Number of dynamic bodies currently simulated (for HUD readouts).
Cached PBR material keyed by color + roughness + metallic.
Spawns a box. half is the half-extent on each axis. Returns the Jolt body.
Spawns a sphere. Returns the Jolt body.
Adds a large static ground slab (a thin box) plus its visual. The top surface sits at y = 0.
Convenience for an immovable box (walls, ramps, anchors).
Adds a static triangle-mesh collider (MeshShape) for arbitrary geometry
— renderMesh is drawn, positions/indices are the same triangles handed
to Jolt. Used for the wavy/ramp surface demo.
Adds a static height-field collider (HeightFieldShape) — the fast
terrain path. renderMesh and the height grid come from the same generator.
Spawns a dynamic convex-hull body (ConvexHullShape). hull is the
point cloud; renderMesh is the matching solid.
Links two bodies with a point (ball-and-socket) constraint anchored at a shared world-space pivot. The bread-and-butter joint for chains/pendulums.
Copies each dynamic body's transform onto its GameObject. Call per frame.
Tears the demo down: removes every GameObject and clears the physics world.
WebGPU device, exposed so demos can build their own render meshes.