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;
            i *= 3;
        }
        return(transform.TransformPoint(CatlikeBezier.GetFirstDerivative(points[i], points[i + 1], points[i + 2], points[i + 3], t)) - transform.position);
    }
Exemplo n.º 2
0
 public Vector3 GetVelocity(float t)
 {
     return(transform.TransformPoint(CatlikeBezier.GetFirstDerivative(points[0], points[1], points[2], points[3], t)) - transform.position);
 }