Changeset 7969 in orxonox.OLD for branches/cr/src/world_entities
- Timestamp:
- May 30, 2006, 1:33:09 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/cr/src/world_entities/world_entity.cc
r7958 r7969 33 33 34 34 #include "collision_handle.h" 35 #include "collision .h"35 #include "collision_event.h" 36 36 37 37 #include <stdarg.h> … … 73 73 for(int i = 0; i < CREngine::CR_NUMBER; ++i) 74 74 this->collisionHandles[i] = NULL; 75 this->bReactive = false; 75 76 76 77 this->toList(OM_NULL); … … 280 281 this->collisionHandles[type] = NULL; 281 282 282 // 283 // check if there is still any handler registered 284 for(int i = 0; i < CREngine::CR_NUMBER; ++i) 285 { 286 if( this->collisionHandles[i] != NULL) 287 { 288 this->bReactive = true; 289 return; 290 } 291 } 292 this->bReactive = false; 283 293 } 284 294 … … 292 302 this->unsubscribeReaction((CREngine::CRType)i); 293 303 304 // there are no reactions subscribed from now on 294 305 this->bReactive = false; 295 306 } … … 302 313 bool WorldEntity::registerCollision(WorldEntity* entityA, WorldEntity* entityB, BoundingVolume* bvA, BoundingVolume* bvB) 303 314 { 315 // is there any handler listening? 316 if( !this->bReactive) 317 return false; 318 304 319 PRINTF(0)("Registering Collision: %s vs %s \n", entityA->getClassName(), entityB->getClassName()); 305 320 // create a collision event 306 Collision * c = CREngine::getInstance()->popCollisionObject();321 CollisionEvent* c = CREngine::getInstance()->popCollisionEventObject(); 307 322 assert(c != NULL); 308 323 c->collide(entityA, entityB, bvA, bvB); … … 310 325 for(int i = 0; i < CREngine::CR_NUMBER; ++i) 311 326 if( this->collisionHandles[i] != NULL) 312 this->collisionHandles[i]->registerCollision (c);327 this->collisionHandles[i]->registerCollisionEvent(c); 313 328 } 314 329
Note: See TracChangeset
for help on using the changeset viewer.