From d32de7dfb4482fabd16e1aa4c44accf3cb1f7f32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Fri, 7 Sep 2018 19:52:19 +0200 Subject: [PATCH] Add steps --- raycastlib.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/raycastlib.h b/raycastlib.h index e964f3c..0473878 100644 --- a/raycastlib.h +++ b/raycastlib.h @@ -107,6 +107,7 @@ typedef struct Unit collisionRadius; Unit collisionHeightBelow; Unit collisionHeightAbove; + Unit collisionStepHeight; } Camera; /** @@ -983,7 +984,8 @@ void moveCameraWithCollision(Camera *camera, Vector2D planeOffset, int16_t xSquareNew = divRoundDown(cornerNew.x,UNITS_PER_SQUARE); int16_t ySquareNew = divRoundDown(cornerNew.y,UNITS_PER_SQUARE); - Unit bottomLimit = camera->height - camera->collisionHeightBelow; + Unit bottomLimit = camera->height - camera->collisionHeightBelow + + camera->collisionStepHeight; Unit topLimit = camera->height + camera->collisionHeightAbove; // checks a single square for collision against the camera