Flow Visualisation
GLM_GTC_quaternion

Defines a templated quaternion type and several quaternion operations. More...

Collaboration diagram for GLM_GTC_quaternion:

Typedefs

typedef detail::tquat< float > glm::quat
 
typedef detail::tquat< detail::half > glm::hquat
 
typedef detail::tquat< float > glm::fquat
 
typedef detail::tquat< double > glm::dquat
 
typedef detail::tquat< lowp_float > glm::lowp_quat
 
typedef detail::tquat< mediump_float > glm::mediump_quat
 
typedef detail::tquat< highp_float > glm::highp_quat
 

Functions

template<typename T >
glm::length (detail::tquat< T > const &q)
 
template<typename T >
detail::tquat< T > glm::normalize (detail::tquat< T > const &q)
 
template<typename T >
glm::dot (detail::tquat< T > const &q1, detail::tquat< T > const &q2)
 
template<typename T >
detail::tquat< T > glm::mix (detail::tquat< T > const &x, detail::tquat< T > const &y, T const &a)
 
template<typename T >
detail::tquat< T > glm::lerp (detail::tquat< T > const &x, detail::tquat< T > const &y, T const &a)
 
template<typename T >
detail::tquat< T > glm::slerp (detail::tquat< T > const &x, detail::tquat< T > const &y, T const &a)
 Returns the slurp interpolation between two quaternions. More...
 
template<typename T >
detail::tquat< T > glm::conjugate (detail::tquat< T > const &q)
 
template<typename T >
detail::tquat< T > glm::inverse (detail::tquat< T > const &q)
 
template<typename T >
detail::tquat< T > glm::rotate (detail::tquat< T > const &q, typename detail::tquat< T >::value_type const &angle, detail::tvec3< T > const &axis)
 
template<typename T >
detail::tvec3< T > glm::eulerAngles (detail::tquat< T > const &x)
 
template<typename valType >
valType glm::roll (detail::tquat< valType > const &x)
 
template<typename valType >
valType glm::pitch (detail::tquat< valType > const &x)
 
template<typename valType >
valType glm::yaw (detail::tquat< valType > const &x)
 
template<typename T >
detail::tmat3x3< T > glm::mat3_cast (detail::tquat< T > const &x)
 
template<typename T >
detail::tmat4x4< T > glm::mat4_cast (detail::tquat< T > const &x)
 
template<typename T >
detail::tquat< T > glm::quat_cast (detail::tmat3x3< T > const &x)
 
template<typename T >
detail::tquat< T > glm::quat_cast (detail::tmat4x4< T > const &x)
 
template<typename valType >
valType glm::angle (detail::tquat< valType > const &x)
 
template<typename valType >
detail::tvec3< valType > glm::axis (detail::tquat< valType > const &x)
 
template<typename valType >
detail::tquat< valType > glm::angleAxis (valType const &angle, valType const &x, valType const &y, valType const &z)
 
template<typename valType >
detail::tquat< valType > glm::angleAxis (valType const &angle, detail::tvec3< valType > const &axis)
 

Detailed Description

Defines a templated quaternion type and several quaternion operations.

<glm/gtc/quaternion.hpp> need to be included to use these functionalities.

Typedef Documentation

typedef detail::tquat<double> glm::dquat

Quaternion of double-precision floating-point numbers.

See also
GLM_GTC_quaternion
typedef detail::tquat<float> glm::fquat

Quaternion of single-precision floating-point numbers.

See also
GLM_GTC_quaternion
typedef detail::tquat<highp_float> glm::highp_quat

Quaternion of high precision floating-point numbers.

See also
GLM_GTC_quaternion
typedef detail::tquat<detail::half> glm::hquat

Quaternion of half-precision floating-point numbers.

See also
GLM_GTC_quaternion
typedef detail::tquat<lowp_float> glm::lowp_quat

Quaternion of low precision floating-point numbers.

See also
GLM_GTC_quaternion
typedef detail::tquat<mediump_float> glm::mediump_quat

Quaternion of medium precision floating-point numbers.

See also
GLM_GTC_quaternion
typedef detail::tquat<float> glm::quat

Quaternion of floating-point numbers.

See also
GLM_GTC_quaternion

Function Documentation

template<typename valType >
valType glm::angle ( detail::tquat< valType > const &  x)

Returns the quaternion rotation angle.

See also
GLM_GTC_quaternion
template<typename valType >
detail::tquat<valType> glm::angleAxis ( valType const &  angle,
valType const &  x,
valType const &  y,
valType const &  z 
)

Build a quaternion from an angle and a normalized axis.

Parameters
angleAngle expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise.
xx component of the x-axis, x, y, z must be a normalized axis
yy component of the y-axis, x, y, z must be a normalized axis
zz component of the z-axis, x, y, z must be a normalized axis
See also
GLM_GTC_quaternion
template<typename valType >
detail::tquat<valType> glm::angleAxis ( valType const &  angle,
detail::tvec3< valType > const &  axis 
)

Build a quaternion from an angle and a normalized axis.

Parameters
angleAngle expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise.
axisAxis of the quaternion, must be normalized.
See also
GLM_GTC_quaternion
template<typename valType >
detail::tvec3<valType> glm::axis ( detail::tquat< valType > const &  x)

Returns the q rotation axis.

See also
GLM_GTC_quaternion
template<typename T >
detail::tquat<T> glm::conjugate ( detail::tquat< T > const &  q)

Returns the q conjugate.

See also
GLM_GTC_quaternion
template<typename T >
T glm::dot ( detail::tquat< T > const &  q1,
detail::tquat< T > const &  q2 
)

Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ...

See also
GLM_GTC_quaternion
template<typename T >
detail::tvec3<T> glm::eulerAngles ( detail::tquat< T > const &  x)

Returns euler angles, yitch as x, yaw as y, roll as z.

See also
GLM_GTC_quaternion
template<typename T >
detail::tquat<T> glm::inverse ( detail::tquat< T > const &  q)

Returns the q inverse.

See also
GLM_GTC_quaternion
template<typename T >
T glm::length ( detail::tquat< T > const &  q)

Returns the length of the quaternion.

See also
GLM_GTC_quaternion
template<typename T >
detail::tquat<T> glm::lerp ( detail::tquat< T > const &  x,
detail::tquat< T > const &  y,
T const &  a 
)

Linear interpolation of two quaternions. The interpolation is oriented.

Parameters
xA quaternion
yA quaternion
aInterpolation factor. The interpolation is defined in the range [0, 1].
Template Parameters
TValue type used to build the quaternion. Supported: half, float or double.
See also
GLM_GTC_quaternion
template<typename T >
detail::tmat3x3<T> glm::mat3_cast ( detail::tquat< T > const &  x)

Converts a quaternion to a 3 * 3 matrix.

See also
GLM_GTC_quaternion
template<typename T >
detail::tmat4x4<T> glm::mat4_cast ( detail::tquat< T > const &  x)

Converts a quaternion to a 4 * 4 matrix.

See also
GLM_GTC_quaternion
template<typename T >
detail::tquat<T> glm::mix ( detail::tquat< T > const &  x,
detail::tquat< T > const &  y,
T const &  a 
)

Spherical linear interpolation of two quaternions. The interpolation is oriented and the rotation is performed at constant speed. For short path spherical linear interpolation, use the slerp function.

Parameters
xA quaternion
yA quaternion
aInterpolation factor. The interpolation is defined beyond the range [0, 1].
Template Parameters
TValue type used to build the quaternion. Supported: half, float or double.
See also
GLM_GTC_quaternion
- slerp(detail::tquat<T> const & x, detail::tquat<T> const & y, T const & a)
template<typename T >
detail::tquat<T> glm::normalize ( detail::tquat< T > const &  q)

Returns the normalized quaternion.

See also
GLM_GTC_quaternion
template<typename valType >
valType glm::pitch ( detail::tquat< valType > const &  x)

Returns pitch value of euler angles expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise.

See also
GLM_GTX_quaternion
template<typename T >
detail::tquat<T> glm::quat_cast ( detail::tmat3x3< T > const &  x)

Converts a 3 * 3 matrix to a quaternion.

See also
GLM_GTC_quaternion
template<typename T >
detail::tquat<T> glm::quat_cast ( detail::tmat4x4< T > const &  x)

Converts a 4 * 4 matrix to a quaternion.

See also
GLM_GTC_quaternion
template<typename valType >
valType glm::roll ( detail::tquat< valType > const &  x)

Returns roll value of euler angles expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise.

See also
GLM_GTX_quaternion
template<typename T >
detail::tquat<T> glm::rotate ( detail::tquat< T > const &  q,
typename detail::tquat< T >::value_type const &  angle,
detail::tvec3< T > const &  axis 
)

Rotates a quaternion from an vector of 3 components axis and an angle.

Parameters
qSource orientation
angleAngle expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise.
axisAxis of the rotation, must be normalized.
See also
GLM_GTC_quaternion
template<typename T >
detail::tquat<T> glm::slerp ( detail::tquat< T > const &  x,
detail::tquat< T > const &  y,
T const &  a 
)

Returns the slurp interpolation between two quaternions.

Spherical linear interpolation of two quaternions. The interpolation always take the short path and the rotation is performed at constant speed.

Parameters
xA quaternion
yA quaternion
aInterpolation factor. The interpolation is defined beyond the range [0, 1].
Template Parameters
TValue type used to build the quaternion. Supported: half, float or double.
See also
GLM_GTC_quaternion
template<typename valType >
valType glm::yaw ( detail::tquat< valType > const &  x)

Returns yaw value of euler angles expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise.

See also
GLM_GTX_quaternion