phaser - v4.0.0-rc.4
    Preparing search index...

    The Matter.Composite module contains methods for creating and manipulating composite bodies. A composite body is a collection of Matter.Body, Matter.Constraint and other Matter.Composite, therefore composites form a tree structure. It is important to use the functions in this module to modify composites, rather than directly modifying their properties. Note that the Matter.World object is also a type of Matter.Composite and as such all composite methods here can also operate on a Matter.World.

    See the included usage examples.

    Composite

    Index

    Constructors

    Methods

    • Removes all bodies, constraints and composites from the given composite. Optionally clearing its children recursively.

      Parameters

      Returns void

      clear

    • Scales all children in the composite, including updating physical properties (mass, area, axes, inertia), from a world-space point.

      Parameters

      Returns void

      scale

    • Sets 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).

      Parameters

      • composite: MatterJS.CompositeType
      • isModified: boolean
      • OptionalupdateParents: boolean
      • OptionalupdateChildren: boolean

      Returns void

      setModified