Optionalx: number = 0origin point of the Polygon
Optionaly: number = 0origin point of the Polygon
array of vector defining the Polygon
The edges here are the direction of the nth edge of the polygon, relative to
the nth point. If you want to draw a given edge from the edge value, you must
first translate to the position of the starting point.
a list of indices for all vertices composing this polygon
Array of points defining the Polygon
Note: If you manually change points, you must call recalcafterwards so that the changes get applied correctly.
origin point of the Polygon
the shape type (used internally)
Returns true if the Line contains the given point
true if contains
returns the bounding box for this shape, the smallest Rectangle object completely containing this shape.
this shape bounding box Rectangle object
returns a list of indices for all triangles defined in this polygon
an array of vertex indices for all triangles forming this polygon.
Returns true if the vertices composing this polygon form a convex shape (vertices must be in clockwise order).
true if the vertices are convex, false if not, null if not computable
Computes the calculated collision edges and normals.
This must be called if the points array, angle, or offset is modified manually.
this instance for objecf chaining
Scales the polygon by the given factors along the x and y axes.
The factor by which to scale the polygon along the x-axis.
Optionaly: number = xThe factor by which to scale the polygon along the y-axis. Defaults to the value of x.
Reference to this object for method chaining
set new value to the Polygon
position of the Polygon
position of the Polygon
array of vector or vertice defining the Polygon
this instance for objecf chaining
set the vertices defining this Polygon
array of vector or vertice defining the Polygon
this instance for objecf chaining
apply an isometric projection to this shape
Reference to this object for method chaining
Translates the Polygon by the specified offset.
The x offset or a vector point to translate by.
Optionaly: numberThe y offset. This parameter is required if the first parameter is a number.
Reference to this object for method chaining
a line segment Object
Param: x
origin point of the Line
Param: y
origin point of the Line
Param: points
array of vectors defining the Line