29 #ifndef glm_core_type_gentype2 30 #define glm_core_type_gentype2 41 template <
typename T>
struct tref2;
42 template <
typename T>
struct tref3;
43 template <
typename T>
struct tref4;
44 template <
typename T>
struct tvec3;
45 template <
typename T>
struct tvec4;
55 typedef std::size_t size_type;
56 GLM_FUNC_DECL size_type length()
const;
58 typedef tvec2<T> type;
59 typedef tvec2<bool> bool_type;
64 # if(GLM_COMPONENT == GLM_COMPONENT_CXX11) 67 # if(defined(GLM_SWIZZLE)) 69 _GLM_SWIZZLE2_2_MEMBERS(value_type,
glm::detail::tvec2<value_type>, r, g)
70 _GLM_SWIZZLE2_2_MEMBERS(value_type,
glm::detail::tvec2<value_type>, s, t)
71 _GLM_SWIZZLE2_3_MEMBERS(value_type,
glm::detail::tvec3<value_type>, x, y)
72 _GLM_SWIZZLE2_3_MEMBERS(value_type,
glm::detail::tvec3<value_type>, r, g)
73 _GLM_SWIZZLE2_3_MEMBERS(value_type,
glm::detail::tvec3<value_type>, s, t)
74 _GLM_SWIZZLE2_4_MEMBERS(value_type,
glm::detail::tvec4<value_type>, x, y)
75 _GLM_SWIZZLE2_4_MEMBERS(value_type,
glm::detail::tvec4<value_type>, r, g)
76 _GLM_SWIZZLE2_4_MEMBERS(value_type,
glm::detail::tvec4<value_type>, s, t)
77 # endif//(defined(GLM_SWIZZLE)) 79 struct{value_type r, g;};
80 struct{value_type s, t;};
81 struct{value_type x, y;};
83 # elif(GLM_COMPONENT == GLM_COMPONENT_CXX98) 84 union {value_type x, r, s;};
85 union {value_type y, g, t;};
87 # if(defined(GLM_SWIZZLE)) 89 GLM_SWIZZLE_GEN_REF_FROM_VEC2(value_type, detail::tvec2, detail::tref2)
90 GLM_SWIZZLE_GEN_VEC_FROM_VEC2(value_type, detail::tvec2, detail::tvec2, detail::tvec3, detail::tvec4)
91 # endif//(defined(GLM_SWIZZLE)) 92 # else //(GLM_COMPONENT == GLM_COMPONENT_ONLY_XYZW) 95 # if(defined(GLM_SWIZZLE)) 97 GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(value_type, detail::tvec2, detail::tref2, x, y)
98 GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(value_type, detail::tvec2, detail::tvec2, detail::tvec3, detail::tvec4, x, y)
99 # endif//(defined(GLM_SWIZZLE)) 100 # endif//GLM_COMPONENT 105 GLM_FUNC_DECL value_type & operator[](size_type i);
106 GLM_FUNC_DECL value_type
const & operator[](size_type i)
const;
111 GLM_FUNC_DECL tvec2();
112 GLM_FUNC_DECL tvec2(tvec2<T>
const & v);
117 GLM_FUNC_DECL
explicit tvec2(
119 GLM_FUNC_DECL
explicit tvec2(
120 value_type
const & s);
121 GLM_FUNC_DECL
explicit tvec2(
122 value_type
const & s1,
123 value_type
const & s2);
128 tvec2(tref2<T>
const & r);
130 template <
int E0,
int E1>
140 template <
typename U>
141 GLM_FUNC_DECL
explicit tvec2(
144 template <
typename U,
typename V>
145 GLM_FUNC_DECL
explicit tvec2(
153 template <
typename U>
154 GLM_FUNC_DECL
explicit tvec2(tvec2<U>
const & v);
156 template <
typename U>
157 GLM_FUNC_DECL
explicit tvec2(tvec3<U>
const & v);
159 template <
typename U>
160 GLM_FUNC_DECL
explicit tvec2(tvec4<U>
const & v);
165 GLM_FUNC_DECL tvec2<T> & operator= (tvec2<T>
const & v);
166 template <
typename U>
167 GLM_FUNC_DECL tvec2<T> & operator= (tvec2<U>
const & v);
169 template <
typename U>
170 GLM_FUNC_DECL tvec2<T> & operator+=(U
const & s);
171 template <
typename U>
172 GLM_FUNC_DECL tvec2<T> & operator+=(tvec2<U>
const & v);
173 template <
typename U>
174 GLM_FUNC_DECL tvec2<T> & operator-=(U
const & s);
175 template <
typename U>
176 GLM_FUNC_DECL tvec2<T> & operator-=(tvec2<U>
const & v);
177 template <
typename U>
178 GLM_FUNC_DECL tvec2<T> & operator*=(U
const & s);
179 template <
typename U>
180 GLM_FUNC_DECL tvec2<T> & operator*=(tvec2<U>
const & v);
181 template <
typename U>
182 GLM_FUNC_DECL tvec2<T> & operator/=(U
const & s);
183 template <
typename U>
184 GLM_FUNC_DECL tvec2<T> & operator/=(tvec2<U>
const & v);
185 GLM_FUNC_DECL tvec2<T> & operator++();
186 GLM_FUNC_DECL tvec2<T> & operator--();
191 template <
typename U>
192 GLM_FUNC_DECL tvec2<T> & operator%= (U
const & s);
193 template <
typename U>
194 GLM_FUNC_DECL tvec2<T> & operator%= (tvec2<U>
const & v);
195 template <
typename U>
196 GLM_FUNC_DECL tvec2<T> & operator&= (U
const & s);
197 template <
typename U>
198 GLM_FUNC_DECL tvec2<T> & operator&= (tvec2<U>
const & v);
199 template <
typename U>
200 GLM_FUNC_DECL tvec2<T> & operator|= (U
const & s);
201 template <
typename U>
202 GLM_FUNC_DECL tvec2<T> & operator|= (tvec2<U>
const & v);
203 template <
typename U>
204 GLM_FUNC_DECL tvec2<T> & operator^= (U
const & s);
205 template <
typename U>
206 GLM_FUNC_DECL tvec2<T> & operator^= (tvec2<U>
const & v);
207 template <
typename U>
208 GLM_FUNC_DECL tvec2<T> & operator<<=(U
const & s);
209 template <
typename U>
210 GLM_FUNC_DECL tvec2<T> & operator<<=(tvec2<U>
const & v);
211 template <
typename U>
212 GLM_FUNC_DECL tvec2<T> & operator>>=(U
const & s);
213 template <
typename U>
214 GLM_FUNC_DECL tvec2<T> & operator>>=(tvec2<U>
const & v);
219 GLM_FUNC_DECL value_type swizzle(comp X)
const;
220 GLM_FUNC_DECL tvec2<T> swizzle(comp X, comp Y)
const;
221 GLM_FUNC_DECL tvec3<T> swizzle(comp X, comp Y, comp Z)
const;
222 GLM_FUNC_DECL tvec4<T> swizzle(comp X, comp Y, comp Z, comp W)
const;
223 GLM_FUNC_DECL tref2<T> swizzle(comp X, comp Y);
226 template <
typename T>
229 GLM_FUNC_DECL tref2(T & x, T & y);
230 GLM_FUNC_DECL tref2(tref2<T>
const & r);
231 GLM_FUNC_DECL
explicit tref2(tvec2<T>
const & v);
233 GLM_FUNC_DECL tref2<T> & operator= (tref2<T>
const & r);
234 GLM_FUNC_DECL tref2<T> & operator= (tvec2<T>
const & v);
236 GLM_FUNC_DECL tvec2<T> operator() ();
242 GLM_DETAIL_IS_VECTOR(tvec2);
315 #ifndef GLM_EXTERNAL_TEMPLATE 316 #include "type_vec2.inl" 317 #endif//GLM_EXTERNAL_TEMPLATE 319 #endif//glm_core_type_gentype2 OpenGL Mathematics (glm.g-truc.net)
detail::tvec2< lowp_uint > lowp_uvec2
2 components vector of low precision unsigned integer numbers.
Definition: type_vec2.hpp:310
detail::tvec2< highp_int > highp_ivec2
2 components vector of high precision signed integer numbers.
Definition: type_vec2.hpp:275
Definition: _swizzle.hpp:204
Definition: _detail.hpp:38
Definition: type_mat2x2.hpp:38
detail::tvec2< mediump_uint > mediump_uvec2
2 components vector of medium precision unsigned integer numbers.
Definition: type_vec2.hpp:303
detail::tvec2< mediump_float > mediump_vec2
2 components vector of medium precision floating-point numbers.
Definition: type_vec2.hpp:261
detail::tvec2< lowp_int > lowp_ivec2
2 components vector of low precision signed integer numbers.
Definition: type_vec2.hpp:289
OpenGL Mathematics (glm.g-truc.net)
OpenGL Mathematics (glm.g-truc.net)
OpenGL Mathematics (glm.g-truc.net)
OpenGL Mathematics (glm.g-truc.net)
detail::tvec2< mediump_int > mediump_ivec2
2 components vector of medium precision signed integer numbers.
Definition: type_vec2.hpp:282
detail::tvec2< lowp_float > lowp_vec2
2 components vector of low precision floating-point numbers.
Definition: type_vec2.hpp:268
detail::tvec2< highp_float > highp_vec2
2 components vector of high precision floating-point numbers.
Definition: type_vec2.hpp:254
detail::tvec2< highp_uint > highp_uvec2
2 components vector of high precision unsigned integer numbers.
Definition: type_vec2.hpp:296