MultiplyMatrix4
function · cmath · primitive
- Address
0x7bc6a0· 542 bytes, up to0x7bc8bd- 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
- 0x58b0c0 gx
- 0x59ca60 gx
- CGxDeviceOpenGl::InitState gx
- CGxDeviceOpenGl::LoadProjection gx
- CGxDeviceD3d::FlushTextureTransform gx
- CGxDeviceD3d::ApplyTexCoordMode gx
- BuildFrustumCorners gxumath
- ProjectPointsToWindow gxumath
- CMissile::StickInUnit objectlayer
- CWorld::SetObjectTransport terrain
- Rain::DrawPatterShader lighting
- Rain::DrawDropsShader lighting
- Snow::DrawShader lighting
- Sand::DrawShader lighting
- CaptureSceneCamera terrain
- DrawMapObjectPass terrain
- DrawGroupLiquidPass terrain
- DrawRiverPass terrain
- CullExteriorMapObjects terrain
- CullInteriorMapObject terrain
- CMapDoodadDef::Repose terrain
- SeedInteriorVisibility terrain
- SeedExteriorVisibility terrain
- BuildDecalTransforms lighting
- DrawDecalBatches lighting
- CM2Model::EnsureAnimated models
- LightningBolt::Render gx
- CParticleEmitter2::Render models
- CParticleEmitter2::DrawModelParticles models
- CParticleEmitter2::SetFrame models
- MultiplyMatrix4InPlace cmath
- RotateMatrix cmath
- RotateMatrixByQuaternion cmath
- QueryGlareOcclusion lighting
- DrawDisc lighting
Callees 2
- DotRowColumn0 cmath
- Matrix4FromFloats cmath
Calls and jumps by a bare address, from tables/calls.tsv.