Rigid body simulation

On this page 8

Rigid body simulation is the numerical computation of how solid objects that never deform move, rotate, collide and come to rest under forces such as gravity, impacts and constraints. Within 3D graphics & animation, and specifically in the field of Simulation & effects, it drives falling debris, tumbling dice, collapsing stacks of crates and the large-scale motion of fractured buildings.

The defining assumption is that the distance between any two points on a body stays constant, so each object is described by only six degrees of freedom: three for position and three for orientation. This simplification makes the method far cheaper than soft body or cloth simulation, which is why rigid body solvers run in real time in games and scale to tens of thousands of pieces in film effects.

How a rigid body solver advances each frame

A rigid body solver repeats a fixed loop on every time step: it integrates forces into velocities, detects contacts, resolves those contacts and then integrates velocities into new positions. Each body stores its mass, its center of mass, an inertia tensor that describes resistance to rotation, and its current linear and angular velocity.

Collision handling is split into two phases. The broad phase quickly discards pairs that cannot touch, typically with bounding volume hierarchies or sweep-and-prune over axis-aligned boxes. The narrow phase then computes exact contact points, normals and penetration depths between candidate shapes, often with the GJK and EPA algorithms for convex geometry.

Most production solvers resolve contacts with impulse-based methods or a sequential impulse variant of projected Gauss-Seidel iteration. The solver applies small corrective impulses at each contact until bodies stop interpenetrating and friction limits are respected. The number of solver iterations therefore controls how firmly stacks hold together.

The following table summarizes the stages of a typical step and the main setting that governs each one.

StageWhat happensKey setting
Force integrationGravity and fields update velocitiesTime step size
Broad phaseCandidate pairs are found cheaplyBounding volume margin
Narrow phaseExact contacts and normals are computedCollision shape type
Contact resolutionImpulses remove overlap and apply frictionSolver iterations
Position integrationBodies move to their new transformsSubsteps per frame
Stages of one rigid body time step

Physical properties that shape rigid body motion

The believability of a rigid body result depends mostly on a handful of material and mass parameters. Artists often leave them at defaults and then wonder why a steel beam behaves like a cardboard box; matching density, friction and bounciness to the real material is the first correction to make.

The table lists the parameters exposed by nearly every solver, their usual range and their visible effect.

ParameterTypical rangeVisible effect
Mass or densityReal-world kg or kg/m³Momentum transfer in collisions
Friction0.0 to about 1.0Sliding versus gripping on contact
Restitution (bounciness)0.0 to about 0.9Energy kept after an impact
Linear damping0.0 to 0.1 per secondGradual loss of travel speed
Angular damping0.0 to 0.1 per secondGradual loss of spin
Collision marginA few millimeters at scene scaleGap that stabilizes contacts
Core rigid body parameters

Scene scale matters as much as the values themselves. Solvers assume meters by default, so a model built in centimeters falls a hundred times too slowly relative to its size and looks like a miniature. Restitution above 1.0 adds energy and should never be used for physical realism.

Collision shapes and their accuracy trade-offs

Every rigid body needs a collision shape, a simplified proxy that the solver tests instead of the render mesh. The choice of proxy is the main trade-off between speed and accuracy: primitive shapes are fast and stable, while mesh shapes follow the silhouette closely but cost more and can jitter.

ShapeSpeedBest use
Sphere, box, capsuleFastestBalls, crates, limbs, props
Convex hullFastRocks, debris chunks, most fragments
Convex decompositionModerateConcave props such as chairs or cups
Triangle meshSlowestStatic ground and passive colliders
Signed distance fieldModerateComplex static environments
Common collision shape types

A useful rule is that moving objects use convex shapes and static objects may use triangle meshes. A dynamic object with a concave mesh shape tends to snag, explode apart or sink into the ground, because contact normals on thin triangles are poorly defined.

Rigid bodies compared with other simulation types

Rigid body simulation is one member of a family of physics techniques, and choosing the right one depends on whether the material deforms and how. The comparison below places it next to neighboring methods in the same toolkit.

MethodDeformationTypical subjects
Rigid body simulationNoneDebris, props, dice, vehicles
Soft body simulationElastic, volume-preservingJelly, flesh, rubber
Cloth simulationThin-shell bendingGarments, flags, curtains
Granular simulationBulk flow of grainsSand, gravel, snow
Destruction simulationFracture, then rigid motionWalls, buildings, glass
Rigid bodies versus related simulation methods

Destruction work is largely rigid body simulation applied after fracturing: geometry is pre-cut with Voronoi or boolean patterns, and the fragments are held together by a rigid body constraint network that breaks when impact forces exceed a threshold. Glue, hinge, spring and slider constraints all extend the basic solver without changing its core loop.

Setting up and stabilizing a rigid body scene

A stable setup starts with correct scale, clean collision proxies and enough substeps for the fastest object in the shot. Fast, thin objects can pass through each other between frames, a failure known as tunneling; raising simulation substeps or enabling continuous collision detection prevents it.

  • Mark ground and walls as passive colliders so they influence motion without moving.
  • Start stacks slightly separated or let them settle in a pre-roll before the shot begins.
  • Use sleeping or deactivation so bodies at rest stop consuming solver time.
  • Write the result to a simulation cache before rendering, because solvers are not guaranteed to be deterministic across machines or versions.

The symptom table below covers the problems artists meet most often and the usual remedy.

SymptomLikely causeFix
Objects jitter at restToo few iterations or mesh shapesMore iterations, convex proxies
Objects pass through wallsTunneling at high speedMore substeps or continuous detection
Stack explodes on frame oneInitial interpenetrationSeparate bodies, add pre-roll
Motion looks floatyWrong scene scaleModel in meters, check gravity
Endless slidingFriction near zeroRaise friction or damping
Frequent rigid body problems and fixes

Limitations of the rigid body assumption

The rigid assumption is an approximation that breaks down whenever visible bending, denting or vibration matters. Real metal panels crumple, wooden planks flex and glass shatters progressively; a pure rigid solver shows none of this unless it is combined with fracturing, soft body layers or hand animation.

Solvers are also chaotic by nature: tiny changes to the start state produce very different final piles, so art-directing an exact outcome usually requires keyframed initial velocities, invisible guide forces or a mix of animated and simulated bodies. Finally, iterative contact solvers trade physical exactness for stability, which means they can lose or gain small amounts of energy and are not suitable for engineering-grade analysis.

In plain words

Rigid body simulation lets a computer work out how hard objects would really move if you dropped, threw or knocked them over. The software treats each object as something that never bends or squashes, like a brick or a billiard ball. It then calculates, many times per second, how gravity pulls it, what it hits and how it bounces or slides.

Think of it as a very fast, very patient referee for a game of falling blocks. The artist sets up the scene and the rules. These say how heavy and slippery each object is. Then the computer plays out the motion, so nobody has to move every piece by hand.

A real-world example

A visual effects artist on a television series needs a warehouse shelf to collapse and scatter about 1,200 cardboard boxes and wooden crates. Animating each box by hand would take weeks, so the artist builds the shot with rigid body simulation. Boxes receive convex box shapes, the floor and remaining shelving are set as passive colliders, and the scene is modeled in meters with realistic densities of roughly 150 kg/m³ for cardboard and 600 kg/m³ for crates.

The first test shows small crates tunneling through the concrete floor, so the artist raises the solver to eight substeps per frame and adds a short pre-roll so the stacked boxes settle before the shelf gives way. A hidden force field nudges the collapse toward camera. After three iterations with the director, the 240-frame result is written to a simulation cache and rendered, delivering the shot in two days instead of the estimated two weeks of keyframe work.