nlerp


Description:

public void nlerp (Quaternion a, Quaternion b, float t)

Performs a normalized linear interpolation between two quaternions.

That is it does a linear interpolation of the quaternion components and then normalizes the result. This will follow the shortest arc between the two orientations (just like the slerp function) but will not progress at a constant speed. Unlike slerp nlerp is commutative which is useful if you are blending animations together. (I.e. nlerp (tmp, a, b) followed by nlerp (result, tmp, d) is the same as nlerp (tmp, a, d) followed by nlerp (result, tmp, b)). Finally nlerp is cheaper than slerp so it can be a good choice if you don't need the constant speed property of the slerp function.

Notable properties: <itemizedlist> <listitem> commutative: Yes </listitem> <listitem> constant velocity: No < /listitem> <listitem> torque minimal (travels along the surface of the 4-sphere): Yes </listitem> <listitem> faster than slerp </listitem> </itemizedlist>

Parameters:

this

The destination Quaternion

a

The first Quaternion

b

The second Quaternion

t

The factor in the range [0,1] used to interpolate between quaterion a and b.