summaryrefslogtreecommitdiff
path: root/scene/animation/animation_player.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-09-16 09:20:50 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-09-16 09:20:50 +0200
commita981a8061f5b3946ee28a3162bcf276173d8b01a (patch)
tree9b76b2a3cffa4ae2d6b9c7ec2403be63f0cfbd96 /scene/animation/animation_player.cpp
parent780211b81b72884132ed76072425b877f109e560 (diff)
parent9d47e079b72c2a0f41e61aebf9f915766fac3bcf (diff)
Merge pull request #65325 from TokageItLab/refactor-variant-for-anim
Move some static methods to `Animation` from `Variant` for refactoring `Animation` and `Tween`
Diffstat (limited to 'scene/animation/animation_player.cpp')
-rw-r--r--scene/animation/animation_player.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp
index 72710cf802..ce9406883d 100644
--- a/scene/animation/animation_player.cpp
+++ b/scene/animation/animation_player.cpp
@@ -650,15 +650,14 @@ void AnimationPlayer::_animation_process_animation(AnimationData *p_anim, double
double c = Math::ease(p_time / first_key_time, transition);
Variant first_value = a->track_get_key_value(i, first_key);
first_value = _post_process_key_value(a, i, first_value, nc->node);
- Variant interp_value;
- Variant::interpolate(pa->capture, first_value, c, interp_value);
+ Variant interp_value = Animation::interpolate_variant(pa->capture, first_value, c);
if (pa->accum_pass != accum_pass) {
ERR_CONTINUE(cache_update_prop_size >= NODE_CACHE_UPDATE_MAX);
cache_update_prop[cache_update_prop_size++] = pa;
pa->value_accum = interp_value;
pa->accum_pass = accum_pass;
} else {
- Variant::interpolate(pa->value_accum, interp_value, p_interp, pa->value_accum);
+ pa->value_accum = Animation::interpolate_variant(pa->value_accum, interp_value, p_interp);
}
continue; //handled
@@ -679,7 +678,7 @@ void AnimationPlayer::_animation_process_animation(AnimationData *p_anim, double
pa->value_accum = value;
pa->accum_pass = accum_pass;
} else {
- Variant::interpolate(pa->value_accum, value, p_interp, pa->value_accum);
+ pa->value_accum = Animation::interpolate_variant(pa->value_accum, value, p_interp);
}
} else if (p_is_current && p_delta != 0) {