type_vec3.hpp
Go to the documentation of this file.
1 
29 #pragma once
30 
31 //#include "../fwd.hpp"
32 #include "type_vec.hpp"
33 #ifdef GLM_SWIZZLE
34 # if GLM_HAS_ANONYMOUS_UNION
35 # include "_swizzle.hpp"
36 # else
37 # include "_swizzle_func.hpp"
38 # endif
39 #endif //GLM_SWIZZLE
40 #include <cstddef>
41 
42 namespace glm{
43 namespace detail
44 {
45  template <typename T, precision P>
46  struct tvec3
47  {
49  // Implementation detail
50 
51  enum ctor{_null};
52 
53  typedef tvec3<T, P> type;
55  typedef T value_type;
56  typedef int size_type;
57 
59  // Helper
60 
62 
64  // Data
65 
66 # if(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
67  union
68  {
69  struct{ T x, y, z; };
70  struct{ T r, g, b; };
71  struct{ T s, t, p; };
72 
75  _GLM_SWIZZLE3_2_MEMBERS(T, P, tvec2, s, t, p)
77  _GLM_SWIZZLE3_3_MEMBERS(T, P, tvec3, r, g, b)
78  _GLM_SWIZZLE3_3_MEMBERS(T, P, tvec3, s, t, p)
79  _GLM_SWIZZLE3_4_MEMBERS(T, P, tvec4, x, y, z)
80  _GLM_SWIZZLE3_4_MEMBERS(T, P, tvec4, r, g, b)
81  _GLM_SWIZZLE3_4_MEMBERS(T, P, tvec4, s, t, p)
82  };
83 # else
84  union { T x, r, s; };
85  union { T y, g, t; };
86  union { T z, b, p; };
87 
88 # ifdef GLM_SWIZZLE
90 # endif
91 # endif//GLM_LANG
92 
94  // Accesses
95 
97  GLM_FUNC_DECL T const & operator[](length_t i) const;
98 
100  // Implicit basic constructors
101 
103  GLM_FUNC_DECL tvec3(tvec3<T, P> const & v);
104  template <precision Q>
105  GLM_FUNC_DECL tvec3(tvec3<T, Q> const & v);
106 
108  // Swizzle constructors
109 
110 # if(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
111  template <int E0, int E1, int E2>
112  GLM_FUNC_DECL tvec3(_swizzle<3, T, P, tvec3<T, P>, E0, E1, E2, -1> const & that)
113  {
114  *this = that();
115  }
116 
117  template <int E0, int E1>
118  GLM_FUNC_DECL tvec3(_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v, T const & s)
119  {
120  *this = tvec3<T, P>(v(), s);
121  }
122 
123  template <int E0, int E1>
124  GLM_FUNC_DECL tvec3(T const & s, _swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v)
125  {
126  *this = tvec3<T, P>(s, v());
127  }
128 # endif//(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
129 
131  // Explicit basic constructors
132 
133  GLM_FUNC_DECL explicit tvec3(ctor);
134  GLM_FUNC_DECL explicit tvec3(T const & s);
135  GLM_FUNC_DECL tvec3(T const & s1, T const & s2, T const & s3);
136 
138  // Conversion scalar constructors
139 
141  template <typename U, typename V, typename W>
143  U const & x,
144  V const & y,
145  W const & z);
146 
148  // Conversion vector constructors
149 
151  template <typename A, typename B, precision Q>
152  GLM_FUNC_DECL explicit tvec3(tvec2<A, Q> const & v, B const & s);
154  template <typename A, typename B, precision Q>
155  GLM_FUNC_DECL explicit tvec3(A const & s, tvec2<B, Q> const & v);
157  template <typename U, precision Q>
158  GLM_FUNC_DECL explicit tvec3(tvec3<U, Q> const & v);
160  template <typename U, precision Q>
161  GLM_FUNC_DECL explicit tvec3(tvec4<U, Q> const & v);
162 
164  // Unary arithmetic operators
165 
167 
168  template <typename U>
170  template <typename U>
172  template <typename U>
174  template <typename U>
176  template <typename U>
178  template <typename U>
180  template <typename U>
182  template <typename U>
184  template <typename U>
186 
188  // Increment and decrement operators
189 
194 
196  // Unary bit operators
197 
198  template <typename U>
200  template <typename U>
202  template <typename U>
204  template <typename U>
206  template <typename U>
208  template <typename U>
210  template <typename U>
212  template <typename U>
214  template <typename U>
216  template <typename U>
217  GLM_FUNC_DECL tvec3<T, P> & operator<<=(tvec3<U, P> const & v);
218  template <typename U>
220  template <typename U>
222  };
223 
224  template <typename T, precision P>
225  GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> const & v, T const & s);
226 
227  template <typename T, precision P>
228  GLM_FUNC_DECL tvec3<T, P> operator+(T const & s, tvec3<T, P> const & v);
229 
230  template <typename T, precision P>
232 
233  template <typename T, precision P>
234  GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> const & v, T const & s);
235 
236  template <typename T, precision P>
237  GLM_FUNC_DECL tvec3<T, P> operator-(T const & s, tvec3<T, P> const & v);
238 
239  template <typename T, precision P>
241 
242  template <typename T, precision P>
243  GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> const & v, T const & s);
244 
245  template <typename T, precision P>
246  GLM_FUNC_DECL tvec3<T, P> operator*(T const & s, tvec3<T, P> const & v);
247 
248  template <typename T, precision P>
250 
251  template <typename T, precision P>
252  GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P> const & v, T const & s);
253 
254  template <typename T, precision P>
255  GLM_FUNC_DECL tvec3<T, P> operator/(T const & s, tvec3<T, P> const & v);
256 
257  template <typename T, precision P>
259 
260  template <typename T, precision P>
262 
263  template <typename T, precision P>
264  GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P> const & v, T const & s);
265 
266  template <typename T, precision P>
267  GLM_FUNC_DECL tvec3<T, P> operator%(T const & s, tvec3<T, P> const & v);
268 
269  template <typename T, precision P>
271 
272  template <typename T, precision P>
273  GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P> const & v, T const & s);
274 
275  template <typename T, precision P>
276  GLM_FUNC_DECL tvec3<T, P> operator&(T const & s, tvec3<T, P> const & v);
277 
278  template <typename T, precision P>
280 
281  template <typename T, precision P>
282  GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P> const & v, T const & s);
283 
284  template <typename T, precision P>
285  GLM_FUNC_DECL tvec3<T, P> operator|(T const & s, tvec3<T, P> const & v);
286 
287  template <typename T, precision P>
289 
290  template <typename T, precision P>
291  GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P> const & v, T const & s);
292 
293  template <typename T, precision P>
294  GLM_FUNC_DECL tvec3<T, P> operator^(T const & s, tvec3<T, P> const & v);
295 
296  template <typename T, precision P>
298 
299  template <typename T, precision P>
300  GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P> const & v, T const & s);
301 
302  template <typename T, precision P>
303  GLM_FUNC_DECL tvec3<T, P> operator<<(T const & s, tvec3<T, P> const & v);
304 
305  template <typename T, precision P>
306  GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
307 
308  template <typename T, precision P>
309  GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P> const & v, T const & s);
310 
311  template <typename T, precision P>
312  GLM_FUNC_DECL tvec3<T, P> operator>>(T const & s, tvec3<T, P> const & v);
313 
314  template <typename T, precision P>
316 
317  template <typename T, precision P>
319 
320 }//namespace detail
321 }//namespace glm
322 
323 #ifndef GLM_EXTERNAL_TEMPLATE
324 #include "type_vec3.inl"
325 #endif//GLM_EXTERNAL_TEMPLATE
GLM_FUNC_DECL tvec1< T, P > operator^(tvec1< T, P > const &v, T const &s)
GLM_FUNC_DECL tvec1< T, P > operator&(tvec1< T, P > const &v, T const &s)
tvec3< T, P > type
Definition: type_vec3.hpp:53
int length_t
Definition: setup.hpp:755
GLM_FUNC_DECL tvec3< T, P > & operator^=(U s)
#define GLM_SWIZZLE_GEN_VEC_FROM_VEC3(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE)
GLM_FUNC_DECL tvec3< T, P > & operator%=(U s)
GLM_FUNC_DECL tvec1< T, P > operator|(tvec1< T, P > const &v, T const &s)
GLM_FUNC_DECL tvec3< T, P > & operator&=(U s)
GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const
GLM_FUNC_DECL tvec3< T, P > & operator>>=(U s)
GLM_FUNC_DECL tvec1< T, P > operator~(tvec1< T, P > const &v)
GLM_FUNC_DECL tmat2x2< T, P > operator*(tmat2x2< T, P > const &m, T const &s)
#define _GLM_SWIZZLE3_4_MEMBERS(T, P, V, E0, E1, E2)
Definition: _swizzle.hpp:414
GLM_FUNC_DECL tvec3< T, P > & operator|=(U 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 tvec3< T, P > & operator++()
GLM_FUNC_DECL tvec3< T, P > & operator--()
GLM_FUNC_DECL tvec3< T, P > & operator*=(U s)
GLM_FUNC_DECL tmat2x2< T, P > operator-(tmat2x2< T, P > const &m, T const &s)
GLM_FUNC_DECL T & operator[](length_t i)
GLM_FUNC_DECL tvec1< T, P > operator%(tvec1< T, P > const &v, T const &s)
GLM_FUNC_DECL tvec3< T, P > & operator=(tvec3< T, P > const &v)
GLM_FUNC_DECL tvec3< T, P > & operator+=(U s)
GLM_FUNC_DECL tvec3< T, P > & operator-=(U s)
#define _GLM_SWIZZLE3_2_MEMBERS(T, P, V, E0, E1, E2)
Definition: _swizzle.hpp:374
GLM_FUNC_DECL tvec3()
#define _GLM_SWIZZLE3_3_MEMBERS(T, P, V,E0, E1, E2)
Definition: _swizzle.hpp:385
GLM_FUNC_DECL tvec3< T, P > & operator/=(U s)
GLM_FUNC_DECL tvec1< T, P > operator>>(tvec1< T, P > const &v, T const &s)
#define GLM_CONSTEXPR
Definition: setup.hpp:801
tvec3< bool, P > bool_type
Definition: type_vec3.hpp:54
#define GLM_FUNC_DECL
Definition: setup.hpp:728
GLM_FUNC_DECL tvec3< T, P > & operator<<=(U s)


rtabmap
Author(s): Mathieu Labbe
autogenerated on Wed Jun 5 2019 22:43:40