benilla-re systems structs docs

FindNearestTriangleEdge

function · collision · primitive

Address
0x634da0 · 414 bytes, up to 0x634f3d
Signature
float * __fastcall (float *out, uint32_t index, const float *point, const float *crease)
Meaning
Returns the unit edge of a listed triangle nearest the line through a point along a crease
Confidence
verified, proof one
Finding
collision/airborne#crease-helpers
Test
collision::slide_normal_difftest

Finding: Crease helpers in collision: airborne

0x634fc0(out, tri, A, B) solves the three planes' normals as rows against −d, through the determinant 0x7be0e0 and the inverse 0x7be2a0, with no zero test. 0x634da0(out, i, P, c) walks triangle i's edges e_k = v_k − v_(k+1 mod 3), skipping any shorter than 2^-22, and keeps the unit edge with the smallest squared distance: for an edge parallel to c (|e·c − 1| < 2^-20), 0x634f40(v_k, P, c), the squared distance from v_k to the line through P along c; otherwise (k·v_k − k·P)², k = e × c, each dot summed z, y, x. The search starts at FLT_MAX and keeps only a strictly smaller value; with none it returns (0, 0, 0).

The derivation is in the doc.

Callers 1

Callees 1

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