/*! * @file collision.h * Definition of a collision as a two WE hit each other */ #ifndef _COLLISION_H #define _COLLISION_H #include "vector.h" #include class WorldEntity; class BoundingVolume; class CollisionEvent; //! A class representing a simple collision class Collision { public: Collision(); virtual ~Collision(); /** collides two WorldEntities @param entityA world entity A, @param entityB world entity B, @param bvA volume A @param bvB volumeB */ inline void collide(WorldEntity* entityA, WorldEntity* entityB) { this->entityA = entityA; this->entityB = entityB; } /** @return Collision WorldEntity A */ inline WorldEntity* getEntityA() const { return this->entityA; } /** @return Collision WorldEntity B */ inline WorldEntity* getEntityB() const { return this->entityB; } /** registers a @param event CollisionEvent to take place */ inline void registerCollisionEvent(CollisionEvent* event) { this->collisionEvents.push_back(event); } void handleCollisionEvents(); private: void flushCollisionEvents(); private: WorldEntity* entityA; //!< the collision body A WorldEntity* entityB; //!< the collision body B std::vector collisionEvents; //!< the collision event list }; #endif /* _COLLISION_H */