void RebuildMass()

book_4_sparkGenerated
code_blocksInput

Description

The RebuildMass method is designed to be used exclusively on dynamic physics bodies. It recalculates the mass of the body by considering all its shapes, taking into account their volume and the physics properties defined by the Surface property. This is particularly useful in scenarios where the shapes or their properties have been modified, necessitating an update to the body's mass.

Usage

To use the RebuildMass method, ensure that the physics body is dynamic. This method should be called whenever there is a change in the shapes or their properties that could affect the mass of the body. It does not take any parameters and does not return a value.

Example

// Assuming 'physicsBody' is an instance of a dynamic PhysicsBody
physicsBody.RebuildMass();