18 #include "../gtc/constants.hpp"
19 #include "../gtc/quaternion.hpp"
20 #include "../gtx/norm.hpp"
22 #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
23 # pragma message("GLM: GLM_GTX_quaternion extension included")
34 template<
typename T, precision P>
35 GLM_FUNC_DECL tvec3<T, P>
cross(
36 tquat<T, P>
const & q,
37 tvec3<T, P>
const & v);
42 template<
typename T, precision P>
43 GLM_FUNC_DECL tvec3<T, P>
cross(
44 tvec3<T, P>
const & v,
45 tquat<T, P>
const & q);
51 template<
typename T, precision P>
52 GLM_FUNC_DECL tquat<T, P>
squad(
53 tquat<T, P>
const & q1,
54 tquat<T, P>
const & q2,
55 tquat<T, P>
const & s1,
56 tquat<T, P>
const & s2,
62 template<
typename T, precision P>
64 tquat<T, P>
const & prev,
65 tquat<T, P>
const & curr,
66 tquat<T, P>
const & next);
71 template<
typename T, precision P>
72 GLM_FUNC_DECL tquat<T, P>
exp(
73 tquat<T, P>
const & q);
78 template<
typename T, precision P>
79 GLM_FUNC_DECL tquat<T, P>
log(
80 tquat<T, P>
const & q);
85 template<
typename T, precision P>
86 GLM_FUNC_DECL tquat<T, P>
pow(
87 tquat<T, P>
const & x,
100 template<
typename T, precision P>
101 GLM_FUNC_DECL tvec3<T, P>
rotate(
102 tquat<T, P>
const & q,
103 tvec3<T, P>
const & v);
108 template<
typename T, precision P>
109 GLM_FUNC_DECL tvec4<T, P>
rotate(
110 tquat<T, P>
const & q,
111 tvec4<T, P>
const & v);
116 template<
typename T, precision P>
118 tquat<T, P>
const & q);
123 template<
typename T, precision P>
125 tquat<T, P>
const & x){
return mat3_cast(x);}
130 template<
typename T, precision P>
132 tquat<T, P>
const & x){
return mat4_cast(x);}
137 template<
typename T, precision P>
139 tmat3x3<T, P>
const & x){
return quat_cast(x);}
144 template<
typename T, precision P>
146 tmat4x4<T, P>
const & x){
return quat_cast(x);}
151 template<
typename T, precision P>
153 tquat<T, P>
const & x,
154 tquat<T, P>
const & y,
160 template<
typename T, precision P>
161 GLM_FUNC_DECL tquat<T, P>
fastMix(
162 tquat<T, P>
const & x,
163 tquat<T, P>
const & y,
171 template<
typename T, precision P>
173 tvec3<T, P>
const & orig,
174 tvec3<T, P>
const & dest);
179 template<
typename T, precision P>
180 GLM_FUNC_DECL T
length2(tquat<T, P>
const & q);
185 #include "quaternion.inl"
GLM_FUNC_DECL tquat< T, P > pow(tquat< T, P > const &x, T const &y)
Returns x raised to the y power.
GLM_FUNC_DECL T length2(tquat< T, P > const &q)
Returns the squared length of x.
GLM_FUNC_DECL tmat4x4< T, P > toMat4(tquat< T, P > const &x)
Converts a quaternion to a 4 * 4 matrix.
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_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_FUNC_DECL tmat3x3< T, P > toMat3(tquat< T, P > const &x)
Converts a quaternion to a 3 * 3 matrix.
GLM_FUNC_DECL tquat< T, P > rotation(tvec3< T, P > const &orig, tvec3< T, P > const &dest)
Compute the rotation between two vectors.
GLM_FUNC_DECL tmat4x4< T, P > mat4_cast(tquat< T, P > const &x)
Converts a quaternion to a 4 * 4 matrix.
GLM_FUNC_DECL T extractRealComponent(tquat< T, P > const &q)
Extract the real component of a quaternion.
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_FUNC_DECL tquat< T, P > exp(tquat< T, P > const &q)
Returns a exp of a quaternion.
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_FUNC_DECL tquat< T, P > fastMix(tquat< T, P > const &x, tquat< T, P > const &y, T const &a)
Quaternion normalized linear interpolation.
GLM_FUNC_DECL tquat< T, P > toQuat(tmat4x4< T, P > const &x)
Converts a 4 * 4 matrix to a quaternion.
GLM_FUNC_DECL tquat< T, P > quat_cast(tmat3x3< T, P > const &x)
Converts a 3 * 3 matrix to a quaternion.
GLM_FUNC_DECL tmat3x3< T, P > mat3_cast(tquat< T, P > const &x)
Converts a quaternion to a 3 * 3 matrix.
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_FUNC_DECL tquat< T, P > log(tquat< T, P > const &q)
Returns a log of a quaternion.