| 0.9.9 API documenation

- Main Page
- Modules
- Files

- File List

gtx/quaternion.hpp
Go to the documentation of this file.
1
14 #pragma once
15
16 // Dependency:
17 #include "../glm.hpp"
18 #include "../gtc/constants.hpp"
19 #include "../gtc/quaternion.hpp"
20 #include "../gtx/norm.hpp"
21
22 #ifndef GLM_ENABLE_EXPERIMENTAL
23 # error "GLM: GLM_GTX_quaternion is an experimetal extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
24 #endif
25
26 #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
27 # pragma message("GLM: GLM_GTX_quaternion extension included")
28 #endif
29
30 namespace glm
31 {
34
38 template<typename T, precision P>
39 GLM_FUNC_DECL tvec3<T, P> cross(
40 tquat<T, P> const & q,
41 tvec3<T, P> const & v);
42
46 template<typename T, precision P>
47 GLM_FUNC_DECL tvec3<T, P> cross(
48 tvec3<T, P> const & v,
49 tquat<T, P> const & q);
50
55 template<typename T, precision P>
56 GLM_FUNC_DECL tquat<T, P> squad(
57 tquat<T, P> const & q1,
58 tquat<T, P> const & q2,
59 tquat<T, P> const & s1,
60 tquat<T, P> const & s2,
61 T const & h);
62
66 template<typename T, precision P>
67 GLM_FUNC_DECL tquat<T, P> intermediate(
68 tquat<T, P> const & prev,
69 tquat<T, P> const & curr,
70 tquat<T, P> const & next);
71
75 template<typename T, precision P>
76 GLM_FUNC_DECL tquat<T, P> exp(
77 tquat<T, P> const & q);
78
82 template<typename T, precision P>
83 GLM_FUNC_DECL tquat<T, P> log(
84 tquat<T, P> const & q);
85
89 template<typename T, precision P>
90 GLM_FUNC_DECL tquat<T, P> pow(
91 tquat<T, P> const & x,
92 T const & y);
93
97 //template<typename T, precision P>
98 //tquat<T, P> sqrt(
99 // tquat<T, P> const & q);
100
104 template<typename T, precision P>
105 GLM_FUNC_DECL tvec3<T, P> rotate(
106 tquat<T, P> const & q,
107 tvec3<T, P> const & v);
108
112 template<typename T, precision P>
113 GLM_FUNC_DECL tvec4<T, P> rotate(
114 tquat<T, P> const & q,
115 tvec4<T, P> const & v);
116
120 template<typename T, precision P>
121 GLM_FUNC_DECL T extractRealComponent(
122 tquat<T, P> const & q);
123
127 template<typename T, precision P>
128 GLM_FUNC_DECL tmat3x3<T, P> toMat3(
129 tquat<T, P> const & x){return mat3_cast(x);}
130
134 template<typename T, precision P>
135 GLM_FUNC_DECL tmat4x4<T, P> toMat4(
136 tquat<T, P> const & x){return mat4_cast(x);}
137
141 template<typename T, precision P>
142 GLM_FUNC_DECL tquat<T, P> toQuat(
143 tmat3x3<T, P> const & x){return quat_cast(x);}
144
148 template<typename T, precision P>
149 GLM_FUNC_DECL tquat<T, P> toQuat(
150 tmat4x4<T, P> const & x){return quat_cast(x);}
151
155 template<typename T, precision P>
156 GLM_FUNC_DECL tquat<T, P> shortMix(
157 tquat<T, P> const & x,
158 tquat<T, P> const & y,
159 T const & a);
160
164 template<typename T, precision P>
165 GLM_FUNC_DECL tquat<T, P> fastMix(
166 tquat<T, P> const & x,
167 tquat<T, P> const & y,
168 T const & a);
169
175 template<typename T, precision P>
176 GLM_FUNC_DECL tquat<T, P> rotation(
177 tvec3<T, P> const & orig,
178 tvec3<T, P> const & dest);
179
183 template<typename T, precision P>
184 GLM_FUNC_DECL T length2(tquat<T, P> const & q);
185
187 }//namespace glm
188
189 #include "quaternion.inl"
glm::pow
GLM_FUNC_DECL tquat< T, P > pow(tquat< T, P > const &x, T const &y)
Returns x raised to the y power.
glm::length2
GLM_FUNC_DECL T length2(tquat< T, P > const &q)
Returns the squared length of x.
glm::toMat4
GLM_FUNC_DECL tmat4x4< T, P > toMat4(tquat< T, P > const &x)
Converts a quaternion to a 4 * 4 matrix.
Definition: gtx/quaternion.hpp:135
glm::cross
GLM_FUNC_DECL tvec3< T, P > cross(tvec3< T, P > const &v, tquat< T, P > const &q)
Compute a cross product between a vector and a quaternion.
glm::shortMix
GLM_FUNC_DECL tquat< T, P > shortMix(tquat< T, P > const &x, tquat< T, P > const &y, T const &a)
Quaternion interpolation using the rotation short path.
glm::toMat3
GLM_FUNC_DECL tmat3x3< T, P > toMat3(tquat< T, P > const &x)
Converts a quaternion to a 3 * 3 matrix.
Definition: gtx/quaternion.hpp:128
glm::rotation
GLM_FUNC_DECL tquat< T, P > rotation(tvec3< T, P > const &orig, tvec3< T, P > const &dest)
Compute the rotation between two vectors.
glm::mat4_cast
GLM_FUNC_DECL tmat4x4< T, P > mat4_cast(tquat< T, P > const &x)
Converts a quaternion to a 4 * 4 matrix.
glm::extractRealComponent
GLM_FUNC_DECL T extractRealComponent(tquat< T, P > const &q)
Extract the real component of a quaternion.
glm::intermediate
GLM_FUNC_DECL tquat< T, P > intermediate(tquat< T, P > const &prev, tquat< T, P > const &curr, tquat< T, P > const &next)
Returns an intermediate control point for squad interpolation.
glm::exp
GLM_FUNC_DECL tquat< T, P > exp(tquat< T, P > const &q)
Returns a exp of a quaternion.
glm::rotate
GLM_FUNC_DECL tvec4< T, P > rotate(tquat< T, P > const &q, tvec4< T, P > const &v)
Rotates a 4 components vector by a quaternion.
glm::fastMix
GLM_FUNC_DECL tquat< T, P > fastMix(tquat< T, P > const &x, tquat< T, P > const &y, T const &a)
Quaternion normalized linear interpolation.
glm
Definition: _noise.hpp:11
glm::toQuat
GLM_FUNC_DECL tquat< T, P > toQuat(tmat4x4< T, P > const &x)
Converts a 4 * 4 matrix to a quaternion.
Definition: gtx/quaternion.hpp:149
glm::quat_cast
GLM_FUNC_DECL tquat< T, P > quat_cast(tmat3x3< T, P > const &x)
Converts a 3 * 3 matrix to a quaternion.
glm::mat3_cast
GLM_FUNC_DECL tmat3x3< T, P > mat3_cast(tquat< T, P > const &x)
Converts a quaternion to a 3 * 3 matrix.
glm::squad
GLM_FUNC_DECL tquat< T, P > squad(tquat< T, P > const &q1, tquat< T, P > const &q2, tquat< T, P > const &s1, tquat< T, P > const &s2, T const &h)
Compute a point on a path according squad equation.
glm::log
GLM_FUNC_DECL tquat< T, P > log(tquat< T, P > const &q)
Returns a log of a quaternion.