Changeset 7927 in orxonox.OLD for trunk/src/lib
- Timestamp:
- May 28, 2006, 6:46:33 PM (19 years ago)
- Location:
- trunk/src/lib/collision_reaction
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/collision_reaction/Makefile.am
r7819 r7927 4 4 noinst_LIBRARIES = libORXcr.a 5 5 6 libORXcr_a_SOURCES = cr_engine.cc 6 libORXcr_a_SOURCES = cr_engine.cc \ 7 collision_handle.cc 7 8 8 9 9 10 10 noinst_HEADERS = cr_engine.h 11 noinst_HEADERS = cr_engine.h \ 12 collision_handle.h 11 13 -
trunk/src/lib/collision_reaction/collision_handle.cc
r7841 r7927 10 10 11 11 ### File Specific: 12 main-programmer: Pat irick Boenzli12 main-programmer: Patrick Boenzli 13 13 */ 14 14 … … 24 24 * @todo this constructor is not jet implemented - do it 25 25 */ 26 CollisionHandle::CollisionHandle ( )26 CollisionHandle::CollisionHandle (WorldEntity* owner, CREngine::CRType type) 27 27 { 28 this->setClassID(CL_COLLISION_HANDLE, "CollisionHandle"); 28 this->setClassID(CL_COLLISION_HANDLE, "CollisionHandle"); 29 30 this->owner = owner; 31 this->type = type; 29 32 30 33 } -
trunk/src/lib/collision_reaction/collision_handle.h
r7841 r7927 8 8 9 9 #include "base_object.h" 10 #include "cr_engine.h" 11 12 #include <vector> 13 10 14 11 15 class Collision; 16 class WorldEntity; 17 18 // struct CRType; 19 12 20 13 21 //! A class for defining collision reactions and storing events … … 15 23 16 24 public: 17 CollisionHandle( );25 CollisionHandle(WorldEntity* owner, CREngine::CRType type); 18 26 virtual ~CollisionHandle(); 27 28 29 void addTarget(); 19 30 20 31 void registerCollision(Collision* collision); … … 25 36 private: 26 37 WorldEntity* owner; //!< the worldenity this reaction will be applied on 27 classID targetClass; //!< the entities triggering the handle38 CREngine::CRType type; //!< the reaction type 28 39 29 40 bool bDispatched; //!< true if this handle has already been dispatched 30 bool bStopOnFirstCollision 41 bool bStopOnFirstCollision; //!< true if the cd of this object should be terminated after one match 31 42 32 43 std::vector<Collision*> collisionList; //!< a list full of collisions 33 std::vector< classID>targetList; //!< a list of target classes for filtering44 std::vector<long> targetList; //!< a list of target classes for filtering 34 45 35 46 }; -
trunk/src/lib/collision_reaction/cr_engine.cc
r7865 r7927 47 47 48 48 49 CollisionHandle* CREngine::subscribeReaction(WorldEntity* worldEntity, CRType type, int nrOfTargets, ...)49 CollisionHandle* CREngine::subscribeReaction(WorldEntity* owner, CRType type, int nrOfTargets, ...) 50 50 { 51 51 52 va_list itemlist; 52 53 va_start (itemlist, type); 53 for (int i = 0; i < nrOfTargets; i++)54 this->targetList.push_back(va_arg(itemlist, int));54 // for (int i = 0; i < nrOfTargets; i++) 55 // this->targetList.push_back(va_arg(itemlist, int)); 55 56 va_end(itemlist); 56 57 } -
trunk/src/lib/collision_reaction/cr_engine.h
r7865 r7927 20 20 { 21 21 22 public: 22 23 typedef enum CRType { 23 CR_CONSERVATION_OF_MOMENTUM = 0, 24 CR_PHYSICS_MOMENTUM = 0, 25 CR_PHYSICS_GROUND, 26 CR_PHYSICS_GROUND_WALK, 24 27 25 28 CR_OBJECT_DAMAGE, … … 28 31 CR_VERTEX_TRAFO, 29 32 30 CR_ CALLBACK,33 CR_SPECIAL_CALLBACK, 31 34 32 35 CR_NUMBER 33 36 }; 34 37 38 virtual ~CREngine(void); 35 39 36 public:37 virtual ~CREngine(void);38 40 /** @returns a Pointer to the only object of this Class */ 39 41 inline static CREngine* getInstance(void) { if (!singletonRef) singletonRef = new CREngine(); return singletonRef; }; … … 57 59 CREngine(void); 58 60 61 59 62 private: 60 63 std::vector<CollisionHandle*> collisionHandles; //!< list with the collision handles 61 64 std::vector<Collision*> cachedCollisions; //!< a list of unused, cached collision events 62 std::vector<int> targetList;63 65 64 66 static CREngine* singletonRef; //!< the reference to the CREngine object (singleton)
Note: See TracChangeset
for help on using the changeset viewer.