From 1d6041aff9a9ef02ceea8ae50a5411b52baf4868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Tue, 4 Sep 2018 13:38:04 +0200 Subject: [PATCH] Fix mapping --- raycastlib.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/raycastlib.h b/raycastlib.h index f0aae46..f724eee 100644 --- a/raycastlib.h +++ b/raycastlib.h @@ -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; }