Changeset 4907 in orxonox.OLD for orxonox/trunk/src
- Timestamp:
- Jul 20, 2005, 9:33:10 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/collision_detection/cd_engine.cc
r4904 r4907 81 81 entity1->collideWith(entity2); 82 82 entity2 = iterator2->nextElement(); 83 84 83 } 85 84 entity1 = iterator1->nextElement(); -
orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.cc
r4902 r4907 33 33 this->treeDepth = treeDepth; 34 34 35 /* initialize the materials for debug draw */ 35 36 this->materials = new Material*[4]; 36 37 for(int i = 0; i < 4; ++i) … … 44 45 materials[3]->setAmbient(5.0, 3.0, 1.0); 45 46 47 /* build the tree */ 48 this->rootNode = new QuadtreeNode(this->pModelInfo, this, this->treeDepth); 46 49 47 this->rootNode = new QuadtreeNode(this->pModelInfo, this, this->treeDepth); 50 /* make an array with access to the leafs of the Quad-Tree */ 51 this->nodes = new QuadtreeNode*[(int)pow(4, treeDepth)]; 48 52 } 49 53 … … 56 60 { 57 61 // delete what has to be deleted here 62 delete [] this->nodes; 63 delete this->rootNode; 58 64 } 59 65 -
orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.h
r4904 r4907 35 35 36 36 Material** materials; //!< materials for debug drawing purposes 37 38 QuadtreeNode** nodes; //!< reference to all quadtree nodes (only leafs of the quad tree) 37 39 }; 38 40 -
orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.cc
r4902 r4907 107 107 this->nodeC = NULL; 108 108 this->nodeD = NULL; 109 this->nodes = new QuadtreeNode*[4]; 109 110 110 111 if( this->treeDepth < this->maxDepth) … … 279 280 280 281 this->nodeD = new QuadtreeNode(pTriD, lenD, this->pVertices, this->numVertices, this->quadtree, this, rD, this->treeDepth + 1, this->maxDepth, (this->treeDepth + 1) * 10 + 3); 282 /* map the array references, this is for faster and automatical interfacing \todo: use only array */ 283 this->nodes[0] = this->nodeA; 284 this->nodes[1] = this->nodeB; 285 this->nodes[2] = this->nodeC; 286 this->nodes[3] = this->nodeD; 281 287 } 282 288 -
orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.h
r4904 r4907 46 46 QuadtreeNode* nodeC; //!< reference to the node C 47 47 QuadtreeNode* nodeD; //!< reference to the node D 48 QuadtreeNode** nodes; //!< reference to the quadtree nodes 49 48 50 49 51 private:
Note: See TracChangeset
for help on using the changeset viewer.