Last change
on this file since 4560 was
4560,
checked in by patrick, 19 years ago
|
orxonox/trunk: compiles again, some smaller changes in the cd engine
|
File size:
1.4 KB
|
Rev | Line | |
---|
[4541] | 1 | /*! |
---|
| 2 | \file bv_tree.h |
---|
| 3 | \brief Definition of a bounding volume tree |
---|
| 4 | |
---|
| 5 | */ |
---|
| 6 | |
---|
| 7 | #ifndef _OBB_TREE_NODE_H |
---|
| 8 | #define _OBB_TREE_NODE_H |
---|
| 9 | |
---|
| 10 | #include "bv_tree_node.h" |
---|
| 11 | |
---|
[4550] | 12 | |
---|
| 13 | |
---|
[4541] | 14 | // FORWARD DEFINITION |
---|
| 15 | class BoundingVolume; |
---|
[4557] | 16 | class OBB; |
---|
[4550] | 17 | //struct sVec3D; |
---|
[4541] | 18 | |
---|
| 19 | //! A class that represents a bounding volume tree |
---|
| 20 | class OBBTreeNode : public BVTreeNode { |
---|
| 21 | |
---|
| 22 | |
---|
| 23 | public: |
---|
| 24 | OBBTreeNode(); |
---|
| 25 | virtual ~OBBTreeNode(); |
---|
| 26 | |
---|
[4544] | 27 | virtual void spawnBVTree(const int depth, sVec3D *verticesList, const int length); |
---|
[4541] | 28 | |
---|
[4560] | 29 | BoundingVolume* getBV(int index) const { return (BoundingVolume*)this->bvElement; } |
---|
[4541] | 30 | inline const int getIndex() { return this->treeIndex; } |
---|
| 31 | |
---|
| 32 | virtual void collideWith(const BVTree &tree); |
---|
| 33 | |
---|
| 34 | virtual void drawBV(int currentDepth, const int depth) const; |
---|
| 35 | virtual void drawBVPolygon(int currentDepth, const int depth) const; |
---|
| 36 | virtual void drawBVBlended(int currentDepth, const int depth) const; |
---|
| 37 | |
---|
[4557] | 38 | private: |
---|
| 39 | OBB* createBox(); |
---|
[4560] | 40 | void calculateBoxAttributes(OBB* box, sVec3D* verticesList, int length); |
---|
[4557] | 41 | void forkBox(OBB* box); |
---|
| 42 | |
---|
[4541] | 43 | |
---|
| 44 | protected: |
---|
[4560] | 45 | OBB* bvElement; |
---|
[4541] | 46 | OBBTreeNode* nodeLeft; |
---|
| 47 | OBBTreeNode* nodeRight; |
---|
| 48 | |
---|
| 49 | |
---|
| 50 | private: |
---|
| 51 | unsigned int treeIndex; //!< Index number of the BV in the tree |
---|
[4553] | 52 | sVec3D* vertices; //!< pointer to the vertices data |
---|
| 53 | int numOfVertices; //!< number of vertices in vertices data |
---|
[4541] | 54 | |
---|
| 55 | }; |
---|
| 56 | |
---|
| 57 | #endif /* _OBB_TREE_NODE_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.