| Line |  | 
|---|
| 1 | /*! | 
|---|
| 2 | * @file bv_tree.h | 
|---|
| 3 | *  Definition of a bounding volume tree | 
|---|
| 4 |  | 
|---|
| 5 | */ | 
|---|
| 6 |  | 
|---|
| 7 | #ifndef _BV_TREE_NODE_H | 
|---|
| 8 | #define _BV_TREE_NODE_H | 
|---|
| 9 |  | 
|---|
| 10 |  | 
|---|
| 11 | #include "base_object.h" | 
|---|
| 12 | #include "model.h" | 
|---|
| 13 | #include "vector.h" | 
|---|
| 14 |  | 
|---|
| 15 |  | 
|---|
| 16 | // forward declarations | 
|---|
| 17 | class BoundingVolume; | 
|---|
| 18 | class BVTree; | 
|---|
| 19 | class PNode; | 
|---|
| 20 | class WorldEntity; | 
|---|
| 21 | template<class T> class tList; | 
|---|
| 22 |  | 
|---|
| 23 |  | 
|---|
| 24 | //! A class that represents a bounding volume tree | 
|---|
| 25 | class BVTreeNode : public BaseObject { | 
|---|
| 26 | ObjectListDeclaration(BVTreeNode); | 
|---|
| 27 |  | 
|---|
| 28 |  | 
|---|
| 29 | public: | 
|---|
| 30 | BVTreeNode(); | 
|---|
| 31 | virtual ~BVTreeNode(); | 
|---|
| 32 |  | 
|---|
| 33 | virtual const BoundingVolume* getBV() const = 0; | 
|---|
| 34 | /** returns the index of this bounding volume tree node @returns index of this index */ | 
|---|
| 35 | inline const int getIndex() const { return this->treeIndex; } | 
|---|
| 36 |  | 
|---|
| 37 | virtual void spawnBVTree(const modelInfo& modInfo, const int* triangleIndexes, int length) = 0; | 
|---|
| 38 | virtual void collideWith(BVTreeNode* treeNode, WorldEntity* nodeA, WorldEntity* nodeB) = 0; | 
|---|
| 39 | virtual void drawBV(int depth, int drawMode, const Vector& color = Vector(1,0,0), bool top = true) const = 0; | 
|---|
| 40 |  | 
|---|
| 41 |  | 
|---|
| 42 |  | 
|---|
| 43 | private: | 
|---|
| 44 | unsigned int        treeIndex;                  //!< Index number of the BV in the tree | 
|---|
| 45 |  | 
|---|
| 46 |  | 
|---|
| 47 | }; | 
|---|
| 48 |  | 
|---|
| 49 | #endif /* _BV_TREE_NODE_H */ | 
|---|
       
      
      Note: See 
TracBrowser
        for help on using the repository browser.