diff options
Diffstat (limited to 'scene/animation/animation_player.h')
-rw-r--r-- | scene/animation/animation_player.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h index dd8ffd3286..c20978f13b 100644 --- a/scene/animation/animation_player.h +++ b/scene/animation/animation_player.h @@ -72,6 +72,18 @@ private: float speed_scale = 1.0; double start_time = 0.0; double end_time = 0.0; + double get_start_time() const { + if (from && (Animation::is_less_approx(start_time, 0) || Animation::is_greater_approx(start_time, from->animation->get_length()))) { + return 0; + } + return start_time; + } + double get_end_time() const { + if (from && (Animation::is_less_approx(end_time, 0) || Animation::is_greater_approx(end_time, from->animation->get_length()))) { + return from->animation->get_length(); + } + return end_time; + } }; struct Blend { |