/// <summary> /// Transform anchor. /// </summary> /// <param name="anchor"></param> /// <returns></returns> protected HermiteAnchor TransformAnchor(HermiteAnchor anchor) { anchor.point = transform.TransformPoint(anchor.point); anchor.inTangent = transform.TransformVector(anchor.inTangent); anchor.outTangent = transform.TransformVector(anchor.outTangent); return(anchor); }
/// <summary> /// Remove the anchor item. /// </summary> /// <param name="anchor">Anchor item.</param> public void RemoveAnchor(HermiteAnchor anchor) { anchors.Remove(anchor); }
/// <summary> /// Insert Anchor item at index. /// </summary> /// <param name="index">Index of anchor.</param> /// <param name="anchor">Anchor item.</param> public void InsertAnchor(int index, HermiteAnchor anchor) { anchors.Insert(index, InverseTransformAnchor(anchor)); }
/// <summary> /// Set the anchor item at index. /// </summary> /// <param name="index">Index of anchor.</param> /// <param name="anchor">Anchor item.</param> public void SetAnchor(int index, HermiteAnchor anchor) { anchors[index] = InverseTransformAnchor(anchor); }
/// <summary> /// Add anchor item. /// </summary> /// <param name="anchor">Anchor item.</param> public void AddAnchor(HermiteAnchor anchor) { anchors.Add(InverseTransformAnchor(anchor)); }