benilla-re systems structs docs

PlaneDistanceAlongRay

function · collision · primitive

Address
0x6329e0 · 78 bytes, up to 0x632a2d
Signature
float __fastcall (const float *point, const float *plane, const float *dir)
Meaning
Returns (n·p + d)/(n·dir), or n·p + d when abs(n·dir) is below 2^-22
Confidence
verified, proof one
Finding
collision/contact#contact-distance
Test
collision::resolve_toolkit_difftest

Finding: Contact distance in collision: contact

0x6329e0(q, plane, dir) returns (n·q + d)/(n·dir) at 53 bits, or n·q + d undivided when abs(n·dir) is below 2^−22 (0x34800000); a NaN n·dir divides. For a volume face and a unit dir it is the travel after which the face reaches q, negative behind it. 0x632830(poly, dir, planes, k, best) measures each vertex of the polygon against plane k:

stepeffect
1m = *best; at each t below m, m = t when t > 0, else 0; a NaN t is skipped
2some t above −2^−20 (0xb5800000, 0x80dff4): go to step 4
3clip by the other eight planes; nothing left, or every remaining t at or below −1/36 (0xbce38e39) or NaN: return 0
4m below *best, or *best NaN: *best = m, return 1; else return 0

The derivation is in the doc.

Callers 1

Callees 0

None by a direct call or jump.

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