8 #if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
9 # if GLM_HAS_UNRESTRICTED_UNIONS
19 template<
typename T, qualifier P>
26 typedef vec<1, bool, P> bool_type;
30 # if GLM_HAS_ONLY_XYZW
33 # elif GLM_HAS_ALIGNED_TYPE
34 # if GLM_COMPILER & GLM_COMPILER_GCC
35 # pragma GCC diagnostic push
36 # pragma GCC diagnostic ignored "-Wpedantic"
38 # if GLM_COMPILER & GLM_COMPILER_CLANG
39 # pragma clang diagnostic push
40 # pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
41 # pragma clang diagnostic ignored "-Wnested-anon-types"
63 # if GLM_COMPILER & GLM_COMPILER_CLANG
64 # pragma clang diagnostic pop
66 # if GLM_COMPILER & GLM_COMPILER_GCC
67 # pragma GCC diagnostic pop
80 typedef length_t length_type;
81 GLM_FUNC_DECL
static GLM_CONSTEXPR length_type
length(){
return 1;}
83 GLM_FUNC_DECL T & operator[](length_type i);
84 GLM_FUNC_DECL T
const & operator[](length_type i)
const;
88 GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec() GLM_DEFAULT;
89 GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec const& v) GLM_DEFAULT;
91 GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, T, Q> const& v);
95 GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit vec(T scalar);
100 template<typename U, qualifier Q>
101 GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT vec(vec<2, U, Q> const& v);
103 template<typename U, qualifier Q>
104 GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT vec(vec<3, U, Q> const& v);
106 template<typename U, qualifier Q>
107 GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT vec(vec<4, U, Q> const& v);
110 template<typename U, qualifier Q>
111 GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT vec(vec<1, U, Q> const& v);
125 GLM_FUNC_DECL vec & operator=(vec const & v) GLM_DEFAULT;
128 GLM_FUNC_DECL vec & operator=(vec<1, U, P> const& v);
130 GLM_FUNC_DECL vec & operator+=(U scalar);
132 GLM_FUNC_DECL vec & operator+=(vec<1, U, P> const& v);
134 GLM_FUNC_DECL vec & operator-=(U scalar);
136 GLM_FUNC_DECL vec & operator-=(vec<1, U, P> const& v);
138 GLM_FUNC_DECL vec & operator*=(U scalar);
140 GLM_FUNC_DECL vec & operator*=(vec<1, U, P> const& v);
142 GLM_FUNC_DECL vec & operator/=(U scalar);
144 GLM_FUNC_DECL vec & operator/=(vec<1, U, P> const& v);
148 GLM_FUNC_DECL vec & operator++();
149 GLM_FUNC_DECL vec & operator--();
150 GLM_FUNC_DECL vec operator++(
int);
151 GLM_FUNC_DECL vec operator--(
int);
156 GLM_FUNC_DECL vec & operator%=(U scalar);
158 GLM_FUNC_DECL vec & operator%=(vec<1, U, P> const& v);
160 GLM_FUNC_DECL vec & operator&=(U scalar);
162 GLM_FUNC_DECL vec & operator&=(vec<1, U, P> const& v);
164 GLM_FUNC_DECL vec & operator|=(U scalar);
166 GLM_FUNC_DECL vec & operator|=(vec<1, U, P> const& v);
168 GLM_FUNC_DECL vec & operator^=(U scalar);
170 GLM_FUNC_DECL vec & operator^=(vec<1, U, P> const& v);
172 GLM_FUNC_DECL vec & operator<<=(U scalar);
174 GLM_FUNC_DECL vec & operator<<=(vec<1, U, P> const& v);
176 GLM_FUNC_DECL vec & operator>>=(U scalar);
178 GLM_FUNC_DECL vec & operator>>=(vec<1, U, P> const& v);
183 template<typename T, qualifier P>
184 GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const& v);
186 template<typename T, qualifier P>
187 GLM_FUNC_DECL vec<1, T, P> operator-(vec<1, T, P> const& v);
191 template<typename T, qualifier P>
192 GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const& v, T scalar);
194 template<typename T, qualifier P>
195 GLM_FUNC_DECL vec<1, T, P> operator+(T scalar, vec<1, T, P> const& v);
197 template<typename T, qualifier P>
198 GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const& v1, vec<1, T, P> const& v2);
200 template<typename T, qualifier P>
201 GLM_FUNC_DECL vec<1, T, P> operator-(vec<1, T, P> const & v, T scalar);
203 template<typename T, qualifier P>
204 GLM_FUNC_DECL vec<1, T, P> operator-(T scalar, vec<1, T, P> const& v);
206 template<typename T, qualifier P>
207 GLM_FUNC_DECL vec<1, T, P> operator-(vec<1, T, P> const& v1, vec<1, T, P> const & v2);
209 template<typename T, qualifier P>
210 GLM_FUNC_DECL vec<1, T, P> operator*(vec<1, T, P> const & v, T scalar);
212 template<typename T, qualifier P>
213 GLM_FUNC_DECL vec<1, T, P> operator*(T scalar, vec<1, T, P> const & v);
215 template<typename T, qualifier P>
216 GLM_FUNC_DECL vec<1, T, P> operator*(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
218 template<typename T, qualifier P>
219 GLM_FUNC_DECL vec<1, T, P> operator/(vec<1, T, P> const & v, T scalar);
221 template<typename T, qualifier P>
222 GLM_FUNC_DECL vec<1, T, P> operator/(T scalar, vec<1, T, P> const & v);
224 template<typename T, qualifier P>
225 GLM_FUNC_DECL vec<1, T, P> operator/(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
227 template<typename T, qualifier P>
228 GLM_FUNC_DECL vec<1, T, P> operator%(vec<1, T, P> const & v, T scalar);
230 template<typename T, qualifier P>
231 GLM_FUNC_DECL vec<1, T, P> operator%(T scalar, vec<1, T, P> const & v);
233 template<typename T, qualifier P>
234 GLM_FUNC_DECL vec<1, T, P> operator%(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
236 template<typename T, qualifier P>
237 GLM_FUNC_DECL vec<1, T, P> operator&(vec<1, T, P> const & v, T scalar);
239 template<typename T, qualifier P>
240 GLM_FUNC_DECL vec<1, T, P> operator&(T scalar, vec<1, T, P> const & v);
242 template<typename T, qualifier P>
243 GLM_FUNC_DECL vec<1, T, P> operator&(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
245 template<typename T, qualifier P>
246 GLM_FUNC_DECL vec<1, T, P> operator|(vec<1, T, P> const & v, T scalar);
248 template<typename T, qualifier P>
249 GLM_FUNC_DECL vec<1, T, P> operator|(T scalar, vec<1, T, P> const & v);
251 template<typename T, qualifier P>
252 GLM_FUNC_DECL vec<1, T, P> operator|(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
254 template<typename T, qualifier P>
255 GLM_FUNC_DECL vec<1, T, P> operator^(vec<1, T, P> const & v, T scalar);
257 template<typename T, qualifier P>
258 GLM_FUNC_DECL vec<1, T, P> operator^(T scalar, vec<1, T, P> const & v);
260 template<typename T, qualifier P>
261 GLM_FUNC_DECL vec<1, T, P> operator^(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
263 template<typename T, qualifier P>
264 GLM_FUNC_DECL vec<1, T, P> operator<<(vec<1, T, P> const & v, T scalar);
266 template<typename T, qualifier P>
267 GLM_FUNC_DECL vec<1, T, P> operator<<(T scalar, vec<1, T, P> const & v);
269 template<typename T, qualifier P>
270 GLM_FUNC_DECL vec<1, T, P> operator<<(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
272 template<typename T, qualifier P>
273 GLM_FUNC_DECL vec<1, T, P> operator>>(vec<1, T, P> const & v, T scalar);
275 template<typename T, qualifier P>
276 GLM_FUNC_DECL vec<1, T, P> operator>>(T scalar, vec<1, T, P> const & v);
278 template<typename T, qualifier P>
279 GLM_FUNC_DECL vec<1, T, P> operator>>(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
281 template<typename T, qualifier P>
282 GLM_FUNC_DECL vec<1, T, P> operator~(vec<1, T, P> const & v);
286 template<typename T, qualifier P>
287 GLM_FUNC_DECL
bool operator==(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
289 template<typename T, qualifier P>
290 GLM_FUNC_DECL
bool operator!=(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
292 template<qualifier P>
293 GLM_FUNC_DECL vec<1,
bool, P> operator&&(vec<1,
bool, P> const & v1, vec<1,
bool, P> const & v2);
295 template<qualifier P>
296 GLM_FUNC_DECL vec<1,
bool, P> operator||(vec<1,
bool, P> const & v1, vec<1,
bool, P> const & v2);
299 #ifndef GLM_EXTERNAL_TEMPLATE
300 #include "type_vec1.inl"
301 #endif//GLM_EXTERNAL_TEMPLATE
GLM_FUNC_DECL T length(vec< L, T, P > const &x)
Returns the length of x, i.e., sqrt(x * x).