benilla-re systems structs docs

CMovement::SweepVolume

function · collision · primitive

Address
0x632ba0 · 985 bytes, up to 0x632f78
Signature
uint32_t __thiscall (CMovement *this, void *list, float *dir, float len, uint32_t *hit, float *out, uint32_t *n, float *dist, float *pos)
Meaning
Returns the travel of the volume along a direction to its first contact, and the leading faces that touch
Confidence
verified, proof one
Finding
collision/contact#earliest-contact-sweep
Test
collision::earliest_contact_difftest

Finding: Earliest contact sweep in collision: contact

0x632ba0(list, dir, len, hit, out, count, dist, pos) sweeps a CMovement's volume from pos (+0x10 when null) along the unit vector dir for len. It returns in dist the travel to the first contact, and in out and count the leading faces that touch within 1/720 of it, by these steps. A NaN len sweeps 1/36, finds nothing and returns a NaN dist.

stepeffect
1count = 0; when abs(len) < 2^−20: dist = 0, hit = the list's count, return 1
2H = +0xb4; three quarters of it for a swimmer (0x200000) sweeping 0xc4e564
3else, with flags 0x2000 and 0x40000000: drop D by 0x632a30 (failure returns 0); H + D, pos.z − D
4s = dir · max(len, 1/36)
5the volume 0x631be0(pos, H)
6when pos is null: 0x631e70(s); failure: dist = 0, return 0
7hit = the list's count, best = len; the bevels by 0x632280
8box faces 0 to 4 with s·n > 0 or NaN: prism 0x632f80, 0x632700 with cap len, the band rule
9dist = best, or 0 when best < 1/720; return 1

The derivation is in the doc.

Callers 5

Callees 8

Calls and jumps by a bare address, from tables/calls.tsv.