1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2026-01-04 15:31:36 +00:00

Merge branch 'master' into feature/1.21.11

This commit is contained in:
Aurora
2025-12-17 20:42:15 +00:00

View File

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