Physical Dynamics and Constraints › Contact, Friction, and Collision
World Models HandbookAll chapters Physical Dynamics and Constraints › Contact, Friction, and CollisionOne section · Sections in this chapter5 / 12 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Contact is where otherwise smooth mechanics becomes especially difficult. Ideal rigid contact introduces unilateral constraints and instantaneous impulses; compliant contact instead uses large but finite forces over a short duration. In either case the active contact set can change abruptly, and Coulomb friction couples normal and tangential behavior. Naive fixed-step differentiation can miss how a perturbation changes impact time or the contact schedule, although event-aware derivatives and smooth approximations can provide useful gradients. This section develops the constraint machinery needed to manage those mode changes.
Signaling Contact: Distance and Penetration
The first ingredient is a way to know whether two bodies touch. A standard tool is a signed distance function (SDF) , positive when separated, zero at contact, and negative when penetrating. For a differentiable spatial SDF, has unit norm and gives the local surface normal. If is written as a function of generalized coordinates , its gradient is instead the contact Jacobian that maps generalized motion to gap change. Many primitives have closed or piecewise-closed distance formulas, although edges and medial axes can be nondifferentiable; for meshes the field is computed or precomputed, and learned implicit representations can approximate it. In a model whose state decodes to solid geometry, a predicted negative gap is an immediate, checkable nonpenetration violation.
Contact as a Complementarity Problem
Non-penetration is naturally expressed as a constraint with a one-sided force. The normal force magnitude satisfies:
At each contact, three conditions must hold simultaneously:
Read this as: the bodies do not overlap, the contact force can only push (never pull), and force exists only when contact exists. After time discretization, a fixed contact geometry, and often a polyhedral approximation to friction, these conditions can yield a linear complementarity problem (LCP). More general rigid-contact formulations lead to nonlinear complementarity or cone programs.
Complementarity couples the two nonnegativity conditions and selects the active mode: if the bodies are separated, the normal force is zero; if a positive normal force is active, the gap is zero. Together with the gap and force inequalities, this produces a nonsmooth switch between separation and sustained contact. Related time-stepping or impact formulations add velocity- or impulse-level conditions to handle impact.
- Gradients through a naive discrete contact event can be discontinuous, inaccurate, or omit the dependence of impact time on the state. Event-aware differentiation, smoothing, or alternative estimators can restore a signal, but the choice changes the model being optimized.
- A small state error near the contact boundary can flip a mode decision and cause two rollouts to diverge rapidly. How rapidly depends on the geometry, timestep, solver, and task; contact-rich prediction should therefore be evaluated with explicit mode and penetration metrics.
- When observations leave the next contact mode ambiguous, a deterministic model trained with squared error targets the conditional mean and can average bouncing and resting into a state that matches neither mode. A multimodal predictive distribution or an explicit mode variable can represent that uncertainty instead.
Friction
Coulomb friction constrains the tangential force to lie inside a friction cone whose radius is the normal force times a coefficient:
where:
- : the tangential force vector at the contact, lying in the local surface plane
- : the normal force magnitude, the pressing force perpendicular to the surface
- : the coefficient of friction, a property of the material pair that sets the cone's radius
Static contact sticks when the tangential force or impulse required to maintain zero relative tangential velocity lies inside the static friction set. If sticking would require leaving that set, a sliding law applies friction opposite the relative tangential motion, usually with a kinetic coefficient. Many engines approximate friction cones with polyhedra and solve a coupled constrained problem across active contacts, while others use cone, penalty, or compliant formulations. A learned contact model must likewise choose what its temporal discretization represents. At finite resolution, force targets can smear short impacts, while impulse targets align naturally with short velocity changes. Either representation can handle sustained contact when paired with suitable labels and a solver.
Impulses and Impacts
In the ideal rigid-body approximation, an impact is represented as instantaneous when its finite physical contact duration is unresolved by the timestep. For a frictionless point mass striking a stationary plane, an impulse update gives , where:
- and : the velocity immediately before and immediately after the impact
- : the unit contact normal, pointing out of the surface
- : the component of the pre-impact velocity along the normal, that is,
- : the Newton coefficient of restitution, the ratio of post-impact separating normal speed to pre-impact approaching normal speed
Under those stationary-plane, frictionless assumptions, the update reverses the normal component and scales it to while leaving the tangential component unchanged. The normal-direction kinetic-energy loss is the fraction . General two-body impact requires contact-point relative velocity, effective mass and inertia, and any tangential impulse. A learned model can predict an impact event and restitution parameter instead of resolving the short force profile, provided those assumptions match its setting.