0.9.9 API documenation
|
Include <glm/gtc/quaternion.hpp> to use the features of this extension. More...
Functions | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL T | angle (tquat< T, Q > const &x) |
Returns the quaternion rotation angle. More... | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL tquat< T, Q > | angleAxis (T const &angle, vec< 3, T, Q > const &axis) |
Build a quaternion from an angle and a normalized axis. More... | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL vec< 3, T, Q > | axis (tquat< T, Q > const &x) |
Returns the q rotation axis. More... | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL tquat< T, Q > | conjugate (tquat< T, Q > const &q) |
Returns the q conjugate. More... | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL T | dot (tquat< T, Q > const &x, tquat< T, Q > const &y) |
Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ... More... | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL vec< 4, bool, Q > | equal (tquat< T, Q > const &x, tquat< T, Q > const &y) |
Returns the component-wise comparison of result x == y. More... | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL vec< 3, T, Q > | eulerAngles (tquat< T, Q > const &x) |
Returns euler angles, pitch as x, yaw as y, roll as z. More... | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL vec< 4, bool, Q > | greaterThan (tquat< T, Q > const &x, tquat< T, Q > const &y) |
Returns the component-wise comparison of result x > y. More... | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL vec< 4, bool, Q > | greaterThanEqual (tquat< T, Q > const &x, tquat< T, Q > const &y) |
Returns the component-wise comparison of result x >= y. More... | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL tquat< T, Q > | inverse (tquat< T, Q > const &q) |
Returns the q inverse. More... | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL vec< 4, bool, Q > | isinf (tquat< T, Q > const &x) |
Returns true if x holds a positive infinity or negative infinity representation in the underlying implementation's set of floating point representations. More... | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL vec< 4, bool, Q > | isnan (tquat< T, Q > const &x) |
Returns true if x holds a NaN (not a number) representation in the underlying implementation's set of floating point representations. More... | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL T | length (tquat< T, Q > const &q) |
Returns the length of the quaternion. More... | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL tquat< T, Q > | lerp (tquat< T, Q > const &x, tquat< T, Q > const &y, T a) |
Linear interpolation of two quaternions. More... | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL vec< 4, bool, Q > | lessThan (tquat< T, Q > const &x, tquat< T, Q > const &y) |
Returns the component-wise comparison result of x < y. More... | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL vec< 4, bool, Q > | lessThanEqual (tquat< T, Q > const &x, tquat< T, Q > const &y) |
Returns the component-wise comparison of result x <= y. More... | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL mat< 3, 3, T, Q > | mat3_cast (tquat< 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 > | mat4_cast (tquat< T, Q > const &x) |
Converts a quaternion to a 4 * 4 matrix. More... | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL tquat< T, Q > | mix (tquat< T, Q > const &x, tquat< T, Q > const &y, T a) |
Spherical linear interpolation of two quaternions. More... | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL tquat< T, Q > | normalize (tquat< T, Q > const &q) |
Returns the normalized quaternion. More... | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL vec< 4, bool, Q > | notEqual (tquat< T, Q > const &x, tquat< T, Q > const &y) |
Returns the component-wise comparison of result x != y. More... | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL T | pitch (tquat< T, Q > const &x) |
Returns pitch value of euler angles expressed in radians. More... | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL tquat< T, Q > | quat_cast (mat< 3, 3, T, Q > const &x) |
Converts a 3 * 3 matrix to a quaternion. More... | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL tquat< T, Q > | quat_cast (mat< 4, 4, T, Q > const &x) |
Converts a 4 * 4 matrix to a quaternion. More... | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL T | roll (tquat< T, Q > const &x) |
Returns roll value of euler angles expressed in radians. More... | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL tquat< T, Q > | rotate (tquat< T, Q > const &q, T const &angle, vec< 3, T, Q > const &axis) |
Rotates a quaternion from a vector of 3 components axis and an angle. More... | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL tquat< T, Q > | slerp (tquat< T, Q > const &x, tquat< T, Q > const &y, T a) |
Spherical linear interpolation of two quaternions. More... | |
template<typename T , qualifier Q> | |
GLM_FUNC_DECL T | yaw (tquat< T, Q > const &x) |
Returns yaw value of euler angles expressed in radians. More... | |
Include <glm/gtc/quaternion.hpp> to use the features of this extension.
Defines a templated quaternion type and several quaternion operations.
GLM_FUNC_DECL T glm::angle | ( | tquat< T, Q > const & | x | ) |
Returns the quaternion rotation angle.
T | Floating-point scalar types. |
GLM_FUNC_DECL tquat<T, Q> glm::angleAxis | ( | T const & | angle, |
vec< 3, T, Q > const & | axis | ||
) |
Build a quaternion from an angle and a normalized axis.
angle | Angle expressed in radians. |
axis | Axis of the quaternion, must be normalized. |
T | Floating-point scalar types. |
GLM_FUNC_DECL vec<3, T, Q> glm::axis | ( | tquat< T, Q > const & | x | ) |
Returns the q rotation axis.
T | Floating-point scalar types. |
GLM_FUNC_DECL tquat<T, Q> glm::conjugate | ( | tquat< T, Q > const & | q | ) |
Returns the q conjugate.
T | Floating-point scalar types. |
GLM_FUNC_DECL T glm::dot | ( | tquat< T, Q > const & | x, |
tquat< T, Q > const & | y | ||
) |
Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ...
T | Floating-point scalar types. |
GLM_FUNC_DECL vec<4, bool, Q> glm::equal | ( | tquat< T, Q > const & | x, |
tquat< T, Q > const & | y | ||
) |
Returns the component-wise comparison of result x == y.
T | Floating-point scalar types. |
GLM_FUNC_DECL vec<3, T, Q> glm::eulerAngles | ( | tquat< T, Q > const & | x | ) |
Returns euler angles, pitch as x, yaw as y, roll as z.
The result is expressed in radians.
T | Floating-point scalar types. |
GLM_FUNC_DECL vec<4, bool, Q> glm::greaterThan | ( | tquat< T, Q > const & | x, |
tquat< T, Q > const & | y | ||
) |
Returns the component-wise comparison of result x > y.
T | Floating-point scalar types. |
GLM_FUNC_DECL vec<4, bool, Q> glm::greaterThanEqual | ( | tquat< T, Q > const & | x, |
tquat< T, Q > const & | y | ||
) |
Returns the component-wise comparison of result x >= y.
T | Floating-point scalar types. |
GLM_FUNC_DECL tquat<T, Q> glm::inverse | ( | tquat< T, Q > const & | q | ) |
GLM_FUNC_DECL vec<4, bool, Q> glm::isinf | ( | tquat< T, Q > const & | x | ) |
Returns true if x holds a positive infinity or negative infinity representation in the underlying implementation's set of floating point representations.
Returns false otherwise, including for implementations with no infinity representations.
T | Floating-point scalar types. |
GLM_FUNC_DECL vec<4, bool, Q> glm::isnan | ( | tquat< T, Q > const & | x | ) |
Returns true if x holds a NaN (not a number) representation in the underlying implementation's set of floating point representations.
Returns false otherwise, including for implementations with no NaN representations.
/!\ When using compiler fast math, this function may fail.
T | Floating-point scalar types. |
GLM_FUNC_DECL T glm::length | ( | tquat< T, Q > const & | q | ) |
Returns the length of the quaternion.
T | Floating-point scalar types. |
GLM_FUNC_DECL tquat<T, Q> glm::lerp | ( | tquat< T, Q > const & | x, |
tquat< T, Q > const & | y, | ||
T | a | ||
) |
Linear interpolation of two quaternions.
The interpolation is oriented.
x | A quaternion |
y | A quaternion |
a | Interpolation factor. The interpolation is defined in the range [0, 1]. |
T | Floating-point scalar types. |
GLM_FUNC_DECL vec<4, bool, Q> glm::lessThan | ( | tquat< T, Q > const & | x, |
tquat< T, Q > const & | y | ||
) |
Returns the component-wise comparison result of x < y.
T | Floating-point scalar types. |
GLM_FUNC_DECL vec<4, bool, Q> glm::lessThanEqual | ( | tquat< T, Q > const & | x, |
tquat< T, Q > const & | y | ||
) |
Returns the component-wise comparison of result x <= y.
T | Floating-point scalar types. |
GLM_FUNC_DECL mat<3, 3, T, Q> glm::mat3_cast | ( | tquat< T, Q > const & | x | ) |
Converts a quaternion to a 3 * 3 matrix.
T | Floating-point scalar types. |
Referenced by glm::toMat3().
GLM_FUNC_DECL mat<4, 4, T, Q> glm::mat4_cast | ( | tquat< T, Q > const & | x | ) |
Converts a quaternion to a 4 * 4 matrix.
T | Floating-point scalar types. |
Referenced by glm::toMat4().
GLM_FUNC_DECL tquat<T, Q> glm::mix | ( | tquat< T, Q > const & | x, |
tquat< T, Q > const & | y, | ||
T | 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.
x | A quaternion |
y | A quaternion |
a | Interpolation factor. The interpolation is defined beyond the range [0, 1]. |
T | Floating-point scalar types. |
GLM_FUNC_DECL tquat<T, Q> glm::normalize | ( | tquat< T, Q > const & | q | ) |
Returns the normalized quaternion.
T | Floating-point scalar types. |
GLM_FUNC_DECL vec<4, bool, Q> glm::notEqual | ( | tquat< T, Q > const & | x, |
tquat< T, Q > const & | y | ||
) |
Returns the component-wise comparison of result x != y.
T | Floating-point scalar types. |
GLM_FUNC_DECL T glm::pitch | ( | tquat< T, Q > const & | x | ) |
Returns pitch value of euler angles expressed in radians.
T | Floating-point scalar types. |
GLM_FUNC_DECL tquat<T, Q> glm::quat_cast | ( | mat< 3, 3, T, Q > const & | x | ) |
Converts a 3 * 3 matrix to a quaternion.
T | Floating-point scalar types. |
Referenced by glm::toQuat().
GLM_FUNC_DECL tquat<T, Q> glm::quat_cast | ( | mat< 4, 4, T, Q > const & | x | ) |
Converts a 4 * 4 matrix to a quaternion.
T | Floating-point scalar types. |
GLM_FUNC_DECL T glm::roll | ( | tquat< T, Q > const & | x | ) |
Returns roll value of euler angles expressed in radians.
T | Floating-point scalar types. |
GLM_FUNC_DECL tquat<T, Q> glm::rotate | ( | tquat< T, Q > const & | q, |
T const & | angle, | ||
vec< 3, T, Q > const & | axis | ||
) |
Rotates a quaternion from a vector of 3 components axis and an angle.
q | Source orientation |
angle | Angle expressed in radians. |
axis | Axis of the rotation |
T | Floating-point scalar types. |
GLM_FUNC_DECL tquat<T, Q> glm::slerp | ( | tquat< T, Q > const & | x, |
tquat< T, Q > const & | y, | ||
T | a | ||
) |
Spherical linear interpolation of two quaternions.
The interpolation always take the short path and the rotation is performed at constant speed.
x | A quaternion |
y | A quaternion |
a | Interpolation factor. The interpolation is defined beyond the range [0, 1]. |
T | Floating-point scalar types. |
GLM_FUNC_DECL T glm::yaw | ( | tquat< T, Q > const & | x | ) |
Returns yaw value of euler angles expressed in radians.
T | Floating-point scalar types. |