/// <summary> /// Constructor. /// </summary> /// <param name="anchor">Anchor points of curve.</param> public LinearBezierCurve(LinearBezierAnchor anchor) { this.anchor = anchor; }
/// <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> public LinearBezierCurve() { anchor = new LinearBezierAnchor(); }