projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
pt_BR updates from Krishnamurti Lelis Lima Vieira Nunes <krishnalelis@gmail.com>
[supertux.git]
/
src
/
collision_hit.hpp
diff --git
a/src/collision_hit.hpp
b/src/collision_hit.hpp
index
e3ae280
..
0287903
100644
(file)
--- a/
src/collision_hit.hpp
+++ b/
src/collision_hit.hpp
@@
-1,7
+1,7
@@
-// $Id
: collision_hit.h 2177 2004-11-24 23:10:09Z matzebraun
$
+// $Id$
//
//
-// SuperTux
- A Jump'n Run
-// Copyright (C) 200
4 Matthias Braun <matze@braunis.de
+// SuperTux
+// Copyright (C) 200
6 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
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
@@
-19,6
+19,8
@@
#ifndef SUPERTUX_COLLISION_HIT_H
#define SUPERTUX_COLLISION_HIT_H
#ifndef SUPERTUX_COLLISION_HIT_H
#define SUPERTUX_COLLISION_HIT_H
+#include <float.h>
+#include <math.h>
#include "math/vector.hpp"
/**
#include "math/vector.hpp"
/**
@@
-30,10
+32,17
@@
enum HitResponse
/// don't move the object
ABORT_MOVE = 0,
/// move object out of collision and check for collisions again
/// 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
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,
};
/**
};
/**
@@
-42,20
+51,19
@@
enum HitResponse
class CollisionHit
{
public:
class CollisionHit
{
public:
- /// penetration depth
-
float depth
;
- /// time of the collision (between 0 and 1 in relation to movement)
-
float tim
e;
- /// The normal of the side we collided with
-
Vector normal
;
-};
+ CollisionHit() {
+
left = false
;
+ right = false;
+
top = fals
e;
+ bottom = false;
+
crush = false
;
+ }
-class TilemapCollisionHit : public CollisionHit
-{
-public:
- /// the flags of all tiles tux collided with
-
int tileflags
;
+ bool left, right;
+ bool top, bottom;
+ bool crush;
+
+
Vector slope_normal
;
};
#endif
};
#endif
-