From b0db2a52ecfd03c012d15769c3f83b6f44e4fe05 Mon Sep 17 00:00:00 2001 From: Klemen Plestenjak Date: Wed, 10 Jan 2024 17:30:03 +0100 Subject: [PATCH] Fix raycast intersection calculation --- engine/breeze/map/map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/breeze/map/map.c b/engine/breeze/map/map.c index a529336..63d793b 100644 --- a/engine/breeze/map/map.c +++ b/engine/breeze/map/map.c @@ -447,9 +447,9 @@ f32 bzTileMapRayCast(BzTileMap *map, Vector2 from, Vector2 to, f32 maxDst, Vecto if (outIntersection) { Vector2 intersection = from; - intersection = Vector2Add(intersection, Vector2Scale(dir, distance)); intersection.x *= map->tileWidth; intersection.y *= map->tileHeight; + intersection = Vector2Add(intersection, Vector2Scale(dir, distance)); *outIntersection = intersection; }