1
0
Fork 0
mirror of https://git.coom.tech/drummyfish/raycastlib.git synced 2024-12-23 01:26:19 +01:00
This commit is contained in:
Miloslav Číž 2018-09-15 17:56:59 +02:00
parent 1186440944
commit 3ef4c4fce9

View file

@ -819,14 +819,20 @@ void castRaysMultiHit(Camera cam, ArrayFunction arrayFunc,
Ray r;
r.start = cam.position;
Unit currentDX = 0;
Unit currentDY = 0;
for (int16_t i = 0; i < cam.resolution.x; ++i)
{
r.direction.x = dir1.x + (dX * i) / cam.resolution.x;
r.direction.y = dir1.y + (dY * i) / cam.resolution.x;
r.direction.x = dir1.x + currentDX / cam.resolution.x;
r.direction.y = dir1.y + currentDY / cam.resolution.x;
castRayMultiHit(r,arrayFunc,typeFunction,hits,&hitCount,constraints);
columnFunc(hits,hitCount,i,r);
currentDX += dX;
currentDY += dY;
}
}