summaryrefslogtreecommitdiff
path: root/editor/import
diff options
context:
space:
mode:
authortagcup <tagcup@yahoo.com>2018-05-26 23:14:05 -0400
committertagcup <tagcup@yahoo.com>2018-05-27 14:15:47 -0400
commit9d41161596167984efdb02639d0857da8979b01b (patch)
treec97563d142deed97f9796dc2814781d09cd8d26e /editor/import
parent130fd6bcb88d7b297b13c3ed20a715b5ab9cce47 (diff)
Fixed Basis -> Quat conversions, added a few safety checks.
Fixes #19027.
Diffstat (limited to 'editor/import')
-rw-r--r--editor/import/editor_import_collada.cpp6
-rw-r--r--editor/import/editor_scene_importer_gltf.cpp3
2 files changed, 3 insertions, 6 deletions
diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp
index 2fb3bf7b1e..a13f741ee7 100644
--- a/editor/import/editor_import_collada.cpp
+++ b/editor/import/editor_import_collada.cpp
@@ -1785,8 +1785,7 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones
}
}
- Quat q = xform.basis;
- q.normalize();
+ Quat q = xform.basis.get_rotation_quat();
Vector3 s = xform.basis.get_scale();
Vector3 l = xform.origin;
@@ -1838,8 +1837,7 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones
xform = sk->get_bone_rest(nm.bone).affine_inverse() * xform;
- Quat q = xform.basis;
- q.normalize();
+ Quat q = xform.basis.get_rotation_quat();
Vector3 s = xform.basis.get_scale();
Vector3 l = xform.origin;
diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp
index f4be6e8d59..2b6a453d8f 100644
--- a/editor/import/editor_scene_importer_gltf.cpp
+++ b/editor/import/editor_scene_importer_gltf.cpp
@@ -1983,8 +1983,7 @@ void EditorSceneImporterGLTF::_import_animation(GLTFState &state, AnimationPlaye
int bone = node->joints[i].godot_bone_index;
xform = skeleton->get_bone_rest(bone).affine_inverse() * xform;
- rot = xform.basis;
- rot.normalize();
+ rot = xform.basis.get_rotation_quat();
scale = xform.basis.get_scale();
pos = xform.origin;
}