Changeset 9889 in orxonox.OLD for branches/coll_rect/src/world_entities/world_entity.cc
- Timestamp:
- Oct 13, 2006, 3:57:44 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/coll_rect/src/world_entities/world_entity.cc
r9869 r9889 78 78 79 79 // reset all collision handles to NULL == unsubscribed state 80 for(int i = 0; i < C REngine::CR_NUMBER; ++i)80 for(int i = 0; i < CoRe::CREngine::CR_NUMBER; ++i) 81 81 this->collisionHandles[i] = NULL; 82 82 this->bReactive = false; … … 84 84 85 85 // registering default reactions: 86 this->subscribeReaction(C REngine::CR_OBJECT_DAMAGE, /* WorldEntity::staticClassID(), */ Projectile::staticClassID());86 this->subscribeReaction(CoRe::CREngine::CR_OBJECT_DAMAGE, /* WorldEntity::staticClassID(), */ Projectile::staticClassID()); 87 87 88 88 this->toList(OM_NULL); … … 302 302 * @param target1 a filter target (classID) 303 303 */ 304 void WorldEntity::subscribeReaction(C REngine::CRType type, const ClassID& target1)304 void WorldEntity::subscribeReaction(CoRe::CREngine::CRType type, const ClassID& target1) 305 305 { 306 306 this->subscribeReaction(type); … … 316 316 * @param target1 a filter target (classID) 317 317 */ 318 void WorldEntity::subscribeReaction(C REngine::CRType type, const ClassID& target1, const ClassID& target2)318 void WorldEntity::subscribeReaction(CoRe::CREngine::CRType type, const ClassID& target1, const ClassID& target2) 319 319 { 320 320 this->subscribeReaction(type); … … 331 331 * @param target1 a filter target (classID) 332 332 */ 333 void WorldEntity::subscribeReaction(C REngine::CRType type, const ClassID& target1, const ClassID& target2, const ClassID& target3)333 void WorldEntity::subscribeReaction(CoRe::CREngine::CRType type, const ClassID& target1, const ClassID& target2, const ClassID& target3) 334 334 { 335 335 this->subscribeReaction(type); … … 342 342 343 343 344 /**345 * subscribes this world entity to a collision reaction346 * @param type the type of reaction to subscribe to347 * @param target1 a filter target (classID)348 */349 void WorldEntity::subscribeReaction(CREngine::CRType type, const ClassID& target1, const ClassID& target2, const ClassID& target3, const ClassID& target4)350 {351 this->subscribeReaction(type);352 353 // add the target filter354 this->collisionHandles[type]->addTarget(target1);355 this->collisionHandles[type]->addTarget(target2);356 this->collisionHandles[type]->addTarget(target3);357 this->collisionHandles[type]->addTarget(target4);358 }359 360 344 361 345 /** … … 365 349 * @param ... the targets as classIDs 366 350 */ 367 void WorldEntity::subscribeReaction(C REngine::CRType type)351 void WorldEntity::subscribeReaction(CoRe::CREngine::CRType type) 368 352 { 369 353 if( this->collisionHandles[type] != NULL) … … 373 357 } 374 358 375 this->collisionHandles[type] = C REngine::getInstance()->subscribeReaction(this, type);359 this->collisionHandles[type] = CoRe::CREngine::getInstance()->subscribeReaction(this, type); 376 360 377 361 // now there is at least one collision reaction subscribed … … 384 368 * @param type the reaction to unsubscribe 385 369 */ 386 void WorldEntity::unsubscribeReaction(C REngine::CRType type)370 void WorldEntity::unsubscribeReaction(CoRe::CREngine::CRType type) 387 371 { 388 372 if( this->collisionHandles[type] == NULL) 389 373 return; 390 374 391 C REngine::getInstance()->unsubscribeReaction(this->collisionHandles[type]);375 CoRe::CREngine::getInstance()->unsubscribeReaction(this->collisionHandles[type]); 392 376 this->collisionHandles[type] = NULL; 393 377 394 378 // check if there is still any handler registered 395 for(int i = 0; i < C REngine::CR_NUMBER; ++i)379 for(int i = 0; i < CoRe::CREngine::CR_NUMBER; ++i) 396 380 { 397 381 if( this->collisionHandles[i] != NULL) … … 410 394 void WorldEntity::unsubscribeReaction() 411 395 { 412 for( int i = 0; i < C REngine::CR_NUMBER; i++)413 this->unsubscribeReaction((C REngine::CRType)i);396 for( int i = 0; i < CoRe::CREngine::CR_NUMBER; i++) 397 this->unsubscribeReaction((CoRe::CREngine::CRType)i); 414 398 415 399 // there are no reactions subscribed from now on … … 433 417 434 418 // get a collision event 435 Co llisionEvent* c =CREngine::getInstance()->popCollisionEventObject();419 CoRe::CollisionEvent* c = CoRe::CREngine::getInstance()->popCollisionEventObject(); 436 420 assert(c != NULL); // if this should fail: we got not enough precached CollisionEvents: alter value in cr_defs.h 437 421 c->collide(COLLISION_TYPE_OBB, entityA, entityB, bvA, bvB); 438 422 439 for( int i = 0; i < C REngine::CR_NUMBER; ++i)423 for( int i = 0; i < CoRe::CREngine::CR_NUMBER; ++i) 440 424 if( this->collisionHandles[i] != NULL) 441 425 this->collisionHandles[i]->registerCollisionEvent(c); … … 457 441 458 442 // get a collision event 459 Co llisionEvent* c =CREngine::getInstance()->popCollisionEventObject();443 CoRe::CollisionEvent* c = CoRe::CREngine::getInstance()->popCollisionEventObject(); 460 444 assert(c != NULL); // if this should fail: we got not enough precached CollisionEvents: alter value in cr_defs.h 461 445 c->collide(type, entity, groundEntity, normal, position, bInWall); 462 446 463 for( int i = 0; i < C REngine::CR_NUMBER; ++i)447 for( int i = 0; i < CoRe::CREngine::CR_NUMBER; ++i) 464 448 if( this->collisionHandles[i] != NULL) 465 449 this->collisionHandles[i]->registerCollisionEvent(c);
Note: See TracChangeset
for help on using the changeset viewer.