mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-19 18:03:48 +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,37 @@
|
|||
using System.Numerics;
|
||||
using GTweens.Easings;
|
||||
|
||||
namespace GTweens.Interpolators
|
||||
{
|
||||
public sealed class SystemQuaternionInterpolator : IInterpolator<Quaternion>
|
||||
{
|
||||
public static readonly SystemQuaternionInterpolator Instance = new();
|
||||
|
||||
SystemQuaternionInterpolator()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Quaternion Evaluate(
|
||||
Quaternion initialValue,
|
||||
Quaternion finalValue,
|
||||
float time,
|
||||
EasingDelegate easingDelegate
|
||||
)
|
||||
{
|
||||
float curveTime = easingDelegate(0f, 1f, time);
|
||||
|
||||
return Quaternion.Slerp(initialValue, finalValue, curveTime);
|
||||
}
|
||||
|
||||
public Quaternion Subtract(Quaternion initialValue, Quaternion finalValue)
|
||||
{
|
||||
return Quaternion.Inverse(initialValue) * finalValue;
|
||||
}
|
||||
|
||||
public Quaternion Add(Quaternion initialValue, Quaternion finalValue)
|
||||
{
|
||||
return initialValue * finalValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue