Computes a rotation quaternion from a rotation matrix.
XMVECTOR XMQuaternionRotationMatrix(
CXMMATRIX M
)
M
Type: CXMMATRIX
Rotation matrix.
Type: XMVECTOR
Returns the rotation quaternion.
This function only uses the upper 3x3 portion of the XMMATRIX. Note if the input matrix contains scales, shears, or other non-rotation transformations in the upper 3x3 matrix, then the output of this function is ill-defined.
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.
Header: Declared in directxmath.h.