Takes an array and returns a new array made from all of the Matter Bodies found in the original array.
For example, passing in Matter Game Objects, such as a bunch of Matter Sprites, to this method, would return an array containing all of their native Matter Body objects.
If the bodies
argument is falsey, it will return all bodies in the world.
name | type | arguments | description |
---|---|---|---|
bodies | array | <optional> |
An array of objects to extract the bodies from. If falsey, it will return all bodies in the world. |
An array of native Matter Body objects.