mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-14 17:23:46 +00:00
Added GTWeen
This commit is contained in:
parent
457998788e
commit
2036e4e748
152 changed files with 5889 additions and 7 deletions
|
|
@ -0,0 +1,38 @@
|
|||
using System.Numerics;
|
||||
using GTweens.Easings;
|
||||
|
||||
namespace GTweens.Interpolators
|
||||
{
|
||||
public sealed class SystemVector2Interpolator : IInterpolator<Vector2>
|
||||
{
|
||||
public static readonly SystemVector2Interpolator Instance = new();
|
||||
|
||||
SystemVector2Interpolator()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Vector2 Evaluate(
|
||||
Vector2 initialValue,
|
||||
Vector2 finalValue,
|
||||
float time,
|
||||
EasingDelegate easingDelegate
|
||||
)
|
||||
{
|
||||
return new Vector2(
|
||||
easingDelegate(initialValue.X, finalValue.X, time),
|
||||
easingDelegate(initialValue.Y, finalValue.Y, time)
|
||||
);
|
||||
}
|
||||
|
||||
public Vector2 Subtract(Vector2 initialValue, Vector2 finalValue)
|
||||
{
|
||||
return finalValue - initialValue;
|
||||
}
|
||||
|
||||
public Vector2 Add(Vector2 initialValue, Vector2 finalValue)
|
||||
{
|
||||
return finalValue + initialValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue