Changeset 4867 in orxonox.OLD for orxonox/trunk/src/lib/graphics/spatial_separation
- Timestamp:
- Jul 14, 2005, 11:26:17 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib/graphics/spatial_separation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.cc
r4859 r4867 26 26 * standard constructor 27 27 */ 28 QuadtreeNode::QuadtreeNode (sTriangleExt* triangles, int numTriangles, Quadtree* quadtree) 29 { 28 QuadtreeNode::QuadtreeNode (sTriangleExt** triangles, int numTriangles, Quadtree* quadtree) 29 { 30 this->pTriangles = triangles; 31 this->numTriangles = numTriangles; 32 this->quadtree = quadtree; 33 30 34 this->init(); 31 35 } … … 58 62 59 63 this->offset = 0.0f; 64 this->nodeA = NULL; 65 this->nodeB = NULL; 66 this->nodeC = NULL; 67 this->nodeD = NULL; 60 68 } 61 69 … … 66 74 QuadtreeNode::~QuadtreeNode () 67 75 { 76 if( this->nodeA != NULL) 77 delete this->nodeA; 78 if( this->nodeB != NULL) 79 delete this->nodeB; 80 if( this->nodeC != NULL) 81 delete this->nodeC; 82 if( this->nodeD != NULL) 83 delete this->nodeD; 68 84 } 69 85 … … 75 91 void QuadtreeNode::separateNode(int treeDepth) 76 92 { 93 if( treeDepth <= 0) 94 return; 77 95 this->separateNode(); 96 97 this->nodeA->separateNode(treeDepth - 1); 98 this->nodeB->separateNode(treeDepth - 1); 99 this->nodeC->separateNode(treeDepth - 1); 100 this->nodeD->separateNode(treeDepth - 1); 78 101 } 79 102 … … 85 108 void QuadtreeNode::separateNode(float minLength) 86 109 { 110 if( minLength <= this->pDimension->getAxis()) 111 return; 87 112 this->separateNode(); 113 114 this->nodeA->separateNode(minLength); 115 this->nodeB->separateNode(minLength); 116 this->nodeC->separateNode(minLength); 117 this->nodeD->separateNode(minLength); 88 118 } 89 119 … … 130 160 sTriangleExt** pTriC; //!< Triangle array C 131 161 sTriangleExt** pTriD; //!< Triangle array D 132 floatlenA; //!< length array A133 floatlenB; //!< length array B134 floatlenC; //!< length array C135 floatlenD; //!< length array D162 int lenA; //!< length array A 163 int lenB; //!< length array B 164 int lenC; //!< length array C 165 int lenD; //!< length array D 136 166 tIterator<sTriangleExt*>* iterator; //!< iterator for the list iterations 137 167 sTriangleExt** tempTri; //!< temp save place for triangle pointer … … 197 227 198 228 /* now propagate */ 199 /*200 229 this->nodeA = new QuadtreeNode(pTriA, lenA, this->quadtree); 201 this->nodeA->separate();202 203 230 this->nodeB = new QuadtreeNode(pTriB, lenB, this->quadtree); 204 this->nodeB->separate();205 206 231 this->nodeC = new QuadtreeNode(pTriC, lenC, this->quadtree); 207 this->nodeC->separate();208 209 232 this->nodeD = new QuadtreeNode(pTriD, lenD, this->quadtree); 210 this->nodeD->separate(); 211 */ 233 212 234 213 235 PRINTF(0)("separation complete\n"); -
orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.h
r4852 r4867 20 20 21 21 public: 22 QuadtreeNode(sTriangleExt* triangles, int numTriangles, Quadtree* quadtree);22 QuadtreeNode(sTriangleExt** triangles, int numTriangles, Quadtree* quadtree); 23 23 QuadtreeNode(modelInfo* pModelInfo); 24 24 virtual ~QuadtreeNode();
Note: See TracChangeset
for help on using the changeset viewer.