29 #ifndef glm_core_type_gentype1
30 #define glm_core_type_gentype1
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 tvec1<T, P> type;
58 typedef tvec1<bool, P> bool_type;
64 GLM_FUNC_DECL GLM_CONSTEXPR length_t
length()
const;
74 GLM_FUNC_DECL T & operator[](length_t i);
75 GLM_FUNC_DECL T
const & operator[](length_t i)
const;
80 GLM_FUNC_DECL tvec1();
81 GLM_FUNC_DECL tvec1(tvec1<T, P>
const & v);
82 template <precision Q>
83 GLM_FUNC_DECL tvec1(tvec1<T, Q>
const & v);
85 #if(GLM_HAS_INITIALIZER_LISTS)
87 GLM_FUNC_DECL tvec1(std::initializer_list<U>
const & v);
88 #endif//GLM_HAS_INITIALIZER_LISTS
93 GLM_FUNC_DECL
explicit tvec1(
102 template <
typename U, precision Q>
103 GLM_FUNC_DECL
explicit tvec1(tvec1<U, Q>
const & v);
105 template <
typename U, precision Q>
106 GLM_FUNC_DECL
explicit tvec1(tvec2<U, Q>
const & v);
108 template <
typename U, precision Q>
109 GLM_FUNC_DECL
explicit tvec1(tvec3<U, Q>
const & v);
111 template <
typename U, precision Q>
112 GLM_FUNC_DECL
explicit tvec1(tvec4<U, Q>
const & v);
117 GLM_FUNC_DECL tvec1<T, P> & operator= (tvec1<T, P>
const & v);
118 template <
typename U>
119 GLM_FUNC_DECL tvec1<T, P> & operator= (tvec1<U, P>
const & v);
121 template <
typename U>
122 GLM_FUNC_DECL tvec1<T, P> & operator+=(U
const & s);
123 template <
typename U>
124 GLM_FUNC_DECL tvec1<T, P> & operator+=(tvec1<U, P>
const & v);
125 template <
typename U>
126 GLM_FUNC_DECL tvec1<T, P> & operator-=(U
const & s);
127 template <
typename U>
128 GLM_FUNC_DECL tvec1<T, P> & operator-=(tvec1<U, P>
const & v);
129 template <
typename U>
130 GLM_FUNC_DECL tvec1<T, P> & operator*=(U
const & s);
131 template <
typename U>
132 GLM_FUNC_DECL tvec1<T, P> & operator*=(tvec1<U, P>
const & v);
133 template <
typename U>
134 GLM_FUNC_DECL tvec1<T, P> & operator/=(U
const & s);
135 template <
typename U>
136 GLM_FUNC_DECL tvec1<T, P> & operator/=(tvec1<U, P>
const & v);
141 GLM_FUNC_DECL tvec1<T, P> & operator++();
142 GLM_FUNC_DECL tvec1<T, P> & operator--();
143 GLM_FUNC_DECL tvec1<T, P> operator++(
int);
144 GLM_FUNC_DECL tvec1<T, P> operator--(
int);
149 template <
typename U>
150 GLM_FUNC_DECL tvec1<T, P> & operator%=(U
const & s);
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);
169 template <
typename U>
170 GLM_FUNC_DECL tvec1<T, P> & operator>>=(U
const & s);
171 template <
typename U>
172 GLM_FUNC_DECL tvec1<T, P> & operator>>=(tvec1<U, P>
const & v);
176 template <
typename T, precision P>
177 GLM_FUNC_DECL tvec1<T, P> operator+(tvec1<T, P>
const & v, T
const & s);
179 template <
typename T, precision P>
180 GLM_FUNC_DECL tvec1<T, P> operator+(T
const & s, tvec1<T, P>
const & v);
182 template <
typename T, precision P>
183 GLM_FUNC_DECL tvec1<T, P> operator+(tvec1<T, P>
const & v1, tvec1<T, P>
const & v2);
185 template <
typename T, precision P>
186 GLM_FUNC_DECL tvec1<T, P> operator-(tvec1<T, P>
const & v, T
const & s);
188 template <
typename T, precision P>
189 GLM_FUNC_DECL tvec1<T, P> operator-(T
const & s, tvec1<T, P>
const & v);
191 template <
typename T, precision P>
192 GLM_FUNC_DECL tvec1<T, P> operator- (tvec1<T, P>
const & v1, tvec1<T, P>
const & v2);
194 template <
typename T, precision P>
195 GLM_FUNC_DECL tvec1<T, P> operator*(tvec1<T, P>
const & v, T
const & s);
197 template <
typename T, precision P>
198 GLM_FUNC_DECL tvec1<T, P> operator*(T
const & s, tvec1<T, P>
const & v);
200 template <
typename T, precision P>
201 GLM_FUNC_DECL tvec1<T, P> operator*(tvec1<T, P>
const & v1, tvec1<T, P>
const & v2);
203 template <
typename T, precision P>
204 GLM_FUNC_DECL tvec1<T, P> operator/(tvec1<T, P>
const & v, T
const & s);
206 template <
typename T, precision P>
207 GLM_FUNC_DECL tvec1<T, P> operator/(T
const & s, tvec1<T, P>
const & v);
209 template <
typename T, precision P>
210 GLM_FUNC_DECL tvec1<T, P> operator/(tvec1<T, P>
const & v1, tvec1<T, P>
const & v2);
212 template <
typename T, precision P>
213 GLM_FUNC_DECL tvec1<T, P> operator-(tvec1<T, P>
const & v);
215 template <
typename T, precision P>
216 GLM_FUNC_DECL
bool operator==(tvec1<T, P>
const & v1, tvec1<T, P>
const & v2);
218 template <
typename T, precision P>
219 GLM_FUNC_DECL
bool 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);
281 #ifndef GLM_EXTERNAL_TEMPLATE
282 #include "type_vec1.inl"
283 #endif//GLM_EXTERNAL_TEMPLATE
285 #endif//glm_core_type_gentype1
GLM_FUNC_DECL genType::value_type length(genType const &x)
Returns the length of x, i.e., sqrt(x * x).