Glossary · Physics simulation
Collision geometry
Also called collider, geom, capsule, collision shape
The simple shapes a physics engine uses to work out what is touching what: spheres, capsules, boxes and meshes.
Checking whether two detailed body meshes touch is slow. Physics engines instead give each part one or more simple shapes, and only test those. These colliders (in MuJoCo, geoms) can be different from what you see on screen.
| shape | good for | contact test |
|---|---|---|
| sphere | heels, joints, heads | very cheap: compare the distance between centres with the radii |
| capsule | limbs: a cylinder with rounded ends | cheap: distance between two line segments |
| box | feet, fists, flat surfaces | moderate |
| mesh | detailed shapes | expensive |
A capsule is the set of all points within radius of a line segment. Two capsules touch when the shortest distance between their segments is less than the sum of their radii:
That makes capsules the standard choice for arms and legs: they’re rounded like limbs and very cheap to test.
Shapes and mass
Collision shapes often also set a part’s mass and inertia, from their volume and a density. A body built from capsules can still have realistic mass if each part’s mass is set separately.
In this project
The simple body v2 has 23 colliding shapes: one capsule per segment, box fists, and box feet with a heel sphere and a toe capsule. Each segment’s mass, centre of mass and inertia are copied from the muscular body rather than computed from the capsules, so the two bodies balance the same way. The simple body’s physics step costs 161 µs, against 423 µs for the muscular one.