XMQuaternionSlerpV

Interpolates between two unit quaternions, using spherical linear interpolation.

Syntax

XMVECTOR XMQuaternionSlerpV(
         XMVECTOR Q0,
         XMVECTOR Q1,
         XMVECTOR T
)  

Parameters

Q0
Type: XMVECTOR 

Unit quaternion to interpolate from.

Q1
Type: XMVECTOR 

Unit quaternion to interpolate to.

T
Type: XMVECTOR 

Interpolation control factor. All components of this vector must be the same.

Return value

Type: XMVECTOR 

Returns the interpolated quaternion. If Q0 and Q1 are not unit quaternions, the resulting interpolation is undefined.

Remarks

The DirectXMath quaternion functions use an XMVECTOR 4-vector to represent quaternions, where the X, Y, and Z components are the vector part and the W component is the scalar part.

This function is identical to XMQuaternionSlerp except that T is supplied using a 4D vector instead of a float value.

Using nlerp instead of slerp

In most use-cases, slerp (spherical linear interpolation) is unnecessary and can be easily and efficiently approximated by nlerp (normalized linear interpolation). nlerp is implemented as follows:

XMQuaternionNormalize( XMVectorLerpV( Q0, Q1, T ) );  

See XMVectorLerpV and XMQuaternionNormalize. For more information, see Understanding Slerp, Then Not Using It.

Requirements

Header: Declared in directxmath.h.