StaticcircleCreates 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.Body module for detailed information on what you can pass via the options object.
Optionaloptions: MatterJS.IBodyDefinitionOptionalmaxSides: numberA new circle body
StaticflagStaticfromCreates 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: numberStaticpolygonCreates 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
StaticrectangleCreates 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
StatictrapezoidCreates 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
The
Matter.Bodiesmodule contains factory methods for creating rigid body models with commonly used body configurations (such as rectangles, circles and other polygons).See the included usage examples.