Collider:getAutomaticMass
EditReturns whether automatic mass is enabled for the Collider.
When enabled, the Collider's mass, inertia, and center of mass will be recomputed when:
- A shape is added to or removed from the Collider.
- A shape attached to the Collider changes shape (e.g.
SphereShape:setRadius
). - A shape attached to the Collider is moved using
Shape:setOffset
. - A shape attached to the Collider changes its density using
Shape:setDensity
.
Additionally, changing the center of mass of a Collider will automatically update its inertia when automatic mass is enabled.
Disable this to manage the mass properties manually. When automatic mass is disabled, Collider:resetMassData
can still be used to reset the mass from attached shapes if needed.
enabled = Collider:getAutomaticMass()
Arguments
None
Returns
Name | Type | Description |
enabled | boolean | Whether automatic mass is enabled. |