GetFirstDerivative() публичный статический Метод

public static GetFirstDerivative ( Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, float t ) : Vector3
p0 Vector3
p1 Vector3
p2 Vector3
p3 Vector3
t float
Результат Vector3
Пример #1
0
    public Vector3 GetVelocity(float t)
    {
        int i;

        if (t >= 1f)
        {
            t = 1f;

            i = points.Length - 4;
        }
        else
        {
            t = Mathf.Clamp01(t) * CurveCount;

            i  = (int)t;
            t -= i;             // [0, 1]

            i *= 3;
        }

        return(transform.TransformPoint(
                   CatmullRom.GetFirstDerivative(points[i], points[i + 1], points[i + 2], points[i + 3], t)
                   ));
    }