InertialBlendingCoefficientsData(float, float, float)
Creates the coefficients of an inertial blend for one animation channel.
Read time 1 minuteLast updated 4 hours ago
Definition
- Type: Constructor
- Namespace: Unity.Animations
- Assembly: UnityEngine.AnimationCoreModule
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 per second.
x0The requested duration of the blend, in seconds.
Remarks
A fast initial velocity toward zero makes the blend finish sooner than , 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 is zero, the constructor sets all coefficients and the blend duration to zero.
durationdurationTo 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.