mirror of
https://github.com/overte-org/overte.git
synced 2025-08-16 08:32:18 +02:00
Make GLTF joint.globalTransform more correct
This commit is contained in:
parent
d3ed0bc71b
commit
9fd3d44a0d
1 changed files with 2 additions and 1 deletions
|
@ -1008,12 +1008,13 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
|
|||
glm::vec3 scale = extractScale(joint.transform);
|
||||
joint.postTransform = glm::scale(glm::mat4(), scale);
|
||||
|
||||
joint.globalTransform = joint.transform;
|
||||
// Nodes are sorted, so we can apply the full transform just by getting the global transform of the already defined parent
|
||||
if (joint.parentIndex != -1 && joint.parentIndex != nodeIndex) {
|
||||
const auto& parentJoint = hfmModel.joints[(size_t)joint.parentIndex];
|
||||
joint.transform = parentJoint.transform * joint.transform;
|
||||
joint.globalTransform = joint.globalTransform * parentJoint.globalTransform;
|
||||
}
|
||||
joint.globalTransform = joint.transform;
|
||||
|
||||
joint.name = node.name;
|
||||
joint.isSkeletonJoint = false;
|
||||
|
|
Loading…
Reference in a new issue