Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/terrain.old/src/lib/collision_detection/obb_tree.h @ 9777

Last change on this file since 9777 was 7711, checked in by patrick, 18 years ago

trunk: merged the cd branche back to trunk

File size: 1.4 KB
Line 
1/*!
2 * @file obb_tree.h
3  *  Definition of an obb tree (object oriented Bounding Box)
4
5*/
6
7#ifndef _OBB_TREE_H
8#define _OBB_TREE_H
9
10#include "bv_tree.h"
11#include "model.h"
12#include "material.h"
13
14class Material;
15class OBBTreeNode;
16class PNode;
17class WorldEntity;
18
19//! A class for representing an obb tree
20class OBBTree : public BVTree
21{
22
23  public:
24    OBBTree(int depth, const modelInfo* modInfo, WorldEntity* entity);
25    virtual ~OBBTree();
26    void init();
27
28    virtual void spawnBVTree(const modelInfo& modelInf);
29    virtual void flushTree();
30
31    virtual void collideWith(WorldEntity* entity1, WorldEntity* entity2);
32    virtual void drawBV(int depth, int drawMode) const;
33
34    /** returns the next if for the obb tree node @return integer id number of the next node */
35    inline const int getID() { return ++this->id;}
36    /** returns the root node of the bounding volume tree @return reference to the root node */
37    inline OBBTreeNode* getRootNode() const { return this->rootNode; }
38    inline WorldEntity* getOwner() const { return this->owner; }
39
40    void debug();
41
42  private:
43    OBBTreeNode*         rootNode;                        //!< reference to the root node of the tree
44    int                  id;                              //!< the next id of a obb tree node
45    int                  depth;                           //!< the depth of the tree to generate
46    WorldEntity*         owner;                           //!< owner
47};
48
49#endif /* _OBB_TREE_H */
Note: See TracBrowser for help on using the repository browser.