Polygon

fun Polygon(vertList: Array<Vec2>)

Constructor takes a supplied list of vertices and generates a convex hull around them.

Parameters

vertList

Vertices of polygon to create.


fun Polygon(width: Double, height: Double)

Constructor to generate a rectangle.

Parameters

width

Desired width of rectangle

height

Desired height of rectangle


fun Polygon(radius: Int, noOfSides: Int)

Generate a regular polygon with a specified number of sides and size.

Parameters

radius

The maximum distance any vertex is away from the center of mass.

noOfSides

The desired number of face the polygon has.