diff options
author | Vivatchai Kaveeta <goodytong@gmail.com> | 2019-03-18 03:08:46 +0700 |
---|---|---|
committer | Vivatchai Kaveeta <goodytong@gmail.com> | 2019-03-18 03:08:46 +0700 |
commit | 32dd9c67c683d40e98b444eab4a0a57a270c1276 (patch) | |
tree | 987c2ddf178a010c3e536af490795b5aeec601da | |
parent | df7d3708c5b535c3696943322a14ec19a175e30c (diff) |
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
-rw-r--r-- | editor/import/editor_scene_importer_gltf.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp index 7032146229..7cdac7da33 100644 --- a/editor/import/editor_scene_importer_gltf.cpp +++ b/editor/import/editor_scene_importer_gltf.cpp @@ -237,8 +237,7 @@ Error EditorSceneImporterGLTF::_parse_nodes(GLTFState &state) { node->scale = _arr_to_vec3(n["scale"]); } - node->xform.basis = Basis(node->rotation); - node->xform.basis.scale(node->scale); + node->xform.basis.set_quat_scale(node->rotation, node->scale); node->xform.origin = node->translation; } |