CMovement::SweepVolume
function · collision · primitive
- Address
0x632ba0· 985 bytes, up to0x632f78- 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.
| step | effect |
|---|---|
| 1 | count = 0; when abs(len) < 2^−20: dist = 0, hit = the list's count, return 1 |
| 2 | H = +0xb4; three quarters of it for a swimmer (0x200000) sweeping 0xc4e564 |
| 3 | else, with flags 0x2000 and 0x40000000: drop D by 0x632a30 (failure returns 0); H + D, pos.z − D |
| 4 | s = dir · max(len, 1/36) |
| 5 | the volume 0x631be0(pos, H) |
| 6 | when pos is null: 0x631e70(s); failure: dist = 0, return 0 |
| 7 | hit = the list's count, best = len; the bevels by 0x632280 |
| 8 | box faces 0 to 4 with s·n > 0 or NaN: prism 0x632f80, 0x632700 with cap len, the band rule |
| 9 | dist = best, or 0 when best < 1/720; return 1 |
The derivation is in the doc.
Callers 5
- CMovement::SweepCarrierMove collision
- CMovement::ResolveFreeMove collision
- CMovement::SweepAirborneStep collision
- CMovement::ProbeStepUp collision
- CMovement::ResolveWalk collision
Callees 8
- SetVector3 spline
- SetPlane gx
- CMovement::BuildVolume collision
- CMovement::GatherSweepFacets collision
- CMovement::FindBevelContacts collision
- FindNearestFacet collision
- CMovement::MeasureHoverDrop collision
- BuildQuadPrism collision
Calls and jumps by a bare address, from tables/calls.tsv.