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