skip to content

Collision Response & Constraints

Impulses with restitution and friction, sequential-impulse solvers, joints and stabilization turn contacts into motion. Interviewers probe it because solvers decide how physics feels.

on this pageshow

explore

questions

5

When two rigid bodies collide in a game physics simulation, what do the coefficient of restitution and the coefficient of friction each control?

level: juniorimportance: must knowfreq 55%

answer

  1. bounce versus slide
  2. normal direction versus tangent plane
  3. separation speed over approach speed
  4. friction capped by the normal push

basics

~20 s

Restitution sets how much approach speed along the contact normal returns as separation speed: 0 is no bounce, 1 a perfectly elastic one. Friction resists sliding in the tangent plane, capped at the coefficient times the normal impulse.

solid answer

~50 s

They act at the same contact point but in different directions. **Restitution** `e` works along the contact normal: the solver targets a separating speed of `e` times the approach speed, so `e = 0` kills the bounce, `e = 1` returns all of the normal speed and a value above 1 adds energy. Because rebound height goes with the square of speed, a ball with `e = 0.8` rebounds to 64% of its drop height. **Friction** works in the tangent plane under the Coulomb model: the friction impulse grows to cancel sliding but never beyond `mu` times the normal impulse, so a contact pressed harder resists more sliding and a light touch slips. Engines also combine the two materials' coefficients with a combine rule, and many skip restitution below a small approach-speed threshold so resting objects do not tremble.

go deeper

for a junior

Recall which direction each coefficient acts in: restitution along the contact normal, friction across the tangent plane, and that friction is capped by how hard the surfaces press together.

for a middle

Explain restitution as a ratio of speeds and derive why rebound height scales with e squared, then state the Coulomb cap and why a pressed-harder contact resists more sliding.

for a senior

Diagnose a wrong bounce from its symptom: combine rules, the resting-contact restitution threshold, position correction adding energy, and friction pyramids behaving unevenly by direction.

for a principal

Weigh the material model a team standardises on: which combine rule is the default, which pairs override it, and how designers tune bounce and grip without breaking resting stacks.

## Two directions at every contact When two rigid bodies touch, the narrow phase hands the solver a **contact point** and a unit **contact normal**: the direction along which the surfaces push each other apart. Everything the solver does to that contact splits into two directions: - **Along the normal**, the bodies must not keep moving into each other. How fast they move apart afterwards is what **restitution** controls. - **In the tangent plane** (every direction perpendicular to the normal), the surfaces may slide. How strongly sliding is resisted is what **friction** controls. The two coefficients are material properties, but they act on different components of the **relative velocity** of the two contact points, which is why a bouncy ball and an icy floor are tuned separately. ## Restitution: how much bounce comes back The **coefficient of restitution** `e` is the ratio of the separating speed along the normal after the collision to the approach speed before it. If the bodies approach at normal speed `vn` (a negative number when they close in), the solver aims for a separating speed of `-e * vn`. | value of `e` | behaviour | |---|---| | `0` | perfectly inelastic: the bodies stop moving apart along the normal, no bounce | | between `0` and `1` | a partial bounce; some kinetic energy along the normal is lost | | `1` | perfectly elastic: all of the normal speed comes back | | above `1` | the bounce leaves faster than it arrived, so the simulation gains energy | A quick check that interviewers like, for a ball dropped onto an immovable floor: 1. The ball hits the floor at speed `v`, and kinetic energy at impact equals the potential energy of the drop, so the drop height is proportional to `v^2`. 2. It leaves at speed `e * v`. 3. The rebound height is therefore proportional to `(e * v)^2`, which is `e^2` times the drop height. With `e = 0.8` the ball rises to 64% of its drop height, and with `e = 0.5` to 25%. A ball that rebounds to 80% of its height has a restitution of about 0.89, not 0.8. ## Friction: the Coulomb limit in the tangent plane Game solvers almost always use the **Coulomb friction model**. The friction impulse acts in the tangent plane against the sliding velocity, and it may grow just enough to stop the sliding, but its magnitude is capped: - `|friction impulse| <= mu * normal impulse`, where `mu` is the **friction coefficient**. - A contact that is pressed harder (a larger normal impulse) can therefore resist more sliding; a light touch slips. - In this model friction does not depend on the contact area, only on how hard the surfaces are pressed together. - Physics distinguishes **static friction** (resisting the start of sliding) from **kinetic friction** (while sliding); many game solvers use one coefficient, some keep both. The allowed friction forms a **cone** around the normal. Some solvers approximate it with a four-sided **pyramid** that clamps two tangent directions separately, which is cheaper to solve but lets a little more friction through along the diagonals. ## Combining materials and resting contacts A contact involves two materials, so an engine must turn two coefficients into one. Common **combine rules** are the average, the minimum, the maximum or the product, and many engines let a material choose its rule. The choice matters: with a maximum rule, one bouncy object makes everything it touches bouncy. Many solvers also apply restitution only when the approach speed exceeds a small **velocity threshold**. Gravity gives a resting body a tiny approach speed every step; bouncing that back would make stacked or resting objects tremble forever, so below the threshold the contact is treated as inelastic. ## Diagnosing a ball with the wrong bounce When a ball bounces with the wrong energy, the usual suspects are: - a restitution above 1, or a combine rule that picks the larger of two coefficients when you expected the floor's value; - the solver's position correction pushing the ball out of the floor after a deep overlap, which adds speed on top of the bounce; - an approach speed below the restitution threshold, which makes a slow ball land dead; - friction mistaken for bounce damping: friction acts in the tangent plane, so it changes a spinning or skidding ball's spin and sideways speed, not the height of a straight vertical bounce. Knowing which coefficient acts in which direction turns all of these into quick checks rather than guesswork.

  • A ball dropped from 2 m rebounds to 0.5 m. What restitution does that imply?
    Rebound height scales with the square of speed, so `e^2 = 0.5 / 2 = 0.25` and `e = 0.5`. Reading the height ratio directly as the restitution, which gives 0.25, is the classic slip; the coefficient is the ratio of speeds, not of heights.
  • Why can a cheap friction pyramid make a box slide differently depending on its direction?
    A pyramid clamps two tangent directions independently, each to `mu` times the normal impulse. Along a diagonal both clamps can saturate together, allowing up to about `1.41 * mu` of friction, while along an axis only `mu` is allowed. Friction then depends on how the tangent axes happen to line up with the sliding direction, which a true cone does not do.
  • Two materials meet: ice with friction 0.05 and rubber with friction 0.9. What does the combine rule change?
    The contact needs a single coefficient. An average gives about 0.48, a minimum gives the ice's 0.05 and a maximum gives the rubber's 0.9, so the same tyre on the same ice can skid or grip depending on the rule. Pick a rule deliberately, or let specific material pairs override it.

  • Restitution is the fraction of drop height the ball rebounds to.
  • Friction slows the bounce of a ball dropped straight down.
  • Friction depends on the contact area between the surfaces.
  • Restitution above 1 is a safe way to get a lively bounce.
  • The friction impulse is always mu times the normal impulse, even with no sliding.
open as a page

How do you derive the normal impulse that resolves a collision between two rotating rigid bodies at a single contact point?

level: middleimportance: must knowfreq 50%

basics

~20 s

Require the relative normal velocity of the two contact points to become -e times its old value and solve for one scalar impulse: j = -(1 + e) * vn / K, with K the inverse effective mass including rotation.

open as a page

How is a hinge joint, such as a door on its frame, expressed as constraints and solved by an impulse-based rigid-body solver?

level: middleimportance: should knowfreq 40%

basics

~20 s

A hinge pins a door point to a frame point (three equations) and keeps their hinge axes aligned (two more), leaving one rotation. The solver applies unclamped impulses zeroing each constraint's velocity error; limits and motors add clamped rows.

open as a page

Why can Baumgarte stabilisation make stacked crates pop apart or a ball bounce too high, and how do split impulses avoid it?

level: seniorimportance: should knowfreq 36%

basics

~20 s

Baumgarte feeds penetration back as extra separating velocity, and that velocity stays in the bodies after the overlap is gone, adding energy. Split impulses solve the correction in a separate pseudo-velocity that moves positions and is then discarded.

open as a page

In a sequential-impulse solver, why do accumulated-impulse clamping and warm starting decide whether a tall stack of crates rests or jitters and sinks?

level: seniorimportance: should knowfreq 42%

basics

~20 s

An iterative sequential-impulse solver relays a stack's weight contact by contact and converges slowly. Clamping the accumulated impulse lets later iterations undo overshoot; warm starting from last step's impulses begins near the answer, so a few iterations suffice.

open as a page