benilla-re systems structs docs

ClassifyCircleAgainstBox

function · cmath · primitive

Address
0x7c2040 · 601 bytes, up to 0x7c2298
Signature
uint8_t __fastcall (const NTempest::CAaBox *box, const NTempest::CAaSphere *sphere, uint32_t mode)
Meaning
Tests a circle against a box in x and y, one of four tests chosen by an argument
Confidence
verified, proof two
Finding
cmath/geometry#circle-and-point-against-a-box
Test
cmath::sphere_aabb_difftest

Finding: Circle and point against a box in cmath: intersections

0x7c2040(mode) tests the circle or sphere in edx (centre x and y at +0 and +4, radius at +0xc) against the box in ecx on the first two axes and returns a byte, with r² the rounded squared radius. Per axis dmin and dmax are the squared distances to the two faces; near sums dmin for a centre below the minimum and dmax above the maximum, and far sums the larger of the two. Mode 3 is true when near≤r², and mode 2 when also r²≤far. Mode 1 needs near≤r² and a hit flag, mode 0 the flag, near≤r² and r²≤far. A mode above 3 returns 0.

The derivation is in the doc.

Callers 1

Callees 0

None by a direct call or jump.

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