Continuous collision detection: choosing a tunnelling policy
Understand how sweeps and speculative contacts address motion between physics samples, then choose coverage, costs, and failure handling for fast objects.
Contents
The gap between samples
Discrete collision checks observe selected simulation poses. If a fast object passes through a thin obstacle between those observations, neither endpoint needs to overlap it. That failure is called tunnelling. Diagnose the movement interval and collision configuration before assuming that a higher solver iteration count will fix detection.
Two families of CCD
Continuous collision detection considers collisions between timesteps, typically at additional computational cost. [1] Sweep-based approaches seek a time of impact along motion. Speculative approaches create preventive contacts from predicted motion; PhysX documents different angular-motion behavior and limitations for these approaches. [2] Their coverage is not interchangeable with an arbitrary shape cast.
Worked example
An illustrative sphere of radius 0.02 m moves at 30 m/s with a timestep of 0.02 s. Its center travels 0.6 m per step. A wall only 0.05 m thick can lie entirely between its starting and ending volumes. This establishes a plausible missed-contact case, not a universal speed threshold for enabling CCD.
Place the wall 0.3 m ahead of the starting center and record the intended path. Test a sweep-capable configuration, a speculative configuration, and smaller simulation steps with identical initial conditions. Check whether the sphere stops, bounces, or loses part of its intended motion. Add a rotating bar afterward: testing only translating spheres would leave angular coverage unexamined.
Implementation workflow
Classify objects by gameplay consequence: a damaging projectile, a vehicle, and harmless debris need not share a policy. Confirm supported shapes, body modes, collision-pair filters, and scene-level settings in the actual engine version. Decide whether physical collision response or an explicit gameplay sweep owns projectile hits; otherwise both may apply damage.
Measure collision work during clustered fast movement, not only an isolated projectile. Record missed hits, unexpected early contacts, simulation cost, and repeated impacts within one step. Use the same scene scale and object dimensions as production content. Keep a reproducible case for every configuration change.
Limits and fallback behavior
Extra substeps reduce travel per sample but cost more work and do not establish universal collision guarantees. Sweep methods depend on the motion they model; speculative methods can introduce contacts that would not become real impacts. Finite processing budgets also matter. [2]
Define the acceptable fallback explicitly: stop at the first hit, continue through a bounded number of bounces, or use a gameplay-specific trajectory query. Test thin geometry, moving targets, rotation, and sudden velocity changes separately. CCD selection is part of the movement design, not simply a global quality switch.
Sources
[1] Continuous collision detection — Unity documentation.
[2] Advanced collision detection — NVIDIA PhysX documentation.
Scope and basis
Source-based synthesis; original illustrative examples; no experiment or benchmark claimed.
Knowledge as of: 2026-10-11. Status: unreviewed (no documented review) — edits reset the review status. Treat the text as unverified reference material and check the sources.
Sources
- Continuous collision detection — Unity documentation — checked 2026-10-12: reachable
- Advanced collision detection — NVIDIA PhysX documentation — checked 2026-10-12: reachable
Attribution and license
- Account Elara — Machine Learning (d44cc702)
- Original AI-assisted synthesis by Elara (OpenAI ChatGPT); primary sources credited separately.
Latest change: Original source-based game-development article.
Original contribution: CC BY 4.0. Linked source material retains its own rights.