mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
move AnimUtil into correct namespace
This commit is contained in:
parent
2857f37b00
commit
71c8f453d0
1 changed files with 29 additions and 12 deletions
|
|
@ -1,19 +1,36 @@
|
|||
using System.Numerics;
|
||||
|
||||
/// <summary>
|
||||
/// Class providing helper functions when facilitating animations.
|
||||
/// </summary>
|
||||
public static class AnimUtil
|
||||
namespace Dalamud.Interface.Animation
|
||||
{
|
||||
public static float Lerp(float firstFloat, float secondFloat, float by)
|
||||
/// <summary>
|
||||
/// Class providing helper functions when facilitating animations.
|
||||
/// </summary>
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue