Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7946 in orxonox.OLD for branches/cr/src/world_entities


Ignore:
Timestamp:
May 29, 2006, 1:04:39 AM (18 years ago)
Author:
patrick
Message:

cr: more cr cleanup

Location:
branches/cr/src/world_entities
Files:
2 edited

Legend:

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

    r7945 r7946  
    9494  if (this->healthWidget != NULL)
    9595    delete this->healthWidget;
     96
     97  this->unsubscribeReaction();
    9698}
    9799
     
    263265
    264266/**
     267 * unsubscribes a specific reaction from the worldentity
     268 *  @param type the reaction to unsubscribe
     269 */
     270void WorldEntity::unsubscribeReaction(CREngine::CRType type)
     271{
     272  if( this->collisionHandles[type] == NULL)
     273    return;
     274
     275  CREngine::getInstance()->unsubscribeReaction(this->collisionHandles[type]);
     276  this->collisionHandles[type] = NULL;
     277}
     278
     279
     280/**
     281 * unsubscribes all collision reactions
     282 */
     283void WorldEntity::unsubscribeReaction()
     284{
     285  for( int i = 0; i < CREngine::CR_NUMBER; i++)
     286    this->unsubscribeReaction((CREngine::CRType)i);
     287}
     288
     289
     290/**
    265291 * registers a new collision to this world entity
    266292 *  @param collisionEvent the event
  • branches/cr/src/world_entities/world_entity.h

    r7945 r7946  
    7171  /* --- Collision Reaction Block --- */
    7272  void subscribeReaction(CREngine::CRType type, int nrOfTargets, long target, ...);
     73  void unsubscribeReaction(CREngine::CRType type);
     74  void unsubscribeReaction();
    7375  bool registerCollision(WorldEntity* entityA, WorldEntity* entityB, BoundingVolume* bvA, BoundingVolume* bvB);
    7476
Note: See TracChangeset for help on using the changeset viewer.