29 #ifndef glm_core_type_gentype3
30 #define glm_core_type_gentype3
33 #include "type_vec.hpp"
35 # if GLM_HAS_ANONYMOUS_UNION
36 # include "_swizzle.hpp"
38 # include "_swizzle_func.hpp"
41 #if(GLM_HAS_INITIALIZER_LISTS)
42 # include <initializer_list>
43 #endif //GLM_HAS_INITIALIZER_LISTS
49 template <
typename T, precision P>
57 typedef tvec3<T, P> type;
58 typedef tvec3<bool, P> bool_type;
60 typedef int size_type;
65 GLM_FUNC_DECL GLM_CONSTEXPR length_t
length()
const;
70 # if(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
77 _GLM_SWIZZLE3_2_MEMBERS(T, P, tvec2, x, y, z)
78 _GLM_SWIZZLE3_2_MEMBERS(T, P, tvec2, r, g, b)
79 _GLM_SWIZZLE3_2_MEMBERS(T, P, tvec2, s, t, p)
80 _GLM_SWIZZLE3_3_MEMBERS(T, P, tvec3, x, y, z)
81 _GLM_SWIZZLE3_3_MEMBERS(T, P, tvec3, r, g, b)
82 _GLM_SWIZZLE3_3_MEMBERS(T, P, tvec3, s, t, p)
83 _GLM_SWIZZLE3_4_MEMBERS(T, P, tvec4, x, y, z)
84 _GLM_SWIZZLE3_4_MEMBERS(T, P, tvec4, r, g, b)
85 _GLM_SWIZZLE3_4_MEMBERS(T, P, tvec4, s, t, p)
93 GLM_SWIZZLE_GEN_VEC_FROM_VEC3(T, P, detail::tvec3, detail::tvec2, detail::tvec3, detail::tvec4)
100 GLM_FUNC_DECL T & operator[](length_t i);
101 GLM_FUNC_DECL T
const & operator[](length_t i)
const;
106 GLM_FUNC_DECL tvec3();
107 GLM_FUNC_DECL tvec3(tvec3<T, P>
const & v);
108 template <precision Q>
109 GLM_FUNC_DECL tvec3(tvec3<T, Q>
const & v);
111 #if(GLM_HAS_INITIALIZER_LISTS)
112 template <
typename U>
113 GLM_FUNC_DECL tvec3(std::initializer_list<U>
const & v);
114 #endif//GLM_HAS_INITIALIZER_LISTS
119 GLM_FUNC_DECL
explicit tvec3(
121 GLM_FUNC_DECL
explicit tvec3(
123 GLM_FUNC_DECL
explicit tvec3(
132 template <
typename U,
typename V,
typename W>
133 GLM_FUNC_DECL
explicit tvec3(
142 template <
typename A,
typename B, precision Q>
143 GLM_FUNC_DECL
explicit tvec3(tvec2<A, Q>
const & v, B
const & s);
145 template <
typename A,
typename B, precision Q>
146 GLM_FUNC_DECL
explicit tvec3(A
const & s, tvec2<B, Q>
const & v);
148 template <
typename U, precision Q>
149 GLM_FUNC_DECL
explicit tvec3(tvec3<U, Q>
const & v);
151 template <
typename U, precision Q>
152 GLM_FUNC_DECL
explicit tvec3(tvec4<U, Q>
const & v);
157 # if(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
158 template <
int E0,
int E1,
int E2>
159 GLM_FUNC_DECL tvec3(_swizzle<3, T, P, tvec3<T, P>, E0, E1, E2, -1>
const & that)
164 template <
int E0,
int E1>
165 GLM_FUNC_DECL tvec3(_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2>
const & v, T
const & s)
167 *
this = tvec3<T, P>(v(), s);
170 template <
int E0,
int E1>
171 GLM_FUNC_DECL tvec3(T
const & s, _swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2>
const & v)
173 *
this = tvec3<T, P>(s, v());
175 # endif//(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
180 GLM_FUNC_DECL tvec3<T, P> & operator= (tvec3<T, P>
const & v);
181 template <
typename U>
182 GLM_FUNC_DECL tvec3<T, P> & operator= (tvec3<U, P>
const & v);
184 template <
typename U>
185 GLM_FUNC_DECL tvec3<T, P> & operator+=(U s);
186 template <
typename U>
187 GLM_FUNC_DECL tvec3<T, P> & operator+=(tvec3<U, P>
const & v);
188 template <
typename U>
189 GLM_FUNC_DECL tvec3<T, P> & operator-=(U s);
190 template <
typename U>
191 GLM_FUNC_DECL tvec3<T, P> & operator-=(tvec3<U, P>
const & v);
192 template <
typename U>
193 GLM_FUNC_DECL tvec3<T, P> & operator*=(U s);
194 template <
typename U>
195 GLM_FUNC_DECL tvec3<T, P> & operator*=(tvec3<U, P>
const & v);
196 template <
typename U>
197 GLM_FUNC_DECL tvec3<T, P> & operator/=(U s);
198 template <
typename U>
199 GLM_FUNC_DECL tvec3<T, P> & operator/=(tvec3<U, P>
const & v);
204 GLM_FUNC_DECL tvec3<T, P> & operator++();
205 GLM_FUNC_DECL tvec3<T, P> & operator--();
206 GLM_FUNC_DECL tvec3<T, P> operator++(
int);
207 GLM_FUNC_DECL tvec3<T, P> operator--(
int);
212 template <
typename U>
213 GLM_FUNC_DECL tvec3<T, P> & operator%= (U s);
214 template <
typename U>
215 GLM_FUNC_DECL tvec3<T, P> & operator%= (tvec3<U, P>
const & v);
216 template <
typename U>
217 GLM_FUNC_DECL tvec3<T, P> & operator&= (U s);
218 template <
typename U>
219 GLM_FUNC_DECL tvec3<T, P> & operator&= (tvec3<U, P>
const & v);
220 template <
typename U>
221 GLM_FUNC_DECL tvec3<T, P> & operator|= (U s);
222 template <
typename U>
223 GLM_FUNC_DECL tvec3<T, P> & operator|= (tvec3<U, P>
const & v);
224 template <
typename U>
225 GLM_FUNC_DECL tvec3<T, P> & operator^= (U s);
226 template <
typename U>
227 GLM_FUNC_DECL tvec3<T, P> & operator^= (tvec3<U, P>
const & v);
228 template <
typename U>
229 GLM_FUNC_DECL tvec3<T, P> & operator<<=(U s);
230 template <
typename U>
231 GLM_FUNC_DECL tvec3<T, P> & operator<<=(tvec3<U, P>
const & v);
232 template <
typename U>
233 GLM_FUNC_DECL tvec3<T, P> & operator>>=(U s);
234 template <
typename U>
235 GLM_FUNC_DECL tvec3<T, P> & operator>>=(tvec3<U, P>
const & v);
238 template <
typename T, precision P>
239 GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P>
const & v, T
const & s);
241 template <
typename T, precision P>
242 GLM_FUNC_DECL tvec3<T, P> operator+(T
const & s, tvec3<T, P>
const & v);
244 template <
typename T, precision P>
245 GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P>
const & v1, tvec3<T, P>
const & v2);
247 template <
typename T, precision P>
248 GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P>
const & v, T
const & s);
250 template <
typename T, precision P>
251 GLM_FUNC_DECL tvec3<T, P> operator-(T
const & s, tvec3<T, P>
const & v);
253 template <
typename T, precision P>
254 GLM_FUNC_DECL tvec3<T, P> operator- (tvec3<T, P>
const & v1, tvec3<T, P>
const & v2);
256 template <
typename T, precision P>
257 GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P>
const & v, T
const & s);
259 template <
typename T, precision P>
260 GLM_FUNC_DECL tvec3<T, P> operator*(T
const & s, tvec3<T, P>
const & v);
262 template <
typename T, precision P>
263 GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P>
const & v1, tvec3<T, P>
const & v2);
265 template <
typename T, precision P>
266 GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P>
const & v, T
const & s);
268 template <
typename T, precision P>
269 GLM_FUNC_DECL tvec3<T, P> operator/(T
const & s, tvec3<T, P>
const & v);
271 template <
typename T, precision P>
272 GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P>
const & v1, tvec3<T, P>
const & v2);
274 template <
typename T, precision P>
275 GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P>
const & v);
277 template <
typename T, precision P>
278 GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P>
const & v, T
const & s);
280 template <
typename T, precision P>
281 GLM_FUNC_DECL tvec3<T, P> operator%(T
const & s, tvec3<T, P>
const & v);
283 template <
typename T, precision P>
284 GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P>
const & v1, tvec3<T, P>
const & v2);
286 template <
typename T, precision P>
287 GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P>
const & v, T
const & s);
289 template <
typename T, precision P>
290 GLM_FUNC_DECL tvec3<T, P> operator&(T
const & s, tvec3<T, P>
const & v);
292 template <
typename T, precision P>
293 GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P>
const & v1, tvec3<T, P>
const & v2);
295 template <
typename T, precision P>
296 GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P>
const & v, T
const & s);
298 template <
typename T, precision P>
299 GLM_FUNC_DECL tvec3<T, P> operator|(T
const & s, tvec3<T, P>
const & v);
301 template <
typename T, precision P>
302 GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P>
const & v1, tvec3<T, P>
const & v2);
304 template <
typename T, precision P>
305 GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P>
const & v, T
const & s);
307 template <
typename T, precision P>
308 GLM_FUNC_DECL tvec3<T, P> operator^(T
const & s, tvec3<T, P>
const & v);
310 template <
typename T, precision P>
311 GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P>
const & v1, tvec3<T, P>
const & v2);
313 template <
typename T, precision P>
314 GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P>
const & v, T
const & s);
316 template <
typename T, precision P>
317 GLM_FUNC_DECL tvec3<T, P> operator<<(T const & s, tvec3<T, P>
const & v);
319 template <
typename T, precision P>
320 GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P>
const & v1, tvec3<T, P>
const & v2);
322 template <
typename T, precision P>
323 GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P>
const & v, T
const & s);
325 template <
typename T, precision P>
326 GLM_FUNC_DECL tvec3<T, P> operator>>(T
const & s, tvec3<T, P>
const & v);
328 template <
typename T, precision P>
329 GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P>
const & v1, tvec3<T, P>
const & v2);
331 template <
typename T, precision P>
332 GLM_FUNC_DECL tvec3<T, P> operator~(tvec3<T, P>
const & v);
337 #ifndef GLM_EXTERNAL_TEMPLATE
338 #include "type_vec3.inl"
339 #endif//GLM_EXTERNAL_TEMPLATE
341 #endif//glm_core_type_gentype3
GLM_FUNC_DECL genType::value_type length(genType const &x)
Returns the length of x, i.e., sqrt(x * x).