From 85b19cafbcc10cde06025454ee6760159841fc41 Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Sun, 18 Jul 2021 22:57:13 +0200 Subject: [PATCH] feat(Animation): add OutCubic --- .../Animation/EasingFunctions/OutCubic.cs | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Dalamud/Interface/Animation/EasingFunctions/OutCubic.cs diff --git a/Dalamud/Interface/Animation/EasingFunctions/OutCubic.cs b/Dalamud/Interface/Animation/EasingFunctions/OutCubic.cs new file mode 100644 index 000000000..e527b228f --- /dev/null +++ b/Dalamud/Interface/Animation/EasingFunctions/OutCubic.cs @@ -0,0 +1,27 @@ +using System; + +namespace Dalamud.Interface.Animation.EasingFunctions +{ + /// + /// Class providing an "OutCubic" easing animation. + /// + public class OutCubic : Easing + { + /// + /// Initializes a new instance of the class. + /// + /// The duration of the animation. + public OutCubic(TimeSpan duration) + : base(duration) + { + // ignored + } + + /// + public override void Update() + { + var p = this.Progress; + this.Value = 1 - Math.Pow(1 - p, 3); + } + } +}