mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-02 22:03:41 +01:00
Revert "refactor(Dalamud): switch to file-scoped namespaces"
This reverts commit b5f34c3199.
This commit is contained in:
parent
d473826247
commit
1561fbac00
325 changed files with 45549 additions and 45209 deletions
|
|
@ -1,35 +1,36 @@
|
|||
using System.Numerics;
|
||||
using System.Numerics;
|
||||
|
||||
namespace Dalamud.Interface.Animation;
|
||||
|
||||
/// <summary>
|
||||
/// Class providing helper functions when facilitating animations.
|
||||
/// </summary>
|
||||
public static class AnimUtil
|
||||
namespace Dalamud.Interface.Animation
|
||||
{
|
||||
/// <summary>
|
||||
/// Lerp between two floats.
|
||||
/// Class providing helper functions when facilitating animations.
|
||||
/// </summary>
|
||||
/// <param name="firstFloat">The first float.</param>
|
||||
/// <param name="secondFloat">The second float.</param>
|
||||
/// <param name="by">The point to lerp to.</param>
|
||||
/// <returns>The lerped value.</returns>
|
||||
public static float Lerp(float firstFloat, float secondFloat, float by)
|
||||
public static class AnimUtil
|
||||
{
|
||||
return (firstFloat * (1 - @by)) + (secondFloat * by);
|
||||
}
|
||||
/// <summary>
|
||||
/// Lerp between two floats.
|
||||
/// </summary>
|
||||
/// <param name="firstFloat">The first float.</param>
|
||||
/// <param name="secondFloat">The second float.</param>
|
||||
/// <param name="by">The point to lerp to.</param>
|
||||
/// <returns>The lerped value.</returns>
|
||||
public static float Lerp(float firstFloat, float secondFloat, float by)
|
||||
{
|
||||
return (firstFloat * (1 - @by)) + (secondFloat * by);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lerp between two vectors.
|
||||
/// </summary>
|
||||
/// <param name="firstVector">The first vector.</param>
|
||||
/// <param name="secondVector">The second float.</param>
|
||||
/// <param name="by">The point to lerp to.</param>
|
||||
/// <returns>The lerped vector.</returns>
|
||||
public static Vector2 Lerp(Vector2 firstVector, Vector2 secondVector, float by)
|
||||
{
|
||||
var retX = Lerp(firstVector.X, secondVector.X, by);
|
||||
var retY = Lerp(firstVector.Y, secondVector.Y, by);
|
||||
return new Vector2(retX, retY);
|
||||
/// <summary>
|
||||
/// Lerp between two vectors.
|
||||
/// </summary>
|
||||
/// <param name="firstVector">The first vector.</param>
|
||||
/// <param name="secondVector">The second float.</param>
|
||||
/// <param name="by">The point to lerp to.</param>
|
||||
/// <returns>The lerped vector.</returns>
|
||||
public static Vector2 Lerp(Vector2 firstVector, Vector2 secondVector, float by)
|
||||
{
|
||||
var retX = Lerp(firstVector.X, secondVector.X, by);
|
||||
var retY = Lerp(firstVector.Y, secondVector.Y, by);
|
||||
return new Vector2(retX, retY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,116 +1,117 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Numerics;
|
||||
|
||||
namespace Dalamud.Interface.Animation;
|
||||
|
||||
/// <summary>
|
||||
/// Base class facilitating the implementation of easing functions.
|
||||
/// </summary>
|
||||
public abstract class Easing
|
||||
namespace Dalamud.Interface.Animation
|
||||
{
|
||||
// TODO: Use game delta time here instead
|
||||
private readonly Stopwatch animationTimer = new();
|
||||
|
||||
private double valueInternal;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Easing"/> class with the specified duration.
|
||||
/// Base class facilitating the implementation of easing functions.
|
||||
/// </summary>
|
||||
/// <param name="duration">The animation duration.</param>
|
||||
protected Easing(TimeSpan duration)
|
||||
public abstract class Easing
|
||||
{
|
||||
this.Duration = duration;
|
||||
}
|
||||
// TODO: Use game delta time here instead
|
||||
private readonly Stopwatch animationTimer = new();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the origin point of the animation.
|
||||
/// </summary>
|
||||
public Vector2? Point1 { get; set; }
|
||||
private double valueInternal;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the destination point of the animation.
|
||||
/// </summary>
|
||||
public Vector2? Point2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the resulting point at the current timestep.
|
||||
/// </summary>
|
||||
public Vector2 EasedPoint { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the result of the easing should be inversed.
|
||||
/// </summary>
|
||||
public bool IsInverse { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the current value of the animation, from 0 to 1.
|
||||
/// </summary>
|
||||
public double Value
|
||||
{
|
||||
get
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Easing"/> class with the specified duration.
|
||||
/// </summary>
|
||||
/// <param name="duration">The animation duration.</param>
|
||||
protected Easing(TimeSpan duration)
|
||||
{
|
||||
if (this.IsInverse)
|
||||
return 1 - this.valueInternal;
|
||||
|
||||
return this.valueInternal;
|
||||
this.Duration = duration;
|
||||
}
|
||||
|
||||
protected set
|
||||
/// <summary>
|
||||
/// Gets or sets the origin point of the animation.
|
||||
/// </summary>
|
||||
public Vector2? Point1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the destination point of the animation.
|
||||
/// </summary>
|
||||
public Vector2? Point2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the resulting point at the current timestep.
|
||||
/// </summary>
|
||||
public Vector2 EasedPoint { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the result of the easing should be inversed.
|
||||
/// </summary>
|
||||
public bool IsInverse { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the current value of the animation, from 0 to 1.
|
||||
/// </summary>
|
||||
public double Value
|
||||
{
|
||||
this.valueInternal = value;
|
||||
get
|
||||
{
|
||||
if (this.IsInverse)
|
||||
return 1 - this.valueInternal;
|
||||
|
||||
if (this.Point1.HasValue && this.Point2.HasValue)
|
||||
this.EasedPoint = AnimUtil.Lerp(this.Point1.Value, this.Point2.Value, (float)this.valueInternal);
|
||||
return this.valueInternal;
|
||||
}
|
||||
|
||||
protected set
|
||||
{
|
||||
this.valueInternal = value;
|
||||
|
||||
if (this.Point1.HasValue && this.Point2.HasValue)
|
||||
this.EasedPoint = AnimUtil.Lerp(this.Point1.Value, this.Point2.Value, (float)this.valueInternal);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the duration of the animation.
|
||||
/// </summary>
|
||||
public TimeSpan Duration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether or not the animation is running.
|
||||
/// </summary>
|
||||
public bool IsRunning => this.animationTimer.IsRunning;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether or not the animation is done.
|
||||
/// </summary>
|
||||
public bool IsDone => this.animationTimer.ElapsedMilliseconds > this.Duration.TotalMilliseconds;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the progress of the animation, from 0 to 1.
|
||||
/// </summary>
|
||||
protected double Progress => this.animationTimer.ElapsedMilliseconds / this.Duration.TotalMilliseconds;
|
||||
|
||||
/// <summary>
|
||||
/// Starts the animation from where it was last stopped, or from the start if it was never started before.
|
||||
/// </summary>
|
||||
public void Start()
|
||||
{
|
||||
this.animationTimer.Start();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stops the animation at the current point.
|
||||
/// </summary>
|
||||
public void Stop()
|
||||
{
|
||||
this.animationTimer.Stop();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restarts the animation.
|
||||
/// </summary>
|
||||
public void Restart()
|
||||
{
|
||||
this.animationTimer.Restart();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the animation.
|
||||
/// </summary>
|
||||
public abstract void Update();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the duration of the animation.
|
||||
/// </summary>
|
||||
public TimeSpan Duration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether or not the animation is running.
|
||||
/// </summary>
|
||||
public bool IsRunning => this.animationTimer.IsRunning;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether or not the animation is done.
|
||||
/// </summary>
|
||||
public bool IsDone => this.animationTimer.ElapsedMilliseconds > this.Duration.TotalMilliseconds;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the progress of the animation, from 0 to 1.
|
||||
/// </summary>
|
||||
protected double Progress => this.animationTimer.ElapsedMilliseconds / this.Duration.TotalMilliseconds;
|
||||
|
||||
/// <summary>
|
||||
/// Starts the animation from where it was last stopped, or from the start if it was never started before.
|
||||
/// </summary>
|
||||
public void Start()
|
||||
{
|
||||
this.animationTimer.Start();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stops the animation at the current point.
|
||||
/// </summary>
|
||||
public void Stop()
|
||||
{
|
||||
this.animationTimer.Stop();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restarts the animation.
|
||||
/// </summary>
|
||||
public void Restart()
|
||||
{
|
||||
this.animationTimer.Restart();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the animation.
|
||||
/// </summary>
|
||||
public abstract void Update();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +1,27 @@
|
|||
using System;
|
||||
using System;
|
||||
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions;
|
||||
|
||||
/// <summary>
|
||||
/// Class providing an "InCirc" easing animation.
|
||||
/// </summary>
|
||||
public class InCirc : Easing
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InCirc"/> class.
|
||||
/// Class providing an "InCirc" easing animation.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public InCirc(TimeSpan duration)
|
||||
: base(duration)
|
||||
public class InCirc : Easing
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InCirc"/> class.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public InCirc(TimeSpan duration)
|
||||
: base(duration)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = 1 - Math.Sqrt(1 - Math.Pow(p, 2));
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = 1 - Math.Sqrt(1 - Math.Pow(p, 2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +1,27 @@
|
|||
using System;
|
||||
using System;
|
||||
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions;
|
||||
|
||||
/// <summary>
|
||||
/// Class providing an "InCubic" easing animation.
|
||||
/// </summary>
|
||||
public class InCubic : Easing
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InCubic"/> class.
|
||||
/// Class providing an "InCubic" easing animation.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public InCubic(TimeSpan duration)
|
||||
: base(duration)
|
||||
public class InCubic : Easing
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InCubic"/> class.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public InCubic(TimeSpan duration)
|
||||
: base(duration)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = p * p * p;
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = p * p * p;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,32 +1,33 @@
|
|||
using System;
|
||||
using System;
|
||||
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions;
|
||||
|
||||
/// <summary>
|
||||
/// Class providing an "InElastic" easing animation.
|
||||
/// </summary>
|
||||
public class InElastic : Easing
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions
|
||||
{
|
||||
private const double Constant = (2 * Math.PI) / 3;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InElastic"/> class.
|
||||
/// Class providing an "InElastic" easing animation.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public InElastic(TimeSpan duration)
|
||||
: base(duration)
|
||||
public class InElastic : Easing
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
private const double Constant = (2 * Math.PI) / 3;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = p == 0
|
||||
? 0
|
||||
: p == 1
|
||||
? 1
|
||||
: -Math.Pow(2, (10 * p) - 10) * Math.Sin(((p * 10) - 10.75) * Constant);
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InElastic"/> class.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public InElastic(TimeSpan duration)
|
||||
: base(duration)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = p == 0
|
||||
? 0
|
||||
: p == 1
|
||||
? 1
|
||||
: -Math.Pow(2, (10 * p) - 10) * Math.Sin(((p * 10) - 10.75) * Constant);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,28 +1,29 @@
|
|||
using System;
|
||||
using System;
|
||||
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions;
|
||||
|
||||
/// <summary>
|
||||
/// Class providing an "InOutCirc" easing animation.
|
||||
/// </summary>
|
||||
public class InOutCirc : Easing
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InOutCirc"/> class.
|
||||
/// Class providing an "InOutCirc" easing animation.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public InOutCirc(TimeSpan duration)
|
||||
: base(duration)
|
||||
public class InOutCirc : Easing
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InOutCirc"/> class.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public InOutCirc(TimeSpan duration)
|
||||
: base(duration)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = p < 0.5
|
||||
? (1 - Math.Sqrt(1 - Math.Pow(2 * p, 2))) / 2
|
||||
: (Math.Sqrt(1 - Math.Pow((-2 * p) + 2, 2)) + 1) / 2;
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = p < 0.5
|
||||
? (1 - Math.Sqrt(1 - Math.Pow(2 * p, 2))) / 2
|
||||
: (Math.Sqrt(1 - Math.Pow((-2 * p) + 2, 2)) + 1) / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +1,27 @@
|
|||
using System;
|
||||
using System;
|
||||
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions;
|
||||
|
||||
/// <summary>
|
||||
/// Class providing an "InOutCubic" easing animation.
|
||||
/// </summary>
|
||||
public class InOutCubic : Easing
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InOutCubic"/> class.
|
||||
/// Class providing an "InOutCubic" easing animation.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public InOutCubic(TimeSpan duration)
|
||||
: base(duration)
|
||||
public class InOutCubic : Easing
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InOutCubic"/> class.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public InOutCubic(TimeSpan duration)
|
||||
: base(duration)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = p < 0.5 ? 4 * p * p * p : 1 - (Math.Pow((-2 * p) + 2, 3) / 2);
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = p < 0.5 ? 4 * p * p * p : 1 - (Math.Pow((-2 * p) + 2, 3) / 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,34 +1,35 @@
|
|||
using System;
|
||||
using System;
|
||||
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions;
|
||||
|
||||
/// <summary>
|
||||
/// Class providing an "InOutCirc" easing animation.
|
||||
/// </summary>
|
||||
public class InOutElastic : Easing
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions
|
||||
{
|
||||
private const double Constant = (2 * Math.PI) / 4.5;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InOutElastic"/> class.
|
||||
/// Class providing an "InOutCirc" easing animation.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public InOutElastic(TimeSpan duration)
|
||||
: base(duration)
|
||||
public class InOutElastic : Easing
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
private const double Constant = (2 * Math.PI) / 4.5;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = p == 0
|
||||
? 0
|
||||
: p == 1
|
||||
? 1
|
||||
: p < 0.5
|
||||
? -(Math.Pow(2, (20 * p) - 10) * Math.Sin(((20 * p) - 11.125) * Constant)) / 2
|
||||
: (Math.Pow(2, (-20 * p) + 10) * Math.Sin(((20 * p) - 11.125) * Constant) / 2) + 1;
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InOutElastic"/> class.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public InOutElastic(TimeSpan duration)
|
||||
: base(duration)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = p == 0
|
||||
? 0
|
||||
: p == 1
|
||||
? 1
|
||||
: p < 0.5
|
||||
? -(Math.Pow(2, (20 * p) - 10) * Math.Sin(((20 * p) - 11.125) * Constant)) / 2
|
||||
: (Math.Pow(2, (-20 * p) + 10) * Math.Sin(((20 * p) - 11.125) * Constant) / 2) + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +1,27 @@
|
|||
using System;
|
||||
using System;
|
||||
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions;
|
||||
|
||||
/// <summary>
|
||||
/// Class providing an "InOutQuint" easing animation.
|
||||
/// </summary>
|
||||
public class InOutQuint : Easing
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InOutQuint"/> class.
|
||||
/// Class providing an "InOutQuint" easing animation.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public InOutQuint(TimeSpan duration)
|
||||
: base(duration)
|
||||
public class InOutQuint : Easing
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InOutQuint"/> class.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public InOutQuint(TimeSpan duration)
|
||||
: base(duration)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = p < 0.5 ? 16 * p * p * p * p * p : 1 - (Math.Pow((-2 * p) + 2, 5) / 2);
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = p < 0.5 ? 16 * p * p * p * p * p : 1 - (Math.Pow((-2 * p) + 2, 5) / 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +1,27 @@
|
|||
using System;
|
||||
using System;
|
||||
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions;
|
||||
|
||||
/// <summary>
|
||||
/// Class providing an "InOutSine" easing animation.
|
||||
/// </summary>
|
||||
public class InOutSine : Easing
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InOutSine"/> class.
|
||||
/// Class providing an "InOutSine" easing animation.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public InOutSine(TimeSpan duration)
|
||||
: base(duration)
|
||||
public class InOutSine : Easing
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InOutSine"/> class.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public InOutSine(TimeSpan duration)
|
||||
: base(duration)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = -(Math.Cos(Math.PI * p) - 1) / 2;
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = -(Math.Cos(Math.PI * p) - 1) / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +1,27 @@
|
|||
using System;
|
||||
using System;
|
||||
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions;
|
||||
|
||||
/// <summary>
|
||||
/// Class providing an "InQuint" easing animation.
|
||||
/// </summary>
|
||||
public class InQuint : Easing
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InQuint"/> class.
|
||||
/// Class providing an "InQuint" easing animation.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public InQuint(TimeSpan duration)
|
||||
: base(duration)
|
||||
public class InQuint : Easing
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InQuint"/> class.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public InQuint(TimeSpan duration)
|
||||
: base(duration)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = p * p * p * p * p;
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = p * p * p * p * p;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +1,27 @@
|
|||
using System;
|
||||
using System;
|
||||
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions;
|
||||
|
||||
/// <summary>
|
||||
/// Class providing an "InSine" easing animation.
|
||||
/// </summary>
|
||||
public class InSine : Easing
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InSine"/> class.
|
||||
/// Class providing an "InSine" easing animation.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public InSine(TimeSpan duration)
|
||||
: base(duration)
|
||||
public class InSine : Easing
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InSine"/> class.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public InSine(TimeSpan duration)
|
||||
: base(duration)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = 1 - Math.Cos((p * Math.PI) / 2);
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = 1 - Math.Cos((p * Math.PI) / 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +1,27 @@
|
|||
using System;
|
||||
using System;
|
||||
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions;
|
||||
|
||||
/// <summary>
|
||||
/// Class providing an "OutCirc" easing animation.
|
||||
/// </summary>
|
||||
public class OutCirc : Easing
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="OutCirc"/> class.
|
||||
/// Class providing an "OutCirc" easing animation.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public OutCirc(TimeSpan duration)
|
||||
: base(duration)
|
||||
public class OutCirc : Easing
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="OutCirc"/> class.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public OutCirc(TimeSpan duration)
|
||||
: base(duration)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = Math.Sqrt(1 - Math.Pow(p - 1, 2));
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = Math.Sqrt(1 - Math.Pow(p - 1, 2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +1,27 @@
|
|||
using System;
|
||||
using System;
|
||||
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions;
|
||||
|
||||
/// <summary>
|
||||
/// Class providing an "OutCubic" easing animation.
|
||||
/// </summary>
|
||||
public class OutCubic : Easing
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="OutCubic"/> class.
|
||||
/// Class providing an "OutCubic" easing animation.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public OutCubic(TimeSpan duration)
|
||||
: base(duration)
|
||||
public class OutCubic : Easing
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="OutCubic"/> class.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public OutCubic(TimeSpan duration)
|
||||
: base(duration)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = 1 - Math.Pow(1 - p, 3);
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = 1 - Math.Pow(1 - p, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,32 +1,33 @@
|
|||
using System;
|
||||
using System;
|
||||
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions;
|
||||
|
||||
/// <summary>
|
||||
/// Class providing an "OutElastic" easing animation.
|
||||
/// </summary>
|
||||
public class OutElastic : Easing
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions
|
||||
{
|
||||
private const double Constant = (2 * Math.PI) / 3;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="OutElastic"/> class.
|
||||
/// Class providing an "OutElastic" easing animation.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public OutElastic(TimeSpan duration)
|
||||
: base(duration)
|
||||
public class OutElastic : Easing
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
private const double Constant = (2 * Math.PI) / 3;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = p == 0
|
||||
? 0
|
||||
: p == 1
|
||||
? 1
|
||||
: (Math.Pow(2, -10 * p) * Math.Sin(((p * 10) - 0.75) * Constant)) + 1;
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="OutElastic"/> class.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public OutElastic(TimeSpan duration)
|
||||
: base(duration)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = p == 0
|
||||
? 0
|
||||
: p == 1
|
||||
? 1
|
||||
: (Math.Pow(2, -10 * p) * Math.Sin(((p * 10) - 0.75) * Constant)) + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +1,27 @@
|
|||
using System;
|
||||
using System;
|
||||
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions;
|
||||
|
||||
/// <summary>
|
||||
/// Class providing an "OutQuint" easing animation.
|
||||
/// </summary>
|
||||
public class OutQuint : Easing
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="OutQuint"/> class.
|
||||
/// Class providing an "OutQuint" easing animation.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public OutQuint(TimeSpan duration)
|
||||
: base(duration)
|
||||
public class OutQuint : Easing
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="OutQuint"/> class.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public OutQuint(TimeSpan duration)
|
||||
: base(duration)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = 1 - Math.Pow(1 - p, 5);
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = 1 - Math.Pow(1 - p, 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +1,27 @@
|
|||
using System;
|
||||
using System;
|
||||
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions;
|
||||
|
||||
/// <summary>
|
||||
/// Class providing an "OutSine" easing animation.
|
||||
/// </summary>
|
||||
public class OutSine : Easing
|
||||
namespace Dalamud.Interface.Animation.EasingFunctions
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="OutSine"/> class.
|
||||
/// Class providing an "OutSine" easing animation.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public OutSine(TimeSpan duration)
|
||||
: base(duration)
|
||||
public class OutSine : Easing
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="OutSine"/> class.
|
||||
/// </summary>
|
||||
/// <param name="duration">The duration of the animation.</param>
|
||||
public OutSine(TimeSpan duration)
|
||||
: base(duration)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = Math.Sin((p * Math.PI) / 2);
|
||||
/// <inheritdoc/>
|
||||
public override void Update()
|
||||
{
|
||||
var p = this.Progress;
|
||||
this.Value = Math.Sin((p * Math.PI) / 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue