X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fcollision_hit.hpp;h=02879039a12ccadb6387e0550d3407c2a05b1801;hb=273bb1e9d8f4a625abce2fbcb6d0c215988cc655;hp=b9ed4d522c8562af00d07b16e83a049f13c9570b;hpb=07ddaed2a657e4d2a3d038fed223fc5827159caf;p=supertux.git diff --git a/src/collision_hit.hpp b/src/collision_hit.hpp index b9ed4d522..02879039a 100644 --- a/src/collision_hit.hpp +++ b/src/collision_hit.hpp @@ -19,6 +19,8 @@ #ifndef SUPERTUX_COLLISION_HIT_H #define SUPERTUX_COLLISION_HIT_H +#include +#include #include "math/vector.hpp" /** @@ -30,12 +32,17 @@ enum HitResponse /// don't move the object ABORT_MOVE = 0, /// move object out of collision and check for collisions again - /// if this happens to often then the move will just be aborted + /// if this happens to often then the move will just be aborted CONTINUE, /// do the move ignoring the collision FORCE_MOVE, /// passes movement to collided object - PASS_MOVEMENT + PASS_MOVEMENT, + + /// the object should not appear solid + PASSTHROUGH, + /// the object should appear solid + SOLID, }; /** @@ -44,13 +51,19 @@ enum HitResponse class CollisionHit { public: - /// penetration depth - float depth; - /// time of the collision (between 0 and 1 in relation to movement) - float time; - /// The normal of the side we collided with - Vector normal; + CollisionHit() { + left = false; + right = false; + top = false; + bottom = false; + crush = false; + } + + bool left, right; + bool top, bottom; + bool crush; + + Vector slope_normal; }; #endif -