/*! \file obb_tree.h * Definition of an obb tree (object oriented Bounding Box) */ #ifndef _OBB_TREE_H #define _OBB_TREE_H #include "bv_tree.h" #include "abstract_model.h" #include "material.h" class Material; class OBBTreeNode; class PNode; //! A class for representing an obb tree class OBBTree : public BVTree { public: OBBTree(); OBBTree(int depth, sVec3D *verticesList, const int length); virtual ~OBBTree(); void init(); virtual void spawnBVTree(int depth, sVec3D *verticesList, const int length); virtual void flushTree(); virtual void collideWith(BVTree* tree, PNode* nodeA, PNode* nodeB); virtual void collideWith(WorldEntity* entity1, WorldEntity* entity2); virtual void drawBV(int depth, int drawMode) const; Material* getMaterial(unsigned int depth) { return this->material[depth%5]; } Material* getTransparentMaterial(unsigned int depth) { return this->transparentMaterial[depth%5]; } Material* getCollisionMaterial() { return this->collisionMaterial; } int getID() { return ++this->id;} inline OBBTreeNode* getRootNode() { return this->rootNode; } void debug(); public: private: OBBTreeNode* rootNode; //!< reference to the root node of the tree Material** material; Material** transparentMaterial; Material* collisionMaterial; int id; }; #endif /* _OBB_TREE_H */