benilla-re systems structs docs

ProjectPointsForDecal

function · gxumath · unreached

Address
0x5c4d70 · 433 bytes, up to 0x5c4f20
Signature
void __fastcall (uint32_t count, const float *in, float *out)
Meaning
Maps points through the device matrix to window fractions scaled by the window rectangle
Confidence
verified, proof one
Finding
gxumath#viewport-projection-for-decals

Finding: Viewport projection for decals in gxumath

0x5c4d70 (ecx a count, edx points of three floats, the output on the stack, ret 4) maps the x and y of each point through the matrix 0x58b0c0 gives: x' = m0·x + m4·y + m12, y' = m1·x + m5·y + m13, then sx = (x' + 1)·(a1 − a0)·0.5 + a0 and sy = (y' + 1)·(b1 − b0)·0.5 + b0, with a0 a1 b0 b1 the first four scalars of 0x58b060. It writes out.x = sx·r3, out.y = r2 − sy·r2 and out.z = 1, r the four floats of 0x58a240. Only m0, m1, m4, m5, m12 and m13 are read. Its one caller is 0x5c5ee0.

The derivation is in the doc.

Callers 1

Callees 3

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