/*! * @file collision_handle.h * @brief Definition of a collision handle: used for accesing per world entity collision events and reactions */ #ifndef _COLLISION_HANDLE_H #define _COLLISION_HANDLE_H #include "base_object.h" #include "cr_engine.h" #include class Collision; class WorldEntity; // struct CRType; //! A class for defining collision reactions and storing events class CollisionHandle : public BaseObject { public: CollisionHandle(WorldEntity* owner, CREngine::CRType type); virtual ~CollisionHandle(); void addTarget(); void registerCollision(Collision* collision); void handleCollisions(); private: WorldEntity* owner; //!< the worldenity this reaction will be applied on CREngine::CRType type; //!< the reaction type bool bDispatched; //!< true if this handle has already been dispatched bool bStopOnFirstCollision; //!< true if the cd of this object should be terminated after one match std::vector collisionList; //!< a list full of collisions std::vector targetList; //!< a list of target classes for filtering }; #endif /* _COLLISION_HANDLE_H */