benilla-re systems structs docs

IntersectSegments2DPoint

function · cmath · unreached

Address
0x7c3d20 · 264 bytes, up to 0x7c3e27
Signature
uint8_t __fastcall (const NTempest::C2Vector *a, const NTempest::C2Vector *b, const NTempest::C2Vector *c, const NTempest::C2Vector *d, NTempest::C2Vector *out)
Meaning
Writes where two 2D lines meet and returns 1 when the segments cross
Confidence
verified, proof two
Finding
cmath/solids#segments-in-the-plane

Finding: Segments in the plane in cmath: boxes, cones and triangles

0x6dc2c0(c, d, out) takes the segment from ecx to edx and the segment from c to d (each point two floats). It forms the determinant of the two directions and returns 0, writing nothing, when it is 0. Otherwise it computes the parameters s along the first segment and t along the second, each rounded to a float, and returns 1 when both are in [0, 1]. When not it writes a + s·(b − a), where the two lines meet, to out and returns 0. 0x7c3d20 is the same with |det| < 0.001 (a float at 0x801360) as the miss test, and it writes the point before it tests the parameters.

The derivation is in the doc.

Callers 0

None by a direct call or jump.

Callees 0

None by a direct call or jump.

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