benilla-re systems structs docs

RotateMatrix3

function · cmath · orchestration

Address
0x7be730 · 57 bytes, up to 0x7be768
Signature
void __thiscall (NTempest::C33Matrix *this, float angle, const NTempest::C3Vector *axis, uint8_t axisIsUnit)
Meaning
Multiplies a 3×3 matrix on the left by the rotation about an axis by an angle
Confidence
verified, proof two
Finding
cmath/matrices#axis-and-angle-rotations

Finding: Axis and angle rotations in cmath: matrices

0x7be490(out, axis, angle, unit), 0x7bdb00 and 0x7bb860 build the rotation about an axis for a row vector. Unless the flag says the axis is a unit vector, it is scaled by 1/√((z² + y²) + x²), each component stored as a float. With c, s, t = 1 − c, x·s and y·s stored as floats, the 3×3 is, by row:

rowcolumn 0column 1column 2
0x·x·t + ct·x·y + z·st·x·z − y·s
1t·x·y − z·sy·y·t + cx·s + t·y·z
2t·x·z + y·st·y·z − x·sz·z·t + c

0x7bdb00 puts it in a 4×4 with (0, 0, 0, 1) last, 0x7bb860 in a 3×4 with zero translation; 0x7be730 and 0x7bbab0 multiply a 3×3 or a 3×4 on the left by one.

The derivation is in the doc.

Callers 3

Callees 2

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