summaryrefslogtreecommitdiff
path: root/scene/animation/animation_tree.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2021-08-09 23:02:43 +0200
committerGitHub <noreply@github.com>2021-08-09 23:02:43 +0200
commit7bcfc66fb4253fb121008809e4e81c5b704776b7 (patch)
tree770bb6c7c266c5266f4de3ceab52e756b55bf440 /scene/animation/animation_tree.cpp
parent9d9161c71956201875334b6a2a9ca37a7d5d3970 (diff)
parent84f720966c74d5b37f70e21867e9e3e6a1e44c36 (diff)
Merge pull request #51294 from aaronfranke/double-time
Diffstat (limited to 'scene/animation/animation_tree.cpp')
-rw-r--r--scene/animation/animation_tree.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp
index e623309888..5674f86e1f 100644
--- a/scene/animation/animation_tree.cpp
+++ b/scene/animation/animation_tree.cpp
@@ -328,7 +328,7 @@ void AnimationNode::remove_input(int p_index) {
emit_changed();
}
-float AnimationNode::process(float p_time, bool p_seek) {
+double AnimationNode::process(double p_time, bool p_seek) {
if (get_script_instance()) {
return get_script_instance()->call("_process", p_time, p_seek);
}
@@ -818,8 +818,8 @@ void AnimationTree::_process_graph(float p_delta) {
for (const AnimationNode::AnimationState &as : state.animation_states) {
Ref<Animation> a = as.animation;
- float time = as.time;
- float delta = as.delta;
+ double time = as.time;
+ double delta = as.delta;
float weight = as.blend;
bool seeked = as.seeked;
@@ -1132,7 +1132,7 @@ void AnimationTree::_process_graph(float p_delta) {
continue;
}
- float pos = a->track_get_key_time(i, idx);
+ double pos = a->track_get_key_time(i, idx);
StringName anim_name = a->animation_track_get_key_animation(i, idx);
if (String(anim_name) == "[stop]" || !player2->has_animation(anim_name)) {
@@ -1144,7 +1144,7 @@ void AnimationTree::_process_graph(float p_delta) {
float at_anim_pos;
if (anim->has_loop()) {
- at_anim_pos = Math::fposmod(time - pos, anim->get_length()); //seek to loop
+ at_anim_pos = Math::fposmod(time - pos, (double)anim->get_length()); //seek to loop
} else {
at_anim_pos = MAX(anim->get_length(), time - pos); //seek to end
}