gtc/quaternion.hpp
Go to the documentation of this file.
1 
40 #pragma once
41 
42 // Dependency:
43 #include "../mat3x3.hpp"
44 #include "../mat4x4.hpp"
45 #include "../vec3.hpp"
46 #include "../vec4.hpp"
47 #include "../gtc/constants.hpp"
48 
49 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
50 # pragma message("GLM: GLM_GTC_quaternion extension included")
51 #endif
52 
53 namespace glm{
54 namespace detail
55 {
56  template <typename T, precision P>
57  struct tquat
58  {
59  enum ctor{null};
60 
61  typedef T value_type;
63 
64  public:
65  T x, y, z, w;
66 
68 
69  // Constructors
71  template <typename U, precision Q>
72  GLM_FUNC_DECL explicit tquat(
73  tquat<U, Q> const & q);
75  T const & s,
76  tvec3<T, P> const & v);
78  T const & w,
79  T const & x,
80  T const & y,
81  T const & z);
82 
83  // Convertions
84 
91  GLM_FUNC_DECL explicit tquat(
92  detail::tvec3<T, P> const & u,
93  detail::tvec3<T, P> const & v);
95  GLM_FUNC_DECL explicit tquat(
96  tvec3<T, P> const & eulerAngles);
97  GLM_FUNC_DECL explicit tquat(
98  tmat3x3<T, P> const & m);
99  GLM_FUNC_DECL explicit tquat(
100  tmat4x4<T, P> const & m);
101 
102  // Accesses
104  GLM_FUNC_DECL T const & operator[](length_t i) const;
105 
106  // Operators
109  GLM_FUNC_DECL tquat<T, P> & operator*=(T const & s);
110  GLM_FUNC_DECL tquat<T, P> & operator/=(T const & s);
111  };
112 
113  template <typename T, precision P>
115  detail::tquat<T, P> const & q);
116 
117  template <typename T, precision P>
119  detail::tquat<T, P> const & q,
120  detail::tquat<T, P> const & p);
121 
122  template <typename T, precision P>
124  detail::tquat<T, P> const & q,
125  detail::tquat<T, P> const & p);
126 
127  template <typename T, precision P>
129  detail::tquat<T, P> const & q,
130  detail::tvec3<T, P> const & v);
131 
132  template <typename T, precision P>
134  detail::tvec3<T, P> const & v,
135  detail::tquat<T, P> const & q);
136 
137  template <typename T, precision P>
139  detail::tquat<T, P> const & q,
140  detail::tvec4<T, P> const & v);
141 
142  template <typename T, precision P>
144  detail::tvec4<T, P> const & v,
145  detail::tquat<T, P> const & q);
146 
147  template <typename T, precision P>
149  detail::tquat<T, P> const & q,
150  T const & s);
151 
152  template <typename T, precision P>
154  T const & s,
155  detail::tquat<T, P> const & q);
156 
157  template <typename T, precision P>
159  detail::tquat<T, P> const & q,
160  T const & s);
161 
162 } //namespace detail
163 
166 
170  template <typename T, precision P>
172  detail::tquat<T, P> const & q);
173 
177  template <typename T, precision P>
179  detail::tquat<T, P> const & q);
180 
184  template <typename T, precision P, template <typename, precision> class quatType>
186  quatType<T, P> const & x,
187  quatType<T, P> const & y);
188 
199  template <typename T, precision P>
201  detail::tquat<T, P> const & x,
202  detail::tquat<T, P> const & y,
203  T const & a);
204 
213  template <typename T, precision P>
215  detail::tquat<T, P> const & x,
216  detail::tquat<T, P> const & y,
217  T const & a);
218 
227  template <typename T, precision P>
229  detail::tquat<T, P> const & x,
230  detail::tquat<T, P> const & y,
231  T const & a);
232 
236  template <typename T, precision P>
238  detail::tquat<T, P> const & q);
239 
243  template <typename T, precision P>
245  detail::tquat<T, P> const & q);
246 
254  template <typename T, precision P>
256  detail::tquat<T, P> const & q,
257  T const & angle,
258  detail::tvec3<T, P> const & axis);
259 
264  template <typename T, precision P>
266  detail::tquat<T, P> const & x);
267 
271  template <typename T, precision P>
273 
277  template <typename T, precision P>
279 
283  template <typename T, precision P>
285 
289  template <typename T, precision P>
291  detail::tquat<T, P> const & x);
292 
296  template <typename T, precision P>
298  detail::tquat<T, P> const & x);
299 
303  template <typename T, precision P>
305  detail::tmat3x3<T, P> const & x);
306 
310  template <typename T, precision P>
312  detail::tmat4x4<T, P> const & x);
313 
317  template <typename T, precision P>
319 
323  template <typename T, precision P>
325  detail::tquat<T, P> const & x);
326 
333  template <typename T, precision P>
335  T const & angle,
336  detail::tvec3<T, P> const & axis);
337 
343  template <typename T, precision P>
345  detail::tquat<T, P> const & x,
346  detail::tquat<T, P> const & y);
347 
353  template <typename T, precision P>
355  detail::tquat<T, P> const & x,
356  detail::tquat<T, P> const & y);
357 
363  template <typename T, precision P>
365  detail::tquat<T, P> const & x,
366  detail::tquat<T, P> const & y);
367 
373  template <typename T, precision P>
375  detail::tquat<T, P> const & x,
376  detail::tquat<T, P> const & y);
377 
383  template <typename T, precision P>
385  detail::tquat<T, P> const & x,
386  detail::tquat<T, P> const & y);
387 
393  template <typename T, precision P>
395  detail::tquat<T, P> const & x,
396  detail::tquat<T, P> const & y);
397 
399 } //namespace glm
400 
401 #include "quaternion.inl"
GLM_FUNC_DECL T roll(detail::tquat< T, P > const &x)
GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const
GLM_FUNC_DECL tquat< T, P > & operator/=(T const &s)
tvec4< bool, P > bool_type
int length_t
Definition: setup.hpp:755
T
GLM_FUNC_DECL detail::tvec3< T, P > axis(detail::tquat< T, P > const &x)
GLM_FUNC_DECL detail::tquat< T, P > lerp(detail::tquat< T, P > const &x, detail::tquat< T, P > const &y, T const &a)
GLM_FUNC_DECL detail::tquat< T, P > conjugate(detail::tquat< T, P > const &q)
GLM_FUNC_DECL tquat< T, P > & operator+=(tquat< T, P > const &q)
GLM_FUNC_DECL T angle(detail::tquat< T, P > const &x)
GLM_FUNC_DECL T pitch(detail::tquat< T, P > const &x)
GLM_FUNC_DECL vecType< T, P > mix(vecType< T, P > const &x, vecType< T, P > const &y, vecType< U, P > const &a)
GLM_FUNC_DECL tmat2x2< T, P > operator*(tmat2x2< T, P > const &m, T const &s)
GLM_FUNC_DECL detail::tquat< T, P > angleAxis(T const &angle, detail::tvec3< T, P > const &axis)
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 vecType< T, P >::bool_type notEqual(vecType< T, P > const &x, vecType< T, P > const &y)
GLM_FUNC_DECL vecType< T, P >::bool_type greaterThanEqual(vecType< T, P > const &x, vecType< T, P > const &y)
GLM_FUNC_DECL detail::tquat< T, P > slerp(detail::tquat< T, P > const &x, detail::tquat< T, P > const &y, T const &a)
Returns the slurp interpolation between two quaternions.
GLM_FUNC_DECL tmat2x2< T, P > operator-(tmat2x2< T, P > const &m, T const &s)
GLM_FUNC_DECL detail::tvec3< T, P > eulerAngles(detail::tquat< T, P > const &x)
GLM_FUNC_DECL vecType< T, P >::bool_type lessThanEqual(vecType< T, P > const &x, vecType< T, P > const &y)
GLM_FUNC_DECL detail::tquat< T, P > quat_cast(detail::tmat3x3< T, P > const &x)
GLM_FUNC_DECL detail::tvec4< bool, P > equal(detail::tquat< T, P > const &x, detail::tquat< T, P > const &y)
GLM_FUNC_DECL detail::tmat4x4< T, P > mat4_cast(detail::tquat< T, P > const &x)
GLM_FUNC_DECL detail::tvec4< bool, P > lessThan(detail::tquat< T, P > const &x, detail::tquat< T, P > const &y)
GLM_FUNC_DECL tquat()
GLM_FUNC_DECL T & operator[](length_t i)
GLM_FUNC_DECL T dot(vecType< T, P > const &x, vecType< T, P > const &y)
GLM_FUNC_DECL detail::tmat3x3< T, P > mat3_cast(detail::tquat< T, P > const &x)
GLM_FUNC_DECL T yaw(detail::tquat< T, P > const &x)
GLM_FUNC_DECL vecType< T, P >::bool_type greaterThan(vecType< T, P > const &x, vecType< T, P > const &y)
#define GLM_CONSTEXPR
Definition: setup.hpp:801
#define GLM_FUNC_DECL
Definition: setup.hpp:728
GLM_FUNC_DECL tquat< T, P > & operator*=(tquat< T, P > const &q)
GLM_FUNC_DECL detail::tmat4x4< T, P > rotate(detail::tmat4x4< T, P > const &m, T const &angle, detail::tvec3< T, P > const &axis)
GLM_FUNC_DECL matType< T, P > inverse(matType< T, P > const &m)


rtabmap
Author(s): Mathieu Labbe
autogenerated on Mon Jan 23 2023 03:37:29