IT lexicon › Programming › Time of impact (TOI)

Time of impact (TOI)

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

The fraction of a timestep at which two moving bodies first touch — the number continuous collision detection exists to find.

A fast bullet that clears a wall in a single step has to be caught before it passes through. The TOI is the exact moment t between 0 and 1 where the shapes go from separated to touching; the simulation advances to that t, resolves the hit, and runs the rest of the step from there.

Box2D computes it with conservative advancement (Brian Mirtich, later refined by Erin Catto): move the bodies by the distance that is provably safe, measure again, repeat until they touch. It is expensive, so engines reserve it for the few objects actually moving fast enough to tunnel.

← Back to the lexicon