Last change
on this file since 4522 was
4522,
checked in by patrick, 19 years ago
|
orxonox/trunk: started implementing header file of cd, some cd state infos
|
File size:
1.2 KB
|
Rev | Line | |
---|
[4510] | 1 | /*! |
---|
[4511] | 2 | \file cd_engine.h |
---|
| 3 | \brief Definition of the collision detection engine |
---|
[4510] | 4 | |
---|
| 5 | */ |
---|
| 6 | |
---|
[4511] | 7 | #ifndef _CD_ENGINE_H |
---|
| 8 | #define _CD_ENGINE_H |
---|
[4510] | 9 | |
---|
| 10 | #include "base_object.h" |
---|
[4522] | 11 | #include "collision_defs.h" |
---|
[4510] | 12 | |
---|
| 13 | |
---|
[4522] | 14 | //! the state options |
---|
| 15 | typedef enum cdState |
---|
| 16 | { |
---|
| 17 | CD_DEBUG_DRAW_ALL = 1, |
---|
| 18 | CD_DEBUG_DRAW_POLYGONS = 1<<1, |
---|
| 19 | CD_DEBUG_DRAW_BLENDED = 1<<2, |
---|
| 20 | CD_DEBUG_DRAW_HIT_BV = 1<<3, |
---|
| 21 | CD_DEBUG_VERBOSE = 1<<4 |
---|
| 22 | }; |
---|
| 23 | |
---|
| 24 | |
---|
[4511] | 25 | //! The class representing the collision detection system of orxonox |
---|
| 26 | class CDEngine : public BaseObject { |
---|
[4510] | 27 | |
---|
| 28 | public: |
---|
[4511] | 29 | virtual ~CDEngine(void); |
---|
[4519] | 30 | /** \returns a Pointer to the only object of this Class */ |
---|
| 31 | inline static CDEngine* getInstance(void) { if (!singletonRef) singletonRef = new CDEngine(); return singletonRef; }; |
---|
[4522] | 32 | void init(); |
---|
[4510] | 33 | |
---|
[4522] | 34 | void setState(int newState); |
---|
| 35 | const int getState() const { return this->state; } |
---|
| 36 | |
---|
| 37 | void drawBV(int currentDepth, int depth) const; |
---|
| 38 | void drawBVPolygon(int currentDepth, int depth) const; |
---|
| 39 | void drawBVBlended(int currentDepth, int depth) const; |
---|
| 40 | |
---|
| 41 | void checkCollisions(); |
---|
| 42 | |
---|
[4510] | 43 | private: |
---|
[4511] | 44 | CDEngine(void); |
---|
| 45 | static CDEngine* singletonRef; |
---|
[4522] | 46 | |
---|
| 47 | void buildBVTree(int depth = MAX_BV_TREE_DEPTH); |
---|
| 48 | |
---|
| 49 | |
---|
| 50 | private: |
---|
| 51 | int state; //!< the current state of the cd engine |
---|
| 52 | |
---|
[4510] | 53 | }; |
---|
| 54 | |
---|
[4511] | 55 | #endif /* _CD_ENGINE_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.