49 #include "../gtc/constants.hpp"
50 #include "../gtc/quaternion.hpp"
52 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
53 # pragma message("GLM: GLM_GTX_dual_quaternion extension included")
61 template <
typename T, precision P>
65 typedef glm::tquat<T, P> part_type;
68 glm::tquat<T, P> real, dual;
73 # ifdef GLM_FORCE_SIZE_FUNC
74 typedef size_t size_type;
76 GLM_FUNC_DECL GLM_CONSTEXPR size_type size()
const;
78 GLM_FUNC_DECL part_type & operator[](size_type i);
79 GLM_FUNC_DECL part_type
const & operator[](size_type i)
const;
81 typedef length_t length_type;
83 GLM_FUNC_DECL GLM_CONSTEXPR length_type
length()
const;
85 GLM_FUNC_DECL part_type & operator[](length_type i);
86 GLM_FUNC_DECL part_type
const & operator[](length_type i)
const;
87 # endif//GLM_FORCE_SIZE_FUNC
92 GLM_FUNC_DECL tdualquat();
93 template <precision Q>
94 GLM_FUNC_DECL tdualquat(tdualquat<T, Q>
const & d);
99 GLM_FUNC_DECL
explicit tdualquat(ctor);
100 GLM_FUNC_DECL
explicit tdualquat(tquat<T, P>
const & real);
101 GLM_FUNC_DECL tdualquat(tquat<T, P>
const &
orientation, tvec3<T, P>
const & translation);
102 GLM_FUNC_DECL tdualquat(tquat<T, P>
const & real, tquat<T, P>
const & dual);
107 # ifdef GLM_FORCE_EXPLICIT_CTOR
108 template <
typename U, precision Q>
109 GLM_FUNC_DECL
explicit tdualquat(tdualquat<U, Q>
const & q);
111 template <
typename U, precision Q>
112 GLM_FUNC_DECL tdualquat(tdualquat<U, Q>
const & q);
115 GLM_FUNC_DECL
explicit tdualquat(tmat2x4<T, P>
const & holder_mat);
116 GLM_FUNC_DECL
explicit tdualquat(tmat3x4<T, P>
const & aug_mat);
119 GLM_FUNC_DECL tdualquat<T, P> & operator*=(T
const & s);
120 GLM_FUNC_DECL tdualquat<T, P> & operator/=(T
const & s);
123 template <
typename T, precision P>
124 GLM_FUNC_DECL tquat<T, P> operator- (
125 tquat<T, P>
const & q);
127 template <
typename T, precision P>
128 GLM_FUNC_DECL tdualquat<T, P> operator+ (
129 tdualquat<T, P>
const & q,
130 tdualquat<T, P>
const & p);
132 template <
typename T, precision P>
133 GLM_FUNC_DECL tdualquat<T, P> operator* (
134 tdualquat<T, P>
const & q,
135 tdualquat<T, P>
const & p);
137 template <
typename T, precision P>
138 GLM_FUNC_DECL tvec3<T, P> operator* (
139 tquat<T, P>
const & q,
140 tvec3<T, P>
const & v);
142 template <
typename T, precision P>
143 GLM_FUNC_DECL tvec3<T, P> operator* (
144 tvec3<T, P>
const & v,
145 tquat<T, P>
const & q);
147 template <
typename T, precision P>
148 GLM_FUNC_DECL tvec4<T, P> operator* (
149 tquat<T, P>
const & q,
150 tvec4<T, P>
const & v);
152 template <
typename T, precision P>
153 GLM_FUNC_DECL tvec4<T, P> operator* (
154 tvec4<T, P>
const & v,
155 tquat<T, P>
const & q);
157 template <
typename T, precision P>
158 GLM_FUNC_DECL tdualquat<T, P> operator* (
159 tdualquat<T, P>
const & q,
162 template <
typename T, precision P>
163 GLM_FUNC_DECL tdualquat<T, P> operator* (
165 tdualquat<T, P>
const & q);
167 template <
typename T, precision P>
168 GLM_FUNC_DECL tdualquat<T, P> operator/ (
169 tdualquat<T, P>
const & q,
175 template <
typename T, precision P>
177 tdualquat<T, P>
const & q);
182 template <
typename T, precision P>
183 GLM_FUNC_DECL tdualquat<T, P>
lerp(
184 tdualquat<T, P>
const & x,
185 tdualquat<T, P>
const & y,
191 template <
typename T, precision P>
192 GLM_FUNC_DECL tdualquat<T, P>
inverse(
193 tdualquat<T, P>
const & q);
198 template <
typename T, precision P>
200 tdualquat<T, P>
const & x);
205 template <
typename T, precision P>
207 tdualquat<T, P>
const & x);
212 template <
typename T, precision P>
214 tmat2x4<T, P>
const & x);
219 template <
typename T, precision P>
221 tmat3x4<T, P>
const & x);
272 #if(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
282 #elif(defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
285 #elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
288 #elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && defined(GLM_PRECISION_LOWP_FLOAT))
292 # error "GLM error: multiple default precision requested for single-precision floating-point types"
296 #if(!defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE))
301 #elif(defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE))
303 #elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE))
305 #elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && defined(GLM_PRECISION_LOWP_DOUBLE))
308 # error "GLM error: Multiple default precision requested for double-precision floating-point types"
314 #include "dual_quaternion.inl"
tdualquat< float, lowp > lowp_fdualquat
Dual-quaternion of low single-precision floating-point numbers.
highp_fdualquat dualquat
Dual-quaternion of floating-point numbers.
tdualquat< float, lowp > lowp_dualquat
Dual-quaternion of low 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.
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< float, highp > highp_dualquat
Dual-quaternion of high single-precision floating-point numbers.
tdualquat< double, lowp > lowp_ddualquat
Dual-quaternion of low double-precision floating-point numbers.
tdualquat< double, highp > highp_ddualquat
Dual-quaternion of high double-precision floating-point numbers.
highp_ddualquat ddualquat
Dual-quaternion of default double-precision floating-point numbers.
tdualquat< float, mediump > mediump_dualquat
Dual-quaternion of medium single-precision floating-point numbers.
GLM_FUNC_DECL tmat2x4< T, P > mat2x4_cast(tdualquat< T, P > const &x)
Converts a quaternion to a 2 * 4 matrix.
highp_fdualquat fdualquat
Dual-quaternion of single-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, mediump > mediump_ddualquat
Dual-quaternion of medium double-precision 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 > inverse(tdualquat< T, P > const &q)
Returns the q inverse.
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 > normalize(tdualquat< T, P > const &q)
Returns the normalized quaternion.
tdualquat< float, mediump > mediump_fdualquat
Dual-quaternion of medium single-precision floating-point numbers.