Fix raycast intersection calculation

This commit is contained in:
2024-01-10 17:30:03 +01:00
parent 214cf19a52
commit b0db2a52ec

View File

@@ -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;
}