mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 15:43:50 +02:00
Fix FBX UpAxis transform not being applied to skinned models
This commit is contained in:
parent
3de61b4a18
commit
9fd76cac84
1 changed files with 6 additions and 1 deletions
|
@ -1312,6 +1312,7 @@ HFMModel* FBXSerializer::extractHFMModel(const hifi::VariantHash& mapping, const
|
|||
joint.preTransform = fbxModel.preTransform;
|
||||
joint.preRotation = fbxModel.preRotation;
|
||||
joint.rotation = fbxModel.rotation;
|
||||
glm::quat rotationWithoutUpZAxis = fbxModel.rotation;
|
||||
joint.postRotation = fbxModel.postRotation;
|
||||
joint.postTransform = fbxModel.postTransform;
|
||||
joint.rotationMin = fbxModel.rotationMin;
|
||||
|
@ -1379,7 +1380,11 @@ HFMModel* FBXSerializer::extractHFMModel(const hifi::VariantHash& mapping, const
|
|||
// Now that we've initialized the joint, we can define the transform
|
||||
// modelIDs is ordered from parent to children, so we can safely get parent transforms from earlier joints as we iterate
|
||||
joint.localTransform = glm::translate(joint.translation) * joint.preTransform * glm::mat4_cast(joint.preRotation * joint.rotation * joint.postRotation) * joint.postTransform;
|
||||
joint.globalTransform = joint.localTransform;
|
||||
if (applyUpAxisZRotation) {
|
||||
joint.globalTransform = glm::translate(joint.translation) * joint.preTransform * glm::mat4_cast(joint.preRotation * rotationWithoutUpZAxis * joint.postRotation) * joint.postTransform;
|
||||
} else {
|
||||
joint.globalTransform = joint.localTransform;
|
||||
}
|
||||
if (joint.parentIndex != -1 && joint.parentIndex < (int)jointIndex && !needMixamoHack) {
|
||||
hfm::Joint& parentJoint = hfmModel.joints[joint.parentIndex];
|
||||
// SG Change: i think this not correct and the [parent]*[local] is the correct answer here
|
||||
|
|
Loading…
Reference in a new issue