FlukyEngine
GLM_GTX_quaternion

Include <glm/gtx/quaternion.hpp> to use the features of this extension. More...

Collaboration diagram for GLM_GTX_quaternion:

## Functions

template<typename T , qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR qua< T, Q > glm::quat_identity ()
Create an identity quaternion. More...

template<typename T , qualifier Q>
GLM_FUNC_DECL vec< 3, T, Q > glm::cross (qua< T, Q > const &q, vec< 3, T, Q > const &v)
Compute a cross product between a quaternion and a vector. More...

template<typename T , qualifier Q>
GLM_FUNC_DECL vec< 3, T, Q > glm::cross (vec< 3, T, Q > const &v, qua< T, Q > const &q)
Compute a cross product between a vector and a quaternion. More...

template<typename T , qualifier Q>
GLM_FUNC_DECL qua< T, Q > glm::squad (qua< T, Q > const &q1, qua< T, Q > const &q2, qua< T, Q > const &s1, qua< T, Q > const &s2, T const &h)
Compute a point on a path according squad equation. More...

template<typename T , qualifier Q>
GLM_FUNC_DECL qua< T, Q > glm::intermediate (qua< T, Q > const &prev, qua< T, Q > const &curr, qua< T, Q > const &next)
Returns an intermediate control point for squad interpolation. More...

template<typename T , qualifier Q>
GLM_FUNC_DECL vec< 3, T, Q > glm::rotate (qua< T, Q > const &q, vec< 3, T, Q > const &v)
Returns quarternion square root. More...

template<typename T , qualifier Q>
GLM_FUNC_DECL vec< 4, T, Q > glm::rotate (qua< T, Q > const &q, vec< 4, T, Q > const &v)
Rotates a 4 components vector by a quaternion. More...

template<typename T , qualifier Q>
GLM_FUNC_DECL T glm::extractRealComponent (qua< T, Q > const &q)
Extract the real component of a quaternion. More...

template<typename T , qualifier Q>
GLM_FUNC_DECL mat< 3, 3, T, Q > glm::toMat3 (qua< T, Q > const &x)
Converts a quaternion to a 3 * 3 matrix. More...

template<typename T , qualifier Q>
GLM_FUNC_DECL mat< 4, 4, T, Q > glm::toMat4 (qua< T, Q > const &x)
Converts a quaternion to a 4 * 4 matrix. More...

template<typename T , qualifier Q>
GLM_FUNC_DECL qua< T, Q > glm::toQuat (mat< 3, 3, T, Q > const &x)
Converts a 3 * 3 matrix to a quaternion. More...

template<typename T , qualifier Q>
GLM_FUNC_DECL qua< T, Q > glm::toQuat (mat< 4, 4, T, Q > const &x)
Converts a 4 * 4 matrix to a quaternion. More...

template<typename T , qualifier Q>
GLM_FUNC_DECL qua< T, Q > glm::shortMix (qua< T, Q > const &x, qua< T, Q > const &y, T const &a)
Quaternion interpolation using the rotation short path. More...

template<typename T , qualifier Q>
GLM_FUNC_DECL qua< T, Q > glm::fastMix (qua< T, Q > const &x, qua< T, Q > const &y, T const &a)
Quaternion normalized linear interpolation. More...

template<typename T , qualifier Q>
GLM_FUNC_DECL qua< T, Q > glm::rotation (vec< 3, T, Q > const &orig, vec< 3, T, Q > const &dest)
Compute the rotation between two vectors. More...

template<typename T , qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR T glm::length2 (qua< T, Q > const &q)
Returns the squared length of x. More...

## Detailed Description

Include <glm/gtx/quaternion.hpp> to use the features of this extension.

Extented quaternion types and functions

## ◆ cross() [1/2]

template<typename T , qualifier Q>
 GLM_FUNC_DECL vec<3, T, Q> glm::cross ( qua< T, Q > const & q, vec< 3, T, Q > const & v )

Compute a cross product between a quaternion and a vector.

GLM_GTX_quaternion

## ◆ cross() [2/2]

template<typename T , qualifier Q>
 GLM_FUNC_DECL vec<3, T, Q> glm::cross ( vec< 3, T, Q > const & v, qua< T, Q > const & q )

Compute a cross product between a vector and a quaternion.

GLM_GTX_quaternion

## ◆ extractRealComponent()

template<typename T , qualifier Q>
 GLM_FUNC_DECL T glm::extractRealComponent ( qua< T, Q > const & q )

Extract the real component of a quaternion.

GLM_GTX_quaternion

## ◆ fastMix()

template<typename T , qualifier Q>
 GLM_FUNC_DECL qua glm::fastMix ( qua< T, Q > const & x, qua< T, Q > const & y, T const & a )

Quaternion normalized linear interpolation.

GLM_GTX_quaternion

## ◆ intermediate()

template<typename T , qualifier Q>
 GLM_FUNC_DECL qua glm::intermediate ( qua< T, Q > const & prev, qua< T, Q > const & curr, qua< T, Q > const & next )

Returns an intermediate control point for squad interpolation.

GLM_GTX_quaternion

## ◆ length2()

template<typename T , qualifier Q>
 GLM_FUNC_DECL GLM_CONSTEXPR T glm::length2 ( qua< T, Q > const & q )

Returns the squared length of x.

GLM_GTX_quaternion

## ◆ quat_identity()

template<typename T , qualifier Q>
 GLM_FUNC_DECL GLM_CONSTEXPR qua glm::quat_identity ( )

Create an identity quaternion.

GLM_GTX_quaternion

## ◆ rotate() [1/2]

template<typename T , qualifier Q>
 GLM_FUNC_DECL vec<3, T, Q> glm::rotate ( qua< T, Q > const & q, vec< 3, T, Q > const & v )

Returns quarternion square root.

GLM_GTX_quaternion Rotates a 3 components vector by a quaternion.
GLM_GTX_quaternion

## ◆ rotate() [2/2]

template<typename T , qualifier Q>
 GLM_FUNC_DECL vec<4, T, Q> glm::rotate ( qua< T, Q > const & q, vec< 4, T, Q > const & v )

Rotates a 4 components vector by a quaternion.

GLM_GTX_quaternion

## ◆ rotation()

template<typename T , qualifier Q>
 GLM_FUNC_DECL qua glm::rotation ( vec< 3, T, Q > const & orig, vec< 3, T, Q > const & dest )

Compute the rotation between two vectors.

Parameters
 orig vector, needs to be normalized dest vector, needs to be normalized
GLM_GTX_quaternion

## ◆ shortMix()

template<typename T , qualifier Q>
 GLM_FUNC_DECL qua glm::shortMix ( qua< T, Q > const & x, qua< T, Q > const & y, T const & a )

Quaternion interpolation using the rotation short path.

GLM_GTX_quaternion

template<typename T , qualifier Q>
 GLM_FUNC_DECL qua glm::squad ( qua< T, Q > const & q1, qua< T, Q > const & q2, qua< T, Q > const & s1, qua< T, Q > const & s2, T const & h )

Compute a point on a path according squad equation.

q1 and q2 are control points; s1 and s2 are intermediate control points.

GLM_GTX_quaternion

## ◆ toMat3()

template<typename T , qualifier Q>
 GLM_FUNC_DECL mat<3, 3, T, Q> glm::toMat3 ( qua< T, Q > const & x )

Converts a quaternion to a 3 * 3 matrix.

GLM_GTX_quaternion

## ◆ toMat4()

template<typename T , qualifier Q>
 GLM_FUNC_DECL mat<4, 4, T, Q> glm::toMat4 ( qua< T, Q > const & x )

Converts a quaternion to a 4 * 4 matrix.

GLM_GTX_quaternion

## ◆ toQuat() [1/2]

template<typename T , qualifier Q>
 GLM_FUNC_DECL qua glm::toQuat ( mat< 3, 3, T, Q > const & x )

Converts a 3 * 3 matrix to a quaternion.