public static T Cosine <U> (BoundInterpolatorSource <T, U> data, ref U obj, int dataOffset, float positionInWindow) { return(_Cosine( data(ref obj, dataOffset), data(ref obj, dataOffset + 1), positionInWindow )); }
public static T Cubic <U> (BoundInterpolatorSource <T, U> data, ref U obj, int dataOffset, float positionInWindow) { if (positionInWindow < 0) { var n = Math.Ceiling(Math.Abs(positionInWindow)); positionInWindow += (float)n; dataOffset -= (int)n; } T a = data(ref obj, dataOffset - 1); T b = data(ref obj, dataOffset); T c = data(ref obj, dataOffset + 1); T d = data(ref obj, dataOffset + 2); T p = _CubicP(a, b, c, d); float x2 = positionInWindow * positionInWindow; float x3 = positionInWindow * x2; return(_CubicR(a, b, c, d, p, positionInWindow, x2, x3)); }
public static T Hermite <U> (BoundInterpolatorSource <T, U> data, ref U obj, int dataOffset, float positionInWindow) { if (positionInWindow < 0) { var n = Math.Ceiling(Math.Abs(positionInWindow)); positionInWindow += (float)n; dataOffset -= (int)n; } T a = data(ref obj, dataOffset); T u = data(ref obj, dataOffset + 1); T d = data(ref obj, dataOffset + 2); T v = data(ref obj, dataOffset + 3); var tSquared = positionInWindow * positionInWindow; var t2 = positionInWindow * 2; var s = 1 - positionInWindow; var s2 = s * 2; var sSquared = s * s; return(_Hermite(a, u, d, v, positionInWindow, t2, tSquared, s, s2, sSquared)); }
static Orb() { Interpolator = Interpolators <Vector2> .Cosine; InterpolatorSource = _InterpolatorSource; }
static Orb () { Interpolator = Interpolators<Vector2>.Cosine; InterpolatorSource = _InterpolatorSource; }
public static T Null <U> (BoundInterpolatorSource <T, U> data, ref U obj, int dataOffset, float positionInWindow) { return(data(ref obj, dataOffset)); }
public T Interpolate <U> (BoundInterpolatorSource <T, U> data, in U obj, int dataOffset, float positionInWindow)