mirror of
https://git.coom.tech/drummyfish/raycastlib.git
synced 2024-11-21 20:29:59 +01:00
Fix floor depth
This commit is contained in:
parent
471b989fcb
commit
bfbc84ed7a
1 changed files with 2 additions and 2 deletions
|
@ -586,8 +586,8 @@ void _columnFunction(HitResult *hits, uint16_t hitCount, uint16_t x, Ray ray)
|
|||
for (int32_t i = y; i >= middleRow; --i)
|
||||
{
|
||||
p.position.y = i;
|
||||
_pixelFunction(p);
|
||||
p.depth = (_camera.resolution.y - i) * _floorDepthStep + floorCameraDiff;
|
||||
_pixelFunction(p);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -603,7 +603,7 @@ void render(Camera cam, ArrayFunction arrayFunc, PixelFunction pixelFunc,
|
|||
cam.position.y / UNITS_PER_SQUARE) -1 * cam.height;
|
||||
|
||||
// TODO
|
||||
_floorDepthStep = (10 * UNITS_PER_SQUARE) / cam.resolution.y;
|
||||
_floorDepthStep = (16 * UNITS_PER_SQUARE) / cam.resolution.y;
|
||||
|
||||
castRaysMultiHit(cam,arrayFunc,_columnFunction,constraints);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue