Пример #1
0
 /// <summary>
 /// get the velocity vector on the line at value t in world space
 /// </summary>
 /// <param name="t"></param>
 /// <returns></returns>
 public Vector3 GetVelocity(float t)
 {
     return(transform.TransformPoint(Bezier.GetFirstDerivative(points[0], points[1], points[2], points[3], t)) -
            transform.position); //we don't a location, subtract position
 }
Пример #2
0
 /// <summary>
 /// get a point on the curve at value t in worldspace
 /// </summary>
 /// <param name="t"></param>
 /// <returns></returns>
 public Vector3 GetPoint(float t)
 {
     return(transform.TransformPoint(Bezier.GetPoint(points[0], points[1], points[2], points[3], t)));
 }