expression
Recognize tunneling between discrete positions
An object can cross a thin obstacle between samples even when neither endpoint overlaps it. This one-dimensional point-versus-stationary-plane model assumes linear motion and tests the swept interval. It is an introduction to continuous collision detection (CCD), not a general swept-shape algorithm. Expected result (NOT RUN): endpoint: false, swept: true Common mistake: Checking only the end position for a fast-moving body. Static Rust example; not a verified ByteMind executable assessment.
Formal Syntax & Structure
rust syntaxrust
min(start,end) <= wall && wall <= max(start,end)Working Example
Example Snippetrust
fn main() { let (start, end, wall) = (0i32, 10i32, 5i32); let endpoint = start == wall || end == wall; let swept = start.min(end) <= wall && wall <= start.max(end); println!("endpoint: {endpoint}, swept: {swept}");}