- Main Page
- Related Pages
- Modules
- Classes
- Files

Classes | Typedefs | Functions
GLM_GTC_quaternion: Quaternion types and functions
GTC Extensions (Stable)

## Classes
struct | tquat< T >
| Template for quaternion. More...
## Typedefs
typedef detail::tquat< double > | dquat
typedef detail::tquat< float > | fquat
typedef detail::tquat < highp_float > | highp_quat
typedef detail::tquat < detail::half > | hquat
typedef detail::tquat< lowp_float > | lowp_quat
typedef detail::tquat < mediump_float > | mediump_quat
typedef detail::tquat< float > | quat
## Functions
template<typename T >
detail::tquat< T > | conjugate (detail::tquat< T > const &q)
template<typename T >
T | dot (detail::tquat< T > const &q1, detail::tquat< T > const &q2)
template<typename T >
detail::tquat< T > | inverse (detail::tquat< T > const &q)
template<typename T >
T | length (detail::tquat< T > const &q)
template<typename T >
detail::tmat3x3< T > | mat3_cast (detail::tquat< T > const &x)
template<typename T >
detail::tmat4x4< T > | mat4_cast (detail::tquat< T > const &x)
template<typename T >
detail::tquat< T > | mix (detail::tquat< T > const &x, detail::tquat< T > const &y, T const &a)
template<typename T >
detail::tquat< T > | normalize (detail::tquat< T > const &q)
template<typename T >
detail::tquat< T > | quat_cast (detail::tmat3x3< T > const &x)
template<typename T >
detail::tquat< T > | quat_cast (detail::tmat4x4< T > const &x)
template<typename T >
detail::tquat< T > | rotate (detail::tquat< T > const &q, typename detail::tquat< T >::value_type const &angle, detail::tvec3< T > const &v)

## 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> dquat

Quaternion of double-precision floating-point numbers.

See also:
  GLM_GTC_quaternion: Quaternion types and functions

Definition at line 253 of file gtc/quaternion.hpp.

typedef detail::tquat<float> fquat

Quaternion of single-precision floating-point numbers.

See also:
  GLM_GTC_quaternion: Quaternion types and functions

Definition at line 248 of file gtc/quaternion.hpp.

typedef detail::tquat<highp_float> highp_quat

Quaternion of high precision floating-point numbers.

See also:
  GLM_GTC_quaternion: Quaternion types and functions

Definition at line 268 of file gtc/quaternion.hpp.

typedef detail::tquat<detail::half> hquat

Quaternion of half-precision floating-point numbers.

See also:
  GLM_GTC_quaternion: Quaternion types and functions

Definition at line 243 of file gtc/quaternion.hpp.

typedef detail::tquat<lowp_float> lowp_quat

Quaternion of low precision floating-point numbers.

See also:
  GLM_GTC_quaternion: Quaternion types and functions

Definition at line 258 of file gtc/quaternion.hpp.

typedef detail::tquat<mediump_float> mediump_quat

Quaternion of medium precision floating-point numbers.

See also:
  GLM_GTC_quaternion: Quaternion types and functions

Definition at line 263 of file gtc/quaternion.hpp.

typedef detail::tquat<float> quat

Quaternion of floating-point numbers.

See also:
  GLM_GTC_quaternion: Quaternion types and functions

Definition at line 238 of file gtc/quaternion.hpp.

## Function Documentation

detail::tquat<T> glm::conjugate | ( | detail::tquat< T > const & | q | ) |

Returns the q conjugate.

See also:
  GLM_GTC_quaternion: Quaternion types and functions

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: Quaternion types and functions

detail::tquat<T> glm::inverse | ( | detail::tquat< T > const & | q | ) |

Returns the q inverse.

See also:
  GLM_GTC_quaternion: Quaternion types and functions

T glm::length | ( | detail::tquat< T > const & | q | ) |

Returns the length of the quaternion.

See also:
  GLM_GTC_quaternion: Quaternion types and functions

detail::tmat3x3<T> glm::mat3_cast | ( | detail::tquat< T > const & | x | ) |

Converts a quaternion to a 3 * 3 matrix.

See also:
  GLM_GTC_quaternion: Quaternion types and functions

Referenced by glm::toMat3().

detail::tmat4x4<T> glm::mat4_cast | ( | detail::tquat< T > const & | x | ) |

Converts a quaternion to a 4 * 4 matrix.

See also:
  GLM_GTC_quaternion: Quaternion types and functions

Referenced by glm::toMat4().

detail::tquat<T> glm::mix | ( | detail::tquat< T > const & | x,
|  | detail::tquat< T > const & | y,
|  | T const & | a
| ) |  |

Returns a SLERP interpolated quaternion of x and y according a.

See also:
  GLM_GTC_quaternion: Quaternion types and functions

detail::tquat<T> glm::normalize | ( | detail::tquat< T > const & | q | ) |

Returns the normalized quaternion.

See also:
  GLM_GTC_quaternion: Quaternion types and functions

detail::tquat<T> glm::quat_cast | ( | detail::tmat3x3< T > const & | x | ) |

Converts a 3 * 3 matrix to a quaternion.

See also:
  GLM_GTC_quaternion: Quaternion types and functions

Referenced by glm::toQuat().

detail::tquat<T> glm::quat_cast | ( | detail::tmat4x4< T > const & | x | ) |

Converts a 4 * 4 matrix to a quaternion.

See also:
  GLM_GTC_quaternion: Quaternion types and functions

detail::tquat<T> glm::rotate | ( | detail::tquat< T > const & | q,
|  | typename detail::tquat< T >::value_type const & | angle,
|  | detail::tvec3< T > const & | v
| ) |  |

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

See also:
  GLM_GTC_quaternion: Quaternion types and functions