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

Fix mapping

This commit is contained in:
Miloslav Číž 2018-09-04 13:38:04 +02:00
parent b59f44048b
commit 1d6041aff9

View file

@ -810,8 +810,8 @@ PixelInfo mapToScreen(Vector2D worldPosition, Unit height, Camera camera)
(result.depth * sinInt(alpha)) / (cos == 0 ? 1 : cos); // sin/cos = tan
result.position.x = (a * middleColumn) / b;
result.position.x = 2 * (middleColumn - result.position.x);
// TODO: ^ why is this 2 here?
result.position.x = middleColumn - result.position.x;
return result;
}