From 855e4bc480a2b3e741a382169e3f8678421f8c37 Mon Sep 17 00:00:00 2001 From: Gellule Xg Date: Tue, 6 Dec 2011 22:43:02 -1000 Subject: [PATCH] Another fix related to LightWave ZXY rotation order and Heading, Pitch, Bank convention. --- code/LWOAnimation.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/code/LWOAnimation.cpp b/code/LWOAnimation.cpp index cf88588d3..96535976e 100644 --- a/code/LWOAnimation.cpp +++ b/code/LWOAnimation.cpp @@ -243,14 +243,13 @@ void AnimResolver::ExtractBindPose(aiMatrix4x4& out) if (scale_z) scaling.z = scale_z->keys[0].value; // build the final matrix - aiMatrix4x4 s,r,t; - - r.FromEulerAnglesXYZ(angles); - //aiMatrix4x4::RotationY(angles.y,r); - // fixme: make FromEulerAngles static, too + aiMatrix4x4 s,rx,ry,rz,t; + aiMatrix4x4::RotationZ(angles.z, rz); + aiMatrix4x4::RotationX(angles.y, rx); + aiMatrix4x4::RotationY(angles.x, ry); aiMatrix4x4::Translation(translation,t); aiMatrix4x4::Scaling(scaling,s); - out = s*r*t; + out = t*ry*rx*rz*s; } // ------------------------------------------------------------------------------------------------