Changeset 4551 in orxonox.OLD for orxonox/trunk/src/lib/collision_detection
- Timestamp:
- Jun 8, 2005, 10:59:50 AM (19 years ago)
- Location:
- orxonox/trunk/src/lib/collision_detection
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/collision_detection/cd_engine.cc
r4546 r4551 30 30 this->setClassName("CDEngine"); 31 31 this->setClassID(CL_CD_ENGINE, "CDEngine"); 32 33 /* testing purposes only: */ 34 this->rootTree = new OBBTree(); 32 35 } 33 36 … … 48 51 49 52 53 54 void CDEngine::drawBV(int currentDepth, const int depth) const 55 { 56 /* this would operate on worldList bases, for testing purposes, we only use one OBBTree */ 57 this->rootTree->drawBV(currentDepth, depth); 58 } 59 60 61 void CDEngine::drawBVPolygon(int currentDepth, const int depth) const 62 {} 63 64 65 void CDEngine::drawBVBlended(int currentDepth, const int depth) const 66 {} 67 68 69 50 70 void CDEngine::debug() 51 71 { 52 72 PRINT(0)("\n=============================| CDEngine::debug() |===\n"); 53 73 PRINT(0)("= CDEngine: Spawning Tree Start\n"); 54 74 this->rootTree->debug(); 55 75 PRINT(0)("= CDEngine: Spawning Tree: Finished\n"); 56 76 PRINT(0)("=======================================================\n"); -
orxonox/trunk/src/lib/collision_detection/cd_engine.h
r4546 r4551 13 13 template<class T> class tList; 14 14 class WorldEntity; 15 class OBBTree; 15 16 16 17 … … 63 64 int state; //!< the current state of the cd engine 64 65 tList<WorldEntity>* entityList; //!< pointer to the world entity list 66 OBBTree* rootTree; //!< for testing purposes a root tree 65 67 }; 66 68 -
orxonox/trunk/src/lib/collision_detection/obb_tree.cc
r4550 r4551 45 45 46 46 47 void OBBTree::spawnBVTree(int depth )47 void OBBTree::spawnBVTree(int depth, sVec3D *verticesList, const int length) 48 48 { 49 49 if( unlikely(this->rootNode != NULL)) 50 { 51 PRINTF(2)("The BVTree has already been spawned, flushing and respawning again...\n"); 52 this->flushTree(); 53 } 54 OBBTreeNode* node = new OBBTreeNode(); 55 this->rootNode = node; 56 this->rootNode->spawnBVTree(depth, verticesList, length); 50 57 } 51 58 … … 84 91 PRINT(0)("\n==============================| OBBTree::debug() |===\n"); 85 92 PRINT(0)("= Spawning Tree: Start\n"); 86 this->spawnBVTree(1); 93 94 /* generate some test vertices */ 95 sVec3D vertList[] = {{1.0, 3.0, 4.0},{3.5, 6.2, 9.6},{6.4, 9.0, 2.0}}; 96 97 this->spawnBVTree(1, vertList, 3); 98 87 99 PRINT(0)("= Spawning Tree: Finished\n"); 88 100 PRINT(0)("=======================================================\n"); -
orxonox/trunk/src/lib/collision_detection/obb_tree.h
r4550 r4551 9 9 10 10 #include "bv_tree.h" 11 11 #include "abstract_model.h" 12 12 13 13 class OBBTreeNode; … … 20 20 virtual ~OBBTree(); 21 21 22 virtual void spawnBVTree(int depth );22 virtual void spawnBVTree(int depth, sVec3D *verticesList, const int length); 23 23 virtual void flushTree(); 24 24 -
orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
r4550 r4551 103 103 } 104 104 } 105 106 printf("Covariance Matrix:\n"); 107 for(int j = 0; j < 3; ++j) 108 { 109 printf(" |"); 110 for(int k = 0; k < 3; ++k) 111 { 112 printf(" \b%f ", covariance[j][k]); 113 } 114 printf(" |\n"); 115 } 105 116 } 106 117
Note: See TracChangeset
for help on using the changeset viewer.