source:
orxonox.OLD/trunk/src/lib/collision_detection/obb_tree.h
@
5463
Last change on this file since 5463 was 5431, checked in by bensch, 19 years ago | |
---|---|
File size: 1.4 KB |
Rev | Line | |
---|---|---|
[4616] | 1 | /*! |
[5039] | 2 | * @file obb_tree.h |
[4836] | 3 | * Definition of an obb tree (object oriented Bounding Box) |
[4510] | 4 | |
5 | */ | |
6 | ||
[4511] | 7 | #ifndef _OBB_TREE_H |
8 | #define _OBB_TREE_H | |
[4510] | 9 | |
[4514] | 10 | #include "bv_tree.h" |
[4551] | 11 | #include "abstract_model.h" |
[4616] | 12 | #include "material.h" |
[4510] | 13 | |
[4616] | 14 | class Material; |
[4550] | 15 | class OBBTreeNode; |
[4700] | 16 | class PNode; |
[4550] | 17 | |
[4511] | 18 | //! A class for representing an obb tree |
[4514] | 19 | class OBBTree : public BVTree { |
[4510] | 20 | |
[4616] | 21 | public: |
22 | OBBTree(); | |
[4682] | 23 | OBBTree(int depth, sVec3D *verticesList, const int length); |
[4616] | 24 | virtual ~OBBTree(); |
[4682] | 25 | void init(); |
[4510] | 26 | |
[4616] | 27 | virtual void spawnBVTree(int depth, sVec3D *verticesList, const int length); |
28 | virtual void flushTree(); | |
[4510] | 29 | |
[5028] | 30 | virtual void collideWith(BVTree* tree, WorldEntity* nodeA, WorldEntity* nodeB); |
[5026] | 31 | virtual void collideWith(WorldEntity* entity1, WorldEntity* entity2); |
[4528] | 32 | |
[4635] | 33 | virtual void drawBV(int depth, int drawMode) const; |
[4528] | 34 | |
[4702] | 35 | Material* getMaterial(unsigned int depth) { return this->material[depth%5]; } |
36 | Material* getTransparentMaterial(unsigned int depth) { return this->transparentMaterial[depth%5]; } | |
37 | Material* getCollisionMaterial() { return this->collisionMaterial; } | |
[5431] | 38 | |
[4638] | 39 | int getID() { return ++this->id;} |
[4696] | 40 | inline OBBTreeNode* getRootNode() { return this->rootNode; } |
[4622] | 41 | |
[4616] | 42 | void debug(); |
[4546] | 43 | |
[4616] | 44 | public: |
[4510] | 45 | |
[4616] | 46 | |
[4622] | 47 | |
[4616] | 48 | private: |
49 | OBBTreeNode* rootNode; //!< reference to the root node of the tree | |
[4622] | 50 | Material** material; |
[4670] | 51 | Material** transparentMaterial; |
[4702] | 52 | Material* collisionMaterial; |
[4638] | 53 | int id; |
[4510] | 54 | }; |
55 | ||
[4511] | 56 | #endif /* _OBB_TREE_H */ |
Note: See TracBrowser
for help on using the repository browser.