コード例 #1
0
 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);
         }
     }
 }
コード例 #2
0
 public void SetIndexAndTangent(int index, BezierTangentDirection dir)
 {
     this.index     = index;
     this.isTangent = true;
     this.tangent   = dir;
 }
コード例 #3
0
 public BezierHandle(int index, bool isTangent, BezierTangentDirection tangent = BezierTangentDirection.In)
 {
     this.index     = index;
     this.isTangent = isTangent;
     this.tangent   = tangent;
 }