X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fcollision.h;h=e823a08fefb978825e4fe76f24508a818d398163;hb=fadf248892eae825b57d283032594ed924d8dbea;hp=9c913c6a9720d52116fadc58060a4eb2bb32a744;hpb=c638442e78b953556e7dadd4c0c34cb0c719bbc8;p=oweals%2Fminetest.git diff --git a/src/collision.h b/src/collision.h index 9c913c6a9..e823a08fe 100644 --- a/src/collision.h +++ b/src/collision.h @@ -23,20 +23,28 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "common_irrlicht.h" class Map; +class IGameDef; struct collisionMoveResult { bool touching_ground; + bool collides; collisionMoveResult(): - touching_ground(false) + touching_ground(false), + collides(false) {} }; -collisionMoveResult collisionMoveSimple(Map *map, f32 pos_max_d, - const core::aabbox3d &box_0, +// Moves using a single iteration; speed should not exceed pos_max_d/dtime +collisionMoveResult collisionMoveSimple(Map *map, IGameDef *gamedef, + f32 pos_max_d, const core::aabbox3d &box_0, + f32 dtime, v3f &pos_f, v3f &speed_f); + +// Moves using as many iterations as needed +collisionMoveResult collisionMovePrecise(Map *map, IGameDef *gamedef, + f32 pos_max_d, const core::aabbox3d &box_0, f32 dtime, v3f &pos_f, v3f &speed_f); -//{return collisionMoveResult();} enum CollisionType {