- Timestamp:
- May 30, 2006, 1:28:36 AM (18 years ago)
- Location:
- branches/cr/src/lib/collision_reaction
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/cr/src/lib/collision_reaction/collision.cc
r7959 r7968 40 40 41 41 42 /** 43 * handles the collision events 44 */ 45 void Collision::handleCollisionEvents() 46 { 42 47 48 49 this->flushCollisionEvents(); 50 } 51 52 53 /** 54 * flushes the CollisionEvent list 55 */ 56 void Collision::flushCollisionEvents() 57 { 58 this->collisionEvents.clear(); 59 } 60 -
branches/cr/src/lib/collision_reaction/collision.h
r7964 r7968 15 15 16 16 //! A class representing a simple collision 17 class Collision { 17 class Collision 18 { 18 19 19 public:20 Collision();21 virtual ~Collision();20 public: 21 Collision(); 22 virtual ~Collision(); 22 23 23 /** collides two WorldEntities @param entityA world entity A, @param entityB world entity B, @param bvA volume A @param bvB volumeB */24 inline void collide(WorldEntity* entityA, WorldEntity* entityB) { this->entityA = entityA; this->entityB = entityB; }24 /** collides two WorldEntities @param entityA world entity A, @param entityB world entity B, @param bvA volume A @param bvB volumeB */ 25 inline void collide(WorldEntity* entityA, WorldEntity* entityB) { this->entityA = entityA; this->entityB = entityB; } 25 26 26 27 27 /** @return Collision WorldEntity A */28 inline WorldEntity* getEntityA() const { return this->entityA; }29 /** @return Collision WorldEntity B */30 inline WorldEntity* getEntityB() const { return this->entityB; }28 /** @return Collision WorldEntity A */ 29 inline WorldEntity* getEntityA() const { return this->entityA; } 30 /** @return Collision WorldEntity B */ 31 inline WorldEntity* getEntityB() const { return this->entityB; } 31 32 32 /** registers a @param event CollisionEvent to take place */ 33 inline void registerCollisionEvent(CollisionEvent* event) { this->collisionList.push_back(event); } 33 /** registers a @param event CollisionEvent to take place */ 34 inline void registerCollisionEvent(CollisionEvent* event) { this->collisionEvents.push_back(event); } 35 36 void handleCollisionEvents(); 34 37 35 38 36 private: 37 WorldEntity* entityA; //!< the collision body A 38 WorldEntity* entityB; //!< the collision body B 39 private: 40 void flushCollisionEvents(); 39 41 40 std::vector<CollisionEvent*> collisionList; //!< the collision event list 42 43 private: 44 WorldEntity* entityA; //!< the collision body A 45 WorldEntity* entityB; //!< the collision body B 46 47 std::vector<CollisionEvent*> collisionEvents; //!< the collision event list 41 48 }; 42 49
Note: See TracChangeset
for help on using the changeset viewer.