summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-11-28 15:18:08 +0100
committerGitHub <noreply@github.com>2018-11-28 15:18:08 +0100
commitc608d770d8bdff5c7c02ef9829befe51d69846d6 (patch)
tree0f026f36f87fee51786d6c09725980527c900e70
parentba54d3e532da4f100c6b3999dd8c49e051f9e21a (diff)
parentfdb1fe6b927deb068a80c0dbf9a892f51108abbf (diff)
Merge pull request #24036 from glaforte/bugfix/18790
Changes the check for a singular matrix to use the scale vector.
-rw-r--r--editor/import/editor_import_collada.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp
index afd09748f3..cdc35a98e2 100644
--- a/editor/import/editor_import_collada.cpp
+++ b/editor/import/editor_import_collada.cpp
@@ -1655,8 +1655,9 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones
}
}
- Quat q = Math::is_equal_approx(xform.basis.determinant(), 0) ? Quat() : xform.basis.get_rotation_quat();
Vector3 s = xform.basis.get_scale();
+ bool singular_matrix = Math::is_equal_approx(s.x, 0.0f) || Math::is_equal_approx(s.y, 0.0f) || Math::is_equal_approx(s.z, 0.0f);
+ Quat q = singular_matrix ? Quat() : xform.basis.get_rotation_quat();
Vector3 l = xform.origin;
animation->transform_track_insert_key(track, snapshots[i], l, q, s);
@@ -1705,8 +1706,9 @@ 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 = Math::is_equal_approx(xform.basis.determinant(), 0) ? Quat() : xform.basis.get_rotation_quat();
Vector3 s = xform.basis.get_scale();
+ bool singular_matrix = Math::is_equal_approx(s.x, 0.0f) || Math::is_equal_approx(s.y, 0.0f) || Math::is_equal_approx(s.z, 0.0f);
+ Quat q = singular_matrix ? Quat() : xform.basis.get_rotation_quat();
Vector3 l = xform.origin;
animation->transform_track_insert_key(track, 0, l, q, s);