From 5ada231044af4adf224f9b0e7cb9ed89d546fc6d Mon Sep 17 00:00:00 2001 From: ZXShady <153229951+ZXShady@users.noreply.github.com> Date: Fri, 7 Mar 2025 19:19:37 +0000 Subject: [PATCH 01/12] Remove overloads in `value_ptr` --- glm/gtc/type_ptr.inl | 155 +++---------------------------------------- 1 file changed, 8 insertions(+), 147 deletions(-) diff --git a/glm/gtc/type_ptr.inl b/glm/gtc/type_ptr.inl index 4e9ed72f..dfa9a0f7 100644 --- a/glm/gtc/type_ptr.inl +++ b/glm/gtc/type_ptr.inl @@ -6,169 +6,30 @@ namespace glm { /// @addtogroup gtc_type_ptr /// @{ - - template - GLM_FUNC_QUALIFIER T const* value_ptr(vec<1, T, Q> const& v) + template + GLM_FUNC_QUALIFIER T* value_ptr(vec& v) { return &(v.x); } - template - GLM_FUNC_QUALIFIER T* value_ptr(vec<1, T, Q>& v) + template + GLM_FUNC_QUALIFIER T const* value_ptr(vec const& v) { return &(v.x); } - template - GLM_FUNC_QUALIFIER T const* value_ptr(vec<2, T, Q> const& v) - { - return &(v.x); - } - - template - GLM_FUNC_QUALIFIER T* value_ptr(vec<2, T, Q>& v) - { - return &(v.x); - } - - template - GLM_FUNC_QUALIFIER T const * value_ptr(vec<3, T, Q> const& v) - { - return &(v.x); - } - - template - GLM_FUNC_QUALIFIER T* value_ptr(vec<3, T, Q>& v) - { - return &(v.x); - } - - template - GLM_FUNC_QUALIFIER T const* value_ptr(vec<4, T, Q> const& v) - { - return &(v.x); - } - - template - GLM_FUNC_QUALIFIER T* value_ptr(vec<4, T, Q>& v) - { - return &(v.x); - } - - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 2, T, Q> const& m) + template + GLM_FUNC_QUALIFIER T* value_ptr(mat& m) { return &(m[0].x); } - template - GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 2, T, Q>& m) + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat const& m) { return &(m[0].x); } - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 3, T, Q> const& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 3, T, Q>& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 4, T, Q> const& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T* value_ptr(mat<4, 4, T, Q>& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 3, T, Q> const& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 3, T, Q>& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 2, T, Q> const& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 2, T, Q>& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 4, T, Q> const& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 4, T, Q>& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 2, T, Q> const& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T* value_ptr(mat<4, 2, T, Q>& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 4, T, Q> const& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 4, T, Q>& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 3, T, Q> const& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T * value_ptr(mat<4, 3, T, Q>& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T const * value_ptr(qua const& q) - { - return &(q[0]); - } - template GLM_FUNC_QUALIFIER T* value_ptr(qua& q) { From eae39033bd6bf06752b6eb83536002f03c391a52 Mon Sep 17 00:00:00 2001 From: ZXShady <153229951+ZXShady@users.noreply.github.com> Date: Fri, 7 Mar 2025 19:37:41 +0000 Subject: [PATCH 02/12] Remove overloads of functions in noise.hpp --- glm/detail/_noise.hpp | 47 ++++++------------------------------------- 1 file changed, 6 insertions(+), 41 deletions(-) diff --git a/glm/detail/_noise.hpp b/glm/detail/_noise.hpp index 5a874a02..5adfe7f5 100644 --- a/glm/detail/_noise.hpp +++ b/glm/detail/_noise.hpp @@ -17,20 +17,8 @@ namespace detail return mod289(((x * static_cast(34)) + static_cast(1)) * x); } - template - GLM_FUNC_QUALIFIER vec<2, T, Q> permute(vec<2, T, Q> const& x) - { - return mod289(((x * static_cast(34)) + static_cast(1)) * x); - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> permute(vec<3, T, Q> const& x) - { - return mod289(((x * static_cast(34)) + static_cast(1)) * x); - } - - template - GLM_FUNC_QUALIFIER vec<4, T, Q> permute(vec<4, T, Q> const& x) + template + GLM_FUNC_QUALIFIER vec permute(vec const& x) { return mod289(((x * static_cast(34)) + static_cast(1)) * x); } @@ -41,41 +29,18 @@ namespace detail return static_cast(1.79284291400159) - static_cast(0.85373472095314) * r; } - template - GLM_FUNC_QUALIFIER vec<2, T, Q> taylorInvSqrt(vec<2, T, Q> const& r) + template + GLM_FUNC_QUALIFIER vec taylorInvSqrt(vec const& r) { return static_cast(1.79284291400159) - static_cast(0.85373472095314) * r; } - template - GLM_FUNC_QUALIFIER vec<3, T, Q> taylorInvSqrt(vec<3, T, Q> const& r) - { - return static_cast(1.79284291400159) - static_cast(0.85373472095314) * r; - } - - template - GLM_FUNC_QUALIFIER vec<4, T, Q> taylorInvSqrt(vec<4, T, Q> const& r) - { - return static_cast(1.79284291400159) - static_cast(0.85373472095314) * r; - } - - template - GLM_FUNC_QUALIFIER vec<2, T, Q> fade(vec<2, T, Q> const& t) + template + GLM_FUNC_QUALIFIER vec fade(vec const& t) { return (t * t * t) * (t * (t * static_cast(6) - static_cast(15)) + static_cast(10)); } - template - GLM_FUNC_QUALIFIER vec<3, T, Q> fade(vec<3, T, Q> const& t) - { - return (t * t * t) * (t * (t * static_cast(6) - static_cast(15)) + static_cast(10)); - } - - template - GLM_FUNC_QUALIFIER vec<4, T, Q> fade(vec<4, T, Q> const& t) - { - return (t * t * t) * (t * (t * static_cast(6) - static_cast(15)) + static_cast(10)); - } }//namespace detail }//namespace glm From 302ea038604e58ccbb1481f0d1f1261e17ac3efb Mon Sep 17 00:00:00 2001 From: ZXShady <153229951+ZXShady@users.noreply.github.com> Date: Fri, 7 Mar 2025 20:29:08 +0000 Subject: [PATCH 03/12] Remove overloads in `extend`,`min_max` --- glm/gtx/extend.inl | 29 ++------ glm/gtx/extended_min_max.hpp | 69 ------------------- glm/gtx/extended_min_max.inl | 125 ++++------------------------------- 3 files changed, 18 insertions(+), 205 deletions(-) diff --git a/glm/gtx/extend.inl b/glm/gtx/extend.inl index 32128eb2..71432be0 100644 --- a/glm/gtx/extend.inl +++ b/glm/gtx/extend.inl @@ -13,36 +13,15 @@ namespace glm return Origin + (Source - Origin) * Distance; } - template - GLM_FUNC_QUALIFIER vec<2, T, Q> extend + template + GLM_FUNC_QUALIFIER vec extend ( - vec<2, T, Q> const& Origin, - vec<2, T, Q> const& Source, + vec const& Origin, + vec const& Source, T const& Distance ) { return Origin + (Source - Origin) * Distance; } - template - GLM_FUNC_QUALIFIER vec<3, T, Q> extend - ( - vec<3, T, Q> const& Origin, - vec<3, T, Q> const& Source, - T const& Distance - ) - { - return Origin + (Source - Origin) * Distance; - } - - template - GLM_FUNC_QUALIFIER vec<4, T, Q> extend - ( - vec<4, T, Q> const& Origin, - vec<4, T, Q> const& Source, - T const& Distance - ) - { - return Origin + (Source - Origin) * Distance; - } }//namespace glm diff --git a/glm/gtx/extended_min_max.hpp b/glm/gtx/extended_min_max.hpp index e1b722fe..85fe6a7a 100644 --- a/glm/gtx/extended_min_max.hpp +++ b/glm/gtx/extended_min_max.hpp @@ -35,23 +35,6 @@ namespace glm T const& y, T const& z); - /// Return the minimum component-wise values of 3 inputs - /// @see gtx_extented_min_max - template class C> - GLM_FUNC_DECL C min( - C const& x, - typename C::T const& y, - typename C::T const& z); - - /// Return the minimum component-wise values of 3 inputs - /// @see gtx_extented_min_max - template class C> - GLM_FUNC_DECL C min( - C const& x, - C const& y, - C const& z); - - /// Return the minimum component-wise values of 4 inputs /// @see gtx_extented_min_max template GLM_FUNC_DECL T min( @@ -60,24 +43,6 @@ namespace glm T const& z, T const& w); - /// Return the minimum component-wise values of 4 inputs - /// @see gtx_extented_min_max - template class C> - GLM_FUNC_DECL C min( - C const& x, - typename C::T const& y, - typename C::T const& z, - typename C::T const& w); - - /// Return the minimum component-wise values of 4 inputs - /// @see gtx_extented_min_max - template class C> - GLM_FUNC_DECL C min( - C const& x, - C const& y, - C const& z, - C const& w); - /// Return the maximum component-wise values of 3 inputs /// @see gtx_extented_min_max template @@ -86,22 +51,6 @@ namespace glm T const& y, T const& z); - /// Return the maximum component-wise values of 3 inputs - /// @see gtx_extented_min_max - template class C> - GLM_FUNC_DECL C max( - C const& x, - typename C::T const& y, - typename C::T const& z); - - /// Return the maximum component-wise values of 3 inputs - /// @see gtx_extented_min_max - template class C> - GLM_FUNC_DECL C max( - C const& x, - C const& y, - C const& z); - /// Return the maximum component-wise values of 4 inputs /// @see gtx_extented_min_max template @@ -111,24 +60,6 @@ namespace glm T const& z, T const& w); - /// Return the maximum component-wise values of 4 inputs - /// @see gtx_extented_min_max - template class C> - GLM_FUNC_DECL C max( - C const& x, - typename C::T const& y, - typename C::T const& z, - typename C::T const& w); - - /// Return the maximum component-wise values of 4 inputs - /// @see gtx_extented_min_max - template class C> - GLM_FUNC_DECL C max( - C const& x, - C const& y, - C const& z, - C const& w); - /// @} }//namespace glm diff --git a/glm/gtx/extended_min_max.inl b/glm/gtx/extended_min_max.inl index de5998fa..637e0248 100644 --- a/glm/gtx/extended_min_max.inl +++ b/glm/gtx/extended_min_max.inl @@ -2,137 +2,40 @@ namespace glm { + template GLM_FUNC_QUALIFIER T min( T const& x, T const& y, - T const& z) - { - return glm::min(glm::min(x, y), z); - } - - template class C> - GLM_FUNC_QUALIFIER C min - ( - C const& x, - typename C::T const& y, - typename C::T const& z - ) - { - return glm::min(glm::min(x, y), z); - } - - template class C> - GLM_FUNC_QUALIFIER C min - ( - C const& x, - C const& y, - C const& z - ) - { - return glm::min(glm::min(x, y), z); + T const& z) { + return glm::min(glm::min(x, y),z); } template - GLM_FUNC_QUALIFIER T min - ( + GLM_FUNC_QUALIFIER T min( T const& x, T const& y, T const& z, - T const& w - ) - { - return glm::min(glm::min(x, y), glm::min(z, w)); + T const& w) { + return glm::min(glm::min(x, y),glm::min(z,w)); } - template class C> - GLM_FUNC_QUALIFIER C min - ( - C const& x, - typename C::T const& y, - typename C::T const& z, - typename C::T const& w - ) - { - return glm::min(glm::min(x, y), glm::min(z, w)); - } - template class C> - GLM_FUNC_QUALIFIER C min - ( - C const& x, - C const& y, - C const& z, - C const& w - ) - { - return glm::min(glm::min(x, y), glm::min(z, w)); + template + GLM_FUNC_QUALIFIER T max( + T const& x, + T const& y, + T const& z) { + return glm::max(glm::max(x, y),z); } template GLM_FUNC_QUALIFIER T max( - T const& x, - T const& y, - T const& z) - { - return glm::max(glm::max(x, y), z); - } - - template class C> - GLM_FUNC_QUALIFIER C max - ( - C const& x, - typename C::T const& y, - typename C::T const& z - ) - { - return glm::max(glm::max(x, y), z); - } - - template class C> - GLM_FUNC_QUALIFIER C max - ( - C const& x, - C const& y, - C const& z - ) - { - return glm::max(glm::max(x, y), z); - } - - template - GLM_FUNC_QUALIFIER T max - ( T const& x, T const& y, T const& z, - T const& w - ) - { - return glm::max(glm::max(x, y), glm::max(z, w)); + T const& w) { + return glm::max(glm::max(x, y),glm::max(z,w)); } - template class C> - GLM_FUNC_QUALIFIER C max - ( - C const& x, - typename C::T const& y, - typename C::T const& z, - typename C::T const& w - ) - { - return glm::max(glm::max(x, y), glm::max(z, w)); - } - - template class C> - GLM_FUNC_QUALIFIER C max - ( - C const& x, - C const& y, - C const& z, - C const& w - ) - { - return glm::max(glm::max(x, y), glm::max(z, w)); - } }//namespace glm From 56b40afefd4a18bd4bf787f8edbba39f5a6bc0b1 Mon Sep 17 00:00:00 2001 From: ZXShady <153229951+ZXShady@users.noreply.github.com> Date: Fri, 7 Mar 2025 20:32:39 +0000 Subject: [PATCH 04/12] Remove `type_trait.inl` infavor of using `enums` for constants. --- glm/gtx/type_trait.hpp | 59 +++++++++++++++++++++++----------------- glm/gtx/type_trait.inl | 61 ------------------------------------------ 2 files changed, 34 insertions(+), 86 deletions(-) delete mode 100644 glm/gtx/type_trait.inl diff --git a/glm/gtx/type_trait.hpp b/glm/gtx/type_trait.hpp index 17ddbad1..6da733a3 100644 --- a/glm/gtx/type_trait.hpp +++ b/glm/gtx/type_trait.hpp @@ -31,53 +31,62 @@ namespace glm template struct type { - static bool const is_vec = false; - static bool const is_mat = false; - static bool const is_quat = false; - static length_t const components = 0; - static length_t const cols = 0; - static length_t const rows = 0; + enum { + is_vec = false, + is_mat = false, + is_quat = false, + components = 0, + cols = 0, + rows = 0 + }; }; template struct type > { - static bool const is_vec = true; - static bool const is_mat = false; - static bool const is_quat = false; - static length_t const components = L; + enum { + is_vec = true, + is_mat = false, + is_quat = false, + components = L + }; }; template struct type > { - static bool const is_vec = false; - static bool const is_mat = true; - static bool const is_quat = false; - static length_t const components = C; - static length_t const cols = C; - static length_t const rows = R; + enum { + is_vec = false, + is_mat = true, + is_quat = false, + components = C, + cols = C, + rows = R + }; }; template struct type > { - static bool const is_vec = false; - static bool const is_mat = false; - static bool const is_quat = true; - static length_t const components = 4; + enum { + is_vec = false, + is_mat = false, + is_quat = true, + components = 4 + }; }; template struct type > { - static bool const is_vec = false; - static bool const is_mat = false; - static bool const is_quat = true; - static length_t const components = 8; + enum { + is_vec = false, + is_mat = false, + is_quat = true, + components = 8 + }; }; /// @} }//namespace glm -#include "type_trait.inl" diff --git a/glm/gtx/type_trait.inl b/glm/gtx/type_trait.inl deleted file mode 100644 index 045de959..00000000 --- a/glm/gtx/type_trait.inl +++ /dev/null @@ -1,61 +0,0 @@ -/// @ref gtx_type_trait - -namespace glm -{ - template - bool const type::is_vec; - template - bool const type::is_mat; - template - bool const type::is_quat; - template - length_t const type::components; - template - length_t const type::cols; - template - length_t const type::rows; - - // vec - template - bool const type >::is_vec; - template - bool const type >::is_mat; - template - bool const type >::is_quat; - template - length_t const type >::components; - - // mat - template - bool const type >::is_vec; - template - bool const type >::is_mat; - template - bool const type >::is_quat; - template - length_t const type >::components; - template - length_t const type >::cols; - template - length_t const type >::rows; - - // tquat - template - bool const type >::is_vec; - template - bool const type >::is_mat; - template - bool const type >::is_quat; - template - length_t const type >::components; - - // tdualquat - template - bool const type >::is_vec; - template - bool const type >::is_mat; - template - bool const type >::is_quat; - template - length_t const type >::components; -}//namespace glm From d38a61f40a91ed2411fabd267bc5147d0eff45ad Mon Sep 17 00:00:00 2001 From: ZXShady <153229951+ZXShady@users.noreply.github.com> Date: Fri, 7 Mar 2025 20:19:18 +0000 Subject: [PATCH 05/12] Use overloading instead of template specilizations --- glm/detail/func_common.inl | 1 - glm/detail/func_integer_simd.inl | 2 -- glm/gtc/bitfield.inl | 40 +++++++++++++------------------- glm/gtc/epsilon.inl | 20 +++++++--------- 4 files changed, 24 insertions(+), 39 deletions(-) diff --git a/glm/detail/func_common.inl b/glm/detail/func_common.inl index 7dd982d5..5cb69517 100644 --- a/glm/detail/func_common.inl +++ b/glm/detail/func_common.inl @@ -40,7 +40,6 @@ namespace glm }; // abs - template<> GLM_FUNC_QUALIFIER GLM_CONSTEXPR int abs(int x) { int const y = x >> (sizeof(int) * 8 - 1); diff --git a/glm/detail/func_integer_simd.inl b/glm/detail/func_integer_simd.inl index 5600c849..1b7aa8db 100644 --- a/glm/detail/func_integer_simd.inl +++ b/glm/detail/func_integer_simd.inl @@ -45,14 +45,12 @@ namespace detail }//namespace detail # if GLM_ARCH & GLM_ARCH_AVX_BIT - template<> GLM_FUNC_QUALIFIER int bitCount(uint x) { return _mm_popcnt_u32(x); } # if(GLM_MODEL == GLM_MODEL_64) - template<> GLM_FUNC_QUALIFIER int bitCount(detail::uint64 x) { return static_cast(_mm_popcnt_u64(x)); diff --git a/glm/gtc/bitfield.inl b/glm/gtc/bitfield.inl index cbfd3888..3abcb96a 100644 --- a/glm/gtc/bitfield.inl +++ b/glm/gtc/bitfield.inl @@ -14,7 +14,6 @@ namespace detail template GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y, PARAM z, PARAM w); - template<> GLM_FUNC_QUALIFIER glm::uint16 bitfieldInterleave(glm::uint8 x, glm::uint8 y) { glm::uint16 REG1(x); @@ -32,7 +31,6 @@ namespace detail return REG1 | static_cast(REG2 << 1); } - template<> GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint16 x, glm::uint16 y) { glm::uint32 REG1(x); @@ -53,7 +51,6 @@ namespace detail return REG1 | (REG2 << 1); } - template<> GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint32 x, glm::uint32 y) { glm::uint64 REG1(x); @@ -77,7 +74,6 @@ namespace detail return REG1 | (REG2 << 1); } - template<> GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint8 x, glm::uint8 y, glm::uint8 z) { glm::uint32 REG1(x); @@ -103,7 +99,6 @@ namespace detail return REG1 | (REG2 << 1) | (REG3 << 2); } - template<> GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint16 x, glm::uint16 y, glm::uint16 z) { glm::uint64 REG1(x); @@ -133,7 +128,6 @@ namespace detail return REG1 | (REG2 << 1) | (REG3 << 2); } - template<> GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint32 x, glm::uint32 y, glm::uint32 z) { glm::uint64 REG1(x); @@ -163,7 +157,6 @@ namespace detail return REG1 | (REG2 << 1) | (REG3 << 2); } - template<> GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint8 x, glm::uint8 y, glm::uint8 z, glm::uint8 w) { glm::uint32 REG1(x); @@ -189,7 +182,6 @@ namespace detail return REG1 | (REG2 << 1) | (REG3 << 2) | (REG4 << 3); } - template<> GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint16 x, glm::uint16 y, glm::uint16 z, glm::uint16 w) { glm::uint64 REG1(x); @@ -329,12 +321,12 @@ namespace detail GLM_FUNC_QUALIFIER uint16 bitfieldInterleave(uint8 x, uint8 y) { - return detail::bitfieldInterleave(x, y); + return detail::bitfieldInterleave(x, y); } GLM_FUNC_QUALIFIER uint16 bitfieldInterleave(u8vec2 const& v) { - return detail::bitfieldInterleave(v.x, v.y); + return detail::bitfieldInterleave(v.x, v.y); } GLM_FUNC_QUALIFIER u8vec2 bitfieldDeinterleave(glm::uint16 x) @@ -383,12 +375,12 @@ namespace detail GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(uint16 x, uint16 y) { - return detail::bitfieldInterleave(x, y); + return detail::bitfieldInterleave(x, y); } GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(u16vec2 const& v) { - return detail::bitfieldInterleave(v.x, v.y); + return detail::bitfieldInterleave(v.x, v.y); } GLM_FUNC_QUALIFIER glm::u16vec2 bitfieldDeinterleave(glm::uint32 x) @@ -437,12 +429,12 @@ namespace detail GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint32 x, uint32 y) { - return detail::bitfieldInterleave(x, y); + return detail::bitfieldInterleave(x, y); } GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(u32vec2 const& v) { - return detail::bitfieldInterleave(v.x, v.y); + return detail::bitfieldInterleave(v.x, v.y); } GLM_FUNC_QUALIFIER glm::u32vec2 bitfieldDeinterleave(glm::uint64 x) @@ -495,12 +487,12 @@ namespace detail GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z) { - return detail::bitfieldInterleave(x, y, z); + return detail::bitfieldInterleave(x, y, z); } GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(u8vec3 const& v) { - return detail::bitfieldInterleave(v.x, v.y, v.z); + return detail::bitfieldInterleave(v.x, v.y, v.z); } GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int16 x, int16 y, int16 z) @@ -527,12 +519,12 @@ namespace detail GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z) { - return detail::bitfieldInterleave(x, y, z); + return detail::bitfieldInterleave(x, y, z); } GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(u16vec3 const& v) { - return detail::bitfieldInterleave(v.x, v.y, v.z); + return detail::bitfieldInterleave(v.x, v.y, v.z); } GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int32 x, int32 y, int32 z) @@ -559,12 +551,12 @@ namespace detail GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint32 x, uint32 y, uint32 z) { - return detail::bitfieldInterleave(x, y, z); + return detail::bitfieldInterleave(x, y, z); } GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(u32vec3 const& v) { - return detail::bitfieldInterleave(v.x, v.y, v.z); + return detail::bitfieldInterleave(v.x, v.y, v.z); } GLM_FUNC_QUALIFIER int32 bitfieldInterleave(int8 x, int8 y, int8 z, int8 w) @@ -592,12 +584,12 @@ namespace detail GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z, uint8 w) { - return detail::bitfieldInterleave(x, y, z, w); + return detail::bitfieldInterleave(x, y, z, w); } GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(u8vec4 const& v) { - return detail::bitfieldInterleave(v.x, v.y, v.z, v.w); + return detail::bitfieldInterleave(v.x, v.y, v.z, v.w); } GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int16 x, int16 y, int16 z, int16 w) @@ -625,11 +617,11 @@ namespace detail GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z, uint16 w) { - return detail::bitfieldInterleave(x, y, z, w); + return detail::bitfieldInterleave(x, y, z, w); } GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(u16vec4 const& v) { - return detail::bitfieldInterleave(v.x, v.y, v.z, v.w); + return detail::bitfieldInterleave(v.x, v.y, v.z, v.w); } }//namespace glm diff --git a/glm/gtc/epsilon.inl b/glm/gtc/epsilon.inl index 508b9f89..d485974a 100644 --- a/glm/gtc/epsilon.inl +++ b/glm/gtc/epsilon.inl @@ -6,23 +6,21 @@ namespace glm { - template<> GLM_FUNC_QUALIFIER bool epsilonEqual ( - float const& x, - float const& y, - float const& epsilon + float x, + float y, + float epsilon ) { return abs(x - y) < epsilon; } - template<> GLM_FUNC_QUALIFIER bool epsilonEqual ( - double const& x, - double const& y, - double const& epsilon + double x, + double y, + double epsilon ) { return abs(x - y) < epsilon; @@ -40,14 +38,12 @@ namespace glm return lessThan(abs(x - y), vec(epsilon)); } - template<> - GLM_FUNC_QUALIFIER bool epsilonNotEqual(float const& x, float const& y, float const& epsilon) + GLM_FUNC_QUALIFIER bool epsilonNotEqual(float x, float y, float epsilon) { return abs(x - y) >= epsilon; } - template<> - GLM_FUNC_QUALIFIER bool epsilonNotEqual(double const& x, double const& y, double const& epsilon) + GLM_FUNC_QUALIFIER bool epsilonNotEqual(double x, double y, double epsilon) { return abs(x - y) >= epsilon; } From 8afe61e9e5b25bbd6af032fe461fd85bfc86d0c7 Mon Sep 17 00:00:00 2001 From: ZXShady <153229951+ZXShady@users.noreply.github.com> Date: Sun, 9 Mar 2025 17:18:57 +0000 Subject: [PATCH 06/12] Remove one member structs in `vec_swizzle` --- glm/detail/_swizzle.hpp | 962 ++++++++++++++++++++-------------------- 1 file changed, 481 insertions(+), 481 deletions(-) diff --git a/glm/detail/_swizzle.hpp b/glm/detail/_swizzle.hpp index 0678982c..d7aaec8e 100644 --- a/glm/detail/_swizzle.hpp +++ b/glm/detail/_swizzle.hpp @@ -310,500 +310,500 @@ namespace glm } #define GLM_SWIZZLE2_2_MEMBERS(T, Q, E0,E1) \ - struct { detail::_swizzle<2, T, Q, 0,0,-1,-2> E0 ## E0; }; \ - struct { detail::_swizzle<2, T, Q, 0,1,-1,-2> E0 ## E1; }; \ - struct { detail::_swizzle<2, T, Q, 1,0,-1,-2> E1 ## E0; }; \ - struct { detail::_swizzle<2, T, Q, 1,1,-1,-2> E1 ## E1; }; + detail::_swizzle<2, T, Q, 0,0,-1,-2> E0 ## E0; \ + detail::_swizzle<2, T, Q, 0,1,-1,-2> E0 ## E1; \ + detail::_swizzle<2, T, Q, 1,0,-1,-2> E1 ## E0; \ + detail::_swizzle<2, T, Q, 1,1,-1,-2> E1 ## E1; #define GLM_SWIZZLE2_3_MEMBERS(T, Q, E0,E1) \ - struct { detail::_swizzle<3,T, Q, 0,0,0,-1> E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<3,T, Q, 0,0,1,-1> E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<3,T, Q, 0,1,0,-1> E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<3,T, Q, 0,1,1,-1> E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<3,T, Q, 1,0,0,-1> E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<3,T, Q, 1,0,1,-1> E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<3,T, Q, 1,1,0,-1> E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<3,T, Q, 1,1,1,-1> E1 ## E1 ## E1; }; + detail::_swizzle<3,T, Q, 0,0,0,-1> E0 ## E0 ## E0; \ + detail::_swizzle<3,T, Q, 0,0,1,-1> E0 ## E0 ## E1; \ + detail::_swizzle<3,T, Q, 0,1,0,-1> E0 ## E1 ## E0; \ + detail::_swizzle<3,T, Q, 0,1,1,-1> E0 ## E1 ## E1; \ + detail::_swizzle<3,T, Q, 1,0,0,-1> E1 ## E0 ## E0; \ + detail::_swizzle<3,T, Q, 1,0,1,-1> E1 ## E0 ## E1; \ + detail::_swizzle<3,T, Q, 1,1,0,-1> E1 ## E1 ## E0; \ + detail::_swizzle<3,T, Q, 1,1,1,-1> E1 ## E1 ## E1; #define GLM_SWIZZLE2_4_MEMBERS(T, Q, E0,E1) \ - struct { detail::_swizzle<4,T, Q, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; + detail::_swizzle<4,T, Q, 0,0,0,0> E0 ## E0 ## E0 ## E0; \ + detail::_swizzle<4,T, Q, 0,0,0,1> E0 ## E0 ## E0 ## E1; \ + detail::_swizzle<4,T, Q, 0,0,1,0> E0 ## E0 ## E1 ## E0; \ + detail::_swizzle<4,T, Q, 0,0,1,1> E0 ## E0 ## E1 ## E1; \ + detail::_swizzle<4,T, Q, 0,1,0,0> E0 ## E1 ## E0 ## E0; \ + detail::_swizzle<4,T, Q, 0,1,0,1> E0 ## E1 ## E0 ## E1; \ + detail::_swizzle<4,T, Q, 0,1,1,0> E0 ## E1 ## E1 ## E0; \ + detail::_swizzle<4,T, Q, 0,1,1,1> E0 ## E1 ## E1 ## E1; \ + detail::_swizzle<4,T, Q, 1,0,0,0> E1 ## E0 ## E0 ## E0; \ + detail::_swizzle<4,T, Q, 1,0,0,1> E1 ## E0 ## E0 ## E1; \ + detail::_swizzle<4,T, Q, 1,0,1,0> E1 ## E0 ## E1 ## E0; \ + detail::_swizzle<4,T, Q, 1,0,1,1> E1 ## E0 ## E1 ## E1; \ + detail::_swizzle<4,T, Q, 1,1,0,0> E1 ## E1 ## E0 ## E0; \ + detail::_swizzle<4,T, Q, 1,1,0,1> E1 ## E1 ## E0 ## E1; \ + detail::_swizzle<4,T, Q, 1,1,1,0> E1 ## E1 ## E1 ## E0; \ + detail::_swizzle<4,T, Q, 1,1,1,1> E1 ## E1 ## E1 ## E1; #define GLM_SWIZZLE3_2_MEMBERS(T, Q, E0,E1,E2) \ - struct { detail::_swizzle<2,T, Q, 0,0,-1,-2> E0 ## E0; }; \ - struct { detail::_swizzle<2,T, Q, 0,1,-1,-2> E0 ## E1; }; \ - struct { detail::_swizzle<2,T, Q, 0,2,-1,-2> E0 ## E2; }; \ - struct { detail::_swizzle<2,T, Q, 1,0,-1,-2> E1 ## E0; }; \ - struct { detail::_swizzle<2,T, Q, 1,1,-1,-2> E1 ## E1; }; \ - struct { detail::_swizzle<2,T, Q, 1,2,-1,-2> E1 ## E2; }; \ - struct { detail::_swizzle<2,T, Q, 2,0,-1,-2> E2 ## E0; }; \ - struct { detail::_swizzle<2,T, Q, 2,1,-1,-2> E2 ## E1; }; \ - struct { detail::_swizzle<2,T, Q, 2,2,-1,-2> E2 ## E2; }; + detail::_swizzle<2,T, Q, 0,0,-1,-2> E0 ## E0; \ + detail::_swizzle<2,T, Q, 0,1,-1,-2> E0 ## E1; \ + detail::_swizzle<2,T, Q, 0,2,-1,-2> E0 ## E2; \ + detail::_swizzle<2,T, Q, 1,0,-1,-2> E1 ## E0; \ + detail::_swizzle<2,T, Q, 1,1,-1,-2> E1 ## E1; \ + detail::_swizzle<2,T, Q, 1,2,-1,-2> E1 ## E2; \ + detail::_swizzle<2,T, Q, 2,0,-1,-2> E2 ## E0; \ + detail::_swizzle<2,T, Q, 2,1,-1,-2> E2 ## E1; \ + detail::_swizzle<2,T, Q, 2,2,-1,-2> E2 ## E2; #define GLM_SWIZZLE3_3_MEMBERS(T, Q ,E0,E1,E2) \ - struct { detail::_swizzle<3, T, Q, 0,0,0,3> E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 0,0,1,3> E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 0,0,2,3> E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 0,1,0,3> E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 0,1,1,3> E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 0,1,2,3> E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 0,2,0,3> E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 0,2,1,3> E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 0,2,2,3> E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 1,0,0,3> E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 1,0,1,3> E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 1,0,2,3> E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 1,1,0,3> E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 1,1,1,3> E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 1,1,2,3> E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 1,2,0,3> E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 1,2,1,3> E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 1,2,2,3> E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 2,0,0,3> E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 2,0,1,3> E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 2,0,2,3> E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 2,1,0,3> E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 2,1,1,3> E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 2,1,2,3> E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 2,2,0,3> E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 2,2,1,3> E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 2,2,2,3> E2 ## E2 ## E2; }; + detail::_swizzle<3, T, Q, 0,0,0,3> E0 ## E0 ## E0; \ + detail::_swizzle<3, T, Q, 0,0,1,3> E0 ## E0 ## E1; \ + detail::_swizzle<3, T, Q, 0,0,2,3> E0 ## E0 ## E2; \ + detail::_swizzle<3, T, Q, 0,1,0,3> E0 ## E1 ## E0; \ + detail::_swizzle<3, T, Q, 0,1,1,3> E0 ## E1 ## E1; \ + detail::_swizzle<3, T, Q, 0,1,2,3> E0 ## E1 ## E2; \ + detail::_swizzle<3, T, Q, 0,2,0,3> E0 ## E2 ## E0; \ + detail::_swizzle<3, T, Q, 0,2,1,3> E0 ## E2 ## E1; \ + detail::_swizzle<3, T, Q, 0,2,2,3> E0 ## E2 ## E2; \ + detail::_swizzle<3, T, Q, 1,0,0,3> E1 ## E0 ## E0; \ + detail::_swizzle<3, T, Q, 1,0,1,3> E1 ## E0 ## E1; \ + detail::_swizzle<3, T, Q, 1,0,2,3> E1 ## E0 ## E2; \ + detail::_swizzle<3, T, Q, 1,1,0,3> E1 ## E1 ## E0; \ + detail::_swizzle<3, T, Q, 1,1,1,3> E1 ## E1 ## E1; \ + detail::_swizzle<3, T, Q, 1,1,2,3> E1 ## E1 ## E2; \ + detail::_swizzle<3, T, Q, 1,2,0,3> E1 ## E2 ## E0; \ + detail::_swizzle<3, T, Q, 1,2,1,3> E1 ## E2 ## E1; \ + detail::_swizzle<3, T, Q, 1,2,2,3> E1 ## E2 ## E2; \ + detail::_swizzle<3, T, Q, 2,0,0,3> E2 ## E0 ## E0; \ + detail::_swizzle<3, T, Q, 2,0,1,3> E2 ## E0 ## E1; \ + detail::_swizzle<3, T, Q, 2,0,2,3> E2 ## E0 ## E2; \ + detail::_swizzle<3, T, Q, 2,1,0,3> E2 ## E1 ## E0; \ + detail::_swizzle<3, T, Q, 2,1,1,3> E2 ## E1 ## E1; \ + detail::_swizzle<3, T, Q, 2,1,2,3> E2 ## E1 ## E2; \ + detail::_swizzle<3, T, Q, 2,2,0,3> E2 ## E2 ## E0; \ + detail::_swizzle<3, T, Q, 2,2,1,3> E2 ## E2 ## E1; \ + detail::_swizzle<3, T, Q, 2,2,2,3> E2 ## E2 ## E2; #define GLM_SWIZZLE3_4_MEMBERS(T, Q, E0,E1,E2) \ - struct { detail::_swizzle<4,T, Q, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; + detail::_swizzle<4,T, Q, 0,0,0,0> E0 ## E0 ## E0 ## E0; \ + detail::_swizzle<4,T, Q, 0,0,0,1> E0 ## E0 ## E0 ## E1; \ + detail::_swizzle<4,T, Q, 0,0,0,2> E0 ## E0 ## E0 ## E2; \ + detail::_swizzle<4,T, Q, 0,0,1,0> E0 ## E0 ## E1 ## E0; \ + detail::_swizzle<4,T, Q, 0,0,1,1> E0 ## E0 ## E1 ## E1; \ + detail::_swizzle<4,T, Q, 0,0,1,2> E0 ## E0 ## E1 ## E2; \ + detail::_swizzle<4,T, Q, 0,0,2,0> E0 ## E0 ## E2 ## E0; \ + detail::_swizzle<4,T, Q, 0,0,2,1> E0 ## E0 ## E2 ## E1; \ + detail::_swizzle<4,T, Q, 0,0,2,2> E0 ## E0 ## E2 ## E2; \ + detail::_swizzle<4,T, Q, 0,1,0,0> E0 ## E1 ## E0 ## E0; \ + detail::_swizzle<4,T, Q, 0,1,0,1> E0 ## E1 ## E0 ## E1; \ + detail::_swizzle<4,T, Q, 0,1,0,2> E0 ## E1 ## E0 ## E2; \ + detail::_swizzle<4,T, Q, 0,1,1,0> E0 ## E1 ## E1 ## E0; \ + detail::_swizzle<4,T, Q, 0,1,1,1> E0 ## E1 ## E1 ## E1; \ + detail::_swizzle<4,T, Q, 0,1,1,2> E0 ## E1 ## E1 ## E2; \ + detail::_swizzle<4,T, Q, 0,1,2,0> E0 ## E1 ## E2 ## E0; \ + detail::_swizzle<4,T, Q, 0,1,2,1> E0 ## E1 ## E2 ## E1; \ + detail::_swizzle<4,T, Q, 0,1,2,2> E0 ## E1 ## E2 ## E2; \ + detail::_swizzle<4,T, Q, 0,2,0,0> E0 ## E2 ## E0 ## E0; \ + detail::_swizzle<4,T, Q, 0,2,0,1> E0 ## E2 ## E0 ## E1; \ + detail::_swizzle<4,T, Q, 0,2,0,2> E0 ## E2 ## E0 ## E2; \ + detail::_swizzle<4,T, Q, 0,2,1,0> E0 ## E2 ## E1 ## E0; \ + detail::_swizzle<4,T, Q, 0,2,1,1> E0 ## E2 ## E1 ## E1; \ + detail::_swizzle<4,T, Q, 0,2,1,2> E0 ## E2 ## E1 ## E2; \ + detail::_swizzle<4,T, Q, 0,2,2,0> E0 ## E2 ## E2 ## E0; \ + detail::_swizzle<4,T, Q, 0,2,2,1> E0 ## E2 ## E2 ## E1; \ + detail::_swizzle<4,T, Q, 0,2,2,2> E0 ## E2 ## E2 ## E2; \ + detail::_swizzle<4,T, Q, 1,0,0,0> E1 ## E0 ## E0 ## E0; \ + detail::_swizzle<4,T, Q, 1,0,0,1> E1 ## E0 ## E0 ## E1; \ + detail::_swizzle<4,T, Q, 1,0,0,2> E1 ## E0 ## E0 ## E2; \ + detail::_swizzle<4,T, Q, 1,0,1,0> E1 ## E0 ## E1 ## E0; \ + detail::_swizzle<4,T, Q, 1,0,1,1> E1 ## E0 ## E1 ## E1; \ + detail::_swizzle<4,T, Q, 1,0,1,2> E1 ## E0 ## E1 ## E2; \ + detail::_swizzle<4,T, Q, 1,0,2,0> E1 ## E0 ## E2 ## E0; \ + detail::_swizzle<4,T, Q, 1,0,2,1> E1 ## E0 ## E2 ## E1; \ + detail::_swizzle<4,T, Q, 1,0,2,2> E1 ## E0 ## E2 ## E2; \ + detail::_swizzle<4,T, Q, 1,1,0,0> E1 ## E1 ## E0 ## E0; \ + detail::_swizzle<4,T, Q, 1,1,0,1> E1 ## E1 ## E0 ## E1; \ + detail::_swizzle<4,T, Q, 1,1,0,2> E1 ## E1 ## E0 ## E2; \ + detail::_swizzle<4,T, Q, 1,1,1,0> E1 ## E1 ## E1 ## E0; \ + detail::_swizzle<4,T, Q, 1,1,1,1> E1 ## E1 ## E1 ## E1; \ + detail::_swizzle<4,T, Q, 1,1,1,2> E1 ## E1 ## E1 ## E2; \ + detail::_swizzle<4,T, Q, 1,1,2,0> E1 ## E1 ## E2 ## E0; \ + detail::_swizzle<4,T, Q, 1,1,2,1> E1 ## E1 ## E2 ## E1; \ + detail::_swizzle<4,T, Q, 1,1,2,2> E1 ## E1 ## E2 ## E2; \ + detail::_swizzle<4,T, Q, 1,2,0,0> E1 ## E2 ## E0 ## E0; \ + detail::_swizzle<4,T, Q, 1,2,0,1> E1 ## E2 ## E0 ## E1; \ + detail::_swizzle<4,T, Q, 1,2,0,2> E1 ## E2 ## E0 ## E2; \ + detail::_swizzle<4,T, Q, 1,2,1,0> E1 ## E2 ## E1 ## E0; \ + detail::_swizzle<4,T, Q, 1,2,1,1> E1 ## E2 ## E1 ## E1; \ + detail::_swizzle<4,T, Q, 1,2,1,2> E1 ## E2 ## E1 ## E2; \ + detail::_swizzle<4,T, Q, 1,2,2,0> E1 ## E2 ## E2 ## E0; \ + detail::_swizzle<4,T, Q, 1,2,2,1> E1 ## E2 ## E2 ## E1; \ + detail::_swizzle<4,T, Q, 1,2,2,2> E1 ## E2 ## E2 ## E2; \ + detail::_swizzle<4,T, Q, 2,0,0,0> E2 ## E0 ## E0 ## E0; \ + detail::_swizzle<4,T, Q, 2,0,0,1> E2 ## E0 ## E0 ## E1; \ + detail::_swizzle<4,T, Q, 2,0,0,2> E2 ## E0 ## E0 ## E2; \ + detail::_swizzle<4,T, Q, 2,0,1,0> E2 ## E0 ## E1 ## E0; \ + detail::_swizzle<4,T, Q, 2,0,1,1> E2 ## E0 ## E1 ## E1; \ + detail::_swizzle<4,T, Q, 2,0,1,2> E2 ## E0 ## E1 ## E2; \ + detail::_swizzle<4,T, Q, 2,0,2,0> E2 ## E0 ## E2 ## E0; \ + detail::_swizzle<4,T, Q, 2,0,2,1> E2 ## E0 ## E2 ## E1; \ + detail::_swizzle<4,T, Q, 2,0,2,2> E2 ## E0 ## E2 ## E2; \ + detail::_swizzle<4,T, Q, 2,1,0,0> E2 ## E1 ## E0 ## E0; \ + detail::_swizzle<4,T, Q, 2,1,0,1> E2 ## E1 ## E0 ## E1; \ + detail::_swizzle<4,T, Q, 2,1,0,2> E2 ## E1 ## E0 ## E2; \ + detail::_swizzle<4,T, Q, 2,1,1,0> E2 ## E1 ## E1 ## E0; \ + detail::_swizzle<4,T, Q, 2,1,1,1> E2 ## E1 ## E1 ## E1; \ + detail::_swizzle<4,T, Q, 2,1,1,2> E2 ## E1 ## E1 ## E2; \ + detail::_swizzle<4,T, Q, 2,1,2,0> E2 ## E1 ## E2 ## E0; \ + detail::_swizzle<4,T, Q, 2,1,2,1> E2 ## E1 ## E2 ## E1; \ + detail::_swizzle<4,T, Q, 2,1,2,2> E2 ## E1 ## E2 ## E2; \ + detail::_swizzle<4,T, Q, 2,2,0,0> E2 ## E2 ## E0 ## E0; \ + detail::_swizzle<4,T, Q, 2,2,0,1> E2 ## E2 ## E0 ## E1; \ + detail::_swizzle<4,T, Q, 2,2,0,2> E2 ## E2 ## E0 ## E2; \ + detail::_swizzle<4,T, Q, 2,2,1,0> E2 ## E2 ## E1 ## E0; \ + detail::_swizzle<4,T, Q, 2,2,1,1> E2 ## E2 ## E1 ## E1; \ + detail::_swizzle<4,T, Q, 2,2,1,2> E2 ## E2 ## E1 ## E2; \ + detail::_swizzle<4,T, Q, 2,2,2,0> E2 ## E2 ## E2 ## E0; \ + detail::_swizzle<4,T, Q, 2,2,2,1> E2 ## E2 ## E2 ## E1; \ + detail::_swizzle<4,T, Q, 2,2,2,2> E2 ## E2 ## E2 ## E2; #define GLM_SWIZZLE4_2_MEMBERS(T, Q, E0,E1,E2,E3) \ - struct { detail::_swizzle<2,T, Q, 0,0,-1,-2> E0 ## E0; }; \ - struct { detail::_swizzle<2,T, Q, 0,1,-1,-2> E0 ## E1; }; \ - struct { detail::_swizzle<2,T, Q, 0,2,-1,-2> E0 ## E2; }; \ - struct { detail::_swizzle<2,T, Q, 0,3,-1,-2> E0 ## E3; }; \ - struct { detail::_swizzle<2,T, Q, 1,0,-1,-2> E1 ## E0; }; \ - struct { detail::_swizzle<2,T, Q, 1,1,-1,-2> E1 ## E1; }; \ - struct { detail::_swizzle<2,T, Q, 1,2,-1,-2> E1 ## E2; }; \ - struct { detail::_swizzle<2,T, Q, 1,3,-1,-2> E1 ## E3; }; \ - struct { detail::_swizzle<2,T, Q, 2,0,-1,-2> E2 ## E0; }; \ - struct { detail::_swizzle<2,T, Q, 2,1,-1,-2> E2 ## E1; }; \ - struct { detail::_swizzle<2,T, Q, 2,2,-1,-2> E2 ## E2; }; \ - struct { detail::_swizzle<2,T, Q, 2,3,-1,-2> E2 ## E3; }; \ - struct { detail::_swizzle<2,T, Q, 3,0,-1,-2> E3 ## E0; }; \ - struct { detail::_swizzle<2,T, Q, 3,1,-1,-2> E3 ## E1; }; \ - struct { detail::_swizzle<2,T, Q, 3,2,-1,-2> E3 ## E2; }; \ - struct { detail::_swizzle<2,T, Q, 3,3,-1,-2> E3 ## E3; }; + detail::_swizzle<2,T, Q, 0,0,-1,-2> E0 ## E0; \ + detail::_swizzle<2,T, Q, 0,1,-1,-2> E0 ## E1; \ + detail::_swizzle<2,T, Q, 0,2,-1,-2> E0 ## E2; \ + detail::_swizzle<2,T, Q, 0,3,-1,-2> E0 ## E3; \ + detail::_swizzle<2,T, Q, 1,0,-1,-2> E1 ## E0; \ + detail::_swizzle<2,T, Q, 1,1,-1,-2> E1 ## E1; \ + detail::_swizzle<2,T, Q, 1,2,-1,-2> E1 ## E2; \ + detail::_swizzle<2,T, Q, 1,3,-1,-2> E1 ## E3; \ + detail::_swizzle<2,T, Q, 2,0,-1,-2> E2 ## E0; \ + detail::_swizzle<2,T, Q, 2,1,-1,-2> E2 ## E1; \ + detail::_swizzle<2,T, Q, 2,2,-1,-2> E2 ## E2; \ + detail::_swizzle<2,T, Q, 2,3,-1,-2> E2 ## E3; \ + detail::_swizzle<2,T, Q, 3,0,-1,-2> E3 ## E0; \ + detail::_swizzle<2,T, Q, 3,1,-1,-2> E3 ## E1; \ + detail::_swizzle<2,T, Q, 3,2,-1,-2> E3 ## E2; \ + detail::_swizzle<2,T, Q, 3,3,-1,-2> E3 ## E3; #define GLM_SWIZZLE4_3_MEMBERS(T, Q, E0,E1,E2,E3) \ - struct { detail::_swizzle<3, T, Q, 0,0,0,3> E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 0,0,1,3> E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 0,0,2,3> E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 0,0,3,3> E0 ## E0 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 0,1,0,3> E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 0,1,1,3> E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 0,1,2,3> E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 0,1,3,3> E0 ## E1 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 0,2,0,3> E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 0,2,1,3> E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 0,2,2,3> E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 0,2,3,3> E0 ## E2 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 0,3,0,3> E0 ## E3 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 0,3,1,3> E0 ## E3 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 0,3,2,3> E0 ## E3 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 0,3,3,3> E0 ## E3 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 1,0,0,3> E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 1,0,1,3> E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 1,0,2,3> E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 1,0,3,3> E1 ## E0 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 1,1,0,3> E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 1,1,1,3> E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 1,1,2,3> E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 1,1,3,3> E1 ## E1 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 1,2,0,3> E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 1,2,1,3> E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 1,2,2,3> E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 1,2,3,3> E1 ## E2 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 1,3,0,3> E1 ## E3 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 1,3,1,3> E1 ## E3 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 1,3,2,3> E1 ## E3 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 1,3,3,3> E1 ## E3 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 2,0,0,3> E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 2,0,1,3> E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 2,0,2,3> E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 2,0,3,3> E2 ## E0 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 2,1,0,3> E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 2,1,1,3> E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 2,1,2,3> E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 2,1,3,3> E2 ## E1 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 2,2,0,3> E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 2,2,1,3> E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 2,2,2,3> E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 2,2,3,3> E2 ## E2 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 2,3,0,3> E2 ## E3 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 2,3,1,3> E2 ## E3 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 2,3,2,3> E2 ## E3 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 2,3,3,3> E2 ## E3 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 3,0,0,3> E3 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 3,0,1,3> E3 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 3,0,2,3> E3 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 3,0,3,3> E3 ## E0 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 3,1,0,3> E3 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 3,1,1,3> E3 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 3,1,2,3> E3 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 3,1,3,3> E3 ## E1 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 3,2,0,3> E3 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 3,2,1,3> E3 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 3,2,2,3> E3 ## E2 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 3,2,3,3> E3 ## E2 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 3,3,0,3> E3 ## E3 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 3,3,1,3> E3 ## E3 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 3,3,2,3> E3 ## E3 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 3,3,3,3> E3 ## E3 ## E3; }; + detail::_swizzle<3, T, Q, 0,0,0,3> E0 ## E0 ## E0; \ + detail::_swizzle<3, T, Q, 0,0,1,3> E0 ## E0 ## E1; \ + detail::_swizzle<3, T, Q, 0,0,2,3> E0 ## E0 ## E2; \ + detail::_swizzle<3, T, Q, 0,0,3,3> E0 ## E0 ## E3; \ + detail::_swizzle<3, T, Q, 0,1,0,3> E0 ## E1 ## E0; \ + detail::_swizzle<3, T, Q, 0,1,1,3> E0 ## E1 ## E1; \ + detail::_swizzle<3, T, Q, 0,1,2,3> E0 ## E1 ## E2; \ + detail::_swizzle<3, T, Q, 0,1,3,3> E0 ## E1 ## E3; \ + detail::_swizzle<3, T, Q, 0,2,0,3> E0 ## E2 ## E0; \ + detail::_swizzle<3, T, Q, 0,2,1,3> E0 ## E2 ## E1; \ + detail::_swizzle<3, T, Q, 0,2,2,3> E0 ## E2 ## E2; \ + detail::_swizzle<3, T, Q, 0,2,3,3> E0 ## E2 ## E3; \ + detail::_swizzle<3, T, Q, 0,3,0,3> E0 ## E3 ## E0; \ + detail::_swizzle<3, T, Q, 0,3,1,3> E0 ## E3 ## E1; \ + detail::_swizzle<3, T, Q, 0,3,2,3> E0 ## E3 ## E2; \ + detail::_swizzle<3, T, Q, 0,3,3,3> E0 ## E3 ## E3; \ + detail::_swizzle<3, T, Q, 1,0,0,3> E1 ## E0 ## E0; \ + detail::_swizzle<3, T, Q, 1,0,1,3> E1 ## E0 ## E1; \ + detail::_swizzle<3, T, Q, 1,0,2,3> E1 ## E0 ## E2; \ + detail::_swizzle<3, T, Q, 1,0,3,3> E1 ## E0 ## E3; \ + detail::_swizzle<3, T, Q, 1,1,0,3> E1 ## E1 ## E0; \ + detail::_swizzle<3, T, Q, 1,1,1,3> E1 ## E1 ## E1; \ + detail::_swizzle<3, T, Q, 1,1,2,3> E1 ## E1 ## E2; \ + detail::_swizzle<3, T, Q, 1,1,3,3> E1 ## E1 ## E3; \ + detail::_swizzle<3, T, Q, 1,2,0,3> E1 ## E2 ## E0; \ + detail::_swizzle<3, T, Q, 1,2,1,3> E1 ## E2 ## E1; \ + detail::_swizzle<3, T, Q, 1,2,2,3> E1 ## E2 ## E2; \ + detail::_swizzle<3, T, Q, 1,2,3,3> E1 ## E2 ## E3; \ + detail::_swizzle<3, T, Q, 1,3,0,3> E1 ## E3 ## E0; \ + detail::_swizzle<3, T, Q, 1,3,1,3> E1 ## E3 ## E1; \ + detail::_swizzle<3, T, Q, 1,3,2,3> E1 ## E3 ## E2; \ + detail::_swizzle<3, T, Q, 1,3,3,3> E1 ## E3 ## E3; \ + detail::_swizzle<3, T, Q, 2,0,0,3> E2 ## E0 ## E0; \ + detail::_swizzle<3, T, Q, 2,0,1,3> E2 ## E0 ## E1; \ + detail::_swizzle<3, T, Q, 2,0,2,3> E2 ## E0 ## E2; \ + detail::_swizzle<3, T, Q, 2,0,3,3> E2 ## E0 ## E3; \ + detail::_swizzle<3, T, Q, 2,1,0,3> E2 ## E1 ## E0; \ + detail::_swizzle<3, T, Q, 2,1,1,3> E2 ## E1 ## E1; \ + detail::_swizzle<3, T, Q, 2,1,2,3> E2 ## E1 ## E2; \ + detail::_swizzle<3, T, Q, 2,1,3,3> E2 ## E1 ## E3; \ + detail::_swizzle<3, T, Q, 2,2,0,3> E2 ## E2 ## E0; \ + detail::_swizzle<3, T, Q, 2,2,1,3> E2 ## E2 ## E1; \ + detail::_swizzle<3, T, Q, 2,2,2,3> E2 ## E2 ## E2; \ + detail::_swizzle<3, T, Q, 2,2,3,3> E2 ## E2 ## E3; \ + detail::_swizzle<3, T, Q, 2,3,0,3> E2 ## E3 ## E0; \ + detail::_swizzle<3, T, Q, 2,3,1,3> E2 ## E3 ## E1; \ + detail::_swizzle<3, T, Q, 2,3,2,3> E2 ## E3 ## E2; \ + detail::_swizzle<3, T, Q, 2,3,3,3> E2 ## E3 ## E3; \ + detail::_swizzle<3, T, Q, 3,0,0,3> E3 ## E0 ## E0; \ + detail::_swizzle<3, T, Q, 3,0,1,3> E3 ## E0 ## E1; \ + detail::_swizzle<3, T, Q, 3,0,2,3> E3 ## E0 ## E2; \ + detail::_swizzle<3, T, Q, 3,0,3,3> E3 ## E0 ## E3; \ + detail::_swizzle<3, T, Q, 3,1,0,3> E3 ## E1 ## E0; \ + detail::_swizzle<3, T, Q, 3,1,1,3> E3 ## E1 ## E1; \ + detail::_swizzle<3, T, Q, 3,1,2,3> E3 ## E1 ## E2; \ + detail::_swizzle<3, T, Q, 3,1,3,3> E3 ## E1 ## E3; \ + detail::_swizzle<3, T, Q, 3,2,0,3> E3 ## E2 ## E0; \ + detail::_swizzle<3, T, Q, 3,2,1,3> E3 ## E2 ## E1; \ + detail::_swizzle<3, T, Q, 3,2,2,3> E3 ## E2 ## E2; \ + detail::_swizzle<3, T, Q, 3,2,3,3> E3 ## E2 ## E3; \ + detail::_swizzle<3, T, Q, 3,3,0,3> E3 ## E3 ## E0; \ + detail::_swizzle<3, T, Q, 3,3,1,3> E3 ## E3 ## E1; \ + detail::_swizzle<3, T, Q, 3,3,2,3> E3 ## E3 ## E2; \ + detail::_swizzle<3, T, Q, 3,3,3,3> E3 ## E3 ## E3; #define GLM_SWIZZLE4_4_MEMBERS(T, Q, E0,E1,E2,E3) \ - struct { detail::_swizzle<4, T, Q, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,0,3> E0 ## E0 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,1,3> E0 ## E0 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,2,3> E0 ## E0 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,3,0> E0 ## E0 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,3,1> E0 ## E0 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,3,2> E0 ## E0 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,3,3> E0 ## E0 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,0,3> E0 ## E1 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,1,3> E0 ## E1 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,2,3> E0 ## E1 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,3,0> E0 ## E1 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,3,1> E0 ## E1 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,3,2> E0 ## E1 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,3,3> E0 ## E1 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,0,3> E0 ## E2 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,1,3> E0 ## E2 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,2,3> E0 ## E2 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,3,0> E0 ## E2 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,3,1> E0 ## E2 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,3,2> E0 ## E2 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,3,3> E0 ## E2 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,0,0> E0 ## E3 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,0,1> E0 ## E3 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,0,2> E0 ## E3 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,0,3> E0 ## E3 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,1,0> E0 ## E3 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,1,1> E0 ## E3 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,1,2> E0 ## E3 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,1,3> E0 ## E3 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,2,0> E0 ## E3 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,2,1> E0 ## E3 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,2,2> E0 ## E3 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,2,3> E0 ## E3 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,3,0> E0 ## E3 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,3,1> E0 ## E3 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,3,2> E0 ## E3 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,3,3> E0 ## E3 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,0,3> E1 ## E0 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,1,3> E1 ## E0 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,2,3> E1 ## E0 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,3,0> E1 ## E0 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,3,1> E1 ## E0 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,3,2> E1 ## E0 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,3,3> E1 ## E0 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,0,3> E1 ## E1 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,1,3> E1 ## E1 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,2,3> E1 ## E1 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,3,0> E1 ## E1 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,3,1> E1 ## E1 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,3,2> E1 ## E1 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,3,3> E1 ## E1 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,0,3> E1 ## E2 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,1,3> E1 ## E2 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,2,3> E1 ## E2 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,3,0> E1 ## E2 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,3,1> E1 ## E2 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,3,2> E1 ## E2 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,3,3> E1 ## E2 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,0,0> E1 ## E3 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,0,1> E1 ## E3 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,0,2> E1 ## E3 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,0,3> E1 ## E3 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,1,0> E1 ## E3 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,1,1> E1 ## E3 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,1,2> E1 ## E3 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,1,3> E1 ## E3 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,2,0> E1 ## E3 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,2,1> E1 ## E3 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,2,2> E1 ## E3 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,2,3> E1 ## E3 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,3,0> E1 ## E3 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,3,1> E1 ## E3 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,3,2> E1 ## E3 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,3,3> E1 ## E3 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,0,3> E2 ## E0 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,1,3> E2 ## E0 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,2,3> E2 ## E0 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,3,0> E2 ## E0 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,3,1> E2 ## E0 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,3,2> E2 ## E0 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,3,3> E2 ## E0 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,0,3> E2 ## E1 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,1,3> E2 ## E1 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,2,3> E2 ## E1 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,3,0> E2 ## E1 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,3,1> E2 ## E1 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,3,2> E2 ## E1 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,3,3> E2 ## E1 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,0,3> E2 ## E2 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,1,3> E2 ## E2 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,2,3> E2 ## E2 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,3,0> E2 ## E2 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,3,1> E2 ## E2 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,3,2> E2 ## E2 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,3,3> E2 ## E2 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,0,0> E2 ## E3 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,0,1> E2 ## E3 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,0,2> E2 ## E3 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,0,3> E2 ## E3 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,1,0> E2 ## E3 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,1,1> E2 ## E3 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,1,2> E2 ## E3 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,1,3> E2 ## E3 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,2,0> E2 ## E3 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,2,1> E2 ## E3 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,2,2> E2 ## E3 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,2,3> E2 ## E3 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,3,0> E2 ## E3 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,3,1> E2 ## E3 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,3,2> E2 ## E3 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,3,3> E2 ## E3 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,0,0> E3 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,0,1> E3 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,0,2> E3 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,0,3> E3 ## E0 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,1,0> E3 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,1,1> E3 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,1,2> E3 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,1,3> E3 ## E0 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,2,0> E3 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,2,1> E3 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,2,2> E3 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,2,3> E3 ## E0 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,3,0> E3 ## E0 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,3,1> E3 ## E0 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,3,2> E3 ## E0 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,3,3> E3 ## E0 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,0,0> E3 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,0,1> E3 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,0,2> E3 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,0,3> E3 ## E1 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,1,0> E3 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,1,1> E3 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,1,2> E3 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,1,3> E3 ## E1 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,2,0> E3 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,2,1> E3 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,2,2> E3 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,2,3> E3 ## E1 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,3,0> E3 ## E1 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,3,1> E3 ## E1 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,3,2> E3 ## E1 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,3,3> E3 ## E1 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,0,0> E3 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,0,1> E3 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,0,2> E3 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,0,3> E3 ## E2 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,1,0> E3 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,1,1> E3 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,1,2> E3 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,1,3> E3 ## E2 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,2,0> E3 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,2,1> E3 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,2,2> E3 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,2,3> E3 ## E2 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,3,0> E3 ## E2 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,3,1> E3 ## E2 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,3,2> E3 ## E2 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,3,3> E3 ## E2 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,0,0> E3 ## E3 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,0,1> E3 ## E3 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,0,2> E3 ## E3 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,0,3> E3 ## E3 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,1,0> E3 ## E3 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,1,1> E3 ## E3 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,1,2> E3 ## E3 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,1,3> E3 ## E3 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,2,0> E3 ## E3 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,2,1> E3 ## E3 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,2,2> E3 ## E3 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,2,3> E3 ## E3 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,3,0> E3 ## E3 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,3,1> E3 ## E3 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,3,2> E3 ## E3 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,3,3> E3 ## E3 ## E3 ## E3; }; + detail::_swizzle<4, T, Q, 0,0,0,0> E0 ## E0 ## E0 ## E0; \ + detail::_swizzle<4, T, Q, 0,0,0,1> E0 ## E0 ## E0 ## E1; \ + detail::_swizzle<4, T, Q, 0,0,0,2> E0 ## E0 ## E0 ## E2; \ + detail::_swizzle<4, T, Q, 0,0,0,3> E0 ## E0 ## E0 ## E3; \ + detail::_swizzle<4, T, Q, 0,0,1,0> E0 ## E0 ## E1 ## E0; \ + detail::_swizzle<4, T, Q, 0,0,1,1> E0 ## E0 ## E1 ## E1; \ + detail::_swizzle<4, T, Q, 0,0,1,2> E0 ## E0 ## E1 ## E2; \ + detail::_swizzle<4, T, Q, 0,0,1,3> E0 ## E0 ## E1 ## E3; \ + detail::_swizzle<4, T, Q, 0,0,2,0> E0 ## E0 ## E2 ## E0; \ + detail::_swizzle<4, T, Q, 0,0,2,1> E0 ## E0 ## E2 ## E1; \ + detail::_swizzle<4, T, Q, 0,0,2,2> E0 ## E0 ## E2 ## E2; \ + detail::_swizzle<4, T, Q, 0,0,2,3> E0 ## E0 ## E2 ## E3; \ + detail::_swizzle<4, T, Q, 0,0,3,0> E0 ## E0 ## E3 ## E0; \ + detail::_swizzle<4, T, Q, 0,0,3,1> E0 ## E0 ## E3 ## E1; \ + detail::_swizzle<4, T, Q, 0,0,3,2> E0 ## E0 ## E3 ## E2; \ + detail::_swizzle<4, T, Q, 0,0,3,3> E0 ## E0 ## E3 ## E3; \ + detail::_swizzle<4, T, Q, 0,1,0,0> E0 ## E1 ## E0 ## E0; \ + detail::_swizzle<4, T, Q, 0,1,0,1> E0 ## E1 ## E0 ## E1; \ + detail::_swizzle<4, T, Q, 0,1,0,2> E0 ## E1 ## E0 ## E2; \ + detail::_swizzle<4, T, Q, 0,1,0,3> E0 ## E1 ## E0 ## E3; \ + detail::_swizzle<4, T, Q, 0,1,1,0> E0 ## E1 ## E1 ## E0; \ + detail::_swizzle<4, T, Q, 0,1,1,1> E0 ## E1 ## E1 ## E1; \ + detail::_swizzle<4, T, Q, 0,1,1,2> E0 ## E1 ## E1 ## E2; \ + detail::_swizzle<4, T, Q, 0,1,1,3> E0 ## E1 ## E1 ## E3; \ + detail::_swizzle<4, T, Q, 0,1,2,0> E0 ## E1 ## E2 ## E0; \ + detail::_swizzle<4, T, Q, 0,1,2,1> E0 ## E1 ## E2 ## E1; \ + detail::_swizzle<4, T, Q, 0,1,2,2> E0 ## E1 ## E2 ## E2; \ + detail::_swizzle<4, T, Q, 0,1,2,3> E0 ## E1 ## E2 ## E3; \ + detail::_swizzle<4, T, Q, 0,1,3,0> E0 ## E1 ## E3 ## E0; \ + detail::_swizzle<4, T, Q, 0,1,3,1> E0 ## E1 ## E3 ## E1; \ + detail::_swizzle<4, T, Q, 0,1,3,2> E0 ## E1 ## E3 ## E2; \ + detail::_swizzle<4, T, Q, 0,1,3,3> E0 ## E1 ## E3 ## E3; \ + detail::_swizzle<4, T, Q, 0,2,0,0> E0 ## E2 ## E0 ## E0; \ + detail::_swizzle<4, T, Q, 0,2,0,1> E0 ## E2 ## E0 ## E1; \ + detail::_swizzle<4, T, Q, 0,2,0,2> E0 ## E2 ## E0 ## E2; \ + detail::_swizzle<4, T, Q, 0,2,0,3> E0 ## E2 ## E0 ## E3; \ + detail::_swizzle<4, T, Q, 0,2,1,0> E0 ## E2 ## E1 ## E0; \ + detail::_swizzle<4, T, Q, 0,2,1,1> E0 ## E2 ## E1 ## E1; \ + detail::_swizzle<4, T, Q, 0,2,1,2> E0 ## E2 ## E1 ## E2; \ + detail::_swizzle<4, T, Q, 0,2,1,3> E0 ## E2 ## E1 ## E3; \ + detail::_swizzle<4, T, Q, 0,2,2,0> E0 ## E2 ## E2 ## E0; \ + detail::_swizzle<4, T, Q, 0,2,2,1> E0 ## E2 ## E2 ## E1; \ + detail::_swizzle<4, T, Q, 0,2,2,2> E0 ## E2 ## E2 ## E2; \ + detail::_swizzle<4, T, Q, 0,2,2,3> E0 ## E2 ## E2 ## E3; \ + detail::_swizzle<4, T, Q, 0,2,3,0> E0 ## E2 ## E3 ## E0; \ + detail::_swizzle<4, T, Q, 0,2,3,1> E0 ## E2 ## E3 ## E1; \ + detail::_swizzle<4, T, Q, 0,2,3,2> E0 ## E2 ## E3 ## E2; \ + detail::_swizzle<4, T, Q, 0,2,3,3> E0 ## E2 ## E3 ## E3; \ + detail::_swizzle<4, T, Q, 0,3,0,0> E0 ## E3 ## E0 ## E0; \ + detail::_swizzle<4, T, Q, 0,3,0,1> E0 ## E3 ## E0 ## E1; \ + detail::_swizzle<4, T, Q, 0,3,0,2> E0 ## E3 ## E0 ## E2; \ + detail::_swizzle<4, T, Q, 0,3,0,3> E0 ## E3 ## E0 ## E3; \ + detail::_swizzle<4, T, Q, 0,3,1,0> E0 ## E3 ## E1 ## E0; \ + detail::_swizzle<4, T, Q, 0,3,1,1> E0 ## E3 ## E1 ## E1; \ + detail::_swizzle<4, T, Q, 0,3,1,2> E0 ## E3 ## E1 ## E2; \ + detail::_swizzle<4, T, Q, 0,3,1,3> E0 ## E3 ## E1 ## E3; \ + detail::_swizzle<4, T, Q, 0,3,2,0> E0 ## E3 ## E2 ## E0; \ + detail::_swizzle<4, T, Q, 0,3,2,1> E0 ## E3 ## E2 ## E1; \ + detail::_swizzle<4, T, Q, 0,3,2,2> E0 ## E3 ## E2 ## E2; \ + detail::_swizzle<4, T, Q, 0,3,2,3> E0 ## E3 ## E2 ## E3; \ + detail::_swizzle<4, T, Q, 0,3,3,0> E0 ## E3 ## E3 ## E0; \ + detail::_swizzle<4, T, Q, 0,3,3,1> E0 ## E3 ## E3 ## E1; \ + detail::_swizzle<4, T, Q, 0,3,3,2> E0 ## E3 ## E3 ## E2; \ + detail::_swizzle<4, T, Q, 0,3,3,3> E0 ## E3 ## E3 ## E3; \ + detail::_swizzle<4, T, Q, 1,0,0,0> E1 ## E0 ## E0 ## E0; \ + detail::_swizzle<4, T, Q, 1,0,0,1> E1 ## E0 ## E0 ## E1; \ + detail::_swizzle<4, T, Q, 1,0,0,2> E1 ## E0 ## E0 ## E2; \ + detail::_swizzle<4, T, Q, 1,0,0,3> E1 ## E0 ## E0 ## E3; \ + detail::_swizzle<4, T, Q, 1,0,1,0> E1 ## E0 ## E1 ## E0; \ + detail::_swizzle<4, T, Q, 1,0,1,1> E1 ## E0 ## E1 ## E1; \ + detail::_swizzle<4, T, Q, 1,0,1,2> E1 ## E0 ## E1 ## E2; \ + detail::_swizzle<4, T, Q, 1,0,1,3> E1 ## E0 ## E1 ## E3; \ + detail::_swizzle<4, T, Q, 1,0,2,0> E1 ## E0 ## E2 ## E0; \ + detail::_swizzle<4, T, Q, 1,0,2,1> E1 ## E0 ## E2 ## E1; \ + detail::_swizzle<4, T, Q, 1,0,2,2> E1 ## E0 ## E2 ## E2; \ + detail::_swizzle<4, T, Q, 1,0,2,3> E1 ## E0 ## E2 ## E3; \ + detail::_swizzle<4, T, Q, 1,0,3,0> E1 ## E0 ## E3 ## E0; \ + detail::_swizzle<4, T, Q, 1,0,3,1> E1 ## E0 ## E3 ## E1; \ + detail::_swizzle<4, T, Q, 1,0,3,2> E1 ## E0 ## E3 ## E2; \ + detail::_swizzle<4, T, Q, 1,0,3,3> E1 ## E0 ## E3 ## E3; \ + detail::_swizzle<4, T, Q, 1,1,0,0> E1 ## E1 ## E0 ## E0; \ + detail::_swizzle<4, T, Q, 1,1,0,1> E1 ## E1 ## E0 ## E1; \ + detail::_swizzle<4, T, Q, 1,1,0,2> E1 ## E1 ## E0 ## E2; \ + detail::_swizzle<4, T, Q, 1,1,0,3> E1 ## E1 ## E0 ## E3; \ + detail::_swizzle<4, T, Q, 1,1,1,0> E1 ## E1 ## E1 ## E0; \ + detail::_swizzle<4, T, Q, 1,1,1,1> E1 ## E1 ## E1 ## E1; \ + detail::_swizzle<4, T, Q, 1,1,1,2> E1 ## E1 ## E1 ## E2; \ + detail::_swizzle<4, T, Q, 1,1,1,3> E1 ## E1 ## E1 ## E3; \ + detail::_swizzle<4, T, Q, 1,1,2,0> E1 ## E1 ## E2 ## E0; \ + detail::_swizzle<4, T, Q, 1,1,2,1> E1 ## E1 ## E2 ## E1; \ + detail::_swizzle<4, T, Q, 1,1,2,2> E1 ## E1 ## E2 ## E2; \ + detail::_swizzle<4, T, Q, 1,1,2,3> E1 ## E1 ## E2 ## E3; \ + detail::_swizzle<4, T, Q, 1,1,3,0> E1 ## E1 ## E3 ## E0; \ + detail::_swizzle<4, T, Q, 1,1,3,1> E1 ## E1 ## E3 ## E1; \ + detail::_swizzle<4, T, Q, 1,1,3,2> E1 ## E1 ## E3 ## E2; \ + detail::_swizzle<4, T, Q, 1,1,3,3> E1 ## E1 ## E3 ## E3; \ + detail::_swizzle<4, T, Q, 1,2,0,0> E1 ## E2 ## E0 ## E0; \ + detail::_swizzle<4, T, Q, 1,2,0,1> E1 ## E2 ## E0 ## E1; \ + detail::_swizzle<4, T, Q, 1,2,0,2> E1 ## E2 ## E0 ## E2; \ + detail::_swizzle<4, T, Q, 1,2,0,3> E1 ## E2 ## E0 ## E3; \ + detail::_swizzle<4, T, Q, 1,2,1,0> E1 ## E2 ## E1 ## E0; \ + detail::_swizzle<4, T, Q, 1,2,1,1> E1 ## E2 ## E1 ## E1; \ + detail::_swizzle<4, T, Q, 1,2,1,2> E1 ## E2 ## E1 ## E2; \ + detail::_swizzle<4, T, Q, 1,2,1,3> E1 ## E2 ## E1 ## E3; \ + detail::_swizzle<4, T, Q, 1,2,2,0> E1 ## E2 ## E2 ## E0; \ + detail::_swizzle<4, T, Q, 1,2,2,1> E1 ## E2 ## E2 ## E1; \ + detail::_swizzle<4, T, Q, 1,2,2,2> E1 ## E2 ## E2 ## E2; \ + detail::_swizzle<4, T, Q, 1,2,2,3> E1 ## E2 ## E2 ## E3; \ + detail::_swizzle<4, T, Q, 1,2,3,0> E1 ## E2 ## E3 ## E0; \ + detail::_swizzle<4, T, Q, 1,2,3,1> E1 ## E2 ## E3 ## E1; \ + detail::_swizzle<4, T, Q, 1,2,3,2> E1 ## E2 ## E3 ## E2; \ + detail::_swizzle<4, T, Q, 1,2,3,3> E1 ## E2 ## E3 ## E3; \ + detail::_swizzle<4, T, Q, 1,3,0,0> E1 ## E3 ## E0 ## E0; \ + detail::_swizzle<4, T, Q, 1,3,0,1> E1 ## E3 ## E0 ## E1; \ + detail::_swizzle<4, T, Q, 1,3,0,2> E1 ## E3 ## E0 ## E2; \ + detail::_swizzle<4, T, Q, 1,3,0,3> E1 ## E3 ## E0 ## E3; \ + detail::_swizzle<4, T, Q, 1,3,1,0> E1 ## E3 ## E1 ## E0; \ + detail::_swizzle<4, T, Q, 1,3,1,1> E1 ## E3 ## E1 ## E1; \ + detail::_swizzle<4, T, Q, 1,3,1,2> E1 ## E3 ## E1 ## E2; \ + detail::_swizzle<4, T, Q, 1,3,1,3> E1 ## E3 ## E1 ## E3; \ + detail::_swizzle<4, T, Q, 1,3,2,0> E1 ## E3 ## E2 ## E0; \ + detail::_swizzle<4, T, Q, 1,3,2,1> E1 ## E3 ## E2 ## E1; \ + detail::_swizzle<4, T, Q, 1,3,2,2> E1 ## E3 ## E2 ## E2; \ + detail::_swizzle<4, T, Q, 1,3,2,3> E1 ## E3 ## E2 ## E3; \ + detail::_swizzle<4, T, Q, 1,3,3,0> E1 ## E3 ## E3 ## E0; \ + detail::_swizzle<4, T, Q, 1,3,3,1> E1 ## E3 ## E3 ## E1; \ + detail::_swizzle<4, T, Q, 1,3,3,2> E1 ## E3 ## E3 ## E2; \ + detail::_swizzle<4, T, Q, 1,3,3,3> E1 ## E3 ## E3 ## E3; \ + detail::_swizzle<4, T, Q, 2,0,0,0> E2 ## E0 ## E0 ## E0; \ + detail::_swizzle<4, T, Q, 2,0,0,1> E2 ## E0 ## E0 ## E1; \ + detail::_swizzle<4, T, Q, 2,0,0,2> E2 ## E0 ## E0 ## E2; \ + detail::_swizzle<4, T, Q, 2,0,0,3> E2 ## E0 ## E0 ## E3; \ + detail::_swizzle<4, T, Q, 2,0,1,0> E2 ## E0 ## E1 ## E0; \ + detail::_swizzle<4, T, Q, 2,0,1,1> E2 ## E0 ## E1 ## E1; \ + detail::_swizzle<4, T, Q, 2,0,1,2> E2 ## E0 ## E1 ## E2; \ + detail::_swizzle<4, T, Q, 2,0,1,3> E2 ## E0 ## E1 ## E3; \ + detail::_swizzle<4, T, Q, 2,0,2,0> E2 ## E0 ## E2 ## E0; \ + detail::_swizzle<4, T, Q, 2,0,2,1> E2 ## E0 ## E2 ## E1; \ + detail::_swizzle<4, T, Q, 2,0,2,2> E2 ## E0 ## E2 ## E2; \ + detail::_swizzle<4, T, Q, 2,0,2,3> E2 ## E0 ## E2 ## E3; \ + detail::_swizzle<4, T, Q, 2,0,3,0> E2 ## E0 ## E3 ## E0; \ + detail::_swizzle<4, T, Q, 2,0,3,1> E2 ## E0 ## E3 ## E1; \ + detail::_swizzle<4, T, Q, 2,0,3,2> E2 ## E0 ## E3 ## E2; \ + detail::_swizzle<4, T, Q, 2,0,3,3> E2 ## E0 ## E3 ## E3; \ + detail::_swizzle<4, T, Q, 2,1,0,0> E2 ## E1 ## E0 ## E0; \ + detail::_swizzle<4, T, Q, 2,1,0,1> E2 ## E1 ## E0 ## E1; \ + detail::_swizzle<4, T, Q, 2,1,0,2> E2 ## E1 ## E0 ## E2; \ + detail::_swizzle<4, T, Q, 2,1,0,3> E2 ## E1 ## E0 ## E3; \ + detail::_swizzle<4, T, Q, 2,1,1,0> E2 ## E1 ## E1 ## E0; \ + detail::_swizzle<4, T, Q, 2,1,1,1> E2 ## E1 ## E1 ## E1; \ + detail::_swizzle<4, T, Q, 2,1,1,2> E2 ## E1 ## E1 ## E2; \ + detail::_swizzle<4, T, Q, 2,1,1,3> E2 ## E1 ## E1 ## E3; \ + detail::_swizzle<4, T, Q, 2,1,2,0> E2 ## E1 ## E2 ## E0; \ + detail::_swizzle<4, T, Q, 2,1,2,1> E2 ## E1 ## E2 ## E1; \ + detail::_swizzle<4, T, Q, 2,1,2,2> E2 ## E1 ## E2 ## E2; \ + detail::_swizzle<4, T, Q, 2,1,2,3> E2 ## E1 ## E2 ## E3; \ + detail::_swizzle<4, T, Q, 2,1,3,0> E2 ## E1 ## E3 ## E0; \ + detail::_swizzle<4, T, Q, 2,1,3,1> E2 ## E1 ## E3 ## E1; \ + detail::_swizzle<4, T, Q, 2,1,3,2> E2 ## E1 ## E3 ## E2; \ + detail::_swizzle<4, T, Q, 2,1,3,3> E2 ## E1 ## E3 ## E3; \ + detail::_swizzle<4, T, Q, 2,2,0,0> E2 ## E2 ## E0 ## E0; \ + detail::_swizzle<4, T, Q, 2,2,0,1> E2 ## E2 ## E0 ## E1; \ + detail::_swizzle<4, T, Q, 2,2,0,2> E2 ## E2 ## E0 ## E2; \ + detail::_swizzle<4, T, Q, 2,2,0,3> E2 ## E2 ## E0 ## E3; \ + detail::_swizzle<4, T, Q, 2,2,1,0> E2 ## E2 ## E1 ## E0; \ + detail::_swizzle<4, T, Q, 2,2,1,1> E2 ## E2 ## E1 ## E1; \ + detail::_swizzle<4, T, Q, 2,2,1,2> E2 ## E2 ## E1 ## E2; \ + detail::_swizzle<4, T, Q, 2,2,1,3> E2 ## E2 ## E1 ## E3; \ + detail::_swizzle<4, T, Q, 2,2,2,0> E2 ## E2 ## E2 ## E0; \ + detail::_swizzle<4, T, Q, 2,2,2,1> E2 ## E2 ## E2 ## E1; \ + detail::_swizzle<4, T, Q, 2,2,2,2> E2 ## E2 ## E2 ## E2; \ + detail::_swizzle<4, T, Q, 2,2,2,3> E2 ## E2 ## E2 ## E3; \ + detail::_swizzle<4, T, Q, 2,2,3,0> E2 ## E2 ## E3 ## E0; \ + detail::_swizzle<4, T, Q, 2,2,3,1> E2 ## E2 ## E3 ## E1; \ + detail::_swizzle<4, T, Q, 2,2,3,2> E2 ## E2 ## E3 ## E2; \ + detail::_swizzle<4, T, Q, 2,2,3,3> E2 ## E2 ## E3 ## E3; \ + detail::_swizzle<4, T, Q, 2,3,0,0> E2 ## E3 ## E0 ## E0; \ + detail::_swizzle<4, T, Q, 2,3,0,1> E2 ## E3 ## E0 ## E1; \ + detail::_swizzle<4, T, Q, 2,3,0,2> E2 ## E3 ## E0 ## E2; \ + detail::_swizzle<4, T, Q, 2,3,0,3> E2 ## E3 ## E0 ## E3; \ + detail::_swizzle<4, T, Q, 2,3,1,0> E2 ## E3 ## E1 ## E0; \ + detail::_swizzle<4, T, Q, 2,3,1,1> E2 ## E3 ## E1 ## E1; \ + detail::_swizzle<4, T, Q, 2,3,1,2> E2 ## E3 ## E1 ## E2; \ + detail::_swizzle<4, T, Q, 2,3,1,3> E2 ## E3 ## E1 ## E3; \ + detail::_swizzle<4, T, Q, 2,3,2,0> E2 ## E3 ## E2 ## E0; \ + detail::_swizzle<4, T, Q, 2,3,2,1> E2 ## E3 ## E2 ## E1; \ + detail::_swizzle<4, T, Q, 2,3,2,2> E2 ## E3 ## E2 ## E2; \ + detail::_swizzle<4, T, Q, 2,3,2,3> E2 ## E3 ## E2 ## E3; \ + detail::_swizzle<4, T, Q, 2,3,3,0> E2 ## E3 ## E3 ## E0; \ + detail::_swizzle<4, T, Q, 2,3,3,1> E2 ## E3 ## E3 ## E1; \ + detail::_swizzle<4, T, Q, 2,3,3,2> E2 ## E3 ## E3 ## E2; \ + detail::_swizzle<4, T, Q, 2,3,3,3> E2 ## E3 ## E3 ## E3; \ + detail::_swizzle<4, T, Q, 3,0,0,0> E3 ## E0 ## E0 ## E0; \ + detail::_swizzle<4, T, Q, 3,0,0,1> E3 ## E0 ## E0 ## E1; \ + detail::_swizzle<4, T, Q, 3,0,0,2> E3 ## E0 ## E0 ## E2; \ + detail::_swizzle<4, T, Q, 3,0,0,3> E3 ## E0 ## E0 ## E3; \ + detail::_swizzle<4, T, Q, 3,0,1,0> E3 ## E0 ## E1 ## E0; \ + detail::_swizzle<4, T, Q, 3,0,1,1> E3 ## E0 ## E1 ## E1; \ + detail::_swizzle<4, T, Q, 3,0,1,2> E3 ## E0 ## E1 ## E2; \ + detail::_swizzle<4, T, Q, 3,0,1,3> E3 ## E0 ## E1 ## E3; \ + detail::_swizzle<4, T, Q, 3,0,2,0> E3 ## E0 ## E2 ## E0; \ + detail::_swizzle<4, T, Q, 3,0,2,1> E3 ## E0 ## E2 ## E1; \ + detail::_swizzle<4, T, Q, 3,0,2,2> E3 ## E0 ## E2 ## E2; \ + detail::_swizzle<4, T, Q, 3,0,2,3> E3 ## E0 ## E2 ## E3; \ + detail::_swizzle<4, T, Q, 3,0,3,0> E3 ## E0 ## E3 ## E0; \ + detail::_swizzle<4, T, Q, 3,0,3,1> E3 ## E0 ## E3 ## E1; \ + detail::_swizzle<4, T, Q, 3,0,3,2> E3 ## E0 ## E3 ## E2; \ + detail::_swizzle<4, T, Q, 3,0,3,3> E3 ## E0 ## E3 ## E3; \ + detail::_swizzle<4, T, Q, 3,1,0,0> E3 ## E1 ## E0 ## E0; \ + detail::_swizzle<4, T, Q, 3,1,0,1> E3 ## E1 ## E0 ## E1; \ + detail::_swizzle<4, T, Q, 3,1,0,2> E3 ## E1 ## E0 ## E2; \ + detail::_swizzle<4, T, Q, 3,1,0,3> E3 ## E1 ## E0 ## E3; \ + detail::_swizzle<4, T, Q, 3,1,1,0> E3 ## E1 ## E1 ## E0; \ + detail::_swizzle<4, T, Q, 3,1,1,1> E3 ## E1 ## E1 ## E1; \ + detail::_swizzle<4, T, Q, 3,1,1,2> E3 ## E1 ## E1 ## E2; \ + detail::_swizzle<4, T, Q, 3,1,1,3> E3 ## E1 ## E1 ## E3; \ + detail::_swizzle<4, T, Q, 3,1,2,0> E3 ## E1 ## E2 ## E0; \ + detail::_swizzle<4, T, Q, 3,1,2,1> E3 ## E1 ## E2 ## E1; \ + detail::_swizzle<4, T, Q, 3,1,2,2> E3 ## E1 ## E2 ## E2; \ + detail::_swizzle<4, T, Q, 3,1,2,3> E3 ## E1 ## E2 ## E3; \ + detail::_swizzle<4, T, Q, 3,1,3,0> E3 ## E1 ## E3 ## E0; \ + detail::_swizzle<4, T, Q, 3,1,3,1> E3 ## E1 ## E3 ## E1; \ + detail::_swizzle<4, T, Q, 3,1,3,2> E3 ## E1 ## E3 ## E2; \ + detail::_swizzle<4, T, Q, 3,1,3,3> E3 ## E1 ## E3 ## E3; \ + detail::_swizzle<4, T, Q, 3,2,0,0> E3 ## E2 ## E0 ## E0; \ + detail::_swizzle<4, T, Q, 3,2,0,1> E3 ## E2 ## E0 ## E1; \ + detail::_swizzle<4, T, Q, 3,2,0,2> E3 ## E2 ## E0 ## E2; \ + detail::_swizzle<4, T, Q, 3,2,0,3> E3 ## E2 ## E0 ## E3; \ + detail::_swizzle<4, T, Q, 3,2,1,0> E3 ## E2 ## E1 ## E0; \ + detail::_swizzle<4, T, Q, 3,2,1,1> E3 ## E2 ## E1 ## E1; \ + detail::_swizzle<4, T, Q, 3,2,1,2> E3 ## E2 ## E1 ## E2; \ + detail::_swizzle<4, T, Q, 3,2,1,3> E3 ## E2 ## E1 ## E3; \ + detail::_swizzle<4, T, Q, 3,2,2,0> E3 ## E2 ## E2 ## E0; \ + detail::_swizzle<4, T, Q, 3,2,2,1> E3 ## E2 ## E2 ## E1; \ + detail::_swizzle<4, T, Q, 3,2,2,2> E3 ## E2 ## E2 ## E2; \ + detail::_swizzle<4, T, Q, 3,2,2,3> E3 ## E2 ## E2 ## E3; \ + detail::_swizzle<4, T, Q, 3,2,3,0> E3 ## E2 ## E3 ## E0; \ + detail::_swizzle<4, T, Q, 3,2,3,1> E3 ## E2 ## E3 ## E1; \ + detail::_swizzle<4, T, Q, 3,2,3,2> E3 ## E2 ## E3 ## E2; \ + detail::_swizzle<4, T, Q, 3,2,3,3> E3 ## E2 ## E3 ## E3; \ + detail::_swizzle<4, T, Q, 3,3,0,0> E3 ## E3 ## E0 ## E0; \ + detail::_swizzle<4, T, Q, 3,3,0,1> E3 ## E3 ## E0 ## E1; \ + detail::_swizzle<4, T, Q, 3,3,0,2> E3 ## E3 ## E0 ## E2; \ + detail::_swizzle<4, T, Q, 3,3,0,3> E3 ## E3 ## E0 ## E3; \ + detail::_swizzle<4, T, Q, 3,3,1,0> E3 ## E3 ## E1 ## E0; \ + detail::_swizzle<4, T, Q, 3,3,1,1> E3 ## E3 ## E1 ## E1; \ + detail::_swizzle<4, T, Q, 3,3,1,2> E3 ## E3 ## E1 ## E2; \ + detail::_swizzle<4, T, Q, 3,3,1,3> E3 ## E3 ## E1 ## E3; \ + detail::_swizzle<4, T, Q, 3,3,2,0> E3 ## E3 ## E2 ## E0; \ + detail::_swizzle<4, T, Q, 3,3,2,1> E3 ## E3 ## E2 ## E1; \ + detail::_swizzle<4, T, Q, 3,3,2,2> E3 ## E3 ## E2 ## E2; \ + detail::_swizzle<4, T, Q, 3,3,2,3> E3 ## E3 ## E2 ## E3; \ + detail::_swizzle<4, T, Q, 3,3,3,0> E3 ## E3 ## E3 ## E0; \ + detail::_swizzle<4, T, Q, 3,3,3,1> E3 ## E3 ## E3 ## E1; \ + detail::_swizzle<4, T, Q, 3,3,3,2> E3 ## E3 ## E3 ## E2; \ + detail::_swizzle<4, T, Q, 3,3,3,3> E3 ## E3 ## E3 ## E3; From a81871a8a4342385b52d9bb96bb65049ec913312 Mon Sep 17 00:00:00 2001 From: ZXShady <153229951+ZXShady@users.noreply.github.com> Date: Fri, 14 Mar 2025 12:00:00 +0000 Subject: [PATCH 07/12] Add simple test for `vec_swizzle` --- test/gtx/gtx_vec_swizzle.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/gtx/gtx_vec_swizzle.cpp b/test/gtx/gtx_vec_swizzle.cpp index 0b0c8b89..8fefe5ac 100644 --- a/test/gtx/gtx_vec_swizzle.cpp +++ b/test/gtx/gtx_vec_swizzle.cpp @@ -6,6 +6,27 @@ int main() int Error = 0; + + + + { + glm::ivec2 const v(1, 2); + Error += xx(v).x != xx(v).y; + Error += yy(v).x != yy(v).y; + } + + { + glm::ivec3 const v(1, 2, 3); + Error += zyx(v) != glm::ivec3(3, 2, 1); + } + + { + glm::ivec4 const v(1, 2, 3, 4); + Error += wwww(v) != glm::ivec4(4); + Error += wzyx(v) != glm::ivec4(4,3,2,1); + + } + return Error; } From a04b1af3fa2a032316095dd850aeb38f7ce54d1d Mon Sep 17 00:00:00 2001 From: ZXShady <153229951+ZXShady@users.noreply.github.com> Date: Fri, 7 Mar 2025 19:07:21 +0000 Subject: [PATCH 08/12] Remove unneccesary `vec_swizzle` overloads and added a script to generate them --- glm/gtx/vec_swizzle.hpp | 3076 +++------------------------- util/generate_swizzle_functions.py | 18 + 2 files changed, 354 insertions(+), 2740 deletions(-) create mode 100644 util/generate_swizzle_functions.py diff --git a/glm/gtx/vec_swizzle.hpp b/glm/gtx/vec_swizzle.hpp index bce96e8b..75c1ea54 100644 --- a/glm/gtx/vec_swizzle.hpp +++ b/glm/gtx/vec_swizzle.hpp @@ -24,2746 +24,342 @@ namespace glm { /// @addtogroup gtx_vec_swizzle /// @{ - // xx - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> xx(const glm::vec<1, T, Q> &v) { - return glm::vec<2, T, Q>(v.x, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> xx(const glm::vec<2, T, Q> &v) { - return glm::vec<2, T, Q>(v.x, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> xx(const glm::vec<3, T, Q> &v) { - return glm::vec<2, T, Q>(v.x, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> xx(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.x, v.x); - } - - // xy - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> xy(const glm::vec<2, T, Q> &v) { - return glm::vec<2, T, Q>(v.x, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> xy(const glm::vec<3, T, Q> &v) { - return glm::vec<2, T, Q>(v.x, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> xy(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.x, v.y); - } - - // xz - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> xz(const glm::vec<3, T, Q> &v) { - return glm::vec<2, T, Q>(v.x, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> xz(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.x, v.z); - } - - // xw - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> xw(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.x, v.w); - } - - // yx - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> yx(const glm::vec<2, T, Q> &v) { - return glm::vec<2, T, Q>(v.y, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> yx(const glm::vec<3, T, Q> &v) { - return glm::vec<2, T, Q>(v.y, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> yx(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.y, v.x); - } - - // yy - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> yy(const glm::vec<2, T, Q> &v) { - return glm::vec<2, T, Q>(v.y, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> yy(const glm::vec<3, T, Q> &v) { - return glm::vec<2, T, Q>(v.y, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> yy(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.y, v.y); - } - - // yz - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> yz(const glm::vec<3, T, Q> &v) { - return glm::vec<2, T, Q>(v.y, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> yz(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.y, v.z); - } - - // yw - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> yw(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.y, v.w); - } - - // zx - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> zx(const glm::vec<3, T, Q> &v) { - return glm::vec<2, T, Q>(v.z, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> zx(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.z, v.x); - } - - // zy - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> zy(const glm::vec<3, T, Q> &v) { - return glm::vec<2, T, Q>(v.z, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> zy(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.z, v.y); - } - - // zz - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> zz(const glm::vec<3, T, Q> &v) { - return glm::vec<2, T, Q>(v.z, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> zz(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.z, v.z); - } - - // zw - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> zw(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.z, v.w); - } - - // wx - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> wx(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.w, v.x); - } - - // wy - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> wy(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.w, v.y); - } - - // wz - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> wz(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.w, v.z); - } - - // ww - template - GLM_FUNC_QUALIFIER glm::vec<2, T, Q> ww(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.w, v.w); - } - - // xxx - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xxx(const glm::vec<1, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.x, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xxx(const glm::vec<2, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.x, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xxx(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.x, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xxx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.x, v.x); - } - - // xxy - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xxy(const glm::vec<2, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.x, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xxy(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.x, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xxy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.x, v.y); - } - - // xxz - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xxz(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.x, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xxz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.x, v.z); - } - - // xxw - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xxw(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.x, v.w); - } - - // xyx - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xyx(const glm::vec<2, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.y, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xyx(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.y, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xyx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.y, v.x); - } - - // xyy - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xyy(const glm::vec<2, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.y, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xyy(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.y, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xyy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.y, v.y); - } - - // xyz - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xyz(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.y, v.z); - } - - // xyw - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xyw(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.y, v.w); - } - - // xzx - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xzx(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.z, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xzx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.z, v.x); - } - - // xzy - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xzy(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.z, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xzy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.z, v.y); - } - - // xzz - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xzz(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.z, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xzz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.z, v.z); - } - - // xzw - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xzw(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.z, v.w); - } - - // xwx - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xwx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.w, v.x); - } - - // xwy - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xwy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.w, v.y); - } - - // xwz - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xwz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.w, v.z); - } - - // xww - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xww(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.w, v.w); - } - - // yxx - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yxx(const glm::vec<2, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.x, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yxx(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.x, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yxx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.x, v.x); - } - - // yxy - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yxy(const glm::vec<2, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.x, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yxy(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.x, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yxy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.x, v.y); - } - - // yxz - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yxz(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.x, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yxz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.x, v.z); - } - - // yxw - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yxw(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.x, v.w); - } - - // yyx - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yyx(const glm::vec<2, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.y, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yyx(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.y, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yyx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.y, v.x); - } - - // yyy - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yyy(const glm::vec<2, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.y, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yyy(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.y, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yyy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.y, v.y); - } - - // yyz - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yyz(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.y, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yyz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.y, v.z); - } - - // yyw - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yyw(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.y, v.w); - } - - // yzx - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yzx(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.z, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yzx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.z, v.x); - } - - // yzy - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yzy(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.z, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yzy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.z, v.y); - } - - // yzz - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yzz(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.z, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yzz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.z, v.z); - } - - // yzw - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yzw(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.z, v.w); - } - - // ywx - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> ywx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.w, v.x); - } - - // ywy - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> ywy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.w, v.y); - } - - // ywz - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> ywz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.w, v.z); - } - - // yww - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yww(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.w, v.w); - } - - // zxx - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zxx(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.x, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zxx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.x, v.x); - } - - // zxy - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zxy(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.x, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zxy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.x, v.y); - } - - // zxz - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zxz(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.x, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zxz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.x, v.z); - } - - // zxw - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zxw(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.x, v.w); - } - - // zyx - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zyx(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.y, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zyx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.y, v.x); - } - - // zyy - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zyy(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.y, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zyy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.y, v.y); - } - - // zyz - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zyz(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.y, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zyz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.y, v.z); - } - - // zyw - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zyw(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.y, v.w); - } - - // zzx - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zzx(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.z, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zzx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.z, v.x); - } - - // zzy - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zzy(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.z, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zzy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.z, v.y); - } - - // zzz - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zzz(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.z, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zzz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.z, v.z); - } - - // zzw - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zzw(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.z, v.w); - } - - // zwx - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zwx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.w, v.x); - } - - // zwy - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zwy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.w, v.y); - } - - // zwz - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zwz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.w, v.z); - } - - // zww - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zww(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.w, v.w); - } - - // wxx - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wxx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.x, v.x); - } - - // wxy - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wxy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.x, v.y); - } - - // wxz - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wxz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.x, v.z); - } - - // wxw - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wxw(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.x, v.w); - } - - // wyx - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wyx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.y, v.x); - } - - // wyy - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wyy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.y, v.y); - } - - // wyz - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wyz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.y, v.z); - } - - // wyw - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wyw(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.y, v.w); - } - - // wzx - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wzx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.z, v.x); - } - - // wzy - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wzy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.z, v.y); - } - - // wzz - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wzz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.z, v.z); - } - - // wzw - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wzw(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.z, v.w); - } - - // wwx - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wwx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.w, v.x); - } - - // wwy - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wwy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.w, v.y); - } - - // wwz - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wwz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.w, v.z); - } - - // www - template - GLM_FUNC_QUALIFIER glm::vec<3, T, Q> www(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.w, v.w); - } - - // xxxx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxxx(const glm::vec<1, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.x, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxxx(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.x, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxxx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.x, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.x, v.x); - } - - // xxxy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxxy(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.x, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxxy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.x, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.x, v.y); - } - - // xxxz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxxz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.x, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.x, v.z); - } - - // xxxw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.x, v.w); - } - - // xxyx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxyx(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.y, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxyx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.y, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.y, v.x); - } - - // xxyy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxyy(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.y, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxyy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.y, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.y, v.y); - } - - // xxyz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxyz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.y, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.y, v.z); - } - - // xxyw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.y, v.w); - } - - // xxzx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxzx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.z, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.z, v.x); - } - - // xxzy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxzy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.z, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.z, v.y); - } - - // xxzz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxzz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.z, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.z, v.z); - } - - // xxzw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.z, v.w); - } - - // xxwx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxwx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.w, v.x); - } - - // xxwy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxwy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.w, v.y); - } - - // xxwz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxwz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.w, v.z); - } - - // xxww - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.w, v.w); - } - - // xyxx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyxx(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.x, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyxx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.x, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.x, v.x); - } - - // xyxy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyxy(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.x, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyxy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.x, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.x, v.y); - } - - // xyxz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyxz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.x, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.x, v.z); - } - - // xyxw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.x, v.w); - } - - // xyyx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyyx(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.y, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyyx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.y, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.y, v.x); - } - - // xyyy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyyy(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.y, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyyy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.y, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.y, v.y); - } - - // xyyz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyyz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.y, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.y, v.z); - } - - // xyyw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.y, v.w); - } - - // xyzx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyzx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.z, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.z, v.x); - } - - // xyzy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyzy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.z, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.z, v.y); - } - - - // xyzw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.z, v.w); - } - - // xywx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xywx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.w, v.x); - } - - // xywy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xywy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.w, v.y); - } - - // xywz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xywz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.w, v.z); - } - - // xyww - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.w, v.w); - } - - // xzxx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzxx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.x, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.x, v.x); - } - - // xzxy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzxy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.x, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.x, v.y); - } - - // xzxz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzxz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.x, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.x, v.z); - } - - // xzxw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.x, v.w); - } - - // xzyx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzyx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.y, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.y, v.x); - } - - // xzyy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzyy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.y, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.y, v.y); - } - - // xzyz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzyz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.y, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.y, v.z); - } - - // xzyw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.y, v.w); - } - - // xzzx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzzx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.z, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.z, v.x); - } - - // xzzy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzzy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.z, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.z, v.y); - } - - // xzzz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzzz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.z, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.z, v.z); - } - - // xzzw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.z, v.w); - } - - // xzwx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzwx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.w, v.x); - } - - // xzwy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzwy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.w, v.y); - } - - // xzwz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzwz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.w, v.z); - } - - // xzww - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.w, v.w); - } - - // xwxx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.x, v.x); - } - - // xwxy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.x, v.y); - } - - // xwxz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.x, v.z); - } - - // xwxw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.x, v.w); - } - - // xwyx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.y, v.x); - } - - // xwyy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.y, v.y); - } - - // xwyz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.y, v.z); - } - - // xwyw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.y, v.w); - } - - // xwzx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.z, v.x); - } - - // xwzy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.z, v.y); - } - - // xwzz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.z, v.z); - } - - // xwzw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.z, v.w); - } - - // xwwx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwwx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.w, v.x); - } - - // xwwy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwwy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.w, v.y); - } - - // xwwz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwwz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.w, v.z); - } - - // xwww - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.w, v.w); - } - - // yxxx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxxx(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.x, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxxx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.x, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.x, v.x); - } - - // yxxy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxxy(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.x, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxxy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.x, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.x, v.y); - } - - // yxxz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxxz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.x, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.x, v.z); - } - - // yxxw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.x, v.w); - } - - // yxyx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxyx(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.y, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxyx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.y, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.y, v.x); - } - - // yxyy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxyy(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.y, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxyy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.y, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.y, v.y); - } - - // yxyz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxyz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.y, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.y, v.z); - } - - // yxyw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.y, v.w); - } - - // yxzx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxzx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.z, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.z, v.x); - } - - // yxzy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxzy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.z, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.z, v.y); - } - - // yxzz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxzz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.z, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.z, v.z); - } - - // yxzw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.z, v.w); - } - - // yxwx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxwx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.w, v.x); - } - - // yxwy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxwy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.w, v.y); - } - - // yxwz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxwz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.w, v.z); - } - - // yxww - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.w, v.w); - } - - // yyxx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyxx(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.x, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyxx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.x, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.x, v.x); - } - - // yyxy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyxy(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.x, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyxy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.x, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.x, v.y); - } - - // yyxz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyxz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.x, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.x, v.z); - } - - // yyxw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.x, v.w); - } - - // yyyx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyyx(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.y, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyyx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.y, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.y, v.x); - } - - // yyyy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyyy(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.y, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyyy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.y, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.y, v.y); - } - - // yyyz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyyz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.y, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.y, v.z); - } - - // yyyw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.y, v.w); - } - - // yyzx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyzx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.z, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.z, v.x); - } - - // yyzy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyzy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.z, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.z, v.y); - } - - // yyzz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyzz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.z, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.z, v.z); - } - - // yyzw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.z, v.w); - } - - // yywx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yywx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.w, v.x); - } - - // yywy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yywy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.w, v.y); - } - - // yywz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yywz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.w, v.z); - } - - // yyww - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.w, v.w); - } - - // yzxx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzxx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.x, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.x, v.x); - } - - // yzxy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzxy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.x, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.x, v.y); - } - - // yzxz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzxz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.x, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.x, v.z); - } - - // yzxw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.x, v.w); - } - - // yzyx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzyx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.y, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.y, v.x); - } - - // yzyy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzyy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.y, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.y, v.y); - } - - // yzyz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzyz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.y, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.y, v.z); - } - - // yzyw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.y, v.w); - } - - // yzzx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzzx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.z, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.z, v.x); - } - - // yzzy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzzy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.z, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.z, v.y); - } - - // yzzz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzzz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.z, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.z, v.z); - } - - // yzzw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.z, v.w); - } - - // yzwx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzwx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.w, v.x); - } - - // yzwy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzwy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.w, v.y); - } - - // yzwz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzwz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.w, v.z); - } - - // yzww - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.w, v.w); - } - - // ywxx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.x, v.x); - } - - // ywxy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.x, v.y); - } - - // ywxz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.x, v.z); - } - - // ywxw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.x, v.w); - } - - // ywyx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.y, v.x); - } - - // ywyy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.y, v.y); - } - - // ywyz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.y, v.z); - } - - // ywyw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.y, v.w); - } - - // ywzx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.z, v.x); - } - - // ywzy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.z, v.y); - } - - // ywzz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.z, v.z); - } - - // ywzw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.z, v.w); - } - - // ywwx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywwx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.w, v.x); - } - - // ywwy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywwy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.w, v.y); - } - - // ywwz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywwz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.w, v.z); - } - - // ywww - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.w, v.w); - } - - // zxxx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxxx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.x, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.x, v.x); - } - - // zxxy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxxy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.x, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.x, v.y); - } - - // zxxz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxxz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.x, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.x, v.z); - } - - // zxxw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.x, v.w); - } - - // zxyx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxyx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.y, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.y, v.x); - } - - // zxyy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxyy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.y, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.y, v.y); - } - - // zxyz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxyz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.y, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.y, v.z); - } - - // zxyw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.y, v.w); - } - - // zxzx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxzx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.z, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.z, v.x); - } - - // zxzy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxzy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.z, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.z, v.y); - } - - // zxzz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxzz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.z, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.z, v.z); - } - - // zxzw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.z, v.w); - } - - // zxwx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxwx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.w, v.x); - } - - // zxwy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxwy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.w, v.y); - } - - // zxwz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxwz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.w, v.z); - } - - // zxww - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.w, v.w); - } - - // zyxx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyxx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.x, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.x, v.x); - } - - // zyxy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyxy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.x, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.x, v.y); - } - - // zyxz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyxz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.x, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.x, v.z); - } - - // zyxw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.x, v.w); - } - - // zyyx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyyx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.y, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.y, v.x); - } - - // zyyy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyyy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.y, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.y, v.y); - } - - // zyyz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyyz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.y, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.y, v.z); - } - - // zyyw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.y, v.w); - } - - // zyzx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyzx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.z, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.z, v.x); - } - - // zyzy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyzy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.z, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.z, v.y); - } - - // zyzz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyzz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.z, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.z, v.z); - } - - // zyzw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.z, v.w); - } - - // zywx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zywx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.w, v.x); - } - - // zywy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zywy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.w, v.y); - } - - // zywz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zywz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.w, v.z); - } - - // zyww - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.w, v.w); - } - - // zzxx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzxx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.x, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.x, v.x); - } - - // zzxy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzxy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.x, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.x, v.y); - } - - // zzxz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzxz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.x, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.x, v.z); - } - - // zzxw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.x, v.w); - } - - // zzyx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzyx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.y, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.y, v.x); - } - - // zzyy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzyy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.y, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.y, v.y); - } - - // zzyz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzyz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.y, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.y, v.z); - } - - // zzyw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.y, v.w); - } - - // zzzx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzzx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.z, v.x); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.z, v.x); - } - - // zzzy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzzy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.z, v.y); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.z, v.y); - } - - // zzzz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzzz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.z, v.z); - } - - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.z, v.z); - } - - // zzzw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.z, v.w); - } - - // zzwx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzwx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.w, v.x); - } - - // zzwy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzwy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.w, v.y); - } - - // zzwz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzwz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.w, v.z); - } - - // zzww - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.w, v.w); - } - - // zwxx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.x, v.x); - } - - // zwxy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.x, v.y); - } - - // zwxz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.x, v.z); - } - - // zwxw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.x, v.w); - } - - // zwyx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.y, v.x); - } - - // zwyy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.y, v.y); - } - - // zwyz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.y, v.z); - } - - // zwyw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.y, v.w); - } - - // zwzx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.z, v.x); - } - - // zwzy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.z, v.y); - } - - // zwzz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.z, v.z); - } - - // zwzw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.z, v.w); - } - - // zwwx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwwx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.w, v.x); - } - - // zwwy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwwy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.w, v.y); - } - - // zwwz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwwz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.w, v.z); - } - - // zwww - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.w, v.w); - } - - // wxxx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.x, v.x); - } - - // wxxy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.x, v.y); - } - - // wxxz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.x, v.z); - } - - // wxxw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.x, v.w); - } - - // wxyx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.y, v.x); - } - - // wxyy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.y, v.y); - } - - // wxyz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.y, v.z); - } - - // wxyw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.y, v.w); - } - - // wxzx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.z, v.x); - } - - // wxzy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.z, v.y); - } - - // wxzz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.z, v.z); - } - - // wxzw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.z, v.w); - } - - // wxwx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxwx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.w, v.x); - } - - // wxwy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxwy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.w, v.y); - } - - // wxwz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxwz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.w, v.z); - } - - // wxww - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.w, v.w); - } - - // wyxx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wyxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.x, v.x); - } - - // wyxy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wyxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.x, v.y); - } - - // wyxz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wyxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.x, v.z); - } - - // wyxw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wyxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.x, v.w); - } - - // wyyx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wyyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.y, v.x); - } - - // wyyy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wyyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.y, v.y); - } - - // wyyz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wyyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.y, v.z); - } - - // wyyw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wyyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.y, v.w); - } - - // wyzx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wyzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.z, v.x); - } - - // wyzy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wyzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.z, v.y); - } - - // wyzz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wyzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.z, v.z); - } - - // wyzw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wyzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.z, v.w); - } - - // wywx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wywx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.w, v.x); - } - - // wywy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wywy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.w, v.y); - } - - // wywz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wywz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.w, v.z); - } - - // wyww - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wyww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.w, v.w); - } - - // wzxx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.x, v.x); - } - - // wzxy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.x, v.y); - } - - // wzxz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.x, v.z); - } - - // wzxw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.x, v.w); - } - - // wzyx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.y, v.x); - } - - // wzyy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.y, v.y); - } - - // wzyz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.y, v.z); - } - - // wzyw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.y, v.w); - } - - // wzzx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.z, v.x); - } - - // wzzy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.z, v.y); - } - - // wzzz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.z, v.z); - } - - // wzzw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.z, v.w); - } - - // wzwx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzwx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.w, v.x); - } - - // wzwy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzwy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.w, v.y); - } - - // wzwz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzwz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.w, v.z); - } - - // wzww - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.w, v.w); - } - - // wwxx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.x, v.x); - } - - // wwxy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.x, v.y); - } - - // wwxz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.x, v.z); - } - - // wwxw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.x, v.w); - } - - // wwyx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.y, v.x); - } - - // wwyy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.y, v.y); - } - - // wwyz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.y, v.z); - } - - // wwyw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.y, v.w); - } - - // wwzx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.z, v.x); - } - - // wwzy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.z, v.y); - } - - // wwzz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.z, v.z); - } - - // wwzw - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.z, v.w); - } - - // wwwx - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwwx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.w, v.x); - } - - // wwwy - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwwy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.w, v.y); - } - - // wwwz - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwwz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.w, v.z); - } - - // wwww - template - GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.w, v.w); - } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> xx(vec const& v) { return vec<2, T, Q>(v.x, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> xy(vec const& v) { return vec<2, T, Q>(v.x, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> xz(vec const& v) { return vec<2, T, Q>(v.x, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> xw(vec const& v) { return vec<2, T, Q>(v.x, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> yx(vec const& v) { return vec<2, T, Q>(v.y, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> yy(vec const& v) { return vec<2, T, Q>(v.y, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> yz(vec const& v) { return vec<2, T, Q>(v.y, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> yw(vec const& v) { return vec<2, T, Q>(v.y, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> zx(vec const& v) { return vec<2, T, Q>(v.z, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> zy(vec const& v) { return vec<2, T, Q>(v.z, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> zz(vec const& v) { return vec<2, T, Q>(v.z, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> zw(vec const& v) { return vec<2, T, Q>(v.z, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> wx(vec const& v) { return vec<2, T, Q>(v.w, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> wy(vec const& v) { return vec<2, T, Q>(v.w, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> wz(vec const& v) { return vec<2, T, Q>(v.w, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> ww(vec const& v) { return vec<2, T, Q>(v.w, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> xxx(vec const& v) { return vec<3, T, Q>(v.x, v.x, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> xxy(vec const& v) { return vec<3, T, Q>(v.x, v.x, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> xxz(vec const& v) { return vec<3, T, Q>(v.x, v.x, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> xxw(vec const& v) { return vec<3, T, Q>(v.x, v.x, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> xyx(vec const& v) { return vec<3, T, Q>(v.x, v.y, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> xyy(vec const& v) { return vec<3, T, Q>(v.x, v.y, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> xyz(vec const& v) { return vec<3, T, Q>(v.x, v.y, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> xyw(vec const& v) { return vec<3, T, Q>(v.x, v.y, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> xzx(vec const& v) { return vec<3, T, Q>(v.x, v.z, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> xzy(vec const& v) { return vec<3, T, Q>(v.x, v.z, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> xzz(vec const& v) { return vec<3, T, Q>(v.x, v.z, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> xzw(vec const& v) { return vec<3, T, Q>(v.x, v.z, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> xwx(vec const& v) { return vec<3, T, Q>(v.x, v.w, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> xwy(vec const& v) { return vec<3, T, Q>(v.x, v.w, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> xwz(vec const& v) { return vec<3, T, Q>(v.x, v.w, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> xww(vec const& v) { return vec<3, T, Q>(v.x, v.w, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> yxx(vec const& v) { return vec<3, T, Q>(v.y, v.x, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> yxy(vec const& v) { return vec<3, T, Q>(v.y, v.x, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> yxz(vec const& v) { return vec<3, T, Q>(v.y, v.x, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> yxw(vec const& v) { return vec<3, T, Q>(v.y, v.x, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> yyx(vec const& v) { return vec<3, T, Q>(v.y, v.y, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> yyy(vec const& v) { return vec<3, T, Q>(v.y, v.y, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> yyz(vec const& v) { return vec<3, T, Q>(v.y, v.y, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> yyw(vec const& v) { return vec<3, T, Q>(v.y, v.y, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> yzx(vec const& v) { return vec<3, T, Q>(v.y, v.z, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> yzy(vec const& v) { return vec<3, T, Q>(v.y, v.z, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> yzz(vec const& v) { return vec<3, T, Q>(v.y, v.z, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> yzw(vec const& v) { return vec<3, T, Q>(v.y, v.z, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> ywx(vec const& v) { return vec<3, T, Q>(v.y, v.w, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> ywy(vec const& v) { return vec<3, T, Q>(v.y, v.w, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> ywz(vec const& v) { return vec<3, T, Q>(v.y, v.w, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> yww(vec const& v) { return vec<3, T, Q>(v.y, v.w, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> zxx(vec const& v) { return vec<3, T, Q>(v.z, v.x, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> zxy(vec const& v) { return vec<3, T, Q>(v.z, v.x, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> zxz(vec const& v) { return vec<3, T, Q>(v.z, v.x, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> zxw(vec const& v) { return vec<3, T, Q>(v.z, v.x, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> zyx(vec const& v) { return vec<3, T, Q>(v.z, v.y, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> zyy(vec const& v) { return vec<3, T, Q>(v.z, v.y, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> zyz(vec const& v) { return vec<3, T, Q>(v.z, v.y, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> zyw(vec const& v) { return vec<3, T, Q>(v.z, v.y, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> zzx(vec const& v) { return vec<3, T, Q>(v.z, v.z, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> zzy(vec const& v) { return vec<3, T, Q>(v.z, v.z, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> zzz(vec const& v) { return vec<3, T, Q>(v.z, v.z, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> zzw(vec const& v) { return vec<3, T, Q>(v.z, v.z, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> zwx(vec const& v) { return vec<3, T, Q>(v.z, v.w, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> zwy(vec const& v) { return vec<3, T, Q>(v.z, v.w, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> zwz(vec const& v) { return vec<3, T, Q>(v.z, v.w, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> zww(vec const& v) { return vec<3, T, Q>(v.z, v.w, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> wxx(vec const& v) { return vec<3, T, Q>(v.w, v.x, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> wxy(vec const& v) { return vec<3, T, Q>(v.w, v.x, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> wxz(vec const& v) { return vec<3, T, Q>(v.w, v.x, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> wxw(vec const& v) { return vec<3, T, Q>(v.w, v.x, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> wyx(vec const& v) { return vec<3, T, Q>(v.w, v.y, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> wyy(vec const& v) { return vec<3, T, Q>(v.w, v.y, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> wyz(vec const& v) { return vec<3, T, Q>(v.w, v.y, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> wyw(vec const& v) { return vec<3, T, Q>(v.w, v.y, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> wzx(vec const& v) { return vec<3, T, Q>(v.w, v.z, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> wzy(vec const& v) { return vec<3, T, Q>(v.w, v.z, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> wzz(vec const& v) { return vec<3, T, Q>(v.w, v.z, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> wzw(vec const& v) { return vec<3, T, Q>(v.w, v.z, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> wwx(vec const& v) { return vec<3, T, Q>(v.w, v.w, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> wwy(vec const& v) { return vec<3, T, Q>(v.w, v.w, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> wwz(vec const& v) { return vec<3, T, Q>(v.w, v.w, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> www(vec const& v) { return vec<3, T, Q>(v.w, v.w, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xxxx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.x, v.x, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xxxy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.x, v.x, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xxxz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.x, v.x, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xxxw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.x, v.x, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xxyx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.x, v.y, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xxyy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.x, v.y, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xxyz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.x, v.y, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xxyw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.x, v.y, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xxzx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.x, v.z, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xxzy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.x, v.z, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xxzz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.x, v.z, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xxzw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.x, v.z, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xxwx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.x, v.w, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xxwy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.x, v.w, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xxwz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.x, v.w, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xxww(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.x, v.w, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xyxx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.y, v.x, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xyxy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.y, v.x, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xyxz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.y, v.x, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xyxw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.y, v.x, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xyyx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.y, v.y, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xyyy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.y, v.y, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xyyz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.y, v.y, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xyyw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.y, v.y, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xyzx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.y, v.z, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xyzy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.y, v.z, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xyzz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.y, v.z, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xyzw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.y, v.z, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xywx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.y, v.w, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xywy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.y, v.w, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xywz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.y, v.w, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xyww(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.y, v.w, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xzxx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.z, v.x, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xzxy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.z, v.x, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xzxz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.z, v.x, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xzxw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.z, v.x, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xzyx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.z, v.y, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xzyy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.z, v.y, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xzyz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.z, v.y, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xzyw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.z, v.y, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xzzx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.z, v.z, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xzzy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.z, v.z, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xzzz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.z, v.z, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xzzw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.z, v.z, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xzwx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.z, v.w, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xzwy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.z, v.w, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xzwz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.z, v.w, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xzww(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.z, v.w, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xwxx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.w, v.x, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xwxy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.w, v.x, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xwxz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.w, v.x, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xwxw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.w, v.x, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xwyx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.w, v.y, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xwyy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.w, v.y, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xwyz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.w, v.y, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xwyw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.w, v.y, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xwzx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.w, v.z, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xwzy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.w, v.z, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xwzz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.w, v.z, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xwzw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.w, v.z, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xwwx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.w, v.w, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xwwy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.w, v.w, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xwwz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.w, v.w, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> xwww(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.x, v.w, v.w, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yxxx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.x, v.x, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yxxy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.x, v.x, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yxxz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.x, v.x, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yxxw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.x, v.x, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yxyx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.x, v.y, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yxyy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.x, v.y, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yxyz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.x, v.y, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yxyw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.x, v.y, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yxzx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.x, v.z, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yxzy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.x, v.z, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yxzz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.x, v.z, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yxzw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.x, v.z, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yxwx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.x, v.w, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yxwy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.x, v.w, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yxwz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.x, v.w, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yxww(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.x, v.w, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yyxx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.y, v.x, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yyxy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.y, v.x, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yyxz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.y, v.x, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yyxw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.y, v.x, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yyyx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.y, v.y, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yyyy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.y, v.y, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yyyz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.y, v.y, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yyyw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.y, v.y, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yyzx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.y, v.z, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yyzy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.y, v.z, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yyzz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.y, v.z, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yyzw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.y, v.z, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yywx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.y, v.w, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yywy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.y, v.w, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yywz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.y, v.w, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yyww(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.y, v.w, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yzxx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.z, v.x, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yzxy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.z, v.x, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yzxz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.z, v.x, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yzxw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.z, v.x, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yzyx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.z, v.y, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yzyy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.z, v.y, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yzyz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.z, v.y, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yzyw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.z, v.y, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yzzx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.z, v.z, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yzzy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.z, v.z, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yzzz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.z, v.z, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yzzw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.z, v.z, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yzwx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.z, v.w, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yzwy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.z, v.w, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yzwz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.z, v.w, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> yzww(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.z, v.w, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> ywxx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.w, v.x, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> ywxy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.w, v.x, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> ywxz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.w, v.x, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> ywxw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.w, v.x, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> ywyx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.w, v.y, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> ywyy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.w, v.y, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> ywyz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.w, v.y, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> ywyw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.w, v.y, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> ywzx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.w, v.z, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> ywzy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.w, v.z, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> ywzz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.w, v.z, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> ywzw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.w, v.z, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> ywwx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.w, v.w, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> ywwy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.w, v.w, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> ywwz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.w, v.w, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> ywww(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.y, v.w, v.w, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zxxx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.x, v.x, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zxxy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.x, v.x, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zxxz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.x, v.x, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zxxw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.x, v.x, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zxyx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.x, v.y, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zxyy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.x, v.y, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zxyz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.x, v.y, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zxyw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.x, v.y, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zxzx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.x, v.z, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zxzy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.x, v.z, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zxzz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.x, v.z, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zxzw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.x, v.z, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zxwx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.x, v.w, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zxwy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.x, v.w, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zxwz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.x, v.w, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zxww(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.x, v.w, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zyxx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.y, v.x, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zyxy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.y, v.x, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zyxz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.y, v.x, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zyxw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.y, v.x, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zyyx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.y, v.y, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zyyy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.y, v.y, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zyyz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.y, v.y, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zyyw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.y, v.y, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zyzx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.y, v.z, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zyzy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.y, v.z, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zyzz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.y, v.z, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zyzw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.y, v.z, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zywx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.y, v.w, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zywy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.y, v.w, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zywz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.y, v.w, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zyww(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.y, v.w, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zzxx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.z, v.x, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zzxy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.z, v.x, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zzxz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.z, v.x, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zzxw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.z, v.x, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zzyx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.z, v.y, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zzyy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.z, v.y, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zzyz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.z, v.y, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zzyw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.z, v.y, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zzzx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.z, v.z, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zzzy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.z, v.z, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zzzz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.z, v.z, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zzzw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.z, v.z, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zzwx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.z, v.w, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zzwy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.z, v.w, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zzwz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.z, v.w, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zzww(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.z, v.w, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zwxx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.w, v.x, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zwxy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.w, v.x, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zwxz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.w, v.x, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zwxw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.w, v.x, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zwyx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.w, v.y, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zwyy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.w, v.y, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zwyz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.w, v.y, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zwyw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.w, v.y, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zwzx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.w, v.z, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zwzy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.w, v.z, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zwzz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.w, v.z, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zwzw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.w, v.z, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zwwx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.w, v.w, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zwwy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.w, v.w, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zwwz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.w, v.w, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> zwww(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.z, v.w, v.w, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wxxx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.x, v.x, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wxxy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.x, v.x, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wxxz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.x, v.x, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wxxw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.x, v.x, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wxyx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.x, v.y, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wxyy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.x, v.y, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wxyz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.x, v.y, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wxyw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.x, v.y, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wxzx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.x, v.z, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wxzy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.x, v.z, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wxzz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.x, v.z, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wxzw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.x, v.z, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wxwx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.x, v.w, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wxwy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.x, v.w, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wxwz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.x, v.w, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wxww(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.x, v.w, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wyxx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.y, v.x, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wyxy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.y, v.x, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wyxz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.y, v.x, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wyxw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.y, v.x, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wyyx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.y, v.y, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wyyy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.y, v.y, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wyyz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.y, v.y, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wyyw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.y, v.y, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wyzx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.y, v.z, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wyzy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.y, v.z, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wyzz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.y, v.z, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wyzw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.y, v.z, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wywx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.y, v.w, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wywy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.y, v.w, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wywz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.y, v.w, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wyww(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.y, v.w, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wzxx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.z, v.x, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wzxy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.z, v.x, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wzxz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.z, v.x, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wzxw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.z, v.x, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wzyx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.z, v.y, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wzyy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.z, v.y, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wzyz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.z, v.y, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wzyw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.z, v.y, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wzzx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.z, v.z, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wzzy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.z, v.z, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wzzz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.z, v.z, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wzzw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.z, v.z, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wzwx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.z, v.w, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wzwy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.z, v.w, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wzwz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.z, v.w, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wzww(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.z, v.w, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wwxx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.w, v.x, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wwxy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.w, v.x, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wwxz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.w, v.x, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wwxw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.w, v.x, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wwyx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.w, v.y, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wwyy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.w, v.y, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wwyz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.w, v.y, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wwyw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.w, v.y, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wwzx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.w, v.z, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wwzy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.w, v.z, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wwzz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.w, v.z, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wwzw(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.w, v.z, v.w); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wwwx(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.w, v.w, v.x); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wwwy(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.w, v.w, v.y); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wwwz(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.w, v.w, v.z); } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> wwww(vec<4, T, Q> const& v) { return vec<4, T, Q>(v.w, v.w, v.w, v.w); } /// @} }//namespace glm diff --git a/util/generate_swizzle_functions.py b/util/generate_swizzle_functions.py new file mode 100644 index 00000000..ad9d92d5 --- /dev/null +++ b/util/generate_swizzle_functions.py @@ -0,0 +1,18 @@ +import itertools + +def make_swizzlers(letters, vector_length): + if vector_length == 4: + template = "template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<{vector_length},T,Q> {function_name}(vec<4,T,Q> const& v) {{ return vec<4,T,Q>({swizzle}); }}" + else: + template = "template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<{vector_length},T,Q> {function_name}(vec const& v) {{ return vec<{vector_length},T,Q>({swizzle}); }}" + for perm in itertools.product(letters, repeat=vector_length): + print(template.format( + vector_length=vector_length, + function_name=''.join(perm), + swizzle=', '.join([f'v.{i}' for i in perm]) + )) + + +if __name__ == "__main__": + for i in range(2,5): + make_swizzlers(['x', 'y', 'z', 'w'], i) From de92b8fe9620590c5f58915ba5e7d1179daace84 Mon Sep 17 00:00:00 2001 From: ZXShady <153229951+ZXShady@users.noreply.github.com> Date: Fri, 14 Mar 2025 12:29:11 +0000 Subject: [PATCH 09/12] Remove overloads in `glm::hash` and specilize correctly --- glm/gtx/hash.hpp | 73 ++++++++---------------------- glm/gtx/hash.inl | 102 ++++++++---------------------------------- test/gtx/gtx_hash.cpp | 2 +- 3 files changed, 39 insertions(+), 138 deletions(-) diff --git a/glm/gtx/hash.hpp b/glm/gtx/hash.hpp index a2ac9892..8920456c 100644 --- a/glm/gtx/hash.hpp +++ b/glm/gtx/hash.hpp @@ -41,17 +41,17 @@ #include "../mat4x4.hpp" #if defined(_MSC_VER) - // MSVC uses _MSVC_LANG instead of __cplusplus - #if _MSVC_LANG < 201103L - #pragma message("GLM_GTX_hash requires C++11 standard library support") - #endif + // MSVC uses _MSVC_LANG instead of __cplusplus +#if _MSVC_LANG < 201103L +#pragma message("GLM_GTX_hash requires C++11 standard library support") +#endif #elif defined(__GNUC__) || defined(__clang__) - // GNU and Clang use __cplusplus - #if __cplusplus < 201103L - #pragma message("GLM_GTX_hash requires C++11 standard library support") - #endif + // GNU and Clang use __cplusplus +#if __cplusplus < 201103L +#pragma message("GLM_GTX_hash requires C++11 standard library support") +#endif #else - #error "Unknown compiler" +#error "Unknown compiler" #endif #if GLM_LANG & GLM_LANG_CXX11 @@ -93,62 +93,27 @@ namespace std template struct hash > { - GLM_FUNC_DECL size_t operator()(glm::tdualquat const& q) const GLM_NOEXCEPT; + GLM_FUNC_DECL size_t operator()(glm::tdualquat const& q) const GLM_NOEXCEPT; }; - template - struct hash > + template + struct hash > { - GLM_FUNC_DECL size_t operator()(glm::mat<2, 2, T,Q> const& m) const GLM_NOEXCEPT; + GLM_FUNC_DECL size_t operator()(glm::mat<2, R, T, Q> const& m) const GLM_NOEXCEPT; }; - template - struct hash > + template + struct hash > { - GLM_FUNC_DECL size_t operator()(glm::mat<2, 3, T,Q> const& m) const GLM_NOEXCEPT; + GLM_FUNC_DECL size_t operator()(glm::mat<3, R, T, Q> const& m) const GLM_NOEXCEPT; }; - template - struct hash > + template + struct hash > { - GLM_FUNC_DECL size_t operator()(glm::mat<2, 4, T,Q> const& m) const GLM_NOEXCEPT; + GLM_FUNC_DECL size_t operator()(glm::mat<4, R, T, Q> const& m) const GLM_NOEXCEPT; }; - template - struct hash > - { - GLM_FUNC_DECL size_t operator()(glm::mat<3, 2, T,Q> const& m) const GLM_NOEXCEPT; - }; - - template - struct hash > - { - GLM_FUNC_DECL size_t operator()(glm::mat<3, 3, T,Q> const& m) const GLM_NOEXCEPT; - }; - - template - struct hash > - { - GLM_FUNC_DECL size_t operator()(glm::mat<3, 4, T,Q> const& m) const GLM_NOEXCEPT; - }; - - template - struct hash > - { - GLM_FUNC_DECL size_t operator()(glm::mat<4, 2, T,Q> const& m) const GLM_NOEXCEPT; - }; - - template - struct hash > - { - GLM_FUNC_DECL size_t operator()(glm::mat<4, 3, T,Q> const& m) const GLM_NOEXCEPT; - }; - - template - struct hash > - { - GLM_FUNC_DECL size_t operator()(glm::mat<4, 4, T,Q> const& m) const GLM_NOEXCEPT; - }; } // namespace std #include "hash.inl" diff --git a/glm/gtx/hash.inl b/glm/gtx/hash.inl index bcadfe53..bfeb85fa 100644 --- a/glm/gtx/hash.inl +++ b/glm/gtx/hash.inl @@ -1,17 +1,18 @@ /// @ref gtx_hash namespace glm { -namespace detail -{ - GLM_INLINE void hash_combine(size_t &seed, size_t hash) + namespace detail { - hash += 0x9e3779b9 + (seed << 6) + (seed >> 2); - seed ^= hash; + GLM_INLINE void hash_combine(size_t& seed, size_t hash) + { + hash += 0x9e3779b9 + (seed << 6) + (seed >> 2); + seed ^= hash; + } } -}} +} + +namespace std { -namespace std -{ template GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::vec<1, T, Q> const& v) const GLM_NOEXCEPT { @@ -53,7 +54,7 @@ namespace std } template - GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::qua const& q) const GLM_NOEXCEPT + GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::qua const& q) const GLM_NOEXCEPT { size_t seed = 0; hash hasher; @@ -74,74 +75,32 @@ namespace std return seed; } - template - GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::mat<2, 2, T, Q> const& m) const GLM_NOEXCEPT + template + GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::mat<2, R, T, Q> const& m) const GLM_NOEXCEPT { size_t seed = 0; - hash > hasher; + hash > hasher; glm::detail::hash_combine(seed, hasher(m[0])); glm::detail::hash_combine(seed, hasher(m[1])); return seed; } - template - GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::mat<2, 3, T, Q> const& m) const GLM_NOEXCEPT + template + GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::mat<3, R, T, Q> const& m) const GLM_NOEXCEPT { size_t seed = 0; - hash > hasher; - glm::detail::hash_combine(seed, hasher(m[0])); - glm::detail::hash_combine(seed, hasher(m[1])); - return seed; - } - - template - GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::mat<2, 4, T, Q> const& m) const GLM_NOEXCEPT - { - size_t seed = 0; - hash > hasher; - glm::detail::hash_combine(seed, hasher(m[0])); - glm::detail::hash_combine(seed, hasher(m[1])); - return seed; - } - - template - GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::mat<3, 2, T, Q> const& m) const GLM_NOEXCEPT - { - size_t seed = 0; - hash > hasher; + hash > hasher; glm::detail::hash_combine(seed, hasher(m[0])); glm::detail::hash_combine(seed, hasher(m[1])); glm::detail::hash_combine(seed, hasher(m[2])); return seed; } - template - GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::mat<3, 3, T, Q> const& m) const GLM_NOEXCEPT + template + GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::mat<4, R, T, Q> const& m) const GLM_NOEXCEPT { size_t seed = 0; - hash > hasher; - glm::detail::hash_combine(seed, hasher(m[0])); - glm::detail::hash_combine(seed, hasher(m[1])); - glm::detail::hash_combine(seed, hasher(m[2])); - return seed; - } - - template - GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::mat<3, 4, T, Q> const& m) const GLM_NOEXCEPT - { - size_t seed = 0; - hash > hasher; - glm::detail::hash_combine(seed, hasher(m[0])); - glm::detail::hash_combine(seed, hasher(m[1])); - glm::detail::hash_combine(seed, hasher(m[2])); - return seed; - } - - template - GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::mat<4, 2, T,Q> const& m) const GLM_NOEXCEPT - { - size_t seed = 0; - hash > hasher; + hash > hasher; glm::detail::hash_combine(seed, hasher(m[0])); glm::detail::hash_combine(seed, hasher(m[1])); glm::detail::hash_combine(seed, hasher(m[2])); @@ -149,27 +108,4 @@ namespace std return seed; } - template - GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::mat<4, 3, T,Q> const& m) const GLM_NOEXCEPT - { - size_t seed = 0; - hash > hasher; - glm::detail::hash_combine(seed, hasher(m[0])); - glm::detail::hash_combine(seed, hasher(m[1])); - glm::detail::hash_combine(seed, hasher(m[2])); - glm::detail::hash_combine(seed, hasher(m[3])); - return seed; - } - - template - GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::mat<4, 4, T, Q> const& m) const GLM_NOEXCEPT - { - size_t seed = 0; - hash > hasher; - glm::detail::hash_combine(seed, hasher(m[0])); - glm::detail::hash_combine(seed, hasher(m[1])); - glm::detail::hash_combine(seed, hasher(m[2])); - glm::detail::hash_combine(seed, hasher(m[3])); - return seed; - } } diff --git a/test/gtx/gtx_hash.cpp b/test/gtx/gtx_hash.cpp index 340a3594..36f4565f 100644 --- a/test/gtx/gtx_hash.cpp +++ b/test/gtx/gtx_hash.cpp @@ -1,4 +1,4 @@ -#if __cplusplus >= 201103L +#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSVC_LANG >= 201103L) #include From b845c29ef141a45ae722e6adfe9b7adb0d7f4d28 Mon Sep 17 00:00:00 2001 From: ZXShady <153229951+ZXShady@users.noreply.github.com> Date: Fri, 14 Mar 2025 17:00:59 +0000 Subject: [PATCH 10/12] Reuse operators to implement other operators for `glm::mat` --- glm/detail/mat2xR_common_operators.hpp | 54 ++++++ glm/detail/mat2xR_common_operators.inl | 112 +++++++++++ glm/detail/mat3xR_common_operators.hpp | 54 ++++++ glm/detail/mat3xR_common_operators.inl | 120 ++++++++++++ glm/detail/mat4xR_common_operators.hpp | 54 ++++++ glm/detail/mat4xR_common_operators.inl | 128 +++++++++++++ glm/detail/mat_common_operators.hpp | 29 +++ glm/detail/mat_common_operators.inl | 39 ++++ glm/detail/type_mat2x2.hpp | 81 +------- glm/detail/type_mat2x2.inl | 211 --------------------- glm/detail/type_mat2x3.hpp | 61 +----- glm/detail/type_mat2x3.inl | 183 ------------------ glm/detail/type_mat2x4.hpp | 61 +----- glm/detail/type_mat2x4.inl | 183 ------------------ glm/detail/type_mat3x2.hpp | 63 +------ glm/detail/type_mat3x2.inl | 200 -------------------- glm/detail/type_mat3x3.hpp | 73 +------- glm/detail/type_mat3x3.inl | 231 ----------------------- glm/detail/type_mat3x4.hpp | 72 +------ glm/detail/type_mat3x4.inl | 201 -------------------- glm/detail/type_mat4x2.hpp | 63 +------ glm/detail/type_mat4x2.inl | 217 --------------------- glm/detail/type_mat4x3.hpp | 67 +------ glm/detail/type_mat4x3.inl | 217 --------------------- glm/detail/type_mat4x4.hpp | 75 +------- glm/detail/type_mat4x4.inl | 249 ------------------------- util/generate_common_mat_operators.py | 209 +++++++++++++++++++++ 27 files changed, 826 insertions(+), 2481 deletions(-) create mode 100644 glm/detail/mat2xR_common_operators.hpp create mode 100644 glm/detail/mat2xR_common_operators.inl create mode 100644 glm/detail/mat3xR_common_operators.hpp create mode 100644 glm/detail/mat3xR_common_operators.inl create mode 100644 glm/detail/mat4xR_common_operators.hpp create mode 100644 glm/detail/mat4xR_common_operators.inl create mode 100644 glm/detail/mat_common_operators.hpp create mode 100644 glm/detail/mat_common_operators.inl create mode 100644 util/generate_common_mat_operators.py diff --git a/glm/detail/mat2xR_common_operators.hpp b/glm/detail/mat2xR_common_operators.hpp new file mode 100644 index 00000000..1681f38f --- /dev/null +++ b/glm/detail/mat2xR_common_operators.hpp @@ -0,0 +1,54 @@ + +#pragma once +#include "qualifier.hpp" +#include "mat_common_operators.hpp" +namespace glm { + + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<2,R,T,Q> operator-(mat<2,R,T,Q> const& m); + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<2,R,T,Q>& operator++(mat<2,R,T,Q>& m); + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<2,R,T,Q>& operator--(mat<2,R,T,Q>& m); + +template +GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<2,R,T,Q> const& m1, mat<2,R,T,Q> const& m2); + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<2,R,T,Q> operator+(mat<2,R,T,Q> const& m1, mat<2,R,T,Q> const& m2); +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<2,R,T,Q>& operator+=(mat<2,R,T,Q>& m1, mat<2,R,U,Q> const& m2); + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<2,R,T,Q> operator-(mat<2,R,T,Q> const& m1, mat<2,R,T,Q> const& m2); +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<2,R,T,Q>& operator-=(mat<2,R,T,Q>& m1, mat<2,R,U,Q> const& m2); + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<2,R, T, Q> operator+(mat<2,R, T, Q> const& m, T scalar); +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<2,R, T, Q> operator+(T scalar,mat<2,R, T, Q> const& m); + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<2,R, T, Q> operator-(mat<2,R, T, Q> const& m, T scalar); +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<2,R, T, Q> operator-(T scalar,mat<2,R, T, Q> const& m); + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<2,R, T, Q> operator*(mat<2,R, T, Q> const& m, T scalar); +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<2,R, T, Q> operator*(T scalar,mat<2,R, T, Q> const& m); + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<2,R, T, Q> operator/(mat<2,R, T, Q> const& m, T scalar); +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<2,R, T, Q> operator/(T scalar,mat<2,R, T, Q> const& m); + +} +#ifndef GLM_EXTERNAL_TEMPLATE +#include "mat2xR_common_operators.inl" +#endif + diff --git a/glm/detail/mat2xR_common_operators.inl b/glm/detail/mat2xR_common_operators.inl new file mode 100644 index 00000000..8eba512d --- /dev/null +++ b/glm/detail/mat2xR_common_operators.inl @@ -0,0 +1,112 @@ + +namespace glm { + + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2,R,T,Q> operator-(mat<2,R,T,Q> const& m) { + return mat<2,R,T,Q>(-m[0],-m[1]); +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2,R,T,Q>& operator++(mat<2,R,T,Q>& m) { + ++m[0]; + ++m[1]; + return m; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2,R,T,Q>& operator--(mat<2,R,T,Q>& m) { + --m[0]; + --m[1]; + return m; +} + +template +GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<2,R,T,Q> const& m1, mat<2,R,T,Q> const& m2) { + return (m1[0] == m2[0]) && (m1[1] == m2[1]); +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2,R,T,Q> operator+(mat<2,R,T,Q> const& m1, mat<2,R,T,Q> const& m2) { + return mat<2,R,T,Q>(m1[0] + m2[0],m1[1] + m2[1]); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2,R,T,Q>& operator+=(mat<2,R,T,Q>& m1, mat<2,R,U,Q> const& m2) { + m1[0] += m2[0]; + m1[1] += m2[1]; + return m1; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2,R,T,Q> operator-(mat<2,R,T,Q> const& m1, mat<2,R,T,Q> const& m2) { + return mat<2,R,T,Q>(m1[0] - m2[0],m1[1] - m2[1]); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2,R,T,Q>& operator-=(mat<2,R,T,Q>& m1, mat<2,R,U,Q> const& m2) { + m1[0] -= m2[0]; + m1[1] -= m2[1]; + return m1; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2,R, T, Q> operator+(mat<2,R, T, Q> const& m, T scalar) { + return mat<2,R,T,Q>(m[0] + scalar,m[1] + scalar); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2,R, T, Q> operator+(T scalar,mat<2,R, T, Q> const& m) { + return mat<2,R,T,Q>(scalar + m[0],scalar + m[1]); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2,R,T,Q>& operator+=(mat<2,R,T,Q>& m, U scalar) { + m[0] += scalar; + m[1] += scalar; + return m; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2,R, T, Q> operator-(mat<2,R, T, Q> const& m, T scalar) { + return mat<2,R,T,Q>(m[0] - scalar,m[1] - scalar); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2,R, T, Q> operator-(T scalar,mat<2,R, T, Q> const& m) { + return mat<2,R,T,Q>(scalar - m[0],scalar - m[1]); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2,R,T,Q>& operator-=(mat<2,R,T,Q>& m, U scalar) { + m[0] -= scalar; + m[1] -= scalar; + return m; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2,R, T, Q> operator*(mat<2,R, T, Q> const& m, T scalar) { + return mat<2,R,T,Q>(m[0] * scalar,m[1] * scalar); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2,R, T, Q> operator*(T scalar,mat<2,R, T, Q> const& m) { + return mat<2,R,T,Q>(scalar * m[0],scalar * m[1]); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2,R,T,Q>& operator*=(mat<2,R,T,Q>& m, U scalar) { + m[0] *= scalar; + m[1] *= scalar; + return m; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2,R, T, Q> operator/(mat<2,R, T, Q> const& m, T scalar) { + return mat<2,R,T,Q>(m[0] / scalar,m[1] / scalar); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2,R, T, Q> operator/(T scalar,mat<2,R, T, Q> const& m) { + return mat<2,R,T,Q>(scalar / m[0],scalar / m[1]); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2,R,T,Q>& operator/=(mat<2,R,T,Q>& m, U scalar) { + m[0] /= scalar; + m[1] /= scalar; + return m; +} + +} + diff --git a/glm/detail/mat3xR_common_operators.hpp b/glm/detail/mat3xR_common_operators.hpp new file mode 100644 index 00000000..6af7e6e9 --- /dev/null +++ b/glm/detail/mat3xR_common_operators.hpp @@ -0,0 +1,54 @@ + +#pragma once +#include "qualifier.hpp" +#include "mat_common_operators.hpp" +namespace glm { + + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<3,R,T,Q> operator-(mat<3,R,T,Q> const& m); + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<3,R,T,Q>& operator++(mat<3,R,T,Q>& m); + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<3,R,T,Q>& operator--(mat<3,R,T,Q>& m); + +template +GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<3,R,T,Q> const& m1, mat<3,R,T,Q> const& m2); + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<3,R,T,Q> operator+(mat<3,R,T,Q> const& m1, mat<3,R,T,Q> const& m2); +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<3,R,T,Q>& operator+=(mat<3,R,T,Q>& m1, mat<3,R,U,Q> const& m2); + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<3,R,T,Q> operator-(mat<3,R,T,Q> const& m1, mat<3,R,T,Q> const& m2); +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<3,R,T,Q>& operator-=(mat<3,R,T,Q>& m1, mat<3,R,U,Q> const& m2); + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<3,R, T, Q> operator+(mat<3,R, T, Q> const& m, T scalar); +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<3,R, T, Q> operator+(T scalar,mat<3,R, T, Q> const& m); + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<3,R, T, Q> operator-(mat<3,R, T, Q> const& m, T scalar); +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<3,R, T, Q> operator-(T scalar,mat<3,R, T, Q> const& m); + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<3,R, T, Q> operator*(mat<3,R, T, Q> const& m, T scalar); +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<3,R, T, Q> operator*(T scalar,mat<3,R, T, Q> const& m); + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<3,R, T, Q> operator/(mat<3,R, T, Q> const& m, T scalar); +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<3,R, T, Q> operator/(T scalar,mat<3,R, T, Q> const& m); + +} +#ifndef GLM_EXTERNAL_TEMPLATE +#include "mat3xR_common_operators.inl" +#endif + diff --git a/glm/detail/mat3xR_common_operators.inl b/glm/detail/mat3xR_common_operators.inl new file mode 100644 index 00000000..8ec156ec --- /dev/null +++ b/glm/detail/mat3xR_common_operators.inl @@ -0,0 +1,120 @@ + +namespace glm { + + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3,R,T,Q> operator-(mat<3,R,T,Q> const& m) { + return mat<3,R,T,Q>(-m[0],-m[1],-m[2]); +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3,R,T,Q>& operator++(mat<3,R,T,Q>& m) { + ++m[0]; + ++m[1]; + ++m[2]; + return m; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3,R,T,Q>& operator--(mat<3,R,T,Q>& m) { + --m[0]; + --m[1]; + --m[2]; + return m; +} + +template +GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<3,R,T,Q> const& m1, mat<3,R,T,Q> const& m2) { + return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]); +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3,R,T,Q> operator+(mat<3,R,T,Q> const& m1, mat<3,R,T,Q> const& m2) { + return mat<3,R,T,Q>(m1[0] + m2[0],m1[1] + m2[1],m1[2] + m2[2]); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3,R,T,Q>& operator+=(mat<3,R,T,Q>& m1, mat<3,R,U,Q> const& m2) { + m1[0] += m2[0]; + m1[1] += m2[1]; + m1[2] += m2[2]; + return m1; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3,R,T,Q> operator-(mat<3,R,T,Q> const& m1, mat<3,R,T,Q> const& m2) { + return mat<3,R,T,Q>(m1[0] - m2[0],m1[1] - m2[1],m1[2] - m2[2]); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3,R,T,Q>& operator-=(mat<3,R,T,Q>& m1, mat<3,R,U,Q> const& m2) { + m1[0] -= m2[0]; + m1[1] -= m2[1]; + m1[2] -= m2[2]; + return m1; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3,R, T, Q> operator+(mat<3,R, T, Q> const& m, T scalar) { + return mat<3,R,T,Q>(m[0] + scalar,m[1] + scalar,m[2] + scalar); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3,R, T, Q> operator+(T scalar,mat<3,R, T, Q> const& m) { + return mat<3,R,T,Q>(scalar + m[0],scalar + m[1],scalar + m[2]); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3,R,T,Q>& operator+=(mat<3,R,T,Q>& m, U scalar) { + m[0] += scalar; + m[1] += scalar; + m[2] += scalar; + return m; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3,R, T, Q> operator-(mat<3,R, T, Q> const& m, T scalar) { + return mat<3,R,T,Q>(m[0] - scalar,m[1] - scalar,m[2] - scalar); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3,R, T, Q> operator-(T scalar,mat<3,R, T, Q> const& m) { + return mat<3,R,T,Q>(scalar - m[0],scalar - m[1],scalar - m[2]); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3,R,T,Q>& operator-=(mat<3,R,T,Q>& m, U scalar) { + m[0] -= scalar; + m[1] -= scalar; + m[2] -= scalar; + return m; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3,R, T, Q> operator*(mat<3,R, T, Q> const& m, T scalar) { + return mat<3,R,T,Q>(m[0] * scalar,m[1] * scalar,m[2] * scalar); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3,R, T, Q> operator*(T scalar,mat<3,R, T, Q> const& m) { + return mat<3,R,T,Q>(scalar * m[0],scalar * m[1],scalar * m[2]); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3,R,T,Q>& operator*=(mat<3,R,T,Q>& m, U scalar) { + m[0] *= scalar; + m[1] *= scalar; + m[2] *= scalar; + return m; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3,R, T, Q> operator/(mat<3,R, T, Q> const& m, T scalar) { + return mat<3,R,T,Q>(m[0] / scalar,m[1] / scalar,m[2] / scalar); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3,R, T, Q> operator/(T scalar,mat<3,R, T, Q> const& m) { + return mat<3,R,T,Q>(scalar / m[0],scalar / m[1],scalar / m[2]); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3,R,T,Q>& operator/=(mat<3,R,T,Q>& m, U scalar) { + m[0] /= scalar; + m[1] /= scalar; + m[2] /= scalar; + return m; +} + +} + diff --git a/glm/detail/mat4xR_common_operators.hpp b/glm/detail/mat4xR_common_operators.hpp new file mode 100644 index 00000000..2454aa74 --- /dev/null +++ b/glm/detail/mat4xR_common_operators.hpp @@ -0,0 +1,54 @@ + +#pragma once +#include "qualifier.hpp" +#include "mat_common_operators.hpp" +namespace glm { + + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<4,R,T,Q> operator-(mat<4,R,T,Q> const& m); + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<4,R,T,Q>& operator++(mat<4,R,T,Q>& m); + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<4,R,T,Q>& operator--(mat<4,R,T,Q>& m); + +template +GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<4,R,T,Q> const& m1, mat<4,R,T,Q> const& m2); + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<4,R,T,Q> operator+(mat<4,R,T,Q> const& m1, mat<4,R,T,Q> const& m2); +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<4,R,T,Q>& operator+=(mat<4,R,T,Q>& m1, mat<4,R,U,Q> const& m2); + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<4,R,T,Q> operator-(mat<4,R,T,Q> const& m1, mat<4,R,T,Q> const& m2); +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<4,R,T,Q>& operator-=(mat<4,R,T,Q>& m1, mat<4,R,U,Q> const& m2); + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<4,R, T, Q> operator+(mat<4,R, T, Q> const& m, T scalar); +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<4,R, T, Q> operator+(T scalar,mat<4,R, T, Q> const& m); + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<4,R, T, Q> operator-(mat<4,R, T, Q> const& m, T scalar); +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<4,R, T, Q> operator-(T scalar,mat<4,R, T, Q> const& m); + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<4,R, T, Q> operator*(mat<4,R, T, Q> const& m, T scalar); +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<4,R, T, Q> operator*(T scalar,mat<4,R, T, Q> const& m); + +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<4,R, T, Q> operator/(mat<4,R, T, Q> const& m, T scalar); +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<4,R, T, Q> operator/(T scalar,mat<4,R, T, Q> const& m); + +} +#ifndef GLM_EXTERNAL_TEMPLATE +#include "mat4xR_common_operators.inl" +#endif + diff --git a/glm/detail/mat4xR_common_operators.inl b/glm/detail/mat4xR_common_operators.inl new file mode 100644 index 00000000..732ec789 --- /dev/null +++ b/glm/detail/mat4xR_common_operators.inl @@ -0,0 +1,128 @@ + +namespace glm { + + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4,R,T,Q> operator-(mat<4,R,T,Q> const& m) { + return mat<4,R,T,Q>(-m[0],-m[1],-m[2],-m[3]); +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4,R,T,Q>& operator++(mat<4,R,T,Q>& m) { + ++m[0]; + ++m[1]; + ++m[2]; + ++m[3]; + return m; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4,R,T,Q>& operator--(mat<4,R,T,Q>& m) { + --m[0]; + --m[1]; + --m[2]; + --m[3]; + return m; +} + +template +GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<4,R,T,Q> const& m1, mat<4,R,T,Q> const& m2) { + return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]); +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4,R,T,Q> operator+(mat<4,R,T,Q> const& m1, mat<4,R,T,Q> const& m2) { + return mat<4,R,T,Q>(m1[0] + m2[0],m1[1] + m2[1],m1[2] + m2[2],m1[3] + m2[3]); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4,R,T,Q>& operator+=(mat<4,R,T,Q>& m1, mat<4,R,U,Q> const& m2) { + m1[0] += m2[0]; + m1[1] += m2[1]; + m1[2] += m2[2]; + m1[3] += m2[3]; + return m1; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4,R,T,Q> operator-(mat<4,R,T,Q> const& m1, mat<4,R,T,Q> const& m2) { + return mat<4,R,T,Q>(m1[0] - m2[0],m1[1] - m2[1],m1[2] - m2[2],m1[3] - m2[3]); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4,R,T,Q>& operator-=(mat<4,R,T,Q>& m1, mat<4,R,U,Q> const& m2) { + m1[0] -= m2[0]; + m1[1] -= m2[1]; + m1[2] -= m2[2]; + m1[3] -= m2[3]; + return m1; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4,R, T, Q> operator+(mat<4,R, T, Q> const& m, T scalar) { + return mat<4,R,T,Q>(m[0] + scalar,m[1] + scalar,m[2] + scalar,m[3] + scalar); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4,R, T, Q> operator+(T scalar,mat<4,R, T, Q> const& m) { + return mat<4,R,T,Q>(scalar + m[0],scalar + m[1],scalar + m[2],scalar + m[3]); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4,R,T,Q>& operator+=(mat<4,R,T,Q>& m, U scalar) { + m[0] += scalar; + m[1] += scalar; + m[2] += scalar; + m[3] += scalar; + return m; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4,R, T, Q> operator-(mat<4,R, T, Q> const& m, T scalar) { + return mat<4,R,T,Q>(m[0] - scalar,m[1] - scalar,m[2] - scalar,m[3] - scalar); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4,R, T, Q> operator-(T scalar,mat<4,R, T, Q> const& m) { + return mat<4,R,T,Q>(scalar - m[0],scalar - m[1],scalar - m[2],scalar - m[3]); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4,R,T,Q>& operator-=(mat<4,R,T,Q>& m, U scalar) { + m[0] -= scalar; + m[1] -= scalar; + m[2] -= scalar; + m[3] -= scalar; + return m; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4,R, T, Q> operator*(mat<4,R, T, Q> const& m, T scalar) { + return mat<4,R,T,Q>(m[0] * scalar,m[1] * scalar,m[2] * scalar,m[3] * scalar); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4,R, T, Q> operator*(T scalar,mat<4,R, T, Q> const& m) { + return mat<4,R,T,Q>(scalar * m[0],scalar * m[1],scalar * m[2],scalar * m[3]); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4,R,T,Q>& operator*=(mat<4,R,T,Q>& m, U scalar) { + m[0] *= scalar; + m[1] *= scalar; + m[2] *= scalar; + m[3] *= scalar; + return m; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4,R, T, Q> operator/(mat<4,R, T, Q> const& m, T scalar) { + return mat<4,R,T,Q>(m[0] / scalar,m[1] / scalar,m[2] / scalar,m[3] / scalar); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4,R, T, Q> operator/(T scalar,mat<4,R, T, Q> const& m) { + return mat<4,R,T,Q>(scalar / m[0],scalar / m[1],scalar / m[2],scalar / m[3]); +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4,R,T,Q>& operator/=(mat<4,R,T,Q>& m, U scalar) { + m[0] /= scalar; + m[1] /= scalar; + m[2] /= scalar; + m[3] /= scalar; + return m; +} + +} + diff --git a/glm/detail/mat_common_operators.hpp b/glm/detail/mat_common_operators.hpp new file mode 100644 index 00000000..cfab4b79 --- /dev/null +++ b/glm/detail/mat_common_operators.hpp @@ -0,0 +1,29 @@ +#pragma once + +#include "qualifier.hpp" + +namespace glm { + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat operator++(mat& m, int); + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat operator--(mat& m, int); + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat operator+(mat const& m); + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat const& m1, mat const& m2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR typename mat::col_type operator/(mat const& m, typename mat::row_type const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR typename mat::row_type operator/(typename mat::col_type const& v, mat const& m); + +} + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "mat_common_operators.inl" +#endif diff --git a/glm/detail/mat_common_operators.inl b/glm/detail/mat_common_operators.inl new file mode 100644 index 00000000..63494733 --- /dev/null +++ b/glm/detail/mat_common_operators.inl @@ -0,0 +1,39 @@ +namespace glm { + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat operator++(mat& m, int) { + mat Result(m); + ++m; + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat operator--(mat& m, int) { + mat Result(m); + --m; + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat operator+(mat const& m) { + return m; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat const& m1, mat const& m2) { + return !(m1 == m2); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat::col_type operator/(mat const& m, typename mat::row_type const& v) + { + return inverse(m) * v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat::row_type operator/(typename mat::col_type const& v, mat const& m) + { + return v * inverse(m); + } + +} diff --git a/glm/detail/type_mat2x2.hpp b/glm/detail/type_mat2x2.hpp index 82e9f66c..b2b3f22c 100644 --- a/glm/detail/type_mat2x2.hpp +++ b/glm/detail/type_mat2x2.hpp @@ -3,6 +3,7 @@ #pragma once +#include "mat2xR_common_operators.hpp" #include "type_vec2.hpp" #include #include @@ -27,7 +28,7 @@ namespace glm typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 2; } - GLM_FUNC_DECL GLM_CONSTEXPR col_type & operator[](length_type i) GLM_NOEXCEPT; + GLM_FUNC_DECL GLM_CONSTEXPR col_type& operator[](length_type i) GLM_NOEXCEPT; GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const GLM_NOEXCEPT; // -- Constructors -- @@ -70,69 +71,16 @@ namespace glm GLM_CTOR_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x); GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x); - // -- Unary arithmetic operators -- - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator=(mat<2, 2, U, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat& operator=(mat<2, 2, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator+=(U s); + GLM_FUNC_DECL GLM_CONSTEXPR mat& operator*=(mat<2, 2, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator+=(mat<2, 2, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator-=(U s); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator-=(mat<2, 2, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator*=(U s); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator*=(mat<2, 2, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator/=(U s); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator/=(mat<2, 2, U, Q> const& m); - - // -- Increment and decrement operators -- - - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator++ (); - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator-- (); - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator++(int); - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator--(int); + GLM_FUNC_DECL GLM_CONSTEXPR mat& operator/=(mat<2, 2, U, Q> const& m); }; - // -- Unary operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m); - // -- Binary operators -- - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator+(T scalar, mat<2, 2, T, Q> const& m); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator-(T scalar, mat<2, 2, T, Q> const& m); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator*(T scalar, mat<2, 2, T, Q> const& m); - template GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 2, T, Q>::col_type operator*(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v); @@ -148,28 +96,9 @@ namespace glm template GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator/(T scalar, mat<2, 2, T, Q> const& m); - - template - GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 2, T, Q>::col_type operator/(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 2, T, Q>::row_type operator/(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m); - template GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); - // -- Boolean operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); } //namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_mat2x2.inl b/glm/detail/type_mat2x2.inl index afb2b31e..5085296c 100644 --- a/glm/detail/type_mat2x2.inl +++ b/glm/detail/type_mat2x2.inl @@ -241,51 +241,6 @@ namespace glm return *this; } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator+=(U scalar) - { - this->value[0] += scalar; - this->value[1] += scalar; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator+=(mat<2, 2, U, Q> const& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator-=(U scalar) - { - this->value[0] -= scalar; - this->value[1] -= scalar; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator-=(mat<2, 2, U, Q> const& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator*=(U scalar) - { - this->value[0] *= scalar; - this->value[1] *= scalar; - return *this; - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator*=(mat<2, 2, U, Q> const& m) @@ -293,15 +248,6 @@ namespace glm return (*this = *this * m); } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator/=(U scalar) - { - this->value[0] /= scalar; - this->value[1] /= scalar; - return *this; - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator/=(mat<2, 2, U, Q> const& m) @@ -309,122 +255,6 @@ namespace glm return *this *= inverse(m); } - // -- Increment and decrement operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator++() - { - ++this->value[0]; - ++this->value[1]; - return *this; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator--() - { - --this->value[0]; - --this->value[1]; - return *this; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> mat<2, 2, T, Q>::operator++(int) - { - mat<2, 2, T, Q> Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> mat<2, 2, T, Q>::operator--(int) - { - mat<2, 2, T, Q> Result(*this); - --*this; - return Result; - } - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m) - { - return m; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m) - { - return mat<2, 2, T, Q>( - -m[0], - -m[1]); - } - - // -- Binary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m, T scalar) - { - return mat<2, 2, T, Q>( - m[0] + scalar, - m[1] + scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator+(T scalar, mat<2, 2, T, Q> const& m) - { - return mat<2, 2, T, Q>( - m[0] + scalar, - m[1] + scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) - { - return mat<2, 2, T, Q>( - m1[0] + m2[0], - m1[1] + m2[1]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m, T scalar) - { - return mat<2, 2, T, Q>( - m[0] - scalar, - m[1] - scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator-(T scalar, mat<2, 2, T, Q> const& m) - { - return mat<2, 2, T, Q>( - scalar - m[0], - scalar - m[1]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) - { - return mat<2, 2, T, Q>( - m1[0] - m2[0], - m1[1] - m2[1]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m, T scalar) - { - return mat<2, 2, T, Q>( - m[0] * scalar, - m[1] * scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator*(T scalar, mat<2, 2, T, Q> const& m) - { - return mat<2, 2, T, Q>( - m[0] * scalar, - m[1] * scalar); - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 2, T, Q>::col_type operator* ( @@ -485,34 +315,6 @@ namespace glm m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1]); } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m, T scalar) - { - return mat<2, 2, T, Q>( - m[0] / scalar, - m[1] / scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator/(T scalar, mat<2, 2, T, Q> const& m) - { - return mat<2, 2, T, Q>( - scalar / m[0], - scalar / m[1]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 2, T, Q>::col_type operator/(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v) - { - return inverse(m) * v; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 2, T, Q>::row_type operator/(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m) - { - return v * inverse(m); - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) { @@ -520,17 +322,4 @@ namespace glm return m1_copy /= m2; } - // -- Boolean operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]); - } } //namespace glm diff --git a/glm/detail/type_mat2x3.hpp b/glm/detail/type_mat2x3.hpp index b65d1c5c..c9b9402c 100644 --- a/glm/detail/type_mat2x3.hpp +++ b/glm/detail/type_mat2x3.hpp @@ -3,6 +3,7 @@ #pragma once +#include "mat2xR_common_operators.hpp" #include "type_vec2.hpp" #include "type_vec3.hpp" #include @@ -74,56 +75,11 @@ namespace glm // -- Unary arithmetic operators -- template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator=(mat<2, 3, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator+=(U s); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator+=(mat<2, 3, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator-=(U s); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator-=(mat<2, 3, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator*=(U s); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator/=(U s); - - // -- Increment and decrement operators -- - - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator++ (); - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator-- (); - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator++(int); - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator--(int); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat& operator=(mat<2, 3, U, Q> const& m); }; - // -- Unary operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m); - // -- Binary operators -- - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator*(T scalar, mat<2, 3, T, Q> const& m); - template GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 3, T, Q>::col_type operator*(mat<2, 3, T, Q> const& m, typename mat<2, 3, T, Q>::row_type const& v); @@ -139,19 +95,6 @@ namespace glm template GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<4, 2, T, Q> const& m2); - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator/(mat<2, 3, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator/(T scalar, mat<2, 3, T, Q> const& m); - - // -- Boolean operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_mat2x3.inl b/glm/detail/type_mat2x3.inl index c29666c3..f205f115 100644 --- a/glm/detail/type_mat2x3.inl +++ b/glm/detail/type_mat2x3.inl @@ -241,160 +241,6 @@ namespace glm return *this; } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator+=(U s) - { - this->value[0] += s; - this->value[1] += s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator+=(mat<2, 3, U, Q> const& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator-=(U s) - { - this->value[0] -= s; - this->value[1] -= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator-=(mat<2, 3, U, Q> const& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator*=(U s) - { - this->value[0] *= s; - this->value[1] *= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator/=(U s) - { - this->value[0] /= s; - this->value[1] /= s; - return *this; - } - - // -- Increment and decrement operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator++() - { - ++this->value[0]; - ++this->value[1]; - return *this; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator--() - { - --this->value[0]; - --this->value[1]; - return *this; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> mat<2, 3, T, Q>::operator++(int) - { - mat<2, 3, T, Q> Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> mat<2, 3, T, Q>::operator--(int) - { - mat<2, 3, T, Q> Result(*this); - --*this; - return Result; - } - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m) - { - return m; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m) - { - return mat<2, 3, T, Q>( - -m[0], - -m[1]); - } - - // -- Binary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m, T scalar) - { - return mat<2, 3, T, Q>( - m[0] + scalar, - m[1] + scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) - { - return mat<2, 3, T, Q>( - m1[0] + m2[0], - m1[1] + m2[1]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m, T scalar) - { - return mat<2, 3, T, Q>( - m[0] - scalar, - m[1] - scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) - { - return mat<2, 3, T, Q>( - m1[0] - m2[0], - m1[1] - m2[1]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m, T scalar) - { - return mat<2, 3, T, Q>( - m[0] * scalar, - m[1] * scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator*(T scalar, mat<2, 3, T, Q> const& m) - { - return mat<2, 3, T, Q>( - m[0] * scalar, - m[1] * scalar); - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 3, T, Q>::col_type operator* ( @@ -463,33 +309,4 @@ namespace glm m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1]); } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator/(mat<2, 3, T, Q> const& m, T scalar) - { - return mat<2, 3, T, Q>( - m[0] / scalar, - m[1] / scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator/(T scalar, mat<2, 3, T, Q> const& m) - { - return mat<2, 3, T, Q>( - scalar / m[0], - scalar / m[1]); - } - - // -- Boolean operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]); - } } //namespace glm diff --git a/glm/detail/type_mat2x4.hpp b/glm/detail/type_mat2x4.hpp index 7ca43e59..99c64846 100644 --- a/glm/detail/type_mat2x4.hpp +++ b/glm/detail/type_mat2x4.hpp @@ -3,6 +3,7 @@ #pragma once +#include "mat2xR_common_operators.hpp" #include "type_vec2.hpp" #include "type_vec4.hpp" #include @@ -76,56 +77,11 @@ namespace glm // -- Unary arithmetic operators -- template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator=(mat<2, 4, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator+=(U s); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator+=(mat<2, 4, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator-=(U s); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator-=(mat<2, 4, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator*=(U s); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator/=(U s); - - // -- Increment and decrement operators -- - - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator++ (); - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator-- (); - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator++(int); - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator--(int); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat& operator=(mat<2, 4, U, Q> const& m); }; - // -- Unary operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m); - // -- Binary operators -- - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator*(T scalar, mat<2, 4, T, Q> const& m); - template GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 4, T, Q>::col_type operator*(mat<2, 4, T, Q> const& m, typename mat<2, 4, T, Q>::row_type const& v); @@ -141,19 +97,6 @@ namespace glm template GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<3, 2, T, Q> const& m2); - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator/(mat<2, 4, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator/(T scalar, mat<2, 4, T, Q> const& m); - - // -- Boolean operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_mat2x4.inl b/glm/detail/type_mat2x4.inl index bde07ced..27a714b0 100644 --- a/glm/detail/type_mat2x4.inl +++ b/glm/detail/type_mat2x4.inl @@ -243,160 +243,6 @@ namespace glm return *this; } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator+=(U s) - { - this->value[0] += s; - this->value[1] += s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator+=(mat<2, 4, U, Q> const& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator-=(U s) - { - this->value[0] -= s; - this->value[1] -= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator-=(mat<2, 4, U, Q> const& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator*=(U s) - { - this->value[0] *= s; - this->value[1] *= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> & mat<2, 4, T, Q>::operator/=(U s) - { - this->value[0] /= s; - this->value[1] /= s; - return *this; - } - - // -- Increment and decrement operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator++() - { - ++this->value[0]; - ++this->value[1]; - return *this; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator--() - { - --this->value[0]; - --this->value[1]; - return *this; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> mat<2, 4, T, Q>::operator++(int) - { - mat<2, 4, T, Q> Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> mat<2, 4, T, Q>::operator--(int) - { - mat<2, 4, T, Q> Result(*this); - --*this; - return Result; - } - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m) - { - return m; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m) - { - return mat<2, 4, T, Q>( - -m[0], - -m[1]); - } - - // -- Binary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m, T scalar) - { - return mat<2, 4, T, Q>( - m[0] + scalar, - m[1] + scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) - { - return mat<2, 4, T, Q>( - m1[0] + m2[0], - m1[1] + m2[1]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m, T scalar) - { - return mat<2, 4, T, Q>( - m[0] - scalar, - m[1] - scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) - { - return mat<2, 4, T, Q>( - m1[0] - m2[0], - m1[1] - m2[1]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m, T scalar) - { - return mat<2, 4, T, Q>( - m[0] * scalar, - m[1] * scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator*(T scalar, mat<2, 4, T, Q> const& m) - { - return mat<2, 4, T, Q>( - m[0] * scalar, - m[1] * scalar); - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 4, T, Q>::col_type operator*(mat<2, 4, T, Q> const& m, typename mat<2, 4, T, Q>::row_type const& v) { @@ -469,33 +315,4 @@ namespace glm m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1]); } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator/(mat<2, 4, T, Q> const& m, T scalar) - { - return mat<2, 4, T, Q>( - m[0] / scalar, - m[1] / scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator/(T scalar, mat<2, 4, T, Q> const& m) - { - return mat<2, 4, T, Q>( - scalar / m[0], - scalar / m[1]); - } - - // -- Boolean operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]); - } } //namespace glm diff --git a/glm/detail/type_mat3x2.hpp b/glm/detail/type_mat3x2.hpp index 0249befd..58765cc8 100644 --- a/glm/detail/type_mat3x2.hpp +++ b/glm/detail/type_mat3x2.hpp @@ -3,6 +3,7 @@ #pragma once +#include "mat3xR_common_operators.hpp" #include "type_vec2.hpp" #include "type_vec3.hpp" #include @@ -81,56 +82,11 @@ namespace glm // -- Unary arithmetic operators -- template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator=(mat<3, 2, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator+=(U s); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator+=(mat<3, 2, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator-=(U s); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator-=(mat<3, 2, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator*=(U s); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator/=(U s); - - // -- Increment and decrement operators -- - - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator++ (); - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator-- (); - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator++(int); - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator--(int); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat& operator=(mat<3, 2, U, Q> const& m); }; // -- Unary operators -- - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m); - - // -- Binary operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator*(T scalar, mat<3, 2, T, Q> const& m); - template GLM_FUNC_DECL GLM_CONSTEXPR typename mat<3, 2, T, Q>::col_type operator*(mat<3, 2, T, Q> const& m, typename mat<3, 2, T, Q>::row_type const& v); @@ -145,21 +101,6 @@ namespace glm template GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<4, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator/(mat<3, 2, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator/(T scalar, mat<3, 2, T, Q> const& m); - - // -- Boolean operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); - }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_mat3x2.inl b/glm/detail/type_mat3x2.inl index dc7654d1..5d2c9609 100644 --- a/glm/detail/type_mat3x2.inl +++ b/glm/detail/type_mat3x2.inl @@ -261,175 +261,6 @@ namespace glm return *this; } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator+=(U s) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator+=(mat<3, 2, U, Q> const& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator-=(U s) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator-=(mat<3, 2, U, Q> const& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator*=(U s) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> & mat<3, 2, T, Q>::operator/=(U s) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - return *this; - } - - // -- Increment and decrement operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator++() - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - return *this; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator--() - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - return *this; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> mat<3, 2, T, Q>::operator++(int) - { - mat<3, 2, T, Q> Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> mat<3, 2, T, Q>::operator--(int) - { - mat<3, 2, T, Q> Result(*this); - --*this; - return Result; - } - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m) - { - return m; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m) - { - return mat<3, 2, T, Q>( - -m[0], - -m[1], - -m[2]); - } - - // -- Binary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m, T scalar) - { - return mat<3, 2, T, Q>( - m[0] + scalar, - m[1] + scalar, - m[2] + scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) - { - return mat<3, 2, T, Q>( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m, T scalar) - { - return mat<3, 2, T, Q>( - m[0] - scalar, - m[1] - scalar, - m[2] - scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) - { - return mat<3, 2, T, Q>( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m, T scalar) - { - return mat<3, 2, T, Q>( - m[0] * scalar, - m[1] * scalar, - m[2] * scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator*(T scalar, mat<3, 2, T, Q> const& m) - { - return mat<3, 2, T, Q>( - m[0] * scalar, - m[1] * scalar, - m[2] * scalar); - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 2, T, Q>::col_type operator*(mat<3, 2, T, Q> const& m, typename mat<3, 2, T, Q>::row_type const& v) { @@ -483,35 +314,4 @@ namespace glm m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2]); } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator/(mat<3, 2, T, Q> const& m, T scalar) - { - return mat<3, 2, T, Q>( - m[0] / scalar, - m[1] / scalar, - m[2] / scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator/(T scalar, mat<3, 2, T, Q> const& m) - { - return mat<3, 2, T, Q>( - scalar / m[0], - scalar / m[1], - scalar / m[2]); - } - - // -- Boolean operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]); - } } //namespace glm diff --git a/glm/detail/type_mat3x3.hpp b/glm/detail/type_mat3x3.hpp index e4cbbdce..4a397cbb 100644 --- a/glm/detail/type_mat3x3.hpp +++ b/glm/detail/type_mat3x3.hpp @@ -3,6 +3,7 @@ #pragma once +#include "mat3xR_common_operators.hpp" #include "type_vec3.hpp" #include #include @@ -80,66 +81,15 @@ namespace glm // -- Unary arithmetic operators -- template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator=(mat<3, 3, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator+=(U s); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator+=(mat<3, 3, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator-=(U s); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator-=(mat<3, 3, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator*=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat& operator=(mat<3, 3, U, Q> const& m); template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator*=(mat<3, 3, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator/=(U s); - template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator/=(mat<3, 3, U, Q> const& m); - - // -- Increment and decrement operators -- - - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator++(); - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator--(); - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator++(int); - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator--(int); }; // -- Unary operators -- - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m); - - // -- Binary operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator+(T scalar, mat<3, 3, T, Q> const& m); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator-(T scalar, mat<3, 3, T, Q> const& m); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator*(T scalar, mat<3, 3, T, Q> const& m); - template GLM_FUNC_DECL GLM_CONSTEXPR typename mat<3, 3, T, Q>::col_type operator*(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v); @@ -155,28 +105,9 @@ namespace glm template GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator/(T scalar, mat<3, 3, T, Q> const& m); - - template - GLM_FUNC_DECL GLM_CONSTEXPR typename mat<3, 3, T, Q>::col_type operator/(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR typename mat<3, 3, T, Q>::row_type operator/(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m); - template GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); - // -- Boolean operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_mat3x3.inl b/glm/detail/type_mat3x3.inl index d81bdf29..4bf4451d 100644 --- a/glm/detail/type_mat3x3.inl +++ b/glm/detail/type_mat3x3.inl @@ -264,57 +264,6 @@ namespace glm return *this; } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator+=(U s) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator+=(mat<3, 3, U, Q> const& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator-=(U s) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator-=(mat<3, 3, U, Q> const& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator*=(U s) - { - col_type sv(s); - this->value[0] *= sv; - this->value[1] *= sv; - this->value[2] *= sv; - return *this; - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator*=(mat<3, 3, U, Q> const& m) @@ -322,16 +271,6 @@ namespace glm return (*this = *this * m); } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator/=(U s) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - return *this; - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator/=(mat<3, 3, U, Q> const& m) @@ -339,133 +278,6 @@ namespace glm return *this *= inverse(m); } - // -- Increment and decrement operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator++() - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - return *this; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator--() - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - return *this; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> mat<3, 3, T, Q>::operator++(int) - { - mat<3, 3, T, Q> Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> mat<3, 3, T, Q>::operator--(int) - { - mat<3, 3, T, Q> Result(*this); - --*this; - return Result; - } - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m) - { - return m; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m) - { - return mat<3, 3, T, Q>( - -m[0], - -m[1], - -m[2]); - } - - // -- Binary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m, T scalar) - { - return mat<3, 3, T, Q>( - m[0] + scalar, - m[1] + scalar, - m[2] + scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator+(T scalar, mat<3, 3, T, Q> const& m) - { - return mat<3, 3, T, Q>( - m[0] + scalar, - m[1] + scalar, - m[2] + scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) - { - return mat<3, 3, T, Q>( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m, T scalar) - { - return mat<3, 3, T, Q>( - m[0] - scalar, - m[1] - scalar, - m[2] - scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator-(T scalar, mat<3, 3, T, Q> const& m) - { - return mat<3, 3, T, Q>( - scalar - m[0], - scalar - m[1], - scalar - m[2]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) - { - return mat<3, 3, T, Q>( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m, T scalar) - { - return mat<3, 3, T, Q>( - m[0] * scalar, - m[1] * scalar, - m[2] * scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator*(T scalar, mat<3, 3, T, Q> const& m) - { - return mat<3, 3, T, Q>( - m[0] * scalar, - m[1] * scalar, - m[2] * scalar); - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 3, T, Q>::col_type operator*(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v) { @@ -578,36 +390,6 @@ namespace glm m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1] + m1[2][2] * m2[3][2]); } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m, T scalar) - { - return mat<3, 3, T, Q>( - m[0] / scalar, - m[1] / scalar, - m[2] / scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator/(T scalar, mat<3, 3, T, Q> const& m) - { - return mat<3, 3, T, Q>( - scalar / m[0], - scalar / m[1], - scalar / m[2]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 3, T, Q>::col_type operator/(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v) - { - return inverse(m) * v; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 3, T, Q>::row_type operator/(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m) - { - return v * inverse(m); - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) { @@ -615,17 +397,4 @@ namespace glm return m1_copy /= m2; } - // -- Boolean operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]); - } } //namespace glm diff --git a/glm/detail/type_mat3x4.hpp b/glm/detail/type_mat3x4.hpp index f9913d27..ded2c351 100644 --- a/glm/detail/type_mat3x4.hpp +++ b/glm/detail/type_mat3x4.hpp @@ -3,6 +3,7 @@ #pragma once +#include "mat3xR_common_operators.hpp" #include "type_vec3.hpp" #include "type_vec4.hpp" #include @@ -28,7 +29,7 @@ namespace glm typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 3; } - GLM_FUNC_DECL GLM_CONSTEXPR col_type & operator[](length_type i) GLM_NOEXCEPT; + GLM_FUNC_DECL GLM_CONSTEXPR col_type& operator[](length_type i) GLM_NOEXCEPT; GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const GLM_NOEXCEPT; // -- Constructors -- @@ -78,59 +79,11 @@ namespace glm GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x); GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x); - // -- Unary arithmetic operators -- + template + GLM_FUNC_DECL GLM_CONSTEXPR mat& operator=(mat<3, 4, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator=(mat<3, 4, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator+=(U s); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator+=(mat<3, 4, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator-=(U s); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator-=(mat<3, 4, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator*=(U s); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator/=(U s); - - // -- Increment and decrement operators -- - - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator++(); - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator--(); - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator++(int); - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator--(int); }; - // -- Unary operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m); - - // -- Binary operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator*(T scalar, mat<3, 4, T, Q> const& m); - template GLM_FUNC_DECL GLM_CONSTEXPR typename mat<3, 4, T, Q>::col_type operator*(mat<3, 4, T, Q> const& m, typename mat<3, 4, T, Q>::row_type const& v); @@ -138,27 +91,14 @@ namespace glm GLM_FUNC_DECL GLM_CONSTEXPR typename mat<3, 4, T, Q>::row_type operator*(typename mat<3, 4, T, Q>::col_type const& v, mat<3, 4, T, Q> const& m); template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<4, 3, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<4, 3, T, Q> const& m2); template GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<2, 3, T, Q> const& m2); template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<3, 3, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<3, 3, T, Q> const& m2); - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator/(mat<3, 4, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator/(T scalar, mat<3, 4, T, Q> const& m); - - // -- Boolean operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_mat3x4.inl b/glm/detail/type_mat3x4.inl index a4afac0d..7c1cd6bd 100644 --- a/glm/detail/type_mat3x4.inl +++ b/glm/detail/type_mat3x4.inl @@ -267,175 +267,6 @@ namespace glm return *this; } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator+=(U s) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator+=(mat<3, 4, U, Q> const& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator-=(U s) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator-=(mat<3, 4, U, Q> const& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator*=(U s) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> & mat<3, 4, T, Q>::operator/=(U s) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - return *this; - } - - // -- Increment and decrement operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator++() - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - return *this; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator--() - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - return *this; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> mat<3, 4, T, Q>::operator++(int) - { - mat<3, 4, T, Q> Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> mat<3, 4, T, Q>::operator--(int) - { - mat<3, 4, T, Q> Result(*this); - --*this; - return Result; - } - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m) - { - return m; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m) - { - return mat<3, 4, T, Q>( - -m[0], - -m[1], - -m[2]); - } - - // -- Binary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m, T scalar) - { - return mat<3, 4, T, Q>( - m[0] + scalar, - m[1] + scalar, - m[2] + scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) - { - return mat<3, 4, T, Q>( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m, T scalar) - { - return mat<3, 4, T, Q>( - m[0] - scalar, - m[1] - scalar, - m[2] - scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) - { - return mat<3, 4, T, Q>( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m, T scalar) - { - return mat<3, 4, T, Q>( - m[0] * scalar, - m[1] * scalar, - m[2] * scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator*(T scalar, mat<3, 4, T, Q> const& m) - { - return mat<3, 4, T, Q>( - m[0] * scalar, - m[1] * scalar, - m[2] * scalar); - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 4, T, Q>::col_type operator* ( @@ -516,36 +347,4 @@ namespace glm m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1] + m1[2][2] * m2[2][2], m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1] + m1[2][3] * m2[2][2]); } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator/(mat<3, 4, T, Q> const& m, T scalar) - { - return mat<3, 4, T, Q>( - m[0] / scalar, - m[1] / scalar, - m[2] / scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator/(T scalar, mat<3, 4, T, Q> const& m) - { - return mat<3, 4, T, Q>( - scalar / m[0], - scalar / m[1], - scalar / m[2]); - } - - // -- Boolean operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]); - } } //namespace glm diff --git a/glm/detail/type_mat4x2.hpp b/glm/detail/type_mat4x2.hpp index 7057d4ce..4425ed6c 100644 --- a/glm/detail/type_mat4x2.hpp +++ b/glm/detail/type_mat4x2.hpp @@ -3,6 +3,7 @@ #pragma once +#include "mat4xR_common_operators.hpp" #include "type_vec2.hpp" #include "type_vec4.hpp" #include @@ -83,59 +84,12 @@ namespace glm GLM_CTOR_DECL mat(mat<4, 3, T, Q> const& x); GLM_CTOR_DECL mat(mat<3, 4, T, Q> const& x); - // -- Unary arithmetic operators -- - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator=(mat<4, 2, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator+=(U s); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator+=(mat<4, 2, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator-=(U s); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator-=(mat<4, 2, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator*=(U s); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator/=(U s); - - // -- Increment and decrement operators -- - - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator++ (); - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator-- (); - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator++(int); - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator--(int); + GLM_FUNC_DECL GLM_CONSTEXPR mat& operator=(mat<4, 2, U, Q> const& m); }; // -- Unary operators -- - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m); - - // -- Binary operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator*(T scalar, mat<4, 2, T, Q> const& m); - template GLM_FUNC_DECL GLM_CONSTEXPR typename mat<4, 2, T, Q>::col_type operator*(mat<4, 2, T, Q> const& m, typename mat<4, 2, T, Q>::row_type const& v); @@ -151,19 +105,6 @@ namespace glm template GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<4, 4, T, Q> const& m2); - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator/(mat<4, 2, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator/(T scalar, mat<4, 2, T, Q> const& m); - - // -- Boolean operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_mat4x2.inl b/glm/detail/type_mat4x2.inl index 0b7ff048..0ef59a55 100644 --- a/glm/detail/type_mat4x2.inl +++ b/glm/detail/type_mat4x2.inl @@ -281,190 +281,6 @@ namespace glm return *this; } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator+=(U s) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - this->value[3] += s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator+=(mat<4, 2, U, Q> const& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - this->value[3] += m[3]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator-=(U s) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - this->value[3] -= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator-=(mat<4, 2, U, Q> const& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - this->value[3] -= m[3]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator*=(U s) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - this->value[3] *= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator/=(U s) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - this->value[3] /= s; - return *this; - } - - // -- Increment and decrement operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator++() - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - ++this->value[3]; - return *this; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator--() - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - --this->value[3]; - return *this; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> mat<4, 2, T, Q>::operator++(int) - { - mat<4, 2, T, Q> Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> mat<4, 2, T, Q>::operator--(int) - { - mat<4, 2, T, Q> Result(*this); - --*this; - return Result; - } - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m) - { - return m; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m) - { - return mat<4, 2, T, Q>( - -m[0], - -m[1], - -m[2], - -m[3]); - } - - // -- Binary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m, T scalar) - { - return mat<4, 2, T, Q>( - m[0] + scalar, - m[1] + scalar, - m[2] + scalar, - m[3] + scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) - { - return mat<4, 2, T, Q>( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2], - m1[3] + m2[3]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m, T scalar) - { - return mat<4, 2, T, Q>( - m[0] - scalar, - m[1] - scalar, - m[2] - scalar, - m[3] - scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) - { - return mat<4, 2, T, Q>( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2], - m1[3] - m2[3]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m, T scalar) - { - return mat<4, 2, T, Q>( - m[0] * scalar, - m[1] * scalar, - m[2] * scalar, - m[3] * scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator*(T scalar, mat<4, 2, T, Q> const& m) - { - return mat<4, 2, T, Q>( - m[0] * scalar, - m[1] * scalar, - m[2] * scalar, - m[3] * scalar); - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 2, T, Q>::col_type operator*(mat<4, 2, T, Q> const& m, typename mat<4, 2, T, Q>::row_type const& v) { @@ -519,37 +335,4 @@ namespace glm m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2] + m1[3][1] * m2[3][3]); } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator/(mat<4, 2, T, Q> const& m, T scalar) - { - return mat<4, 2, T, Q>( - m[0] / scalar, - m[1] / scalar, - m[2] / scalar, - m[3] / scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator/(T scalar, mat<4, 2, T, Q> const& m) - { - return mat<4, 2, T, Q>( - scalar / m[0], - scalar / m[1], - scalar / m[2], - scalar / m[3]); - } - - // -- Boolean operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]); - } } //namespace glm diff --git a/glm/detail/type_mat4x3.hpp b/glm/detail/type_mat4x3.hpp index 52a38d87..357cd6bb 100644 --- a/glm/detail/type_mat4x3.hpp +++ b/glm/detail/type_mat4x3.hpp @@ -3,6 +3,7 @@ #pragma once +#include "mat4xR_common_operators.hpp" #include "type_vec3.hpp" #include "type_vec4.hpp" #include @@ -28,7 +29,7 @@ namespace glm typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 4; } - GLM_FUNC_DECL GLM_CONSTEXPR col_type & operator[](length_type i) GLM_NOEXCEPT; + GLM_FUNC_DECL GLM_CONSTEXPR col_type& operator[](length_type i) GLM_NOEXCEPT; GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const GLM_NOEXCEPT; // -- Constructors -- @@ -83,58 +84,11 @@ namespace glm GLM_CTOR_DECL mat(mat<4, 2, T, Q> const& x); GLM_CTOR_DECL mat(mat<3, 4, T, Q> const& x); - // -- Unary arithmetic operators -- template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator=(mat<4, 3, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator+=(U s); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator+=(mat<4, 3, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator-=(U s); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator-=(mat<4, 3, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator*=(U s); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator/=(U s); - - // -- Increment and decrement operators -- - - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q>& operator++(); - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q>& operator--(); - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator++(int); - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator--(int); + GLM_FUNC_DECL GLM_CONSTEXPR mat& operator=(mat<4, 3, U, Q> const& m); }; - // -- Unary operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m); - - // -- Binary operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator*(T scalar, mat<4, 3, T, Q> const& m); template GLM_FUNC_DECL GLM_CONSTEXPR typename mat<4, 3, T, Q>::col_type operator*(mat<4, 3, T, Q> const& m, typename mat<4, 3, T, Q>::row_type const& v); @@ -146,24 +100,11 @@ namespace glm GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<2, 4, T, Q> const& m2); template - GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<3, 4, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<3, 4, T, Q> const& m2); template GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<4, 4, T, Q> const& m2); - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator/(mat<4, 3, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator/(T scalar, mat<4, 3, T, Q> const& m); - - // -- Boolean operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_mat4x3.inl b/glm/detail/type_mat4x3.inl index ab438ffc..9284e82b 100644 --- a/glm/detail/type_mat4x3.inl +++ b/glm/detail/type_mat4x3.inl @@ -281,190 +281,6 @@ namespace glm return *this; } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator+=(U s) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - this->value[3] += s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator+=(mat<4, 3, U, Q> const& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - this->value[3] += m[3]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator-=(U s) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - this->value[3] -= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator-=(mat<4, 3, U, Q> const& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - this->value[3] -= m[3]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator*=(U s) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - this->value[3] *= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator/=(U s) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - this->value[3] /= s; - return *this; - } - - // -- Increment and decrement operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator++() - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - ++this->value[3]; - return *this; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator--() - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - --this->value[3]; - return *this; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> mat<4, 3, T, Q>::operator++(int) - { - mat<4, 3, T, Q> Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> mat<4, 3, T, Q>::operator--(int) - { - mat<4, 3, T, Q> Result(*this); - --*this; - return Result; - } - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m) - { - return m; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m) - { - return mat<4, 3, T, Q>( - -m[0], - -m[1], - -m[2], - -m[3]); - } - - // -- Binary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m, T scalar) - { - return mat<4, 3, T, Q>( - m[0] + scalar, - m[1] + scalar, - m[2] + scalar, - m[3] + scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) - { - return mat<4, 3, T, Q>( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2], - m1[3] + m2[3]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m, T scalar) - { - return mat<4, 3, T, Q>( - m[0] - scalar, - m[1] - scalar, - m[2] - scalar, - m[3] - scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) - { - return mat<4, 3, T, Q>( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2], - m1[3] - m2[3]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m, T scalar) - { - return mat<4, 3, T, Q>( - m[0] * scalar, - m[1] * scalar, - m[2] * scalar, - m[3] * scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator*(T scalar, mat<4, 3, T, Q> const& m) - { - return mat<4, 3, T, Q>( - m[0] * scalar, - m[1] * scalar, - m[2] * scalar, - m[3] * scalar); - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 3, T, Q>::col_type operator* ( @@ -535,37 +351,4 @@ namespace glm m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1] + m1[2][2] * m2[3][2] + m1[3][2] * m2[3][3]); } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator/(mat<4, 3, T, Q> const& m, T scalar) - { - return mat<4, 3, T, Q>( - m[0] / scalar, - m[1] / scalar, - m[2] / scalar, - m[3] / scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator/(T scalar, mat<4, 3, T, Q> const& m) - { - return mat<4, 3, T, Q>( - scalar / m[0], - scalar / m[1], - scalar / m[2], - scalar / m[3]); - } - - // -- Boolean operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]); - } } //namespace glm diff --git a/glm/detail/type_mat4x4.hpp b/glm/detail/type_mat4x4.hpp index ad7597b8..51824aed 100644 --- a/glm/detail/type_mat4x4.hpp +++ b/glm/detail/type_mat4x4.hpp @@ -3,6 +3,7 @@ #pragma once +#include "mat4xR_common_operators.hpp" #include "type_vec4.hpp" #include #include @@ -85,66 +86,13 @@ namespace glm // -- Unary arithmetic operators -- template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator=(mat<4, 4, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator+=(U s); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator+=(mat<4, 4, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator-=(U s); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator-=(mat<4, 4, U, Q> const& m); - template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator*=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat& operator=(mat<4, 4, U, Q> const& m); template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator*=(mat<4, 4, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator/=(U s); - template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator/=(mat<4, 4, U, Q> const& m); - - // -- Increment and decrement operators -- - - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator++(); - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator--(); - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator++(int); - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator--(int); }; - // -- Unary operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m); - - // -- Binary operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator+(T scalar, mat<4, 4, T, Q> const& m); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator-(T scalar, mat<4, 4, T, Q> const& m); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator*(T scalar, mat<4, 4, T, Q> const& m); - template GLM_FUNC_DECL GLM_CONSTEXPR typename mat<4, 4, T, Q>::col_type operator*(mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v); @@ -160,28 +108,9 @@ namespace glm template GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator/(T scalar, mat<4, 4, T, Q> const& m); - - template - GLM_FUNC_DECL GLM_CONSTEXPR typename mat<4, 4, T, Q>::col_type operator/(mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR typename mat<4, 4, T, Q>::row_type operator/(typename mat<4, 4, T, Q>::col_type const& v, mat<4, 4, T, Q> const& m); - template GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); - // -- Boolean operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_mat4x4.inl b/glm/detail/type_mat4x4.inl index 9b812034..2d4cf176 100644 --- a/glm/detail/type_mat4x4.inl +++ b/glm/detail/type_mat4x4.inl @@ -315,61 +315,6 @@ namespace glm return *this; } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator+=(U s) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - this->value[3] += s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator+=(mat<4, 4, U, Q> const& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - this->value[3] += m[3]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator-=(U s) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - this->value[3] -= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator-=(mat<4, 4, U, Q> const& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - this->value[3] -= m[3]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator*=(U s) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - this->value[3] *= s; - return *this; - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator*=(mat<4, 4, U, Q> const& m) @@ -377,17 +322,6 @@ namespace glm return (*this = *this * m); } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator/=(U s) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - this->value[3] /= s; - return *this; - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator/=(mat<4, 4, U, Q> const& m) @@ -395,144 +329,6 @@ namespace glm return *this *= inverse(m); } - // -- Increment and decrement operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator++() - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - ++this->value[3]; - return *this; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator--() - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - --this->value[3]; - return *this; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> mat<4, 4, T, Q>::operator++(int) - { - mat<4, 4, T, Q> Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> mat<4, 4, T, Q>::operator--(int) - { - mat<4, 4, T, Q> Result(*this); - --*this; - return Result; - } - - // -- Unary constant operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m) - { - return m; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m) - { - return mat<4, 4, T, Q>( - -m[0], - -m[1], - -m[2], - -m[3]); - } - - // -- Binary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m, T scalar) - { - return mat<4, 4, T, Q>( - m[0] + scalar, - m[1] + scalar, - m[2] + scalar, - m[3] + scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator+(T scalar, mat<4, 4, T, Q> const& m) - { - return mat<4, 4, T, Q>( - m[0] + scalar, - m[1] + scalar, - m[2] + scalar, - m[3] + scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) - { - return mat<4, 4, T, Q>( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2], - m1[3] + m2[3]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m, T scalar) - { - return mat<4, 4, T, Q>( - m[0] - scalar, - m[1] - scalar, - m[2] - scalar, - m[3] - scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator-(T scalar, mat<4, 4, T, Q> const& m) - { - return mat<4, 4, T, Q>( - scalar - m[0], - scalar - m[1], - scalar - m[2], - scalar - m[3]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) - { - return mat<4, 4, T, Q>( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2], - m1[3] - m2[3]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m, T scalar) - { - return mat<4, 4, T, Q>( - m[0] * scalar, - m[1] * scalar, - m[2] * scalar, - m[3] * scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator*(T scalar, mat<4, 4, T, Q> const& m) - { - return mat<4, 4, T, Q>( - m[0] * scalar, - m[1] * scalar, - m[2] * scalar, - m[3] * scalar); - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 4, T, Q>::col_type operator* ( @@ -706,38 +502,6 @@ namespace glm return detail::mul4x4::value>::call(m1, m2); } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m, T scalar) - { - return mat<4, 4, T, Q>( - m[0] / scalar, - m[1] / scalar, - m[2] / scalar, - m[3] / scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator/(T scalar, mat<4, 4, T, Q> const& m) - { - return mat<4, 4, T, Q>( - scalar / m[0], - scalar / m[1], - scalar / m[2], - scalar / m[3]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 4, T, Q>::col_type operator/(mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v) - { - return inverse(m) * v; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 4, T, Q>::row_type operator/(typename mat<4, 4, T, Q>::col_type const& v, mat<4, 4, T, Q> const& m) - { - return v * inverse(m); - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) { @@ -745,19 +509,6 @@ namespace glm return m1_copy /= m2; } - // -- Boolean operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]); - } }//namespace glm #if GLM_CONFIG_SIMD == GLM_ENABLE diff --git a/util/generate_common_mat_operators.py b/util/generate_common_mat_operators.py new file mode 100644 index 00000000..500c1216 --- /dev/null +++ b/util/generate_common_mat_operators.py @@ -0,0 +1,209 @@ +import itertools +import sys + +def make_unary_minus(column_count,filename): + mat_def = f"mat<{column_count},R,T,Q>" + sys.stdout = open(f"{filename}.hpp", 'a') + print(f""" +template +GLM_FUNC_DECL GLM_CONSTEXPR {mat_def} operator-({mat_def} const& m); +""" ,end="") + sys.stdout.close() + + sys.stdout = open(f"{filename}.inl", 'a') + print(f""" +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR {mat_def} operator-({mat_def} const& m) {{ + return {mat_def}({",".join([f"-m[{i}]" for i in range(0,column_count)])}); +}} +""" ,end="") + sys.stdout.close() + + + + + + +def make_prefix_incr_decr_funcs(column_count,filename): + op_symbols = ["++","--"] + sys.stdout = open(f"{filename}.hpp", 'a') + mat_def = f"mat<{column_count},R,T,Q>" + for op_symbol in op_symbols: + print(f""" +template +GLM_FUNC_DECL GLM_CONSTEXPR {mat_def}& operator{op_symbol}({mat_def}& m); +""" ,end="") + sys.stdout.close() + + sys.stdout = open(f"{filename}.inl", 'a') + for op_symbol in op_symbols: + print(f""" +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR {mat_def}& operator{op_symbol}({mat_def}& m) {{ + {" ".join([f"{op_symbol}m[{i}];" + ("\n" if i != column_count-1 else "") for i in range(0,column_count)])} + return m; +}} +""" ,end="") + sys.stdout.close() + + + + +def make_equality_funcs(column_count,filename): + sys.stdout = open(f"{filename}.hpp", 'a') + mat_def = f"mat<{column_count},R,T,Q>" + print(f""" +template +GLM_FUNC_DECL GLM_CONSTEXPR bool operator==({mat_def} const& m1, {mat_def} const& m2); +""" ,end="") + sys.stdout.close() + + sys.stdout = open(f"{filename}.inl", 'a') + print(f""" +template +GLM_FUNC_DECL GLM_CONSTEXPR bool operator==({mat_def} const& m1, {mat_def} const& m2) {{ + return {" && ".join([f"(m1[{i}] == m2[{i}])" for i in range(0,column_count)])}; +}} +""" ,end="") + sys.stdout.close() + +def make_binary_scalar_funcs(op_symbols,column_count,filename): + mat_def = f"mat<{column_count},R,T,Q>" + col_range = range(0,column_count) + template = """ +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<{column_count},R, T, Q> operator{op_symbol}(mat<{column_count},R, T, Q> const& m, T scalar); +template +GLM_FUNC_DECL GLM_CONSTEXPR mat<{column_count},R, T, Q> operator{op_symbol}(T scalar,mat<{column_count},R, T, Q> const& m); +""" + sys.stdout = open(f"{filename}.hpp", 'a') + for op_symbol in op_symbols: + print(template.format( + op_symbol= op_symbol, + column_count= column_count + ),end="") + sys.stdout.close() + + + sys.stdout = open(f"{filename}.inl", 'a') + for op_symbol in op_symbols: + print(f""" +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<{column_count},R, T, Q> operator{op_symbol}(mat<{column_count},R, T, Q> const& m, T scalar) {{ + return mat<{column_count},R,T,Q>({",".join([f"m[{i}] {op_symbol} scalar" for i in range(0,column_count)])}); +}} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<{column_count},R, T, Q> operator{op_symbol}(T scalar,mat<{column_count},R, T, Q> const& m) {{ + return mat<{column_count},R,T,Q>({",".join([f"scalar {op_symbol} m[{i}]" for i in range(0,column_count)])}); +}} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR {mat_def}& operator{op_symbol}=({mat_def}& m, U scalar) {{ + {" ".join([f"m[{i}] {op_symbol}= scalar;" + ("\n" if i != col_range.stop-1 else "") for i in col_range])} + return m; +}} +""",end="") + sys.stdout.close() + + +def make_binary_mat_funcs(op_symbols,column_count,filename): + col_range = range(0,column_count) + mat_def = f"mat<{column_count},R,T,Q>" + mat_def_U = f"mat<{column_count},R,U,Q>" + + sys.stdout = open(f"{filename}.hpp", 'a') + for op_symbol in op_symbols: + + print(f""" +template +GLM_FUNC_DECL GLM_CONSTEXPR {mat_def} operator{op_symbol}({mat_def} const& m1, {mat_def} const& m2); +template +GLM_FUNC_DECL GLM_CONSTEXPR {mat_def}& operator{op_symbol}=({mat_def}& m1, {mat_def_U} const& m2); +""",end="") + sys.stdout.close() + + + sys.stdout = open(f"{filename}.inl", 'a') + for op_symbol in op_symbols: + print(f""" +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR {mat_def} operator{op_symbol}({mat_def} const& m1, {mat_def} const& m2) {{ + return {mat_def}({",".join([f"m1[{i}] {op_symbol} m2[{i}]" for i in col_range])}); +}} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR {mat_def}& operator{op_symbol}=({mat_def}& m1, {mat_def_U} const& m2) {{ + {" ".join([f"m1[{i}] {op_symbol}= m2[{i}];" + ("\n" if i != col_range.stop-1 else "") for i in col_range])} + return m1; +}} +""",end="") + sys.stdout.close() + + +def make_scalar_commutative_operators(op_symbols,filename): + template = """ +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator{op_symbol}(T scalar,vec const& v); +""" + sys.stdout = open(f"{filename}.hpp", 'a') + for op_symbol in op_symbols: + print(template.format( + op_symbol= op_symbol + ),end="") + sys.stdout.close() + + template = """ +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator{op_symbol}(T scalar,vec const& v) {{ + return v {op_symbol} scalar; +}} +""" + sys.stdout = open(f"{filename}.inl", 'a') + for op_symbol in op_symbols: + print(template.format( + op_symbol= op_symbol + ),end="") + sys.stdout.close() + + + + +if __name__ == "__main__": + for C in range(2,5): + filename = f"mat{C}xR_common_operators" + sys.stdout = open(f"{filename}.hpp",'w') + print(""" +#pragma once +#include "qualifier.hpp" +#include "mat_common_operators.hpp" +namespace glm { +""") + sys.stdout.close() + + sys.stdout = open(f"{filename}.inl",'w') + print(""" +namespace glm { +""") + sys.stdout.close() + + make_unary_minus(C,filename) + make_prefix_incr_decr_funcs(C,filename) + make_equality_funcs(C,filename) + make_binary_mat_funcs(['+', '-'],C,filename) + make_binary_scalar_funcs(['+', '-', '*','/'],C,filename) + + sys.stdout = open(f"{filename}.hpp",'a') + print(f""" +}} +#ifndef GLM_EXTERNAL_TEMPLATE +#include "{filename}.inl" +#endif +""") + sys.stdout.close() + + + sys.stdout = open(f"{filename}.inl",'a') + print(""" +} +""") + sys.stdout.close() + + #make_scalar_commutative_operators(['+', '*'],"mat") \ No newline at end of file From 5a27826c788bda5e9118a361ab1f735a9002fff9 Mon Sep 17 00:00:00 2001 From: ZXShady <153229951+ZXShady@users.noreply.github.com> Date: Fri, 14 Mar 2025 14:21:51 +0000 Subject: [PATCH 11/12] Reuse operators to implement other operators for `glm::vec` --- glm/detail/type_vec1.hpp | 38 +--- glm/detail/type_vec1.inl | 85 +------- glm/detail/type_vec2.hpp | 116 +--------- glm/detail/type_vec2.inl | 176 +-------------- glm/detail/type_vec3.hpp | 117 +--------- glm/detail/type_vec3.inl | 261 +---------------------- glm/detail/type_vec4.hpp | 102 +-------- glm/detail/type_vec4.inl | 246 +-------------------- glm/detail/vec_common_operators.hpp | 102 +++++++++ glm/detail/vec_common_operators.inl | 173 +++++++++++++++ util/generate_common_vector_operators.py | 99 +++++++++ 11 files changed, 393 insertions(+), 1122 deletions(-) create mode 100644 glm/detail/vec_common_operators.hpp create mode 100644 glm/detail/vec_common_operators.inl create mode 100644 util/generate_common_vector_operators.py diff --git a/glm/detail/type_vec1.hpp b/glm/detail/type_vec1.hpp index 0cc7b5d4..e1565667 100644 --- a/glm/detail/type_vec1.hpp +++ b/glm/detail/type_vec1.hpp @@ -10,6 +10,7 @@ # include "_swizzle_func.hpp" #endif #include +#include "vec_common_operators.hpp" namespace glm { @@ -104,18 +105,8 @@ namespace glm // -- Conversion vector constructors -- /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_CTOR_DECL GLM_EXPLICIT vec(vec<2, U, P> const& v); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_CTOR_DECL GLM_EXPLICIT vec(vec<3, U, P> const& v); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_CTOR_DECL GLM_EXPLICIT vec(vec<4, U, P> const& v); - - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_CTOR_DECL GLM_EXPLICIT vec(vec<1, U, P> const& v); + template + GLM_CTOR_DECL GLM_EXPLICIT vec(vec const& v); // -- Swizzle constructors -- /* @@ -154,8 +145,6 @@ namespace glm GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator++(); GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator--(); - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator++(int); - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator--(int); // -- Unary bit operators -- @@ -187,9 +176,6 @@ namespace glm // -- Unary operators -- - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v); @@ -198,9 +184,6 @@ namespace glm template GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(T scalar, vec<1, T, Q> const& v); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); @@ -216,9 +199,6 @@ namespace glm template GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator*(T scalar, vec<1, T, Q> const& v); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); @@ -243,27 +223,18 @@ namespace glm template GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator&(T scalar, vec<1, T, Q> const& v); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator|(T scalar, vec<1, T, Q> const& v); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator^(T scalar, vec<1, T, Q> const& v); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); @@ -293,9 +264,6 @@ namespace glm template GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<1, bool, Q> operator&&(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2); diff --git a/glm/detail/type_vec1.inl b/glm/detail/type_vec1.inl index 18411e7f..4984a65d 100644 --- a/glm/detail/type_vec1.inl +++ b/glm/detail/type_vec1.inl @@ -38,26 +38,8 @@ namespace glm // -- Conversion vector constructors -- template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<1, U, P> const& v) - : x(static_cast(v.x)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<2, U, P> const& v) - : x(static_cast(v.x)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<3, U, P> const& v) - : x(static_cast(v.x)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<4, U, P> const& v) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec const& v) : x(static_cast(v.x)) {} @@ -174,22 +156,6 @@ namespace glm return *this; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> vec<1, T, Q>::operator++(int) - { - vec<1, T, Q> Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> vec<1, T, Q>::operator--(int) - { - vec<1, T, Q> Result(*this); - --*this; - return Result; - } - // -- Unary bit operators -- template @@ -290,12 +256,6 @@ namespace glm // -- Unary constant operators -- - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v) - { - return v; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v) { @@ -312,13 +272,6 @@ namespace glm v.x + scalar); } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator+(T scalar, vec<1, T, Q> const& v) - { - return vec<1, T, Q>( - scalar + v.x); - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { @@ -355,13 +308,6 @@ namespace glm v.x * scalar); } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator*(T scalar, vec<1, T, Q> const& v) - { - return vec<1, T, Q>( - scalar * v.x); - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { @@ -420,13 +366,6 @@ namespace glm v.x & scalar); } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator&(T scalar, vec<1, T, Q> const& v) - { - return vec<1, T, Q>( - scalar & v.x); - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { @@ -441,13 +380,6 @@ namespace glm v.x | scalar); } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator|(T scalar, vec<1, T, Q> const& v) - { - return vec<1, T, Q>( - scalar | v.x); - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { @@ -462,13 +394,6 @@ namespace glm v.x ^ scalar); } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator^(T scalar, vec<1, T, Q> const& v) - { - return vec<1, T, Q>( - scalar ^ v.x); - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { @@ -533,12 +458,6 @@ namespace glm return detail::compute_equal::is_iec559>::call(v1.x, v2.x); } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return !(v1 == v2); - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, bool, Q> operator&&(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2) { diff --git a/glm/detail/type_vec2.hpp b/glm/detail/type_vec2.hpp index 66c6137c..228f28c5 100644 --- a/glm/detail/type_vec2.hpp +++ b/glm/detail/type_vec2.hpp @@ -10,6 +10,7 @@ # include "_swizzle_func.hpp" #endif #include +#include "vec_common_operators.hpp" namespace glm { @@ -126,15 +127,8 @@ namespace glm // -- Conversion vector constructors -- /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_CTOR_DECL GLM_EXPLICIT vec(vec<3, U, P> const& v); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_CTOR_DECL GLM_EXPLICIT vec(vec<4, U, P> const& v); - - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_CTOR_DECL GLM_EXPLICIT vec(vec<2, U, P> const& v); + template + GLM_CTOR_DECL GLM_EXPLICIT vec(vec const& v); // -- Swizzle constructors -- # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR @@ -154,80 +148,54 @@ namespace glm template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator+=(U scalar); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator+=(vec<1, U, Q> const& v); - template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator+=(vec<2, U, Q> const& v); template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator-=(U scalar); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator-=(vec<1, U, Q> const& v); - template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator-=(vec<2, U, Q> const& v); template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator*=(U scalar); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator*=(vec<1, U, Q> const& v); - template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator*=(vec<2, U, Q> const& v); template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator/=(U scalar); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator/=(vec<1, U, Q> const& v); - template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator/=(vec<2, U, Q> const& v); // -- Increment and decrement operators -- GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator++(); GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator--(); - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator++(int); - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator--(int); - // -- Unary bit operators -- template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator%=(U scalar); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator%=(vec<1, U, Q> const& v); - template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator%=(vec<2, U, Q> const& v); template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator&=(U scalar); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator&=(vec<1, U, Q> const& v); - template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator&=(vec<2, U, Q> const& v); template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator|=(U scalar); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator|=(vec<1, U, Q> const& v); - template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator|=(vec<2, U, Q> const& v); template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator^=(U scalar); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator^=(vec<1, U, Q> const& v); - template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator^=(vec<2, U, Q> const& v); template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator<<=(U scalar); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator<<=(vec<1, U, Q> const& v); - template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator<<=(vec<2, U, Q> const& v); template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator>>=(U scalar); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator>>=(vec<1, U, Q> const& v); - template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator>>=(vec<2, U, Q> const& v); }; // -- Unary operators -- - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v); @@ -236,150 +204,75 @@ namespace glm template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(T scalar, vec<2, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(T scalar, vec<2, T, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(T scalar, vec<2, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(T scalar, vec<2, T, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(T scalar, vec<2, T, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(T scalar, vec<2, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(T scalar, vec<2, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(T scalar, vec<2, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(T scalar, vec<2, T, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(T scalar, vec<2, T, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); @@ -391,9 +284,6 @@ namespace glm template GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<2, bool, Q> operator&&(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2); diff --git a/glm/detail/type_vec2.inl b/glm/detail/type_vec2.inl index e8408997..5cc4ce9e 100644 --- a/glm/detail/type_vec2.inl +++ b/glm/detail/type_vec2.inl @@ -80,22 +80,8 @@ namespace glm // -- Conversion vector constructors -- template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<2, U, P> const& v) - : x(static_cast(v.x)) - , y(static_cast(v.y)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<3, U, P> const& v) - : x(static_cast(v.x)) - , y(static_cast(v.y)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<4, U, P> const& v) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec const& v) : x(static_cast(v.x)) , y(static_cast(v.y)) {} @@ -160,15 +146,6 @@ namespace glm return *this; } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator+=(vec<1, U, Q> const& v) - { - this->x += static_cast(v.x); - this->y += static_cast(v.x); - return *this; - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator+=(vec<2, U, Q> const& v) @@ -187,15 +164,6 @@ namespace glm return *this; } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator-=(vec<1, U, Q> const& v) - { - this->x -= static_cast(v.x); - this->y -= static_cast(v.x); - return *this; - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator-=(vec<2, U, Q> const& v) @@ -214,15 +182,6 @@ namespace glm return *this; } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator*=(vec<1, U, Q> const& v) - { - this->x *= static_cast(v.x); - this->y *= static_cast(v.x); - return *this; - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator*=(vec<2, U, Q> const& v) @@ -241,15 +200,6 @@ namespace glm return *this; } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator/=(vec<1, U, Q> const& v) - { - this->x /= static_cast(v.x); - this->y /= static_cast(v.x); - return *this; - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator/=(vec<2, U, Q> const& v) @@ -277,22 +227,6 @@ namespace glm return *this; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> vec<2, T, Q>::operator++(int) - { - vec<2, T, Q> Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> vec<2, T, Q>::operator--(int) - { - vec<2, T, Q> Result(*this); - --*this; - return Result; - } - // -- Unary bit operators -- template @@ -304,15 +238,6 @@ namespace glm return *this; } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator%=(vec<1, U, Q> const& v) - { - this->x %= static_cast(v.x); - this->y %= static_cast(v.x); - return *this; - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator%=(vec<2, U, Q> const& v) @@ -331,15 +256,6 @@ namespace glm return *this; } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator&=(vec<1, U, Q> const& v) - { - this->x &= static_cast(v.x); - this->y &= static_cast(v.x); - return *this; - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator&=(vec<2, U, Q> const& v) @@ -358,15 +274,6 @@ namespace glm return *this; } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator|=(vec<1, U, Q> const& v) - { - this->x |= static_cast(v.x); - this->y |= static_cast(v.x); - return *this; - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator|=(vec<2, U, Q> const& v) @@ -385,15 +292,6 @@ namespace glm return *this; } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator^=(vec<1, U, Q> const& v) - { - this->x ^= static_cast(v.x); - this->y ^= static_cast(v.x); - return *this; - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator^=(vec<2, U, Q> const& v) @@ -412,15 +310,6 @@ namespace glm return *this; } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator<<=(vec<1, U, Q> const& v) - { - this->x <<= static_cast(v.x); - this->y <<= static_cast(v.x); - return *this; - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator<<=(vec<2, U, Q> const& v) @@ -439,15 +328,6 @@ namespace glm return *this; } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator>>=(vec<1, U, Q> const& v) - { - this->x >>= static_cast(v.x); - this->y >>= static_cast(v.x); - return *this; - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator>>=(vec<2, U, Q> const& v) @@ -459,12 +339,6 @@ namespace glm // -- Unary arithmetic operators -- - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v) - { - return v; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v) { @@ -491,14 +365,6 @@ namespace glm v1.y + v2.x); } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(T scalar, vec<2, T, Q> const& v) - { - return vec<2, T, Q>( - scalar + v.x, - scalar + v.y); - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) { @@ -571,14 +437,6 @@ namespace glm v1.y * v2.x); } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(T scalar, vec<2, T, Q> const& v) - { - return vec<2, T, Q>( - scalar * v.x, - scalar * v.y); - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) { @@ -693,14 +551,6 @@ namespace glm v1.y & v2.x); } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(T scalar, vec<2, T, Q> const& v) - { - return vec<2, T, Q>( - scalar & v.x, - scalar & v.y); - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) { @@ -733,14 +583,6 @@ namespace glm v1.y | v2.x); } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(T scalar, vec<2, T, Q> const& v) - { - return vec<2, T, Q>( - scalar | v.x, - scalar | v.y); - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) { @@ -773,14 +615,6 @@ namespace glm v1.y ^ v2.x); } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(T scalar, vec<2, T, Q> const& v) - { - return vec<2, T, Q>( - scalar ^ v.x, - scalar ^ v.y); - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) { @@ -895,12 +729,6 @@ namespace glm detail::compute_equal::is_iec559>::call(v1.y, v2.y); } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) - { - return !(v1 == v2); - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, bool, Q> operator&&(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2) { diff --git a/glm/detail/type_vec3.hpp b/glm/detail/type_vec3.hpp index 90de2f8a..ad497cf7 100644 --- a/glm/detail/type_vec3.hpp +++ b/glm/detail/type_vec3.hpp @@ -10,6 +10,7 @@ # include "_swizzle_func.hpp" #endif #include +#include "vec_common_operators.hpp" namespace glm { @@ -151,13 +152,10 @@ namespace glm /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_CTOR_DECL vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_CTOR_DECL GLM_EXPLICIT vec(vec<4, U, P> const& v); - - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_CTOR_DECL GLM_EXPLICIT vec(vec<3, U, P> const& v); + template + GLM_CTOR_DECL GLM_EXPLICIT vec(vec const& v); // -- Swizzle constructors -- # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR @@ -189,72 +187,49 @@ namespace glm template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator+=(U scalar); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator+=(vec<1, U, Q> const& v); - template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator+=(vec<3, U, Q> const& v); template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator-=(U scalar); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator-=(vec<1, U, Q> const& v); - template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator-=(vec<3, U, Q> const& v); template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator*=(U scalar); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator*=(vec<1, U, Q> const& v); - template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator*=(vec<3, U, Q> const& v); template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator/=(U scalar); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator/=(vec<1, U, Q> const& v); - template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator/=(vec<3, U, Q> const& v); // -- Increment and decrement operators -- GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator++(); GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator--(); - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator++(int); - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator--(int); - // -- Unary bit operators -- template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator%=(U scalar); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator%=(vec<1, U, Q> const& v); - template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator%=(vec<3, U, Q> const& v); template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator&=(U scalar); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator&=(vec<1, U, Q> const& v); - template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator&=(vec<3, U, Q> const& v); template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator|=(U scalar); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator|=(vec<1, U, Q> const& v); - template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator|=(vec<3, U, Q> const& v); template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator^=(U scalar); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator^=(vec<1, U, Q> const& v); - template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator^=(vec<3, U, Q> const& v); template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator<<=(U scalar); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator<<=(vec<1, U, Q> const& v); - template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator<<=(vec<3, U, Q> const& v); template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator>>=(U scalar); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator>>=(vec<1, U, Q> const& v); - template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator>>=(vec<3, U, Q> const& v); }; @@ -262,9 +237,6 @@ namespace glm // -- Unary operators -- - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v); @@ -273,150 +245,72 @@ namespace glm template GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(T scalar, vec<3, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(T scalar, vec<3, T, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(T scalar, vec<3, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(T scalar, vec<3, T, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(T scalar, vec<3, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(T scalar, vec<3, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(T scalar, vec<3, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(T scalar, vec<3, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(T scalar, vec<3, T, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(T scalar, vec<3, T, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); @@ -428,9 +322,6 @@ namespace glm template GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<3, bool, Q> operator&&(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2); diff --git a/glm/detail/type_vec3.inl b/glm/detail/type_vec3.inl index fed82bf6..059d10b7 100644 --- a/glm/detail/type_vec3.inl +++ b/glm/detail/type_vec3.inl @@ -150,16 +150,8 @@ namespace glm {} template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<3, U, P> const& v) - : x(static_cast(v.x)) - , y(static_cast(v.y)) - , z(static_cast(v.z)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<4, U, P> const& v) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec const& v) : x(static_cast(v.x)) , y(static_cast(v.y)) , z(static_cast(v.z)) @@ -229,13 +221,6 @@ namespace glm return (*this = detail::compute_vec_add<3, T, Q, detail::is_aligned::value>::call(*this, vec<3, T, Q>(scalar))); } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator+=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec_add<3, T, Q, detail::is_aligned::value>::call(*this, vec<1, T, Q>(v.x))); - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator+=(vec<3, U, Q> const& v) @@ -250,13 +235,6 @@ namespace glm return (*this = detail::compute_vec_sub<3, T, Q, detail::is_aligned::value>::call(*this, vec<3, T, Q>(scalar))); } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator-=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec_sub<3, T, Q, detail::is_aligned::value>::call(*this, vec<1, T, Q>(v.x))); - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator-=(vec<3, U, Q> const& v) @@ -271,13 +249,6 @@ namespace glm return (*this = detail::compute_vec_mul<3, T, Q, detail::is_aligned::value>::call(*this, vec<3, T, Q>(static_cast(scalar)))); } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator*=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec_mul<3, T, Q, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v.x))); - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator*=(vec<3, U, Q> const& v) @@ -292,13 +263,6 @@ namespace glm return (*this = detail::compute_vec_div<3, T, Q, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v))); } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator/=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec_div<3, T, Q, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v.x))); - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator/=(vec<3, U, Q> const& v) @@ -326,22 +290,6 @@ namespace glm return *this; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> vec<3, T, Q>::operator++(int) - { - vec<3, T, Q> Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> vec<3, T, Q>::operator--(int) - { - vec<3, T, Q> Result(*this); - --*this; - return Result; - } - // -- Unary bit operators -- template @@ -351,13 +299,6 @@ namespace glm return (*this = detail::compute_vec_mod<3, T, Q, detail::is_aligned::value>::call(*this, vec<3, T, Q>(scalar))); } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator%=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec_mod<3, T, Q, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v))); - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator%=(vec<3, U, Q> const& v) @@ -372,13 +313,6 @@ namespace glm return (*this = detail::compute_vec_and<3, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<3, T, Q>(scalar))); } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator&=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec_and<3, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v))); - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator&=(vec<3, U, Q> const& v) @@ -392,14 +326,6 @@ namespace glm { return (*this = detail::compute_vec_or<3, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<3, T, Q>(scalar))); } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator|=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec_or<3, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v))); - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator|=(vec<3, U, Q> const& v) @@ -414,13 +340,6 @@ namespace glm return (*this = detail::compute_vec_xor<3, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<3, T, Q>(scalar))); } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator^=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec_xor<3, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v.x))); - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator^=(vec<3, U, Q> const& v) @@ -435,13 +354,6 @@ namespace glm return (*this = detail::compute_vec_shift_left<3, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<3, T, Q>(scalar))); } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator<<=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec_shift_left<3, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<1, T, Q>(v))); - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator<<=(vec<3, U, Q> const& v) @@ -456,13 +368,6 @@ namespace glm return (*this = detail::compute_vec_shift_right<3, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<3, T, Q>(scalar))); } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator>>=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec_shift_right<3, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v))); - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator>>=(vec<3, U, Q> const& v) @@ -473,12 +378,6 @@ namespace glm // -- Unary arithmetic operators -- - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v) - { - return v; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v) { @@ -493,24 +392,6 @@ namespace glm return vec<3, T, Q>(v) += scalar; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<3, T, Q>(v1) += v2; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(T scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>(v) += scalar; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>(scalar) += v; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { @@ -523,24 +404,12 @@ namespace glm return vec<3, T, Q>(v) -= scalar; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) - { - return vec<3, T, Q>(v) -= scalar.x; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(T scalar, vec<3, T, Q> const& v) { return vec<3, T, Q>(scalar) -= v; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>(scalar) -= v; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { @@ -553,24 +422,6 @@ namespace glm return vec<3, T, Q>(v) *= scalar; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) - { - return vec<3, T, Q>(v) *= scalar.x; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(T scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>(v) *= scalar; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>(v) *= scalar.x; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { @@ -584,24 +435,12 @@ namespace glm return vec<3, T, Q>(v) /= scalar; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) - { - return vec<3, T, Q>(v) /= scalar.x; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(T scalar, vec<3, T, Q> const& v) { return vec<3, T, Q>(scalar) /= v; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>(scalar) /= v; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { @@ -616,24 +455,12 @@ namespace glm return vec<3, T, Q>(v) %= scalar; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) - { - return vec<3, T, Q>(v) %= scalar.x; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(T scalar, vec<3, T, Q> const& v) { return vec<3, T, Q>(scalar) %= v; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>(scalar.x) %= v; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { @@ -646,24 +473,6 @@ namespace glm return vec<3, T, Q>(v) &= scalar; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) - { - return vec<3, T, Q>(v) &= scalar.x; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(T scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>(scalar) &= v; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>(scalar.x) &= v; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { @@ -676,24 +485,6 @@ namespace glm return vec<3, T, Q>(v) |= scalar; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) - { - return vec<3, T, Q>(v) |= scalar.x; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(T scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>(scalar) |= v; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>(scalar.x) |= v; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { @@ -706,24 +497,6 @@ namespace glm return vec<3, T, Q>(v) ^= scalar; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) - { - return vec<3, T, Q>(v) ^= scalar.x; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(T scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>(scalar) ^= v; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>(scalar.x) ^= v; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { @@ -736,24 +509,12 @@ namespace glm return vec<3, T, Q>(v) <<= scalar; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) - { - return vec<3, T, Q>(v) <<= scalar.x; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(T scalar, vec<3, T, Q> const& v) { return vec<3, T, Q>(scalar) << v; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>(scalar.x) << v; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { @@ -766,24 +527,12 @@ namespace glm return vec<3, T, Q>(v) >>= scalar; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) - { - return vec<3, T, Q>(v) >>= scalar.x; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(T scalar, vec<3, T, Q> const& v) { return vec<3, T, Q>(scalar) >>= v; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>(scalar.x) >>= v; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { @@ -810,12 +559,6 @@ namespace glm detail::compute_equal::is_iec559>::call(v1.z, v2.z); } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) - { - return !(v1 == v2); - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, bool, Q> operator&&(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2) { diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index 9ba11229..db19b739 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -10,6 +10,7 @@ # include "_swizzle_func.hpp" #endif #include +#include "vec_common_operators.hpp" namespace glm { @@ -261,81 +262,55 @@ namespace glm template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator+=(U scalar); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator+=(vec<1, U, Q> const& v); - template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator+=(vec<4, U, Q> const& v); template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator-=(U scalar); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator-=(vec<1, U, Q> const& v); - template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator-=(vec<4, U, Q> const& v); template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator*=(U scalar); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator*=(vec<1, U, Q> const& v); - template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator*=(vec<4, U, Q> const& v); template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator/=(U scalar); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator/=(vec<1, U, Q> const& v); - template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator/=(vec<4, U, Q> const& v); // -- Increment and decrement operators -- GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q> & operator++(); GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q> & operator--(); - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator++(int); - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator--(int); - // -- Unary bit operators -- template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator%=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator%=(vec<1, U, Q> const& v); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator%=(vec<4, U, Q> const& v); template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator&=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator&=(vec<1, U, Q> const& v); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator&=(vec<4, U, Q> const& v); template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator|=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator|=(vec<1, U, Q> const& v); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator|=(vec<4, U, Q> const& v); template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator^=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator^=(vec<1, U, Q> const& v); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator^=(vec<4, U, Q> const& v); template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator<<=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator<<=(vec<1, U, Q> const& v); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator<<=(vec<4, U, Q> const& v); template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator>>=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator>>=(vec<1, U, Q> const& v); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator>>=(vec<4, U, Q> const& v); }; // -- Unary operators -- - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v); @@ -344,150 +319,75 @@ namespace glm template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(T scalar, vec<4, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(T scalar, vec<4, T, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(T scalar, vec<4, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(T scalar, vec<4, T, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(T scalar, vec<4, T, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(T scalar, vec<4, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(T scalar, vec<4, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(T scalar, vec<4, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(T scalar, vec<4, T, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(T scalar, vec<4, T, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); - template GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index 66539e30..7ea7e146 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -426,13 +426,6 @@ namespace detail return (*this = detail::compute_vec_add<4, T, Q, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator+=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec_add<4, T, Q, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v.x))); - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator+=(vec<4, U, Q> const& v) @@ -447,13 +440,6 @@ namespace detail return (*this = detail::compute_vec_sub<4, T, Q, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator-=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec_sub<4, T, Q, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v.x))); - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator-=(vec<4, U, Q> const& v) @@ -468,13 +454,6 @@ namespace detail return (*this = detail::compute_vec_mul<4,T, Q, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator*=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec_mul<4,T, Q, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v.x))); - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator*=(vec<4, U, Q> const& v) @@ -489,13 +468,6 @@ namespace detail return (*this = detail::compute_vec_div<4, T, Q, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator/=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec_div<4, T, Q, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v.x))); - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator/=(vec<4, U, Q> const& v) @@ -525,22 +497,6 @@ namespace detail return *this; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> vec<4, T, Q>::operator++(int) - { - vec<4, T, Q> Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> vec<4, T, Q>::operator--(int) - { - vec<4, T, Q> Result(*this); - --*this; - return Result; - } - // -- Unary bit operators -- template @@ -550,13 +506,6 @@ namespace detail return (*this = detail::compute_vec_mod<4, T, Q, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator%=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec_mod<3, T, Q, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v))); - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator%=(vec<4, U, Q> const& v) @@ -571,13 +520,6 @@ namespace detail return (*this = detail::compute_vec_and<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator&=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec_and<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator&=(vec<4, U, Q> const& v) @@ -592,13 +534,6 @@ namespace detail return (*this = detail::compute_vec_or<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator|=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec_or<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator|=(vec<4, U, Q> const& v) @@ -613,13 +548,6 @@ namespace detail return (*this = detail::compute_vec_xor<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator^=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec_xor<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator^=(vec<4, U, Q> const& v) @@ -634,13 +562,6 @@ namespace detail return (*this = detail::compute_vec_shift_left<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator<<=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec_shift_left<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator<<=(vec<4, U, Q> const& v) @@ -655,13 +576,6 @@ namespace detail return (*this = detail::compute_vec_shift_right<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); } - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator>>=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec_shift_right<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); - } - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator>>=(vec<4, U, Q> const& v) @@ -671,12 +585,6 @@ namespace detail // -- Unary constant operators -- - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v) - { - return v; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v) { @@ -691,24 +599,6 @@ namespace detail return vec<4, T, Q>(v) += scalar; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<4, T, Q>(v1) += v2; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(T scalar, vec<4, T, Q> const& v) - { - return vec<4, T, Q>(v) += scalar; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v2) += v1; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { @@ -721,24 +611,12 @@ namespace detail return vec<4, T, Q>(v) -= scalar; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<4, T, Q>(v1) -= v2; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(T scalar, vec<4, T, Q> const& v) { return vec<4, T, Q>(scalar) -= v; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v1.x) -= v2; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { @@ -751,42 +629,12 @@ namespace detail return vec<4, T, Q>(v) *= scalar; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<4, T, Q>(v1) *= v2; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(T scalar, vec<4, T, Q> const& v) - { - return vec<4, T, Q>(v) *= scalar; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v2) *= v1; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { return vec<4, T, Q>(v1) *= v2; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v, T scalar) - { - return vec<4, T, Q>(v) /= scalar; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<4, T, Q>(v1) /= v2; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(T scalar, vec<4, T, Q> const& v) { @@ -794,9 +642,9 @@ namespace detail } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v, T scalar) { - return vec<4, T, Q>(v1.x) /= v2; + return vec<4, T, Q>(v) /= scalar; } template @@ -813,24 +661,12 @@ namespace detail return vec<4, T, Q>(v) %= scalar; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<4, T, Q>(v1) %= v2.x; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(T scalar, vec<4, T, Q> const& v) { return vec<4, T, Q>(scalar) %= v; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v) - { - return vec<4, T, Q>(scalar.x) %= v; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { @@ -843,24 +679,6 @@ namespace detail return vec<4, T, Q>(v) &= scalar; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar) - { - return vec<4, T, Q>(v) &= scalar; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(T scalar, vec<4, T, Q> const& v) - { - return vec<4, T, Q>(scalar) &= v; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v1.x) &= v2; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { @@ -873,24 +691,6 @@ namespace detail return vec<4, T, Q>(v) |= scalar; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<4, T, Q>(v1) |= v2.x; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(T scalar, vec<4, T, Q> const& v) - { - return vec<4, T, Q>(scalar) |= v; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v1.x) |= v2; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { @@ -903,24 +703,6 @@ namespace detail return vec<4, T, Q>(v) ^= scalar; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<4, T, Q>(v1) ^= v2.x; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(T scalar, vec<4, T, Q> const& v) - { - return vec<4, T, Q>(scalar) ^= v; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v1.x) ^= v2; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { @@ -933,24 +715,12 @@ namespace detail return vec<4, T, Q>(v) <<= scalar; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<4, T, Q>(v1) <<= v2.x; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(T scalar, vec<4, T, Q> const& v) { return vec<4, T, Q>(scalar) <<= v; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v1.x) <<= v2; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { @@ -963,24 +733,12 @@ namespace detail return vec<4, T, Q>(v) >>= scalar; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<4, T, Q>(v1) >>= v2.x; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(T scalar, vec<4, T, Q> const& v) { return vec<4, T, Q>(scalar) >>= v; } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v1.x) >>= v2; - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { diff --git a/glm/detail/vec_common_operators.hpp b/glm/detail/vec_common_operators.hpp new file mode 100644 index 00000000..593aa3fa --- /dev/null +++ b/glm/detail/vec_common_operators.hpp @@ -0,0 +1,102 @@ +#pragma once +#include "qualifier.hpp" +namespace glm { + +template +GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec operator++(vec& v,int); +template +GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec operator--(vec& v,int); +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator+(vec const& v); +template +GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec const& a,vec const& b); + +template +GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec& operator+=(vec& a, vec<1,U,P> const& b); +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator+(vec const& a, vec<1,T,Q> const& b); +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator+(vec<1, T, Q> const& a, vec const& b); + +template +GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec& operator-=(vec& a, vec<1,U,P> const& b); +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator-(vec const& a, vec<1,T,Q> const& b); +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator-(vec<1, T, Q> const& a, vec const& b); + +template +GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec& operator*=(vec& a, vec<1,U,P> const& b); +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator*(vec const& a, vec<1,T,Q> const& b); +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator*(vec<1, T, Q> const& a, vec const& b); + +template +GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec& operator/=(vec& a, vec<1,U,P> const& b); +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator/(vec const& a, vec<1,T,Q> const& b); +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator/(vec<1, T, Q> const& a, vec const& b); + +template +GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec& operator%=(vec& a, vec<1,U,P> const& b); +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator%(vec const& a, vec<1,T,Q> const& b); +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator%(vec<1, T, Q> const& a, vec const& b); + +template +GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec& operator&=(vec& a, vec<1,U,P> const& b); +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator&(vec const& a, vec<1,T,Q> const& b); +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator&(vec<1, T, Q> const& a, vec const& b); + +template +GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec& operator|=(vec& a, vec<1,U,P> const& b); +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator|(vec const& a, vec<1,T,Q> const& b); +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator|(vec<1, T, Q> const& a, vec const& b); + +template +GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec& operator^=(vec& a, vec<1,U,P> const& b); +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator^(vec const& a, vec<1,T,Q> const& b); +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator^(vec<1, T, Q> const& a, vec const& b); + +template +GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec& operator<<=(vec& a, vec<1,U,P> const& b); +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator<<(vec const& a, vec<1,T,Q> const& b); +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator<<(vec<1, T, Q> const& a, vec const& b); + +template +GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec& operator>>=(vec& a, vec<1,U,P> const& b); +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator>>(vec const& a, vec<1,T,Q> const& b); +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator>>(vec<1, T, Q> const& a, vec const& b); + +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator+(T scalar,vec const& v); + +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator*(T scalar,vec const& v); + +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator&(T scalar,vec const& v); + +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator|(T scalar,vec const& v); + +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator^(T scalar,vec const& v); +} // namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "vec_common_operators.inl" +#endif diff --git a/glm/detail/vec_common_operators.inl b/glm/detail/vec_common_operators.inl new file mode 100644 index 00000000..f2d92b84 --- /dev/null +++ b/glm/detail/vec_common_operators.inl @@ -0,0 +1,173 @@ +namespace glm { +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator++(vec& v,int) {{ + const vec Result(v); + ++v; + return Result; +}} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator--(vec& v,int) { + const vec Result(v); + --v; + return Result; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator+(vec const& v) { + return v; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(vec const& a,vec const& b) { + return !(a == b); +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec& operator+=(vec& a, vec<1,U,P> const& b) { + return a += b.x; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator+(vec const& a, vec<1,T,Q> const& b) { + return a + b.x; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator+(vec<1, T, Q> const& a, vec const& b) { + return a.x + b; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec& operator-=(vec& a, vec<1,U,P> const& b) { + return a -= b.x; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator-(vec const& a, vec<1,T,Q> const& b) { + return a - b.x; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator-(vec<1, T, Q> const& a, vec const& b) { + return a.x - b; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec& operator*=(vec& a, vec<1,U,P> const& b) { + return a *= b.x; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator*(vec const& a, vec<1,T,Q> const& b) { + return a * b.x; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator*(vec<1, T, Q> const& a, vec const& b) { + return a.x * b; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec& operator/=(vec& a, vec<1,U,P> const& b) { + return a /= b.x; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator/(vec const& a, vec<1,T,Q> const& b) { + return a / b.x; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator/(vec<1, T, Q> const& a, vec const& b) { + return a.x / b; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec& operator%=(vec& a, vec<1,U,P> const& b) { + return a %= b.x; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator%(vec const& a, vec<1,T,Q> const& b) { + return a % b.x; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator%(vec<1, T, Q> const& a, vec const& b) { + return a.x % b; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec& operator&=(vec& a, vec<1,U,P> const& b) { + return a &= b.x; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator&(vec const& a, vec<1,T,Q> const& b) { + return a & b.x; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator&(vec<1, T, Q> const& a, vec const& b) { + return a.x & b; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec& operator|=(vec& a, vec<1,U,P> const& b) { + return a |= b.x; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator|(vec const& a, vec<1,T,Q> const& b) { + return a | b.x; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator|(vec<1, T, Q> const& a, vec const& b) { + return a.x | b; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec& operator^=(vec& a, vec<1,U,P> const& b) { + return a ^= b.x; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator^(vec const& a, vec<1,T,Q> const& b) { + return a ^ b.x; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator^(vec<1, T, Q> const& a, vec const& b) { + return a.x ^ b; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec& operator<<=(vec& a, vec<1,U,P> const& b) { + return a <<= b.x; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator<<(vec const& a, vec<1,T,Q> const& b) { + return a << b.x; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator<<(vec<1, T, Q> const& a, vec const& b) { + return a.x << b; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec& operator>>=(vec& a, vec<1,U,P> const& b) { + return a >>= b.x; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator>>(vec const& a, vec<1,T,Q> const& b) { + return a >> b.x; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator>>(vec<1, T, Q> const& a, vec const& b) { + return a.x >> b; +} + +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator+(T scalar,vec const& v) { + return v + scalar; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator*(T scalar,vec const& v) { + return v * scalar; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator&(T scalar,vec const& v) { + return v & scalar; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator|(T scalar,vec const& v) { + return v | scalar; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator^(T scalar,vec const& v) { + return v ^ scalar; +} +} // namespace glm diff --git a/util/generate_common_vector_operators.py b/util/generate_common_vector_operators.py new file mode 100644 index 00000000..bb82afbd --- /dev/null +++ b/util/generate_common_vector_operators.py @@ -0,0 +1,99 @@ +import itertools +import sys + +def write_to_file(text,filename,mode='a'): + with open(filename,mode) as file: + file.write(text) + +def make_binary_funcs(filename,op_symbols): + for op_symbol in op_symbols: + write_to_file(f""" +template +GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec& operator{op_symbol}=(vec& a, vec<1,U,P> const& b); +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator{op_symbol}(vec const& a, vec<1,T,Q> const& b); +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator{op_symbol}(vec<1, T, Q> const& a, vec const& b); +""",f"{filename}.hpp") + write_to_file(f""" +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec& operator{op_symbol}=(vec& a, vec<1,U,P> const& b) {{ + return a {op_symbol}= b.x; +}} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator{op_symbol}(vec const& a, vec<1,T,Q> const& b) {{ + return a {op_symbol} b.x; +}} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator{op_symbol}(vec<1, T, Q> const& a, vec const& b) {{ + return a.x {op_symbol} b; +}} +""",f"{filename}.inl") + + +def make_scalar_commutative_operators(filename,op_symbols): + for op_symbol in op_symbols: + write_to_file(f""" +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator{op_symbol}(T scalar,vec const& v); +""",f"{filename}.hpp") + write_to_file(f""" +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator{op_symbol}(T scalar,vec const& v) {{ + return v {op_symbol} scalar; +}}""",f"{filename}.inl") + + + + +if __name__ == "__main__": + filename = "vec_common_operators" + write_to_file("""#pragma once +#include "qualifier.hpp" +namespace glm { + +template +GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec operator++(vec& v,int); +template +GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec operator--(vec& v,int); +template +GLM_FUNC_DECL GLM_CONSTEXPR vec operator+(vec const& v); +template +GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec const& a,vec const& b); +""",f"{filename}.hpp",'w') + + write_to_file("""namespace glm { +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator++(vec& v,int) {{ + const vec Result(v); + ++v; + return Result; +}} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator--(vec& v,int) { + const vec Result(v); + --v; + return Result; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec operator+(vec const& v) { + return v; +} +template +GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(vec const& a,vec const& b) { + return !(a == b); +} +""",f"{filename}.inl",'w') + make_binary_funcs(filename,['+', '-', '*', '/', '%', '&', '|', '^', '<<', '>>']) + make_scalar_commutative_operators(filename,['+', '*', '&', '|', '^']) + + write_to_file(""" +} // namespace glm +""",f"{filename}.inl") + + write_to_file(f"""}} // namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "{filename}.inl" +#endif +""",f"{filename}.hpp") \ No newline at end of file From 63d8733b697cd2591b8ac5ac86cc1d6a1dc6301a Mon Sep 17 00:00:00 2001 From: ZXShady <153229951+ZXShady@users.noreply.github.com> Date: Fri, 14 Mar 2025 13:12:05 +0000 Subject: [PATCH 12/12] Use comparisons instead of template specilizatins --- glm/detail/qualifier.hpp | 414 +++++++++++++++++++-------------------- 1 file changed, 202 insertions(+), 212 deletions(-) diff --git a/glm/detail/qualifier.hpp b/glm/detail/qualifier.hpp index d67fd0d4..bdf65717 100644 --- a/glm/detail/qualifier.hpp +++ b/glm/detail/qualifier.hpp @@ -12,10 +12,10 @@ namespace glm packed_lowp, ///< Typed data is tightly packed in memory and operations are executed with low precision in term of ULPs to maximize performance # if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE - aligned_highp, ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs - aligned_mediump, ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs for higher performance - aligned_lowp, // ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs to maximize performance - aligned = aligned_highp, ///< By default aligned qualifier is also high precision + aligned_highp, ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs + aligned_mediump, ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs for higher performance + aligned_lowp, // ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs to maximize performance + aligned = aligned_highp, ///< By default aligned qualifier is also high precision # endif highp = packed_highp, ///< By default highp qualifier is also packed @@ -24,9 +24,9 @@ namespace glm packed = packed_highp, ///< By default packed qualifier is also high precision # if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE && defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES) - defaultp = aligned_highp + defaultp = aligned_highp # else - defaultp = highp + defaultp = highp # endif }; @@ -37,259 +37,249 @@ namespace glm template struct qua; # if GLM_HAS_TEMPLATE_ALIASES - template using tvec1 = vec<1, T, Q>; - template using tvec2 = vec<2, T, Q>; - template using tvec3 = vec<3, T, Q>; - template using tvec4 = vec<4, T, Q>; - template using tmat2x2 = mat<2, 2, T, Q>; - template using tmat2x3 = mat<2, 3, T, Q>; - template using tmat2x4 = mat<2, 4, T, Q>; - template using tmat3x2 = mat<3, 2, T, Q>; - template using tmat3x3 = mat<3, 3, T, Q>; - template using tmat3x4 = mat<3, 4, T, Q>; - template using tmat4x2 = mat<4, 2, T, Q>; - template using tmat4x3 = mat<4, 3, T, Q>; - template using tmat4x4 = mat<4, 4, T, Q>; - template using tquat = qua; + template using tvec1 = vec<1, T, Q>; + template using tvec2 = vec<2, T, Q>; + template using tvec3 = vec<3, T, Q>; + template using tvec4 = vec<4, T, Q>; + template using tmat2x2 = mat<2, 2, T, Q>; + template using tmat2x3 = mat<2, 3, T, Q>; + template using tmat2x4 = mat<2, 4, T, Q>; + template using tmat3x2 = mat<3, 2, T, Q>; + template using tmat3x3 = mat<3, 3, T, Q>; + template using tmat3x4 = mat<3, 4, T, Q>; + template using tmat4x2 = mat<4, 2, T, Q>; + template using tmat4x3 = mat<4, 3, T, Q>; + template using tmat4x4 = mat<4, 4, T, Q>; + template using tquat = qua; # endif -namespace detail -{ - template - struct is_aligned + namespace detail { - static const bool value = false; - }; - -# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE - template<> - struct is_aligned + template + struct is_aligned { - static const bool value = true; + enum { +#if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE + value = P == glm::aligned_mediump || P == glm::aligned_lowp || P == glm::aligned_highp +#else + value = false +#endif + }; }; - - template<> - struct is_aligned + template + struct storage { - static const bool value = true; + struct type { + T data[L]; + }; }; - template<> - struct is_aligned - { - static const bool value = true; - }; -# endif - - template - struct storage - { - typedef struct type { - T data[L]; - } type; - }; - # if GLM_HAS_ALIGNOF template struct storage { - typedef struct alignas(L * sizeof(T)) type { + struct alignas(L * sizeof(T)) type { T data[L]; - } type; + }; }; template struct storage<3, T, true> { - typedef struct alignas(4 * sizeof(T)) type { + struct alignas(4 * sizeof(T)) type { T data[4]; - } type; + }; }; # endif # if GLM_ARCH & GLM_ARCH_SSE2_BIT - template<> - struct storage<4, float, true> - { - typedef glm_f32vec4 type; - }; - - template<> - struct storage<4, int, true> - { - typedef glm_i32vec4 type; - }; - - template<> - struct storage<4, unsigned int, true> - { - typedef glm_u32vec4 type; - }; - - template<> - struct storage<3, float, true> - { - typedef glm_f32vec4 type; - }; - - template<> - struct storage<3, int, true> - { - typedef glm_i32vec4 type; - }; - - template<> - struct storage<3, unsigned int, true> - { - typedef glm_i32vec4 type; - }; - - template<> - struct storage<2, double, true> - { - typedef glm_f64vec2 type; - }; - - template<> - struct storage<2, detail::int64, true> - { - typedef glm_i64vec2 type; - }; - - template<> - struct storage<2, detail::uint64, true> - { - typedef glm_u64vec2 type; - }; - - - template<> - struct storage<3, detail::uint64, true> - { - typedef glm_u64vec2 type; - }; - - template<> - struct storage<4, double, true> - { -# if (GLM_ARCH & GLM_ARCH_AVX_BIT) - typedef glm_f64vec4 type; -# else - struct type + template<> + struct storage<4, float, true> { - glm_f64vec2 data[2]; - GLM_CONSTEXPR glm_f64vec2 getv(int i) const { - return data[i]; - } - GLM_CONSTEXPR void setv(int i, const glm_f64vec2& v) { - data[i] = v; - } + typedef glm_f32vec4 type; }; + + template<> + struct storage<4, int, true> + { + typedef glm_i32vec4 type; + }; + + template<> + struct storage<4, unsigned int, true> + { + typedef glm_u32vec4 type; + }; + + template<> + struct storage<3, float, true> + { + typedef glm_f32vec4 type; + }; + + template<> + struct storage<3, int, true> + { + typedef glm_i32vec4 type; + }; + + template<> + struct storage<3, unsigned int, true> + { + typedef glm_i32vec4 type; + }; + + template<> + struct storage<2, double, true> + { + typedef glm_f64vec2 type; + }; + + template<> + struct storage<2, detail::int64, true> + { + typedef glm_i64vec2 type; + }; + + template<> + struct storage<2, detail::uint64, true> + { + typedef glm_u64vec2 type; + }; + + + template<> + struct storage<3, detail::uint64, true> + { + typedef glm_u64vec2 type; + }; + + template<> + struct storage<4, double, true> + { +# if (GLM_ARCH & GLM_ARCH_AVX_BIT) + typedef glm_f64vec4 type; +# else + struct type + { + glm_f64vec2 data[2]; + GLM_CONSTEXPR glm_f64vec2 getv(int i) const { + return data[i]; + } + GLM_CONSTEXPR void setv(int i, const glm_f64vec2& v) { + data[i] = v; + } + }; # endif - }; + }; - template<> - struct storage<3, double, true> : public storage<4, double, true> - {}; - + template<> + struct storage<3, double, true> : public storage<4, double, true> + { + }; + # endif # if (GLM_ARCH & GLM_ARCH_AVX2_BIT) - template<> - struct storage<4, detail::int64, true> - { - typedef glm_i64vec4 type; - }; + template<> + struct storage<4, detail::int64, true> + { + typedef glm_i64vec4 type; + }; - template<> - struct storage<4, detail::uint64, true> - { - typedef glm_u64vec4 type; - }; + template<> + struct storage<4, detail::uint64, true> + { + typedef glm_u64vec4 type; + }; # endif # if GLM_ARCH & GLM_ARCH_NEON_BIT - template<> - struct storage<4, float, true> - { - typedef glm_f32vec4 type; - }; + template<> + struct storage<4, float, true> + { + typedef glm_f32vec4 type; + }; - template<> - struct storage<3, float, true> : public storage<4, float, true> - {}; + template<> + struct storage<3, float, true> : public storage<4, float, true> + { + }; - template<> - struct storage<4, int, true> - { - typedef glm_i32vec4 type; - }; + template<> + struct storage<4, int, true> + { + typedef glm_i32vec4 type; + }; - template<> - struct storage<3, int, true> : public storage<4, int, true> - {}; + template<> + struct storage<3, int, true> : public storage<4, int, true> + { + }; - template<> - struct storage<4, unsigned int, true> - { - typedef glm_u32vec4 type; - }; + template<> + struct storage<4, unsigned int, true> + { + typedef glm_u32vec4 type; + }; - template<> - struct storage<3, unsigned int, true> : public storage<4, unsigned int, true> - {}; + template<> + struct storage<3, unsigned int, true> : public storage<4, unsigned int, true> + { + }; # if GLM_HAS_ALIGNOF - template<> - struct storage<3, double, true> - { - typedef struct alignas(4 * sizeof(double)) type { - double data[4]; - } type; - }; + template<> + struct storage<3, double, true> + { + struct alignas(4 * sizeof(double)) type { + double data[4]; + }; + }; # endif//GLM_HAS_ALIGNOF # endif - enum genTypeEnum - { - GENTYPE_VEC, - GENTYPE_MAT, - GENTYPE_QUAT - }; - - template - struct genTypeTrait - {}; - - template - struct genTypeTrait > - { - static const genTypeEnum GENTYPE = GENTYPE_MAT; - }; - - template - struct init_gentype - { - }; - - template - struct init_gentype - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genType identity() + enum genTypeEnum { - return genType(1, 0, 0, 0); - } - }; + GENTYPE_VEC, + GENTYPE_MAT, + GENTYPE_QUAT + }; - template - struct init_gentype - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genType identity() + template + struct genTypeTrait { - return genType(1); - } - }; -}//namespace detail + }; + + template + struct genTypeTrait > + { + static const genTypeEnum GENTYPE = GENTYPE_MAT; + }; + + template + struct init_gentype + { + }; + + template + struct init_gentype + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genType identity() + { + return genType(1, 0, 0, 0); + } + }; + + template + struct init_gentype + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genType identity() + { + return genType(1); + } + }; + }//namespace detail }//namespace glm