45 #include "../gtc/constants.hpp"
46 #include "../gtc/quaternion.hpp"
48 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
49 # pragma message("GLM: GLM_GTX_dual_quaternion extension included")
57 template <
typename T, precision P>
61 typedef glm::tquat<T, P> part_type;
64 glm::tquat<T, P> real, dual;
66 #if GLM_FORCE_SIZE_FUNC
67 GLM_FUNC_DECL GLM_CONSTEXPR
size_t size()
const;
70 GLM_FUNC_DECL GLM_CONSTEXPR length_t
length()
const;
72 #endif//GLM_FORCE_SIZE_FUNC
77 GLM_FUNC_DECL tdualquat();
78 template <precision Q>
79 GLM_FUNC_DECL tdualquat(tdualquat<T, Q>
const & d);
84 GLM_FUNC_DECL
explicit tdualquat(ctor);
85 GLM_FUNC_DECL
explicit tdualquat(tquat<T, P>
const & real);
86 GLM_FUNC_DECL tdualquat(tquat<T, P>
const &
orientation, tvec3<T, P>
const & translation);
87 GLM_FUNC_DECL tdualquat(tquat<T, P>
const & real, tquat<T, P>
const & dual);
92 # ifdef GLM_FORCE_EXPLICIT_CTOR
93 template <
typename U, precision Q>
94 GLM_FUNC_DECL
explicit tdualquat(tdualquat<U, Q>
const & q);
96 template <
typename U, precision Q>
97 GLM_FUNC_DECL tdualquat(tdualquat<U, Q>
const & q);
100 GLM_FUNC_DECL
explicit tdualquat(tmat2x4<T, P>
const & holder_mat);
101 GLM_FUNC_DECL
explicit tdualquat(tmat3x4<T, P>
const & aug_mat);
104 GLM_FUNC_DECL part_type & operator[](
int i);
105 GLM_FUNC_DECL part_type
const & operator[](
int i)
const;
108 GLM_FUNC_DECL tdualquat<T, P> & operator*=(T
const & s);
109 GLM_FUNC_DECL tdualquat<T, P> & operator/=(T
const & s);
112 template <
typename T, precision P>
113 GLM_FUNC_DECL tquat<T, P> operator- (
114 tquat<T, P>
const & q);
116 template <
typename T, precision P>
117 GLM_FUNC_DECL tdualquat<T, P> operator+ (
118 tdualquat<T, P>
const & q,
119 tdualquat<T, P>
const & p);
121 template <
typename T, precision P>
122 GLM_FUNC_DECL tdualquat<T, P> operator* (
123 tdualquat<T, P>
const & q,
124 tdualquat<T, P>
const & p);
126 template <
typename T, precision P>
127 GLM_FUNC_DECL tvec3<T, P> operator* (
128 tquat<T, P>
const & q,
129 tvec3<T, P>
const & v);
131 template <
typename T, precision P>
132 GLM_FUNC_DECL tvec3<T, P> operator* (
133 tvec3<T, P>
const & v,
134 tquat<T, P>
const & q);
136 template <
typename T, precision P>
137 GLM_FUNC_DECL tvec4<T, P> operator* (
138 tquat<T, P>
const & q,
139 tvec4<T, P>
const & v);
141 template <
typename T, precision P>
142 GLM_FUNC_DECL tvec4<T, P> operator* (
143 tvec4<T, P>
const & v,
144 tquat<T, P>
const & q);
146 template <
typename T, precision P>
147 GLM_FUNC_DECL tdualquat<T, P> operator* (
148 tdualquat<T, P>
const & q,
151 template <
typename T, precision P>
152 GLM_FUNC_DECL tdualquat<T, P> operator* (
154 tdualquat<T, P>
const & q);
156 template <
typename T, precision P>
157 GLM_FUNC_DECL tdualquat<T, P> operator/ (
158 tdualquat<T, P>
const & q,
164 template <
typename T, precision P>
166 tdualquat<T, P>
const & q);
171 template <
typename T, precision P>
172 GLM_FUNC_DECL tdualquat<T, P>
lerp(
173 tdualquat<T, P>
const & x,
174 tdualquat<T, P>
const & y,
180 template <
typename T, precision P>
181 GLM_FUNC_DECL tdualquat<T, P>
inverse(
182 tdualquat<T, P>
const & q);
187 template <
typename T, precision P>
189 tdualquat<T, P>
const & x);
194 template <
typename T, precision P>
196 tdualquat<T, P>
const & x);
201 template <
typename T, precision P>
203 tmat2x4<T, P>
const & x);
208 template <
typename T, precision P>
210 tmat3x4<T, P>
const & x);
261 #if(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
271 #elif(defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
274 #elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
277 #elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && defined(GLM_PRECISION_LOWP_FLOAT))
281 # error "GLM error: multiple default precision requested for single-precision floating-point types"
285 #if(!defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE))
290 #elif(defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE))
292 #elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE))
294 #elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && defined(GLM_PRECISION_LOWP_DOUBLE))
297 # error "GLM error: Multiple default precision requested for double-precision floating-point types"
303 #include "dual_quaternion.inl"
GLM_FUNC_DECL tdualquat< T, P > lerp(tdualquat< T, P > const &x, tdualquat< T, P > const &y, T const &a)
Returns the linear interpolation of two dual quaternion.
tdualquat< double, lowp > lowp_ddualquat
Dual-quaternion of low double-precision floating-point numbers.
highp_ddualquat ddualquat
Dual-quaternion of default double-precision floating-point numbers.
GLM_FUNC_DECL T length(vecType< T, P > const &x)
Returns the length of x, i.e., sqrt(x * x).
tdualquat< double, highp > highp_ddualquat
Dual-quaternion of high double-precision floating-point numbers.
GLM_FUNC_DECL tdualquat< T, P > normalize(tdualquat< T, P > const &q)
Returns the normalized quaternion.
GLM_FUNC_DECL tmat2x4< T, P > mat2x4_cast(tdualquat< T, P > const &x)
Converts a quaternion to a 2 * 4 matrix.
tdualquat< float, lowp > lowp_fdualquat
Dual-quaternion of low single-precision floating-point numbers.
highp_fdualquat dualquat
Dual-quaternion of floating-point numbers.
GLM_FUNC_DECL tmat3x4< T, P > mat3x4_cast(tdualquat< T, P > const &x)
Converts a quaternion to a 3 * 4 matrix.
tdualquat< float, highp > highp_fdualquat
Dual-quaternion of high single-precision floating-point numbers.
GLM_FUNC_DECL tdualquat< T, P > dualquat_cast(tmat3x4< T, P > const &x)
Converts a 3 * 4 matrix (augmented matrix rotation + translation) to a quaternion.
tdualquat< float, highp > highp_dualquat
Dual-quaternion of high single-precision floating-point numbers.
tdualquat< float, mediump > mediump_fdualquat
Dual-quaternion of medium single-precision floating-point numbers.
tdualquat< float, mediump > mediump_dualquat
Dual-quaternion of medium single-precision floating-point numbers.
highp_fdualquat fdualquat
Dual-quaternion of single-precision floating-point numbers.
tdualquat< float, lowp > lowp_dualquat
Dual-quaternion of low single-precision floating-point numbers.
GLM_FUNC_DECL tmat4x4< T, P > orientation(tvec3< T, P > const &Normal, tvec3< T, P > const &Up)
Build a rotation matrix from a normal and a up vector.
GLM_FUNC_DECL tdualquat< T, P > inverse(tdualquat< T, P > const &q)
Returns the q inverse.
tdualquat< double, mediump > mediump_ddualquat
Dual-quaternion of medium double-precision floating-point numbers.