Changeset 7839 in orxonox.OLD for trunk/src/lib
- Timestamp:
- May 24, 2006, 10:35:26 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/collision_reaction/cr_engine.h
r7819 r7839 10 10 11 11 // FORWARD DECLARATION 12 class CollisionHandle; 13 class Collision; 12 14 13 15 //! A default singleton class. 14 class CREngine : public BaseObject { 16 class CREngine : public BaseObject 17 { 15 18 16 public: 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 32 33 public: 17 34 virtual ~CREngine(void); 18 35 /** @returns a Pointer to the only object of this Class */ … … 20 37 21 38 22 void subscribeToCollisionEvent();39 CollisionHandle* subscribeReaction(WorldEntity* worldEntity, ClassId targets, CRType type); 23 40 24 private: 41 bool unsubscribeReaction(WorldEntity* worldEntity); 42 bool unsubscribeReaction(CollisionHandle* collisionHandle); 43 44 45 /** @returns an instance to a collision object. instead of creating new object this ones can be resycled */ 46 inline Collision* getCollisionObject() { /* return the first element of the cache list*/ } 47 /** @param collision: returns the Collision object back to the cache list */ 48 inline void putCollisionObject(Collision* collision) { this->cachedCollisions.push_back(collision); } 49 50 51 private: 25 52 CREngine(void); 26 static CREngine* singletonRef; 53 static CREngine* singletonRef; //!< the reference to the CREngine object (singleton) 54 55 std::vector<CollisionHandle*> collisionHandles; //!< list with the collision handles 56 std::vector<Collision*> cachedCollisions; //!< a list of unused, cached collision events 27 57 }; 28 58
Note: See TracChangeset
for help on using the changeset viewer.