Repository navigation
fix(render): Vehicle rendering: passenger seating, alignment, and boat water mask - #85
Conversation
Apply the boat-specific yaw offset at mesh level so rendered bows follow the physics heading. Add coverage for boat and raft entity variants.
Keep the controlled boat aligned with camera-smoothed movement while preserving its authoritative height. Add a vanilla-shaped depth mask and opaque hull ordering to hide water inside boats.
|
@sandexzx does renderer also render mounted vehicle entities correctly as well? Eg would other players see a player riding the boat or other vehicle correctly? I can add "sit" animation for the correct pose to display |
Render remote boat passengers at vanilla seat offsets and keep their positions synchronized with the interpolated boat movement. Release the passenger position when it is detached from the boat.
|
I tested this from another player's perspective and pushed the fixes. Remote boat passengers are now propagated from Mineflayer through the web client and anchored to the interpolated boat position in the renderer. This fixes the player drifting away from the boat and handles attach, detach, and vehicle changes. The remaining issue is the pose: the passenger coordinates use the vanilla seated offset, but the player model is still rendered in the standing/walking pose, which makes it appear partially inside the boat. As you mentioned, adding a I have only tested this behavior with boats. The Mineflayer attach/detach changes are vehicle-agnostic and may help with other mounted entities, but the renderer-side positioning currently uses boat-specific seat offsets and logic. Correct rendering for other vehicles is therefore not guaranteed and should be implemented and tested separately. |
|
Awesome, good. yes we can do basic horse/minecart riding as follow-up, feel free to push commits in existing PRs |
|
i will add "sit" animation pose tomorrow, thanks |
Generalize passenger anchoring for boats and minecarts and align local and remote riders with the minecart seat. Smooth server-authoritative camera movement, keep vehicle and camera interpolation synchronized, and preserve remote head pitch across animation frames.
Keep the driver's minecart aligned with the interpolated camera instead of running an independent position tween. Preserve ordinary interpolation for remote minecarts and keep passenger anchoring synchronized with the rendered vehicle position.
Anchor local and remote passengers to interpolated horse positions using variant-specific vanilla seat offsets. Add a riding player pose and release passenger anchors cleanly after dismounting.
Resolve the controlled horse height from the camera position to prevent vertical jitter during jump interpolation.
As I understand it's not needed anymore |
- Match Minecraft 1.17.1 riding limb rotations and preserve them during arm swings. - Anchor local boat and minecart bodies to rendered seat positions without moving the camera. - Correct the 1.17.1 minecart passenger offset and preserve the existing local horse path. - Add finite-coordinate guards, anchor release handling, and production-path tests. Boat leg clipping and the horse model gap remain visual follow-up work.
- Lower the boat OBJ hull by 0.125 while preserving the water patch height. - Apply vanilla entity scales for horse, donkey, mule, skeleton horse, and zombie horse models. - Use vanilla ZYX riding-leg rotations with skinview3d axis conversion. - Resolve shared transforms for normalized entity types and add regression coverage for boat bounds, horse scales, and riding matrices.
Add time-based paddle animation using the vanilla 1.17.1 phase and rotation formulas. Group each paddle under a shared pivot, move the paddle geometry to the corrected oarlock position, and update both sides from render hints each frame. Preserve the static OBJ rest pose and water patch behavior.
Render anchored remote players with the boat body yaw and apply the network look direction as relative head rotation. Restore the generic player pose after dismounting.
Mineflayer notch pitch and vanilla gait now map to Three.js rotation.x with the same sign the horse OBJ expects: look-down stays negative and gait subtracts from pitch.
Render-only prediction removes head jitter when turning while mounted; physics and network yaw updates stay on the 20 Hz tick.
|
@sandexzx lets update physics module in client repo and merge this |
Vehicle rendering: passenger seating, alignment, and boat water mask
Context
The renderer had several visible issues with ridden vehicles (boats, horses,
and minecarts):
the player camera, causing relative drift and short forward/backward jumps
(boats, and later horses on jump and locally ridden minecarts).
vanilla's depth-only water patch.
vehicle seats, so riders drifted on their own tween instead of following the
vehicle across boats, horses, and minecarts.
up/down correctly.
Root causes
Local vehicle jitter
The camera and entity renderer maintained separate interpolation state. Deriving
a vehicle offset from asynchronously updated player and vehicle snapshots
produced a stale horizontal offset during acceleration and input release. The
same class of problem affected locally ridden horses (during jumps) and
locally ridden minecarts.
Passenger seat anchoring
Passengers were positioned by their own entity tween rather than pinned to the
vehicle's seat, so remote riders lagged or drifted relative to the vehicle.
Water inside the hull
Vanilla boats render a dedicated water-mask patch. The renderer had no
equivalent geometry, and an opaque depth mask cannot reliably occlude water
while the hull remains in Three.js's transparent render list.
Model heading
The OBJ boat model's forward axis differs from the physics forward axis by 90
degrees.
Fix
Alignment / interpolation
visibility.
preserve authoritative vehicle Y instead of copying camera height.
and to locally ridden minecarts (camera-synced); render remote minecart
passengers smoothly.
Passenger seating
passenger-anchoring helper, using vanilla-sourced seat offsets for boats,
minecarts, and horses (including donkey/mule/skeleton-horse variants).
Boat water mask
bounds.
Testing
Focused unit and integration coverage was added for:
hull/patch render ordering;
intermediate acceleration/input-release frames, and preserving vehicle Y
independently from camera Y;
Manual validation (Minecraft 1.17.1) confirmed:
Related PRs
Scope
The renderer changes are generic and can merge independently; the complete
controlled-vehicle behavior becomes active when the related web-client
integration is present.
There is no runtime version gate in the renderer. The only version-specific
pieces are hardcoded constants sourced from vanilla 1.17.1 — passenger seat
offsets and the boat water-patch bounds. They render on any version; on versions
whose vanilla seat/attachment values differ, a rider may sit slightly high or
low, which would be corrected by per-version constants in a follow-up.
The one remaining item across all three vehicles is the seated rider pose:
passengers are seated at the correct position but are still rendered standing
(the vanilla sitting pose is not applied yet). This is being finished.