Last change
on this file since 4581 was
4568,
checked in by patrick, 19 years ago
|
orxonox/trunk: moved the newmat source to lib
|
File size:
1.4 KB
|
Line | |
---|
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 | |
---|
12 | |
---|
13 | |
---|
14 | // FORWARD DEFINITION |
---|
15 | class BoundingVolume; |
---|
16 | class OBB; |
---|
17 | //struct sVec3D; |
---|
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 | |
---|
27 | virtual void spawnBVTree(const int depth, sVec3D *verticesList, const int length); |
---|
28 | |
---|
29 | BoundingVolume* getBV(int index) const { return (BoundingVolume*)this->bvElement; } |
---|
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 | |
---|
38 | void debug(); |
---|
39 | |
---|
40 | private: |
---|
41 | OBB* createBox(); |
---|
42 | void calculateBoxAttributes(OBB* box, sVec3D* verticesList, int length); |
---|
43 | void forkBox(OBB* box); |
---|
44 | |
---|
45 | |
---|
46 | protected: |
---|
47 | OBB* bvElement; |
---|
48 | OBBTreeNode* nodeLeft; |
---|
49 | OBBTreeNode* nodeRight; |
---|
50 | |
---|
51 | |
---|
52 | private: |
---|
53 | unsigned int treeIndex; //!< Index number of the BV in the tree |
---|
54 | sVec3D* vertices; //!< pointer to the vertices data |
---|
55 | int numOfVertices; //!< number of vertices in vertices data |
---|
56 | |
---|
57 | }; |
---|
58 | |
---|
59 | #endif /* _OBB_TREE_NODE_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.