Exemple #1
0
    // ----------------------------------------------------------------------------
    // Easing equation Vector2.
    //
    // param t  Current time (in frames or seconds).
    // param b  Starting value.
    // param c  Target value.
    // param d  Expected easing duration (in frames or seconds).
    // return   The correct value.
    // ----------------------------------------------------------------------------
    public static Vector2 Ease(float t, ref Vector2 b, ref Vector2 c, float d, Easing.Method method)
    {
        EaseingDelgate func = delgates[(int)method];

        float x = func(t, b.x, c.x, d);
        float y = func(t, b.y, c.y, d);

        return(new Vector2(x, y));
    }
Exemple #2
0
    // ----------------------------------------------------------------------------
    // Easing equation Vector3.
    //
    // param t  Current time (in frames or seconds).
    // param b  Starting value.
    // param c  Target value.
    // param d  Expected easing duration (in frames or seconds).
    // return   The correct value.
    // ----------------------------------------------------------------------------
    public static Vector3 Ease(float t, ref Vector3 b, ref Vector3 c, float d, Easing.Method method)
    {
        EaseingDelgate func = delgates[(int)method];

        float x = func(t, b.x, c.x, d);
        float y = func(t, b.y, c.y, d);
        float z = func(t, b.z, c.z, d);

        return(new Vector3(x, y, z));
    }
Exemple #3
0
    // ----------------------------------------------------------------------------
    // Easing equation Color.
    //
    // param t  Current time (in frames or seconds).
    // param b  Starting value.
    // param c  Target value.
    // param d  Expected easing duration (in frames or seconds).
    // return   The correct value.
    // ----------------------------------------------------------------------------
    public static Color Ease(float t, ref Color b, ref Color c, float d, Easing.Method method)
    {
        EaseingDelgate func = delgates[(int)method];

        float cr = func(t, b.r, c.r, d);
        float cg = func(t, b.g, c.g, d);
        float cb = func(t, b.b, c.b, d);
        float ca = func(t, b.a, c.a, d);

        return(new Color(cr, cg, cb, ca));
    }
Exemple #4
0
    // ----------------------------------------------------------------------------
    // Easing equation Vector4.
    //
    // param t  Current time (in frames or seconds).
    // param b  Starting value.
    // param c  Target value.
    // param d  Expected easing duration (in frames or seconds).
    // return   The correct value.
    // ----------------------------------------------------------------------------
    public static Vector4 Ease(float t, Vector4 b, Vector4 c, float d, Easing.Method method)
    {
        EaseingDelgate func = delgates[(int)method];

        float x = func(t, b.x, c.x, d);
        float y = func(t, b.y, c.y, d);
        float z = func(t, b.z, c.z, d);
        float w = func(t, b.w, c.w, d);

        return(new Vector4(x, y, z, w));
    }
Exemple #5
0
    // ----------------------------------------------------------------------------
    // Easing equation float.
    //
    // param t  Current time (in frames or seconds).
    // param b  Starting value.
    // param c  Target value.
    // param d  Expected easing duration (in frames or seconds).
    // return   The correct value.
    // ----------------------------------------------------------------------------
    public static float Ease(float t, float b, float c, float d, Easing.Method method)
    {
        EaseingDelgate func = delgates[(int)method];

        return(func(t, b, c, d));
    }
Exemple #6
0
    // ----------------------------------------------------------------------------
    // Easing equation float.
    //
    // param t  Current tval to ease
    // return   The correct value.
    // ----------------------------------------------------------------------------
    public static float Ease01(float t, Easing.Method method)
    {
        EaseingDelgate func = delgates[(int)method];

        return(func(t, 0, 1, 1));
    }