Optionaloptions: MatterJS.IBodyDefinitionOptionalmaxSides: numberA new circle body
Creates a body using the supplied vertices (or an array containing multiple sets of vertices).
If the vertices are convex, they will pass through as supplied.
Otherwise if the vertices are concave, they will be decomposed if poly-decomp.js is available.
Note that this process is not guaranteed to support complex sets of vertices (e.g. those with holes may fail).
By default the decomposition will discard collinear edges (to improve performance).
It can also optionally discard any parts that have an area less than minimumArea.
If the vertices can not be decomposed, the result will fall back to using the convex hull.
The options parameter is an object that specifies any Matter.Body properties you wish to override the defaults.
See the properties section of the Matter.Body module for detailed information on what you can pass via the options object.
Optionaloptions: MatterJS.IBodyDefinitionOptionalflagInternal: booleanOptionalremoveCollinear: numberOptionalminimumArea: numberCreates a new rigid body model with a regular polygon hull with the given number of sides.
The options parameter is an object that specifies any properties you wish to override the defaults.
See the properties section of the Matter.Body module for detailed information on what you can pass via the options object.
Optionaloptions: MatterJS.IChamferableBodyDefinitionA new regular polygon body
Creates a new rigid body model with a rectangle hull.
The options parameter is an object that specifies any properties you wish to override the defaults.
See the properties section of the Matter.Body module for detailed information on what you can pass via the options object.
Optionaloptions: MatterJS.IChamferableBodyDefinitionA new rectangle body
Creates a new rigid body model with a trapezoid hull.
The slope is parameterised as a fraction of width and must be < 1 to form a valid trapezoid.
The options parameter is an object that specifies any properties you wish to override the defaults.
See the properties section of the Matter.Body module for detailed information on what you can pass via the options object.
Optionaloptions: MatterJS.IChamferableBodyDefinitionA new trapezoid body
Creates a new rigid body model with a circle hull. The options parameter is an object that specifies any properties you wish to override the defaults. See the properties section of the
Matter.Bodymodule for detailed information on what you can pass via theoptionsobject.