X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fmoving_object.hpp;h=69d36a3317b03f4b423f46bb5b18e7649038ab53;hb=691335a74a0717e839f440c6151f1517cf89548d;hp=b2f3de99536a28c967e6723f3adab543419095c4;hpb=4a486d92343d1824b311c234e9321e08f280fe68;p=supertux.git diff --git a/src/moving_object.hpp b/src/moving_object.hpp index b2f3de995..69d36a331 100644 --- a/src/moving_object.hpp +++ b/src/moving_object.hpp @@ -31,7 +31,7 @@ class CollisionGrid; enum CollisionGroup { /** Objects in DISABLED group are not tested for collisions */ - COLGROUP_DISABLED, + COLGROUP_DISABLED = 0, /** * "default" is moving object. MovingObjects get tested against all other * objects and against other movingobjects @@ -42,6 +42,8 @@ enum CollisionGroup { * MovingOnlyStatic objects), but is tested against all other objects. */ COLGROUP_MOVING_ONLY_STATIC, + /** TODO write docu :-/ */ + COLGROUP_MOVING_STATIC, /** * Doesn't move and isn't explicitely checked for collisions with other * objects (but other objects might check with this) @@ -85,6 +87,16 @@ public: { (void) hit; } + /** + * when 2 objects collided, we will first call the pre_collision_check + * functions of both objects that can decide on how to react to the collision. + */ + virtual bool collides(GameObject& other, const CollisionHit& hit) + { + (void) other; + (void) hit; + return true; + } /** this function is called when the object collided with any other object */ virtual HitResponse collision(GameObject& other, const CollisionHit& hit) = 0; /** called when tiles with special attributes have been touched */