0.9.9 API documentation
gtc/quaternion.hpp
Go to the documentation of this file.
1 
14 #pragma once
15 
16 // Dependency:
17 #include "../gtc/constants.hpp"
18 #include "../gtc/matrix_transform.hpp"
19 #include "../ext/vector_relational.hpp"
20 #include "../ext/quaternion_common.hpp"
21 #include "../ext/quaternion_float.hpp"
22 #include "../ext/quaternion_float_precision.hpp"
23 #include "../ext/quaternion_double.hpp"
24 #include "../ext/quaternion_double_precision.hpp"
25 #include "../ext/quaternion_relational.hpp"
26 #include "../ext/quaternion_geometric.hpp"
27 #include "../ext/quaternion_trigonometric.hpp"
28 #include "../ext/quaternion_transform.hpp"
29 #include "../detail/type_mat3x3.hpp"
30 #include "../detail/type_mat4x4.hpp"
31 #include "../detail/type_vec3.hpp"
32 #include "../detail/type_vec4.hpp"
33 
34 #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
35 # pragma message("GLM: GLM_GTC_quaternion extension included")
36 #endif
37 
38 namespace glm
39 {
42 
49  template<typename T, qualifier Q>
50  GLM_FUNC_DECL vec<3, T, Q> eulerAngles(qua<T, Q> const& x);
51 
57  template<typename T, qualifier Q>
58  GLM_FUNC_DECL T roll(qua<T, Q> const& x);
59 
65  template<typename T, qualifier Q>
66  GLM_FUNC_DECL T pitch(qua<T, Q> const& x);
67 
73  template<typename T, qualifier Q>
74  GLM_FUNC_DECL T yaw(qua<T, Q> const& x);
75 
81  template<typename T, qualifier Q>
82  GLM_FUNC_DECL mat<3, 3, T, Q> mat3_cast(qua<T, Q> const& x);
83 
89  template<typename T, qualifier Q>
90  GLM_FUNC_DECL mat<4, 4, T, Q> mat4_cast(qua<T, Q> const& x);
91 
97  template<typename T, qualifier Q>
98  GLM_FUNC_DECL qua<T, Q> quat_cast(mat<3, 3, T, Q> const& x);
99 
105  template<typename T, qualifier Q>
106  GLM_FUNC_DECL qua<T, Q> quat_cast(mat<4, 4, T, Q> const& x);
107 
114  template<typename T, qualifier Q>
115  GLM_FUNC_DECL vec<4, bool, Q> lessThan(qua<T, Q> const& x, qua<T, Q> const& y);
116 
123  template<typename T, qualifier Q>
124  GLM_FUNC_DECL vec<4, bool, Q> lessThanEqual(qua<T, Q> const& x, qua<T, Q> const& y);
125 
132  template<typename T, qualifier Q>
133  GLM_FUNC_DECL vec<4, bool, Q> greaterThan(qua<T, Q> const& x, qua<T, Q> const& y);
134 
141  template<typename T, qualifier Q>
142  GLM_FUNC_DECL vec<4, bool, Q> greaterThanEqual(qua<T, Q> const& x, qua<T, Q> const& y);
143 
148  template<typename T, qualifier Q>
149  GLM_FUNC_DECL qua<T, Q> quatLookAt(
150  vec<3, T, Q> const& direction,
151  vec<3, T, Q> const& up);
152 
157  template<typename T, qualifier Q>
158  GLM_FUNC_DECL qua<T, Q> quatLookAtRH(
159  vec<3, T, Q> const& direction,
160  vec<3, T, Q> const& up);
161 
166  template<typename T, qualifier Q>
167  GLM_FUNC_DECL qua<T, Q> quatLookAtLH(
168  vec<3, T, Q> const& direction,
169  vec<3, T, Q> const& up);
171 } //namespace glm
172 
173 #include "quaternion.inl"
GLM_FUNC_DECL vec< 3, T, Q > eulerAngles(qua< T, Q > const &x)
Returns euler angles, pitch as x, yaw as y, roll as z.
GLM_FUNC_DECL mat< 3, 3, T, Q > mat3_cast(qua< T, Q > const &x)
Converts a quaternion to a 3 * 3 matrix.
GLM_FUNC_DECL T pitch(qua< T, Q > const &x)
Returns pitch value of euler angles expressed in radians.
GLM_FUNC_DECL vec< 4, bool, Q > greaterThanEqual(qua< T, Q > const &x, qua< T, Q > const &y)
Returns the component-wise comparison of result x >= y.
GLM_FUNC_DECL qua< T, Q > quatLookAtLH(vec< 3, T, Q > const &direction, vec< 3, T, Q > const &up)
Build a left-handed look at quaternion.
GLM_FUNC_DECL vec< 4, bool, Q > greaterThan(qua< T, Q > const &x, qua< T, Q > const &y)
Returns the component-wise comparison of result x > y.
GLM_FUNC_DECL T roll(qua< T, Q > const &x)
Returns roll value of euler angles expressed in radians.
GLM_FUNC_DECL qua< T, Q > quatLookAtRH(vec< 3, T, Q > const &direction, vec< 3, T, Q > const &up)
Build a right-handed look at quaternion.
GLM_FUNC_DECL mat< 4, 4, T, Q > mat4_cast(qua< T, Q > const &x)
Converts a quaternion to a 4 * 4 matrix.
GLM_FUNC_DECL vec< 4, bool, Q > lessThanEqual(qua< T, Q > const &x, qua< T, Q > const &y)
Returns the component-wise comparison of result x <= y.
GLM_FUNC_DECL T yaw(qua< T, Q > const &x)
Returns yaw value of euler angles expressed in radians.
GLM_FUNC_DECL qua< T, Q > quat_cast(mat< 4, 4, T, Q > const &x)
Converts a pure rotation 4 * 4 matrix to a quaternion.
GLM_FUNC_DECL vec< 4, bool, Q > lessThan(qua< T, Q > const &x, qua< T, Q > const &y)
Returns the component-wise comparison result of x < y.
GLM_FUNC_DECL qua< T, Q > quatLookAt(vec< 3, T, Q > const &direction, vec< 3, T, Q > const &up)
Build a look at quaternion based on the default handedness.
Definition: common.hpp:18