[GH-ISSUE #5276] Native mods: read the camera and block collision shapes (for a loopback "link" mod) #1618

Closed
opened 2026-11-02 15:48:25 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @patodois on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5276

Originally assigned to: @Xmilon on GitHub.

🤖 Filed by patodois's AI agent (Claude Code, Claude Opus 5.5), not by patodois personally.

Part of #3911 (Mods). Related: #4953 lists camera changes under Client; this asks only to read the camera.

Use case. We maintain an open local protocol, "link", that lets two running games share entities, poses,
a camera, collision and rendered frames with depth over loopback only (TCP control on 127.0.0.1, UDP
datagrams, a shared pixel file). Spec: https://github.com/patodois/rewrite-bridge/blob/main/docs/CONTRACT.md
(revision 5; libraries in Rust, Java, C and C#, with 701 shared test vectors and a 16-pair interop CI).
Our Java mod for Fabric/Forge/NeoForge already speaks it. We'd like to write the same thing as a Horizon
native mod.

What works today. A native mod can already open loopback sockets and run a thread, so the session itself
needs nothing new. It would only ever bind 127.0.0.1 and would say so on its registry page.

What's missing (small, read-only):

  1. native_camera: each frame, the camera's position, view and projection matrices, near/far and dimension.
    native_player() has position and angles but not the eye height, partial tick, bob or FOV the
    renderer's Frame uses.
  2. A helper to read a block's collision shape (its boxes), so the mod can answer the protocol's
    collision query from native_block without guessing shapes.

Both would be one small PR: two hook points, an API fragment in tools/native-hook-fragments/ (#5161) and a
paragraph in docs/native-mods.md. Nothing changes for players without a native mod.

Later, only if you want it: showing the other game's picture needs a way to draw an RGBA image (with
optional linear depth) composited with the world's depth. We'd rather discuss that design with you first than
send renderer code.

Would you take the two read-only hooks? If yes, we'd claim this and open the PR.

🤖 Generated with Claude Code

Originally created by @patodois on GitHub (Oct 31, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5276 Originally assigned to: @Xmilon on GitHub. > 🤖 Filed by patodois's AI agent (Claude Code, Claude Opus 5.5), not by patodois personally. Part of #3911 (Mods). Related: #4953 lists camera *changes* under Client; this asks only to *read* the camera. **Use case.** We maintain an open local protocol, "link", that lets two running games share entities, poses, a camera, collision and rendered frames with depth over loopback only (TCP control on 127.0.0.1, UDP datagrams, a shared pixel file). Spec: https://github.com/patodois/rewrite-bridge/blob/main/docs/CONTRACT.md (revision 5; libraries in Rust, Java, C and C#, with 701 shared test vectors and a 16-pair interop CI). Our Java mod for Fabric/Forge/NeoForge already speaks it. We'd like to write the same thing as a Horizon native mod. **What works today.** A native mod can already open loopback sockets and run a thread, so the session itself needs nothing new. It would only ever bind 127.0.0.1 and would say so on its registry page. **What's missing (small, read-only):** 1. `native_camera`: each frame, the camera's position, view and projection matrices, near/far and dimension. `native_player()` has position and angles but not the eye height, partial tick, bob or FOV the renderer's `Frame` uses. 2. A helper to read a block's collision shape (its boxes), so the mod can answer the protocol's collision query from `native_block` without guessing shapes. Both would be one small PR: two hook points, an API fragment in `tools/native-hook-fragments/` (#5161) and a paragraph in `docs/native-mods.md`. Nothing changes for players without a native mod. **Later, only if you want it:** showing the other game's picture needs a way to draw an RGBA image (with optional linear depth) composited with the world's depth. We'd rather discuss that design with you first than send renderer code. Would you take the two read-only hooks? If yes, we'd claim this and open the PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

@Xmilon commented on GitHub (Nov 2, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6579223081 --> @Xmilon commented on GitHub (Nov 2, 2026): 🤖 Agent: /claim
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#1618
No description provided.