Changeset 10355 in orxonox.OLD for branches/ODE/src/lib/collision_detection/cd_engine.cc
- Timestamp:
- Jan 24, 2007, 8:48:26 PM (18 years ago)
- Location:
- branches/ODE
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/ODE/src/lib/collision_detection/cd_engine.cc
r10033 r10355 68 68 void CDEngine::checkCollisions(ObjectManager::EntityList& list1, ObjectManager::EntityList& list2) 69 69 { 70 71 70 72 BVTree* tree; 71 73 ObjectManager::EntityList::iterator entity1, entity2, pre1, pre2; … … 84 86 if( likely((*entity2) != this->terrain)) 85 87 { 88 86 89 PRINTF(5)("checking object %s (%s) against %s (%s)\n", 87 (*entity1)->getClassCName(), (*entity1)->getCName(), (*entity2)->getClassCName(), (*entity2)->getCName()); 90 (*entity1)->getClassCName(), (*entity1)->getCName(), (*entity2)->getClassCName(), (*entity2)->getCName()); 91 #ifndef WITH_ODE 88 92 tree = (*entity1)->getOBBTree(); 89 93 if( likely(tree != NULL) && (*entity2)->getOBBTree() != NULL) 90 tree->collideWith(*entity1, *entity2); 94 tree->collideWith(*entity1, *entity2); 95 #endif 96 (*entity1)->checkCollision(*entity2); 97 98 91 99 } 92 100 } … … 102 110 { 103 111 std::list<WorldEntity*>::iterator entityIterator; 112 113 for( ObjectList<Terrain>::const_iterator bspIterator = Terrain::objectList().begin(); 114 bspIterator != Terrain::objectList().end(); 115 bspIterator++) { 116 for(entityIterator = list1.begin(); entityIterator != list1.end(); entityIterator++) 117 { 118 PRINTF(5)("Checking %s against: %s\n", ((dynamic_cast<Terrain*>(*bspIterator)))->getCName(), (*entityIterator)->getClassCName()); 119 (dynamic_cast<Terrain*>(*bspIterator))->checkCollision(*entityIterator); 120 } 121 } 122 104 123 // for all bsp managers check all entities 105 124 for( ObjectList<BspEntity>::const_iterator bspIterator = BspEntity::objectList().begin(); … … 108 127 for(entityIterator = list1.begin(); entityIterator != list1.end(); entityIterator++) 109 128 { 110 // PRINTF(0)("Checking: %s a %s\n", (*entityIterator)->getName(), (*entityIterator)->getClassCName());129 // PRINTF(0)("Checking: %s a %s\n", (*entityIterator)->getCName(), (*entityIterator)->getClassCName()); 111 130 (dynamic_cast<BspEntity*>(*bspIterator)->getBspManager())->checkCollision(*entityIterator); 112 131 } 132 113 133 } 134 114 135 } 115 136
Note: See TracChangeset
for help on using the changeset viewer.