Struct PhysicsVelocity
The velocity of a rigid body. If absent, the rigid body is static.
Inherited Members
Namespace: Unity.Physics
Assembly: Unity.Physics.dll
Syntax
public struct PhysicsVelocity : IComponentData, IQueryTypeParameter
Fields
Angular
The body's angular velocity in radians per second about each principal axis specified by Transform
. In order to get or set world-space values, use Get
Declaration
public float3 Angular
Field Value
Type | Description |
---|---|
float3 |
Linear
The body's world-space linear velocity in units per second.
Declaration
public float3 Linear
Field Value
Type | Description |
---|---|
float3 |
Zero
Zero Physics Velocity. All fields are initialized to zero.
Declaration
public static readonly PhysicsVelocity Zero
Field Value
Type | Description |
---|---|
Physics |
Methods
CalculateVelocityToTarget(in PhysicsMass, in float3, in quaternion, in RigidTransform, in float)
Create a Physics
Declaration
public static PhysicsVelocity CalculateVelocityToTarget(in PhysicsMass bodyMass, in float3 bodyPosition, in quaternion bodyOrientation, in RigidTransform targetTransform, in float stepFrequency)
Parameters
Type | Name | Description |
---|---|---|
Physics |
bodyMass | The body's Physics |
float3 | bodyPosition | The body's world-space position. |
quaternion | bodyOrientation | The body's world-space rotation. |
Rigid |
targetTransform | The desired translation and rotation values the body should move to in world space. |
float | stepFrequency | The step frequency in the simulation where the body's motion is solved (i.e., 1 / FixedDeltaTime). |
Returns
Type | Description |
---|---|
Physics |
The calculated velocity to target. |