8 #if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
9 # if GLM_HAS_UNRESTRICTED_UNIONS
19 template <
typename T, precision P = defaultp>
25 typedef tvec1<T, P> type;
26 typedef tvec1<bool, P> bool_type;
30 # if GLM_HAS_ALIGNED_TYPE
31 # if GLM_COMPILER & GLM_COMPILER_GCC
32 # pragma GCC diagnostic push
33 # pragma GCC diagnostic ignored "-pedantic"
35 # if GLM_COMPILER & GLM_COMPILER_CLANG
36 # pragma clang diagnostic push
37 # pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
38 # pragma clang diagnostic ignored "-Wnested-anon-types"
60 # if GLM_COMPILER & GLM_COMPILER_CLANG
61 # pragma clang diagnostic pop
63 # if GLM_COMPILER & GLM_COMPILER_GCC
64 # pragma GCC diagnostic pop
77 typedef length_t length_type;
78 GLM_FUNC_DECL GLM_CONSTEXPR length_type
length()
const;
80 GLM_FUNC_DECL T & operator[](length_type i);
81 GLM_FUNC_DECL T
const & operator[](length_type i)
const;
85 GLM_FUNC_DECL GLM_CONSTEXPR tvec1() GLM_DEFAULT_CTOR;
86 GLM_FUNC_DECL GLM_CONSTEXPR tvec1(tvec1<T, P> const & v) GLM_DEFAULT;
87 template <precision Q>
88 GLM_FUNC_DECL GLM_CONSTEXPR tvec1(tvec1<T, Q> const & v);
92 GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec1(ctor);
93 GLM_FUNC_DECL GLM_CONSTEXPR explicit tvec1(T scalar);
98 template <typename U, precision Q>
99 GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec1(tvec2<U, Q> const & v);
101 template <typename U, precision Q>
102 GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec1(tvec3<U, Q> const & v);
104 template <typename U, precision Q>
105 GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec1(tvec4<U, Q> const & v);
108 template <typename U, precision Q>
109 GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec1(tvec1<U, Q> const & v);
123 GLM_FUNC_DECL tvec1<T, P> & operator=(tvec1<T, P> const & v) GLM_DEFAULT;
125 template <typename U>
126 GLM_FUNC_DECL tvec1<T, P> & operator=(tvec1<U, P> const & v);
127 template <typename U>
128 GLM_FUNC_DECL tvec1<T, P> & operator+=(U scalar);
129 template <typename U>
130 GLM_FUNC_DECL tvec1<T, P> & operator+=(tvec1<U, P> const & v);
131 template <typename U>
132 GLM_FUNC_DECL tvec1<T, P> & operator-=(U scalar);
133 template <typename U>
134 GLM_FUNC_DECL tvec1<T, P> & operator-=(tvec1<U, P> const & v);
135 template <typename U>
136 GLM_FUNC_DECL tvec1<T, P> & operator*=(U scalar);
137 template <typename U>
138 GLM_FUNC_DECL tvec1<T, P> & operator*=(tvec1<U, P> const & v);
139 template <typename U>
140 GLM_FUNC_DECL tvec1<T, P> & operator/=(U scalar);
141 template <typename U>
142 GLM_FUNC_DECL tvec1<T, P> & operator/=(tvec1<U, P> const & v);
146 GLM_FUNC_DECL tvec1<T, P> & operator++();
147 GLM_FUNC_DECL tvec1<T, P> & operator--();
148 GLM_FUNC_DECL tvec1<T, P> operator++(
int);
149 GLM_FUNC_DECL tvec1<T, P> operator--(
int);
153 template <typename U>
154 GLM_FUNC_DECL tvec1<T, P> & operator%=(U scalar);
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 scalar);
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 scalar);
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 scalar);
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 scalar);
171 template <typename U>
172 GLM_FUNC_DECL tvec1<T, P> & operator<<=(tvec1<U, P> const & v);
173 template <typename U>
174 GLM_FUNC_DECL tvec1<T, P> & operator>>=(U scalar);
175 template <typename U>
176 GLM_FUNC_DECL tvec1<T, P> & operator>>=(tvec1<U, P> const & v);
181 template <typename T, precision P>
182 GLM_FUNC_DECL tvec1<T, P> operator+(tvec1<T, P> const & v);
184 template <typename T, precision P>
185 GLM_FUNC_DECL tvec1<T, P> operator-(tvec1<T, P> const & v);
189 template <typename T, precision P>
190 GLM_FUNC_DECL tvec1<T, P> operator+(tvec1<T, P> const & v, T scalar);
192 template <typename T, precision P>
193 GLM_FUNC_DECL tvec1<T, P> operator+(T scalar, tvec1<T, P> const & v);
195 template <typename T, precision P>
196 GLM_FUNC_DECL tvec1<T, P> operator+(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
198 template <typename T, precision P>
199 GLM_FUNC_DECL tvec1<T, P> operator-(tvec1<T, P> const & v, T scalar);
201 template <typename T, precision P>
202 GLM_FUNC_DECL tvec1<T, P> operator-(T scalar, tvec1<T, P> const & v);
204 template <typename T, precision P>
205 GLM_FUNC_DECL tvec1<T, P> operator- (tvec1<T, P> const & v1, tvec1<T, P> const & v2);
207 template <typename T, precision P>
208 GLM_FUNC_DECL tvec1<T, P> operator*(tvec1<T, P> const & v, T scalar);
210 template <typename T, precision P>
211 GLM_FUNC_DECL tvec1<T, P> operator*(T scalar, tvec1<T, P> const & v);
213 template <typename T, precision P>
214 GLM_FUNC_DECL tvec1<T, P> operator*(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
216 template <typename T, precision P>
217 GLM_FUNC_DECL tvec1<T, P> operator/(tvec1<T, P> const & v, T scalar);
219 template <typename T, precision P>
220 GLM_FUNC_DECL tvec1<T, P> operator/(T scalar, tvec1<T, P> const & v);
222 template <typename T, precision P>
223 GLM_FUNC_DECL tvec1<T, P> operator/(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
225 template <typename T, precision P>
226 GLM_FUNC_DECL tvec1<T, P> operator%(tvec1<T, P> const & v, T scalar);
228 template <typename T, precision P>
229 GLM_FUNC_DECL tvec1<T, P> operator%(T scalar, tvec1<T, P> const & v);
231 template <typename T, precision P>
232 GLM_FUNC_DECL tvec1<T, P> operator%(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
234 template <typename T, precision P>
235 GLM_FUNC_DECL tvec1<T, P> operator&(tvec1<T, P> const & v, T scalar);
237 template <typename T, precision P>
238 GLM_FUNC_DECL tvec1<T, P> operator&(T scalar, tvec1<T, P> const & v);
240 template <typename T, precision P>
241 GLM_FUNC_DECL tvec1<T, P> operator&(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
243 template <typename T, precision P>
244 GLM_FUNC_DECL tvec1<T, P> operator|(tvec1<T, P> const & v, T scalar);
246 template <typename T, precision P>
247 GLM_FUNC_DECL tvec1<T, P> operator|(T scalar, tvec1<T, P> const & v);
249 template <typename T, precision P>
250 GLM_FUNC_DECL tvec1<T, P> operator|(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
252 template <typename T, precision P>
253 GLM_FUNC_DECL tvec1<T, P> operator^(tvec1<T, P> const & v, T scalar);
255 template <typename T, precision P>
256 GLM_FUNC_DECL tvec1<T, P> operator^(T scalar, tvec1<T, P> const & v);
258 template <typename T, precision P>
259 GLM_FUNC_DECL tvec1<T, P> operator^(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
261 template <typename T, precision P>
262 GLM_FUNC_DECL tvec1<T, P> operator<<(tvec1<T, P> const & v, T scalar);
264 template <typename T, precision P>
265 GLM_FUNC_DECL tvec1<T, P> operator<<(T scalar, tvec1<T, P> const & v);
267 template <typename T, precision P>
268 GLM_FUNC_DECL tvec1<T, P> operator<<(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
270 template <typename T, precision P>
271 GLM_FUNC_DECL tvec1<T, P> operator>>(tvec1<T, P> const & v, T scalar);
273 template <typename T, precision P>
274 GLM_FUNC_DECL tvec1<T, P> operator>>(T scalar, tvec1<T, P> const & v);
276 template <typename T, precision P>
277 GLM_FUNC_DECL tvec1<T, P> operator>>(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
279 template <typename T, precision P>
280 GLM_FUNC_DECL tvec1<T, P> operator~(tvec1<T, P> const & v);
284 template <typename T, precision P>
285 GLM_FUNC_DECL
bool operator==(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
287 template <typename T, precision P>
288 GLM_FUNC_DECL
bool operator!=(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
290 template <precision P>
291 GLM_FUNC_DECL tvec1<
bool, P> operator&&(tvec1<
bool, P> const & v1, tvec1<
bool, P> const & v2);
293 template <precision P>
294 GLM_FUNC_DECL tvec1<
bool, P> operator||(tvec1<
bool, P> const & v1, tvec1<
bool, P> const & v2);
297 #ifndef GLM_EXTERNAL_TEMPLATE
298 #include "type_vec1.inl"
299 #endif//GLM_EXTERNAL_TEMPLATE
GLM_FUNC_DECL T length(vecType< T, P > const &x)
Returns the length of x, i.e., sqrt(x * x).