ComputeLocalToWorldLinearVelocities
Computes the linear velocity of each bone in world space, from two consecutive streams of the same rig.
Read time 1 minuteLast updated 4 hours ago
Definition
- Type: Method
- Namespace: Unity.Animations
- Assembly: UnityEngine.AnimationCoreModule
ComputeLocalToWorldLinearVelocities(float4x4, float4x4, AnimationStream, AnimationStream, float, NativeArray<float3>)
public static void ComputeLocalToWorldLinearVelocities(float4x4 localToWorld, float4x4 previousLocalToWorld, ref AnimationStream input, ref AnimationStream previousInput, float deltaTime, NativeArray<float3> outVelocities)
Parameters
The matrix of the character at the time of .
LocalToWorldinputThe matrix of the character at the time of .
LocalToWorldpreviousInputThe stream for the current update.
The stream for the previous update. It must use the same rig as .
inputThe time between the two streams, in seconds. It must not be zero.
Receives the velocity of each bone, in units per second. The length must be equal to the bone count of the rig.
Remarks
The velocity of a bone is the change of its world position between the two streams, divided by the elapsed time. The world position of a bone is its translation transformed by the matrix.
LocalToCharacterLocalToWorld