summaryrefslogtreecommitdiff
path: root/scene/animation/animation_tree.cpp
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2021-05-21 02:42:37 -0400
committerAaron Franke <arnfranke@yahoo.com>2021-08-09 14:04:25 -0500
commit78d33a6e24a3977fc3a2c66808d7cbdddd3add11 (patch)
tree33fb1ac262ab3fa621a4bb8036300000dd53e910 /scene/animation/animation_tree.cpp
parent9d9161c71956201875334b6a2a9ca37a7d5d3970 (diff)
Use doubles for time in animation code
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
}