Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.h @ 4915

Last change on this file since 4915 was 4915, checked in by patrick, 19 years ago

oxonox/trunk: now swapping the coordinates

File size: 1.2 KB
Line 
1/*!
2    \file quadtree.h
3  *  Definition of a spatial data separation using quadtree
4
5*/
6
7#ifndef _QUADTREE_H
8#define _QUADTREE_H
9
10
11#include "base_object.h"
12#include "abstract_model.h"
13
14
15class QuadtreeNode;
16class Material;
17class Vector;
18
19//! A class for quadtree separation of the world
20class Quadtree : public BaseObject {
21
22 public:
23  Quadtree(modelInfo* pModelInfo, const int treeDepth);
24  virtual ~Quadtree();
25
26  QuadtreeNode* getQuadtreeFromPosition(const Vector& position);
27
28  void drawTree(int depth, int drawMode) const;
29  inline Material* getMaterial(int indexNode) const { return this->materials[indexNode % 4]; }
30
31  private:
32    void revertHashTable(QuadtreeNode** nodes);
33
34 private:
35   QuadtreeNode*                   rootNode;              //!< reference to the root node of the quadtree
36   modelInfo*                      pModelInfo;            //!< reference to the modelInfo of the object
37   int                             treeDepth;             //!< depth of the tree
38
39   Material**                      materials;             //!< materials for debug drawing purposes
40
41   QuadtreeNode**                  nodes;                 //!< reference to all quadtree nodes (only leafs of the quad tree)
42};
43
44#endif /* _QUADTREE_H */
Note: See TracBrowser for help on using the repository browser.