mirror of
https://git.coom.tech/drummyfish/raycastlib.git
synced 2024-11-24 20:59:58 +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 collisionRadius;
|
||||||
Unit collisionHeightBelow;
|
Unit collisionHeightBelow;
|
||||||
Unit collisionHeightAbove;
|
Unit collisionHeightAbove;
|
||||||
|
Unit collisionStepHeight;
|
||||||
} Camera;
|
} Camera;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -983,7 +984,8 @@ void moveCameraWithCollision(Camera *camera, Vector2D planeOffset,
|
||||||
int16_t xSquareNew = divRoundDown(cornerNew.x,UNITS_PER_SQUARE);
|
int16_t xSquareNew = divRoundDown(cornerNew.x,UNITS_PER_SQUARE);
|
||||||
int16_t ySquareNew = divRoundDown(cornerNew.y,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;
|
Unit topLimit = camera->height + camera->collisionHeightAbove;
|
||||||
|
|
||||||
// checks a single square for collision against the camera
|
// checks a single square for collision against the camera
|
||||||
|
|
Loading…
Reference in a new issue