Skip to content

[feat] roadmap 13 batch C - physics usability + car playability - #35

Merged
AlexZ005 merged 4 commits into
mainfrom
feature/roadmap-13-physics-car
Jul 21, 2026
Merged

[feat] roadmap 13 batch C - physics usability + car playability#35
AlexZ005 merged 4 commits into
mainfrom
feature/roadmap-13-physics-car

Conversation

@AlexZ005

Copy link
Copy Markdown
Collaborator

Batch C - Physics usability + car playability (roadmap #13, lane 1)

C1 - physics discoverability (1edf8be)

  • Inspector scene mode gains a Physics section: one row per object that gets a body at sim start (userData.physics + flow Mass overrides, provenance-flagged), row click selects, plus an Enable physics on selection quick action (dynamic mass 1 via the existing objectParameters replication, props undo entries).
  • Clearer startSimulation fallback toasts: they say WHY and point at Inspector > Physics.

C2 - angular velocity + motor nodes, torque SDK (0a795ce)

  • New Physics flow nodes: angularvelocity (axis + rad/s; setAngvel at sim start, wiring it alone implies dynamic mass 1) and motor (drives every revolute joint touching the selected object, wins over the joint def motor).
  • Node param edits re-apply live mid-sim on the stepping peer (change-detected graph subscriptions, cleared on stop).
  • api.physics.applyTorqueImpulse(uuid, torque) (initiator-only). NODES.md / MODULES.md updated.
  • Sync model: authoritative (initiator applies, motion rides move broadcasts).

C3 - car playability + blow-up ROOT FIX (9751d0a)

  • Root cause of the car blow-up found: rapier revolute() takes ONE axis interpreted in BOTH bodies local frames; hull bodies carried the object rotation, so the z-rotated wheel hulls hinged about an axis 90 degrees off the body half and the solver launched the assembly. Hull colliders now bake rotation into their vertices (like scale) so every body starts world-aligned; the hull special-case in the joint anchor math is gone. The car now sits perfectly still and drives upright.
  • Play gate: claims work anytime; driving + the chase camera engage only in Play mode with a running sim. Engagement claims keys (kills WASD-flies-camera / pauses play-mode walking) and disengages on exit/release.
  • Chase cam via the possess path: chaseCamera() extracted, new camera-only startFollowCam/stopFollowCam + followingCam store.
  • Tuning (stable and grippy): FORCE 300->120, MAX_VEL 14->10, STEER_VEL 8->6, wheel friction 1.4->1.1, body mass 20->30, stance 1.15->1.3.

Verification

  • New suites: physics-discoverability (11 checks), flow-physics-nodes (two-peer, 10 checks); car-module extended to 16 checks (gate, engagement, chase cam, upright-through-drive).
  • physics, physics-kinematic, physics-joints, possess suites green; physics-joints motor phase made robust (wheel hinged in the air + polled read - the grounded layout could contact-lock and stall).
  • npm run build green; svelte-check holds the 501/77 baseline on all three commits.

🤖 Generated with Claude Code

AlexZ005 and others added 4 commits July 21, 2026 20:56
- Inspector scene mode gains a Physics section: rows for every object
  that gets a body at sim start (userData.physics + flow Mass overrides,
  provenance-flagged via collectParams), row click selects
- Enable physics on selection quick action: dynamic mass 1 through the
  existing objectParameters replication + a props undo entry per object
- clearer startSimulation fallback toasts: say WHY and point at the
  Inspector Physics section
- new e2e suite physics-discoverability (11 checks)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- new Physics nodes: angularvelocity (axis + rad/s, setAngvel at sim
  start, wiring it alone implies dynamic mass 1) and motor (drives every
  revolute joint touching the selected object, wins over the joint def)
- node param edits re-apply LIVE mid-sim on the stepping peer
  (change-detected flowNodes/flowEdges subscriptions, cleared on stop)
- api.physics.applyTorqueImpulse(uuid, torque) - initiator-only spin
- authoritative sync: initiator applies, motion rides move broadcasts
- new two-peer e2e suite flow-physics-nodes (10 checks)
- physics-joints motor phase made robust: wheel hinged in the air (the
  grounded layout could contact-lock and stall the motor) + polled read
- NODES.md / MODULES.md documented

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- ROOT CAUSE of the car blow-up found and fixed: rapier revolute() takes
  ONE axis interpreted in BOTH bodies LOCAL frames; hull bodies carried
  the object rotation, so the z-rotated wheel hulls hinged about an axis
  90 degrees off the body half and the solver launched the assembly.
  Hull colliders now bake rotation into their vertices (like scale) so
  EVERY body starts world-aligned - one world axis is valid everywhere,
  and the hull special-case in the joint anchor math is gone
- play-gate: claims work anytime, but driving + the chase camera engage
  only in Play mode with a running simulation; engagement claims keys
  (pausing play-mode walking) and disengages on exit/release
- chase cam reuses the possess path: chaseCamera() extracted, new
  camera-only startFollowCam/stopFollowCam + followingCam store
  (stops on VR entry like possess)
- tuning: FORCE 300->120, MAX_VEL 14->10, STEER_VEL 8->6, wheel friction
  1.4->1.1, body mass 20->30, stance 1.15->1.3 (stable and grippy)
- car-module e2e extended: no-keys-outside-play gate, engagement claims,
  chase-cam follow + restore, upright-through-drive check (16 checks)
- MODULES.md car recipe updated

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@AlexZ005
AlexZ005 merged commit 8d8e2f2 into main Jul 21, 2026
@AlexZ005
AlexZ005 deleted the feature/roadmap-13-physics-car branch August 5, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant