Changeset 4689 in orxonox.OLD for orxonox/trunk/src/lib/collision_detection
- Timestamp:
- Jun 24, 2005, 3:06:04 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/collision_detection/cd_engine.cc
r4688 r4689 20 20 #include "debug.h" 21 21 #include "abstract_model.h" 22 #include "world_entity.h" 23 #include "list.h" 22 24 23 25 using namespace std; … … 33 35 34 36 /* testing purposes only: */ 35 this->rootTree = new OBBTree();37 //this->rootTree = new OBBTree(); 36 38 } 37 39 … … 54 56 void CDEngine::checkCollisions() 55 57 { 58 tIterator<WorldEntity>* iterator1 = entityList->getIterator(); 59 tIterator<WorldEntity>* iterator2 = entityList->getIterator(); 60 WorldEntity* entity1 = iterator1->nextElement(); 61 WorldEntity* entity2 = iterator2->nextElement(); 62 while( entity1 != NULL) 63 { 64 while( entity2 != NULL && entity1 != entity2) 65 { 66 entity1->collideWith(entity2); 67 entity2 = iterator2->nextElement(); 68 } 69 entity1 = iterator1->nextElement(); 70 } 71 delete iterator1; 72 delete iterator2; 73 56 74 57 75 } … … 70 88 { 71 89 /* this would operate on worldList bases, for testing purposes, we only use one OBBTree */ 72 this->rootTree->drawBV(depth, drawMode); 90 //this->rootTree->drawBV(depth, drawMode); 91 92 tIterator<WorldEntity>* iterator = entityList->getIterator(); 93 WorldEntity* entity = iterator->nextElement(); 94 while( entity != NULL) 95 { 96 entity->drawBVTree(depth, drawMode); 97 entity = iterator->nextElement(); 98 } 99 delete iterator; 100 //model->draw(); 73 101 } 74 102 … … 81 109 PRINT(0)("\n=============================| CDEngine::debug() |===\n"); 82 110 PRINT(0)("= CDEngine: Spawning Tree Start\n"); 83 this->rootTree->debug();111 //this->rootTree->debug(); 84 112 PRINT(0)("= CDEngine: Spawning Tree: Finished\n"); 85 113 PRINT(0)("=======================================================\n"); … … 89 117 void CDEngine::debugSpawnTree(int depth, sVec3D* vertices, int numVertices) 90 118 { 119 if ( this->rootTree == NULL) 120 this->rootTree = new OBBTree(); 91 121 this->rootTree->spawnBVTree(depth, vertices, numVertices); 92 122 }
Note: See TracChangeset
for help on using the changeset viewer.