Exemplo n.º 1
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="anchor">Anchor points of curve.</param>
 public QuadraticBezierCurve(QuadraticBezierAnchor anchor)
 {
     this.anchor = anchor;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Get curve point base on anchor points and t.
 /// </summary>
 /// <param name="anchor">Anchor points of curve.</param>
 /// <param name="t">t is in the range(0~1).</param>
 /// <returns>Point on curve.</returns>
 public static Vector3 GetPointAt(QuadraticBezierAnchor anchor, float t)
 {
     return(Mathf.Pow(1 - t, 2) * anchor.start + 2 * t * (1 - t) * anchor.tangent + Mathf.Pow(t, 2) * anchor.end);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public QuadraticBezierCurve()
 {
     anchor = new QuadraticBezierAnchor();
 }