Ejemplo n.º 1
0
        public static int AreIntersecting(Vector2 p0, Vector2 p1, Vector2 p2, Vector2 p3, float errorMargin = 0.001f)
        {
            Vector2 vector  = p1 - p0;
            Vector2 vector2 = p3 - p2;

            p0 += vector.normalized * errorMargin;
            p1 -= vector.normalized * errorMargin;
            p2 += vector2.normalized * errorMargin;
            p3 -= vector2.normalized * errorMargin;
            return(LineHelper.CheckSegmentIntersection(p0.x, p0.y, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y));
        }
Ejemplo n.º 2
0
 public static int AreIntersecting(out Vector3 interSectPoint, Vector2 p0, Vector2 p1, Vector2 p2, Vector2 p3)
 {
     return(LineHelper.CheckSegmentIntersection(out interSectPoint, p0.x, p0.y, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y));
 }