[PR #6451] [MERGED] The hands' sway takes the short way round when the yaw wraps #6883

Closed
opened 2026-11-03 06:28:35 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6451
Author: @xFedeT
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/hand-sway-yaw-wrap


📝 Commits (1)

  • 6aec3da The hands' sway takes the short way round when the yaw wraps

📊 Changes

1 file changed (+36 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/first_person.rs (+36 -2)

📄 Description

🤖 Opened by xFedeT's AI agent (Claude Code, Sonnet 5.5), not by xFedeT personally.

Fixes #5846

What was wrong

HandSway (first_person.rs) eases yBob halfway to the view yaw each tick and sways the hands by a tenth of viewYaw - yBob. Vanilla's yaw is never wrapped, so that difference is always the short way round. Horizon keeps the player's yaw in -180..180, and a boat turns its rider through the wrap: for one tick the difference jumps by 360 degrees, the hands swing 36 degrees, then ease back by halves over the next ticks, which is the "slime or jelly" wobble the issue describes, after any turn that crosses the south/north line.

What changes

Both the easing and the sway read wrap_degrees(view - bob) (Mth.wrapDegrees), so the short way is taken across the wrap.

Verification

hand_sway_takes_the_short_way_over_the_yaw_wrap: after the view reads 179 for a while and then -179 (2 degrees on), the sway is under half a degree (the unwrapped difference would give about 36). The earlier boat-turn test (#4583) and the 17 first_person tests pass; clippy and rustfmt are clean for the changed file except the existing needless_borrow in horizon-world. I did not ride a boat across the wrap in game, and the reporter's video is not readable to me, so this is the cause I can show from the code, not a confirmed match for their clip.

Not done

If the wobble the video shows happens away from the yaw wrap, it has another cause.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/6451 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/hand-sway-yaw-wrap` --- ### 📝 Commits (1) - [`6aec3da`](https://github.com/horizon-rust/horizon/commit/6aec3da419c7a8ae11d2eafe5ae41afa5865f243) The hands' sway takes the short way round when the yaw wraps ### 📊 Changes **1 file changed** (+36 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/first_person.rs` (+36 -2) </details> ### 📄 Description > 🤖 Opened by xFedeT's AI agent (Claude Code, Sonnet 5.5), not by xFedeT personally. Fixes #5846 ## What was wrong `HandSway` (`first_person.rs`) eases `yBob` halfway to the view yaw each tick and sways the hands by a tenth of `viewYaw - yBob`. Vanilla's yaw is never wrapped, so that difference is always the short way round. Horizon keeps the player's yaw in -180..180, and a boat turns its rider through the wrap: for one tick the difference jumps by 360 degrees, the hands swing 36 degrees, then ease back by halves over the next ticks, which is the "slime or jelly" wobble the issue describes, after any turn that crosses the south/north line. ## What changes Both the easing and the sway read `wrap_degrees(view - bob)` (`Mth.wrapDegrees`), so the short way is taken across the wrap. ## Verification `hand_sway_takes_the_short_way_over_the_yaw_wrap`: after the view reads 179 for a while and then -179 (2 degrees on), the sway is under half a degree (the unwrapped difference would give about 36). The earlier boat-turn test (#4583) and the 17 `first_person` tests pass; clippy and rustfmt are clean for the changed file except the existing `needless_borrow` in `horizon-world`. I did not ride a boat across the wrap in game, and the reporter's video is not readable to me, so this is the cause I can show from the code, not a confirmed match for their clip. ## Not done If the wobble the video shows happens away from the yaw wrap, it has another cause. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:28:35 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#6883
No description provided.