38 #ifndef GLM_GTC_swizzle
39 #define GLM_GTC_swizzle GLM_VERSION
43 #include "../gtc/type_precision.hpp"
45 #if(defined(GLM_MESSAGES) && !defined(glm_ext))
46 # pragma message("GLM: GLM_GTC_swizzle extension included")
54 template <
typename T,
template <
typename>
class vecType>
59 template <
typename T,
template <
typename>
class vecType>
60 detail::tvec2<T>
const &
swizzle(
64 template <
typename T,
template <
typename>
class vecType>
65 detail::tvec3<T>
const &
swizzle(
69 template <
typename T,
template <
typename>
class vecType>
70 detail::tvec4<T>
const &
swizzle(
74 template <
typename T,
template <
typename>
class vecType>
79 template <
typename T,
template <
typename>
class vecType>
84 template <
typename T,
template <
typename>
class vecType>
89 template <
typename T,
template <
typename>
class vecType>
94 # define static_swizzle1_const(TYPE, SIZE) \
96 GLM_FUNC_QUALIFIER TYPE swizzle(detail::tvec##SIZE<TYPE> const & v) \
99 # define static_swizzle1_ref(TYPE, SIZE) \
101 GLM_FUNC_QUALIFIER TYPE& swizzle(detail::tvec##SIZE<TYPE> & v) \
156 # define static_swizzle2_const(TYPE, SIZE) \
157 template <comp x, comp y> \
158 GLM_FUNC_QUALIFIER detail::tvec2<TYPE> swizzle(detail::tvec##SIZE<TYPE> const & v) \
159 {return detail::tvec2<TYPE>(v[x], v[y]);}
161 # define static_swizzle3_const(TYPE, SIZE) \
162 template <comp x, comp y, comp z> \
163 GLM_FUNC_QUALIFIER detail::tvec3<TYPE> swizzle(detail::tvec##SIZE<TYPE> const & v) \
164 {return detail::tvec3<TYPE>(v[x], v[y], v[z]);}
166 # define static_swizzle4_const(TYPE, SIZE) \
167 template <comp x, comp y, comp z, comp w> \
168 GLM_FUNC_QUALIFIER detail::tvec4<TYPE> swizzle(detail::tvec##SIZE<TYPE> const & v) \
169 {return detail::tvec4<TYPE>(v[x], v[y], v[z], v[w]);}
280 # define static_swizzle2_ref(TYPE, SIZE) \
281 template <glm::comp x, glm::comp y> \
282 GLM_FUNC_QUALIFIER glm::detail::tref2<TYPE> swizzle(detail::tvec##SIZE<TYPE> & v) \
283 {return glm::detail::tref2<TYPE>(v[x], v[y]);}
285 # define static_swizzle3_ref(TYPE, SIZE) \
286 template <glm::comp x, glm::comp y, glm::comp z> \
287 GLM_FUNC_QUALIFIER glm::detail::tref3<TYPE> swizzle(detail::tvec##SIZE<TYPE> & v) \
288 {return glm::detail::tref3<TYPE>(v[x], v[y], v[z]);}
290 # define static_swizzle4_ref(TYPE, SIZE) \
291 template <glm::comp x, glm::comp y, glm::comp z, glm::comp w> \
292 GLM_FUNC_QUALIFIER glm::detail::tref4<TYPE> swizzle(detail::tvec##SIZE<TYPE> & v) \
293 {return glm::detail::tref4<TYPE>(v[x], v[y], v[z], v[w]);}
373 #include "swizzle.inl"
375 #endif//GLM_GTC_swizzle
detail::uint8 uint8
Definition: type_precision.hpp:187
detail::uint16 u16
Definition: type_precision.hpp:225
detail::uint32 uint32
Definition: type_precision.hpp:195
detail::float16 float16
Definition: type_precision.hpp:309
detail::int8 int8
Definition: type_precision.hpp:65
detail::int8 i8
Definition: type_precision.hpp:99
Definition: _detail.hpp:38
float16 f16
Definition: type_precision.hpp:335
#define static_swizzle2_ref(TYPE, SIZE)
Definition: _swizzle.hpp:43
detail::uint8 u8
Definition: type_precision.hpp:221
#define static_swizzle4_const(TYPE, SIZE)
detail::float64 float64
Definition: type_precision.hpp:317
detail::uint64 u64
Definition: type_precision.hpp:233
#define static_swizzle3_const(TYPE, SIZE)
#define static_swizzle3_ref(TYPE, SIZE)
detail::int16 int16
Definition: type_precision.hpp:69
detail::uint16 uint16
Definition: type_precision.hpp:191
detail::int64 i64
Definition: type_precision.hpp:111
detail::float32 float32
Definition: type_precision.hpp:313
float64 f64
Definition: type_precision.hpp:343
float32 f32
Definition: type_precision.hpp:339
Definition: type_half.hpp:42
detail::int16 i16
Definition: type_precision.hpp:103
detail::uint64 uint64
Definition: type_precision.hpp:199
detail::int32 int32
Definition: type_precision.hpp:73
detail::int32 i32
Definition: type_precision.hpp:107
detail::half float16
Definition: _detail.hpp:349
detail::uint32 u32
Definition: type_precision.hpp:229
#define static_swizzle1_ref(TYPE, SIZE)
Definition: swizzle.hpp:99
T const & swizzle(vecType< T > const &v, comp x)
Definition: swizzle.inl:33
detail::int64 int64
Definition: type_precision.hpp:77
#define static_swizzle4_ref(TYPE, SIZE)
#define static_swizzle2_const(TYPE, SIZE)
comp
Definition: _swizzle.hpp:36