An abstract over an Array of Polygon
instances that define multiple polygonal shapes that can be collision-tested against.
See also:
Static variables
Static methods
staticcontains(this:Array<Polygon>, p:Point, isConvex:Bool = false):Bool
Tests if Point p
is inside any of the Polygon instances in Polygons.
Parameters:
p | The point to test against. |
---|---|
isConvex | Use simplified collision test suited for convex polygons. Results are undefined if polygon is concave. |
staticgetBounds(this:Array<Polygon>, ?b:Bounds):Null<Bounds>
Returns bounding box of all Polygon instances in Polygons.
Parameters:
b | Optional Bounds instance to be filled. Returns new Bounds instance if |
---|
staticgetCollider(this:Array<Polygon>, isConvex:Bool = false):PolygonCollider
Returns new PolygonCollider
instance containing this Polygons.
Parameters:
isConvex | Use simplified collision test suited for convex polygons. Results are undefined if polygon is concave. |
---|
staticoptimize(this:Array<Polygon>, epsilon:Float):Polygons
Optimizes all polygons and returns new Polygons instances. See [h2d.col.Polygon.optimize].
statictoIPolygons(this:Array<Polygon>, scale:Float = 1.):IPolygons
Converts Polygons instance to Int-based IPolygons.