PointToLineDistanceSquared
function · collision · primitive
- Address
0x634f40· 128 bytes, up to0x634fbf- Signature
float __fastcall (const float *point, const float *origin, const float *dir)- Meaning
- Returns the squared distance from a point to the line through an origin along a unit direction
- Confidence
- verified, proof one
- Finding
- collision/airborne#crease-helpers
- Test
collision::sibling_pure_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
- FindNearestTriangleEdge collision
Callees 0
None by a direct call or jump.
Calls and jumps by a bare address, from tables/calls.tsv.