示例#1
0
 /// <summary> Returns true if polys intersect eachother</summary>
 public bool Intersect(Polygon2D poly)
 {
     //Possible optimization: bounds check?
     //Start by performing a quick bounds test
     //if (!bounds.Intersects(poly.bounds)) return false;
     //Test against all edges
     if (Contains(poly.edges[0].Center))
     {
         return(true);
     }
     if (poly.Contains(edges[0].Center))
     {
         return(true);
     }
     return(IntersectEdge(poly.edges));
 }