Table of Contents

Method SetDensity

Namespace
Box3D
Assembly
Box3D.NET.dll

SetDensity(float, bool)

Sets the density, optionally deferring the body mass update.

public void SetDensity(float density, bool updateBodyMass = true)

Parameters

density float

The new density, usually in kilograms per cubic metre.

updateBodyMass bool

Whether to recompute the body's mass now. Pass false when changing several shapes at once and call Box3D.Body.RecomputeMass afterwards.