Changeset 4851 in orxonox.OLD for orxonox/trunk/src/lib/graphics/spatial_separation
- Timestamp:
- Jul 13, 2005, 9:07:13 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
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 -
orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.h
r4845 r4851 26 26 void separateNode(int treeDepth); 27 27 void separateNode(float minLength); 28 void separateNode(); 28 29 29 30 void drawTree(int depth, int drawMode) const; … … 38 39 float axisLength; //!< axis length of the quadtree 39 40 float maxHeigth; //!< max height of the model in the quadtree 41 float offset; //!< offset of the actual quadtree rectangle 40 42 41 sTriangleExt* triangles; //!< reference to the triangles of the node 43 sTriangleExt** pTriangles; //!< reference to the triangles of the node 44 const float* pVertices; //!< reference to vertices data 42 45 unsigned int numTriangles; //!< number of triangles of the Node 43 46 modelInfo* pModelInfo; //!< reference to the modelInfo of the object 47 Rectangle* pDimension; //!< pointer to the local rectangle properties 44 48 45 49 QuadtreeNode* nodeA; //!< reference to the node A
Note: See TracChangeset
for help on using the changeset viewer.