Struct MassProperties
The mass properties of an object.
Inherited Members
Namespace: Unity.Physics
Assembly: Unity.Physics.dll
Syntax
public struct MassProperties
Fields
AngularExpansionFactor
Upper bound on the rate of change of the object's extent in any direction, with respect to angular speed around its center of mass. Used to determine how much to expand a rigid body's AABB to enclose its swept volume.
Declaration
public float AngularExpansionFactor
Field Value
| Type | Description |
|---|---|
| float |
MassDistribution
The distribution of a unit mass throughout the object.
Declaration
public MassDistribution MassDistribution
Field Value
| Type | Description |
|---|---|
| MassDistribution |
UnitSphere
(Immutable) The mass properties of a unit sphere.
Declaration
public static readonly MassProperties UnitSphere
Field Value
| Type | Description |
|---|---|
| MassProperties |
Volume
The volume of the object.
Declaration
public float Volume
Field Value
| Type | Description |
|---|---|
| float |
Methods
CreateBox(in float3)
Creates mass properties of a box with the provided side lengths, centered on the origin.
Declaration
public static MassProperties CreateBox(in float3 size)
Parameters
| Type | Name | Description |
|---|---|---|
| float3 | size | Side lengths of the box along x, y and z. |
Returns
| Type | Description |
|---|---|
| MassProperties | Mass properties of the box. |
CreateSphere(in float)
Creates mass properties of a sphere with the provided radius, centered on the origin.
Declaration
public static MassProperties CreateSphere(in float radius)
Parameters
| Type | Name | Description |
|---|---|---|
| float | radius | Sphere radius. |
Returns
| Type | Description |
|---|---|
| MassProperties | Mass properties of the sphere. |
Scale(float)
Scales the mass properties by the given uniform scale factor assuming unit mass.
Declaration
public void Scale(float uniformScale)
Parameters
| Type | Name | Description |
|---|---|---|
| float | uniformScale | The uniform scale. |