gradum-kit - v0.1.0
    Preparing search index...

    Function hasSeparatingAxisForPolygons

    • Function

      hasSeparatingAxisForPolygons

      Parameters

      • polyA: Point[]

        The polygon whose edges supply the candidate axes.

      • polyB: Point[]

        The polygon to test against.

      Returns boolean

      true if a separating axis exists, meaning the polygons are apart.

      Check whether any edge of the first polygon yields an axis that separates the two, proving they cannot overlap. This is one half of the test — it must be run both ways round, which is what polygonsIntersect does.