Changeset 4614 in orxonox.OLD for orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
- Timestamp:
- Jun 13, 2005, 12:57:53 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
r4613 r4614 64 64 /** 65 65 \brief creates a new BVTree or BVTree partition 66 \param depth: the depth of the tree66 \param depth: how much more depth-steps to go: if == 1 don't go any deeper! 67 67 \param verticesList: the list of vertices of the object - each vertices triple is interpreted as a triangle 68 68 */ 69 69 void OBBTreeNode::spawnBVTree(const int depth, sVec3D *verticesList, const int length) 70 70 { 71 this->bvElement = this->createBox(); 72 this->calculateBoxAttributes(this->bvElement, verticesList, length); 73 this->forkBox(this->bvElement); 71 this->depth = depth; 72 73 if( likely( this->depth > 0)) 74 { 75 this->bvElement = this->createBox(); 76 this->calculateBoxAttributes(this->bvElement, verticesList, length); 77 this->forkBox(this->bvElement); 78 } 74 79 } 75 80 … … 366 371 } 367 372 373 /* now spawn the obb tree: create the nodes and descent */ 374 OBBTreeNode* node1 = new OBBTreeNode(); 375 OBBTreeNode* node2 = new OBBTreeNode(); 376 377 this->nodeLeft = node1; 378 this->nodeRight = node2; 379 380 this->nodeLeft->spawnBVTree(this->depth - 1, vertList1, partition1.getSize()); 381 this->nodeRight->spawnBVTree(this->depth - 1, vertList2, partition2.getSize()); 368 382 } 369 383
Note: See TracChangeset
for help on using the changeset viewer.