From 9bc93fb18e91c6dfd06b3b85ac62059c9c7c4e22 Mon Sep 17 00:00:00 2001 From: Farshid Lashkari Date: Tue, 18 Apr 2017 17:01:26 +0100 Subject: [PATCH] There is a small bug in how the FBX importer computes the rotation matrix for nodes. It applies the "RotationOrder" property to the local, pre, and post rotation values. However, the pre/post rotation values should always use a fixed XYZ order. The "RotationOrder" property should only apply to the local rotation value. I've attached the updated file with the fix. --- src/osgPlugins/fbx/fbxRNode.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/osgPlugins/fbx/fbxRNode.cpp b/src/osgPlugins/fbx/fbxRNode.cpp index 68657a138..ec82c4ee9 100644 --- a/src/osgPlugins/fbx/fbxRNode.cpp +++ b/src/osgPlugins/fbx/fbxRNode.cpp @@ -162,9 +162,9 @@ void makeLocalMatrix(const FbxNode* pNode, osg::Matrix& m) if (rotationActive) { m.preMultRotate( - makeQuat(fbxPostRot, fbxRotOrder) * + makeQuat(fbxPostRot, eEulerXYZ) * makeQuat(fbxLclRot, fbxRotOrder) * - makeQuat(fbxPreRot, fbxRotOrder)); + makeQuat(fbxPreRot, eEulerXYZ)); } else { @@ -339,7 +339,7 @@ void readUpdateMatrixTransform(osgAnimation::UpdateMatrixTransform* pUpdate, Fbx if (rotationActive) { - staticTransform.preMultRotate(makeQuat(pNode->PreRotation.Get(), fbxRotOrder)); + staticTransform.preMultRotate(makeQuat(pNode->PreRotation.Get(), eEulerXYZ)); } readRotationElement(pNode->LclRotation, fbxRotOrder, @@ -348,7 +348,7 @@ void readUpdateMatrixTransform(osgAnimation::UpdateMatrixTransform* pUpdate, Fbx if (rotationActive) { - staticTransform.preMultRotate(makeQuat(pNode->PostRotation.Get(), fbxRotOrder)); + staticTransform.preMultRotate(makeQuat(pNode->PostRotation.Get(), eEulerXYZ)); } FbxDouble3 fbxSclOffset = pNode->ScalingOffset.Get();