summaryrefslogtreecommitdiff
path: root/modules/gltf
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-06-30 18:47:40 +0200
committerGitHub <noreply@github.com>2021-06-30 18:47:40 +0200
commita02620f3a5f3b94c68dfbe18874b34ac1c32374a (patch)
tree6e203152459a2efff38db6a18490f38f9efc88bf /modules/gltf
parent6f9767eff75c1e1db635139588994ad7ce1763b8 (diff)
parent75688772b3efadb8a36b1bb7ccde9c08819bc58e (diff)
Merge pull request #50009 from reduz/fix-suffixes-and-degrees
Fix editor suffixes and degrees conversion
Diffstat (limited to 'modules/gltf')
-rw-r--r--modules/gltf/gltf_document.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp
index a5080f9c41..660c2ab305 100644
--- a/modules/gltf/gltf_document.cpp
+++ b/modules/gltf/gltf_document.cpp
@@ -6089,7 +6089,7 @@ GLTFAnimation::Track GLTFDocument::_convert_animation_track(Ref<GLTFState> state
Vector3 translation = p_animation->track_get_key_value(p_track_i, key_i);
p_track.translation_track.values.write[key_i] = translation;
}
- } else if (path.find(":rotation_degrees") != -1) {
+ } else if (path.find(":rotation") != -1) {
p_track.rotation_track.times = times;
p_track.rotation_track.interpolation = gltf_interpolation;
@@ -6097,11 +6097,7 @@ GLTFAnimation::Track GLTFDocument::_convert_animation_track(Ref<GLTFState> state
p_track.rotation_track.interpolation = gltf_interpolation;
for (int32_t key_i = 0; key_i < key_count; key_i++) {
- Vector3 rotation_degrees = p_animation->track_get_key_value(p_track_i, key_i);
- Vector3 rotation_radian;
- rotation_radian.x = Math::deg2rad(rotation_degrees.x);
- rotation_radian.y = Math::deg2rad(rotation_degrees.y);
- rotation_radian.z = Math::deg2rad(rotation_degrees.z);
+ Vector3 rotation_radian = p_animation->track_get_key_value(p_track_i, key_i);
p_track.rotation_track.values.write[key_i] = Quaternion(rotation_radian);
}
} else if (path.find(":scale") != -1) {