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.

This commit is contained in:
Farshid Lashkari
2017-04-18 17:01:26 +01:00
committed by Robert Osfield
parent 2523dee7e0
commit 9bc93fb18e

View File

@@ -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();