|
|
|
@ -51,14 +51,13 @@ namespace detail |
|
|
|
|
//////////////////////////////////////
|
|
|
|
|
// Data
|
|
|
|
|
|
|
|
|
|
# if(GLM_COMPONENT == GLM_COMPONENT_CXXMS) |
|
|
|
|
# if((GLM_LANG & GLM_LANG_CXXMS_FLAG) && defined(GLM_SWIZZLE)) |
|
|
|
|
union
|
|
|
|
|
{ |
|
|
|
|
struct { value_type r, g, b, a; }; |
|
|
|
|
struct { value_type s, t, p, q; }; |
|
|
|
|
struct { value_type x, y, z, w;}; |
|
|
|
|
|
|
|
|
|
# if(defined(GLM_SWIZZLE)) |
|
|
|
|
_GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, x, y, z, w) |
|
|
|
|
_GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, r, g, b, a) |
|
|
|
|
_GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, s, t, p, q) |
|
|
|
@ -68,28 +67,18 @@ namespace detail |
|
|
|
|
_GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, x, y, z, w) |
|
|
|
|
_GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, r, g, b, a) |
|
|
|
|
_GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, s, t, p, q) |
|
|
|
|
# endif//(defined(GLM_SWIZZLE))
|
|
|
|
|
}; |
|
|
|
|
# elif(GLM_COMPONENT == GLM_COMPONENT_CXX98) |
|
|
|
|
# else |
|
|
|
|
union { value_type x, r, s; }; |
|
|
|
|
union { value_type y, g, t; }; |
|
|
|
|
union { value_type z, b, p; }; |
|
|
|
|
union { value_type w, a, q; }; |
|
|
|
|
|
|
|
|
|
# if(defined(GLM_SWIZZLE)) |
|
|
|
|
// Defines all he swizzle operator as functions
|
|
|
|
|
GLM_SWIZZLE_GEN_REF_FROM_VEC4(T, P, detail::tvec4, detail::tref2, detail::tref3, detail::tref4) |
|
|
|
|
//GLM_SWIZZLE_GEN_REF_FROM_VEC4(T, P, detail::tvec4, detail::tref2, detail::tref3, detail::tref4)
|
|
|
|
|
GLM_SWIZZLE_GEN_VEC_FROM_VEC4(T, P, detail::tvec4, detail::tvec2, detail::tvec3, detail::tvec4) |
|
|
|
|
# endif//(defined(GLM_SWIZZLE))
|
|
|
|
|
# else //(GLM_COMPONENT == GLM_COMPONENT_ONLY_XYZW)
|
|
|
|
|
value_type x, y, z, w; |
|
|
|
|
|
|
|
|
|
# if(defined(GLM_SWIZZLE)) |
|
|
|
|
// Defines all he swizzle operator as functions
|
|
|
|
|
GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(T, P, detail::tvec4, detail::tref2, detail::tref3, detail::tref4, x, y, z, w) |
|
|
|
|
GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(T, P, detail::tvec4, detail::tvec2, detail::tvec3, detail::tvec4, x, y, z, w) |
|
|
|
|
# endif//(defined(GLM_SWIZZLE))
|
|
|
|
|
# endif//GLM_COMPONENT
|
|
|
|
|
# endif//GLM_LANG
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////
|
|
|
|
|
// Accesses
|
|
|
|
@ -102,6 +91,8 @@ namespace detail |
|
|
|
|
|
|
|
|
|
GLM_FUNC_DECL tvec4(); |
|
|
|
|
GLM_FUNC_DECL tvec4(type const & v); |
|
|
|
|
template <precision Q> |
|
|
|
|
GLM_FUNC_DECL tvec4(tvec4<T, Q> const & v); |
|
|
|
|
|
|
|
|
|
//////////////////////////////////////
|
|
|
|
|
// Explicit basic constructors
|
|
|
|
@ -117,13 +108,13 @@ namespace detail |
|
|
|
|
value_type const & s3); |
|
|
|
|
|
|
|
|
|
//////////////////////////////////////
|
|
|
|
|
// Convertion scalar constructors
|
|
|
|
|
// Conversion scalar constructors
|
|
|
|
|
|
|
|
|
|
//! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
|
|
|
|
/// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
|
|
|
|
template <typename U> |
|
|
|
|
GLM_FUNC_DECL explicit tvec4( |
|
|
|
|
U const & x); |
|
|
|
|
//! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
|
|
|
|
/// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
|
|
|
|
template <typename A, typename B, typename C, typename D> |
|
|
|
|
GLM_FUNC_DECL explicit tvec4( |
|
|
|
|
A const & x, |
|
|
|
@ -132,7 +123,7 @@ namespace detail |
|
|
|
|
D const & w); |
|
|
|
|
|
|
|
|
|
//////////////////////////////////////
|
|
|
|
|
// Convertion vector constructors
|
|
|
|
|
// Conversion vector constructors
|
|
|
|
|
|
|
|
|
|
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
|
|
|
|
template <typename A, typename B, typename C, precision Q> |
|
|
|
@ -232,8 +223,8 @@ namespace detail |
|
|
|
|
// Unary arithmetic operators
|
|
|
|
|
|
|
|
|
|
GLM_FUNC_DECL tvec4<T, P> & operator= (tvec4<T, P> const & v); |
|
|
|
|
template <typename U> |
|
|
|
|
GLM_FUNC_DECL tvec4<T, P> & operator= (tvec4<U, P> const & v); |
|
|
|
|
template <typename U, precision Q> |
|
|
|
|
GLM_FUNC_DECL tvec4<T, P> & operator= (tvec4<U, Q> const & v); |
|
|
|
|
|
|
|
|
|
template <typename U> |
|
|
|
|
GLM_FUNC_DECL tvec4<T, P> & operator+=(U const & s); |
|
|
|
|