benilla-re systems structs docs

s_m2TextureCenter

global · models

Address
0xcf043c · 12 bytes, up to 0xcf0447
Type
float[3]
Meaning
Holds (0.5, 0.5, 0), the centre texture transforms rotate and scale about
Confidence
verified, proof one
Finding
models/animation#texture-transforms

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.