Changeset 4924 in orxonox.OLD for orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.h
- Timestamp:
- Jul 21, 2005, 4:46:41 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.h
r4922 r4924 1 1 /*! 2 2 \file quadtree.h 3 3 * Definition of a spatial data separation using quadtree 4 4 5 */ 5 This is the top element of the quadtree framework. A Quadtree is build of QuadtreeNodes, which are again separated 6 into QuadtreeNodes until a certain depth is reached 7 */ 6 8 7 9 #ifndef _QUADTREE_H … … 20 22 class Quadtree : public BaseObject { 21 23 22 public:23 Quadtree(modelInfo* pModelInfo, const int treeDepth);24 virtual ~Quadtree();25 24 26 QuadtreeNode* getQuadtreeFromPosition(const Vector& position); 25 public: 26 Quadtree(modelInfo* pModelInfo, const int treeDepth); 27 virtual ~Quadtree(); 27 28 28 void drawTree() const; 29 inline Material* getMaterial(int indexNode) const { return this->materials[indexNode % 4]; } 29 QuadtreeNode* getQuadtreeFromPosition(const Vector& position); 30 31 void drawTree() const; 32 inline Material* getMaterial(int indexNode) const { return this->materials[indexNode % 4]; } 33 30 34 31 35 private: … … 33 37 void sortHashTable(QuadtreeNode** nodes); 34 38 35 private:36 QuadtreeNode* rootNode; //!< reference to the root node of the quadtree37 modelInfo* pModelInfo; //!< reference to the modelInfo of the object38 int treeDepth; //!< depth of the tree39 39 40 float quadLength; //!< length of the leaf quadtree nodes 41 Vector* offset; //!< vector to the left lower corner of the root quadtree node 42 int maxIndex; //!< maximal index for the nodes array 40 private: 41 QuadtreeNode* rootNode; //!< reference to the root node of the quadtree 42 QuadtreeNode** nodes; //!< reference to all quadtree nodes (only leafs of the quad tree) 43 modelInfo* pModelInfo; //!< reference to the modelInfo of the object 44 int treeDepth; //!< depth of the tree 43 45 44 Material** materials; //!< materials for debug drawing purposes 46 float quadLength; //!< length of the leaf quadtree nodes 47 Vector* offset; //!< vector to the left lower corner of the root quadtree node 48 int maxIndex; //!< maximal index for the nodes array 45 49 46 QuadtreeNode** nodes; //!< reference to all quadtree nodes (only leafs of the quad tree)50 Material** materials; //!< materials for debug drawing purposes 47 51 }; 48 52
Note: See TracChangeset
for help on using the changeset viewer.