dual_quaternion.hpp
Go to the documentation of this file.
1 
41 #pragma once
42 
43 // Dependency:
44 #include "../glm.hpp"
45 #include "../gtc/constants.hpp"
46 #include "../gtc/quaternion.hpp"
47 
48 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
49 # pragma message("GLM: GLM_GTX_dual_quaternion extension included")
50 #endif
51 
52 namespace glm{
53 namespace detail
54 {
55  template <typename T, precision P>
56  struct tdualquat
57  {
58  enum ctor{null};
59  typedef T value_type;
61 
62  public:
64 
66 
67  // Constructors
69  GLM_FUNC_DECL explicit tdualquat(tquat<T, P> const & real);
70  GLM_FUNC_DECL tdualquat(tquat<T, P> const & real,tquat<T, P> const & dual);
71  GLM_FUNC_DECL tdualquat(tquat<T, P> const & orientation,tvec3<T, P> const& translation);
72 
74  // tdualquat conversions
75  GLM_FUNC_DECL explicit tdualquat(tmat2x4<T, P> const & holder_mat);
76  GLM_FUNC_DECL explicit tdualquat(tmat3x4<T, P> const & aug_mat);
77 
78  // Accesses
79  GLM_FUNC_DECL part_type & operator[](int i);
80  GLM_FUNC_DECL part_type const & operator[](int i) const;
81 
82  // Operators
85  };
86 
87  template <typename T, precision P>
89  detail::tquat<T, P> const & q);
90 
91  template <typename T, precision P>
93  detail::tdualquat<T, P> const & q,
94  detail::tdualquat<T, P> const & p);
95 
96  template <typename T, precision P>
98  detail::tdualquat<T, P> const & q,
99  detail::tdualquat<T, P> const & p);
100 
101  template <typename T, precision P>
103  detail::tquat<T, P> const & q,
104  detail::tvec3<T, P> const & v);
105 
106  template <typename T, precision P>
108  detail::tvec3<T, P> const & v,
109  detail::tquat<T, P> const & q);
110 
111  template <typename T, precision P>
113  detail::tquat<T, P> const & q,
114  detail::tvec4<T, P> const & v);
115 
116  template <typename T, precision P>
118  detail::tvec4<T, P> const & v,
119  detail::tquat<T, P> const & q);
120 
121  template <typename T, precision P>
123  detail::tdualquat<T, P> const & q,
124  T const & s);
125 
126  template <typename T, precision P>
128  T const & s,
129  detail::tdualquat<T, P> const & q);
130 
131  template <typename T, precision P>
133  detail::tdualquat<T, P> const & q,
134  T const & s);
135 } //namespace detail
136 
139 
143  template <typename T, precision P>
145  detail::tdualquat<T, P> const & q);
146 
150  template <typename T, precision P>
152  detail::tdualquat<T, P> const & x,
153  detail::tdualquat<T, P> const & y,
154  T const & a);
155 
159  template <typename T, precision P>
161  detail::tdualquat<T, P> const & q);
162 
163  /*
168  template <typename T, precision P>
169  detail::tmat3x3<T, P> mat3_cast(
170  detail::tdualquat<T, P> const & x);
171  */
172 
176  template <typename T, precision P>
178  detail::tdualquat<T, P> const & x);
179 
183  template <typename T, precision P>
185  detail::tdualquat<T, P> const & x);
186 
190  template <typename T, precision P>
192  detail::tmat2x4<T, P> const & x);
193 
197  template <typename T, precision P>
199  detail::tmat3x4<T, P> const & x);
200 
201 
206 
211 
216 
217 
222 
227 
232 
233 
238 
243 
248 
249 
250 #if(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
251  typedef highp_fdualquat dualquat;
255 
259  typedef highp_fdualquat fdualquat;
260 #elif(defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
261  typedef highp_fdualquat dualquat;
262  typedef highp_fdualquat fdualquat;
263 #elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
264  typedef mediump_fdualquat dualquat;
265  typedef mediump_fdualquat fdualquat;
266 #elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && defined(GLM_PRECISION_LOWP_FLOAT))
267  typedef lowp_fdualquat dualquat;
268  typedef lowp_fdualquat fdualquat;
269 #else
270 # error "GLM error: multiple default precision requested for single-precision floating-point types"
271 #endif
272 
273 
274 #if(!defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE))
275  typedef highp_ddualquat ddualquat;
279 #elif(defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE))
280  typedef highp_ddualquat ddualquat;
281 #elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE))
282  typedef mediump_ddualquat ddualquat;
283 #elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && defined(GLM_PRECISION_LOWP_DOUBLE))
284  typedef lowp_ddualquat ddualquat;
285 #else
286 # error "GLM error: Multiple default precision requested for double-precision floating-point types"
287 #endif
288 
290 } //namespace glm
291 
292 #include "dual_quaternion.inl"
detail::tdualquat< double, highp > highp_ddualquat
glm::detail::tquat< T, P > dual
detail::tdualquat< float, highp > highp_fdualquat
highp_fdualquat dualquat
int length_t
Definition: setup.hpp:755
detail::tdualquat< float, mediump > mediump_fdualquat
GLM_FUNC_DECL detail::tquat< T, P > lerp(detail::tquat< T, P > const &x, detail::tquat< T, P > const &y, T const &a)
detail::tdualquat< double, mediump > mediump_ddualquat
GLM_FUNC_DECL tdualquat< T, P > & operator/=(T const &s)
highp_fdualquat fdualquat
detail::tdualquat< float, mediump > mediump_dualquat
GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const
GLM_FUNC_DECL tmat2x2< T, P > operator*(tmat2x2< T, P > const &m, T const &s)
detail::tdualquat< float, lowp > lowp_dualquat
glm::detail::tquat< T, P > part_type
GLM_FUNC_DECL genType normalize(genType const &x)
GLM_FUNC_DECL tmat2x2< T, P > operator+(tmat2x2< T, P > const &m, T const &s)
GLM_FUNC_DECL tmat2x2< T, P > operator/(tmat2x2< T, P > const &m, T const &s)
GLM_FUNC_DECL tmat2x2< T, P > operator-(tmat2x2< T, P > const &m, T const &s)
GLM_FUNC_DECL detail::tmat3x4< T, P > mat3x4_cast(detail::tdualquat< T, P > const &x)
GLM_FUNC_DECL detail::tmat2x4< T, P > mat2x4_cast(detail::tdualquat< T, P > const &x)
detail::tdualquat< float, lowp > lowp_fdualquat
GLM_FUNC_DECL tdualquat()
GLM_FUNC_DECL part_type & operator[](int i)
GLM_FUNC_DECL tdualquat< T, P > & operator*=(T const &s)
glm::detail::tquat< T, P > real
highp_ddualquat ddualquat
detail::tdualquat< double, lowp > lowp_ddualquat
detail::tdualquat< float, highp > highp_dualquat
GLM_FUNC_DECL detail::tdualquat< T, P > dualquat_cast(detail::tmat2x4< T, P > const &x)
#define GLM_CONSTEXPR
Definition: setup.hpp:801
#define GLM_FUNC_DECL
Definition: setup.hpp:728
GLM_FUNC_DECL detail::tmat4x4< T, P > orientation(detail::tvec3< T, P > const &Normal, detail::tvec3< T, P > const &Up)
GLM_FUNC_DECL matType< T, P > inverse(matType< T, P > const &m)


rtabmap
Author(s): Mathieu Labbe
autogenerated on Mon Dec 14 2020 03:34:58