IT lexicon › Programming › Narrow phase

Narrow phase

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

The second collision stage, deciding exactly whether two already-shortlisted objects really touch, and how.

The narrow phase receives the candidate pairs from the broad phase and does the expensive, precise work for each one: do the shapes intersect, and if so, where? The output is a contact point, a contact normal and a penetration depth — exactly what a physics solver needs in order to push the bodies apart again.

For convex shapes two techniques dominate: the separating axis theorem for polygons and polyhedra, and the GJK algorithm for arbitrary convex bodies. Penetration depth, which GJK does not give directly, is usually computed by its companion EPA (Expanding Polytope Algorithm). Non-convex shapes are decomposed into convex pieces first, since nearly every fast test assumes convexity.

← Back to the lexicon