source:
orxonox.OLD/trunk/src/lib/collision_detection/obb_tree.h
@
7899
Last change on this file since 7899 was 7711, checked in by patrick, 19 years ago | |
---|---|
File size: 1.4 KB |
Rev | Line | |
---|---|---|
[4616] | 1 | /*! |
[5039] | 2 | * @file obb_tree.h |
[4836] | 3 | * Definition of an obb tree (object oriented Bounding Box) |
[4510] | 4 | |
5 | */ | |
6 | ||
[4511] | 7 | #ifndef _OBB_TREE_H |
8 | #define _OBB_TREE_H | |
[4510] | 9 | |
[4514] | 10 | #include "bv_tree.h" |
[6022] | 11 | #include "model.h" |
[4616] | 12 | #include "material.h" |
[4510] | 13 | |
[4616] | 14 | class Material; |
[4550] | 15 | class OBBTreeNode; |
[4700] | 16 | class PNode; |
[7711] | 17 | class WorldEntity; |
[4550] | 18 | |
[4511] | 19 | //! A class for representing an obb tree |
[7711] | 20 | class OBBTree : public BVTree |
21 | { | |
[4510] | 22 | |
[4616] | 23 | public: |
[7711] | 24 | OBBTree(int depth, const modelInfo* modInfo, WorldEntity* entity); |
[4616] | 25 | virtual ~OBBTree(); |
[4682] | 26 | void init(); |
[4510] | 27 | |
[7711] | 28 | virtual void spawnBVTree(const modelInfo& modelInf); |
[4616] | 29 | virtual void flushTree(); |
[4510] | 30 | |
[5026] | 31 | virtual void collideWith(WorldEntity* entity1, WorldEntity* entity2); |
[4635] | 32 | virtual void drawBV(int depth, int drawMode) const; |
[4528] | 33 | |
[7711] | 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; } | |
[4622] | 39 | |
[4616] | 40 | void debug(); |
[4546] | 41 | |
[4616] | 42 | private: |
43 | OBBTreeNode* rootNode; //!< reference to the root node of the tree | |
[7711] | 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 | |
[4510] | 47 | }; |
48 | ||
[4511] | 49 | #endif /* _OBB_TREE_H */ |
Note: See TracBrowser
for help on using the repository browser.