-// $Id: collision_hit.h 2177 2004-11-24 23:10:09Z matzebraun $
+// $Id$
//
-// SuperTux - A Jump'n Run
-// Copyright (C) 2004 Matthias Braun <matze@braunis.de
+// SuperTux
+// Copyright (C) 2006 Matthias Braun <matze@braunis.de>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
#ifndef SUPERTUX_COLLISION_HIT_H
#define SUPERTUX_COLLISION_HIT_H
+#include <cfloat>
+#include <cmath>
#include "math/vector.hpp"
/**
/// 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
+ FORCE_MOVE,
+ /// passes movement to collided object
+ PASS_MOVEMENT,
+
+ /// the object should not appear solid
+ PASSTHROUGH,
+ /// the object should appear solid
+ SOLID,
};
/**
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
-