コード例 #1
0
 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
                ));
 }
コード例 #2
0
        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));
        }
コード例 #3
0
        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));
        }
コード例 #4
0
 static Orb()
 {
     Interpolator       = Interpolators <Vector2> .Cosine;
     InterpolatorSource = _InterpolatorSource;
 }
コード例 #5
0
ファイル: Game.cs プロジェクト: mbahar94/fracture
 static Orb () {
     Interpolator = Interpolators<Vector2>.Cosine;
     InterpolatorSource = _InterpolatorSource;
 }
コード例 #6
0
 public static T Null <U> (BoundInterpolatorSource <T, U> data, ref U obj, int dataOffset, float positionInWindow)
 {
     return(data(ref obj, dataOffset));
 }
コード例 #7
0
ファイル: Interpolators.cs プロジェクト: sq/Libraries
 public T Interpolate <U> (BoundInterpolatorSource <T, U> data, in U obj, int dataOffset, float positionInWindow)