| 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 | 
|---|
| 12 | class CollisionHandle; | 
|---|
| 13 | class Collision; | 
|---|
| 14 |  | 
|---|
| 15 | //! A default singleton class. | 
|---|
| 16 | class 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 |  | 
|---|
| 33 | public: | 
|---|
| 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 */ | 
|---|
| 48 | inline 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 |  | 
|---|
| 53 | private: | 
|---|
| 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 | 
|---|
| 58 | private: | 
|---|
| 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.