mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-16 02:03:47 +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,39 @@
|
|||
using System.Numerics;
|
||||
using GTweens.Easings;
|
||||
|
||||
namespace GTweens.Interpolators
|
||||
{
|
||||
public sealed class SystemVector3Interpolator : IInterpolator<Vector3>
|
||||
{
|
||||
public static readonly SystemVector3Interpolator Instance = new();
|
||||
|
||||
SystemVector3Interpolator()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Vector3 Evaluate(
|
||||
Vector3 initialValue,
|
||||
Vector3 finalValue,
|
||||
float time,
|
||||
EasingDelegate easingDelegate
|
||||
)
|
||||
{
|
||||
return new Vector3(
|
||||
easingDelegate(initialValue.X, finalValue.X, time),
|
||||
easingDelegate(initialValue.Y, finalValue.Y, time),
|
||||
easingDelegate(initialValue.Z, finalValue.Z, time)
|
||||
);
|
||||
}
|
||||
|
||||
public Vector3 Subtract(Vector3 initialValue, Vector3 finalValue)
|
||||
{
|
||||
return finalValue - initialValue;
|
||||
}
|
||||
|
||||
public Vector3 Add(Vector3 initialValue, Vector3 finalValue)
|
||||
{
|
||||
return finalValue + initialValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue