Fix order of transformation in GLTF import
From the gltf 2 spec, the order is R * S. Previously we did S * R, which broke some mesh with non-uniform scale.
Fix #23356, Fix #14725
(cherry picked from commit 32dd9c67c6
)
This commit is contained in:
parent
9ca440b763
commit
dffc754a0a
|
@ -237,8 +237,7 @@ Error EditorSceneImporterGLTF::_parse_nodes(GLTFState &state) {
|
||||||
node->scale = _arr_to_vec3(n["scale"]);
|
node->scale = _arr_to_vec3(n["scale"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
node->xform.basis = Basis(node->rotation);
|
node->xform.basis.set_quat_scale(node->rotation, node->scale);
|
||||||
node->xform.basis.scale(node->scale);
|
|
||||||
node->xform.origin = node->translation;
|
node->xform.origin = node->translation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue