Function overlapConvexPolygons

  • Parameters

    • poly1: [number, number][]

      a polygon as an array of points

    • poly2: [number, number][]

      a polygon as an array of points

    • Optional epsilon: number = EPSILON

      an optional epsilon

    Returns boolean

    Description

    Find out if two convex polygons are overlapping by searching for a dividing axis, which should be one side from one of the polygons. This method is hard-coded to be exclusive, if two otherwise non-overlapping polygons share an overlapping edge, the method will still count the two polygons as not overlapping.