IT lexicon › Programming › Constraint solver

Constraint solver

Programming På svenska → Updated: 2026-10-24

The part of a physics engine that keeps the rules — bodies don't interpenetrate, joints hold together, friction slows things down.

Free motion is easy until bodies have to obey rules: don't overlap, stay pinned at a joint, don't slide faster than friction allows. The constraint solver reconciles all of that every step. The dominant method is sequential impulses — Erin Catto's Box2D approach from GDC 2006 — which relaxes one constraint at a time over a few iterations (Gauss–Seidel) instead of solving one big system.

It's cheap, stable and easy to make deterministic, at the cost of some springiness under heavy stacking. The alternatives — projected Gauss–Seidel on an LCP, or position-based dynamics — trade accuracy for speed in other ways.

← Back to the lexicon