Struct RigidBodyAspect
A rigid body aspect. Contatins transform data, mass, mass overide, velocity, damping and gravity factor information.
Inherited Members
Namespace: Unity.Physics.Aspects
Syntax
public readonly struct RigidBodyAspect : IAspect, IQueryTypeParameter
Fields
Entity
The entity of this aspect.
Declaration
public readonly Entity Entity
Field Value
Type | Description |
---|---|
Entity |
Properties
AngularDamping
Gets or sets the angular damping.
Declaration
public readonly float AngularDamping { get; set; }
Property Value
Type | Description |
---|---|
Single | The angular damping. |
AngularVelocityLocalSpace
Gets or sets the angular velocity in local space.
Declaration
public readonly float3 AngularVelocityLocalSpace { get; set; }
Property Value
Type | Description |
---|---|
float3 | The angular velocity in local space. |
AngularVelocityWorldSpace
Gets or sets the angular velocity in world space.
Declaration
public readonly float3 AngularVelocityWorldSpace { get; set; }
Property Value
Type | Description |
---|---|
float3 | The angular velocity in world space. |
CenterOfMassLocalSpace
Gets or sets the center of mass in local space.
Declaration
public readonly float3 CenterOfMassLocalSpace { get; set; }
Property Value
Type | Description |
---|---|
float3 | The center of mass in local space. |
CenterOfMassWorldSpace
Gets or sets the center of mass in world space.
Declaration
public readonly float3 CenterOfMassWorldSpace { get; set; }
Property Value
Type | Description |
---|---|
float3 | The center of mass in world space. |
GravityFactor
Gets or sets the gravity factor.
Declaration
public readonly float GravityFactor { get; set; }
Property Value
Type | Description |
---|---|
Single | The gravity factor. |
Inertia
Gets or sets the inertia.
Declaration
public readonly float3 Inertia { get; set; }
Property Value
Type | Description |
---|---|
float3 | The inertia. |
IsKinematic
Gets or sets a value indicating whether this object is kinematic.
Declaration
public readonly bool IsKinematic { get; set; }
Property Value
Type | Description |
---|---|
Boolean | True if this object is kinematic, false if not. |
LinearDamping
Gets or sets the linear damping.
Declaration
public readonly float LinearDamping { get; set; }
Property Value
Type | Description |
---|---|
Single | The linear damping. |
LinearVelocity
Gets or sets the linear velocity.
Declaration
public readonly float3 LinearVelocity { get; set; }
Property Value
Type | Description |
---|---|
float3 | The linear velocity. |
Mass
Gets or sets the mass.
Declaration
public readonly float Mass { get; set; }
Property Value
Type | Description |
---|---|
Single | The mass. |
Position
Gets or sets the world space position.
Declaration
public readonly float3 Position { get; set; }
Property Value
Type | Description |
---|---|
float3 | The world space position. |
Rotation
Gets or sets the world space rotation.
Declaration
public readonly quaternion Rotation { get; set; }
Property Value
Type | Description |
---|---|
quaternion | The world space rotation. |
Scale
Gets or sets the uniform scale.
Declaration
public readonly float Scale { get; set; }
Property Value
Type | Description |
---|---|
Single | The scale. |
WorldFromBody
Gets or sets the world transform of this aspect.
Declaration
public readonly LocalTransform WorldFromBody { get; set; }
Property Value
Type | Description |
---|---|
LocalTransform | The world space transform. |
Methods
ApplyAngularImpulseLocalSpace(float3)
Applies the angular impulse in local space.
Declaration
public readonly void ApplyAngularImpulseLocalSpace(float3 impulse)
Parameters
Type | Name | Description |
---|---|---|
float3 | impulse | The impulse to apply. |
ApplyAngularImpulseWorldSpace(float3)
Applies the angular impulse in world space.
Declaration
public readonly void ApplyAngularImpulseWorldSpace(float3 impulse)
Parameters
Type | Name | Description |
---|---|---|
float3 | impulse | The impulse to apply. |
ApplyExplosiveImpulse(Single, float3, Single, float3, Single)
Applies the explosive impulse.
Declaration
public readonly void ApplyExplosiveImpulse(float impulse, float3 explosionPositionWorldSpace, float explosionRadius, float3 up, float upwardsModifier = 0F)
Parameters
Type | Name | Description |
---|---|---|
Single | impulse | The impulse. |
float3 | explosionPositionWorldSpace | The explosion position world space. |
Single | explosionRadius | The explosion radius. |
float3 | up | The up vector. |
Single | upwardsModifier | (Optional) The upwards modifier. |
ApplyExplosiveImpulse(Single, float3, Single, float3, CollisionFilter, Single)
Applies the explosive impulse.
Declaration
public readonly void ApplyExplosiveImpulse(float impulse, float3 explosionPositionWorldSpace, float explosionRadius, float3 up, CollisionFilter filter, float upwardsModifier = 0F)
Parameters
Type | Name | Description |
---|---|---|
Single | impulse | The impulse. |
float3 | explosionPositionWorldSpace | The explosion position world space. |
Single | explosionRadius | The explosion radius. |
float3 | up | The up vector. |
CollisionFilter | filter |
applied to the impulse. |
Single | upwardsModifier | (Optional) The upwards modifier. |
ApplyImpulseAtPointLocalSpace(float3, float3)
Applies the impulse at point in local space.
Declaration
public readonly void ApplyImpulseAtPointLocalSpace(float3 impulse, float3 pointLocalSpace)
Parameters
Type | Name | Description |
---|---|---|
float3 | impulse | The impulse. |
float3 | pointLocalSpace | The point in local space. |
ApplyImpulseAtPointWorldSpace(float3, float3)
Applies the impulse at point in world space.
Declaration
public readonly void ApplyImpulseAtPointWorldSpace(float3 impulse, float3 pointWorldSpace)
Parameters
Type | Name | Description |
---|---|---|
float3 | impulse | The impulse. |
float3 | pointWorldSpace | The point in world space. |
ApplyLinearImpulseLocalSpace(float3)
Applies the linear impulse in local space.
Declaration
public readonly void ApplyLinearImpulseLocalSpace(float3 impulse)
Parameters
Type | Name | Description |
---|---|---|
float3 | impulse | The impulse to apply. |
ApplyLinearImpulseWorldSpace(float3)
Applies the linear impulse in world space.
Declaration
public readonly void ApplyLinearImpulseWorldSpace(float3 impulse)
Parameters
Type | Name | Description |
---|---|---|
float3 | impulse | The impulse to apply. |
GetEffectiveMassLocalSpace(float3, float3)
Gets effective mass in local space.
Declaration
public readonly float GetEffectiveMassLocalSpace(float3 impulse, float3 pointLocalSpace)
Parameters
Type | Name | Description |
---|---|---|
float3 | impulse | The impulse. |
float3 | pointLocalSpace | The point in local space. |
Returns
Type | Description |
---|---|
Single | The effective mass local space. |
GetEffectiveMassWorldSpace(float3, float3)
Gets effective mass in world space.
Declaration
public readonly float GetEffectiveMassWorldSpace(float3 impulse, float3 pointWorldSpace)
Parameters
Type | Name | Description |
---|---|---|
float3 | impulse | The impulse. |
float3 | pointWorldSpace | The point in world space. |
Returns
Type | Description |
---|---|
Single | The effective mass in world space. |
GetLinearVelocityAtPointLocalSpace(float3)
Gets linear velocity at point in local space.
Declaration
public readonly float3 GetLinearVelocityAtPointLocalSpace(float3 pointLocalSpace)
Parameters
Type | Name | Description |
---|---|---|
float3 | pointLocalSpace | The point in local space. |
Returns
Type | Description |
---|---|
float3 | The linear velocity at point in local space. |
GetLinearVelocityAtPointWorldSpace(float3)
Gets linear velocity at point in world space.
Declaration
public readonly float3 GetLinearVelocityAtPointWorldSpace(float3 pointWorldSpace)
Parameters
Type | Name | Description |
---|---|---|
float3 | pointWorldSpace | The point in world space. |
Returns
Type | Description |
---|---|
float3 | The linear velocity at point in world space. |