Documentation

Unity Engine

Download Unity

Unity Engine

ComputeLocalToParentLinearVelocities

Computes the linear velocity of each bone in LocalToParent space, from two consecutive streams of the same rig.
Read time 1 minuteLast updated 4 hours ago

Definition

ComputeLocalToParentLinearVelocities(AnimationStream, AnimationStream, float, NativeArray<float3>)

public static void ComputeLocalToParentLinearVelocities(ref AnimationStream input, ref AnimationStream previousInput, float deltaTime, NativeArray<float3> outVelocities)

Parameters

The stream for the current update.

previousInput

The stream for the previous update. It must use the same rig as
input
.

deltaTime

Time between the two streams, in seconds. It must be greater than zero.

outVelocities

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
LocalToParent
translation between the two streams, divided by the elapsed time. Element j of the output belongs to the bone with index j.