From 05c560e7b9f508997a7c7c5e466329692796dab4 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 10 Oct 2012 21:27:41 +0000 Subject: Provided bullet physics collision callback methods. --- src/core/entity.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/core/entity.h') diff --git a/src/core/entity.h b/src/core/entity.h index 19e47bc..092f4a7 100644 --- a/src/core/entity.h +++ b/src/core/entity.h @@ -630,6 +630,16 @@ public: * @brief reset the physics state */ virtual void reset(); + + /** + * @brief physics collision callback + * This funcion is called by the physics engine if the entity collides with another entity. + * It can be implemented by game child classes to provide collision effects and feedback. + * If the collision happens between two EntityDynamic instances (or subclasses thereof) + * the method will be called on each collision partner. + * Warning: this can be called multiple times for a single collision + * */ + virtual void collision(Entity *other); protected: float entity_mass; -- cgit v1.2.3