diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-09-01 12:58:37 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-09-01 12:58:37 +0300 |
commit | 3b43c69df4ce7d68aebb4bd02aaa4aca18b9afad (patch) | |
tree | 60f6b5b30e8f18eacc71d812a30776641c32999c /src/collision.h | |
parent | b17d3e7ad7e59a10df50277c15174529f20d0bed (diff) | |
download | minetest-3b43c69df4ce7d68aebb4bd02aaa4aca18b9afad.tar.gz minetest-3b43c69df4ce7d68aebb4bd02aaa4aca18b9afad.tar.bz2 minetest-3b43c69df4ce7d68aebb4bd02aaa4aca18b9afad.zip |
Add bouncy node group
Diffstat (limited to 'src/collision.h')
-rw-r--r-- | src/collision.h | 34 |
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 |