| 
                Last change
                  on this file since 7434 was
                  6447,
                  checked in by patrick, 20 years ago
           | 
        
        
          | 
               
collision: some more debug work on the collision detection framework 
 
           | 
        
        | 
            File size:
            1.3 KB
           | 
      
      
        
  | Line |   | 
|---|
| 1 | /*! | 
|---|
| 2 |  * @file obb_tree.h | 
|---|
| 3 |   *  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 | class PNode; | 
|---|
| 17 |  | 
|---|
| 18 | //! A class for representing an obb tree | 
|---|
| 19 | class OBBTree : public BVTree | 
|---|
| 20 | { | 
|---|
| 21 |  | 
|---|
| 22 |   public: | 
|---|
| 23 |     OBBTree(int depth, const modelInfo& modInfo); | 
|---|
| 24 |     virtual ~OBBTree(); | 
|---|
| 25 |     void init(); | 
|---|
| 26 |  | 
|---|
| 27 |     virtual void spawnBVTree(const modelInfo& modelInf); | 
|---|
| 28 |     virtual void flushTree(); | 
|---|
| 29 |  | 
|---|
| 30 |     virtual void collideWith(const WorldEntity& entity1, const WorldEntity& entity2) const; | 
|---|
| 31 |     virtual void drawBV(int depth, int drawMode) const; | 
|---|
| 32 |  | 
|---|
| 33 |     /** returns the next if for the obb tree node @return integer id number of the next node */ | 
|---|
| 34 |     inline const int getID() { return ++this->id;} | 
|---|
| 35 |     /** returns the root node of the bounding volume tree @return reference to the root node */ | 
|---|
| 36 |     inline const OBBTreeNode* getRootNode() const { return this->rootNode; } | 
|---|
| 37 |  | 
|---|
| 38 |     void debug(); | 
|---|
| 39 |  | 
|---|
| 40 |   private: | 
|---|
| 41 |     OBBTreeNode*         rootNode;                        //!< reference to the root node of the tree | 
|---|
| 42 |     int                  id;                              //!< the next id of a obb tree node | 
|---|
| 43 |     int                  depth;                           //!< the depth of the tree to generate | 
|---|
| 44 | }; | 
|---|
| 45 |  | 
|---|
| 46 | #endif /* _OBB_TREE_H */ | 
|---|
       
      
      Note: See 
TracBrowser
        for help on using the repository browser.