summaryrefslogtreecommitdiffstats
path: root/scene/animation/animation_player.h
diff options
context:
space:
mode:
authorGeorge L. Albany <Megacake1234@gmail.com>2024-11-27 21:15:49 +0000
committerGitHub <noreply@github.com>2024-11-27 21:15:49 +0000
commit85d87116e184e7923b8d6804cab2681b61c62d83 (patch)
tree55ec5bfa061a5c27272b831e697b78ed1b756a70 /scene/animation/animation_player.h
parentb06d20bf39d15ec736d08d4e4fcb32e0c3c1ce1e (diff)
parent721f53fde47c2727d99e3ecccdb789a67df36de0 (diff)
downloadredot-engine-master.tar.gz
Merge pull request #886 from Spartan322/merge/f128f38HEADmaster
Merge commit godotengine/godot@f128f38
Diffstat (limited to 'scene/animation/animation_player.h')
-rw-r--r--scene/animation/animation_player.h12
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 {