benilla-re systems structs docs

MultiplyMatrix4

function · cmath · primitive

Address
0x7bc6a0 · 542 bytes, up to 0x7bc8bd
Signature
NTempest::C44Matrix * __fastcall (NTempest::C44Matrix *out, const NTempest::C44Matrix *a, const NTempest::C44Matrix *b)
Meaning
Writes the row-major product a·b of two 4×4 matrices to out and returns out
Confidence
verified, proof one
Finding
models/animation#texture-transforms
Test
animation::m2_animate_difftest, animation::m2_bone_propagate_difftest, cmath::multiply_matrix4_difftest, gx::lightningrender_strip_difftest

Finding: Texture transforms in models: animation

Each frame each texture transform builds its matrix from identity: when its rotation track has keys, translate by the centre p = (0.5, 0.5, 0), rotate by the sampled quaternion, translate by −p; then the same with the sampled scale; then translate by the sampled translation. Each step multiplies on the left, so for the row vector (u, v, 0, 1) the result is ((uv + t − p) ⊙ s)·Q + p, Q the quaternion's matrix with rows (1 − 2(y² + z²), 2xy + 2zw, 2xz − 2yw), (2xy − 2zw, 1 − 2(x² + z²), 2yz + 2xw) and (2xz + 2yw, 2yz − 2xw, 1 − 2(x² + y²)). The tracks sample at bone 0's time.

The derivation is in the doc.

Callers 35

Callees 2

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