[PR #3890] [CLOSED] Third person: the player model's head pitch follows the mouse without interpolation #5271

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3890
Author: @xFedeT
Created: 10/29/2026
Status: ❌ Closed

Base: main ← Head: fix/third-person-head-pitch


📝 Commits (2)

  • 53157fe Third person: the player model's head pitch follows the mouse without interpolation
  • 81cc3bb Merge remote-tracking branch 'origin/main' into fix/third-person-head-pitch

📊 Changes

3 files changed (+36 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+6 -0)
📝 crates/horizon-client/src/game/agent.rs (+2 -0)
📝 tools/lan_e2e.py (+28 -0)

📄 Description

🤖 Opened by Federico's AI agent (Claude), not by Federico himself.

Fixes #3844. Checked: no open PR touches the third-person head pitch. The issue is not claimed in Kira yet (rate limit and the 8-claim cap); I left a comment on it and will claim it when I can.

What and why

In third person the player model's head pitch lagged behind the mouse: it was interpolated between the pitch of the last tick and the current one. In vanilla Entity.turn moves xRotO together with xRot, so the rendered pitch (lerp(partialTick, xRotO, xRot)) is the current one every frame and mouse turns are never interpolated (the first-person camera already did this: x_rot_o: self.pitch).

Change

  • game.rs apply_mouse_look: the model's head_pitch and previous_head_pitch follow the mouse turn, as xRotO does.
  • game/agent.rs: state reports model_head_pitch ([previous, current]) for the check below.

Vanilla reference

Entity.turn, LivingEntityRenderer.extractRenderState (xRot).

Testing

  • New lan_e2e --check head_pitch (host and guest): in third person, turning the view by +35, -50 and +20 degrees over 0.4 s, the model's previous and current head pitch both equal the view pitch right after. On main it fails (head [31.47, 34.45] for a view pitch of 35).
  • pr_ready --quick: Python tests (444), rustfmt and clippy pass; horizon-client tests: 674 pass, 1 fails on main too (entity_nbt::axolotl_nbt_tests::bucket_cooldown_and_brain_memories_survive_and_expired_cooldown_is_removed), fixed by the open #3851.

🤖 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/3890 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 10/29/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/third-person-head-pitch` --- ### 📝 Commits (2) - [`53157fe`](https://github.com/horizon-rust/horizon/commit/53157fe190f902bc0ba8a9c345b755ea6370405e) Third person: the player model's head pitch follows the mouse without interpolation - [`81cc3bb`](https://github.com/horizon-rust/horizon/commit/81cc3bbf251b400cc74101cbc69e638efb9b41d4) Merge remote-tracking branch 'origin/main' into fix/third-person-head-pitch ### 📊 Changes **3 files changed** (+36 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+6 -0) 📝 `crates/horizon-client/src/game/agent.rs` (+2 -0) 📝 `tools/lan_e2e.py` (+28 -0) </details> ### 📄 Description > 🤖 Opened by Federico's AI agent (Claude), not by Federico himself. Fixes #3844. Checked: no open PR touches the third-person head pitch. The issue is not claimed in Kira yet (rate limit and the 8-claim cap); I left a comment on it and will claim it when I can. ## What and why In third person the player model's head pitch lagged behind the mouse: it was interpolated between the pitch of the last tick and the current one. In vanilla `Entity.turn` moves `xRotO` together with `xRot`, so the rendered pitch (`lerp(partialTick, xRotO, xRot)`) is the current one every frame and mouse turns are never interpolated (the first-person camera already did this: `x_rot_o: self.pitch`). ## Change - `game.rs` `apply_mouse_look`: the model's `head_pitch` and `previous_head_pitch` follow the mouse turn, as `xRotO` does. - `game/agent.rs`: `state` reports `model_head_pitch` (`[previous, current]`) for the check below. ## Vanilla reference `Entity.turn`, `LivingEntityRenderer.extractRenderState` (`xRot`). ## Testing - New `lan_e2e --check head_pitch` (host and guest): in third person, turning the view by +35, -50 and +20 degrees over 0.4 s, the model's previous and current head pitch both equal the view pitch right after. On `main` it fails (`head [31.47, 34.45]` for a view pitch of 35). - `pr_ready --quick`: Python tests (444), rustfmt and clippy pass; `horizon-client` tests: 674 pass, 1 fails on `main` too (`entity_nbt::axolotl_nbt_tests::bucket_cooldown_and_brain_memories_survive_and_expired_cooldown_is_removed`), fixed by the open #3851. 🤖 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 05:11:25 +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#5271
No description provided.