Struct PhysicsMass
The mass properties of a rigid body. If not present, the rigid body has infinite mass and inertia.
Implements
Inherited Members
Namespace: Unity.Physics
Assembly: Unity.Physics.dll
Syntax
public struct PhysicsMass : IComponentData, IQueryTypeParameter
Fields
AngularExpansionFactor
See MassProperties.AngularExpansionFactor.
Declaration
public float AngularExpansionFactor
Field Value
Type | Description |
---|---|
float |
InverseInertia
Zero is allowed, for infinite inertia.
Declaration
public float3 InverseInertia
Field Value
Type | Description |
---|---|
float3 |
InverseMass
Zero is allowed, for infinite mass.
Declaration
public float InverseMass
Field Value
Type | Description |
---|---|
float |
Transform
Center of mass and orientation of principal axes.
Declaration
public RigidTransform Transform
Field Value
Type | Description |
---|---|
RigidTransform |
Properties
CenterOfMass
Gets or sets the center of mass.
Declaration
public float3 CenterOfMass { get; set; }
Property Value
Type | Description |
---|---|
float3 | The center of mass. |
HasInfiniteInertia
Gets a value indicating whether this object has infinite inertia.
Declaration
public bool HasInfiniteInertia { get; }
Property Value
Type | Description |
---|---|
bool | True if this object has infinite inertia, false if not. |
HasInfiniteMass
Gets a value indicating whether this object has infinite mass.
Declaration
public bool HasInfiniteMass { get; }
Property Value
Type | Description |
---|---|
bool | True if this object has infinite mass, false if not. |
InertiaOrientation
Gets or sets the inertia orientation.
Declaration
public quaternion InertiaOrientation { get; set; }
Property Value
Type | Description |
---|---|
quaternion | The inertia orientation. |
IsKinematic
Gets a value indicating whether this object is kinematic.
Declaration
public bool IsKinematic { get; }
Property Value
Type | Description |
---|---|
bool | True if this object is kinematic, false if not. |
Methods
CreateDynamic(MassProperties, float)
Creates a dynamic mass.
Declaration
public static PhysicsMass CreateDynamic(MassProperties massProperties, float mass)
Parameters
Type | Name | Description |
---|---|---|
MassProperties | massProperties | The mass properties. |
float | mass | The mass. |
Returns
Type | Description |
---|---|
PhysicsMass | The new dynamic mass. |
CreateKinematic(MassProperties)
Creates a kinematic mass.
Declaration
public static PhysicsMass CreateKinematic(MassProperties massProperties)
Parameters
Type | Name | Description |
---|---|---|
MassProperties | massProperties | The mass properties. |
Returns
Type | Description |
---|---|
PhysicsMass | The new kinematic mass. |