From d35667a7ec9dbd85427d9307ac43b828fec17c2f Mon Sep 17 00:00:00 2001 From: Jacob Hofer Date: Wed, 17 Dec 2025 13:40:24 -0700 Subject: [PATCH] Fix simulated position calculation for azimuth waypoints (#6060) * Fix simulated position calculation for azimuth waypoints * Add comment describing position calculation --- .../geyser/session/cache/waypoint/AzimuthWaypoint.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/session/cache/waypoint/AzimuthWaypoint.java b/core/src/main/java/org/geysermc/geyser/session/cache/waypoint/AzimuthWaypoint.java index 2f44a4894..c4a956437 100644 --- a/core/src/main/java/org/geysermc/geyser/session/cache/waypoint/AzimuthWaypoint.java +++ b/core/src/main/java/org/geysermc/geyser/session/cache/waypoint/AzimuthWaypoint.java @@ -68,8 +68,9 @@ public class AzimuthWaypoint extends GeyserWaypoint implements TickingWaypoint { private void updatePosition() { Vector3f playerPosition = session.getPlayerEntity().position(); // Unit circle math! - float dx = (float) (Math.cos(angle) * WAYPOINT_DISTANCE); - float dz = (float) -(Math.sin(angle) * WAYPOINT_DISTANCE); + // Unintuitively, the delta x corresponds to the sin of the angle, and delta z to the cos + float dx = (float) -(Math.sin(angle) * WAYPOINT_DISTANCE); + float dz = (float) (Math.cos(angle) * WAYPOINT_DISTANCE); // Set Y to the player's Y since this waypoint always appears in the centre of the bar on Java position = Vector3f.from(playerPosition.getX() + dx, playerPosition.getY(), playerPosition.getZ() + dz); }