Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/trunk: hash table preparation for quadtree nodes lookup

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   QuadtreeNode*                   rootNode;              //!< reference to the root node of the quadtree
33   modelInfo*                      pModelInfo;            //!< reference to the modelInfo of the object
34   int                             treeDepth;             //!< depth of the tree
35
36   Material**                      materials;             //!< materials for debug drawing purposes
37
38   QuadtreeNode**                  nodes;                 //!< reference to all quadtree nodes (only leafs of the quad tree)
39};
40
41#endif /* _QUADTREE_H */
Note: See TracBrowser for help on using the repository browser.