C4 Engine Terathon Software C4 Engine API Documentation

• Math Library

API Links
Developer Links

Quaternion::SetRotationMatrix

Defined in:  C4Quaternion.h
Converts a 3 × 3 matrix to a quaternion.
Prototype

Quaternion& SetRotationMatrix(const Matrix3D& m);

Quaternion& SetRotationMatrix(const Transform4D& m);

Parameters
m The matrix to convert to a quaternion. For best results, this matrix should be orthogonal.
Description
The SetRotationMatrix function sets the components of a quaternion to values that represent the same rotation as the one represented by the matrix specified by the m parameter. If m is a Transform4D object, then the upper-left 3 × 3 submatrix is used, and the fourth column is ignored.
See Also

Quaternion::GetRotationMatrix

Quaternion::SetRotationAboutX

Quaternion::SetRotationAboutY

Quaternion::SetRotationAboutZ

Quaternion::SetRotationAboutAxis