What it does
game.physics3d.bind(object, options) gives an object a body. The engine's primitives are unit-sized, so an object's
scale is its world size, and the shape comes from it: a box by default, a sphere, an upright capsule, or a convex hull
of points you build with hull-3d. A one-by-one-by-one box has a mass of 1, so no units table is needed, and impulses
are scaled by mass, so impulse({ y: 6 }) pops a crate and a boulder alike.
The one rule to hold on to is who owns the transform. A dynamic body owns it: steer it with impulse, force,
velocity or spin, and move it outright only with teleport, which clears its velocity so a respawn does not smear
across the map. A kinematic body is the reverse: you move the object and physics pushes dynamic bodies out of its way,
for moving platforms, doors on rails and lifts. A static body is level geometry. Poses are written at the fixed step,
and the engine's own interpolation carries them smoothly to any refresh rate.
Collision filtering is said in names: a body's group is what it is and hits is what it collides with. A family is
separate: bodies sharing one never collide with each other, which is what a ragdoll's overlapping limbs need. Triggers
report onEnter and onExit and apply no force; ordinary bodies report onTouch, onRelease, and onHit with the
approach speed, so impact sounds can be kept for real hits rather than a pile of resting crates.
Features
- Shapes from size — box, sphere, upright capsule or convex hull, sized from the object's scale, with mass from density or a total.
- Body options — friction, bounce, rolling resistance, damping, gravity scale, locked rotation, a centre-of-mass
offset (
balance), conveyor surfaces, and continuous collision (fast) for fast movers. - A character controller — a capsule with
move,groundedandjump, which pushes crates and rides platforms. - Seven joints —
hinge,socket(with a swing cone, twist limits and a rest-pose spring),slider,wheel(suspension, drive and steering in one),spring,grabandweld; a motor wakes its bodies. - Queries —
raycastwith a body to ignore,raycastAllnearest first, sphere and box overlaps, and a mass-scaledexplosionwith a little lift. - Triggers and contact callbacks — enter and exit for triggers; touch, release and hit with speed for everything else.
- Named groups and families — filtering without bitmasks, and ragdolls that do not fight themselves.
- A headless world —
createRigidWorld3druns the same solver without a renderer, withresetfor repeatable replays.
Good for
- Physics playgrounds and destruction — stacks of crates that topple, and a blast that scatters a room.
- Driving games — a chassis, four wheel bodies and four wheel joints make a car with suspension and steering.
- 3D platformers and adventures — the capsule controller on floors and moving platforms, pushing crates as it goes.
- Ragdolls — socket joints with swing cones, and families so the limbs overlap in peace.
- Contraptions — doors on hinges, elevators on sliders, cranes on springs, conveyors and tractor beams.
- Puzzle rules that need real motion — checked headless with the standalone rigid world.
Make it yours
The pack options are gravity (a number straight down or a full vector; the default of −20 is arcade-weighty rather
than real), substeps (4, more for taller stacks) and module, to point development builds at another copy of the
core. Gravity can change at any time, and every body takes its own friction, bounce, damping, gravity scale and
filtering.
Two different uses: a stunt-driving game where a chassis with balance: { y: -0.4 } carries its weight low, four wheel
joints give it suspension, drive and steering, and ramps and conveyor belts are static bodies; and a ragdoll brawler
where every doll's limbs share a family, sockets join them with swing limits and a little rest-pose stiffness, and
explosion throws them about.
A quick look
Wait for the core, then bind the level and kick a crate:
game.scenes.register({ name: 'level', async enter() {
await game.physics3d.ready;
game.physics3d.bind(ground, { type: 'static' });
const crate = game.physics3d.bind(box, { friction: 0.6, bounce: 0.2 });
crate.impulse({ y: 6 }); // mass-scaled: the same pop for any crate
} });
Works with
world-3d— the 3D world the bodies live in.hull-3d— builds the convex point cloud for a hull shape from a loaded model.collision-3d— overlap rules by tag, which run after the physics, for pickups and triggers that need no solver.physics-rope— ropes, cords and chains that can be tied to these bodies.
Good to know
- There is one world for the game:
clear()empties it between levels, and there is no world per scene. bindthrows untilgame.physics3d.readyresolves, so a scene awaits it first.- A hull is convex, so a donut's hull is a solid disc, and continuous collision is for the primitive shapes only.
- The pack has no ropes of its own; compose
physics-ropefor those. - A body tumbling exactly through the pitch pole can see yaw and roll swap in its raw numbers, though the drawn orientation stays right.
Changes
3.0.0-4 (2026-10-26)
- Changed: the
moduleoption only loads the core from the game's own origin; a URL on another origin, or adata:URL, is refused. Standalone builds embed the core and are unaffected.






