The original composite with the objects added
Returns all bodies in the given composite, including all bodies in its children, recursively.
All the bodies
Returns all composites in the given composite, including all composites in its children, recursively.
All the composites
Returns all constraints in the given composite, including all constraints in its children, recursively.
All the constraints
Removes all bodies, constraints and composites from the given composite. Optionally clearing its children recursively.
Optionaldeep: booleanCreates a new composite. The options parameter is an object that specifies any properties you wish to override the defaults.
See the properites section below for detailed information on what you can pass via the options object.
Optionaloptions: MatterJS.ICompositeDefinitionA new composite
Searches the composite recursively for an object matching the type and id supplied, null if not found.
The requested object, if found
Moves the given object(s) from compositeA to compositeB (equal to a remove followed by an add).
Returns compositeA
Assigns new ids for all objects in the composite, recursively.
Returns composite
Generic remove function. Removes one or many body(s), constraint(s) or a composite(s) to the given composite.
Optionally searching its children recursively.
Triggers beforeRemove and afterRemove events on the composite.
Optionaldeep: booleanThe original composite with the objects removed
Rotates all children in the composite by a given angle about the given point, without imparting any angular velocity.
Optionalrecursive: booleanScales all children in the composite, including updating physical properties (mass, area, axes, inertia), from a world-space point.
Optionalrecursive: booleanSets the composite's isModified flag.
If updateParents is true, all parents will be set (default: false).
If updateChildren is true, all children will be set (default: false).
OptionalupdateParents: booleanOptionalupdateChildren: booleanTranslates all children in the composite by a given vector relative to their current positions, without imparting any velocity.
Optionalrecursive: boolean
Generic add function. Adds one or many body(s), constraint(s) or a composite(s) to the given composite. Triggers
beforeAddandafterAddevents on thecomposite.