mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 07:12:40 +02:00
It makes more sense for joint.globalTransform to have the hfmModel.offset applied
This commit is contained in:
parent
28e3fd4bc4
commit
3c078eeef6
3 changed files with 5 additions and 5 deletions
|
@ -1362,8 +1362,8 @@ HFMModel* FBXSerializer::extractHFMModel(const hifi::VariantHash& mapping, const
|
|||
joint.localTransform = glm::translate(joint.translation) * joint.preTransform * glm::mat4_cast(combinedRotation) * joint.postTransform;
|
||||
|
||||
if (joint.parentIndex == -1) {
|
||||
joint.transform = hfmModel.offset * joint.localTransform;
|
||||
joint.globalTransform = joint.localTransform;
|
||||
joint.transform = joint.localTransform;
|
||||
joint.globalTransform = hfmModel.offset * joint.localTransform;
|
||||
joint.inverseDefaultRotation = glm::inverse(combinedRotation);
|
||||
joint.distanceToParent = 0.0f;
|
||||
} else {
|
||||
|
|
|
@ -1015,7 +1015,7 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
|
|||
joint.transform = parentJoint.transform * joint.transform;
|
||||
joint.globalTransform = joint.globalTransform * parentJoint.globalTransform;
|
||||
} else {
|
||||
joint.transform = hfmModel.offset * joint.transform;
|
||||
joint.transform = joint.transform;
|
||||
joint.globalTransform = hfmModel.offset * joint.globalTransform;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,13 +43,13 @@ void calculateExtentsForShape(hfm::Shape& shape, const std::vector<hfm::Mesh>& m
|
|||
const auto& mesh = meshes[shape.mesh];
|
||||
const auto& meshPart = mesh.parts[shape.meshPart];
|
||||
|
||||
glm::mat4 globalTransform = joints[shape.joint].globalTransform;
|
||||
glm::mat4 transform = joints[shape.joint].transform;
|
||||
forEachIndex(meshPart, [&](int32_t idx){
|
||||
if (mesh.vertices.size() <= idx) {
|
||||
return;
|
||||
}
|
||||
const glm::vec3& vertex = mesh.vertices[idx];
|
||||
const glm::vec3 transformedVertex = glm::vec3(globalTransform * glm::vec4(vertex, 1.0f));
|
||||
const glm::vec3 transformedVertex = glm::vec3(transform * glm::vec4(vertex, 1.0f));
|
||||
shapeExtents.addPoint(transformedVertex);
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue