Пример #1
0
    public SsInterpolatable Interpolate(SsCurveParams curve, float time, SsInterpolatable start_, SsInterpolatable end_, int startTime, int endTime)
    {
        var start = (SsPoint)start_;
        var end   = (SsPoint)end_;

        X = SsInterpolation.Interpolate(curve, time, start.X, end.X, startTime, endTime);
        Y = SsInterpolation.Interpolate(curve, time, start.Y, end.Y, startTime, endTime);
        return(this);
    }
Пример #2
0
    public SsInterpolatable Interpolate(SsCurveParams curve, float time, SsInterpolatable start_, SsInterpolatable end_, int startTime, int endTime)
    {
        var start = (SsPaletteKeyValue)start_;
        var end   = (SsPaletteKeyValue)end_;

        Use   = SsInterpolation.Interpolate(curve, time, start.Use ? 1f : 0f, end.Use ? 1f : 0f, startTime, endTime) >= 0.5f ? true : false;
        Page  = SsInterpolation.Interpolate(curve, time, start.Page, end.Page, startTime, endTime);
        Block = (byte)SsInterpolation.Interpolate(curve, time, start.Block, end.Block, startTime, endTime);
        return(this);
    }
Пример #3
0
    public SsInterpolatable Interpolate(SsCurveParams curve, float time, SsInterpolatable start_, SsInterpolatable end_, int startTime, int endTime)
    {
        var start = (SsColorRef)start_;
        var end   = (SsColorRef)end_;

        R = (byte)SsInterpolation.Interpolate(curve, time, start.R, end.R, startTime, endTime);
        G = (byte)SsInterpolation.Interpolate(curve, time, start.G, end.G, startTime, endTime);
        B = (byte)SsInterpolation.Interpolate(curve, time, start.B, end.B, startTime, endTime);
        A = (byte)SsInterpolation.Interpolate(curve, time, start.A, end.A, startTime, endTime);
        return(this);
    }
Пример #4
0
    public SsInterpolatable Interpolate(SsCurveParams curve, float time, SsInterpolatable start_, SsInterpolatable end_, int startTime, int endTime)
    {
        var start = (SsRect)start_;
        var end   = (SsRect)end_;

        Left   = SsInterpolation.Interpolate(curve, time, start.Left, end.Left, startTime, endTime);
        Top    = SsInterpolation.Interpolate(curve, time, start.Top, end.Top, startTime, endTime);
        Right  = SsInterpolation.Interpolate(curve, time, start.Right, end.Right, startTime, endTime);
        Bottom = SsInterpolation.Interpolate(curve, time, start.Bottom, end.Bottom, startTime, endTime);
        return(this);
    }
Пример #5
0
    public SsInterpolatable Interpolate(SsCurveParams curve, float time, SsInterpolatable start_, SsInterpolatable end_, int startTime, int endTime)
    {
        var start = (SsVertexKeyValue)start_;
        var end   = (SsVertexKeyValue)end_;

        // use curve params as blend ratio between start key and end key.
        float rate = SsInterpolation.Interpolate(curve, time, 0.0f, 1.0f, startTime, endTime);

        // lerp value from start to end.
        SsCurveParams linearCurve = new SsCurveParams();

        linearCurve.Type = SsInterpolationType.Linear;

        for (int i = 0; i < Vertices.Length; ++i)
        {
            Vertices[i].Interpolate(linearCurve, rate, start.Vertices[i], end.Vertices[i], startTime, endTime);
        }
        return(this);
    }