benilla-re systems structs docs

ComputeWallPushOut

function · collision · primitive

Address
0x635d80 · 274 bytes, up to 0x635e91
Signature
float * __thiscall (void *this, float *out, const float *dir, float len, const float *normal)
Meaning
Writes the horizontal push-out that cancels a move entering a plane, plus 0.001
Confidence
verified, proof one
Finding
collision/walking#horizontal-push-out-from-a-wall
Test
collision::walk_helpers_difftest

Finding: Horizontal push-out from a wall in collision: walking

0x635d80(out, dir, len, n) writes the horizontal correction that cancels the part of the move dir·len that enters the plane n, plus 0.001 yd. A plane with n.z < 0 and −n.z > cos 50° gives (0, 0, 0). Otherwise u = (n.x, n.y)/√(n.x² + n.y²), or the raw pair when the root is under 2^-22; c = (u.y·n.y + u.x·n.x) + n.z·0; p = −(n·dir)·len; k = p/c + 0.001, or p + 0.001 when |c| < 2^-22; out = (float(u.x·k), float(u.y·k), 0). It returns out and does not read this.

The derivation is in the doc.

Callers 1

Callees 1

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