summaryrefslogtreecommitdiff
path: root/src/collision.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/collision.h')
-rw-r--r--src/collision.h34
1 files changed, 23 insertions, 11 deletions
diff --git a/src/collision.h b/src/collision.h
index 243c4b294..52a7bbb7d 100644
--- a/src/collision.h
+++ b/src/collision.h
@@ -26,12 +26,35 @@ with this program; if not, write to the Free Software Foundation, Inc.,
class Map;
class IGameDef;
+enum CollisionType
+{
+ COLLISION_NODE
+};
+
+struct CollisionInfo
+{
+ enum CollisionType type;
+ v3s16 node_p; // COLLISION_NODE
+ bool bouncy;
+ v3f old_speed;
+ v3f new_speed;
+
+ CollisionInfo():
+ type(COLLISION_NODE),
+ node_p(-32768,-32768,-32768),
+ bouncy(false),
+ old_speed(0,0,0),
+ new_speed(0,0,0)
+ {}
+};
+
struct collisionMoveResult
{
bool touching_ground;
bool collides;
bool collides_xz;
bool standing_on_unloaded;
+ std::vector<CollisionInfo> collisions;
collisionMoveResult():
touching_ground(false),
@@ -72,16 +95,5 @@ bool wouldCollideWithCeiling(
f32 y_increase, f32 d);
-enum CollisionType
-{
- COLLISION_FALL
-};
-
-struct CollisionInfo
-{
- CollisionType t;
- f32 speed;
-};
-
#endif