|
Last change
on this file since 4694 was
4682,
checked in by patrick, 20 years ago
|
|
orxonox/trunk: now there is a possibility to render the bvtree through the world entities, the bvtree is a member of the worldentity
|
|
File size:
1.1 KB
|
| Line | |
|---|
| 1 | /*! |
|---|
| 2 | \file obb_tree.h |
|---|
| 3 | \brief 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 "abstract_model.h" |
|---|
| 12 | #include "material.h" |
|---|
| 13 | |
|---|
| 14 | class Material; |
|---|
| 15 | class OBBTreeNode; |
|---|
| 16 | |
|---|
| 17 | //! A class for representing an obb tree |
|---|
| 18 | class OBBTree : public BVTree { |
|---|
| 19 | |
|---|
| 20 | public: |
|---|
| 21 | OBBTree(); |
|---|
| 22 | OBBTree(int depth, sVec3D *verticesList, const int length); |
|---|
| 23 | virtual ~OBBTree(); |
|---|
| 24 | void init(); |
|---|
| 25 | |
|---|
| 26 | virtual void spawnBVTree(int depth, sVec3D *verticesList, const int length); |
|---|
| 27 | virtual void flushTree(); |
|---|
| 28 | |
|---|
| 29 | void collideWith(const OBBTree &tree); |
|---|
| 30 | |
|---|
| 31 | virtual void drawBV(int depth, int drawMode) const; |
|---|
| 32 | |
|---|
| 33 | Material* getMaterial(unsigned int depth) { return material[depth%5]; } |
|---|
| 34 | Material* getTransparentMaterial(unsigned int depth) { return transparentMaterial[depth%5]; } |
|---|
| 35 | int getID() { return ++this->id;} |
|---|
| 36 | |
|---|
| 37 | |
|---|
| 38 | void debug(); |
|---|
| 39 | |
|---|
| 40 | public: |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | private: |
|---|
| 45 | OBBTreeNode* rootNode; //!< reference to the root node of the tree |
|---|
| 46 | Material** material; |
|---|
| 47 | Material** transparentMaterial; |
|---|
| 48 | int id; |
|---|
| 49 | }; |
|---|
| 50 | |
|---|
| 51 | #endif /* _OBB_TREE_H */ |
|---|
Note: See
TracBrowser
for help on using the repository browser.