ComputeLocalToParentAngularVelocities
Computes the angular velocity of each bone in LocalToParent 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
ComputeLocalToParentAngularVelocities(AnimationStream, AnimationStream, float, NativeArray<float3>)
public static void ComputeLocalToParentAngularVelocities(ref AnimationStream input, ref AnimationStream previousInput, float deltaTime, NativeArray<float3> outAngularVelocities)
Parameters
The stream for the current update.
The stream for the previous update. It must use the same rig as .
inputTime between the two streams, in seconds. It must be greater than zero.
Receives the angular velocity of each bone, in radians per second. The length must be equal to the bone count of the rig.
Remarks
For each bone, the function computes the rotation that goes from the previous rotation to the current one, and divides its angle by the elapsed time. The result points along the rotation axis, and its length is the speed in radians per second. The function uses the shortest rotation, so a bone that turns more than half a turn in one update gets a velocity in the opposite direction. A bone whose rotation didn't change has a velocity of zero.
LocalToParent