benilla-re systems structs docs

CMovement::LimitFaceRise

function · collision · primitive

Address
0x635c00 · 376 bytes, up to 0x635d77
Signature
float * __thiscall (CMovement *this, float *out, const float *dir, float *len, float nx, float ny, float nz, uint32_t flip, const float *contact)
Meaning
Writes (0, 0, rise) for moving len along dir on a face, limiting the rise to the step height and scaling len
Confidence
verified, proof one
Finding
collision/walking#rise-along-a-face
Test
collision::speed_select_difftest

Finding: Rise along a face in collision: walking

0x635c00(out, dir, &len, n, flip, B) gives the height change h of moving len along dir on the plane n, h = float(−(n·dir)·len / n.z), and limits it to H. When flip is nonzero, n.z ≤ cos 50° and |B|² ≥ 2^-22, n is replaced by −B, the contact vector, so the rise follows B's slope, h = float(−(B·dir)·len / B.z), instead of the face's. For |n.z| < 2^-22, h is −FLT_MAX when the numerator is negative, else +FLT_MAX. The output is (0·X, 0·X, X) (0x635d5b): x and y are −0 for a negative X and NaN for a NaN one.

case, in test orderlenX
flag 0x4000000 and h < 00H
H < hfloat(H/h·len)H
h < −Hfloat(−(H/h·len))−H
otherwise, NaN includedkepth

The derivation is in the doc.

Callers 2

Callees 1

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