1
0
Fork 0
mirror of https://git.coom.tech/drummyfish/raycastlib.git synced 2024-11-23 20:49:57 +01:00

Add steps

This commit is contained in:
Miloslav Číž 2018-09-07 19:52:19 +02:00
parent df8b84a0d5
commit d32de7dfb4

View file

@ -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