IT lexicon › Programming › Distance joint

Distance joint

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

A physics constraint that keeps two anchor points on rigid bodies a set distance apart — stiff like a rod or springy like, well, a spring.

One of the simplest joints in a 2D physics engine. It pins an anchor point on each body and a rest length between them; the constraint solver pulls the points together until the distance matches. Box2D (Erin Catto, 2007) let you soften it with a frequency and damping ratio so the rod became a spring, and later versions add minimum and maximum lengths so it can behave like a rope.

It drives suspension bridges, pendulums, chains of bodies and anything that should stay connected without locking rotation. Unlike a hinge joint it constrains only one degree of freedom — the length — and lets the bodies spin freely around their anchors.

← Back to the lexicon