Documentation

Unity Engine

Download Unity

Unity Engine

InertialBlendingCoefficientsData(float, float, float)

Creates the coefficients of an inertial blend for one animation channel.
Read time 1 minuteLast updated 4 hours ago

Definition

public InertialBlendingCoefficientsData(float x0, float v0, float duration)

Parameters

The size of the initial offset between the last output value and the current input value of the channel. For a float channel, the value is signed. For a translation or scale channel, the value is the length of the offset vector. For a rotation channel, the value is the angle of the offset rotation, in radians.

The initial velocity of the offset, in the unit of
x0
per second.

duration

The requested duration of the blend, in seconds.

Remarks

A fast initial velocity toward zero makes the blend finish sooner than
duration
, so the offset doesn't overshoot zero. The constructor treats an initial velocity that moves the offset away from zero as zero. If the coefficients aren't finite, for example when
duration
is zero, the constructor sets all coefficients and the blend duration to zero.
To blend a single value, create the coefficients with this constructor. Then pass the result of Core.InertialBlendingCoefficientsData.ComputeTimePowers and the elapsed time to Core.InertialBlendingCoefficientsData.Interpolate, and add the returned offset to the input value. To blend the channels of a rig, call Core.ComputeInertialBlendingCoefficients, which creates the coefficients of every channel.