Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 29, 2006, 12:48:21 AM (18 years ago)
Author:
patrick
Message:

cr: collision objects handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/cr/src/world_entities/world_entity.cc

    r7944 r7945  
    3333
    3434#include "collision_handle.h"
     35#include "collision.h"
    3536
    3637#include <stdarg.h>
     
    6869  this->objectListNumber = OM_INIT;
    6970  this->objectListIterator = NULL;
     71
     72  // reset all collision handles to NULL == unsubscribed state
     73  for(int i = 0; i < CREngine::CR_NUMBER; ++i)
     74    this->collisionHandles[i] = NULL;
    7075
    7176  this->toList(OM_NULL);
     
    242247void WorldEntity::subscribeReaction(CREngine::CRType type, int nrOfTargets, long target...)
    243248{
     249  if( this->collisionHandles[type] != NULL)  {
     250    PRINTF(2)("Registering for a CollisionReaction already subscribed to! Skipping\n");
     251    return;
     252  }
    244253
    245254  this->collisionHandles[type] = CREngine::getInstance()->subscribeReaction(this, type);
     
    257266 *  @param collisionEvent the event
    258267 */
    259 void WorldEntity::registerCollision(WorldEntity* entityA, WorldEntity* entityB, BouningVolume* bvA, BoundingVolume* bvB)
     268bool WorldEntity::registerCollision(WorldEntity* entityA, WorldEntity* entityB, BoundingVolume* bvA, BoundingVolume* bvB)
    260269{
    261270  // create a collision event
Note: See TracChangeset for help on using the changeset viewer.