Repository navigation
body-contact-2
Body contact gains a sorted sweep, an exact range filter and a pair-list resolve, so a caller that computes a body's position or velocity lazily pays for them only where a pair needs them. No body-contact-1 result changes.
- Change:
sh2z_bc_sweep(the pairs within a window, in the field walk's order, with the bodies they touch marked),sh2z_bc_range(pairs of two ACTIVE bodies within the reach on every axis, tested in 32 bits) andsh2z_bc_field_resolve_list(the pair function over a list, with the field's history).sh2z_bc_field_resolvealso tests the position box in 32 bits before it calls the pair function; the test never rejects a pair the pair function accepts. - API: three new entry points; no new types, no change to existing signatures.
- Objects: no libc memcpy, memset or memmove in the SH-2 objects; compiled with
-Wall -Wextra -Werror. - Evidence: HOST:
body_contact_exactunder GCC and Clang strict and ASan/UBSan, with 20 races x 300 ticks x 30 bodies of the list path equal to the field walk, the int32-range case and two controls that are caught. At merge, a separate differential of main's field walk against this one (16,000 ticks, 24 bodies, positions across the whole int32 range) showed 0 differences in outputs, history and counters. No instruction model, no console run. CI on the head passes (host, SH-2 cross compile, math lab, docs). Validation record. - Merge: PR #84, merge
e83dae5. - Guide:
saturn/BODY_CONTACT.md.