Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/util/collision_detection/cd_engine.h @ 4522

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
Line 
1/*!
2    \file cd_engine.h
3    \brief Definition of the collision detection engine
4   
5*/
6
7#ifndef _CD_ENGINE_H
8#define _CD_ENGINE_H
9
10#include "base_object.h"
11#include "collision_defs.h"
12
13
14//! the state options
15typedef 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
25//! The class representing the collision detection system of orxonox
26class CDEngine : public BaseObject {
27
28 public:
29  virtual ~CDEngine(void);
30  /** \returns a Pointer to the only object of this Class */
31  inline static CDEngine* getInstance(void) { if (!singletonRef) singletonRef = new CDEngine();  return singletonRef; };
32  void init();
33
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
43 private:
44  CDEngine(void);
45  static CDEngine* singletonRef;
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
53};
54
55#endif /* _CD_ENGINE_H */
Note: See TracBrowser for help on using the repository browser.