math docs
    Preparing search index...

    Function containsPoint

    • Tests whether a point lies inside the polygon. Works for both convex and concave polygons. Points exactly on an edge or vertex are considered inside.

      Parameters

      • vertices: number[]

        polygon vertices as a flat array [x0, y0, x1, y1, ...]

      • n: number

        number of vertices to read from vertices

      • point: vec2.Vec2

        the point to test

      Returns boolean

      true if the point is inside (or on the boundary of) the polygon