AverageGroundNormal
function · collision · primitive
- Address
0x637140· 386 bytes, up to0x6372c1- Signature
float * __stdcall (float *out, const float *planes, uint32_t count)- Meaning
- Returns the normalized mean normal of candidate faces above cos 89° inside the planes, or (0, 0, 1)
- Confidence
- verified, proof one
- Finding
- collision/walking#averaged-ground-normal
- Test
collision::walkable_normal_avg_difftest
Finding: Averaged ground normal in collision: walking
0x637140(out, planes, count) returns the mean normal of the candidate faces with n.z above
cos 89° whose triangle survives clipping by the planes (0x631870), normalized; (0, 0, 1) when
none does. The sums are float adds in face order; the mean is sum·(1/k) and the result
mean·(1/|mean|). 0x6332a0 (resolve) passes the six planes of the mover's box and stores the
result at +0x24. It does not read this.
The derivation is in the doc.
Callers 1
- CMovement::RefreshGroundNormal collision
Callees 2
- SplatVector3 loadingscreen
- ClipPolygonByPlanes collision
Calls and jumps by a bare address, from tables/calls.tsv.