示例#1
0
 private static bool Equivalent( Point2 p0, Point2 p1 )
 {
     return p0.SqrDistanceTo( p1 ) <= 0.01f ;
 }
 /// <summary>
 /// Finds the index of a control point that is within the distance to point pt
 /// </summary>
 public int FindControlPoint( Point2 pt, float distance )
 {
     float sqrDist = distance * distance;
     for ( int cpIndex = 0; cpIndex < m_ControlPoints.Count; ++cpIndex )
     {
         if ( pt.SqrDistanceTo( m_ControlPoints[ cpIndex ] ) < sqrDist )
         {
             return cpIndex;
         }
     }
     return -1;
 }