public void EnforceTangentMode(BezierTangentDirection master, BezierTangentMode mode) { if (mode == BezierTangentMode.Aligned) { if (master == BezierTangentDirection.In) { tangentOut = position + (tangentOut - position).normalized * (tangentIn - position).magnitude; } else { tangentIn = position + (tangentIn - position).normalized * (tangentOut - position).magnitude; } } else if (mode == BezierTangentMode.Mirrored) { if (master == BezierTangentDirection.In) { tangentOut = position - (tangentIn - position); } else { tangentIn = position - (tangentOut - position); } } }
public void SetIndexAndTangent(int index, BezierTangentDirection dir) { this.index = index; this.isTangent = true; this.tangent = dir; }
public BezierHandle(int index, bool isTangent, BezierTangentDirection tangent = BezierTangentDirection.In) { this.index = index; this.isTangent = isTangent; this.tangent = tangent; }