/// <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(LinearBezierAnchor anchor, float t) { return((1 - t) * anchor.start + t * anchor.end); }
/// <summary> /// Get curve point base on anchor points and key. /// </summary> /// <param name="anchor">Anchor points of curve.</param> /// <param name="key">Key is in the range(0~1).</param> /// <returns>Point on curve.</returns> public static Vector3 GetPointAt(LinearBezierAnchor anchor, float key) { return((1 - key) * anchor.start + key * anchor.end); }
/// <summary> /// Constructor. /// </summary> /// <param name="anchor">Anchor points of curve.</param> public LinearBezierCurve(LinearBezierAnchor anchor) { this.anchor = anchor; }
/// <summary> /// Constructor. /// </summary> public LinearBezierCurve() { anchor = new LinearBezierAnchor(); }