benilla-re systems structs docs

HeadingBetweenPoints

function · objectlayer · primitive

Address
0x47f220 · 141 bytes, up to 0x47f2ac
Signature
float __fastcall (const float *from, const float *to)
Meaning
Returns atan2 of the y and x differences, with fixed headings when either difference is below 2^-22
Confidence
verified, proof one
Finding
objectlayer/movement#heading-between-two-points
Test
ui::geo_47f220

Finding: Heading between two points in objectlayer: movement

0x47f220(a, b) returns the heading from a to b in the x-y plane. With dx = b.x − a.x rounded to a float and dy = b.y − a.y kept at the client's 53-bit precision: when |dx| is below 2^−22 it returns 1.5π for dy < 0 and 0.5π otherwise; else when |dy| is below 2^−22 it returns π for b.x < a.x and 0 otherwise; else atan2(dy, dx), in (−π, π]. A NaN dx or dy takes the else branches. The products 1.5π and 0.5π use π as the float 0x40490fdb.

The derivation is in the doc.

Callers 13

Callees 0

None by a direct call or jump.

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