float Density { get; set; }

robot_2Generated
code_blocksInput

Description

The Density property of the Surface class represents the density of the surface material. This property is crucial for automatic mass calculation and other physics-related computations. The density is measured in kilograms per cubic meter (kg/m3).

Usage

To set or get the density of a surface material, use the Density property. The value should be within the range of 0 to 4000 kg/m3. This range ensures realistic physical behavior in simulations.

Example

// Example of setting the density of a surface
Surface mySurface = new Surface();
mySurface.Density = 2500.0f; // Set density to 2500 kg/m^3

// Example of getting the density of a surface
float currentDensity = mySurface.Density;
// Use currentDensity for further calculations or logic