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:
parent
df8b84a0d5
commit
d32de7dfb4
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue