Skip to content

v0.13.0

@bbohlender bbohlender tagged this 28 Sep 18:58
Every prepare, twice per step, rebuilt a JSON key from each body's
colliders: getColliders, transform decompositions and JSON.stringify,
and every body was validated twice. Almost nothing changes between steps.

Change detection now reads one flat list: object identities, settings,
material and joint versions, each owner's world scale, and for each
collider source the local matrices from it up to its owner, with its
settings and geometry versions. The sources come from colliderSources,
now split out of RigidBody and Trigger getColliders so both share one
rule. Physics never writes those local matrices, so moving bodies, and
cameras or triggers moved inside them, read the same list. An equal list
reuses the compiled model; a different one validates colliders and
scales, recompiles and commits it. Three.js transforms have no change
hooks, so the local matrices stand in for a version counter where the
library does not own the setters. The JSON key is gone, and each body is
validated once per prepare.

A driven six-joint arm at 500 Hz steps 19-22% faster
(packages/physics-mujoco/bench/arm.ts, pnpm bench:arm).

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Assets 2
Loading