Changeset 8490 in orxonox.OLD for trunk/src/lib/collision_detection
- Timestamp:
- Jun 15, 2006, 9:34:48 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/collision_detection/cd_engine.cc
r8316 r8490 20 20 #include "debug.h" 21 21 22 #include "class_list.h" 23 22 24 #include "model.h" 23 25 #include "world_entity.h" … … 30 32 31 33 #include "bsp_manager.h" 34 #include "bsp_entity.h" 32 35 33 36 using namespace std; … … 97 100 void CDEngine::checkCollisionGround(std::list<WorldEntity*>& list1) 98 101 { 99 if( likely( this->terrain != NULL))100 {101 // Quadtree* q = dynamic_cast<Terrain*>(this->terrain)->ssp->getQuadtree();102 // QuadtreeNode* n = q->getQuadtreeFromPosition(this->player->getAbsCoor());103 }104 102 105 if( likely( this->bspManager != NULL)) 106 { 107 std::list<WorldEntity*>::iterator iterator; 108 PRINTF(3)("checking for collisions\n"); 103 std::list<BaseObject*>::const_iterator bspIterator; 104 std::list<WorldEntity*>::iterator entityIterator; 105 const std::list<BaseObject*>* bspList = ClassList::getList(CL_BSP_ENTITY); 106 if( bspList == NULL) 107 return; 109 108 110 iterator = list1.begin(); 111 while (iterator != list1.end()) 112 { 113 bspManager->checkCollision(*iterator); 114 iterator++; 115 } 109 // for all bsp managers check all entities 110 for( bspIterator = bspList->begin(); bspIterator != bspList->end(); bspIterator++) { 111 for(entityIterator = list1.begin(); entityIterator != list1.end(); entityIterator++) 112 { 113 // PRINTF(0)("Checking: %s a %s\n", (*entityIterator)->getName(), (*entityIterator)->getClassName()); 114 (dynamic_cast<BspEntity*>(*bspIterator)->getBspManager())->checkCollision(*entityIterator); 115 } 116 116 } 117 117 } … … 128 128 PRINT(0)("= CDEngine: Spawning Tree: Finished\n"); 129 129 PRINT(0)("=======================================================\n"); 130 131 130 } 132 131 … … 149 148 } 150 149 150 151 151 /** 152 152 * this draws the debug spawn tree
Note: See TracChangeset
for help on using the changeset viewer.