Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/collision_reaction/cr_engine.h @ 7843

Last change on this file since 7843 was 7843, checked in by bensch, 18 years ago

compiles

File size: 1.7 KB
Line 
1/*!
2 * @file cr_engine.h
3 * @brief The collision reaction engine, defining generic collision reactions to collision events
4*/
5
6#ifndef _CR_ENGINE_
7#define _CR_ENGINE_
8
9#include "base_object.h"
10
11// FORWARD DECLARATION
12class CollisionHandle;
13class Collision;
14
15//! A default singleton class.
16class CREngine : public BaseObject
17{
18#if 0
19  typedef enum CRType {
20    CR_CONSERVATION_OF_MOMENTUM   = 0,
21
22    CR_OBJECT_DAMAGE,
23    CR_OBJECT_PICKUP,
24
25    CR_VERTEX_TRAFO,
26
27    CR_CALLBACK,
28
29    CR_NUMBER
30  };
31#endif
32
33public:
34  virtual ~CREngine(void);
35  /** @returns a Pointer to the only object of this Class */
36  inline static CREngine* getInstance(void) { if (!singletonRef) singletonRef = new CREngine();  return singletonRef; };
37
38#if 0
39  CollisionHandle* subscribeReaction(WorldEntity* worldEntity, CRType type, int nrOfTargets, ...);
40
41  bool unsubscribeReaction(WorldEntity* worldEntity);
42  bool unsubscribeReaction(CollisionHandle* collisionHandle);
43
44
45  void handleCollisions();
46
47  /** @returns an instance to a collision object. instead of creating new object this ones can be resycled */
48inline Collision* getCollisionObject() { /* return the first element of the cache list*/ }
49  /** @param collision: returns the Collision object back to the cache list */
50  inline void putCollisionObject(Collision* collision) { this->cachedCollisions.push_back(collision); }
51
52
53private:
54
55  std::vector<CollisionHandle*>       collisionHandles;         //!< list with the collision handles
56  std::vector<Collision*>             cachedCollisions;         //!< a list of unused, cached collision events
57#endif
58private:
59  CREngine(void);
60  static CREngine*                    singletonRef;             //!< the reference to the CREngine object (singleton)
61};
62
63#endif /* _CR_ENGINE_ */
Note: See TracBrowser for help on using the repository browser.