[PR #3104] [MERGED] client: aim every crosshair target along one ray (VR groundwork) #4807

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3104
Author: @Expected333
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @ludovic111

Base: main ← Head: vr/aim-ray


📝 Commits (3)

  • b78ff5f client: aim every crosshair target along one ray (VR groundwork)
  • 5c0f6aa Merge origin/main into vr/aim-ray
  • 70b5133 Merge origin/main into vr/aim-ray

📊 Changes

12 files changed (+30 additions, -38 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+10 -6)
📝 crates/horizon-client/src/game/armor_stands.rs (+2 -3)
📝 crates/horizon-client/src/game/boats.rs (+2 -4)
📝 crates/horizon-client/src/game/cushions.rs (+2 -3)
📝 crates/horizon-client/src/game/deflect.rs (+1 -2)
📝 crates/horizon-client/src/game/dragon.rs (+1 -2)
📝 crates/horizon-client/src/game/frames.rs (+3 -4)
📝 crates/horizon-client/src/game/lan_pvp.rs (+2 -3)
📝 crates/horizon-client/src/game/minecarts.rs (+2 -3)
📝 crates/horizon-client/src/game/mods.rs (+1 -2)
📝 crates/horizon-client/src/game/paintings.rs (+2 -3)
📝 crates/horizon-client/src/game/remote_vehicles.rs (+2 -3)

📄 Description

🤖 Opened by Expected333's AI agent (Claude), not by Expected333 themself.

Groundwork for VR: every crosshair target is found along one ray, Game::aim(), instead of each *_hit rebuilding eye_position() + view_vector(yaw, pitch) itself. A tracked controller can later replace that ray in one place. No visible change (label wanted: skip-release; I can't set labels from a fork).

What changes

  • game.rs: new fn aim(&self) -> Option<([f64; 3], [f64; 3])>, which returns the eyes and the view direction, exactly as before.
  • These now go through it: pick, pick_fluid, mob_hit, armor_stand_hit, boat_hit, place_boat, cart_hit, cushion_hit, dragon_hit, frame_hit / before_block, guest_hit, mod_view_hit, painting_hit, redirectable_hit, remote_object_hit.
  • Left on the head on purpose: what a player looks at (looking_at_entity), and what is thrown or shot from the head (spear jab, deflect, crossbow, trident, fishing, fireworks, potions). In VR those follow the head or the hand for their own reasons, so they move in their own PRs.

Why behaviour is identical

aim() returns (self.eye_position()?, view_vector(self.yaw, self.pitch)), the same expressions every call site used, evaluated in the same order. No arithmetic moved.

Self-check

pr_ready (tools/pr_ready.py --quick on a4a98c4f63f3, against origin/main at 56f968e11, 1 min 45 s)

Check Result
Scope ✅ 12 files, +30 −38
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 398 passed (33 s)
rustfmt ✅ (7 s)
clippy ✅ (44 s)
tests: horizon-client ✅ 1261 passed (19 s)
doc tests ✅ 0 passed (2 s)
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses

Not run here: the harnesses and an in-game check. There is no vanilla data in .local/ on this machine.

🤖 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/3104 **Author:** [@Expected333](https://github.com/Expected333) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `vr/aim-ray` --- ### 📝 Commits (3) - [`b78ff5f`](https://github.com/horizon-rust/horizon/commit/b78ff5f55e594a1754227bb210bda44824140076) client: aim every crosshair target along one ray (VR groundwork) - [`5c0f6aa`](https://github.com/horizon-rust/horizon/commit/5c0f6aa56c307299184918cdb3e3539fd9012f4a) Merge origin/main into vr/aim-ray - [`70b5133`](https://github.com/horizon-rust/horizon/commit/70b51333d352c531b9f446672b93cdb9784d26d7) Merge origin/main into vr/aim-ray ### 📊 Changes **12 files changed** (+30 additions, -38 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+10 -6) 📝 `crates/horizon-client/src/game/armor_stands.rs` (+2 -3) 📝 `crates/horizon-client/src/game/boats.rs` (+2 -4) 📝 `crates/horizon-client/src/game/cushions.rs` (+2 -3) 📝 `crates/horizon-client/src/game/deflect.rs` (+1 -2) 📝 `crates/horizon-client/src/game/dragon.rs` (+1 -2) 📝 `crates/horizon-client/src/game/frames.rs` (+3 -4) 📝 `crates/horizon-client/src/game/lan_pvp.rs` (+2 -3) 📝 `crates/horizon-client/src/game/minecarts.rs` (+2 -3) 📝 `crates/horizon-client/src/game/mods.rs` (+1 -2) 📝 `crates/horizon-client/src/game/paintings.rs` (+2 -3) 📝 `crates/horizon-client/src/game/remote_vehicles.rs` (+2 -3) </details> ### 📄 Description > 🤖 Opened by Expected333's AI agent (Claude), not by Expected333 themself. Groundwork for VR: every crosshair target is found along one ray, `Game::aim()`, instead of each `*_hit` rebuilding `eye_position()` + `view_vector(yaw, pitch)` itself. A tracked controller can later replace that ray in one place. **No visible change** (label wanted: `skip-release`; I can't set labels from a fork). ## What changes - `game.rs`: new `fn aim(&self) -> Option<([f64; 3], [f64; 3])>`, which returns the eyes and the view direction, exactly as before. - These now go through it: `pick`, `pick_fluid`, `mob_hit`, `armor_stand_hit`, `boat_hit`, `place_boat`, `cart_hit`, `cushion_hit`, `dragon_hit`, `frame_hit` / `before_block`, `guest_hit`, `mod_view_hit`, `painting_hit`, `redirectable_hit`, `remote_object_hit`. - Left on the head on purpose: what a player *looks at* (`looking_at_entity`), and what is thrown or shot from the head (spear jab, deflect, crossbow, trident, fishing, fireworks, potions). In VR those follow the head or the hand for their own reasons, so they move in their own PRs. ## Why behaviour is identical `aim()` returns `(self.eye_position()?, view_vector(self.yaw, self.pitch))`, the same expressions every call site used, evaluated in the same order. No arithmetic moved. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on a4a98c4f63f3, against origin/main at 56f968e11, 1 min 45 s) | Check | Result | | --- | --- | | Scope | ✅ 12 files, +30 −38 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 398 passed (33 s) | | rustfmt | ✅ (7 s) | | clippy | ✅ (44 s) | | tests: horizon-client | ✅ 1261 passed (19 s) | | doc tests | ✅ 0 passed (2 s) | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | Not run here: the harnesses and an in-game check. There is no vanilla data in `.local/` on this machine. 🤖 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:08:06 +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#4807
No description provided.