summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-03-19 00:14:51 +0100
committerGitHub <noreply@github.com>2021-03-19 00:14:51 +0100
commit47cf9985ebf2799d9718fa1a2ca96f2f70c6d212 (patch)
tree99cd8941a4bd8926dec335e3d3c172c29758a286 /modules
parent217d9d1b3057499a64dfff915121afb531198af0 (diff)
parent6770a9413b8a4ec58414054b24469e44b1334540 (diff)
Merge pull request #47128 from ArdaE/master
GLTF importer: Prevent quick accumulation of significant numerical errors in keyframe times
Diffstat (limited to 'modules')
-rw-r--r--modules/gltf/gltf_document.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp
index caf8e3f48f..7ea0aa8ba2 100644
--- a/modules/gltf/gltf_document.cpp
+++ b/modules/gltf/gltf_document.cpp
@@ -5633,8 +5633,8 @@ void GLTFDocument::_import_animation(Ref<GLTFState> state, AnimationPlayer *ap,
animation->track_set_path(track_idx, node_path);
//first determine animation length
- const float increment = 1.0 / float(bake_fps);
- float time = 0.0;
+ const double increment = 1.0 / bake_fps;
+ double time = 0.0;
Vector3 base_pos;
Quat base_rot;
@@ -5724,8 +5724,8 @@ void GLTFDocument::_import_animation(Ref<GLTFState> state, AnimationPlayer *ap,
}
} else {
// CATMULLROMSPLINE or CUBIC_SPLINE have to be baked, apologies.
- const float increment = 1.0 / float(bake_fps);
- float time = 0.0;
+ const double increment = 1.0 / bake_fps;
+ double time = 0.0;
bool last = false;
while (true) {
_interpolate_track<float>(track.weight_tracks[i].times, track.weight_tracks[i].values, time, gltf_interp);