mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-03 08:03:50 +00:00
fix: correct minimap player arrow orientation (was 90° off, E/W appeared flipped)
This commit is contained in:
parent
ebd9cf5542
commit
952f36b732
1 changed files with 4 additions and 2 deletions
|
|
@ -15555,7 +15555,9 @@ void GameScreen::renderMinimapMarkers(game::GameHandler& gameHandler) {
|
||||||
float sinB = 0.0f;
|
float sinB = 0.0f;
|
||||||
if (minimap->isRotateWithCamera()) {
|
if (minimap->isRotateWithCamera()) {
|
||||||
glm::vec3 fwd = camera->getForward();
|
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);
|
cosB = std::cos(bearing);
|
||||||
sinB = std::sin(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.
|
// The player is always at centerX, centerY on the minimap.
|
||||||
// Draw a yellow arrow pointing in the player's facing direction.
|
// Draw a yellow arrow pointing in the player's facing direction.
|
||||||
glm::vec3 fwd = camera->getForward();
|
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 cosF = std::cos(facing - bearing);
|
||||||
float sinF = std::sin(facing - bearing);
|
float sinF = std::sin(facing - bearing);
|
||||||
float arrowLen = 8.0f;
|
float arrowLen = 8.0f;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue