20 #include "../gtc/constants.hpp"
21 #include "../gtc/quaternion.hpp"
23 #ifndef GLM_ENABLE_EXPERIMENTAL
24 # error "GLM: GLM_GTX_dual_quaternion is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
25 #elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
26 # pragma message("GLM: GLM_GTX_dual_quaternion extension included")
34 template<
typename T, qualifier Q = defaultp>
40 typedef qua<T, Q> part_type;
48 typedef length_t length_type;
50 GLM_FUNC_DECL
static GLM_CONSTEXPR length_type
length(){
return 2;}
52 GLM_FUNC_DECL part_type & operator[](length_type i);
53 GLM_FUNC_DECL part_type
const& operator[](length_type i)
const;
57 GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR tdualquat() GLM_DEFAULT;
58 GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat<T, Q> const& d) GLM_DEFAULT;
60 GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat<T, P> const& d);
64 GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(qua<T, Q> const& real);
65 GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(qua<T, Q> const&
orientation, vec<3, T, Q> const& translation);
66 GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(qua<T, Q> const& real, qua<T, Q> const& dual);
70 template<typename U, qualifier P>
71 GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tdualquat(tdualquat<U, P> const& q);
73 GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR tdualquat(mat<2, 4, T, Q> const& holder_mat);
74 GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR tdualquat(mat<3, 4, T, Q> const& aug_mat);
78 GLM_DEFAULTED_FUNC_DECL tdualquat<T, Q> & operator=(tdualquat<T, Q> const& m) GLM_DEFAULT;
81 GLM_FUNC_DECL tdualquat<T, Q> & operator=(tdualquat<U, Q> const& m);
83 GLM_FUNC_DECL tdualquat<T, Q> & operator*=(U s);
85 GLM_FUNC_DECL tdualquat<T, Q> & operator/=(U s);
90 template<typename T, qualifier Q>
91 GLM_FUNC_DECL tdualquat<T, Q> operator+(tdualquat<T, Q> const& q);
93 template<typename T, qualifier Q>
94 GLM_FUNC_DECL tdualquat<T, Q> operator-(tdualquat<T, Q> const& q);
98 template<typename T, qualifier Q>
99 GLM_FUNC_DECL tdualquat<T, Q> operator+(tdualquat<T, Q> const& q, tdualquat<T, Q> const& p);
101 template<typename T, qualifier Q>
102 GLM_FUNC_DECL tdualquat<T, Q> operator*(tdualquat<T, Q> const& q, tdualquat<T, Q> const& p);
104 template<typename T, qualifier Q>
105 GLM_FUNC_DECL vec<3, T, Q> operator*(tdualquat<T, Q> const& q, vec<3, T, Q> const& v);
107 template<typename T, qualifier Q>
108 GLM_FUNC_DECL vec<3, T, Q> operator*(vec<3, T, Q> const& v, tdualquat<T, Q> const& q);
110 template<typename T, qualifier Q>
111 GLM_FUNC_DECL vec<4, T, Q> operator*(tdualquat<T, Q> const& q, vec<4, T, Q> const& v);
113 template<typename T, qualifier Q>
114 GLM_FUNC_DECL vec<4, T, Q> operator*(vec<4, T, Q> const& v, tdualquat<T, Q> const& q);
116 template<typename T, qualifier Q>
117 GLM_FUNC_DECL tdualquat<T, Q> operator*(tdualquat<T, Q> const& q, T const& s);
119 template<typename T, qualifier Q>
120 GLM_FUNC_DECL tdualquat<T, Q> operator*(T const& s, tdualquat<T, Q> const& q);
122 template<typename T, qualifier Q>
123 GLM_FUNC_DECL tdualquat<T, Q> operator/(tdualquat<T, Q> const& q, T const& s);
127 template<typename T, qualifier Q>
128 GLM_FUNC_DECL
bool operator==(tdualquat<T, Q> const& q1, tdualquat<T, Q> const& q2);
130 template<typename T, qualifier Q>
131 GLM_FUNC_DECL
bool operator!=(tdualquat<T, Q> const& q1, tdualquat<T, Q> const& q2);
136 template <typename T, qualifier Q>
142 template<typename T, qualifier Q>
143 GLM_FUNC_DECL tdualquat<T, Q>
normalize(tdualquat<T, Q> const& q);
148 template<typename T, qualifier Q>
149 GLM_FUNC_DECL tdualquat<T, Q>
lerp(tdualquat<T, Q> const& x, tdualquat<T, Q> const& y, T const& a);
154 template<typename T, qualifier Q>
155 GLM_FUNC_DECL tdualquat<T, Q>
inverse(tdualquat<T, Q> const& q);
160 template<typename T, qualifier Q>
161 GLM_FUNC_DECL mat<2, 4, T, Q>
mat2x4_cast(tdualquat<T, Q> const& x);
166 template<typename T, qualifier Q>
167 GLM_FUNC_DECL mat<3, 4, T, Q>
mat3x4_cast(tdualquat<T, Q> const& x);
172 template<typename T, qualifier Q>
178 template<typename T, qualifier Q>
230 #if(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
240 #elif(defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
243 #elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
246 #elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && defined(GLM_PRECISION_LOWP_FLOAT))
250 # error "GLM error: multiple default precision requested for single-precision floating-point types"
254 #if(!defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE))
259 #elif(defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE))
261 #elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE))
263 #elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && defined(GLM_PRECISION_LOWP_DOUBLE))
266 # error "GLM error: Multiple default precision requested for double-precision floating-point types"
272 #include "dual_quaternion.inl"