Allows accessing the mass, density, and center of mass of a Matter-enabled Game Object. Should be used as a mixin and not directly.
Readonly
The body's center of mass.
Calling this creates a new Vector2 each time to avoid mutation.
Vector2
If you only need to read the value and won't change it, you can get it from GameObject.body.centerOfMass.
GameObject.body.centerOfMass
Sets the density of the body.
The new density of the body.
This Game Object instance.
Sets the mass of the Game Object's Matter Body.
The new mass of the body.
Allows accessing the mass, density, and center of mass of a Matter-enabled Game Object. Should be used as a mixin and not directly.