[PR #4114] [MERGED] Smooth the elytra body lean between ticks #5428

Closed
opened 2026-11-03 05:12:31 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4114
Author: @DUzzL
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @rdbtCVS

Base: main ← Head: fix/issue-4104-elytra-body-jitter


📝 Commits (4)

  • 5c4eb67 Interpolate elytra lean velocity from the previous tick
  • d14b3e2 Save the previous velocity for LAN guest bodies too
  • 3fa621d Save the previous velocity for remote players and test the elytra yaw lerp
  • 1ad4d86 Merge remote-tracking branch 'origin/main' into pr-4114

📊 Changes

5 files changed (+92 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/game/lan.rs (+1 -0)
📝 crates/horizon-client/src/game/perspective.rs (+1 -0)
📝 crates/horizon-client/src/game/remote.rs (+4 -0)
📝 crates/horizon-client/src/mobs.rs (+3 -0)
📝 crates/horizon-client/src/mobs/render.rs (+83 -1)

📄 Description

🤖 Opened by DUzzL's AI agent, not by DUzzL personally.

Fixes #4104

Cause: the elytra flight yaw term in base_transform_at (mobs/render.rs, the Y rotation from AvatarRenderer.extractFlightData) used the current tick's velocity, while head yaw, head pitch and body yaw were interpolated every frame. So the model's yaw stepped once per tick while turning. This is the yaw, not the body lean: the lean (-90 - pitch, scaled by the fall-fly ticks) is a separate pitch term that does not use velocity and is unchanged.

Change: Extra.previous_velocity (mobs.rs) keeps the previous tick's velocity. It is saved before the per-tick velocity write in game/perspective.rs (own body), in the LAN guest body path (game/lan.rs) and, for other players on a server, next to m.previous in the per-tick mob loop in game/remote.rs. The flight yaw lerps between the two velocities with the frame alpha. Walk-direction body-yaw logic is unchanged, and the lerp sits inside the elytra branch.

Tested: cargo test -p horizon-client --lib -- elytra, including a new test that the flight yaw at alpha 0.5 equals the yaw of the lerped velocity and differs from either tick's alone. cargo fmt --check, clippy, the python tests and python tools/pr_ready.py --quick pass except title::tests::each_world_preset_writes_its_own_generator, which fails on Windows with NotADirectory in the title world-preset code this PR does not touch.

Not tested: no in-game third-person elytra flight, so the jitter fix is not visually confirmed (this is covered by the unit test only). No vanilla source comparison beyond the 26.3 description in review. No parity harness run (no .local vanilla data here).


🔄 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/4114 **Author:** [@DUzzL](https://github.com/DUzzL) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/issue-4104-elytra-body-jitter` --- ### 📝 Commits (4) - [`5c4eb67`](https://github.com/horizon-rust/horizon/commit/5c4eb67ba220330d08eb9ec210258e503fb6a6a3) Interpolate elytra lean velocity from the previous tick - [`d14b3e2`](https://github.com/horizon-rust/horizon/commit/d14b3e27ba10b4e925ac3f391e65867ca30a90e2) Save the previous velocity for LAN guest bodies too - [`3fa621d`](https://github.com/horizon-rust/horizon/commit/3fa621d254fd4b548e72a96500b17bf94ef59047) Save the previous velocity for remote players and test the elytra yaw lerp - [`1ad4d86`](https://github.com/horizon-rust/horizon/commit/1ad4d8633b6bf814061b9957f4517e044e5de448) Merge remote-tracking branch 'origin/main' into pr-4114 ### 📊 Changes **5 files changed** (+92 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lan.rs` (+1 -0) 📝 `crates/horizon-client/src/game/perspective.rs` (+1 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+4 -0) 📝 `crates/horizon-client/src/mobs.rs` (+3 -0) 📝 `crates/horizon-client/src/mobs/render.rs` (+83 -1) </details> ### 📄 Description > 🤖 Opened by DUzzL's AI agent, not by DUzzL personally. Fixes #4104 **Cause:** the elytra flight yaw term in `base_transform_at` (`mobs/render.rs`, the `Y` rotation from `AvatarRenderer.extractFlightData`) used the current tick's velocity, while head yaw, head pitch and body yaw were interpolated every frame. So the model's yaw stepped once per tick while turning. This is the yaw, not the body lean: the lean (`-90 - pitch`, scaled by the fall-fly ticks) is a separate pitch term that does not use velocity and is unchanged. **Change:** `Extra.previous_velocity` (`mobs.rs`) keeps the previous tick's velocity. It is saved before the per-tick velocity write in `game/perspective.rs` (own body), in the LAN guest body path (`game/lan.rs`) and, for other players on a server, next to `m.previous` in the per-tick mob loop in `game/remote.rs`. The flight yaw lerps between the two velocities with the frame alpha. Walk-direction body-yaw logic is unchanged, and the lerp sits inside the elytra branch. **Tested:** `cargo test -p horizon-client --lib -- elytra`, including a new test that the flight yaw at alpha 0.5 equals the yaw of the lerped velocity and differs from either tick's alone. `cargo fmt --check`, clippy, the python tests and `python tools/pr_ready.py --quick` pass except `title::tests::each_world_preset_writes_its_own_generator`, which fails on Windows with `NotADirectory` in the title world-preset code this PR does not touch. **Not tested:** no in-game third-person elytra flight, so the jitter fix is not visually confirmed (this is covered by the unit test only). No vanilla source comparison beyond the 26.3 description in review. No parity harness run (no `.local` vanilla data here). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:12:31 +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#5428
No description provided.