From 952f36b73238bdbe4009d1ae2b20668c6d3bcf8e Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 13 Mar 2026 03:19:05 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20correct=20minimap=20player=20arrow=20ori?= =?UTF-8?q?entation=20(was=2090=C2=B0=20off,=20E/W=20appeared=20flipped)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui/game_screen.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 4da386cb..aad87838 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -15555,7 +15555,9 @@ void GameScreen::renderMinimapMarkers(game::GameHandler& gameHandler) { float sinB = 0.0f; if (minimap->isRotateWithCamera()) { glm::vec3 fwd = camera->getForward(); - bearing = std::atan2(-fwd.x, fwd.y); + // Render space: +X=West, +Y=North. Camera fwd=(cos(yaw),sin(yaw)). + // Clockwise bearing from North: atan2(fwd.y, -fwd.x). + bearing = std::atan2(fwd.y, -fwd.x); cosB = std::cos(bearing); sinB = std::sin(bearing); } @@ -15593,7 +15595,7 @@ void GameScreen::renderMinimapMarkers(game::GameHandler& gameHandler) { // The player is always at centerX, centerY on the minimap. // Draw a yellow arrow pointing in the player's facing direction. glm::vec3 fwd = camera->getForward(); - float facing = std::atan2(-fwd.x, fwd.y); // bearing relative to north + float facing = std::atan2(fwd.y, -fwd.x); // clockwise bearing from North float cosF = std::cos(facing - bearing); float sinF = std::sin(facing - bearing); float arrowLen = 8.0f;