6 #include "qualifier.hpp" 7 #if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR 8 # include "_swizzle.hpp" 9 #elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION 10 # include "_swizzle_func.hpp" 16 template<
typename T, qualifier Q>
22 typedef vec<1, T, Q> type;
23 typedef vec<1, bool, Q> bool_type;
27 # if GLM_CONFIG_XYZW_ONLY 29 # elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE 36 typename detail::storage<1, T, detail::is_aligned<Q>::value>::type data;
63 typedef length_t length_type;
64 GLM_FUNC_DECL
static GLM_CONSTEXPR length_type
length(){
return 1;}
66 GLM_FUNC_DECL GLM_CONSTEXPR T & operator[](length_type i);
67 GLM_FUNC_DECL GLM_CONSTEXPR T
const& operator[](length_type i)
const;
71 GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT;
72 GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const& v) GLM_DEFAULT;
74 GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, T, P> const& v);
78 GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(T scalar);
83 template<typename U, qualifier P>
84 GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<2, U, P> const& v);
86 template<typename U, qualifier P>
87 GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, P> const& v);
89 template<typename U, qualifier P>
90 GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, P> const& v);
93 template<typename U, qualifier P>
94 GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<1, U, P> const& v);
108 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator=(vec const& v) GLM_DEFAULT;
111 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator=(vec<1, U, Q> const& v);
113 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator+=(U scalar);
115 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator+=(vec<1, U, Q> const& v);
117 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator-=(U scalar);
119 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator-=(vec<1, U, Q> const& v);
121 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator*=(U scalar);
123 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator*=(vec<1, U, Q> const& v);
125 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator/=(U scalar);
127 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator/=(vec<1, U, Q> const& v);
131 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator++();
132 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator--();
133 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator++(
int);
134 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator--(
int);
139 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator%=(U scalar);
141 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator%=(vec<1, U, Q> const& v);
143 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator&=(U scalar);
145 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator&=(vec<1, U, Q> const& v);
147 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator|=(U scalar);
149 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator|=(vec<1, U, Q> const& v);
151 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator^=(U scalar);
153 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator^=(vec<1, U, Q> const& v);
155 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator<<=(U scalar);
157 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator<<=(vec<1, U, Q> const& v);
159 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator>>=(U scalar);
161 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator>>=(vec<1, U, Q> const& v);
166 template<typename T, qualifier Q>
167 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v);
169 template<typename T, qualifier Q>
170 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v);
174 template<typename T, qualifier Q>
175 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v, T scalar);
177 template<typename T, qualifier Q>
178 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(T scalar, vec<1, T, Q> const& v);
180 template<typename T, qualifier Q>
181 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
183 template<typename T, qualifier Q>
184 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v, T scalar);
186 template<typename T, qualifier Q>
187 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(T scalar, vec<1, T, Q> const& v);
189 template<typename T, qualifier Q>
190 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
192 template<typename T, qualifier Q>
193 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v, T scalar);
195 template<typename T, qualifier Q>
196 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator*(T scalar, vec<1, T, Q> const& v);
198 template<typename T, qualifier Q>
199 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
201 template<typename T, qualifier Q>
202 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator/(vec<1, T, Q> const& v, T scalar);
204 template<typename T, qualifier Q>
205 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator/(T scalar, vec<1, T, Q> const& v);
207 template<typename T, qualifier Q>
208 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator/(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
210 template<typename T, qualifier Q>
211 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator%(vec<1, T, Q> const& v, T scalar);
213 template<typename T, qualifier Q>
214 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator%(T scalar, vec<1, T, Q> const& v);
216 template<typename T, qualifier Q>
217 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator%(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
219 template<typename T, qualifier Q>
220 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v, T scalar);
222 template<typename T, qualifier Q>
223 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator&(T scalar, vec<1, T, Q> const& v);
225 template<typename T, qualifier Q>
226 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
228 template<typename T, qualifier Q>
229 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v, T scalar);
231 template<typename T, qualifier Q>
232 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator|(T scalar, vec<1, T, Q> const& v);
234 template<typename T, qualifier Q>
235 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
237 template<typename T, qualifier Q>
238 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v, T scalar);
240 template<typename T, qualifier Q>
241 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator^(T scalar, vec<1, T, Q> const& v);
243 template<typename T, qualifier Q>
244 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
246 template<typename T, qualifier Q>
247 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator<<(vec<1, T, Q> const& v, T scalar);
249 template<typename T, qualifier Q>
250 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator<<(T scalar, vec<1, T, Q> const& v);
252 template<typename T, qualifier Q>
253 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator<<(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
255 template<typename T, qualifier Q>
256 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator>>(vec<1, T, Q> const& v, T scalar);
258 template<typename T, qualifier Q>
259 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator>>(T scalar, vec<1, T, Q> const& v);
261 template<typename T, qualifier Q>
262 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator>>(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
264 template<typename T, qualifier Q>
265 GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator~(vec<1, T, Q> const& v);
269 template<typename T, qualifier Q>
270 GLM_FUNC_DECL GLM_CONSTEXPR
bool operator==(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
272 template<typename T, qualifier Q>
273 GLM_FUNC_DECL GLM_CONSTEXPR
bool operator!=(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
275 template<qualifier Q>
276 GLM_FUNC_DECL GLM_CONSTEXPR vec<1,
bool, Q> operator&&(vec<1,
bool, Q> const& v1, vec<1,
bool, Q> const& v2);
278 template<qualifier Q>
279 GLM_FUNC_DECL GLM_CONSTEXPR vec<1,
bool, Q> operator||(vec<1,
bool, Q> const& v1, vec<1,
bool, Q> const& v2);
282 #ifndef GLM_EXTERNAL_TEMPLATE 283 #include "type_vec1.inl" 284 #endif//GLM_EXTERNAL_TEMPLATE
GLM_FUNC_DECL T length(qua< T, Q > const &q)
Returns the norm of a quaternions.