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>
133 GLM_FUNC_DECL
explicit tvec3(
136 template <
typename U,
typename V,
typename W>
137 GLM_FUNC_DECL
explicit tvec3(
146 template <
typename A,
typename B, precision Q>
147 GLM_FUNC_DECL
explicit tvec3(tvec2<A, Q>
const & v, B
const & s);
149 template <
typename A,
typename B, precision Q>
150 GLM_FUNC_DECL
explicit tvec3(A
const & s, tvec2<B, Q>
const & v);
152 template <
typename U, precision Q>
153 GLM_FUNC_DECL
explicit tvec3(tvec3<U, Q>
const & v);
155 template <
typename U, precision Q>
156 GLM_FUNC_DECL
explicit tvec3(tvec4<U, Q>
const & v);
161 # if(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
162 template <
int E0,
int E1,
int E2>
163 GLM_FUNC_DECL tvec3(_swizzle<3, T, P, tvec3<T, P>, E0, E1, E2, -1>
const & that)
168 template <
int E0,
int E1>
169 GLM_FUNC_DECL tvec3(_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2>
const & v, T
const & s)
171 *
this = tvec3<T, P>(v(), s);
174 template <
int E0,
int E1>
175 GLM_FUNC_DECL tvec3(T
const & s, _swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2>
const & v)
177 *
this = tvec3<T, P>(s, v());
179 # endif//(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
184 GLM_FUNC_DECL tvec3<T, P> & operator= (tvec3<T, P>
const & v);
185 template <
typename U>
186 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);
200 template <
typename U>
201 GLM_FUNC_DECL tvec3<T, P> & operator/=(U s);
202 template <
typename U>
203 GLM_FUNC_DECL tvec3<T, P> & operator/=(tvec3<U, P>
const & v);
208 GLM_FUNC_DECL tvec3<T, P> & operator++();
209 GLM_FUNC_DECL tvec3<T, P> & operator--();
210 GLM_FUNC_DECL tvec3<T, P> operator++(
int);
211 GLM_FUNC_DECL tvec3<T, P> operator--(
int);
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);
236 template <
typename U>
237 GLM_FUNC_DECL tvec3<T, P> & operator>>=(U s);
238 template <
typename U>
239 GLM_FUNC_DECL tvec3<T, P> & operator>>=(tvec3<U, P>
const & v);
242 GLM_DETAIL_IS_VECTOR(tvec3);
244 template <
typename T, precision P>
245 GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P>
const & v, T
const & s);
247 template <
typename T, precision P>
248 GLM_FUNC_DECL tvec3<T, P> operator+(T
const & s, tvec3<T, P>
const & v);
250 template <
typename T, precision P>
251 GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P>
const & v1, tvec3<T, P>
const & v2);
253 template <
typename T, precision P>
254 GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P>
const & v, T
const & s);
256 template <
typename T, precision P>
257 GLM_FUNC_DECL tvec3<T, P> operator-(T
const & s, tvec3<T, P>
const & v);
259 template <
typename T, precision P>
260 GLM_FUNC_DECL tvec3<T, P> operator- (tvec3<T, P>
const & v1, tvec3<T, P>
const & v2);
262 template <
typename T, precision P>
263 GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P>
const & v, T
const & s);
265 template <
typename T, precision P>
266 GLM_FUNC_DECL tvec3<T, P> operator*(T
const & s, tvec3<T, P>
const & v);
268 template <
typename T, precision P>
269 GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P>
const & v1, tvec3<T, P>
const & v2);
271 template <
typename T, precision P>
272 GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P>
const & v, T
const & s);
274 template <
typename T, precision P>
275 GLM_FUNC_DECL tvec3<T, P> operator/(T
const & s, tvec3<T, P>
const & v);
277 template <
typename T, precision P>
278 GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P>
const & v1, tvec3<T, P>
const & v2);
280 template <
typename T, precision P>
281 GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P>
const & v);
283 template <
typename T, precision P>
284 GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P>
const & v, T
const & s);
286 template <
typename T, precision P>
287 GLM_FUNC_DECL tvec3<T, P> operator%(T
const & s, tvec3<T, P>
const & v);
289 template <
typename T, precision P>
290 GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P>
const & v1, tvec3<T, P>
const & v2);
292 template <
typename T, precision P>
293 GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P>
const & v, T
const & s);
295 template <
typename T, precision P>
296 GLM_FUNC_DECL tvec3<T, P> operator&(T
const & s, tvec3<T, P>
const & v);
298 template <
typename T, precision P>
299 GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P>
const & v1, tvec3<T, P>
const & v2);
301 template <
typename T, precision P>
302 GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P>
const & v, T
const & s);
304 template <
typename T, precision P>
305 GLM_FUNC_DECL tvec3<T, P> operator|(T
const & s, tvec3<T, P>
const & v);
307 template <
typename T, precision P>
308 GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P>
const & v1, tvec3<T, P>
const & v2);
310 template <
typename T, precision P>
311 GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P>
const & v, T
const & s);
313 template <
typename T, precision P>
314 GLM_FUNC_DECL tvec3<T, P> operator^(T
const & s, tvec3<T, P>
const & v);
316 template <
typename T, precision P>
317 GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P>
const & v1, tvec3<T, P>
const & v2);
319 template <
typename T, precision P>
320 GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P>
const & v, T
const & s);
322 template <
typename T, precision P>
323 GLM_FUNC_DECL tvec3<T, P> operator<<(T const & s, tvec3<T, P>
const & v);
325 template <
typename T, precision P>
326 GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P>
const & v1, tvec3<T, P>
const & v2);
328 template <
typename T, precision P>
329 GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P>
const & v, T
const & s);
331 template <
typename T, precision P>
332 GLM_FUNC_DECL tvec3<T, P> operator>>(T
const & s, tvec3<T, P>
const & v);
334 template <
typename T, precision P>
335 GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P>
const & v1, tvec3<T, P>
const & v2);
337 template <
typename T, precision P>
338 GLM_FUNC_DECL tvec3<T, P> operator~(tvec3<T, P>
const & v);
343 #ifndef GLM_EXTERNAL_TEMPLATE
344 #include "type_vec3.inl"
345 #endif//GLM_EXTERNAL_TEMPLATE
347 #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).