Creates a new rigid body model. The options parameter is an object that specifies any properties you wish to override the defaults.
All properties have default values, and many are pre-calculated automatically based on other properties.
See the properties section below for detailed information on what you can pass via the options object.
body
Returns the next unique group index for which bodies will collide.
If isNonColliding is true, returns the next unique group index for which bodies will not collide.
See body.collisionFilter for more information.
OptionalisNonColliding: booleanUnique group index
Given a property and a value (or map of), sets the property(s) on the body, using the appropriate setter functions if they exist. Prefer to use the actual setter functions in performance critical situations.
Set the centre of mass of the body.
The centre is a vector in world-space unless relative is set, in which case it is a translation.
The centre of mass is the point the body rotates about and can be used to simulate non-uniform density.
This is equal to moving body.position but not the body.vertices.
Invalid if the centre falls outside the body's convex hull.
Sets the parts of the body and updates mass, inertia and centroid.
Each part will have its parent set to body.
By default the convex hull will be automatically computed and set on body, unless autoHull is set to false.
Note that this method will ensure that the first part in body.parts will always be the body.
Sets the body's vertices and updates body properties accordingly, including inertia, area and mass (with respect to body.density).
Vertices will be automatically transformed to be orientated around their centre of mass as the origin.
They are then automatically translated to world space based on body.position.
The vertices argument should be passed as an array of Matter.Vector points (or a Matter.Vertices array).
Vertices must form a convex hull, concave hulls are not supported.
Applies a force to a body from a given world-space position, including resulting torque.