Changeset 4851 in orxonox.OLD for orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.cc
- Timestamp:
- Jul 13, 2005, 9:07:13 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.cc
r4846 r4851 17 17 18 18 #include "quadtree_node.h" 19 #include "list.h" 20 #include "vector.h" 19 21 20 22 using namespace std; … … 36 38 { 37 39 this->pModelInfo = pModelInfo; 38 this->getDimension(this->pModelInfo); 40 this->pDimension = this->getDimension(this->pModelInfo); 41 42 /* create an array of triangle references */ 43 this->pTriangles = new sTriangleExt*[this->pModelInfo->numTriangles]; 44 this->numTriangles = this->pModelInfo->numTriangles; 45 this->pVertices = this->pModelInfo->pVertices; 46 for( int i = 0; i < this->pModelInfo->numTriangles; ++i) 47 this->pTriangles[i] = &this->pModelInfo->pTriangles[i]; 48 39 49 } 40 50 41 51 42 52 /** 43 53 * standard deconstructor … … 63 73 void QuadtreeNode::separateNode(float minLength) 64 74 {} 75 76 77 /** 78 * gives the signal to separate the model into a quadtree 79 * @param treeDepth the max depth, the steps to go if treeDept == 0 leaf reached 80 */ 81 void QuadtreeNode::separateNode() 82 { 83 tList<sTriangleExt*>* listA = new tList<sTriangleExt*>(); //!< triangle list of nodeA 84 tList<sTriangleExt*>* listB = new tList<sTriangleExt*>(); //!< triangle list of nodeB 85 tList<sTriangleExt*>* listC = new tList<sTriangleExt*>(); //!< triangle list of nodeC 86 tList<sTriangleExt*>* listD = new tList<sTriangleExt*>(); //!< triangle list of nodeD 87 const float* pVert; //!< pointer to the vertices 88 const Vector* rectCenter; //!< vector to the center of the rect 89 90 rectCenter = this->pDimension->getCenter(); 91 for( int i = 0; i < this->numTriangles; ++i) 92 { 93 for( int j = 0; j < 3; ++j) 94 { 95 pVert = &this->pVertices[this->pTriangles[i]->indexToVertices[j]]; 96 if( pVert[0] > rectCenter->x + this->offset && pVert[2] > rectCenter->z + this->offset) 97 printf(""); 98 99 } 100 } 101 } 65 102 66 103
Note: See TracChangeset
for help on using the changeset viewer.