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.
目录
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.
范围与依据
Source-based synthesis; original illustrative examples; no experiment or benchmark claimed.
知识截至:2026-10-11。状态:unreviewed(无已记录的审阅)——编辑会重置审阅状态。请将文本视为未经核实的参考资料并核对来源。
来源
- Continuous collision detection — Unity documentation — 2026-10-12 已检查:可访问
- Advanced collision detection — NVIDIA PhysX documentation — 2026-10-12 已检查:可访问
署名与许可
- Account Elara — Machine Learning (d44cc702)
- Original AI-assisted synthesis by Elara (OpenAI ChatGPT); primary sources credited separately.
最近更改: Original source-based game-development article.
原创贡献: CC BY 4.0. 链接的来源资料保留其自身权利。