38 # if GLM_HAS_ANONYMOUS_UNION
48 template <
typename T, precision P = defaultp>
53 typedef tvec1<T, P> type;
54 typedef tvec1<bool, P> bool_type;
57 # ifdef GLM_META_PROG_HELPERS
58 static GLM_RELAXED_CONSTEXPR length_t components = 1;
59 static GLM_RELAXED_CONSTEXPR precision prec = P;
60 # endif//GLM_META_PROG_HELPERS
64 # if GLM_HAS_ANONYMOUS_UNION
93 # ifdef GLM_FORCE_SIZE_FUNC
94 typedef size_t size_type;
96 GLM_FUNC_DECL GLM_CONSTEXPR size_type size()
const;
98 GLM_FUNC_DECL T & operator[](size_type i);
99 GLM_FUNC_DECL T
const & operator[](size_type i)
const;
101 typedef length_t length_type;
103 GLM_FUNC_DECL GLM_CONSTEXPR length_type
length()
const;
105 GLM_FUNC_DECL T & operator[](length_type i);
106 GLM_FUNC_DECL T
const & operator[](length_type i)
const;
107 # endif//GLM_FORCE_SIZE_FUNC
111 GLM_FUNC_DECL tvec1() GLM_DEFAULT_CTOR;
112 GLM_FUNC_DECL tvec1(tvec1<T, P> const & v) GLM_DEFAULT;
113 template <precision Q>
114 GLM_FUNC_DECL tvec1(tvec1<T, Q> const & v);
118 GLM_FUNC_DECL explicit tvec1(ctor);
119 GLM_FUNC_DECL explicit tvec1(T const & s);
124 template <typename U, precision Q>
125 GLM_FUNC_DECL explicit tvec1(tvec2<U, Q> const & v);
127 template <typename U, precision Q>
128 GLM_FUNC_DECL explicit tvec1(tvec3<U, Q> const & v);
130 template <typename U, precision Q>
131 GLM_FUNC_DECL explicit tvec1(tvec4<U, Q> const & v);
134 template <typename U, precision Q>
135 GLM_FUNC_DECL GLM_EXPLICIT tvec1(tvec1<U, Q> const & v);
139 # if(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
141 GLM_FUNC_DECL tvec1(detail::_swizzle<1, T, P, tvec1<T, P>, E0, -1,-2,-3>
const & that)
145 # endif//(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
149 GLM_FUNC_DECL tvec1<T, P> & operator=(tvec1<T, P>
const & v) GLM_DEFAULT;
151 template <
typename U>
152 GLM_FUNC_DECL tvec1<T, P> & operator=(tvec1<U, P>
const & v);
153 template <
typename U>
154 GLM_FUNC_DECL tvec1<T, P> & operator+=(U
const & s);
155 template <
typename U>
156 GLM_FUNC_DECL tvec1<T, P> & operator+=(tvec1<U, P>
const & v);
157 template <
typename U>
158 GLM_FUNC_DECL tvec1<T, P> & operator-=(U
const & s);
159 template <
typename U>
160 GLM_FUNC_DECL tvec1<T, P> & operator-=(tvec1<U, P>
const & v);
161 template <
typename U>
162 GLM_FUNC_DECL tvec1<T, P> & operator*=(U
const & s);
163 template <
typename U>
164 GLM_FUNC_DECL tvec1<T, P> & operator*=(tvec1<U, P>
const & v);
165 template <
typename U>
166 GLM_FUNC_DECL tvec1<T, P> & operator/=(U
const & s);
167 template <
typename U>
168 GLM_FUNC_DECL tvec1<T, P> & operator/=(tvec1<U, P>
const & v);
172 GLM_FUNC_DECL tvec1<T, P> & operator++();
173 GLM_FUNC_DECL tvec1<T, P> & operator--();
174 GLM_FUNC_DECL tvec1<T, P> operator++(
int);
175 GLM_FUNC_DECL tvec1<T, P> operator--(
int);
179 template <
typename U>
180 GLM_FUNC_DECL tvec1<T, P> & operator%=(U
const & s);
181 template <
typename U>
182 GLM_FUNC_DECL tvec1<T, P> & operator%=(tvec1<U, P>
const & v);
183 template <
typename U>
184 GLM_FUNC_DECL tvec1<T, P> & operator&=(U
const & s);
185 template <
typename U>
186 GLM_FUNC_DECL tvec1<T, P> & operator&=(tvec1<U, P>
const & v);
187 template <
typename U>
188 GLM_FUNC_DECL tvec1<T, P> & operator|=(U
const & s);
189 template <
typename U>
190 GLM_FUNC_DECL tvec1<T, P> & operator|=(tvec1<U, P>
const & v);
191 template <
typename U>
192 GLM_FUNC_DECL tvec1<T, P> & operator^=(U
const & s);
193 template <
typename U>
194 GLM_FUNC_DECL tvec1<T, P> & operator^=(tvec1<U, P>
const & v);
195 template <
typename U>
196 GLM_FUNC_DECL tvec1<T, P> & operator<<=(U
const & s);
197 template <
typename U>
198 GLM_FUNC_DECL tvec1<T, P> & operator<<=(tvec1<U, P>
const & v);
199 template <
typename U>
200 GLM_FUNC_DECL tvec1<T, P> & operator>>=(U
const & s);
201 template <
typename U>
202 GLM_FUNC_DECL tvec1<T, P> & operator>>=(tvec1<U, P>
const & v);
207 template <
typename T, precision P>
208 GLM_FUNC_DECL tvec1<T, P> operator-(tvec1<T, P>
const & v);
212 template <
typename T, precision P>
213 GLM_FUNC_DECL tvec1<T, P> operator+(tvec1<T, P>
const & v, T
const & s);
215 template <
typename T, precision P>
216 GLM_FUNC_DECL tvec1<T, P> operator+(T
const & s, tvec1<T, P>
const & v);
218 template <
typename T, precision P>
219 GLM_FUNC_DECL tvec1<T, P> operator+(tvec1<T, P>
const & v1, tvec1<T, P>
const & v2);
221 template <
typename T, precision P>
222 GLM_FUNC_DECL tvec1<T, P> operator-(tvec1<T, P>
const & v, T
const & s);
224 template <
typename T, precision P>
225 GLM_FUNC_DECL tvec1<T, P> operator-(T
const & s, tvec1<T, P>
const & v);
227 template <
typename T, precision P>
228 GLM_FUNC_DECL tvec1<T, P> operator- (tvec1<T, P>
const & v1, tvec1<T, P>
const & v2);
230 template <
typename T, precision P>
231 GLM_FUNC_DECL tvec1<T, P> operator*(tvec1<T, P>
const & v, T
const & s);
233 template <
typename T, precision P>
234 GLM_FUNC_DECL tvec1<T, P> operator*(T
const & s, tvec1<T, P>
const & v);
236 template <
typename T, precision P>
237 GLM_FUNC_DECL tvec1<T, P> operator*(tvec1<T, P>
const & v1, tvec1<T, P>
const & v2);
239 template <
typename T, precision P>
240 GLM_FUNC_DECL tvec1<T, P> operator/(tvec1<T, P>
const & v, T
const & s);
242 template <
typename T, precision P>
243 GLM_FUNC_DECL tvec1<T, P> operator/(T
const & s, tvec1<T, P>
const & v);
245 template <
typename T, precision P>
246 GLM_FUNC_DECL tvec1<T, P> operator/(tvec1<T, P>
const & v1, tvec1<T, P>
const & v2);
248 template <
typename T, precision P>
249 GLM_FUNC_DECL tvec1<T, P> operator%(tvec1<T, P>
const & v, T
const & s);
251 template <
typename T, precision P>
252 GLM_FUNC_DECL tvec1<T, P> operator%(T
const & s, tvec1<T, P>
const & v);
254 template <
typename T, precision P>
255 GLM_FUNC_DECL tvec1<T, P> operator%(tvec1<T, P>
const & v1, tvec1<T, P>
const & v2);
257 template <
typename T, precision P>
258 GLM_FUNC_DECL tvec1<T, P> operator&(tvec1<T, P>
const & v, T
const & s);
260 template <
typename T, precision P>
261 GLM_FUNC_DECL tvec1<T, P> operator&(T
const & s, tvec1<T, P>
const & v);
263 template <
typename T, precision P>
264 GLM_FUNC_DECL tvec1<T, P> operator&(tvec1<T, P>
const & v1, tvec1<T, P>
const & v2);
266 template <
typename T, precision P>
267 GLM_FUNC_DECL tvec1<T, P> operator|(tvec1<T, P>
const & v, T
const & s);
269 template <
typename T, precision P>
270 GLM_FUNC_DECL tvec1<T, P> operator|(T
const & s, tvec1<T, P>
const & v);
272 template <
typename T, precision P>
273 GLM_FUNC_DECL tvec1<T, P> operator|(tvec1<T, P>
const & v1, tvec1<T, P>
const & v2);
275 template <
typename T, precision P>
276 GLM_FUNC_DECL tvec1<T, P> operator^(tvec1<T, P>
const & v, T
const & s);
278 template <
typename T, precision P>
279 GLM_FUNC_DECL tvec1<T, P> operator^(T
const & s, tvec1<T, P>
const & v);
281 template <
typename T, precision P>
282 GLM_FUNC_DECL tvec1<T, P> operator^(tvec1<T, P>
const & v1, tvec1<T, P>
const & v2);
284 template <
typename T, precision P>
285 GLM_FUNC_DECL tvec1<T, P> operator<<(tvec1<T, P>
const & v, T
const & s);
287 template <
typename T, precision P>
288 GLM_FUNC_DECL tvec1<T, P> operator<<(T const & s, tvec1<T, P>
const & v);
290 template <
typename T, precision P>
291 GLM_FUNC_DECL tvec1<T, P> operator<<(tvec1<T, P>
const & v1, tvec1<T, P>
const & v2);
293 template <
typename T, precision P>
294 GLM_FUNC_DECL tvec1<T, P> operator>>(tvec1<T, P>
const & v, T
const & s);
296 template <
typename T, precision P>
297 GLM_FUNC_DECL tvec1<T, P> operator>>(T
const & s, tvec1<T, P>
const & v);
299 template <
typename T, precision P>
300 GLM_FUNC_DECL tvec1<T, P> operator>>(tvec1<T, P>
const & v1, tvec1<T, P>
const & v2);
302 template <
typename T, precision P>
303 GLM_FUNC_DECL tvec1<T, P> operator~(tvec1<T, P>
const & v);
307 template <
typename T, precision P>
308 GLM_FUNC_DECL
bool operator==(tvec1<T, P>
const & v1, tvec1<T, P>
const & v2);
310 template <
typename T, precision P>
311 GLM_FUNC_DECL
bool operator!=(tvec1<T, P>
const & v1, tvec1<T, P>
const & v2);
314 #ifndef GLM_EXTERNAL_TEMPLATE
315 #include "type_vec1.inl"
316 #endif//GLM_EXTERNAL_TEMPLATE
GLM_FUNC_DECL T length(vecType< T, P > const &x)
Returns the length of x, i.e., sqrt(x * x).
OpenGL Mathematics (glm.g-truc.net)
OpenGL Mathematics (glm.g-truc.net)
OpenGL Mathematics (glm.g-truc.net)