diff --git a/glm/detail/_noise.hpp b/glm/detail/_noise.hpp index 5a2d46b3..43ac488a 100644 --- a/glm/detail/_noise.hpp +++ b/glm/detail/_noise.hpp @@ -23,20 +23,20 @@ namespace detail return mod289(((x * static_cast(34)) + static_cast(1)) * x); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> permute(vec<2, T, P> const& 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, P> permute(vec<3, T, P> const& 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, P> permute(vec<4, T, P> const& x) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> permute(vec<4, T, Q> const& x) { return mod289(((x * static_cast(34)) + static_cast(1)) * x); } @@ -47,38 +47,38 @@ namespace detail return T(1.79284291400159) - T(0.85373472095314) * r; } - template - GLM_FUNC_QUALIFIER vec<2, T, P> taylorInvSqrt(vec<2, T, P> const& r) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> taylorInvSqrt(vec<2, T, Q> const& r) { return T(1.79284291400159) - T(0.85373472095314) * r; } - template - GLM_FUNC_QUALIFIER vec<3, T, P> taylorInvSqrt(vec<3, T, P> const& r) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> taylorInvSqrt(vec<3, T, Q> const& r) { return T(1.79284291400159) - T(0.85373472095314) * r; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> taylorInvSqrt(vec<4, T, P> const& r) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> taylorInvSqrt(vec<4, T, Q> const& r) { return T(1.79284291400159) - T(0.85373472095314) * r; } - template - GLM_FUNC_QUALIFIER vec<2, T, P> fade(vec<2, T, P> const& t) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> fade(vec<2, T, Q> const& t) { return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> fade(vec<3, T, P> const& t) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> fade(vec<3, T, Q> const& t) { return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); } - template - GLM_FUNC_QUALIFIER vec<4, T, P> fade(vec<4, T, P> const& t) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> fade(vec<4, T, Q> const& t) { return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); } diff --git a/glm/detail/_swizzle.hpp b/glm/detail/_swizzle.hpp index 6f38b011..21566a8e 100644 --- a/glm/detail/_swizzle.hpp +++ b/glm/detail/_swizzle.hpp @@ -20,27 +20,27 @@ namespace detail char _buffer[1]; }; - template + template struct _swizzle_base1 : public _swizzle_base0 { }; - template - struct _swizzle_base1<2, T, P, E0,E1,-1,-2, Aligned> : public _swizzle_base0 + template + struct _swizzle_base1<2, T, Q, E0,E1,-1,-2, Aligned> : public _swizzle_base0 { - GLM_FUNC_QUALIFIER vec<2, T, P> operator ()() const { return vec<2, T, P>(this->elem(E0), this->elem(E1)); } + GLM_FUNC_QUALIFIER vec<2, T, Q> operator ()() const { return vec<2, T, Q>(this->elem(E0), this->elem(E1)); } }; - template - struct _swizzle_base1<3, T, P, E0,E1,E2,-1, Aligned> : public _swizzle_base0 + template + struct _swizzle_base1<3, T, Q, E0,E1,E2,-1, Aligned> : public _swizzle_base0 { - GLM_FUNC_QUALIFIER vec<3, T, P> operator ()() const { return vec<3, T, P>(this->elem(E0), this->elem(E1), this->elem(E2)); } + GLM_FUNC_QUALIFIER vec<3, T, Q> operator ()() const { return vec<3, T, Q>(this->elem(E0), this->elem(E1), this->elem(E2)); } }; - template - struct _swizzle_base1<4, T, P, E0,E1,E2,E3, Aligned> : public _swizzle_base0 + template + struct _swizzle_base1<4, T, Q, E0,E1,E2,E3, Aligned> : public _swizzle_base0 { - GLM_FUNC_QUALIFIER vec<4, T, P> operator ()() const { return vec<4, T, P>(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); } + GLM_FUNC_QUALIFIER vec<4, T, Q> operator ()() const { return vec<4, T, Q>(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); } }; // Internal class for implementing swizzle operators @@ -54,7 +54,7 @@ namespace detail DUPLICATE_ELEMENTS = 1 if there is a repeated element, 0 otherwise (used to specialize swizzles containing duplicate elements so that they cannot be used as r-values). */ - template + template struct _swizzle_base2 : public _swizzle_base1::value> { GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const T& t) @@ -64,7 +64,7 @@ namespace detail return *this; } - GLM_FUNC_QUALIFIER _swizzle_base2& operator= (vec const& that) + GLM_FUNC_QUALIFIER _swizzle_base2& operator= (vec const& that) { struct op { GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e = t; } @@ -73,7 +73,7 @@ namespace detail return *this; } - GLM_FUNC_QUALIFIER void operator -= (vec const& that) + GLM_FUNC_QUALIFIER void operator -= (vec const& that) { struct op { GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e -= t; } @@ -81,7 +81,7 @@ namespace detail _apply_op(that, op()); } - GLM_FUNC_QUALIFIER void operator += (vec const& that) + GLM_FUNC_QUALIFIER void operator += (vec const& that) { struct op { GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e += t; } @@ -89,7 +89,7 @@ namespace detail _apply_op(that, op()); } - GLM_FUNC_QUALIFIER void operator *= (vec const& that) + GLM_FUNC_QUALIFIER void operator *= (vec const& that) { struct op { GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e *= t; } @@ -97,7 +97,7 @@ namespace detail _apply_op(that, op()); } - GLM_FUNC_QUALIFIER void operator /= (vec const& that) + GLM_FUNC_QUALIFIER void operator /= (vec const& that) { struct op { GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e /= t; } @@ -118,7 +118,7 @@ namespace detail protected: template - GLM_FUNC_QUALIFIER void _apply_op(vec const& that, U op) + GLM_FUNC_QUALIFIER void _apply_op(vec const& that, U op) { // Make a copy of the data in this == &that. // The copier should optimize out the copy in cases where the function is @@ -132,7 +132,7 @@ namespace detail }; // Specialization for swizzles containing duplicate elements. These cannot be modified. - template + template struct _swizzle_base2 : public _swizzle_base1::value> { struct Stub {}; @@ -146,7 +146,7 @@ namespace detail } }; - template + template struct _swizzle : public _swizzle_base2 { typedef _swizzle_base2 base_type; @@ -159,8 +159,8 @@ namespace detail // // To prevent the C++ syntax from getting entirely overwhelming, define some alias macros // -#define GLM_SWIZZLE_TEMPLATE1 template -#define GLM_SWIZZLE_TEMPLATE2 template +#define GLM_SWIZZLE_TEMPLATE1 template +#define GLM_SWIZZLE_TEMPLATE2 template #define GLM_SWIZZLE_TYPE1 _swizzle #define GLM_SWIZZLE_TYPE2 _swizzle @@ -297,10 +297,10 @@ namespace glm } #define GLM_SWIZZLE2_2_MEMBERS(T, P, E0,E1) \ - struct { detail::_swizzle<2, T, P, 0,0,-1,-2> E0 ## E0; }; \ - struct { detail::_swizzle<2, T, P, 0,1,-1,-2> E0 ## E1; }; \ - struct { detail::_swizzle<2, T, P, 1,0,-1,-2> E1 ## E0; }; \ - struct { detail::_swizzle<2, T, P, 1,1,-1,-2> E1 ## 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; }; #define GLM_SWIZZLE2_3_MEMBERS(T, P, E0,E1) \ struct { detail::_swizzle<3,T, P, 0,0,0,-1> E0 ## E0 ## E0; }; \ @@ -342,33 +342,33 @@ namespace glm struct { detail::_swizzle<2,T, P, 2,2,-1,-2> E2 ## E2; }; #define GLM_SWIZZLE3_3_MEMBERS(T, P ,E0,E1,E2) \ - struct { detail::_swizzle<3, T, P, 0,0,0,-1> E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, P, 0,0,1,-1> E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, P, 0,0,2,-1> E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, P, 0,1,0,-1> E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, P, 0,1,1,-1> E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, P, 0,1,2,-1> E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, P, 0,2,0,-1> E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, P, 0,2,1,-1> E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, P, 0,2,2,-1> E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<3, T, P, 1,0,0,-1> E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, P, 1,0,1,-1> E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, P, 1,0,2,-1> E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, P, 1,1,0,-1> E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, P, 1,1,1,-1> E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, P, 1,1,2,-1> E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, P, 1,2,0,-1> E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, P, 1,2,1,-1> E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, P, 1,2,2,-1> E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<3, T, P, 2,0,0,-1> E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, P, 2,0,1,-1> E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, P, 2,0,2,-1> E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, P, 2,1,0,-1> E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, P, 2,1,1,-1> E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, P, 2,1,2,-1> E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, P, 2,2,0,-1> E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, P, 2,2,1,-1> E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, P, 2,2,2,-1> E2 ## E2 ## E2; }; + 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,0,2,-1> E0 ## E0 ## E2; }; \ + 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, 0,1,2,-1> E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,0,-1> E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,1,-1> E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,2,-1> E0 ## E2 ## E2; }; \ + 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,0,2,-1> E1 ## E0 ## E2; }; \ + 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; }; \ + struct { detail::_swizzle<3, T, Q, 1,1,2,-1> E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,0,-1> E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,1,-1> E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,2,-1> E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,0,-1> E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,1,-1> E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,2,-1> E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,0,-1> E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,1,-1> E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,2,-1> E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,0,-1> E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,1,-1> E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,2,-1> E2 ## E2 ## E2; }; #define GLM_SWIZZLE3_4_MEMBERS(T, P, E0,E1,E2) \ struct { detail::_swizzle<4,T, P, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ @@ -472,325 +472,325 @@ namespace glm struct { detail::_swizzle<2,T, P, 3,3,-1,-2> E3 ## E3; }; #define GLM_SWIZZLE4_3_MEMBERS(T, P, E0,E1,E2,E3) \ - struct { detail::_swizzle<3, T, P, 0,0,0,-1> E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, P, 0,0,1,-1> E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, P, 0,0,2,-1> E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, P, 0,0,3,-1> E0 ## E0 ## E3; }; \ - struct { detail::_swizzle<3, T, P, 0,1,0,-1> E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, P, 0,1,1,-1> E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, P, 0,1,2,-1> E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, P, 0,1,3,-1> E0 ## E1 ## E3; }; \ - struct { detail::_swizzle<3, T, P, 0,2,0,-1> E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, P, 0,2,1,-1> E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, P, 0,2,2,-1> E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<3, T, P, 0,2,3,-1> E0 ## E2 ## E3; }; \ - struct { detail::_swizzle<3, T, P, 0,3,0,-1> E0 ## E3 ## E0; }; \ - struct { detail::_swizzle<3, T, P, 0,3,1,-1> E0 ## E3 ## E1; }; \ - struct { detail::_swizzle<3, T, P, 0,3,2,-1> E0 ## E3 ## E2; }; \ - struct { detail::_swizzle<3, T, P, 0,3,3,-1> E0 ## E3 ## E3; }; \ - struct { detail::_swizzle<3, T, P, 1,0,0,-1> E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, P, 1,0,1,-1> E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, P, 1,0,2,-1> E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, P, 1,0,3,-1> E1 ## E0 ## E3; }; \ - struct { detail::_swizzle<3, T, P, 1,1,0,-1> E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, P, 1,1,1,-1> E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, P, 1,1,2,-1> E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, P, 1,1,3,-1> E1 ## E1 ## E3; }; \ - struct { detail::_swizzle<3, T, P, 1,2,0,-1> E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, P, 1,2,1,-1> E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, P, 1,2,2,-1> E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<3, T, P, 1,2,3,-1> E1 ## E2 ## E3; }; \ - struct { detail::_swizzle<3, T, P, 1,3,0,-1> E1 ## E3 ## E0; }; \ - struct { detail::_swizzle<3, T, P, 1,3,1,-1> E1 ## E3 ## E1; }; \ - struct { detail::_swizzle<3, T, P, 1,3,2,-1> E1 ## E3 ## E2; }; \ - struct { detail::_swizzle<3, T, P, 1,3,3,-1> E1 ## E3 ## E3; }; \ - struct { detail::_swizzle<3, T, P, 2,0,0,-1> E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, P, 2,0,1,-1> E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, P, 2,0,2,-1> E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, P, 2,0,3,-1> E2 ## E0 ## E3; }; \ - struct { detail::_swizzle<3, T, P, 2,1,0,-1> E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, P, 2,1,1,-1> E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, P, 2,1,2,-1> E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, P, 2,1,3,-1> E2 ## E1 ## E3; }; \ - struct { detail::_swizzle<3, T, P, 2,2,0,-1> E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, P, 2,2,1,-1> E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, P, 2,2,2,-1> E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<3, T, P, 2,2,3,-1> E2 ## E2 ## E3; }; \ - struct { detail::_swizzle<3, T, P, 2,3,0,-1> E2 ## E3 ## E0; }; \ - struct { detail::_swizzle<3, T, P, 2,3,1,-1> E2 ## E3 ## E1; }; \ - struct { detail::_swizzle<3, T, P, 2,3,2,-1> E2 ## E3 ## E2; }; \ - struct { detail::_swizzle<3, T, P, 2,3,3,-1> E2 ## E3 ## E3; }; \ - struct { detail::_swizzle<3, T, P, 3,0,0,-1> E3 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, P, 3,0,1,-1> E3 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, P, 3,0,2,-1> E3 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, P, 3,0,3,-1> E3 ## E0 ## E3; }; \ - struct { detail::_swizzle<3, T, P, 3,1,0,-1> E3 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, P, 3,1,1,-1> E3 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, P, 3,1,2,-1> E3 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, P, 3,1,3,-1> E3 ## E1 ## E3; }; \ - struct { detail::_swizzle<3, T, P, 3,2,0,-1> E3 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, P, 3,2,1,-1> E3 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, P, 3,2,2,-1> E3 ## E2 ## E2; }; \ - struct { detail::_swizzle<3, T, P, 3,2,3,-1> E3 ## E2 ## E3; }; \ - struct { detail::_swizzle<3, T, P, 3,3,0,-1> E3 ## E3 ## E0; }; \ - struct { detail::_swizzle<3, T, P, 3,3,1,-1> E3 ## E3 ## E1; }; \ - struct { detail::_swizzle<3, T, P, 3,3,2,-1> E3 ## E3 ## E2; }; \ - struct { detail::_swizzle<3, T, P, 3,3,3,-1> E3 ## E3 ## E3; }; + 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,0,2,-1> E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 0,0,3,-1> E0 ## E0 ## E3; }; \ + 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, 0,1,2,-1> E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 0,1,3,-1> E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,0,-1> E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,1,-1> E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,2,-1> E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,3,-1> E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 0,3,0,-1> E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 0,3,1,-1> E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 0,3,2,-1> E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 0,3,3,-1> E0 ## E3 ## E3; }; \ + 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,0,2,-1> E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 1,0,3,-1> E1 ## E0 ## E3; }; \ + 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; }; \ + struct { detail::_swizzle<3, T, Q, 1,1,2,-1> E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 1,1,3,-1> E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,0,-1> E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,1,-1> E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,2,-1> E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,3,-1> E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 1,3,0,-1> E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 1,3,1,-1> E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 1,3,2,-1> E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 1,3,3,-1> E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,0,-1> E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,1,-1> E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,2,-1> E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,3,-1> E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,0,-1> E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,1,-1> E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,2,-1> E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,3,-1> E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,0,-1> E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,1,-1> E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,2,-1> E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,3,-1> E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 2,3,0,-1> E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,3,1,-1> E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,3,2,-1> E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,3,3,-1> E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 3,0,0,-1> E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 3,0,1,-1> E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 3,0,2,-1> E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 3,0,3,-1> E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 3,1,0,-1> E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 3,1,1,-1> E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 3,1,2,-1> E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 3,1,3,-1> E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 3,2,0,-1> E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 3,2,1,-1> E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 3,2,2,-1> E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 3,2,3,-1> E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 3,3,0,-1> E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 3,3,1,-1> E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 3,3,2,-1> E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 3,3,3,-1> E3 ## E3 ## E3; }; #define GLM_SWIZZLE4_4_MEMBERS(T, P, E0,E1,E2,E3) \ - struct { detail::_swizzle<4, T, P, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 0,0,0,3> E0 ## E0 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 0,0,1,3> E0 ## E0 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 0,0,2,3> E0 ## E0 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 0,0,3,0> E0 ## E0 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 0,0,3,1> E0 ## E0 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 0,0,3,2> E0 ## E0 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 0,0,3,3> E0 ## E0 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 0,1,0,3> E0 ## E1 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 0,1,1,3> E0 ## E1 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 0,1,2,3> E0 ## E1 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 0,1,3,0> E0 ## E1 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 0,1,3,1> E0 ## E1 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 0,1,3,2> E0 ## E1 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 0,1,3,3> E0 ## E1 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 0,2,0,3> E0 ## E2 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 0,2,1,3> E0 ## E2 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 0,2,2,3> E0 ## E2 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 0,2,3,0> E0 ## E2 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 0,2,3,1> E0 ## E2 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 0,2,3,2> E0 ## E2 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 0,2,3,3> E0 ## E2 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 0,3,0,0> E0 ## E3 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 0,3,0,1> E0 ## E3 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 0,3,0,2> E0 ## E3 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 0,3,0,3> E0 ## E3 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 0,3,1,0> E0 ## E3 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 0,3,1,1> E0 ## E3 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 0,3,1,2> E0 ## E3 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 0,3,1,3> E0 ## E3 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 0,3,2,0> E0 ## E3 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 0,3,2,1> E0 ## E3 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 0,3,2,2> E0 ## E3 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 0,3,2,3> E0 ## E3 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 0,3,3,0> E0 ## E3 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 0,3,3,1> E0 ## E3 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 0,3,3,2> E0 ## E3 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 0,3,3,3> E0 ## E3 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 1,0,0,3> E1 ## E0 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 1,0,1,3> E1 ## E0 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 1,0,2,3> E1 ## E0 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 1,0,3,0> E1 ## E0 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 1,0,3,1> E1 ## E0 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 1,0,3,2> E1 ## E0 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 1,0,3,3> E1 ## E0 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 1,1,0,3> E1 ## E1 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 1,1,1,3> E1 ## E1 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 1,1,2,3> E1 ## E1 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 1,1,3,0> E1 ## E1 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 1,1,3,1> E1 ## E1 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 1,1,3,2> E1 ## E1 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 1,1,3,3> E1 ## E1 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 1,2,0,3> E1 ## E2 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 1,2,1,3> E1 ## E2 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 1,2,2,3> E1 ## E2 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 1,2,3,0> E1 ## E2 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 1,2,3,1> E1 ## E2 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 1,2,3,2> E1 ## E2 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 1,2,3,3> E1 ## E2 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 1,3,0,0> E1 ## E3 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 1,3,0,1> E1 ## E3 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 1,3,0,2> E1 ## E3 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 1,3,0,3> E1 ## E3 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 1,3,1,0> E1 ## E3 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 1,3,1,1> E1 ## E3 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 1,3,1,2> E1 ## E3 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 1,3,1,3> E1 ## E3 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 1,3,2,0> E1 ## E3 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 1,3,2,1> E1 ## E3 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 1,3,2,2> E1 ## E3 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 1,3,2,3> E1 ## E3 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 1,3,3,0> E1 ## E3 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 1,3,3,1> E1 ## E3 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 1,3,3,2> E1 ## E3 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 1,3,3,3> E1 ## E3 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 2,0,0,3> E2 ## E0 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 2,0,1,3> E2 ## E0 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 2,0,2,3> E2 ## E0 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 2,0,3,0> E2 ## E0 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 2,0,3,1> E2 ## E0 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 2,0,3,2> E2 ## E0 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 2,0,3,3> E2 ## E0 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 2,1,0,3> E2 ## E1 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 2,1,1,3> E2 ## E1 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 2,1,2,3> E2 ## E1 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 2,1,3,0> E2 ## E1 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 2,1,3,1> E2 ## E1 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 2,1,3,2> E2 ## E1 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 2,1,3,3> E2 ## E1 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 2,2,0,3> E2 ## E2 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 2,2,1,3> E2 ## E2 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 2,2,2,3> E2 ## E2 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 2,2,3,0> E2 ## E2 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 2,2,3,1> E2 ## E2 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 2,2,3,2> E2 ## E2 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 2,2,3,3> E2 ## E2 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 2,3,0,0> E2 ## E3 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 2,3,0,1> E2 ## E3 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 2,3,0,2> E2 ## E3 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 2,3,0,3> E2 ## E3 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 2,3,1,0> E2 ## E3 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 2,3,1,1> E2 ## E3 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 2,3,1,2> E2 ## E3 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 2,3,1,3> E2 ## E3 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 2,3,2,0> E2 ## E3 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 2,3,2,1> E2 ## E3 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 2,3,2,2> E2 ## E3 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 2,3,2,3> E2 ## E3 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 2,3,3,0> E2 ## E3 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 2,3,3,1> E2 ## E3 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 2,3,3,2> E2 ## E3 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 2,3,3,3> E2 ## E3 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 3,0,0,0> E3 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 3,0,0,1> E3 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 3,0,0,2> E3 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 3,0,0,3> E3 ## E0 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 3,0,1,0> E3 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 3,0,1,1> E3 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 3,0,1,2> E3 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 3,0,1,3> E3 ## E0 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 3,0,2,0> E3 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 3,0,2,1> E3 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 3,0,2,2> E3 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 3,0,2,3> E3 ## E0 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 3,0,3,0> E3 ## E0 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 3,0,3,1> E3 ## E0 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 3,0,3,2> E3 ## E0 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 3,0,3,3> E3 ## E0 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 3,1,0,0> E3 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 3,1,0,1> E3 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 3,1,0,2> E3 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 3,1,0,3> E3 ## E1 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 3,1,1,0> E3 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 3,1,1,1> E3 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 3,1,1,2> E3 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 3,1,1,3> E3 ## E1 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 3,1,2,0> E3 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 3,1,2,1> E3 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 3,1,2,2> E3 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 3,1,2,3> E3 ## E1 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 3,1,3,0> E3 ## E1 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 3,1,3,1> E3 ## E1 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 3,1,3,2> E3 ## E1 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 3,1,3,3> E3 ## E1 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 3,2,0,0> E3 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 3,2,0,1> E3 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 3,2,0,2> E3 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 3,2,0,3> E3 ## E2 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 3,2,1,0> E3 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 3,2,1,1> E3 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 3,2,1,2> E3 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 3,2,1,3> E3 ## E2 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 3,2,2,0> E3 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 3,2,2,1> E3 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 3,2,2,2> E3 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 3,2,2,3> E3 ## E2 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 3,2,3,0> E3 ## E2 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 3,2,3,1> E3 ## E2 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 3,2,3,2> E3 ## E2 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 3,2,3,3> E3 ## E2 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 3,3,0,0> E3 ## E3 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 3,3,0,1> E3 ## E3 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 3,3,0,2> E3 ## E3 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 3,3,0,3> E3 ## E3 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 3,3,1,0> E3 ## E3 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 3,3,1,1> E3 ## E3 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 3,3,1,2> E3 ## E3 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 3,3,1,3> E3 ## E3 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 3,3,2,0> E3 ## E3 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 3,3,2,1> E3 ## E3 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 3,3,2,2> E3 ## E3 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 3,3,2,3> E3 ## E3 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, P, 3,3,3,0> E3 ## E3 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, P, 3,3,3,1> E3 ## E3 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, P, 3,3,3,2> E3 ## E3 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, P, 3,3,3,3> E3 ## E3 ## E3 ## 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; }; diff --git a/glm/detail/_swizzle_func.hpp b/glm/detail/_swizzle_func.hpp index 0ca9bd8e..d2183371 100644 --- a/glm/detail/_swizzle_func.hpp +++ b/glm/detail/_swizzle_func.hpp @@ -4,42 +4,42 @@ #pragma once #define GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, CONST, A, B) \ - vec<2, T, P> A ## B() CONST \ + vec<2, T, Q> A ## B() CONST \ { \ - return vec<2, T, P>(this->A, this->B); \ + return vec<2, T, Q>(this->A, this->B); \ } #define GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, CONST, A, B, C) \ - vec<3, T, P> A ## B ## C() CONST \ + vec<3, T, Q> A ## B ## C() CONST \ { \ - return vec<3, T, P>(this->A, this->B, this->C); \ + return vec<3, T, Q>(this->A, this->B, this->C); \ } #define GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, CONST, A, B, C, D) \ - vec<4, T, P> A ## B ## C ## D() CONST \ + vec<4, T, Q> A ## B ## C ## D() CONST \ { \ - return vec<4, T, P>(this->A, this->B, this->C, this->D); \ + return vec<4, T, Q>(this->A, this->B, this->C, this->D); \ } #define GLM_SWIZZLE_GEN_VEC2_ENTRY_DEF(T, P, L, CONST, A, B) \ template \ - vec vec::A ## B() CONST \ + vec vec::A ## B() CONST \ { \ - return vec<2, T, P>(this->A, this->B); \ + return vec<2, T, Q>(this->A, this->B); \ } #define GLM_SWIZZLE_GEN_VEC3_ENTRY_DEF(T, P, L, CONST, A, B, C) \ template \ - vec<3, T, P> vec::A ## B ## C() CONST \ + vec<3, T, Q> vec::A ## B ## C() CONST \ { \ - return vec<3, T, P>(this->A, this->B, this->C); \ + return vec<3, T, Q>(this->A, this->B, this->C); \ } #define GLM_SWIZZLE_GEN_VEC4_ENTRY_DEF(T, P, L, CONST, A, B, C, D) \ template \ - vec<4, T, P> vec::A ## B ## C ## D() CONST \ + vec<4, T, Q> vec::A ## B ## C ## D() CONST \ { \ - return vec<4, T, P>(this->A, this->B, this->C, this->D); \ + return vec<4, T, Q>(this->A, this->B, this->C, this->D); \ } #define GLM_MUTABLE diff --git a/glm/detail/_vectorize.hpp b/glm/detail/_vectorize.hpp index e07a79d5..2e577a80 100644 --- a/glm/detail/_vectorize.hpp +++ b/glm/detail/_vectorize.hpp @@ -11,120 +11,120 @@ namespace glm{ namespace detail { - template + template struct functor1{}; - template - struct functor1<1, R, T, P> + template + struct functor1<1, R, T, Q> { - GLM_FUNC_QUALIFIER static vec<1, R, P> call(R (*Func) (T x), vec<1, T, P> const& v) + GLM_FUNC_QUALIFIER static vec<1, R, Q> call(R (*Func) (T x), vec<1, T, Q> const& v) { - return vec<1, R, P>(Func(v.x)); + return vec<1, R, Q>(Func(v.x)); } }; - template - struct functor1<2, R, T, P> + template + struct functor1<2, R, T, Q> { - GLM_FUNC_QUALIFIER static vec<2, R, P> call(R (*Func) (T x), vec<2, T, P> const& v) + GLM_FUNC_QUALIFIER static vec<2, R, Q> call(R (*Func) (T x), vec<2, T, Q> const& v) { - return vec<2, R, P>(Func(v.x), Func(v.y)); + return vec<2, R, Q>(Func(v.x), Func(v.y)); } }; - template - struct functor1<3, R, T, P> + template + struct functor1<3, R, T, Q> { - GLM_FUNC_QUALIFIER static vec<3, R, P> call(R (*Func) (T x), vec<3, T, P> const& v) + GLM_FUNC_QUALIFIER static vec<3, R, Q> call(R (*Func) (T x), vec<3, T, Q> const& v) { - return vec<3, R, P>(Func(v.x), Func(v.y), Func(v.z)); + return vec<3, R, Q>(Func(v.x), Func(v.y), Func(v.z)); } }; - template - struct functor1<4, R, T, P> + template + struct functor1<4, R, T, Q> { - GLM_FUNC_QUALIFIER static vec<4, R, P> call(R (*Func) (T x), vec<4, T, P> const& v) + GLM_FUNC_QUALIFIER static vec<4, R, Q> call(R (*Func) (T x), vec<4, T, Q> const& v) { - return vec<4, R, P>(Func(v.x), Func(v.y), Func(v.z), Func(v.w)); + return vec<4, R, Q>(Func(v.x), Func(v.y), Func(v.z), Func(v.w)); } }; - template + template struct functor2{}; - template - struct functor2<1, T, P> + template + struct functor2<1, T, Q> { - GLM_FUNC_QUALIFIER static vec<1, T, P> call(T (*Func) (T x, T y), vec<1, T, P> const& a, vec<1, T, P> const& b) + GLM_FUNC_QUALIFIER static vec<1, T, Q> call(T (*Func) (T x, T y), vec<1, T, Q> const& a, vec<1, T, Q> const& b) { - return vec<1, T, P>(Func(a.x, b.x)); + return vec<1, T, Q>(Func(a.x, b.x)); } }; - template - struct functor2<2, T, P> + template + struct functor2<2, T, Q> { - GLM_FUNC_QUALIFIER static vec<2, T, P> call(T (*Func) (T x, T y), vec<2, T, P> const& a, vec<2, T, P> const& b) + GLM_FUNC_QUALIFIER static vec<2, T, Q> call(T (*Func) (T x, T y), vec<2, T, Q> const& a, vec<2, T, Q> const& b) { - return vec<2, T, P>(Func(a.x, b.x), Func(a.y, b.y)); + return vec<2, T, Q>(Func(a.x, b.x), Func(a.y, b.y)); } }; - template - struct functor2<3, T, P> + template + struct functor2<3, T, Q> { - GLM_FUNC_QUALIFIER static vec<3, T, P> call(T (*Func) (T x, T y), vec<3, T, P> const& a, vec<3, T, P> const& b) + GLM_FUNC_QUALIFIER static vec<3, T, Q> call(T (*Func) (T x, T y), vec<3, T, Q> const& a, vec<3, T, Q> const& b) { - return vec<3, T, P>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z)); + return vec<3, T, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z)); } }; - template - struct functor2<4, T, P> + template + struct functor2<4, T, Q> { - GLM_FUNC_QUALIFIER static vec<4, T, P> call(T (*Func) (T x, T y), vec<4, T, P> const& a, vec<4, T, P> const& b) + GLM_FUNC_QUALIFIER static vec<4, T, Q> call(T (*Func) (T x, T y), vec<4, T, Q> const& a, vec<4, T, Q> const& b) { - return vec<4, T, P>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w)); + return vec<4, T, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w)); } }; - template + template struct functor2_vec_sca{}; - template - struct functor2_vec_sca<1, T, P> + template + struct functor2_vec_sca<1, T, Q> { - GLM_FUNC_QUALIFIER static vec<1, T, P> call(T (*Func) (T x, T y), vec<1, T, P> const& a, T b) + GLM_FUNC_QUALIFIER static vec<1, T, Q> call(T (*Func) (T x, T y), vec<1, T, Q> const& a, T b) { - return vec<1, T, P>(Func(a.x, b)); + return vec<1, T, Q>(Func(a.x, b)); } }; - template - struct functor2_vec_sca<2, T, P> + template + struct functor2_vec_sca<2, T, Q> { - GLM_FUNC_QUALIFIER static vec<2, T, P> call(T (*Func) (T x, T y), vec<2, T, P> const& a, T b) + GLM_FUNC_QUALIFIER static vec<2, T, Q> call(T (*Func) (T x, T y), vec<2, T, Q> const& a, T b) { - return vec<2, T, P>(Func(a.x, b), Func(a.y, b)); + return vec<2, T, Q>(Func(a.x, b), Func(a.y, b)); } }; - template - struct functor2_vec_sca<3, T, P> + template + struct functor2_vec_sca<3, T, Q> { - GLM_FUNC_QUALIFIER static vec<3, T, P> call(T (*Func) (T x, T y), vec<3, T, P> const& a, T b) + GLM_FUNC_QUALIFIER static vec<3, T, Q> call(T (*Func) (T x, T y), vec<3, T, Q> const& a, T b) { - return vec<3, T, P>(Func(a.x, b), Func(a.y, b), Func(a.z, b)); + return vec<3, T, Q>(Func(a.x, b), Func(a.y, b), Func(a.z, b)); } }; - template - struct functor2_vec_sca<4, T, P> + template + struct functor2_vec_sca<4, T, Q> { - GLM_FUNC_QUALIFIER static vec<4, T, P> call(T (*Func) (T x, T y), vec<4, T, P> const& a, T b) + GLM_FUNC_QUALIFIER static vec<4, T, Q> call(T (*Func) (T x, T y), vec<4, T, Q> const& a, T b) { - return vec<4, T, P>(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b)); + return vec<4, T, Q>(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b)); } }; }//namespace detail diff --git a/glm/detail/func_common.hpp b/glm/detail/func_common.hpp index 90fd8d6c..7fe07bcf 100644 --- a/glm/detail/func_common.hpp +++ b/glm/detail/func_common.hpp @@ -38,8 +38,8 @@ namespace glm /// /// @see GLSL abs man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec abs(vec const& x); + template + GLM_FUNC_DECL vec abs(vec const& x); /// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0. /// @@ -49,8 +49,8 @@ namespace glm /// /// @see GLSL sign man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec sign(vec const& x); + template + GLM_FUNC_DECL vec sign(vec const& x); /// Returns a value equal to the nearest integer that is less then or equal to x. /// @@ -60,8 +60,8 @@ namespace glm /// /// @see GLSL floor man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec floor(vec const& x); + template + GLM_FUNC_DECL vec floor(vec const& x); /// Returns a value equal to the nearest integer to x /// whose absolute value is not larger than the absolute value of x. @@ -72,8 +72,8 @@ namespace glm /// /// @see GLSL trunc man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec trunc(vec const& x); + template + GLM_FUNC_DECL vec trunc(vec const& x); /// Returns a value equal to the nearest integer to x. /// The fraction 0.5 will round in a direction chosen by the @@ -87,8 +87,8 @@ namespace glm /// /// @see GLSL round man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec round(vec const& x); + template + GLM_FUNC_DECL vec round(vec const& x); /// Returns a value equal to the nearest integer to x. /// A fractional part of 0.5 will round toward the nearest even @@ -101,8 +101,8 @@ namespace glm /// @see GLSL roundEven man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions /// @see New round to even technique - template - GLM_FUNC_DECL vec roundEven(vec const& x); + template + GLM_FUNC_DECL vec roundEven(vec const& x); /// Returns a value equal to the nearest integer /// that is greater than or equal to x. @@ -113,8 +113,8 @@ namespace glm /// /// @see GLSL ceil man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec ceil(vec const& x); + template + GLM_FUNC_DECL vec ceil(vec const& x); /// Return x - floor(x). /// @@ -133,8 +133,8 @@ namespace glm /// /// @see GLSL fract man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec fract(vec const& x); + template + GLM_FUNC_DECL vec fract(vec const& x); /// Modulus. Returns x - y * floor(x / y) /// for each component in x using the floating point value y. @@ -155,8 +155,8 @@ namespace glm /// /// @see GLSL mod man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec mod(vec const& x, T y); + template + GLM_FUNC_DECL vec mod(vec const& x, T y); /// Modulus. Returns x - y * floor(x / y) /// for each component in x using the floating point value y. @@ -167,8 +167,8 @@ namespace glm /// /// @see GLSL mod man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec mod(vec const& x, vec const& y); + template + GLM_FUNC_DECL vec mod(vec const& x, vec const& y); /// Returns the fractional part of x and sets i to the integer /// part (as a whole number floating point value). Both the @@ -199,8 +199,8 @@ namespace glm /// /// @see GLSL min man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec min(vec const& x, T y); + template + GLM_FUNC_DECL vec min(vec const& x, T y); /// Returns y if y < x; otherwise, it returns x. /// @@ -210,8 +210,8 @@ namespace glm /// /// @see GLSL min man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec min(vec const& x, vec const& y); + template + GLM_FUNC_DECL vec min(vec const& x, vec const& y); /// Returns y if x < y; otherwise, it returns x. /// @@ -230,8 +230,8 @@ namespace glm /// /// @see GLSL max man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec max(vec const& x, T y); + template + GLM_FUNC_DECL vec max(vec const& x, T y); /// Returns y if x < y; otherwise, it returns x. /// @@ -241,8 +241,8 @@ namespace glm /// /// @see GLSL max man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec max(vec const& x, vec const& y); + template + GLM_FUNC_DECL vec max(vec const& x, vec const& y); /// Returns min(max(x, minVal), maxVal) for each component in x /// using the floating-point values minVal and maxVal. @@ -263,8 +263,8 @@ namespace glm /// /// @see GLSL clamp man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec clamp(vec const& x, T minVal, T maxVal); + template + GLM_FUNC_DECL vec clamp(vec const& x, T minVal, T maxVal); /// Returns min(max(x, minVal), maxVal) for each component in x /// using the floating-point values minVal and maxVal. @@ -275,8 +275,8 @@ namespace glm /// /// @see GLSL clamp man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec clamp(vec const& x, vec const& minVal, vec const& maxVal); + template + GLM_FUNC_DECL vec clamp(vec const& x, vec const& minVal, vec const& maxVal); /// If genTypeU is a floating scalar or vector: /// Returns x * (1.0 - a) + y * a, i.e., the linear blend of @@ -323,11 +323,11 @@ namespace glm template GLM_FUNC_DECL genTypeT mix(genTypeT x, genTypeT y, genTypeU a); - template - GLM_FUNC_DECL vec mix(vec const& x, vec const& y, vec const& a); + template + GLM_FUNC_DECL vec mix(vec const& x, vec const& y, vec const& a); - template - GLM_FUNC_DECL vec mix(vec const& x, vec const& y, U a); + template + GLM_FUNC_DECL vec mix(vec const& x, vec const& y, U a); /// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType. /// @@ -344,8 +344,8 @@ namespace glm /// /// @see GLSL step man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec step(T edge, vec const& x); + template + GLM_FUNC_DECL vec step(T edge, vec const& x); /// Returns 0.0 if x < edge, otherwise it returns 1.0. /// @@ -355,8 +355,8 @@ namespace glm /// /// @see GLSL step man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec step(vec const& edge, vec const& x); + template + GLM_FUNC_DECL vec step(vec const& edge, vec const& x); /// Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and /// performs smooth Hermite interpolation between 0 and 1 @@ -375,11 +375,11 @@ namespace glm template GLM_FUNC_DECL genType smoothstep(genType edge0, genType edge1, genType x); - template - GLM_FUNC_DECL vec smoothstep(T edge0, T edge1, vec const& x); + template + GLM_FUNC_DECL vec smoothstep(T edge0, T edge1, vec const& x); - template - GLM_FUNC_DECL vec smoothstep(vec const& edge0, vec const& edge1, vec const& x); + template + GLM_FUNC_DECL vec smoothstep(vec const& edge0, vec const& edge1, vec const& x); /// Returns true if x holds a NaN (not a number) /// representation in the underlying implementation's set of @@ -395,8 +395,8 @@ namespace glm /// /// @see GLSL isnan man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec isnan(vec const& x); + template + GLM_FUNC_DECL vec isnan(vec const& x); /// Returns true if x holds a positive infinity or negative /// infinity representation in the underlying implementation's @@ -410,8 +410,8 @@ namespace glm /// /// @see GLSL isinf man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec isinf(vec const& x); + template + GLM_FUNC_DECL vec isinf(vec const& x); /// Returns a signed integer value representing /// the encoding of a floating-point value. The floating-point @@ -430,8 +430,8 @@ namespace glm /// /// @see GLSL floatBitsToInt man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec floatBitsToInt(vec const& v); + template + GLM_FUNC_DECL vec floatBitsToInt(vec const& v); /// Returns a unsigned integer value representing /// the encoding of a floating-point value. The floatingpoint @@ -450,8 +450,8 @@ namespace glm /// /// @see GLSL floatBitsToUint man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec floatBitsToUint(vec const& v); + template + GLM_FUNC_DECL vec floatBitsToUint(vec const& v); /// Returns a floating-point value corresponding to a signed /// integer encoding of a floating-point value. @@ -474,8 +474,8 @@ namespace glm /// /// @see GLSL intBitsToFloat man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec intBitsToFloat(vec const& v); + template + GLM_FUNC_DECL vec intBitsToFloat(vec const& v); /// Returns a floating-point value corresponding to a /// unsigned integer encoding of a floating-point value. @@ -498,8 +498,8 @@ namespace glm /// /// @see GLSL uintBitsToFloat man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec uintBitsToFloat(vec const& v); + template + GLM_FUNC_DECL vec uintBitsToFloat(vec const& v); /// Computes and returns a * b + c. /// diff --git a/glm/detail/func_common.inl b/glm/detail/func_common.inl index 6857faff..ee40be7d 100644 --- a/glm/detail/func_common.inl +++ b/glm/detail/func_common.inl @@ -107,53 +107,53 @@ namespace detail } }; - template + template struct compute_abs_vector { - GLM_FUNC_QUALIFIER static vec call(vec const& x) + GLM_FUNC_QUALIFIER static vec call(vec const& x) { - return detail::functor1::call(abs, x); + return detail::functor1::call(abs, x); } }; - template + template struct compute_mix_vector { - GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, vec const& a) + GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, vec const& a) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); - return vec(vec(x) + a * vec(y - x)); + return vec(vec(x) + a * vec(y - x)); } }; - template - struct compute_mix_vector + template + struct compute_mix_vector { - GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, vec const& a) + GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, vec const& a) { - vec Result; + vec Result; for(length_t i = 0; i < x.length(); ++i) Result[i] = a[i] ? y[i] : x[i]; return Result; } }; - template + template struct compute_mix_scalar { - GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, U const& a) + GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, U const& a) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); - return vec(vec(x) + a * vec(y - x)); + return vec(vec(x) + a * vec(y - x)); } }; - template - struct compute_mix_scalar + template + struct compute_mix_scalar { - GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, bool const& a) + GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, bool const& a) { return a ? y : x; } @@ -179,127 +179,127 @@ namespace detail } }; - template + template struct compute_sign { - GLM_FUNC_QUALIFIER static vec call(vec const& x) + GLM_FUNC_QUALIFIER static vec call(vec const& x) { - return vec(glm::lessThan(vec(0), x)) - vec(glm::lessThan(x, vec(0))); + return vec(glm::lessThan(vec(0), x)) - vec(glm::lessThan(x, vec(0))); } }; # if GLM_ARCH == GLM_ARCH_X86 - template - struct compute_sign + template + struct compute_sign { - GLM_FUNC_QUALIFIER static vec call(vec const& x) + GLM_FUNC_QUALIFIER static vec call(vec const& x) { T const Shift(static_cast(sizeof(T) * 8 - 1)); - vec const y(vec::type, P>(-x) >> typename make_unsigned::type(Shift)); + vec const y(vec::type, P>(-x) >> typename make_unsigned::type(Shift)); return (x >> Shift) | y; } }; # endif - template + template struct compute_floor { - GLM_FUNC_QUALIFIER static vec call(vec const& x) + GLM_FUNC_QUALIFIER static vec call(vec const& x) { - return detail::functor1::call(std::floor, x); + return detail::functor1::call(std::floor, x); } }; - template + template struct compute_ceil { - GLM_FUNC_QUALIFIER static vec call(vec const& x) + GLM_FUNC_QUALIFIER static vec call(vec const& x) { - return detail::functor1::call(std::ceil, x); + return detail::functor1::call(std::ceil, x); } }; - template + template struct compute_fract { - GLM_FUNC_QUALIFIER static vec call(vec const& x) + GLM_FUNC_QUALIFIER static vec call(vec const& x) { return x - floor(x); } }; - template + template struct compute_trunc { - GLM_FUNC_QUALIFIER static vec call(vec const& x) + GLM_FUNC_QUALIFIER static vec call(vec const& x) { - return detail::functor1::call(trunc, x); + return detail::functor1::call(trunc, x); } }; - template + template struct compute_round { - GLM_FUNC_QUALIFIER static vec call(vec const& x) + GLM_FUNC_QUALIFIER static vec call(vec const& x) { - return detail::functor1::call(round, x); + return detail::functor1::call(round, x); } }; - template + template struct compute_mod { - GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'mod' only accept floating-point inputs. Include for integer inputs."); return a - b * floor(a / b); } }; - template + template struct compute_min_vector { - GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y) + GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y) { - return detail::functor2::call(min, x, y); + return detail::functor2::call(min, x, y); } }; - template + template struct compute_max_vector { - GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y) + GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y) { - return detail::functor2::call(max, x, y); + return detail::functor2::call(max, x, y); } }; - template + template struct compute_clamp_vector { - GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& minVal, vec const& maxVal) + GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& minVal, vec const& maxVal) { return min(max(x, minVal), maxVal); } }; - template + template struct compute_step_vector { - GLM_FUNC_QUALIFIER static vec call(vec const& edge, vec const& x) + GLM_FUNC_QUALIFIER static vec call(vec const& edge, vec const& x) { - return mix(vec(1), vec(0), glm::lessThan(x, edge)); + return mix(vec(1), vec(0), glm::lessThan(x, edge)); } }; - template + template struct compute_smoothstep_vector { - GLM_FUNC_QUALIFIER static vec call(vec const& edge0, vec const& edge1, vec const& x) + GLM_FUNC_QUALIFIER static vec call(vec const& edge0, vec const& edge1, vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'step' only accept floating-point inputs"); - vec const tmp(clamp((x - edge0) / (edge1 - edge0), static_cast(0), static_cast(1))); + vec const tmp(clamp((x - edge0) / (edge1 - edge0), static_cast(0), static_cast(1))); return tmp * tmp * (static_cast(3) - static_cast(2) * tmp); } }; @@ -311,10 +311,10 @@ namespace detail return detail::compute_abs::is_signed>::call(x); } - template - GLM_FUNC_QUALIFIER vec abs(vec const& x) + template + GLM_FUNC_QUALIFIER vec abs(vec const& x) { - return detail::compute_abs_vector::value>::call(x); + return detail::compute_abs_vector::value>::call(x); } // sign @@ -329,37 +329,37 @@ namespace detail return detail::compute_sign<1, genFIType, defaultp, std::numeric_limits::is_iec559, highp>::call(vec<1, genFIType>(x)).x; } - template - GLM_FUNC_QUALIFIER vec sign(vec const& x) + template + GLM_FUNC_QUALIFIER vec sign(vec const& x) { GLM_STATIC_ASSERT( std::numeric_limits::is_iec559 || (std::numeric_limits::is_signed && std::numeric_limits::is_integer), "'sign' only accept signed inputs"); - return detail::compute_sign::is_iec559, detail::is_aligned

::value>::call(x); + return detail::compute_sign::is_iec559, detail::is_aligned::value>::call(x); } // floor using ::std::floor; - template - GLM_FUNC_QUALIFIER vec floor(vec const& x) + template + GLM_FUNC_QUALIFIER vec floor(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'floor' only accept floating-point inputs."); - return detail::compute_floor::value>::call(x); + return detail::compute_floor::value>::call(x); } - template - GLM_FUNC_QUALIFIER vec trunc(vec const& x) + template + GLM_FUNC_QUALIFIER vec trunc(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'trunc' only accept floating-point inputs"); - return detail::compute_trunc::value>::call(x); + return detail::compute_trunc::value>::call(x); } - template - GLM_FUNC_QUALIFIER vec round(vec const& x) + template + GLM_FUNC_QUALIFIER vec round(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'round' only accept floating-point inputs"); - return detail::compute_round::value>::call(x); + return detail::compute_round::value>::call(x); } /* @@ -405,20 +405,20 @@ namespace detail //} } - template - GLM_FUNC_QUALIFIER vec roundEven(vec const& x) + template + GLM_FUNC_QUALIFIER vec roundEven(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'roundEven' only accept floating-point inputs"); - return detail::functor1::call(roundEven, x); + return detail::functor1::call(roundEven, x); } // ceil using ::std::ceil; - template - GLM_FUNC_QUALIFIER vec ceil(vec const& x) + template + GLM_FUNC_QUALIFIER vec ceil(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'ceil' only accept floating-point inputs"); - return detail::compute_ceil::value>::call(x); + return detail::compute_ceil::value>::call(x); } // fract @@ -428,11 +428,11 @@ namespace detail return fract(vec<1, genType>(x)).x; } - template - GLM_FUNC_QUALIFIER vec fract(vec const& x) + template + GLM_FUNC_QUALIFIER vec fract(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fract' only accept floating-point inputs"); - return detail::compute_fract::value>::call(x); + return detail::compute_fract::value>::call(x); } // mod @@ -448,16 +448,16 @@ namespace detail # endif } - template - GLM_FUNC_QUALIFIER vec mod(vec const& x, T y) + template + GLM_FUNC_QUALIFIER vec mod(vec const& x, T y) { - return detail::compute_mod::value>::call(x, vec(y)); + return detail::compute_mod::value>::call(x, vec(y)); } - template - GLM_FUNC_QUALIFIER vec mod(vec const& x, vec const& y) + template + GLM_FUNC_QUALIFIER vec mod(vec const& x, vec const& y) { - return detail::compute_mod::value>::call(x, y); + return detail::compute_mod::value>::call(x, y); } // modf @@ -468,34 +468,34 @@ namespace detail return std::modf(x, &i); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> modf(vec<1, T, P> const& x, vec<1, T, P> & i) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> modf(vec<1, T, Q> const& x, vec<1, T, Q> & i) { - return vec<1, T, P>( + return vec<1, T, Q>( modf(x.x, i.x)); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> modf(vec<2, T, P> const& x, vec<2, T, P> & i) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> modf(vec<2, T, Q> const& x, vec<2, T, Q> & i) { - return vec<2, T, P>( + return vec<2, T, Q>( modf(x.x, i.x), modf(x.y, i.y)); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> modf(vec<3, T, P> const& x, vec<3, T, P> & i) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> modf(vec<3, T, Q> const& x, vec<3, T, Q> & i) { - return vec<3, T, P>( + return vec<3, T, Q>( modf(x.x, i.x), modf(x.y, i.y), modf(x.z, i.z)); } - template - GLM_FUNC_QUALIFIER vec<4, T, P> modf(vec<4, T, P> const& x, vec<4, T, P> & i) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> modf(vec<4, T, Q> const& x, vec<4, T, Q> & i) { - return vec<4, T, P>( + return vec<4, T, Q>( modf(x.x, i.x), modf(x.y, i.y), modf(x.z, i.z), @@ -511,31 +511,31 @@ namespace detail //CHAR_BIT - 1))); // min - template - GLM_FUNC_QUALIFIER vec min(vec const& a, T b) + template + GLM_FUNC_QUALIFIER vec min(vec const& a, T b) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "'min' only accept floating-point or integer inputs"); - return detail::compute_min_vector::value>::call(a, vec(b)); + return detail::compute_min_vector::value>::call(a, vec(b)); } - template - GLM_FUNC_QUALIFIER vec min(vec const& a, vec const& b) + template + GLM_FUNC_QUALIFIER vec min(vec const& a, vec const& b) { - return detail::compute_min_vector::value>::call(a, b); + return detail::compute_min_vector::value>::call(a, b); } // max - template - GLM_FUNC_QUALIFIER vec max(vec const& a, T b) + template + GLM_FUNC_QUALIFIER vec max(vec const& a, T b) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "'max' only accept floating-point or integer inputs"); - return detail::compute_max_vector::value>::call(a, vec(b)); + return detail::compute_max_vector::value>::call(a, vec(b)); } - template - GLM_FUNC_QUALIFIER vec max(vec const& a, vec const& b) + template + GLM_FUNC_QUALIFIER vec max(vec const& a, vec const& b) { - return detail::compute_max_vector::value>::call(a, b); + return detail::compute_max_vector::value>::call(a, b); } // clamp @@ -546,18 +546,18 @@ namespace detail return min(max(x, minVal), maxVal); } - template - GLM_FUNC_QUALIFIER vec clamp(vec const& x, T minVal, T maxVal) + template + GLM_FUNC_QUALIFIER vec clamp(vec const& x, T minVal, T maxVal) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs"); - return detail::compute_clamp_vector::value>::call(x, vec(minVal), vec(maxVal)); + return detail::compute_clamp_vector::value>::call(x, vec(minVal), vec(maxVal)); } - template - GLM_FUNC_QUALIFIER vec clamp(vec const& x, vec const& minVal, vec const& maxVal) + template + GLM_FUNC_QUALIFIER vec clamp(vec const& x, vec const& minVal, vec const& maxVal) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs"); - return detail::compute_clamp_vector::value>::call(x, minVal, maxVal); + return detail::compute_clamp_vector::value>::call(x, minVal, maxVal); } template @@ -566,16 +566,16 @@ namespace detail return detail::compute_mix::call(x, y, a); } - template - GLM_FUNC_QUALIFIER vec mix(vec const& x, vec const& y, U a) + template + GLM_FUNC_QUALIFIER vec mix(vec const& x, vec const& y, U a) { - return detail::compute_mix_scalar::value>::call(x, y, a); + return detail::compute_mix_scalar::value>::call(x, y, a); } - template - GLM_FUNC_QUALIFIER vec mix(vec const& x, vec const& y, vec const& a) + template + GLM_FUNC_QUALIFIER vec mix(vec const& x, vec const& y, vec const& a) { - return detail::compute_mix_vector::value>::call(x, y, a); + return detail::compute_mix_vector::value>::call(x, y, a); } // step @@ -585,16 +585,16 @@ namespace detail return mix(static_cast(1), static_cast(0), glm::lessThan(x, edge)); } - template - GLM_FUNC_QUALIFIER vec step(T edge, vec const& x) + template + GLM_FUNC_QUALIFIER vec step(T edge, vec const& x) { - return detail::compute_step_vector::value>::call(vec(edge), x); + return detail::compute_step_vector::value>::call(vec(edge), x); } - template - GLM_FUNC_QUALIFIER vec step(vec const& edge, vec const& x) + template + GLM_FUNC_QUALIFIER vec step(vec const& edge, vec const& x) { - return detail::compute_step_vector::value>::call(edge, x); + return detail::compute_step_vector::value>::call(edge, x); } // smoothstep @@ -607,16 +607,16 @@ namespace detail return tmp * tmp * (genType(3) - genType(2) * tmp); } - template - GLM_FUNC_QUALIFIER vec smoothstep(T edge0, T edge1, vec const& x) + template + GLM_FUNC_QUALIFIER vec smoothstep(T edge0, T edge1, vec const& x) { - return detail::compute_smoothstep_vector::value>::call(vec(edge0), vec(edge1), x); + return detail::compute_smoothstep_vector::value>::call(vec(edge0), vec(edge1), x); } - template - GLM_FUNC_QUALIFIER vec smoothstep(vec const& edge0, vec const& edge1, vec const& x) + template + GLM_FUNC_QUALIFIER vec smoothstep(vec const& edge0, vec const& edge1, vec const& x) { - return detail::compute_smoothstep_vector::value>::call(edge0, edge1, x); + return detail::compute_smoothstep_vector::value>::call(edge0, edge1, x); } # if GLM_HAS_CXX11_STL @@ -647,12 +647,12 @@ namespace detail } # endif - template - GLM_FUNC_QUALIFIER vec isnan(vec const& x) + template + GLM_FUNC_QUALIFIER vec isnan(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isnan' only accept floating-point inputs"); - return detail::functor1::call(isnan, x); + return detail::functor1::call(isnan, x); } # if GLM_HAS_CXX11_STL @@ -686,12 +686,12 @@ namespace detail } # endif - template - GLM_FUNC_QUALIFIER vec isinf(vec const& x) + template + GLM_FUNC_QUALIFIER vec isinf(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isnan' only accept floating-point inputs"); - return detail::functor1::call(isinf, x); + return detail::functor1::call(isinf, x); } GLM_FUNC_QUALIFIER int floatBitsToInt(float const& v) @@ -707,10 +707,10 @@ namespace detail return u.out; } - template - GLM_FUNC_QUALIFIER vec floatBitsToInt(vec const& v) + template + GLM_FUNC_QUALIFIER vec floatBitsToInt(vec const& v) { - return reinterpret_cast&>(const_cast&>(v)); + return reinterpret_cast&>(const_cast&>(v)); } GLM_FUNC_QUALIFIER uint floatBitsToUint(float const& v) @@ -726,10 +726,10 @@ namespace detail return u.out; } - template - GLM_FUNC_QUALIFIER vec floatBitsToUint(vec const& v) + template + GLM_FUNC_QUALIFIER vec floatBitsToUint(vec const& v) { - return reinterpret_cast&>(const_cast&>(v)); + return reinterpret_cast&>(const_cast&>(v)); } GLM_FUNC_QUALIFIER float intBitsToFloat(int const& v) @@ -745,10 +745,10 @@ namespace detail return u.out; } - template - GLM_FUNC_QUALIFIER vec intBitsToFloat(vec const& v) + template + GLM_FUNC_QUALIFIER vec intBitsToFloat(vec const& v) { - return reinterpret_cast&>(const_cast&>(v)); + return reinterpret_cast&>(const_cast&>(v)); } GLM_FUNC_QUALIFIER float uintBitsToFloat(uint const& v) @@ -764,10 +764,10 @@ namespace detail return u.out; } - template - GLM_FUNC_QUALIFIER vec uintBitsToFloat(vec const& v) + template + GLM_FUNC_QUALIFIER vec uintBitsToFloat(vec const& v) { - return reinterpret_cast&>(const_cast&>(v)); + return reinterpret_cast&>(const_cast&>(v)); } template @@ -784,41 +784,41 @@ namespace detail return std::frexp(x, &exp); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> frexp(vec<1, T, P> const& x, vec<1, int, P>& exp) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> frexp(vec<1, T, Q> const& x, vec<1, int, Q>& exp) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs"); - return vec<1, T, P>(std::frexp(x.x, &exp.x)); + return vec<1, T, Q>(std::frexp(x.x, &exp.x)); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> frexp(vec<2, T, P> const& x, vec<2, int, P>& exp) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> frexp(vec<2, T, Q> const& x, vec<2, int, Q>& exp) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs"); - return vec<2, T, P>( + return vec<2, T, Q>( frexp(x.x, exp.x), frexp(x.y, exp.y)); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> frexp(vec<3, T, P> const& x, vec<3, int, P>& exp) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> frexp(vec<3, T, Q> const& x, vec<3, int, Q>& exp) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs"); - return vec<3, T, P>( + return vec<3, T, Q>( frexp(x.x, exp.x), frexp(x.y, exp.y), frexp(x.z, exp.z)); } - template - GLM_FUNC_QUALIFIER vec<4, T, P> frexp(vec<4, T, P> const& x, vec<4, int, P>& exp) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> frexp(vec<4, T, Q> const& x, vec<4, int, Q>& exp) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs"); - return vec<4, T, P>( + return vec<4, T, Q>( frexp(x.x, exp.x), frexp(x.y, exp.y), frexp(x.z, exp.z), @@ -833,42 +833,42 @@ namespace detail return std::ldexp(x, exp); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> ldexp(vec<1, T, P> const& x, vec<1, int, P> const& exp) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> ldexp(vec<1, T, Q> const& x, vec<1, int, Q> const& exp) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs"); - return vec<1, T, P>( + return vec<1, T, Q>( ldexp(x.x, exp.x)); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> ldexp(vec<2, T, P> const& x, vec<2, int, P> const& exp) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> ldexp(vec<2, T, Q> const& x, vec<2, int, Q> const& exp) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs"); - return vec<2, T, P>( + return vec<2, T, Q>( ldexp(x.x, exp.x), ldexp(x.y, exp.y)); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> ldexp(vec<3, T, P> const& x, vec<3, int, P> const& exp) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> ldexp(vec<3, T, Q> const& x, vec<3, int, Q> const& exp) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs"); - return vec<3, T, P>( + return vec<3, T, Q>( ldexp(x.x, exp.x), ldexp(x.y, exp.y), ldexp(x.z, exp.z)); } - template - GLM_FUNC_QUALIFIER vec<4, T, P> ldexp(vec<4, T, P> const& x, vec<4, int, P> const& exp) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> ldexp(vec<4, T, Q> const& x, vec<4, int, Q> const& exp) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs"); - return vec<4, T, P>( + return vec<4, T, Q>( ldexp(x.x, exp.x), ldexp(x.y, exp.y), ldexp(x.z, exp.z), diff --git a/glm/detail/func_common_simd.inl b/glm/detail/func_common_simd.inl index 7cf0ea36..9c2d820e 100644 --- a/glm/detail/func_common_simd.inl +++ b/glm/detail/func_common_simd.inl @@ -10,10 +10,10 @@ namespace glm{ namespace detail { - template + template struct compute_abs_vector<4, float, P, true> { - GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& v) + GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, Q> const& v) { vec<4, float, P> result; result.data = glm_vec4_abs(v.data); @@ -21,21 +21,21 @@ namespace detail } }; - template - struct compute_abs_vector<4, int, P, true> + template + struct compute_abs_vector<4, int, Q, true> { - GLM_FUNC_QUALIFIER static vec<4, int, P> call(vec<4, int, P> const& v) + GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v) { - vec<4, int, P> result; + vec<4, int, Q> result; result.data = glm_ivec4_abs(v.data); return result; } }; - template + template struct compute_floor<4, float, P, true> { - GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& v) + GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, Q> const& v) { vec<4, float, P> result; result.data = glm_vec4_floor(v.data); @@ -43,10 +43,10 @@ namespace detail } }; - template + template struct compute_ceil<4, float, P, true> { - GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& v) + GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, Q> const& v) { vec<4, float, P> result; result.data = glm_vec4_ceil(v.data); @@ -54,10 +54,10 @@ namespace detail } }; - template + template struct compute_fract<4, float, P, true> { - GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& v) + GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, Q> const& v) { vec<4, float, P> result; result.data = glm_vec4_fract(v.data); @@ -65,10 +65,10 @@ namespace detail } }; - template + template struct compute_round<4, float, P, true> { - GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& v) + GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, Q> const& v) { vec<4, float, P> result; result.data = glm_vec4_round(v.data); @@ -76,10 +76,10 @@ namespace detail } }; - template + template struct compute_mod<4, float, P, true> { - GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& x, vec<4, float, P> const& y) + GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, Q> const& x, vec<4, float, Q> const& y) { vec<4, float, P> result; result.data = glm_vec4_mod(x.data, y.data); @@ -87,10 +87,10 @@ namespace detail } }; - template + template struct compute_min_vector<4, float, P, true> { - GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& v1, vec<4, float, P> const& v2) + GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) { vec<4, float, P> result; result.data = _mm_min_ps(v1.data, v2.data); @@ -98,10 +98,10 @@ namespace detail } }; - template + template struct compute_min_vector<4, int32, P, true> { - GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, int32, P> const& v1, vec<4, int32, P> const& v2) + GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, int32, Q> const& v1, vec<4, int32, Q> const& v2) { vec<4, int32, P> result; result.data = _mm_min_epi32(v1.data, v2.data); @@ -109,10 +109,10 @@ namespace detail } }; - template + template struct compute_min_vector<4, uint32, P, true> { - GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, uint32, P> const& v1, vec<4, uint32, P> const& v2) + GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, uint32, Q> const& v1, vec<4, uint32, Q> const& v2) { vec<4, uint32, P> result; result.data = _mm_min_epu32(v1.data, v2.data); @@ -120,10 +120,10 @@ namespace detail } }; - template + template struct compute_max_vector<4, float, P, true> { - GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& v1, vec<4, float, P> const& v2) + GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) { vec<4, float, P> result; result.data = _mm_max_ps(v1.data, v2.data); @@ -131,10 +131,10 @@ namespace detail } }; - template + template struct compute_max_vector<4, int32, P, true> { - GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, int32, P> const& v1, vec<4, int32, P> const& v2) + GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, int32, Q> const& v1, vec<4, int32, Q> const& v2) { vec<4, int32, P> result; result.data = _mm_max_epi32(v1.data, v2.data); @@ -142,10 +142,10 @@ namespace detail } }; - template + template struct compute_max_vector<4, uint32, P, true> { - GLM_FUNC_QUALIFIER static vec<4, uint32, P> call(vec<4, uint32, P> const& v1, vec<4, uint32, P> const& v2) + GLM_FUNC_QUALIFIER static vec<4, uint32, P> call(vec<4, uint32, Q> const& v1, vec<4, uint32, Q> const& v2) { vec<4, uint32, P> result; result.data = _mm_max_epu32(v1.data, v2.data); @@ -153,10 +153,10 @@ namespace detail } }; - template + template struct compute_clamp_vector<4, float, P, true> { - GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& x, vec<4, float, P> const& minVal, vec<4, float, P> const& maxVal) + GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, Q> const& x, vec<4, float, Q> const& minVal, vec<4, float, Q> const& maxVal) { vec<4, float, P> result; result.data = _mm_min_ps(_mm_max_ps(x.data, minVal.data), maxVal.data); @@ -164,10 +164,10 @@ namespace detail } }; - template + template struct compute_clamp_vector<4, int32, P, true> { - GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, int32, P> const& x, vec<4, int32, P> const& minVal, vec<4, int32, P> const& maxVal) + GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, int32, Q> const& x, vec<4, int32, Q> const& minVal, vec<4, int32, Q> const& maxVal) { vec<4, int32, P> result; result.data = _mm_min_epi32(_mm_max_epi32(x.data, minVal.data), maxVal.data); @@ -175,10 +175,10 @@ namespace detail } }; - template + template struct compute_clamp_vector<4, uint32, P, true> { - GLM_FUNC_QUALIFIER static vec<4, uint32, P> call(vec<4, uint32, P> const& x, vec<4, uint32, P> const& minVal, vec<4, uint32, P> const& maxVal) + GLM_FUNC_QUALIFIER static vec<4, uint32, P> call(vec<4, uint32, Q> const& x, vec<4, uint32, Q> const& minVal, vec<4, uint32, Q> const& maxVal) { vec<4, uint32, P> result; result.data = _mm_min_epu32(_mm_max_epu32(x.data, minVal.data), maxVal.data); @@ -186,10 +186,10 @@ namespace detail } }; - template + template struct compute_mix_vector<4, float, bool, P, true> { - GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& x, vec<4, float, P> const& y, vec<4, bool, P> const& a) + GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, Q> const& x, vec<4, float, Q> const& y, vec<4, bool, Q> const& a) { __m128i const Load = _mm_set_epi32(-static_cast(a.w), -static_cast(a.z), -static_cast(a.y), -static_cast(a.x)); __m128 const Mask = _mm_castsi128_ps(Load); @@ -204,10 +204,10 @@ namespace detail } }; /* FIXME - template + template struct compute_step_vector { - GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& edge, vec<4, float, P> const& x) + GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, Q> const& edge, vec<4, float, Q> const& x) { vec<4, float, P> Result; result.data = glm_vec4_step(edge.data, x.data); @@ -215,10 +215,10 @@ namespace detail } }; */ - template + template struct compute_smoothstep_vector<4, float, P, true> { - GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& edge0, vec<4, float, P> const& edge1, vec<4, float, P> const& x) + GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, Q> const& edge0, vec<4, float, Q> const& edge1, vec<4, float, Q> const& x) { vec<4, float, P> Result; Result.data = glm_vec4_smoothstep(edge0.data, edge1.data, x.data); diff --git a/glm/detail/func_exponential.hpp b/glm/detail/func_exponential.hpp index c0289cae..8de5839e 100644 --- a/glm/detail/func_exponential.hpp +++ b/glm/detail/func_exponential.hpp @@ -28,8 +28,8 @@ namespace glm /// /// @see GLSL pow man page /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions - template - GLM_FUNC_DECL vec pow(vec const& base, vec const& exponent); + template + GLM_FUNC_DECL vec pow(vec const& base, vec const& exponent); /// Returns the natural exponentiation of x, i.e., e^x. /// @@ -39,8 +39,8 @@ namespace glm /// /// @see GLSL exp man page /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions - template - GLM_FUNC_DECL vec exp(vec const& v); + template + GLM_FUNC_DECL vec exp(vec const& v); /// Returns the natural logarithm of v, i.e., /// returns the value y which satisfies the equation x = e^y. @@ -52,8 +52,8 @@ namespace glm /// /// @see GLSL log man page /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions - template - GLM_FUNC_DECL vec log(vec const& v); + template + GLM_FUNC_DECL vec log(vec const& v); /// Returns 2 raised to the v power. /// @@ -63,8 +63,8 @@ namespace glm /// /// @see GLSL exp2 man page /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions - template - GLM_FUNC_DECL vec exp2(vec const& v); + template + GLM_FUNC_DECL vec exp2(vec const& v); /// Returns the base 2 log of x, i.e., returns the value y, /// which satisfies the equation x = 2 ^ y. @@ -75,8 +75,8 @@ namespace glm /// /// @see GLSL log2 man page /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions - template - GLM_FUNC_DECL vec log2(vec const& v); + template + GLM_FUNC_DECL vec log2(vec const& v); /// Returns the positive square root of v. /// @@ -86,8 +86,8 @@ namespace glm /// /// @see GLSL sqrt man page /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions - template - GLM_FUNC_DECL vec sqrt(vec const& v); + template + GLM_FUNC_DECL vec sqrt(vec const& v); /// Returns the reciprocal of the positive square root of v. /// @@ -97,8 +97,8 @@ namespace glm /// /// @see GLSL inversesqrt man page /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions - template - GLM_FUNC_DECL vec inversesqrt(vec const& v); + template + GLM_FUNC_DECL vec inversesqrt(vec const& v); /// @} }//namespace glm diff --git a/glm/detail/func_exponential.inl b/glm/detail/func_exponential.inl index faea7dea..e574beba 100644 --- a/glm/detail/func_exponential.inl +++ b/glm/detail/func_exponential.inl @@ -20,28 +20,28 @@ namespace detail } # endif - template + template struct compute_log2 { - GLM_FUNC_QUALIFIER static vec call(vec const& v) + GLM_FUNC_QUALIFIER static vec call(vec const& v) { - return detail::functor1::call(log2, v); + return detail::functor1::call(log2, v); } }; - template + template struct compute_sqrt { - GLM_FUNC_QUALIFIER static vec call(vec const& x) + GLM_FUNC_QUALIFIER static vec call(vec const& x) { - return detail::functor1::call(std::sqrt, x); + return detail::functor1::call(std::sqrt, x); } }; - template + template struct compute_inversesqrt { - GLM_FUNC_QUALIFIER static vec call(vec const& x) + GLM_FUNC_QUALIFIER static vec call(vec const& x) { return static_cast(1) / sqrt(x); } @@ -66,26 +66,26 @@ namespace detail // pow using std::pow; - template - GLM_FUNC_QUALIFIER vec pow(vec const& base, vec const& exponent) + template + GLM_FUNC_QUALIFIER vec pow(vec const& base, vec const& exponent) { - return detail::functor2::call(pow, base, exponent); + return detail::functor2::call(pow, base, exponent); } // exp using std::exp; - template - GLM_FUNC_QUALIFIER vec exp(vec const& x) + template + GLM_FUNC_QUALIFIER vec exp(vec const& x) { - return detail::functor1::call(exp, x); + return detail::functor1::call(exp, x); } // log using std::log; - template - GLM_FUNC_QUALIFIER vec log(vec const& x) + template + GLM_FUNC_QUALIFIER vec log(vec const& x) { - return detail::functor1::call(log, x); + return detail::functor1::call(log, x); } //exp2, ln2 = 0.69314718055994530941723212145818f @@ -97,10 +97,10 @@ namespace detail return std::exp(static_cast(0.69314718055994530941723212145818) * x); } - template - GLM_FUNC_QUALIFIER vec exp2(vec const& x) + template + GLM_FUNC_QUALIFIER vec exp2(vec const& x) { - return detail::functor1::call(exp2, x); + return detail::functor1::call(exp2, x); } // log2, ln2 = 0.69314718055994530941723212145818f @@ -110,19 +110,19 @@ namespace detail return log2(vec<1, genType>(x)).x; } - template - GLM_FUNC_QUALIFIER vec log2(vec const& x) + template + GLM_FUNC_QUALIFIER vec log2(vec const& x) { - return detail::compute_log2::is_iec559, detail::is_aligned

::value>::call(x); + return detail::compute_log2::is_iec559, detail::is_aligned::value>::call(x); } // sqrt using std::sqrt; - template - GLM_FUNC_QUALIFIER vec sqrt(vec const& x) + template + GLM_FUNC_QUALIFIER vec sqrt(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'sqrt' only accept floating-point inputs"); - return detail::compute_sqrt::value>::call(x); + return detail::compute_sqrt::value>::call(x); } // inversesqrt @@ -132,11 +132,11 @@ namespace detail return static_cast(1) / sqrt(x); } - template - GLM_FUNC_QUALIFIER vec inversesqrt(vec const& x) + template + GLM_FUNC_QUALIFIER vec inversesqrt(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'inversesqrt' only accept floating-point inputs"); - return detail::compute_inversesqrt::value>::call(x); + return detail::compute_inversesqrt::value>::call(x); } }//namespace glm diff --git a/glm/detail/func_exponential_simd.inl b/glm/detail/func_exponential_simd.inl index 1dd61f0f..6fb164fe 100644 --- a/glm/detail/func_exponential_simd.inl +++ b/glm/detail/func_exponential_simd.inl @@ -8,10 +8,10 @@ namespace glm{ namespace detail { - template + template struct compute_sqrt<4, float, P, true> { - GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& v) + GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, Q> const& v) { vec<4, float, P> Result; Result.data = _mm_sqrt_ps(v.data); diff --git a/glm/detail/func_geometric.hpp b/glm/detail/func_geometric.hpp index 94c06d7b..1bc5a6b5 100644 --- a/glm/detail/func_geometric.hpp +++ b/glm/detail/func_geometric.hpp @@ -24,8 +24,8 @@ namespace glm /// /// @see GLSL length man page /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions - template - GLM_FUNC_DECL T length(vec const& x); + template + GLM_FUNC_DECL T length(vec const& x); /// Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). /// @@ -34,8 +34,8 @@ namespace glm /// /// @see GLSL distance man page /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions - template - GLM_FUNC_DECL T distance(vec const& p0, vec const& p1); + template + GLM_FUNC_DECL T distance(vec const& p0, vec const& p1); /// Returns the dot product of x and y, i.e., result = x * y. /// @@ -44,8 +44,8 @@ namespace glm /// /// @see GLSL dot man page /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions - template - GLM_FUNC_DECL T dot(vec const& x, vec const& y); + template + GLM_FUNC_DECL T dot(vec const& x, vec const& y); /// Returns the cross product of x and y. /// @@ -53,8 +53,8 @@ namespace glm /// /// @see GLSL cross man page /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions - template - GLM_FUNC_DECL vec<3, T, P> cross(vec<3, T, P> const& x, vec<3, T, P> const& y); + template + GLM_FUNC_DECL vec<3, T, Q> cross(vec<3, T, Q> const& x, vec<3, T, Q> const& y); /// Returns a vector in the same direction as x but with length of 1. /// According to issue 10 GLSL 1.10 specification, if length(x) == 0 then result is undefined and generate an error. @@ -64,8 +64,8 @@ namespace glm /// /// @see GLSL normalize man page /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions - template - GLM_FUNC_DECL vec normalize(vec const& x); + template + GLM_FUNC_DECL vec normalize(vec const& x); /// If dot(Nref, I) < 0.0, return N, otherwise, return -N. /// @@ -74,11 +74,11 @@ namespace glm /// /// @see GLSL faceforward man page /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions - template - GLM_FUNC_DECL vec faceforward( - vec const& N, - vec const& I, - vec const& Nref); + template + GLM_FUNC_DECL vec faceforward( + vec const& N, + vec const& I, + vec const& Nref); /// For the incident vector I and surface orientation N, /// returns the reflection direction : result = I - 2.0 * dot(N, I) * N. @@ -88,10 +88,10 @@ namespace glm /// /// @see GLSL reflect man page /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions - template - GLM_FUNC_DECL vec reflect( - vec const& I, - vec const& N); + template + GLM_FUNC_DECL vec reflect( + vec const& I, + vec const& N); /// For the incident vector I and surface normal N, /// and the ratio of indices of refraction eta, @@ -102,10 +102,10 @@ namespace glm /// /// @see GLSL refract man page /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions - template - GLM_FUNC_DECL vec refract( - vec const& I, - vec const& N, + template + GLM_FUNC_DECL vec refract( + vec const& I, + vec const& N, T eta); /// @} diff --git a/glm/detail/func_geometric.inl b/glm/detail/func_geometric.inl index 546ccc06..e06b6df4 100644 --- a/glm/detail/func_geometric.inl +++ b/glm/detail/func_geometric.inl @@ -10,19 +10,19 @@ namespace glm{ namespace detail { - template + template struct compute_length { - GLM_FUNC_QUALIFIER static T call(vec const& v) + GLM_FUNC_QUALIFIER static T call(vec const& v) { return sqrt(dot(v, v)); } }; - template + template struct compute_distance { - GLM_FUNC_QUALIFIER static T call(vec const& p0, vec const& p1) + GLM_FUNC_QUALIFIER static T call(vec const& p0, vec const& p1) { return length(p1 - p0); } @@ -31,63 +31,63 @@ namespace detail template struct compute_dot{}; - template - struct compute_dot, T, Aligned> + template + struct compute_dot, T, Aligned> { - GLM_FUNC_QUALIFIER static T call(vec<1, T, P> const& a, vec<1, T, P> const& b) + GLM_FUNC_QUALIFIER static T call(vec<1, T, Q> const& a, vec<1, T, Q> const& b) { return a.x * b.x; } }; - template - struct compute_dot, T, Aligned> + template + struct compute_dot, T, Aligned> { - GLM_FUNC_QUALIFIER static T call(vec<2, T, P> const& a, vec<2, T, P> const& b) + GLM_FUNC_QUALIFIER static T call(vec<2, T, Q> const& a, vec<2, T, Q> const& b) { - vec<2, T, P> tmp(a * b); + vec<2, T, Q> tmp(a * b); return tmp.x + tmp.y; } }; - template - struct compute_dot, T, Aligned> + template + struct compute_dot, T, Aligned> { - GLM_FUNC_QUALIFIER static T call(vec<3, T, P> const& a, vec<3, T, P> const& b) + GLM_FUNC_QUALIFIER static T call(vec<3, T, Q> const& a, vec<3, T, Q> const& b) { - vec<3, T, P> tmp(a * b); + vec<3, T, Q> tmp(a * b); return tmp.x + tmp.y + tmp.z; } }; - template - struct compute_dot, T, Aligned> + template + struct compute_dot, T, Aligned> { - GLM_FUNC_QUALIFIER static T call(vec<4, T, P> const& a, vec<4, T, P> const& b) + GLM_FUNC_QUALIFIER static T call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) { - vec<4, T, P> tmp(a * b); + vec<4, T, Q> tmp(a * b); return (tmp.x + tmp.y) + (tmp.z + tmp.w); } }; - template + template struct compute_cross { - GLM_FUNC_QUALIFIER static vec<3, T, P> call(vec<3, T, P> const& x, vec<3, T, P> const& y) + GLM_FUNC_QUALIFIER static vec<3, T, Q> call(vec<3, T, Q> const& x, vec<3, T, Q> const& y) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'cross' accepts only floating-point inputs"); - return vec<3, T, P>( + return vec<3, T, Q>( x.y * y.z - y.y * x.z, x.z * y.x - y.z * x.x, x.x * y.y - y.x * x.y); } }; - template + template struct compute_normalize { - GLM_FUNC_QUALIFIER static vec call(vec const& v) + GLM_FUNC_QUALIFIER static vec call(vec const& v) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'normalize' accepts only floating-point inputs"); @@ -95,10 +95,10 @@ namespace detail } }; - template + template struct compute_faceforward { - GLM_FUNC_QUALIFIER static vec call(vec const& N, vec const& I, vec const& Nref) + GLM_FUNC_QUALIFIER static vec call(vec const& N, vec const& I, vec const& Nref) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'normalize' accepts only floating-point inputs"); @@ -106,19 +106,19 @@ namespace detail } }; - template + template struct compute_reflect { - GLM_FUNC_QUALIFIER static vec call(vec const& I, vec const& N) + GLM_FUNC_QUALIFIER static vec call(vec const& I, vec const& N) { return I - N * dot(N, I) * static_cast(2); } }; - template + template struct compute_refract { - GLM_FUNC_QUALIFIER static vec call(vec const& I, vec const& N, T eta) + GLM_FUNC_QUALIFIER static vec call(vec const& I, vec const& N, T eta) { T const dotValue(dot(N, I)); T const k(static_cast(1) - eta * eta * (static_cast(1) - dotValue * dotValue)); @@ -136,12 +136,12 @@ namespace detail return abs(x); } - template - GLM_FUNC_QUALIFIER T length(vec const& v) + template + GLM_FUNC_QUALIFIER T length(vec const& v) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'length' accepts only floating-point inputs"); - return detail::compute_length::value>::call(v); + return detail::compute_length::value>::call(v); } // distance @@ -153,10 +153,10 @@ namespace detail return length(p1 - p0); } - template - GLM_FUNC_QUALIFIER T distance(vec const& p0, vec const& p1) + template + GLM_FUNC_QUALIFIER T distance(vec const& p0, vec const& p1) { - return detail::compute_distance::value>::call(p0, p1); + return detail::compute_distance::value>::call(p0, p1); } // dot @@ -167,25 +167,25 @@ namespace detail return x * y; } - template - GLM_FUNC_QUALIFIER T dot(vec const& x, vec const& y) + template + GLM_FUNC_QUALIFIER T dot(vec const& x, vec const& y) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'dot' accepts only floating-point inputs"); - return detail::compute_dot, T, detail::is_aligned

::value>::call(x, y); + return detail::compute_dot, T, detail::is_aligned::value>::call(x, y); } - template - GLM_FUNC_QUALIFIER T dot(tquat const& x, tquat const& y) + template + GLM_FUNC_QUALIFIER T dot(tquat const& x, tquat const& y) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'dot' accepts only floating-point inputs"); - return detail::compute_dot, T, detail::is_aligned

::value>::call(x, y); + return detail::compute_dot, T, detail::is_aligned::value>::call(x, y); } // cross - template - GLM_FUNC_QUALIFIER vec<3, T, P> cross(vec<3, T, P> const& x, vec<3, T, P> const& y) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> cross(vec<3, T, Q> const& x, vec<3, T, Q> const& y) { - return detail::compute_cross::value>::call(x, y); + return detail::compute_cross::value>::call(x, y); } // normalize @@ -197,12 +197,12 @@ namespace detail return x < genType(0) ? genType(-1) : genType(1); } - template - GLM_FUNC_QUALIFIER vec normalize(vec const& x) + template + GLM_FUNC_QUALIFIER vec normalize(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'normalize' accepts only floating-point inputs"); - return detail::compute_normalize::value>::call(x); + return detail::compute_normalize::value>::call(x); } // faceforward @@ -212,10 +212,10 @@ namespace detail return dot(Nref, I) < static_cast(0) ? N : -N; } - template - GLM_FUNC_QUALIFIER vec faceforward(vec const& N, vec const& I, vec const& Nref) + template + GLM_FUNC_QUALIFIER vec faceforward(vec const& N, vec const& I, vec const& Nref) { - return detail::compute_faceforward::value>::call(N, I, Nref); + return detail::compute_faceforward::value>::call(N, I, Nref); } // reflect @@ -225,10 +225,10 @@ namespace detail return I - N * dot(N, I) * genType(2); } - template - GLM_FUNC_QUALIFIER vec reflect(vec const& I, vec const& N) + template + GLM_FUNC_QUALIFIER vec reflect(vec const& I, vec const& N) { - return detail::compute_reflect::value>::call(I, N); + return detail::compute_reflect::value>::call(I, N); } // refract @@ -241,11 +241,11 @@ namespace detail return (eta * I - (eta * dotValue + sqrt(k)) * N) * static_cast(k >= static_cast(0)); } - template - GLM_FUNC_QUALIFIER vec refract(vec const& I, vec const& N, T eta) + template + GLM_FUNC_QUALIFIER vec refract(vec const& I, vec const& N, T eta) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'refract' accepts only floating-point inputs"); - return detail::compute_refract::value>::call(I, N, eta); + return detail::compute_refract::value>::call(I, N, eta); } }//namespace glm diff --git a/glm/detail/func_geometric_simd.inl b/glm/detail/func_geometric_simd.inl index 218c73a7..b6194651 100644 --- a/glm/detail/func_geometric_simd.inl +++ b/glm/detail/func_geometric_simd.inl @@ -8,37 +8,37 @@ namespace glm{ namespace detail { - template + template struct compute_length<4, float, P, true> { - GLM_FUNC_QUALIFIER static float call(vec<4, float, P> const& v) + GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& v) { return _mm_cvtss_f32(glm_vec4_length(v.data)); } }; - template + template struct compute_distance<4, float, P, true> { - GLM_FUNC_QUALIFIER static float call(vec<4, float, P> const& p0, vec<4, float, P> const& p1) + GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& p0, vec<4, float, Q> const& p1) { return _mm_cvtss_f32(glm_vec4_distance(p0.data, p1.data)); } }; - template + template struct compute_dot, float, true> { - GLM_FUNC_QUALIFIER static float call(vec<4, float, P> const& x, vec<4, float, P> const& y) + GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& x, vec<4, float, Q> const& y) { return _mm_cvtss_f32(glm_vec1_dot(x.data, y.data)); } }; - template + template struct compute_cross { - GLM_FUNC_QUALIFIER static vec<3, float, P> call(vec<3, float, P> const& a, vec<3, float, P> const& b) + GLM_FUNC_QUALIFIER static vec<3, float, P> call(vec<3, float, Q> const& a, vec<3, float, Q> const& b) { __m128 const set0 = _mm_set_ps(0.0f, a.z, a.y, a.x); __m128 const set1 = _mm_set_ps(0.0f, b.z, b.y, b.x); @@ -46,14 +46,14 @@ namespace detail vec<4, float, P> Result; Result.data = xpd0; - return vec<3, float, P>(Result); + return vec<3, float, Q>(Result); } }; - template + template struct compute_normalize<4, float, P, true> { - GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& v) + GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, Q> const& v) { vec<4, float, P> Result; Result.data = glm_vec4_normalize(v.data); @@ -61,10 +61,10 @@ namespace detail } }; - template + template struct compute_faceforward<4, float, P, true> { - GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& N, vec<4, float, P> const& I, vec<4, float, P> const& Nref) + GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, Q> const& N, vec<4, float, Q> const& I, vec<4, float, Q> const& Nref) { vec<4, float, P> Result; Result.data = glm_vec4_faceforward(N.data, I.data, Nref.data); @@ -72,10 +72,10 @@ namespace detail } }; - template + template struct compute_reflect<4, float, P, true> { - GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& I, vec<4, float, P> const& N) + GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, Q> const& I, vec<4, float, Q> const& N) { vec<4, float, P> Result; Result.data = glm_vec4_reflect(I.data, N.data); @@ -83,10 +83,10 @@ namespace detail } }; - template + template struct compute_refract<4, float, P, true> { - GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& I, vec<4, float, P> const& N, float eta) + GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, Q> const& I, vec<4, float, Q> const& N, float eta) { vec<4, float, P> Result; Result.data = glm_vec4_refract(I.data, N.data, _mm_set1_ps(eta)); diff --git a/glm/detail/func_integer.hpp b/glm/detail/func_integer.hpp index 10e4da75..5690afe1 100644 --- a/glm/detail/func_integer.hpp +++ b/glm/detail/func_integer.hpp @@ -30,11 +30,11 @@ namespace glm /// /// @see GLSL uaddCarry man page /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions - template - GLM_FUNC_DECL vec uaddCarry( - vec const& x, - vec const& y, - vec & carry); + template + GLM_FUNC_DECL vec uaddCarry( + vec const& x, + vec const& y, + vec & carry); /// Subtracts the 32-bit unsigned integer y from x, returning /// the difference if non-negative, or pow(2, 32) plus the difference @@ -44,11 +44,11 @@ namespace glm /// /// @see GLSL usubBorrow man page /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions - template - GLM_FUNC_DECL vec usubBorrow( - vec const& x, - vec const& y, - vec & borrow); + template + GLM_FUNC_DECL vec usubBorrow( + vec const& x, + vec const& y, + vec & borrow); /// Multiplies 32-bit integers x and y, producing a 64-bit /// result. The 32 least-significant bits are returned in lsb. @@ -58,12 +58,12 @@ namespace glm /// /// @see GLSL umulExtended man page /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions - template + template GLM_FUNC_DECL void umulExtended( - vec const& x, - vec const& y, - vec & msb, - vec & lsb); + vec const& x, + vec const& y, + vec & msb, + vec & lsb); /// Multiplies 32-bit integers x and y, producing a 64-bit /// result. The 32 least-significant bits are returned in lsb. @@ -73,12 +73,12 @@ namespace glm /// /// @see GLSL imulExtended man page /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions - template + template GLM_FUNC_DECL void imulExtended( - vec const& x, - vec const& y, - vec & msb, - vec & lsb); + vec const& x, + vec const& y, + vec & msb, + vec & lsb); /// Extracts bits [offset, offset + bits - 1] from value, /// returning them in the least significant bits of the result. @@ -96,9 +96,9 @@ namespace glm /// /// @see GLSL bitfieldExtract man page /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions - template - GLM_FUNC_DECL vec bitfieldExtract( - vec const& Value, + template + GLM_FUNC_DECL vec bitfieldExtract( + vec const& Value, int Offset, int Bits); @@ -117,10 +117,10 @@ namespace glm /// /// @see GLSL bitfieldInsert man page /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions - template - GLM_FUNC_DECL vec bitfieldInsert( - vec const& Base, - vec const& Insert, + template + GLM_FUNC_DECL vec bitfieldInsert( + vec const& Base, + vec const& Insert, int Offset, int Bits); @@ -133,8 +133,8 @@ namespace glm /// /// @see GLSL bitfieldReverse man page /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions - template - GLM_FUNC_DECL vec bitfieldReverse(vec const& v); + template + GLM_FUNC_DECL vec bitfieldReverse(vec const& v); /// Returns the number of bits set to 1 in the binary representation of value. /// @@ -152,8 +152,8 @@ namespace glm /// /// @see GLSL bitCount man page /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions - template - GLM_FUNC_DECL vec bitCount(vec const& v); + template + GLM_FUNC_DECL vec bitCount(vec const& v); /// Returns the bit number of the least significant bit set to /// 1 in the binary representation of value. @@ -175,8 +175,8 @@ namespace glm /// /// @see GLSL findLSB man page /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions - template - GLM_FUNC_DECL vec findLSB(vec const& v); + template + GLM_FUNC_DECL vec findLSB(vec const& v); /// Returns the bit number of the most significant bit in the binary representation of value. /// For positive integers, the result will be the bit number of the most significant bit set to 1. @@ -200,8 +200,8 @@ namespace glm /// /// @see GLSL findMSB man page /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions - template - GLM_FUNC_DECL vec findMSB(vec const& v); + template + GLM_FUNC_DECL vec findMSB(vec const& v); /// @} }//namespace glm diff --git a/glm/detail/func_integer.inl b/glm/detail/func_integer.inl index 6f6925bf..3617ef38 100644 --- a/glm/detail/func_integer.inl +++ b/glm/detail/func_integer.inl @@ -30,37 +30,37 @@ namespace detail return Bits >= static_cast(sizeof(T) * 8) ? ~static_cast(0) : (static_cast(1) << Bits) - static_cast(1); } - template + template struct compute_bitfieldReverseStep { - GLM_FUNC_QUALIFIER static vec call(vec const& v, T, T) + GLM_FUNC_QUALIFIER static vec call(vec const& v, T, T) { return v; } }; - template - struct compute_bitfieldReverseStep + template + struct compute_bitfieldReverseStep { - GLM_FUNC_QUALIFIER static vec call(vec const& v, T Mask, T Shift) + GLM_FUNC_QUALIFIER static vec call(vec const& v, T Mask, T Shift) { return (v & Mask) << Shift | (v & (~Mask)) >> Shift; } }; - template + template struct compute_bitfieldBitCountStep { - GLM_FUNC_QUALIFIER static vec call(vec const& v, T, T) + GLM_FUNC_QUALIFIER static vec call(vec const& v, T, T) { return v; } }; - template - struct compute_bitfieldBitCountStep + template + struct compute_bitfieldBitCountStep { - GLM_FUNC_QUALIFIER static vec call(vec const& v, T Mask, T Shift) + GLM_FUNC_QUALIFIER static vec call(vec const& v, T Mask, T Shift) { return (v & Mask) + ((v >> Shift) & Mask); } @@ -104,37 +104,37 @@ namespace detail # endif # endif//GLM_HAS_BITSCAN_WINDOWS - template + template struct compute_findMSB_step_vec { - GLM_FUNC_QUALIFIER static vec call(vec const& x, T Shift) + GLM_FUNC_QUALIFIER static vec call(vec const& x, T Shift) { return x | (x >> Shift); } }; - template - struct compute_findMSB_step_vec + template + struct compute_findMSB_step_vec { - GLM_FUNC_QUALIFIER static vec call(vec const& x, T) + GLM_FUNC_QUALIFIER static vec call(vec const& x, T) { return x; } }; - template + template struct compute_findMSB_vec { - GLM_FUNC_QUALIFIER static vec call(vec const& v) + GLM_FUNC_QUALIFIER static vec call(vec const& v) { - vec x(v); - x = compute_findMSB_step_vec= 8>::call(x, static_cast( 1)); - x = compute_findMSB_step_vec= 8>::call(x, static_cast( 2)); - x = compute_findMSB_step_vec= 8>::call(x, static_cast( 4)); - x = compute_findMSB_step_vec= 16>::call(x, static_cast( 8)); - x = compute_findMSB_step_vec= 32>::call(x, static_cast(16)); - x = compute_findMSB_step_vec= 64>::call(x, static_cast(32)); - return vec(sizeof(T) * 8 - 1) - glm::bitCount(~x); + vec x(v); + x = compute_findMSB_step_vec= 8>::call(x, static_cast( 1)); + x = compute_findMSB_step_vec= 8>::call(x, static_cast( 2)); + x = compute_findMSB_step_vec= 8>::call(x, static_cast( 4)); + x = compute_findMSB_step_vec= 16>::call(x, static_cast( 8)); + x = compute_findMSB_step_vec= 32>::call(x, static_cast(16)); + x = compute_findMSB_step_vec= 64>::call(x, static_cast(32)); + return vec(sizeof(T) * 8 - 1) - glm::bitCount(~x); } }; @@ -147,12 +147,12 @@ namespace detail return IsNotNull ? int(Result) : -1; } - template - struct compute_findMSB_vec + template + struct compute_findMSB_vec { - GLM_FUNC_QUALIFIER static vec call(vec const& x) + GLM_FUNC_QUALIFIER static vec call(vec const& x) { - return detail::functor1::call(compute_findMSB_32, x); + return detail::functor1::call(compute_findMSB_32, x); } }; @@ -165,12 +165,12 @@ namespace detail return IsNotNull ? int(Result) : -1; } - template - struct compute_findMSB_vec + template + struct compute_findMSB_vec { - GLM_FUNC_QUALIFIER static vec call(vec const& x) + GLM_FUNC_QUALIFIER static vec call(vec const& x) { - return detail::functor1::call(compute_findMSB_64, x); + return detail::functor1::call(compute_findMSB_64, x); } }; # endif @@ -186,13 +186,13 @@ namespace detail return static_cast(Value64 % (Max32 + static_cast(1))); } - template - GLM_FUNC_QUALIFIER vec uaddCarry(vec const& x, vec const& y, vec& Carry) + template + GLM_FUNC_QUALIFIER vec uaddCarry(vec const& x, vec const& y, vec& Carry) { - vec Value64(vec(x) + vec(y)); - vec Max32((static_cast(1) << static_cast(32)) - static_cast(1)); - Carry = mix(vec(0), vec(1), greaterThan(Value64, Max32)); - return vec(Value64 % (Max32 + static_cast(1))); + vec Value64(vec(x) + vec(y)); + vec Max32((static_cast(1) << static_cast(32)) - static_cast(1)); + Carry = mix(vec(0), vec(1), greaterThan(Value64, Max32)); + return vec(Value64 % (Max32 + static_cast(1))); } // usubBorrow @@ -207,12 +207,12 @@ namespace detail return static_cast((static_cast(1) << static_cast(32)) + (static_cast(y) - static_cast(x))); } - template - GLM_FUNC_QUALIFIER vec usubBorrow(vec const& x, vec const& y, vec& Borrow) + template + GLM_FUNC_QUALIFIER vec usubBorrow(vec const& x, vec const& y, vec& Borrow) { - Borrow = mix(vec(1), vec(0), greaterThanEqual(x, y)); - vec const YgeX(y - x); - vec const XgeY(vec((static_cast(1) << static_cast(32)) + (vec(y) - vec(x)))); + Borrow = mix(vec(1), vec(0), greaterThanEqual(x, y)); + vec const YgeX(y - x); + vec const XgeY(vec((static_cast(1) << static_cast(32)) + (vec(y) - vec(x)))); return mix(XgeY, YgeX, greaterThanEqual(y, x)); } @@ -226,14 +226,14 @@ namespace detail lsb = static_cast(Value64); } - template - GLM_FUNC_QUALIFIER void umulExtended(vec const& x, vec const& y, vec& msb, vec& lsb) + template + GLM_FUNC_QUALIFIER void umulExtended(vec const& x, vec const& y, vec& msb, vec& lsb) { GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch"); - vec Value64(vec(x) * vec(y)); - msb = vec(Value64 >> static_cast(32)); - lsb = vec(Value64); + vec Value64(vec(x) * vec(y)); + msb = vec(Value64 >> static_cast(32)); + lsb = vec(Value64); } // imulExtended @@ -246,14 +246,14 @@ namespace detail lsb = static_cast(Value64); } - template - GLM_FUNC_QUALIFIER void imulExtended(vec const& x, vec const& y, vec& msb, vec& lsb) + template + GLM_FUNC_QUALIFIER void imulExtended(vec const& x, vec const& y, vec& msb, vec& lsb) { GLM_STATIC_ASSERT(sizeof(int) == sizeof(int32), "int and int32 size mismatch"); - vec Value64(vec(x) * vec(y)); - lsb = vec(Value64 & static_cast(0xFFFFFFFF)); - msb = vec((Value64 >> static_cast(32)) & static_cast(0xFFFFFFFF)); + vec Value64(vec(x) * vec(y)); + lsb = vec(Value64 & static_cast(0xFFFFFFFF)); + msb = vec((Value64 >> static_cast(32)) & static_cast(0xFFFFFFFF)); } // bitfieldExtract @@ -263,8 +263,8 @@ namespace detail return bitfieldExtract(vec<1, genIUType>(Value), Offset, Bits).x; } - template - GLM_FUNC_QUALIFIER vec bitfieldExtract(vec const& Value, int Offset, int Bits) + template + GLM_FUNC_QUALIFIER vec bitfieldExtract(vec const& Value, int Offset, int Bits) { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldExtract' only accept integer inputs"); @@ -278,8 +278,8 @@ namespace detail return bitfieldInsert(vec<1, genIUType>(Base), vec<1, genIUType>(Insert), Offset, Bits).x; } - template - GLM_FUNC_QUALIFIER vec bitfieldInsert(vec const& Base, vec const& Insert, int Offset, int Bits) + template + GLM_FUNC_QUALIFIER vec bitfieldInsert(vec const& Base, vec const& Insert, int Offset, int Bits) { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldInsert' only accept integer values"); @@ -294,16 +294,16 @@ namespace detail return bitfieldReverse(glm::vec<1, genType, glm::defaultp>(x)).x; } - template - GLM_FUNC_QUALIFIER vec bitfieldReverse(vec const& v) + template + GLM_FUNC_QUALIFIER vec bitfieldReverse(vec const& v) { - vec x(v); - x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 2>::call(x, static_cast(0x5555555555555555ull), static_cast( 1)); - x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 4>::call(x, static_cast(0x3333333333333333ull), static_cast( 2)); - x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 8>::call(x, static_cast(0x0F0F0F0F0F0F0F0Full), static_cast( 4)); - x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 16>::call(x, static_cast(0x00FF00FF00FF00FFull), static_cast( 8)); - x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 32>::call(x, static_cast(0x0000FFFF0000FFFFull), static_cast(16)); - x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 64>::call(x, static_cast(0x00000000FFFFFFFFull), static_cast(32)); + vec x(v); + x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 2>::call(x, static_cast(0x5555555555555555ull), static_cast( 1)); + x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 4>::call(x, static_cast(0x3333333333333333ull), static_cast( 2)); + x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 8>::call(x, static_cast(0x0F0F0F0F0F0F0F0Full), static_cast( 4)); + x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 16>::call(x, static_cast(0x00FF00FF00FF00FFull), static_cast( 8)); + x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 32>::call(x, static_cast(0x0000FFFF0000FFFFull), static_cast(16)); + x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 64>::call(x, static_cast(0x00000000FFFFFFFFull), static_cast(32)); return x; } @@ -314,22 +314,22 @@ namespace detail return bitCount(glm::vec<1, genType, glm::defaultp>(x)).x; } - template - GLM_FUNC_QUALIFIER vec bitCount(vec const& v) + template + GLM_FUNC_QUALIFIER vec bitCount(vec const& v) { # if GLM_COMPILER & GLM_COMPILER_VC # pragma warning(push) # pragma warning(disable : 4310) //cast truncates constant value # endif - vec::type, P> x(*reinterpret_cast::type, P> const *>(&v)); - x = detail::compute_bitfieldBitCountStep::type, P, detail::is_aligned

::value, sizeof(T) * 8>= 2>::call(x, typename detail::make_unsigned::type(0x5555555555555555ull), typename detail::make_unsigned::type( 1)); - x = detail::compute_bitfieldBitCountStep::type, P, detail::is_aligned

::value, sizeof(T) * 8>= 4>::call(x, typename detail::make_unsigned::type(0x3333333333333333ull), typename detail::make_unsigned::type( 2)); - x = detail::compute_bitfieldBitCountStep::type, P, detail::is_aligned

::value, sizeof(T) * 8>= 8>::call(x, typename detail::make_unsigned::type(0x0F0F0F0F0F0F0F0Full), typename detail::make_unsigned::type( 4)); - x = detail::compute_bitfieldBitCountStep::type, P, detail::is_aligned

::value, sizeof(T) * 8>= 16>::call(x, typename detail::make_unsigned::type(0x00FF00FF00FF00FFull), typename detail::make_unsigned::type( 8)); - x = detail::compute_bitfieldBitCountStep::type, P, detail::is_aligned

::value, sizeof(T) * 8>= 32>::call(x, typename detail::make_unsigned::type(0x0000FFFF0000FFFFull), typename detail::make_unsigned::type(16)); - x = detail::compute_bitfieldBitCountStep::type, P, detail::is_aligned

::value, sizeof(T) * 8>= 64>::call(x, typename detail::make_unsigned::type(0x00000000FFFFFFFFull), typename detail::make_unsigned::type(32)); - return vec(x); + vec::type, Q> x(*reinterpret_cast::type, Q> const *>(&v)); + x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 2>::call(x, typename detail::make_unsigned::type(0x5555555555555555ull), typename detail::make_unsigned::type( 1)); + x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 4>::call(x, typename detail::make_unsigned::type(0x3333333333333333ull), typename detail::make_unsigned::type( 2)); + x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 8>::call(x, typename detail::make_unsigned::type(0x0F0F0F0F0F0F0F0Full), typename detail::make_unsigned::type( 4)); + x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 16>::call(x, typename detail::make_unsigned::type(0x00FF00FF00FF00FFull), typename detail::make_unsigned::type( 8)); + x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 32>::call(x, typename detail::make_unsigned::type(0x0000FFFF0000FFFFull), typename detail::make_unsigned::type(16)); + x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 64>::call(x, typename detail::make_unsigned::type(0x00000000FFFFFFFFull), typename detail::make_unsigned::type(32)); + return vec(x); # if GLM_COMPILER & GLM_COMPILER_VC # pragma warning(pop) @@ -345,12 +345,12 @@ namespace detail return detail::compute_findLSB::call(Value); } - template - GLM_FUNC_QUALIFIER vec findLSB(vec const& x) + template + GLM_FUNC_QUALIFIER vec findLSB(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findLSB' only accept integer values"); - return detail::functor1::call(findLSB, x); + return detail::functor1::call(findLSB, x); } // findMSB @@ -362,12 +362,12 @@ namespace detail return findMSB(vec<1, genIUType>(v)).x; } - template - GLM_FUNC_QUALIFIER vec findMSB(vec const& v) + template + GLM_FUNC_QUALIFIER vec findMSB(vec const& v) { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findMSB' only accept integer values"); - return detail::compute_findMSB_vec::call(v); + return detail::compute_findMSB_vec::call(v); } }//namespace glm diff --git a/glm/detail/func_integer_simd.inl b/glm/detail/func_integer_simd.inl index a31a57b8..9259f52d 100644 --- a/glm/detail/func_integer_simd.inl +++ b/glm/detail/func_integer_simd.inl @@ -11,7 +11,7 @@ namespace detail template struct compute_bitfieldReverseStep<4, uint32, P, true, true> { - GLM_FUNC_QUALIFIER static vec<4, uint32, P> call(vec<4, uint32, P> const& v, uint32 Mask, uint32 Shift) + GLM_FUNC_QUALIFIER static vec<4, uint32, P> call(vec<4, uint32, Q> const& v, uint32 Mask, uint32 Shift) { __m128i const set0 = v.data; @@ -32,7 +32,7 @@ namespace detail template struct compute_bitfieldBitCountStep<4, uint32, P, true, true> { - GLM_FUNC_QUALIFIER static vec<4, uint32, P> call(vec<4, uint32, P> const& v, uint32 Mask, uint32 Shift) + GLM_FUNC_QUALIFIER static vec<4, uint32, P> call(vec<4, uint32, Q> const& v, uint32 Mask, uint32 Shift) { __m128i const set0 = v.data; diff --git a/glm/detail/func_matrix.hpp b/glm/detail/func_matrix.hpp index f2fd1b1a..80621619 100644 --- a/glm/detail/func_matrix.hpp +++ b/glm/detail/func_matrix.hpp @@ -34,58 +34,58 @@ namespace glm{ namespace detail { - template - struct outerProduct_trait<2, 2, T, P> + template + struct outerProduct_trait<2, 2, T, Q> { - typedef mat<2, 2, T, P> type; + typedef mat<2, 2, T, Q> type; }; - template - struct outerProduct_trait<2, 3, T, P> + template + struct outerProduct_trait<2, 3, T, Q> { - typedef mat<3, 2, T, P> type; + typedef mat<3, 2, T, Q> type; }; - template - struct outerProduct_trait<2, 4, T, P> + template + struct outerProduct_trait<2, 4, T, Q> { - typedef mat<4, 2, T, P> type; + typedef mat<4, 2, T, Q> type; }; - template - struct outerProduct_trait<3, 2, T, P> + template + struct outerProduct_trait<3, 2, T, Q> { - typedef mat<2, 3, T, P> type; + typedef mat<2, 3, T, Q> type; }; - template - struct outerProduct_trait<3, 3, T, P> + template + struct outerProduct_trait<3, 3, T, Q> { - typedef mat<3, 3, T, P> type; + typedef mat<3, 3, T, Q> type; }; - template - struct outerProduct_trait<3, 4, T, P> + template + struct outerProduct_trait<3, 4, T, Q> { - typedef mat<4, 3, T, P> type; + typedef mat<4, 3, T, Q> type; }; - template - struct outerProduct_trait<4, 2, T, P> + template + struct outerProduct_trait<4, 2, T, Q> { - typedef mat<2, 4, T, P> type; + typedef mat<2, 4, T, Q> type; }; - template - struct outerProduct_trait<4, 3, T, P> + template + struct outerProduct_trait<4, 3, T, Q> { - typedef mat<3, 4, T, P> type; + typedef mat<3, 4, T, Q> type; }; - template - struct outerProduct_trait<4, 4, T, P> + template + struct outerProduct_trait<4, 4, T, Q> { - typedef mat<4, 4, T, P> type; + typedef mat<4, 4, T, Q> type; }; }//namespace detail @@ -100,8 +100,8 @@ namespace detail /// /// @see GLSL matrixCompMult man page /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions - template class matType> - GLM_FUNC_DECL matType matrixCompMult(matType const& x, matType const& y); + template + GLM_FUNC_DECL mat matrixCompMult(mat const& x, mat const& y); /// Treats the first parameter c as a column vector /// and the second parameter r as a row vector @@ -109,8 +109,8 @@ namespace detail /// /// @see GLSL outerProduct man page /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions - template - GLM_FUNC_DECL typename detail::outerProduct_trait::type outerProduct(vec const& c, vec const& r); + template + GLM_FUNC_DECL typename detail::outerProduct_trait::type outerProduct(vec const& c, vec const& r); /// Returns the transposed matrix of x /// @@ -118,8 +118,8 @@ namespace detail /// /// @see GLSL transpose man page /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions - template class matType> - GLM_FUNC_DECL typename matType::transpose_type transpose(matType const& x); + template + GLM_FUNC_DECL typename mat::transpose_type transpose(mat const& x); /// Return the determinant of a squared matrix. /// @@ -127,8 +127,8 @@ namespace detail /// /// @see GLSL determinant man page /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions - template class matType> - GLM_FUNC_DECL T determinant(matType const& m); + template + GLM_FUNC_DECL T determinant(mat const& m); /// Return the inverse of a squared matrix. /// @@ -136,8 +136,8 @@ namespace detail /// /// @see GLSL inverse man page /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions - template class matType> - GLM_FUNC_DECL matType inverse(matType const& m); + template + GLM_FUNC_DECL mat inverse(mat const& m); /// @} }//namespace glm diff --git a/glm/detail/func_matrix.inl b/glm/detail/func_matrix.inl index d607a982..d823d76b 100644 --- a/glm/detail/func_matrix.inl +++ b/glm/detail/func_matrix.inl @@ -7,27 +7,27 @@ namespace glm{ namespace detail { - template class matType, length_t C, length_t R, typename T, qualifier P, bool Aligned> + template struct compute_matrixCompMult { - GLM_FUNC_QUALIFIER static matType call(matType const& x, matType const& y) + GLM_FUNC_QUALIFIER static mat call(mat const& x, mat const& y) { - matType Result; + mat Result; for(length_t i = 0; i < Result.length(); ++i) Result[i] = x[i] * y[i]; return Result; } }; - template class matType, length_t C, length_t R, typename T, qualifier P, bool Aligned> + template struct compute_transpose{}; - template - struct compute_transpose + template + struct compute_transpose<2, 2, T, Q, Aligned> { - GLM_FUNC_QUALIFIER static mat<2, 2, T, P> call(mat<2, 2, T, P> const& m) + GLM_FUNC_QUALIFIER static mat<2, 2, T, Q> call(mat<2, 2, T, Q> const& m) { - mat<2, 2, T, P> Result; + mat<2, 2, T, Q> Result; Result[0][0] = m[0][0]; Result[0][1] = m[1][0]; Result[1][0] = m[0][1]; @@ -36,12 +36,12 @@ namespace detail } }; - template - struct compute_transpose + template + struct compute_transpose<2, 3, T, Q, Aligned> { - GLM_FUNC_QUALIFIER static mat<3, 2, T, P> call(mat<2, 3, T, P> const& m) + GLM_FUNC_QUALIFIER static mat<3, 2, T, Q> call(mat<2, 3, T, Q> const& m) { - mat<3,2, T, P> Result; + mat<3,2, T, Q> Result; Result[0][0] = m[0][0]; Result[0][1] = m[1][0]; Result[1][0] = m[0][1]; @@ -52,12 +52,12 @@ namespace detail } }; - template - struct compute_transpose + template + struct compute_transpose<2, 4, T, Q, Aligned> { - GLM_FUNC_QUALIFIER static mat<4, 2, T, P> call(mat<2, 4, T, P> const& m) + GLM_FUNC_QUALIFIER static mat<4, 2, T, Q> call(mat<2, 4, T, Q> const& m) { - mat<4, 2, T, P> Result; + mat<4, 2, T, Q> Result; Result[0][0] = m[0][0]; Result[0][1] = m[1][0]; Result[1][0] = m[0][1]; @@ -70,12 +70,12 @@ namespace detail } }; - template - struct compute_transpose + template + struct compute_transpose<3, 2, T, Q, Aligned> { - GLM_FUNC_QUALIFIER static mat<2, 3, T, P> call(mat<3, 2, T, P> const& m) + GLM_FUNC_QUALIFIER static mat<2, 3, T, Q> call(mat<3, 2, T, Q> const& m) { - mat<2, 3, T, P> Result; + mat<2, 3, T, Q> Result; Result[0][0] = m[0][0]; Result[0][1] = m[1][0]; Result[0][2] = m[2][0]; @@ -86,12 +86,12 @@ namespace detail } }; - template - struct compute_transpose + template + struct compute_transpose<3, 3, T, Q, Aligned> { - GLM_FUNC_QUALIFIER static mat<3, 3, T, P> call(mat<3, 3, T, P> const& m) + GLM_FUNC_QUALIFIER static mat<3, 3, T, Q> call(mat<3, 3, T, Q> const& m) { - mat<3, 3, T, P> Result; + mat<3, 3, T, Q> Result; Result[0][0] = m[0][0]; Result[0][1] = m[1][0]; Result[0][2] = m[2][0]; @@ -107,12 +107,12 @@ namespace detail } }; - template - struct compute_transpose + template + struct compute_transpose<3, 4, T, Q, Aligned> { - GLM_FUNC_QUALIFIER static mat<4, 3, T, P> call(mat<3, 4, T, P> const& m) + GLM_FUNC_QUALIFIER static mat<4, 3, T, Q> call(mat<3, 4, T, Q> const& m) { - mat<4, 3, T, P> Result; + mat<4, 3, T, Q> Result; Result[0][0] = m[0][0]; Result[0][1] = m[1][0]; Result[0][2] = m[2][0]; @@ -129,12 +129,12 @@ namespace detail } }; - template - struct compute_transpose + template + struct compute_transpose<4, 2, T, Q, Aligned> { - GLM_FUNC_QUALIFIER static mat<2, 4, T, P> call(mat<4, 2, T, P> const& m) + GLM_FUNC_QUALIFIER static mat<2, 4, T, Q> call(mat<4, 2, T, Q> const& m) { - mat<2, 4, T, P> Result; + mat<2, 4, T, Q> Result; Result[0][0] = m[0][0]; Result[0][1] = m[1][0]; Result[0][2] = m[2][0]; @@ -147,12 +147,12 @@ namespace detail } }; - template - struct compute_transpose + template + struct compute_transpose<4, 3, T, Q, Aligned> { - GLM_FUNC_QUALIFIER static mat<3, 4, T, P> call(mat<4, 3, T, P> const& m) + GLM_FUNC_QUALIFIER static mat<3, 4, T, Q> call(mat<4, 3, T, Q> const& m) { - mat<3, 4, T, P> Result; + mat<3, 4, T, Q> Result; Result[0][0] = m[0][0]; Result[0][1] = m[1][0]; Result[0][2] = m[2][0]; @@ -169,12 +169,12 @@ namespace detail } }; - template - struct compute_transpose + template + struct compute_transpose<4, 4, T, Q, Aligned> { - GLM_FUNC_QUALIFIER static mat<4, 4, T, P> call(mat<4, 4, T, P> const& m) + GLM_FUNC_QUALIFIER static mat<4, 4, T, Q> call(mat<4, 4, T, Q> const& m) { - mat<4, 4, T, P> Result; + mat<4, 4, T, Q> Result; Result[0][0] = m[0][0]; Result[0][1] = m[1][0]; Result[0][2] = m[2][0]; @@ -198,22 +198,22 @@ namespace detail } }; - template class matType, length_t C, length_t R, typename T, qualifier P, bool Aligned> + template struct compute_determinant{}; - template - struct compute_determinant + template + struct compute_determinant<2, 2, T, Q, Aligned> { - GLM_FUNC_QUALIFIER static T call(mat<2, 2, T, P> const& m) + GLM_FUNC_QUALIFIER static T call(mat<2, 2, T, Q> const& m) { return m[0][0] * m[1][1] - m[1][0] * m[0][1]; } }; - template - struct compute_determinant + template + struct compute_determinant<3, 3, T, Q, Aligned> { - GLM_FUNC_QUALIFIER static T call(mat<3, 3, T, P> const& m) + GLM_FUNC_QUALIFIER static T call(mat<3, 3, T, Q> const& m) { return + m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2]) @@ -222,10 +222,10 @@ namespace detail } }; - template - struct compute_determinant + template + struct compute_determinant<4, 4, T, Q, Aligned> { - GLM_FUNC_QUALIFIER static T call(mat<4, 4, T, P> const& m) + GLM_FUNC_QUALIFIER static T call(mat<4, 4, T, Q> const& m) { T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; @@ -234,7 +234,7 @@ namespace detail T SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; T SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - vec<4, T, P> DetCof( + vec<4, T, Q> DetCof( + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02), - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04), + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05), @@ -246,19 +246,19 @@ namespace detail } }; - template class matType, length_t C, length_t R, typename T, qualifier P, bool Aligned> + template struct compute_inverse{}; - template - struct compute_inverse + template + struct compute_inverse<2, 2, T, Q, Aligned> { - GLM_FUNC_QUALIFIER static mat<2, 2, T, P> call(mat<2, 2, T, P> const& m) + GLM_FUNC_QUALIFIER static mat<2, 2, T, Q> call(mat<2, 2, T, Q> const& m) { T OneOverDeterminant = static_cast(1) / ( + m[0][0] * m[1][1] - m[1][0] * m[0][1]); - mat<2, 2, T, P> Inverse( + mat<2, 2, T, Q> Inverse( + m[1][1] * OneOverDeterminant, - m[0][1] * OneOverDeterminant, - m[1][0] * OneOverDeterminant, @@ -268,17 +268,17 @@ namespace detail } }; - template - struct compute_inverse + template + struct compute_inverse<3, 3, T, Q, Aligned> { - GLM_FUNC_QUALIFIER static mat<3, 3, T, P> call(mat<3, 3, T, P> const& m) + GLM_FUNC_QUALIFIER static mat<3, 3, T, Q> call(mat<3, 3, T, Q> const& m) { T OneOverDeterminant = static_cast(1) / ( + m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2]) - m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2]) + m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2])); - mat<3, 3, T, P> Inverse; + mat<3, 3, T, Q> Inverse; Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]) * OneOverDeterminant; Inverse[1][0] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]) * OneOverDeterminant; Inverse[2][0] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]) * OneOverDeterminant; @@ -293,10 +293,10 @@ namespace detail } }; - template - struct compute_inverse + template + struct compute_inverse<4, 4, T, Q, Aligned> { - GLM_FUNC_QUALIFIER static mat<4, 4, T, P> call(mat<4, 4, T, P> const& m) + GLM_FUNC_QUALIFIER static mat<4, 4, T, Q> call(mat<4, 4, T, Q> const& m) { T Coef00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; T Coef02 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; @@ -322,30 +322,30 @@ namespace detail T Coef22 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; T Coef23 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; - vec<4, T, P> Fac0(Coef00, Coef00, Coef02, Coef03); - vec<4, T, P> Fac1(Coef04, Coef04, Coef06, Coef07); - vec<4, T, P> Fac2(Coef08, Coef08, Coef10, Coef11); - vec<4, T, P> Fac3(Coef12, Coef12, Coef14, Coef15); - vec<4, T, P> Fac4(Coef16, Coef16, Coef18, Coef19); - vec<4, T, P> Fac5(Coef20, Coef20, Coef22, Coef23); + vec<4, T, Q> Fac0(Coef00, Coef00, Coef02, Coef03); + vec<4, T, Q> Fac1(Coef04, Coef04, Coef06, Coef07); + vec<4, T, Q> Fac2(Coef08, Coef08, Coef10, Coef11); + vec<4, T, Q> Fac3(Coef12, Coef12, Coef14, Coef15); + vec<4, T, Q> Fac4(Coef16, Coef16, Coef18, Coef19); + vec<4, T, Q> Fac5(Coef20, Coef20, Coef22, Coef23); - vec<4, T, P> Vec0(m[1][0], m[0][0], m[0][0], m[0][0]); - vec<4, T, P> Vec1(m[1][1], m[0][1], m[0][1], m[0][1]); - vec<4, T, P> Vec2(m[1][2], m[0][2], m[0][2], m[0][2]); - vec<4, T, P> Vec3(m[1][3], m[0][3], m[0][3], m[0][3]); + vec<4, T, Q> Vec0(m[1][0], m[0][0], m[0][0], m[0][0]); + vec<4, T, Q> Vec1(m[1][1], m[0][1], m[0][1], m[0][1]); + vec<4, T, Q> Vec2(m[1][2], m[0][2], m[0][2], m[0][2]); + vec<4, T, Q> Vec3(m[1][3], m[0][3], m[0][3], m[0][3]); - vec<4, T, P> Inv0(Vec1 * Fac0 - Vec2 * Fac1 + Vec3 * Fac2); - vec<4, T, P> Inv1(Vec0 * Fac0 - Vec2 * Fac3 + Vec3 * Fac4); - vec<4, T, P> Inv2(Vec0 * Fac1 - Vec1 * Fac3 + Vec3 * Fac5); - vec<4, T, P> Inv3(Vec0 * Fac2 - Vec1 * Fac4 + Vec2 * Fac5); + vec<4, T, Q> Inv0(Vec1 * Fac0 - Vec2 * Fac1 + Vec3 * Fac2); + vec<4, T, Q> Inv1(Vec0 * Fac0 - Vec2 * Fac3 + Vec3 * Fac4); + vec<4, T, Q> Inv2(Vec0 * Fac1 - Vec1 * Fac3 + Vec3 * Fac5); + vec<4, T, Q> Inv3(Vec0 * Fac2 - Vec1 * Fac4 + Vec2 * Fac5); - vec<4, T, P> SignA(+1, -1, +1, -1); - vec<4, T, P> SignB(-1, +1, -1, +1); - mat<4, 4, T, P> Inverse(Inv0 * SignA, Inv1 * SignB, Inv2 * SignA, Inv3 * SignB); + vec<4, T, Q> SignA(+1, -1, +1, -1); + vec<4, T, Q> SignB(-1, +1, -1, +1); + mat<4, 4, T, Q> Inverse(Inv0 * SignA, Inv1 * SignB, Inv2 * SignA, Inv3 * SignB); - vec<4, T, P> Row0(Inverse[0][0], Inverse[1][0], Inverse[2][0], Inverse[3][0]); + vec<4, T, Q> Row0(Inverse[0][0], Inverse[1][0], Inverse[2][0], Inverse[3][0]); - vec<4, T, P> Dot0(m[0] * Row0); + vec<4, T, Q> Dot0(m[0] * Row0); T Dot1 = (Dot0.x + Dot0.y) + (Dot0.z + Dot0.w); T OneOverDeterminant = static_cast(1) / Dot1; @@ -355,43 +355,43 @@ namespace detail }; }//namespace detail - template class matType> - GLM_FUNC_QUALIFIER matType matrixCompMult(matType const& x, matType const& y) + template + GLM_FUNC_QUALIFIER mat matrixCompMult(mat const& x, mat const& y) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'matrixCompMult' only accept floating-point inputs"); - return detail::compute_matrixCompMult::value>::call(x, y); + return detail::compute_matrixCompMult::value>::call(x, y); } - template - GLM_FUNC_QUALIFIER typename detail::outerProduct_trait::type outerProduct(vec const& c, vec const& r) + template + GLM_FUNC_QUALIFIER typename detail::outerProduct_trait::type outerProduct(vec const& c, vec const& r) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'outerProduct' only accept floating-point inputs"); - typename detail::outerProduct_trait::type m; + typename detail::outerProduct_trait::type m; for(length_t i = 0; i < m.length(); ++i) m[i] = c * r[i]; return m; } - template class matType> - GLM_FUNC_QUALIFIER typename matType::transpose_type transpose(matType const& m) + template + GLM_FUNC_QUALIFIER typename mat::transpose_type transpose(mat const& m) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'transpose' only accept floating-point inputs"); - return detail::compute_transpose::value>::call(m); + return detail::compute_transpose::value>::call(m); } - template class matType> - GLM_FUNC_QUALIFIER T determinant(matType const& m) + template + GLM_FUNC_QUALIFIER T determinant(mat const& m) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'determinant' only accept floating-point inputs"); - return detail::compute_determinant::value>::call(m); + return detail::compute_determinant::value>::call(m); } - template class matType> - GLM_FUNC_QUALIFIER matType inverse(matType const& m) + template + GLM_FUNC_QUALIFIER mat inverse(mat const& m) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'inverse' only accept floating-point inputs"); - return detail::compute_inverse::value>::call(m); + return detail::compute_inverse::value>::call(m); } }//namespace glm diff --git a/glm/detail/func_matrix_simd.inl b/glm/detail/func_matrix_simd.inl index 42026033..a4a3d6d3 100644 --- a/glm/detail/func_matrix_simd.inl +++ b/glm/detail/func_matrix_simd.inl @@ -11,12 +11,12 @@ namespace glm{ namespace detail { - template + template struct compute_matrixCompMult { GLM_STATIC_ASSERT(detail::is_aligned

::value, "Specialization requires aligned"); - GLM_FUNC_QUALIFIER static mat<4, 4, float, P> call(mat<4, 4, float, P> const& x, mat<4, 4, float, P> const& y) + GLM_FUNC_QUALIFIER static mat<4, 4, float, P> call(mat<4, 4, float, Q> const& x, mat<4, 4, float, Q> const& y) { mat<4, 4, float, P> Result; glm_mat4_matrixCompMult( @@ -27,10 +27,10 @@ namespace detail } }; - template + template struct compute_transpose { - GLM_FUNC_QUALIFIER static mat<4, 4, float, P> call(mat<4, 4, float, P> const& m) + GLM_FUNC_QUALIFIER static mat<4, 4, float, P> call(mat<4, 4, float, Q> const& m) { mat<4, 4, float, P> Result; glm_mat4_transpose( @@ -40,19 +40,19 @@ namespace detail } }; - template + template struct compute_determinant { - GLM_FUNC_QUALIFIER static float call(mat<4, 4, float, P> const& m) + GLM_FUNC_QUALIFIER static float call(mat<4, 4, float, Q> const& m) { return _mm_cvtss_f32(glm_mat4_determinant(*reinterpret_cast<__m128 const(*)[4]>(&m[0].data))); } }; - template + template struct compute_inverse { - GLM_FUNC_QUALIFIER static mat<4, 4, float, P> call(mat<4, 4, float, P> const& m) + GLM_FUNC_QUALIFIER static mat<4, 4, float, P> call(mat<4, 4, float, Q> const& m) { mat<4, 4, float, P> Result; glm_mat4_inverse(*reinterpret_cast<__m128 const(*)[4]>(&m[0].data), *reinterpret_cast<__m128(*)[4]>(&Result[0].data)); diff --git a/glm/detail/func_trigonometric.hpp b/glm/detail/func_trigonometric.hpp index 8a6d0747..3e00e372 100644 --- a/glm/detail/func_trigonometric.hpp +++ b/glm/detail/func_trigonometric.hpp @@ -30,8 +30,8 @@ namespace glm /// /// @see GLSL radians man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL GLM_CONSTEXPR vec radians(vec const& degrees); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec radians(vec const& degrees); /// Converts radians to degrees and returns the result. /// @@ -41,8 +41,8 @@ namespace glm /// /// @see GLSL degrees man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL GLM_CONSTEXPR vec degrees(vec const& radians); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec degrees(vec const& radians); /// The standard trigonometric sine function. /// The values returned by this function will range from [-1, 1]. @@ -53,8 +53,8 @@ namespace glm /// /// @see GLSL sin man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL vec sin(vec const& angle); + template + GLM_FUNC_DECL vec sin(vec const& angle); /// The standard trigonometric cosine function. /// The values returned by this function will range from [-1, 1]. @@ -65,8 +65,8 @@ namespace glm /// /// @see GLSL cos man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL vec cos(vec const& angle); + template + GLM_FUNC_DECL vec cos(vec const& angle); /// The standard trigonometric tangent function. /// @@ -76,8 +76,8 @@ namespace glm /// /// @see GLSL tan man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL vec tan(vec const& angle); + template + GLM_FUNC_DECL vec tan(vec const& angle); /// Arc sine. Returns an angle whose sine is x. /// The range of values returned by this function is [-PI/2, PI/2]. @@ -89,8 +89,8 @@ namespace glm /// /// @see GLSL asin man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL vec asin(vec const& x); + template + GLM_FUNC_DECL vec asin(vec const& x); /// Arc cosine. Returns an angle whose sine is x. /// The range of values returned by this function is [0, PI]. @@ -102,8 +102,8 @@ namespace glm /// /// @see GLSL acos man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL vec acos(vec const& x); + template + GLM_FUNC_DECL vec acos(vec const& x); /// Arc tangent. Returns an angle whose tangent is y/x. /// The signs of x and y are used to determine what @@ -117,8 +117,8 @@ namespace glm /// /// @see GLSL atan man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL vec atan(vec const& y, vec const& x); + template + GLM_FUNC_DECL vec atan(vec const& y, vec const& x); /// Arc tangent. Returns an angle whose tangent is y_over_x. /// The range of values returned by this function is [-PI/2, PI/2]. @@ -129,8 +129,8 @@ namespace glm /// /// @see GLSL atan man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL vec atan(vec const& y_over_x); + template + GLM_FUNC_DECL vec atan(vec const& y_over_x); /// Returns the hyperbolic sine function, (exp(x) - exp(-x)) / 2 /// @@ -140,8 +140,8 @@ namespace glm /// /// @see GLSL sinh man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL vec sinh(vec const& angle); + template + GLM_FUNC_DECL vec sinh(vec const& angle); /// Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2 /// @@ -151,8 +151,8 @@ namespace glm /// /// @see GLSL cosh man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL vec cosh(vec const& angle); + template + GLM_FUNC_DECL vec cosh(vec const& angle); /// Returns the hyperbolic tangent function, sinh(angle) / cosh(angle) /// @@ -162,8 +162,8 @@ namespace glm /// /// @see GLSL tanh man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL vec tanh(vec const& angle); + template + GLM_FUNC_DECL vec tanh(vec const& angle); /// Arc hyperbolic sine; returns the inverse of sinh. /// @@ -173,8 +173,8 @@ namespace glm /// /// @see GLSL asinh man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL vec asinh(vec const& x); + template + GLM_FUNC_DECL vec asinh(vec const& x); /// Arc hyperbolic cosine; returns the non-negative inverse /// of cosh. Results are undefined if x < 1. @@ -185,8 +185,8 @@ namespace glm /// /// @see GLSL acosh man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL vec acosh(vec const& x); + template + GLM_FUNC_DECL vec acosh(vec const& x); /// Arc hyperbolic tangent; returns the inverse of tanh. /// Results are undefined if abs(x) >= 1. @@ -197,8 +197,8 @@ namespace glm /// /// @see GLSL atanh man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL vec atanh(vec const& x); + template + GLM_FUNC_DECL vec atanh(vec const& x); /// @} }//namespace glm diff --git a/glm/detail/func_trigonometric.inl b/glm/detail/func_trigonometric.inl index a1ac2f11..00599740 100644 --- a/glm/detail/func_trigonometric.inl +++ b/glm/detail/func_trigonometric.inl @@ -16,10 +16,10 @@ namespace glm return degrees * static_cast(0.01745329251994329576923690768489); } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec radians(vec const& v) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec radians(vec const& v) { - return detail::functor1::call(radians, v); + return detail::functor1::call(radians, v); } // degrees @@ -31,55 +31,55 @@ namespace glm return radians * static_cast(57.295779513082320876798154814105); } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec degrees(vec const& v) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec degrees(vec const& v) { - return detail::functor1::call(degrees, v); + return detail::functor1::call(degrees, v); } // sin using ::std::sin; - template - GLM_FUNC_QUALIFIER vec sin(vec const& v) + template + GLM_FUNC_QUALIFIER vec sin(vec const& v) { - return detail::functor1::call(sin, v); + return detail::functor1::call(sin, v); } // cos using std::cos; - template - GLM_FUNC_QUALIFIER vec cos(vec const& v) + template + GLM_FUNC_QUALIFIER vec cos(vec const& v) { - return detail::functor1::call(cos, v); + return detail::functor1::call(cos, v); } // tan using std::tan; - template - GLM_FUNC_QUALIFIER vec tan(vec const& v) + template + GLM_FUNC_QUALIFIER vec tan(vec const& v) { - return detail::functor1::call(tan, v); + return detail::functor1::call(tan, v); } // asin using std::asin; - template - GLM_FUNC_QUALIFIER vec asin(vec const& v) + template + GLM_FUNC_QUALIFIER vec asin(vec const& v) { - return detail::functor1::call(asin, v); + return detail::functor1::call(asin, v); } // acos using std::acos; - template - GLM_FUNC_QUALIFIER vec acos(vec const& v) + template + GLM_FUNC_QUALIFIER vec acos(vec const& v) { - return detail::functor1::call(acos, v); + return detail::functor1::call(acos, v); } // atan @@ -91,45 +91,45 @@ namespace glm return ::std::atan2(y, x); } - template - GLM_FUNC_QUALIFIER vec atan(vec const& a, vec const& b) + template + GLM_FUNC_QUALIFIER vec atan(vec const& a, vec const& b) { - return detail::functor2::call(::std::atan2, a, b); + return detail::functor2::call(::std::atan2, a, b); } using std::atan; - template - GLM_FUNC_QUALIFIER vec atan(vec const& v) + template + GLM_FUNC_QUALIFIER vec atan(vec const& v) { - return detail::functor1::call(atan, v); + return detail::functor1::call(atan, v); } // sinh using std::sinh; - template - GLM_FUNC_QUALIFIER vec sinh(vec const& v) + template + GLM_FUNC_QUALIFIER vec sinh(vec const& v) { - return detail::functor1::call(sinh, v); + return detail::functor1::call(sinh, v); } // cosh using std::cosh; - template - GLM_FUNC_QUALIFIER vec cosh(vec const& v) + template + GLM_FUNC_QUALIFIER vec cosh(vec const& v) { - return detail::functor1::call(cosh, v); + return detail::functor1::call(cosh, v); } // tanh using std::tanh; - template - GLM_FUNC_QUALIFIER vec tanh(vec const& v) + template + GLM_FUNC_QUALIFIER vec tanh(vec const& v) { - return detail::functor1::call(tanh, v); + return detail::functor1::call(tanh, v); } // asinh @@ -145,10 +145,10 @@ namespace glm } # endif - template - GLM_FUNC_QUALIFIER vec asinh(vec const& v) + template + GLM_FUNC_QUALIFIER vec asinh(vec const& v) { - return detail::functor1::call(asinh, v); + return detail::functor1::call(asinh, v); } // acosh @@ -166,10 +166,10 @@ namespace glm } # endif - template - GLM_FUNC_QUALIFIER vec acosh(vec const& v) + template + GLM_FUNC_QUALIFIER vec acosh(vec const& v) { - return detail::functor1::call(acosh, v); + return detail::functor1::call(acosh, v); } // atanh @@ -187,10 +187,10 @@ namespace glm } # endif - template - GLM_FUNC_QUALIFIER vec atanh(vec const& v) + template + GLM_FUNC_QUALIFIER vec atanh(vec const& v) { - return detail::functor1::call(atanh, v); + return detail::functor1::call(atanh, v); } }//namespace glm diff --git a/glm/detail/func_vector_relational.hpp b/glm/detail/func_vector_relational.hpp index 0e463113..ce2c980c 100644 --- a/glm/detail/func_vector_relational.hpp +++ b/glm/detail/func_vector_relational.hpp @@ -30,8 +30,8 @@ namespace glm /// /// @see GLSL lessThan man page /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions - template - GLM_FUNC_DECL vec lessThan(vec const& x, vec const& y); + template + GLM_FUNC_DECL vec lessThan(vec const& x, vec const& y); /// Returns the component-wise comparison of result x <= y. /// @@ -40,8 +40,8 @@ namespace glm /// /// @see GLSL lessThanEqual man page /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions - template - GLM_FUNC_DECL vec lessThanEqual(vec const& x, vec const& y); + template + GLM_FUNC_DECL vec lessThanEqual(vec const& x, vec const& y); /// Returns the component-wise comparison of result x > y. /// @@ -50,8 +50,8 @@ namespace glm /// /// @see GLSL greaterThan man page /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions - template - GLM_FUNC_DECL vec greaterThan(vec const& x, vec const& y); + template + GLM_FUNC_DECL vec greaterThan(vec const& x, vec const& y); /// Returns the component-wise comparison of result x >= y. /// @@ -60,8 +60,8 @@ namespace glm /// /// @see GLSL greaterThanEqual man page /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions - template - GLM_FUNC_DECL vec greaterThanEqual(vec const& x, vec const& y); + template + GLM_FUNC_DECL vec greaterThanEqual(vec const& x, vec const& y); /// Returns the component-wise comparison of result x == y. /// @@ -70,8 +70,8 @@ namespace glm /// /// @see GLSL equal man page /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions - template - GLM_FUNC_DECL vec equal(vec const& x, vec const& y); + template + GLM_FUNC_DECL vec equal(vec const& x, vec const& y); /// Returns the component-wise comparison of result x != y. /// @@ -80,8 +80,8 @@ namespace glm /// /// @see GLSL notEqual man page /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions - template - GLM_FUNC_DECL vec notEqual(vec const& x, vec const& y); + template + GLM_FUNC_DECL vec notEqual(vec const& x, vec const& y); /// Returns true if any component of x is true. /// @@ -89,8 +89,8 @@ namespace glm /// /// @see GLSL any man page /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions - template - GLM_FUNC_DECL bool any(vec const& v); + template + GLM_FUNC_DECL bool any(vec const& v); /// Returns true if all components of x are true. /// @@ -98,8 +98,8 @@ namespace glm /// /// @see GLSL all man page /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions - template - GLM_FUNC_DECL bool all(vec const& v); + template + GLM_FUNC_DECL bool all(vec const& v); /// Returns the component-wise logical complement of x. /// /!\ Because of language incompatibilities between C++ and GLSL, GLM defines the function not but not_ instead. @@ -108,8 +108,8 @@ namespace glm /// /// @see GLSL not man page /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions - template - GLM_FUNC_DECL vec not_(vec const& v); + template + GLM_FUNC_DECL vec not_(vec const& v); /// @} }//namespace glm diff --git a/glm/detail/func_vector_relational.inl b/glm/detail/func_vector_relational.inl index f7131a16..b081a90d 100644 --- a/glm/detail/func_vector_relational.inl +++ b/glm/detail/func_vector_relational.inl @@ -5,75 +5,75 @@ namespace glm { - template - GLM_FUNC_QUALIFIER vec lessThan(vec const& x, vec const& y) + template + GLM_FUNC_QUALIFIER vec lessThan(vec const& x, vec const& y) { assert(x.length() == y.length()); - vec Result; + vec Result; for(length_t i = 0; i < x.length(); ++i) Result[i] = x[i] < y[i]; return Result; } - template - GLM_FUNC_QUALIFIER vec lessThanEqual(vec const& x, vec const& y) + template + GLM_FUNC_QUALIFIER vec lessThanEqual(vec const& x, vec const& y) { assert(x.length() == y.length()); - vec Result; + vec Result; for(length_t i = 0; i < x.length(); ++i) Result[i] = x[i] <= y[i]; return Result; } - template - GLM_FUNC_QUALIFIER vec greaterThan(vec const& x, vec const& y) + template + GLM_FUNC_QUALIFIER vec greaterThan(vec const& x, vec const& y) { assert(x.length() == y.length()); - vec Result; + vec Result; for(length_t i = 0; i < x.length(); ++i) Result[i] = x[i] > y[i]; return Result; } - template - GLM_FUNC_QUALIFIER vec greaterThanEqual(vec const& x, vec const& y) + template + GLM_FUNC_QUALIFIER vec greaterThanEqual(vec const& x, vec const& y) { assert(x.length() == y.length()); - vec Result; + vec Result; for(length_t i = 0; i < x.length(); ++i) Result[i] = x[i] >= y[i]; return Result; } - template - GLM_FUNC_QUALIFIER vec equal(vec const& x, vec const& y) + template + GLM_FUNC_QUALIFIER vec equal(vec const& x, vec const& y) { assert(x.length() == y.length()); - vec Result; + vec Result; for(length_t i = 0; i < x.length(); ++i) Result[i] = detail::compute_equal::call(x[i], y[i]); return Result; } - template - GLM_FUNC_QUALIFIER vec notEqual(vec const& x, vec const& y) + template + GLM_FUNC_QUALIFIER vec notEqual(vec const& x, vec const& y) { assert(x.length() == y.length()); - vec Result; + vec Result; for(length_t i = 0; i < x.length(); ++i) Result[i] = !detail::compute_equal::call(x[i], y[i]); return Result; } - template - GLM_FUNC_QUALIFIER bool any(vec const& v) + template + GLM_FUNC_QUALIFIER bool any(vec const& v) { bool Result = false; for(length_t i = 0; i < v.length(); ++i) @@ -81,8 +81,8 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER bool all(vec const& v) + template + GLM_FUNC_QUALIFIER bool all(vec const& v) { bool Result = true; for(length_t i = 0; i < v.length(); ++i) @@ -90,10 +90,10 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER vec not_(vec const& v) + template + GLM_FUNC_QUALIFIER vec not_(vec const& v) { - vec Result; + vec Result; for(length_t i = 0; i < v.length(); ++i) Result[i] = !v[i]; return Result; diff --git a/glm/detail/qualifier.hpp b/glm/detail/qualifier.hpp index 74c35942..09d8716b 100644 --- a/glm/detail/qualifier.hpp +++ b/glm/detail/qualifier.hpp @@ -33,8 +33,8 @@ namespace glm # endif }; - template struct vec; - template struct mat; + template struct vec; + template struct mat; namespace detail { diff --git a/glm/detail/type_mat.hpp b/glm/detail/type_mat.hpp index 26a2feb7..53479eeb 100644 --- a/glm/detail/type_mat.hpp +++ b/glm/detail/type_mat.hpp @@ -8,24 +8,24 @@ namespace glm{ namespace detail { - template + template struct outerProduct_trait{}; }//namespace detail #if GLM_HAS_TEMPLATE_ALIASES - template using tmat2x2 = mat<2, 2, T, P>; - template using tmat2x3 = mat<2, 3, T, P>; - template using tmat2x4 = mat<2, 4, T, P>; - template using tmat3x2 = mat<3, 2, T, P>; - template using tmat3x3 = mat<3, 3, T, P>; - template using tmat3x4 = mat<3, 4, T, P>; - template using tmat4x2 = mat<4, 2, T, P>; - template using tmat4x3 = mat<4, 3, T, P>; - template using tmat4x4 = mat<4, 4, T, P>; + 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>; #endif//GLM_HAS_TEMPLATE_ALIASES - template class matType> - GLM_FUNC_DECL matType inverse(matType const& m); + template + GLM_FUNC_DECL mat inverse(mat const& m); /// @addtogroup core_precision /// @{ diff --git a/glm/detail/type_mat2x2.hpp b/glm/detail/type_mat2x2.hpp index 60732dda..0571d31a 100644 --- a/glm/detail/type_mat2x2.hpp +++ b/glm/detail/type_mat2x2.hpp @@ -11,13 +11,13 @@ namespace glm { - template - struct mat<2, 2, T, P> + template + struct mat<2, 2, T, Q> { - typedef vec<2, T, P> col_type; - typedef vec<2, T, P> row_type; - typedef mat<2, 2, T, P> type; - typedef mat<2, 2, T, P> transpose_type; + typedef vec<2, T, Q> col_type; + typedef vec<2, T, Q> row_type; + typedef mat<2, 2, T, Q> type; + typedef mat<2, 2, T, Q> transpose_type; typedef T value_type; private: @@ -35,7 +35,7 @@ namespace glm // -- Constructors -- GLM_FUNC_DECL mat() GLM_DEFAULT; - GLM_FUNC_DECL mat(mat<2, 2, T, P> const& m) GLM_DEFAULT; + GLM_FUNC_DECL mat(mat<2, 2, T, Q> const& m) GLM_DEFAULT; template GLM_FUNC_DECL mat(mat<2, 2, T, Q> const& m); @@ -56,125 +56,125 @@ namespace glm template GLM_FUNC_DECL mat( - vec<2, U, P> const& v1, - vec<2, V, P> const& v2); + vec<2, U, Q> const& v1, + vec<2, V, Q> const& v2); // -- Matrix conversions -- template GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, U, Q> const& m); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<2, 2, T, P> & operator=(mat<2, 2, T, P> const& v) GLM_DEFAULT; + GLM_FUNC_DECL mat<2, 2, T, Q> & operator=(mat<2, 2, T, Q> const& v) GLM_DEFAULT; template - GLM_FUNC_DECL mat<2, 2, T, P> & operator=(mat<2, 2, U, P> const& m); + GLM_FUNC_DECL mat<2, 2, T, Q> & operator=(mat<2, 2, U, Q> const& m); template - GLM_FUNC_DECL mat<2, 2, T, P> & operator+=(U s); + GLM_FUNC_DECL mat<2, 2, T, Q> & operator+=(U s); template - GLM_FUNC_DECL mat<2, 2, T, P> & operator+=(mat<2, 2, U, P> const& m); + GLM_FUNC_DECL mat<2, 2, T, Q> & operator+=(mat<2, 2, U, Q> const& m); template - GLM_FUNC_DECL mat<2, 2, T, P> & operator-=(U s); + GLM_FUNC_DECL mat<2, 2, T, Q> & operator-=(U s); template - GLM_FUNC_DECL mat<2, 2, T, P> & operator-=(mat<2, 2, U, P> const& m); + GLM_FUNC_DECL mat<2, 2, T, Q> & operator-=(mat<2, 2, U, Q> const& m); template - GLM_FUNC_DECL mat<2, 2, T, P> & operator*=(U s); + GLM_FUNC_DECL mat<2, 2, T, Q> & operator*=(U s); template - GLM_FUNC_DECL mat<2, 2, T, P> & operator*=(mat<2, 2, U, P> const& m); + GLM_FUNC_DECL mat<2, 2, T, Q> & operator*=(mat<2, 2, U, Q> const& m); template - GLM_FUNC_DECL mat<2, 2, T, P> & operator/=(U s); + GLM_FUNC_DECL mat<2, 2, T, Q> & operator/=(U s); template - GLM_FUNC_DECL mat<2, 2, T, P> & operator/=(mat<2, 2, U, P> const& m); + GLM_FUNC_DECL mat<2, 2, T, Q> & operator/=(mat<2, 2, U, Q> const& m); // -- Increment and decrement operators -- - GLM_FUNC_DECL mat<2, 2, T, P> & operator++ (); - GLM_FUNC_DECL mat<2, 2, T, P> & operator-- (); - GLM_FUNC_DECL mat<2, 2, T, P> operator++(int); - GLM_FUNC_DECL mat<2, 2, T, P> operator--(int); + GLM_FUNC_DECL mat<2, 2, T, Q> & operator++ (); + GLM_FUNC_DECL mat<2, 2, T, Q> & operator-- (); + GLM_FUNC_DECL mat<2, 2, T, Q> operator++(int); + GLM_FUNC_DECL mat<2, 2, T, Q> operator--(int); }; // -- Unary operators -- - template - GLM_FUNC_DECL mat<2, 2, T, P> operator+(mat<2, 2, T, P> const& m); + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m); - template - GLM_FUNC_DECL mat<2, 2, T, P> operator-(mat<2, 2, T, P> const& m); + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m); // -- Binary operators -- - template - GLM_FUNC_DECL mat<2, 2, T, P> operator+(mat<2, 2, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<2, 2, T, P> operator+(T scalar, mat<2, 2, T, P> const& m); + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator+(T scalar, mat<2, 2, T, Q> const& m); - template - GLM_FUNC_DECL mat<2, 2, T, P> operator+(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2); + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); - template - GLM_FUNC_DECL mat<2, 2, T, P> operator-(mat<2, 2, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<2, 2, T, P> operator-(T scalar, mat<2, 2, T, P> const& m); + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator-(T scalar, mat<2, 2, T, Q> const& m); - template - GLM_FUNC_DECL mat<2, 2, T, P> operator-(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2); + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); - template - GLM_FUNC_DECL mat<2, 2, T, P> operator*(mat<2, 2, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<2, 2, T, P> operator*(T scalar, mat<2, 2, T, P> const& m); + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator*(T scalar, mat<2, 2, T, Q> const& m); - template - GLM_FUNC_DECL typename mat<2, 2, T, P>::col_type operator*(mat<2, 2, T, P> const& m, typename mat<2, 2, T, P>::row_type const& v); + template + GLM_FUNC_DECL 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 typename mat<2, 2, T, P>::row_type operator*(typename mat<2, 2, T, P>::col_type const& v, mat<2, 2, T, P> const& m); + template + GLM_FUNC_DECL 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 mat<2, 2, T, P> operator*(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2); + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); - template - GLM_FUNC_DECL mat<3, 2, T, P> operator*(mat<2, 2, T, P> const& m1, mat<3, 2, T, P> const& m2); + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); - template - GLM_FUNC_DECL mat<4, 2, T, P> operator*(mat<2, 2, T, P> const& m1, mat<4, 2, T, P> const& m2); + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); - template - GLM_FUNC_DECL mat<2, 2, T, P> operator/(mat<2, 2, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<2, 2, T, P> operator/(T scalar, mat<2, 2, T, P> const& m); + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator/(T scalar, mat<2, 2, T, Q> const& m); - template - GLM_FUNC_DECL typename mat<2, 2, T, P>::col_type operator/(mat<2, 2, T, P> const& m, typename mat<2, 2, T, P>::row_type const& v); + template + GLM_FUNC_DECL 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 typename mat<2, 2, T, P>::row_type operator/(typename mat<2, 2, T, P>::col_type const& v, mat<2, 2, T, P> const& m); + template + GLM_FUNC_DECL 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 mat<2, 2, T, P> operator/(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2); + template + GLM_FUNC_DECL 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 bool operator==(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2); + template + GLM_FUNC_DECL bool operator==(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); - template - GLM_FUNC_DECL bool operator!=(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2); + template + GLM_FUNC_DECL 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 88a0c039..6c42a2ed 100644 --- a/glm/detail/type_mat2x2.inl +++ b/glm/detail/type_mat2x2.inl @@ -8,37 +8,37 @@ namespace glm // -- Constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat() + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat() {} # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<2, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<2, 2, T, Q> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<2, 2, T, Q> const& m) + template + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<2, 2, T, P> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(T scalar) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(T scalar) { this->value[0] = col_type(scalar, 0); this->value[1] = col_type(0, scalar); } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat ( T const& x0, T const& y0, T const& x1, T const& y1 @@ -48,8 +48,8 @@ namespace glm this->value[1] = col_type(x1, y1); } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(col_type const& v0, col_type const& v1) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(col_type const& v0, col_type const& v1) { this->value[0] = v0; this->value[1] = v1; @@ -57,9 +57,9 @@ namespace glm // -- Conversion constructors -- - template + template template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat ( X1 const& x1, Y1 const& y1, X2 const& x2, Y2 const& y2 @@ -69,9 +69,9 @@ namespace glm this->value[1] = col_type(static_cast(x2), value_type(y2)); } - template + template template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(vec<2, V1, P> const& v1, vec<2, V2, P> const& v2) + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2) { this->value[0] = col_type(v1); this->value[1] = col_type(v2); @@ -79,65 +79,65 @@ namespace glm // -- mat2x2 matrix conversions -- - template - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<2, 2, U, Q> const& m) + template + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<2, 2, U, P> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<3, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<4, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<2, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<3, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<3, 2, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<2, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<4, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<4, 2, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<3, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<4, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -145,15 +145,15 @@ namespace glm // -- Accesses -- - template - GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::col_type& mat<2, 2, T, P>::operator[](typename mat<2, 2, T, P>::length_type i) + template + GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::col_type& mat<2, 2, T, Q>::operator[](typename mat<2, 2, T, Q>::length_type i) { assert(i < this->length()); return this->value[i]; } - template - GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::col_type const& mat<2, 2, T, P>::operator[](typename mat<2, 2, T, P>::length_type i) const + template + GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::col_type const& mat<2, 2, T, Q>::operator[](typename mat<2, 2, T, Q>::length_type i) const { assert(i < this->length()); return this->value[i]; @@ -162,8 +162,8 @@ namespace glm // -- Unary updatable operators -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator=(mat<2, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator=(mat<2, 2, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -171,237 +171,237 @@ namespace glm } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template + template template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator=(mat<2, 2, U, P> const& m) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator+=(U scalar) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator+=(mat<2, 2, U, P> const& m) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator-=(U scalar) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator-=(mat<2, 2, U, P> const& m) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator*=(U scalar) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator*=(mat<2, 2, U, P> const& m) + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator*=(mat<2, 2, U, Q> const& m) { return (*this = *this * m); } - template + template template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator/=(U scalar) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator/=(mat<2, 2, U, P> const& m) + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator/=(mat<2, 2, U, Q> const& m) { return *this *= inverse(m); } // -- Increment and decrement operators -- - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator++() + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator++() { ++this->value[0]; ++this->value[1]; return *this; } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator--() + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator--() { --this->value[0]; --this->value[1]; return *this; } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P> mat<2, 2, T, P>::operator++(int) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> mat<2, 2, T, Q>::operator++(int) { - mat<2, 2, T, P> Result(*this); + mat<2, 2, T, Q> Result(*this); ++*this; return Result; } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P> mat<2, 2, T, P>::operator--(int) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> mat<2, 2, T, Q>::operator--(int) { - mat<2, 2, T, P> Result(*this); + mat<2, 2, T, Q> Result(*this); --*this; return Result; } // -- Unary arithmetic operators -- - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(mat<2, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m) { return m; } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(mat<2, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m) { - return mat<2, 2, T, P>( + return mat<2, 2, T, Q>( -m[0], -m[1]); } // -- Binary arithmetic operators -- - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(mat<2, 2, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m, T scalar) { - return mat<2, 2, T, P>( + return mat<2, 2, T, Q>( m[0] + scalar, m[1] + scalar); } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(T scalar, mat<2, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator+(T scalar, mat<2, 2, T, Q> const& m) { - return mat<2, 2, T, P>( + return mat<2, 2, T, Q>( m[0] + scalar, m[1] + scalar); } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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, P>( + return mat<2, 2, T, Q>( m1[0] + m2[0], m1[1] + m2[1]); } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(mat<2, 2, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m, T scalar) { - return mat<2, 2, T, P>( + return mat<2, 2, T, Q>( m[0] - scalar, m[1] - scalar); } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(T scalar, mat<2, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator-(T scalar, mat<2, 2, T, Q> const& m) { - return mat<2, 2, T, P>( + return mat<2, 2, T, Q>( scalar - m[0], scalar - m[1]); } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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, P>( + return mat<2, 2, T, Q>( m1[0] - m2[0], m1[1] - m2[1]); } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<2, 2, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m, T scalar) { - return mat<2, 2, T, P>( + return mat<2, 2, T, Q>( m[0] * scalar, m[1] * scalar); } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(T scalar, mat<2, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(T scalar, mat<2, 2, T, Q> const& m) { - return mat<2, 2, T, P>( + return mat<2, 2, T, Q>( m[0] * scalar, m[1] * scalar); } - template - GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::col_type operator* + template + GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::col_type operator* ( - mat<2, 2, T, P> const& m, - typename mat<2, 2, T, P>::row_type const& v + mat<2, 2, T, Q> const& m, + typename mat<2, 2, T, Q>::row_type const& v ) { - return vec<2, T, P>( + return vec<2, T, Q>( m[0][0] * v.x + m[1][0] * v.y, m[0][1] * v.x + m[1][1] * v.y); } - template - GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::row_type operator* + template + GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::row_type operator* ( - typename mat<2, 2, T, P>::col_type const& v, - mat<2, 2, T, P> const& m + typename mat<2, 2, T, Q>::col_type const& v, + mat<2, 2, T, Q> const& m ) { - return vec<2, T, P>( + return vec<2, T, Q>( v.x * m[0][0] + v.y * m[0][1], v.x * m[1][0] + v.y * m[1][1]); } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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, P>( + return mat<2, 2, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1]); } - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<2, 2, T, P> const& m1, mat<3, 2, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) { - return mat<3, 2, T, P>( + return mat<3, 2, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], @@ -410,10 +410,10 @@ namespace glm m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1]); } - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<2, 2, T, P> const& m1, mat<4, 2, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) { - return mat<4, 2, T, P>( + return mat<4, 2, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], @@ -424,51 +424,51 @@ namespace glm m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1]); } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator/(mat<2, 2, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m, T scalar) { - return mat<2, 2, T, P>( + return mat<2, 2, T, Q>( m[0] / scalar, m[1] / scalar); } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator/(T scalar, mat<2, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator/(T scalar, mat<2, 2, T, Q> const& m) { - return mat<2, 2, T, P>( + return mat<2, 2, T, Q>( scalar / m[0], scalar / m[1]); } - template - GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::col_type operator/(mat<2, 2, T, P> const& m, typename mat<2, 2, T, P>::row_type const& v) + template + GLM_FUNC_QUALIFIER 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 typename mat<2, 2, T, P>::row_type operator/(typename mat<2, 2, T, P>::col_type const& v, mat<2, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER 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 mat<2, 2, T, P> operator/(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) { - mat<2, 2, T, P> m1_copy(m1); + mat<2, 2, T, Q> m1_copy(m1); return m1_copy /= m2; } // -- Boolean operators -- - template - GLM_FUNC_QUALIFIER bool operator==(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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 bool operator!=(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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]); } diff --git a/glm/detail/type_mat2x3.hpp b/glm/detail/type_mat2x3.hpp index 90217e0e..791ce7c1 100644 --- a/glm/detail/type_mat2x3.hpp +++ b/glm/detail/type_mat2x3.hpp @@ -12,13 +12,13 @@ namespace glm { - template - struct mat<2, 3, T, P> + template + struct mat<2, 3, T, Q> { - typedef vec<3, T, P> col_type; - typedef vec<2, T, P> row_type; - typedef mat<2, 3, T, P> type; - typedef mat<3, 2, T, P> transpose_type; + typedef vec<3, T, Q> col_type; + typedef vec<2, T, Q> row_type; + typedef mat<2, 3, T, Q> type; + typedef mat<3, 2, T, Q> transpose_type; typedef T value_type; private: @@ -36,7 +36,7 @@ namespace glm // -- Constructors -- GLM_FUNC_DECL mat() GLM_DEFAULT; - GLM_FUNC_DECL mat(mat<2, 3, T, P> const& m) GLM_DEFAULT; + GLM_FUNC_DECL mat(mat<2, 3, T, Q> const& m) GLM_DEFAULT; template GLM_FUNC_DECL mat(mat<2, 3, T, Q> const& m); @@ -57,106 +57,106 @@ namespace glm template GLM_FUNC_DECL mat( - vec<3, U, P> const& v1, - vec<3, V, P> const& v2); + vec<3, U, Q> const& v1, + vec<3, V, Q> const& v2); // -- Matrix conversions -- template GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, U, Q> const& m); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<2, 3, T, P> & operator=(mat<2, 3, T, P> const& m) GLM_DEFAULT; + GLM_FUNC_DECL mat<2, 3, T, Q> & operator=(mat<2, 3, T, Q> const& m) GLM_DEFAULT; template - GLM_FUNC_DECL mat<2, 3, T, P> & operator=(mat<2, 3, U, P> const& m); + GLM_FUNC_DECL mat<2, 3, T, Q> & operator=(mat<2, 3, U, Q> const& m); template - GLM_FUNC_DECL mat<2, 3, T, P> & operator+=(U s); + GLM_FUNC_DECL mat<2, 3, T, Q> & operator+=(U s); template - GLM_FUNC_DECL mat<2, 3, T, P> & operator+=(mat<2, 3, U, P> const& m); + GLM_FUNC_DECL mat<2, 3, T, Q> & operator+=(mat<2, 3, U, Q> const& m); template - GLM_FUNC_DECL mat<2, 3, T, P> & operator-=(U s); + GLM_FUNC_DECL mat<2, 3, T, Q> & operator-=(U s); template - GLM_FUNC_DECL mat<2, 3, T, P> & operator-=(mat<2, 3, U, P> const& m); + GLM_FUNC_DECL mat<2, 3, T, Q> & operator-=(mat<2, 3, U, Q> const& m); template - GLM_FUNC_DECL mat<2, 3, T, P> & operator*=(U s); + GLM_FUNC_DECL mat<2, 3, T, Q> & operator*=(U s); template - GLM_FUNC_DECL mat<2, 3, T, P> & operator/=(U s); + GLM_FUNC_DECL mat<2, 3, T, Q> & operator/=(U s); // -- Increment and decrement operators -- - GLM_FUNC_DECL mat<2, 3, T, P> & operator++ (); - GLM_FUNC_DECL mat<2, 3, T, P> & operator-- (); - GLM_FUNC_DECL mat<2, 3, T, P> operator++(int); - GLM_FUNC_DECL mat<2, 3, T, P> operator--(int); + GLM_FUNC_DECL mat<2, 3, T, Q> & operator++ (); + GLM_FUNC_DECL mat<2, 3, T, Q> & operator-- (); + GLM_FUNC_DECL mat<2, 3, T, Q> operator++(int); + GLM_FUNC_DECL mat<2, 3, T, Q> operator--(int); }; // -- Unary operators -- - template - GLM_FUNC_DECL mat<2, 3, T, P> operator+(mat<2, 3, T, P> const& m); + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m); - template - GLM_FUNC_DECL mat<2, 3, T, P> operator-(mat<2, 3, T, P> const& m); + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m); // -- Binary operators -- - template - GLM_FUNC_DECL mat<2, 3, T, P> operator+(mat<2, 3, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<2, 3, T, P> operator+(mat<2, 3, T, P> const& m1, mat<2, 3, T, P> const& m2); + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); - template - GLM_FUNC_DECL mat<2, 3, T, P> operator-(mat<2, 3, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<2, 3, T, P> operator-(mat<2, 3, T, P> const& m1, mat<2, 3, T, P> const& m2); + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); - template - GLM_FUNC_DECL mat<2, 3, T, P> operator*(mat<2, 3, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<2, 3, T, P> operator*(T scalar, mat<2, 3, T, P> const& m); + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator*(T scalar, mat<2, 3, T, Q> const& m); - template - GLM_FUNC_DECL typename mat<2, 3, T, P>::col_type operator*(mat<2, 3, T, P> const& m, typename mat<2, 3, T, P>::row_type const& v); + template + GLM_FUNC_DECL 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); - template - GLM_FUNC_DECL typename mat<2, 3, T, P>::row_type operator*(typename mat<2, 3, T, P>::col_type const& v, mat<2, 3, T, P> const& m); + template + GLM_FUNC_DECL typename mat<2, 3, T, Q>::row_type operator*(typename mat<2, 3, T, Q>::col_type const& v, mat<2, 3, T, Q> const& m); - template - GLM_FUNC_DECL mat<2, 3, T, P> operator*(mat<2, 3, T, P> const& m1, mat<2, 2, T, P> const& m2); + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<2, 2, T, Q> const& m2); - template - GLM_FUNC_DECL mat<3, 3, T, P> operator*(mat<2, 3, T, P> const& m1, mat<3, 2, T, P> const& m2); + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<3, 2, T, Q> const& m2); - template - GLM_FUNC_DECL mat<4, 3, T, P> operator*(mat<2, 3, T, P> const& m1, mat<4, 2, T, P> const& m2); + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<4, 2, T, Q> const& m2); - template - GLM_FUNC_DECL mat<2, 3, T, P> operator/(mat<2, 3, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator/(mat<2, 3, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<2, 3, T, P> operator/(T scalar, mat<2, 3, T, P> const& m); + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator/(T scalar, mat<2, 3, T, Q> const& m); // -- Boolean operators -- - template - GLM_FUNC_DECL bool operator==(mat<2, 3, T, P> const& m1, mat<2, 3, T, P> const& m2); + template + GLM_FUNC_DECL bool operator==(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); - template - GLM_FUNC_DECL bool operator!=(mat<2, 3, T, P> const& m1, mat<2, 3, T, P> const& m2); + template + GLM_FUNC_DECL 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 049f6866..9944654c 100644 --- a/glm/detail/type_mat2x3.inl +++ b/glm/detail/type_mat2x3.inl @@ -6,37 +6,37 @@ namespace glm // -- Constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat() + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat() {} # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<2, 3, T, Q> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 3, T, Q> const& m) + template + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<2, 3, T, P> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; } - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(T scalar) + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(T scalar) { this->value[0] = col_type(scalar, 0, 0); this->value[1] = col_type(0, scalar, 0); } - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat ( T x0, T y0, T z0, T x1, T y1, T z1 @@ -46,8 +46,8 @@ namespace glm this->value[1] = col_type(x1, y1, z1); } - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(col_type const& v0, col_type const& v1) + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(col_type const& v0, col_type const& v1) { this->value[0] = v0; this->value[1] = v1; @@ -55,11 +55,11 @@ namespace glm // -- Conversion constructors -- - template + template template< typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2> - GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat ( X1 x1, Y1 y1, Z1 z1, X2 x2, Y2 y2, Z2 z2 @@ -69,9 +69,9 @@ namespace glm this->value[1] = col_type(static_cast(x2), value_type(y2), value_type(z2)); } - template + template template - GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(vec<3, V1, P> const& v1, vec<3, V2, P> const& v2) + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2) { this->value[0] = col_type(v1); this->value[1] = col_type(v2); @@ -79,65 +79,65 @@ namespace glm // -- Matrix conversions -- - template - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 3, U, Q> const& m) + template + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<2, 3, U, P> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); } - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<3, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<3, 3, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<4, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<3, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); } - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<3, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<4, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); } - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<4, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<4, 3, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -145,15 +145,15 @@ namespace glm // -- Accesses -- - template - GLM_FUNC_QUALIFIER typename mat<2, 3, T, P>::col_type & mat<2, 3, T, P>::operator[](typename mat<2, 3, T, P>::length_type i) + template + GLM_FUNC_QUALIFIER typename mat<2, 3, T, Q>::col_type & mat<2, 3, T, Q>::operator[](typename mat<2, 3, T, Q>::length_type i) { assert(i < this->length()); return this->value[i]; } - template - GLM_FUNC_QUALIFIER typename mat<2, 3, T, P>::col_type const& mat<2, 3, T, P>::operator[](typename mat<2, 3, T, P>::length_type i) const + template + GLM_FUNC_QUALIFIER typename mat<2, 3, T, Q>::col_type const& mat<2, 3, T, Q>::operator[](typename mat<2, 3, T, Q>::length_type i) const { assert(i < this->length()); return this->value[i]; @@ -162,8 +162,8 @@ namespace glm // -- Unary updatable operators -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator=(mat<2, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator=(mat<2, 3, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -171,63 +171,63 @@ namespace glm } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template + template template - GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator=(mat<2, 3, U, P> const& m) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER mat<2, 3, T, P> & mat<2, 3, T, P>::operator+=(U s) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator+=(mat<2, 3, U, P> const& m) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator-=(U s) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator-=(mat<2, 3, U, P> const& m) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator*=(U s) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER mat<2, 3, T, P> & mat<2, 3, T, P>::operator/=(U s) + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator/=(U s) { this->value[0] /= s; this->value[1] /= s; @@ -236,131 +236,131 @@ namespace glm // -- Increment and decrement operators -- - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P> & mat<2, 3, T, P>::operator++() + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator++() { ++this->value[0]; ++this->value[1]; return *this; } - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P> & mat<2, 3, T, P>::operator--() + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator--() { --this->value[0]; --this->value[1]; return *this; } - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P> mat<2, 3, T, P>::operator++(int) + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> mat<2, 3, T, Q>::operator++(int) { - mat<2, 3, T, P> Result(*this); + mat<2, 3, T, Q> Result(*this); ++*this; return Result; } - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P> mat<2, 3, T, P>::operator--(int) + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> mat<2, 3, T, Q>::operator--(int) { - mat<2, 3, T, P> Result(*this); + mat<2, 3, T, Q> Result(*this); --*this; return Result; } // -- Unary arithmetic operators -- - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator+(mat<2, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m) { return m; } - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator-(mat<2, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m) { - return mat<2, 3, T, P>( + return mat<2, 3, T, Q>( -m[0], -m[1]); } // -- Binary arithmetic operators -- - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator+(mat<2, 3, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m, T scalar) { - return mat<2, 3, T, P>( + return mat<2, 3, T, Q>( m[0] + scalar, m[1] + scalar); } - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator+(mat<2, 3, T, P> const& m1, mat<2, 3, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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, P>( + return mat<2, 3, T, Q>( m1[0] + m2[0], m1[1] + m2[1]); } - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator-(mat<2, 3, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m, T scalar) { - return mat<2, 3, T, P>( + return mat<2, 3, T, Q>( m[0] - scalar, m[1] - scalar); } - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator-(mat<2, 3, T, P> const& m1, mat<2, 3, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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, P>( + return mat<2, 3, T, Q>( m1[0] - m2[0], m1[1] - m2[1]); } - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<2, 3, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m, T scalar) { - return mat<2, 3, T, P>( + return mat<2, 3, T, Q>( m[0] * scalar, m[1] * scalar); } - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(T scalar, mat<2, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(T scalar, mat<2, 3, T, Q> const& m) { - return mat<2, 3, T, P>( + return mat<2, 3, T, Q>( m[0] * scalar, m[1] * scalar); } - template - GLM_FUNC_QUALIFIER typename mat<2, 3, T, P>::col_type operator* + template + GLM_FUNC_QUALIFIER typename mat<2, 3, T, Q>::col_type operator* ( - mat<2, 3, T, P> const& m, - typename mat<2, 3, T, P>::row_type const& v) + mat<2, 3, T, Q> const& m, + typename mat<2, 3, T, Q>::row_type const& v) { - return typename mat<2, 3, T, P>::col_type( + return typename mat<2, 3, T, Q>::col_type( m[0][0] * v.x + m[1][0] * v.y, m[0][1] * v.x + m[1][1] * v.y, m[0][2] * v.x + m[1][2] * v.y); } - template - GLM_FUNC_QUALIFIER typename mat<2, 3, T, P>::row_type operator* + template + GLM_FUNC_QUALIFIER typename mat<2, 3, T, Q>::row_type operator* ( - typename mat<2, 3, T, P>::col_type const& v, - mat<2, 3, T, P> const& m) + typename mat<2, 3, T, Q>::col_type const& v, + mat<2, 3, T, Q> const& m) { - return typename mat<2, 3, T, P>::row_type( + return typename mat<2, 3, T, Q>::row_type( v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2], v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2]); } - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<2, 3, T, P> const& m1, mat<2, 2, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<2, 2, T, Q> const& m2) { - return mat<2, 3, T, P>( + return mat<2, 3, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1], @@ -369,8 +369,8 @@ namespace glm m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1]); } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<2, 3, T, P> const& m1, mat<3, 2, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<3, 2, T, Q> const& m2) { T SrcA00 = m1[0][0]; T SrcA01 = m1[0][1]; @@ -386,7 +386,7 @@ namespace glm T SrcB20 = m2[2][0]; T SrcB21 = m2[2][1]; - mat<3, 3, T, P> Result; + mat<3, 3, T, Q> Result; Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01; Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01; Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01; @@ -399,10 +399,10 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<2, 3, T, P> const& m1, mat<4, 2, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<4, 2, T, Q> const& m2) { - return mat<4, 3, T, P>( + return mat<4, 3, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1], @@ -417,32 +417,32 @@ namespace glm m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1]); } - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator/(mat<2, 3, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator/(mat<2, 3, T, Q> const& m, T scalar) { - return mat<2, 3, T, P>( + return mat<2, 3, T, Q>( m[0] / scalar, m[1] / scalar); } - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator/(T scalar, mat<2, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator/(T scalar, mat<2, 3, T, Q> const& m) { - return mat<2, 3, T, P>( + return mat<2, 3, T, Q>( scalar / m[0], scalar / m[1]); } // -- Boolean operators -- - template - GLM_FUNC_QUALIFIER bool operator==(mat<2, 3, T, P> const& m1, mat<2, 3, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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 bool operator!=(mat<2, 3, T, P> const& m1, mat<2, 3, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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]); } diff --git a/glm/detail/type_mat2x4.hpp b/glm/detail/type_mat2x4.hpp index 19460551..a12a3d82 100644 --- a/glm/detail/type_mat2x4.hpp +++ b/glm/detail/type_mat2x4.hpp @@ -12,13 +12,13 @@ namespace glm { - template - struct mat<2, 4, T, P> + template + struct mat<2, 4, T, Q> { - typedef vec<4, T, P> col_type; - typedef vec<2, T, P> row_type; - typedef mat<2, 4, T, P> type; - typedef mat<4, 2, T, P> transpose_type; + typedef vec<4, T, Q> col_type; + typedef vec<2, T, Q> row_type; + typedef mat<2, 4, T, Q> type; + typedef mat<4, 2, T, Q> transpose_type; typedef T value_type; private: @@ -36,7 +36,7 @@ namespace glm // -- Constructors -- GLM_FUNC_DECL mat() GLM_DEFAULT; - GLM_FUNC_DECL mat(mat<2, 4, T, P> const& m) GLM_DEFAULT; + GLM_FUNC_DECL mat(mat<2, 4, T, Q> const& m) GLM_DEFAULT; template GLM_FUNC_DECL mat(mat<2, 4, T, Q> const& m); @@ -59,106 +59,106 @@ namespace glm template GLM_FUNC_DECL mat( - vec<4, U, P> const& v1, - vec<4, V, P> const& v2); + vec<4, U, Q> const& v1, + vec<4, V, Q> const& v2); // -- Matrix conversions -- template GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, U, Q> const& m); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<2, 4, T, P> & operator=(mat<2, 4, T, P> const& m) GLM_DEFAULT; + GLM_FUNC_DECL mat<2, 4, T, Q> & operator=(mat<2, 4, T, Q> const& m) GLM_DEFAULT; template - GLM_FUNC_DECL mat<2, 4, T, P> & operator=(mat<2, 4, U, P> const& m); + GLM_FUNC_DECL mat<2, 4, T, Q> & operator=(mat<2, 4, U, Q> const& m); template - GLM_FUNC_DECL mat<2, 4, T, P> & operator+=(U s); + GLM_FUNC_DECL mat<2, 4, T, Q> & operator+=(U s); template - GLM_FUNC_DECL mat<2, 4, T, P> & operator+=(mat<2, 4, U, P> const& m); + GLM_FUNC_DECL mat<2, 4, T, Q> & operator+=(mat<2, 4, U, Q> const& m); template - GLM_FUNC_DECL mat<2, 4, T, P> & operator-=(U s); + GLM_FUNC_DECL mat<2, 4, T, Q> & operator-=(U s); template - GLM_FUNC_DECL mat<2, 4, T, P> & operator-=(mat<2, 4, U, P> const& m); + GLM_FUNC_DECL mat<2, 4, T, Q> & operator-=(mat<2, 4, U, Q> const& m); template - GLM_FUNC_DECL mat<2, 4, T, P> & operator*=(U s); + GLM_FUNC_DECL mat<2, 4, T, Q> & operator*=(U s); template - GLM_FUNC_DECL mat<2, 4, T, P> & operator/=(U s); + GLM_FUNC_DECL mat<2, 4, T, Q> & operator/=(U s); // -- Increment and decrement operators -- - GLM_FUNC_DECL mat<2, 4, T, P> & operator++ (); - GLM_FUNC_DECL mat<2, 4, T, P> & operator-- (); - GLM_FUNC_DECL mat<2, 4, T, P> operator++(int); - GLM_FUNC_DECL mat<2, 4, T, P> operator--(int); + GLM_FUNC_DECL mat<2, 4, T, Q> & operator++ (); + GLM_FUNC_DECL mat<2, 4, T, Q> & operator-- (); + GLM_FUNC_DECL mat<2, 4, T, Q> operator++(int); + GLM_FUNC_DECL mat<2, 4, T, Q> operator--(int); }; // -- Unary operators -- - template - GLM_FUNC_DECL mat<2, 4, T, P> operator+(mat<2, 4, T, P> const& m); + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m); - template - GLM_FUNC_DECL mat<2, 4, T, P> operator-(mat<2, 4, T, P> const& m); + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m); // -- Binary operators -- - template - GLM_FUNC_DECL mat<2, 4, T, P> operator+(mat<2, 4, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<2, 4, T, P> operator+(mat<2, 4, T, P> const& m1, mat<2, 4, T, P> const& m2); + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); - template - GLM_FUNC_DECL mat<2, 4, T, P> operator-(mat<2, 4, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<2, 4, T, P> operator-(mat<2, 4, T, P> const& m1, mat<2, 4, T, P> const& m2); + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); - template - GLM_FUNC_DECL mat<2, 4, T, P> operator*(mat<2, 4, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<2, 4, T, P> operator*(T scalar, mat<2, 4, T, P> const& m); + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator*(T scalar, mat<2, 4, T, Q> const& m); - template - GLM_FUNC_DECL typename mat<2, 4, T, P>::col_type operator*(mat<2, 4, T, P> const& m, typename mat<2, 4, T, P>::row_type const& v); + template + GLM_FUNC_DECL 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); - template - GLM_FUNC_DECL typename mat<2, 4, T, P>::row_type operator*(typename mat<2, 4, T, P>::col_type const& v, mat<2, 4, T, P> const& m); + template + GLM_FUNC_DECL typename mat<2, 4, T, Q>::row_type operator*(typename mat<2, 4, T, Q>::col_type const& v, mat<2, 4, T, Q> const& m); - template - GLM_FUNC_DECL mat<4, 4, T, P> operator*(mat<2, 4, T, P> const& m1, mat<4, 2, T, P> const& m2); + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<4, 2, T, Q> const& m2); - template - GLM_FUNC_DECL mat<2, 4, T, P> operator*(mat<2, 4, T, P> const& m1, mat<2, 2, T, P> const& m2); + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<2, 2, T, Q> const& m2); - template - GLM_FUNC_DECL mat<3, 4, T, P> operator*(mat<2, 4, T, P> const& m1, mat<3, 2, T, P> const& m2); + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<3, 2, T, Q> const& m2); - template - GLM_FUNC_DECL mat<2, 4, T, P> operator/(mat<2, 4, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator/(mat<2, 4, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<2, 4, T, P> operator/(T scalar, mat<2, 4, T, P> const& m); + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator/(T scalar, mat<2, 4, T, Q> const& m); // -- Boolean operators -- - template - GLM_FUNC_DECL bool operator==(mat<2, 4, T, P> const& m1, mat<2, 4, T, P> const& m2); + template + GLM_FUNC_DECL bool operator==(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); - template - GLM_FUNC_DECL bool operator!=(mat<2, 4, T, P> const& m1, mat<2, 4, T, P> const& m2); + template + GLM_FUNC_DECL 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 2ebbb88b..62fc5b1a 100644 --- a/glm/detail/type_mat2x4.inl +++ b/glm/detail/type_mat2x4.inl @@ -6,38 +6,38 @@ namespace glm // -- Constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat() + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat() {} # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<2, 4, T, Q> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 4, T, Q> const& m) + template + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<2, 4, T, P> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(T scalar) + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(T scalar) { value_type const Zero(0); this->value[0] = col_type(scalar, Zero, Zero, Zero); this->value[1] = col_type(Zero, scalar, Zero, Zero); } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat ( T x0, T y0, T z0, T w0, T x1, T y1, T z1, T w1 @@ -47,8 +47,8 @@ namespace glm this->value[1] = col_type(x1, y1, z1, w1); } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(col_type const& v0, col_type const& v1) + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(col_type const& v0, col_type const& v1) { this->value[0] = v0; this->value[1] = v1; @@ -56,11 +56,11 @@ namespace glm // -- Conversion constructors -- - template + template template< typename X1, typename Y1, typename Z1, typename W1, typename X2, typename Y2, typename Z2, typename W2> - GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat ( X1 x1, Y1 y1, Z1 z1, W1 w1, X2 x2, Y2 y2, Z2 z2, W2 w2 @@ -70,9 +70,9 @@ namespace glm this->value[1] = col_type(static_cast(x2), value_type(y2), value_type(z2), value_type(w2)); } - template + template template - GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(vec<4, V1, P> const& v1, vec<4, V2, P> const& v2) + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(vec<4, V1, Q> const& v1, vec<4, V2, Q> const& v2) { this->value[0] = col_type(v1); this->value[1] = col_type(v2); @@ -80,65 +80,65 @@ namespace glm // -- Matrix conversions -- - template - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 4, U, Q> const& m) + template + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<2, 4, U, P> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0, 0); this->value[1] = col_type(m[1], 0, 0); } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<3, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<4, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<4, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<3, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0, 0); this->value[1] = col_type(m[1], 0, 0); } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<3, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<3, 4, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<4, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0, 0); this->value[1] = col_type(m[1], 0, 0); } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<4, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); @@ -146,15 +146,15 @@ namespace glm // -- Accesses -- - template - GLM_FUNC_QUALIFIER typename mat<2, 4, T, P>::col_type & mat<2, 4, T, P>::operator[](typename mat<2, 4, T, P>::length_type i) + template + GLM_FUNC_QUALIFIER typename mat<2, 4, T, Q>::col_type & mat<2, 4, T, Q>::operator[](typename mat<2, 4, T, Q>::length_type i) { assert(i < this->length()); return this->value[i]; } - template - GLM_FUNC_QUALIFIER typename mat<2, 4, T, P>::col_type const& mat<2, 4, T, P>::operator[](typename mat<2, 4, T, P>::length_type i) const + template + GLM_FUNC_QUALIFIER typename mat<2, 4, T, Q>::col_type const& mat<2, 4, T, Q>::operator[](typename mat<2, 4, T, Q>::length_type i) const { assert(i < this->length()); return this->value[i]; @@ -163,8 +163,8 @@ namespace glm // -- Unary updatable operators -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator=(mat<2, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator=(mat<2, 4, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -172,63 +172,63 @@ namespace glm } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template + template template - GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator=(mat<2, 4, U, P> const& m) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator+=(U s) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator+=(mat<2, 4, U, P> const& m) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator-=(U s) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator-=(mat<2, 4, U, P> const& m) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator*=(U s) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER mat<2, 4, T, P> & mat<2, 4, T, P>::operator/=(U s) + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> & mat<2, 4, T, Q>::operator/=(U s) { this->value[0] /= s; this->value[1] /= s; @@ -237,124 +237,124 @@ namespace glm // -- Increment and decrement operators -- - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator++() + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator++() { ++this->value[0]; ++this->value[1]; return *this; } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator--() + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator--() { --this->value[0]; --this->value[1]; return *this; } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P> mat<2, 4, T, P>::operator++(int) + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> mat<2, 4, T, Q>::operator++(int) { - mat<2, 4, T, P> Result(*this); + mat<2, 4, T, Q> Result(*this); ++*this; return Result; } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P> mat<2, 4, T, P>::operator--(int) + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> mat<2, 4, T, Q>::operator--(int) { - mat<2, 4, T, P> Result(*this); + mat<2, 4, T, Q> Result(*this); --*this; return Result; } // -- Unary arithmetic operators -- - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator+(mat<2, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m) { return m; } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator-(mat<2, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m) { - return mat<2, 4, T, P>( + return mat<2, 4, T, Q>( -m[0], -m[1]); } // -- Binary arithmetic operators -- - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator+(mat<2, 4, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m, T scalar) { - return mat<2, 4, T, P>( + return mat<2, 4, T, Q>( m[0] + scalar, m[1] + scalar); } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator+(mat<2, 4, T, P> const& m1, mat<2, 4, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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, P>( + return mat<2, 4, T, Q>( m1[0] + m2[0], m1[1] + m2[1]); } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator-(mat<2, 4, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m, T scalar) { - return mat<2, 4, T, P>( + return mat<2, 4, T, Q>( m[0] - scalar, m[1] - scalar); } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator-(mat<2, 4, T, P> const& m1, mat<2, 4, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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, P>( + return mat<2, 4, T, Q>( m1[0] - m2[0], m1[1] - m2[1]); } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<2, 4, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m, T scalar) { - return mat<2, 4, T, P>( + return mat<2, 4, T, Q>( m[0] * scalar, m[1] * scalar); } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(T scalar, mat<2, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(T scalar, mat<2, 4, T, Q> const& m) { - return mat<2, 4, T, P>( + return mat<2, 4, T, Q>( m[0] * scalar, m[1] * scalar); } - template - GLM_FUNC_QUALIFIER typename mat<2, 4, T, P>::col_type operator*(mat<2, 4, T, P> const& m, typename mat<2, 4, T, P>::row_type const& v) + template + GLM_FUNC_QUALIFIER 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) { - return typename mat<2, 4, T, P>::col_type( + return typename mat<2, 4, T, Q>::col_type( m[0][0] * v.x + m[1][0] * v.y, m[0][1] * v.x + m[1][1] * v.y, m[0][2] * v.x + m[1][2] * v.y, m[0][3] * v.x + m[1][3] * v.y); } - template - GLM_FUNC_QUALIFIER typename mat<2, 4, T, P>::row_type operator*(typename mat<2, 4, T, P>::col_type const& v, mat<2, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER typename mat<2, 4, T, Q>::row_type operator*(typename mat<2, 4, T, Q>::col_type const& v, mat<2, 4, T, Q> const& m) { - return typename mat<2, 4, T, P>::row_type( + return typename mat<2, 4, T, Q>::row_type( v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3], v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2] + v.w * m[1][3]); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<2, 4, T, P> const& m1, mat<4, 2, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<4, 2, T, Q> const& m2) { T SrcA00 = m1[0][0]; T SrcA01 = m1[0][1]; @@ -374,7 +374,7 @@ namespace glm T SrcB30 = m2[3][0]; T SrcB31 = m2[3][1]; - mat<4, 4, T, P> Result; + mat<4, 4, T, Q> Result; Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01; Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01; Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01; @@ -394,10 +394,10 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<2, 4, T, P> const& m1, mat<2, 2, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<2, 2, T, Q> const& m2) { - return mat<2, 4, T, P>( + return mat<2, 4, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1], @@ -408,10 +408,10 @@ namespace glm m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1]); } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<2, 4, T, P> const& m1, mat<3, 2, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<3, 2, T, Q> const& m2) { - return mat<3, 4, T, P>( + return mat<3, 4, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1], @@ -426,32 +426,32 @@ namespace glm m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1]); } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator/(mat<2, 4, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator/(mat<2, 4, T, Q> const& m, T scalar) { - return mat<2, 4, T, P>( + return mat<2, 4, T, Q>( m[0] / scalar, m[1] / scalar); } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator/(T scalar, mat<2, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator/(T scalar, mat<2, 4, T, Q> const& m) { - return mat<2, 4, T, P>( + return mat<2, 4, T, Q>( scalar / m[0], scalar / m[1]); } // -- Boolean operators -- - template - GLM_FUNC_QUALIFIER bool operator==(mat<2, 4, T, P> const& m1, mat<2, 4, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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 bool operator!=(mat<2, 4, T, P> const& m1, mat<2, 4, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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]); } diff --git a/glm/detail/type_mat3x2.hpp b/glm/detail/type_mat3x2.hpp index 2cdfbb8e..c37384c4 100644 --- a/glm/detail/type_mat3x2.hpp +++ b/glm/detail/type_mat3x2.hpp @@ -12,13 +12,13 @@ namespace glm { - template - struct mat<3, 2, T, P> + template + struct mat<3, 2, T, Q> { - typedef vec<2, T, P> col_type; - typedef vec<3, T, P> row_type; - typedef mat<3, 2, T, P> type; - typedef mat<2, 3, T, P> transpose_type; + typedef vec<2, T, Q> col_type; + typedef vec<3, T, Q> row_type; + typedef mat<3, 2, T, Q> type; + typedef mat<2, 3, T, Q> transpose_type; typedef T value_type; private: @@ -36,7 +36,7 @@ namespace glm // -- Constructors -- GLM_FUNC_DECL mat() GLM_DEFAULT; - GLM_FUNC_DECL mat(mat<3, 2, T, P> const& m) GLM_DEFAULT; + GLM_FUNC_DECL mat(mat<3, 2, T, Q> const& m) GLM_DEFAULT; template GLM_FUNC_DECL mat(mat<3, 2, T, Q> const& m); @@ -63,107 +63,107 @@ namespace glm template GLM_FUNC_DECL mat( - vec<2, V1, P> const& v1, - vec<2, V2, P> const& v2, - vec<2, V3, P> const& v3); + vec<2, V1, Q> const& v1, + vec<2, V2, Q> const& v2, + vec<2, V3, Q> const& v3); // -- Matrix conversions -- template GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, U, Q> const& m); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<3, 2, T, P> & operator=(mat<3, 2, T, P> const& m) GLM_DEFAULT; + GLM_FUNC_DECL mat<3, 2, T, Q> & operator=(mat<3, 2, T, Q> const& m) GLM_DEFAULT; template - GLM_FUNC_DECL mat<3, 2, T, P> & operator=(mat<3, 2, U, P> const& m); + GLM_FUNC_DECL mat<3, 2, T, Q> & operator=(mat<3, 2, U, Q> const& m); template - GLM_FUNC_DECL mat<3, 2, T, P> & operator+=(U s); + GLM_FUNC_DECL mat<3, 2, T, Q> & operator+=(U s); template - GLM_FUNC_DECL mat<3, 2, T, P> & operator+=(mat<3, 2, U, P> const& m); + GLM_FUNC_DECL mat<3, 2, T, Q> & operator+=(mat<3, 2, U, Q> const& m); template - GLM_FUNC_DECL mat<3, 2, T, P> & operator-=(U s); + GLM_FUNC_DECL mat<3, 2, T, Q> & operator-=(U s); template - GLM_FUNC_DECL mat<3, 2, T, P> & operator-=(mat<3, 2, U, P> const& m); + GLM_FUNC_DECL mat<3, 2, T, Q> & operator-=(mat<3, 2, U, Q> const& m); template - GLM_FUNC_DECL mat<3, 2, T, P> & operator*=(U s); + GLM_FUNC_DECL mat<3, 2, T, Q> & operator*=(U s); template - GLM_FUNC_DECL mat<3, 2, T, P> & operator/=(U s); + GLM_FUNC_DECL mat<3, 2, T, Q> & operator/=(U s); // -- Increment and decrement operators -- - GLM_FUNC_DECL mat<3, 2, T, P> & operator++ (); - GLM_FUNC_DECL mat<3, 2, T, P> & operator-- (); - GLM_FUNC_DECL mat<3, 2, T, P> operator++(int); - GLM_FUNC_DECL mat<3, 2, T, P> operator--(int); + GLM_FUNC_DECL mat<3, 2, T, Q> & operator++ (); + GLM_FUNC_DECL mat<3, 2, T, Q> & operator-- (); + GLM_FUNC_DECL mat<3, 2, T, Q> operator++(int); + GLM_FUNC_DECL mat<3, 2, T, Q> operator--(int); }; // -- Unary operators -- - template - GLM_FUNC_DECL mat<3, 2, T, P> operator+(mat<3, 2, T, P> const& m); + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m); - template - GLM_FUNC_DECL mat<3, 2, T, P> operator-(mat<3, 2, T, P> const& m); + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m); // -- Binary operators -- - template - GLM_FUNC_DECL mat<3, 2, T, P> operator+(mat<3, 2, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<3, 2, T, P> operator+(mat<3, 2, T, P> const& m1, mat<3, 2, T, P> const& m2); + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); - template - GLM_FUNC_DECL mat<3, 2, T, P> operator-(mat<3, 2, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<3, 2, T, P> operator-(mat<3, 2, T, P> const& m1, mat<3, 2, T, P> const& m2); + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); - template - GLM_FUNC_DECL mat<3, 2, T, P> operator*(mat<3, 2, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<3, 2, T, P> operator*(T scalar, mat<3, 2, T, P> const& m); + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator*(T scalar, mat<3, 2, T, Q> const& m); - template - GLM_FUNC_DECL typename mat<3, 2, T, P>::col_type operator*(mat<3, 2, T, P> const& m, typename mat<3, 2, T, P>::row_type const& v); + template + GLM_FUNC_DECL 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); - template - GLM_FUNC_DECL typename mat<3, 2, T, P>::row_type operator*(typename mat<3, 2, T, P>::col_type const& v, mat<3, 2, T, P> const& m); + template + GLM_FUNC_DECL typename mat<3, 2, T, Q>::row_type operator*(typename mat<3, 2, T, Q>::col_type const& v, mat<3, 2, T, Q> const& m); - template - GLM_FUNC_DECL mat<2, 2, T, P> operator*(mat<3, 2, T, P> const& m1, mat<2, 3, T, P> const& m2); + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<2, 3, T, Q> const& m2); - template - GLM_FUNC_DECL mat<3, 2, T, P> operator*(mat<3, 2, T, P> const& m1, mat<3, 3, T, P> const& m2); + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<3, 3, T, Q> const& m2); - template - GLM_FUNC_DECL mat<4, 2, T, P> operator*(mat<3, 2, T, P> const& m1, mat<4, 3, T, P> const& m2); + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<4, 3, T, Q> const& m2); - template - GLM_FUNC_DECL mat<3, 2, T, P> operator/(mat<3, 2, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator/(mat<3, 2, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<3, 2, T, P> operator/(T scalar, mat<3, 2, T, P> const& m); + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator/(T scalar, mat<3, 2, T, Q> const& m); // -- Boolean operators -- - template - GLM_FUNC_DECL bool operator==(mat<3, 2, T, P> const& m1, mat<3, 2, T, P> const& m2); + template + GLM_FUNC_DECL bool operator==(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); - template - GLM_FUNC_DECL bool operator!=(mat<3, 2, T, P> const& m1, mat<3, 2, T, P> const& m2); + template + GLM_FUNC_DECL bool operator!=(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); }//namespace glm diff --git a/glm/detail/type_mat3x2.inl b/glm/detail/type_mat3x2.inl index 8a15a533..5a64edbb 100644 --- a/glm/detail/type_mat3x2.inl +++ b/glm/detail/type_mat3x2.inl @@ -6,14 +6,14 @@ namespace glm // -- Constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat() + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat() {} # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<3, 2, T, Q> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; @@ -21,25 +21,25 @@ namespace glm } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 2, T, Q> const& m) + template + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<3, 2, T, P> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; this->value[2] = m.value[2]; } - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(T scalar) + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(T scalar) { this->value[0] = col_type(scalar, 0); this->value[1] = col_type(0, scalar); this->value[2] = col_type(0, 0); } - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat ( T x0, T y0, T x1, T y1, @@ -51,8 +51,8 @@ namespace glm this->value[2] = col_type(x2, y2); } - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat ( col_type const& v0, col_type const& v1, @@ -66,12 +66,12 @@ namespace glm // -- Conversion constructors -- - template + template template< typename X1, typename Y1, typename X2, typename Y2, typename X3, typename Y3> - GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat ( X1 x1, Y1 y1, X2 x2, Y2 y2, @@ -83,13 +83,13 @@ namespace glm this->value[2] = col_type(static_cast(x3), value_type(y3)); } - template + template template - GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat ( - vec<2, V1, P> const& v1, - vec<2, V2, P> const& v2, - vec<2, V3, P> const& v3 + vec<2, V1, Q> const& v1, + vec<2, V2, Q> const& v2, + vec<2, V3, Q> const& v3 ) { this->value[0] = col_type(v1); @@ -99,73 +99,73 @@ namespace glm // -- Matrix conversions -- - template - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 2, U, Q> const& m) + template + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<3, 2, U, P> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); this->value[2] = col_type(m[2]); } - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<2, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<2, 2, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; this->value[2] = col_type(0); } - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); this->value[2] = col_type(m[2]); } - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<4, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); this->value[2] = col_type(m[2]); } - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<2, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); this->value[2] = col_type(T(0)); } - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<2, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); this->value[2] = col_type(T(0)); } - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); this->value[2] = col_type(m[2]); } - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<4, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<4, 2, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; this->value[2] = m[2]; } - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<4, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -174,15 +174,15 @@ namespace glm // -- Accesses -- - template - GLM_FUNC_QUALIFIER typename mat<3, 2, T, P>::col_type & mat<3, 2, T, P>::operator[](typename mat<3, 2, T, P>::length_type i) + template + GLM_FUNC_QUALIFIER typename mat<3, 2, T, Q>::col_type & mat<3, 2, T, Q>::operator[](typename mat<3, 2, T, Q>::length_type i) { assert(i < this->length()); return this->value[i]; } - template - GLM_FUNC_QUALIFIER typename mat<3, 2, T, P>::col_type const& mat<3, 2, T, P>::operator[](typename mat<3, 2, T, P>::length_type i) const + template + GLM_FUNC_QUALIFIER typename mat<3, 2, T, Q>::col_type const& mat<3, 2, T, Q>::operator[](typename mat<3, 2, T, Q>::length_type i) const { assert(i < this->length()); return this->value[i]; @@ -191,8 +191,8 @@ namespace glm // -- Unary updatable operators -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator=(mat<3, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator=(mat<3, 2, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -201,9 +201,9 @@ namespace glm } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template + template template - GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator=(mat<3, 2, U, P> const& m) + GLM_FUNC_QUALIFIER 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]; @@ -211,9 +211,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator+=(U s) + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator+=(U s) { this->value[0] += s; this->value[1] += s; @@ -221,9 +221,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator+=(mat<3, 2, U, P> const& m) + GLM_FUNC_QUALIFIER 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]; @@ -231,9 +231,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator-=(U s) + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator-=(U s) { this->value[0] -= s; this->value[1] -= s; @@ -241,9 +241,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator-=(mat<3, 2, U, P> const& m) + GLM_FUNC_QUALIFIER 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]; @@ -251,9 +251,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator*=(U s) + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator*=(U s) { this->value[0] *= s; this->value[1] *= s; @@ -261,9 +261,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<3, 2, T, P> & mat<3, 2, T, P>::operator/=(U s) + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> & mat<3, 2, T, Q>::operator/=(U s) { this->value[0] /= s; this->value[1] /= s; @@ -273,8 +273,8 @@ namespace glm // -- Increment and decrement operators -- - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator++() + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator++() { ++this->value[0]; ++this->value[1]; @@ -282,8 +282,8 @@ namespace glm return *this; } - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator--() + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator--() { --this->value[0]; --this->value[1]; @@ -291,34 +291,34 @@ namespace glm return *this; } - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P> mat<3, 2, T, P>::operator++(int) + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> mat<3, 2, T, Q>::operator++(int) { - mat<3, 2, T, P> Result(*this); + mat<3, 2, T, Q> Result(*this); ++*this; return Result; } - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P> mat<3, 2, T, P>::operator--(int) + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> mat<3, 2, T, Q>::operator--(int) { - mat<3, 2, T, P> Result(*this); + mat<3, 2, T, Q> Result(*this); --*this; return Result; } // -- Unary arithmetic operators -- - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator+(mat<3, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m) { return m; } - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator-(mat<3, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m) { - return mat<3, 2, T, P>( + return mat<3, 2, T, Q>( -m[0], -m[1], -m[2]); @@ -326,79 +326,79 @@ namespace glm // -- Binary arithmetic operators -- - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator+(mat<3, 2, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m, T scalar) { - return mat<3, 2, T, P>( + return mat<3, 2, T, Q>( m[0] + scalar, m[1] + scalar, m[2] + scalar); } - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator+(mat<3, 2, T, P> const& m1, mat<3, 2, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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, P>( + return mat<3, 2, T, Q>( m1[0] + m2[0], m1[1] + m2[1], m1[2] + m2[2]); } - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator-(mat<3, 2, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m, T scalar) { - return mat<3, 2, T, P>( + return mat<3, 2, T, Q>( m[0] - scalar, m[1] - scalar, m[2] - scalar); } - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator-(mat<3, 2, T, P> const& m1, mat<3, 2, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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, P>( + return mat<3, 2, T, Q>( m1[0] - m2[0], m1[1] - m2[1], m1[2] - m2[2]); } - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<3, 2, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m, T scalar) { - return mat<3, 2, T, P>( + return mat<3, 2, T, Q>( m[0] * scalar, m[1] * scalar, m[2] * scalar); } - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(T scalar, mat<3, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(T scalar, mat<3, 2, T, Q> const& m) { - return mat<3, 2, T, P>( + return mat<3, 2, T, Q>( m[0] * scalar, m[1] * scalar, m[2] * scalar); } - template - GLM_FUNC_QUALIFIER typename mat<3, 2, T, P>::col_type operator*(mat<3, 2, T, P> const& m, typename mat<3, 2, T, P>::row_type const& v) + template + GLM_FUNC_QUALIFIER 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) { - return typename mat<3, 2, T, P>::col_type( + return typename mat<3, 2, T, Q>::col_type( m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z); } - template - GLM_FUNC_QUALIFIER typename mat<3, 2, T, P>::row_type operator*(typename mat<3, 2, T, P>::col_type const& v, mat<3, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER typename mat<3, 2, T, Q>::row_type operator*(typename mat<3, 2, T, Q>::col_type const& v, mat<3, 2, T, Q> const& m) { - return typename mat<3, 2, T, P>::row_type( + return typename mat<3, 2, T, Q>::row_type( v.x * m[0][0] + v.y * m[0][1], v.x * m[1][0] + v.y * m[1][1], v.x * m[2][0] + v.y * m[2][1]); } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<3, 2, T, P> const& m1, mat<2, 3, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<2, 3, T, Q> const& m2) { const T SrcA00 = m1[0][0]; const T SrcA01 = m1[0][1]; @@ -414,7 +414,7 @@ namespace glm const T SrcB11 = m2[1][1]; const T SrcB12 = m2[1][2]; - mat<2, 2, T, P> Result; + mat<2, 2, T, Q> Result; Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; @@ -422,10 +422,10 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<3, 2, T, P> const& m1, mat<3, 3, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<3, 3, T, Q> const& m2) { - return mat<3, 2, T, P>( + return mat<3, 2, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], @@ -434,10 +434,10 @@ namespace glm m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2]); } - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<3, 2, T, P> const& m1, mat<4, 3, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<4, 3, T, Q> const& m2) { - return mat<4, 2, T, P>( + return mat<4, 2, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], @@ -448,19 +448,19 @@ namespace glm m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2]); } - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator/(mat<3, 2, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator/(mat<3, 2, T, Q> const& m, T scalar) { - return mat<3, 2, T, P>( + return mat<3, 2, T, Q>( m[0] / scalar, m[1] / scalar, m[2] / scalar); } - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator/(T scalar, mat<3, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator/(T scalar, mat<3, 2, T, Q> const& m) { - return mat<3, 2, T, P>( + return mat<3, 2, T, Q>( scalar / m[0], scalar / m[1], scalar / m[2]); @@ -468,14 +468,14 @@ namespace glm // -- Boolean operators -- - template - GLM_FUNC_QUALIFIER bool operator==(mat<3, 2, T, P> const& m1, mat<3, 2, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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 bool operator!=(mat<3, 2, T, P> const& m1, mat<3, 2, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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]); } diff --git a/glm/detail/type_mat3x3.hpp b/glm/detail/type_mat3x3.hpp index a464fe8c..1cad819b 100644 --- a/glm/detail/type_mat3x3.hpp +++ b/glm/detail/type_mat3x3.hpp @@ -11,13 +11,13 @@ namespace glm { - template - struct mat<3, 3, T, P> + template + struct mat<3, 3, T, Q> { - typedef vec<3, T, P> col_type; - typedef vec<3, T, P> row_type; - typedef mat<3, 3, T, P> type; - typedef mat<3, 3, T, P> transpose_type; + typedef vec<3, T, Q> col_type; + typedef vec<3, T, Q> row_type; + typedef mat<3, 3, T, Q> type; + typedef mat<3, 3, T, Q> transpose_type; typedef T value_type; private: @@ -35,7 +35,7 @@ namespace glm // -- Constructors -- GLM_FUNC_DECL mat() GLM_DEFAULT; - GLM_FUNC_DECL mat(mat<3, 3, T, P> const& m) GLM_DEFAULT; + GLM_FUNC_DECL mat(mat<3, 3, T, Q> const& m) GLM_DEFAULT; template GLM_FUNC_DECL mat(mat<3, 3, T, Q> const& m); @@ -62,126 +62,126 @@ namespace glm template GLM_FUNC_DECL mat( - vec<3, V1, P> const& v1, - vec<3, V2, P> const& v2, - vec<3, V3, P> const& v3); + vec<3, V1, Q> const& v1, + vec<3, V2, Q> const& v2, + vec<3, V3, Q> const& v3); // -- Matrix conversions -- template GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, U, Q> const& m); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<3, 3, T, P> & operator=(mat<3, 3, T, P> const& m) GLM_DEFAULT; + GLM_FUNC_DECL mat<3, 3, T, Q> & operator=(mat<3, 3, T, Q> const& m) GLM_DEFAULT; template - GLM_FUNC_DECL mat<3, 3, T, P> & operator=(mat<3, 3, U, P> const& m); + GLM_FUNC_DECL mat<3, 3, T, Q> & operator=(mat<3, 3, U, Q> const& m); template - GLM_FUNC_DECL mat<3, 3, T, P> & operator+=(U s); + GLM_FUNC_DECL mat<3, 3, T, Q> & operator+=(U s); template - GLM_FUNC_DECL mat<3, 3, T, P> & operator+=(mat<3, 3, U, P> const& m); + GLM_FUNC_DECL mat<3, 3, T, Q> & operator+=(mat<3, 3, U, Q> const& m); template - GLM_FUNC_DECL mat<3, 3, T, P> & operator-=(U s); + GLM_FUNC_DECL mat<3, 3, T, Q> & operator-=(U s); template - GLM_FUNC_DECL mat<3, 3, T, P> & operator-=(mat<3, 3, U, P> const& m); + GLM_FUNC_DECL mat<3, 3, T, Q> & operator-=(mat<3, 3, U, Q> const& m); template - GLM_FUNC_DECL mat<3, 3, T, P> & operator*=(U s); + GLM_FUNC_DECL mat<3, 3, T, Q> & operator*=(U s); template - GLM_FUNC_DECL mat<3, 3, T, P> & operator*=(mat<3, 3, U, P> const& m); + GLM_FUNC_DECL mat<3, 3, T, Q> & operator*=(mat<3, 3, U, Q> const& m); template - GLM_FUNC_DECL mat<3, 3, T, P> & operator/=(U s); + GLM_FUNC_DECL mat<3, 3, T, Q> & operator/=(U s); template - GLM_FUNC_DECL mat<3, 3, T, P> & operator/=(mat<3, 3, U, P> const& m); + GLM_FUNC_DECL mat<3, 3, T, Q> & operator/=(mat<3, 3, U, Q> const& m); // -- Increment and decrement operators -- - GLM_FUNC_DECL mat<3, 3, T, P> & operator++(); - GLM_FUNC_DECL mat<3, 3, T, P> & operator--(); - GLM_FUNC_DECL mat<3, 3, T, P> operator++(int); - GLM_FUNC_DECL mat<3, 3, T, P> operator--(int); + GLM_FUNC_DECL mat<3, 3, T, Q> & operator++(); + GLM_FUNC_DECL mat<3, 3, T, Q> & operator--(); + GLM_FUNC_DECL mat<3, 3, T, Q> operator++(int); + GLM_FUNC_DECL mat<3, 3, T, Q> operator--(int); }; // -- Unary operators -- - template - GLM_FUNC_DECL mat<3, 3, T, P> operator+(mat<3, 3, T, P> const& m); + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m); - template - GLM_FUNC_DECL mat<3, 3, T, P> operator-(mat<3, 3, T, P> const& m); + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m); // -- Binary operators -- - template - GLM_FUNC_DECL mat<3, 3, T, P> operator+(mat<3, 3, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<3, 3, T, P> operator+(T scalar, mat<3, 3, T, P> const& m); + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator+(T scalar, mat<3, 3, T, Q> const& m); - template - GLM_FUNC_DECL mat<3, 3, T, P> operator+(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2); + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); - template - GLM_FUNC_DECL mat<3, 3, T, P> operator-(mat<3, 3, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<3, 3, T, P> operator-(T scalar, mat<3, 3, T, P> const& m); + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator-(T scalar, mat<3, 3, T, Q> const& m); - template - GLM_FUNC_DECL mat<3, 3, T, P> operator-(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2); + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); - template - GLM_FUNC_DECL mat<3, 3, T, P> operator*(mat<3, 3, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<3, 3, T, P> operator*(T scalar, mat<3, 3, T, P> const& m); + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator*(T scalar, mat<3, 3, T, Q> const& m); - template - GLM_FUNC_DECL typename mat<3, 3, T, P>::col_type operator*(mat<3, 3, T, P> const& m, typename mat<3, 3, T, P>::row_type const& v); + template + GLM_FUNC_DECL 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 typename mat<3, 3, T, P>::row_type operator*(typename mat<3, 3, T, P>::col_type const& v, mat<3, 3, T, P> const& m); + template + GLM_FUNC_DECL 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 mat<3, 3, T, P> operator*(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2); + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); - template - GLM_FUNC_DECL mat<2, 3, T, P> operator*(mat<3, 3, T, P> const& m1, mat<2, 3, T, P> const& m2); + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); - template - GLM_FUNC_DECL mat<4, 3, T, P> operator*(mat<3, 3, T, P> const& m1, mat<4, 3, T, P> const& m2); + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); - template - GLM_FUNC_DECL mat<3, 3, T, P> operator/(mat<3, 3, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<3, 3, T, P> operator/(T scalar, mat<3, 3, T, P> const& m); + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator/(T scalar, mat<3, 3, T, Q> const& m); - template - GLM_FUNC_DECL typename mat<3, 3, T, P>::col_type operator/(mat<3, 3, T, P> const& m, typename mat<3, 3, T, P>::row_type const& v); + template + GLM_FUNC_DECL 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 typename mat<3, 3, T, P>::row_type operator/(typename mat<3, 3, T, P>::col_type const& v, mat<3, 3, T, P> const& m); + template + GLM_FUNC_DECL 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 mat<3, 3, T, P> operator/(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2); + template + GLM_FUNC_DECL 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 bool operator==(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2); + template + GLM_FUNC_DECL bool operator==(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); - template - GLM_FUNC_DECL bool operator!=(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2); + template + GLM_FUNC_DECL 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 e21f6ffc..7b81e7d4 100644 --- a/glm/detail/type_mat3x3.inl +++ b/glm/detail/type_mat3x3.inl @@ -8,14 +8,14 @@ namespace glm // -- Constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat() + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat() {} # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<3, 3, T, Q> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; @@ -23,25 +23,25 @@ namespace glm } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 3, T, Q> const& m) + template + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<3, 3, T, P> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; this->value[2] = m.value[2]; } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(T scalar) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(T scalar) { this->value[0] = col_type(scalar, 0, 0); this->value[1] = col_type(0, scalar, 0); this->value[2] = col_type(0, 0, scalar); } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat ( T x0, T y0, T z0, T x1, T y1, T z1, @@ -53,8 +53,8 @@ namespace glm this->value[2] = col_type(x2, y2, z2); } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat ( col_type const& v0, col_type const& v1, @@ -68,12 +68,12 @@ namespace glm // -- Conversion constructors -- - template + template template< typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2, typename X3, typename Y3, typename Z3> - GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat + GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat ( X1 x1, Y1 y1, Z1 z1, X2 x2, Y2 y2, Z2 z2, @@ -85,13 +85,13 @@ namespace glm this->value[2] = col_type(static_cast(x3), value_type(y3), value_type(z3)); } - template + template template - GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat + GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat ( - vec<3, V1, P> const& v1, - vec<3, V2, P> const& v2, - vec<3, V3, P> const& v3 + vec<3, V1, Q> const& v1, + vec<3, V2, Q> const& v2, + vec<3, V3, Q> const& v3 ) { this->value[0] = col_type(v1); @@ -101,73 +101,73 @@ namespace glm // -- Matrix conversions -- - template - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 3, U, Q> const& m) + template + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<3, 3, U, P> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); this->value[2] = col_type(m[2]); } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<2, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); this->value[2] = col_type(0, 0, 1); } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<4, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); this->value[2] = col_type(m[2]); } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<2, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<2, 3, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; this->value[2] = col_type(0, 0, 1); } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); this->value[2] = col_type(m[2], 1); } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<2, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); this->value[2] = col_type(0, 0, 1); } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<4, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); this->value[2] = col_type(m[2], 1); } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); this->value[2] = col_type(m[2]); } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<4, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<4, 3, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -176,15 +176,15 @@ namespace glm // -- Accesses -- - template - GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::col_type & mat<3, 3, T, P>::operator[](typename mat<3, 3, T, P>::length_type i) + template + GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::col_type & mat<3, 3, T, Q>::operator[](typename mat<3, 3, T, Q>::length_type i) { assert(i < this->length()); return this->value[i]; } - template - GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::col_type const& mat<3, 3, T, P>::operator[](typename mat<3, 3, T, P>::length_type i) const + template + GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::col_type const& mat<3, 3, T, Q>::operator[](typename mat<3, 3, T, Q>::length_type i) const { assert(i < this->length()); return this->value[i]; @@ -193,8 +193,8 @@ namespace glm // -- Unary updatable operators -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator=(mat<3, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator=(mat<3, 3, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -203,9 +203,9 @@ namespace glm } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template + template template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator=(mat<3, 3, U, P> const& m) + GLM_FUNC_QUALIFIER 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]; @@ -213,9 +213,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator+=(U s) + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator+=(U s) { this->value[0] += s; this->value[1] += s; @@ -223,9 +223,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator+=(mat<3, 3, U, P> const& m) + GLM_FUNC_QUALIFIER 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]; @@ -233,9 +233,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator-=(U s) + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator-=(U s) { this->value[0] -= s; this->value[1] -= s; @@ -243,9 +243,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator-=(mat<3, 3, U, P> const& m) + GLM_FUNC_QUALIFIER 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]; @@ -253,9 +253,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator*=(U s) + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator*=(U s) { this->value[0] *= s; this->value[1] *= s; @@ -263,16 +263,16 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator*=(mat<3, 3, U, P> const& m) + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator*=(mat<3, 3, U, Q> const& m) { return (*this = *this * m); } - template + template template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator/=(U s) + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator/=(U s) { this->value[0] /= s; this->value[1] /= s; @@ -280,17 +280,17 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator/=(mat<3, 3, U, P> const& m) + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator/=(mat<3, 3, U, Q> const& m) { return *this *= inverse(m); } // -- Increment and decrement operators -- - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator++() + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator++() { ++this->value[0]; ++this->value[1]; @@ -298,8 +298,8 @@ namespace glm return *this; } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator--() + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator--() { --this->value[0]; --this->value[1]; @@ -307,34 +307,34 @@ namespace glm return *this; } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> mat<3, 3, T, P>::operator++(int) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> mat<3, 3, T, Q>::operator++(int) { - mat<3, 3, T, P> Result(*this); + mat<3, 3, T, Q> Result(*this); ++*this; return Result; } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> mat<3, 3, T, P>::operator--(int) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> mat<3, 3, T, Q>::operator--(int) { - mat<3, 3, T, P> Result(*this); + mat<3, 3, T, Q> Result(*this); --*this; return Result; } // -- Unary arithmetic operators -- - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(mat<3, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m) { return m; } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(mat<3, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m) { - return mat<3, 3, T, P>( + return mat<3, 3, T, Q>( -m[0], -m[1], -m[2]); @@ -342,98 +342,98 @@ namespace glm // -- Binary arithmetic operators -- - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(mat<3, 3, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m, T scalar) { - return mat<3, 3, T, P>( + return mat<3, 3, T, Q>( m[0] + scalar, m[1] + scalar, m[2] + scalar); } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(T scalar, mat<3, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator+(T scalar, mat<3, 3, T, Q> const& m) { - return mat<3, 3, T, P>( + return mat<3, 3, T, Q>( m[0] + scalar, m[1] + scalar, m[2] + scalar); } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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, P>( + return mat<3, 3, T, Q>( m1[0] + m2[0], m1[1] + m2[1], m1[2] + m2[2]); } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(mat<3, 3, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m, T scalar) { - return mat<3, 3, T, P>( + return mat<3, 3, T, Q>( m[0] - scalar, m[1] - scalar, m[2] - scalar); } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(T scalar, mat<3, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(T scalar, mat<3, 3, T, Q> const& m) { - return mat<3, 3, T, P>( + return mat<3, 3, T, Q>( scalar - m[0], scalar - m[1], scalar - m[2]); } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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, P>( + return mat<3, 3, T, Q>( m1[0] - m2[0], m1[1] - m2[1], m1[2] - m2[2]); } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<3, 3, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m, T scalar) { - return mat<3, 3, T, P>( + return mat<3, 3, T, Q>( m[0] * scalar, m[1] * scalar, m[2] * scalar); } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(T scalar, mat<3, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(T scalar, mat<3, 3, T, Q> const& m) { - return mat<3, 3, T, P>( + return mat<3, 3, T, Q>( m[0] * scalar, m[1] * scalar, m[2] * scalar); } - template - GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::col_type operator*(mat<3, 3, T, P> const& m, typename mat<3, 3, T, P>::row_type const& v) + template + GLM_FUNC_QUALIFIER 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 typename mat<3, 3, T, P>::col_type( + return typename mat<3, 3, T, Q>::col_type( m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z, m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z); } - template - GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::row_type operator*(typename mat<3, 3, T, P>::col_type const& v, mat<3, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER 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 typename mat<3, 3, T, P>::row_type( + return typename mat<3, 3, T, Q>::row_type( m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z, m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z, m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z); } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) { T const SrcA00 = m1[0][0]; T const SrcA01 = m1[0][1]; @@ -455,7 +455,7 @@ namespace glm T const SrcB21 = m2[2][1]; T const SrcB22 = m2[2][2]; - mat<3, 3, T, P> Result; + mat<3, 3, T, Q> Result; Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02; @@ -468,10 +468,10 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<3, 3, T, P> const& m1, mat<2, 3, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) { - return mat<2, 3, T, P>( + return mat<2, 3, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2], @@ -480,10 +480,10 @@ namespace glm m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2]); } - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<3, 3, T, P> const& m1, mat<4, 3, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) { - return mat<4, 3, T, P>( + return mat<4, 3, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2], @@ -498,53 +498,53 @@ namespace glm m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1] + m1[2][2] * m2[3][2]); } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator/(mat<3, 3, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m, T scalar) { - return mat<3, 3, T, P>( + return mat<3, 3, T, Q>( m[0] / scalar, m[1] / scalar, m[2] / scalar); } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator/(T scalar, mat<3, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator/(T scalar, mat<3, 3, T, Q> const& m) { - return mat<3, 3, T, P>( + return mat<3, 3, T, Q>( scalar / m[0], scalar / m[1], scalar / m[2]); } - template - GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::col_type operator/(mat<3, 3, T, P> const& m, typename mat<3, 3, T, P>::row_type const& v) + template + GLM_FUNC_QUALIFIER 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 typename mat<3, 3, T, P>::row_type operator/(typename mat<3, 3, T, P>::col_type const& v, mat<3, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER 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 mat<3, 3, T, P> operator/(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) { - mat<3, 3, T, P> m1_copy(m1); + mat<3, 3, T, Q> m1_copy(m1); return m1_copy /= m2; } // -- Boolean operators -- - template - GLM_FUNC_QUALIFIER bool operator==(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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 bool operator!=(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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]); } diff --git a/glm/detail/type_mat3x4.hpp b/glm/detail/type_mat3x4.hpp index 3eec6f56..4dfab12d 100644 --- a/glm/detail/type_mat3x4.hpp +++ b/glm/detail/type_mat3x4.hpp @@ -12,13 +12,13 @@ namespace glm { - template - struct mat<3, 4, T, P> + template + struct mat<3, 4, T, Q> { - typedef vec<4, T, P> col_type; - typedef vec<3, T, P> row_type; - typedef mat<3, 4, T, P> type; - typedef mat<4, 3, T, P> transpose_type; + typedef vec<4, T, Q> col_type; + typedef vec<3, T, Q> row_type; + typedef mat<3, 4, T, Q> type; + typedef mat<4, 3, T, Q> transpose_type; typedef T value_type; private: @@ -36,7 +36,7 @@ namespace glm // -- Constructors -- GLM_FUNC_DECL mat() GLM_DEFAULT; - GLM_FUNC_DECL mat(mat<3, 4, T, P> const& m) GLM_DEFAULT; + GLM_FUNC_DECL mat(mat<3, 4, T, Q> const& m) GLM_DEFAULT; template GLM_FUNC_DECL mat(mat<3, 4, T, Q> const& m); @@ -63,107 +63,107 @@ namespace glm template GLM_FUNC_DECL mat( - vec<4, V1, P> const& v1, - vec<4, V2, P> const& v2, - vec<4, V3, P> const& v3); + vec<4, V1, Q> const& v1, + vec<4, V2, Q> const& v2, + vec<4, V3, Q> const& v3); // -- Matrix conversions -- template GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, U, Q> const& m); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<3, 4, T, P> & operator=(mat<3, 4, T, P> const& m) GLM_DEFAULT; + GLM_FUNC_DECL mat<3, 4, T, Q> & operator=(mat<3, 4, T, Q> const& m) GLM_DEFAULT; template - GLM_FUNC_DECL mat<3, 4, T, P> & operator=(mat<3, 4, U, P> const& m); + GLM_FUNC_DECL mat<3, 4, T, Q> & operator=(mat<3, 4, U, Q> const& m); template - GLM_FUNC_DECL mat<3, 4, T, P> & operator+=(U s); + GLM_FUNC_DECL mat<3, 4, T, Q> & operator+=(U s); template - GLM_FUNC_DECL mat<3, 4, T, P> & operator+=(mat<3, 4, U, P> const& m); + GLM_FUNC_DECL mat<3, 4, T, Q> & operator+=(mat<3, 4, U, Q> const& m); template - GLM_FUNC_DECL mat<3, 4, T, P> & operator-=(U s); + GLM_FUNC_DECL mat<3, 4, T, Q> & operator-=(U s); template - GLM_FUNC_DECL mat<3, 4, T, P> & operator-=(mat<3, 4, U, P> const& m); + GLM_FUNC_DECL mat<3, 4, T, Q> & operator-=(mat<3, 4, U, Q> const& m); template - GLM_FUNC_DECL mat<3, 4, T, P> & operator*=(U s); + GLM_FUNC_DECL mat<3, 4, T, Q> & operator*=(U s); template - GLM_FUNC_DECL mat<3, 4, T, P> & operator/=(U s); + GLM_FUNC_DECL mat<3, 4, T, Q> & operator/=(U s); // -- Increment and decrement operators -- - GLM_FUNC_DECL mat<3, 4, T, P> & operator++(); - GLM_FUNC_DECL mat<3, 4, T, P> & operator--(); - GLM_FUNC_DECL mat<3, 4, T, P> operator++(int); - GLM_FUNC_DECL mat<3, 4, T, P> operator--(int); + GLM_FUNC_DECL mat<3, 4, T, Q> & operator++(); + GLM_FUNC_DECL mat<3, 4, T, Q> & operator--(); + GLM_FUNC_DECL mat<3, 4, T, Q> operator++(int); + GLM_FUNC_DECL mat<3, 4, T, Q> operator--(int); }; // -- Unary operators -- - template - GLM_FUNC_DECL mat<3, 4, T, P> operator+(mat<3, 4, T, P> const& m); + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m); - template - GLM_FUNC_DECL mat<3, 4, T, P> operator-(mat<3, 4, T, P> const& m); + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m); // -- Binary operators -- - template - GLM_FUNC_DECL mat<3, 4, T, P> operator+(mat<3, 4, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<3, 4, T, P> operator+(mat<3, 4, T, P> const& m1, mat<3, 4, T, P> const& m2); + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); - template - GLM_FUNC_DECL mat<3, 4, T, P> operator-(mat<3, 4, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<3, 4, T, P> operator-(mat<3, 4, T, P> const& m1, mat<3, 4, T, P> const& m2); + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); - template - GLM_FUNC_DECL mat<3, 4, T, P> operator*(mat<3, 4, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<3, 4, T, P> operator*(T scalar, mat<3, 4, T, P> const& m); + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator*(T scalar, mat<3, 4, T, Q> const& m); - template - GLM_FUNC_DECL typename mat<3, 4, T, P>::col_type operator*(mat<3, 4, T, P> const& m, typename mat<3, 4, T, P>::row_type const& v); + template + GLM_FUNC_DECL 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); - template - GLM_FUNC_DECL typename mat<3, 4, T, P>::row_type operator*(typename mat<3, 4, T, P>::col_type const& v, mat<3, 4, T, P> const& m); + template + GLM_FUNC_DECL 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 mat<4, 4, T, P> operator*(mat<3, 4, T, P> const& m1, mat<4, 3, T, P> const& m2); + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<4, 3, T, Q> const& m2); - template - GLM_FUNC_DECL mat<2, 4, T, P> operator*(mat<3, 4, T, P> const& m1, mat<2, 3, T, P> const& m2); + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<2, 3, T, Q> const& m2); - template - GLM_FUNC_DECL mat<3, 4, T, P> operator*(mat<3, 4, T, P> const& m1, mat<3, 3, T, P> const& m2); + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<3, 3, T, Q> const& m2); - template - GLM_FUNC_DECL mat<3, 4, T, P> operator/(mat<3, 4, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator/(mat<3, 4, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<3, 4, T, P> operator/(T scalar, mat<3, 4, T, P> const& m); + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator/(T scalar, mat<3, 4, T, Q> const& m); // -- Boolean operators -- - template - GLM_FUNC_DECL bool operator==(mat<3, 4, T, P> const& m1, mat<3, 4, T, P> const& m2); + template + GLM_FUNC_DECL bool operator==(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); - template - GLM_FUNC_DECL bool operator!=(mat<3, 4, T, P> const& m1, mat<3, 4, T, P> const& m2); + template + GLM_FUNC_DECL 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 b4ec4aa6..28d3198f 100644 --- a/glm/detail/type_mat3x4.inl +++ b/glm/detail/type_mat3x4.inl @@ -6,14 +6,14 @@ namespace glm // -- Constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat() + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat() {} # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<3, 4, T, Q> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; @@ -21,25 +21,25 @@ namespace glm } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 4, T, Q> const& m) + template + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<3, 4, T, P> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; this->value[2] = m.value[2]; } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(T scalar) + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(T scalar) { this->value[0] = col_type(scalar, 0, 0, 0); this->value[1] = col_type(0, scalar, 0, 0); this->value[2] = col_type(0, 0, scalar, 0); } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat ( T x0, T y0, T z0, T w0, T x1, T y1, T z1, T w1, @@ -51,8 +51,8 @@ namespace glm this->value[2] = col_type(x2, y2, z2, w2); } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat ( col_type const& v0, col_type const& v1, @@ -66,12 +66,12 @@ namespace glm // -- Conversion constructors -- - template + template template< typename X1, typename Y1, typename Z1, typename W1, typename X2, typename Y2, typename Z2, typename W2, typename X3, typename Y3, typename Z3, typename W3> - GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat ( X1 x1, Y1 y1, Z1 z1, W1 w1, X2 x2, Y2 y2, Z2 z2, W2 w2, @@ -83,13 +83,13 @@ namespace glm this->value[2] = col_type(static_cast(x3), value_type(y3), value_type(z3), value_type(w3)); } - template + template template - GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat ( - vec<4, V1, P> const& v1, - vec<4, V2, P> const& v2, - vec<4, V3, P> const& v3 + vec<4, V1, Q> const& v1, + vec<4, V2, Q> const& v2, + vec<4, V3, Q> const& v3 ) { this->value[0] = col_type(v1); @@ -99,73 +99,73 @@ namespace glm // -- Matrix conversions -- - template - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 4, U, Q> const& m) + template + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<3, 4, U, P> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); this->value[2] = col_type(m[2]); } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<2, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0, 0); this->value[1] = col_type(m[1], 0, 0); this->value[2] = col_type(0, 0, 1, 0); } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); this->value[2] = col_type(m[2], 0); } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<4, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<4, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); this->value[2] = col_type(m[2]); } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<2, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); this->value[2] = col_type(0, 0, 1, 0); } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0, 0); this->value[1] = col_type(m[1], 0, 0); this->value[2] = col_type(m[2], 1, 0); } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<2, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<2, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); this->value[2] = col_type(0, 0, 1, 0); } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<4, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0, 0); this->value[1] = col_type(m[1], 0, 0); this->value[2] = col_type(m[2], 1, 0); } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<4, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); @@ -174,15 +174,15 @@ namespace glm // -- Accesses -- - template - GLM_FUNC_QUALIFIER typename mat<3, 4, T, P>::col_type & mat<3, 4, T, P>::operator[](typename mat<3, 4, T, P>::length_type i) + template + GLM_FUNC_QUALIFIER typename mat<3, 4, T, Q>::col_type & mat<3, 4, T, Q>::operator[](typename mat<3, 4, T, Q>::length_type i) { assert(i < this->length()); return this->value[i]; } - template - GLM_FUNC_QUALIFIER typename mat<3, 4, T, P>::col_type const& mat<3, 4, T, P>::operator[](typename mat<3, 4, T, P>::length_type i) const + template + GLM_FUNC_QUALIFIER typename mat<3, 4, T, Q>::col_type const& mat<3, 4, T, Q>::operator[](typename mat<3, 4, T, Q>::length_type i) const { assert(i < this->length()); return this->value[i]; @@ -191,8 +191,8 @@ namespace glm // -- Unary updatable operators -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator=(mat<3, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator=(mat<3, 4, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -201,9 +201,9 @@ namespace glm } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template + template template - GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator=(mat<3, 4, U, P> const& m) + GLM_FUNC_QUALIFIER 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]; @@ -211,9 +211,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator+=(U s) + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator+=(U s) { this->value[0] += s; this->value[1] += s; @@ -221,9 +221,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator+=(mat<3, 4, U, P> const& m) + GLM_FUNC_QUALIFIER 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]; @@ -231,9 +231,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator-=(U s) + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator-=(U s) { this->value[0] -= s; this->value[1] -= s; @@ -241,9 +241,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator-=(mat<3, 4, U, P> const& m) + GLM_FUNC_QUALIFIER 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]; @@ -251,9 +251,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator*=(U s) + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator*=(U s) { this->value[0] *= s; this->value[1] *= s; @@ -261,9 +261,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<3, 4, T, P> & mat<3, 4, T, P>::operator/=(U s) + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> & mat<3, 4, T, Q>::operator/=(U s) { this->value[0] /= s; this->value[1] /= s; @@ -273,8 +273,8 @@ namespace glm // -- Increment and decrement operators -- - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator++() + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator++() { ++this->value[0]; ++this->value[1]; @@ -282,8 +282,8 @@ namespace glm return *this; } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator--() + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator--() { --this->value[0]; --this->value[1]; @@ -291,34 +291,34 @@ namespace glm return *this; } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P> mat<3, 4, T, P>::operator++(int) + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> mat<3, 4, T, Q>::operator++(int) { - mat<3, 4, T, P> Result(*this); + mat<3, 4, T, Q> Result(*this); ++*this; return Result; } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P> mat<3, 4, T, P>::operator--(int) + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> mat<3, 4, T, Q>::operator--(int) { - mat<3, 4, T, P> Result(*this); + mat<3, 4, T, Q> Result(*this); --*this; return Result; } // -- Unary arithmetic operators -- - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator+(mat<3, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m) { return m; } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator-(mat<3, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m) { - return mat<3, 4, T, P>( + return mat<3, 4, T, Q>( -m[0], -m[1], -m[2]); @@ -326,89 +326,89 @@ namespace glm // -- Binary arithmetic operators -- - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator+(mat<3, 4, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m, T scalar) { - return mat<3, 4, T, P>( + return mat<3, 4, T, Q>( m[0] + scalar, m[1] + scalar, m[2] + scalar); } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator+(mat<3, 4, T, P> const& m1, mat<3, 4, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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, P>( + return mat<3, 4, T, Q>( m1[0] + m2[0], m1[1] + m2[1], m1[2] + m2[2]); } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator-(mat<3, 4, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m, T scalar) { - return mat<3, 4, T, P>( + return mat<3, 4, T, Q>( m[0] - scalar, m[1] - scalar, m[2] - scalar); } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator-(mat<3, 4, T, P> const& m1, mat<3, 4, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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, P>( + return mat<3, 4, T, Q>( m1[0] - m2[0], m1[1] - m2[1], m1[2] - m2[2]); } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<3, 4, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m, T scalar) { - return mat<3, 4, T, P>( + return mat<3, 4, T, Q>( m[0] * scalar, m[1] * scalar, m[2] * scalar); } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(T scalar, mat<3, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(T scalar, mat<3, 4, T, Q> const& m) { - return mat<3, 4, T, P>( + return mat<3, 4, T, Q>( m[0] * scalar, m[1] * scalar, m[2] * scalar); } - template - GLM_FUNC_QUALIFIER typename mat<3, 4, T, P>::col_type operator* + template + GLM_FUNC_QUALIFIER typename mat<3, 4, T, Q>::col_type operator* ( - mat<3, 4, T, P> const& m, - typename mat<3, 4, T, P>::row_type const& v + mat<3, 4, T, Q> const& m, + typename mat<3, 4, T, Q>::row_type const& v ) { - return typename mat<3, 4, T, P>::col_type( + return typename mat<3, 4, T, Q>::col_type( m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z, m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z, m[0][3] * v.x + m[1][3] * v.y + m[2][3] * v.z); } - template - GLM_FUNC_QUALIFIER typename mat<3, 4, T, P>::row_type operator* + template + GLM_FUNC_QUALIFIER typename mat<3, 4, T, Q>::row_type operator* ( - typename mat<3, 4, T, P>::col_type const& v, - mat<3, 4, T, P> const& m + typename mat<3, 4, T, Q>::col_type const& v, + mat<3, 4, T, Q> const& m ) { - return typename mat<3, 4, T, P>::row_type( + return typename mat<3, 4, T, Q>::row_type( v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3], v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2] + v.w * m[1][3], v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2] + v.w * m[2][3]); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<3, 4, T, P> const& m1, mat<4, 3, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<4, 3, T, Q> const& m2) { const T SrcA00 = m1[0][0]; const T SrcA01 = m1[0][1]; @@ -436,7 +436,7 @@ namespace glm const T SrcB31 = m2[3][1]; const T SrcB32 = m2[3][2]; - mat<4, 4, T, P> Result; + mat<4, 4, T, Q> Result; Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02; @@ -456,10 +456,10 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<3, 4, T, P> const& m1, mat<2, 3, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<2, 3, T, Q> const& m2) { - return mat<2, 4, T, P>( + return mat<2, 4, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2], @@ -470,10 +470,10 @@ namespace glm m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2]); } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<3, 4, T, P> const& m1, mat<3, 3, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<3, 3, T, Q> const& m2) { - return mat<3, 4, T, P>( + return mat<3, 4, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2], @@ -488,19 +488,19 @@ namespace glm m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1] + m1[2][3] * m2[2][2]); } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator/(mat<3, 4, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator/(mat<3, 4, T, Q> const& m, T scalar) { - return mat<3, 4, T, P>( + return mat<3, 4, T, Q>( m[0] / scalar, m[1] / scalar, m[2] / scalar); } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator/(T scalar, mat<3, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator/(T scalar, mat<3, 4, T, Q> const& m) { - return mat<3, 4, T, P>( + return mat<3, 4, T, Q>( scalar / m[0], scalar / m[1], scalar / m[2]); @@ -508,14 +508,14 @@ namespace glm // -- Boolean operators -- - template - GLM_FUNC_QUALIFIER bool operator==(mat<3, 4, T, P> const& m1, mat<3, 4, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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 bool operator!=(mat<3, 4, T, P> const& m1, mat<3, 4, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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]); } diff --git a/glm/detail/type_mat4x2.hpp b/glm/detail/type_mat4x2.hpp index d025d1ee..edcd0784 100644 --- a/glm/detail/type_mat4x2.hpp +++ b/glm/detail/type_mat4x2.hpp @@ -12,13 +12,13 @@ namespace glm { - template - struct mat<4, 2, T, P> + template + struct mat<4, 2, T, Q> { - typedef vec<2, T, P> col_type; - typedef vec<4, T, P> row_type; - typedef mat<4, 2, T, P> type; - typedef mat<2, 4, T, P> transpose_type; + typedef vec<2, T, Q> col_type; + typedef vec<4, T, Q> row_type; + typedef mat<4, 2, T, Q> type; + typedef mat<2, 4, T, Q> transpose_type; typedef T value_type; private: @@ -36,7 +36,7 @@ namespace glm // -- Constructors -- GLM_FUNC_DECL mat() GLM_DEFAULT; - GLM_FUNC_DECL mat(mat<4, 2, T, P> const& m) GLM_DEFAULT; + GLM_FUNC_DECL mat(mat<4, 2, T, Q> const& m) GLM_DEFAULT; template GLM_FUNC_DECL mat(mat<4, 2, T, Q> const& m); @@ -67,108 +67,108 @@ namespace glm template GLM_FUNC_DECL mat( - vec<2, V1, P> const& v1, - vec<2, V2, P> const& v2, - vec<2, V3, P> const& v3, - vec<2, V4, P> const& v4); + vec<2, V1, Q> const& v1, + vec<2, V2, Q> const& v2, + vec<2, V3, Q> const& v3, + vec<2, V4, Q> const& v4); // -- Matrix conversions -- template GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, U, Q> const& m); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x); // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<4, 2, T, P> & operator=(mat<4, 2, T, P> const& m) GLM_DEFAULT; + GLM_FUNC_DECL mat<4, 2, T, Q> & operator=(mat<4, 2, T, Q> const& m) GLM_DEFAULT; template - GLM_FUNC_DECL mat<4, 2, T, P> & operator=(mat<4, 2, U, P> const& m); + GLM_FUNC_DECL mat<4, 2, T, Q> & operator=(mat<4, 2, U, Q> const& m); template - GLM_FUNC_DECL mat<4, 2, T, P> & operator+=(U s); + GLM_FUNC_DECL mat<4, 2, T, Q> & operator+=(U s); template - GLM_FUNC_DECL mat<4, 2, T, P> & operator+=(mat<4, 2, U, P> const& m); + GLM_FUNC_DECL mat<4, 2, T, Q> & operator+=(mat<4, 2, U, Q> const& m); template - GLM_FUNC_DECL mat<4, 2, T, P> & operator-=(U s); + GLM_FUNC_DECL mat<4, 2, T, Q> & operator-=(U s); template - GLM_FUNC_DECL mat<4, 2, T, P> & operator-=(mat<4, 2, U, P> const& m); + GLM_FUNC_DECL mat<4, 2, T, Q> & operator-=(mat<4, 2, U, Q> const& m); template - GLM_FUNC_DECL mat<4, 2, T, P> & operator*=(U s); + GLM_FUNC_DECL mat<4, 2, T, Q> & operator*=(U s); template - GLM_FUNC_DECL mat<4, 2, T, P> & operator/=(U s); + GLM_FUNC_DECL mat<4, 2, T, Q> & operator/=(U s); // -- Increment and decrement operators -- - GLM_FUNC_DECL mat<4, 2, T, P> & operator++ (); - GLM_FUNC_DECL mat<4, 2, T, P> & operator-- (); - GLM_FUNC_DECL mat<4, 2, T, P> operator++(int); - GLM_FUNC_DECL mat<4, 2, T, P> operator--(int); + GLM_FUNC_DECL mat<4, 2, T, Q> & operator++ (); + GLM_FUNC_DECL mat<4, 2, T, Q> & operator-- (); + GLM_FUNC_DECL mat<4, 2, T, Q> operator++(int); + GLM_FUNC_DECL mat<4, 2, T, Q> operator--(int); }; // -- Unary operators -- - template - GLM_FUNC_DECL mat<4, 2, T, P> operator+(mat<4, 2, T, P> const& m); + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m); - template - GLM_FUNC_DECL mat<4, 2, T, P> operator-(mat<4, 2, T, P> const& m); + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m); // -- Binary operators -- - template - GLM_FUNC_DECL mat<4, 2, T, P> operator+(mat<4, 2, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<4, 2, T, P> operator+(mat<4, 2, T, P> const& m1, mat<4, 2, T, P> const& m2); + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); - template - GLM_FUNC_DECL mat<4, 2, T, P> operator-(mat<4, 2, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<4, 2, T, P> operator-(mat<4, 2, T, P> const& m1, mat<4, 2, T, P> const& m2); + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); - template - GLM_FUNC_DECL mat<4, 2, T, P> operator*(mat<4, 2, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<4, 2, T, P> operator*(T scalar, mat<4, 2, T, P> const& m); + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator*(T scalar, mat<4, 2, T, Q> const& m); - template - GLM_FUNC_DECL typename mat<4, 2, T, P>::col_type operator*(mat<4, 2, T, P> const& m, typename mat<4, 2, T, P>::row_type const& v); + template + GLM_FUNC_DECL 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); - template - GLM_FUNC_DECL typename mat<4, 2, T, P>::row_type operator*(typename mat<4, 2, T, P>::col_type const& v, mat<4, 2, T, P> const& m); + template + GLM_FUNC_DECL typename mat<4, 2, T, Q>::row_type operator*(typename mat<4, 2, T, Q>::col_type const& v, mat<4, 2, T, Q> const& m); - template - GLM_FUNC_DECL mat<2, 2, T, P> operator*(mat<4, 2, T, P> const& m1, mat<2, 4, T, P> const& m2); + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<2, 4, T, Q> const& m2); - template - GLM_FUNC_DECL mat<3, 2, T, P> operator*(mat<4, 2, T, P> const& m1, mat<3, 4, T, P> const& m2); + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<3, 4, T, Q> const& m2); - template - GLM_FUNC_DECL mat<4, 2, T, P> operator*(mat<4, 2, T, P> const& m1, mat<4, 4, T, P> const& m2); + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<4, 4, T, Q> const& m2); - template - GLM_FUNC_DECL mat<4, 2, T, P> operator/(mat<4, 2, T, P> const& m, T scalar); + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator/(mat<4, 2, T, Q> const& m, T scalar); - template - GLM_FUNC_DECL mat<4, 2, T, P> operator/(T scalar, mat<4, 2, T, P> const& m); + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator/(T scalar, mat<4, 2, T, Q> const& m); // -- Boolean operators -- - template - GLM_FUNC_DECL bool operator==(mat<4, 2, T, P> const& m1, mat<4, 2, T, P> const& m2); + template + GLM_FUNC_DECL bool operator==(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); - template - GLM_FUNC_DECL bool operator!=(mat<4, 2, T, P> const& m1, mat<4, 2, T, P> const& m2); + template + GLM_FUNC_DECL 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 909c6292..cc496232 100644 --- a/glm/detail/type_mat4x2.inl +++ b/glm/detail/type_mat4x2.inl @@ -6,14 +6,14 @@ namespace glm // -- Constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat() + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat() {} # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<4, 2, T, Q> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; @@ -22,9 +22,9 @@ namespace glm } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 2, T, Q> const& m) + template + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<4, 2, T, P> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; @@ -32,8 +32,8 @@ namespace glm this->value[3] = m.value[3]; } - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(T scalar) + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(T scalar) { this->value[0] = col_type(scalar, 0); this->value[1] = col_type(0, scalar); @@ -41,8 +41,8 @@ namespace glm this->value[3] = col_type(0, 0); } - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat ( T x0, T y0, T x1, T y1, @@ -56,8 +56,8 @@ namespace glm this->value[3] = col_type(x3, y3); } - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat ( col_type const& v0, col_type const& v1, @@ -73,13 +73,13 @@ namespace glm // -- Conversion constructors -- - template + template template< typename X1, typename Y1, typename X2, typename Y2, typename X3, typename Y3, typename X4, typename Y4> - GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat + GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat ( X1 x1, Y1 y1, X2 x2, Y2 y2, @@ -93,14 +93,14 @@ namespace glm this->value[3] = col_type(static_cast(x4), value_type(y4)); } - template + template template - GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat + GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat ( - vec<2, V1, P> const& v1, - vec<2, V2, P> const& v2, - vec<2, V3, P> const& v3, - vec<2, V4, P> const& v4 + vec<2, V1, Q> const& v1, + vec<2, V2, Q> const& v2, + vec<2, V3, Q> const& v3, + vec<2, V4, Q> const& v4 ) { this->value[0] = col_type(v1); @@ -111,9 +111,9 @@ namespace glm // -- Conversion -- - template - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 2, U, Q> const& m) + template + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<4, 2, U, P> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -121,8 +121,8 @@ namespace glm this->value[3] = col_type(m[3]); } - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<2, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<2, 2, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -130,8 +130,8 @@ namespace glm this->value[3] = col_type(0); } - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<3, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -139,8 +139,8 @@ namespace glm this->value[3] = col_type(0); } - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -148,8 +148,8 @@ namespace glm this->value[3] = col_type(m[3]); } - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<2, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -157,8 +157,8 @@ namespace glm this->value[3] = col_type(0); } - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<3, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<3, 2, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -166,8 +166,8 @@ namespace glm this->value[3] = col_type(0); } - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<2, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -175,8 +175,8 @@ namespace glm this->value[3] = col_type(0); } - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -184,8 +184,8 @@ namespace glm this->value[3] = col_type(m[3]); } - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<3, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -195,15 +195,15 @@ namespace glm // -- Accesses -- - template - GLM_FUNC_QUALIFIER typename mat<4, 2, T, P>::col_type & mat<4, 2, T, P>::operator[](typename mat<4, 2, T, P>::length_type i) + template + GLM_FUNC_QUALIFIER typename mat<4, 2, T, Q>::col_type & mat<4, 2, T, Q>::operator[](typename mat<4, 2, T, Q>::length_type i) { assert(i < this->length()); return this->value[i]; } - template - GLM_FUNC_QUALIFIER typename mat<4, 2, T, P>::col_type const& mat<4, 2, T, P>::operator[](typename mat<4, 2, T, P>::length_type i) const + template + GLM_FUNC_QUALIFIER typename mat<4, 2, T, Q>::col_type const& mat<4, 2, T, Q>::operator[](typename mat<4, 2, T, Q>::length_type i) const { assert(i < this->length()); return this->value[i]; @@ -212,8 +212,8 @@ namespace glm // -- Unary updatable operators -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P>& mat<4, 2, T, P>::operator=(mat<4, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q>& mat<4, 2, T, Q>::operator=(mat<4, 2, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -223,9 +223,9 @@ namespace glm } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template + template template - GLM_FUNC_QUALIFIER mat<4, 2, T, P>& mat<4, 2, T, P>::operator=(mat<4, 2, U, P> const& m) + GLM_FUNC_QUALIFIER 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]; @@ -234,9 +234,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator+=(U s) + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator+=(U s) { this->value[0] += s; this->value[1] += s; @@ -245,9 +245,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator+=(mat<4, 2, U, P> const& m) + GLM_FUNC_QUALIFIER 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]; @@ -256,9 +256,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator-=(U s) + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator-=(U s) { this->value[0] -= s; this->value[1] -= s; @@ -267,9 +267,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator-=(mat<4, 2, U, P> const& m) + GLM_FUNC_QUALIFIER 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]; @@ -278,9 +278,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator*=(U s) + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator*=(U s) { this->value[0] *= s; this->value[1] *= s; @@ -289,9 +289,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator/=(U s) + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator/=(U s) { this->value[0] /= s; this->value[1] /= s; @@ -302,8 +302,8 @@ namespace glm // -- Increment and decrement operators -- - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator++() + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator++() { ++this->value[0]; ++this->value[1]; @@ -312,8 +312,8 @@ namespace glm return *this; } - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator--() + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator--() { --this->value[0]; --this->value[1]; @@ -322,34 +322,34 @@ namespace glm return *this; } - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P> mat<4, 2, T, P>::operator++(int) + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> mat<4, 2, T, Q>::operator++(int) { - mat<4, 2, T, P> Result(*this); + mat<4, 2, T, Q> Result(*this); ++*this; return Result; } - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P> mat<4, 2, T, P>::operator--(int) + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> mat<4, 2, T, Q>::operator--(int) { - mat<4, 2, T, P> Result(*this); + mat<4, 2, T, Q> Result(*this); --*this; return Result; } // -- Unary arithmetic operators -- - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator+(mat<4, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m) { return m; } - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator-(mat<4, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m) { - return mat<4, 2, T, P>( + return mat<4, 2, T, Q>( -m[0], -m[1], -m[2], @@ -358,86 +358,86 @@ namespace glm // -- Binary arithmetic operators -- - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator+(mat<4, 2, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m, T scalar) { - return mat<4, 2, T, P>( + return mat<4, 2, T, Q>( m[0] + scalar, m[1] + scalar, m[2] + scalar, m[3] + scalar); } - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator+(mat<4, 2, T, P> const& m1, mat<4, 2, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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, P>( + 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 mat<4, 2, T, P> operator-(mat<4, 2, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m, T scalar) { - return mat<4, 2, T, P>( + return mat<4, 2, T, Q>( m[0] - scalar, m[1] - scalar, m[2] - scalar, m[3] - scalar); } - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator-(mat<4, 2, T, P> const& m1, mat<4, 2, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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, P>( + 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 mat<4, 2, T, P> operator*(mat<4, 2, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m, T scalar) { - return mat<4, 2, T, P>( + return mat<4, 2, T, Q>( m[0] * scalar, m[1] * scalar, m[2] * scalar, m[3] * scalar); } - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(T scalar, mat<4, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(T scalar, mat<4, 2, T, Q> const& m) { - return mat<4, 2, T, P>( + return mat<4, 2, T, Q>( m[0] * scalar, m[1] * scalar, m[2] * scalar, m[3] * scalar); } - template - GLM_FUNC_QUALIFIER typename mat<4, 2, T, P>::col_type operator*(mat<4, 2, T, P> const& m, typename mat<4, 2, T, P>::row_type const& v) + template + GLM_FUNC_QUALIFIER 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) { - return typename mat<4, 2, T, P>::col_type( + return typename mat<4, 2, T, Q>::col_type( m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w); } - template - GLM_FUNC_QUALIFIER typename mat<4, 2, T, P>::row_type operator*(typename mat<4, 2, T, P>::col_type const& v, mat<4, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER typename mat<4, 2, T, Q>::row_type operator*(typename mat<4, 2, T, Q>::col_type const& v, mat<4, 2, T, Q> const& m) { - return typename mat<4, 2, T, P>::row_type( + return typename mat<4, 2, T, Q>::row_type( v.x * m[0][0] + v.y * m[0][1], v.x * m[1][0] + v.y * m[1][1], v.x * m[2][0] + v.y * m[2][1], v.x * m[3][0] + v.y * m[3][1]); } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<4, 2, T, P> const& m1, mat<2, 4, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<2, 4, T, Q> const& m2) { T const SrcA00 = m1[0][0]; T const SrcA01 = m1[0][1]; @@ -457,7 +457,7 @@ namespace glm T const SrcB12 = m2[1][2]; T const SrcB13 = m2[1][3]; - mat<2, 2, T, P> Result; + mat<2, 2, T, Q> Result; Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03; Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03; Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13; @@ -465,10 +465,10 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<4, 2, T, P> const& m1, mat<3, 4, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<3, 4, T, Q> const& m2) { - return mat<3, 2, T, P>( + return mat<3, 2, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], @@ -477,10 +477,10 @@ namespace glm m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3]); } - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<4, 2, T, P> const& m1, mat<4, 4, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<4, 4, T, Q> const& m2) { - return mat<4, 2, T, P>( + return mat<4, 2, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], @@ -491,20 +491,20 @@ 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 mat<4, 2, T, P> operator/(mat<4, 2, T, P> const& m, T scalar) + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator/(mat<4, 2, T, Q> const& m, T scalar) { - return mat<4, 2, T, P>( + return mat<4, 2, T, Q>( m[0] / scalar, m[1] / scalar, m[2] / scalar, m[3] / scalar); } - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator/(T scalar, mat<4, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator/(T scalar, mat<4, 2, T, Q> const& m) { - return mat<4, 2, T, P>( + return mat<4, 2, T, Q>( scalar / m[0], scalar / m[1], scalar / m[2], @@ -513,14 +513,14 @@ namespace glm // -- Boolean operators -- - template - GLM_FUNC_QUALIFIER bool operator==(mat<4, 2, T, P> const& m1, mat<4, 2, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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 bool operator!=(mat<4, 2, T, P> const& m1, mat<4, 2, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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]); } diff --git a/glm/detail/type_mat4x3.hpp b/glm/detail/type_mat4x3.hpp index ef7c443a..d92ce389 100644 --- a/glm/detail/type_mat4x3.hpp +++ b/glm/detail/type_mat4x3.hpp @@ -12,13 +12,13 @@ namespace glm { - template - struct mat<4, 3, T, P> + template + struct mat<4, 3, T, Q> { - typedef vec<3, T, P> col_type; - typedef vec<4, T, P> row_type; - typedef mat<4, 3, T, P> type; - typedef mat<3, 4, T, P> transpose_type; + typedef vec<3, T, Q> col_type; + typedef vec<4, T, Q> row_type; + typedef mat<4, 3, T, Q> type; + typedef mat<3, 4, T, Q> transpose_type; typedef T value_type; private: @@ -36,7 +36,7 @@ namespace glm // -- Constructors -- GLM_FUNC_DECL mat() GLM_DEFAULT; - GLM_FUNC_DECL mat(mat<4, 3, T, P> const& m) GLM_DEFAULT; + GLM_FUNC_DECL mat(mat<4, 3, T, Q> const& m) GLM_DEFAULT; template GLM_FUNC_DECL mat(mat<4, 3, T, Q> const& m); @@ -67,108 +67,108 @@ namespace glm template GLM_FUNC_DECL mat( - vec<3, V1, P> const& v1, - vec<3, V2, P> const& v2, - vec<3, V3, P> const& v3, - vec<3, V4, P> const& v4); + vec<3, V1, Q> const& v1, + vec<3, V2, Q> const& v2, + vec<3, V3, Q> const& v3, + vec<3, V4, Q> const& v4); // -- Matrix conversions -- template GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, U, Q> const& m); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x); // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<4, 3, T, P> & operator=(mat<4, 3, T, P> const& m) GLM_DEFAULT; + GLM_FUNC_DECL mat<4, 3, T, Q> & operator=(mat<4, 3, T, Q> const& m) GLM_DEFAULT; template - GLM_FUNC_DECL mat<4, 3, T, P> & operator=(mat<4, 3, U, P> const& m); + GLM_FUNC_DECL mat<4, 3, T, Q> & operator=(mat<4, 3, U, Q> const& m); template - GLM_FUNC_DECL mat<4, 3, T, P> & operator+=(U s); + GLM_FUNC_DECL mat<4, 3, T, Q> & operator+=(U s); template - GLM_FUNC_DECL mat<4, 3, T, P> & operator+=(mat<4, 3, U, P> const& m); + GLM_FUNC_DECL mat<4, 3, T, Q> & operator+=(mat<4, 3, U, Q> const& m); template - GLM_FUNC_DECL mat<4, 3, T, P> & operator-=(U s); + GLM_FUNC_DECL mat<4, 3, T, Q> & operator-=(U s); template - GLM_FUNC_DECL mat<4, 3, T, P> & operator-=(mat<4, 3, U, P> const& m); + GLM_FUNC_DECL mat<4, 3, T, Q> & operator-=(mat<4, 3, U, Q> const& m); template - GLM_FUNC_DECL mat<4, 3, T, P> & operator*=(U s); + GLM_FUNC_DECL mat<4, 3, T, Q> & operator*=(U s); template - GLM_FUNC_DECL mat<4, 3, T, P> & operator/=(U s); + GLM_FUNC_DECL mat<4, 3, T, Q> & operator/=(U s); // -- Increment and decrement operators -- - GLM_FUNC_DECL mat<4, 3, T, P>& operator++(); - GLM_FUNC_DECL mat<4, 3, T, P>& operator--(); - GLM_FUNC_DECL mat<4, 3, T, P> operator++(int); - GLM_FUNC_DECL mat<4, 3, T, P> operator--(int); + GLM_FUNC_DECL mat<4, 3, T, Q>& operator++(); + GLM_FUNC_DECL mat<4, 3, T, Q>& operator--(); + GLM_FUNC_DECL mat<4, 3, T, Q> operator++(int); + GLM_FUNC_DECL mat<4, 3, T, Q> operator--(int); }; // -- Unary operators -- - template - GLM_FUNC_DECL mat<4, 3, T, P> operator+(mat<4, 3, T, P> const& m); + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m); - template - GLM_FUNC_DECL mat<4, 3, T, P> operator-(mat<4, 3, T, P> const& m); + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m); // -- Binary operators -- - template - GLM_FUNC_DECL mat<4, 3, T, P> operator+(mat<4, 3, T, P> const& m, T const& s); + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m, T const& s); - template - GLM_FUNC_DECL mat<4, 3, T, P> operator+(mat<4, 3, T, P> const& m1, mat<4, 3, T, P> const& m2); + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); - template - GLM_FUNC_DECL mat<4, 3, T, P> operator-(mat<4, 3, T, P> const& m, T const& s); + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m, T const& s); - template - GLM_FUNC_DECL mat<4, 3, T, P> operator-(mat<4, 3, T, P> const& m1, mat<4, 3, T, P> const& m2); + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); - template - GLM_FUNC_DECL mat<4, 3, T, P> operator*(mat<4, 3, T, P> const& m, T const& s); + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m, T const& s); - template - GLM_FUNC_DECL mat<4, 3, T, P> operator*(T const& s, mat<4, 3, T, P> const& m); + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator*(T const& s, mat<4, 3, T, Q> const& m); - template - GLM_FUNC_DECL typename mat<4, 3, T, P>::col_type operator*(mat<4, 3, T, P> const& m, typename mat<4, 3, T, P>::row_type const& v); + template + GLM_FUNC_DECL 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); - template - GLM_FUNC_DECL typename mat<4, 3, T, P>::row_type operator*(typename mat<4, 3, T, P>::col_type const& v, mat<4, 3, T, P> const& m); + template + GLM_FUNC_DECL typename mat<4, 3, T, Q>::row_type operator*(typename mat<4, 3, T, Q>::col_type const& v, mat<4, 3, T, Q> const& m); - template - GLM_FUNC_DECL mat<2, 3, T, P> operator*(mat<4, 3, T, P> const& m1, mat<2, 4, T, P> const& m2); + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<2, 4, T, Q> const& m2); - template - GLM_FUNC_DECL mat<3, 3, T, P> operator*(mat<4, 3, T, P> const& m1, mat<3, 4, T, P> const& m2); + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<3, 4, T, Q> const& m2); - template - GLM_FUNC_DECL mat<4, 3, T, P> operator*(mat<4, 3, T, P> const& m1, mat<4, 4, T, P> const& m2); + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<4, 4, T, Q> const& m2); - template - GLM_FUNC_DECL mat<4, 3, T, P> operator/(mat<4, 3, T, P> const& m, T const& s); + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator/(mat<4, 3, T, Q> const& m, T const& s); - template - GLM_FUNC_DECL mat<4, 3, T, P> operator/(T const& s, mat<4, 3, T, P> const& m); + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator/(T const& s, mat<4, 3, T, Q> const& m); // -- Boolean operators -- - template - GLM_FUNC_DECL bool operator==(mat<4, 3, T, P> const& m1, mat<4, 3, T, P> const& m2); + template + GLM_FUNC_DECL bool operator==(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); - template - GLM_FUNC_DECL bool operator!=(mat<4, 3, T, P> const& m1, mat<4, 3, T, P> const& m2); + template + GLM_FUNC_DECL 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 cca80921..4fe9a45d 100644 --- a/glm/detail/type_mat4x3.inl +++ b/glm/detail/type_mat4x3.inl @@ -6,14 +6,14 @@ namespace glm // -- Constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat() + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat() {} # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<4, 3, T, Q> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; @@ -22,9 +22,9 @@ namespace glm } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 3, T, Q> const& m) + template + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<4, 3, T, P> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; @@ -32,8 +32,8 @@ namespace glm this->value[3] = m.value[3]; } - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(T const& s) + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(T const& s) { this->value[0] = col_type(s, 0, 0); this->value[1] = col_type(0, s, 0); @@ -41,8 +41,8 @@ namespace glm this->value[3] = col_type(0, 0, 0); } - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat ( T const& x0, T const& y0, T const& z0, T const& x1, T const& y1, T const& z1, @@ -56,8 +56,8 @@ namespace glm this->value[3] = col_type(x3, y3, z3); } - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat ( col_type const& v0, col_type const& v1, @@ -73,13 +73,13 @@ namespace glm // -- Conversion constructors -- - template + template template< typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2, typename X3, typename Y3, typename Z3, typename X4, typename Y4, typename Z4> - GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat + GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat ( X1 const& x1, Y1 const& y1, Z1 const& z1, X2 const& x2, Y2 const& y2, Z2 const& z2, @@ -93,14 +93,14 @@ namespace glm this->value[3] = col_type(static_cast(x4), value_type(y4), value_type(z4)); } - template + template template - GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat + GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat ( - vec<3, V1, P> const& v1, - vec<3, V2, P> const& v2, - vec<3, V3, P> const& v3, - vec<3, V4, P> const& v4 + vec<3, V1, Q> const& v1, + vec<3, V2, Q> const& v2, + vec<3, V3, Q> const& v3, + vec<3, V4, Q> const& v4 ) { this->value[0] = col_type(v1); @@ -111,9 +111,9 @@ namespace glm // -- Matrix conversions -- - template - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 3, U, Q> const& m) + template + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<4, 3, U, P> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -121,8 +121,8 @@ namespace glm this->value[3] = col_type(m[3]); } - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<2, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); @@ -130,8 +130,8 @@ namespace glm this->value[3] = col_type(0); } - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<3, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<3, 3, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -139,8 +139,8 @@ namespace glm this->value[3] = col_type(0); } - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -148,8 +148,8 @@ namespace glm this->value[3] = col_type(m[3]); } - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<2, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<2, 3, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -157,8 +157,8 @@ namespace glm this->value[3] = col_type(0); } - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<3, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); @@ -166,8 +166,8 @@ namespace glm this->value[3] = col_type(0); } - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<2, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -175,8 +175,8 @@ namespace glm this->value[3] = col_type(0); } - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); @@ -184,8 +184,8 @@ namespace glm this->value[3] = col_type(m[3], 0); } - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<3, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -195,15 +195,15 @@ namespace glm // -- Accesses -- - template - GLM_FUNC_QUALIFIER typename mat<4, 3, T, P>::col_type & mat<4, 3, T, P>::operator[](typename mat<4, 3, T, P>::length_type i) + template + GLM_FUNC_QUALIFIER typename mat<4, 3, T, Q>::col_type & mat<4, 3, T, Q>::operator[](typename mat<4, 3, T, Q>::length_type i) { assert(i < this->length()); return this->value[i]; } - template - GLM_FUNC_QUALIFIER typename mat<4, 3, T, P>::col_type const& mat<4, 3, T, P>::operator[](typename mat<4, 3, T, P>::length_type i) const + template + GLM_FUNC_QUALIFIER typename mat<4, 3, T, Q>::col_type const& mat<4, 3, T, Q>::operator[](typename mat<4, 3, T, Q>::length_type i) const { assert(i < this->length()); return this->value[i]; @@ -212,8 +212,8 @@ namespace glm // -- Unary updatable operators -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P>& mat<4, 3, T, P>::operator=(mat<4, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q>& mat<4, 3, T, Q>::operator=(mat<4, 3, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -223,9 +223,9 @@ namespace glm } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template + template template - GLM_FUNC_QUALIFIER mat<4, 3, T, P>& mat<4, 3, T, P>::operator=(mat<4, 3, U, P> const& m) + GLM_FUNC_QUALIFIER 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]; @@ -234,9 +234,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator+=(U s) + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator+=(U s) { this->value[0] += s; this->value[1] += s; @@ -245,9 +245,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator+=(mat<4, 3, U, P> const& m) + GLM_FUNC_QUALIFIER 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]; @@ -256,9 +256,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator-=(U s) + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator-=(U s) { this->value[0] -= s; this->value[1] -= s; @@ -267,9 +267,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator-=(mat<4, 3, U, P> const& m) + GLM_FUNC_QUALIFIER 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]; @@ -278,9 +278,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator*=(U s) + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator*=(U s) { this->value[0] *= s; this->value[1] *= s; @@ -289,9 +289,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator/=(U s) + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator/=(U s) { this->value[0] /= s; this->value[1] /= s; @@ -302,8 +302,8 @@ namespace glm // -- Increment and decrement operators -- - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator++() + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator++() { ++this->value[0]; ++this->value[1]; @@ -312,8 +312,8 @@ namespace glm return *this; } - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator--() + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator--() { --this->value[0]; --this->value[1]; @@ -322,34 +322,34 @@ namespace glm return *this; } - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P> mat<4, 3, T, P>::operator++(int) + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> mat<4, 3, T, Q>::operator++(int) { - mat<4, 3, T, P> Result(*this); + mat<4, 3, T, Q> Result(*this); ++*this; return Result; } - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P> mat<4, 3, T, P>::operator--(int) + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> mat<4, 3, T, Q>::operator--(int) { - mat<4, 3, T, P> Result(*this); + mat<4, 3, T, Q> Result(*this); --*this; return Result; } // -- Unary arithmetic operators -- - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator+(mat<4, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m) { return m; } - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator-(mat<4, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m) { - return mat<4, 3, T, P>( + return mat<4, 3, T, Q>( -m[0], -m[1], -m[2], @@ -358,95 +358,95 @@ namespace glm // -- Binary arithmetic operators -- - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator+(mat<4, 3, T, P> const& m, T const& s) + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m, T const& s) { - return mat<4, 3, T, P>( + return mat<4, 3, T, Q>( m[0] + s, m[1] + s, m[2] + s, m[3] + s); } - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator+(mat<4, 3, T, P> const& m1, mat<4, 3, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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, P>( + 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 mat<4, 3, T, P> operator-(mat<4, 3, T, P> const& m, T const& s) + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m, T const& s) { - return mat<4, 3, T, P>( + return mat<4, 3, T, Q>( m[0] - s, m[1] - s, m[2] - s, m[3] - s); } - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator-(mat<4, 3, T, P> const& m1, mat<4, 3, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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, P>( + 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 mat<4, 3, T, P> operator*(mat<4, 3, T, P> const& m, T const& s) + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m, T const& s) { - return mat<4, 3, T, P>( + return mat<4, 3, T, Q>( m[0] * s, m[1] * s, m[2] * s, m[3] * s); } - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(T const& s, mat<4, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(T const& s, mat<4, 3, T, Q> const& m) { - return mat<4, 3, T, P>( + return mat<4, 3, T, Q>( m[0] * s, m[1] * s, m[2] * s, m[3] * s); } - template - GLM_FUNC_QUALIFIER typename mat<4, 3, T, P>::col_type operator* + template + GLM_FUNC_QUALIFIER typename mat<4, 3, T, Q>::col_type operator* ( - mat<4, 3, T, P> const& m, - typename mat<4, 3, T, P>::row_type const& v) + mat<4, 3, T, Q> const& m, + typename mat<4, 3, T, Q>::row_type const& v) { - return typename mat<4, 3, T, P>::col_type( + return typename mat<4, 3, T, Q>::col_type( m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w, m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w); } - template - GLM_FUNC_QUALIFIER typename mat<4, 3, T, P>::row_type operator* + template + GLM_FUNC_QUALIFIER typename mat<4, 3, T, Q>::row_type operator* ( - typename mat<4, 3, T, P>::col_type const& v, - mat<4, 3, T, P> const& m) + typename mat<4, 3, T, Q>::col_type const& v, + mat<4, 3, T, Q> const& m) { - return typename mat<4, 3, T, P>::row_type( + return typename mat<4, 3, T, Q>::row_type( v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2], v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2], v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2], v.x * m[3][0] + v.y * m[3][1] + v.z * m[3][2]); } - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<4, 3, T, P> const& m1, mat<2, 4, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<2, 4, T, Q> const& m2) { - return mat<2, 3, T, P>( + return mat<2, 3, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3], @@ -455,8 +455,8 @@ namespace glm m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3]); } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<4, 3, T, P> const& m1, mat<3, 4, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<3, 4, T, Q> const& m2) { T const SrcA00 = m1[0][0]; T const SrcA01 = m1[0][1]; @@ -484,7 +484,7 @@ namespace glm T const SrcB22 = m2[2][2]; T const SrcB23 = m2[2][3]; - mat<3, 3, T, P> Result; + mat<3, 3, T, Q> Result; Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03; Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03; Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02 + SrcA32 * SrcB03; @@ -497,10 +497,10 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<4, 3, T, P> const& m1, mat<4, 4, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<4, 4, T, Q> const& m2) { - return mat<4, 3, T, P>( + return mat<4, 3, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3], @@ -515,20 +515,20 @@ 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 mat<4, 3, T, P> operator/(mat<4, 3, T, P> const& m, T const& s) + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator/(mat<4, 3, T, Q> const& m, T const& s) { - return mat<4, 3, T, P>( + return mat<4, 3, T, Q>( m[0] / s, m[1] / s, m[2] / s, m[3] / s); } - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator/(T const& s, mat<4, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator/(T const& s, mat<4, 3, T, Q> const& m) { - return mat<4, 3, T, P>( + return mat<4, 3, T, Q>( s / m[0], s / m[1], s / m[2], @@ -537,14 +537,14 @@ namespace glm // -- Boolean operators -- - template - GLM_FUNC_QUALIFIER bool operator==(mat<4, 3, T, P> const& m1, mat<4, 3, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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 bool operator!=(mat<4, 3, T, P> const& m1, mat<4, 3, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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]); } diff --git a/glm/detail/type_mat4x4.hpp b/glm/detail/type_mat4x4.hpp index f5a9afdd..15baede2 100644 --- a/glm/detail/type_mat4x4.hpp +++ b/glm/detail/type_mat4x4.hpp @@ -11,13 +11,13 @@ namespace glm { - template - struct mat<4, 4, T, P> + template + struct mat<4, 4, T, Q> { - typedef vec<4, T, P> col_type; - typedef vec<4, T, P> row_type; - typedef mat<4, 4, T, P> type; - typedef mat<4, 4, T, P> transpose_type; + typedef vec<4, T, Q> col_type; + typedef vec<4, T, Q> row_type; + typedef mat<4, 4, T, Q> type; + typedef mat<4, 4, T, Q> transpose_type; typedef T value_type; private: @@ -35,7 +35,7 @@ namespace glm // -- Constructors -- GLM_FUNC_DECL mat() GLM_DEFAULT; - GLM_FUNC_DECL mat(mat<4, 4, T, P> const& m) GLM_DEFAULT; + GLM_FUNC_DECL mat(mat<4, 4, T, Q> const& m) GLM_DEFAULT; template GLM_FUNC_DECL mat(mat<4, 4, T, Q> const& m); @@ -66,127 +66,127 @@ namespace glm template GLM_FUNC_DECL mat( - vec<4, V1, P> const& v1, - vec<4, V2, P> const& v2, - vec<4, V3, P> const& v3, - vec<4, V4, P> const& v4); + vec<4, V1, Q> const& v1, + vec<4, V2, Q> const& v2, + vec<4, V3, Q> const& v3, + vec<4, V4, Q> const& v4); // -- Matrix conversions -- template GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, U, Q> const& m); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<4, 4, T, P> & operator=(mat<4, 4, T, P> const& m) GLM_DEFAULT; + GLM_FUNC_DECL mat<4, 4, T, Q> & operator=(mat<4, 4, T, Q> const& m) GLM_DEFAULT; template - GLM_FUNC_DECL mat<4, 4, T, P> & operator=(mat<4, 4, U, P> const& m); + GLM_FUNC_DECL mat<4, 4, T, Q> & operator=(mat<4, 4, U, Q> const& m); template - GLM_FUNC_DECL mat<4, 4, T, P> & operator+=(U s); + GLM_FUNC_DECL mat<4, 4, T, Q> & operator+=(U s); template - GLM_FUNC_DECL mat<4, 4, T, P> & operator+=(mat<4, 4, U, P> const& m); + GLM_FUNC_DECL mat<4, 4, T, Q> & operator+=(mat<4, 4, U, Q> const& m); template - GLM_FUNC_DECL mat<4, 4, T, P> & operator-=(U s); + GLM_FUNC_DECL mat<4, 4, T, Q> & operator-=(U s); template - GLM_FUNC_DECL mat<4, 4, T, P> & operator-=(mat<4, 4, U, P> const& m); + GLM_FUNC_DECL mat<4, 4, T, Q> & operator-=(mat<4, 4, U, Q> const& m); template - GLM_FUNC_DECL mat<4, 4, T, P> & operator*=(U s); + GLM_FUNC_DECL mat<4, 4, T, Q> & operator*=(U s); template - GLM_FUNC_DECL mat<4, 4, T, P> & operator*=(mat<4, 4, U, P> const& m); + GLM_FUNC_DECL mat<4, 4, T, Q> & operator*=(mat<4, 4, U, Q> const& m); template - GLM_FUNC_DECL mat<4, 4, T, P> & operator/=(U s); + GLM_FUNC_DECL mat<4, 4, T, Q> & operator/=(U s); template - GLM_FUNC_DECL mat<4, 4, T, P> & operator/=(mat<4, 4, U, P> const& m); + GLM_FUNC_DECL mat<4, 4, T, Q> & operator/=(mat<4, 4, U, Q> const& m); // -- Increment and decrement operators -- - GLM_FUNC_DECL mat<4, 4, T, P> & operator++(); - GLM_FUNC_DECL mat<4, 4, T, P> & operator--(); - GLM_FUNC_DECL mat<4, 4, T, P> operator++(int); - GLM_FUNC_DECL mat<4, 4, T, P> operator--(int); + GLM_FUNC_DECL mat<4, 4, T, Q> & operator++(); + GLM_FUNC_DECL mat<4, 4, T, Q> & operator--(); + GLM_FUNC_DECL mat<4, 4, T, Q> operator++(int); + GLM_FUNC_DECL mat<4, 4, T, Q> operator--(int); }; // -- Unary operators -- - template - GLM_FUNC_DECL mat<4, 4, T, P> operator+(mat<4, 4, T, P> const& m); + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m); - template - GLM_FUNC_DECL mat<4, 4, T, P> operator-(mat<4, 4, T, P> const& m); + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m); // -- Binary operators -- - template - GLM_FUNC_DECL mat<4, 4, T, P> operator+(mat<4, 4, T, P> const& m, T const& s); + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m, T const& s); - template - GLM_FUNC_DECL mat<4, 4, T, P> operator+(T const& s, mat<4, 4, T, P> const& m); + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator+(T const& s, mat<4, 4, T, Q> const& m); - template - GLM_FUNC_DECL mat<4, 4, T, P> operator+(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2); + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); - template - GLM_FUNC_DECL mat<4, 4, T, P> operator-(mat<4, 4, T, P> const& m, T const& s); + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m, T const& s); - template - GLM_FUNC_DECL mat<4, 4, T, P> operator-(T const& s, mat<4, 4, T, P> const& m); + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator-(T const& s, mat<4, 4, T, Q> const& m); - template - GLM_FUNC_DECL mat<4, 4, T, P> operator-(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2); + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); - template - GLM_FUNC_DECL mat<4, 4, T, P> operator*(mat<4, 4, T, P> const& m, T const& s); + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m, T const& s); - template - GLM_FUNC_DECL mat<4, 4, T, P> operator*(T const& s, mat<4, 4, T, P> const& m); + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator*(T const& s, mat<4, 4, T, Q> const& m); - template - GLM_FUNC_DECL typename mat<4, 4, T, P>::col_type operator*(mat<4, 4, T, P> const& m, typename mat<4, 4, T, P>::row_type const& v); + template + GLM_FUNC_DECL 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 typename mat<4, 4, T, P>::row_type operator*(typename mat<4, 4, T, P>::col_type const& v, mat<4, 4, T, P> const& m); + template + GLM_FUNC_DECL 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 mat<2, 4, T, P> operator*(mat<4, 4, T, P> const& m1, mat<2, 4, T, P> const& m2); + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); - template - GLM_FUNC_DECL mat<3, 4, T, P> operator*(mat<4, 4, T, P> const& m1, mat<3, 4, T, P> const& m2); + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); - template - GLM_FUNC_DECL mat<4, 4, T, P> operator*(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2); + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); - template - GLM_FUNC_DECL mat<4, 4, T, P> operator/(mat<4, 4, T, P> const& m, T const& s); + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m, T const& s); - template - GLM_FUNC_DECL mat<4, 4, T, P> operator/(T const& s, mat<4, 4, T, P> const& m); + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator/(T const& s, mat<4, 4, T, Q> const& m); - template - GLM_FUNC_DECL typename mat<4, 4, T, P>::col_type operator/(mat<4, 4, T, P> const& m, typename mat<4, 4, T, P>::row_type const& v); + template + GLM_FUNC_DECL 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 typename mat<4, 4, T, P>::row_type operator/(typename mat<4, 4, T, P>::col_type const& v, mat<4, 4, T, P> const& m); + template + GLM_FUNC_DECL 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 mat<4, 4, T, P> operator/(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2); + template + GLM_FUNC_DECL 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 bool operator==(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2); + template + GLM_FUNC_DECL bool operator==(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); - template - GLM_FUNC_DECL bool operator!=(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2); + template + GLM_FUNC_DECL 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 eaa78d64..08436fab 100644 --- a/glm/detail/type_mat4x4.inl +++ b/glm/detail/type_mat4x4.inl @@ -8,14 +8,14 @@ namespace glm // -- Constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat() + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat() {} # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<4, 4, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -24,9 +24,9 @@ namespace glm } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 4, T, Q> const& m) + template + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<4, 4, T, P> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -34,8 +34,8 @@ namespace glm this->value[3] = m[3]; } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(T const& s) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(T const& s) { this->value[0] = col_type(s, 0, 0, 0); this->value[1] = col_type(0, s, 0, 0); @@ -43,8 +43,8 @@ namespace glm this->value[3] = col_type(0, 0, 0, s); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat ( T const& x0, T const& y0, T const& z0, T const& w0, T const& x1, T const& y1, T const& z1, T const& w1, @@ -58,8 +58,8 @@ namespace glm this->value[3] = col_type(x3, y3, z3, w3); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat ( col_type const& v0, col_type const& v1, @@ -73,12 +73,9 @@ namespace glm this->value[3] = v3; } - template - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat - ( - mat<4, 4, U, Q> const& m - ) + template + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<4, 4, U, P> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -88,13 +85,13 @@ namespace glm // -- Conversions -- - template + template template< typename X1, typename Y1, typename Z1, typename W1, typename X2, typename Y2, typename Z2, typename W2, typename X3, typename Y3, typename Z3, typename W3, typename X4, typename Y4, typename Z4, typename W4> - GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat + GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat ( X1 const& x1, Y1 const& y1, Z1 const& z1, W1 const& w1, X2 const& x2, Y2 const& y2, Z2 const& z2, W2 const& w2, @@ -128,14 +125,14 @@ namespace glm this->value[3] = col_type(static_cast(x4), value_type(y4), value_type(z4), value_type(w4)); } - template + template template - GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat + GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat ( - vec<4, V1, P> const& v1, - vec<4, V2, P> const& v2, - vec<4, V3, P> const& v3, - vec<4, V4, P> const& v4 + vec<4, V1, Q> const& v1, + vec<4, V2, Q> const& v2, + vec<4, V3, Q> const& v3, + vec<4, V4, Q> const& v4 ) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid."); @@ -151,8 +148,8 @@ namespace glm // -- Matrix conversions -- - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<2, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0, 0); this->value[1] = col_type(m[1], 0, 0); @@ -160,8 +157,8 @@ namespace glm this->value[3] = col_type(0, 0, 0, 1); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<3, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); @@ -169,8 +166,8 @@ namespace glm this->value[3] = col_type(0, 0, 0, 1); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<2, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); @@ -178,8 +175,8 @@ namespace glm this->value[3] = col_type(0, 0, 0, 1); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<3, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0, 0); this->value[1] = col_type(m[1], 0, 0); @@ -187,8 +184,8 @@ namespace glm this->value[3] = col_type(0, 0, 0, 1); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<2, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<2, 4, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -196,8 +193,8 @@ namespace glm this->value[3] = col_type(0, 0, 0, 1); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0, 0); this->value[1] = col_type(m[1], 0, 0); @@ -205,8 +202,8 @@ namespace glm this->value[3] = col_type(0, 0, 0, 1); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<3, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<3, 4, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -214,8 +211,8 @@ namespace glm this->value[3] = col_type(0, 0, 0, 1); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); @@ -225,15 +222,15 @@ namespace glm // -- Accesses -- - template - GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::col_type & mat<4, 4, T, P>::operator[](typename mat<4, 4, T, P>::length_type i) + template + GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::col_type & mat<4, 4, T, Q>::operator[](typename mat<4, 4, T, Q>::length_type i) { assert(i < this->length()); return this->value[i]; } - template - GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::col_type const& mat<4, 4, T, P>::operator[](typename mat<4, 4, T, P>::length_type i) const + template + GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::col_type const& mat<4, 4, T, Q>::operator[](typename mat<4, 4, T, Q>::length_type i) const { assert(i < this->length()); return this->value[i]; @@ -242,8 +239,8 @@ namespace glm // -- Unary arithmetic operators -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P>& mat<4, 4, T, P>::operator=(mat<4, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator=(mat<4, 4, T, Q> const& m) { //memcpy could be faster //memcpy(&this->value, &m.value, 16 * sizeof(valType)); @@ -255,9 +252,9 @@ namespace glm } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template + template template - GLM_FUNC_QUALIFIER mat<4, 4, T, P>& mat<4, 4, T, P>::operator=(mat<4, 4, U, P> const& m) + GLM_FUNC_QUALIFIER mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator=(mat<4, 4, U, Q> const& m) { //memcpy could be faster //memcpy(&this->value, &m.value, 16 * sizeof(valType)); @@ -268,9 +265,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<4, 4, T, P>& mat<4, 4, T, P>::operator+=(U s) + GLM_FUNC_QUALIFIER mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator+=(U s) { this->value[0] += s; this->value[1] += s; @@ -279,9 +276,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<4, 4, T, P>& mat<4, 4, T, P>::operator+=(mat<4, 4, U, P> const& m) + GLM_FUNC_QUALIFIER 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]; @@ -290,9 +287,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator-=(U s) + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator-=(U s) { this->value[0] -= s; this->value[1] -= s; @@ -301,9 +298,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator-=(mat<4, 4, U, P> const& m) + GLM_FUNC_QUALIFIER 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]; @@ -312,9 +309,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator*=(U s) + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator*=(U s) { this->value[0] *= s; this->value[1] *= s; @@ -323,16 +320,16 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator*=(mat<4, 4, U, P> const& m) + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator*=(mat<4, 4, U, Q> const& m) { return (*this = *this * m); } - template + template template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator/=(U s) + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator/=(U s) { this->value[0] /= s; this->value[1] /= s; @@ -341,17 +338,17 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator/=(mat<4, 4, U, P> const& m) + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator/=(mat<4, 4, U, Q> const& m) { return *this *= inverse(m); } // -- Increment and decrement operators -- - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator++() + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator++() { ++this->value[0]; ++this->value[1]; @@ -360,8 +357,8 @@ namespace glm return *this; } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator--() + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator--() { --this->value[0]; --this->value[1]; @@ -370,34 +367,34 @@ namespace glm return *this; } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> mat<4, 4, T, P>::operator++(int) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> mat<4, 4, T, Q>::operator++(int) { - mat<4, 4, T, P> Result(*this); + mat<4, 4, T, Q> Result(*this); ++*this; return Result; } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> mat<4, 4, T, P>::operator--(int) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> mat<4, 4, T, Q>::operator--(int) { - mat<4, 4, T, P> Result(*this); + mat<4, 4, T, Q> Result(*this); --*this; return Result; } // -- Unary constant operators -- - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(mat<4, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m) { return m; } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(mat<4, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m) { - return mat<4, 4, T, P>( + return mat<4, 4, T, Q>( -m[0], -m[1], -m[2], @@ -406,91 +403,91 @@ namespace glm // -- Binary arithmetic operators -- - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(mat<4, 4, T, P> const& m, T const& s) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m, T const& s) { - return mat<4, 4, T, P>( + return mat<4, 4, T, Q>( m[0] + s, m[1] + s, m[2] + s, m[3] + s); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(T const& s, mat<4, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator+(T const& s, mat<4, 4, T, Q> const& m) { - return mat<4, 4, T, P>( + return mat<4, 4, T, Q>( m[0] + s, m[1] + s, m[2] + s, m[3] + s); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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, P>( + 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 mat<4, 4, T, P> operator-(mat<4, 4, T, P> const& m, T const& s) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m, T const& s) { - return mat<4, 4, T, P>( + return mat<4, 4, T, Q>( m[0] - s, m[1] - s, m[2] - s, m[3] - s); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(T const& s, mat<4, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator-(T const& s, mat<4, 4, T, Q> const& m) { - return mat<4, 4, T, P>( + return mat<4, 4, T, Q>( s - m[0], s - m[1], s - m[2], s - m[3]); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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, P>( + 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 mat<4, 4, T, P> operator*(mat<4, 4, T, P> const& m, T const & s) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m, T const & s) { - return mat<4, 4, T, P>( + return mat<4, 4, T, Q>( m[0] * s, m[1] * s, m[2] * s, m[3] * s); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(T const& s, mat<4, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(T const& s, mat<4, 4, T, Q> const& m) { - return mat<4, 4, T, P>( + return mat<4, 4, T, Q>( m[0] * s, m[1] * s, m[2] * s, m[3] * s); } - template - GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::col_type operator* + template + GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::col_type operator* ( - mat<4, 4, T, P> const& m, - typename mat<4, 4, T, P>::row_type const& v + mat<4, 4, T, Q> const& m, + typename mat<4, 4, T, Q>::row_type const& v ) { /* @@ -509,24 +506,24 @@ namespace glm __m128 a2 = _mm_add_ps(a0, a1); - return typename mat<4, 4, T, P>::col_type(a2); + return typename mat<4, 4, T, Q>::col_type(a2); */ - typename mat<4, 4, T, P>::col_type const Mov0(v[0]); - typename mat<4, 4, T, P>::col_type const Mov1(v[1]); - typename mat<4, 4, T, P>::col_type const Mul0 = m[0] * Mov0; - typename mat<4, 4, T, P>::col_type const Mul1 = m[1] * Mov1; - typename mat<4, 4, T, P>::col_type const Add0 = Mul0 + Mul1; - typename mat<4, 4, T, P>::col_type const Mov2(v[2]); - typename mat<4, 4, T, P>::col_type const Mov3(v[3]); - typename mat<4, 4, T, P>::col_type const Mul2 = m[2] * Mov2; - typename mat<4, 4, T, P>::col_type const Mul3 = m[3] * Mov3; - typename mat<4, 4, T, P>::col_type const Add1 = Mul2 + Mul3; - typename mat<4, 4, T, P>::col_type const Add2 = Add0 + Add1; + typename mat<4, 4, T, Q>::col_type const Mov0(v[0]); + typename mat<4, 4, T, Q>::col_type const Mov1(v[1]); + typename mat<4, 4, T, Q>::col_type const Mul0 = m[0] * Mov0; + typename mat<4, 4, T, Q>::col_type const Mul1 = m[1] * Mov1; + typename mat<4, 4, T, Q>::col_type const Add0 = Mul0 + Mul1; + typename mat<4, 4, T, Q>::col_type const Mov2(v[2]); + typename mat<4, 4, T, Q>::col_type const Mov3(v[3]); + typename mat<4, 4, T, Q>::col_type const Mul2 = m[2] * Mov2; + typename mat<4, 4, T, Q>::col_type const Mul3 = m[3] * Mov3; + typename mat<4, 4, T, Q>::col_type const Add1 = Mul2 + Mul3; + typename mat<4, 4, T, Q>::col_type const Add2 = Add0 + Add1; return Add2; /* - return typename mat<4, 4, T, P>::col_type( + return typename mat<4, 4, T, Q>::col_type( m[0][0] * v[0] + m[1][0] * v[1] + m[2][0] * v[2] + m[3][0] * v[3], m[0][1] * v[0] + m[1][1] * v[1] + m[2][1] * v[2] + m[3][1] * v[3], m[0][2] * v[0] + m[1][2] * v[1] + m[2][2] * v[2] + m[3][2] * v[3], @@ -534,24 +531,24 @@ namespace glm */ } - template - GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::row_type operator* + template + GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::row_type operator* ( - typename mat<4, 4, T, P>::col_type const& v, - mat<4, 4, T, P> const& m + typename mat<4, 4, T, Q>::col_type const& v, + mat<4, 4, T, Q> const& m ) { - return typename mat<4, 4, T, P>::row_type( + return typename mat<4, 4, T, Q>::row_type( m[0][0] * v[0] + m[0][1] * v[1] + m[0][2] * v[2] + m[0][3] * v[3], m[1][0] * v[0] + m[1][1] * v[1] + m[1][2] * v[2] + m[1][3] * v[3], m[2][0] * v[0] + m[2][1] * v[1] + m[2][2] * v[2] + m[2][3] * v[3], m[3][0] * v[0] + m[3][1] * v[1] + m[3][2] * v[2] + m[3][3] * v[3]); } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<4, 4, T, P> const& m1, mat<2, 4, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) { - return mat<2, 4, T, P>( + return mat<2, 4, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3], @@ -562,10 +559,10 @@ namespace glm m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2] + m1[3][3] * m2[1][3]); } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<4, 4, T, P> const& m1, mat<3, 4, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) { - return mat<3, 4, T, P>( + return mat<3, 4, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3], @@ -580,20 +577,20 @@ namespace glm m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1] + m1[2][3] * m2[2][2] + m1[3][3] * m2[2][3]); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) { - typename mat<4, 4, T, P>::col_type const SrcA0 = m1[0]; - typename mat<4, 4, T, P>::col_type const SrcA1 = m1[1]; - typename mat<4, 4, T, P>::col_type const SrcA2 = m1[2]; - typename mat<4, 4, T, P>::col_type const SrcA3 = m1[3]; + typename mat<4, 4, T, Q>::col_type const SrcA0 = m1[0]; + typename mat<4, 4, T, Q>::col_type const SrcA1 = m1[1]; + typename mat<4, 4, T, Q>::col_type const SrcA2 = m1[2]; + typename mat<4, 4, T, Q>::col_type const SrcA3 = m1[3]; - typename mat<4, 4, T, P>::col_type const SrcB0 = m2[0]; - typename mat<4, 4, T, P>::col_type const SrcB1 = m2[1]; - typename mat<4, 4, T, P>::col_type const SrcB2 = m2[2]; - typename mat<4, 4, T, P>::col_type const SrcB3 = m2[3]; + typename mat<4, 4, T, Q>::col_type const SrcB0 = m2[0]; + typename mat<4, 4, T, Q>::col_type const SrcB1 = m2[1]; + typename mat<4, 4, T, Q>::col_type const SrcB2 = m2[2]; + typename mat<4, 4, T, Q>::col_type const SrcB3 = m2[3]; - mat<4, 4, T, P> Result; + mat<4, 4, T, Q> Result; Result[0] = SrcA0 * SrcB0[0] + SrcA1 * SrcB0[1] + SrcA2 * SrcB0[2] + SrcA3 * SrcB0[3]; Result[1] = SrcA0 * SrcB1[0] + SrcA1 * SrcB1[1] + SrcA2 * SrcB1[2] + SrcA3 * SrcB1[3]; Result[2] = SrcA0 * SrcB2[0] + SrcA1 * SrcB2[1] + SrcA2 * SrcB2[2] + SrcA3 * SrcB2[3]; @@ -601,55 +598,55 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator/(mat<4, 4, T, P> const& m, T const& s) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m, T const& s) { - return mat<4, 4, T, P>( + return mat<4, 4, T, Q>( m[0] / s, m[1] / s, m[2] / s, m[3] / s); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator/(T const& s, mat<4, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator/(T const& s, mat<4, 4, T, Q> const& m) { - return mat<4, 4, T, P>( + return mat<4, 4, T, Q>( s / m[0], s / m[1], s / m[2], s / m[3]); } - template - GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::col_type operator/(mat<4, 4, T, P> const& m, typename mat<4, 4, T, P>::row_type const& v) + template + GLM_FUNC_QUALIFIER 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 typename mat<4, 4, T, P>::row_type operator/(typename mat<4, 4, T, P>::col_type const& v, mat<4, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER 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 mat<4, 4, T, P> operator/(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) { - mat<4, 4, T, P> m1_copy(m1); + mat<4, 4, T, Q> m1_copy(m1); return m1_copy /= m2; } // -- Boolean operators -- - template - GLM_FUNC_QUALIFIER bool operator==(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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 bool operator!=(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2) + template + GLM_FUNC_QUALIFIER 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]); } diff --git a/glm/detail/type_vec.hpp b/glm/detail/type_vec.hpp index 2a5be39a..4272ddcf 100644 --- a/glm/detail/type_vec.hpp +++ b/glm/detail/type_vec.hpp @@ -103,10 +103,10 @@ namespace detail }//namespace detail #if GLM_HAS_TEMPLATE_ALIASES - template using tvec1 = vec<1, T, P>; - template using tvec2 = vec<2, T, P>; - template using tvec3 = vec<3, T, P>; - template using tvec4 = vec<4, T, P>; + 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>; #endif//GLM_HAS_TEMPLATE_ALIASES typedef vec<1, float, highp> highp_vec1_t; diff --git a/glm/detail/type_vec1.hpp b/glm/detail/type_vec1.hpp index 885827d7..843b511b 100644 --- a/glm/detail/type_vec1.hpp +++ b/glm/detail/type_vec1.hpp @@ -16,14 +16,14 @@ namespace glm { - template - struct vec<1, T, P> + template + struct vec<1, T, Q> { // -- Implementation detail -- typedef T value_type; typedef vec type; - typedef vec<1, bool, P> bool_type; + typedef vec<1, bool, Q> bool_type; // -- Data -- @@ -114,7 +114,7 @@ namespace glm /* # if(GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)) template - GLM_FUNC_DECL tvec(detail::_swizzle<1, T, P, tvec1, E0, -1,-2,-3> const& that) + GLM_FUNC_DECL tvec(detail::_swizzle<1, T, Q, tvec1, E0, -1,-2,-3> const& that) { *this = that(); } @@ -125,23 +125,23 @@ namespace glm GLM_FUNC_DECL vec & operator=(vec const& v) GLM_DEFAULT; template - GLM_FUNC_DECL vec & operator=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator=(vec<1, U, Q> const& v); template GLM_FUNC_DECL vec & operator+=(U scalar); template - GLM_FUNC_DECL vec & operator+=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator+=(vec<1, U, Q> const& v); template GLM_FUNC_DECL vec & operator-=(U scalar); template - GLM_FUNC_DECL vec & operator-=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator-=(vec<1, U, Q> const& v); template GLM_FUNC_DECL vec & operator*=(U scalar); template - GLM_FUNC_DECL vec & operator*=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator*=(vec<1, U, Q> const& v); template GLM_FUNC_DECL vec & operator/=(U scalar); template - GLM_FUNC_DECL vec & operator/=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator/=(vec<1, U, Q> const& v); // -- Increment and decrement operators -- @@ -155,145 +155,145 @@ namespace glm template GLM_FUNC_DECL vec & operator%=(U scalar); template - GLM_FUNC_DECL vec & operator%=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator%=(vec<1, U, Q> const& v); template GLM_FUNC_DECL vec & operator&=(U scalar); template - GLM_FUNC_DECL vec & operator&=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator&=(vec<1, U, Q> const& v); template GLM_FUNC_DECL vec & operator|=(U scalar); template - GLM_FUNC_DECL vec & operator|=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator|=(vec<1, U, Q> const& v); template GLM_FUNC_DECL vec & operator^=(U scalar); template - GLM_FUNC_DECL vec & operator^=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator^=(vec<1, U, Q> const& v); template GLM_FUNC_DECL vec & operator<<=(U scalar); template - GLM_FUNC_DECL vec & operator<<=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator<<=(vec<1, U, Q> const& v); template GLM_FUNC_DECL vec & operator>>=(U scalar); template - GLM_FUNC_DECL vec & operator>>=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator>>=(vec<1, U, Q> const& v); }; // -- Unary operators -- - template - GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const& v); + template + GLM_FUNC_DECL vec<1, T, Q> operator+(vec<1, T, Q> const& v); - template - GLM_FUNC_DECL vec<1, T, P> operator-(vec<1, T, P> const& v); + template + GLM_FUNC_DECL vec<1, T, Q> operator-(vec<1, T, Q> const& v); // -- Binary operators -- - template - GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<1, T, Q> operator+(vec<1, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<1, T, P> operator+(T scalar, vec<1, T, P> const& v); + template + GLM_FUNC_DECL vec<1, T, Q> operator+(T scalar, vec<1, T, Q> const& v); - template - GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<1, T, Q> operator+(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<1, T, P> operator-(vec<1, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<1, T, Q> operator-(vec<1, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<1, T, P> operator-(T scalar, vec<1, T, P> const& v); + template + GLM_FUNC_DECL vec<1, T, Q> operator-(T scalar, vec<1, T, Q> const& v); - template - GLM_FUNC_DECL vec<1, T, P> operator-(vec<1, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<1, T, Q> operator-(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<1, T, P> operator*(vec<1, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<1, T, Q> operator*(vec<1, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<1, T, P> operator*(T scalar, vec<1, T, P> const& v); + template + GLM_FUNC_DECL vec<1, T, Q> operator*(T scalar, vec<1, T, Q> const& v); - template - GLM_FUNC_DECL vec<1, T, P> operator*(vec<1, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<1, T, Q> operator*(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<1, T, P> operator/(vec<1, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<1, T, Q> operator/(vec<1, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<1, T, P> operator/(T scalar, vec<1, T, P> const& v); + template + GLM_FUNC_DECL vec<1, T, Q> operator/(T scalar, vec<1, T, Q> const& v); - template - GLM_FUNC_DECL vec<1, T, P> operator/(vec<1, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<1, T, Q> operator/(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<1, T, P> operator%(vec<1, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<1, T, Q> operator%(vec<1, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<1, T, P> operator%(T scalar, vec<1, T, P> const& v); + template + GLM_FUNC_DECL vec<1, T, Q> operator%(T scalar, vec<1, T, Q> const& v); - template - GLM_FUNC_DECL vec<1, T, P> operator%(vec<1, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<1, T, Q> operator%(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<1, T, P> operator&(vec<1, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<1, T, Q> operator&(vec<1, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<1, T, P> operator&(T scalar, vec<1, T, P> const& v); + template + GLM_FUNC_DECL vec<1, T, Q> operator&(T scalar, vec<1, T, Q> const& v); - template - GLM_FUNC_DECL vec<1, T, P> operator&(vec<1, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<1, T, Q> operator&(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<1, T, P> operator|(vec<1, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<1, T, Q> operator|(vec<1, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<1, T, P> operator|(T scalar, vec<1, T, P> const& v); + template + GLM_FUNC_DECL vec<1, T, Q> operator|(T scalar, vec<1, T, Q> const& v); - template - GLM_FUNC_DECL vec<1, T, P> operator|(vec<1, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<1, T, Q> operator|(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<1, T, P> operator^(vec<1, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<1, T, Q> operator^(vec<1, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<1, T, P> operator^(T scalar, vec<1, T, P> const& v); + template + GLM_FUNC_DECL vec<1, T, Q> operator^(T scalar, vec<1, T, Q> const& v); - template - GLM_FUNC_DECL vec<1, T, P> operator^(vec<1, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<1, T, Q> operator^(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<1, T, P> operator<<(vec<1, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<1, T, Q> operator<<(vec<1, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<1, T, P> operator<<(T scalar, vec<1, T, P> const& v); + template + GLM_FUNC_DECL vec<1, T, Q> operator<<(T scalar, vec<1, T, Q> const& v); - template - GLM_FUNC_DECL vec<1, T, P> operator<<(vec<1, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<1, T, Q> operator<<(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<1, T, P> operator>>(vec<1, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<1, T, Q> operator>>(vec<1, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<1, T, P> operator>>(T scalar, vec<1, T, P> const& v); + template + GLM_FUNC_DECL vec<1, T, Q> operator>>(T scalar, vec<1, T, Q> const& v); - template - GLM_FUNC_DECL vec<1, T, P> operator>>(vec<1, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<1, T, Q> operator>>(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<1, T, P> operator~(vec<1, T, P> const& v); + template + GLM_FUNC_DECL vec<1, T, Q> operator~(vec<1, T, Q> const& v); // -- Boolean operators -- - template - GLM_FUNC_DECL bool operator==(vec<1, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL bool operator==(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL bool operator!=(vec<1, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL bool operator!=(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<1, bool, P> operator&&(vec<1, bool, P> const& v1, vec<1, bool, P> const& v2); + template + GLM_FUNC_DECL vec<1, bool, Q> operator&&(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2); - template - GLM_FUNC_DECL vec<1, bool, P> operator||(vec<1, bool, P> const& v1, vec<1, bool, P> const& v2); + template + GLM_FUNC_DECL vec<1, bool, Q> operator||(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_vec1.inl b/glm/detail/type_vec1.inl index 15de613b..e59606f1 100644 --- a/glm/detail/type_vec1.inl +++ b/glm/detail/type_vec1.inl @@ -6,68 +6,68 @@ namespace glm // -- Implicit basic constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec() + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec() {} # endif//!GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<1, T, P> const& v) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec(vec<1, T, Q> const& v) : x(v.x) {} # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<1, T, Q> const& v) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec(vec<1, T, P> const& v) : x(v.x) {} // -- Explicit basic constructors -- - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(T scalar) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec(T scalar) : x(scalar) {} // -- Conversion vector constructors -- - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<1, U, Q> const& v) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec(vec<1, U, P> const& v) : x(static_cast(v.x)) {} - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<2, U, Q> const& v) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec(vec<2, U, P> const& v) : x(static_cast(v.x)) {} - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<3, U, Q> const& v) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec(vec<3, U, P> const& v) : x(static_cast(v.x)) {} - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<4, U, Q> const& v) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec(vec<4, U, P> const& v) : x(static_cast(v.x)) {} // -- Component accesses -- - template - GLM_FUNC_QUALIFIER T & vec<1, T, P>::operator[](typename vec<1, T, P>::length_type i) + template + GLM_FUNC_QUALIFIER T & vec<1, T, Q>::operator[](typename vec<1, T, Q>::length_type i) { assert(i >= 0 && i < this->length()); return (&x)[i]; } - template - GLM_FUNC_QUALIFIER T const& vec<1, T, P>::operator[](typename vec<1, T, P>::length_type i) const + template + GLM_FUNC_QUALIFIER T const& vec<1, T, Q>::operator[](typename vec<1, T, Q>::length_type i) const { assert(i >= 0 && i < this->length()); return (&x)[i]; @@ -76,81 +76,81 @@ namespace glm // -- Unary arithmetic operators -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator=(vec<1, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator=(vec<1, T, Q> const& v) { this->x = v.x; return *this; } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template + template template - GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator=(vec<1, U, Q> const& v) { this->x = static_cast(v.x); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator+=(U scalar) + GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator+=(U scalar) { this->x += static_cast(scalar); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator+=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator+=(vec<1, U, Q> const& v) { this->x += static_cast(v.x); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator-=(U scalar) + GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator-=(U scalar) { this->x -= static_cast(scalar); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator-=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator-=(vec<1, U, Q> const& v) { this->x -= static_cast(v.x); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator*=(U scalar) + GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator*=(U scalar) { this->x *= static_cast(scalar); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator*=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator*=(vec<1, U, Q> const& v) { this->x *= static_cast(v.x); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator/=(U scalar) + GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator/=(U scalar) { this->x /= static_cast(scalar); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator/=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator/=(vec<1, U, Q> const& v) { this->x /= static_cast(v.x); return *this; @@ -158,129 +158,129 @@ namespace glm // -- Increment and decrement operators -- - template - GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator++() + template + GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator++() { ++this->x; return *this; } - template - GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator--() + template + GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator--() { --this->x; return *this; } - template - GLM_FUNC_QUALIFIER vec<1, T, P> vec<1, T, P>::operator++(int) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> vec<1, T, Q>::operator++(int) { - vec<1, T, P> Result(*this); + vec<1, T, Q> Result(*this); ++*this; return Result; } - template - GLM_FUNC_QUALIFIER vec<1, T, P> vec<1, T, P>::operator--(int) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> vec<1, T, Q>::operator--(int) { - vec<1, T, P> Result(*this); + vec<1, T, Q> Result(*this); --*this; return Result; } // -- Unary bit operators -- - template + template template - GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator%=(U scalar) + GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator%=(U scalar) { this->x %= static_cast(scalar); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator%=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator%=(vec<1, U, Q> const& v) { this->x %= static_cast(v.x); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator&=(U scalar) + GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator&=(U scalar) { this->x &= static_cast(scalar); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator&=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator&=(vec<1, U, Q> const& v) { this->x &= static_cast(v.x); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator|=(U scalar) + GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator|=(U scalar) { this->x |= static_cast(scalar); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator|=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator|=(vec<1, U, Q> const& v) { this->x |= U(v.x); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator^=(U scalar) + GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator^=(U scalar) { this->x ^= static_cast(scalar); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator^=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator^=(vec<1, U, Q> const& v) { this->x ^= static_cast(v.x); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator<<=(U scalar) + GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator<<=(U scalar) { this->x <<= static_cast(scalar); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator<<=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator<<=(vec<1, U, Q> const& v) { this->x <<= static_cast(v.x); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator>>=(U scalar) + GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator>>=(U scalar) { this->x >>= static_cast(scalar); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator>>=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator>>=(vec<1, U, Q> const& v) { this->x >>= static_cast(v.x); return *this; @@ -288,264 +288,264 @@ namespace glm // -- Unary constant operators -- - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator+(vec<1, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator+(vec<1, T, Q> const& v) { return v; } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator-(vec<1, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator-(vec<1, T, Q> const& v) { - return vec<1, T, P>( + return vec<1, T, Q>( -v.x); } // -- Binary arithmetic operators -- - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator+(vec<1, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator+(vec<1, T, Q> const& v, T scalar) { - return vec<1, T, P>( + return vec<1, T, Q>( v.x + scalar); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator+(T scalar, vec<1, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator+(T scalar, vec<1, T, Q> const& v) { - return vec<1, T, P>( + return vec<1, T, Q>( scalar + v.x); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator+(vec<1, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator+(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<1, T, P>( + return vec<1, T, Q>( v1.x + v2.x); } //operator- - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator-(vec<1, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator-(vec<1, T, Q> const& v, T scalar) { - return vec<1, T, P>( + return vec<1, T, Q>( v.x - scalar); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator-(T scalar, vec<1, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator-(T scalar, vec<1, T, Q> const& v) { - return vec<1, T, P>( + return vec<1, T, Q>( scalar - v.x); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator-(vec<1, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator-(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<1, T, P>( + return vec<1, T, Q>( v1.x - v2.x); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator*(vec<1, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator*(vec<1, T, Q> const& v, T scalar) { - return vec<1, T, P>( + return vec<1, T, Q>( v.x * scalar); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator*(T scalar, vec<1, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator*(T scalar, vec<1, T, Q> const& v) { - return vec<1, T, P>( + return vec<1, T, Q>( scalar * v.x); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator*(vec<1, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator*(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<1, T, P>( + return vec<1, T, Q>( v1.x * v2.x); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator/(vec<1, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator/(vec<1, T, Q> const& v, T scalar) { - return vec<1, T, P>( + return vec<1, T, Q>( v.x / scalar); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator/(T scalar, vec<1, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator/(T scalar, vec<1, T, Q> const& v) { - return vec<1, T, P>( + return vec<1, T, Q>( scalar / v.x); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator/(vec<1, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator/(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<1, T, P>( + return vec<1, T, Q>( v1.x / v2.x); } // -- Binary bit operators -- - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator%(vec<1, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator%(vec<1, T, Q> const& v, T scalar) { - return vec<1, T, P>( + return vec<1, T, Q>( v.x % scalar); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator%(T scalar, vec<1, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator%(T scalar, vec<1, T, Q> const& v) { - return vec<1, T, P>( + return vec<1, T, Q>( scalar % v.x); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator%(vec<1, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator%(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<1, T, P>( + return vec<1, T, Q>( v1.x % v2.x); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator&(vec<1, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator&(vec<1, T, Q> const& v, T scalar) { - return vec<1, T, P>( + return vec<1, T, Q>( v.x & scalar); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator&(T scalar, vec<1, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator&(T scalar, vec<1, T, Q> const& v) { - return vec<1, T, P>( + return vec<1, T, Q>( scalar & v.x); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator&(vec<1, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator&(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<1, T, P>( + return vec<1, T, Q>( v1.x & v2.x); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator|(vec<1, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator|(vec<1, T, Q> const& v, T scalar) { - return vec<1, T, P>( + return vec<1, T, Q>( v.x | scalar); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator|(T scalar, vec<1, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator|(T scalar, vec<1, T, Q> const& v) { - return vec<1, T, P>( + return vec<1, T, Q>( scalar | v.x); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator|(vec<1, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator|(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<1, T, P>( + return vec<1, T, Q>( v1.x | v2.x); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator^(vec<1, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator^(vec<1, T, Q> const& v, T scalar) { - return vec<1, T, P>( + return vec<1, T, Q>( v.x ^ scalar); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator^(T scalar, vec<1, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator^(T scalar, vec<1, T, Q> const& v) { - return vec<1, T, P>( + return vec<1, T, Q>( scalar ^ v.x); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator^(vec<1, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator^(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<1, T, P>( + return vec<1, T, Q>( v1.x ^ v2.x); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator<<(vec<1, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator<<(vec<1, T, Q> const& v, T scalar) { - return vec<1, T, P>( + return vec<1, T, Q>( static_cast(v.x << scalar)); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator<<(T scalar, vec<1, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator<<(T scalar, vec<1, T, Q> const& v) { - return vec<1, T, P>( + return vec<1, T, Q>( scalar << v.x); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator<<(vec<1, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator<<(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<1, T, P>( + return vec<1, T, Q>( v1.x << v2.x); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator>>(vec<1, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator>>(vec<1, T, Q> const& v, T scalar) { - return vec<1, T, P>( + return vec<1, T, Q>( v.x >> scalar); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator>>(T scalar, vec<1, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator>>(T scalar, vec<1, T, Q> const& v) { - return vec<1, T, P>( + return vec<1, T, Q>( scalar >> v.x); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator>>(vec<1, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator>>(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<1, T, P>( + return vec<1, T, Q>( v1.x >> v2.x); } - template - GLM_FUNC_QUALIFIER vec<1, T, P> operator~(vec<1, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<1, T, Q> operator~(vec<1, T, Q> const& v) { - return vec<1, T, P>( + return vec<1, T, Q>( ~v.x); } // -- Boolean operators -- - template - GLM_FUNC_QUALIFIER bool operator==(vec<1, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER bool operator==(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { return detail::compute_equal::call(v1.x, v2.x); } - template - GLM_FUNC_QUALIFIER bool operator!=(vec<1, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER bool operator!=(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { return !(v1 == v2); } - template - GLM_FUNC_QUALIFIER vec<1, bool, P> operator&&(vec<1, bool, P> const& v1, vec<1, bool, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<1, bool, Q> operator&&(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2) { - return vec<1, bool, P>(v1.x && v2.x); + return vec<1, bool, Q>(v1.x && v2.x); } - template - GLM_FUNC_QUALIFIER vec<1, bool, P> operator||(vec<1, bool, P> const& v1, vec<1, bool, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<1, bool, Q> operator||(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2) { - return vec<1, bool, P>(v1.x || v2.x); + return vec<1, bool, Q>(v1.x || v2.x); } }//namespace glm diff --git a/glm/detail/type_vec2.hpp b/glm/detail/type_vec2.hpp index c1cfc102..a82994c8 100644 --- a/glm/detail/type_vec2.hpp +++ b/glm/detail/type_vec2.hpp @@ -15,14 +15,14 @@ namespace glm { - template - struct vec<2, T, P> + template + struct vec<2, T, Q> { // -- Implementation detail -- typedef T value_type; typedef vec type; - typedef vec<2, bool, P> bool_type; + typedef vec<2, bool, Q> bool_type; // -- Data -- @@ -102,7 +102,7 @@ namespace glm template GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(A x, B y); template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, A, P> const& x, vec<1, B, P> const& y); + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, A, Q> const& x, vec<1, B, Q> const& y); // -- Conversion vector constructors -- @@ -120,7 +120,7 @@ namespace glm // -- Swizzle constructors -- # if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED) template - GLM_FUNC_DECL vec(detail::_swizzle<2, T, P, E0, E1,-1,-2> const& that) + GLM_FUNC_DECL vec(detail::_swizzle<2, T, Q, E0, E1,-1,-2> const& that) { *this = that(); } @@ -131,31 +131,31 @@ namespace glm GLM_FUNC_DECL vec& operator=(vec const& v) GLM_DEFAULT; template - GLM_FUNC_DECL vec& operator=(vec<2, U, P> const& v); + GLM_FUNC_DECL vec& operator=(vec<2, U, Q> const& v); template GLM_FUNC_DECL vec& operator+=(U scalar); template - GLM_FUNC_DECL vec& operator+=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec& operator+=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec& operator+=(vec<2, U, P> const& v); + GLM_FUNC_DECL vec& operator+=(vec<2, U, Q> const& v); template GLM_FUNC_DECL vec& operator-=(U scalar); template - GLM_FUNC_DECL vec& operator-=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec& operator-=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec& operator-=(vec<2, U, P> const& v); + GLM_FUNC_DECL vec& operator-=(vec<2, U, Q> const& v); template GLM_FUNC_DECL vec& operator*=(U scalar); template - GLM_FUNC_DECL vec& operator*=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec& operator*=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec& operator*=(vec<2, U, P> const& v); + GLM_FUNC_DECL vec& operator*=(vec<2, U, Q> const& v); template GLM_FUNC_DECL vec& operator/=(U scalar); template - GLM_FUNC_DECL vec& operator/=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec& operator/=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec& operator/=(vec<2, U, P> const& v); + GLM_FUNC_DECL vec& operator/=(vec<2, U, Q> const& v); // -- Increment and decrement operators -- @@ -169,217 +169,217 @@ namespace glm template GLM_FUNC_DECL vec & operator%=(U scalar); template - GLM_FUNC_DECL vec & operator%=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator%=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator%=(vec<2, U, P> const& v); + GLM_FUNC_DECL vec & operator%=(vec<2, U, Q> const& v); template GLM_FUNC_DECL vec & operator&=(U scalar); template - GLM_FUNC_DECL vec & operator&=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator&=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator&=(vec<2, U, P> const& v); + GLM_FUNC_DECL vec & operator&=(vec<2, U, Q> const& v); template GLM_FUNC_DECL vec & operator|=(U scalar); template - GLM_FUNC_DECL vec & operator|=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator|=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator|=(vec<2, U, P> const& v); + GLM_FUNC_DECL vec & operator|=(vec<2, U, Q> const& v); template GLM_FUNC_DECL vec & operator^=(U scalar); template - GLM_FUNC_DECL vec & operator^=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator^=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator^=(vec<2, U, P> const& v); + GLM_FUNC_DECL vec & operator^=(vec<2, U, Q> const& v); template GLM_FUNC_DECL vec & operator<<=(U scalar); template - GLM_FUNC_DECL vec & operator<<=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator<<=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator<<=(vec<2, U, P> const& v); + GLM_FUNC_DECL vec & operator<<=(vec<2, U, Q> const& v); template GLM_FUNC_DECL vec & operator>>=(U scalar); template - GLM_FUNC_DECL vec & operator>>=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator>>=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator>>=(vec<2, U, P> const& v); + GLM_FUNC_DECL vec & operator>>=(vec<2, U, Q> const& v); }; // -- Unary operators -- - template - GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const& v); + template + GLM_FUNC_DECL vec<2, T, Q> operator+(vec<2, T, Q> const& v); - template - GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const& v); + template + GLM_FUNC_DECL vec<2, T, Q> operator-(vec<2, T, Q> const& v); // -- Binary operators -- - template - GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<2, T, Q> operator+(vec<2, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator+(T scalar, vec<2, T, P> const& v); + template + GLM_FUNC_DECL vec<2, T, Q> operator+(T scalar, vec<2, T, Q> const& v); - template - GLM_FUNC_DECL vec<2, T, P> operator+(vec<1, T, P> const& v1, vec<2, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator+(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const& v1, vec<2, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<2, T, Q> operator-(vec<2, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator-(T scalar, vec<2, T, P> const& v); + template + GLM_FUNC_DECL vec<2, T, Q> operator-(T scalar, vec<2, T, Q> const& v); - template - GLM_FUNC_DECL vec<2, T, P> operator-(vec<1, T, P> const& v1, vec<2, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator-(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const& v1, vec<2, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator*(vec<2, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<2, T, Q> operator*(vec<2, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<2, T, P> operator*(vec<2, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator*(T scalar, vec<2, T, P> const& v); + template + GLM_FUNC_DECL vec<2, T, Q> operator*(T scalar, vec<2, T, Q> const& v); - template - GLM_FUNC_DECL vec<2, T, P> operator*(vec<1, T, P> const& v1, vec<2, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator*(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator*(vec<2, T, P> const& v1, vec<2, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator/(vec<2, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<2, T, Q> operator/(vec<2, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<2, T, P> operator/(vec<2, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator/(T scalar, vec<2, T, P> const& v); + template + GLM_FUNC_DECL vec<2, T, Q> operator/(T scalar, vec<2, T, Q> const& v); - template - GLM_FUNC_DECL vec<2, T, P> operator/(vec<1, T, P> const& v1, vec<2, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator/(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator/(vec<2, T, P> const& v1, vec<2, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator%(vec<2, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<2, T, Q> operator%(vec<2, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<2, T, P> operator%(vec<2, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator%(T scalar, vec<2, T, P> const& v); + template + GLM_FUNC_DECL vec<2, T, Q> operator%(T scalar, vec<2, T, Q> const& v); - template - GLM_FUNC_DECL vec<2, T, P> operator%(vec<1, T, P> const& v1, vec<2, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator%(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator%(vec<2, T, P> const& v1, vec<2, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator&(vec<2, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<2, T, Q> operator&(vec<2, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<2, T, P> operator&(vec<2, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator&(T scalar, vec<2, T, P> const& v); + template + GLM_FUNC_DECL vec<2, T, Q> operator&(T scalar, vec<2, T, Q> const& v); - template - GLM_FUNC_DECL vec<2, T, P> operator&(vec<1, T, P> const& v1, vec<2, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator&(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator&(vec<2, T, P> const& v1, vec<2, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator|(vec<2, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<2, T, Q> operator|(vec<2, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<2, T, P> operator|(vec<2, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator|(T scalar, vec<2, T, P> const& v); + template + GLM_FUNC_DECL vec<2, T, Q> operator|(T scalar, vec<2, T, Q> const& v); - template - GLM_FUNC_DECL vec<2, T, P> operator|(vec<1, T, P> const& v1, vec<2, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator|(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator|(vec<2, T, P> const& v1, vec<2, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator^(vec<2, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<2, T, Q> operator^(vec<2, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<2, T, P> operator^(vec<2, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator^(T scalar, vec<2, T, P> const& v); + template + GLM_FUNC_DECL vec<2, T, Q> operator^(T scalar, vec<2, T, Q> const& v); - template - GLM_FUNC_DECL vec<2, T, P> operator^(vec<1, T, P> const& v1, vec<2, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator^(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator^(vec<2, T, P> const& v1, vec<2, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator<<(vec<2, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<2, T, Q> operator<<(vec<2, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<2, T, P> operator<<(vec<2, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator<<(T scalar, vec<2, T, P> const& v); + template + GLM_FUNC_DECL vec<2, T, Q> operator<<(T scalar, vec<2, T, Q> const& v); - template - GLM_FUNC_DECL vec<2, T, P> operator<<(vec<1, T, P> const& v1, vec<2, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator<<(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator<<(vec<2, T, P> const& v1, vec<2, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator>>(vec<2, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<2, T, Q> operator>>(vec<2, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<2, T, P> operator>>(vec<2, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator>>(T scalar, vec<2, T, P> const& v); + template + GLM_FUNC_DECL vec<2, T, Q> operator>>(T scalar, vec<2, T, Q> const& v); - template - GLM_FUNC_DECL vec<2, T, P> operator>>(vec<1, T, P> const& v1, vec<2, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator>>(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator>>(vec<2, T, P> const& v1, vec<2, T, P> const& v2); + template + GLM_FUNC_DECL vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, T, P> operator~(vec<2, T, P> const& v); + template + GLM_FUNC_DECL vec<2, T, Q> operator~(vec<2, T, Q> const& v); // -- Boolean operators -- - template - GLM_FUNC_DECL bool operator==(vec<2, T, P> const& v1, vec<2, T, P> const& v2); + template + GLM_FUNC_DECL bool operator==(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); - template - GLM_FUNC_DECL bool operator!=(vec<2, T, P> const& v1, vec<2, T, P> const& v2); + template + GLM_FUNC_DECL bool operator!=(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); - template - GLM_FUNC_DECL vec<2, bool, P> operator&&(vec<2, bool, P> const& v1, vec<2, bool, P> const& v2); + template + GLM_FUNC_DECL vec<2, bool, Q> operator&&(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2); - template - GLM_FUNC_DECL vec<2, bool, P> operator||(vec<2, bool, P> const& v1, vec<2, bool, P> const& v2); + template + GLM_FUNC_DECL vec<2, bool, Q> operator||(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_vec2.inl b/glm/detail/type_vec2.inl index 1c90eec3..d82d22ea 100644 --- a/glm/detail/type_vec2.inl +++ b/glm/detail/type_vec2.inl @@ -6,86 +6,86 @@ namespace glm // -- Implicit basic constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, P>::vec() + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, Q>::vec() {} # endif//!GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, P>::vec(vec<2, T, P> const& v) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, Q>::vec(vec<2, T, Q> const& v) : x(v.x), y(v.y) {} # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, P>::vec(vec<2, T, Q> const& v) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, Q>::vec(vec<2, T, P> const& v) : x(v.x), y(v.y) {} // -- Explicit basic constructors -- - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, P>::vec(T scalar) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, Q>::vec(T scalar) : x(scalar), y(scalar) {} - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, P>::vec(T _x, T _y) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, Q>::vec(T _x, T _y) : x(_x), y(_y) {} // -- Conversion scalar constructors -- - template + template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, P>::vec(A _x, B _y) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, Q>::vec(A _x, B _y) : x(static_cast(_x)) , y(static_cast(_y)) {} - template + template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, P>::vec(vec<1, A, P> const& _x, vec<1, B, P> const& _y) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, Q>::vec(vec<1, A, Q> const& _x, vec<1, B, Q> const& _y) : x(static_cast(_x.x)) , y(static_cast(_y.x)) {} // -- Conversion vector constructors -- - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, P>::vec(vec<2, U, Q> const& v) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR 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_CTOR vec<2, T, P>::vec(vec<3, U, Q> const& v) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR 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_CTOR vec<2, T, P>::vec(vec<4, U, Q> const& v) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, Q>::vec(vec<4, U, P> const& v) : x(static_cast(v.x)) , y(static_cast(v.y)) {} // -- Component accesses -- - template - GLM_FUNC_QUALIFIER T & vec<2, T, P>::operator[](typename vec<2, T, P>::length_type i) + template + GLM_FUNC_QUALIFIER T & vec<2, T, Q>::operator[](typename vec<2, T, Q>::length_type i) { assert(i >= 0 && i < this->length()); return (&x)[i]; } - template - GLM_FUNC_QUALIFIER T const& vec<2, T, P>::operator[](typename vec<2, T, P>::length_type i) const + template + GLM_FUNC_QUALIFIER T const& vec<2, T, Q>::operator[](typename vec<2, T, Q>::length_type i) const { assert(i >= 0 && i < this->length()); return (&x)[i]; @@ -94,8 +94,8 @@ namespace glm // -- Unary arithmetic operators -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator=(vec<2, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator=(vec<2, T, Q> const& v) { this->x = v.x; this->y = v.y; @@ -103,117 +103,117 @@ namespace glm } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template + template template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator=(vec<2, U, P> const& v) + GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator=(vec<2, U, Q> const& v) { this->x = static_cast(v.x); this->y = static_cast(v.y); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator+=(U scalar) + GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator+=(U scalar) { this->x += static_cast(scalar); this->y += static_cast(scalar); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator+=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator+=(vec<2, U, P> const& v) + GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator+=(vec<2, U, Q> const& v) { this->x += static_cast(v.x); this->y += static_cast(v.y); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator-=(U scalar) + GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator-=(U scalar) { this->x -= static_cast(scalar); this->y -= static_cast(scalar); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator-=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator-=(vec<2, U, P> const& v) + GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator-=(vec<2, U, Q> const& v) { this->x -= static_cast(v.x); this->y -= static_cast(v.y); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator*=(U scalar) + GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator*=(U scalar) { this->x *= static_cast(scalar); this->y *= static_cast(scalar); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator*=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator*=(vec<2, U, P> const& v) + GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator*=(vec<2, U, Q> const& v) { this->x *= static_cast(v.x); this->y *= static_cast(v.y); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator/=(U scalar) + GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator/=(U scalar) { this->x /= static_cast(scalar); this->y /= static_cast(scalar); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator/=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator/=(vec<2, U, P> const& v) + GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator/=(vec<2, U, Q> const& v) { this->x /= static_cast(v.x); this->y /= static_cast(v.y); @@ -222,196 +222,196 @@ namespace glm // -- Increment and decrement operators -- - template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator++() + template + GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator++() { ++this->x; ++this->y; return *this; } - template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator--() + template + GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator--() { --this->x; --this->y; return *this; } - template - GLM_FUNC_QUALIFIER vec<2, T, P> vec<2, T, P>::operator++(int) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> vec<2, T, Q>::operator++(int) { - vec<2, T, P> Result(*this); + vec<2, T, Q> Result(*this); ++*this; return Result; } - template - GLM_FUNC_QUALIFIER vec<2, T, P> vec<2, T, P>::operator--(int) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> vec<2, T, Q>::operator--(int) { - vec<2, T, P> Result(*this); + vec<2, T, Q> Result(*this); --*this; return Result; } // -- Unary bit operators -- - template + template template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator%=(U scalar) + GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator%=(U scalar) { this->x %= static_cast(scalar); this->y %= static_cast(scalar); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator%=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator%=(vec<2, U, P> const& v) + GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator%=(vec<2, U, Q> const& v) { this->x %= static_cast(v.x); this->y %= static_cast(v.y); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator&=(U scalar) + GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator&=(U scalar) { this->x &= static_cast(scalar); this->y &= static_cast(scalar); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator&=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator&=(vec<2, U, P> const& v) + GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator&=(vec<2, U, Q> const& v) { this->x &= static_cast(v.x); this->y &= static_cast(v.y); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator|=(U scalar) + GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator|=(U scalar) { this->x |= static_cast(scalar); this->y |= static_cast(scalar); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator|=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator|=(vec<2, U, P> const& v) + GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator|=(vec<2, U, Q> const& v) { this->x |= static_cast(v.x); this->y |= static_cast(v.y); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator^=(U scalar) + GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator^=(U scalar) { this->x ^= static_cast(scalar); this->y ^= static_cast(scalar); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator^=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator^=(vec<2, U, P> const& v) + GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator^=(vec<2, U, Q> const& v) { this->x ^= static_cast(v.x); this->y ^= static_cast(v.y); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator<<=(U scalar) + GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator<<=(U scalar) { this->x <<= static_cast(scalar); this->y <<= static_cast(scalar); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator<<=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator<<=(vec<2, U, P> const& v) + GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator<<=(vec<2, U, Q> const& v) { this->x <<= static_cast(v.x); this->y <<= static_cast(v.y); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator>>=(U scalar) + GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator>>=(U scalar) { this->x >>= static_cast(scalar); this->y >>= static_cast(scalar); return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator>>=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER 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 template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator>>=(vec<2, U, P> const& v) + GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator>>=(vec<2, U, Q> const& v) { this->x >>= static_cast(v.x); this->y >>= static_cast(v.y); @@ -420,457 +420,457 @@ namespace glm // -- Unary arithmetic operators -- - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<2, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator+(vec<2, T, Q> const& v) { return v; } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<2, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator-(vec<2, T, Q> const& v) { - return vec<2, T, P>( + return vec<2, T, Q>( -v.x, -v.y); } // -- Binary arithmetic operators -- - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<2, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator+(vec<2, T, Q> const& v, T scalar) { - return vec<2, T, P>( + return vec<2, T, Q>( v.x + scalar, v.y + scalar); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<2, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x + v2.x, v1.y + v2.x); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator+(T scalar, vec<2, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator+(T scalar, vec<2, T, Q> const& v) { - return vec<2, T, P>( + return vec<2, T, Q>( scalar + v.x, scalar + v.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<1, T, P> const& v1, vec<2, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator+(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x + v2.x, v1.x + v2.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<2, T, P> const& v1, vec<2, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x + v2.x, v1.y + v2.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<2, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator-(vec<2, T, Q> const& v, T scalar) { - return vec<2, T, P>( + return vec<2, T, Q>( v.x - scalar, v.y - scalar); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<2, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x - v2.x, v1.y - v2.x); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator-(T scalar, vec<2, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator-(T scalar, vec<2, T, Q> const& v) { - return vec<2, T, P>( + return vec<2, T, Q>( scalar - v.x, scalar - v.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<1, T, P> const& v1, vec<2, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator-(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x - v2.x, v1.x - v2.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<2, T, P> const& v1, vec<2, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x - v2.x, v1.y - v2.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator*(vec<2, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator*(vec<2, T, Q> const& v, T scalar) { - return vec<2, T, P>( + return vec<2, T, Q>( v.x * scalar, v.y * scalar); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator*(vec<2, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x * v2.x, v1.y * v2.x); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator*(T scalar, vec<2, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator*(T scalar, vec<2, T, Q> const& v) { - return vec<2, T, P>( + return vec<2, T, Q>( scalar * v.x, scalar * v.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator*(vec<1, T, P> const& v1, vec<2, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator*(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x * v2.x, v1.x * v2.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator*(vec<2, T, P> const& v1, vec<2, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x * v2.x, v1.y * v2.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator/(vec<2, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator/(vec<2, T, Q> const& v, T scalar) { - return vec<2, T, P>( + return vec<2, T, Q>( v.x / scalar, v.y / scalar); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator/(vec<2, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x / v2.x, v1.y / v2.x); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator/(T scalar, vec<2, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator/(T scalar, vec<2, T, Q> const& v) { - return vec<2, T, P>( + return vec<2, T, Q>( scalar / v.x, scalar / v.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator/(vec<1, T, P> const& v1, vec<2, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator/(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x / v2.x, v1.x / v2.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator/(vec<2, T, P> const& v1, vec<2, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x / v2.x, v1.y / v2.y); } // -- Binary bit operators -- - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator%(vec<2, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator%(vec<2, T, Q> const& v, T scalar) { - return vec<2, T, P>( + return vec<2, T, Q>( v.x % scalar, v.y % scalar); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator%(vec<2, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x % v2.x, v1.y % v2.x); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator%(T scalar, vec<2, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator%(T scalar, vec<2, T, Q> const& v) { - return vec<2, T, P>( + return vec<2, T, Q>( scalar % v.x, scalar % v.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator%(vec<1, T, P> const& v1, vec<2, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator%(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x % v2.x, v1.x % v2.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator%(vec<2, T, P> const& v1, vec<2, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x % v2.x, v1.y % v2.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator&(vec<2, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator&(vec<2, T, Q> const& v, T scalar) { - return vec<2, T, P>( + return vec<2, T, Q>( v.x & scalar, v.y & scalar); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator&(vec<2, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x & v2.x, v1.y & v2.x); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator&(T scalar, vec<2, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator&(T scalar, vec<2, T, Q> const& v) { - return vec<2, T, P>( + return vec<2, T, Q>( scalar & v.x, scalar & v.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator&(vec<1, T, P> const& v1, vec<2, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator&(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x & v2.x, v1.x & v2.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator&(vec<2, T, P> const& v1, vec<2, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x & v2.x, v1.y & v2.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator|(vec<2, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator|(vec<2, T, Q> const& v, T scalar) { - return vec<2, T, P>( + return vec<2, T, Q>( v.x | scalar, v.y | scalar); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator|(vec<2, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x | v2.x, v1.y | v2.x); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator|(T scalar, vec<2, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator|(T scalar, vec<2, T, Q> const& v) { - return vec<2, T, P>( + return vec<2, T, Q>( scalar | v.x, scalar | v.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator|(vec<1, T, P> const& v1, vec<2, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator|(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x | v2.x, v1.x | v2.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator|(vec<2, T, P> const& v1, vec<2, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x | v2.x, v1.y | v2.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator^(vec<2, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator^(vec<2, T, Q> const& v, T scalar) { - return vec<2, T, P>( + return vec<2, T, Q>( v.x ^ scalar, v.y ^ scalar); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator^(vec<2, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x ^ v2.x, v1.y ^ v2.x); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator^(T scalar, vec<2, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator^(T scalar, vec<2, T, Q> const& v) { - return vec<2, T, P>( + return vec<2, T, Q>( scalar ^ v.x, scalar ^ v.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator^(vec<1, T, P> const& v1, vec<2, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator^(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x ^ v2.x, v1.x ^ v2.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator^(vec<2, T, P> const& v1, vec<2, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x ^ v2.x, v1.y ^ v2.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(vec<2, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator<<(vec<2, T, Q> const& v, T scalar) { - return vec<2, T, P>( + return vec<2, T, Q>( v.x << scalar, v.y << scalar); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(vec<2, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x << v2.x, v1.y << v2.x); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(T scalar, vec<2, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator<<(T scalar, vec<2, T, Q> const& v) { - return vec<2, T, P>( + return vec<2, T, Q>( scalar << v.x, scalar << v.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(vec<1, T, P> const& v1, vec<2, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator<<(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x << v2.x, v1.x << v2.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(vec<2, T, P> const& v1, vec<2, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x << v2.x, v1.y << v2.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(vec<2, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator>>(vec<2, T, Q> const& v, T scalar) { - return vec<2, T, P>( + return vec<2, T, Q>( v.x >> scalar, v.y >> scalar); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(vec<2, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x >> v2.x, v1.y >> v2.x); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(T scalar, vec<2, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator>>(T scalar, vec<2, T, Q> const& v) { - return vec<2, T, P>( + return vec<2, T, Q>( scalar >> v.x, scalar >> v.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(vec<1, T, P> const& v1, vec<2, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator>>(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x >> v2.x, v1.x >> v2.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(vec<2, T, P> const& v1, vec<2, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) { - return vec<2, T, P>( + return vec<2, T, Q>( v1.x >> v2.x, v1.y >> v2.y); } - template - GLM_FUNC_QUALIFIER vec<2, T, P> operator~(vec<2, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> operator~(vec<2, T, Q> const& v) { - return vec<2, T, P>( + return vec<2, T, Q>( ~v.x, ~v.y); } // -- Boolean operators -- - template - GLM_FUNC_QUALIFIER bool operator==(vec<2, T, P> const& v1, vec<2, T, P> const& v2) + template + GLM_FUNC_QUALIFIER bool operator==(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) { return detail::compute_equal::call(v1.x, v2.x) && detail::compute_equal::call(v1.y, v2.y); } - template - GLM_FUNC_QUALIFIER bool operator!=(vec<2, T, P> const& v1, vec<2, T, P> const& v2) + template + GLM_FUNC_QUALIFIER bool operator!=(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) { return !(v1 == v2); } - template - GLM_FUNC_QUALIFIER vec<2, bool, P> operator&&(vec<2, bool, P> const& v1, vec<2, bool, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, bool, Q> operator&&(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2) { - return vec<2, bool, P>(v1.x && v2.x, v1.y && v2.y); + return vec<2, bool, Q>(v1.x && v2.x, v1.y && v2.y); } - template - GLM_FUNC_QUALIFIER vec<2, bool, P> operator||(vec<2, bool, P> const& v1, vec<2, bool, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<2, bool, Q> operator||(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2) { - return vec<2, bool, P>(v1.x || v2.x, v1.y || v2.y); + return vec<2, bool, Q>(v1.x || v2.x, v1.y || v2.y); } }//namespace glm diff --git a/glm/detail/type_vec3.hpp b/glm/detail/type_vec3.hpp index 458eca1c..d57cf652 100644 --- a/glm/detail/type_vec3.hpp +++ b/glm/detail/type_vec3.hpp @@ -15,14 +15,14 @@ namespace glm { - template - struct vec<3, T, P> + template + struct vec<3, T, Q> { // -- Implementation detail -- typedef T value_type; typedef vec type; - typedef vec<3, bool, P> bool_type; + typedef vec<3, bool, Q> bool_type; // -- Data -- @@ -102,7 +102,7 @@ namespace glm template GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(X x, Y y, Z z); template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, X, P> const& _x, vec<1, Y, P> const& _y, vec<1, Z, P> const& _z); + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z); // -- Conversion vector constructors -- @@ -129,19 +129,19 @@ namespace glm // -- Swizzle constructors -- # if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED) template - GLM_FUNC_DECL vec(detail::_swizzle<3, T, P, E0, E1, E2, -1> const& that) + GLM_FUNC_DECL vec(detail::_swizzle<3, T, Q, E0, E1, E2, -1> const& that) { *this = that(); } template - GLM_FUNC_DECL vec(detail::_swizzle<2, T, P, E0, E1, -1, -2> const& v, T const& scalar) + GLM_FUNC_DECL vec(detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, T const& scalar) { *this = vec(v(), scalar); } template - GLM_FUNC_DECL vec(T const& scalar, detail::_swizzle<2, T, P, E0, E1, -1, -2> const& v) + GLM_FUNC_DECL vec(T const& scalar, detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v) { *this = vec(scalar, v()); } @@ -152,31 +152,31 @@ namespace glm GLM_FUNC_DECL vec & operator=(vec const& v) GLM_DEFAULT; template - GLM_FUNC_DECL vec & operator=(vec<3, U, P> const& v); + GLM_FUNC_DECL vec & operator=(vec<3, U, Q> const& v); template GLM_FUNC_DECL vec & operator+=(U scalar); template - GLM_FUNC_DECL vec & operator+=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator+=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator+=(vec<3, U, P> const& v); + GLM_FUNC_DECL vec & operator+=(vec<3, U, Q> const& v); template GLM_FUNC_DECL vec & operator-=(U scalar); template - GLM_FUNC_DECL vec & operator-=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator-=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator-=(vec<3, U, P> const& v); + GLM_FUNC_DECL vec & operator-=(vec<3, U, Q> const& v); template GLM_FUNC_DECL vec & operator*=(U scalar); template - GLM_FUNC_DECL vec & operator*=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator*=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator*=(vec<3, U, P> const& v); + GLM_FUNC_DECL vec & operator*=(vec<3, U, Q> const& v); template GLM_FUNC_DECL vec & operator/=(U scalar); template - GLM_FUNC_DECL vec & operator/=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator/=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator/=(vec<3, U, P> const& v); + GLM_FUNC_DECL vec & operator/=(vec<3, U, Q> const& v); // -- Increment and decrement operators -- @@ -190,217 +190,217 @@ namespace glm template GLM_FUNC_DECL vec & operator%=(U scalar); template - GLM_FUNC_DECL vec & operator%=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator%=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator%=(vec<3, U, P> const& v); + GLM_FUNC_DECL vec & operator%=(vec<3, U, Q> const& v); template GLM_FUNC_DECL vec & operator&=(U scalar); template - GLM_FUNC_DECL vec & operator&=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator&=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator&=(vec<3, U, P> const& v); + GLM_FUNC_DECL vec & operator&=(vec<3, U, Q> const& v); template GLM_FUNC_DECL vec & operator|=(U scalar); template - GLM_FUNC_DECL vec & operator|=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator|=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator|=(vec<3, U, P> const& v); + GLM_FUNC_DECL vec & operator|=(vec<3, U, Q> const& v); template GLM_FUNC_DECL vec & operator^=(U scalar); template - GLM_FUNC_DECL vec & operator^=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator^=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator^=(vec<3, U, P> const& v); + GLM_FUNC_DECL vec & operator^=(vec<3, U, Q> const& v); template GLM_FUNC_DECL vec & operator<<=(U scalar); template - GLM_FUNC_DECL vec & operator<<=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator<<=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator<<=(vec<3, U, P> const& v); + GLM_FUNC_DECL vec & operator<<=(vec<3, U, Q> const& v); template GLM_FUNC_DECL vec & operator>>=(U scalar); template - GLM_FUNC_DECL vec & operator>>=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec & operator>>=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator>>=(vec<3, U, P> const& v); + GLM_FUNC_DECL vec & operator>>=(vec<3, U, Q> const& v); }; // -- Unary operators -- - template - GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const& v); + template + GLM_FUNC_DECL vec<3, T, Q> operator+(vec<3, T, Q> const& v); - template - GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const& v); + template + GLM_FUNC_DECL vec<3, T, Q> operator-(vec<3, T, Q> const& v); // -- Binary operators -- - template - GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<3, T, Q> operator+(vec<3, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const& v, vec<1, T, P> const& scalar); + template + GLM_FUNC_DECL vec<3, T, Q> operator+(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar); - template - GLM_FUNC_DECL vec<3, T, P> operator+(T scalar, vec<3, T, P> const& v); + template + GLM_FUNC_DECL vec<3, T, Q> operator+(T scalar, vec<3, T, Q> const& v); - template - GLM_FUNC_DECL vec<3, T, P> operator+(vec<1, T, P> const& v1, vec<3, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator+(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const& v1, vec<3, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator+(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<3, T, Q> operator-(vec<3, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator-(T scalar, vec<3, T, P> const& v); + template + GLM_FUNC_DECL vec<3, T, Q> operator-(T scalar, vec<3, T, Q> const& v); - template - GLM_FUNC_DECL vec<3, T, P> operator-(vec<1, T, P> const& v1, vec<3, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator-(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const& v1, vec<3, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<3, T, Q> operator*(vec<3, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator*(T scalar, vec<3, T, P> const& v); + template + GLM_FUNC_DECL vec<3, T, Q> operator*(T scalar, vec<3, T, Q> const& v); - template - GLM_FUNC_DECL vec<3, T, P> operator*(vec<1, T, P> const& v1, vec<3, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator*(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const& v1, vec<3, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator/(vec<3, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<3, T, Q> operator/(vec<3, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<3, T, P> operator/(vec<3, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator/(T scalar, vec<3, T, P> const& v); + template + GLM_FUNC_DECL vec<3, T, Q> operator/(T scalar, vec<3, T, Q> const& v); - template - GLM_FUNC_DECL vec<3, T, P> operator/(vec<1, T, P> const& v1, vec<3, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator/(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator/(vec<3, T, P> const& v1, vec<3, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator%(vec<3, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<3, T, Q> operator%(vec<3, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<3, T, P> operator%(vec<3, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator%(T const& scalar, vec<3, T, P> const& v); + template + GLM_FUNC_DECL vec<3, T, Q> operator%(T const& scalar, vec<3, T, Q> const& v); - template - GLM_FUNC_DECL vec<3, T, P> operator%(vec<1, T, P> const& v1, vec<3, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator%(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator%(vec<3, T, P> const& v1, vec<3, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator&(vec<3, T, P> const& v1, T scalar); + template + GLM_FUNC_DECL vec<3, T, Q> operator&(vec<3, T, Q> const& v1, T scalar); - template - GLM_FUNC_DECL vec<3, T, P> operator&(vec<3, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator&(T scalar, vec<3, T, P> const& v); + template + GLM_FUNC_DECL vec<3, T, Q> operator&(T scalar, vec<3, T, Q> const& v); - template - GLM_FUNC_DECL vec<3, T, P> operator&(vec<1, T, P> const& v1, vec<3, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator&(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator&(vec<3, T, P> const& v1, vec<3, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator|(vec<3, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<3, T, Q> operator|(vec<3, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<3, T, P> operator|(vec<3, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator|(T scalar, vec<3, T, P> const& v); + template + GLM_FUNC_DECL vec<3, T, Q> operator|(T scalar, vec<3, T, Q> const& v); - template - GLM_FUNC_DECL vec<3, T, P> operator|(vec<1, T, P> const& v1, vec<3, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator|(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator|(vec<3, T, P> const& v1, vec<3, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator^(vec<3, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<3, T, Q> operator^(vec<3, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<3, T, P> operator^(vec<3, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator^(T scalar, vec<3, T, P> const& v); + template + GLM_FUNC_DECL vec<3, T, Q> operator^(T scalar, vec<3, T, Q> const& v); - template - GLM_FUNC_DECL vec<3, T, P> operator^(vec<1, T, P> const& v1, vec<3, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator^(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator^(vec<3, T, P> const& v1, vec<3, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator<<(vec<3, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<3, T, Q> operator<<(vec<3, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<3, T, P> operator<<(vec<3, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator<<(T scalar, vec<3, T, P> const& v); + template + GLM_FUNC_DECL vec<3, T, Q> operator<<(T scalar, vec<3, T, Q> const& v); - template - GLM_FUNC_DECL vec<3, T, P> operator<<(vec<1, T, P> const& v1, vec<3, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator<<(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator<<(vec<3, T, P> const& v1, vec<3, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator>>(vec<3, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<3, T, Q> operator>>(vec<3, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<3, T, P> operator>>(vec<3, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator>>(T scalar, vec<3, T, P> const& v); + template + GLM_FUNC_DECL vec<3, T, Q> operator>>(T scalar, vec<3, T, Q> const& v); - template - GLM_FUNC_DECL vec<3, T, P> operator>>(vec<1, T, P> const& v1, vec<3, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator>>(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator>>(vec<3, T, P> const& v1, vec<3, T, P> const& v2); + template + GLM_FUNC_DECL vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, T, P> operator~(vec<3, T, P> const& v); + template + GLM_FUNC_DECL vec<3, T, Q> operator~(vec<3, T, Q> const& v); // -- Boolean operators -- - template - GLM_FUNC_DECL bool operator==(vec<3, T, P> const& v1, vec<3, T, P> const& v2); + template + GLM_FUNC_DECL bool operator==(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); - template - GLM_FUNC_DECL bool operator!=(vec<3, T, P> const& v1, vec<3, T, P> const& v2); + template + GLM_FUNC_DECL bool operator!=(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); - template - GLM_FUNC_DECL vec<3, bool, P> operator&&(vec<3, bool, P> const& v1, vec<3, bool, P> const& v2); + template + GLM_FUNC_DECL vec<3, bool, Q> operator&&(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2); - template - GLM_FUNC_DECL vec<3, bool, P> operator||(vec<3, bool, P> const& v1, vec<3, bool, P> const& v2); + template + GLM_FUNC_DECL vec<3, bool, Q> operator||(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_vec3.inl b/glm/detail/type_vec3.inl index 4071fc87..75488c4e 100644 --- a/glm/detail/type_vec3.inl +++ b/glm/detail/type_vec3.inl @@ -6,49 +6,49 @@ namespace glm // -- Implicit basic constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec() + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec() {} # endif//!GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec(vec<3, T, Q> const& v) : x(v.x), y(v.y), z(v.z) {} # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(vec<3, T, Q> const& v) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec(vec<3, T, P> const& v) : x(v.x), y(v.y), z(v.z) {} // -- Explicit basic constructors -- - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(T scalar) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec(T scalar) : x(scalar), y(scalar), z(scalar) {} - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(T _x, T _y, T _z) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec(T _x, T _y, T _z) : x(_x), y(_y), z(_z) {} // -- Conversion scalar constructors -- - template + template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(X _x, Y _y, Z _z) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec(X _x, Y _y, Z _z) : x(static_cast(_x)) , y(static_cast(_y)) , z(static_cast(_z)) {} - template + template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(vec<1, X, P> const& _x, vec<1, Y, P> const& _y, vec<1, Z, P> const& _z) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z) : x(static_cast(_x)) , y(static_cast(_y)) , z(static_cast(_z)) @@ -56,65 +56,65 @@ namespace glm // -- Conversion vector constructors -- - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(vec<2, A, Q> const& _xy, B _z) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec(vec<2, A, P> const& _xy, B _z) : x(static_cast(_xy.x)) , y(static_cast(_xy.y)) , z(static_cast(_z)) {} - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(vec<2, A, Q> const& _xy, vec<1, B, Q> const& _z) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z) : x(static_cast(_xy.x)) , y(static_cast(_xy.y)) , z(static_cast(_z.x)) {} - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(A _x, vec<2, B, Q> const& _yz) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec(A _x, vec<2, B, P> const& _yz) : x(static_cast(_x)) , y(static_cast(_yz.x)) , z(static_cast(_yz.y)) {} - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(vec<1, A, Q> const& _x, vec<2, B, Q> const& _yz) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz) : x(static_cast(_x.x)) , y(static_cast(_yz.x)) , z(static_cast(_yz.y)) {} - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(vec<3, U, Q> const& v) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR 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_CTOR vec<3, T, P>::vec(vec<4, U, Q> const& v) : - x(static_cast(v.x)), - y(static_cast(v.y)), - z(static_cast(v.z)) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec(vec<4, U, P> const& v) + : x(static_cast(v.x)) + , y(static_cast(v.y)) + , z(static_cast(v.z)) {} // -- Component accesses -- - template - GLM_FUNC_QUALIFIER T & vec<3, T, P>::operator[](typename vec<3, T, P>::length_type i) + template + GLM_FUNC_QUALIFIER T & vec<3, T, Q>::operator[](typename vec<3, T, Q>::length_type i) { assert(i >= 0 && i < this->length()); return (&x)[i]; } - template - GLM_FUNC_QUALIFIER T const& vec<3, T, P>::operator[](typename vec<3, T, P>::length_type i) const + template + GLM_FUNC_QUALIFIER T const& vec<3, T, Q>::operator[](typename vec<3, T, Q>::length_type i) const { assert(i >= 0 && i < this->length()); return (&x)[i]; @@ -123,8 +123,8 @@ namespace glm // -- Unary arithmetic operators -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER vec<3, T, P>& vec<3, T, P>::operator=(vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q>& vec<3, T, Q>::operator=(vec<3, T, Q> const& v) { this->x = v.x; this->y = v.y; @@ -133,9 +133,9 @@ namespace glm } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P>& vec<3, T, P>::operator=(vec<3, U, P> const& v) + GLM_FUNC_QUALIFIER vec<3, T, Q>& vec<3, T, Q>::operator=(vec<3, U, Q> const& v) { this->x = static_cast(v.x); this->y = static_cast(v.y); @@ -143,9 +143,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator+=(U scalar) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator+=(U scalar) { this->x += static_cast(scalar); this->y += static_cast(scalar); @@ -153,9 +153,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator+=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator+=(vec<1, U, Q> const& v) { this->x += static_cast(v.x); this->y += static_cast(v.x); @@ -163,9 +163,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator+=(vec<3, U, P> const& v) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator+=(vec<3, U, Q> const& v) { this->x += static_cast(v.x); this->y += static_cast(v.y); @@ -173,9 +173,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator-=(U scalar) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator-=(U scalar) { this->x -= static_cast(scalar); this->y -= static_cast(scalar); @@ -183,9 +183,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator-=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator-=(vec<1, U, Q> const& v) { this->x -= static_cast(v.x); this->y -= static_cast(v.x); @@ -193,9 +193,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator-=(vec<3, U, P> const& v) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator-=(vec<3, U, Q> const& v) { this->x -= static_cast(v.x); this->y -= static_cast(v.y); @@ -203,9 +203,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator*=(U scalar) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator*=(U scalar) { this->x *= static_cast(scalar); this->y *= static_cast(scalar); @@ -213,9 +213,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator*=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator*=(vec<1, U, Q> const& v) { this->x *= static_cast(v.x); this->y *= static_cast(v.x); @@ -223,9 +223,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator*=(vec<3, U, P> const& v) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator*=(vec<3, U, Q> const& v) { this->x *= static_cast(v.x); this->y *= static_cast(v.y); @@ -233,9 +233,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator/=(U v) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator/=(U v) { this->x /= static_cast(v); this->y /= static_cast(v); @@ -243,9 +243,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator/=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator/=(vec<1, U, Q> const& v) { this->x /= static_cast(v.x); this->y /= static_cast(v.x); @@ -253,9 +253,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator/=(vec<3, U, P> const& v) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator/=(vec<3, U, Q> const& v) { this->x /= static_cast(v.x); this->y /= static_cast(v.y); @@ -265,8 +265,8 @@ namespace glm // -- Increment and decrement operators -- - template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator++() + template + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator++() { ++this->x; ++this->y; @@ -274,8 +274,8 @@ namespace glm return *this; } - template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator--() + template + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator--() { --this->x; --this->y; @@ -283,27 +283,27 @@ namespace glm return *this; } - template - GLM_FUNC_QUALIFIER vec<3, T, P> vec<3, T, P>::operator++(int) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> vec<3, T, Q>::operator++(int) { - vec<3, T, P> Result(*this); + vec<3, T, Q> Result(*this); ++*this; return Result; } - template - GLM_FUNC_QUALIFIER vec<3, T, P> vec<3, T, P>::operator--(int) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> vec<3, T, Q>::operator--(int) { - vec<3, T, P> Result(*this); + vec<3, T, Q> Result(*this); --*this; return Result; } // -- Unary bit operators -- - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator%=(U scalar) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator%=(U scalar) { this->x %= scalar; this->y %= scalar; @@ -311,9 +311,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator%=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator%=(vec<1, U, Q> const& v) { this->x %= v.x; this->y %= v.x; @@ -321,9 +321,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator%=(vec<3, U, P> const& v) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator%=(vec<3, U, Q> const& v) { this->x %= v.x; this->y %= v.y; @@ -331,9 +331,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator&=(U scalar) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator&=(U scalar) { this->x &= scalar; this->y &= scalar; @@ -341,9 +341,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator&=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator&=(vec<1, U, Q> const& v) { this->x &= v.x; this->y &= v.x; @@ -351,9 +351,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator&=(vec<3, U, P> const& v) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator&=(vec<3, U, Q> const& v) { this->x &= v.x; this->y &= v.y; @@ -361,9 +361,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator|=(U scalar) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator|=(U scalar) { this->x |= scalar; this->y |= scalar; @@ -371,9 +371,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator|=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator|=(vec<1, U, Q> const& v) { this->x |= v.x; this->y |= v.x; @@ -381,9 +381,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator|=(vec<3, U, P> const& v) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator|=(vec<3, U, Q> const& v) { this->x |= v.x; this->y |= v.y; @@ -391,9 +391,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator^=(U scalar) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator^=(U scalar) { this->x ^= scalar; this->y ^= scalar; @@ -401,9 +401,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator^=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator^=(vec<1, U, Q> const& v) { this->x ^= v.x; this->y ^= v.x; @@ -411,9 +411,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator^=(vec<3, U, P> const& v) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator^=(vec<3, U, Q> const& v) { this->x ^= v.x; this->y ^= v.y; @@ -421,9 +421,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator<<=(U scalar) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator<<=(U scalar) { this->x <<= scalar; this->y <<= scalar; @@ -431,9 +431,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator<<=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator<<=(vec<1, U, Q> const& v) { this->x <<= static_cast(v.x); this->y <<= static_cast(v.x); @@ -441,9 +441,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator<<=(vec<3, U, P> const& v) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator<<=(vec<3, U, Q> const& v) { this->x <<= static_cast(v.x); this->y <<= static_cast(v.y); @@ -451,9 +451,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator>>=(U scalar) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator>>=(U scalar) { this->x >>= static_cast(scalar); this->y >>= static_cast(scalar); @@ -461,9 +461,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator>>=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator>>=(vec<1, U, Q> const& v) { this->x >>= static_cast(v.x); this->y >>= static_cast(v.x); @@ -471,9 +471,9 @@ namespace glm return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator>>=(vec<3, U, P> const& v) + GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator>>=(vec<3, U, Q> const& v) { this->x >>= static_cast(v.x); this->y >>= static_cast(v.y); @@ -483,16 +483,16 @@ namespace glm // -- Unary arithmetic operators -- - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator+(vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator+(vec<3, T, Q> const& v) { return v; } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator-(vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator-(vec<3, T, Q> const& v) { - return vec<3, T, P>( + return vec<3, T, Q>( -v.x, -v.y, -v.z); @@ -500,181 +500,181 @@ namespace glm // -- Binary arithmetic operators -- - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator+(vec<3, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator+(vec<3, T, Q> const& v, T scalar) { - return vec<3, T, P>( + return vec<3, T, Q>( v.x + scalar, v.y + scalar, v.z + scalar); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator+(vec<3, T, P> const& v, vec<1, T, P> const& scalar) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator+(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) { - return vec<3, T, P>( + return vec<3, T, Q>( v.x + scalar.x, v.y + scalar.x, v.z + scalar.x); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator+(T scalar, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator+(T scalar, vec<3, T, Q> const& v) { - return vec<3, T, P>( + return vec<3, T, Q>( scalar + v.x, scalar + v.y, scalar + v.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator+(vec<1, T, P> const& scalar, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator+(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) { - return vec<3, T, P>( + return vec<3, T, Q>( scalar.x + v.x, scalar.x + v.y, scalar.x + v.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator+(vec<3, T, P> const& v1, vec<3, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator+(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { - return vec<3, T, P>( + return vec<3, T, Q>( v1.x + v2.x, v1.y + v2.y, v1.z + v2.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator-(vec<3, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator-(vec<3, T, Q> const& v, T scalar) { - return vec<3, T, P>( + return vec<3, T, Q>( v.x - scalar, v.y - scalar, v.z - scalar); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator-(vec<3, T, P> const& v, vec<1, T, P> const& scalar) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator-(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) { - return vec<3, T, P>( + return vec<3, T, Q>( v.x - scalar.x, v.y - scalar.x, v.z - scalar.x); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator-(T scalar, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator-(T scalar, vec<3, T, Q> const& v) { - return vec<3, T, P>( + return vec<3, T, Q>( scalar - v.x, scalar - v.y, scalar - v.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator-(vec<1, T, P> const& scalar, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator-(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) { - return vec<3, T, P>( + return vec<3, T, Q>( scalar.x - v.x, scalar.x - v.y, scalar.x - v.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator-(vec<3, T, P> const& v1, vec<3, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { - return vec<3, T, P>( + return vec<3, T, Q>( v1.x - v2.x, v1.y - v2.y, v1.z - v2.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator*(vec<3, T, Q> const& v, T scalar) { - return vec<3, T, P>( + return vec<3, T, Q>( v.x * scalar, v.y * scalar, v.z * scalar); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const& v, vec<1, T, P> const& scalar) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator*(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) { - return vec<3, T, P>( + return vec<3, T, Q>( v.x * scalar.x, v.y * scalar.x, v.z * scalar.x); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator*(T scalar, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator*(T scalar, vec<3, T, Q> const& v) { - return vec<3, T, P>( + return vec<3, T, Q>( scalar * v.x, scalar * v.y, scalar * v.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<1, T, P> const& scalar, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator*(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) { - return vec<3, T, P>( + return vec<3, T, Q>( scalar.x * v.x, scalar.x * v.y, scalar.x * v.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const& v1, vec<3, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { - return vec<3, T, P>( + return vec<3, T, Q>( v1.x * v2.x, v1.y * v2.y, v1.z * v2.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator/(vec<3, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator/(vec<3, T, Q> const& v, T scalar) { - return vec<3, T, P>( + return vec<3, T, Q>( v.x / scalar, v.y / scalar, v.z / scalar); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator/(vec<3, T, P> const& v, vec<1, T, P> const& scalar) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator/(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) { - return vec<3, T, P>( + return vec<3, T, Q>( v.x / scalar.x, v.y / scalar.x, v.z / scalar.x); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator/(T scalar, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator/(T scalar, vec<3, T, Q> const& v) { - return vec<3, T, P>( + return vec<3, T, Q>( scalar / v.x, scalar / v.y, scalar / v.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator/(vec<1, T, P> const& scalar, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator/(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) { - return vec<3, T, P>( + return vec<3, T, Q>( scalar.x / v.x, scalar.x / v.y, scalar.x / v.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator/(vec<3, T, P> const& v1, vec<3, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { - return vec<3, T, P>( + return vec<3, T, Q>( v1.x / v2.x, v1.y / v2.y, v1.z / v2.z); @@ -682,280 +682,280 @@ namespace glm // -- Binary bit operators -- - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator%(vec<3, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator%(vec<3, T, Q> const& v, T scalar) { - return vec<3, T, P>( + return vec<3, T, Q>( v.x % scalar, v.y % scalar, v.z % scalar); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator%(vec<3, T, P> const& v, vec<1, T, P> const& scalar) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator%(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) { - return vec<3, T, P>( + return vec<3, T, Q>( v.x % scalar.x, v.y % scalar.x, v.z % scalar.x); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator%(T scalar, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator%(T scalar, vec<3, T, Q> const& v) { - return vec<3, T, P>( + return vec<3, T, Q>( scalar % v.x, scalar % v.y, scalar % v.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator%(vec<1, T, P> const& scalar, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator%(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) { - return vec<3, T, P>( + return vec<3, T, Q>( scalar.x % v.x, scalar.x % v.y, scalar.x % v.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator%(vec<3, T, P> const& v1, vec<3, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { - return vec<3, T, P>( + return vec<3, T, Q>( v1.x % v2.x, v1.y % v2.y, v1.z % v2.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator&(vec<3, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator&(vec<3, T, Q> const& v, T scalar) { - return vec<3, T, P>( + return vec<3, T, Q>( v.x & scalar, v.y & scalar, v.z & scalar); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator&(vec<3, T, P> const& v, vec<1, T, P> const& scalar) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator&(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) { - return vec<3, T, P>( + return vec<3, T, Q>( v.x & scalar.x, v.y & scalar.x, v.z & scalar.x); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator&(T scalar, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator&(T scalar, vec<3, T, Q> const& v) { - return vec<3, T, P>( + return vec<3, T, Q>( scalar & v.x, scalar & v.y, scalar & v.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator&(vec<1, T, P> const& scalar, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator&(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) { - return vec<3, T, P>( + return vec<3, T, Q>( scalar.x & v.x, scalar.x & v.y, scalar.x & v.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator&(vec<3, T, P> const& v1, vec<3, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { - return vec<3, T, P>( + return vec<3, T, Q>( v1.x & v2.x, v1.y & v2.y, v1.z & v2.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator|(vec<3, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator|(vec<3, T, Q> const& v, T scalar) { - return vec<3, T, P>( + return vec<3, T, Q>( v.x | scalar, v.y | scalar, v.z | scalar); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator|(vec<3, T, P> const& v, vec<1, T, P> const& scalar) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator|(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) { - return vec<3, T, P>( + return vec<3, T, Q>( v.x | scalar.x, v.y | scalar.x, v.z | scalar.x); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator|(T scalar, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator|(T scalar, vec<3, T, Q> const& v) { - return vec<3, T, P>( + return vec<3, T, Q>( scalar | v.x, scalar | v.y, scalar | v.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator|(vec<1, T, P> const& scalar, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator|(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) { - return vec<3, T, P>( + return vec<3, T, Q>( scalar.x | v.x, scalar.x | v.y, scalar.x | v.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator|(vec<3, T, P> const& v1, vec<3, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { - return vec<3, T, P>( + return vec<3, T, Q>( v1.x | v2.x, v1.y | v2.y, v1.z | v2.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator^(vec<3, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator^(vec<3, T, Q> const& v, T scalar) { - return vec<3, T, P>( + return vec<3, T, Q>( v.x ^ scalar, v.y ^ scalar, v.z ^ scalar); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator^(vec<3, T, P> const& v, vec<1, T, P> const& scalar) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator^(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) { - return vec<3, T, P>( + return vec<3, T, Q>( v.x ^ scalar.x, v.y ^ scalar.x, v.z ^ scalar.x); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator^(T scalar, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator^(T scalar, vec<3, T, Q> const& v) { - return vec<3, T, P>( + return vec<3, T, Q>( scalar ^ v.x, scalar ^ v.y, scalar ^ v.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator^(vec<1, T, P> const& scalar, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator^(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) { - return vec<3, T, P>( + return vec<3, T, Q>( scalar.x ^ v.x, scalar.x ^ v.y, scalar.x ^ v.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator^(vec<3, T, P> const& v1, vec<3, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { - return vec<3, T, P>( + return vec<3, T, Q>( v1.x ^ v2.x, v1.y ^ v2.y, v1.z ^ v2.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator<<(vec<3, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator<<(vec<3, T, Q> const& v, T scalar) { - return vec<3, T, P>( + return vec<3, T, Q>( v.x << scalar, v.y << scalar, v.z << scalar); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator<<(vec<3, T, P> const& v, vec<1, T, P> const& scalar) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator<<(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) { - return vec<3, T, P>( + return vec<3, T, Q>( v.x << scalar.x, v.y << scalar.x, v.z << scalar.x); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator<<(T scalar, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator<<(T scalar, vec<3, T, Q> const& v) { - return vec<3, T, P>( + return vec<3, T, Q>( scalar << v.x, scalar << v.y, scalar << v.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator<<(vec<1, T, P> const& scalar, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator<<(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) { - return vec<3, T, P>( + return vec<3, T, Q>( scalar.x << v.x, scalar.x << v.y, scalar.x << v.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator<<(vec<3, T, P> const& v1, vec<3, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { - return vec<3, T, P>( + return vec<3, T, Q>( v1.x << v2.x, v1.y << v2.y, v1.z << v2.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator>>(vec<3, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator>>(vec<3, T, Q> const& v, T scalar) { - return vec<3, T, P>( + return vec<3, T, Q>( v.x >> scalar, v.y >> scalar, v.z >> scalar); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator>>(vec<3, T, P> const& v, vec<1, T, P> const& scalar) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator>>(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) { - return vec<3, T, P>( + return vec<3, T, Q>( v.x >> scalar.x, v.y >> scalar.x, v.z >> scalar.x); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator>>(T scalar, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator>>(T scalar, vec<3, T, Q> const& v) { - return vec<3, T, P>( + return vec<3, T, Q>( scalar >> v.x, scalar >> v.y, scalar >> v.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator>>(vec<1, T, P> const& scalar, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator>>(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) { - return vec<3, T, P>( + return vec<3, T, Q>( scalar.x >> v.x, scalar.x >> v.y, scalar.x >> v.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator>>(vec<3, T, P> const& v1, vec<3, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { - return vec<3, T, P>( + return vec<3, T, Q>( v1.x >> v2.x, v1.y >> v2.y, v1.z >> v2.z); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator~(vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator~(vec<3, T, Q> const& v) { - return vec<3, T, P>( + return vec<3, T, Q>( ~v.x, ~v.y, ~v.z); @@ -963,8 +963,8 @@ namespace glm // -- Boolean operators -- - template - GLM_FUNC_QUALIFIER bool operator==(vec<3, T, P> const& v1, vec<3, T, P> const& v2) + template + GLM_FUNC_QUALIFIER bool operator==(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { return detail::compute_equal::call(v1.x, v2.x) && @@ -972,21 +972,21 @@ namespace glm detail::compute_equal::call(v1.z, v2.z); } - template - GLM_FUNC_QUALIFIER bool operator!=(vec<3, T, P> const& v1, vec<3, T, P> const& v2) + template + GLM_FUNC_QUALIFIER bool operator!=(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { return !(v1 == v2); } - template - GLM_FUNC_QUALIFIER vec<3, bool, P> operator&&(vec<3, bool, P> const& v1, vec<3, bool, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<3, bool, Q> operator&&(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2) { - return vec<3, bool, P>(v1.x && v2.x, v1.y && v2.y, v1.z && v2.z); + return vec<3, bool, Q>(v1.x && v2.x, v1.y && v2.y, v1.z && v2.z); } - template - GLM_FUNC_QUALIFIER vec<3, bool, P> operator||(vec<3, bool, P> const& v1, vec<3, bool, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<3, bool, Q> operator||(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2) { - return vec<3, bool, P>(v1.x || v2.x, v1.y || v2.y, v1.z || v2.z); + return vec<3, bool, Q>(v1.x || v2.x, v1.y || v2.y, v1.z || v2.z); } }//namespace glm diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index f81ce3d3..4bb74bd6 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -15,14 +15,14 @@ namespace glm { - template - struct vec<4, T, P> + template + struct vec<4, T, Q> { // -- Implementation detail -- typedef T value_type; - typedef vec<4, T, P> type; - typedef vec<4, bool, P> bool_type; + typedef vec<4, T, Q> type; + typedef vec<4, bool, Q> bool_type; // -- Data -- @@ -90,7 +90,7 @@ namespace glm // -- Implicit basic constructors -- GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec() GLM_DEFAULT; - GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(vec<4, T, P> const& v) GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(vec<4, T, Q> const& v) GLM_DEFAULT; template GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(vec<4, T, Q> const& v); @@ -105,7 +105,7 @@ namespace glm template GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(X _x, Y _y, Z _z, W _w); template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, X, P> const& _x, vec<1, Y, P> const& _Y, vec<1, Z, P> const& _z, vec<1, W, P> const& _w); + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _Y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w); // -- Conversion vector constructors -- @@ -150,302 +150,302 @@ namespace glm // -- Swizzle constructors -- # if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED) template - GLM_FUNC_DECL vec(detail::_swizzle<4, T, P, E0, E1, E2, E3> const& that) + GLM_FUNC_DECL vec(detail::_swizzle<4, T, Q, E0, E1, E2, E3> const& that) { *this = that(); } template - GLM_FUNC_DECL vec(detail::_swizzle<2, T, P, E0, E1, -1, -2> const& v, detail::_swizzle<2, T, P, F0, F1, -1, -2> const& u) + GLM_FUNC_DECL vec(detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, detail::_swizzle<2, T, Q, F0, F1, -1, -2> const& u) { - *this = vec<4, T, P>(v(), u()); + *this = vec<4, T, Q>(v(), u()); } template - GLM_FUNC_DECL vec(T const& x, T const& y, detail::_swizzle<2, T, P, E0, E1, -1, -2> const& v) + GLM_FUNC_DECL vec(T const& x, T const& y, detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v) { - *this = vec<4, T, P>(x, y, v()); + *this = vec<4, T, Q>(x, y, v()); } template - GLM_FUNC_DECL vec(T const& x, detail::_swizzle<2, T, P, E0, E1, -1, -2> const& v, T const& w) + GLM_FUNC_DECL vec(T const& x, detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, T const& w) { - *this = vec<4, T, P>(x, v(), w); + *this = vec<4, T, Q>(x, v(), w); } template - GLM_FUNC_DECL vec(detail::_swizzle<2, T, P, E0, E1, -1, -2> const& v, T const& z, T const& w) + GLM_FUNC_DECL vec(detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, T const& z, T const& w) { - *this = vec<4, T, P>(v(), z, w); + *this = vec<4, T, Q>(v(), z, w); } template - GLM_FUNC_DECL vec(detail::_swizzle<3, T, P, E0, E1, E2, -1> const& v, T const& w) + GLM_FUNC_DECL vec(detail::_swizzle<3, T, Q, E0, E1, E2, -1> const& v, T const& w) { - *this = vec<4, T, P>(v(), w); + *this = vec<4, T, Q>(v(), w); } template - GLM_FUNC_DECL vec(T const& x, detail::_swizzle<3, T, P, E0, E1, E2, -1> const& v) + GLM_FUNC_DECL vec(T const& x, detail::_swizzle<3, T, Q, E0, E1, E2, -1> const& v) { - *this = vec<4, T, P>(x, v()); + *this = vec<4, T, Q>(x, v()); } # endif// GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED) // -- Unary arithmetic operators -- - GLM_FUNC_DECL vec<4, T, P>& operator=(vec<4, T, P> const& v) GLM_DEFAULT; + GLM_FUNC_DECL vec<4, T, Q>& operator=(vec<4, T, Q> const& v) GLM_DEFAULT; template - GLM_FUNC_DECL vec<4, T, P>& operator=(vec<4, U, P> const& v); + GLM_FUNC_DECL vec<4, T, Q>& operator=(vec<4, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, P>& operator+=(U scalar); + GLM_FUNC_DECL vec<4, T, Q>& operator+=(U scalar); template - GLM_FUNC_DECL vec<4, T, P>& operator+=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec<4, T, Q>& operator+=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, P>& operator+=(vec<4, U, P> const& v); + GLM_FUNC_DECL vec<4, T, Q>& operator+=(vec<4, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, P>& operator-=(U scalar); + GLM_FUNC_DECL vec<4, T, Q>& operator-=(U scalar); template - GLM_FUNC_DECL vec<4, T, P>& operator-=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec<4, T, Q>& operator-=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, P>& operator-=(vec<4, U, P> const& v); + GLM_FUNC_DECL vec<4, T, Q>& operator-=(vec<4, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, P>& operator*=(U scalar); + GLM_FUNC_DECL vec<4, T, Q>& operator*=(U scalar); template - GLM_FUNC_DECL vec<4, T, P>& operator*=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec<4, T, Q>& operator*=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, P>& operator*=(vec<4, U, P> const& v); + GLM_FUNC_DECL vec<4, T, Q>& operator*=(vec<4, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, P>& operator/=(U scalar); + GLM_FUNC_DECL vec<4, T, Q>& operator/=(U scalar); template - GLM_FUNC_DECL vec<4, T, P>& operator/=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec<4, T, Q>& operator/=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, P>& operator/=(vec<4, U, P> const& v); + GLM_FUNC_DECL vec<4, T, Q>& operator/=(vec<4, U, Q> const& v); // -- Increment and decrement operators -- - GLM_FUNC_DECL vec<4, T, P> & operator++(); - GLM_FUNC_DECL vec<4, T, P> & operator--(); - GLM_FUNC_DECL vec<4, T, P> operator++(int); - GLM_FUNC_DECL vec<4, T, P> operator--(int); + GLM_FUNC_DECL vec<4, T, Q> & operator++(); + GLM_FUNC_DECL vec<4, T, Q> & operator--(); + GLM_FUNC_DECL vec<4, T, Q> operator++(int); + GLM_FUNC_DECL vec<4, T, Q> operator--(int); // -- Unary bit operators -- template - GLM_FUNC_DECL vec<4, T, P> & operator%=(U scalar); + GLM_FUNC_DECL vec<4, T, Q> & operator%=(U scalar); template - GLM_FUNC_DECL vec<4, T, P> & operator%=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec<4, T, Q> & operator%=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, P> & operator%=(vec<4, U, P> const& v); + GLM_FUNC_DECL vec<4, T, Q> & operator%=(vec<4, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, P> & operator&=(U scalar); + GLM_FUNC_DECL vec<4, T, Q> & operator&=(U scalar); template - GLM_FUNC_DECL vec<4, T, P> & operator&=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec<4, T, Q> & operator&=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, P> & operator&=(vec<4, U, P> const& v); + GLM_FUNC_DECL vec<4, T, Q> & operator&=(vec<4, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, P> & operator|=(U scalar); + GLM_FUNC_DECL vec<4, T, Q> & operator|=(U scalar); template - GLM_FUNC_DECL vec<4, T, P> & operator|=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec<4, T, Q> & operator|=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, P> & operator|=(vec<4, U, P> const& v); + GLM_FUNC_DECL vec<4, T, Q> & operator|=(vec<4, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, P> & operator^=(U scalar); + GLM_FUNC_DECL vec<4, T, Q> & operator^=(U scalar); template - GLM_FUNC_DECL vec<4, T, P> & operator^=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec<4, T, Q> & operator^=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, P> & operator^=(vec<4, U, P> const& v); + GLM_FUNC_DECL vec<4, T, Q> & operator^=(vec<4, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, P> & operator<<=(U scalar); + GLM_FUNC_DECL vec<4, T, Q> & operator<<=(U scalar); template - GLM_FUNC_DECL vec<4, T, P> & operator<<=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec<4, T, Q> & operator<<=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, P> & operator<<=(vec<4, U, P> const& v); + GLM_FUNC_DECL vec<4, T, Q> & operator<<=(vec<4, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, P> & operator>>=(U scalar); + GLM_FUNC_DECL vec<4, T, Q> & operator>>=(U scalar); template - GLM_FUNC_DECL vec<4, T, P> & operator>>=(vec<1, U, P> const& v); + GLM_FUNC_DECL vec<4, T, Q> & operator>>=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, P> & operator>>=(vec<4, U, P> const& v); + GLM_FUNC_DECL vec<4, T, Q> & operator>>=(vec<4, U, Q> const& v); }; // -- Unary operators -- - template - GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const& v); + template + GLM_FUNC_DECL vec<4, T, Q> operator+(vec<4, T, Q> const& v); - template - GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const& v); + template + GLM_FUNC_DECL vec<4, T, Q> operator-(vec<4, T, Q> const& v); // -- Binary operators -- - template - GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<4, T, Q> operator+(vec<4, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<4, T, P> operator+(T scalar, vec<4, T, P> const& v); + template + GLM_FUNC_DECL vec<4, T, Q> operator+(T scalar, vec<4, T, Q> const& v); - template - GLM_FUNC_DECL vec<4, T, P> operator+(vec<1, T, P> const& v1, vec<4, T, P> const& v2); + template + GLM_FUNC_DECL vec<4, T, Q> operator+(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); - template - GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const& v1, vec<4, T, P> const& v2); + template + GLM_FUNC_DECL vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); - template - GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<4, T, Q> operator-(vec<4, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<4, T, P> operator-(T scalar, vec<4, T, P> const& v); + template + GLM_FUNC_DECL vec<4, T, Q> operator-(T scalar, vec<4, T, Q> const& v); - template - GLM_FUNC_DECL vec<4, T, P> operator-(vec<1, T, P> const& v1, vec<4, T, P> const& v2); + template + GLM_FUNC_DECL vec<4, T, Q> operator-(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); - template - GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const& v1, vec<4, T, P> const& v2); + template + GLM_FUNC_DECL vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); - template - GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<4, T, Q> operator*(vec<4, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<4, T, P> operator*(T scalar, vec<4, T, P> const& v); + template + GLM_FUNC_DECL vec<4, T, Q> operator*(T scalar, vec<4, T, Q> const& v); - template - GLM_FUNC_DECL vec<4, T, P> operator*(vec<1, T, P> const& v1, vec<4, T, P> const& v2); + template + GLM_FUNC_DECL vec<4, T, Q> operator*(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); - template - GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const& v1, vec<4, T, P> const& v2); + template + GLM_FUNC_DECL vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); - template - GLM_FUNC_DECL vec<4, T, P> operator/(vec<4, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<4, T, Q> operator/(vec<4, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<4, T, P> operator/(vec<4, T, P> const& v1, vec<1, T, P> const& v2); + template + GLM_FUNC_DECL vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); - template - GLM_FUNC_DECL vec<4, T, P> operator/(T scalar, vec<4, T, P> const& v); + template + GLM_FUNC_DECL vec<4, T, Q> operator/(T scalar, vec<4, T, Q> const& v); - template - GLM_FUNC_DECL vec<4, T, P> operator/(vec<1, T, P> const& v1, vec<4, T, P> const& v2); + template + GLM_FUNC_DECL vec<4, T, Q> operator/(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); - template - GLM_FUNC_DECL vec<4, T, P> operator/(vec<4, T, P> const& v1, vec<4, T, P> const& v2); + template + GLM_FUNC_DECL vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); - template - GLM_FUNC_DECL vec<4, T, P> operator%(vec<4, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<4, T, Q> operator%(vec<4, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<4, T, P> operator%(vec<4, T, P> const& v, vec<1, T, P> const& scalar); + template + GLM_FUNC_DECL vec<4, T, Q> operator%(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); - template - GLM_FUNC_DECL vec<4, T, P> operator%(T scalar, vec<4, T, P> const& v); + template + GLM_FUNC_DECL vec<4, T, Q> operator%(T scalar, vec<4, T, Q> const& v); - template - GLM_FUNC_DECL vec<4, T, P> operator%(vec<1, T, P> const& scalar, vec<4, T, P> const& v); + template + GLM_FUNC_DECL vec<4, T, Q> operator%(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); - template - GLM_FUNC_DECL vec<4, T, P> operator%(vec<4, T, P> const& v1, vec<4, T, P> const& v2); + template + GLM_FUNC_DECL vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); - template - GLM_FUNC_DECL vec<4, T, P> operator&(vec<4, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<4, T, Q> operator&(vec<4, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<4, T, P> operator&(vec<4, T, P> const& v, vec<1, T, P> const& scalar); + template + GLM_FUNC_DECL vec<4, T, Q> operator&(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); - template - GLM_FUNC_DECL vec<4, T, P> operator&(T scalar, vec<4, T, P> const& v); + template + GLM_FUNC_DECL vec<4, T, Q> operator&(T scalar, vec<4, T, Q> const& v); - template - GLM_FUNC_DECL vec<4, T, P> operator&(vec<1, T, P> const& scalar, vec<4, T, P> const& v); + template + GLM_FUNC_DECL vec<4, T, Q> operator&(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); - template - GLM_FUNC_DECL vec<4, T, P> operator&(vec<4, T, P> const& v1, vec<4, T, P> const& v2); + template + GLM_FUNC_DECL vec<4, T, Q> operator&(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); - template - GLM_FUNC_DECL vec<4, T, P> operator|(vec<4, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<4, T, Q> operator|(vec<4, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<4, T, P> operator|(vec<4, T, P> const& v, vec<1, T, P> const& scalar); + template + GLM_FUNC_DECL vec<4, T, Q> operator|(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); - template - GLM_FUNC_DECL vec<4, T, P> operator|(T scalar, vec<4, T, P> const& v); + template + GLM_FUNC_DECL vec<4, T, Q> operator|(T scalar, vec<4, T, Q> const& v); - template - GLM_FUNC_DECL vec<4, T, P> operator|(vec<1, T, P> const& scalar, vec<4, T, P> const& v); + template + GLM_FUNC_DECL vec<4, T, Q> operator|(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); - template - GLM_FUNC_DECL vec<4, T, P> operator|(vec<4, T, P> const& v1, vec<4, T, P> const& v2); + template + GLM_FUNC_DECL vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); - template - GLM_FUNC_DECL vec<4, T, P> operator^(vec<4, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<4, T, Q> operator^(vec<4, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<4, T, P> operator^(vec<4, T, P> const& v, vec<1, T, P> const& scalar); + template + GLM_FUNC_DECL vec<4, T, Q> operator^(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); - template - GLM_FUNC_DECL vec<4, T, P> operator^(T scalar, vec<4, T, P> const& v); + template + GLM_FUNC_DECL vec<4, T, Q> operator^(T scalar, vec<4, T, Q> const& v); - template - GLM_FUNC_DECL vec<4, T, P> operator^(vec<1, T, P> const& scalar, vec<4, T, P> const& v); + template + GLM_FUNC_DECL vec<4, T, Q> operator^(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); - template - GLM_FUNC_DECL vec<4, T, P> operator^(vec<4, T, P> const& v1, vec<4, T, P> const& v2); + template + GLM_FUNC_DECL vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); - template - GLM_FUNC_DECL vec<4, T, P> operator<<(vec<4, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<4, T, Q> operator<<(vec<4, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<4, T, P> operator<<(vec<4, T, P> const& v, vec<1, T, P> const& scalar); + template + GLM_FUNC_DECL vec<4, T, Q> operator<<(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); - template - GLM_FUNC_DECL vec<4, T, P> operator<<(T scalar, vec<4, T, P> const& v); + template + GLM_FUNC_DECL vec<4, T, Q> operator<<(T scalar, vec<4, T, Q> const& v); - template - GLM_FUNC_DECL vec<4, T, P> operator<<(vec<1, T, P> const& scalar, vec<4, T, P> const& v); + template + GLM_FUNC_DECL vec<4, T, Q> operator<<(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); - template - GLM_FUNC_DECL vec<4, T, P> operator<<(vec<4, T, P> const& v1, vec<4, T, P> const& v2); + template + GLM_FUNC_DECL vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); - template - GLM_FUNC_DECL vec<4, T, P> operator>>(vec<4, T, P> const& v, T scalar); + template + GLM_FUNC_DECL vec<4, T, Q> operator>>(vec<4, T, Q> const& v, T scalar); - template - GLM_FUNC_DECL vec<4, T, P> operator>>(vec<4, T, P> const& v, vec<1, T, P> const& scalar); + template + GLM_FUNC_DECL vec<4, T, Q> operator>>(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); - template - GLM_FUNC_DECL vec<4, T, P> operator>>(T scalar, vec<4, T, P> const& v); + template + GLM_FUNC_DECL vec<4, T, Q> operator>>(T scalar, vec<4, T, Q> const& v); - template - GLM_FUNC_DECL vec<4, T, P> operator>>(vec<1, T, P> const& scalar, vec<4, T, P> const& v); + template + GLM_FUNC_DECL vec<4, T, Q> operator>>(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); - template - GLM_FUNC_DECL vec<4, T, P> operator>>(vec<4, T, P> const& v1, vec<4, T, P> const& v2); + template + GLM_FUNC_DECL vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); - template - GLM_FUNC_DECL vec<4, T, P> operator~(vec<4, T, P> const& v); + template + GLM_FUNC_DECL vec<4, T, Q> operator~(vec<4, T, Q> const& v); // -- Boolean operators -- - template - GLM_FUNC_DECL bool operator==(vec<4, T, P> const& v1, vec<4, T, P> const& v2); + template + GLM_FUNC_DECL bool operator==(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); - template - GLM_FUNC_DECL bool operator!=(vec<4, T, P> const& v1, vec<4, T, P> const& v2); + template + GLM_FUNC_DECL bool operator!=(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); - template - GLM_FUNC_DECL vec<4, bool, P> operator&&(vec<4, bool, P> const& v1, vec<4, bool, P> const& v2); + template + GLM_FUNC_DECL vec<4, bool, Q> operator&&(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2); - template - GLM_FUNC_DECL vec<4, bool, P> operator||(vec<4, bool, P> const& v1, vec<4, bool, P> const& v2); + template + GLM_FUNC_DECL vec<4, bool, Q> operator||(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index 8ab775a8..2bad9aee 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -34,100 +34,100 @@ namespace detail enum test {value = ~0}; }; - template + template struct compute_vec4_add { - GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) + GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) { - return vec<4, T, P>(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); + return vec<4, T, Q>(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); } }; - template + template struct compute_vec4_sub { - GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) + GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) { - return vec<4, T, P>(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w); + return vec<4, T, Q>(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w); } }; - template + template struct compute_vec4_mul { - GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) + GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) { - return vec<4, T, P>(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w); + return vec<4, T, Q>(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w); } }; - template + template struct compute_vec4_div { - GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) + GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) { - return vec<4, T, P>(a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w); + return vec<4, T, Q>(a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w); } }; - template + template struct compute_vec4_mod { - GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) + GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) { - return vec<4, T, P>(a.x % b.x, a.y % b.y, a.z % b.z, a.w % b.w); + return vec<4, T, Q>(a.x % b.x, a.y % b.y, a.z % b.z, a.w % b.w); } }; - template + template struct compute_vec4_and { - GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) + GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) { - return vec<4, T, P>(a.x & b.x, a.y & b.y, a.z & b.z, a.w & b.w); + return vec<4, T, Q>(a.x & b.x, a.y & b.y, a.z & b.z, a.w & b.w); } }; - template + template struct compute_vec4_or { - GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) + GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) { - return vec<4, T, P>(a.x | b.x, a.y | b.y, a.z | b.z, a.w | b.w); + return vec<4, T, Q>(a.x | b.x, a.y | b.y, a.z | b.z, a.w | b.w); } }; - template + template struct compute_vec4_xor { - GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) + GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) { - return vec<4, T, P>(a.x ^ b.x, a.y ^ b.y, a.z ^ b.z, a.w ^ b.w); + return vec<4, T, Q>(a.x ^ b.x, a.y ^ b.y, a.z ^ b.z, a.w ^ b.w); } }; - template + template struct compute_vec4_shift_left { - GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) + GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) { - return vec<4, T, P>(a.x << b.x, a.y << b.y, a.z << b.z, a.w << b.w); + return vec<4, T, Q>(a.x << b.x, a.y << b.y, a.z << b.z, a.w << b.w); } }; - template + template struct compute_vec4_shift_right { - GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) + GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) { - return vec<4, T, P>(a.x >> b.x, a.y >> b.y, a.z >> b.z, a.w >> b.w); + return vec<4, T, Q>(a.x >> b.x, a.y >> b.y, a.z >> b.z, a.w >> b.w); } }; - template + template struct compute_vec4_equal { - GLM_FUNC_QUALIFIER static bool call(vec<4, T, P> const& v1, vec<4, T, P> const& v2) + GLM_FUNC_QUALIFIER static bool call(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { return detail::compute_equal::call(v1.x, v2.x) && @@ -137,21 +137,21 @@ namespace detail } }; - template + template struct compute_vec4_nequal { - GLM_FUNC_QUALIFIER static bool call(vec<4, T, P> const& v1, vec<4, T, P> const& v2) + GLM_FUNC_QUALIFIER static bool call(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { - return !compute_vec4_equal::value, sizeof(T) * 8, detail::is_aligned

::value>::call(v1, v2); + return !compute_vec4_equal::value, sizeof(T) * 8, detail::is_aligned::value>::call(v1, v2); } }; - template + template struct compute_vec4_bitwise_not { - GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& v) + GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& v) { - return vec<4, T, P>(~v.x, ~v.y, ~v.z, ~v.w); + return vec<4, T, Q>(~v.x, ~v.y, ~v.z, ~v.w); } }; }//namespace detail @@ -159,50 +159,50 @@ namespace detail // -- Implicit basic constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, P>::vec() + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, Q>::vec() {} # endif//!GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, P>::vec(vec<4, T, P> const& v) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, Q>::vec(vec<4, T, Q> const& v) : x(v.x), y(v.y), z(v.z), w(v.w) {} # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, P>::vec(vec<4, T, Q> const& v) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, Q>::vec(vec<4, T, P> const& v) : x(v.x), y(v.y), z(v.z), w(v.w) {} // -- Explicit basic constructors -- - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, P>::vec(T scalar) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, Q>::vec(T scalar) : x(scalar), y(scalar), z(scalar), w(scalar) {} - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, P>::vec(T _x, T _y, T _z, T _w) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, Q>::vec(T _x, T _y, T _z, T _w) : x(_x), y(_y), z(_z), w(_w) {} // -- Conversion scalar constructors -- - template + template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, P>::vec(X _x, Y _y, Z _z, W _w) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, Q>::vec(X _x, Y _y, Z _z, W _w) : x(static_cast(_x)) , y(static_cast(_y)) , z(static_cast(_z)) , w(static_cast(_w)) {} - template + template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, P>::vec(vec<1, X, P> const& _x, vec<1, Y, P> const& _y, vec<1, Z, P> const& _z, vec<1, W, P> const& _w) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w) : x(static_cast(_x.x)) , y(static_cast(_y.x)) , z(static_cast(_z.x)) @@ -211,125 +211,125 @@ namespace detail // -- Conversion vector constructors -- - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, P>::vec(vec<2, A, Q> const& _xy, B _z, C _w) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, Q>::vec(vec<2, A, P> const& _xy, B _z, C _w) : x(static_cast(_xy.x)) , y(static_cast(_xy.y)) , z(static_cast(_z)) , w(static_cast(_w)) {} - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, P>::vec(vec<2, A, Q> const& _xy, vec<1, B, Q> const& _z, vec<1, C, Q> const& _w) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, Q>::vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z, vec<1, C, P> const& _w) : x(static_cast(_xy.x)) , y(static_cast(_xy.y)) , z(static_cast(_z.x)) , w(static_cast(_w.x)) {} - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, P>::vec(A _x, vec<2, B, Q> const& _yz, C _w) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, Q>::vec(A _x, vec<2, B, P> const& _yz, C _w) : x(static_cast(_x)) , y(static_cast(_yz.x)) , z(static_cast(_yz.y)) , w(static_cast(_w)) {} - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, P>::vec(vec<1, A, Q> const& _x, vec<2, B, Q> const& _yz, vec<1, C, Q> const& _w) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, Q>::vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz, vec<1, C, P> const& _w) : x(static_cast(_x.x)) , y(static_cast(_yz.x)) , z(static_cast(_yz.y)) , w(static_cast(_w.x)) {} - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, P>::vec(A _x, B _y, vec<2, C, Q> const& _zw) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, Q>::vec(A _x, B _y, vec<2, C, P> const& _zw) : x(static_cast(_x)) , y(static_cast(_y)) , z(static_cast(_zw.x)) , w(static_cast(_zw.y)) {} - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, P>::vec(vec<1, A, Q> const& _x, vec<1, B, Q> const& _y, vec<2, C, Q> const& _zw) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, Q>::vec(vec<1, A, P> const& _x, vec<1, B, P> const& _y, vec<2, C, P> const& _zw) : x(static_cast(_x.x)) , y(static_cast(_y.x)) , z(static_cast(_zw.x)) , w(static_cast(_zw.y)) {} - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, P>::vec(vec<3, A, Q> const& _xyz, B _w) : - x(static_cast(_xyz.x)), - y(static_cast(_xyz.y)), - z(static_cast(_xyz.z)), - w(static_cast(_w)) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, Q>::vec(vec<3, A, P> const& _xyz, B _w) + : x(static_cast(_xyz.x)) + , y(static_cast(_xyz.y)) + , z(static_cast(_xyz.z)) + , w(static_cast(_w)) {} - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, P>::vec(vec<3, A, Q> const& _xyz, vec<1, B, Q> const& _w) : - x(static_cast(_xyz.x)), - y(static_cast(_xyz.y)), - z(static_cast(_xyz.z)), - w(static_cast(_w.x)) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, Q>::vec(vec<3, A, P> const& _xyz, vec<1, B, P> const& _w) + : x(static_cast(_xyz.x)) + , y(static_cast(_xyz.y)) + , z(static_cast(_xyz.z)) + , w(static_cast(_w.x)) {} - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, P>::vec(A _x, vec<3, B, Q> const& _yzw) : - x(static_cast(_x)), - y(static_cast(_yzw.x)), - z(static_cast(_yzw.y)), - w(static_cast(_yzw.z)) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, Q>::vec(A _x, vec<3, B, P> const& _yzw) + : x(static_cast(_x)) + , y(static_cast(_yzw.x)) + , z(static_cast(_yzw.y)) + , w(static_cast(_yzw.z)) {} - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, P>::vec(vec<1, A, Q> const& _x, vec<3, B, Q> const& _yzw) : - x(static_cast(_x.x)), - y(static_cast(_yzw.x)), - z(static_cast(_yzw.y)), - w(static_cast(_yzw.z)) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, Q>::vec(vec<1, A, P> const& _x, vec<3, B, P> const& _yzw) + : x(static_cast(_x.x)) + , y(static_cast(_yzw.x)) + , z(static_cast(_yzw.y)) + , w(static_cast(_yzw.z)) {} - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, P>::vec(vec<2, A, Q> const& _xy, vec<2, B, Q> const& _zw) : - x(static_cast(_xy.x)), - y(static_cast(_xy.y)), - z(static_cast(_zw.x)), - w(static_cast(_zw.y)) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, Q>::vec(vec<2, A, P> const& _xy, vec<2, B, P> const& _zw) + : x(static_cast(_xy.x)) + , y(static_cast(_xy.y)) + , z(static_cast(_zw.x)) + , w(static_cast(_zw.y)) {} - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, P>::vec(vec<4, U, Q> const& v) : - x(static_cast(v.x)), - y(static_cast(v.y)), - z(static_cast(v.z)), - w(static_cast(v.w)) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, Q>::vec(vec<4, U, P> const& v) + : x(static_cast(v.x)) + , y(static_cast(v.y)) + , z(static_cast(v.z)) + , w(static_cast(v.w)) {} // -- Component accesses -- - template - GLM_FUNC_QUALIFIER T& vec<4, T, P>::operator[](typename vec<4, T, P>::length_type i) + template + GLM_FUNC_QUALIFIER T& vec<4, T, Q>::operator[](typename vec<4, T, Q>::length_type i) { assert(i >= 0 && i < this->length()); return (&x)[i]; } - template - GLM_FUNC_QUALIFIER T const& vec<4, T, P>::operator[](typename vec<4, T, P>::length_type i) const + template + GLM_FUNC_QUALIFIER T const& vec<4, T, Q>::operator[](typename vec<4, T, Q>::length_type i) const { assert(i >= 0 && i < this->length()); return (&x)[i]; @@ -338,8 +338,8 @@ namespace detail // -- Unary arithmetic operators -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER vec<4, T, P>& vec<4, T, P>::operator=(vec<4, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<4, T, Q>& vec<4, T, Q>::operator=(vec<4, T, Q> const& v) { this->x = v.x; this->y = v.y; @@ -349,9 +349,9 @@ namespace detail } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P>& vec<4, T, P>::operator=(vec<4, U, P> const& v) + GLM_FUNC_QUALIFIER vec<4, T, Q>& vec<4, T, Q>::operator=(vec<4, U, Q> const& v) { this->x = static_cast(v.x); this->y = static_cast(v.y); @@ -360,94 +360,94 @@ namespace detail return *this; } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator+=(U scalar) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator+=(U scalar) { - return (*this = detail::compute_vec4_add::value>::call(*this, vec<4, T, P>(scalar))); + return (*this = detail::compute_vec4_add::value>::call(*this, vec<4, T, Q>(scalar))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator+=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator+=(vec<1, U, Q> const& v) { - return (*this = detail::compute_vec4_add::value>::call(*this, vec<4, T, P>(v.x))); + return (*this = detail::compute_vec4_add::value>::call(*this, vec<4, T, Q>(v.x))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator+=(vec<4, U, P> const& v) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator+=(vec<4, U, Q> const& v) { - return (*this = detail::compute_vec4_add::value>::call(*this, vec<4, T, P>(v))); + return (*this = detail::compute_vec4_add::value>::call(*this, vec<4, T, Q>(v))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator-=(U scalar) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator-=(U scalar) { - return (*this = detail::compute_vec4_sub::value>::call(*this, vec<4, T, P>(scalar))); + return (*this = detail::compute_vec4_sub::value>::call(*this, vec<4, T, Q>(scalar))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator-=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator-=(vec<1, U, Q> const& v) { - return (*this = detail::compute_vec4_sub::value>::call(*this, vec<4, T, P>(v.x))); + return (*this = detail::compute_vec4_sub::value>::call(*this, vec<4, T, Q>(v.x))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator-=(vec<4, U, P> const& v) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator-=(vec<4, U, Q> const& v) { - return (*this = detail::compute_vec4_sub::value>::call(*this, vec<4, T, P>(v))); + return (*this = detail::compute_vec4_sub::value>::call(*this, vec<4, T, Q>(v))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator*=(U scalar) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator*=(U scalar) { - return (*this = detail::compute_vec4_mul::value>::call(*this, vec<4, T, P>(scalar))); + return (*this = detail::compute_vec4_mul::value>::call(*this, vec<4, T, Q>(scalar))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator*=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator*=(vec<1, U, Q> const& v) { - return (*this = detail::compute_vec4_mul::value>::call(*this, vec<4, T, P>(v.x))); + return (*this = detail::compute_vec4_mul::value>::call(*this, vec<4, T, Q>(v.x))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator*=(vec<4, U, P> const& v) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator*=(vec<4, U, Q> const& v) { - return (*this = detail::compute_vec4_mul::value>::call(*this, vec<4, T, P>(v))); + return (*this = detail::compute_vec4_mul::value>::call(*this, vec<4, T, Q>(v))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator/=(U scalar) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator/=(U scalar) { - return (*this = detail::compute_vec4_div::value>::call(*this, vec<4, T, P>(scalar))); + return (*this = detail::compute_vec4_div::value>::call(*this, vec<4, T, Q>(scalar))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator/=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator/=(vec<1, U, Q> const& v) { - return (*this = detail::compute_vec4_div::value>::call(*this, vec<4, T, P>(v.x))); + return (*this = detail::compute_vec4_div::value>::call(*this, vec<4, T, Q>(v.x))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator/=(vec<4, U, P> const& v) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator/=(vec<4, U, Q> const& v) { - return (*this = detail::compute_vec4_div::value>::call(*this, vec<4, T, P>(v))); + return (*this = detail::compute_vec4_div::value>::call(*this, vec<4, T, Q>(v))); } // -- Increment and decrement operators -- - template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator++() + template + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator++() { ++this->x; ++this->y; @@ -456,8 +456,8 @@ namespace detail return *this; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator--() + template + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator--() { --this->x; --this->y; @@ -466,498 +466,498 @@ namespace detail return *this; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> vec<4, T, P>::operator++(int) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> vec<4, T, Q>::operator++(int) { - vec<4, T, P> Result(*this); + vec<4, T, Q> Result(*this); ++*this; return Result; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> vec<4, T, P>::operator--(int) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> vec<4, T, Q>::operator--(int) { - vec<4, T, P> Result(*this); + vec<4, T, Q> Result(*this); --*this; return Result; } // -- Unary bit operators -- - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator%=(U scalar) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator%=(U scalar) { - return (*this = detail::compute_vec4_mod::value>::call(*this, vec<4, T, P>(scalar))); + return (*this = detail::compute_vec4_mod::value>::call(*this, vec<4, T, Q>(scalar))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator%=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator%=(vec<1, U, Q> const& v) { - return (*this = detail::compute_vec4_mod::value>::call(*this, vec<4, T, P>(v))); + return (*this = detail::compute_vec4_mod::value>::call(*this, vec<4, T, Q>(v))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator%=(vec<4, U, P> const& v) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator%=(vec<4, U, Q> const& v) { - return (*this = detail::compute_vec4_mod::value>::call(*this, vec<4, T, P>(v))); + return (*this = detail::compute_vec4_mod::value>::call(*this, vec<4, T, Q>(v))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator&=(U scalar) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator&=(U scalar) { - return (*this = detail::compute_vec4_and::value, sizeof(T) * 8, detail::is_aligned

::value>::call(*this, vec<4, T, P>(scalar))); + return (*this = detail::compute_vec4_and::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator&=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator&=(vec<1, U, Q> const& v) { - return (*this = detail::compute_vec4_and::value, sizeof(T) * 8, detail::is_aligned

::value>::call(*this, vec<4, T, P>(v))); + return (*this = detail::compute_vec4_and::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator&=(vec<4, U, P> const& v) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator&=(vec<4, U, Q> const& v) { - return (*this = detail::compute_vec4_and::value, sizeof(T) * 8, detail::is_aligned

::value>::call(*this, vec<4, T, P>(v))); + return (*this = detail::compute_vec4_and::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator|=(U scalar) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator|=(U scalar) { - return (*this = detail::compute_vec4_or::value, sizeof(T) * 8, detail::is_aligned

::value>::call(*this, vec<4, T, P>(scalar))); + return (*this = detail::compute_vec4_or::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator|=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator|=(vec<1, U, Q> const& v) { - return (*this = detail::compute_vec4_or::value, sizeof(T) * 8, detail::is_aligned

::value>::call(*this, vec<4, T, P>(v))); + return (*this = detail::compute_vec4_or::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator|=(vec<4, U, P> const& v) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator|=(vec<4, U, Q> const& v) { - return (*this = detail::compute_vec4_or::value, sizeof(T) * 8, detail::is_aligned

::value>::call(*this, vec<4, T, P>(v))); + return (*this = detail::compute_vec4_or::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator^=(U scalar) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator^=(U scalar) { - return (*this = detail::compute_vec4_xor::value, sizeof(T) * 8, detail::is_aligned

::value>::call(*this, vec<4, T, P>(scalar))); + return (*this = detail::compute_vec4_xor::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator^=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator^=(vec<1, U, Q> const& v) { - return (*this = detail::compute_vec4_xor::value, sizeof(T) * 8, detail::is_aligned

::value>::call(*this, vec<4, T, P>(v))); + return (*this = detail::compute_vec4_xor::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator^=(vec<4, U, P> const& v) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator^=(vec<4, U, Q> const& v) { - return (*this = detail::compute_vec4_xor::value, sizeof(T) * 8, detail::is_aligned

::value>::call(*this, vec<4, T, P>(v))); + return (*this = detail::compute_vec4_xor::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator<<=(U scalar) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator<<=(U scalar) { - return (*this = detail::compute_vec4_shift_left::value, sizeof(T) * 8, detail::is_aligned

::value>::call(*this, vec<4, T, P>(scalar))); + return (*this = detail::compute_vec4_shift_left::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator<<=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator<<=(vec<1, U, Q> const& v) { - return (*this = detail::compute_vec4_shift_left::value, sizeof(T) * 8, detail::is_aligned

::value>::call(*this, vec<4, T, P>(v))); + return (*this = detail::compute_vec4_shift_left::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator<<=(vec<4, U, P> const& v) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator<<=(vec<4, U, Q> const& v) { - return (*this = detail::compute_vec4_shift_left::value, sizeof(T) * 8, detail::is_aligned

::value>::call(*this, vec<4, T, P>(v))); + return (*this = detail::compute_vec4_shift_left::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator>>=(U scalar) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator>>=(U scalar) { - return (*this = detail::compute_vec4_shift_right::value, sizeof(T) * 8, detail::is_aligned

::value>::call(*this, vec<4, T, P>(scalar))); + return (*this = detail::compute_vec4_shift_right::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator>>=(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator>>=(vec<1, U, Q> const& v) { - return (*this = detail::compute_vec4_shift_right::value, sizeof(T) * 8, detail::is_aligned

::value>::call(*this, vec<4, T, P>(v))); + return (*this = detail::compute_vec4_shift_right::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); } - template + template template - GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator>>=(vec<4, U, P> const& v) + GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator>>=(vec<4, U, Q> const& v) { - return (*this = detail::compute_vec4_shift_right::value, sizeof(T) * 8, detail::is_aligned

::value>::call(*this, vec<4, T, P>(v))); + return (*this = detail::compute_vec4_shift_right::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); } // -- Unary constant operators -- - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator+(vec<4, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator+(vec<4, T, Q> const& v) { return v; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator-(vec<4, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator-(vec<4, T, Q> const& v) { - return vec<4, T, P>(0) -= v; + return vec<4, T, Q>(0) -= v; } // -- Binary arithmetic operators -- - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator+(vec<4, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator+(vec<4, T, Q> const& v, T scalar) { - return vec<4, T, P>(v) += scalar; + return vec<4, T, Q>(v) += scalar; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator+(vec<4, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<4, T, P>(v1) += v2; + return vec<4, T, Q>(v1) += v2; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator+(T scalar, vec<4, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator+(T scalar, vec<4, T, Q> const& v) { - return vec<4, T, P>(v) += scalar; + return vec<4, T, Q>(v) += scalar; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator+(vec<1, T, P> const& v1, vec<4, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator+(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) { - return vec<4, T, P>(v2) += v1; + return vec<4, T, Q>(v2) += v1; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator+(vec<4, T, P> const& v1, vec<4, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { - return vec<4, T, P>(v1) += v2; + return vec<4, T, Q>(v1) += v2; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator-(vec<4, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator-(vec<4, T, Q> const& v, T scalar) { - return vec<4, T, P>(v) -= scalar; + return vec<4, T, Q>(v) -= scalar; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator-(vec<4, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<4, T, P>(v1) -= v2; + return vec<4, T, Q>(v1) -= v2; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator-(T scalar, vec<4, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator-(T scalar, vec<4, T, Q> const& v) { - return vec<4, T, P>(scalar) -= v; + return vec<4, T, Q>(scalar) -= v; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator-(vec<1, T, P> const& v1, vec<4, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator-(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) { - return vec<4, T, P>(v1.x) -= v2; + return vec<4, T, Q>(v1.x) -= v2; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator-(vec<4, T, P> const& v1, vec<4, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { - return vec<4, T, P>(v1) -= v2; + return vec<4, T, Q>(v1) -= v2; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator*(vec<4, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator*(vec<4, T, Q> const& v, T scalar) { - return vec<4, T, P>(v) *= scalar; + return vec<4, T, Q>(v) *= scalar; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator*(vec<4, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<4, T, P>(v1) *= v2; + return vec<4, T, Q>(v1) *= v2; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator*(T scalar, vec<4, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator*(T scalar, vec<4, T, Q> const& v) { - return vec<4, T, P>(v) *= scalar; + return vec<4, T, Q>(v) *= scalar; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator*(vec<1, T, P> const& v1, vec<4, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator*(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) { - return vec<4, T, P>(v2) *= v1; + return vec<4, T, Q>(v2) *= v1; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator*(vec<4, T, P> const& v1, vec<4, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { - return vec<4, T, P>(v1) *= v2; + return vec<4, T, Q>(v1) *= v2; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator/(vec<4, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator/(vec<4, T, Q> const& v, T scalar) { - return vec<4, T, P>(v) /= scalar; + return vec<4, T, Q>(v) /= scalar; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator/(vec<4, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<4, T, P>(v1) /= v2; + return vec<4, T, Q>(v1) /= v2; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator/(T scalar, vec<4, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator/(T scalar, vec<4, T, Q> const& v) { - return vec<4, T, P>(scalar) /= v; + return vec<4, T, Q>(scalar) /= v; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator/(vec<1, T, P> const& v1, vec<4, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator/(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) { - return vec<4, T, P>(v1.x) /= v2; + return vec<4, T, Q>(v1.x) /= v2; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator/(vec<4, T, P> const& v1, vec<4, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { - return vec<4, T, P>(v1) /= v2; + return vec<4, T, Q>(v1) /= v2; } // -- Binary bit operators -- - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator%(vec<4, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator%(vec<4, T, Q> const& v, T scalar) { - return vec<4, T, P>(v) %= scalar; + return vec<4, T, Q>(v) %= scalar; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator%(vec<4, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<4, T, P>(v1) %= v2.x; + return vec<4, T, Q>(v1) %= v2.x; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator%(T scalar, vec<4, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator%(T scalar, vec<4, T, Q> const& v) { - return vec<4, T, P>(scalar) %= v; + return vec<4, T, Q>(scalar) %= v; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator%(vec<1, T, P> const& scalar, vec<4, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator%(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v) { - return vec<4, T, P>(scalar.x) %= v; + return vec<4, T, Q>(scalar.x) %= v; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator%(vec<4, T, P> const& v1, vec<4, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { - return vec<4, T, P>(v1) %= v2; + return vec<4, T, Q>(v1) %= v2; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator&(vec<4, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator&(vec<4, T, Q> const& v, T scalar) { - return vec<4, T, P>(v) &= scalar; + return vec<4, T, Q>(v) &= scalar; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator&(vec<4, T, P> const& v, vec<1, T, P> const& scalar) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator&(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar) { - return vec<4, T, P>(v) &= scalar; + return vec<4, T, Q>(v) &= scalar; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator&(T scalar, vec<4, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator&(T scalar, vec<4, T, Q> const& v) { - return vec<4, T, P>(scalar) &= v; + return vec<4, T, Q>(scalar) &= v; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator&(vec<1, T, P> const& v1, vec<4, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator&(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) { - return vec<4, T, P>(v1.x) &= v2; + return vec<4, T, Q>(v1.x) &= v2; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator&(vec<4, T, P> const& v1, vec<4, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator&(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { - return vec<4, T, P>(v1) &= v2; + return vec<4, T, Q>(v1) &= v2; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator|(vec<4, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator|(vec<4, T, Q> const& v, T scalar) { - return vec<4, T, P>(v) |= scalar; + return vec<4, T, Q>(v) |= scalar; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator|(vec<4, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<4, T, P>(v1) |= v2.x; + return vec<4, T, Q>(v1) |= v2.x; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator|(T scalar, vec<4, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator|(T scalar, vec<4, T, Q> const& v) { - return vec<4, T, P>(scalar) |= v; + return vec<4, T, Q>(scalar) |= v; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator|(vec<1, T, P> const& v1, vec<4, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator|(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) { - return vec<4, T, P>(v1.x) |= v2; + return vec<4, T, Q>(v1.x) |= v2; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator|(vec<4, T, P> const& v1, vec<4, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { - return vec<4, T, P>(v1) |= v2; + return vec<4, T, Q>(v1) |= v2; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator^(vec<4, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator^(vec<4, T, Q> const& v, T scalar) { - return vec<4, T, P>(v) ^= scalar; + return vec<4, T, Q>(v) ^= scalar; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator^(vec<4, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<4, T, P>(v1) ^= v2.x; + return vec<4, T, Q>(v1) ^= v2.x; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator^(T scalar, vec<4, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator^(T scalar, vec<4, T, Q> const& v) { - return vec<4, T, P>(scalar) ^= v; + return vec<4, T, Q>(scalar) ^= v; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator^(vec<1, T, P> const& v1, vec<4, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator^(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) { - return vec<4, T, P>(v1.x) ^= v2; + return vec<4, T, Q>(v1.x) ^= v2; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator^(vec<4, T, P> const& v1, vec<4, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { - return vec<4, T, P>(v1) ^= v2; + return vec<4, T, Q>(v1) ^= v2; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator<<(vec<4, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator<<(vec<4, T, Q> const& v, T scalar) { - return vec<4, T, P>(v) <<= scalar; + return vec<4, T, Q>(v) <<= scalar; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator<<(vec<4, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<4, T, P>(v1) <<= v2.x; + return vec<4, T, Q>(v1) <<= v2.x; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator<<(T scalar, vec<4, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator<<(T scalar, vec<4, T, Q> const& v) { - return vec<4, T, P>(scalar) <<= v; + return vec<4, T, Q>(scalar) <<= v; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator<<(vec<1, T, P> const& v1, vec<4, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator<<(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) { - return vec<4, T, P>(v1.x) <<= v2; + return vec<4, T, Q>(v1.x) <<= v2; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator<<(vec<4, T, P> const& v1, vec<4, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { - return vec<4, T, P>(v1) <<= v2; + return vec<4, T, Q>(v1) <<= v2; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator>>(vec<4, T, P> const& v, T scalar) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator>>(vec<4, T, Q> const& v, T scalar) { - return vec<4, T, P>(v) >>= scalar; + return vec<4, T, Q>(v) >>= scalar; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator>>(vec<4, T, P> const& v1, vec<1, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<4, T, P>(v1) >>= v2.x; + return vec<4, T, Q>(v1) >>= v2.x; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator>>(T scalar, vec<4, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator>>(T scalar, vec<4, T, Q> const& v) { - return vec<4, T, P>(scalar) >>= v; + return vec<4, T, Q>(scalar) >>= v; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator>>(vec<1, T, P> const& v1, vec<4, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator>>(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) { - return vec<4, T, P>(v1.x) >>= v2; + return vec<4, T, Q>(v1.x) >>= v2; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator>>(vec<4, T, P> const& v1, vec<4, T, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { - return vec<4, T, P>(v1) >>= v2; + return vec<4, T, Q>(v1) >>= v2; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator~(vec<4, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator~(vec<4, T, Q> const& v) { - return detail::compute_vec4_bitwise_not::value, sizeof(T) * 8, detail::is_aligned

::value>::call(v); + return detail::compute_vec4_bitwise_not::value, sizeof(T) * 8, detail::is_aligned::value>::call(v); } // -- Boolean operators -- - template - GLM_FUNC_QUALIFIER bool operator==(vec<4, T, P> const& v1, vec<4, T, P> const& v2) + template + GLM_FUNC_QUALIFIER bool operator==(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { - return detail::compute_vec4_equal::value, sizeof(T) * 8, detail::is_aligned

::value>::call(v1, v2); + return detail::compute_vec4_equal::value, sizeof(T) * 8, detail::is_aligned::value>::call(v1, v2); } - template - GLM_FUNC_QUALIFIER bool operator!=(vec<4, T, P> const& v1, vec<4, T, P> const& v2) + template + GLM_FUNC_QUALIFIER bool operator!=(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { - return detail::compute_vec4_nequal::value, sizeof(T) * 8, detail::is_aligned

::value>::call(v1, v2); + return detail::compute_vec4_nequal::value, sizeof(T) * 8, detail::is_aligned::value>::call(v1, v2); } - template - GLM_FUNC_QUALIFIER vec<4, bool, P> operator&&(vec<4, bool, P> const& v1, vec<4, bool, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> operator&&(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2) { - return vec<4, bool, P>(v1.x && v2.x, v1.y && v2.y, v1.z && v2.z, v1.w && v2.w); + return vec<4, bool, Q>(v1.x && v2.x, v1.y && v2.y, v1.z && v2.z, v1.w && v2.w); } - template - GLM_FUNC_QUALIFIER vec<4, bool, P> operator||(vec<4, bool, P> const& v1, vec<4, bool, P> const& v2) + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> operator||(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2) { - return vec<4, bool, P>(v1.x || v2.x, v1.y || v2.y, v1.z || v2.z, v1.w || v2.w); + return vec<4, bool, Q>(v1.x || v2.x, v1.y || v2.y, v1.z || v2.z, v1.w || v2.w); } }//namespace glm diff --git a/glm/detail/type_vec4_simd.inl b/glm/detail/type_vec4_simd.inl index a2d155a7..4a2e497e 100644 --- a/glm/detail/type_vec4_simd.inl +++ b/glm/detail/type_vec4_simd.inl @@ -51,10 +51,10 @@ namespace detail }; # endif// GLM_SWIZZLE == GLM_SWIZZLE_ENABLED - template + template struct compute_vec4_add { - static vec<4, float, P> call(vec<4, float, P> const& a, vec<4, float, P> const& b) + static vec<4, float, P> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) { vec<4, float, P> Result; Result.data = _mm_add_ps(a.data, b.data); @@ -63,10 +63,10 @@ namespace detail }; # if GLM_ARCH & GLM_ARCH_AVX_BIT - template + template struct compute_vec4_add { - static vec<4, double, P> call(vec<4, double, P> const& a, vec<4, double, P> const& b) + static vec<4, double, P> call(vec<4, double, Q> const& a, vec<4, double, Q> const& b) { vec<4, double, P> Result; Result.data = _mm256_add_pd(a.data, b.data); @@ -75,10 +75,10 @@ namespace detail }; # endif - template + template struct compute_vec4_sub { - static vec<4, float, P> call(vec<4, float, P> const& a, vec<4, float, P> const& b) + static vec<4, float, P> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) { vec<4, float, P> Result; Result.data = _mm_sub_ps(a.data, b.data); @@ -87,10 +87,10 @@ namespace detail }; # if GLM_ARCH & GLM_ARCH_AVX_BIT - template + template struct compute_vec4_sub { - static vec<4, double, P> call(vec<4, double, P> const& a, vec<4, double, P> const& b) + static vec<4, double, P> call(vec<4, double, Q> const& a, vec<4, double, Q> const& b) { vec<4, double, P> Result; Result.data = _mm256_sub_pd(a.data, b.data); @@ -99,10 +99,10 @@ namespace detail }; # endif - template + template struct compute_vec4_mul { - static vec<4, float, P> call(vec<4, float, P> const& a, vec<4, float, P> const& b) + static vec<4, float, P> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) { vec<4, float, P> Result; Result.data = _mm_mul_ps(a.data, b.data); @@ -111,10 +111,10 @@ namespace detail }; # if GLM_ARCH & GLM_ARCH_AVX_BIT - template + template struct compute_vec4_mul { - static vec<4, double, P> call(vec<4, double, P> const& a, vec<4, double, P> const& b) + static vec<4, double, P> call(vec<4, double, Q> const& a, vec<4, double, Q> const& b) { vec<4, double, P> Result; Result.data = _mm256_mul_pd(a.data, b.data); @@ -123,10 +123,10 @@ namespace detail }; # endif - template + template struct compute_vec4_div { - static vec<4, float, P> call(vec<4, float, P> const& a, vec<4, float, P> const& b) + static vec<4, float, P> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) { vec<4, float, P> Result; Result.data = _mm_div_ps(a.data, b.data); @@ -135,10 +135,10 @@ namespace detail }; # if GLM_ARCH & GLM_ARCH_AVX_BIT - template + template struct compute_vec4_div { - static vec<4, double, P> call(vec<4, double, P> const& a, vec<4, double, P> const& b) + static vec<4, double, P> call(vec<4, double, Q> const& a, vec<4, double, Q> const& b) { vec<4, double, P> Result; Result.data = _mm256_div_pd(a.data, b.data); @@ -158,181 +158,181 @@ namespace detail } }; - template - struct compute_vec4_and + template + struct compute_vec4_and { - static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) { - vec<4, T, P> Result; + vec<4, T, Q> Result; Result.data = _mm_and_si128(a.data, b.data); return Result; } }; # if GLM_ARCH & GLM_ARCH_AVX2_BIT - template - struct compute_vec4_and + template + struct compute_vec4_and { - static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) { - vec<4, T, P> Result; + vec<4, T, Q> Result; Result.data = _mm256_and_si256(a.data, b.data); return Result; } }; # endif - template - struct compute_vec4_or + template + struct compute_vec4_or { - static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) { - vec<4, T, P> Result; + vec<4, T, Q> Result; Result.data = _mm_or_si128(a.data, b.data); return Result; } }; # if GLM_ARCH & GLM_ARCH_AVX2_BIT - template - struct compute_vec4_or + template + struct compute_vec4_or { - static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) { - vec<4, T, P> Result; + vec<4, T, Q> Result; Result.data = _mm256_or_si256(a.data, b.data); return Result; } }; # endif - template - struct compute_vec4_xor + template + struct compute_vec4_xor { - static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) { - vec<4, T, P> Result; + vec<4, T, Q> Result; Result.data = _mm_xor_si128(a.data, b.data); return Result; } }; # if GLM_ARCH & GLM_ARCH_AVX2_BIT - template - struct compute_vec4_xor + template + struct compute_vec4_xor { - static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) { - vec<4, T, P> Result; + vec<4, T, Q> Result; Result.data = _mm256_xor_si256(a.data, b.data); return Result; } }; # endif - template - struct compute_vec4_shift_left + template + struct compute_vec4_shift_left { - static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) { - vec<4, T, P> Result; + vec<4, T, Q> Result; Result.data = _mm_sll_epi32(a.data, b.data); return Result; } }; # if GLM_ARCH & GLM_ARCH_AVX2_BIT - template - struct compute_vec4_shift_left + template + struct compute_vec4_shift_left { - static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) { - vec<4, T, P> Result; + vec<4, T, Q> Result; Result.data = _mm256_sll_epi64(a.data, b.data); return Result; } }; # endif - template - struct compute_vec4_shift_right + template + struct compute_vec4_shift_right { - static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) { - vec<4, T, P> Result; + vec<4, T, Q> Result; Result.data = _mm_srl_epi32(a.data, b.data); return Result; } }; # if GLM_ARCH & GLM_ARCH_AVX2_BIT - template - struct compute_vec4_shift_right + template + struct compute_vec4_shift_right { - static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) { - vec<4, T, P> Result; + vec<4, T, Q> Result; Result.data = _mm256_srl_epi64(a.data, b.data); return Result; } }; # endif - template - struct compute_vec4_bitwise_not + template + struct compute_vec4_bitwise_not { - static vec<4, T, P> call(vec<4, T, P> const& v) + static vec<4, T, Q> call(vec<4, T, Q> const& v) { - vec<4, T, P> Result; + vec<4, T, Q> Result; Result.data = _mm_xor_si128(v.data, _mm_set1_epi32(-1)); return Result; } }; # if GLM_ARCH & GLM_ARCH_AVX2_BIT - template - struct compute_vec4_bitwise_not + template + struct compute_vec4_bitwise_not { - static vec<4, T, P> call(vec<4, T, P> const& v) + static vec<4, T, Q> call(vec<4, T, Q> const& v) { - vec<4, T, P> Result; + vec<4, T, Q> Result; Result.data = _mm256_xor_si256(v.data, _mm_set1_epi32(-1)); return Result; } }; # endif - template + template struct compute_vec4_equal { - static bool call(vec<4, float, P> const& v1, vec<4, float, P> const& v2) + static bool call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) { return _mm_movemask_ps(_mm_cmpeq_ps(v1.data, v2.data)) != 0; } }; - template + template struct compute_vec4_equal { - static bool call(vec<4, int32, P> const& v1, vec<4, int32, P> const& v2) + static bool call(vec<4, int32, Q> const& v1, vec<4, int32, Q> const& v2) { return _mm_movemask_epi8(_mm_cmpeq_epi32(v1.data, v2.data)) != 0; } }; - template + template struct compute_vec4_nequal { - static bool call(vec<4, float, P> const& v1, vec<4, float, P> const& v2) + static bool call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) { return _mm_movemask_ps(_mm_cmpneq_ps(v1.data, v2.data)) != 0; } }; - template + template struct compute_vec4_nequal { - static bool call(vec<4, int32, P> const& v1, vec<4, int32, P> const& v2) + static bool call(vec<4, int32, Q> const& v1, vec<4, int32, Q> const& v2) { return _mm_movemask_epi8(_mm_cmpneq_epi32(v1.data, v2.data)) != 0; } diff --git a/glm/fwd.hpp b/glm/fwd.hpp index d4c5e3fb..553dfb07 100644 --- a/glm/fwd.hpp +++ b/glm/fwd.hpp @@ -14,7 +14,7 @@ // GLM_GTC_quaternion namespace glm { - template struct tquat; + template struct tquat; /// Quaternion of low single-qualifier floating-point numbers. /// diff --git a/glm/gtc/bitfield.hpp b/glm/gtc/bitfield.hpp index 60f4a43f..b8c9ef3b 100644 --- a/glm/gtc/bitfield.hpp +++ b/glm/gtc/bitfield.hpp @@ -38,9 +38,13 @@ namespace glm /// Build a mask of 'count' bits /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed and unsigned integer scalar types + /// @tparam P Value from qualifier enum + /// /// @see gtc_bitfield - template class vecIUType> - GLM_FUNC_DECL vecIUType mask(vecIUType const& v); + template + GLM_FUNC_DECL vec mask(vec const& v); /// Rotate all bits to the right. All the bits dropped in the right side are inserted back on the left side. /// @@ -51,8 +55,8 @@ namespace glm /// Rotate all bits to the right. All the bits dropped in the right side are inserted back on the left side. /// /// @see gtc_bitfield - template - GLM_FUNC_DECL vec bitfieldRotateRight(vec const& In, int Shift); + template + GLM_FUNC_DECL vec bitfieldRotateRight(vec const& In, int Shift); /// Rotate all bits to the left. All the bits dropped in the left side are inserted back on the right side. /// @@ -63,8 +67,8 @@ namespace glm /// Rotate all bits to the left. All the bits dropped in the left side are inserted back on the right side. /// /// @see gtc_bitfield - template - GLM_FUNC_DECL vec bitfieldRotateLeft(vec const& In, int Shift); + template + GLM_FUNC_DECL vec bitfieldRotateLeft(vec const& In, int Shift); /// Set to 1 a range of bits. /// @@ -75,8 +79,8 @@ namespace glm /// Set to 1 a range of bits. /// /// @see gtc_bitfield - template - GLM_FUNC_DECL vec bitfieldFillOne(vec const& Value, int FirstBit, int BitCount); + template + GLM_FUNC_DECL vec bitfieldFillOne(vec const& Value, int FirstBit, int BitCount); /// Set to 0 a range of bits. /// @@ -87,8 +91,8 @@ namespace glm /// Set to 0 a range of bits. /// /// @see gtc_bitfield - template - GLM_FUNC_DECL vec bitfieldFillZero(vec const& Value, int FirstBit, int BitCount); + template + GLM_FUNC_DECL vec bitfieldFillZero(vec const& Value, int FirstBit, int BitCount); /// Interleaves the bits of x and y. /// The first bit is the first bit of x followed by the first bit of y. diff --git a/glm/gtc/bitfield.inl b/glm/gtc/bitfield.inl index acd39c24..fabfd1a0 100644 --- a/glm/gtc/bitfield.inl +++ b/glm/gtc/bitfield.inl @@ -230,12 +230,12 @@ namespace detail return Bits >= sizeof(genIUType) * 8 ? ~static_cast(0) : (static_cast(1) << Bits) - static_cast(1); } - template class vecIUType> - GLM_FUNC_QUALIFIER vecIUType mask(vecIUType const& v) + template + GLM_FUNC_QUALIFIER vec mask(vec const& v) { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'mask' accepts only integer values"); - return detail::functor1::call(mask, v); + return detail::functor1::call(mask, v); } template @@ -247,8 +247,8 @@ namespace detail return (In << static_cast(Shift)) | (In >> static_cast(BitSize - Shift)); } - template - GLM_FUNC_QUALIFIER vec bitfieldRotateRight(vec const& In, int Shift) + template + GLM_FUNC_QUALIFIER vec bitfieldRotateRight(vec const& In, int Shift) { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldRotateRight' accepts only integer values"); @@ -265,8 +265,8 @@ namespace detail return (In >> static_cast(Shift)) | (In << static_cast(BitSize - Shift)); } - template - GLM_FUNC_QUALIFIER vec bitfieldRotateLeft(vec const& In, int Shift) + template + GLM_FUNC_QUALIFIER vec bitfieldRotateLeft(vec const& In, int Shift) { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldRotateLeft' accepts only integer values"); @@ -280,8 +280,8 @@ namespace detail return Value | static_cast(mask(BitCount) << FirstBit); } - template - GLM_FUNC_QUALIFIER vec bitfieldFillOne(vec const& Value, int FirstBit, int BitCount) + template + GLM_FUNC_QUALIFIER vec bitfieldFillOne(vec const& Value, int FirstBit, int BitCount) { return Value | static_cast(mask(BitCount) << FirstBit); } @@ -292,8 +292,8 @@ namespace detail return Value & static_cast(~(mask(BitCount) << FirstBit)); } - template - GLM_FUNC_QUALIFIER vec bitfieldFillZero(vec const& Value, int FirstBit, int BitCount) + template + GLM_FUNC_QUALIFIER vec bitfieldFillZero(vec const& Value, int FirstBit, int BitCount) { return Value & static_cast(~(mask(BitCount) << FirstBit)); } diff --git a/glm/gtc/color_space.hpp b/glm/gtc/color_space.hpp index 7a51667f..3d9a5715 100644 --- a/glm/gtc/color_space.hpp +++ b/glm/gtc/color_space.hpp @@ -32,23 +32,23 @@ namespace glm /// Convert a linear color to sRGB color using a standard gamma correction. /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb - template - GLM_FUNC_DECL vec convertLinearToSRGB(vec const& ColorLinear); + template + GLM_FUNC_DECL vec convertLinearToSRGB(vec const& ColorLinear); /// Convert a linear color to sRGB color using a custom gamma correction. /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb - template - GLM_FUNC_DECL vec convertLinearToSRGB(vec const& ColorLinear, T Gamma); + template + GLM_FUNC_DECL vec convertLinearToSRGB(vec const& ColorLinear, T Gamma); /// Convert a sRGB color to linear color using a standard gamma correction. /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb - template - GLM_FUNC_DECL vec convertSRGBToLinear(vec const& ColorSRGB); + template + GLM_FUNC_DECL vec convertSRGBToLinear(vec const& ColorSRGB); /// Convert a sRGB color to linear color using a custom gamma correction. // IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb - template - GLM_FUNC_DECL vec convertSRGBToLinear(vec const& ColorSRGB, T Gamma); + template + GLM_FUNC_DECL vec convertSRGBToLinear(vec const& ColorSRGB, T Gamma); /// @} } //namespace glm diff --git a/glm/gtc/color_space.inl b/glm/gtc/color_space.inl index debde485..53241ac0 100644 --- a/glm/gtc/color_space.inl +++ b/glm/gtc/color_space.inl @@ -4,55 +4,55 @@ namespace glm{ namespace detail { - template + template struct compute_rgbToSrgb { - GLM_FUNC_QUALIFIER static vec call(vec const& ColorRGB, T GammaCorrection) + GLM_FUNC_QUALIFIER static vec call(vec const& ColorRGB, T GammaCorrection) { - vec const ClampedColor(clamp(ColorRGB, static_cast(0), static_cast(1))); + vec const ClampedColor(clamp(ColorRGB, static_cast(0), static_cast(1))); return mix( - pow(ClampedColor, vec(GammaCorrection)) * static_cast(1.055) - static_cast(0.055), + pow(ClampedColor, vec(GammaCorrection)) * static_cast(1.055) - static_cast(0.055), ClampedColor * static_cast(12.92), - lessThan(ClampedColor, vec(static_cast(0.0031308)))); + lessThan(ClampedColor, vec(static_cast(0.0031308)))); } }; - template - struct compute_rgbToSrgb<4, T, P> + template + struct compute_rgbToSrgb<4, T, Q> { - GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& ColorRGB, T GammaCorrection) + GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& ColorRGB, T GammaCorrection) { - return vec<4, T, P>(compute_rgbToSrgb<3, T, P>::call(vec<3, T, P>(ColorRGB), GammaCorrection), ColorRGB.w); + return vec<4, T, Q>(compute_rgbToSrgb<3, T, Q>::call(vec<3, T, Q>(ColorRGB), GammaCorrection), ColorRGB.w); } }; - template + template struct compute_srgbToRgb { - GLM_FUNC_QUALIFIER static vec call(vec const& ColorSRGB, T Gamma) + GLM_FUNC_QUALIFIER static vec call(vec const& ColorSRGB, T Gamma) { return mix( - pow((ColorSRGB + static_cast(0.055)) * static_cast(0.94786729857819905213270142180095), vec(Gamma)), + pow((ColorSRGB + static_cast(0.055)) * static_cast(0.94786729857819905213270142180095), vec(Gamma)), ColorSRGB * static_cast(0.07739938080495356037151702786378), - lessThanEqual(ColorSRGB, vec(static_cast(0.04045)))); + lessThanEqual(ColorSRGB, vec(static_cast(0.04045)))); } }; - template - struct compute_srgbToRgb<4, T, P> + template + struct compute_srgbToRgb<4, T, Q> { - GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& ColorSRGB, T Gamma) + GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& ColorSRGB, T Gamma) { - return vec<4, T, P>(compute_srgbToRgb<3, T, P>::call(vec<3, T, P>(ColorSRGB), Gamma), ColorSRGB.w); + return vec<4, T, Q>(compute_srgbToRgb<3, T, Q>::call(vec<3, T, Q>(ColorSRGB), Gamma), ColorSRGB.w); } }; }//namespace detail - template - GLM_FUNC_QUALIFIER vec convertLinearToSRGB(vec const& ColorLinear) + template + GLM_FUNC_QUALIFIER vec convertLinearToSRGB(vec const& ColorLinear) { - return detail::compute_rgbToSrgb::call(ColorLinear, static_cast(0.41666)); + return detail::compute_rgbToSrgb::call(ColorLinear, static_cast(0.41666)); } // Based on Ian Taylor http://chilliant.blogspot.fr/2012/08/srgb-approximations-for-hlsl.html @@ -65,21 +65,21 @@ namespace detail return 0.662002687f * S1 + 0.684122060f * S2 - 0.323583601f * S3 - 0.0225411470f * ColorLinear; } - template - GLM_FUNC_QUALIFIER vec convertLinearToSRGB(vec const& ColorLinear, T Gamma) + template + GLM_FUNC_QUALIFIER vec convertLinearToSRGB(vec const& ColorLinear, T Gamma) { - return detail::compute_rgbToSrgb::call(ColorLinear, static_cast(1) / Gamma); + return detail::compute_rgbToSrgb::call(ColorLinear, static_cast(1) / Gamma); } - template - GLM_FUNC_QUALIFIER vec convertSRGBToLinear(vec const& ColorSRGB) + template + GLM_FUNC_QUALIFIER vec convertSRGBToLinear(vec const& ColorSRGB) { - return detail::compute_srgbToRgb::call(ColorSRGB, static_cast(2.4)); + return detail::compute_srgbToRgb::call(ColorSRGB, static_cast(2.4)); } - template - GLM_FUNC_QUALIFIER vec convertSRGBToLinear(vec const& ColorSRGB, T Gamma) + template + GLM_FUNC_QUALIFIER vec convertSRGBToLinear(vec const& ColorSRGB, T Gamma) { - return detail::compute_srgbToRgb::call(ColorSRGB, Gamma); + return detail::compute_srgbToRgb::call(ColorSRGB, Gamma); } }//namespace glm diff --git a/glm/gtc/epsilon.hpp b/glm/gtc/epsilon.hpp index 9f6db975..9cf6fc30 100644 --- a/glm/gtc/epsilon.hpp +++ b/glm/gtc/epsilon.hpp @@ -30,8 +30,8 @@ namespace glm /// True if this expression is satisfied. /// /// @see gtc_epsilon - template - GLM_FUNC_DECL vec epsilonEqual(vec const& x, vec const& y, T const& epsilon); + template + GLM_FUNC_DECL vec epsilonEqual(vec const& x, vec const& y, T const& epsilon); /// Returns the component-wise comparison of |x - y| < epsilon. /// True if this expression is satisfied. @@ -44,8 +44,8 @@ namespace glm /// True if this expression is not satisfied. /// /// @see gtc_epsilon - template - GLM_FUNC_DECL vec epsilonNotEqual(vec const& x, vec const& y, T const& epsilon); + template + GLM_FUNC_DECL vec epsilonNotEqual(vec const& x, vec const& y, T const& epsilon); /// Returns the component-wise comparison of |x - y| >= epsilon. /// True if this expression is not satisfied. diff --git a/glm/gtc/epsilon.inl b/glm/gtc/epsilon.inl index d04e3cff..796e8118 100644 --- a/glm/gtc/epsilon.inl +++ b/glm/gtc/epsilon.inl @@ -33,16 +33,16 @@ namespace glm return abs(x - y) < epsilon; } - template - GLM_FUNC_QUALIFIER vec epsilonEqual(vec const& x, vec const& y, T const& epsilon) + template + GLM_FUNC_QUALIFIER vec epsilonEqual(vec const& x, vec const& y, T const& epsilon) { - return lessThan(abs(x - y), vec(epsilon)); + return lessThan(abs(x - y), vec(epsilon)); } - template - GLM_FUNC_QUALIFIER vec epsilonEqual(vec const& x, vec const& y, vec const& epsilon) + template + GLM_FUNC_QUALIFIER vec epsilonEqual(vec const& x, vec const& y, vec const& epsilon) { - return lessThan(abs(x - y), vec(epsilon)); + return lessThan(abs(x - y), vec(epsilon)); } template<> @@ -57,29 +57,29 @@ namespace glm return abs(x - y) >= epsilon; } - template - GLM_FUNC_QUALIFIER vec epsilonNotEqual(vec const& x, vec const& y, T const& epsilon) + template + GLM_FUNC_QUALIFIER vec epsilonNotEqual(vec const& x, vec const& y, T const& epsilon) { - return greaterThanEqual(abs(x - y), vec(epsilon)); + return greaterThanEqual(abs(x - y), vec(epsilon)); } - template - GLM_FUNC_QUALIFIER vec epsilonNotEqual(vec const& x, vec const& y, vec const& epsilon) + template + GLM_FUNC_QUALIFIER vec epsilonNotEqual(vec const& x, vec const& y, vec const& epsilon) { - return greaterThanEqual(abs(x - y), vec(epsilon)); + return greaterThanEqual(abs(x - y), vec(epsilon)); } - template - GLM_FUNC_QUALIFIER vec<4, bool, P> epsilonEqual(tquat const& x, tquat const& y, T const& epsilon) + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> epsilonEqual(tquat const& x, tquat const& y, T const& epsilon) { - vec<4, T, P> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); - return lessThan(abs(v), vec<4, T, P>(epsilon)); + vec<4, T, Q> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); + return lessThan(abs(v), vec<4, T, Q>(epsilon)); } - template - GLM_FUNC_QUALIFIER vec<4, bool, P> epsilonNotEqual(tquat const& x, tquat const& y, T const& epsilon) + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> epsilonNotEqual(tquat const& x, tquat const& y, T const& epsilon) { - vec<4, T, P> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); - return greaterThanEqual(abs(v), vec<4, T, P>(epsilon)); + vec<4, T, Q> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); + return greaterThanEqual(abs(v), vec<4, T, Q>(epsilon)); } }//namespace glm diff --git a/glm/gtc/functions.hpp b/glm/gtc/functions.hpp index ef7796af..7f8260ad 100644 --- a/glm/gtc/functions.hpp +++ b/glm/gtc/functions.hpp @@ -39,11 +39,11 @@ namespace glm /// 2D gauss function /// /// @see gtc_epsilon - template + template GLM_FUNC_DECL T gauss( - vec<2, T, P> const& Coord, - vec<2, T, P> const& ExpectedValue, - vec<2, T, P> const& StandardDeviation); + vec<2, T, Q> const& Coord, + vec<2, T, Q> const& ExpectedValue, + vec<2, T, Q> const& StandardDeviation); /// @} }//namespace glm diff --git a/glm/gtc/functions.inl b/glm/gtc/functions.inl index be1c276b..4dc42aa1 100644 --- a/glm/gtc/functions.inl +++ b/glm/gtc/functions.inl @@ -16,15 +16,15 @@ namespace glm return exp(-((x - ExpectedValue) * (x - ExpectedValue)) / (static_cast(2) * StandardDeviation * StandardDeviation)) / (StandardDeviation * sqrt(static_cast(6.28318530717958647692528676655900576))); } - template + template GLM_FUNC_QUALIFIER T gauss ( - vec<2, T, P> const& Coord, - vec<2, T, P> const& ExpectedValue, - vec<2, T, P> const& StandardDeviation + vec<2, T, Q> const& Coord, + vec<2, T, Q> const& ExpectedValue, + vec<2, T, Q> const& StandardDeviation ) { - vec<2, T, P> const Squared = ((Coord - ExpectedValue) * (Coord - ExpectedValue)) / (static_cast(2) * StandardDeviation * StandardDeviation); + vec<2, T, Q> const Squared = ((Coord - ExpectedValue) * (Coord - ExpectedValue)) / (static_cast(2) * StandardDeviation * StandardDeviation); return exp(-(Squared.x + Squared.y)); } }//namespace glm diff --git a/glm/gtc/integer.hpp b/glm/gtc/integer.hpp index 275348ee..5778e5de 100644 --- a/glm/gtc/integer.hpp +++ b/glm/gtc/integer.hpp @@ -54,8 +54,8 @@ namespace glm /// @see gtc_integer /// @see GLSL mod man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec mod(vec const& x, T y); + template + GLM_FUNC_DECL vec mod(vec const& x, T y); /// Modulus. Returns x % y /// for each component in x using the floating point value y. @@ -65,8 +65,8 @@ namespace glm /// @see gtc_integer /// @see GLSL mod man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec mod(vec const& x, vec const& y); + template + GLM_FUNC_DECL vec mod(vec const& x, vec const& y); /// Returns a value equal to the nearest integer to x. /// The fraction 0.5 will round in a direction chosen by the @@ -77,8 +77,8 @@ namespace glm /// /// @see GLSL round man page /// @see gtc_integer - template - GLM_FUNC_DECL vec iround(vec const& x); + template + GLM_FUNC_DECL vec iround(vec const& x); /// Returns a value equal to the nearest integer to x. /// The fraction 0.5 will round in a direction chosen by the @@ -89,8 +89,8 @@ namespace glm /// /// @see GLSL round man page /// @see gtc_integer - template - GLM_FUNC_DECL vec uround(vec const& x); + template + GLM_FUNC_DECL vec uround(vec const& x); /// @} } //namespace glm diff --git a/glm/gtc/integer.inl b/glm/gtc/integer.inl index a8258fc6..9d4b6185 100644 --- a/glm/gtc/integer.inl +++ b/glm/gtc/integer.inl @@ -4,24 +4,24 @@ namespace glm{ namespace detail { - template - struct compute_log2 + template + struct compute_log2 { - GLM_FUNC_QUALIFIER static vec call(vec const& v) + GLM_FUNC_QUALIFIER static vec call(vec const& v) { //Equivalent to return findMSB(vec); but save one function call in ASM with VC //return findMSB(vec); - return vec(detail::compute_findMSB_vec::call(v)); + return vec(detail::compute_findMSB_vec::call(v)); } }; # if GLM_HAS_BITSCAN_WINDOWS - template - struct compute_log2<4, int, P, false, Aligned> + template + struct compute_log2<4, int, Q, false, Aligned> { - GLM_FUNC_QUALIFIER static vec<4, int, P> call(vec<4, int, P> const& v) + GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v) { - vec<4, int, P> Result; + vec<4, int, Q> Result; _BitScanReverse(reinterpret_cast(&Result.x), v.x); _BitScanReverse(reinterpret_cast(&Result.y), v.y); _BitScanReverse(reinterpret_cast(&Result.z), v.z); @@ -40,13 +40,13 @@ namespace detail return static_cast(x + static_cast(0.5)); } - template - GLM_FUNC_QUALIFIER vec iround(vec const& x) + template + GLM_FUNC_QUALIFIER vec iround(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'iround' only accept floating-point inputs"); - assert(all(lessThanEqual(vec(0), x))); + assert(all(lessThanEqual(vec(0), x))); - return vec(x + static_cast(0.5)); + return vec(x + static_cast(0.5)); } template @@ -58,12 +58,12 @@ namespace detail return static_cast(x + static_cast(0.5)); } - template - GLM_FUNC_QUALIFIER vec uround(vec const& x) + template + GLM_FUNC_QUALIFIER vec uround(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'uround' only accept floating-point inputs"); - assert(all(lessThanEqual(vec(0), x))); + assert(all(lessThanEqual(vec(0), x))); - return vec(x + static_cast(0.5)); + return vec(x + static_cast(0.5)); } }//namespace glm diff --git a/glm/gtc/matrix_inverse.inl b/glm/gtc/matrix_inverse.inl index 0e2bf254..592e690a 100644 --- a/glm/gtc/matrix_inverse.inl +++ b/glm/gtc/matrix_inverse.inl @@ -3,35 +3,35 @@ namespace glm { - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> affineInverse(mat<3, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> affineInverse(mat<3, 3, T, Q> const& m) { - mat<2, 2, T, P> const Inv(inverse(mat<2, 2, T, P>(m))); + mat<2, 2, T, Q> const Inv(inverse(mat<2, 2, T, Q>(m))); - return mat<3, 3, T, P>( - vec<3, T, P>(Inv[0], static_cast(0)), - vec<3, T, P>(Inv[1], static_cast(0)), - vec<3, T, P>(-Inv * vec<2, T, P>(m[2]), static_cast(1))); + return mat<3, 3, T, Q>( + vec<3, T, Q>(Inv[0], static_cast(0)), + vec<3, T, Q>(Inv[1], static_cast(0)), + vec<3, T, Q>(-Inv * vec<2, T, Q>(m[2]), static_cast(1))); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> affineInverse(mat<4, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> affineInverse(mat<4, 4, T, Q> const& m) { - mat<3, 3, T, P> const Inv(inverse(mat<3, 3, T, P>(m))); + mat<3, 3, T, Q> const Inv(inverse(mat<3, 3, T, Q>(m))); - return mat<4, 4, T, P>( - vec<4, T, P>(Inv[0], static_cast(0)), - vec<4, T, P>(Inv[1], static_cast(0)), - vec<4, T, P>(Inv[2], static_cast(0)), - vec<4, T, P>(-Inv * vec<3, T, P>(m[3]), static_cast(1))); + return mat<4, 4, T, Q>( + vec<4, T, Q>(Inv[0], static_cast(0)), + vec<4, T, Q>(Inv[1], static_cast(0)), + vec<4, T, Q>(Inv[2], static_cast(0)), + vec<4, T, Q>(-Inv * vec<3, T, Q>(m[3]), static_cast(1))); } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P> inverseTranspose(mat<2, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> inverseTranspose(mat<2, 2, T, Q> const& m) { T Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1]; - mat<2, 2, T, P> Inverse( + mat<2, 2, T, Q> Inverse( + m[1][1] / Determinant, - m[0][1] / Determinant, - m[1][0] / Determinant, @@ -40,15 +40,15 @@ namespace glm return Inverse; } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> inverseTranspose(mat<3, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> inverseTranspose(mat<3, 3, T, Q> const& m) { T Determinant = + m[0][0] * (m[1][1] * m[2][2] - m[1][2] * m[2][1]) - m[0][1] * (m[1][0] * m[2][2] - m[1][2] * m[2][0]) + m[0][2] * (m[1][0] * m[2][1] - m[1][1] * m[2][0]); - mat<3, 3, T, P> Inverse; + mat<3, 3, T, Q> Inverse; Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]); Inverse[0][1] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]); Inverse[0][2] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]); @@ -63,8 +63,8 @@ namespace glm return Inverse; } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> inverseTranspose(mat<4, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> inverseTranspose(mat<4, 4, T, Q> const& m) { T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; @@ -86,7 +86,7 @@ namespace glm T SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; T SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; - mat<4, 4, T, P> Inverse; + mat<4, 4, T, Q> Inverse; Inverse[0][0] = + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02); Inverse[0][1] = - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04); Inverse[0][2] = + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05); diff --git a/glm/gtc/matrix_transform.hpp b/glm/gtc/matrix_transform.hpp index 7f9a50c7..4a99d4c1 100644 --- a/glm/gtc/matrix_transform.hpp +++ b/glm/gtc/matrix_transform.hpp @@ -52,12 +52,12 @@ namespace glm /// // m[3][0] == 1.0f, m[3][1] == 1.0f, m[3][2] == 1.0f, m[3][3] == 1.0f /// @endcode /// @see gtc_matrix_transform - /// @see - translate(mat<4, 4, T, P> const& m, T x, T y, T z) - /// @see - translate(vec<3, T, P> const& v) - template - GLM_FUNC_DECL mat<4, 4, T, P> translate( - mat<4, 4, T, P> const& m, - vec<3, T, P> const& v); + /// @see - translate(mat<4, 4, T, Q> const& m, T x, T y, T z) + /// @see - translate(vec<3, T, Q> const& v) + template + GLM_FUNC_DECL mat<4, 4, T, Q> translate( + mat<4, 4, T, Q> const& m, + vec<3, T, Q> const& v); /// Builds a rotation 4 * 4 matrix created from an axis vector and an angle. /// @@ -66,13 +66,13 @@ namespace glm /// @param axis Rotation axis, recommended to be normalized. /// @tparam T Value type used to build the matrix. Supported: half, float or double. /// @see gtc_matrix_transform - /// @see - rotate(mat<4, 4, T, P> const& m, T angle, T x, T y, T z) - /// @see - rotate(T angle, vec<3, T, P> const& v) - template - GLM_FUNC_DECL mat<4, 4, T, P> rotate( - mat<4, 4, T, P> const& m, + /// @see - rotate(mat<4, 4, T, Q> const& m, T angle, T x, T y, T z) + /// @see - rotate(T angle, vec<3, T, Q> const& v) + template + GLM_FUNC_DECL mat<4, 4, T, Q> rotate( + mat<4, 4, T, Q> const& m, T angle, - vec<3, T, P> const& axis); + vec<3, T, Q> const& axis); /// Builds a scale 4 * 4 matrix created from 3 scalars. /// @@ -80,12 +80,12 @@ namespace glm /// @param v Ratio of scaling for each axis. /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. /// @see gtc_matrix_transform - /// @see - scale(mat<4, 4, T, P> const& m, T x, T y, T z) - /// @see - scale(vec<3, T, P> const& v) - template - GLM_FUNC_DECL mat<4, 4, T, P> scale( - mat<4, 4, T, P> const& m, - vec<3, T, P> const& v); + /// @see - scale(mat<4, 4, T, Q> const& m, T x, T y, T z) + /// @see - scale(vec<3, T, Q> const& v) + template + GLM_FUNC_DECL mat<4, 4, T, Q> scale( + mat<4, 4, T, Q> const& m, + vec<3, T, Q> const& v); /// Creates a matrix for an orthographic parallel viewing volume, using the default handedness. /// @@ -382,12 +382,12 @@ namespace glm /// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double. /// @tparam U Currently supported: Floating-point types and integer types. /// @see gtc_matrix_transform - template - GLM_FUNC_DECL vec<3, T, P> project( - vec<3, T, P> const& obj, - mat<4, 4, T, P> const& model, - mat<4, 4, T, P> const& proj, - vec<4, U, P> const& viewport); + template + GLM_FUNC_DECL vec<3, T, Q> project( + vec<3, T, Q> const& obj, + mat<4, 4, T, Q> const& model, + mat<4, 4, T, Q> const& proj, + vec<4, U, Q> const& viewport); /// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates. /// @@ -399,12 +399,12 @@ namespace glm /// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double. /// @tparam U Currently supported: Floating-point types and integer types. /// @see gtc_matrix_transform - template - GLM_FUNC_DECL vec<3, T, P> unProject( - vec<3, T, P> const& win, - mat<4, 4, T, P> const& model, - mat<4, 4, T, P> const& proj, - vec<4, U, P> const& viewport); + template + GLM_FUNC_DECL vec<3, T, Q> unProject( + vec<3, T, Q> const& win, + mat<4, 4, T, Q> const& model, + mat<4, 4, T, Q> const& proj, + vec<4, U, Q> const& viewport); /// Define a picking region /// @@ -414,11 +414,11 @@ namespace glm /// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double. /// @tparam U Currently supported: Floating-point types and integer types. /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, P> pickMatrix( - vec<2, T, P> const& center, - vec<2, T, P> const& delta, - vec<4, U, P> const& viewport); + template + GLM_FUNC_DECL mat<4, 4, T, Q> pickMatrix( + vec<2, T, Q> const& center, + vec<2, T, Q> const& delta, + vec<4, U, Q> const& viewport); /// Build a look at view matrix based on the default handedness. /// @@ -427,11 +427,11 @@ namespace glm /// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) /// @see gtc_matrix_transform /// @see - frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) - template - GLM_FUNC_DECL mat<4, 4, T, P> lookAt( - vec<3, T, P> const& eye, - vec<3, T, P> const& center, - vec<3, T, P> const& up); + template + GLM_FUNC_DECL mat<4, 4, T, Q> lookAt( + vec<3, T, Q> const& eye, + vec<3, T, Q> const& center, + vec<3, T, Q> const& up); /// Build a right handed look at view matrix. /// @@ -440,11 +440,11 @@ namespace glm /// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) /// @see gtc_matrix_transform /// @see - frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) - template - GLM_FUNC_DECL mat<4, 4, T, P> lookAtRH( - vec<3, T, P> const& eye, - vec<3, T, P> const& center, - vec<3, T, P> const& up); + template + GLM_FUNC_DECL mat<4, 4, T, Q> lookAtRH( + vec<3, T, Q> const& eye, + vec<3, T, Q> const& center, + vec<3, T, Q> const& up); /// Build a left handed look at view matrix. /// @@ -453,11 +453,11 @@ namespace glm /// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) /// @see gtc_matrix_transform /// @see - frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) - template - GLM_FUNC_DECL mat<4, 4, T, P> lookAtLH( - vec<3, T, P> const& eye, - vec<3, T, P> const& center, - vec<3, T, P> const& up); + template + GLM_FUNC_DECL mat<4, 4, T, Q> lookAtLH( + vec<3, T, Q> const& eye, + vec<3, T, Q> const& center, + vec<3, T, Q> const& up); /// @} }//namespace glm diff --git a/glm/gtc/matrix_transform.inl b/glm/gtc/matrix_transform.inl index e3749b49..0dda98a2 100644 --- a/glm/gtc/matrix_transform.inl +++ b/glm/gtc/matrix_transform.inl @@ -7,25 +7,25 @@ namespace glm { - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> translate(mat<4, 4, T, P> const& m, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> translate(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v) { - mat<4, 4, T, P> Result(m); + mat<4, 4, T, Q> Result(m); Result[3] = m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3]; return Result; } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> rotate(mat<4, 4, T, P> const& m, T angle, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rotate(mat<4, 4, T, Q> const& m, T angle, vec<3, T, Q> const& v) { T const a = angle; T const c = cos(a); T const s = sin(a); - vec<3, T, P> axis(normalize(v)); - vec<3, T, P> temp((T(1) - c) * axis); + vec<3, T, Q> axis(normalize(v)); + vec<3, T, Q> temp((T(1) - c) * axis); - mat<4, 4, T, P> Rotate; + mat<4, 4, T, Q> Rotate; Rotate[0][0] = c + temp[0] * axis[0]; Rotate[0][1] = temp[0] * axis[1] + s * axis[2]; Rotate[0][2] = temp[0] * axis[2] - s * axis[1]; @@ -38,7 +38,7 @@ namespace glm Rotate[2][1] = temp[2] * axis[1] - s * axis[0]; Rotate[2][2] = c + temp[2] * axis[2]; - mat<4, 4, T, P> Result; + mat<4, 4, T, Q> Result; Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2]; Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2]; Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2]; @@ -46,15 +46,15 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> rotate_slow(mat<4, 4, T, P> const& m, T angle, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rotate_slow(mat<4, 4, T, Q> const& m, T angle, vec<3, T, Q> const& v) { T const a = angle; T const c = cos(a); T const s = sin(a); - mat<4, 4, T, P> Result; + mat<4, 4, T, Q> Result; - vec<3, T, P> axis = normalize(v); + vec<3, T, Q> axis = normalize(v); Result[0][0] = c + (static_cast(1) - c) * axis.x * axis.x; Result[0][1] = (static_cast(1) - c) * axis.x * axis.y + s * axis.z; @@ -71,14 +71,14 @@ namespace glm Result[2][2] = c + (static_cast(1) - c) * axis.z * axis.z; Result[2][3] = static_cast(0); - Result[3] = vec<4, T, P>(0, 0, 0, 1); + Result[3] = vec<4, T, Q>(0, 0, 0, 1); return m * Result; } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> scale(mat<4, 4, T, P> const& m, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scale(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v) { - mat<4, 4, T, P> Result; + mat<4, 4, T, Q> Result; Result[0] = m[0] * v[0]; Result[1] = m[1] * v[1]; Result[2] = m[2] * v[2]; @@ -86,10 +86,10 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> scale_slow(mat<4, 4, T, P> const& m, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scale_slow(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v) { - mat<4, 4, T, P> Result(T(1)); + mat<4, 4, T, Q> Result(T(1)); Result[0][0] = v.x; Result[1][1] = v.y; Result[2][2] = v.z; @@ -435,16 +435,16 @@ namespace glm return tweakedInfinitePerspective(fovy, aspect, zNear, epsilon()); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> project + template + GLM_FUNC_QUALIFIER vec<3, T, Q> project ( - vec<3, T, P> const& obj, - mat<4, 4, T, P> const& model, - mat<4, 4, T, P> const& proj, - vec<4, U, P> const& viewport + vec<3, T, Q> const& obj, + mat<4, 4, T, Q> const& model, + mat<4, 4, T, Q> const& proj, + vec<4, U, Q> const& viewport ) { - vec<4, T, P> tmp = vec<4, T, P>(obj, static_cast(1)); + vec<4, T, Q> tmp = vec<4, T, Q>(obj, static_cast(1)); tmp = model * tmp; tmp = proj * tmp; @@ -458,21 +458,21 @@ namespace glm tmp[0] = tmp[0] * T(viewport[2]) + T(viewport[0]); tmp[1] = tmp[1] * T(viewport[3]) + T(viewport[1]); - return vec<3, T, P>(tmp); + return vec<3, T, Q>(tmp); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> unProject + template + GLM_FUNC_QUALIFIER vec<3, T, Q> unProject ( - vec<3, T, P> const& win, - mat<4, 4, T, P> const& model, - mat<4, 4, T, P> const& proj, - vec<4, U, P> const& viewport + vec<3, T, Q> const& win, + mat<4, 4, T, Q> const& model, + mat<4, 4, T, Q> const& proj, + vec<4, U, Q> const& viewport ) { - mat<4, 4, T, P> Inverse = inverse(proj * model); + mat<4, 4, T, Q> Inverse = inverse(proj * model); - vec<4, T, P> tmp = vec<4, T, P>(win, T(1)); + vec<4, T, Q> tmp = vec<4, T, Q>(win, T(1)); tmp.x = (tmp.x - T(viewport[0])) / T(viewport[2]); tmp.y = (tmp.y - T(viewport[1])) / T(viewport[3]); # if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE @@ -482,33 +482,33 @@ namespace glm tmp = tmp * static_cast(2) - static_cast(1); # endif - vec<4, T, P> obj = Inverse * tmp; + vec<4, T, Q> obj = Inverse * tmp; obj /= obj.w; - return vec<3, T, P>(obj); + return vec<3, T, Q>(obj); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> pickMatrix(vec<2, T, P> const& center, vec<2, T, P> const& delta, vec<4, U, P> const& viewport) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> pickMatrix(vec<2, T, Q> const& center, vec<2, T, Q> const& delta, vec<4, U, Q> const& viewport) { assert(delta.x > static_cast(0) && delta.y > static_cast(0)); - mat<4, 4, T, P> Result(static_cast(1)); + mat<4, 4, T, Q> Result(static_cast(1)); if(!(delta.x > static_cast(0) && delta.y > static_cast(0))) return Result; // Error - vec<3, T, P> Temp( + vec<3, T, Q> Temp( (static_cast(viewport[2]) - static_cast(2) * (center.x - static_cast(viewport[0]))) / delta.x, (static_cast(viewport[3]) - static_cast(2) * (center.y - static_cast(viewport[1]))) / delta.y, static_cast(0)); // Translate and scale the picked region to the entire window Result = translate(Result, Temp); - return scale(Result, vec<3, T, P>(static_cast(viewport[2]) / delta.x, static_cast(viewport[3]) / delta.y, static_cast(1))); + return scale(Result, vec<3, T, Q>(static_cast(viewport[2]) / delta.x, static_cast(viewport[3]) / delta.y, static_cast(1))); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> lookAt(vec<3, T, P> const& eye, vec<3, T, P> const& center, vec<3, T, P> const& up) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> lookAt(vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up) { # if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED return lookAtLH(eye, center, up); @@ -517,19 +517,19 @@ namespace glm # endif } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> lookAtRH + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> lookAtRH ( - vec<3, T, P> const& eye, - vec<3, T, P> const& center, - vec<3, T, P> const& up + vec<3, T, Q> const& eye, + vec<3, T, Q> const& center, + vec<3, T, Q> const& up ) { - vec<3, T, P> const f(normalize(center - eye)); - vec<3, T, P> const s(normalize(cross(f, up))); - vec<3, T, P> const u(cross(s, f)); + vec<3, T, Q> const f(normalize(center - eye)); + vec<3, T, Q> const s(normalize(cross(f, up))); + vec<3, T, Q> const u(cross(s, f)); - mat<4, 4, T, P> Result(1); + mat<4, 4, T, Q> Result(1); Result[0][0] = s.x; Result[1][0] = s.y; Result[2][0] = s.z; @@ -545,19 +545,19 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> lookAtLH + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> lookAtLH ( - vec<3, T, P> const& eye, - vec<3, T, P> const& center, - vec<3, T, P> const& up + vec<3, T, Q> const& eye, + vec<3, T, Q> const& center, + vec<3, T, Q> const& up ) { - vec<3, T, P> const f(normalize(center - eye)); - vec<3, T, P> const s(normalize(cross(up, f))); - vec<3, T, P> const u(cross(f, s)); + vec<3, T, Q> const f(normalize(center - eye)); + vec<3, T, Q> const s(normalize(cross(up, f))); + vec<3, T, Q> const u(cross(f, s)); - mat<4, 4, T, P> Result(1); + mat<4, 4, T, Q> Result(1); Result[0][0] = s.x; Result[1][0] = s.y; Result[2][0] = s.z; diff --git a/glm/gtc/noise.hpp b/glm/gtc/noise.hpp index eab5593a..b80124ed 100644 --- a/glm/gtc/noise.hpp +++ b/glm/gtc/noise.hpp @@ -37,22 +37,22 @@ namespace glm /// Classic perlin noise. /// @see gtc_noise - template + template GLM_FUNC_DECL T perlin( - vec const& p); + vec const& p); /// Periodic perlin noise. /// @see gtc_noise - template + template GLM_FUNC_DECL T perlin( - vec const& p, - vec const& rep); + vec const& p, + vec const& rep); /// Simplex noise. /// @see gtc_noise - template + template GLM_FUNC_DECL T simplex( - vec const& p); + vec const& p); /// @} }//namespace glm diff --git a/glm/gtc/noise.inl b/glm/gtc/noise.inl index e1b5eae1..9b4ed79b 100644 --- a/glm/gtc/noise.inl +++ b/glm/gtc/noise.inl @@ -9,635 +9,635 @@ namespace glm{ namespace gtc { - template - GLM_FUNC_QUALIFIER vec<4, T, P> grad4(T const& j, vec<4, T, P> const& ip) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> grad4(T const& j, vec<4, T, Q> const& ip) { - vec<3, T, P> pXYZ = floor(fract(vec<3, T, P>(j) * vec<3, T, P>(ip)) * T(7)) * ip[2] - T(1); - T pW = static_cast(1.5) - dot(abs(pXYZ), vec<3, T, P>(1)); - vec<4, T, P> s = vec<4, T, P>(lessThan(vec<4, T, P>(pXYZ, pW), vec<4, T, P>(0.0))); - pXYZ = pXYZ + (vec<3, T, P>(s) * T(2) - T(1)) * s.w; - return vec<4, T, P>(pXYZ, pW); + vec<3, T, Q> pXYZ = floor(fract(vec<3, T, Q>(j) * vec<3, T, Q>(ip)) * T(7)) * ip[2] - T(1); + T pW = static_cast(1.5) - dot(abs(pXYZ), vec<3, T, Q>(1)); + vec<4, T, Q> s = vec<4, T, Q>(lessThan(vec<4, T, Q>(pXYZ, pW), vec<4, T, Q>(0.0))); + pXYZ = pXYZ + (vec<3, T, Q>(s) * T(2) - T(1)) * s.w; + return vec<4, T, Q>(pXYZ, pW); } }//namespace gtc // Classic Perlin noise - template - GLM_FUNC_QUALIFIER T perlin(vec<2, T, P> const& Position) + template + GLM_FUNC_QUALIFIER T perlin(vec<2, T, Q> const& Position) { - vec<4, T, P> Pi = glm::floor(vec<4, T, P>(Position.x, Position.y, Position.x, Position.y)) + vec<4, T, P>(0.0, 0.0, 1.0, 1.0); - vec<4, T, P> Pf = glm::fract(vec<4, T, P>(Position.x, Position.y, Position.x, Position.y)) - vec<4, T, P>(0.0, 0.0, 1.0, 1.0); - Pi = mod(Pi, vec<4, T, P>(289)); // To avoid truncation effects in permutation - vec<4, T, P> ix(Pi.x, Pi.z, Pi.x, Pi.z); - vec<4, T, P> iy(Pi.y, Pi.y, Pi.w, Pi.w); - vec<4, T, P> fx(Pf.x, Pf.z, Pf.x, Pf.z); - vec<4, T, P> fy(Pf.y, Pf.y, Pf.w, Pf.w); + vec<4, T, Q> Pi = glm::floor(vec<4, T, Q>(Position.x, Position.y, Position.x, Position.y)) + vec<4, T, Q>(0.0, 0.0, 1.0, 1.0); + vec<4, T, Q> Pf = glm::fract(vec<4, T, Q>(Position.x, Position.y, Position.x, Position.y)) - vec<4, T, Q>(0.0, 0.0, 1.0, 1.0); + Pi = mod(Pi, vec<4, T, Q>(289)); // To avoid truncation effects in permutation + vec<4, T, Q> ix(Pi.x, Pi.z, Pi.x, Pi.z); + vec<4, T, Q> iy(Pi.y, Pi.y, Pi.w, Pi.w); + vec<4, T, Q> fx(Pf.x, Pf.z, Pf.x, Pf.z); + vec<4, T, Q> fy(Pf.y, Pf.y, Pf.w, Pf.w); - vec<4, T, P> i = detail::permute(detail::permute(ix) + iy); + vec<4, T, Q> i = detail::permute(detail::permute(ix) + iy); - vec<4, T, P> gx = static_cast(2) * glm::fract(i / T(41)) - T(1); - vec<4, T, P> gy = glm::abs(gx) - T(0.5); - vec<4, T, P> tx = glm::floor(gx + T(0.5)); + vec<4, T, Q> gx = static_cast(2) * glm::fract(i / T(41)) - T(1); + vec<4, T, Q> gy = glm::abs(gx) - T(0.5); + vec<4, T, Q> tx = glm::floor(gx + T(0.5)); gx = gx - tx; - vec<2, T, P> g00(gx.x, gy.x); - vec<2, T, P> g10(gx.y, gy.y); - vec<2, T, P> g01(gx.z, gy.z); - vec<2, T, P> g11(gx.w, gy.w); + vec<2, T, Q> g00(gx.x, gy.x); + vec<2, T, Q> g10(gx.y, gy.y); + vec<2, T, Q> g01(gx.z, gy.z); + vec<2, T, Q> g11(gx.w, gy.w); - vec<4, T, P> norm = detail::taylorInvSqrt(vec<4, T, P>(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11))); + vec<4, T, Q> norm = detail::taylorInvSqrt(vec<4, T, Q>(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11))); g00 *= norm.x; g01 *= norm.y; g10 *= norm.z; g11 *= norm.w; - T n00 = dot(g00, vec<2, T, P>(fx.x, fy.x)); - T n10 = dot(g10, vec<2, T, P>(fx.y, fy.y)); - T n01 = dot(g01, vec<2, T, P>(fx.z, fy.z)); - T n11 = dot(g11, vec<2, T, P>(fx.w, fy.w)); + T n00 = dot(g00, vec<2, T, Q>(fx.x, fy.x)); + T n10 = dot(g10, vec<2, T, Q>(fx.y, fy.y)); + T n01 = dot(g01, vec<2, T, Q>(fx.z, fy.z)); + T n11 = dot(g11, vec<2, T, Q>(fx.w, fy.w)); - vec<2, T, P> fade_xy = detail::fade(vec<2, T, P>(Pf.x, Pf.y)); - vec<2, T, P> n_x = mix(vec<2, T, P>(n00, n01), vec<2, T, P>(n10, n11), fade_xy.x); + vec<2, T, Q> fade_xy = detail::fade(vec<2, T, Q>(Pf.x, Pf.y)); + vec<2, T, Q> n_x = mix(vec<2, T, Q>(n00, n01), vec<2, T, Q>(n10, n11), fade_xy.x); T n_xy = mix(n_x.x, n_x.y, fade_xy.y); return T(2.3) * n_xy; } // Classic Perlin noise - template - GLM_FUNC_QUALIFIER T perlin(vec<3, T, P> const& Position) + template + GLM_FUNC_QUALIFIER T perlin(vec<3, T, Q> const& Position) { - vec<3, T, P> Pi0 = floor(Position); // Integer part for indexing - vec<3, T, P> Pi1 = Pi0 + T(1); // Integer part + 1 + vec<3, T, Q> Pi0 = floor(Position); // Integer part for indexing + vec<3, T, Q> Pi1 = Pi0 + T(1); // Integer part + 1 Pi0 = detail::mod289(Pi0); Pi1 = detail::mod289(Pi1); - vec<3, T, P> Pf0 = fract(Position); // Fractional part for interpolation - vec<3, T, P> Pf1 = Pf0 - T(1); // Fractional part - 1.0 - vec<4, T, P> ix(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - vec<4, T, P> iy = vec<4, T, P>(vec<2, T, P>(Pi0.y), vec<2, T, P>(Pi1.y)); - vec<4, T, P> iz0(Pi0.z); - vec<4, T, P> iz1(Pi1.z); + vec<3, T, Q> Pf0 = fract(Position); // Fractional part for interpolation + vec<3, T, Q> Pf1 = Pf0 - T(1); // Fractional part - 1.0 + vec<4, T, Q> ix(Pi0.x, Pi1.x, Pi0.x, Pi1.x); + vec<4, T, Q> iy = vec<4, T, Q>(vec<2, T, Q>(Pi0.y), vec<2, T, Q>(Pi1.y)); + vec<4, T, Q> iz0(Pi0.z); + vec<4, T, Q> iz1(Pi1.z); - vec<4, T, P> ixy = detail::permute(detail::permute(ix) + iy); - vec<4, T, P> ixy0 = detail::permute(ixy + iz0); - vec<4, T, P> ixy1 = detail::permute(ixy + iz1); + vec<4, T, Q> ixy = detail::permute(detail::permute(ix) + iy); + vec<4, T, Q> ixy0 = detail::permute(ixy + iz0); + vec<4, T, Q> ixy1 = detail::permute(ixy + iz1); - vec<4, T, P> gx0 = ixy0 * T(1.0 / 7.0); - vec<4, T, P> gy0 = fract(floor(gx0) * T(1.0 / 7.0)) - T(0.5); + vec<4, T, Q> gx0 = ixy0 * T(1.0 / 7.0); + vec<4, T, Q> gy0 = fract(floor(gx0) * T(1.0 / 7.0)) - T(0.5); gx0 = fract(gx0); - vec<4, T, P> gz0 = vec<4, T, P>(0.5) - abs(gx0) - abs(gy0); - vec<4, T, P> sz0 = step(gz0, vec<4, T, P>(0.0)); + vec<4, T, Q> gz0 = vec<4, T, Q>(0.5) - abs(gx0) - abs(gy0); + vec<4, T, Q> sz0 = step(gz0, vec<4, T, Q>(0.0)); gx0 -= sz0 * (step(T(0), gx0) - T(0.5)); gy0 -= sz0 * (step(T(0), gy0) - T(0.5)); - vec<4, T, P> gx1 = ixy1 * T(1.0 / 7.0); - vec<4, T, P> gy1 = fract(floor(gx1) * T(1.0 / 7.0)) - T(0.5); + vec<4, T, Q> gx1 = ixy1 * T(1.0 / 7.0); + vec<4, T, Q> gy1 = fract(floor(gx1) * T(1.0 / 7.0)) - T(0.5); gx1 = fract(gx1); - vec<4, T, P> gz1 = vec<4, T, P>(0.5) - abs(gx1) - abs(gy1); - vec<4, T, P> sz1 = step(gz1, vec<4, T, P>(0.0)); + vec<4, T, Q> gz1 = vec<4, T, Q>(0.5) - abs(gx1) - abs(gy1); + vec<4, T, Q> sz1 = step(gz1, vec<4, T, Q>(0.0)); gx1 -= sz1 * (step(T(0), gx1) - T(0.5)); gy1 -= sz1 * (step(T(0), gy1) - T(0.5)); - vec<3, T, P> g000(gx0.x, gy0.x, gz0.x); - vec<3, T, P> g100(gx0.y, gy0.y, gz0.y); - vec<3, T, P> g010(gx0.z, gy0.z, gz0.z); - vec<3, T, P> g110(gx0.w, gy0.w, gz0.w); - vec<3, T, P> g001(gx1.x, gy1.x, gz1.x); - vec<3, T, P> g101(gx1.y, gy1.y, gz1.y); - vec<3, T, P> g011(gx1.z, gy1.z, gz1.z); - vec<3, T, P> g111(gx1.w, gy1.w, gz1.w); + vec<3, T, Q> g000(gx0.x, gy0.x, gz0.x); + vec<3, T, Q> g100(gx0.y, gy0.y, gz0.y); + vec<3, T, Q> g010(gx0.z, gy0.z, gz0.z); + vec<3, T, Q> g110(gx0.w, gy0.w, gz0.w); + vec<3, T, Q> g001(gx1.x, gy1.x, gz1.x); + vec<3, T, Q> g101(gx1.y, gy1.y, gz1.y); + vec<3, T, Q> g011(gx1.z, gy1.z, gz1.z); + vec<3, T, Q> g111(gx1.w, gy1.w, gz1.w); - vec<4, T, P> norm0 = detail::taylorInvSqrt(vec<4, T, P>(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); + vec<4, T, Q> norm0 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); g000 *= norm0.x; g010 *= norm0.y; g100 *= norm0.z; g110 *= norm0.w; - vec<4, T, P> norm1 = detail::taylorInvSqrt(vec<4, T, P>(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); + vec<4, T, Q> norm1 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); g001 *= norm1.x; g011 *= norm1.y; g101 *= norm1.z; g111 *= norm1.w; T n000 = dot(g000, Pf0); - T n100 = dot(g100, vec<3, T, P>(Pf1.x, Pf0.y, Pf0.z)); - T n010 = dot(g010, vec<3, T, P>(Pf0.x, Pf1.y, Pf0.z)); - T n110 = dot(g110, vec<3, T, P>(Pf1.x, Pf1.y, Pf0.z)); - T n001 = dot(g001, vec<3, T, P>(Pf0.x, Pf0.y, Pf1.z)); - T n101 = dot(g101, vec<3, T, P>(Pf1.x, Pf0.y, Pf1.z)); - T n011 = dot(g011, vec<3, T, P>(Pf0.x, Pf1.y, Pf1.z)); + T n100 = dot(g100, vec<3, T, Q>(Pf1.x, Pf0.y, Pf0.z)); + T n010 = dot(g010, vec<3, T, Q>(Pf0.x, Pf1.y, Pf0.z)); + T n110 = dot(g110, vec<3, T, Q>(Pf1.x, Pf1.y, Pf0.z)); + T n001 = dot(g001, vec<3, T, Q>(Pf0.x, Pf0.y, Pf1.z)); + T n101 = dot(g101, vec<3, T, Q>(Pf1.x, Pf0.y, Pf1.z)); + T n011 = dot(g011, vec<3, T, Q>(Pf0.x, Pf1.y, Pf1.z)); T n111 = dot(g111, Pf1); - vec<3, T, P> fade_xyz = detail::fade(Pf0); - vec<4, T, P> n_z = mix(vec<4, T, P>(n000, n100, n010, n110), vec<4, T, P>(n001, n101, n011, n111), fade_xyz.z); - vec<2, T, P> n_yz = mix(vec<2, T, P>(n_z.x, n_z.y), vec<2, T, P>(n_z.z, n_z.w), fade_xyz.y); + vec<3, T, Q> fade_xyz = detail::fade(Pf0); + vec<4, T, Q> n_z = mix(vec<4, T, Q>(n000, n100, n010, n110), vec<4, T, Q>(n001, n101, n011, n111), fade_xyz.z); + vec<2, T, Q> n_yz = mix(vec<2, T, Q>(n_z.x, n_z.y), vec<2, T, Q>(n_z.z, n_z.w), fade_xyz.y); T n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); return T(2.2) * n_xyz; } /* // Classic Perlin noise - template - GLM_FUNC_QUALIFIER T perlin(vec<3, T, P> const& P) + template + GLM_FUNC_QUALIFIER T perlin(vec<3, T, Q> const& P) { - vec<3, T, P> Pi0 = floor(P); // Integer part for indexing - vec<3, T, P> Pi1 = Pi0 + T(1); // Integer part + 1 + vec<3, T, Q> Pi0 = floor(P); // Integer part for indexing + vec<3, T, Q> Pi1 = Pi0 + T(1); // Integer part + 1 Pi0 = mod(Pi0, T(289)); Pi1 = mod(Pi1, T(289)); - vec<3, T, P> Pf0 = fract(P); // Fractional part for interpolation - vec<3, T, P> Pf1 = Pf0 - T(1); // Fractional part - 1.0 - vec<4, T, P> ix(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - vec<4, T, P> iy(Pi0.y, Pi0.y, Pi1.y, Pi1.y); - vec<4, T, P> iz0(Pi0.z); - vec<4, T, P> iz1(Pi1.z); + vec<3, T, Q> Pf0 = fract(P); // Fractional part for interpolation + vec<3, T, Q> Pf1 = Pf0 - T(1); // Fractional part - 1.0 + vec<4, T, Q> ix(Pi0.x, Pi1.x, Pi0.x, Pi1.x); + vec<4, T, Q> iy(Pi0.y, Pi0.y, Pi1.y, Pi1.y); + vec<4, T, Q> iz0(Pi0.z); + vec<4, T, Q> iz1(Pi1.z); - vec<4, T, P> ixy = permute(permute(ix) + iy); - vec<4, T, P> ixy0 = permute(ixy + iz0); - vec<4, T, P> ixy1 = permute(ixy + iz1); + vec<4, T, Q> ixy = permute(permute(ix) + iy); + vec<4, T, Q> ixy0 = permute(ixy + iz0); + vec<4, T, Q> ixy1 = permute(ixy + iz1); - vec<4, T, P> gx0 = ixy0 / T(7); - vec<4, T, P> gy0 = fract(floor(gx0) / T(7)) - T(0.5); + vec<4, T, Q> gx0 = ixy0 / T(7); + vec<4, T, Q> gy0 = fract(floor(gx0) / T(7)) - T(0.5); gx0 = fract(gx0); - vec<4, T, P> gz0 = vec<4, T, P>(0.5) - abs(gx0) - abs(gy0); - vec<4, T, P> sz0 = step(gz0, vec<4, T, P>(0.0)); + vec<4, T, Q> gz0 = vec<4, T, Q>(0.5) - abs(gx0) - abs(gy0); + vec<4, T, Q> sz0 = step(gz0, vec<4, T, Q>(0.0)); gx0 -= sz0 * (step(0.0, gx0) - T(0.5)); gy0 -= sz0 * (step(0.0, gy0) - T(0.5)); - vec<4, T, P> gx1 = ixy1 / T(7); - vec<4, T, P> gy1 = fract(floor(gx1) / T(7)) - T(0.5); + vec<4, T, Q> gx1 = ixy1 / T(7); + vec<4, T, Q> gy1 = fract(floor(gx1) / T(7)) - T(0.5); gx1 = fract(gx1); - vec<4, T, P> gz1 = vec<4, T, P>(0.5) - abs(gx1) - abs(gy1); - vec<4, T, P> sz1 = step(gz1, vec<4, T, P>(0.0)); + vec<4, T, Q> gz1 = vec<4, T, Q>(0.5) - abs(gx1) - abs(gy1); + vec<4, T, Q> sz1 = step(gz1, vec<4, T, Q>(0.0)); gx1 -= sz1 * (step(T(0), gx1) - T(0.5)); gy1 -= sz1 * (step(T(0), gy1) - T(0.5)); - vec<3, T, P> g000(gx0.x, gy0.x, gz0.x); - vec<3, T, P> g100(gx0.y, gy0.y, gz0.y); - vec<3, T, P> g010(gx0.z, gy0.z, gz0.z); - vec<3, T, P> g110(gx0.w, gy0.w, gz0.w); - vec<3, T, P> g001(gx1.x, gy1.x, gz1.x); - vec<3, T, P> g101(gx1.y, gy1.y, gz1.y); - vec<3, T, P> g011(gx1.z, gy1.z, gz1.z); - vec<3, T, P> g111(gx1.w, gy1.w, gz1.w); + vec<3, T, Q> g000(gx0.x, gy0.x, gz0.x); + vec<3, T, Q> g100(gx0.y, gy0.y, gz0.y); + vec<3, T, Q> g010(gx0.z, gy0.z, gz0.z); + vec<3, T, Q> g110(gx0.w, gy0.w, gz0.w); + vec<3, T, Q> g001(gx1.x, gy1.x, gz1.x); + vec<3, T, Q> g101(gx1.y, gy1.y, gz1.y); + vec<3, T, Q> g011(gx1.z, gy1.z, gz1.z); + vec<3, T, Q> g111(gx1.w, gy1.w, gz1.w); - vec<4, T, P> norm0 = taylorInvSqrt(vec<4, T, P>(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); + vec<4, T, Q> norm0 = taylorInvSqrt(vec<4, T, Q>(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); g000 *= norm0.x; g010 *= norm0.y; g100 *= norm0.z; g110 *= norm0.w; - vec<4, T, P> norm1 = taylorInvSqrt(vec<4, T, P>(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); + vec<4, T, Q> norm1 = taylorInvSqrt(vec<4, T, Q>(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); g001 *= norm1.x; g011 *= norm1.y; g101 *= norm1.z; g111 *= norm1.w; T n000 = dot(g000, Pf0); - T n100 = dot(g100, vec<3, T, P>(Pf1.x, Pf0.y, Pf0.z)); - T n010 = dot(g010, vec<3, T, P>(Pf0.x, Pf1.y, Pf0.z)); - T n110 = dot(g110, vec<3, T, P>(Pf1.x, Pf1.y, Pf0.z)); - T n001 = dot(g001, vec<3, T, P>(Pf0.x, Pf0.y, Pf1.z)); - T n101 = dot(g101, vec<3, T, P>(Pf1.x, Pf0.y, Pf1.z)); - T n011 = dot(g011, vec<3, T, P>(Pf0.x, Pf1.y, Pf1.z)); + T n100 = dot(g100, vec<3, T, Q>(Pf1.x, Pf0.y, Pf0.z)); + T n010 = dot(g010, vec<3, T, Q>(Pf0.x, Pf1.y, Pf0.z)); + T n110 = dot(g110, vec<3, T, Q>(Pf1.x, Pf1.y, Pf0.z)); + T n001 = dot(g001, vec<3, T, Q>(Pf0.x, Pf0.y, Pf1.z)); + T n101 = dot(g101, vec<3, T, Q>(Pf1.x, Pf0.y, Pf1.z)); + T n011 = dot(g011, vec<3, T, Q>(Pf0.x, Pf1.y, Pf1.z)); T n111 = dot(g111, Pf1); - vec<3, T, P> fade_xyz = fade(Pf0); - vec<4, T, P> n_z = mix(vec<4, T, P>(n000, n100, n010, n110), vec<4, T, P>(n001, n101, n011, n111), fade_xyz.z); - vec<2, T, P> n_yz = mix( - vec<2, T, P>(n_z.x, n_z.y), - vec<2, T, P>(n_z.z, n_z.w), fade_xyz.y); + vec<3, T, Q> fade_xyz = fade(Pf0); + vec<4, T, Q> n_z = mix(vec<4, T, Q>(n000, n100, n010, n110), vec<4, T, Q>(n001, n101, n011, n111), fade_xyz.z); + vec<2, T, Q> n_yz = mix( + vec<2, T, Q>(n_z.x, n_z.y), + vec<2, T, Q>(n_z.z, n_z.w), fade_xyz.y); T n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); return T(2.2) * n_xyz; } */ // Classic Perlin noise - template - GLM_FUNC_QUALIFIER T perlin(vec<4, T, P> const& Position) + template + GLM_FUNC_QUALIFIER T perlin(vec<4, T, Q> const& Position) { - vec<4, T, P> Pi0 = floor(Position); // Integer part for indexing - vec<4, T, P> Pi1 = Pi0 + T(1); // Integer part + 1 - Pi0 = mod(Pi0, vec<4, T, P>(289)); - Pi1 = mod(Pi1, vec<4, T, P>(289)); - vec<4, T, P> Pf0 = fract(Position); // Fractional part for interpolation - vec<4, T, P> Pf1 = Pf0 - T(1); // Fractional part - 1.0 - vec<4, T, P> ix(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - vec<4, T, P> iy(Pi0.y, Pi0.y, Pi1.y, Pi1.y); - vec<4, T, P> iz0(Pi0.z); - vec<4, T, P> iz1(Pi1.z); - vec<4, T, P> iw0(Pi0.w); - vec<4, T, P> iw1(Pi1.w); + vec<4, T, Q> Pi0 = floor(Position); // Integer part for indexing + vec<4, T, Q> Pi1 = Pi0 + T(1); // Integer part + 1 + Pi0 = mod(Pi0, vec<4, T, Q>(289)); + Pi1 = mod(Pi1, vec<4, T, Q>(289)); + vec<4, T, Q> Pf0 = fract(Position); // Fractional part for interpolation + vec<4, T, Q> Pf1 = Pf0 - T(1); // Fractional part - 1.0 + vec<4, T, Q> ix(Pi0.x, Pi1.x, Pi0.x, Pi1.x); + vec<4, T, Q> iy(Pi0.y, Pi0.y, Pi1.y, Pi1.y); + vec<4, T, Q> iz0(Pi0.z); + vec<4, T, Q> iz1(Pi1.z); + vec<4, T, Q> iw0(Pi0.w); + vec<4, T, Q> iw1(Pi1.w); - vec<4, T, P> ixy = detail::permute(detail::permute(ix) + iy); - vec<4, T, P> ixy0 = detail::permute(ixy + iz0); - vec<4, T, P> ixy1 = detail::permute(ixy + iz1); - vec<4, T, P> ixy00 = detail::permute(ixy0 + iw0); - vec<4, T, P> ixy01 = detail::permute(ixy0 + iw1); - vec<4, T, P> ixy10 = detail::permute(ixy1 + iw0); - vec<4, T, P> ixy11 = detail::permute(ixy1 + iw1); + vec<4, T, Q> ixy = detail::permute(detail::permute(ix) + iy); + vec<4, T, Q> ixy0 = detail::permute(ixy + iz0); + vec<4, T, Q> ixy1 = detail::permute(ixy + iz1); + vec<4, T, Q> ixy00 = detail::permute(ixy0 + iw0); + vec<4, T, Q> ixy01 = detail::permute(ixy0 + iw1); + vec<4, T, Q> ixy10 = detail::permute(ixy1 + iw0); + vec<4, T, Q> ixy11 = detail::permute(ixy1 + iw1); - vec<4, T, P> gx00 = ixy00 / T(7); - vec<4, T, P> gy00 = floor(gx00) / T(7); - vec<4, T, P> gz00 = floor(gy00) / T(6); + vec<4, T, Q> gx00 = ixy00 / T(7); + vec<4, T, Q> gy00 = floor(gx00) / T(7); + vec<4, T, Q> gz00 = floor(gy00) / T(6); gx00 = fract(gx00) - T(0.5); gy00 = fract(gy00) - T(0.5); gz00 = fract(gz00) - T(0.5); - vec<4, T, P> gw00 = vec<4, T, P>(0.75) - abs(gx00) - abs(gy00) - abs(gz00); - vec<4, T, P> sw00 = step(gw00, vec<4, T, P>(0.0)); + vec<4, T, Q> gw00 = vec<4, T, Q>(0.75) - abs(gx00) - abs(gy00) - abs(gz00); + vec<4, T, Q> sw00 = step(gw00, vec<4, T, Q>(0.0)); gx00 -= sw00 * (step(T(0), gx00) - T(0.5)); gy00 -= sw00 * (step(T(0), gy00) - T(0.5)); - vec<4, T, P> gx01 = ixy01 / T(7); - vec<4, T, P> gy01 = floor(gx01) / T(7); - vec<4, T, P> gz01 = floor(gy01) / T(6); + vec<4, T, Q> gx01 = ixy01 / T(7); + vec<4, T, Q> gy01 = floor(gx01) / T(7); + vec<4, T, Q> gz01 = floor(gy01) / T(6); gx01 = fract(gx01) - T(0.5); gy01 = fract(gy01) - T(0.5); gz01 = fract(gz01) - T(0.5); - vec<4, T, P> gw01 = vec<4, T, P>(0.75) - abs(gx01) - abs(gy01) - abs(gz01); - vec<4, T, P> sw01 = step(gw01, vec<4, T, P>(0.0)); + vec<4, T, Q> gw01 = vec<4, T, Q>(0.75) - abs(gx01) - abs(gy01) - abs(gz01); + vec<4, T, Q> sw01 = step(gw01, vec<4, T, Q>(0.0)); gx01 -= sw01 * (step(T(0), gx01) - T(0.5)); gy01 -= sw01 * (step(T(0), gy01) - T(0.5)); - vec<4, T, P> gx10 = ixy10 / T(7); - vec<4, T, P> gy10 = floor(gx10) / T(7); - vec<4, T, P> gz10 = floor(gy10) / T(6); + vec<4, T, Q> gx10 = ixy10 / T(7); + vec<4, T, Q> gy10 = floor(gx10) / T(7); + vec<4, T, Q> gz10 = floor(gy10) / T(6); gx10 = fract(gx10) - T(0.5); gy10 = fract(gy10) - T(0.5); gz10 = fract(gz10) - T(0.5); - vec<4, T, P> gw10 = vec<4, T, P>(0.75) - abs(gx10) - abs(gy10) - abs(gz10); - vec<4, T, P> sw10 = step(gw10, vec<4, T, P>(0)); + vec<4, T, Q> gw10 = vec<4, T, Q>(0.75) - abs(gx10) - abs(gy10) - abs(gz10); + vec<4, T, Q> sw10 = step(gw10, vec<4, T, Q>(0)); gx10 -= sw10 * (step(T(0), gx10) - T(0.5)); gy10 -= sw10 * (step(T(0), gy10) - T(0.5)); - vec<4, T, P> gx11 = ixy11 / T(7); - vec<4, T, P> gy11 = floor(gx11) / T(7); - vec<4, T, P> gz11 = floor(gy11) / T(6); + vec<4, T, Q> gx11 = ixy11 / T(7); + vec<4, T, Q> gy11 = floor(gx11) / T(7); + vec<4, T, Q> gz11 = floor(gy11) / T(6); gx11 = fract(gx11) - T(0.5); gy11 = fract(gy11) - T(0.5); gz11 = fract(gz11) - T(0.5); - vec<4, T, P> gw11 = vec<4, T, P>(0.75) - abs(gx11) - abs(gy11) - abs(gz11); - vec<4, T, P> sw11 = step(gw11, vec<4, T, P>(0.0)); + vec<4, T, Q> gw11 = vec<4, T, Q>(0.75) - abs(gx11) - abs(gy11) - abs(gz11); + vec<4, T, Q> sw11 = step(gw11, vec<4, T, Q>(0.0)); gx11 -= sw11 * (step(T(0), gx11) - T(0.5)); gy11 -= sw11 * (step(T(0), gy11) - T(0.5)); - vec<4, T, P> g0000(gx00.x, gy00.x, gz00.x, gw00.x); - vec<4, T, P> g1000(gx00.y, gy00.y, gz00.y, gw00.y); - vec<4, T, P> g0100(gx00.z, gy00.z, gz00.z, gw00.z); - vec<4, T, P> g1100(gx00.w, gy00.w, gz00.w, gw00.w); - vec<4, T, P> g0010(gx10.x, gy10.x, gz10.x, gw10.x); - vec<4, T, P> g1010(gx10.y, gy10.y, gz10.y, gw10.y); - vec<4, T, P> g0110(gx10.z, gy10.z, gz10.z, gw10.z); - vec<4, T, P> g1110(gx10.w, gy10.w, gz10.w, gw10.w); - vec<4, T, P> g0001(gx01.x, gy01.x, gz01.x, gw01.x); - vec<4, T, P> g1001(gx01.y, gy01.y, gz01.y, gw01.y); - vec<4, T, P> g0101(gx01.z, gy01.z, gz01.z, gw01.z); - vec<4, T, P> g1101(gx01.w, gy01.w, gz01.w, gw01.w); - vec<4, T, P> g0011(gx11.x, gy11.x, gz11.x, gw11.x); - vec<4, T, P> g1011(gx11.y, gy11.y, gz11.y, gw11.y); - vec<4, T, P> g0111(gx11.z, gy11.z, gz11.z, gw11.z); - vec<4, T, P> g1111(gx11.w, gy11.w, gz11.w, gw11.w); + vec<4, T, Q> g0000(gx00.x, gy00.x, gz00.x, gw00.x); + vec<4, T, Q> g1000(gx00.y, gy00.y, gz00.y, gw00.y); + vec<4, T, Q> g0100(gx00.z, gy00.z, gz00.z, gw00.z); + vec<4, T, Q> g1100(gx00.w, gy00.w, gz00.w, gw00.w); + vec<4, T, Q> g0010(gx10.x, gy10.x, gz10.x, gw10.x); + vec<4, T, Q> g1010(gx10.y, gy10.y, gz10.y, gw10.y); + vec<4, T, Q> g0110(gx10.z, gy10.z, gz10.z, gw10.z); + vec<4, T, Q> g1110(gx10.w, gy10.w, gz10.w, gw10.w); + vec<4, T, Q> g0001(gx01.x, gy01.x, gz01.x, gw01.x); + vec<4, T, Q> g1001(gx01.y, gy01.y, gz01.y, gw01.y); + vec<4, T, Q> g0101(gx01.z, gy01.z, gz01.z, gw01.z); + vec<4, T, Q> g1101(gx01.w, gy01.w, gz01.w, gw01.w); + vec<4, T, Q> g0011(gx11.x, gy11.x, gz11.x, gw11.x); + vec<4, T, Q> g1011(gx11.y, gy11.y, gz11.y, gw11.y); + vec<4, T, Q> g0111(gx11.z, gy11.z, gz11.z, gw11.z); + vec<4, T, Q> g1111(gx11.w, gy11.w, gz11.w, gw11.w); - vec<4, T, P> norm00 = detail::taylorInvSqrt(vec<4, T, P>(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100))); + vec<4, T, Q> norm00 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100))); g0000 *= norm00.x; g0100 *= norm00.y; g1000 *= norm00.z; g1100 *= norm00.w; - vec<4, T, P> norm01 = detail::taylorInvSqrt(vec<4, T, P>(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101))); + vec<4, T, Q> norm01 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101))); g0001 *= norm01.x; g0101 *= norm01.y; g1001 *= norm01.z; g1101 *= norm01.w; - vec<4, T, P> norm10 = detail::taylorInvSqrt(vec<4, T, P>(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110))); + vec<4, T, Q> norm10 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110))); g0010 *= norm10.x; g0110 *= norm10.y; g1010 *= norm10.z; g1110 *= norm10.w; - vec<4, T, P> norm11 = detail::taylorInvSqrt(vec<4, T, P>(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111))); + vec<4, T, Q> norm11 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111))); g0011 *= norm11.x; g0111 *= norm11.y; g1011 *= norm11.z; g1111 *= norm11.w; T n0000 = dot(g0000, Pf0); - T n1000 = dot(g1000, vec<4, T, P>(Pf1.x, Pf0.y, Pf0.z, Pf0.w)); - T n0100 = dot(g0100, vec<4, T, P>(Pf0.x, Pf1.y, Pf0.z, Pf0.w)); - T n1100 = dot(g1100, vec<4, T, P>(Pf1.x, Pf1.y, Pf0.z, Pf0.w)); - T n0010 = dot(g0010, vec<4, T, P>(Pf0.x, Pf0.y, Pf1.z, Pf0.w)); - T n1010 = dot(g1010, vec<4, T, P>(Pf1.x, Pf0.y, Pf1.z, Pf0.w)); - T n0110 = dot(g0110, vec<4, T, P>(Pf0.x, Pf1.y, Pf1.z, Pf0.w)); - T n1110 = dot(g1110, vec<4, T, P>(Pf1.x, Pf1.y, Pf1.z, Pf0.w)); - T n0001 = dot(g0001, vec<4, T, P>(Pf0.x, Pf0.y, Pf0.z, Pf1.w)); - T n1001 = dot(g1001, vec<4, T, P>(Pf1.x, Pf0.y, Pf0.z, Pf1.w)); - T n0101 = dot(g0101, vec<4, T, P>(Pf0.x, Pf1.y, Pf0.z, Pf1.w)); - T n1101 = dot(g1101, vec<4, T, P>(Pf1.x, Pf1.y, Pf0.z, Pf1.w)); - T n0011 = dot(g0011, vec<4, T, P>(Pf0.x, Pf0.y, Pf1.z, Pf1.w)); - T n1011 = dot(g1011, vec<4, T, P>(Pf1.x, Pf0.y, Pf1.z, Pf1.w)); - T n0111 = dot(g0111, vec<4, T, P>(Pf0.x, Pf1.y, Pf1.z, Pf1.w)); + T n1000 = dot(g1000, vec<4, T, Q>(Pf1.x, Pf0.y, Pf0.z, Pf0.w)); + T n0100 = dot(g0100, vec<4, T, Q>(Pf0.x, Pf1.y, Pf0.z, Pf0.w)); + T n1100 = dot(g1100, vec<4, T, Q>(Pf1.x, Pf1.y, Pf0.z, Pf0.w)); + T n0010 = dot(g0010, vec<4, T, Q>(Pf0.x, Pf0.y, Pf1.z, Pf0.w)); + T n1010 = dot(g1010, vec<4, T, Q>(Pf1.x, Pf0.y, Pf1.z, Pf0.w)); + T n0110 = dot(g0110, vec<4, T, Q>(Pf0.x, Pf1.y, Pf1.z, Pf0.w)); + T n1110 = dot(g1110, vec<4, T, Q>(Pf1.x, Pf1.y, Pf1.z, Pf0.w)); + T n0001 = dot(g0001, vec<4, T, Q>(Pf0.x, Pf0.y, Pf0.z, Pf1.w)); + T n1001 = dot(g1001, vec<4, T, Q>(Pf1.x, Pf0.y, Pf0.z, Pf1.w)); + T n0101 = dot(g0101, vec<4, T, Q>(Pf0.x, Pf1.y, Pf0.z, Pf1.w)); + T n1101 = dot(g1101, vec<4, T, Q>(Pf1.x, Pf1.y, Pf0.z, Pf1.w)); + T n0011 = dot(g0011, vec<4, T, Q>(Pf0.x, Pf0.y, Pf1.z, Pf1.w)); + T n1011 = dot(g1011, vec<4, T, Q>(Pf1.x, Pf0.y, Pf1.z, Pf1.w)); + T n0111 = dot(g0111, vec<4, T, Q>(Pf0.x, Pf1.y, Pf1.z, Pf1.w)); T n1111 = dot(g1111, Pf1); - vec<4, T, P> fade_xyzw = detail::fade(Pf0); - vec<4, T, P> n_0w = mix(vec<4, T, P>(n0000, n1000, n0100, n1100), vec<4, T, P>(n0001, n1001, n0101, n1101), fade_xyzw.w); - vec<4, T, P> n_1w = mix(vec<4, T, P>(n0010, n1010, n0110, n1110), vec<4, T, P>(n0011, n1011, n0111, n1111), fade_xyzw.w); - vec<4, T, P> n_zw = mix(n_0w, n_1w, fade_xyzw.z); - vec<2, T, P> n_yzw = mix(vec<2, T, P>(n_zw.x, n_zw.y), vec<2, T, P>(n_zw.z, n_zw.w), fade_xyzw.y); + vec<4, T, Q> fade_xyzw = detail::fade(Pf0); + vec<4, T, Q> n_0w = mix(vec<4, T, Q>(n0000, n1000, n0100, n1100), vec<4, T, Q>(n0001, n1001, n0101, n1101), fade_xyzw.w); + vec<4, T, Q> n_1w = mix(vec<4, T, Q>(n0010, n1010, n0110, n1110), vec<4, T, Q>(n0011, n1011, n0111, n1111), fade_xyzw.w); + vec<4, T, Q> n_zw = mix(n_0w, n_1w, fade_xyzw.z); + vec<2, T, Q> n_yzw = mix(vec<2, T, Q>(n_zw.x, n_zw.y), vec<2, T, Q>(n_zw.z, n_zw.w), fade_xyzw.y); T n_xyzw = mix(n_yzw.x, n_yzw.y, fade_xyzw.x); return T(2.2) * n_xyzw; } // Classic Perlin noise, periodic variant - template - GLM_FUNC_QUALIFIER T perlin(vec<2, T, P> const& Position, vec<2, T, P> const& rep) + template + GLM_FUNC_QUALIFIER T perlin(vec<2, T, Q> const& Position, vec<2, T, Q> const& rep) { - vec<4, T, P> Pi = floor(vec<4, T, P>(Position.x, Position.y, Position.x, Position.y)) + vec<4, T, P>(0.0, 0.0, 1.0, 1.0); - vec<4, T, P> Pf = fract(vec<4, T, P>(Position.x, Position.y, Position.x, Position.y)) - vec<4, T, P>(0.0, 0.0, 1.0, 1.0); - Pi = mod(Pi, vec<4, T, P>(rep.x, rep.y, rep.x, rep.y)); // To create noise with explicit period - Pi = mod(Pi, vec<4, T, P>(289)); // To avoid truncation effects in permutation - vec<4, T, P> ix(Pi.x, Pi.z, Pi.x, Pi.z); - vec<4, T, P> iy(Pi.y, Pi.y, Pi.w, Pi.w); - vec<4, T, P> fx(Pf.x, Pf.z, Pf.x, Pf.z); - vec<4, T, P> fy(Pf.y, Pf.y, Pf.w, Pf.w); + vec<4, T, Q> Pi = floor(vec<4, T, Q>(Position.x, Position.y, Position.x, Position.y)) + vec<4, T, Q>(0.0, 0.0, 1.0, 1.0); + vec<4, T, Q> Pf = fract(vec<4, T, Q>(Position.x, Position.y, Position.x, Position.y)) - vec<4, T, Q>(0.0, 0.0, 1.0, 1.0); + Pi = mod(Pi, vec<4, T, Q>(rep.x, rep.y, rep.x, rep.y)); // To create noise with explicit period + Pi = mod(Pi, vec<4, T, Q>(289)); // To avoid truncation effects in permutation + vec<4, T, Q> ix(Pi.x, Pi.z, Pi.x, Pi.z); + vec<4, T, Q> iy(Pi.y, Pi.y, Pi.w, Pi.w); + vec<4, T, Q> fx(Pf.x, Pf.z, Pf.x, Pf.z); + vec<4, T, Q> fy(Pf.y, Pf.y, Pf.w, Pf.w); - vec<4, T, P> i = detail::permute(detail::permute(ix) + iy); + vec<4, T, Q> i = detail::permute(detail::permute(ix) + iy); - vec<4, T, P> gx = static_cast(2) * fract(i / T(41)) - T(1); - vec<4, T, P> gy = abs(gx) - T(0.5); - vec<4, T, P> tx = floor(gx + T(0.5)); + vec<4, T, Q> gx = static_cast(2) * fract(i / T(41)) - T(1); + vec<4, T, Q> gy = abs(gx) - T(0.5); + vec<4, T, Q> tx = floor(gx + T(0.5)); gx = gx - tx; - vec<2, T, P> g00(gx.x, gy.x); - vec<2, T, P> g10(gx.y, gy.y); - vec<2, T, P> g01(gx.z, gy.z); - vec<2, T, P> g11(gx.w, gy.w); + vec<2, T, Q> g00(gx.x, gy.x); + vec<2, T, Q> g10(gx.y, gy.y); + vec<2, T, Q> g01(gx.z, gy.z); + vec<2, T, Q> g11(gx.w, gy.w); - vec<4, T, P> norm = detail::taylorInvSqrt(vec<4, T, P>(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11))); + vec<4, T, Q> norm = detail::taylorInvSqrt(vec<4, T, Q>(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11))); g00 *= norm.x; g01 *= norm.y; g10 *= norm.z; g11 *= norm.w; - T n00 = dot(g00, vec<2, T, P>(fx.x, fy.x)); - T n10 = dot(g10, vec<2, T, P>(fx.y, fy.y)); - T n01 = dot(g01, vec<2, T, P>(fx.z, fy.z)); - T n11 = dot(g11, vec<2, T, P>(fx.w, fy.w)); + T n00 = dot(g00, vec<2, T, Q>(fx.x, fy.x)); + T n10 = dot(g10, vec<2, T, Q>(fx.y, fy.y)); + T n01 = dot(g01, vec<2, T, Q>(fx.z, fy.z)); + T n11 = dot(g11, vec<2, T, Q>(fx.w, fy.w)); - vec<2, T, P> fade_xy = detail::fade(vec<2, T, P>(Pf.x, Pf.y)); - vec<2, T, P> n_x = mix(vec<2, T, P>(n00, n01), vec<2, T, P>(n10, n11), fade_xy.x); + vec<2, T, Q> fade_xy = detail::fade(vec<2, T, Q>(Pf.x, Pf.y)); + vec<2, T, Q> n_x = mix(vec<2, T, Q>(n00, n01), vec<2, T, Q>(n10, n11), fade_xy.x); T n_xy = mix(n_x.x, n_x.y, fade_xy.y); return T(2.3) * n_xy; } // Classic Perlin noise, periodic variant - template - GLM_FUNC_QUALIFIER T perlin(vec<3, T, P> const& Position, vec<3, T, P> const& rep) + template + GLM_FUNC_QUALIFIER T perlin(vec<3, T, Q> const& Position, vec<3, T, Q> const& rep) { - vec<3, T, P> Pi0 = mod(floor(Position), rep); // Integer part, modulo period - vec<3, T, P> Pi1 = mod(Pi0 + vec<3, T, P>(T(1)), rep); // Integer part + 1, mod period - Pi0 = mod(Pi0, vec<3, T, P>(289)); - Pi1 = mod(Pi1, vec<3, T, P>(289)); - vec<3, T, P> Pf0 = fract(Position); // Fractional part for interpolation - vec<3, T, P> Pf1 = Pf0 - vec<3, T, P>(T(1)); // Fractional part - 1.0 - vec<4, T, P> ix = vec<4, T, P>(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - vec<4, T, P> iy = vec<4, T, P>(Pi0.y, Pi0.y, Pi1.y, Pi1.y); - vec<4, T, P> iz0(Pi0.z); - vec<4, T, P> iz1(Pi1.z); + vec<3, T, Q> Pi0 = mod(floor(Position), rep); // Integer part, modulo period + vec<3, T, Q> Pi1 = mod(Pi0 + vec<3, T, Q>(T(1)), rep); // Integer part + 1, mod period + Pi0 = mod(Pi0, vec<3, T, Q>(289)); + Pi1 = mod(Pi1, vec<3, T, Q>(289)); + vec<3, T, Q> Pf0 = fract(Position); // Fractional part for interpolation + vec<3, T, Q> Pf1 = Pf0 - vec<3, T, Q>(T(1)); // Fractional part - 1.0 + vec<4, T, Q> ix = vec<4, T, Q>(Pi0.x, Pi1.x, Pi0.x, Pi1.x); + vec<4, T, Q> iy = vec<4, T, Q>(Pi0.y, Pi0.y, Pi1.y, Pi1.y); + vec<4, T, Q> iz0(Pi0.z); + vec<4, T, Q> iz1(Pi1.z); - vec<4, T, P> ixy = detail::permute(detail::permute(ix) + iy); - vec<4, T, P> ixy0 = detail::permute(ixy + iz0); - vec<4, T, P> ixy1 = detail::permute(ixy + iz1); + vec<4, T, Q> ixy = detail::permute(detail::permute(ix) + iy); + vec<4, T, Q> ixy0 = detail::permute(ixy + iz0); + vec<4, T, Q> ixy1 = detail::permute(ixy + iz1); - vec<4, T, P> gx0 = ixy0 / T(7); - vec<4, T, P> gy0 = fract(floor(gx0) / T(7)) - T(0.5); + vec<4, T, Q> gx0 = ixy0 / T(7); + vec<4, T, Q> gy0 = fract(floor(gx0) / T(7)) - T(0.5); gx0 = fract(gx0); - vec<4, T, P> gz0 = vec<4, T, P>(0.5) - abs(gx0) - abs(gy0); - vec<4, T, P> sz0 = step(gz0, vec<4, T, P>(0)); + vec<4, T, Q> gz0 = vec<4, T, Q>(0.5) - abs(gx0) - abs(gy0); + vec<4, T, Q> sz0 = step(gz0, vec<4, T, Q>(0)); gx0 -= sz0 * (step(T(0), gx0) - T(0.5)); gy0 -= sz0 * (step(T(0), gy0) - T(0.5)); - vec<4, T, P> gx1 = ixy1 / T(7); - vec<4, T, P> gy1 = fract(floor(gx1) / T(7)) - T(0.5); + vec<4, T, Q> gx1 = ixy1 / T(7); + vec<4, T, Q> gy1 = fract(floor(gx1) / T(7)) - T(0.5); gx1 = fract(gx1); - vec<4, T, P> gz1 = vec<4, T, P>(0.5) - abs(gx1) - abs(gy1); - vec<4, T, P> sz1 = step(gz1, vec<4, T, P>(T(0))); + vec<4, T, Q> gz1 = vec<4, T, Q>(0.5) - abs(gx1) - abs(gy1); + vec<4, T, Q> sz1 = step(gz1, vec<4, T, Q>(T(0))); gx1 -= sz1 * (step(T(0), gx1) - T(0.5)); gy1 -= sz1 * (step(T(0), gy1) - T(0.5)); - vec<3, T, P> g000 = vec<3, T, P>(gx0.x, gy0.x, gz0.x); - vec<3, T, P> g100 = vec<3, T, P>(gx0.y, gy0.y, gz0.y); - vec<3, T, P> g010 = vec<3, T, P>(gx0.z, gy0.z, gz0.z); - vec<3, T, P> g110 = vec<3, T, P>(gx0.w, gy0.w, gz0.w); - vec<3, T, P> g001 = vec<3, T, P>(gx1.x, gy1.x, gz1.x); - vec<3, T, P> g101 = vec<3, T, P>(gx1.y, gy1.y, gz1.y); - vec<3, T, P> g011 = vec<3, T, P>(gx1.z, gy1.z, gz1.z); - vec<3, T, P> g111 = vec<3, T, P>(gx1.w, gy1.w, gz1.w); + vec<3, T, Q> g000 = vec<3, T, Q>(gx0.x, gy0.x, gz0.x); + vec<3, T, Q> g100 = vec<3, T, Q>(gx0.y, gy0.y, gz0.y); + vec<3, T, Q> g010 = vec<3, T, Q>(gx0.z, gy0.z, gz0.z); + vec<3, T, Q> g110 = vec<3, T, Q>(gx0.w, gy0.w, gz0.w); + vec<3, T, Q> g001 = vec<3, T, Q>(gx1.x, gy1.x, gz1.x); + vec<3, T, Q> g101 = vec<3, T, Q>(gx1.y, gy1.y, gz1.y); + vec<3, T, Q> g011 = vec<3, T, Q>(gx1.z, gy1.z, gz1.z); + vec<3, T, Q> g111 = vec<3, T, Q>(gx1.w, gy1.w, gz1.w); - vec<4, T, P> norm0 = detail::taylorInvSqrt(vec<4, T, P>(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); + vec<4, T, Q> norm0 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); g000 *= norm0.x; g010 *= norm0.y; g100 *= norm0.z; g110 *= norm0.w; - vec<4, T, P> norm1 = detail::taylorInvSqrt(vec<4, T, P>(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); + vec<4, T, Q> norm1 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); g001 *= norm1.x; g011 *= norm1.y; g101 *= norm1.z; g111 *= norm1.w; T n000 = dot(g000, Pf0); - T n100 = dot(g100, vec<3, T, P>(Pf1.x, Pf0.y, Pf0.z)); - T n010 = dot(g010, vec<3, T, P>(Pf0.x, Pf1.y, Pf0.z)); - T n110 = dot(g110, vec<3, T, P>(Pf1.x, Pf1.y, Pf0.z)); - T n001 = dot(g001, vec<3, T, P>(Pf0.x, Pf0.y, Pf1.z)); - T n101 = dot(g101, vec<3, T, P>(Pf1.x, Pf0.y, Pf1.z)); - T n011 = dot(g011, vec<3, T, P>(Pf0.x, Pf1.y, Pf1.z)); + T n100 = dot(g100, vec<3, T, Q>(Pf1.x, Pf0.y, Pf0.z)); + T n010 = dot(g010, vec<3, T, Q>(Pf0.x, Pf1.y, Pf0.z)); + T n110 = dot(g110, vec<3, T, Q>(Pf1.x, Pf1.y, Pf0.z)); + T n001 = dot(g001, vec<3, T, Q>(Pf0.x, Pf0.y, Pf1.z)); + T n101 = dot(g101, vec<3, T, Q>(Pf1.x, Pf0.y, Pf1.z)); + T n011 = dot(g011, vec<3, T, Q>(Pf0.x, Pf1.y, Pf1.z)); T n111 = dot(g111, Pf1); - vec<3, T, P> fade_xyz = detail::fade(Pf0); - vec<4, T, P> n_z = mix(vec<4, T, P>(n000, n100, n010, n110), vec<4, T, P>(n001, n101, n011, n111), fade_xyz.z); - vec<2, T, P> n_yz = mix(vec<2, T, P>(n_z.x, n_z.y), vec<2, T, P>(n_z.z, n_z.w), fade_xyz.y); + vec<3, T, Q> fade_xyz = detail::fade(Pf0); + vec<4, T, Q> n_z = mix(vec<4, T, Q>(n000, n100, n010, n110), vec<4, T, Q>(n001, n101, n011, n111), fade_xyz.z); + vec<2, T, Q> n_yz = mix(vec<2, T, Q>(n_z.x, n_z.y), vec<2, T, Q>(n_z.z, n_z.w), fade_xyz.y); T n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); return T(2.2) * n_xyz; } // Classic Perlin noise, periodic version - template - GLM_FUNC_QUALIFIER T perlin(vec<4, T, P> const& Position, vec<4, T, P> const& rep) + template + GLM_FUNC_QUALIFIER T perlin(vec<4, T, Q> const& Position, vec<4, T, Q> const& rep) { - vec<4, T, P> Pi0 = mod(floor(Position), rep); // Integer part modulo rep - vec<4, T, P> Pi1 = mod(Pi0 + T(1), rep); // Integer part + 1 mod rep - vec<4, T, P> Pf0 = fract(Position); // Fractional part for interpolation - vec<4, T, P> Pf1 = Pf0 - T(1); // Fractional part - 1.0 - vec<4, T, P> ix = vec<4, T, P>(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - vec<4, T, P> iy = vec<4, T, P>(Pi0.y, Pi0.y, Pi1.y, Pi1.y); - vec<4, T, P> iz0(Pi0.z); - vec<4, T, P> iz1(Pi1.z); - vec<4, T, P> iw0(Pi0.w); - vec<4, T, P> iw1(Pi1.w); + vec<4, T, Q> Pi0 = mod(floor(Position), rep); // Integer part modulo rep + vec<4, T, Q> Pi1 = mod(Pi0 + T(1), rep); // Integer part + 1 mod rep + vec<4, T, Q> Pf0 = fract(Position); // Fractional part for interpolation + vec<4, T, Q> Pf1 = Pf0 - T(1); // Fractional part - 1.0 + vec<4, T, Q> ix = vec<4, T, Q>(Pi0.x, Pi1.x, Pi0.x, Pi1.x); + vec<4, T, Q> iy = vec<4, T, Q>(Pi0.y, Pi0.y, Pi1.y, Pi1.y); + vec<4, T, Q> iz0(Pi0.z); + vec<4, T, Q> iz1(Pi1.z); + vec<4, T, Q> iw0(Pi0.w); + vec<4, T, Q> iw1(Pi1.w); - vec<4, T, P> ixy = detail::permute(detail::permute(ix) + iy); - vec<4, T, P> ixy0 = detail::permute(ixy + iz0); - vec<4, T, P> ixy1 = detail::permute(ixy + iz1); - vec<4, T, P> ixy00 = detail::permute(ixy0 + iw0); - vec<4, T, P> ixy01 = detail::permute(ixy0 + iw1); - vec<4, T, P> ixy10 = detail::permute(ixy1 + iw0); - vec<4, T, P> ixy11 = detail::permute(ixy1 + iw1); + vec<4, T, Q> ixy = detail::permute(detail::permute(ix) + iy); + vec<4, T, Q> ixy0 = detail::permute(ixy + iz0); + vec<4, T, Q> ixy1 = detail::permute(ixy + iz1); + vec<4, T, Q> ixy00 = detail::permute(ixy0 + iw0); + vec<4, T, Q> ixy01 = detail::permute(ixy0 + iw1); + vec<4, T, Q> ixy10 = detail::permute(ixy1 + iw0); + vec<4, T, Q> ixy11 = detail::permute(ixy1 + iw1); - vec<4, T, P> gx00 = ixy00 / T(7); - vec<4, T, P> gy00 = floor(gx00) / T(7); - vec<4, T, P> gz00 = floor(gy00) / T(6); + vec<4, T, Q> gx00 = ixy00 / T(7); + vec<4, T, Q> gy00 = floor(gx00) / T(7); + vec<4, T, Q> gz00 = floor(gy00) / T(6); gx00 = fract(gx00) - T(0.5); gy00 = fract(gy00) - T(0.5); gz00 = fract(gz00) - T(0.5); - vec<4, T, P> gw00 = vec<4, T, P>(0.75) - abs(gx00) - abs(gy00) - abs(gz00); - vec<4, T, P> sw00 = step(gw00, vec<4, T, P>(0)); + vec<4, T, Q> gw00 = vec<4, T, Q>(0.75) - abs(gx00) - abs(gy00) - abs(gz00); + vec<4, T, Q> sw00 = step(gw00, vec<4, T, Q>(0)); gx00 -= sw00 * (step(T(0), gx00) - T(0.5)); gy00 -= sw00 * (step(T(0), gy00) - T(0.5)); - vec<4, T, P> gx01 = ixy01 / T(7); - vec<4, T, P> gy01 = floor(gx01) / T(7); - vec<4, T, P> gz01 = floor(gy01) / T(6); + vec<4, T, Q> gx01 = ixy01 / T(7); + vec<4, T, Q> gy01 = floor(gx01) / T(7); + vec<4, T, Q> gz01 = floor(gy01) / T(6); gx01 = fract(gx01) - T(0.5); gy01 = fract(gy01) - T(0.5); gz01 = fract(gz01) - T(0.5); - vec<4, T, P> gw01 = vec<4, T, P>(0.75) - abs(gx01) - abs(gy01) - abs(gz01); - vec<4, T, P> sw01 = step(gw01, vec<4, T, P>(0.0)); + vec<4, T, Q> gw01 = vec<4, T, Q>(0.75) - abs(gx01) - abs(gy01) - abs(gz01); + vec<4, T, Q> sw01 = step(gw01, vec<4, T, Q>(0.0)); gx01 -= sw01 * (step(T(0), gx01) - T(0.5)); gy01 -= sw01 * (step(T(0), gy01) - T(0.5)); - vec<4, T, P> gx10 = ixy10 / T(7); - vec<4, T, P> gy10 = floor(gx10) / T(7); - vec<4, T, P> gz10 = floor(gy10) / T(6); + vec<4, T, Q> gx10 = ixy10 / T(7); + vec<4, T, Q> gy10 = floor(gx10) / T(7); + vec<4, T, Q> gz10 = floor(gy10) / T(6); gx10 = fract(gx10) - T(0.5); gy10 = fract(gy10) - T(0.5); gz10 = fract(gz10) - T(0.5); - vec<4, T, P> gw10 = vec<4, T, P>(0.75) - abs(gx10) - abs(gy10) - abs(gz10); - vec<4, T, P> sw10 = step(gw10, vec<4, T, P>(0.0)); + vec<4, T, Q> gw10 = vec<4, T, Q>(0.75) - abs(gx10) - abs(gy10) - abs(gz10); + vec<4, T, Q> sw10 = step(gw10, vec<4, T, Q>(0.0)); gx10 -= sw10 * (step(T(0), gx10) - T(0.5)); gy10 -= sw10 * (step(T(0), gy10) - T(0.5)); - vec<4, T, P> gx11 = ixy11 / T(7); - vec<4, T, P> gy11 = floor(gx11) / T(7); - vec<4, T, P> gz11 = floor(gy11) / T(6); + vec<4, T, Q> gx11 = ixy11 / T(7); + vec<4, T, Q> gy11 = floor(gx11) / T(7); + vec<4, T, Q> gz11 = floor(gy11) / T(6); gx11 = fract(gx11) - T(0.5); gy11 = fract(gy11) - T(0.5); gz11 = fract(gz11) - T(0.5); - vec<4, T, P> gw11 = vec<4, T, P>(0.75) - abs(gx11) - abs(gy11) - abs(gz11); - vec<4, T, P> sw11 = step(gw11, vec<4, T, P>(T(0))); + vec<4, T, Q> gw11 = vec<4, T, Q>(0.75) - abs(gx11) - abs(gy11) - abs(gz11); + vec<4, T, Q> sw11 = step(gw11, vec<4, T, Q>(T(0))); gx11 -= sw11 * (step(T(0), gx11) - T(0.5)); gy11 -= sw11 * (step(T(0), gy11) - T(0.5)); - vec<4, T, P> g0000(gx00.x, gy00.x, gz00.x, gw00.x); - vec<4, T, P> g1000(gx00.y, gy00.y, gz00.y, gw00.y); - vec<4, T, P> g0100(gx00.z, gy00.z, gz00.z, gw00.z); - vec<4, T, P> g1100(gx00.w, gy00.w, gz00.w, gw00.w); - vec<4, T, P> g0010(gx10.x, gy10.x, gz10.x, gw10.x); - vec<4, T, P> g1010(gx10.y, gy10.y, gz10.y, gw10.y); - vec<4, T, P> g0110(gx10.z, gy10.z, gz10.z, gw10.z); - vec<4, T, P> g1110(gx10.w, gy10.w, gz10.w, gw10.w); - vec<4, T, P> g0001(gx01.x, gy01.x, gz01.x, gw01.x); - vec<4, T, P> g1001(gx01.y, gy01.y, gz01.y, gw01.y); - vec<4, T, P> g0101(gx01.z, gy01.z, gz01.z, gw01.z); - vec<4, T, P> g1101(gx01.w, gy01.w, gz01.w, gw01.w); - vec<4, T, P> g0011(gx11.x, gy11.x, gz11.x, gw11.x); - vec<4, T, P> g1011(gx11.y, gy11.y, gz11.y, gw11.y); - vec<4, T, P> g0111(gx11.z, gy11.z, gz11.z, gw11.z); - vec<4, T, P> g1111(gx11.w, gy11.w, gz11.w, gw11.w); + vec<4, T, Q> g0000(gx00.x, gy00.x, gz00.x, gw00.x); + vec<4, T, Q> g1000(gx00.y, gy00.y, gz00.y, gw00.y); + vec<4, T, Q> g0100(gx00.z, gy00.z, gz00.z, gw00.z); + vec<4, T, Q> g1100(gx00.w, gy00.w, gz00.w, gw00.w); + vec<4, T, Q> g0010(gx10.x, gy10.x, gz10.x, gw10.x); + vec<4, T, Q> g1010(gx10.y, gy10.y, gz10.y, gw10.y); + vec<4, T, Q> g0110(gx10.z, gy10.z, gz10.z, gw10.z); + vec<4, T, Q> g1110(gx10.w, gy10.w, gz10.w, gw10.w); + vec<4, T, Q> g0001(gx01.x, gy01.x, gz01.x, gw01.x); + vec<4, T, Q> g1001(gx01.y, gy01.y, gz01.y, gw01.y); + vec<4, T, Q> g0101(gx01.z, gy01.z, gz01.z, gw01.z); + vec<4, T, Q> g1101(gx01.w, gy01.w, gz01.w, gw01.w); + vec<4, T, Q> g0011(gx11.x, gy11.x, gz11.x, gw11.x); + vec<4, T, Q> g1011(gx11.y, gy11.y, gz11.y, gw11.y); + vec<4, T, Q> g0111(gx11.z, gy11.z, gz11.z, gw11.z); + vec<4, T, Q> g1111(gx11.w, gy11.w, gz11.w, gw11.w); - vec<4, T, P> norm00 = detail::taylorInvSqrt(vec<4, T, P>(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100))); + vec<4, T, Q> norm00 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100))); g0000 *= norm00.x; g0100 *= norm00.y; g1000 *= norm00.z; g1100 *= norm00.w; - vec<4, T, P> norm01 = detail::taylorInvSqrt(vec<4, T, P>(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101))); + vec<4, T, Q> norm01 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101))); g0001 *= norm01.x; g0101 *= norm01.y; g1001 *= norm01.z; g1101 *= norm01.w; - vec<4, T, P> norm10 = detail::taylorInvSqrt(vec<4, T, P>(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110))); + vec<4, T, Q> norm10 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110))); g0010 *= norm10.x; g0110 *= norm10.y; g1010 *= norm10.z; g1110 *= norm10.w; - vec<4, T, P> norm11 = detail::taylorInvSqrt(vec<4, T, P>(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111))); + vec<4, T, Q> norm11 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111))); g0011 *= norm11.x; g0111 *= norm11.y; g1011 *= norm11.z; g1111 *= norm11.w; T n0000 = dot(g0000, Pf0); - T n1000 = dot(g1000, vec<4, T, P>(Pf1.x, Pf0.y, Pf0.z, Pf0.w)); - T n0100 = dot(g0100, vec<4, T, P>(Pf0.x, Pf1.y, Pf0.z, Pf0.w)); - T n1100 = dot(g1100, vec<4, T, P>(Pf1.x, Pf1.y, Pf0.z, Pf0.w)); - T n0010 = dot(g0010, vec<4, T, P>(Pf0.x, Pf0.y, Pf1.z, Pf0.w)); - T n1010 = dot(g1010, vec<4, T, P>(Pf1.x, Pf0.y, Pf1.z, Pf0.w)); - T n0110 = dot(g0110, vec<4, T, P>(Pf0.x, Pf1.y, Pf1.z, Pf0.w)); - T n1110 = dot(g1110, vec<4, T, P>(Pf1.x, Pf1.y, Pf1.z, Pf0.w)); - T n0001 = dot(g0001, vec<4, T, P>(Pf0.x, Pf0.y, Pf0.z, Pf1.w)); - T n1001 = dot(g1001, vec<4, T, P>(Pf1.x, Pf0.y, Pf0.z, Pf1.w)); - T n0101 = dot(g0101, vec<4, T, P>(Pf0.x, Pf1.y, Pf0.z, Pf1.w)); - T n1101 = dot(g1101, vec<4, T, P>(Pf1.x, Pf1.y, Pf0.z, Pf1.w)); - T n0011 = dot(g0011, vec<4, T, P>(Pf0.x, Pf0.y, Pf1.z, Pf1.w)); - T n1011 = dot(g1011, vec<4, T, P>(Pf1.x, Pf0.y, Pf1.z, Pf1.w)); - T n0111 = dot(g0111, vec<4, T, P>(Pf0.x, Pf1.y, Pf1.z, Pf1.w)); + T n1000 = dot(g1000, vec<4, T, Q>(Pf1.x, Pf0.y, Pf0.z, Pf0.w)); + T n0100 = dot(g0100, vec<4, T, Q>(Pf0.x, Pf1.y, Pf0.z, Pf0.w)); + T n1100 = dot(g1100, vec<4, T, Q>(Pf1.x, Pf1.y, Pf0.z, Pf0.w)); + T n0010 = dot(g0010, vec<4, T, Q>(Pf0.x, Pf0.y, Pf1.z, Pf0.w)); + T n1010 = dot(g1010, vec<4, T, Q>(Pf1.x, Pf0.y, Pf1.z, Pf0.w)); + T n0110 = dot(g0110, vec<4, T, Q>(Pf0.x, Pf1.y, Pf1.z, Pf0.w)); + T n1110 = dot(g1110, vec<4, T, Q>(Pf1.x, Pf1.y, Pf1.z, Pf0.w)); + T n0001 = dot(g0001, vec<4, T, Q>(Pf0.x, Pf0.y, Pf0.z, Pf1.w)); + T n1001 = dot(g1001, vec<4, T, Q>(Pf1.x, Pf0.y, Pf0.z, Pf1.w)); + T n0101 = dot(g0101, vec<4, T, Q>(Pf0.x, Pf1.y, Pf0.z, Pf1.w)); + T n1101 = dot(g1101, vec<4, T, Q>(Pf1.x, Pf1.y, Pf0.z, Pf1.w)); + T n0011 = dot(g0011, vec<4, T, Q>(Pf0.x, Pf0.y, Pf1.z, Pf1.w)); + T n1011 = dot(g1011, vec<4, T, Q>(Pf1.x, Pf0.y, Pf1.z, Pf1.w)); + T n0111 = dot(g0111, vec<4, T, Q>(Pf0.x, Pf1.y, Pf1.z, Pf1.w)); T n1111 = dot(g1111, Pf1); - vec<4, T, P> fade_xyzw = detail::fade(Pf0); - vec<4, T, P> n_0w = mix(vec<4, T, P>(n0000, n1000, n0100, n1100), vec<4, T, P>(n0001, n1001, n0101, n1101), fade_xyzw.w); - vec<4, T, P> n_1w = mix(vec<4, T, P>(n0010, n1010, n0110, n1110), vec<4, T, P>(n0011, n1011, n0111, n1111), fade_xyzw.w); - vec<4, T, P> n_zw = mix(n_0w, n_1w, fade_xyzw.z); - vec<2, T, P> n_yzw = mix(vec<2, T, P>(n_zw.x, n_zw.y), vec<2, T, P>(n_zw.z, n_zw.w), fade_xyzw.y); + vec<4, T, Q> fade_xyzw = detail::fade(Pf0); + vec<4, T, Q> n_0w = mix(vec<4, T, Q>(n0000, n1000, n0100, n1100), vec<4, T, Q>(n0001, n1001, n0101, n1101), fade_xyzw.w); + vec<4, T, Q> n_1w = mix(vec<4, T, Q>(n0010, n1010, n0110, n1110), vec<4, T, Q>(n0011, n1011, n0111, n1111), fade_xyzw.w); + vec<4, T, Q> n_zw = mix(n_0w, n_1w, fade_xyzw.z); + vec<2, T, Q> n_yzw = mix(vec<2, T, Q>(n_zw.x, n_zw.y), vec<2, T, Q>(n_zw.z, n_zw.w), fade_xyzw.y); T n_xyzw = mix(n_yzw.x, n_yzw.y, fade_xyzw.x); return T(2.2) * n_xyzw; } - template - GLM_FUNC_QUALIFIER T simplex(glm::vec<2, T, P> const& v) + template + GLM_FUNC_QUALIFIER T simplex(glm::vec<2, T, Q> const& v) { - vec<4, T, P> const C = vec<4, T, P>( + vec<4, T, Q> const C = vec<4, T, Q>( T( 0.211324865405187), // (3.0 - sqrt(3.0)) / 6.0 T( 0.366025403784439), // 0.5 * (sqrt(3.0) - 1.0) T(-0.577350269189626), // -1.0 + 2.0 * C.x T( 0.024390243902439)); // 1.0 / 41.0 // First corner - vec<2, T, P> i = floor(v + dot(v, vec<2, T, P>(C[1]))); - vec<2, T, P> x0 = v - i + dot(i, vec<2, T, P>(C[0])); + vec<2, T, Q> i = floor(v + dot(v, vec<2, T, Q>(C[1]))); + vec<2, T, Q> x0 = v - i + dot(i, vec<2, T, Q>(C[0])); // Other corners //i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0 //i1.y = 1.0 - i1.x; - vec<2, T, P> i1 = (x0.x > x0.y) ? vec<2, T, P>(1, 0) : vec<2, T, P>(0, 1); + vec<2, T, Q> i1 = (x0.x > x0.y) ? vec<2, T, Q>(1, 0) : vec<2, T, Q>(0, 1); // x0 = x0 - 0.0 + 0.0 * C.xx ; // x1 = x0 - i1 + 1.0 * C.xx ; // x2 = x0 - 1.0 + 2.0 * C.xx ; - vec<4, T, P> x12 = vec<4, T, P>(x0.x, x0.y, x0.x, x0.y) + vec<4, T, P>(C.x, C.x, C.z, C.z); - x12 = vec<4, T, P>(vec<2, T, P>(x12) - i1, x12.z, x12.w); + vec<4, T, Q> x12 = vec<4, T, Q>(x0.x, x0.y, x0.x, x0.y) + vec<4, T, Q>(C.x, C.x, C.z, C.z); + x12 = vec<4, T, Q>(vec<2, T, Q>(x12) - i1, x12.z, x12.w); // Permutations - i = mod(i, vec<2, T, P>(289)); // Avoid truncation effects in permutation - vec<3, T, P> p = detail::permute( - detail::permute(i.y + vec<3, T, P>(T(0), i1.y, T(1))) - + i.x + vec<3, T, P>(T(0), i1.x, T(1))); + i = mod(i, vec<2, T, Q>(289)); // Avoid truncation effects in permutation + vec<3, T, Q> p = detail::permute( + detail::permute(i.y + vec<3, T, Q>(T(0), i1.y, T(1))) + + i.x + vec<3, T, Q>(T(0), i1.x, T(1))); - vec<3, T, P> m = max(vec<3, T, P>(0.5) - vec<3, T, P>( + vec<3, T, Q> m = max(vec<3, T, Q>(0.5) - vec<3, T, Q>( dot(x0, x0), - dot(vec<2, T, P>(x12.x, x12.y), vec<2, T, P>(x12.x, x12.y)), - dot(vec<2, T, P>(x12.z, x12.w), vec<2, T, P>(x12.z, x12.w))), vec<3, T, P>(0)); + dot(vec<2, T, Q>(x12.x, x12.y), vec<2, T, Q>(x12.x, x12.y)), + dot(vec<2, T, Q>(x12.z, x12.w), vec<2, T, Q>(x12.z, x12.w))), vec<3, T, Q>(0)); m = m * m ; m = m * m ; // Gradients: 41 points uniformly over a line, mapped onto a diamond. // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287) - vec<3, T, P> x = static_cast(2) * fract(p * C.w) - T(1); - vec<3, T, P> h = abs(x) - T(0.5); - vec<3, T, P> ox = floor(x + T(0.5)); - vec<3, T, P> a0 = x - ox; + vec<3, T, Q> x = static_cast(2) * fract(p * C.w) - T(1); + vec<3, T, Q> h = abs(x) - T(0.5); + vec<3, T, Q> ox = floor(x + T(0.5)); + vec<3, T, Q> a0 = x - ox; // Normalise gradients implicitly by scaling m // Inlined for speed: m *= taylorInvSqrt( a0*a0 + h*h ); m *= static_cast(1.79284291400159) - T(0.85373472095314) * (a0 * a0 + h * h); // Compute final noise value at P - vec<3, T, P> g; + vec<3, T, Q> g; g.x = a0.x * x0.x + h.x * x0.y; //g.yz = a0.yz * x12.xz + h.yz * x12.yw; g.y = a0.y * x12.x + h.y * x12.y; @@ -645,85 +645,85 @@ namespace gtc return T(130) * dot(m, g); } - template - GLM_FUNC_QUALIFIER T simplex(vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER T simplex(vec<3, T, Q> const& v) { - vec<2, T, P> const C(1.0 / 6.0, 1.0 / 3.0); - vec<4, T, P> const D(0.0, 0.5, 1.0, 2.0); + vec<2, T, Q> const C(1.0 / 6.0, 1.0 / 3.0); + vec<4, T, Q> const D(0.0, 0.5, 1.0, 2.0); // First corner - vec<3, T, P> i(floor(v + dot(v, vec<3, T, P>(C.y)))); - vec<3, T, P> x0(v - i + dot(i, vec<3, T, P>(C.x))); + vec<3, T, Q> i(floor(v + dot(v, vec<3, T, Q>(C.y)))); + vec<3, T, Q> x0(v - i + dot(i, vec<3, T, Q>(C.x))); // Other corners - vec<3, T, P> g(step(vec<3, T, P>(x0.y, x0.z, x0.x), x0)); - vec<3, T, P> l(T(1) - g); - vec<3, T, P> i1(min(g, vec<3, T, P>(l.z, l.x, l.y))); - vec<3, T, P> i2(max(g, vec<3, T, P>(l.z, l.x, l.y))); + vec<3, T, Q> g(step(vec<3, T, Q>(x0.y, x0.z, x0.x), x0)); + vec<3, T, Q> l(T(1) - g); + vec<3, T, Q> i1(min(g, vec<3, T, Q>(l.z, l.x, l.y))); + vec<3, T, Q> i2(max(g, vec<3, T, Q>(l.z, l.x, l.y))); // x0 = x0 - 0.0 + 0.0 * C.xxx; // x1 = x0 - i1 + 1.0 * C.xxx; // x2 = x0 - i2 + 2.0 * C.xxx; // x3 = x0 - 1.0 + 3.0 * C.xxx; - vec<3, T, P> x1(x0 - i1 + C.x); - vec<3, T, P> x2(x0 - i2 + C.y); // 2.0*C.x = 1/3 = C.y - vec<3, T, P> x3(x0 - D.y); // -1.0+3.0*C.x = -0.5 = -D.y + vec<3, T, Q> x1(x0 - i1 + C.x); + vec<3, T, Q> x2(x0 - i2 + C.y); // 2.0*C.x = 1/3 = C.y + vec<3, T, Q> x3(x0 - D.y); // -1.0+3.0*C.x = -0.5 = -D.y // Permutations i = detail::mod289(i); - vec<4, T, P> p(detail::permute(detail::permute(detail::permute( - i.z + vec<4, T, P>(T(0), i1.z, i2.z, T(1))) + - i.y + vec<4, T, P>(T(0), i1.y, i2.y, T(1))) + - i.x + vec<4, T, P>(T(0), i1.x, i2.x, T(1)))); + vec<4, T, Q> p(detail::permute(detail::permute(detail::permute( + i.z + vec<4, T, Q>(T(0), i1.z, i2.z, T(1))) + + i.y + vec<4, T, Q>(T(0), i1.y, i2.y, T(1))) + + i.x + vec<4, T, Q>(T(0), i1.x, i2.x, T(1)))); // Gradients: 7x7 points over a square, mapped onto an octahedron. // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294) T n_ = static_cast(0.142857142857); // 1.0/7.0 - vec<3, T, P> ns(n_ * vec<3, T, P>(D.w, D.y, D.z) - vec<3, T, P>(D.x, D.z, D.x)); + vec<3, T, Q> ns(n_ * vec<3, T, Q>(D.w, D.y, D.z) - vec<3, T, Q>(D.x, D.z, D.x)); - vec<4, T, P> j(p - T(49) * floor(p * ns.z * ns.z)); // mod(p,7*7) + vec<4, T, Q> j(p - T(49) * floor(p * ns.z * ns.z)); // mod(p,7*7) - vec<4, T, P> x_(floor(j * ns.z)); - vec<4, T, P> y_(floor(j - T(7) * x_)); // mod(j,N) + vec<4, T, Q> x_(floor(j * ns.z)); + vec<4, T, Q> y_(floor(j - T(7) * x_)); // mod(j,N) - vec<4, T, P> x(x_ * ns.x + ns.y); - vec<4, T, P> y(y_ * ns.x + ns.y); - vec<4, T, P> h(T(1) - abs(x) - abs(y)); + vec<4, T, Q> x(x_ * ns.x + ns.y); + vec<4, T, Q> y(y_ * ns.x + ns.y); + vec<4, T, Q> h(T(1) - abs(x) - abs(y)); - vec<4, T, P> b0(x.x, x.y, y.x, y.y); - vec<4, T, P> b1(x.z, x.w, y.z, y.w); + vec<4, T, Q> b0(x.x, x.y, y.x, y.y); + vec<4, T, Q> b1(x.z, x.w, y.z, y.w); // vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0; // vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0; - vec<4, T, P> s0(floor(b0) * T(2) + T(1)); - vec<4, T, P> s1(floor(b1) * T(2) + T(1)); - vec<4, T, P> sh(-step(h, vec<4, T, P>(0.0))); + vec<4, T, Q> s0(floor(b0) * T(2) + T(1)); + vec<4, T, Q> s1(floor(b1) * T(2) + T(1)); + vec<4, T, Q> sh(-step(h, vec<4, T, Q>(0.0))); - vec<4, T, P> a0 = vec<4, T, P>(b0.x, b0.z, b0.y, b0.w) + vec<4, T, P>(s0.x, s0.z, s0.y, s0.w) * vec<4, T, P>(sh.x, sh.x, sh.y, sh.y); - vec<4, T, P> a1 = vec<4, T, P>(b1.x, b1.z, b1.y, b1.w) + vec<4, T, P>(s1.x, s1.z, s1.y, s1.w) * vec<4, T, P>(sh.z, sh.z, sh.w, sh.w); + vec<4, T, Q> a0 = vec<4, T, Q>(b0.x, b0.z, b0.y, b0.w) + vec<4, T, Q>(s0.x, s0.z, s0.y, s0.w) * vec<4, T, Q>(sh.x, sh.x, sh.y, sh.y); + vec<4, T, Q> a1 = vec<4, T, Q>(b1.x, b1.z, b1.y, b1.w) + vec<4, T, Q>(s1.x, s1.z, s1.y, s1.w) * vec<4, T, Q>(sh.z, sh.z, sh.w, sh.w); - vec<3, T, P> p0(a0.x, a0.y, h.x); - vec<3, T, P> p1(a0.z, a0.w, h.y); - vec<3, T, P> p2(a1.x, a1.y, h.z); - vec<3, T, P> p3(a1.z, a1.w, h.w); + vec<3, T, Q> p0(a0.x, a0.y, h.x); + vec<3, T, Q> p1(a0.z, a0.w, h.y); + vec<3, T, Q> p2(a1.x, a1.y, h.z); + vec<3, T, Q> p3(a1.z, a1.w, h.w); // Normalise gradients - vec<4, T, P> norm = detail::taylorInvSqrt(vec<4, T, P>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3))); + vec<4, T, Q> norm = detail::taylorInvSqrt(vec<4, T, Q>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3))); p0 *= norm.x; p1 *= norm.y; p2 *= norm.z; p3 *= norm.w; // Mix final noise value - vec<4, T, P> m = max(T(0.6) - vec<4, T, P>(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), vec<4, T, P>(0)); + vec<4, T, Q> m = max(T(0.6) - vec<4, T, Q>(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), vec<4, T, Q>(0)); m = m * m; - return T(42) * dot(m * m, vec<4, T, P>(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3))); + return T(42) * dot(m * m, vec<4, T, Q>(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3))); } - template - GLM_FUNC_QUALIFIER T simplex(vec<4, T, P> const& v) + template + GLM_FUNC_QUALIFIER T simplex(vec<4, T, Q> const& v) { - vec<4, T, P> const C( + vec<4, T, Q> const C( 0.138196601125011, // (5 - sqrt(5))/20 G4 0.276393202250021, // 2 * G4 0.414589803375032, // 3 * G4 @@ -733,63 +733,63 @@ namespace gtc T const F4 = static_cast(0.309016994374947451); // First corner - vec<4, T, P> i = floor(v + dot(v, vec4(F4))); - vec<4, T, P> x0 = v - i + dot(i, vec4(C.x)); + vec<4, T, Q> i = floor(v + dot(v, vec4(F4))); + vec<4, T, Q> x0 = v - i + dot(i, vec4(C.x)); // Other corners // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI) - vec<4, T, P> i0; - vec<3, T, P> isX = step(vec<3, T, P>(x0.y, x0.z, x0.w), vec<3, T, P>(x0.x)); - vec<3, T, P> isYZ = step(vec<3, T, P>(x0.z, x0.w, x0.w), vec<3, T, P>(x0.y, x0.y, x0.z)); + vec<4, T, Q> i0; + vec<3, T, Q> isX = step(vec<3, T, Q>(x0.y, x0.z, x0.w), vec<3, T, Q>(x0.x)); + vec<3, T, Q> isYZ = step(vec<3, T, Q>(x0.z, x0.w, x0.w), vec<3, T, Q>(x0.y, x0.y, x0.z)); // i0.x = dot(isX, vec3(1.0)); //i0.x = isX.x + isX.y + isX.z; //i0.yzw = static_cast(1) - isX; - i0 = vec<4, T, P>(isX.x + isX.y + isX.z, T(1) - isX); + i0 = vec<4, T, Q>(isX.x + isX.y + isX.z, T(1) - isX); // i0.y += dot(isYZ.xy, vec2(1.0)); i0.y += isYZ.x + isYZ.y; - //i0.zw += 1.0 - vec<2, T, P>(isYZ.x, isYZ.y); + //i0.zw += 1.0 - vec<2, T, Q>(isYZ.x, isYZ.y); i0.z += static_cast(1) - isYZ.x; i0.w += static_cast(1) - isYZ.y; i0.z += isYZ.z; i0.w += static_cast(1) - isYZ.z; // i0 now contains the unique values 0,1,2,3 in each channel - vec<4, T, P> i3 = clamp(i0, T(0), T(1)); - vec<4, T, P> i2 = clamp(i0 - T(1), T(0), T(1)); - vec<4, T, P> i1 = clamp(i0 - T(2), T(0), T(1)); + vec<4, T, Q> i3 = clamp(i0, T(0), T(1)); + vec<4, T, Q> i2 = clamp(i0 - T(1), T(0), T(1)); + vec<4, T, Q> i1 = clamp(i0 - T(2), T(0), T(1)); // x0 = x0 - 0.0 + 0.0 * C.xxxx // x1 = x0 - i1 + 0.0 * C.xxxx // x2 = x0 - i2 + 0.0 * C.xxxx // x3 = x0 - i3 + 0.0 * C.xxxx // x4 = x0 - 1.0 + 4.0 * C.xxxx - vec<4, T, P> x1 = x0 - i1 + C.x; - vec<4, T, P> x2 = x0 - i2 + C.y; - vec<4, T, P> x3 = x0 - i3 + C.z; - vec<4, T, P> x4 = x0 + C.w; + vec<4, T, Q> x1 = x0 - i1 + C.x; + vec<4, T, Q> x2 = x0 - i2 + C.y; + vec<4, T, Q> x3 = x0 - i3 + C.z; + vec<4, T, Q> x4 = x0 + C.w; // Permutations - i = mod(i, vec<4, T, P>(289)); + i = mod(i, vec<4, T, Q>(289)); T j0 = detail::permute(detail::permute(detail::permute(detail::permute(i.w) + i.z) + i.y) + i.x); - vec<4, T, P> j1 = detail::permute(detail::permute(detail::permute(detail::permute( - i.w + vec<4, T, P>(i1.w, i2.w, i3.w, T(1))) + - i.z + vec<4, T, P>(i1.z, i2.z, i3.z, T(1))) + - i.y + vec<4, T, P>(i1.y, i2.y, i3.y, T(1))) + - i.x + vec<4, T, P>(i1.x, i2.x, i3.x, T(1))); + vec<4, T, Q> j1 = detail::permute(detail::permute(detail::permute(detail::permute( + i.w + vec<4, T, Q>(i1.w, i2.w, i3.w, T(1))) + + i.z + vec<4, T, Q>(i1.z, i2.z, i3.z, T(1))) + + i.y + vec<4, T, Q>(i1.y, i2.y, i3.y, T(1))) + + i.x + vec<4, T, Q>(i1.x, i2.x, i3.x, T(1))); // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope // 7*7*6 = 294, which is close to the ring size 17*17 = 289. - vec<4, T, P> ip = vec<4, T, P>(T(1) / T(294), T(1) / T(49), T(1) / T(7), T(0)); + vec<4, T, Q> ip = vec<4, T, Q>(T(1) / T(294), T(1) / T(49), T(1) / T(7), T(0)); - vec<4, T, P> p0 = gtc::grad4(j0, ip); - vec<4, T, P> p1 = gtc::grad4(j1.x, ip); - vec<4, T, P> p2 = gtc::grad4(j1.y, ip); - vec<4, T, P> p3 = gtc::grad4(j1.z, ip); - vec<4, T, P> p4 = gtc::grad4(j1.w, ip); + vec<4, T, Q> p0 = gtc::grad4(j0, ip); + vec<4, T, Q> p1 = gtc::grad4(j1.x, ip); + vec<4, T, Q> p2 = gtc::grad4(j1.y, ip); + vec<4, T, Q> p3 = gtc::grad4(j1.z, ip); + vec<4, T, Q> p4 = gtc::grad4(j1.w, ip); // Normalise gradients - vec<4, T, P> norm = detail::taylorInvSqrt(vec<4, T, P>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3))); + vec<4, T, Q> norm = detail::taylorInvSqrt(vec<4, T, Q>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3))); p0 *= norm.x; p1 *= norm.y; p2 *= norm.z; @@ -797,12 +797,12 @@ namespace gtc p4 *= detail::taylorInvSqrt(dot(p4, p4)); // Mix contributions from the five corners - vec<3, T, P> m0 = max(T(0.6) - vec<3, T, P>(dot(x0, x0), dot(x1, x1), dot(x2, x2)), vec<3, T, P>(0)); - vec<2, T, P> m1 = max(T(0.6) - vec<2, T, P>(dot(x3, x3), dot(x4, x4) ), vec<2, T, P>(0)); + vec<3, T, Q> m0 = max(T(0.6) - vec<3, T, Q>(dot(x0, x0), dot(x1, x1), dot(x2, x2)), vec<3, T, Q>(0)); + vec<2, T, Q> m1 = max(T(0.6) - vec<2, T, Q>(dot(x3, x3), dot(x4, x4) ), vec<2, T, Q>(0)); m0 = m0 * m0; m1 = m1 * m1; return T(49) * - (dot(m0 * m0, vec<3, T, P>(dot(p0, x0), dot(p1, x1), dot(p2, x2))) + - dot(m1 * m1, vec<2, T, P>(dot(p3, x3), dot(p4, x4)))); + (dot(m0 * m0, vec<3, T, Q>(dot(p0, x0), dot(p1, x1), dot(p2, x2))) + + dot(m1 * m1, vec<2, T, Q>(dot(p3, x3), dot(p4, x4)))); } }//namespace glm diff --git a/glm/gtc/packing.hpp b/glm/gtc/packing.hpp index 5e8ad6fb..ac529c2b 100644 --- a/glm/gtc/packing.hpp +++ b/glm/gtc/packing.hpp @@ -475,20 +475,20 @@ namespace glm /// the forth component specifies the 16 most-significant bits. /// /// @see gtc_packing - /// @see vec<3, T, P> unpackRGBM(vec<4, T, P> const& p) + /// @see vec<3, T, Q> unpackRGBM(vec<4, T, Q> const& p) /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - template - GLM_FUNC_DECL vec<4, T, P> packRGBM(vec<3, T, P> const& rgb); + template + GLM_FUNC_DECL vec<4, T, Q> packRGBM(vec<3, T, Q> const& rgb); /// Returns a floating-point vector with components obtained by reinterpreting an integer vector as 16-bit floating-point numbers and converting them to 32-bit floating-point values. /// The first component of the vector is obtained from the 16 least-significant bits of v; /// the forth component is obtained from the 16 most-significant bits of v. /// /// @see gtc_packing - /// @see vec<4, T, P> packRGBM(vec<3, float, P> const& v) + /// @see vec<4, T, Q> packRGBM(vec<3, float, Q> const& v) /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - template - GLM_FUNC_DECL vec<3, T, P> unpackRGBM(vec<4, T, P> const& rgbm); + template + GLM_FUNC_DECL vec<3, T, Q> unpackRGBM(vec<4, T, Q> const& rgbm); /// Returns an unsigned integer vector obtained by converting the components of a floating-point vector /// to the 16-bit floating-point representation found in the OpenGL Specification. @@ -496,48 +496,48 @@ namespace glm /// the forth component specifies the 16 most-significant bits. /// /// @see gtc_packing - /// @see vec unpackHalf(vec const& p) + /// @see vec unpackHalf(vec const& p) /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - template - GLM_FUNC_DECL vec packHalf(vec const& v); + template + GLM_FUNC_DECL vec packHalf(vec const& v); /// Returns a floating-point vector with components obtained by reinterpreting an integer vector as 16-bit floating-point numbers and converting them to 32-bit floating-point values. /// The first component of the vector is obtained from the 16 least-significant bits of v; /// the forth component is obtained from the 16 most-significant bits of v. /// /// @see gtc_packing - /// @see vec packHalf(vec const& v) + /// @see vec packHalf(vec const& v) /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - template - GLM_FUNC_DECL vec unpackHalf(vec const& p); + template + GLM_FUNC_DECL vec unpackHalf(vec const& p); /// Convert each component of the normalized floating-point vector into unsigned integer values. /// /// @see gtc_packing - /// @see vec unpackUnorm(vec const& p); - template - GLM_FUNC_DECL vec packUnorm(vec const& v); + /// @see vec unpackUnorm(vec const& p); + template + GLM_FUNC_DECL vec packUnorm(vec const& v); /// Convert a packed integer to a normalized floating-point vector. /// /// @see gtc_packing - /// @see vec packUnorm(vec const& v) - template - GLM_FUNC_DECL vec unpackUnorm(vec const& v); + /// @see vec packUnorm(vec const& v) + template + GLM_FUNC_DECL vec unpackUnorm(vec const& v); /// Convert each component of the normalized floating-point vector into signed integer values. /// /// @see gtc_packing - /// @see vec unpackSnorm(vec const& p); - template - GLM_FUNC_DECL vec packSnorm(vec const& v); + /// @see vec unpackSnorm(vec const& p); + template + GLM_FUNC_DECL vec packSnorm(vec const& v); /// Convert a packed integer to a normalized floating-point vector. /// /// @see gtc_packing - /// @see vec packSnorm(vec const& v) - template - GLM_FUNC_DECL vec unpackSnorm(vec const& v); + /// @see vec packSnorm(vec const& v) + template + GLM_FUNC_DECL vec unpackSnorm(vec const& v); /// Convert each component of the normalized floating-point vector into unsigned integer values. /// diff --git a/glm/gtc/packing.inl b/glm/gtc/packing.inl index 8e6340e5..39031b32 100644 --- a/glm/gtc/packing.inl +++ b/glm/gtc/packing.inl @@ -271,14 +271,14 @@ namespace detail uint32 pack; }; - template + template struct compute_half {}; - template - struct compute_half<1, P> + template + struct compute_half<1, Q> { - GLM_FUNC_QUALIFIER static vec<1, uint16, P> pack(vec<1, float, P> const& v) + GLM_FUNC_QUALIFIER static vec<1, uint16, Q> pack(vec<1, float, Q> const& v) { int16 const Unpack(detail::toFloat16(v.x)); u16vec1 Packed; @@ -286,68 +286,68 @@ namespace detail return Packed; } - GLM_FUNC_QUALIFIER static vec<1, float, P> unpack(vec<1, uint16, P> const& v) + GLM_FUNC_QUALIFIER static vec<1, float, Q> unpack(vec<1, uint16, Q> const& v) { i16vec1 Unpack; memcpy(&Unpack, &v, sizeof(Unpack)); - return vec<1, float, P>(detail::toFloat32(v.x)); + return vec<1, float, Q>(detail::toFloat32(v.x)); } }; - template - struct compute_half<2, P> + template + struct compute_half<2, Q> { - GLM_FUNC_QUALIFIER static vec<2, uint16, P> pack(vec<2, float, P> const& v) + GLM_FUNC_QUALIFIER static vec<2, uint16, Q> pack(vec<2, float, Q> const& v) { - vec<2, int16, P> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y)); + vec<2, int16, Q> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y)); u16vec2 Packed; memcpy(&Packed, &Unpack, sizeof(Packed)); return Packed; } - GLM_FUNC_QUALIFIER static vec<2, float, P> unpack(vec<2, uint16, P> const& v) + GLM_FUNC_QUALIFIER static vec<2, float, Q> unpack(vec<2, uint16, Q> const& v) { i16vec2 Unpack; memcpy(&Unpack, &v, sizeof(Unpack)); - return vec<2, float, P>(detail::toFloat32(v.x), detail::toFloat32(v.y)); + return vec<2, float, Q>(detail::toFloat32(v.x), detail::toFloat32(v.y)); } }; - template - struct compute_half<3, P> + template + struct compute_half<3, Q> { - GLM_FUNC_QUALIFIER static vec<3, uint16, P> pack(vec<3, float, P> const& v) + GLM_FUNC_QUALIFIER static vec<3, uint16, Q> pack(vec<3, float, Q> const& v) { - vec<3, int16, P> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y), detail::toFloat16(v.z)); + vec<3, int16, Q> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y), detail::toFloat16(v.z)); u16vec3 Packed; memcpy(&Packed, &Unpack, sizeof(Packed)); return Packed; } - GLM_FUNC_QUALIFIER static vec<3, float, P> unpack(vec<3, uint16, P> const& v) + GLM_FUNC_QUALIFIER static vec<3, float, Q> unpack(vec<3, uint16, Q> const& v) { i16vec3 Unpack; memcpy(&Unpack, &v, sizeof(Unpack)); - return vec<3, float, P>(detail::toFloat32(v.x), detail::toFloat32(v.y), detail::toFloat32(v.z)); + return vec<3, float, Q>(detail::toFloat32(v.x), detail::toFloat32(v.y), detail::toFloat32(v.z)); } }; - template - struct compute_half<4, P> + template + struct compute_half<4, Q> { - GLM_FUNC_QUALIFIER static vec<4, uint16, P> pack(vec<4, float, P> const& v) + GLM_FUNC_QUALIFIER static vec<4, uint16, Q> pack(vec<4, float, Q> const& v) { - vec<4, int16, P> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y), detail::toFloat16(v.z), detail::toFloat16(v.w)); + vec<4, int16, Q> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y), detail::toFloat16(v.z), detail::toFloat16(v.w)); u16vec4 Packed; memcpy(&Packed, &Unpack, sizeof(Packed)); return Packed; } - GLM_FUNC_QUALIFIER static vec<4, float, P> unpack(vec<4, uint16, P> const& v) + GLM_FUNC_QUALIFIER static vec<4, float, Q> unpack(vec<4, uint16, Q> const& v) { i16vec4 Unpack; memcpy(&Unpack, &v, sizeof(Unpack)); - return vec<4, float, P>(detail::toFloat32(v.x), detail::toFloat32(v.y), detail::toFloat32(v.z), detail::toFloat32(v.w)); + return vec<4, float, Q>(detail::toFloat32(v.x), detail::toFloat32(v.y), detail::toFloat32(v.z), detail::toFloat32(v.w)); } }; }//namespace detail @@ -641,67 +641,67 @@ namespace detail } // Based on Brian Karis http://graphicrants.blogspot.fr/2009/04/rgbm-color-encoding.html - template - GLM_FUNC_QUALIFIER vec<4, T, P> packRGBM(vec<3, T, P> const& rgb) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> packRGBM(vec<3, T, Q> const& rgb) { - vec<3, T, P> const Color(rgb * static_cast(1.0 / 6.0)); + vec<3, T, Q> const Color(rgb * static_cast(1.0 / 6.0)); T Alpha = clamp(max(max(Color.x, Color.y), max(Color.z, static_cast(1e-6))), static_cast(0), static_cast(1)); Alpha = ceil(Alpha * static_cast(255.0)) / static_cast(255.0); - return vec<4, T, P>(Color / Alpha, Alpha); + return vec<4, T, Q>(Color / Alpha, Alpha); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> unpackRGBM(vec<4, T, P> const& rgbm) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> unpackRGBM(vec<4, T, Q> const& rgbm) { - return vec<3, T, P>(rgbm.x, rgbm.y, rgbm.z) * rgbm.w * static_cast(6); + return vec<3, T, Q>(rgbm.x, rgbm.y, rgbm.z) * rgbm.w * static_cast(6); } - template - GLM_FUNC_QUALIFIER vec packHalf(vec const& v) + template + GLM_FUNC_QUALIFIER vec packHalf(vec const& v) { - return detail::compute_half::pack(v); + return detail::compute_half::pack(v); } - template - GLM_FUNC_QUALIFIER vec unpackHalf(vec const& v) + template + GLM_FUNC_QUALIFIER vec unpackHalf(vec const& v) { - return detail::compute_half::unpack(v); + return detail::compute_half::unpack(v); } - template - GLM_FUNC_QUALIFIER vec packUnorm(vec const& v) + template + GLM_FUNC_QUALIFIER vec packUnorm(vec const& v) { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "uintType must be an integer type"); GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "floatType must be a floating point type"); - return vec(round(clamp(v, static_cast(0), static_cast(1)) * static_cast(std::numeric_limits::max()))); + return vec(round(clamp(v, static_cast(0), static_cast(1)) * static_cast(std::numeric_limits::max()))); } - template - GLM_FUNC_QUALIFIER vec unpackUnorm(vec const& v) + template + GLM_FUNC_QUALIFIER vec unpackUnorm(vec const& v) { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "uintType must be an integer type"); GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "floatType must be a floating point type"); - return vec(v) * (static_cast(1) / static_cast(std::numeric_limits::max())); + return vec(v) * (static_cast(1) / static_cast(std::numeric_limits::max())); } - template - GLM_FUNC_QUALIFIER vec packSnorm(vec const& v) + template + GLM_FUNC_QUALIFIER vec packSnorm(vec const& v) { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "uintType must be an integer type"); GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "floatType must be a floating point type"); - return vec(round(clamp(v , static_cast(-1), static_cast(1)) * static_cast(std::numeric_limits::max()))); + return vec(round(clamp(v , static_cast(-1), static_cast(1)) * static_cast(std::numeric_limits::max()))); } - template - GLM_FUNC_QUALIFIER vec unpackSnorm(vec const& v) + template + GLM_FUNC_QUALIFIER vec unpackSnorm(vec const& v) { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "uintType must be an integer type"); GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "floatType must be a floating point type"); - return clamp(vec(v) * (static_cast(1) / static_cast(std::numeric_limits::max())), static_cast(-1), static_cast(1)); + return clamp(vec(v) * (static_cast(1) / static_cast(std::numeric_limits::max())), static_cast(-1), static_cast(1)); } GLM_FUNC_QUALIFIER uint8 packUnorm2x4(vec2 const& v) diff --git a/glm/gtc/quaternion.hpp b/glm/gtc/quaternion.hpp index b343f130..d9947c6c 100644 --- a/glm/gtc/quaternion.hpp +++ b/glm/gtc/quaternion.hpp @@ -29,12 +29,12 @@ namespace glm /// @addtogroup gtc_quaternion /// @{ - template + template struct tquat { // -- Implementation detail -- - typedef tquat type; + typedef tquat type; typedef T value_type; // -- Data -- @@ -78,13 +78,13 @@ namespace glm // -- Implicit basic constructors -- GLM_FUNC_DECL GLM_CONSTEXPR tquat() GLM_DEFAULT; - GLM_FUNC_DECL GLM_CONSTEXPR tquat(tquat const& q) GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR tquat(tquat const& q) GLM_DEFAULT; template GLM_FUNC_DECL GLM_CONSTEXPR tquat(tquat const& q); // -- Explicit basic constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR tquat(T s, vec<3, T, P> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR tquat(T s, vec<3, T, Q> const& v); GLM_FUNC_DECL GLM_CONSTEXPR tquat(T w, T x, T y, T z); // -- Conversion constructors -- @@ -94,8 +94,8 @@ namespace glm /// Explicit conversion operators # if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS - GLM_FUNC_DECL explicit operator mat<3, 3, T, P>(); - GLM_FUNC_DECL explicit operator mat<4, 4, T, P>(); + GLM_FUNC_DECL explicit operator mat<3, 3, T, Q>(); + GLM_FUNC_DECL explicit operator mat<4, 4, T, Q>(); # endif /// Create a quaternion from two normalized axis @@ -104,99 +104,99 @@ namespace glm /// @param v A second normalized axis /// @see gtc_quaternion /// @see http://lolengine.net/blog/2013/09/18/beautiful-maths-quaternion-from-vectors - GLM_FUNC_DECL tquat(vec<3, T, P> const& u, vec<3, T, P> const& v); + GLM_FUNC_DECL tquat(vec<3, T, Q> const& u, vec<3, T, Q> const& v); /// Build a quaternion from euler angles (pitch, yaw, roll), in radians. - GLM_FUNC_DECL GLM_EXPLICIT tquat(vec<3, T, P> const& eulerAngles); - GLM_FUNC_DECL GLM_EXPLICIT tquat(mat<3, 3, T, P> const& q); - GLM_FUNC_DECL GLM_EXPLICIT tquat(mat<4, 4, T, P> const& q); + GLM_FUNC_DECL GLM_EXPLICIT tquat(vec<3, T, Q> const& eulerAngles); + GLM_FUNC_DECL GLM_EXPLICIT tquat(mat<3, 3, T, Q> const& q); + GLM_FUNC_DECL GLM_EXPLICIT tquat(mat<4, 4, T, Q> const& q); // -- Unary arithmetic operators -- - GLM_FUNC_DECL tquat & operator=(tquat const& q) GLM_DEFAULT; + GLM_FUNC_DECL tquat & operator=(tquat const& q) GLM_DEFAULT; template - GLM_FUNC_DECL tquat & operator=(tquat const& q); + GLM_FUNC_DECL tquat & operator=(tquat const& q); template - GLM_FUNC_DECL tquat & operator+=(tquat const& q); + GLM_FUNC_DECL tquat & operator+=(tquat const& q); template - GLM_FUNC_DECL tquat & operator-=(tquat const& q); + GLM_FUNC_DECL tquat & operator-=(tquat const& q); template - GLM_FUNC_DECL tquat & operator*=(tquat const& q); + GLM_FUNC_DECL tquat & operator*=(tquat const& q); template - GLM_FUNC_DECL tquat & operator*=(U s); + GLM_FUNC_DECL tquat & operator*=(U s); template - GLM_FUNC_DECL tquat & operator/=(U s); + GLM_FUNC_DECL tquat & operator/=(U s); }; // -- Unary bit operators -- - template - GLM_FUNC_DECL tquat operator+(tquat const& q); + template + GLM_FUNC_DECL tquat operator+(tquat const& q); - template - GLM_FUNC_DECL tquat operator-(tquat const& q); + template + GLM_FUNC_DECL tquat operator-(tquat const& q); // -- Binary operators -- - template - GLM_FUNC_DECL tquat operator+(tquat const& q, tquat const& p); + template + GLM_FUNC_DECL tquat operator+(tquat const& q, tquat const& p); - template - GLM_FUNC_DECL tquat operator*(tquat const& q, tquat const& p); + template + GLM_FUNC_DECL tquat operator*(tquat const& q, tquat const& p); - template - GLM_FUNC_DECL vec<3, T, P> operator*(tquat const& q, vec<3, T, P> const& v); + template + GLM_FUNC_DECL vec<3, T, Q> operator*(tquat const& q, vec<3, T, Q> const& v); - template - GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const& v, tquat const& q); + template + GLM_FUNC_DECL vec<3, T, Q> operator*(vec<3, T, Q> const& v, tquat const& q); - template - GLM_FUNC_DECL vec<4, T, P> operator*(tquat const& q, vec<4, T, P> const& v); + template + GLM_FUNC_DECL vec<4, T, Q> operator*(tquat const& q, vec<4, T, Q> const& v); - template - GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const& v, tquat const& q); + template + GLM_FUNC_DECL vec<4, T, Q> operator*(vec<4, T, Q> const& v, tquat const& q); - template - GLM_FUNC_DECL tquat operator*(tquat const& q, T const& s); + template + GLM_FUNC_DECL tquat operator*(tquat const& q, T const& s); - template - GLM_FUNC_DECL tquat operator*(T const& s, tquat const& q); + template + GLM_FUNC_DECL tquat operator*(T const& s, tquat const& q); - template - GLM_FUNC_DECL tquat operator/(tquat const& q, T const& s); + template + GLM_FUNC_DECL tquat operator/(tquat const& q, T const& s); // -- Boolean operators -- - template - GLM_FUNC_DECL bool operator==(tquat const& q1, tquat const& q2); + template + GLM_FUNC_DECL bool operator==(tquat const& q1, tquat const& q2); - template - GLM_FUNC_DECL bool operator!=(tquat const& q1, tquat const& q2); + template + GLM_FUNC_DECL bool operator!=(tquat const& q1, tquat const& q2); /// Returns the length of the quaternion. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL T length(tquat const& q); + template + GLM_FUNC_DECL T length(tquat const& q); /// Returns the normalized quaternion. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL tquat normalize(tquat const& q); + template + GLM_FUNC_DECL tquat normalize(tquat const& q); /// Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ... /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL T dot(tquat const& x, tquat const& y); + template + GLM_FUNC_DECL T dot(tquat const& x, tquat const& y); /// Spherical linear interpolation of two quaternions. /// The interpolation is oriented and the rotation is performed at constant speed. @@ -207,10 +207,10 @@ namespace glm /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. /// @tparam T Floating-point scalar types. /// - /// @see - slerp(tquat const& x, tquat const& y, T const& a) + /// @see - slerp(tquat const& x, tquat const& y, T const& a) /// @see gtc_quaternion - template - GLM_FUNC_DECL tquat mix(tquat const& x, tquat const& y, T a); + template + GLM_FUNC_DECL tquat mix(tquat const& x, tquat const& y, T a); /// Linear interpolation of two quaternions. /// The interpolation is oriented. @@ -221,8 +221,8 @@ namespace glm /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL tquat lerp(tquat const& x, tquat const& y, T a); + template + GLM_FUNC_DECL tquat lerp(tquat const& x, tquat const& y, T a); /// Spherical linear interpolation of two quaternions. /// The interpolation always take the short path and the rotation is performed at constant speed. @@ -233,24 +233,24 @@ namespace glm /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL tquat slerp(tquat const& x, tquat const& y, T a); + template + GLM_FUNC_DECL tquat slerp(tquat const& x, tquat const& y, T a); /// Returns the q conjugate. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL tquat conjugate(tquat const& q); + template + GLM_FUNC_DECL tquat conjugate(tquat const& q); /// Returns the q inverse. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL tquat inverse(tquat const& q); + template + GLM_FUNC_DECL tquat inverse(tquat const& q); /// Rotates a quaternion from a vector of 3 components axis and an angle. /// @@ -260,8 +260,8 @@ namespace glm /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL tquat rotate(tquat const& q, T const& angle, vec<3, T, P> const& axis); + template + GLM_FUNC_DECL tquat rotate(tquat const& q, T const& angle, vec<3, T, Q> const& axis); /// Returns euler angles, pitch as x, yaw as y, roll as z. /// The result is expressed in radians. @@ -269,80 +269,80 @@ namespace glm /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL vec<3, T, P> eulerAngles(tquat const& x); + template + GLM_FUNC_DECL vec<3, T, Q> eulerAngles(tquat const& x); /// Returns roll value of euler angles expressed in radians. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL T roll(tquat const& x); + template + GLM_FUNC_DECL T roll(tquat const& x); /// Returns pitch value of euler angles expressed in radians. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL T pitch(tquat const& x); + template + GLM_FUNC_DECL T pitch(tquat const& x); /// Returns yaw value of euler angles expressed in radians. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL T yaw(tquat const& x); + template + GLM_FUNC_DECL T yaw(tquat const& x); /// Converts a quaternion to a 3 * 3 matrix. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL mat<3, 3, T, P> mat3_cast(tquat const& x); + template + GLM_FUNC_DECL mat<3, 3, T, Q> mat3_cast(tquat const& x); /// Converts a quaternion to a 4 * 4 matrix. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL mat<4, 4, T, P> mat4_cast(tquat const& x); + template + GLM_FUNC_DECL mat<4, 4, T, Q> mat4_cast(tquat const& x); /// Converts a 3 * 3 matrix to a quaternion. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL tquat quat_cast(mat<3, 3, T, P> const& x); + template + GLM_FUNC_DECL tquat quat_cast(mat<3, 3, T, Q> const& x); /// Converts a 4 * 4 matrix to a quaternion. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL tquat quat_cast(mat<4, 4, T, P> const& x); + template + GLM_FUNC_DECL tquat quat_cast(mat<4, 4, T, Q> const& x); /// Returns the quaternion rotation angle. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL T angle(tquat const& x); + template + GLM_FUNC_DECL T angle(tquat const& x); /// Returns the q rotation axis. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL vec<3, T, P> axis(tquat const& x); + template + GLM_FUNC_DECL vec<3, T, Q> axis(tquat const& x); /// Build a quaternion from an angle and a normalized axis. /// @@ -351,56 +351,56 @@ namespace glm /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL tquat angleAxis(T const& angle, vec<3, T, P> const& axis); + template + GLM_FUNC_DECL tquat angleAxis(T const& angle, vec<3, T, Q> const& axis); /// Returns the component-wise comparison result of x < y. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL vec<4, bool, P> lessThan(tquat const& x, tquat const& y); + template + GLM_FUNC_DECL vec<4, bool, Q> lessThan(tquat const& x, tquat const& y); /// Returns the component-wise comparison of result x <= y. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL vec<4, bool, P> lessThanEqual(tquat const& x, tquat const& y); + template + GLM_FUNC_DECL vec<4, bool, Q> lessThanEqual(tquat const& x, tquat const& y); /// Returns the component-wise comparison of result x > y. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL vec<4, bool, P> greaterThan(tquat const& x, tquat const& y); + template + GLM_FUNC_DECL vec<4, bool, Q> greaterThan(tquat const& x, tquat const& y); /// Returns the component-wise comparison of result x >= y. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL vec<4, bool, P> greaterThanEqual(tquat const& x, tquat const& y); + template + GLM_FUNC_DECL vec<4, bool, Q> greaterThanEqual(tquat const& x, tquat const& y); /// Returns the component-wise comparison of result x == y. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL vec<4, bool, P> equal(tquat const& x, tquat const& y); + template + GLM_FUNC_DECL vec<4, bool, Q> equal(tquat const& x, tquat const& y); /// Returns the component-wise comparison of result x != y. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL vec<4, bool, P> notEqual(tquat const& x, tquat const& y); + template + GLM_FUNC_DECL vec<4, bool, Q> notEqual(tquat const& x, tquat const& y); /// Returns true if x holds a NaN (not a number) /// representation in the underlying implementation's set of @@ -413,8 +413,8 @@ namespace glm /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL vec<4, bool, P> isnan(tquat const& x); + template + GLM_FUNC_DECL vec<4, bool, Q> isnan(tquat const& x); /// Returns true if x holds a positive infinity or negative /// infinity representation in the underlying implementation's @@ -425,8 +425,8 @@ namespace glm /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion - template - GLM_FUNC_DECL vec<4, bool, P> isinf(tquat const& x); + template + GLM_FUNC_DECL vec<4, bool, Q> isinf(tquat const& x); /// @} } //namespace glm diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index f8bd4545..fe6c052d 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -11,73 +11,73 @@ namespace glm{ namespace detail { - template - struct compute_dot, T, Aligned> + template + struct compute_dot, T, Aligned> { - static GLM_FUNC_QUALIFIER T call(tquat const& a, tquat const& b) + static GLM_FUNC_QUALIFIER T call(tquat const& a, tquat const& b) { - vec<4, T, P> tmp(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w); + vec<4, T, Q> tmp(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w); return (tmp.x + tmp.y) + (tmp.z + tmp.w); } }; - template + template struct compute_quat_add { - static tquat call(tquat const& q, tquat const& p) + static tquat call(tquat const& q, tquat const& p) { - return tquat(q.w + p.w, q.x + p.x, q.y + p.y, q.z + p.z); + return tquat(q.w + p.w, q.x + p.x, q.y + p.y, q.z + p.z); } }; - template + template struct compute_quat_sub { - static tquat call(tquat const& q, tquat const& p) + static tquat call(tquat const& q, tquat const& p) { - return tquat(q.w - p.w, q.x - p.x, q.y - p.y, q.z - p.z); + return tquat(q.w - p.w, q.x - p.x, q.y - p.y, q.z - p.z); } }; - template + template struct compute_quat_mul_scalar { - static tquat call(tquat const& q, T s) + static tquat call(tquat const& q, T s) { - return tquat(q.w * s, q.x * s, q.y * s, q.z * s); + return tquat(q.w * s, q.x * s, q.y * s, q.z * s); } }; - template + template struct compute_quat_div_scalar { - static tquat call(tquat const& q, T s) + static tquat call(tquat const& q, T s) { - return tquat(q.w / s, q.x / s, q.y / s, q.z / s); + return tquat(q.w / s, q.x / s, q.y / s, q.z / s); } }; - template + template struct compute_quat_mul_vec4 { - static vec<4, T, P> call(tquat const& q, vec<4, T, P> const& v) + static vec<4, T, Q> call(tquat const& q, vec<4, T, Q> const& v) { - return vec<4, T, P>(q * vec<3, T, P>(v), v.w); + return vec<4, T, Q>(q * vec<3, T, Q>(v), v.w); } }; }//namespace detail // -- Component accesses -- - template - GLM_FUNC_QUALIFIER T & tquat::operator[](typename tquat::length_type i) + template + GLM_FUNC_QUALIFIER T & tquat::operator[](typename tquat::length_type i) { assert(i >= 0 && i < this->length()); return (&x)[i]; } - template - GLM_FUNC_QUALIFIER T const& tquat::operator[](typename tquat::length_type i) const + template + GLM_FUNC_QUALIFIER T const& tquat::operator[](typename tquat::length_type i) const { assert(i >= 0 && i < this->length()); return (&x)[i]; @@ -86,41 +86,41 @@ namespace detail // -- Implicit basic constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat() + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat() {} # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat(tquat const& q) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat(tquat const& q) : x(q.x), y(q.y), z(q.z), w(q.w) {} # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat(tquat const& q) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat(tquat const& q) : x(q.x), y(q.y), z(q.z), w(q.w) {} // -- Explicit basic constructors -- - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat(T s, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat(T s, vec<3, T, Q> const& v) : x(v.x), y(v.y), z(v.z), w(s) {} - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat(T _w, T _x, T _y, T _z) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat(T _w, T _x, T _y, T _z) : x(_x), y(_y), z(_z), w(_w) {} // -- Conversion constructors -- - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat(tquat const& q) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat(tquat const& q) : x(static_cast(q.x)) , y(static_cast(q.y)) , z(static_cast(q.z)) @@ -145,21 +145,21 @@ namespace detail // this->z = c.x * c.y * s.z - s.x * s.y * c.z; //} - template - GLM_FUNC_QUALIFIER tquat::tquat(vec<3, T, P> const& u, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER tquat::tquat(vec<3, T, Q> const& u, vec<3, T, Q> const& v) { - vec<3, T, P> const LocalW(cross(u, v)); - T Dot = detail::compute_dot, T, detail::is_aligned

::value>::call(u, v); - tquat q(T(1) + Dot, LocalW.x, LocalW.y, LocalW.z); + vec<3, T, Q> const LocalW(cross(u, v)); + T Dot = detail::compute_dot, T, detail::is_aligned::value>::call(u, v); + tquat q(T(1) + Dot, LocalW.x, LocalW.y, LocalW.z); *this = normalize(q); } - template - GLM_FUNC_QUALIFIER tquat::tquat(vec<3, T, P> const& eulerAngle) + template + GLM_FUNC_QUALIFIER tquat::tquat(vec<3, T, Q> const& eulerAngle) { - vec<3, T, P> c = glm::cos(eulerAngle * T(0.5)); - vec<3, T, P> s = glm::sin(eulerAngle * T(0.5)); + vec<3, T, Q> c = glm::cos(eulerAngle * T(0.5)); + vec<3, T, Q> s = glm::sin(eulerAngle * T(0.5)); this->w = c.x * c.y * c.z + s.x * s.y * s.z; this->x = s.x * c.y * c.z - c.x * s.y * s.z; @@ -167,40 +167,40 @@ namespace detail this->z = c.x * c.y * s.z - s.x * s.y * c.z; } - template - GLM_FUNC_QUALIFIER tquat::tquat(mat<3, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER tquat::tquat(mat<3, 3, T, Q> const& m) { *this = quat_cast(m); } - template - GLM_FUNC_QUALIFIER tquat::tquat(mat<4, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER tquat::tquat(mat<4, 4, T, Q> const& m) { *this = quat_cast(m); } # if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS - template - GLM_FUNC_QUALIFIER tquat::operator mat<3, 3, T, P>() + template + GLM_FUNC_QUALIFIER tquat::operator mat<3, 3, T, Q>() { return mat3_cast(*this); } - template - GLM_FUNC_QUALIFIER tquat::operator mat<4, 4, T, P>() + template + GLM_FUNC_QUALIFIER tquat::operator mat<4, 4, T, Q>() { return mat4_cast(*this); } # endif//GLM_HAS_EXPLICIT_CONVERSION_OPERATORS - template - GLM_FUNC_QUALIFIER tquat conjugate(tquat const& q) + template + GLM_FUNC_QUALIFIER tquat conjugate(tquat const& q) { - return tquat(q.w, -q.x, -q.y, -q.z); + return tquat(q.w, -q.x, -q.y, -q.z); } - template - GLM_FUNC_QUALIFIER tquat inverse(tquat const& q) + template + GLM_FUNC_QUALIFIER tquat inverse(tquat const& q) { return conjugate(q) / dot(q, q); } @@ -208,8 +208,8 @@ namespace detail // -- Unary arithmetic operators -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER tquat & tquat::operator=(tquat const& q) + template + GLM_FUNC_QUALIFIER tquat & tquat::operator=(tquat const& q) { this->w = q.w; this->x = q.x; @@ -219,9 +219,9 @@ namespace detail } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template + template template - GLM_FUNC_QUALIFIER tquat & tquat::operator=(tquat const& q) + GLM_FUNC_QUALIFIER tquat & tquat::operator=(tquat const& q) { this->w = static_cast(q.w); this->x = static_cast(q.x); @@ -230,26 +230,26 @@ namespace detail return *this; } - template + template template - GLM_FUNC_QUALIFIER tquat & tquat::operator+=(tquat const& q) + GLM_FUNC_QUALIFIER tquat & tquat::operator+=(tquat const& q) { - return (*this = detail::compute_quat_add::value>::call(*this, tquat(q))); + return (*this = detail::compute_quat_add::value>::call(*this, tquat(q))); } - template + template template - GLM_FUNC_QUALIFIER tquat & tquat::operator-=(tquat const& q) + GLM_FUNC_QUALIFIER tquat & tquat::operator-=(tquat const& q) { - return (*this = detail::compute_quat_sub::value>::call(*this, tquat(q))); + return (*this = detail::compute_quat_sub::value>::call(*this, tquat(q))); } - template + template template - GLM_FUNC_QUALIFIER tquat & tquat::operator*=(tquat const& r) + GLM_FUNC_QUALIFIER tquat & tquat::operator*=(tquat const& r) { - tquat const p(*this); - tquat const q(r); + tquat const p(*this); + tquat const q(r); this->w = p.w * q.w - p.x * q.x - p.y * q.y - p.z * q.z; this->x = p.w * q.x + p.x * q.w + p.y * q.z - p.z * q.y; @@ -258,132 +258,132 @@ namespace detail return *this; } - template + template template - GLM_FUNC_QUALIFIER tquat & tquat::operator*=(U s) + GLM_FUNC_QUALIFIER tquat & tquat::operator*=(U s) { - return (*this = detail::compute_quat_mul_scalar::value>::call(*this, static_cast(s))); + return (*this = detail::compute_quat_mul_scalar::value>::call(*this, static_cast(s))); } - template + template template - GLM_FUNC_QUALIFIER tquat & tquat::operator/=(U s) + GLM_FUNC_QUALIFIER tquat & tquat::operator/=(U s) { - return (*this = detail::compute_quat_div_scalar::value>::call(*this, static_cast(s))); + return (*this = detail::compute_quat_div_scalar::value>::call(*this, static_cast(s))); } // -- Unary bit operators -- - template - GLM_FUNC_QUALIFIER tquat operator+(tquat const& q) + template + GLM_FUNC_QUALIFIER tquat operator+(tquat const& q) { return q; } - template - GLM_FUNC_QUALIFIER tquat operator-(tquat const& q) + template + GLM_FUNC_QUALIFIER tquat operator-(tquat const& q) { - return tquat(-q.w, -q.x, -q.y, -q.z); + return tquat(-q.w, -q.x, -q.y, -q.z); } // -- Binary operators -- - template - GLM_FUNC_QUALIFIER tquat operator+(tquat const& q, tquat const& p) + template + GLM_FUNC_QUALIFIER tquat operator+(tquat const& q, tquat const& p) { - return tquat(q) += p; + return tquat(q) += p; } - template - GLM_FUNC_QUALIFIER tquat operator*(tquat const& q, tquat const& p) + template + GLM_FUNC_QUALIFIER tquat operator*(tquat const& q, tquat const& p) { - return tquat(q) *= p; + return tquat(q) *= p; } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator*(tquat const& q, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator*(tquat const& q, vec<3, T, Q> const& v) { - vec<3, T, P> const QuatVector(q.x, q.y, q.z); - vec<3, T, P> const uv(glm::cross(QuatVector, v)); - vec<3, T, P> const uuv(glm::cross(QuatVector, uv)); + vec<3, T, Q> const QuatVector(q.x, q.y, q.z); + vec<3, T, Q> const uv(glm::cross(QuatVector, v)); + vec<3, T, Q> const uuv(glm::cross(QuatVector, uv)); return v + ((uv * q.w) + uuv) * static_cast(2); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const& v, tquat const& q) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator*(vec<3, T, Q> const& v, tquat const& q) { return glm::inverse(q) * v; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator*(tquat const& q, vec<4, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator*(tquat const& q, vec<4, T, Q> const& v) { - return detail::compute_quat_mul_vec4::value>::call(q, v); + return detail::compute_quat_mul_vec4::value>::call(q, v); } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator*(vec<4, T, P> const& v, tquat const& q) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator*(vec<4, T, Q> const& v, tquat const& q) { return glm::inverse(q) * v; } - template - GLM_FUNC_QUALIFIER tquat operator*(tquat const& q, T const& s) + template + GLM_FUNC_QUALIFIER tquat operator*(tquat const& q, T const& s) { - return tquat( + return tquat( q.w * s, q.x * s, q.y * s, q.z * s); } - template - GLM_FUNC_QUALIFIER tquat operator*(T const& s, tquat const& q) + template + GLM_FUNC_QUALIFIER tquat operator*(T const& s, tquat const& q) { return q * s; } - template - GLM_FUNC_QUALIFIER tquat operator/(tquat const& q, T const& s) + template + GLM_FUNC_QUALIFIER tquat operator/(tquat const& q, T const& s) { - return tquat( + return tquat( q.w / s, q.x / s, q.y / s, q.z / s); } // -- Boolean operators -- - template - GLM_FUNC_QUALIFIER bool operator==(tquat const& q1, tquat const& q2) + template + GLM_FUNC_QUALIFIER bool operator==(tquat const& q1, tquat const& q2) { return all(epsilonEqual(q1, q2, epsilon())); } - template - GLM_FUNC_QUALIFIER bool operator!=(tquat const& q1, tquat const& q2) + template + GLM_FUNC_QUALIFIER bool operator!=(tquat const& q1, tquat const& q2) { return any(epsilonNotEqual(q1, q2, epsilon())); } // -- Operations -- - template - GLM_FUNC_QUALIFIER T length(tquat const& q) + template + GLM_FUNC_QUALIFIER T length(tquat const& q) { return glm::sqrt(dot(q, q)); } - template - GLM_FUNC_QUALIFIER tquat normalize(tquat const& q) + template + GLM_FUNC_QUALIFIER tquat normalize(tquat const& q) { T len = length(q); if(len <= T(0)) // Problem - return tquat(static_cast(1), static_cast(0), static_cast(0), static_cast(0)); + return tquat(static_cast(1), static_cast(0), static_cast(0), static_cast(0)); T oneOverLen = T(1) / len; - return tquat(q.w * oneOverLen, q.x * oneOverLen, q.y * oneOverLen, q.z * oneOverLen); + return tquat(q.w * oneOverLen, q.x * oneOverLen, q.y * oneOverLen, q.z * oneOverLen); } - template - GLM_FUNC_QUALIFIER tquat cross(tquat const& q1, tquat const& q2) + template + GLM_FUNC_QUALIFIER tquat cross(tquat const& q1, tquat const& q2) { - return tquat( + return tquat( q1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z, q1.w * q2.x + q1.x * q2.w + q1.y * q2.z - q1.z * q2.y, q1.w * q2.y + q1.y * q2.w + q1.z * q2.x - q1.x * q2.z, @@ -391,14 +391,14 @@ namespace detail } /* // (x * sin(1 - a) * angle / sin(angle)) + (y * sin(a) * angle / sin(angle)) - template - GLM_FUNC_QUALIFIER tquat mix(tquat const& x, tquat const& y, T const& a) + template + GLM_FUNC_QUALIFIER tquat mix(tquat const& x, tquat const& y, T const& a) { if(a <= T(0)) return x; if(a >= T(1)) return y; float fCos = dot(x, y); - tquat y2(y); //BUG!!! tquat y2; + tquat y2(y); //BUG!!! tquat y2; if(fCos < T(0)) { y2 = -y; @@ -421,18 +421,18 @@ namespace detail k1 = sin((T(0) + a) * fAngle) * fOneOverSin; } - return tquat( + return tquat( k0 * x.w + k1 * y2.w, k0 * x.x + k1 * y2.x, k0 * x.y + k1 * y2.y, k0 * x.z + k1 * y2.z); } - template - GLM_FUNC_QUALIFIER tquat mix2 + template + GLM_FUNC_QUALIFIER tquat mix2 ( - tquat const& x, - tquat const& y, + tquat const& x, + tquat const& y, T const& a ) { @@ -466,8 +466,8 @@ namespace detail } */ - template - GLM_FUNC_QUALIFIER tquat mix(tquat const& x, tquat const& y, T a) + template + GLM_FUNC_QUALIFIER tquat mix(tquat const& x, tquat const& y, T a) { T cosTheta = dot(x, y); @@ -475,7 +475,7 @@ namespace detail if(cosTheta > T(1) - epsilon()) { // Linear interpolation - return tquat( + return tquat( mix(x.w, y.w, a), mix(x.x, y.x, a), mix(x.y, y.y, a), @@ -489,8 +489,8 @@ namespace detail } } - template - GLM_FUNC_QUALIFIER tquat lerp(tquat const& x, tquat const& y, T a) + template + GLM_FUNC_QUALIFIER tquat lerp(tquat const& x, tquat const& y, T a) { // Lerp is only defined in [0, 1] assert(a >= static_cast(0)); @@ -499,10 +499,10 @@ namespace detail return x * (T(1) - a) + (y * a); } - template - GLM_FUNC_QUALIFIER tquat slerp(tquat const& x, tquat const& y, T a) + template + GLM_FUNC_QUALIFIER tquat slerp(tquat const& x, tquat const& y, T a) { - tquat z = y; + tquat z = y; T cosTheta = dot(x, y); @@ -518,7 +518,7 @@ namespace detail if(cosTheta > T(1) - epsilon()) { // Linear interpolation - return tquat( + return tquat( mix(x.w, z.w, a), mix(x.x, z.x, a), mix(x.y, z.y, a), @@ -532,10 +532,10 @@ namespace detail } } - template - GLM_FUNC_QUALIFIER tquat rotate(tquat const& q, T const& angle, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER tquat rotate(tquat const& q, T const& angle, vec<3, T, Q> const& v) { - vec<3, T, P> Tmp = v; + vec<3, T, Q> Tmp = v; // Axis of rotation must be normalised T len = glm::length(Tmp); @@ -550,24 +550,24 @@ namespace detail T const AngleRad(angle); T const Sin = sin(AngleRad * T(0.5)); - return q * tquat(cos(AngleRad * T(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin); - //return gtc::quaternion::cross(q, tquat(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin)); + return q * tquat(cos(AngleRad * T(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin); + //return gtc::quaternion::cross(q, tquat(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin)); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> eulerAngles(tquat const& x) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> eulerAngles(tquat const& x) { - return vec<3, T, P>(pitch(x), yaw(x), roll(x)); + return vec<3, T, Q>(pitch(x), yaw(x), roll(x)); } - template - GLM_FUNC_QUALIFIER T roll(tquat const& q) + template + GLM_FUNC_QUALIFIER T roll(tquat const& q) { return static_cast(atan(static_cast(2) * (q.x * q.y + q.w * q.z), q.w * q.w + q.x * q.x - q.y * q.y - q.z * q.z)); } - template - GLM_FUNC_QUALIFIER T pitch(tquat const& q) + template + GLM_FUNC_QUALIFIER T pitch(tquat const& q) { //return T(atan(T(2) * (q.y * q.z + q.w * q.x), q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z)); const T y = static_cast(2) * (q.y * q.z + q.w * q.x); @@ -579,16 +579,16 @@ namespace detail return static_cast(atan(y,x)); } - template - GLM_FUNC_QUALIFIER T yaw(tquat const& q) + template + GLM_FUNC_QUALIFIER T yaw(tquat const& q) { return asin(clamp(static_cast(-2) * (q.x * q.z - q.w * q.y), static_cast(-1), static_cast(1))); } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> mat3_cast(tquat const& q) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> mat3_cast(tquat const& q) { - mat<3, 3, T, P> Result(T(1)); + mat<3, 3, T, Q> Result(T(1)); T qxx(q.x * q.x); T qyy(q.y * q.y); T qzz(q.z * q.z); @@ -613,14 +613,14 @@ namespace detail return Result; } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> mat4_cast(tquat const& q) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> mat4_cast(tquat const& q) { - return mat<4, 4, T, P>(mat3_cast(q)); + return mat<4, 4, T, Q>(mat3_cast(q)); } - template - GLM_FUNC_QUALIFIER tquat quat_cast(mat<3, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER tquat quat_cast(mat<3, 3, T, Q> const& m) { T fourXSquaredMinus1 = m[0][0] - m[1][1] - m[2][2]; T fourYSquaredMinus1 = m[1][1] - m[0][0] - m[2][2]; @@ -648,7 +648,7 @@ namespace detail T biggestVal = sqrt(fourBiggestSquaredMinus1 + static_cast(1)) * static_cast(0.5); T mult = static_cast(0.25) / biggestVal; - tquat Result; + tquat Result; switch(biggestIndex) { case 0: @@ -683,32 +683,32 @@ namespace detail return Result; } - template - GLM_FUNC_QUALIFIER tquat quat_cast(mat<4, 4, T, P> const& m4) + template + GLM_FUNC_QUALIFIER tquat quat_cast(mat<4, 4, T, Q> const& m4) { - return quat_cast(mat<3, 3, T, P>(m4)); + return quat_cast(mat<3, 3, T, Q>(m4)); } - template - GLM_FUNC_QUALIFIER T angle(tquat const& x) + template + GLM_FUNC_QUALIFIER T angle(tquat const& x) { return acos(x.w) * static_cast(2); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> axis(tquat const& x) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> axis(tquat const& x) { T tmp1 = static_cast(1) - x.w * x.w; if(tmp1 <= static_cast(0)) - return vec<3, T, P>(0, 0, 1); + return vec<3, T, Q>(0, 0, 1); T tmp2 = static_cast(1) / sqrt(tmp1); - return vec<3, T, P>(x.x * tmp2, x.y * tmp2, x.z * tmp2); + return vec<3, T, Q>(x.x * tmp2, x.y * tmp2, x.z * tmp2); } - template - GLM_FUNC_QUALIFIER tquat angleAxis(T const& angle, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER tquat angleAxis(T const& angle, vec<3, T, Q> const& v) { - tquat Result; + tquat Result; T const a(angle); T const s = glm::sin(a * static_cast(0.5)); @@ -720,74 +720,74 @@ namespace detail return Result; } - template - GLM_FUNC_QUALIFIER vec<4, bool, P> lessThan(tquat const& x, tquat const& y) + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> lessThan(tquat const& x, tquat const& y) { - vec<4, bool, P> Result; + vec<4, bool, Q> Result; for(length_t i = 0; i < x.length(); ++i) Result[i] = x[i] < y[i]; return Result; } - template - GLM_FUNC_QUALIFIER vec<4, bool, P> lessThanEqual(tquat const& x, tquat const& y) + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> lessThanEqual(tquat const& x, tquat const& y) { - vec<4, bool, P> Result; + vec<4, bool, Q> Result; for(length_t i = 0; i < x.length(); ++i) Result[i] = x[i] <= y[i]; return Result; } - template - GLM_FUNC_QUALIFIER vec<4, bool, P> greaterThan(tquat const& x, tquat const& y) + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> greaterThan(tquat const& x, tquat const& y) { - vec<4, bool, P> Result; + vec<4, bool, Q> Result; for(length_t i = 0; i < x.length(); ++i) Result[i] = x[i] > y[i]; return Result; } - template - GLM_FUNC_QUALIFIER vec<4, bool, P> greaterThanEqual(tquat const& x, tquat const& y) + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> greaterThanEqual(tquat const& x, tquat const& y) { - vec<4, bool, P> Result; + vec<4, bool, Q> Result; for(length_t i = 0; i < x.length(); ++i) Result[i] = x[i] >= y[i]; return Result; } - template - GLM_FUNC_QUALIFIER vec<4, bool, P> equal(tquat const& x, tquat const& y) + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> equal(tquat const& x, tquat const& y) { - vec<4, bool, P> Result; + vec<4, bool, Q> Result; for(length_t i = 0; i < x.length(); ++i) Result[i] = detail::compute_equal::call(x[i], y[i]); return Result; } - template - GLM_FUNC_QUALIFIER vec<4, bool, P> notEqual(tquat const& x, tquat const& y) + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> notEqual(tquat const& x, tquat const& y) { - vec<4, bool, P> Result; + vec<4, bool, Q> Result; for(length_t i = 0; i < x.length(); ++i) Result[i] = !detail::compute_equal::call(x[i], y[i]); return Result; } - template - GLM_FUNC_QUALIFIER vec<4, bool, P> isnan(tquat const& q) + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> isnan(tquat const& q) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isnan' only accept floating-point inputs"); - return vec<4, bool, P>(isnan(q.x), isnan(q.y), isnan(q.z), isnan(q.w)); + return vec<4, bool, Q>(isnan(q.x), isnan(q.y), isnan(q.z), isnan(q.w)); } - template - GLM_FUNC_QUALIFIER vec<4, bool, P> isinf(tquat const& q) + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> isinf(tquat const& q) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isinf' only accept floating-point inputs"); - return vec<4, bool, P>(isinf(q.x), isinf(q.y), isinf(q.z), isinf(q.w)); + return vec<4, bool, Q>(isinf(q.x), isinf(q.y), isinf(q.z), isinf(q.w)); } }//namespace glm diff --git a/glm/gtc/quaternion_simd.inl b/glm/gtc/quaternion_simd.inl index 14f67c07..4a8e4211 100644 --- a/glm/gtc/quaternion_simd.inl +++ b/glm/gtc/quaternion_simd.inl @@ -7,10 +7,10 @@ namespace glm{ namespace detail { /* - template + template struct compute_quat_mul { - static tquat call(tquat const& q1, tquat const& q2) + static tquat call(tquat const& q1, tquat const& q2) { // SSE2 STATS: 11 shuffle, 8 mul, 8 add // SSE4 STATS: 3 shuffle, 4 mul, 4 dpps @@ -61,19 +61,19 @@ namespace detail }; */ - template + template struct compute_dot, float, true> { - static GLM_FUNC_QUALIFIER float call(tquat const& x, tquat const& y) + static GLM_FUNC_QUALIFIER float call(tquat const& x, tquat const& y) { return _mm_cvtss_f32(glm_vec1_dot(x.data, y.data)); } }; - template + template struct compute_quat_add { - static tquat call(tquat const& q, tquat const& p) + static tquat call(tquat const& q, tquat const& p) { tquat Result; Result.data = _mm_add_ps(q.data, p.data); @@ -82,10 +82,10 @@ namespace detail }; # if GLM_ARCH & GLM_ARCH_AVX_BIT - template + template struct compute_quat_add { - static tquat call(tquat const& a, tquat const& b) + static tquat call(tquat const& a, tquat const& b) { tquat Result; Result.data = _mm256_add_pd(a.data, b.data); @@ -94,10 +94,10 @@ namespace detail }; # endif - template + template struct compute_quat_sub { - static tquat call(tquat const& q, tquat const& p) + static tquat call(tquat const& q, tquat const& p) { vec<4, float, P> Result; Result.data = _mm_sub_ps(q.data, p.data); @@ -106,10 +106,10 @@ namespace detail }; # if GLM_ARCH & GLM_ARCH_AVX_BIT - template + template struct compute_quat_sub { - static tquat call(tquat const& a, tquat const& b) + static tquat call(tquat const& a, tquat const& b) { tquat Result; Result.data = _mm256_sub_pd(a.data, b.data); @@ -118,10 +118,10 @@ namespace detail }; # endif - template + template struct compute_quat_mul_scalar { - static tquat call(tquat const& q, float s) + static tquat call(tquat const& q, float s) { vec<4, float, P> Result; Result.data = _mm_mul_ps(q.data, _mm_set_ps1(s)); @@ -130,10 +130,10 @@ namespace detail }; # if GLM_ARCH & GLM_ARCH_AVX_BIT - template + template struct compute_quat_mul_scalar { - static tquat call(tquat const& q, double s) + static tquat call(tquat const& q, double s) { tquat Result; Result.data = _mm256_mul_pd(q.data, _mm_set_ps1(s)); @@ -142,10 +142,10 @@ namespace detail }; # endif - template + template struct compute_quat_div_scalar { - static tquat call(tquat const& q, float s) + static tquat call(tquat const& q, float s) { vec<4, float, P> Result; Result.data = _mm_div_ps(q.data, _mm_set_ps1(s)); @@ -154,10 +154,10 @@ namespace detail }; # if GLM_ARCH & GLM_ARCH_AVX_BIT - template + template struct compute_quat_div_scalar { - static tquat call(tquat const& q, double s) + static tquat call(tquat const& q, double s) { tquat Result; Result.data = _mm256_div_pd(q.data, _mm_set_ps1(s)); @@ -166,10 +166,10 @@ namespace detail }; # endif - template + template struct compute_quat_mul_vec4 { - static vec<4, float, P> call(tquat const& q, vec<4, float, P> const& v) + static vec<4, float, P> call(tquat const& q, vec<4, float, Q> const& v) { __m128 const q_wwww = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 3, 3, 3)); __m128 const q_swp0 = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 0, 2, 1)); diff --git a/glm/gtc/random.hpp b/glm/gtc/random.hpp index 391dd929..65adb18a 100644 --- a/glm/gtc/random.hpp +++ b/glm/gtc/random.hpp @@ -42,8 +42,8 @@ namespace glm /// @tparam T Value type. Currently supported: float or double. /// /// @see gtc_random - template - GLM_FUNC_DECL vec linearRand(vec const& Min, vec const& Max); + template + GLM_FUNC_DECL vec linearRand(vec const& Min, vec const& Max); /// Generate random numbers in the interval [Min, Max], according a gaussian distribution /// diff --git a/glm/gtc/random.inl b/glm/gtc/random.inl index f0939bf0..ad9e64db 100644 --- a/glm/gtc/random.inl +++ b/glm/gtc/random.inl @@ -12,10 +12,10 @@ namespace glm{ namespace detail { - template + template struct compute_rand { - GLM_FUNC_QUALIFIER static vec call(); + GLM_FUNC_QUALIFIER static vec call(); }; template @@ -64,114 +64,114 @@ namespace detail } }; - template - struct compute_rand + template + struct compute_rand { - GLM_FUNC_QUALIFIER static vec call() + GLM_FUNC_QUALIFIER static vec call() { return - (vec(compute_rand::call()) << static_cast(8)) | - (vec(compute_rand::call()) << static_cast(0)); + (vec(compute_rand::call()) << static_cast(8)) | + (vec(compute_rand::call()) << static_cast(0)); } }; - template - struct compute_rand + template + struct compute_rand { - GLM_FUNC_QUALIFIER static vec call() + GLM_FUNC_QUALIFIER static vec call() { return - (vec(compute_rand::call()) << static_cast(16)) | - (vec(compute_rand::call()) << static_cast(0)); + (vec(compute_rand::call()) << static_cast(16)) | + (vec(compute_rand::call()) << static_cast(0)); } }; - template - struct compute_rand + template + struct compute_rand { - GLM_FUNC_QUALIFIER static vec call() + GLM_FUNC_QUALIFIER static vec call() { return - (vec(compute_rand::call()) << static_cast(32)) | - (vec(compute_rand::call()) << static_cast(0)); + (vec(compute_rand::call()) << static_cast(32)) | + (vec(compute_rand::call()) << static_cast(0)); } }; - template + template struct compute_linearRand { - GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max); + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max); }; - template - struct compute_linearRand + template + struct compute_linearRand { - GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) { - return (vec(compute_rand::call() % vec(Max + static_cast(1) - Min))) + Min; + return (vec(compute_rand::call() % vec(Max + static_cast(1) - Min))) + Min; } }; - template - struct compute_linearRand + template + struct compute_linearRand { - GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) { - return (compute_rand::call() % (Max + static_cast(1) - Min)) + Min; + return (compute_rand::call() % (Max + static_cast(1) - Min)) + Min; } }; - template - struct compute_linearRand + template + struct compute_linearRand { - GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) { - return (vec(compute_rand::call() % vec(Max + static_cast(1) - Min))) + Min; + return (vec(compute_rand::call() % vec(Max + static_cast(1) - Min))) + Min; } }; - template - struct compute_linearRand + template + struct compute_linearRand { - GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) { - return (compute_rand::call() % (Max + static_cast(1) - Min)) + Min; + return (compute_rand::call() % (Max + static_cast(1) - Min)) + Min; } }; - template - struct compute_linearRand + template + struct compute_linearRand { - GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) { - return (vec(compute_rand::call() % vec(Max + static_cast(1) - Min))) + Min; + return (vec(compute_rand::call() % vec(Max + static_cast(1) - Min))) + Min; } }; - template - struct compute_linearRand + template + struct compute_linearRand { - GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) { - return (compute_rand::call() % (Max + static_cast(1) - Min)) + Min; + return (compute_rand::call() % (Max + static_cast(1) - Min)) + Min; } }; - template - struct compute_linearRand + template + struct compute_linearRand { - GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) { - return (vec(compute_rand::call() % vec(Max + static_cast(1) - Min))) + Min; + return (vec(compute_rand::call() % vec(Max + static_cast(1) - Min))) + Min; } }; - template - struct compute_linearRand + template + struct compute_linearRand { - GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) { - return (compute_rand::call() % (Max + static_cast(1) - Min)) + Min; + return (compute_rand::call() % (Max + static_cast(1) - Min)) + Min; } }; @@ -265,10 +265,10 @@ namespace detail vec<1, genType, highp>(Max)).x; } - template - GLM_FUNC_QUALIFIER vec linearRand(vec const& Min, vec const& Max) + template + GLM_FUNC_QUALIFIER vec linearRand(vec const& Min, vec const& Max) { - return detail::compute_linearRand::call(Min, Max); + return detail::compute_linearRand::call(Min, Max); } template @@ -287,10 +287,10 @@ namespace detail return x2 * Deviation * Deviation * sqrt((genType(-2) * log(w)) / w) + Mean; } - template - GLM_FUNC_QUALIFIER vec gaussRand(vec const& Mean, vec const& Deviation) + template + GLM_FUNC_QUALIFIER vec gaussRand(vec const& Mean, vec const& Deviation) { - return detail::functor2::call(gaussRand, Mean, Deviation); + return detail::functor2::call(gaussRand, Mean, Deviation); } template diff --git a/glm/gtc/reciprocal.inl b/glm/gtc/reciprocal.inl index f18fafda..616ec9d1 100644 --- a/glm/gtc/reciprocal.inl +++ b/glm/gtc/reciprocal.inl @@ -14,11 +14,11 @@ namespace glm return genType(1) / glm::cos(angle); } - template - GLM_FUNC_QUALIFIER vec sec(vec const& x) + template + GLM_FUNC_QUALIFIER vec sec(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'sec' only accept floating-point inputs"); - return detail::functor1::call(sec, x); + return detail::functor1::call(sec, x); } // csc @@ -29,11 +29,11 @@ namespace glm return genType(1) / glm::sin(angle); } - template - GLM_FUNC_QUALIFIER vec csc(vec const& x) + template + GLM_FUNC_QUALIFIER vec csc(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'csc' only accept floating-point inputs"); - return detail::functor1::call(csc, x); + return detail::functor1::call(csc, x); } // cot @@ -46,11 +46,11 @@ namespace glm return glm::tan(pi_over_2 - angle); } - template - GLM_FUNC_QUALIFIER vec cot(vec const& x) + template + GLM_FUNC_QUALIFIER vec cot(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'cot' only accept floating-point inputs"); - return detail::functor1::call(cot, x); + return detail::functor1::call(cot, x); } // asec @@ -61,11 +61,11 @@ namespace glm return acos(genType(1) / x); } - template - GLM_FUNC_QUALIFIER vec asec(vec const& x) + template + GLM_FUNC_QUALIFIER vec asec(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'asec' only accept floating-point inputs"); - return detail::functor1::call(asec, x); + return detail::functor1::call(asec, x); } // acsc @@ -76,11 +76,11 @@ namespace glm return asin(genType(1) / x); } - template - GLM_FUNC_QUALIFIER vec acsc(vec const& x) + template + GLM_FUNC_QUALIFIER vec acsc(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acsc' only accept floating-point inputs"); - return detail::functor1::call(acsc, x); + return detail::functor1::call(acsc, x); } // acot @@ -93,11 +93,11 @@ namespace glm return pi_over_2 - atan(x); } - template - GLM_FUNC_QUALIFIER vec acot(vec const& x) + template + GLM_FUNC_QUALIFIER vec acot(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acot' only accept floating-point inputs"); - return detail::functor1::call(acot, x); + return detail::functor1::call(acot, x); } // sech @@ -108,11 +108,11 @@ namespace glm return genType(1) / glm::cosh(angle); } - template - GLM_FUNC_QUALIFIER vec sech(vec const& x) + template + GLM_FUNC_QUALIFIER vec sech(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'sech' only accept floating-point inputs"); - return detail::functor1::call(sech, x); + return detail::functor1::call(sech, x); } // csch @@ -123,11 +123,11 @@ namespace glm return genType(1) / glm::sinh(angle); } - template - GLM_FUNC_QUALIFIER vec csch(vec const& x) + template + GLM_FUNC_QUALIFIER vec csch(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'csch' only accept floating-point inputs"); - return detail::functor1::call(csch, x); + return detail::functor1::call(csch, x); } // coth @@ -138,11 +138,11 @@ namespace glm return glm::cosh(angle) / glm::sinh(angle); } - template - GLM_FUNC_QUALIFIER vec coth(vec const& x) + template + GLM_FUNC_QUALIFIER vec coth(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'coth' only accept floating-point inputs"); - return detail::functor1::call(coth, x); + return detail::functor1::call(coth, x); } // asech @@ -153,11 +153,11 @@ namespace glm return acosh(genType(1) / x); } - template - GLM_FUNC_QUALIFIER vec asech(vec const& x) + template + GLM_FUNC_QUALIFIER vec asech(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'asech' only accept floating-point inputs"); - return detail::functor1::call(asech, x); + return detail::functor1::call(asech, x); } // acsch @@ -168,11 +168,11 @@ namespace glm return acsch(genType(1) / x); } - template - GLM_FUNC_QUALIFIER vec acsch(vec const& x) + template + GLM_FUNC_QUALIFIER vec acsch(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acsch' only accept floating-point inputs"); - return detail::functor1::call(acsch, x); + return detail::functor1::call(acsch, x); } // acoth @@ -183,10 +183,10 @@ namespace glm return atanh(genType(1) / x); } - template - GLM_FUNC_QUALIFIER vec acoth(vec const& x) + template + GLM_FUNC_QUALIFIER vec acoth(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acoth' only accept floating-point inputs"); - return detail::functor1::call(acoth, x); + return detail::functor1::call(acoth, x); } }//namespace glm diff --git a/glm/gtc/round.hpp b/glm/gtc/round.hpp index b6afd3d8..31b73360 100644 --- a/glm/gtc/round.hpp +++ b/glm/gtc/round.hpp @@ -39,8 +39,8 @@ namespace glm /// Return true if the value is a power of two number. /// /// @see gtc_round - template - GLM_FUNC_DECL vec isPowerOfTwo(vec const& value); + template + GLM_FUNC_DECL vec isPowerOfTwo(vec const& value); /// Return the power of two number which value is just higher the input value, /// round up to a power of two. @@ -53,8 +53,8 @@ namespace glm /// round up to a power of two. /// /// @see gtc_round - template - GLM_FUNC_DECL vec ceilPowerOfTwo(vec const& value); + template + GLM_FUNC_DECL vec ceilPowerOfTwo(vec const& value); /// Return the power of two number which value is just lower the input value, /// round down to a power of two. @@ -67,8 +67,8 @@ namespace glm /// round down to a power of two. /// /// @see gtc_round - template - GLM_FUNC_DECL vec floorPowerOfTwo(vec const& value); + template + GLM_FUNC_DECL vec floorPowerOfTwo(vec const& value); /// Return the power of two number which value is the closet to the input value. /// @@ -79,8 +79,8 @@ namespace glm /// Return the power of two number which value is the closet to the input value. /// /// @see gtc_round - template - GLM_FUNC_DECL vec roundPowerOfTwo(vec const& value); + template + GLM_FUNC_DECL vec roundPowerOfTwo(vec const& value); /// Return true if the 'Value' is a multiple of 'Multiple'. /// @@ -91,14 +91,14 @@ namespace glm /// Return true if the 'Value' is a multiple of 'Multiple'. /// /// @see gtc_round - template - GLM_FUNC_DECL vec isMultiple(vec const& Value, T Multiple); + template + GLM_FUNC_DECL vec isMultiple(vec const& Value, T Multiple); /// Return true if the 'Value' is a multiple of 'Multiple'. /// /// @see gtc_round - template - GLM_FUNC_DECL vec isMultiple(vec const& Value, vec const& Multiple); + template + GLM_FUNC_DECL vec isMultiple(vec const& Value, vec const& Multiple); /// Higher multiple number of Source. /// @@ -115,8 +115,8 @@ namespace glm /// @param Multiple Must be a null or positive value /// /// @see gtc_round - template - GLM_FUNC_DECL vec ceilMultiple(vec const& Source, vec const& Multiple); + template + GLM_FUNC_DECL vec ceilMultiple(vec const& Source, vec const& Multiple); /// Lower multiple number of Source. /// @@ -133,8 +133,8 @@ namespace glm /// @param Multiple Must be a null or positive value /// /// @see gtc_round - template - GLM_FUNC_DECL vec floorMultiple(vec const& Source, vec const& Multiple); + template + GLM_FUNC_DECL vec floorMultiple(vec const& Source, vec const& Multiple); /// Lower multiple number of Source. /// @@ -151,8 +151,8 @@ namespace glm /// @param Multiple Must be a null or positive value /// /// @see gtc_round - template - GLM_FUNC_DECL vec roundMultiple(vec const& Source, vec const& Multiple); + template + GLM_FUNC_DECL vec roundMultiple(vec const& Source, vec const& Multiple); /// @} } //namespace glm diff --git a/glm/gtc/round.inl b/glm/gtc/round.inl index c1313a55..048fbfdb 100644 --- a/glm/gtc/round.inl +++ b/glm/gtc/round.inl @@ -6,62 +6,62 @@ namespace glm{ namespace detail { - template + template struct compute_ceilShift { - GLM_FUNC_QUALIFIER static vec call(vec const& v, T) + GLM_FUNC_QUALIFIER static vec call(vec const& v, T) { return v; } }; - template - struct compute_ceilShift + template + struct compute_ceilShift { - GLM_FUNC_QUALIFIER static vec call(vec const& v, T Shift) + GLM_FUNC_QUALIFIER static vec call(vec const& v, T Shift) { return v | (v >> Shift); } }; - template + template struct compute_ceilPowerOfTwo { - GLM_FUNC_QUALIFIER static vec call(vec const& x) + GLM_FUNC_QUALIFIER static vec call(vec const& x) { GLM_STATIC_ASSERT(!std::numeric_limits::is_iec559, "'ceilPowerOfTwo' only accept integer scalar or vector inputs"); - vec const Sign(sign(x)); + vec const Sign(sign(x)); - vec v(abs(x)); + vec v(abs(x)); v = v - static_cast(1); v = v | (v >> static_cast(1)); v = v | (v >> static_cast(2)); v = v | (v >> static_cast(4)); - v = compute_ceilShift= 2>::call(v, 8); - v = compute_ceilShift= 4>::call(v, 16); - v = compute_ceilShift= 8>::call(v, 32); + v = compute_ceilShift= 2>::call(v, 8); + v = compute_ceilShift= 4>::call(v, 16); + v = compute_ceilShift= 8>::call(v, 32); return (v + static_cast(1)) * Sign; } }; - template - struct compute_ceilPowerOfTwo + template + struct compute_ceilPowerOfTwo { - GLM_FUNC_QUALIFIER static vec call(vec const& x) + GLM_FUNC_QUALIFIER static vec call(vec const& x) { GLM_STATIC_ASSERT(!std::numeric_limits::is_iec559, "'ceilPowerOfTwo' only accept integer scalar or vector inputs"); - vec v(x); + vec v(x); v = v - static_cast(1); v = v | (v >> static_cast(1)); v = v | (v >> static_cast(2)); v = v | (v >> static_cast(4)); - v = compute_ceilShift= 2>::call(v, 8); - v = compute_ceilShift= 4>::call(v, 16); - v = compute_ceilShift= 8>::call(v, 32); + v = compute_ceilShift= 2>::call(v, 8); + v = compute_ceilShift= 4>::call(v, 16); + v = compute_ceilShift= 8>::call(v, 32); return v + static_cast(1); } }; @@ -219,11 +219,11 @@ namespace detail return !(Result & (Result - 1)); } - template - GLM_FUNC_QUALIFIER vec isPowerOfTwo(vec const& Value) + template + GLM_FUNC_QUALIFIER vec isPowerOfTwo(vec const& Value) { - vec const Result(abs(Value)); - return equal(Result & (Result - 1), vec(0)); + vec const Result(abs(Value)); + return equal(Result & (Result - 1), vec(0)); } ////////////////// @@ -235,10 +235,10 @@ namespace detail return detail::compute_ceilPowerOfTwo<1, genType, defaultp, std::numeric_limits::is_signed>::call(vec<1, genType, defaultp>(value)).x; } - template - GLM_FUNC_QUALIFIER vec ceilPowerOfTwo(vec const& v) + template + GLM_FUNC_QUALIFIER vec ceilPowerOfTwo(vec const& v) { - return detail::compute_ceilPowerOfTwo::is_signed>::call(v); + return detail::compute_ceilPowerOfTwo::is_signed>::call(v); } /////////////////// @@ -250,10 +250,10 @@ namespace detail return isPowerOfTwo(value) ? value : static_cast(1) << findMSB(value); } - template - GLM_FUNC_QUALIFIER vec floorPowerOfTwo(vec const& v) + template + GLM_FUNC_QUALIFIER vec floorPowerOfTwo(vec const& v) { - return detail::functor1::call(floorPowerOfTwo, v); + return detail::functor1::call(floorPowerOfTwo, v); } /////////////////// @@ -270,10 +270,10 @@ namespace detail return (next - value) < (value - prev) ? next : prev; } - template - GLM_FUNC_QUALIFIER vec roundPowerOfTwo(vec const& v) + template + GLM_FUNC_QUALIFIER vec roundPowerOfTwo(vec const& v) { - return detail::functor1::call(roundPowerOfTwo, v); + return detail::functor1::call(roundPowerOfTwo, v); } //////////////// @@ -285,16 +285,16 @@ namespace detail return isMultiple(vec<1, genType>(Value), vec<1, genType>(Multiple)).x; } - template - GLM_FUNC_QUALIFIER vec isMultiple(vec const& Value, T Multiple) + template + GLM_FUNC_QUALIFIER vec isMultiple(vec const& Value, T Multiple) { - return (Value % Multiple) == vec(0); + return (Value % Multiple) == vec(0); } - template - GLM_FUNC_QUALIFIER vec isMultiple(vec const& Value, vec const& Multiple) + template + GLM_FUNC_QUALIFIER vec isMultiple(vec const& Value, vec const& Multiple) { - return (Value % Multiple) == vec(0); + return (Value % Multiple) == vec(0); } ////////////////////// @@ -306,10 +306,10 @@ namespace detail return detail::compute_ceilMultiple::is_iec559, std::numeric_limits::is_signed>::call(Source, Multiple); } - template - GLM_FUNC_QUALIFIER vec ceilMultiple(vec const& Source, vec const& Multiple) + template + GLM_FUNC_QUALIFIER vec ceilMultiple(vec const& Source, vec const& Multiple) { - return detail::functor2::call(ceilMultiple, Source, Multiple); + return detail::functor2::call(ceilMultiple, Source, Multiple); } ////////////////////// @@ -321,10 +321,10 @@ namespace detail return detail::compute_floorMultiple::is_iec559, std::numeric_limits::is_signed>::call(Source, Multiple); } - template - GLM_FUNC_QUALIFIER vec floorMultiple(vec const& Source, vec const& Multiple) + template + GLM_FUNC_QUALIFIER vec floorMultiple(vec const& Source, vec const& Multiple) { - return detail::functor2::call(floorMultiple, Source, Multiple); + return detail::functor2::call(floorMultiple, Source, Multiple); } ////////////////////// @@ -336,9 +336,9 @@ namespace detail return detail::compute_roundMultiple::is_iec559, std::numeric_limits::is_signed>::call(Source, Multiple); } - template - GLM_FUNC_QUALIFIER vec roundMultiple(vec const& Source, vec const& Multiple) + template + GLM_FUNC_QUALIFIER vec roundMultiple(vec const& Source, vec const& Multiple) { - return detail::functor2::call(roundMultiple, Source, Multiple); + return detail::functor2::call(roundMultiple, Source, Multiple); } }//namespace glm diff --git a/glm/gtc/type_ptr.inl b/glm/gtc/type_ptr.inl index 66468bfa..5d176692 100644 --- a/glm/gtc/type_ptr.inl +++ b/glm/gtc/type_ptr.inl @@ -10,208 +10,208 @@ namespace glm /// Return the constant address to the data of the vector input. /// @see gtc_type_ptr - template - GLM_FUNC_QUALIFIER T const* value_ptr(vec<2, T, P> const& v) + template + GLM_FUNC_QUALIFIER T const* value_ptr(vec<2, T, Q> const& v) { return &(v.x); } //! Return the address to the data of the vector input. /// @see gtc_type_ptr - template - GLM_FUNC_QUALIFIER T* value_ptr(vec<2, T, P>& v) + template + GLM_FUNC_QUALIFIER T* value_ptr(vec<2, T, Q>& v) { return &(v.x); } /// Return the constant address to the data of the vector input. /// @see gtc_type_ptr - template - GLM_FUNC_QUALIFIER T const * value_ptr(vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER T const * value_ptr(vec<3, T, Q> const& v) { return &(v.x); } //! Return the address to the data of the vector input. /// @see gtc_type_ptr - template - GLM_FUNC_QUALIFIER T* value_ptr(vec<3, T, P>& v) + template + GLM_FUNC_QUALIFIER T* value_ptr(vec<3, T, Q>& v) { return &(v.x); } /// Return the constant address to the data of the vector input. /// @see gtc_type_ptr - template - GLM_FUNC_QUALIFIER T const* value_ptr(vec<4, T, P> const& v) + template + GLM_FUNC_QUALIFIER T const* value_ptr(vec<4, T, Q> const& v) { return &(v.x); } //! Return the address to the data of the vector input. //! From GLM_GTC_type_ptr extension. - template - GLM_FUNC_QUALIFIER T* value_ptr(vec<4, T, P>& v) + template + GLM_FUNC_QUALIFIER T* value_ptr(vec<4, T, Q>& v) { return &(v.x); } /// Return the constant address to the data of the matrix input. /// @see gtc_type_ptr - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 2, T, Q> const& m) { return &(m[0].x); } //! Return the address to the data of the matrix input. /// @see gtc_type_ptr - template - GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 2, T, P>& m) + template + GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 2, T, Q>& m) { return &(m[0].x); } /// Return the constant address to the data of the matrix input. /// @see gtc_type_ptr - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 3, T, Q> const& m) { return &(m[0].x); } //! Return the address to the data of the matrix input. /// @see gtc_type_ptr - template - GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 3, T, P>& m) + template + GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 3, T, Q>& m) { return &(m[0].x); } /// Return the constant address to the data of the matrix input. /// @see gtc_type_ptr - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 4, T, Q> const& m) { return &(m[0].x); } //! Return the address to the data of the matrix input. //! From GLM_GTC_type_ptr extension. - template - GLM_FUNC_QUALIFIER T* value_ptr(mat<4, 4, T, P>& m) + template + GLM_FUNC_QUALIFIER T* value_ptr(mat<4, 4, T, Q>& m) { return &(m[0].x); } /// Return the constant address to the data of the matrix input. /// @see gtc_type_ptr - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 3, T, Q> const& m) { return &(m[0].x); } //! Return the address to the data of the matrix input. /// @see gtc_type_ptr - template - GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 3, T, P>& m) + template + GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 3, T, Q>& m) { return &(m[0].x); } /// Return the constant address to the data of the matrix input. /// @see gtc_type_ptr - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 2, T, Q> const& m) { return &(m[0].x); } //! Return the address to the data of the matrix input. /// @see gtc_type_ptr - template - GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 2, T, P>& m) + template + GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 2, T, Q>& m) { return &(m[0].x); } /// Return the constant address to the data of the matrix input. /// @see gtc_type_ptr - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 4, T, Q> const& m) { return &(m[0].x); } //! Return the address to the data of the matrix input. /// @see gtc_type_ptr - template - GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 4, T, P>& m) + template + GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 4, T, Q>& m) { return &(m[0].x); } /// Return the constant address to the data of the matrix input. /// @see gtc_type_ptr - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 2, T, P> const& m) + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 2, T, Q> const& m) { return &(m[0].x); } //! Return the address to the data of the matrix input. /// @see gtc_type_ptr - template - GLM_FUNC_QUALIFIER T* value_ptr(mat<4, 2, T, P>& m) + template + GLM_FUNC_QUALIFIER T* value_ptr(mat<4, 2, T, Q>& m) { return &(m[0].x); } /// Return the constant address to the data of the matrix input. /// @see gtc_type_ptr - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 4, T, Q> const& m) { return &(m[0].x); } //! Return the address to the data of the matrix input. /// @see gtc_type_ptr - template - GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 4, T, P>& m) + template + GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 4, T, Q>& m) { return &(m[0].x); } /// Return the constant address to the data of the matrix input. /// @see gtc_type_ptr - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 3, T, Q> const& m) { return &(m[0].x); } /// Return the address to the data of the matrix input. /// @see gtc_type_ptr - template - GLM_FUNC_QUALIFIER T * value_ptr(mat<4, 3, T, P>& m) + template + GLM_FUNC_QUALIFIER T * value_ptr(mat<4, 3, T, Q>& m) { return &(m[0].x); } /// Return the constant address to the data of the input parameter. /// @see gtc_type_ptr - template - GLM_FUNC_QUALIFIER T const * value_ptr(tquat const& q) + template + GLM_FUNC_QUALIFIER T const * value_ptr(tquat const& q) { return &(q[0]); } /// Return the address to the data of the quaternion input. /// @see gtc_type_ptr - template - GLM_FUNC_QUALIFIER T* value_ptr(tquat& q) + template + GLM_FUNC_QUALIFIER T* value_ptr(tquat& q) { return &(q[0]); } diff --git a/glm/gtc/ulp.inl b/glm/gtc/ulp.inl index a1be841a..d514a2c2 100644 --- a/glm/gtc/ulp.inl +++ b/glm/gtc/ulp.inl @@ -217,10 +217,10 @@ namespace glm # endif } - template - GLM_FUNC_QUALIFIER vec next_float(vec const& x) + template + GLM_FUNC_QUALIFIER vec next_float(vec const& x) { - vec Result; + vec Result; for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = next_float(x[i]); return Result; @@ -252,10 +252,10 @@ namespace glm # endif } - template - GLM_FUNC_QUALIFIER vec prev_float(vec const& x) + template + GLM_FUNC_QUALIFIER vec prev_float(vec const& x) { - vec Result; + vec Result; for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = prev_float(x[i]); return Result; @@ -270,10 +270,10 @@ namespace glm return temp; } - template - GLM_FUNC_QUALIFIER vec next_float(vec const& x, vec const& ulps) + template + GLM_FUNC_QUALIFIER vec next_float(vec const& x, vec const& ulps) { - vec Result; + vec Result; for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = next_float(x[i], ulps[i]); return Result; @@ -288,10 +288,10 @@ namespace glm return temp; } - template - GLM_FUNC_QUALIFIER vec prev_float(vec const& x, vec const& ulps) + template + GLM_FUNC_QUALIFIER vec prev_float(vec const& x, vec const& ulps) { - vec Result; + vec Result; for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = prev_float(x[i], ulps[i]); return Result; @@ -328,10 +328,10 @@ namespace glm return ulp; } - template - GLM_FUNC_QUALIFIER vec float_distance(vec const& x, vec const& y) + template + GLM_FUNC_QUALIFIER vec float_distance(vec const& x, vec const& y) { - vec Result; + vec Result; for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = float_distance(x[i], y[i]); return Result; diff --git a/glm/gtx/associated_min_max.hpp b/glm/gtx/associated_min_max.hpp index 8b163e4f..c5e2f12e 100644 --- a/glm/gtx/associated_min_max.hpp +++ b/glm/gtx/associated_min_max.hpp @@ -30,29 +30,29 @@ namespace glm /// Minimum comparison between 2 variables and returns 2 associated variable values /// @see gtx_associated_min_max - template + template GLM_FUNC_DECL U associatedMin(T x, U a, T y, U b); /// Minimum comparison between 2 variables and returns 2 associated variable values /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec<2, U, P> associatedMin( - vec const& x, vec const& a, - vec const& y, vec const& b); + template + GLM_FUNC_DECL vec<2, U, Q> associatedMin( + vec const& x, vec const& a, + vec const& y, vec const& b); /// Minimum comparison between 2 variables and returns 2 associated variable values /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMin( - T x, const vec& a, - T y, const vec& b); + template + GLM_FUNC_DECL vec associatedMin( + T x, const vec& a, + T y, const vec& b); /// Minimum comparison between 2 variables and returns 2 associated variable values /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMin( - vec const& x, U a, - vec const& y, U b); + template + GLM_FUNC_DECL vec associatedMin( + vec const& x, U a, + vec const& y, U b); /// Minimum comparison between 3 variables and returns 3 associated variable values /// @see gtx_associated_min_max @@ -64,11 +64,11 @@ namespace glm /// Minimum comparison between 3 variables and returns 3 associated variable values /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMin( - vec const& x, vec const& a, - vec const& y, vec const& b, - vec const& z, vec const& c); + template + GLM_FUNC_DECL vec associatedMin( + vec const& x, vec const& a, + vec const& y, vec const& b, + vec const& z, vec const& c); /// Minimum comparison between 4 variables and returns 4 associated variable values /// @see gtx_associated_min_max @@ -81,30 +81,30 @@ namespace glm /// Minimum comparison between 4 variables and returns 4 associated variable values /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMin( - vec const& x, vec const& a, - vec const& y, vec const& b, - vec const& z, vec const& c, - vec const& w, vec const& d); + template + GLM_FUNC_DECL vec associatedMin( + vec const& x, vec const& a, + vec const& y, vec const& b, + vec const& z, vec const& c, + vec const& w, vec const& d); /// Minimum comparison between 4 variables and returns 4 associated variable values /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMin( - T x, vec const& a, - T y, vec const& b, - T z, vec const& c, - T w, vec const& d); + template + GLM_FUNC_DECL vec associatedMin( + T x, vec const& a, + T y, vec const& b, + T z, vec const& c, + T w, vec const& d); /// Minimum comparison between 4 variables and returns 4 associated variable values /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMin( - vec const& x, U a, - vec const& y, U b, - vec const& z, U c, - vec const& w, U d); + template + GLM_FUNC_DECL vec associatedMin( + vec const& x, U a, + vec const& y, U b, + vec const& z, U c, + vec const& w, U d); /// Maximum comparison between 2 variables and returns 2 associated variable values /// @see gtx_associated_min_max @@ -113,24 +113,24 @@ namespace glm /// Maximum comparison between 2 variables and returns 2 associated variable values /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec<2, U, P> associatedMax( - vec const& x, vec const& a, - vec const& y, vec const& b); + template + GLM_FUNC_DECL vec<2, U, Q> associatedMax( + vec const& x, vec const& a, + vec const& y, vec const& b); /// Maximum comparison between 2 variables and returns 2 associated variable values /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMax( - T x, vec const& a, - T y, vec const& b); + template + GLM_FUNC_DECL vec associatedMax( + T x, vec const& a, + T y, vec const& b); /// Maximum comparison between 2 variables and returns 2 associated variable values /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMax( - vec const& x, U a, - vec const& y, U b); + template + GLM_FUNC_DECL vec associatedMax( + vec const& x, U a, + vec const& y, U b); /// Maximum comparison between 3 variables and returns 3 associated variable values /// @see gtx_associated_min_max @@ -142,27 +142,27 @@ namespace glm /// Maximum comparison between 3 variables and returns 3 associated variable values /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMax( - vec const& x, vec const& a, - vec const& y, vec const& b, - vec const& z, vec const& c); + template + GLM_FUNC_DECL vec associatedMax( + vec const& x, vec const& a, + vec const& y, vec const& b, + vec const& z, vec const& c); /// Maximum comparison between 3 variables and returns 3 associated variable values /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMax( - T x, vec const& a, - T y, vec const& b, - T z, vec const& c); + template + GLM_FUNC_DECL vec associatedMax( + T x, vec const& a, + T y, vec const& b, + T z, vec const& c); /// Maximum comparison between 3 variables and returns 3 associated variable values /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMax( - vec const& x, U a, - vec const& y, U b, - vec const& z, U c); + template + GLM_FUNC_DECL vec associatedMax( + vec const& x, U a, + vec const& y, U b, + vec const& z, U c); /// Maximum comparison between 4 variables and returns 4 associated variable values /// @see gtx_associated_min_max @@ -175,30 +175,30 @@ namespace glm /// Maximum comparison between 4 variables and returns 4 associated variable values /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMax( - vec const& x, vec const& a, - vec const& y, vec const& b, - vec const& z, vec const& c, - vec const& w, vec const& d); + template + GLM_FUNC_DECL vec associatedMax( + vec const& x, vec const& a, + vec const& y, vec const& b, + vec const& z, vec const& c, + vec const& w, vec const& d); /// Maximum comparison between 4 variables and returns 4 associated variable values /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMax( - T x, vec const& a, - T y, vec const& b, - T z, vec const& c, - T w, vec const& d); + template + GLM_FUNC_DECL vec associatedMax( + T x, vec const& a, + T y, vec const& b, + T z, vec const& c, + T w, vec const& d); /// Maximum comparison between 4 variables and returns 4 associated variable values /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMax( - vec const& x, U a, - vec const& y, U b, - vec const& z, U c, - vec const& w, U d); + template + GLM_FUNC_DECL vec associatedMax( + vec const& x, U a, + vec const& y, U b, + vec const& z, U c, + vec const& w, U d); /// @} } //namespace glm diff --git a/glm/gtx/associated_min_max.inl b/glm/gtx/associated_min_max.inl index 16b808f1..d0666cc9 100644 --- a/glm/gtx/associated_min_max.inl +++ b/glm/gtx/associated_min_max.inl @@ -4,46 +4,46 @@ namespace glm{ // Min comparison between 2 variables -template +template GLM_FUNC_QUALIFIER U associatedMin(T x, U a, T y, U b) { return x < y ? a : b; } -template -GLM_FUNC_QUALIFIER vec<2, U, P> associatedMin +template +GLM_FUNC_QUALIFIER vec<2, U, Q> associatedMin ( - vec const& x, vec const& a, - vec const& y, vec const& b + vec const& x, vec const& a, + vec const& y, vec const& b ) { - vec Result; + vec Result; for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = x[i] < y[i] ? a[i] : b[i]; return Result; } -template -GLM_FUNC_QUALIFIER vec associatedMin +template +GLM_FUNC_QUALIFIER vec associatedMin ( - T x, const vec& a, - T y, const vec& b + T x, const vec& a, + T y, const vec& b ) { - vec Result; + vec Result; for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = x < y ? a[i] : b[i]; return Result; } -template -GLM_FUNC_QUALIFIER vec associatedMin +template +GLM_FUNC_QUALIFIER vec associatedMin ( - vec const& x, U a, - vec const& y, U b + vec const& x, U a, + vec const& y, U b ) { - vec Result; + vec Result; for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = x[i] < y[i] ? a : b; return Result; @@ -62,15 +62,15 @@ GLM_FUNC_QUALIFIER U associatedMin return Result; } -template -GLM_FUNC_QUALIFIER vec associatedMin +template +GLM_FUNC_QUALIFIER vec associatedMin ( - vec const& x, vec const& a, - vec const& y, vec const& b, - vec const& z, vec const& c + vec const& x, vec const& a, + vec const& y, vec const& b, + vec const& z, vec const& c ) { - vec Result; + vec Result; for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = x[i] < y[i] ? (x[i] < z[i] ? a[i] : c[i]) : (y[i] < z[i] ? b[i] : c[i]); return Result; @@ -95,16 +95,16 @@ GLM_FUNC_QUALIFIER U associatedMin } // Min comparison between 4 variables -template -GLM_FUNC_QUALIFIER vec associatedMin +template +GLM_FUNC_QUALIFIER vec associatedMin ( - vec const& x, vec const& a, - vec const& y, vec const& b, - vec const& z, vec const& c, - vec const& w, vec const& d + vec const& x, vec const& a, + vec const& y, vec const& b, + vec const& z, vec const& c, + vec const& w, vec const& d ) { - vec Result; + vec Result; for(length_t i = 0, n = Result.length(); i < n; ++i) { T Test1 = min(x[i], y[i]); @@ -117,19 +117,19 @@ GLM_FUNC_QUALIFIER vec associatedMin } // Min comparison between 4 variables -template -GLM_FUNC_QUALIFIER vec associatedMin +template +GLM_FUNC_QUALIFIER vec associatedMin ( - T x, vec const& a, - T y, vec const& b, - T z, vec const& c, - T w, vec const& d + T x, vec const& a, + T y, vec const& b, + T z, vec const& c, + T w, vec const& d ) { T Test1 = min(x, y); T Test2 = min(z, w); - vec Result; + vec Result; for(length_t i = 0, n = Result.length(); i < n; ++i) { U Result1 = x < y ? a[i] : b[i]; @@ -140,16 +140,16 @@ GLM_FUNC_QUALIFIER vec associatedMin } // Min comparison between 4 variables -template -GLM_FUNC_QUALIFIER vec associatedMin +template +GLM_FUNC_QUALIFIER vec associatedMin ( - vec const& x, U a, - vec const& y, U b, - vec const& z, U c, - vec const& w, U d + vec const& x, U a, + vec const& y, U b, + vec const& z, U c, + vec const& w, U d ) { - vec Result; + vec Result; for(length_t i = 0, n = Result.length(); i < n; ++i) { T Test1 = min(x[i], y[i]); @@ -169,42 +169,42 @@ GLM_FUNC_QUALIFIER U associatedMax(T x, U a, T y, U b) } // Max comparison between 2 variables -template -GLM_FUNC_QUALIFIER vec<2, U, P> associatedMax +template +GLM_FUNC_QUALIFIER vec<2, U, Q> associatedMax ( - vec const& x, vec const& a, - vec const& y, vec const& b + vec const& x, vec const& a, + vec const& y, vec const& b ) { - vec Result; + vec Result; for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = x[i] > y[i] ? a[i] : b[i]; return Result; } // Max comparison between 2 variables -template -GLM_FUNC_QUALIFIER vec associatedMax +template +GLM_FUNC_QUALIFIER vec associatedMax ( - T x, vec const& a, - T y, vec const& b + T x, vec const& a, + T y, vec const& b ) { - vec Result; + vec Result; for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = x > y ? a[i] : b[i]; return Result; } // Max comparison between 2 variables -template -GLM_FUNC_QUALIFIER vec associatedMax +template +GLM_FUNC_QUALIFIER vec associatedMax ( - vec const& x, U a, - vec const& y, U b + vec const& x, U a, + vec const& y, U b ) { - vec Result; + vec Result; for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = x[i] > y[i] ? a : b; return Result; @@ -224,45 +224,45 @@ GLM_FUNC_QUALIFIER U associatedMax } // Max comparison between 3 variables -template -GLM_FUNC_QUALIFIER vec associatedMax +template +GLM_FUNC_QUALIFIER vec associatedMax ( - vec const& x, vec const& a, - vec const& y, vec const& b, - vec const& z, vec const& c + vec const& x, vec const& a, + vec const& y, vec const& b, + vec const& z, vec const& c ) { - vec Result; + vec Result; for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a[i] : c[i]) : (y[i] > z[i] ? b[i] : c[i]); return Result; } // Max comparison between 3 variables -template -GLM_FUNC_QUALIFIER vec associatedMax +template +GLM_FUNC_QUALIFIER vec associatedMax ( - T x, vec const& a, - T y, vec const& b, - T z, vec const& c + T x, vec const& a, + T y, vec const& b, + T z, vec const& c ) { - vec Result; + vec Result; for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = x > y ? (x > z ? a[i] : c[i]) : (y > z ? b[i] : c[i]); return Result; } // Max comparison between 3 variables -template -GLM_FUNC_QUALIFIER vec associatedMax +template +GLM_FUNC_QUALIFIER vec associatedMax ( - vec const& x, U a, - vec const& y, U b, - vec const& z, U c + vec const& x, U a, + vec const& y, U b, + vec const& z, U c ) { - vec Result; + vec Result; for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a : c) : (y[i] > z[i] ? b : c); return Result; @@ -287,16 +287,16 @@ GLM_FUNC_QUALIFIER U associatedMax } // Max comparison between 4 variables -template -GLM_FUNC_QUALIFIER vec associatedMax +template +GLM_FUNC_QUALIFIER vec associatedMax ( - vec const& x, vec const& a, - vec const& y, vec const& b, - vec const& z, vec const& c, - vec const& w, vec const& d + vec const& x, vec const& a, + vec const& y, vec const& b, + vec const& z, vec const& c, + vec const& w, vec const& d ) { - vec Result; + vec Result; for(length_t i = 0, n = Result.length(); i < n; ++i) { T Test1 = max(x[i], y[i]); @@ -309,19 +309,19 @@ GLM_FUNC_QUALIFIER vec associatedMax } // Max comparison between 4 variables -template -GLM_FUNC_QUALIFIER vec associatedMax +template +GLM_FUNC_QUALIFIER vec associatedMax ( - T x, vec const& a, - T y, vec const& b, - T z, vec const& c, - T w, vec const& d + T x, vec const& a, + T y, vec const& b, + T z, vec const& c, + T w, vec const& d ) { T Test1 = max(x, y); T Test2 = max(z, w); - vec Result; + vec Result; for(length_t i = 0, n = Result.length(); i < n; ++i) { U Result1 = x > y ? a[i] : b[i]; @@ -332,16 +332,16 @@ GLM_FUNC_QUALIFIER vec associatedMax } // Max comparison between 4 variables -template -GLM_FUNC_QUALIFIER vec associatedMax +template +GLM_FUNC_QUALIFIER vec associatedMax ( - vec const& x, U a, - vec const& y, U b, - vec const& z, U c, - vec const& w, U d + vec const& x, U a, + vec const& y, U b, + vec const& z, U c, + vec const& w, U d ) { - vec Result; + vec Result; for(length_t i = 0, n = Result.length(); i < n; ++i) { T Test1 = max(x[i], y[i]); diff --git a/glm/gtx/bit.hpp b/glm/gtx/bit.hpp index b883a664..ccbd5f69 100644 --- a/glm/gtx/bit.hpp +++ b/glm/gtx/bit.hpp @@ -39,8 +39,8 @@ namespace glm /// Find the highest bit set to 1 in a integer variable and return its value. /// /// @see gtx_bit - template - GLM_FUNC_DECL vec highestBitValue(vec const& value); + template + GLM_FUNC_DECL vec highestBitValue(vec const& value); /// Return the power of two number which value is just higher the input value. /// Deprecated, use ceilPowerOfTwo from GTC_round instead @@ -55,8 +55,8 @@ namespace glm /// /// @see gtc_round /// @see gtx_bit - template - GLM_DEPRECATED GLM_FUNC_DECL vec powerOfTwoAbove(vec const& value); + template + GLM_DEPRECATED GLM_FUNC_DECL vec powerOfTwoAbove(vec const& value); /// Return the power of two number which value is just lower the input value. /// Deprecated, use floorPowerOfTwo from GTC_round instead @@ -71,8 +71,8 @@ namespace glm /// /// @see gtc_round /// @see gtx_bit - template - GLM_DEPRECATED GLM_FUNC_DECL vec powerOfTwoBelow(vec const& value); + template + GLM_DEPRECATED GLM_FUNC_DECL vec powerOfTwoBelow(vec const& value); /// Return the power of two number which value is the closet to the input value. /// Deprecated, use roundPowerOfTwo from GTC_round instead @@ -87,8 +87,8 @@ namespace glm /// /// @see gtc_round /// @see gtx_bit - template - GLM_DEPRECATED GLM_FUNC_DECL vec powerOfTwoNearest(vec const& value); + template + GLM_DEPRECATED GLM_FUNC_DECL vec powerOfTwoNearest(vec const& value); /// @} } //namespace glm diff --git a/glm/gtx/bit.inl b/glm/gtx/bit.inl index c2a09ee5..277aeaa6 100644 --- a/glm/gtx/bit.inl +++ b/glm/gtx/bit.inl @@ -19,10 +19,10 @@ namespace glm return result; } - template - GLM_FUNC_QUALIFIER vec highestBitValue(vec const& v) + template + GLM_FUNC_QUALIFIER vec highestBitValue(vec const& v) { - return detail::functor1::call(highestBitValue, v); + return detail::functor1::call(highestBitValue, v); } /////////////////// @@ -34,10 +34,10 @@ namespace glm return (Value & (~Value + 1)); } - template - GLM_FUNC_QUALIFIER vec lowestBitValue(vec const& v) + template + GLM_FUNC_QUALIFIER vec lowestBitValue(vec const& v) { - return detail::functor1::call(lowestBitValue, v); + return detail::functor1::call(lowestBitValue, v); } /////////////////// @@ -49,10 +49,10 @@ namespace glm return isPowerOfTwo(value) ? value : highestBitValue(value) << 1; } - template - GLM_FUNC_QUALIFIER vec powerOfTwoAbove(vec const& v) + template + GLM_FUNC_QUALIFIER vec powerOfTwoAbove(vec const& v) { - return detail::functor1::call(powerOfTwoAbove, v); + return detail::functor1::call(powerOfTwoAbove, v); } /////////////////// @@ -64,10 +64,10 @@ namespace glm return isPowerOfTwo(value) ? value : highestBitValue(value); } - template - GLM_FUNC_QUALIFIER vec powerOfTwoBelow(vec const& v) + template + GLM_FUNC_QUALIFIER vec powerOfTwoBelow(vec const& v) { - return detail::functor1::call(powerOfTwoBelow, v); + return detail::functor1::call(powerOfTwoBelow, v); } ///////////////////// @@ -84,10 +84,10 @@ namespace glm return (next - value) < (value - prev) ? next : prev; } - template - GLM_FUNC_QUALIFIER vec powerOfTwoNearest(vec const& v) + template + GLM_FUNC_QUALIFIER vec powerOfTwoNearest(vec const& v) { - return detail::functor1::call(powerOfTwoNearest, v); + return detail::functor1::call(powerOfTwoNearest, v); } }//namespace glm diff --git a/glm/gtx/closest_point.hpp b/glm/gtx/closest_point.hpp index 8bdca2f6..3b4ba1c0 100644 --- a/glm/gtx/closest_point.hpp +++ b/glm/gtx/closest_point.hpp @@ -30,18 +30,18 @@ namespace glm /// Find the point on a straight line which is the closet of a point. /// @see gtx_closest_point - template - GLM_FUNC_DECL vec<3, T, P> closestPointOnLine( - vec<3, T, P> const& point, - vec<3, T, P> const& a, - vec<3, T, P> const& b); + template + GLM_FUNC_DECL vec<3, T, Q> closestPointOnLine( + vec<3, T, Q> const& point, + vec<3, T, Q> const& a, + vec<3, T, Q> const& b); /// 2d lines work as well - template - GLM_FUNC_DECL vec<2, T, P> closestPointOnLine( - vec<2, T, P> const& point, - vec<2, T, P> const& a, - vec<2, T, P> const& b); + template + GLM_FUNC_DECL vec<2, T, Q> closestPointOnLine( + vec<2, T, Q> const& point, + vec<2, T, Q> const& a, + vec<2, T, Q> const& b); /// @} }// namespace glm diff --git a/glm/gtx/closest_point.inl b/glm/gtx/closest_point.inl index 25563a71..a11d6283 100644 --- a/glm/gtx/closest_point.inl +++ b/glm/gtx/closest_point.inl @@ -3,17 +3,17 @@ namespace glm { - template - GLM_FUNC_QUALIFIER vec<3, T, P> closestPointOnLine + template + GLM_FUNC_QUALIFIER vec<3, T, Q> closestPointOnLine ( - vec<3, T, P> const& point, - vec<3, T, P> const& a, - vec<3, T, P> const& b + vec<3, T, Q> const& point, + vec<3, T, Q> const& a, + vec<3, T, Q> const& b ) { T LineLength = distance(a, b); - vec<3, T, P> Vector = point - a; - vec<3, T, P> LineDirection = (b - a) / LineLength; + vec<3, T, Q> Vector = point - a; + vec<3, T, Q> LineDirection = (b - a) / LineLength; // Project Vector to LineDirection to get the distance of point from a T Distance = dot(Vector, LineDirection); @@ -23,17 +23,17 @@ namespace glm return a + LineDirection * Distance; } - template - GLM_FUNC_QUALIFIER vec<2, T, P> closestPointOnLine + template + GLM_FUNC_QUALIFIER vec<2, T, Q> closestPointOnLine ( - vec<2, T, P> const& point, - vec<2, T, P> const& a, - vec<2, T, P> const& b + vec<2, T, Q> const& point, + vec<2, T, Q> const& a, + vec<2, T, Q> const& b ) { T LineLength = distance(a, b); - vec<2, T, P> Vector = point - a; - vec<2, T, P> LineDirection = (b - a) / LineLength; + vec<2, T, Q> Vector = point - a; + vec<2, T, Q> LineDirection = (b - a) / LineLength; // Project Vector to LineDirection to get the distance of point from a T Distance = dot(Vector, LineDirection); diff --git a/glm/gtx/color_encoding.hpp b/glm/gtx/color_encoding.hpp index 40cc8234..a094bc37 100644 --- a/glm/gtx/color_encoding.hpp +++ b/glm/gtx/color_encoding.hpp @@ -29,20 +29,20 @@ namespace glm /// @{ /// Convert a linear sRGB color to D65 YUV. - template - GLM_FUNC_DECL vec<3, T, P> convertLinearSRGBToD65XYZ(vec<3, T, P> const& ColorLinearSRGB); + template + GLM_FUNC_DECL vec<3, T, Q> convertLinearSRGBToD65XYZ(vec<3, T, Q> const& ColorLinearSRGB); /// Convert a linear sRGB color to D50 YUV. - template - GLM_FUNC_DECL vec<3, T, P> convertLinearSRGBToD50XYZ(vec<3, T, P> const& ColorLinearSRGB); + template + GLM_FUNC_DECL vec<3, T, Q> convertLinearSRGBToD50XYZ(vec<3, T, Q> const& ColorLinearSRGB); /// Convert a D65 YUV color to linear sRGB. - template - GLM_FUNC_DECL vec<3, T, P> convertD65XYZToLinearSRGB(vec<3, T, P> const& ColorD65XYZ); + template + GLM_FUNC_DECL vec<3, T, Q> convertD65XYZToLinearSRGB(vec<3, T, Q> const& ColorD65XYZ); /// Convert a D65 YUV color to D50 YUV. - template - GLM_FUNC_DECL vec<3, T, P> convertD65XYZToD50XYZ(vec<3, T, P> const& ColorD65XYZ); + template + GLM_FUNC_DECL vec<3, T, Q> convertD65XYZToD50XYZ(vec<3, T, Q> const& ColorD65XYZ); /// @} } //namespace glm diff --git a/glm/gtx/color_encoding.inl b/glm/gtx/color_encoding.inl index aef01ef1..8dca67b9 100644 --- a/glm/gtx/color_encoding.inl +++ b/glm/gtx/color_encoding.inl @@ -3,42 +3,42 @@ namespace glm { - template - GLM_FUNC_QUALIFIER vec<3, T, P> convertLinearSRGBToD65XYZ(vec<3, T, P> const& ColorLinearSRGB) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> convertLinearSRGBToD65XYZ(vec<3, T, Q> const& ColorLinearSRGB) { - vec<3, T, P> const M(0.490f, 0.17697f, 0.2f); - vec<3, T, P> const N(0.31f, 0.8124f, 0.01063f); - vec<3, T, P> const O(0.490f, 0.01f, 0.99f); + vec<3, T, Q> const M(0.490f, 0.17697f, 0.2f); + vec<3, T, Q> const N(0.31f, 0.8124f, 0.01063f); + vec<3, T, Q> const O(0.490f, 0.01f, 0.99f); return (M * ColorLinearSRGB + N * ColorLinearSRGB + O * ColorLinearSRGB) * static_cast(5.650675255693055f); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> convertLinearSRGBToD50XYZ(vec<3, T, P> const& ColorLinearSRGB) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> convertLinearSRGBToD50XYZ(vec<3, T, Q> const& ColorLinearSRGB) { - vec<3, T, P> const M(0.436030342570117f, 0.222438466210245f, 0.013897440074263f); - vec<3, T, P> const N(0.385101860087134f, 0.716942745571917f, 0.097076381494207f); - vec<3, T, P> const O(0.143067806654203f, 0.060618777416563f, 0.713926257896652f); + vec<3, T, Q> const M(0.436030342570117f, 0.222438466210245f, 0.013897440074263f); + vec<3, T, Q> const N(0.385101860087134f, 0.716942745571917f, 0.097076381494207f); + vec<3, T, Q> const O(0.143067806654203f, 0.060618777416563f, 0.713926257896652f); return M * ColorLinearSRGB + N * ColorLinearSRGB + O * ColorLinearSRGB; } - template - GLM_FUNC_QUALIFIER vec<3, T, P> convertD65XYZToLinearSRGB(vec<3, T, P> const& ColorD65XYZ) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> convertD65XYZToLinearSRGB(vec<3, T, Q> const& ColorD65XYZ) { - vec<3, T, P> const M(0.41847f, -0.091169f, 0.0009209f); - vec<3, T, P> const N(-0.15866f, 0.25243f, 0.015708f); - vec<3, T, P> const O(0.0009209f, -0.0025498f, 0.1786f); + vec<3, T, Q> const M(0.41847f, -0.091169f, 0.0009209f); + vec<3, T, Q> const N(-0.15866f, 0.25243f, 0.015708f); + vec<3, T, Q> const O(0.0009209f, -0.0025498f, 0.1786f); return M * ColorD65XYZ + N * ColorD65XYZ + O * ColorD65XYZ; } - template - GLM_FUNC_QUALIFIER vec<3, T, P> convertD65XYZToD50XYZ(vec<3, T, P> const& ColorD65XYZ) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> convertD65XYZToD50XYZ(vec<3, T, Q> const& ColorD65XYZ) { - vec<3, T, P> const M(+1.047844353856414f, +0.029549007606644f, -0.009250984365223f); - vec<3, T, P> const N(+0.022898981050086f, +0.990508028941971f, +0.015072338237051f); - vec<3, T, P> const O(-0.050206647741605f, -0.017074711360960f, +0.751717835079977f); + vec<3, T, Q> const M(+1.047844353856414f, +0.029549007606644f, -0.009250984365223f); + vec<3, T, Q> const N(+0.022898981050086f, +0.990508028941971f, +0.015072338237051f); + vec<3, T, Q> const O(-0.050206647741605f, -0.017074711360960f, +0.751717835079977f); return M * ColorD65XYZ + N * ColorD65XYZ + O * ColorD65XYZ; } diff --git a/glm/gtx/color_space.hpp b/glm/gtx/color_space.hpp index 0db8f676..de7df32b 100644 --- a/glm/gtx/color_space.hpp +++ b/glm/gtx/color_space.hpp @@ -30,15 +30,15 @@ namespace glm /// Converts a color from HSV color space to its color in RGB color space. /// @see gtx_color_space - template - GLM_FUNC_DECL vec<3, T, P> rgbColor( - vec<3, T, P> const& hsvValue); + template + GLM_FUNC_DECL vec<3, T, Q> rgbColor( + vec<3, T, Q> const& hsvValue); /// Converts a color from RGB color space to its color in HSV color space. /// @see gtx_color_space - template - GLM_FUNC_DECL vec<3, T, P> hsvColor( - vec<3, T, P> const& rgbValue); + template + GLM_FUNC_DECL vec<3, T, Q> hsvColor( + vec<3, T, Q> const& rgbValue); /// Build a saturation matrix. /// @see gtx_color_space @@ -48,23 +48,23 @@ namespace glm /// Modify the saturation of a color. /// @see gtx_color_space - template - GLM_FUNC_DECL vec<3, T, P> saturation( + template + GLM_FUNC_DECL vec<3, T, Q> saturation( T const s, - vec<3, T, P> const& color); + vec<3, T, Q> const& color); /// Modify the saturation of a color. /// @see gtx_color_space - template - GLM_FUNC_DECL vec<4, T, P> saturation( + template + GLM_FUNC_DECL vec<4, T, Q> saturation( T const s, - vec<4, T, P> const& color); + vec<4, T, Q> const& color); /// Compute color luminosity associating ratios (0.33, 0.59, 0.11) to RGB canals. /// @see gtx_color_space - template + template GLM_FUNC_DECL T luminosity( - vec<3, T, P> const& color); + vec<3, T, Q> const& color); /// @} }//namespace glm diff --git a/glm/gtx/color_space.inl b/glm/gtx/color_space.inl index af19f02a..eb6b1d63 100644 --- a/glm/gtx/color_space.inl +++ b/glm/gtx/color_space.inl @@ -3,15 +3,15 @@ namespace glm { - template - GLM_FUNC_QUALIFIER vec<3, T, P> rgbColor(const vec<3, T, P>& hsvColor) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rgbColor(const vec<3, T, Q>& hsvColor) { - vec<3, T, P> hsv = hsvColor; - vec<3, T, P> rgbColor; + vec<3, T, Q> hsv = hsvColor; + vec<3, T, Q> rgbColor; if(hsv.y == static_cast(0)) // achromatic (grey) - rgbColor = vec<3, T, P>(hsv.z); + rgbColor = vec<3, T, Q>(hsv.z); else { T sector = floor(hsv.x * (T(1) / T(60))); @@ -60,10 +60,10 @@ namespace glm return rgbColor; } - template - GLM_FUNC_QUALIFIER vec<3, T, P> hsvColor(const vec<3, T, P>& rgbColor) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> hsvColor(const vec<3, T, Q>& rgbColor) { - vec<3, T, P> hsv = rgbColor; + vec<3, T, Q> hsv = rgbColor; float Min = min(min(rgbColor.r, rgbColor.g), rgbColor.b); float Max = max(max(rgbColor.r, rgbColor.g), rgbColor.b); float Delta = Max - Min; @@ -121,22 +121,22 @@ namespace glm return result; } - template - GLM_FUNC_QUALIFIER vec<3, T, P> saturation(const T s, const vec<3, T, P>& color) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> saturation(const T s, const vec<3, T, Q>& color) { - return vec<3, T, P>(saturation(s) * vec<4, T, P>(color, T(0))); + return vec<3, T, Q>(saturation(s) * vec<4, T, Q>(color, T(0))); } - template - GLM_FUNC_QUALIFIER vec<4, T, P> saturation(const T s, const vec<4, T, P>& color) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> saturation(const T s, const vec<4, T, Q>& color) { return saturation(s) * color; } - template - GLM_FUNC_QUALIFIER T luminosity(const vec<3, T, P>& color) + template + GLM_FUNC_QUALIFIER T luminosity(const vec<3, T, Q>& color) { - const vec<3, T, P> tmp = vec<3, T, P>(0.33, 0.59, 0.11); + const vec<3, T, Q> tmp = vec<3, T, Q>(0.33, 0.59, 0.11); return dot(color, tmp); } }//namespace glm diff --git a/glm/gtx/color_space_YCoCg.hpp b/glm/gtx/color_space_YCoCg.hpp index d21408ba..0a701adf 100644 --- a/glm/gtx/color_space_YCoCg.hpp +++ b/glm/gtx/color_space_YCoCg.hpp @@ -30,29 +30,29 @@ namespace glm /// Convert a color from RGB color space to YCoCg color space. /// @see gtx_color_space_YCoCg - template - GLM_FUNC_DECL vec<3, T, P> rgb2YCoCg( - vec<3, T, P> const& rgbColor); + template + GLM_FUNC_DECL vec<3, T, Q> rgb2YCoCg( + vec<3, T, Q> const& rgbColor); /// Convert a color from YCoCg color space to RGB color space. /// @see gtx_color_space_YCoCg - template - GLM_FUNC_DECL vec<3, T, P> YCoCg2rgb( - vec<3, T, P> const& YCoCgColor); + template + GLM_FUNC_DECL vec<3, T, Q> YCoCg2rgb( + vec<3, T, Q> const& YCoCgColor); /// Convert a color from RGB color space to YCoCgR color space. /// @see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range" /// @see gtx_color_space_YCoCg - template - GLM_FUNC_DECL vec<3, T, P> rgb2YCoCgR( - vec<3, T, P> const& rgbColor); + template + GLM_FUNC_DECL vec<3, T, Q> rgb2YCoCgR( + vec<3, T, Q> const& rgbColor); /// Convert a color from YCoCgR color space to RGB color space. /// @see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range" /// @see gtx_color_space_YCoCg - template - GLM_FUNC_DECL vec<3, T, P> YCoCgR2rgb( - vec<3, T, P> const& YCoCgColor); + template + GLM_FUNC_DECL vec<3, T, Q> YCoCgR2rgb( + vec<3, T, Q> const& YCoCgColor); /// @} }//namespace glm diff --git a/glm/gtx/color_space_YCoCg.inl b/glm/gtx/color_space_YCoCg.inl index f698dc85..105a5765 100644 --- a/glm/gtx/color_space_YCoCg.inl +++ b/glm/gtx/color_space_YCoCg.inl @@ -3,53 +3,53 @@ namespace glm { - template - GLM_FUNC_QUALIFIER vec<3, T, P> rgb2YCoCg + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rgb2YCoCg ( - vec<3, T, P> const& rgbColor + vec<3, T, Q> const& rgbColor ) { - vec<3, T, P> result; + vec<3, T, Q> result; result.x/*Y */ = rgbColor.r / T(4) + rgbColor.g / T(2) + rgbColor.b / T(4); result.y/*Co*/ = rgbColor.r / T(2) + rgbColor.g * T(0) - rgbColor.b / T(2); result.z/*Cg*/ = - rgbColor.r / T(4) + rgbColor.g / T(2) - rgbColor.b / T(4); return result; } - template - GLM_FUNC_QUALIFIER vec<3, T, P> YCoCg2rgb + template + GLM_FUNC_QUALIFIER vec<3, T, Q> YCoCg2rgb ( - vec<3, T, P> const& YCoCgColor + vec<3, T, Q> const& YCoCgColor ) { - vec<3, T, P> result; + vec<3, T, Q> result; result.r = YCoCgColor.x + YCoCgColor.y - YCoCgColor.z; result.g = YCoCgColor.x + YCoCgColor.z; result.b = YCoCgColor.x - YCoCgColor.y - YCoCgColor.z; return result; } - template + template class compute_YCoCgR { public: - static GLM_FUNC_QUALIFIER vec<3, T, P> rgb2YCoCgR + static GLM_FUNC_QUALIFIER vec<3, T, Q> rgb2YCoCgR ( - vec<3, T, P> const& rgbColor + vec<3, T, Q> const& rgbColor ) { - vec<3, T, P> result; + vec<3, T, Q> result; result.x/*Y */ = rgbColor.g * static_cast(0.5) + (rgbColor.r + rgbColor.b) * static_cast(0.25); result.y/*Co*/ = rgbColor.r - rgbColor.b; result.z/*Cg*/ = rgbColor.g - (rgbColor.r + rgbColor.b) * static_cast(0.5); return result; } - static GLM_FUNC_QUALIFIER vec<3, T, P> YCoCgR2rgb + static GLM_FUNC_QUALIFIER vec<3, T, Q> YCoCgR2rgb ( - vec<3, T, P> const& YCoCgRColor + vec<3, T, Q> const& YCoCgRColor ) { - vec<3, T, P> result; + vec<3, T, Q> result; T tmp = YCoCgRColor.x - (YCoCgRColor.z * static_cast(0.5)); result.g = YCoCgRColor.z + tmp; result.b = tmp - (YCoCgRColor.y * static_cast(0.5)); @@ -58,15 +58,15 @@ namespace glm } }; - template - class compute_YCoCgR { + template + class compute_YCoCgR { public: - static GLM_FUNC_QUALIFIER vec<3, T, P> rgb2YCoCgR + static GLM_FUNC_QUALIFIER vec<3, T, Q> rgb2YCoCgR ( - vec<3, T, P> const& rgbColor + vec<3, T, Q> const& rgbColor ) { - vec<3, T, P> result; + vec<3, T, Q> result; result.y/*Co*/ = rgbColor.r - rgbColor.b; T tmp = rgbColor.b + (result.y >> 1); result.z/*Cg*/ = rgbColor.g - tmp; @@ -74,12 +74,12 @@ namespace glm return result; } - static GLM_FUNC_QUALIFIER vec<3, T, P> YCoCgR2rgb + static GLM_FUNC_QUALIFIER vec<3, T, Q> YCoCgR2rgb ( - vec<3, T, P> const& YCoCgRColor + vec<3, T, Q> const& YCoCgRColor ) { - vec<3, T, P> result; + vec<3, T, Q> result; T tmp = YCoCgRColor.x - (YCoCgRColor.z >> 1); result.g = YCoCgRColor.z + tmp; result.b = tmp - (YCoCgRColor.y >> 1); @@ -88,21 +88,21 @@ namespace glm } }; - template - GLM_FUNC_QUALIFIER vec<3, T, P> rgb2YCoCgR + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rgb2YCoCgR ( - vec<3, T, P> const& rgbColor + vec<3, T, Q> const& rgbColor ) { - return compute_YCoCgR::is_integer>::rgb2YCoCgR(rgbColor); + return compute_YCoCgR::is_integer>::rgb2YCoCgR(rgbColor); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> YCoCgR2rgb + template + GLM_FUNC_QUALIFIER vec<3, T, Q> YCoCgR2rgb ( - vec<3, T, P> const& YCoCgRColor + vec<3, T, Q> const& YCoCgRColor ) { - return compute_YCoCgR::is_integer>::YCoCgR2rgb(YCoCgRColor); + return compute_YCoCgR::is_integer>::YCoCgR2rgb(YCoCgRColor); } }//namespace glm diff --git a/glm/gtx/common.hpp b/glm/gtx/common.hpp index c4eab57a..25e4517b 100644 --- a/glm/gtx/common.hpp +++ b/glm/gtx/common.hpp @@ -47,8 +47,8 @@ namespace glm /// /// @see GLSL mod vs HLSL fmod /// @see GLSL mod man page - template - GLM_FUNC_DECL vec fmod(vec const& v); + template + GLM_FUNC_DECL vec fmod(vec const& v); /// @} }//namespace glm diff --git a/glm/gtx/common.inl b/glm/gtx/common.inl index 86712a69..1531c2be 100644 --- a/glm/gtx/common.inl +++ b/glm/gtx/common.inl @@ -8,19 +8,19 @@ namespace glm{ namespace detail { - template + template struct compute_fmod { - GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) { - return detail::functor2::call(std::fmod, a, b); + return detail::functor2::call(std::fmod, a, b); } }; - template - struct compute_fmod + template + struct compute_fmod { - GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) { return a % b; } @@ -39,54 +39,54 @@ namespace detail # endif } - template - GLM_FUNC_QUALIFIER typename vec<1, T, P>::bool_type isdenormal + template + GLM_FUNC_QUALIFIER typename vec<1, T, Q>::bool_type isdenormal ( - vec<1, T, P> const& x + vec<1, T, Q> const& x ) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isdenormal' only accept floating-point inputs"); - return typename vec<1, T, P>::bool_type( + return typename vec<1, T, Q>::bool_type( isdenormal(x.x)); } - template - GLM_FUNC_QUALIFIER typename vec<2, T, P>::bool_type isdenormal + template + GLM_FUNC_QUALIFIER typename vec<2, T, Q>::bool_type isdenormal ( - vec<2, T, P> const& x + vec<2, T, Q> const& x ) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isdenormal' only accept floating-point inputs"); - return typename vec<2, T, P>::bool_type( + return typename vec<2, T, Q>::bool_type( isdenormal(x.x), isdenormal(x.y)); } - template - GLM_FUNC_QUALIFIER typename vec<3, T, P>::bool_type isdenormal + template + GLM_FUNC_QUALIFIER typename vec<3, T, Q>::bool_type isdenormal ( - vec<3, T, P> const& x + vec<3, T, Q> const& x ) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isdenormal' only accept floating-point inputs"); - return typename vec<3, T, P>::bool_type( + return typename vec<3, T, Q>::bool_type( isdenormal(x.x), isdenormal(x.y), isdenormal(x.z)); } - template - GLM_FUNC_QUALIFIER typename vec<4, T, P>::bool_type isdenormal + template + GLM_FUNC_QUALIFIER typename vec<4, T, Q>::bool_type isdenormal ( - vec<4, T, P> const& x + vec<4, T, Q> const& x ) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isdenormal' only accept floating-point inputs"); - return typename vec<4, T, P>::bool_type( + return typename vec<4, T, Q>::bool_type( isdenormal(x.x), isdenormal(x.y), isdenormal(x.z), @@ -100,15 +100,15 @@ namespace detail return fmod(vec<1, genType>(x), y).x; } - template - GLM_FUNC_QUALIFIER vec fmod(vec const& x, T y) + template + GLM_FUNC_QUALIFIER vec fmod(vec const& x, T y) { - return detail::compute_fmod::is_iec559>::call(x, vec(y)); + return detail::compute_fmod::is_iec559>::call(x, vec(y)); } - template - GLM_FUNC_QUALIFIER vec fmod(vec const& x, vec const& y) + template + GLM_FUNC_QUALIFIER vec fmod(vec const& x, vec const& y) { - return detail::compute_fmod::is_iec559>::call(x, y); + return detail::compute_fmod::is_iec559>::call(x, y); } }//namespace glm diff --git a/glm/gtx/compatibility.hpp b/glm/gtx/compatibility.hpp index 22169923..d5a6ee22 100644 --- a/glm/gtx/compatibility.hpp +++ b/glm/gtx/compatibility.hpp @@ -39,29 +39,29 @@ namespace glm /// @{ template GLM_FUNC_QUALIFIER T lerp(T x, T y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER vec<2, T, P> lerp(const vec<2, T, P>& x, const vec<2, T, P>& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<2, T, Q> lerp(const vec<2, T, Q>& x, const vec<2, T, Q>& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER vec<3, T, P> lerp(const vec<3, T, P>& x, const vec<3, T, P>& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER vec<4, T, P> lerp(const vec<4, T, P>& x, const vec<4, T, P>& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER vec<2, T, P> lerp(const vec<2, T, P>& x, const vec<2, T, P>& y, const vec<2, T, P>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER vec<3, T, P> lerp(const vec<3, T, P>& x, const vec<3, T, P>& y, const vec<3, T, P>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER vec<4, T, P> lerp(const vec<4, T, P>& x, const vec<4, T, P>& y, const vec<4, T, P>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<3, T, Q> lerp(const vec<3, T, Q>& x, const vec<3, T, Q>& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<4, T, Q> lerp(const vec<4, T, Q>& x, const vec<4, T, Q>& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<2, T, Q> lerp(const vec<2, T, Q>& x, const vec<2, T, Q>& y, const vec<2, T, Q>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<3, T, Q> lerp(const vec<3, T, Q>& x, const vec<3, T, Q>& y, const vec<3, T, Q>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<4, T, Q> lerp(const vec<4, T, Q>& x, const vec<4, T, Q>& y, const vec<4, T, Q>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER T saturate(T x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER vec<2, T, P> saturate(const vec<2, T, P>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER vec<3, T, P> saturate(const vec<3, T, P>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER vec<4, T, P> saturate(const vec<4, T, P>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER T saturate(T x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<2, T, Q> saturate(const vec<2, T, Q>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<3, T, Q> saturate(const vec<3, T, Q>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<4, T, Q> saturate(const vec<4, T, Q>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER T atan2(T x, T y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER vec<2, T, P> atan2(const vec<2, T, P>& x, const vec<2, T, P>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER vec<3, T, P> atan2(const vec<3, T, P>& x, const vec<3, T, P>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER vec<4, T, P> atan2(const vec<4, T, P>& x, const vec<4, T, P>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER T atan2(T x, T y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<2, T, Q> atan2(const vec<2, T, Q>& x, const vec<2, T, Q>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<3, T, Q> atan2(const vec<3, T, Q>& x, const vec<3, T, Q>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<4, T, Q> atan2(const vec<4, T, Q>& x, const vec<4, T, Q>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) template GLM_FUNC_DECL bool isfinite(genType const& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) - template GLM_FUNC_DECL vec<1, bool, P> isfinite(const vec<1, T, P>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) - template GLM_FUNC_DECL vec<2, bool, P> isfinite(const vec<2, T, P>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) - template GLM_FUNC_DECL vec<3, bool, P> isfinite(const vec<3, T, P>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) - template GLM_FUNC_DECL vec<4, bool, P> isfinite(const vec<4, T, P>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) + template GLM_FUNC_DECL vec<1, bool, Q> isfinite(const vec<1, T, Q>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) + template GLM_FUNC_DECL vec<2, bool, Q> isfinite(const vec<2, T, Q>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) + template GLM_FUNC_DECL vec<3, bool, Q> isfinite(const vec<3, T, Q>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) + template GLM_FUNC_DECL vec<4, bool, Q> isfinite(const vec<4, T, Q>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) typedef bool bool1; //!< \brief boolean type with 1 component. (From GLM_GTX_compatibility extension) typedef vec<2, bool, highp> bool2; //!< \brief boolean type with 2 components. (From GLM_GTX_compatibility extension) diff --git a/glm/gtx/compatibility.inl b/glm/gtx/compatibility.inl index 3f5de42f..11affa1c 100644 --- a/glm/gtx/compatibility.inl +++ b/glm/gtx/compatibility.inl @@ -24,38 +24,38 @@ namespace glm # endif } - template - GLM_FUNC_QUALIFIER vec<1, bool, P> isfinite( - vec<1, T, P> const& x) + template + GLM_FUNC_QUALIFIER vec<1, bool, Q> isfinite( + vec<1, T, Q> const& x) { - return vec<1, bool, P>( + return vec<1, bool, Q>( isfinite(x.x)); } - template - GLM_FUNC_QUALIFIER vec<2, bool, P> isfinite( - vec<2, T, P> const& x) + template + GLM_FUNC_QUALIFIER vec<2, bool, Q> isfinite( + vec<2, T, Q> const& x) { - return vec<2, bool, P>( + return vec<2, bool, Q>( isfinite(x.x), isfinite(x.y)); } - template - GLM_FUNC_QUALIFIER vec<3, bool, P> isfinite( - vec<3, T, P> const& x) + template + GLM_FUNC_QUALIFIER vec<3, bool, Q> isfinite( + vec<3, T, Q> const& x) { - return vec<3, bool, P>( + return vec<3, bool, Q>( isfinite(x.x), isfinite(x.y), isfinite(x.z)); } - template - GLM_FUNC_QUALIFIER vec<4, bool, P> isfinite( - vec<4, T, P> const& x) + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> isfinite( + vec<4, T, Q> const& x) { - return vec<4, bool, P>( + return vec<4, bool, Q>( isfinite(x.x), isfinite(x.y), isfinite(x.z), diff --git a/glm/gtx/component_wise.hpp b/glm/gtx/component_wise.hpp index d0b96983..fc52d1cd 100644 --- a/glm/gtx/component_wise.hpp +++ b/glm/gtx/component_wise.hpp @@ -34,14 +34,14 @@ namespace glm /// Convert an integer vector to a normalized float vector. /// If the parameter value type is already a floating qualifier type, the value is passed through. /// @see gtx_component_wise - template - GLM_FUNC_DECL vec compNormalize(vec const& v); + template + GLM_FUNC_DECL vec compNormalize(vec const& v); /// Convert a normalized float vector to an integer vector. /// If the parameter value type is already a floating qualifier type, the value is passed through. /// @see gtx_component_wise - template - GLM_FUNC_DECL vec compScale(vec const& v); + template + GLM_FUNC_DECL vec compScale(vec const& v); /// Add all vector components together. /// @see gtx_component_wise diff --git a/glm/gtx/component_wise.inl b/glm/gtx/component_wise.inl index b59dae65..8ca0ca98 100644 --- a/glm/gtx/component_wise.inl +++ b/glm/gtx/component_wise.inl @@ -6,92 +6,92 @@ namespace glm{ namespace detail { - template + template struct compute_compNormalize {}; - template - struct compute_compNormalize + template + struct compute_compNormalize { - GLM_FUNC_QUALIFIER static vec call(vec const& v) + GLM_FUNC_QUALIFIER static vec call(vec const& v) { floatType const Min = static_cast(std::numeric_limits::min()); floatType const Max = static_cast(std::numeric_limits::max()); - return (vec(v) - Min) / (Max - Min) * static_cast(2) - static_cast(1); + return (vec(v) - Min) / (Max - Min) * static_cast(2) - static_cast(1); } }; - template - struct compute_compNormalize + template + struct compute_compNormalize { - GLM_FUNC_QUALIFIER static vec call(vec const& v) + GLM_FUNC_QUALIFIER static vec call(vec const& v) { - return vec(v) / static_cast(std::numeric_limits::max()); + return vec(v) / static_cast(std::numeric_limits::max()); } }; - template - struct compute_compNormalize + template + struct compute_compNormalize { - GLM_FUNC_QUALIFIER static vec call(vec const& v) + GLM_FUNC_QUALIFIER static vec call(vec const& v) { return v; } }; - template + template struct compute_compScale {}; - template - struct compute_compScale + template + struct compute_compScale { - GLM_FUNC_QUALIFIER static vec call(vec const& v) + GLM_FUNC_QUALIFIER static vec call(vec const& v) { floatType const Max = static_cast(std::numeric_limits::max()) + static_cast(0.5); - vec const Scaled(v * Max); - vec const Result(Scaled - static_cast(0.5)); + vec const Scaled(v * Max); + vec const Result(Scaled - static_cast(0.5)); return Result; } }; - template - struct compute_compScale + template + struct compute_compScale { - GLM_FUNC_QUALIFIER static vec call(vec const& v) + GLM_FUNC_QUALIFIER static vec call(vec const& v) { - return vec(vec(v) * static_cast(std::numeric_limits::max())); + return vec(vec(v) * static_cast(std::numeric_limits::max())); } }; - template - struct compute_compScale + template + struct compute_compScale { - GLM_FUNC_QUALIFIER static vec call(vec const& v) + GLM_FUNC_QUALIFIER static vec call(vec const& v) { return v; } }; }//namespace detail - template - GLM_FUNC_QUALIFIER vec compNormalize(vec const& v) + template + GLM_FUNC_QUALIFIER vec compNormalize(vec const& v) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'compNormalize' accepts only floating-point types for 'floatType' template parameter"); - return detail::compute_compNormalize::is_integer, std::numeric_limits::is_signed>::call(v); + return detail::compute_compNormalize::is_integer, std::numeric_limits::is_signed>::call(v); } - template - GLM_FUNC_QUALIFIER vec compScale(vec const& v) + template + GLM_FUNC_QUALIFIER vec compScale(vec const& v) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'compScale' accepts only floating-point types for 'floatType' template parameter"); - return detail::compute_compScale::is_integer, std::numeric_limits::is_signed>::call(v); + return detail::compute_compScale::is_integer, std::numeric_limits::is_signed>::call(v); } - template - GLM_FUNC_QUALIFIER T compAdd(vec const& v) + template + GLM_FUNC_QUALIFIER T compAdd(vec const& v) { T Result(0); for(length_t i = 0, n = v.length(); i < n; ++i) @@ -99,8 +99,8 @@ namespace detail return Result; } - template - GLM_FUNC_QUALIFIER T compMul(vec const& v) + template + GLM_FUNC_QUALIFIER T compMul(vec const& v) { T Result(1); for(length_t i = 0, n = v.length(); i < n; ++i) @@ -108,8 +108,8 @@ namespace detail return Result; } - template - GLM_FUNC_QUALIFIER T compMin(vec const& v) + template + GLM_FUNC_QUALIFIER T compMin(vec const& v) { T Result(v[0]); for(length_t i = 1, n = v.length(); i < n; ++i) @@ -117,8 +117,8 @@ namespace detail return Result; } - template - GLM_FUNC_QUALIFIER T compMax(vec const& v) + template + GLM_FUNC_QUALIFIER T compMax(vec const& v) { T Result(v[0]); for(length_t i = 1, n = v.length(); i < n; ++i) diff --git a/glm/gtx/dual_quaternion.hpp b/glm/gtx/dual_quaternion.hpp index b9d28071..3a00fc39 100644 --- a/glm/gtx/dual_quaternion.hpp +++ b/glm/gtx/dual_quaternion.hpp @@ -33,17 +33,17 @@ namespace glm /// @addtogroup gtx_dual_quaternion /// @{ - template + template struct tdualquat { // -- Implementation detail -- typedef T value_type; - typedef glm::tquat part_type; + typedef glm::tquat part_type; // -- Data -- - glm::tquat real, dual; + glm::tquat real, dual; // -- Component accesses -- @@ -57,128 +57,128 @@ namespace glm // -- Implicit basic constructors -- GLM_FUNC_DECL GLM_CONSTEXPR tdualquat() GLM_DEFAULT; - GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat const& d) GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat const& d) GLM_DEFAULT; template GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat const& d); // -- Explicit basic constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tquat const& real); - GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tquat const& orientation, vec<3, T, P> const& translation); - GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tquat const& real, tquat const& dual); + GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tquat const& real); + GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tquat const& orientation, vec<3, T, Q> const& translation); + GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tquat const& real, tquat const& dual); // -- Conversion constructors -- template GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tdualquat(tdualquat const& q); - GLM_FUNC_DECL GLM_EXPLICIT tdualquat(mat<2, 4, T, P> const& holder_mat); - GLM_FUNC_DECL GLM_EXPLICIT tdualquat(mat<3, 4, T, P> const& aug_mat); + GLM_FUNC_DECL GLM_EXPLICIT tdualquat(mat<2, 4, T, Q> const& holder_mat); + GLM_FUNC_DECL GLM_EXPLICIT tdualquat(mat<3, 4, T, Q> const& aug_mat); // -- Unary arithmetic operators -- - GLM_FUNC_DECL tdualquat & operator=(tdualquat const& m) GLM_DEFAULT; + GLM_FUNC_DECL tdualquat & operator=(tdualquat const& m) GLM_DEFAULT; template - GLM_FUNC_DECL tdualquat & operator=(tdualquat const& m); + GLM_FUNC_DECL tdualquat & operator=(tdualquat const& m); template - GLM_FUNC_DECL tdualquat & operator*=(U s); + GLM_FUNC_DECL tdualquat & operator*=(U s); template - GLM_FUNC_DECL tdualquat & operator/=(U s); + GLM_FUNC_DECL tdualquat & operator/=(U s); }; // -- Unary bit operators -- - template - GLM_FUNC_DECL tdualquat operator+(tdualquat const& q); + template + GLM_FUNC_DECL tdualquat operator+(tdualquat const& q); - template - GLM_FUNC_DECL tdualquat operator-(tdualquat const& q); + template + GLM_FUNC_DECL tdualquat operator-(tdualquat const& q); // -- Binary operators -- - template - GLM_FUNC_DECL tdualquat operator+(tdualquat const& q, tdualquat const& p); + template + GLM_FUNC_DECL tdualquat operator+(tdualquat const& q, tdualquat const& p); - template - GLM_FUNC_DECL tdualquat operator*(tdualquat const& q, tdualquat const& p); + template + GLM_FUNC_DECL tdualquat operator*(tdualquat const& q, tdualquat const& p); - template - GLM_FUNC_DECL vec<3, T, P> operator*(tdualquat const& q, vec<3, T, P> const& v); + template + GLM_FUNC_DECL vec<3, T, Q> operator*(tdualquat const& q, vec<3, T, Q> const& v); - template - GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const& v, tdualquat const& q); + template + GLM_FUNC_DECL vec<3, T, Q> operator*(vec<3, T, Q> const& v, tdualquat const& q); - template - GLM_FUNC_DECL vec<4, T, P> operator*(tdualquat const& q, vec<4, T, P> const& v); + template + GLM_FUNC_DECL vec<4, T, Q> operator*(tdualquat const& q, vec<4, T, Q> const& v); - template - GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const& v, tdualquat const& q); + template + GLM_FUNC_DECL vec<4, T, Q> operator*(vec<4, T, Q> const& v, tdualquat const& q); - template - GLM_FUNC_DECL tdualquat operator*(tdualquat const& q, T const& s); + template + GLM_FUNC_DECL tdualquat operator*(tdualquat const& q, T const& s); - template - GLM_FUNC_DECL tdualquat operator*(T const& s, tdualquat const& q); + template + GLM_FUNC_DECL tdualquat operator*(T const& s, tdualquat const& q); - template - GLM_FUNC_DECL tdualquat operator/(tdualquat const& q, T const& s); + template + GLM_FUNC_DECL tdualquat operator/(tdualquat const& q, T const& s); // -- Boolean operators -- - template - GLM_FUNC_DECL bool operator==(tdualquat const& q1, tdualquat const& q2); + template + GLM_FUNC_DECL bool operator==(tdualquat const& q1, tdualquat const& q2); - template - GLM_FUNC_DECL bool operator!=(tdualquat const& q1, tdualquat const& q2); + template + GLM_FUNC_DECL bool operator!=(tdualquat const& q1, tdualquat const& q2); /// Creates an identity dual quaternion. /// /// @see gtx_dual_quaternion - template - GLM_FUNC_DECL tdualquat dual_quat_identity(); + template + GLM_FUNC_DECL tdualquat dual_quat_identity(); /// Returns the normalized quaternion. /// /// @see gtx_dual_quaternion - template - GLM_FUNC_DECL tdualquat normalize(tdualquat const& q); + template + GLM_FUNC_DECL tdualquat normalize(tdualquat const& q); /// Returns the linear interpolation of two dual quaternion. /// /// @see gtc_dual_quaternion - template - GLM_FUNC_DECL tdualquat lerp(tdualquat const& x, tdualquat const& y, T const& a); + template + GLM_FUNC_DECL tdualquat lerp(tdualquat const& x, tdualquat const& y, T const& a); /// Returns the q inverse. /// /// @see gtx_dual_quaternion - template - GLM_FUNC_DECL tdualquat inverse(tdualquat const& q); + template + GLM_FUNC_DECL tdualquat inverse(tdualquat const& q); /// Converts a quaternion to a 2 * 4 matrix. /// /// @see gtx_dual_quaternion - template - GLM_FUNC_DECL mat<2, 4, T, P> mat2x4_cast(tdualquat const& x); + template + GLM_FUNC_DECL mat<2, 4, T, Q> mat2x4_cast(tdualquat const& x); /// Converts a quaternion to a 3 * 4 matrix. /// /// @see gtx_dual_quaternion - template - GLM_FUNC_DECL mat<3, 4, T, P> mat3x4_cast(tdualquat const& x); + template + GLM_FUNC_DECL mat<3, 4, T, Q> mat3x4_cast(tdualquat const& x); /// Converts a 2 * 4 matrix (matrix which holds real and dual parts) to a quaternion. /// /// @see gtx_dual_quaternion - template - GLM_FUNC_DECL tdualquat dualquat_cast(mat<2, 4, T, P> const& x); + template + GLM_FUNC_DECL tdualquat dualquat_cast(mat<2, 4, T, Q> const& x); /// Converts a 3 * 4 matrix (augmented matrix rotation + translation) to a quaternion. /// /// @see gtx_dual_quaternion - template - GLM_FUNC_DECL tdualquat dualquat_cast(mat<3, 4, T, P> const& x); + template + GLM_FUNC_DECL tdualquat dualquat_cast(mat<3, 4, T, Q> const& x); /// Dual-quaternion of low single-qualifier floating-point numbers. diff --git a/glm/gtx/dual_quaternion.inl b/glm/gtx/dual_quaternion.inl index d86bd439..78fb4f77 100644 --- a/glm/gtx/dual_quaternion.inl +++ b/glm/gtx/dual_quaternion.inl @@ -8,15 +8,15 @@ namespace glm { // -- Component accesses -- - template - GLM_FUNC_QUALIFIER typename tdualquat::part_type & tdualquat::operator[](typename tdualquat::length_type i) + template + GLM_FUNC_QUALIFIER typename tdualquat::part_type & tdualquat::operator[](typename tdualquat::length_type i) { assert(i >= 0 && i < this->length()); return (&real)[i]; } - template - GLM_FUNC_QUALIFIER typename tdualquat::part_type const& tdualquat::operator[](typename tdualquat::length_type i) const + template + GLM_FUNC_QUALIFIER typename tdualquat::part_type const& tdualquat::operator[](typename tdualquat::length_type i) const { assert(i >= 0 && i < this->length()); return (&real)[i]; @@ -25,35 +25,35 @@ namespace glm // -- Implicit basic constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat() + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat() {} # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tdualquat const& d) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tdualquat const& d) : real(d.real) , dual(d.dual) {} # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tdualquat const& d) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tdualquat const& d) : real(d.real) , dual(d.dual) {} // -- Explicit basic constructors -- - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tquat const& r) - : real(r), dual(tquat(0, 0, 0, 0)) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tquat const& r) + : real(r), dual(tquat(0, 0, 0, 0)) {} - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tquat const& q, vec<3, T, P> const& p) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tquat const& q, vec<3, T, Q> const& p) : real(q), dual( T(-0.5) * ( p.x*q.x + p.y*q.y + p.z*q.z), T(+0.5) * ( p.x*q.w + p.y*q.z - p.z*q.y), @@ -61,28 +61,28 @@ namespace glm T(+0.5) * ( p.x*q.y - p.y*q.x + p.z*q.w)) {} - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tquat const& r, tquat const& d) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tquat const& r, tquat const& d) : real(r), dual(d) {} // -- Conversion constructors -- - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tdualquat const& q) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tdualquat const& q) : real(q.real) , dual(q.dual) {} - template - GLM_FUNC_QUALIFIER tdualquat::tdualquat(mat<2, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER tdualquat::tdualquat(mat<2, 4, T, Q> const& m) { *this = dualquat_cast(m); } - template - GLM_FUNC_QUALIFIER tdualquat::tdualquat(mat<3, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER tdualquat::tdualquat(mat<3, 4, T, Q> const& m) { *this = dualquat_cast(m); } @@ -90,8 +90,8 @@ namespace glm // -- Unary arithmetic operators -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator=(tdualquat const& q) + template + GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator=(tdualquat const& q) { this->real = q.real; this->dual = q.dual; @@ -99,27 +99,27 @@ namespace glm } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template + template template - GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator=(tdualquat const& q) + GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator=(tdualquat const& q) { this->real = q.real; this->dual = q.dual; return *this; } - template + template template - GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator*=(U s) + GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator*=(U s) { this->real *= static_cast(s); this->dual *= static_cast(s); return *this; } - template + template template - GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator/=(U s) + GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator/=(U s) { this->real /= static_cast(s); this->dual /= static_cast(s); @@ -128,108 +128,108 @@ namespace glm // -- Unary bit operators -- - template - GLM_FUNC_QUALIFIER tdualquat operator+(tdualquat const& q) + template + GLM_FUNC_QUALIFIER tdualquat operator+(tdualquat const& q) { return q; } - template - GLM_FUNC_QUALIFIER tdualquat operator-(tdualquat const& q) + template + GLM_FUNC_QUALIFIER tdualquat operator-(tdualquat const& q) { - return tdualquat(-q.real, -q.dual); + return tdualquat(-q.real, -q.dual); } // -- Binary operators -- - template - GLM_FUNC_QUALIFIER tdualquat operator+(tdualquat const& q, tdualquat const& p) + template + GLM_FUNC_QUALIFIER tdualquat operator+(tdualquat const& q, tdualquat const& p) { - return tdualquat(q.real + p.real,q.dual + p.dual); + return tdualquat(q.real + p.real,q.dual + p.dual); } - template - GLM_FUNC_QUALIFIER tdualquat operator*(tdualquat const& p, tdualquat const& o) + template + GLM_FUNC_QUALIFIER tdualquat operator*(tdualquat const& p, tdualquat const& o) { - return tdualquat(p.real * o.real,p.real * o.dual + p.dual * o.real); + return tdualquat(p.real * o.real,p.real * o.dual + p.dual * o.real); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator*(tdualquat const& q, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator*(tdualquat const& q, vec<3, T, Q> const& v) { - vec<3, T, P> const real_v3(q.real.x,q.real.y,q.real.z); - vec<3, T, P> const dual_v3(q.dual.x,q.dual.y,q.dual.z); + vec<3, T, Q> const real_v3(q.real.x,q.real.y,q.real.z); + vec<3, T, Q> const dual_v3(q.dual.x,q.dual.y,q.dual.z); return (cross(real_v3, cross(real_v3,v) + v * q.real.w + dual_v3) + dual_v3 * q.real.w - real_v3 * q.dual.w) * T(2) + v; } - template - GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const& v, tdualquat const& q) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator*(vec<3, T, Q> const& v, tdualquat const& q) { return glm::inverse(q) * v; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator*(tdualquat const& q, vec<4, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator*(tdualquat const& q, vec<4, T, Q> const& v) { - return vec<4, T, P>(q * vec<3, T, P>(v), v.w); + return vec<4, T, Q>(q * vec<3, T, Q>(v), v.w); } - template - GLM_FUNC_QUALIFIER vec<4, T, P> operator*(vec<4, T, P> const& v, tdualquat const& q) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator*(vec<4, T, Q> const& v, tdualquat const& q) { return glm::inverse(q) * v; } - template - GLM_FUNC_QUALIFIER tdualquat operator*(tdualquat const& q, T const& s) + template + GLM_FUNC_QUALIFIER tdualquat operator*(tdualquat const& q, T const& s) { - return tdualquat(q.real * s, q.dual * s); + return tdualquat(q.real * s, q.dual * s); } - template - GLM_FUNC_QUALIFIER tdualquat operator*(T const& s, tdualquat const& q) + template + GLM_FUNC_QUALIFIER tdualquat operator*(T const& s, tdualquat const& q) { return q * s; } - template - GLM_FUNC_QUALIFIER tdualquat operator/(tdualquat const& q, T const& s) + template + GLM_FUNC_QUALIFIER tdualquat operator/(tdualquat const& q, T const& s) { - return tdualquat(q.real / s, q.dual / s); + return tdualquat(q.real / s, q.dual / s); } // -- Boolean operators -- - template - GLM_FUNC_QUALIFIER bool operator==(tdualquat const& q1, tdualquat const& q2) + template + GLM_FUNC_QUALIFIER bool operator==(tdualquat const& q1, tdualquat const& q2) { return (q1.real == q2.real) && (q1.dual == q2.dual); } - template - GLM_FUNC_QUALIFIER bool operator!=(tdualquat const& q1, tdualquat const& q2) + template + GLM_FUNC_QUALIFIER bool operator!=(tdualquat const& q1, tdualquat const& q2) { return (q1.real != q2.real) || (q1.dual != q2.dual); } // -- Operations -- - template - GLM_FUNC_QUALIFIER tdualquat dual_quat_identity() + template + GLM_FUNC_QUALIFIER tdualquat dual_quat_identity() { - return tdualquat( - tquat(static_cast(1), static_cast(0), static_cast(0), static_cast(0)), - tquat(static_cast(0), static_cast(0), static_cast(0), static_cast(0))); + return tdualquat( + tquat(static_cast(1), static_cast(0), static_cast(0), static_cast(0)), + tquat(static_cast(0), static_cast(0), static_cast(0), static_cast(0))); } - template - GLM_FUNC_QUALIFIER tdualquat normalize(tdualquat const& q) + template + GLM_FUNC_QUALIFIER tdualquat normalize(tdualquat const& q) { return q / length(q.real); } - template - GLM_FUNC_QUALIFIER tdualquat lerp(tdualquat const& x, tdualquat const& y, T const& a) + template + GLM_FUNC_QUALIFIER tdualquat lerp(tdualquat const& x, tdualquat const& y, T const& a) { // Dual Quaternion Linear blend aka DLB: // Lerp is only defined in [0, 1] @@ -237,29 +237,29 @@ namespace glm assert(a <= static_cast(1)); T const k = dot(x.real,y.real) < static_cast(0) ? -a : a; T const one(1); - return tdualquat(x * (one - a) + y * k); + return tdualquat(x * (one - a) + y * k); } - template - GLM_FUNC_QUALIFIER tdualquat inverse(tdualquat const& q) + template + GLM_FUNC_QUALIFIER tdualquat inverse(tdualquat const& q) { - const glm::tquat real = conjugate(q.real); - const glm::tquat dual = conjugate(q.dual); - return tdualquat(real, dual + (real * (-2.0f * dot(real,dual)))); + const glm::tquat real = conjugate(q.real); + const glm::tquat dual = conjugate(q.dual); + return tdualquat(real, dual + (real * (-2.0f * dot(real,dual)))); } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P> mat2x4_cast(tdualquat const& x) + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> mat2x4_cast(tdualquat const& x) { - return mat<2, 4, T, P>( x[0].x, x[0].y, x[0].z, x[0].w, x[1].x, x[1].y, x[1].z, x[1].w ); + return mat<2, 4, T, Q>( x[0].x, x[0].y, x[0].z, x[0].w, x[1].x, x[1].y, x[1].z, x[1].w ); } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P> mat3x4_cast(tdualquat const& x) + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> mat3x4_cast(tdualquat const& x) { - tquat r = x.real / length2(x.real); + tquat r = x.real / length2(x.real); - tquat const rr(r.w * x.real.w, r.x * x.real.x, r.y * x.real.y, r.z * x.real.z); + tquat const rr(r.w * x.real.w, r.x * x.real.x, r.y * x.real.y, r.z * x.real.z); r *= static_cast(2); T const xy = r.x * x.real.y; @@ -269,39 +269,39 @@ namespace glm T const wy = r.w * x.real.y; T const wz = r.w * x.real.z; - vec<4, T, P> const a( + vec<4, T, Q> const a( rr.w + rr.x - rr.y - rr.z, xy - wz, xz + wy, -(x.dual.w * r.x - x.dual.x * r.w + x.dual.y * r.z - x.dual.z * r.y)); - vec<4, T, P> const b( + vec<4, T, Q> const b( xy + wz, rr.w + rr.y - rr.x - rr.z, yz - wx, -(x.dual.w * r.y - x.dual.x * r.z - x.dual.y * r.w + x.dual.z * r.x)); - vec<4, T, P> const c( + vec<4, T, Q> const c( xz - wy, yz + wx, rr.w + rr.z - rr.x - rr.y, -(x.dual.w * r.z + x.dual.x * r.y - x.dual.y * r.x - x.dual.z * r.w)); - return mat<3, 4, T, P>(a, b, c); + return mat<3, 4, T, Q>(a, b, c); } - template - GLM_FUNC_QUALIFIER tdualquat dualquat_cast(mat<2, 4, T, P> const& x) + template + GLM_FUNC_QUALIFIER tdualquat dualquat_cast(mat<2, 4, T, Q> const& x) { - return tdualquat( - tquat( x[0].w, x[0].x, x[0].y, x[0].z ), - tquat( x[1].w, x[1].x, x[1].y, x[1].z )); + return tdualquat( + tquat( x[0].w, x[0].x, x[0].y, x[0].z ), + tquat( x[1].w, x[1].x, x[1].y, x[1].z )); } - template - GLM_FUNC_QUALIFIER tdualquat dualquat_cast(mat<3, 4, T, P> const& x) + template + GLM_FUNC_QUALIFIER tdualquat dualquat_cast(mat<3, 4, T, Q> const& x) { - tquat real; + tquat real; T const trace = x[0].x + x[1].y + x[2].z; if(trace > static_cast(0)) @@ -341,11 +341,11 @@ namespace glm real.w = (x[1].x - x[0].y) * invr; } - tquat dual; + tquat dual; dual.x = static_cast(0.5) * ( x[0].w * real.w + x[1].w * real.z - x[2].w * real.y); dual.y = static_cast(0.5) * (-x[0].w * real.z + x[1].w * real.w + x[2].w * real.x); dual.z = static_cast(0.5) * ( x[0].w * real.y - x[1].w * real.x + x[2].w * real.w); dual.w = -static_cast(0.5) * ( x[0].w * real.x + x[1].w * real.y + x[2].w * real.z); - return tdualquat(real, dual); + return tdualquat(real, dual); } }//namespace glm diff --git a/glm/gtx/euler_angles.hpp b/glm/gtx/euler_angles.hpp index 9386c40b..9486065a 100644 --- a/glm/gtx/euler_angles.hpp +++ b/glm/gtx/euler_angles.hpp @@ -124,13 +124,13 @@ namespace glm /// Creates a 3D 3 * 3 rotation matrix from euler angles (Y * X * Z). /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<3, 3, T, P> orientate3(vec<3, T, P> const& angles); + template + GLM_FUNC_DECL mat<3, 3, T, Q> orientate3(vec<3, T, Q> const& angles); /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z). /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, P> orientate4(vec<3, T, P> const& angles); + template + GLM_FUNC_DECL mat<4, 4, T, Q> orientate4(vec<3, T, Q> const& angles); /// Extracts the (X * Y * Z) Euler angles from the rotation matrix M /// @see gtx_euler_angles diff --git a/glm/gtx/euler_angles.inl b/glm/gtx/euler_angles.inl index dd62b071..24efedeb 100644 --- a/glm/gtx/euler_angles.inl +++ b/glm/gtx/euler_angles.inl @@ -275,19 +275,19 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> orientate3 + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> orientate3 ( - vec<3, T, P> const& angles + vec<3, T, Q> const& angles ) { - return mat<3, 3, T, P>(yawPitchRoll(angles.z, angles.x, angles.y)); + return mat<3, 3, T, Q>(yawPitchRoll(angles.z, angles.x, angles.y)); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> orientate4 + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> orientate4 ( - vec<3, T, P> const& angles + vec<3, T, Q> const& angles ) { return yawPitchRoll(angles.z, angles.x, angles.y); diff --git a/glm/gtx/extend.inl b/glm/gtx/extend.inl index 8cf93bb5..162a3ce3 100644 --- a/glm/gtx/extend.inl +++ b/glm/gtx/extend.inl @@ -14,33 +14,33 @@ namespace glm return Origin + (Source - Origin) * Distance; } - template - GLM_FUNC_QUALIFIER vec<2, T, P> extend + template + GLM_FUNC_QUALIFIER vec<2, T, Q> extend ( - vec<2, T, P> const& Origin, - vec<2, T, P> const& Source, + vec<2, T, Q> const& Origin, + vec<2, T, Q> const& Source, T const& Distance ) { return Origin + (Source - Origin) * Distance; } - template - GLM_FUNC_QUALIFIER vec<3, T, P> extend + template + GLM_FUNC_QUALIFIER vec<3, T, Q> extend ( - vec<3, T, P> const& Origin, - vec<3, T, P> const& Source, + 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, P> extend + template + GLM_FUNC_QUALIFIER vec<4, T, Q> extend ( - vec<4, T, P> const& Origin, - vec<4, T, P> const& Source, + vec<4, T, Q> const& Origin, + vec<4, T, Q> const& Source, T const& Distance ) { diff --git a/glm/gtx/exterior_product.hpp b/glm/gtx/exterior_product.hpp index a686df51..b97e8238 100644 --- a/glm/gtx/exterior_product.hpp +++ b/glm/gtx/exterior_product.hpp @@ -31,8 +31,8 @@ namespace glm /// @tparam valType Floating-point scalar types. /// /// @see Exterior product - template - GLM_FUNC_DECL T cross(vec<2, T, P> const& v, vec<2, T, P> const& u); + template + GLM_FUNC_DECL T cross(vec<2, T, Q> const& v, vec<2, T, Q> const& u); /// @} } //namespace glm diff --git a/glm/gtx/exterior_product.inl b/glm/gtx/exterior_product.inl index 3d29d829..b4b36341 100644 --- a/glm/gtx/exterior_product.inl +++ b/glm/gtx/exterior_product.inl @@ -6,10 +6,10 @@ namespace glm { namespace detail { - template + template struct compute_cross_vec2 { - GLM_FUNC_QUALIFIER static T call(vec<2, T, P> const& v, vec<2, T, P> const& u) + GLM_FUNC_QUALIFIER static T call(vec<2, T, Q> const& v, vec<2, T, Q> const& u) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'cross' accepts only floating-point inputs"); @@ -18,10 +18,10 @@ namespace detail }; }//namespace detail - template - GLM_FUNC_QUALIFIER T cross(vec<2, T, P> const& x, vec<2, T, P> const& y) + template + GLM_FUNC_QUALIFIER T cross(vec<2, T, Q> const& x, vec<2, T, Q> const& y) { - return detail::compute_cross_vec2::value>::call(x, y); + return detail::compute_cross_vec2::value>::call(x, y); } }//namespace glm diff --git a/glm/gtx/fast_exponential.hpp b/glm/gtx/fast_exponential.hpp index e1b98dc2..2bf9dc54 100644 --- a/glm/gtx/fast_exponential.hpp +++ b/glm/gtx/fast_exponential.hpp @@ -36,8 +36,8 @@ namespace glm /// Faster than the common pow function but less accurate. /// @see gtx_fast_exponential - template - GLM_FUNC_DECL vec fastPow(vec const& x, vec const& y); + template + GLM_FUNC_DECL vec fastPow(vec const& x, vec const& y); /// Faster than the common pow function but less accurate. /// @see gtx_fast_exponential @@ -46,8 +46,8 @@ namespace glm /// Faster than the common pow function but less accurate. /// @see gtx_fast_exponential - template - GLM_FUNC_DECL vec fastPow(vec const& x); + template + GLM_FUNC_DECL vec fastPow(vec const& x); /// Faster than the common exp function but less accurate. /// @see gtx_fast_exponential @@ -56,8 +56,8 @@ namespace glm /// Faster than the common exp function but less accurate. /// @see gtx_fast_exponential - template - GLM_FUNC_DECL vec fastExp(vec const& x); + template + GLM_FUNC_DECL vec fastExp(vec const& x); /// Faster than the common log function but less accurate. /// @see gtx_fast_exponential @@ -66,8 +66,8 @@ namespace glm /// Faster than the common exp2 function but less accurate. /// @see gtx_fast_exponential - template - GLM_FUNC_DECL vec fastLog(vec const& x); + template + GLM_FUNC_DECL vec fastLog(vec const& x); /// Faster than the common exp2 function but less accurate. /// @see gtx_fast_exponential @@ -76,8 +76,8 @@ namespace glm /// Faster than the common exp2 function but less accurate. /// @see gtx_fast_exponential - template - GLM_FUNC_DECL vec fastExp2(vec const& x); + template + GLM_FUNC_DECL vec fastExp2(vec const& x); /// Faster than the common log2 function but less accurate. /// @see gtx_fast_exponential @@ -86,8 +86,8 @@ namespace glm /// Faster than the common log2 function but less accurate. /// @see gtx_fast_exponential - template - GLM_FUNC_DECL vec fastLog2(vec const& x); + template + GLM_FUNC_DECL vec fastLog2(vec const& x); /// @} }//namespace glm diff --git a/glm/gtx/fast_exponential.inl b/glm/gtx/fast_exponential.inl index a856cc3d..9dfb1091 100644 --- a/glm/gtx/fast_exponential.inl +++ b/glm/gtx/fast_exponential.inl @@ -10,8 +10,8 @@ namespace glm return exp(y * log(x)); } - template - GLM_FUNC_QUALIFIER vec fastPow(vec const& x, vec const& y) + template + GLM_FUNC_QUALIFIER vec fastPow(vec const& x, vec const& y) { return exp(y * log(x)); } @@ -25,10 +25,10 @@ namespace glm return f; } - template - GLM_FUNC_QUALIFIER vec fastPow(vec const& x, vec const& y) + template + GLM_FUNC_QUALIFIER vec fastPow(vec const& x, vec const& y) { - vec Result; + vec Result; for(length_t i = 0, n = x.length(); i < n; ++i) Result[i] = fastPow(x[i], y[i]); return Result; @@ -81,10 +81,10 @@ namespace glm } */ - template - GLM_FUNC_QUALIFIER vec fastExp(vec const& x) + template + GLM_FUNC_QUALIFIER vec fastExp(vec const& x) { - return detail::functor1::call(fastExp, x); + return detail::functor1::call(fastExp, x); } // fastLog @@ -103,10 +103,10 @@ namespace glm } */ - template - GLM_FUNC_QUALIFIER vec fastLog(vec const& x) + template + GLM_FUNC_QUALIFIER vec fastLog(vec const& x) { - return detail::functor1::call(fastLog, x); + return detail::functor1::call(fastLog, x); } //fastExp2, ln2 = 0.69314718055994530941723212145818f @@ -116,10 +116,10 @@ namespace glm return fastExp(0.69314718055994530941723212145818f * x); } - template - GLM_FUNC_QUALIFIER vec fastExp2(vec const& x) + template + GLM_FUNC_QUALIFIER vec fastExp2(vec const& x) { - return detail::functor1::call(fastExp2, x); + return detail::functor1::call(fastExp2, x); } // fastLog2, ln2 = 0.69314718055994530941723212145818f @@ -129,9 +129,9 @@ namespace glm return fastLog(x) / 0.69314718055994530941723212145818f; } - template - GLM_FUNC_QUALIFIER vec fastLog2(vec const& x) + template + GLM_FUNC_QUALIFIER vec fastLog2(vec const& x) { - return detail::functor1::call(fastLog2, x); + return detail::functor1::call(fastLog2, x); } }//namespace glm diff --git a/glm/gtx/fast_square_root.hpp b/glm/gtx/fast_square_root.hpp index 5b9e8177..994f1f90 100644 --- a/glm/gtx/fast_square_root.hpp +++ b/glm/gtx/fast_square_root.hpp @@ -41,8 +41,8 @@ namespace glm /// Faster than the common sqrt function but less accurate. /// /// @see gtx_fast_square_root extension. - template - GLM_FUNC_DECL vec fastSqrt(vec const& x); + template + GLM_FUNC_DECL vec fastSqrt(vec const& x); /// Faster than the common inversesqrt function but less accurate. /// @@ -53,8 +53,8 @@ namespace glm /// Faster than the common inversesqrt function but less accurate. /// /// @see gtx_fast_square_root extension. - template - GLM_FUNC_DECL vec fastInverseSqrt(vec const& x); + template + GLM_FUNC_DECL vec fastInverseSqrt(vec const& x); /// Faster than the common length function but less accurate. /// @@ -65,8 +65,8 @@ namespace glm /// Faster than the common length function but less accurate. /// /// @see gtx_fast_square_root extension. - template - GLM_FUNC_DECL T fastLength(vec const& x); + template + GLM_FUNC_DECL T fastLength(vec const& x); /// Faster than the common distance function but less accurate. /// @@ -77,8 +77,8 @@ namespace glm /// Faster than the common distance function but less accurate. /// /// @see gtx_fast_square_root extension. - template - GLM_FUNC_DECL T fastDistance(vec const& x, vec const& y); + template + GLM_FUNC_DECL T fastDistance(vec const& x, vec const& y); /// Faster than the common normalize function but less accurate. /// diff --git a/glm/gtx/fast_square_root.inl b/glm/gtx/fast_square_root.inl index 551ad12d..e9889878 100644 --- a/glm/gtx/fast_square_root.inl +++ b/glm/gtx/fast_square_root.inl @@ -12,10 +12,10 @@ namespace glm return genType(1) / fastInverseSqrt(x); } - template - GLM_FUNC_QUALIFIER vec fastSqrt(vec const& x) + template + GLM_FUNC_QUALIFIER vec fastSqrt(vec const& x) { - return detail::functor1::call(fastSqrt, x); + return detail::functor1::call(fastSqrt, x); } // fastInversesqrt @@ -23,17 +23,17 @@ namespace glm GLM_FUNC_QUALIFIER genType fastInverseSqrt(genType x) { # ifdef __CUDACC__ // Wordaround for a CUDA compiler bug up to CUDA6 - vec<1, T, P> tmp(detail::compute_inversesqrt::value>::call(vec<1, genType, lowp>(x))); + vec<1, T, Q> tmp(detail::compute_inversesqrt::value>::call(vec<1, genType, lowp>(x))); return tmp.x; # else return detail::compute_inversesqrt<1, genType, lowp, detail::is_aligned::value>::call(vec<1, genType, lowp>(x)).x; # endif } - template - GLM_FUNC_QUALIFIER vec fastInverseSqrt(vec const& x) + template + GLM_FUNC_QUALIFIER vec fastInverseSqrt(vec const& x) { - return detail::compute_inversesqrt::value>::call(x); + return detail::compute_inversesqrt::value>::call(x); } // fastLength @@ -45,8 +45,8 @@ namespace glm return abs(x); } - template - GLM_FUNC_QUALIFIER T fastLength(vec const& x) + template + GLM_FUNC_QUALIFIER T fastLength(vec const& x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fastLength' only accept floating-point inputs"); @@ -60,8 +60,8 @@ namespace glm return fastLength(y - x); } - template - GLM_FUNC_QUALIFIER T fastDistance(vec const& x, vec const& y) + template + GLM_FUNC_QUALIFIER T fastDistance(vec const& x, vec const& y) { return fastLength(y - x); } @@ -73,8 +73,8 @@ namespace glm return x > genType(0) ? genType(1) : -genType(1); } - template - GLM_FUNC_QUALIFIER vec fastNormalize(vec const& x) + template + GLM_FUNC_QUALIFIER vec fastNormalize(vec const& x) { return x * fastInverseSqrt(dot(x, x)); } diff --git a/glm/gtx/fast_trigonometry.inl b/glm/gtx/fast_trigonometry.inl index ad57b7c1..847b5fcc 100644 --- a/glm/gtx/fast_trigonometry.inl +++ b/glm/gtx/fast_trigonometry.inl @@ -4,8 +4,8 @@ namespace glm{ namespace detail { - template - GLM_FUNC_QUALIFIER vec taylorCos(vec const& x) + template + GLM_FUNC_QUALIFIER vec taylorCos(vec const& x) { return static_cast(1) - (x * x) * (1.f / 2.f) @@ -21,10 +21,10 @@ namespace detail return (T(0.9999932946) + xx * (T(-0.4999124376) + xx * (T(0.0414877472) + xx * T(-0.0012712095)))); } - template - GLM_FUNC_QUALIFIER vec cos_52s(vec const& x) + template + GLM_FUNC_QUALIFIER vec cos_52s(vec const& x) { - return detail::functor1::call(cos_52s, x); + return detail::functor1::call(cos_52s, x); } }//namespace detail @@ -35,10 +35,10 @@ namespace detail return abs(mod(angle, two_pi())); } - template - GLM_FUNC_QUALIFIER vec wrapAngle(vec const& x) + template + GLM_FUNC_QUALIFIER vec wrapAngle(vec const& x) { - return detail::functor1::call(wrapAngle, x); + return detail::functor1::call(wrapAngle, x); } // cos @@ -57,10 +57,10 @@ namespace detail return detail::cos_52s(two_pi() - angle); } - template - GLM_FUNC_QUALIFIER vec fastCos(vec const& x) + template + GLM_FUNC_QUALIFIER vec fastCos(vec const& x) { - return detail::functor1::call(fastCos, x); + return detail::functor1::call(fastCos, x); } // sin @@ -70,10 +70,10 @@ namespace detail return fastCos(half_pi() - x); } - template - GLM_FUNC_QUALIFIER vec fastSin(vec const& x) + template + GLM_FUNC_QUALIFIER vec fastSin(vec const& x) { - return detail::functor1::call(fastSin, x); + return detail::functor1::call(fastSin, x); } // tan @@ -83,10 +83,10 @@ namespace detail return x + (x * x * x * T(0.3333333333)) + (x * x * x * x * x * T(0.1333333333333)) + (x * x * x * x * x * x * x * T(0.0539682539)); } - template - GLM_FUNC_QUALIFIER vec fastTan(vec const& x) + template + GLM_FUNC_QUALIFIER vec fastTan(vec const& x) { - return detail::functor1::call(fastTan, x); + return detail::functor1::call(fastTan, x); } // asin @@ -96,10 +96,10 @@ namespace detail return x + (x * x * x * T(0.166666667)) + (x * x * x * x * x * T(0.075)) + (x * x * x * x * x * x * x * T(0.0446428571)) + (x * x * x * x * x * x * x * x * x * T(0.0303819444));// + (x * x * x * x * x * x * x * x * x * x * x * T(0.022372159)); } - template - GLM_FUNC_QUALIFIER vec fastAsin(vec const& x) + template + GLM_FUNC_QUALIFIER vec fastAsin(vec const& x) { - return detail::functor1::call(fastAsin, x); + return detail::functor1::call(fastAsin, x); } // acos @@ -109,10 +109,10 @@ namespace detail return T(1.5707963267948966192313216916398) - fastAsin(x); //(PI / 2) } - template - GLM_FUNC_QUALIFIER vec fastAcos(vec const& x) + template + GLM_FUNC_QUALIFIER vec fastAcos(vec const& x) { - return detail::functor1::call(fastAcos, x); + return detail::functor1::call(fastAcos, x); } // atan @@ -123,10 +123,10 @@ namespace detail return abs(fastAtan(y / x)) * sgn; } - template - GLM_FUNC_QUALIFIER vec fastAtan(vec const& y, vec const& x) + template + GLM_FUNC_QUALIFIER vec fastAtan(vec const& y, vec const& x) { - return detail::functor2::call(fastAtan, y, x); + return detail::functor2::call(fastAtan, y, x); } template @@ -135,9 +135,9 @@ namespace detail return x - (x * x * x * T(0.333333333333)) + (x * x * x * x * x * T(0.2)) - (x * x * x * x * x * x * x * T(0.1428571429)) + (x * x * x * x * x * x * x * x * x * T(0.111111111111)) - (x * x * x * x * x * x * x * x * x * x * x * T(0.0909090909)); } - template - GLM_FUNC_QUALIFIER vec fastAtan(vec const& x) + template + GLM_FUNC_QUALIFIER vec fastAtan(vec const& x) { - return detail::functor1::call(fastAtan, x); + return detail::functor1::call(fastAtan, x); } }//namespace glm diff --git a/glm/gtx/float_notmalize.inl b/glm/gtx/float_notmalize.inl index fa3ce8c2..bceab10e 100644 --- a/glm/gtx/float_notmalize.inl +++ b/glm/gtx/float_notmalize.inl @@ -5,10 +5,10 @@ namespace glm { - template - GLM_FUNC_QUALIFIER vec floatNormalize(vec const& v) + template + GLM_FUNC_QUALIFIER vec floatNormalize(vec const& v) { - return vec(v) / static_cast(std::numeric_limits::max()); + return vec(v) / static_cast(std::numeric_limits::max()); } }//namespace glm diff --git a/glm/gtx/gradient_paint.hpp b/glm/gtx/gradient_paint.hpp index 1725179b..ed1925be 100644 --- a/glm/gtx/gradient_paint.hpp +++ b/glm/gtx/gradient_paint.hpp @@ -31,20 +31,20 @@ namespace glm /// Return a color from a radial gradient. /// @see - gtx_gradient_paint - template + template GLM_FUNC_DECL T radialGradient( - vec<2, T, P> const& Center, + vec<2, T, Q> const& Center, T const& Radius, - vec<2, T, P> const& Focal, - vec<2, T, P> const& Position); + vec<2, T, Q> const& Focal, + vec<2, T, Q> const& Position); /// Return a color from a linear gradient. /// @see - gtx_gradient_paint - template + template GLM_FUNC_DECL T linearGradient( - vec<2, T, P> const& Point0, - vec<2, T, P> const& Point1, - vec<2, T, P> const& Position); + vec<2, T, Q> const& Point0, + vec<2, T, Q> const& Point1, + vec<2, T, Q> const& Position); /// @} }// namespace glm diff --git a/glm/gtx/gradient_paint.inl b/glm/gtx/gradient_paint.inl index bfbd81f2..e2e92b59 100644 --- a/glm/gtx/gradient_paint.inl +++ b/glm/gtx/gradient_paint.inl @@ -3,17 +3,17 @@ namespace glm { - template + template GLM_FUNC_QUALIFIER T radialGradient ( - vec<2, T, P> const& Center, + vec<2, T, Q> const& Center, T const& Radius, - vec<2, T, P> const& Focal, - vec<2, T, P> const& Position + vec<2, T, Q> const& Focal, + vec<2, T, Q> const& Position ) { - vec<2, T, P> F = Focal - Center; - vec<2, T, P> D = Position - Focal; + vec<2, T, Q> F = Focal - Center; + vec<2, T, Q> D = Position - Focal; T Radius2 = pow2(Radius); T Fx2 = pow2(F.x); T Fy2 = pow2(F.y); @@ -23,15 +23,15 @@ namespace glm return Numerator / Denominator; } - template + template GLM_FUNC_QUALIFIER T linearGradient ( - vec<2, T, P> const& Point0, - vec<2, T, P> const& Point1, - vec<2, T, P> const& Position + vec<2, T, Q> const& Point0, + vec<2, T, Q> const& Point1, + vec<2, T, Q> const& Position ) { - vec<2, T, P> Dist = Point1 - Point0; + vec<2, T, Q> Dist = Point1 - Point0; return (Dist.x * (Position.x - Point0.x) + Dist.y * (Position.y - Point0.y)) / glm::dot(Dist, Dist); } }//namespace glm diff --git a/glm/gtx/handed_coordinate_space.hpp b/glm/gtx/handed_coordinate_space.hpp index 95c3fcd9..e7dc9b35 100644 --- a/glm/gtx/handed_coordinate_space.hpp +++ b/glm/gtx/handed_coordinate_space.hpp @@ -30,19 +30,19 @@ namespace glm //! Return if a trihedron right handed or not. //! From GLM_GTX_handed_coordinate_space extension. - template + template GLM_FUNC_DECL bool rightHanded( - vec<3, T, P> const& tangent, - vec<3, T, P> const& binormal, - vec<3, T, P> const& normal); + vec<3, T, Q> const& tangent, + vec<3, T, Q> const& binormal, + vec<3, T, Q> const& normal); //! Return if a trihedron left handed or not. //! From GLM_GTX_handed_coordinate_space extension. - template + template GLM_FUNC_DECL bool leftHanded( - vec<3, T, P> const& tangent, - vec<3, T, P> const& binormal, - vec<3, T, P> const& normal); + vec<3, T, Q> const& tangent, + vec<3, T, Q> const& binormal, + vec<3, T, Q> const& normal); /// @} }// namespace glm diff --git a/glm/gtx/handed_coordinate_space.inl b/glm/gtx/handed_coordinate_space.inl index bd1432fc..16392455 100644 --- a/glm/gtx/handed_coordinate_space.inl +++ b/glm/gtx/handed_coordinate_space.inl @@ -3,23 +3,23 @@ namespace glm { - template + template GLM_FUNC_QUALIFIER bool rightHanded ( - vec<3, T, P> const& tangent, - vec<3, T, P> const& binormal, - vec<3, T, P> const& normal + vec<3, T, Q> const& tangent, + vec<3, T, Q> const& binormal, + vec<3, T, Q> const& normal ) { return dot(cross(normal, tangent), binormal) > T(0); } - template + template GLM_FUNC_QUALIFIER bool leftHanded ( - vec<3, T, P> const& tangent, - vec<3, T, P> const& binormal, - vec<3, T, P> const& normal + vec<3, T, Q> const& tangent, + vec<3, T, Q> const& binormal, + vec<3, T, Q> const& normal ) { return dot(cross(normal, tangent), binormal) < T(0); diff --git a/glm/gtx/hash.hpp b/glm/gtx/hash.hpp index 9b090bc0..ea051085 100644 --- a/glm/gtx/hash.hpp +++ b/glm/gtx/hash.hpp @@ -47,31 +47,31 @@ namespace std template struct hash > { - GLM_FUNC_DECL size_t operator()(glm::vec<1, T, P> const& v) const; + GLM_FUNC_DECL size_t operator()(glm::vec<1, T, Q> const& v) const; }; template struct hash > { - GLM_FUNC_DECL size_t operator()(glm::vec<2, T, P> const& v) const; + GLM_FUNC_DECL size_t operator()(glm::vec<2, T, Q> const& v) const; }; template struct hash > { - GLM_FUNC_DECL size_t operator()(glm::vec<3, T, P> const& v) const; + GLM_FUNC_DECL size_t operator()(glm::vec<3, T, Q> const& v) const; }; template struct hash > { - GLM_FUNC_DECL size_t operator()(glm::vec<4, T, P> const& v) const; + GLM_FUNC_DECL size_t operator()(glm::vec<4, T, Q> const& v) const; }; template struct hash> { - GLM_FUNC_DECL size_t operator()(glm::tquat const& q) const; + GLM_FUNC_DECL size_t operator()(glm::tquat const& q) const; }; template diff --git a/glm/gtx/hash.inl b/glm/gtx/hash.inl index 3914eb53..33193165 100644 --- a/glm/gtx/hash.inl +++ b/glm/gtx/hash.inl @@ -23,14 +23,14 @@ namespace detail namespace std { template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::vec<1, T, P> const& v) const + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::vec<1, T, Q> const& v) const { hash hasher; return hasher(v.x); } template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::vec<2, T, P> const& v) const + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::vec<2, T, Q> const& v) const { size_t seed = 0; hash hasher; @@ -40,7 +40,7 @@ namespace std } template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::vec<3, T, P> const& v) const + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::vec<3, T, Q> const& v) const { size_t seed = 0; hash hasher; @@ -51,7 +51,7 @@ namespace std } template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::vec<4, T, P> const& v) const + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::vec<4, T, Q> const& v) const { size_t seed = 0; hash hasher; @@ -63,7 +63,7 @@ namespace std } template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::tquat const& q) const + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::tquat const& q) const { size_t seed = 0; hash hasher; @@ -75,50 +75,50 @@ namespace std } template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::tdualquat const& q) const + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::tdualquat const& q) const { size_t seed = 0; - hash> hasher; + hash> hasher; glm::detail::hash_combine(seed, hasher(q.real)); glm::detail::hash_combine(seed, hasher(q.dual)); return seed; } template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<2, 2, T, P> const& m) const + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<2, 2, T, Q> const& m) const { 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, P> const& m) const + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<2, 3, T, Q> const& m) const { 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, 4, T, P> const& m) const + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<2, 4, T, Q> const& m) const { 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<3, 2, T, P> const& m) const + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<3, 2, T, Q> const& m) const { 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])); @@ -126,10 +126,10 @@ namespace std } template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<3, 3, T, P> const& m) const + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<3, 3, T, Q> const& m) const { 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])); @@ -137,10 +137,10 @@ namespace std } template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<3, 4, T, P> const& m) const + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<3, 4, T, Q> const& m) const { 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])); @@ -151,7 +151,7 @@ namespace std GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<4, 2, T,P> const& m) const { 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])); @@ -163,7 +163,7 @@ namespace std GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<4, 3, T,P> const& m) const { 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])); @@ -172,10 +172,10 @@ namespace std } template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<4, 4, T, P> const& m) const + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<4, 4, T, Q> const& m) const { 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])); diff --git a/glm/gtx/integer.inl b/glm/gtx/integer.inl index 6a4133af..5891653b 100644 --- a/glm/gtx/integer.inl +++ b/glm/gtx/integer.inl @@ -80,30 +80,30 @@ namespace detail return Result; } - template - GLM_FUNC_QUALIFIER vec<2, T, P> factorial( - vec<2, T, P> const& x) + template + GLM_FUNC_QUALIFIER vec<2, T, Q> factorial( + vec<2, T, Q> const& x) { - return vec<2, T, P>( + return vec<2, T, Q>( factorial(x.x), factorial(x.y)); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> factorial( - vec<3, T, P> const& x) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> factorial( + vec<3, T, Q> const& x) { - return vec<3, T, P>( + return vec<3, T, Q>( factorial(x.x), factorial(x.y), factorial(x.z)); } - template - GLM_FUNC_QUALIFIER vec<4, T, P> factorial( - vec<4, T, P> const& x) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> factorial( + vec<4, T, Q> const& x) { - return vec<4, T, P>( + return vec<4, T, Q>( factorial(x.x), factorial(x.y), factorial(x.z), diff --git a/glm/gtx/intersect.hpp b/glm/gtx/intersect.hpp index e6c3b072..e331b228 100644 --- a/glm/gtx/intersect.hpp +++ b/glm/gtx/intersect.hpp @@ -46,11 +46,11 @@ namespace glm //! Compute the intersection of a ray and a triangle. /// Based om Tomas Möller implementation http://fileadmin.cs.lth.se/cs/Personal/Tomas_Akenine-Moller/raytri/ //! From GLM_GTX_intersect extension. - template + template GLM_FUNC_DECL bool intersectRayTriangle( - vec<3, T, P> const& orig, vec<3, T, P> const& dir, - vec<3, T, P> const& v0, vec<3, T, P> const& v1, vec<3, T, P> const& v2, - vec<3, T, P>& baryPosition, T& distance); + vec<3, T, Q> const& orig, vec<3, T, Q> const& dir, + vec<3, T, Q> const& v0, vec<3, T, Q> const& v1, vec<3, T, Q> const& v2, + vec<3, T, Q>& baryPosition, T& distance); //! Compute the intersection of a line and a triangle. //! From GLM_GTX_intersect extension. diff --git a/glm/gtx/intersect.inl b/glm/gtx/intersect.inl index b59ad77f..15257434 100644 --- a/glm/gtx/intersect.inl +++ b/glm/gtx/intersect.inl @@ -23,30 +23,30 @@ namespace glm return false; } - template + template GLM_FUNC_QUALIFIER bool intersectRayTriangle ( - vec<3, T, P> const& orig, vec<3, T, P> const& dir, - vec<3, T, P> const& vert0, vec<3, T, P> const& vert1, vec<3, T, P> const& vert2, - vec<2, T, P>& baryPosition, T& distance + vec<3, T, Q> const& orig, vec<3, T, Q> const& dir, + vec<3, T, Q> const& vert0, vec<3, T, Q> const& vert1, vec<3, T, Q> const& vert2, + vec<2, T, Q>& baryPosition, T& distance ) { // find vectors for two edges sharing vert0 - vec<3, T, P> const edge1 = vert1 - vert0; - vec<3, T, P> const edge2 = vert2 - vert0; + vec<3, T, Q> const edge1 = vert1 - vert0; + vec<3, T, Q> const edge2 = vert2 - vert0; // begin calculating determinant - also used to calculate U parameter - vec<3, T, P> const p = glm::cross(dir, edge2); + vec<3, T, Q> const p = glm::cross(dir, edge2); // if determinant is near zero, ray lies in plane of triangle T const det = glm::dot(edge1, p); - vec<3, T, P> qvec; + vec<3, T, Q> qvec; if(det > std::numeric_limits::epsilon()) { // calculate distance from vert0 to ray origin - vec<3, T, P> const tvec = orig - vert0; + vec<3, T, Q> const tvec = orig - vert0; // calculate U parameter and test bounds baryPosition.x = glm::dot(tvec, p); @@ -64,7 +64,7 @@ namespace glm else if(det < -std::numeric_limits::epsilon()) { // calculate distance from vert0 to ray origin - vec<3, T, P> const tvec = orig - vert0; + vec<3, T, Q> const tvec = orig - vert0; // calculate U parameter and test bounds baryPosition.x = glm::dot(tvec, p); diff --git a/glm/gtx/io.hpp b/glm/gtx/io.hpp index 4d459a19..0f49bc2c 100644 --- a/glm/gtx/io.hpp +++ b/glm/gtx/io.hpp @@ -162,38 +162,38 @@ namespace glm std::basic_ostream& operator<<(std::basic_ostream&, order const&); }//namespace io - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, tquat const&); - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<1, T,P> const&); - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<2, T,P> const&); - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<3, T,P> const&); - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<4, T,P> const&); - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<2, 2, T,P> const&); - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<2, 3, T,P> const&); - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<2, 4, T,P> const&); - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<3, 2, T,P> const&); - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<3, 3, T,P> const&); - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<3, 4, T,P> const&); - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<4, 2, T,P> const&); - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<4, 3, T,P> const&); - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<4, 4, T,P> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, tquat const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<1, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<2, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<3, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<4, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<2, 2, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<2, 3, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<2, 4, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<3, 2, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<3, 3, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<3, 4, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<4, 2, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<4, 3, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<4, 4, T, Q> const&); - template + template GLM_FUNC_DECL std::basic_ostream & operator<<(std::basic_ostream &, - std::pair const, mat<4, 4, T,P> const> const&); + std::pair const, mat<4, 4, T, Q> const> const&); /// @} }//namespace glm diff --git a/glm/gtx/io.inl b/glm/gtx/io.inl index 5acadb61..0450dd4b 100644 --- a/glm/gtx/io.inl +++ b/glm/gtx/io.inl @@ -195,40 +195,40 @@ namespace detail } }//namespace detail - template - GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, tquat const& a) + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, tquat const& a) { return detail::print_vector_on(os, a); } - template - GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, vec<1, T,P> const& a) + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, vec<1, T, Q> const& a) { return detail::print_vector_on(os, a); } - template - GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, vec<2, T,P> const& a) + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, vec<2, T, Q> const& a) { return detail::print_vector_on(os, a); } - template - GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, vec<3, T,P> const& a) + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, vec<3, T, Q> const& a) { return detail::print_vector_on(os, a); } - template - GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, vec<4, T,P> const& a) + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, vec<4, T, Q> const& a) { return detail::print_vector_on(os, a); } namespace detail { - template class M, length_t C, length_t R, typename T, qualifier P> - GLM_FUNC_QUALIFIER std::basic_ostream& print_matrix_on(std::basic_ostream& os, M const& a) + template class M, length_t C, length_t R, typename T, qualifier Q> + GLM_FUNC_QUALIFIER std::basic_ostream& print_matrix_on(std::basic_ostream& os, M const& a) { typename std::basic_ostream::sentry const cerberus(os); @@ -236,8 +236,8 @@ namespace detail { io::format_punct const& fmt(io::get_facet >(os)); - length_t const& cols(type >::cols); - length_t const& rows(type >::rows); + length_t const& cols(type >::cols); + length_t const& rows(type >::rows); if(fmt.formatted) { @@ -313,74 +313,74 @@ namespace detail } }//namespace detail - template - GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, mat<2, 2, T, P> const& a) + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, mat<2, 2, T, Q> const& a) { return detail::print_matrix_on(os, a); } - template - GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, mat<2, 3, T, P> const& a) + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, mat<2, 3, T, Q> const& a) { return detail::print_matrix_on(os, a); } - template - GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, mat<2, 4, T, P> const& a) + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, mat<2, 4, T, Q> const& a) { return detail::print_matrix_on(os, a); } - template - GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, mat<3, 2, T,P> const& a) + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, mat<3, 2, T, Q> const& a) { return detail::print_matrix_on(os, a); } - template - GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, mat<3, 3, T,P> const& a) + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, mat<3, 3, T, Q> const& a) { return detail::print_matrix_on(os, a); } - template - GLM_FUNC_QUALIFIER std::basic_ostream & operator<<(std::basic_ostream& os, mat<3, 4, T,P> const& a) + template + GLM_FUNC_QUALIFIER std::basic_ostream & operator<<(std::basic_ostream& os, mat<3, 4, T, Q> const& a) { return detail::print_matrix_on(os, a); } - template - GLM_FUNC_QUALIFIER std::basic_ostream & operator<<(std::basic_ostream& os, mat<4, 2, T,P> const& a) + template + GLM_FUNC_QUALIFIER std::basic_ostream & operator<<(std::basic_ostream& os, mat<4, 2, T, Q> const& a) { return detail::print_matrix_on(os, a); } - template - GLM_FUNC_QUALIFIER std::basic_ostream & operator<<(std::basic_ostream& os, mat<4, 3, T,P> const& a) + template + GLM_FUNC_QUALIFIER std::basic_ostream & operator<<(std::basic_ostream& os, mat<4, 3, T, Q> const& a) { return detail::print_matrix_on(os, a); } - template - GLM_FUNC_QUALIFIER std::basic_ostream & operator<<(std::basic_ostream& os, mat<4, 4, T,P> const& a) + template + GLM_FUNC_QUALIFIER std::basic_ostream & operator<<(std::basic_ostream& os, mat<4, 4, T, Q> const& a) { return detail::print_matrix_on(os, a); } namespace detail { - template class M, length_t C, length_t R, typename T, qualifier P> - GLM_FUNC_QUALIFIER std::basic_ostream& print_matrix_pair_on(std::basic_ostream& os, std::pair const, M const> const& a) + template class M, length_t C, length_t R, typename T, qualifier Q> + GLM_FUNC_QUALIFIER std::basic_ostream& print_matrix_pair_on(std::basic_ostream& os, std::pair const, M const> const& a) { typename std::basic_ostream::sentry const cerberus(os); if(cerberus) { io::format_punct const& fmt(io::get_facet >(os)); - M const& ml(a.first); - M const& mr(a.second); - length_t const& cols(type >::cols); - length_t const& rows(type >::rows); + M const& ml(a.first); + M const& mr(a.second); + length_t const& cols(type >::cols); + length_t const& rows(type >::rows); if(fmt.formatted) { @@ -430,11 +430,11 @@ namespace detail } }//namespace detail - template + template GLM_FUNC_QUALIFIER std::basic_ostream& operator<<( std::basic_ostream & os, - std::pair const, - mat<4, 4, T, P> const> const& a) + std::pair const, + mat<4, 4, T, Q> const> const& a) { return detail::print_matrix_pair_on(os, a); } diff --git a/glm/gtx/log_base.hpp b/glm/gtx/log_base.hpp index f0de1577..7e7847e8 100644 --- a/glm/gtx/log_base.hpp +++ b/glm/gtx/log_base.hpp @@ -37,10 +37,10 @@ namespace glm /// Logarithm for any base. /// From GLM_GTX_log_base. - template - GLM_FUNC_DECL vec sign( - vec const& x, - vec const& base); + template + GLM_FUNC_DECL vec sign( + vec const& x, + vec const& base); /// @} }//namespace glm diff --git a/glm/gtx/log_base.inl b/glm/gtx/log_base.inl index a4b926e4..8f210eb6 100644 --- a/glm/gtx/log_base.inl +++ b/glm/gtx/log_base.inl @@ -10,8 +10,8 @@ namespace glm return glm::log(x) / glm::log(base); } - template - GLM_FUNC_QUALIFIER vec log(vec const& x, vec const& base) + template + GLM_FUNC_QUALIFIER vec log(vec const& x, vec const& base) { return glm::log(x) / glm::log(base); } diff --git a/glm/gtx/matrix_cross_product.hpp b/glm/gtx/matrix_cross_product.hpp index 20a2ee96..dda68832 100644 --- a/glm/gtx/matrix_cross_product.hpp +++ b/glm/gtx/matrix_cross_product.hpp @@ -31,15 +31,15 @@ namespace glm //! Build a cross product matrix. //! From GLM_GTX_matrix_cross_product extension. - template - GLM_FUNC_DECL mat<3, 3, T, P> matrixCross3( - vec<3, T, P> const& x); + template + GLM_FUNC_DECL mat<3, 3, T, Q> matrixCross3( + vec<3, T, Q> const& x); //! Build a cross product matrix. //! From GLM_GTX_matrix_cross_product extension. - template - GLM_FUNC_DECL mat<4, 4, T, P> matrixCross4( - vec<3, T, P> const& x); + template + GLM_FUNC_DECL mat<4, 4, T, Q> matrixCross4( + vec<3, T, Q> const& x); /// @} }//namespace glm diff --git a/glm/gtx/matrix_cross_product.inl b/glm/gtx/matrix_cross_product.inl index 4d499db5..d8ec11f9 100644 --- a/glm/gtx/matrix_cross_product.inl +++ b/glm/gtx/matrix_cross_product.inl @@ -3,13 +3,13 @@ namespace glm { - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> matrixCross3 + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> matrixCross3 ( - vec<3, T, P> const& x + vec<3, T, Q> const& x ) { - mat<3, 3, T, P> Result(T(0)); + mat<3, 3, T, Q> Result(T(0)); Result[0][1] = x.z; Result[1][0] = -x.z; Result[0][2] = -x.y; @@ -19,13 +19,13 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> matrixCross4 + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> matrixCross4 ( - vec<3, T, P> const& x + vec<3, T, Q> const& x ) { - mat<4, 4, T, P> Result(T(0)); + mat<4, 4, T, Q> Result(T(0)); Result[0][1] = x.z; Result[1][0] = -x.z; Result[0][2] = -x.y; diff --git a/glm/gtx/matrix_decompose.hpp b/glm/gtx/matrix_decompose.hpp index 94fc24d7..6ef92606 100644 --- a/glm/gtx/matrix_decompose.hpp +++ b/glm/gtx/matrix_decompose.hpp @@ -35,10 +35,10 @@ namespace glm /// Decomposes a model matrix to translations, rotation and scale components /// @see gtx_matrix_decompose - template + template GLM_FUNC_DECL bool decompose( - mat<4, 4, T, P> const& modelMatrix, - vec<3, T, P> & scale, tquat & orientation, vec<3, T, P> & translation, vec<3, T, P> & skew, vec<4, T, P> & perspective); + mat<4, 4, T, Q> const& modelMatrix, + vec<3, T, Q> & scale, tquat & orientation, vec<3, T, Q> & translation, vec<3, T, Q> & skew, vec<4, T, Q> & perspective); /// @} }//namespace glm diff --git a/glm/gtx/matrix_decompose.inl b/glm/gtx/matrix_decompose.inl index 0467360d..efa22374 100644 --- a/glm/gtx/matrix_decompose.inl +++ b/glm/gtx/matrix_decompose.inl @@ -9,17 +9,17 @@ namespace detail { /// Make a linear combination of two vectors and return the result. // result = (a * ascl) + (b * bscl) - template - GLM_FUNC_QUALIFIER vec<3, T, P> combine( - vec<3, T, P> const& a, - vec<3, T, P> const& b, + template + GLM_FUNC_QUALIFIER vec<3, T, Q> combine( + vec<3, T, Q> const& a, + vec<3, T, Q> const& b, T ascl, T bscl) { return (a * ascl) + (b * bscl); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> scale(vec<3, T, P> const& v, T desiredLength) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> scale(vec<3, T, Q> const& v, T desiredLength) { return v * desiredLength / length(v); } @@ -29,10 +29,10 @@ namespace detail // http://www.opensource.apple.com/source/WebCore/WebCore-514/platform/graphics/transforms/TransformationMatrix.cpp // Decomposes the mode matrix to translations,rotation scale components - template - GLM_FUNC_QUALIFIER bool decompose(mat<4, 4, T, P> const& ModelMatrix, vec<3, T, P> & Scale, tquat & Orientation, vec<3, T, P> & Translation, vec<3, T, P> & Skew, vec<4, T, P> & Perspective) + template + GLM_FUNC_QUALIFIER bool decompose(mat<4, 4, T, Q> const& ModelMatrix, vec<3, T, Q> & Scale, tquat & Orientation, vec<3, T, Q> & Translation, vec<3, T, Q> & Skew, vec<4, T, Q> & Perspective) { - mat<4, 4, T, P> LocalMatrix(ModelMatrix); + mat<4, 4, T, Q> LocalMatrix(ModelMatrix); // Normalize the matrix. if(epsilonEqual(LocalMatrix[3][3], static_cast(0), epsilon())) @@ -44,7 +44,7 @@ namespace detail // perspectiveMatrix is used to solve for perspective, but it also provides // an easy way to test for singularity of the upper 3x3 component. - mat<4, 4, T, P> PerspectiveMatrix(LocalMatrix); + mat<4, 4, T, Q> PerspectiveMatrix(LocalMatrix); for(length_t i = 0; i < 3; i++) PerspectiveMatrix[i][3] = static_cast(0); @@ -61,7 +61,7 @@ namespace detail epsilonNotEqual(LocalMatrix[2][3], static_cast(0), epsilon())) { // rightHandSide is the right hand side of the equation. - vec<4, T, P> RightHandSide; + vec<4, T, Q> RightHandSide; RightHandSide[0] = LocalMatrix[0][3]; RightHandSide[1] = LocalMatrix[1][3]; RightHandSide[2] = LocalMatrix[2][3]; @@ -70,8 +70,8 @@ namespace detail // Solve the equation by inverting PerspectiveMatrix and multiplying // rightHandSide by the inverse. (This is the easiest way, not // necessarily the best.) - mat<4, 4, T, P> InversePerspectiveMatrix = glm::inverse(PerspectiveMatrix);// inverse(PerspectiveMatrix, inversePerspectiveMatrix); - mat<4, 4, T, P> TransposedInversePerspectiveMatrix = glm::transpose(InversePerspectiveMatrix);// transposeMatrix4(inversePerspectiveMatrix, transposedInversePerspectiveMatrix); + mat<4, 4, T, Q> InversePerspectiveMatrix = glm::inverse(PerspectiveMatrix);// inverse(PerspectiveMatrix, inversePerspectiveMatrix); + mat<4, 4, T, Q> TransposedInversePerspectiveMatrix = glm::transpose(InversePerspectiveMatrix);// transposeMatrix4(inversePerspectiveMatrix, transposedInversePerspectiveMatrix); Perspective = TransposedInversePerspectiveMatrix * RightHandSide; // v4MulPointByMatrix(rightHandSide, transposedInversePerspectiveMatrix, perspectivePoint); @@ -83,14 +83,14 @@ namespace detail else { // No perspective. - Perspective = vec<4, T, P>(0, 0, 0, 1); + Perspective = vec<4, T, Q>(0, 0, 0, 1); } // Next take care of translation (easy). - Translation = vec<3, T, P>(LocalMatrix[3]); - LocalMatrix[3] = vec<4, T, P>(0, 0, 0, LocalMatrix[3].w); + Translation = vec<3, T, Q>(LocalMatrix[3]); + LocalMatrix[3] = vec<4, T, Q>(0, 0, 0, LocalMatrix[3].w); - vec<3, T, P> Row[3], Pdum3; + vec<3, T, Q> Row[3], Pdum3; // Now get scale and shear. for(length_t i = 0; i < 3; ++i) diff --git a/glm/gtx/matrix_factorisation.hpp b/glm/gtx/matrix_factorisation.hpp index 096cdebc..e8b40c79 100644 --- a/glm/gtx/matrix_factorisation.hpp +++ b/glm/gtx/matrix_factorisation.hpp @@ -35,29 +35,33 @@ namespace glm /// @{ /// Flips the matrix rows up and down. + /// /// From GLM_GTX_matrix_factorisation extension. - template class matType> - GLM_FUNC_DECL matType flipud(matType const& in); + template + GLM_FUNC_DECL mat flipud(mat const& in); /// Flips the matrix columns right and left. + /// /// From GLM_GTX_matrix_factorisation extension. - template class matType> - GLM_FUNC_DECL matType fliplr(matType const& in); + template + GLM_FUNC_DECL mat fliplr(mat const& in); /// Performs QR factorisation of a matrix. /// Returns 2 matrices, q and r, such that the columns of q are orthonormal and span the same subspace than those of the input matrix, r is an upper triangular matrix, and q*r=in. /// Given an n-by-m input matrix, q has dimensions min(n,m)-by-m, and r has dimensions n-by-min(n,m). + /// /// From GLM_GTX_matrix_factorisation extension. - template class matType> - GLM_FUNC_DECL void qr_decompose(matType const& in, matType<(C < R ? C : R), R, T, P>& q, matType& r); + template + GLM_FUNC_DECL void qr_decompose(mat const& in, mat<(C < R ? C : R), R, T, Q>& q, mat& r); /// Performs RQ factorisation of a matrix. /// Returns 2 matrices, r and q, such that r is an upper triangular matrix, the rows of q are orthonormal and span the same subspace than those of the input matrix, and r*q=in. /// Note that in the context of RQ factorisation, the diagonal is seen as starting in the lower-right corner of the matrix, instead of the usual upper-left. /// Given an n-by-m input matrix, r has dimensions min(n,m)-by-m, and q has dimensions n-by-min(n,m). + /// /// From GLM_GTX_matrix_factorisation extension. - template class matType> - GLM_FUNC_DECL void rq_decompose(matType const& in, matType<(C < R ? C : R), R, T, P>& r, matType& q); + template + GLM_FUNC_DECL void rq_decompose(mat const& in, mat<(C < R ? C : R), R, T, Q>& r, mat& q); /// @} } diff --git a/glm/gtx/matrix_factorisation.inl b/glm/gtx/matrix_factorisation.inl index fe37daef..32215b47 100644 --- a/glm/gtx/matrix_factorisation.inl +++ b/glm/gtx/matrix_factorisation.inl @@ -3,20 +3,20 @@ namespace glm { - template class matType> - GLM_FUNC_QUALIFIER matType flipud(matType const& in) + template + GLM_FUNC_QUALIFIER mat flipud(mat const& in) { - matType tin = transpose(in); + mat tin = transpose(in); tin = fliplr(tin); - matType out = transpose(tin); + mat out = transpose(tin); return out; } - template class matType> - GLM_FUNC_QUALIFIER matType fliplr(matType const& in) + template + GLM_FUNC_QUALIFIER mat fliplr(mat const& in) { - matType out; + mat out; for (length_t i = 0; i < C; i++) { out[i] = in[(C - i) - 1]; @@ -25,8 +25,8 @@ namespace glm return out; } - template class matType> - GLM_FUNC_QUALIFIER void qr_decompose(matType const& in, matType<(C < R ? C : R), R, T, P>& q, matType& r) + template + GLM_FUNC_QUALIFIER void qr_decompose(mat const& in, mat<(C < R ? C : R), R, T, Q>& q, mat& r) { // Uses modified Gram-Schmidt method // Source: https://en.wikipedia.org/wiki/Gram–Schmidt_process @@ -60,19 +60,19 @@ namespace glm } } - template class matType> - GLM_FUNC_QUALIFIER void rq_decompose(matType const& in, matType<(C < R ? C : R), R, T, P>& r, matType& q) + template + GLM_FUNC_QUALIFIER void rq_decompose(mat const& in, mat<(C < R ? C : R), R, T, Q>& r, mat& q) { // From https://en.wikipedia.org/wiki/QR_decomposition: // The RQ decomposition transforms a matrix A into the product of an upper triangular matrix R (also known as right-triangular) and an orthogonal matrix Q. The only difference from QR decomposition is the order of these matrices. // QR decomposition is Gram–Schmidt orthogonalization of columns of A, started from the first column. // RQ decomposition is Gram–Schmidt orthogonalization of rows of A, started from the last row. - matType tin = transpose(in); + mat tin = transpose(in); tin = fliplr(tin); - matType tr; - matType<(C < R ? C : R), C, T, P> tq; + mat tr; + mat<(C < R ? C : R), C, T, Q> tq; qr_decompose(tin, tq, tr); tr = fliplr(tr); diff --git a/glm/gtx/matrix_interpolation.hpp b/glm/gtx/matrix_interpolation.hpp index 93c4ff7f..fbd68ebd 100644 --- a/glm/gtx/matrix_interpolation.hpp +++ b/glm/gtx/matrix_interpolation.hpp @@ -31,32 +31,32 @@ namespace glm /// Get the axis and angle of the rotation from a matrix. /// From GLM_GTX_matrix_interpolation extension. - template + template GLM_FUNC_DECL void axisAngle( - mat<4, 4, T, P> const& mat, - vec<3, T, P> & axis, + mat<4, 4, T, Q> const& mat, + vec<3, T, Q> & axis, T & angle); /// Build a matrix from axis and angle. /// From GLM_GTX_matrix_interpolation extension. - template - GLM_FUNC_DECL mat<4, 4, T, P> axisAngleMatrix( - vec<3, T, P> const& axis, + template + GLM_FUNC_DECL mat<4, 4, T, Q> axisAngleMatrix( + vec<3, T, Q> const& axis, T const angle); /// Extracts the rotation part of a matrix. /// From GLM_GTX_matrix_interpolation extension. - template - GLM_FUNC_DECL mat<4, 4, T, P> extractMatrixRotation( - mat<4, 4, T, P> const& mat); + template + GLM_FUNC_DECL mat<4, 4, T, Q> extractMatrixRotation( + mat<4, 4, T, Q> const& mat); /// Build a interpolation of 4 * 4 matrixes. /// From GLM_GTX_matrix_interpolation extension. /// Warning! works only with rotation and/or translation matrixes, scale will generate unexpected results. - template - GLM_FUNC_DECL mat<4, 4, T, P> interpolate( - mat<4, 4, T, P> const& m1, - mat<4, 4, T, P> const& m2, + template + GLM_FUNC_DECL mat<4, 4, T, Q> interpolate( + mat<4, 4, T, Q> const& m1, + mat<4, 4, T, Q> const& m2, T const delta); /// @} diff --git a/glm/gtx/matrix_interpolation.inl b/glm/gtx/matrix_interpolation.inl index 76dd1b17..1f2915a4 100644 --- a/glm/gtx/matrix_interpolation.inl +++ b/glm/gtx/matrix_interpolation.inl @@ -5,8 +5,8 @@ namespace glm { - template - GLM_FUNC_QUALIFIER void axisAngle(mat<4, 4, T, P> const& mat, vec<3, T, P> & axis, T & angle) + template + GLM_FUNC_QUALIFIER void axisAngle(mat<4, 4, T, Q> const& mat, vec<3, T, Q> & axis, T & angle) { T epsilon = static_cast(0.01); T epsilon2 = static_cast(0.1); @@ -88,40 +88,40 @@ namespace glm axis.z = (mat[0][1] - mat[1][0]) / s; } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> axisAngleMatrix(vec<3, T, P> const& axis, T const angle) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> axisAngleMatrix(vec<3, T, Q> const& axis, T const angle) { T c = cos(angle); T s = sin(angle); T t = static_cast(1) - c; - vec<3, T, P> n = normalize(axis); + vec<3, T, Q> n = normalize(axis); - return mat<4, 4, T, P>( + return mat<4, 4, T, Q>( t * n.x * n.x + c, t * n.x * n.y + n.z * s, t * n.x * n.z - n.y * s, static_cast(0.0), t * n.x * n.y - n.z * s, t * n.y * n.y + c, t * n.y * n.z + n.x * s, static_cast(0.0), t * n.x * n.z + n.y * s, t * n.y * n.z - n.x * s, t * n.z * n.z + c, static_cast(0.0), static_cast(0.0), static_cast(0.0), static_cast(0.0), static_cast(1.0)); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> extractMatrixRotation(mat<4, 4, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> extractMatrixRotation(mat<4, 4, T, Q> const& m) { - return mat<4, 4, T, P>( + return mat<4, 4, T, Q>( m[0][0], m[0][1], m[0][2], static_cast(0.0), m[1][0], m[1][1], m[1][2], static_cast(0.0), m[2][0], m[2][1], m[2][2], static_cast(0.0), static_cast(0.0), static_cast(0.0), static_cast(0.0), static_cast(1.0)); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> interpolate(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2, T const delta) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> interpolate(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2, T const delta) { - mat<4, 4, T, P> m1rot = extractMatrixRotation(m1); - mat<4, 4, T, P> dltRotation = m2 * transpose(m1rot); - vec<3, T, P> dltAxis; + mat<4, 4, T, Q> m1rot = extractMatrixRotation(m1); + mat<4, 4, T, Q> dltRotation = m2 * transpose(m1rot); + vec<3, T, Q> dltAxis; T dltAngle; axisAngle(dltRotation, dltAxis, dltAngle); - mat<4, 4, T, P> out = axisAngleMatrix(dltAxis, dltAngle * delta) * m1rot; + mat<4, 4, T, Q> out = axisAngleMatrix(dltAxis, dltAngle * delta) * m1rot; out[3][0] = m1[3][0] + delta * (m2[3][0] - m1[3][0]); out[3][1] = m1[3][1] + delta * (m2[3][1] - m1[3][1]); out[3][2] = m1[3][2] + delta * (m2[3][2] - m1[3][2]); diff --git a/glm/gtx/matrix_major_storage.hpp b/glm/gtx/matrix_major_storage.hpp index 9e54398e..d722b0e9 100644 --- a/glm/gtx/matrix_major_storage.hpp +++ b/glm/gtx/matrix_major_storage.hpp @@ -31,87 +31,87 @@ namespace glm //! Build a row major matrix from row vectors. //! From GLM_GTX_matrix_major_storage extension. - template - GLM_FUNC_DECL mat<2, 2, T, P> rowMajor2( - vec<2, T, P> const& v1, - vec<2, T, P> const& v2); + template + GLM_FUNC_DECL mat<2, 2, T, Q> rowMajor2( + vec<2, T, Q> const& v1, + vec<2, T, Q> const& v2); //! Build a row major matrix from other matrix. //! From GLM_GTX_matrix_major_storage extension. - template - GLM_FUNC_DECL mat<2, 2, T, P> rowMajor2( - mat<2, 2, T, P> const& m); + template + GLM_FUNC_DECL mat<2, 2, T, Q> rowMajor2( + mat<2, 2, T, Q> const& m); //! Build a row major matrix from row vectors. //! From GLM_GTX_matrix_major_storage extension. - template - GLM_FUNC_DECL mat<3, 3, T, P> rowMajor3( - vec<3, T, P> const& v1, - vec<3, T, P> const& v2, - vec<3, T, P> const& v3); + template + GLM_FUNC_DECL mat<3, 3, T, Q> rowMajor3( + vec<3, T, Q> const& v1, + vec<3, T, Q> const& v2, + vec<3, T, Q> const& v3); //! Build a row major matrix from other matrix. //! From GLM_GTX_matrix_major_storage extension. - template - GLM_FUNC_DECL mat<3, 3, T, P> rowMajor3( - mat<3, 3, T, P> const& m); + template + GLM_FUNC_DECL mat<3, 3, T, Q> rowMajor3( + mat<3, 3, T, Q> const& m); //! Build a row major matrix from row vectors. //! From GLM_GTX_matrix_major_storage extension. - template - GLM_FUNC_DECL mat<4, 4, T, P> rowMajor4( - vec<4, T, P> const& v1, - vec<4, T, P> const& v2, - vec<4, T, P> const& v3, - vec<4, T, P> const& v4); + template + GLM_FUNC_DECL mat<4, 4, T, Q> rowMajor4( + vec<4, T, Q> const& v1, + vec<4, T, Q> const& v2, + vec<4, T, Q> const& v3, + vec<4, T, Q> const& v4); //! Build a row major matrix from other matrix. //! From GLM_GTX_matrix_major_storage extension. - template - GLM_FUNC_DECL mat<4, 4, T, P> rowMajor4( - mat<4, 4, T, P> const& m); + template + GLM_FUNC_DECL mat<4, 4, T, Q> rowMajor4( + mat<4, 4, T, Q> const& m); //! Build a column major matrix from column vectors. //! From GLM_GTX_matrix_major_storage extension. - template - GLM_FUNC_DECL mat<2, 2, T, P> colMajor2( - vec<2, T, P> const& v1, - vec<2, T, P> const& v2); + template + GLM_FUNC_DECL mat<2, 2, T, Q> colMajor2( + vec<2, T, Q> const& v1, + vec<2, T, Q> const& v2); //! Build a column major matrix from other matrix. //! From GLM_GTX_matrix_major_storage extension. - template - GLM_FUNC_DECL mat<2, 2, T, P> colMajor2( - mat<2, 2, T, P> const& m); + template + GLM_FUNC_DECL mat<2, 2, T, Q> colMajor2( + mat<2, 2, T, Q> const& m); //! Build a column major matrix from column vectors. //! From GLM_GTX_matrix_major_storage extension. - template - GLM_FUNC_DECL mat<3, 3, T, P> colMajor3( - vec<3, T, P> const& v1, - vec<3, T, P> const& v2, - vec<3, T, P> const& v3); + template + GLM_FUNC_DECL mat<3, 3, T, Q> colMajor3( + vec<3, T, Q> const& v1, + vec<3, T, Q> const& v2, + vec<3, T, Q> const& v3); //! Build a column major matrix from other matrix. //! From GLM_GTX_matrix_major_storage extension. - template - GLM_FUNC_DECL mat<3, 3, T, P> colMajor3( - mat<3, 3, T, P> const& m); + template + GLM_FUNC_DECL mat<3, 3, T, Q> colMajor3( + mat<3, 3, T, Q> const& m); //! Build a column major matrix from column vectors. //! From GLM_GTX_matrix_major_storage extension. - template - GLM_FUNC_DECL mat<4, 4, T, P> colMajor4( - vec<4, T, P> const& v1, - vec<4, T, P> const& v2, - vec<4, T, P> const& v3, - vec<4, T, P> const& v4); + template + GLM_FUNC_DECL mat<4, 4, T, Q> colMajor4( + vec<4, T, Q> const& v1, + vec<4, T, Q> const& v2, + vec<4, T, Q> const& v3, + vec<4, T, Q> const& v4); //! Build a column major matrix from other matrix. //! From GLM_GTX_matrix_major_storage extension. - template - GLM_FUNC_DECL mat<4, 4, T, P> colMajor4( - mat<4, 4, T, P> const& m); + template + GLM_FUNC_DECL mat<4, 4, T, Q> colMajor4( + mat<4, 4, T, Q> const& m); /// @} }//namespace glm diff --git a/glm/gtx/matrix_major_storage.inl b/glm/gtx/matrix_major_storage.inl index cae310a4..f7325dab 100644 --- a/glm/gtx/matrix_major_storage.inl +++ b/glm/gtx/matrix_major_storage.inl @@ -3,14 +3,14 @@ namespace glm { - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P> rowMajor2 + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> rowMajor2 ( - vec<2, T, P> const& v1, - vec<2, T, P> const& v2 + vec<2, T, Q> const& v1, + vec<2, T, Q> const& v2 ) { - mat<2, 2, T, P> Result; + mat<2, 2, T, Q> Result; Result[0][0] = v1.x; Result[1][0] = v1.y; Result[0][1] = v2.x; @@ -18,11 +18,11 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P> rowMajor2( - const mat<2, 2, T, P>& m) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> rowMajor2( + const mat<2, 2, T, Q>& m) { - mat<2, 2, T, P> Result; + mat<2, 2, T, Q> Result; Result[0][0] = m[0][0]; Result[0][1] = m[1][0]; Result[1][0] = m[0][1]; @@ -30,13 +30,13 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> rowMajor3( - const vec<3, T, P>& v1, - const vec<3, T, P>& v2, - const vec<3, T, P>& v3) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> rowMajor3( + const vec<3, T, Q>& v1, + const vec<3, T, Q>& v2, + const vec<3, T, Q>& v3) { - mat<3, 3, T, P> Result; + mat<3, 3, T, Q> Result; Result[0][0] = v1.x; Result[1][0] = v1.y; Result[2][0] = v1.z; @@ -49,11 +49,11 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> rowMajor3( - const mat<3, 3, T, P>& m) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> rowMajor3( + const mat<3, 3, T, Q>& m) { - mat<3, 3, T, P> Result; + mat<3, 3, T, Q> Result; Result[0][0] = m[0][0]; Result[0][1] = m[1][0]; Result[0][2] = m[2][0]; @@ -66,14 +66,14 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> rowMajor4( - const vec<4, T, P>& v1, - const vec<4, T, P>& v2, - const vec<4, T, P>& v3, - const vec<4, T, P>& v4) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rowMajor4( + const vec<4, T, Q>& v1, + const vec<4, T, Q>& v2, + const vec<4, T, Q>& v3, + const vec<4, T, Q>& v4) { - mat<4, 4, T, P> Result; + mat<4, 4, T, Q> Result; Result[0][0] = v1.x; Result[1][0] = v1.y; Result[2][0] = v1.z; @@ -93,11 +93,11 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> rowMajor4( - const mat<4, 4, T, P>& m) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rowMajor4( + const mat<4, 4, T, Q>& m) { - mat<4, 4, T, P> Result; + mat<4, 4, T, Q> Result; Result[0][0] = m[0][0]; Result[0][1] = m[1][0]; Result[0][2] = m[2][0]; @@ -117,51 +117,51 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P> colMajor2( - const vec<2, T, P>& v1, - const vec<2, T, P>& v2) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> colMajor2( + const vec<2, T, Q>& v1, + const vec<2, T, Q>& v2) { - return mat<2, 2, T, P>(v1, v2); + return mat<2, 2, T, Q>(v1, v2); } - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P> colMajor2( - const mat<2, 2, T, P>& m) + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> colMajor2( + const mat<2, 2, T, Q>& m) { - return mat<2, 2, T, P>(m); + return mat<2, 2, T, Q>(m); } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> colMajor3( - const vec<3, T, P>& v1, - const vec<3, T, P>& v2, - const vec<3, T, P>& v3) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> colMajor3( + const vec<3, T, Q>& v1, + const vec<3, T, Q>& v2, + const vec<3, T, Q>& v3) { - return mat<3, 3, T, P>(v1, v2, v3); + return mat<3, 3, T, Q>(v1, v2, v3); } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> colMajor3( - const mat<3, 3, T, P>& m) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> colMajor3( + const mat<3, 3, T, Q>& m) { - return mat<3, 3, T, P>(m); + return mat<3, 3, T, Q>(m); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> colMajor4( - const vec<4, T, P>& v1, - const vec<4, T, P>& v2, - const vec<4, T, P>& v3, - const vec<4, T, P>& v4) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> colMajor4( + const vec<4, T, Q>& v1, + const vec<4, T, Q>& v2, + const vec<4, T, Q>& v3, + const vec<4, T, Q>& v4) { - return mat<4, 4, T, P>(v1, v2, v3, v4); + return mat<4, 4, T, Q>(v1, v2, v3, v4); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> colMajor4( - const mat<4, 4, T, P>& m) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> colMajor4( + const mat<4, 4, T, Q>& m) { - return mat<4, 4, T, P>(m); + return mat<4, 4, T, Q>(m); } }//namespace glm diff --git a/glm/gtx/matrix_operation.hpp b/glm/gtx/matrix_operation.hpp index ca2667bc..66930421 100644 --- a/glm/gtx/matrix_operation.hpp +++ b/glm/gtx/matrix_operation.hpp @@ -30,57 +30,57 @@ namespace glm //! Build a diagonal matrix. //! From GLM_GTX_matrix_operation extension. - template - GLM_FUNC_DECL mat<2, 2, T, P> diagonal2x2( - vec<2, T, P> const& v); + template + GLM_FUNC_DECL mat<2, 2, T, Q> diagonal2x2( + vec<2, T, Q> const& v); //! Build a diagonal matrix. //! From GLM_GTX_matrix_operation extension. - template - GLM_FUNC_DECL mat<2, 3, T, P> diagonal2x3( - vec<2, T, P> const& v); + template + GLM_FUNC_DECL mat<2, 3, T, Q> diagonal2x3( + vec<2, T, Q> const& v); //! Build a diagonal matrix. //! From GLM_GTX_matrix_operation extension. - template - GLM_FUNC_DECL mat<2, 4, T, P> diagonal2x4( - vec<2, T, P> const& v); + template + GLM_FUNC_DECL mat<2, 4, T, Q> diagonal2x4( + vec<2, T, Q> const& v); //! Build a diagonal matrix. //! From GLM_GTX_matrix_operation extension. - template - GLM_FUNC_DECL mat<3, 2, T, P> diagonal3x2( - vec<2, T, P> const& v); + template + GLM_FUNC_DECL mat<3, 2, T, Q> diagonal3x2( + vec<2, T, Q> const& v); //! Build a diagonal matrix. //! From GLM_GTX_matrix_operation extension. - template - GLM_FUNC_DECL mat<3, 3, T, P> diagonal3x3( - vec<3, T, P> const& v); + template + GLM_FUNC_DECL mat<3, 3, T, Q> diagonal3x3( + vec<3, T, Q> const& v); //! Build a diagonal matrix. //! From GLM_GTX_matrix_operation extension. - template - GLM_FUNC_DECL mat<3, 4, T, P> diagonal3x4( - vec<3, T, P> const& v); + template + GLM_FUNC_DECL mat<3, 4, T, Q> diagonal3x4( + vec<3, T, Q> const& v); //! Build a diagonal matrix. //! From GLM_GTX_matrix_operation extension. - template - GLM_FUNC_DECL mat<4, 2, T, P> diagonal4x2( - vec<2, T, P> const& v); + template + GLM_FUNC_DECL mat<4, 2, T, Q> diagonal4x2( + vec<2, T, Q> const& v); //! Build a diagonal matrix. //! From GLM_GTX_matrix_operation extension. - template - GLM_FUNC_DECL mat<4, 3, T, P> diagonal4x3( - vec<3, T, P> const& v); + template + GLM_FUNC_DECL mat<4, 3, T, Q> diagonal4x3( + vec<3, T, Q> const& v); //! Build a diagonal matrix. //! From GLM_GTX_matrix_operation extension. - template - GLM_FUNC_DECL mat<4, 4, T, P> diagonal4x4( - vec<4, T, P> const& v); + template + GLM_FUNC_DECL mat<4, 4, T, Q> diagonal4x4( + vec<4, T, Q> const& v); /// @} }//namespace glm diff --git a/glm/gtx/matrix_operation.inl b/glm/gtx/matrix_operation.inl index 646d800e..04b7b8e5 100644 --- a/glm/gtx/matrix_operation.inl +++ b/glm/gtx/matrix_operation.inl @@ -3,87 +3,87 @@ namespace glm { - template - GLM_FUNC_QUALIFIER mat<2, 2, T, P> diagonal2x2 + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> diagonal2x2 ( - vec<2, T, P> const& v + vec<2, T, Q> const& v ) { - mat<2, 2, T, P> Result(static_cast(1)); + mat<2, 2, T, Q> Result(static_cast(1)); Result[0][0] = v[0]; Result[1][1] = v[1]; return Result; } - template - GLM_FUNC_QUALIFIER mat<2, 3, T, P> diagonal2x3 + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> diagonal2x3 ( - vec<2, T, P> const& v + vec<2, T, Q> const& v ) { - mat<2, 3, T, P> Result(static_cast(1)); + mat<2, 3, T, Q> Result(static_cast(1)); Result[0][0] = v[0]; Result[1][1] = v[1]; return Result; } - template - GLM_FUNC_QUALIFIER mat<2, 4, T, P> diagonal2x4 + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> diagonal2x4 ( - vec<2, T, P> const& v + vec<2, T, Q> const& v ) { - mat<2, 4, T, P> Result(static_cast(1)); + mat<2, 4, T, Q> Result(static_cast(1)); Result[0][0] = v[0]; Result[1][1] = v[1]; return Result; } - template - GLM_FUNC_QUALIFIER mat<3, 2, T, P> diagonal3x2 + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> diagonal3x2 ( - vec<2, T, P> const& v + vec<2, T, Q> const& v ) { - mat<3, 2, T, P> Result(static_cast(1)); + mat<3, 2, T, Q> Result(static_cast(1)); Result[0][0] = v[0]; Result[1][1] = v[1]; return Result; } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> diagonal3x3 + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> diagonal3x3 ( - vec<3, T, P> const& v + vec<3, T, Q> const& v ) { - mat<3, 3, T, P> Result(static_cast(1)); + mat<3, 3, T, Q> Result(static_cast(1)); Result[0][0] = v[0]; Result[1][1] = v[1]; Result[2][2] = v[2]; return Result; } - template - GLM_FUNC_QUALIFIER mat<3, 4, T, P> diagonal3x4 + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> diagonal3x4 ( - vec<3, T, P> const& v + vec<3, T, Q> const& v ) { - mat<3, 4, T, P> Result(static_cast(1)); + mat<3, 4, T, Q> Result(static_cast(1)); Result[0][0] = v[0]; Result[1][1] = v[1]; Result[2][2] = v[2]; return Result; } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> diagonal4x4 + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> diagonal4x4 ( - vec<4, T, P> const& v + vec<4, T, Q> const& v ) { - mat<4, 4, T, P> Result(static_cast(1)); + mat<4, 4, T, Q> Result(static_cast(1)); Result[0][0] = v[0]; Result[1][1] = v[1]; Result[2][2] = v[2]; @@ -91,26 +91,26 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER mat<4, 3, T, P> diagonal4x3 + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> diagonal4x3 ( - vec<3, T, P> const& v + vec<3, T, Q> const& v ) { - mat<4, 3, T, P> Result(static_cast(1)); + mat<4, 3, T, Q> Result(static_cast(1)); Result[0][0] = v[0]; Result[1][1] = v[1]; Result[2][2] = v[2]; return Result; } - template - GLM_FUNC_QUALIFIER mat<4, 2, T, P> diagonal4x2 + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> diagonal4x2 ( - vec<2, T, P> const& v + vec<2, T, Q> const& v ) { - mat<4, 2, T, P> Result(static_cast(1)); + mat<4, 2, T, Q> Result(static_cast(1)); Result[0][0] = v[0]; Result[1][1] = v[1]; return Result; diff --git a/glm/gtx/matrix_query.hpp b/glm/gtx/matrix_query.hpp index 9a3a9b94..1fb41ca6 100644 --- a/glm/gtx/matrix_query.hpp +++ b/glm/gtx/matrix_query.hpp @@ -33,43 +33,43 @@ namespace glm /// Return whether a matrix a null matrix. /// From GLM_GTX_matrix_query extension. - template - GLM_FUNC_DECL bool isNull(mat<2, 2, T, P> const& m, T const& epsilon); + template + GLM_FUNC_DECL bool isNull(mat<2, 2, T, Q> const& m, T const& epsilon); /// Return whether a matrix a null matrix. /// From GLM_GTX_matrix_query extension. - template - GLM_FUNC_DECL bool isNull(mat<3, 3, T, P> const& m, T const& epsilon); + template + GLM_FUNC_DECL bool isNull(mat<3, 3, T, Q> const& m, T const& epsilon); /// Return whether a matrix is a null matrix. /// From GLM_GTX_matrix_query extension. - template - GLM_FUNC_DECL bool isNull(mat<4, 4, T, P> const& m, T const& epsilon); + template + GLM_FUNC_DECL bool isNull(mat<4, 4, T, Q> const& m, T const& epsilon); /// Return whether a matrix is an identity matrix. /// From GLM_GTX_matrix_query extension. - template class matType> - GLM_FUNC_DECL bool isIdentity(matType const& m, T const& epsilon); + template class matType> + GLM_FUNC_DECL bool isIdentity(matType const& m, T const& epsilon); /// Return whether a matrix is a normalized matrix. /// From GLM_GTX_matrix_query extension. - template - GLM_FUNC_DECL bool isNormalized(mat<2, 2, T, P> const& m, T const& epsilon); + template + GLM_FUNC_DECL bool isNormalized(mat<2, 2, T, Q> const& m, T const& epsilon); /// Return whether a matrix is a normalized matrix. /// From GLM_GTX_matrix_query extension. - template - GLM_FUNC_DECL bool isNormalized(mat<3, 3, T, P> const& m, T const& epsilon); + template + GLM_FUNC_DECL bool isNormalized(mat<3, 3, T, Q> const& m, T const& epsilon); /// Return whether a matrix is a normalized matrix. /// From GLM_GTX_matrix_query extension. - template - GLM_FUNC_DECL bool isNormalized(mat<4, 4, T, P> const& m, T const& epsilon); + template + GLM_FUNC_DECL bool isNormalized(mat<4, 4, T, Q> const& m, T const& epsilon); /// Return whether a matrix is an orthonormalized matrix. /// From GLM_GTX_matrix_query extension. - template class matType> - GLM_FUNC_DECL bool isOrthogonal(matType const& m, T const& epsilon); + template class matType> + GLM_FUNC_DECL bool isOrthogonal(matType const& m, T const& epsilon); /// @} }//namespace glm diff --git a/glm/gtx/matrix_query.inl b/glm/gtx/matrix_query.inl index 0eb71e8f..38b520f1 100644 --- a/glm/gtx/matrix_query.inl +++ b/glm/gtx/matrix_query.inl @@ -3,8 +3,8 @@ namespace glm { - template - GLM_FUNC_QUALIFIER bool isNull(mat<2, 2, T, P> const& m, T const& epsilon) + template + GLM_FUNC_QUALIFIER bool isNull(mat<2, 2, T, Q> const& m, T const& epsilon) { bool result = true; for(length_t i = 0; result && i < m.length() ; ++i) @@ -12,8 +12,8 @@ namespace glm return result; } - template - GLM_FUNC_QUALIFIER bool isNull(mat<3, 3, T, P> const& m, T const& epsilon) + template + GLM_FUNC_QUALIFIER bool isNull(mat<3, 3, T, Q> const& m, T const& epsilon) { bool result = true; for(length_t i = 0; result && i < m.length() ; ++i) @@ -21,8 +21,8 @@ namespace glm return result; } - template - GLM_FUNC_QUALIFIER bool isNull(mat<4, 4, T, P> const& m, T const& epsilon) + template + GLM_FUNC_QUALIFIER bool isNull(mat<4, 4, T, Q> const& m, T const& epsilon) { bool result = true; for(length_t i = 0; result && i < m.length() ; ++i) @@ -30,8 +30,8 @@ namespace glm return result; } - template - GLM_FUNC_QUALIFIER bool isIdentity(mat const& m, T const& epsilon) + template + GLM_FUNC_QUALIFIER bool isIdentity(mat const& m, T const& epsilon) { bool result = true; for(length_t i = 0; result && i < m[0].length() ; ++i) @@ -46,15 +46,15 @@ namespace glm return result; } - template - GLM_FUNC_QUALIFIER bool isNormalized(mat<2, 2, T, P> const& m, T const& epsilon) + template + GLM_FUNC_QUALIFIER bool isNormalized(mat<2, 2, T, Q> const& m, T const& epsilon) { bool result(true); for(length_t i = 0; result && i < m.length(); ++i) result = isNormalized(m[i], epsilon); for(length_t i = 0; result && i < m.length(); ++i) { - typename mat<2, 2, T, P>::col_type v; + typename mat<2, 2, T, Q>::col_type v; for(length_t j = 0; j < m.length(); ++j) v[j] = m[j][i]; result = isNormalized(v, epsilon); @@ -62,15 +62,15 @@ namespace glm return result; } - template - GLM_FUNC_QUALIFIER bool isNormalized(mat<3, 3, T, P> const& m, T const& epsilon) + template + GLM_FUNC_QUALIFIER bool isNormalized(mat<3, 3, T, Q> const& m, T const& epsilon) { bool result(true); for(length_t i = 0; result && i < m.length(); ++i) result = isNormalized(m[i], epsilon); for(length_t i = 0; result && i < m.length(); ++i) { - typename mat<3, 3, T, P>::col_type v; + typename mat<3, 3, T, Q>::col_type v; for(length_t j = 0; j < m.length(); ++j) v[j] = m[j][i]; result = isNormalized(v, epsilon); @@ -78,15 +78,15 @@ namespace glm return result; } - template - GLM_FUNC_QUALIFIER bool isNormalized(mat<4, 4, T, P> const& m, T const& epsilon) + template + GLM_FUNC_QUALIFIER bool isNormalized(mat<4, 4, T, Q> const& m, T const& epsilon) { bool result(true); for(length_t i = 0; result && i < m.length(); ++i) result = isNormalized(m[i], epsilon); for(length_t i = 0; result && i < m.length(); ++i) { - typename mat<4, 4, T, P>::col_type v; + typename mat<4, 4, T, Q>::col_type v; for(length_t j = 0; j < m.length(); ++j) v[j] = m[j][i]; result = isNormalized(v, epsilon); @@ -94,8 +94,8 @@ namespace glm return result; } - template - GLM_FUNC_QUALIFIER bool isOrthogonal(mat const& m, T const& epsilon) + template + GLM_FUNC_QUALIFIER bool isOrthogonal(mat const& m, T const& epsilon) { bool result = true; for(length_t i(0); result && i < m.length() - 1; ++i) @@ -104,7 +104,7 @@ namespace glm if(result) { - mat tmp = transpose(m); + mat tmp = transpose(m); for(length_t i(0); result && i < m.length() - 1 ; ++i) for(length_t j(i + 1); result && j < m.length(); ++j) result = areOrthogonal(tmp[i], tmp[j], epsilon); diff --git a/glm/gtx/matrix_transform_2d.hpp b/glm/gtx/matrix_transform_2d.hpp index ebab5ca2..c0c31296 100644 --- a/glm/gtx/matrix_transform_2d.hpp +++ b/glm/gtx/matrix_transform_2d.hpp @@ -34,45 +34,45 @@ namespace glm /// /// @param m Input matrix multiplied by this translation matrix. /// @param v Coordinates of a translation vector. - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> translate( - mat<3, 3, T, P> const& m, - vec<2, T, P> const& v); + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> translate( + mat<3, 3, T, Q> const& m, + vec<2, T, Q> const& v); /// Builds a rotation 3 * 3 matrix created from an angle. /// /// @param m Input matrix multiplied by this translation matrix. /// @param angle Rotation angle expressed in radians. - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> rotate( - mat<3, 3, T, P> const& m, + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> rotate( + mat<3, 3, T, Q> const& m, T angle); /// Builds a scale 3 * 3 matrix created from a vector of 2 components. /// /// @param m Input matrix multiplied by this translation matrix. /// @param v Coordinates of a scale vector. - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> scale( - mat<3, 3, T, P> const& m, - vec<2, T, P> const& v); + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> scale( + mat<3, 3, T, Q> const& m, + vec<2, T, Q> const& v); /// Builds an horizontal (parallel to the x axis) shear 3 * 3 matrix. /// /// @param m Input matrix multiplied by this translation matrix. /// @param y Shear factor. - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> shearX( - mat<3, 3, T, P> const& m, + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> shearX( + mat<3, 3, T, Q> const& m, T y); /// Builds a vertical (parallel to the y axis) shear 3 * 3 matrix. /// /// @param m Input matrix multiplied by this translation matrix. /// @param x Shear factor. - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> shearY( - mat<3, 3, T, P> const& m, + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> shearY( + mat<3, 3, T, Q> const& m, T x); /// @} diff --git a/glm/gtx/matrix_transform_2d.inl b/glm/gtx/matrix_transform_2d.inl index 5bcb53a9..e4036984 100644 --- a/glm/gtx/matrix_transform_2d.inl +++ b/glm/gtx/matrix_transform_2d.inl @@ -7,61 +7,61 @@ namespace glm { - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> translate( - mat<3, 3, T, P> const& m, - vec<2, T, P> const& v) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> translate( + mat<3, 3, T, Q> const& m, + vec<2, T, Q> const& v) { - mat<3, 3, T, P> Result(m); + mat<3, 3, T, Q> Result(m); Result[2] = m[0] * v[0] + m[1] * v[1] + m[2]; return Result; } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> rotate( - mat<3, 3, T, P> const& m, + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> rotate( + mat<3, 3, T, Q> const& m, T angle) { T const a = angle; T const c = cos(a); T const s = sin(a); - mat<3, 3, T, P> Result; + mat<3, 3, T, Q> Result; Result[0] = m[0] * c + m[1] * s; Result[1] = m[0] * -s + m[1] * c; Result[2] = m[2]; return Result; } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> scale( - mat<3, 3, T, P> const& m, - vec<2, T, P> const& v) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> scale( + mat<3, 3, T, Q> const& m, + vec<2, T, Q> const& v) { - mat<3, 3, T, P> Result; + mat<3, 3, T, Q> Result; Result[0] = m[0] * v[0]; Result[1] = m[1] * v[1]; Result[2] = m[2]; return Result; } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> shearX( - mat<3, 3, T, P> const& m, + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> shearX( + mat<3, 3, T, Q> const& m, T y) { - mat<3, 3, T, P> Result(1); + mat<3, 3, T, Q> Result(1); Result[0][1] = y; return m * Result; } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> shearY( - mat<3, 3, T, P> const& m, + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> shearY( + mat<3, 3, T, Q> const& m, T x) { - mat<3, 3, T, P> Result(1); + mat<3, 3, T, Q> Result(1); Result[1][0] = x; return m * Result; } diff --git a/glm/gtx/mixed_product.hpp b/glm/gtx/mixed_product.hpp index 19012162..f56895d8 100644 --- a/glm/gtx/mixed_product.hpp +++ b/glm/gtx/mixed_product.hpp @@ -29,11 +29,11 @@ namespace glm /// @{ /// @brief Mixed product of 3 vectors (from GLM_GTX_mixed_product extension) - template + template GLM_FUNC_DECL T mixedProduct( - vec<3, T, P> const& v1, - vec<3, T, P> const& v2, - vec<3, T, P> const& v3); + vec<3, T, Q> const& v1, + vec<3, T, Q> const& v2, + vec<3, T, Q> const& v3); /// @} }// namespace glm diff --git a/glm/gtx/mixed_product.inl b/glm/gtx/mixed_product.inl index d6f2a012..01e94ecb 100644 --- a/glm/gtx/mixed_product.inl +++ b/glm/gtx/mixed_product.inl @@ -3,12 +3,12 @@ namespace glm { - template + template GLM_FUNC_QUALIFIER T mixedProduct ( - vec<3, T, P> const& v1, - vec<3, T, P> const& v2, - vec<3, T, P> const& v3 + vec<3, T, Q> const& v1, + vec<3, T, Q> const& v2, + vec<3, T, Q> const& v3 ) { return dot(cross(v1, v2), v3); diff --git a/glm/gtx/norm.hpp b/glm/gtx/norm.hpp index daddfe41..9cb9b294 100644 --- a/glm/gtx/norm.hpp +++ b/glm/gtx/norm.hpp @@ -32,43 +32,43 @@ namespace glm /// Returns the squared length of x. /// From GLM_GTX_norm extension. - template - GLM_FUNC_DECL T length2(vec const& x); + template + GLM_FUNC_DECL T length2(vec const& x); /// Returns the squared distance between p0 and p1, i.e., length2(p0 - p1). /// From GLM_GTX_norm extension. - template - GLM_FUNC_DECL T distance2(vec const& p0, vec const& p1); + template + GLM_FUNC_DECL T distance2(vec const& p0, vec const& p1); //! Returns the L1 norm between x and y. //! From GLM_GTX_norm extension. - template - GLM_FUNC_DECL T l1Norm(vec<3, T, P> const& x, vec<3, T, P> const& y); + template + GLM_FUNC_DECL T l1Norm(vec<3, T, Q> const& x, vec<3, T, Q> const& y); //! Returns the L1 norm of v. //! From GLM_GTX_norm extension. - template - GLM_FUNC_DECL T l1Norm(vec<3, T, P> const& v); + template + GLM_FUNC_DECL T l1Norm(vec<3, T, Q> const& v); //! Returns the L2 norm between x and y. //! From GLM_GTX_norm extension. - template - GLM_FUNC_DECL T l2Norm(vec<3, T, P> const& x, vec<3, T, P> const& y); + template + GLM_FUNC_DECL T l2Norm(vec<3, T, Q> const& x, vec<3, T, Q> const& y); //! Returns the L2 norm of v. //! From GLM_GTX_norm extension. - template - GLM_FUNC_DECL T l2Norm(vec<3, T, P> const& x); + template + GLM_FUNC_DECL T l2Norm(vec<3, T, Q> const& x); //! Returns the L norm between x and y. //! From GLM_GTX_norm extension. - template - GLM_FUNC_DECL T lxNorm(vec<3, T, P> const& x, vec<3, T, P> const& y, unsigned int Depth); + template + GLM_FUNC_DECL T lxNorm(vec<3, T, Q> const& x, vec<3, T, Q> const& y, unsigned int Depth); //! Returns the L norm of v. //! From GLM_GTX_norm extension. - template - GLM_FUNC_DECL T lxNorm(vec<3, T, P> const& x, unsigned int Depth); + template + GLM_FUNC_DECL T lxNorm(vec<3, T, Q> const& x, unsigned int Depth); /// @} }//namespace glm diff --git a/glm/gtx/norm.inl b/glm/gtx/norm.inl index a49a0c76..7bd64e87 100644 --- a/glm/gtx/norm.inl +++ b/glm/gtx/norm.inl @@ -6,10 +6,10 @@ namespace glm{ namespace detail { - template + template struct compute_length2 { - GLM_FUNC_QUALIFIER static T call(vec const& v) + GLM_FUNC_QUALIFIER static T call(vec const& v) { return dot(v, v); } @@ -23,11 +23,11 @@ namespace detail return x * x; } - template - GLM_FUNC_QUALIFIER T length2(vec const& v) + template + GLM_FUNC_QUALIFIER T length2(vec const& v) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'length2' accepts only floating-point inputs"); - return detail::compute_length2::value>::call(v); + return detail::compute_length2::value>::call(v); } template @@ -37,46 +37,46 @@ namespace detail return length2(p1 - p0); } - template - GLM_FUNC_QUALIFIER T distance2(vec const& p0, vec const& p1) + template + GLM_FUNC_QUALIFIER T distance2(vec const& p0, vec const& p1) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'distance2' accepts only floating-point inputs"); return length2(p1 - p0); } - template - GLM_FUNC_QUALIFIER T l1Norm(vec<3, T, P> const& a, vec<3, T, P> const& b) + template + GLM_FUNC_QUALIFIER T l1Norm(vec<3, T, Q> const& a, vec<3, T, Q> const& b) { return abs(b.x - a.x) + abs(b.y - a.y) + abs(b.z - a.z); } - template - GLM_FUNC_QUALIFIER T l1Norm(vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER T l1Norm(vec<3, T, Q> const& v) { return abs(v.x) + abs(v.y) + abs(v.z); } - template - GLM_FUNC_QUALIFIER T l2Norm(vec<3, T, P> const& a, vec<3, T, P> const& b + template + GLM_FUNC_QUALIFIER T l2Norm(vec<3, T, Q> const& a, vec<3, T, Q> const& b ) { return length(b - a); } - template - GLM_FUNC_QUALIFIER T l2Norm(vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER T l2Norm(vec<3, T, Q> const& v) { return length(v); } - template - GLM_FUNC_QUALIFIER T lxNorm(vec<3, T, P> const& x, vec<3, T, P> const& y, unsigned int Depth) + template + GLM_FUNC_QUALIFIER T lxNorm(vec<3, T, Q> const& x, vec<3, T, Q> const& y, unsigned int Depth) { return pow(pow(y.x - x.x, T(Depth)) + pow(y.y - x.y, T(Depth)) + pow(y.z - x.z, T(Depth)), T(1) / T(Depth)); } - template - GLM_FUNC_QUALIFIER T lxNorm(vec<3, T, P> const& v, unsigned int Depth) + template + GLM_FUNC_QUALIFIER T lxNorm(vec<3, T, Q> const& v, unsigned int Depth) { return pow(pow(v.x, T(Depth)) + pow(v.y, T(Depth)) + pow(v.z, T(Depth)), T(1) / T(Depth)); } diff --git a/glm/gtx/normal.hpp b/glm/gtx/normal.hpp index a3069866..08776254 100644 --- a/glm/gtx/normal.hpp +++ b/glm/gtx/normal.hpp @@ -32,8 +32,8 @@ namespace glm /// Computes triangle normal from triangle points. /// /// @see gtx_normal - template - GLM_FUNC_DECL vec<3, T, P> triangleNormal(vec<3, T, P> const& p1, vec<3, T, P> const& p2, vec<3, T, P> const& p3); + template + GLM_FUNC_DECL vec<3, T, Q> triangleNormal(vec<3, T, Q> const& p1, vec<3, T, Q> const& p2, vec<3, T, Q> const& p3); /// @} }//namespace glm diff --git a/glm/gtx/normal.inl b/glm/gtx/normal.inl index e88a9a06..d930a253 100644 --- a/glm/gtx/normal.inl +++ b/glm/gtx/normal.inl @@ -3,12 +3,12 @@ namespace glm { - template - GLM_FUNC_QUALIFIER vec<3, T, P> triangleNormal + template + GLM_FUNC_QUALIFIER vec<3, T, Q> triangleNormal ( - vec<3, T, P> const& p1, - vec<3, T, P> const& p2, - vec<3, T, P> const& p3 + vec<3, T, Q> const& p1, + vec<3, T, Q> const& p2, + vec<3, T, Q> const& p3 ) { return normalize(cross(p1 - p2, p1 - p3)); diff --git a/glm/gtx/normalize_dot.hpp b/glm/gtx/normalize_dot.hpp index 2c1d8983..02882dbd 100644 --- a/glm/gtx/normalize_dot.hpp +++ b/glm/gtx/normalize_dot.hpp @@ -33,15 +33,15 @@ namespace glm /// It's faster that dot(normalize(x), normalize(y)). /// /// @see gtx_normalize_dot extension. - template - GLM_FUNC_DECL T normalizeDot(vec const& x, vec const& y); + template + GLM_FUNC_DECL T normalizeDot(vec const& x, vec const& y); /// Normalize parameters and returns the dot product of x and y. /// Faster that dot(fastNormalize(x), fastNormalize(y)). /// /// @see gtx_normalize_dot extension. - template - GLM_FUNC_DECL T fastNormalizeDot(vec const& x, vec const& y); + template + GLM_FUNC_DECL T fastNormalizeDot(vec const& x, vec const& y); /// @} }//namespace glm diff --git a/glm/gtx/normalize_dot.inl b/glm/gtx/normalize_dot.inl index bef91f70..8b88860e 100644 --- a/glm/gtx/normalize_dot.inl +++ b/glm/gtx/normalize_dot.inl @@ -3,14 +3,14 @@ namespace glm { - template - GLM_FUNC_QUALIFIER T normalizeDot(vec const& x, vec const& y) + template + GLM_FUNC_QUALIFIER T normalizeDot(vec const& x, vec const& y) { return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); } - template - GLM_FUNC_QUALIFIER T fastNormalizeDot(vec const& x, vec const& y) + template + GLM_FUNC_QUALIFIER T fastNormalizeDot(vec const& x, vec const& y) { return glm::dot(x, y) * glm::fastInverseSqrt(glm::dot(x, x) * glm::dot(y, y)); } diff --git a/glm/gtx/orthonormalize.hpp b/glm/gtx/orthonormalize.hpp index cc25074c..dd6494ab 100644 --- a/glm/gtx/orthonormalize.hpp +++ b/glm/gtx/orthonormalize.hpp @@ -34,14 +34,14 @@ namespace glm /// Returns the orthonormalized matrix of m. /// /// @see gtx_orthonormalize - template - GLM_FUNC_DECL mat<3, 3, T, P> orthonormalize(mat<3, 3, T, P> const& m); + template + GLM_FUNC_DECL mat<3, 3, T, Q> orthonormalize(mat<3, 3, T, Q> const& m); /// Orthonormalizes x according y. /// /// @see gtx_orthonormalize - template - GLM_FUNC_DECL vec<3, T, P> orthonormalize(vec<3, T, P> const& x, vec<3, T, P> const& y); + template + GLM_FUNC_DECL vec<3, T, Q> orthonormalize(vec<3, T, Q> const& x, vec<3, T, Q> const& y); /// @} }//namespace glm diff --git a/glm/gtx/orthonormalize.inl b/glm/gtx/orthonormalize.inl index b6edee81..1cc087d6 100644 --- a/glm/gtx/orthonormalize.inl +++ b/glm/gtx/orthonormalize.inl @@ -3,10 +3,10 @@ namespace glm { - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> orthonormalize(mat<3, 3, T, P> const& m) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> orthonormalize(mat<3, 3, T, Q> const& m) { - mat<3, 3, T, P> r = m; + mat<3, 3, T, Q> r = m; r[0] = normalize(r[0]); @@ -22,8 +22,8 @@ namespace glm return r; } - template - GLM_FUNC_QUALIFIER vec<3, T, P> orthonormalize(vec<3, T, P> const& x, vec<3, T, P> const& y) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> orthonormalize(vec<3, T, Q> const& x, vec<3, T, Q> const& y) { return normalize(x - y * dot(y, x)); } diff --git a/glm/gtx/polar_coordinates.hpp b/glm/gtx/polar_coordinates.hpp index 95e872b1..6e8ed9c6 100644 --- a/glm/gtx/polar_coordinates.hpp +++ b/glm/gtx/polar_coordinates.hpp @@ -31,16 +31,16 @@ namespace glm /// Convert Euclidean to Polar coordinates, x is the xz distance, y, the latitude and z the longitude. /// /// @see gtx_polar_coordinates - template - GLM_FUNC_DECL vec<3, T, P> polar( - vec<3, T, P> const& euclidean); + template + GLM_FUNC_DECL vec<3, T, Q> polar( + vec<3, T, Q> const& euclidean); /// Convert Polar to Euclidean coordinates. /// /// @see gtx_polar_coordinates - template - GLM_FUNC_DECL vec<3, T, P> euclidean( - vec<2, T, P> const& polar); + template + GLM_FUNC_DECL vec<3, T, Q> euclidean( + vec<2, T, Q> const& polar); /// @} }//namespace glm diff --git a/glm/gtx/polar_coordinates.inl b/glm/gtx/polar_coordinates.inl index 68761a7d..cd1f357c 100644 --- a/glm/gtx/polar_coordinates.inl +++ b/glm/gtx/polar_coordinates.inl @@ -3,32 +3,32 @@ namespace glm { - template - GLM_FUNC_QUALIFIER vec<3, T, P> polar + template + GLM_FUNC_QUALIFIER vec<3, T, Q> polar ( - vec<3, T, P> const& euclidean + vec<3, T, Q> const& euclidean ) { T const Length(length(euclidean)); - vec<3, T, P> const tmp(euclidean / Length); + vec<3, T, Q> const tmp(euclidean / Length); T const xz_dist(sqrt(tmp.x * tmp.x + tmp.z * tmp.z)); - return vec<3, T, P>( + return vec<3, T, Q>( asin(tmp.y), // latitude atan(tmp.x, tmp.z), // longitude xz_dist); // xz distance } - template - GLM_FUNC_QUALIFIER vec<3, T, P> euclidean + template + GLM_FUNC_QUALIFIER vec<3, T, Q> euclidean ( - vec<2, T, P> const& polar + vec<2, T, Q> const& polar ) { T const latitude(polar.x); T const longitude(polar.y); - return vec<3, T, P>( + return vec<3, T, Q>( cos(latitude) * sin(longitude), sin(latitude), cos(latitude) * cos(longitude)); diff --git a/glm/gtx/quaternion.hpp b/glm/gtx/quaternion.hpp index e2506640..a4fcf486 100644 --- a/glm/gtx/quaternion.hpp +++ b/glm/gtx/quaternion.hpp @@ -35,142 +35,142 @@ namespace glm /// Create an identity quaternion. /// /// @see gtx_quaternion - template - GLM_FUNC_DECL tquat quat_identity(); + template + GLM_FUNC_DECL tquat quat_identity(); /// Compute a cross product between a quaternion and a vector. /// /// @see gtx_quaternion - template - GLM_FUNC_DECL vec<3, T, P> cross( - tquat const& q, - vec<3, T, P> const& v); + template + GLM_FUNC_DECL vec<3, T, Q> cross( + tquat const& q, + vec<3, T, Q> const& v); //! Compute a cross product between a vector and a quaternion. /// /// @see gtx_quaternion - template - GLM_FUNC_DECL vec<3, T, P> cross( - vec<3, T, P> const& v, - tquat const& q); + template + GLM_FUNC_DECL vec<3, T, Q> cross( + vec<3, T, Q> const& v, + tquat const& q); //! Compute a point on a path according squad equation. //! q1 and q2 are control points; s1 and s2 are intermediate control points. /// /// @see gtx_quaternion - template - GLM_FUNC_DECL tquat squad( - tquat const& q1, - tquat const& q2, - tquat const& s1, - tquat const& s2, + template + GLM_FUNC_DECL tquat squad( + tquat const& q1, + tquat const& q2, + tquat const& s1, + tquat const& s2, T const& h); //! Returns an intermediate control point for squad interpolation. /// /// @see gtx_quaternion - template - GLM_FUNC_DECL tquat intermediate( - tquat const& prev, - tquat const& curr, - tquat const& next); + template + GLM_FUNC_DECL tquat intermediate( + tquat const& prev, + tquat const& curr, + tquat const& next); //! Returns a exp of a quaternion. /// /// @see gtx_quaternion - template - GLM_FUNC_DECL tquat exp( - tquat const& q); + template + GLM_FUNC_DECL tquat exp( + tquat const& q); //! Returns a log of a quaternion. /// /// @see gtx_quaternion - template - GLM_FUNC_DECL tquat log( - tquat const& q); + template + GLM_FUNC_DECL tquat log( + tquat const& q); /// Returns x raised to the y power. /// /// @see gtx_quaternion - template - GLM_FUNC_DECL tquat pow( - tquat const& x, + template + GLM_FUNC_DECL tquat pow( + tquat const& x, T const& y); //! Returns quarternion square root. /// /// @see gtx_quaternion - //template - //tquat sqrt( - // tquat const& q); + //template + //tquat sqrt( + // tquat const& q); //! Rotates a 3 components vector by a quaternion. /// /// @see gtx_quaternion - template - GLM_FUNC_DECL vec<3, T, P> rotate( - tquat const& q, - vec<3, T, P> const& v); + template + GLM_FUNC_DECL vec<3, T, Q> rotate( + tquat const& q, + vec<3, T, Q> const& v); /// Rotates a 4 components vector by a quaternion. /// /// @see gtx_quaternion - template - GLM_FUNC_DECL vec<4, T, P> rotate( - tquat const& q, - vec<4, T, P> const& v); + template + GLM_FUNC_DECL vec<4, T, Q> rotate( + tquat const& q, + vec<4, T, Q> const& v); /// Extract the real component of a quaternion. /// /// @see gtx_quaternion - template + template GLM_FUNC_DECL T extractRealComponent( - tquat const& q); + tquat const& q); /// Converts a quaternion to a 3 * 3 matrix. /// /// @see gtx_quaternion - template - GLM_FUNC_DECL mat<3, 3, T, P> toMat3( - tquat const& x){return mat3_cast(x);} + template + GLM_FUNC_DECL mat<3, 3, T, Q> toMat3( + tquat const& x){return mat3_cast(x);} /// Converts a quaternion to a 4 * 4 matrix. /// /// @see gtx_quaternion - template - GLM_FUNC_DECL mat<4, 4, T, P> toMat4( - tquat const& x){return mat4_cast(x);} + template + GLM_FUNC_DECL mat<4, 4, T, Q> toMat4( + tquat const& x){return mat4_cast(x);} /// Converts a 3 * 3 matrix to a quaternion. /// /// @see gtx_quaternion - template - GLM_FUNC_DECL tquat toQuat( - mat<3, 3, T, P> const& x){return quat_cast(x);} + template + GLM_FUNC_DECL tquat toQuat( + mat<3, 3, T, Q> const& x){return quat_cast(x);} /// Converts a 4 * 4 matrix to a quaternion. /// /// @see gtx_quaternion - template - GLM_FUNC_DECL tquat toQuat( - mat<4, 4, T, P> const& x){return quat_cast(x);} + template + GLM_FUNC_DECL tquat toQuat( + mat<4, 4, T, Q> const& x){return quat_cast(x);} /// Quaternion interpolation using the rotation short path. /// /// @see gtx_quaternion - template - GLM_FUNC_DECL tquat shortMix( - tquat const& x, - tquat const& y, + template + GLM_FUNC_DECL tquat shortMix( + tquat const& x, + tquat const& y, T const& a); /// Quaternion normalized linear interpolation. /// /// @see gtx_quaternion - template - GLM_FUNC_DECL tquat fastMix( - tquat const& x, - tquat const& y, + template + GLM_FUNC_DECL tquat fastMix( + tquat const& x, + tquat const& y, T const& a); /// Compute the rotation between two vectors. @@ -178,43 +178,43 @@ namespace glm /// param dest vector, needs to be normalized /// /// @see gtx_quaternion - template - GLM_FUNC_DECL tquat rotation( - vec<3, T, P> const& orig, - vec<3, T, P> const& dest); + template + GLM_FUNC_DECL tquat rotation( + vec<3, T, Q> const& orig, + vec<3, T, Q> const& dest); /// Build a look at quaternion based on the default handedness. /// /// @param direction Desired direction of the camera. /// @param up Up vector, how the camera is oriented. Typically (0, 1, 0). - template - GLM_FUNC_DECL tquat quatLookAt( - vec<3, T, P> const& direction, - vec<3, T, P> const& up); + template + GLM_FUNC_DECL tquat quatLookAt( + vec<3, T, Q> const& direction, + vec<3, T, Q> const& up); /// Build a right-handed look at quaternion. /// /// @param direction Desired direction of the camera. /// @param up Up vector, how the camera is oriented. Typically (0, 1, 0). - template - GLM_FUNC_DECL tquat quatLookAtRH( - vec<3, T, P> const& direction, - vec<3, T, P> const& up); + template + GLM_FUNC_DECL tquat quatLookAtRH( + vec<3, T, Q> const& direction, + vec<3, T, Q> const& up); /// Build a left-handed look at quaternion. /// /// @param direction Desired direction onto which the +z-axis gets mapped /// @param up Up vector, how the camera is oriented. Typically (0, 1, 0). - template - GLM_FUNC_DECL tquat quatLookAtLH( - vec<3, T, P> const& direction, - vec<3, T, P> const& up); + template + GLM_FUNC_DECL tquat quatLookAtLH( + vec<3, T, Q> const& direction, + vec<3, T, Q> const& up); /// Returns the squared length of x. /// /// @see gtx_quaternion - template - GLM_FUNC_DECL T length2(tquat const& q); + template + GLM_FUNC_DECL T length2(tquat const& q); /// @} }//namespace glm diff --git a/glm/gtx/quaternion.inl b/glm/gtx/quaternion.inl index bcb0eab9..6c713fde 100644 --- a/glm/gtx/quaternion.inl +++ b/glm/gtx/quaternion.inl @@ -6,90 +6,90 @@ namespace glm { - template - GLM_FUNC_QUALIFIER tquat quat_identity() + template + GLM_FUNC_QUALIFIER tquat quat_identity() { - return tquat(static_cast(1), static_cast(0), static_cast(0), static_cast(0)); + return tquat(static_cast(1), static_cast(0), static_cast(0), static_cast(0)); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> cross(vec<3, T, P> const& v, tquat const& q) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> cross(vec<3, T, Q> const& v, tquat const& q) { return inverse(q) * v; } - template - GLM_FUNC_QUALIFIER vec<3, T, P> cross(tquat const& q, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> cross(tquat const& q, vec<3, T, Q> const& v) { return q * v; } - template - GLM_FUNC_QUALIFIER tquat squad + template + GLM_FUNC_QUALIFIER tquat squad ( - tquat const& q1, - tquat const& q2, - tquat const& s1, - tquat const& s2, + tquat const& q1, + tquat const& q2, + tquat const& s1, + tquat const& s2, T const& h) { return mix(mix(q1, q2, h), mix(s1, s2, h), static_cast(2) * (static_cast(1) - h) * h); } - template - GLM_FUNC_QUALIFIER tquat intermediate + template + GLM_FUNC_QUALIFIER tquat intermediate ( - tquat const& prev, - tquat const& curr, - tquat const& next + tquat const& prev, + tquat const& curr, + tquat const& next ) { - tquat invQuat = inverse(curr); + tquat invQuat = inverse(curr); return exp((log(next + invQuat) + log(prev + invQuat)) / static_cast(-4)) * curr; } - template - GLM_FUNC_QUALIFIER tquat exp(tquat const& q) + template + GLM_FUNC_QUALIFIER tquat exp(tquat const& q) { - vec<3, T, P> u(q.x, q.y, q.z); + vec<3, T, Q> u(q.x, q.y, q.z); T const Angle = glm::length(u); if (Angle < epsilon()) - return tquat(); + return tquat(); - vec<3, T, P> const v(u / Angle); - return tquat(cos(Angle), sin(Angle) * v); + vec<3, T, Q> const v(u / Angle); + return tquat(cos(Angle), sin(Angle) * v); } - template - GLM_FUNC_QUALIFIER tquat log(tquat const& q) + template + GLM_FUNC_QUALIFIER tquat log(tquat const& q) { - vec<3, T, P> u(q.x, q.y, q.z); + vec<3, T, Q> u(q.x, q.y, q.z); T Vec3Len = length(u); if (Vec3Len < epsilon()) { if(q.w > static_cast(0)) - return tquat(log(q.w), static_cast(0), static_cast(0), static_cast(0)); + return tquat(log(q.w), static_cast(0), static_cast(0), static_cast(0)); else if(q.w < static_cast(0)) - return tquat(log(-q.w), pi(), static_cast(0), static_cast(0)); + return tquat(log(-q.w), pi(), static_cast(0), static_cast(0)); else - return tquat(std::numeric_limits::infinity(), std::numeric_limits::infinity(), std::numeric_limits::infinity(), std::numeric_limits::infinity()); + return tquat(std::numeric_limits::infinity(), std::numeric_limits::infinity(), std::numeric_limits::infinity(), std::numeric_limits::infinity()); } else { T t = atan(Vec3Len, T(q.w)) / Vec3Len; T QuatLen2 = Vec3Len * Vec3Len + q.w * q.w; - return tquat(static_cast(0.5) * log(QuatLen2), t * q.x, t * q.y, t * q.z); + return tquat(static_cast(0.5) * log(QuatLen2), t * q.x, t * q.y, t * q.z); } } - template - GLM_FUNC_QUALIFIER tquat pow(tquat const& x, T const& y) + template + GLM_FUNC_QUALIFIER tquat pow(tquat const& x, T const& y) { //Raising to the power of 0 should yield 1 //Needed to prevent a division by 0 error later on if(y > -epsilon() && y < epsilon()) - return tquat(1,0,0,0); + return tquat(1,0,0,0); //To deal with non-unit quaternions T magnitude = sqrt(x.x * x.x + x.y * x.y + x.z * x.z + x.w *x.w); @@ -97,30 +97,30 @@ namespace glm //Equivalent to raising a real number to a power //Needed to prevent a division by 0 error later on if(abs(x.w / magnitude) > static_cast(1) - epsilon() && abs(x.w / magnitude) < static_cast(1) + epsilon()) - return tquat(pow(x.w, y),0,0,0); + return tquat(pow(x.w, y),0,0,0); T Angle = acos(x.w / magnitude); T NewAngle = Angle * y; T Div = sin(NewAngle) / sin(Angle); T Mag = pow(magnitude, y - static_cast(1)); - return tquat(cos(NewAngle) * magnitude * Mag, x.x * Div * Mag, x.y * Div * Mag, x.z * Div * Mag); + return tquat(cos(NewAngle) * magnitude * Mag, x.x * Div * Mag, x.y * Div * Mag, x.z * Div * Mag); } - template - GLM_FUNC_QUALIFIER vec<3, T, P> rotate(tquat const& q, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rotate(tquat const& q, vec<3, T, Q> const& v) { return q * v; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> rotate(tquat const& q, vec<4, T, P> const& v) + template + GLM_FUNC_QUALIFIER vec<4, T, Q> rotate(tquat const& q, vec<4, T, Q> const& v) { return q * v; } - template - GLM_FUNC_QUALIFIER T extractRealComponent(tquat const& q) + template + GLM_FUNC_QUALIFIER T extractRealComponent(tquat const& q) { T w = static_cast(1) - q.x * q.x - q.y * q.y - q.z * q.z; if(w < T(0)) @@ -129,20 +129,20 @@ namespace glm return -sqrt(w); } - template - GLM_FUNC_QUALIFIER T length2(tquat const& q) + template + GLM_FUNC_QUALIFIER T length2(tquat const& q) { return q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w; } - template - GLM_FUNC_QUALIFIER tquat shortMix(tquat const& x, tquat const& y, T const& a) + template + GLM_FUNC_QUALIFIER tquat shortMix(tquat const& x, tquat const& y, T const& a) { if(a <= static_cast(0)) return x; if(a >= static_cast(1)) return y; T fCos = dot(x, y); - tquat y2(y); //BUG!!! tquat y2; + tquat y2(y); //BUG!!! tquat y2; if(fCos < static_cast(0)) { y2 = -y; @@ -165,24 +165,24 @@ namespace glm k1 = sin((static_cast(0) + a) * fAngle) * fOneOverSin; } - return tquat( + return tquat( k0 * x.w + k1 * y2.w, k0 * x.x + k1 * y2.x, k0 * x.y + k1 * y2.y, k0 * x.z + k1 * y2.z); } - template - GLM_FUNC_QUALIFIER tquat fastMix(tquat const& x, tquat const& y, T const& a) + template + GLM_FUNC_QUALIFIER tquat fastMix(tquat const& x, tquat const& y, T const& a) { return glm::normalize(x * (static_cast(1) - a) + (y * a)); } - template - GLM_FUNC_QUALIFIER tquat rotation(vec<3, T, P> const& orig, vec<3, T, P> const& dest) + template + GLM_FUNC_QUALIFIER tquat rotation(vec<3, T, Q> const& orig, vec<3, T, Q> const& dest) { T cosTheta = dot(orig, dest); - vec<3, T, P> rotationAxis; + vec<3, T, Q> rotationAxis; if(cosTheta >= static_cast(1) - epsilon()) return quat(); @@ -194,9 +194,9 @@ namespace glm // So guess one; any will do as long as it's perpendicular to start // This implementation favors a rotation around the Up axis (Y), // since it's often what you want to do. - rotationAxis = cross(vec<3, T, P>(0, 0, 1), orig); + rotationAxis = cross(vec<3, T, Q>(0, 0, 1), orig); if(length2(rotationAxis) < epsilon()) // bad luck, they were parallel, try again! - rotationAxis = cross(vec<3, T, P>(1, 0, 0), orig); + rotationAxis = cross(vec<3, T, Q>(1, 0, 0), orig); rotationAxis = normalize(rotationAxis); return angleAxis(pi(), rotationAxis); @@ -208,15 +208,15 @@ namespace glm T s = sqrt((T(1) + cosTheta) * static_cast(2)); T invs = static_cast(1) / s; - return tquat( + return tquat( s * static_cast(0.5f), rotationAxis.x * invs, rotationAxis.y * invs, rotationAxis.z * invs); } - template - GLM_FUNC_QUALIFIER tquat quatLookAt(vec<3, T, P> const& direction, vec<3, T, P> const& up) + template + GLM_FUNC_QUALIFIER tquat quatLookAt(vec<3, T, Q> const& direction, vec<3, T, Q> const& up) { # if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED return quatLookAtLH(direction, up); @@ -225,10 +225,10 @@ namespace glm # endif } - template - GLM_FUNC_QUALIFIER tquat quatLookAtRH(vec<3, T, P> const& direction, vec<3, T, P> const& up) + template + GLM_FUNC_QUALIFIER tquat quatLookAtRH(vec<3, T, Q> const& direction, vec<3, T, Q> const& up) { - mat<3, 3, T, P> Result; + mat<3, 3, T, Q> Result; Result[2] = -normalize(direction); Result[0] = normalize(cross(up, Result[2])); @@ -237,10 +237,10 @@ namespace glm return quat_cast(Result); } - template - GLM_FUNC_QUALIFIER tquat quatLookAtLH(vec<3, T, P> const& direction, vec<3, T, P> const& up) + template + GLM_FUNC_QUALIFIER tquat quatLookAtLH(vec<3, T, Q> const& direction, vec<3, T, Q> const& up) { - mat<3, 3, T, P> Result; + mat<3, 3, T, Q> Result; Result[2] = normalize(direction); Result[0] = normalize(cross(up, Result[2])); diff --git a/glm/gtx/range.hpp b/glm/gtx/range.hpp index 99ab0183..7e466f1e 100644 --- a/glm/gtx/range.hpp +++ b/glm/gtx/range.hpp @@ -31,26 +31,26 @@ namespace glm /// @addtogroup gtx_range /// @{ - template - inline length_t components(vec<1, T, P> const& v) + template + inline length_t components(vec<1, T, Q> const& v) { return v.length(); } - template - inline length_t components(vec<2, T, P> const& v) + template + inline length_t components(vec<2, T, Q> const& v) { return v.length(); } - template - inline length_t components(vec<3, T, P> const& v) + template + inline length_t components(vec<3, T, Q> const& v) { return v.length(); } - template - inline length_t components(vec<4, T, P> const& v) + template + inline length_t components(vec<4, T, Q> const& v) { return v.length(); } diff --git a/glm/gtx/rotate_normalized_axis.hpp b/glm/gtx/rotate_normalized_axis.hpp index 8badfdc5..bd750e80 100644 --- a/glm/gtx/rotate_normalized_axis.hpp +++ b/glm/gtx/rotate_normalized_axis.hpp @@ -41,13 +41,13 @@ namespace glm /// /// @see gtx_rotate_normalized_axis /// @see - rotate(T angle, T x, T y, T z) - /// @see - rotate(mat<4, 4, T, P> const& m, T angle, T x, T y, T z) - /// @see - rotate(T angle, vec<3, T, P> const& v) - template - GLM_FUNC_DECL mat<4, 4, T, P> rotateNormalizedAxis( - mat<4, 4, T, P> const& m, + /// @see - rotate(mat<4, 4, T, Q> const& m, T angle, T x, T y, T z) + /// @see - rotate(T angle, vec<3, T, Q> const& v) + template + GLM_FUNC_DECL mat<4, 4, T, Q> rotateNormalizedAxis( + mat<4, 4, T, Q> const& m, T const& angle, - vec<3, T, P> const& axis); + vec<3, T, Q> const& axis); /// Rotates a quaternion from a vector of 3 components normalized axis and an angle. /// @@ -56,11 +56,11 @@ namespace glm /// @param axis Normalized axis of the rotation, must be normalized. /// /// @see gtx_rotate_normalized_axis - template - GLM_FUNC_DECL tquat rotateNormalizedAxis( - tquat const& q, + template + GLM_FUNC_DECL tquat rotateNormalizedAxis( + tquat const& q, T const& angle, - vec<3, T, P> const& axis); + vec<3, T, Q> const& axis); /// @} }//namespace glm diff --git a/glm/gtx/rotate_normalized_axis.inl b/glm/gtx/rotate_normalized_axis.inl index 51f485fd..6a578dff 100644 --- a/glm/gtx/rotate_normalized_axis.inl +++ b/glm/gtx/rotate_normalized_axis.inl @@ -3,23 +3,23 @@ namespace glm { - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> rotateNormalizedAxis + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rotateNormalizedAxis ( - mat<4, 4, T, P> const& m, + mat<4, 4, T, Q> const& m, T const& angle, - vec<3, T, P> const& v + vec<3, T, Q> const& v ) { T const a = angle; T const c = cos(a); T const s = sin(a); - vec<3, T, P> const axis(v); + vec<3, T, Q> const axis(v); - vec<3, T, P> const temp((static_cast(1) - c) * axis); + vec<3, T, Q> const temp((static_cast(1) - c) * axis); - mat<4, 4, T, P> Rotate; + mat<4, 4, T, Q> Rotate; Rotate[0][0] = c + temp[0] * axis[0]; Rotate[0][1] = 0 + temp[0] * axis[1] + s * axis[2]; Rotate[0][2] = 0 + temp[0] * axis[2] - s * axis[1]; @@ -32,7 +32,7 @@ namespace glm Rotate[2][1] = 0 + temp[2] * axis[1] - s * axis[0]; Rotate[2][2] = c + temp[2] * axis[2]; - mat<4, 4, T, P> Result; + mat<4, 4, T, Q> Result; Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2]; Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2]; Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2]; @@ -40,20 +40,20 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER tquat rotateNormalizedAxis + template + GLM_FUNC_QUALIFIER tquat rotateNormalizedAxis ( - tquat const& q, + tquat const& q, T const& angle, - vec<3, T, P> const& v + vec<3, T, Q> const& v ) { - vec<3, T, P> const Tmp(v); + vec<3, T, Q> const Tmp(v); T const AngleRad(angle); T const Sin = sin(AngleRad * T(0.5)); - return q * tquat(cos(AngleRad * static_cast(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin); - //return gtc::quaternion::cross(q, tquat(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin)); + return q * tquat(cos(AngleRad * static_cast(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin); + //return gtc::quaternion::cross(q, tquat(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin)); } }//namespace glm diff --git a/glm/gtx/rotate_vector.hpp b/glm/gtx/rotate_vector.hpp index 50a18128..1cb8a7db 100644 --- a/glm/gtx/rotate_vector.hpp +++ b/glm/gtx/rotate_vector.hpp @@ -37,83 +37,83 @@ namespace glm /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. /// /// @see gtx_rotate_vector - template - GLM_FUNC_DECL vec<3, T, P> slerp( - vec<3, T, P> const& x, - vec<3, T, P> const& y, + template + GLM_FUNC_DECL vec<3, T, Q> slerp( + vec<3, T, Q> const& x, + vec<3, T, Q> const& y, T const& a); //! Rotate a two dimensional vector. //! From GLM_GTX_rotate_vector extension. - template - GLM_FUNC_DECL vec<2, T, P> rotate( - vec<2, T, P> const& v, + template + GLM_FUNC_DECL vec<2, T, Q> rotate( + vec<2, T, Q> const& v, T const& angle); //! Rotate a three dimensional vector around an axis. //! From GLM_GTX_rotate_vector extension. - template - GLM_FUNC_DECL vec<3, T, P> rotate( - vec<3, T, P> const& v, + template + GLM_FUNC_DECL vec<3, T, Q> rotate( + vec<3, T, Q> const& v, T const& angle, - vec<3, T, P> const& normal); + vec<3, T, Q> const& normal); //! Rotate a four dimensional vector around an axis. //! From GLM_GTX_rotate_vector extension. - template - GLM_FUNC_DECL vec<4, T, P> rotate( - vec<4, T, P> const& v, + template + GLM_FUNC_DECL vec<4, T, Q> rotate( + vec<4, T, Q> const& v, T const& angle, - vec<3, T, P> const& normal); + vec<3, T, Q> const& normal); //! Rotate a three dimensional vector around the X axis. //! From GLM_GTX_rotate_vector extension. - template - GLM_FUNC_DECL vec<3, T, P> rotateX( - vec<3, T, P> const& v, + template + GLM_FUNC_DECL vec<3, T, Q> rotateX( + vec<3, T, Q> const& v, T const& angle); //! Rotate a three dimensional vector around the Y axis. //! From GLM_GTX_rotate_vector extension. - template - GLM_FUNC_DECL vec<3, T, P> rotateY( - vec<3, T, P> const& v, + template + GLM_FUNC_DECL vec<3, T, Q> rotateY( + vec<3, T, Q> const& v, T const& angle); //! Rotate a three dimensional vector around the Z axis. //! From GLM_GTX_rotate_vector extension. - template - GLM_FUNC_DECL vec<3, T, P> rotateZ( - vec<3, T, P> const& v, + template + GLM_FUNC_DECL vec<3, T, Q> rotateZ( + vec<3, T, Q> const& v, T const& angle); //! Rotate a four dimensional vector around the X axis. //! From GLM_GTX_rotate_vector extension. - template - GLM_FUNC_DECL vec<4, T, P> rotateX( - vec<4, T, P> const& v, + template + GLM_FUNC_DECL vec<4, T, Q> rotateX( + vec<4, T, Q> const& v, T const& angle); //! Rotate a four dimensional vector around the Y axis. //! From GLM_GTX_rotate_vector extension. - template - GLM_FUNC_DECL vec<4, T, P> rotateY( - vec<4, T, P> const& v, + template + GLM_FUNC_DECL vec<4, T, Q> rotateY( + vec<4, T, Q> const& v, T const& angle); //! Rotate a four dimensional vector around the Z axis. //! From GLM_GTX_rotate_vector extension. - template - GLM_FUNC_DECL vec<4, T, P> rotateZ( - vec<4, T, P> const& v, + template + GLM_FUNC_DECL vec<4, T, Q> rotateZ( + vec<4, T, Q> const& v, T const& angle); //! Build a rotation matrix from a normal and a up vector. //! From GLM_GTX_rotate_vector extension. - template - GLM_FUNC_DECL mat<4, 4, T, P> orientation( - vec<3, T, P> const& Normal, - vec<3, T, P> const& Up); + template + GLM_FUNC_DECL mat<4, 4, T, Q> orientation( + vec<3, T, Q> const& Normal, + vec<3, T, Q> const& Up); /// @} }//namespace glm diff --git a/glm/gtx/rotate_vector.inl b/glm/gtx/rotate_vector.inl index 07cc4895..5183d37d 100644 --- a/glm/gtx/rotate_vector.inl +++ b/glm/gtx/rotate_vector.inl @@ -3,11 +3,11 @@ namespace glm { - template - GLM_FUNC_QUALIFIER vec<3, T, P> slerp + template + GLM_FUNC_QUALIFIER vec<3, T, Q> slerp ( - vec<3, T, P> const& x, - vec<3, T, P> const& y, + vec<3, T, Q> const& x, + vec<3, T, Q> const& y, T const& a ) { @@ -25,14 +25,14 @@ namespace glm return x * t1 + y * t2; } - template - GLM_FUNC_QUALIFIER vec<2, T, P> rotate + template + GLM_FUNC_QUALIFIER vec<2, T, Q> rotate ( - vec<2, T, P> const& v, + vec<2, T, Q> const& v, T const& angle ) { - vec<2, T, P> Result; + vec<2, T, Q> Result; T const Cos(cos(angle)); T const Sin(sin(angle)); @@ -41,47 +41,47 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER vec<3, T, P> rotate + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rotate ( - vec<3, T, P> const& v, + vec<3, T, Q> const& v, T const& angle, - vec<3, T, P> const& normal + vec<3, T, Q> const& normal ) { - return mat<3, 3, T, P>(glm::rotate(angle, normal)) * v; + return mat<3, 3, T, Q>(glm::rotate(angle, normal)) * v; } /* - template - GLM_FUNC_QUALIFIER vec<3, T, P> rotateGTX( - const vec<3, T, P>& x, + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rotateGTX( + const vec<3, T, Q>& x, T angle, - const vec<3, T, P>& normal) + const vec<3, T, Q>& normal) { const T Cos = cos(radians(angle)); const T Sin = sin(radians(angle)); return x * Cos + ((x * normal) * (T(1) - Cos)) * normal + cross(x, normal) * Sin; } */ - template - GLM_FUNC_QUALIFIER vec<4, T, P> rotate + template + GLM_FUNC_QUALIFIER vec<4, T, Q> rotate ( - vec<4, T, P> const& v, + vec<4, T, Q> const& v, T const& angle, - vec<3, T, P> const& normal + vec<3, T, Q> const& normal ) { return rotate(angle, normal) * v; } - template - GLM_FUNC_QUALIFIER vec<3, T, P> rotateX + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rotateX ( - vec<3, T, P> const& v, + vec<3, T, Q> const& v, T const& angle ) { - vec<3, T, P> Result(v); + vec<3, T, Q> Result(v); T const Cos(cos(angle)); T const Sin(sin(angle)); @@ -90,14 +90,14 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER vec<3, T, P> rotateY + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rotateY ( - vec<3, T, P> const& v, + vec<3, T, Q> const& v, T const& angle ) { - vec<3, T, P> Result = v; + vec<3, T, Q> Result = v; T const Cos(cos(angle)); T const Sin(sin(angle)); @@ -106,14 +106,14 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER vec<3, T, P> rotateZ + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rotateZ ( - vec<3, T, P> const& v, + vec<3, T, Q> const& v, T const& angle ) { - vec<3, T, P> Result = v; + vec<3, T, Q> Result = v; T const Cos(cos(angle)); T const Sin(sin(angle)); @@ -122,14 +122,14 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> rotateX + template + GLM_FUNC_QUALIFIER vec<4, T, Q> rotateX ( - vec<4, T, P> const& v, + vec<4, T, Q> const& v, T const& angle ) { - vec<4, T, P> Result = v; + vec<4, T, Q> Result = v; T const Cos(cos(angle)); T const Sin(sin(angle)); @@ -138,14 +138,14 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> rotateY + template + GLM_FUNC_QUALIFIER vec<4, T, Q> rotateY ( - vec<4, T, P> const& v, + vec<4, T, Q> const& v, T const& angle ) { - vec<4, T, P> Result = v; + vec<4, T, Q> Result = v; T const Cos(cos(angle)); T const Sin(sin(angle)); @@ -154,14 +154,14 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER vec<4, T, P> rotateZ + template + GLM_FUNC_QUALIFIER vec<4, T, Q> rotateZ ( - vec<4, T, P> const& v, + vec<4, T, Q> const& v, T const& angle ) { - vec<4, T, P> Result = v; + vec<4, T, Q> Result = v; T const Cos(cos(angle)); T const Sin(sin(angle)); @@ -170,17 +170,17 @@ namespace glm return Result; } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> orientation + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> orientation ( - vec<3, T, P> const& Normal, - vec<3, T, P> const& Up + vec<3, T, Q> const& Normal, + vec<3, T, Q> const& Up ) { if(all(equal(Normal, Up))) - return mat<4, 4, T, P>(T(1)); + return mat<4, 4, T, Q>(T(1)); - vec<3, T, P> RotationAxis = cross(Up, Normal); + vec<3, T, Q> RotationAxis = cross(Up, Normal); T Angle = acos(dot(Normal, Up)); return rotate(Angle, RotationAxis); diff --git a/glm/gtx/string_cast.inl b/glm/gtx/string_cast.inl index df867eb3..b376ce4e 100644 --- a/glm/gtx/string_cast.inl +++ b/glm/gtx/string_cast.inl @@ -141,20 +141,20 @@ namespace detail struct compute_to_string {}; - template - struct compute_to_string > + template + struct compute_to_string > { - GLM_FUNC_QUALIFIER static std::string call(vec<1, bool, P> const& x) + GLM_FUNC_QUALIFIER static std::string call(vec<1, bool, Q> const& x) { return detail::format("bvec1(%s)", x[0] ? detail::LabelTrue : detail::LabelFalse); } }; - template - struct compute_to_string > + template + struct compute_to_string > { - GLM_FUNC_QUALIFIER static std::string call(vec<2, bool, P> const& x) + GLM_FUNC_QUALIFIER static std::string call(vec<2, bool, Q> const& x) { return detail::format("bvec2(%s, %s)", x[0] ? detail::LabelTrue : detail::LabelFalse, @@ -162,10 +162,10 @@ namespace detail } }; - template - struct compute_to_string > + template + struct compute_to_string > { - GLM_FUNC_QUALIFIER static std::string call(vec<3, bool, P> const& x) + GLM_FUNC_QUALIFIER static std::string call(vec<3, bool, Q> const& x) { return detail::format("bvec3(%s, %s, %s)", x[0] ? detail::LabelTrue : detail::LabelFalse, @@ -174,10 +174,10 @@ namespace detail } }; - template - struct compute_to_string > + template + struct compute_to_string > { - GLM_FUNC_QUALIFIER static std::string call(vec<4, bool, P> const& x) + GLM_FUNC_QUALIFIER static std::string call(vec<4, bool, Q> const& x) { return detail::format("bvec4(%s, %s, %s, %s)", x[0] ? detail::LabelTrue : detail::LabelFalse, @@ -187,10 +187,10 @@ namespace detail } }; - template - struct compute_to_string > + template + struct compute_to_string > { - GLM_FUNC_QUALIFIER static std::string call(vec<1, T, P> const& x) + GLM_FUNC_QUALIFIER static std::string call(vec<1, T, Q> const& x) { char const * PrefixStr = prefix::value(); char const * LiteralStr = literal::is_iec559>::value(); @@ -203,10 +203,10 @@ namespace detail } }; - template - struct compute_to_string > + template + struct compute_to_string > { - GLM_FUNC_QUALIFIER static std::string call(vec<2, T, P> const& x) + GLM_FUNC_QUALIFIER static std::string call(vec<2, T, Q> const& x) { char const * PrefixStr = prefix::value(); char const * LiteralStr = literal::is_iec559>::value(); @@ -220,10 +220,10 @@ namespace detail } }; - template - struct compute_to_string > + template + struct compute_to_string > { - GLM_FUNC_QUALIFIER static std::string call(vec<3, T, P> const& x) + GLM_FUNC_QUALIFIER static std::string call(vec<3, T, Q> const& x) { char const * PrefixStr = prefix::value(); char const * LiteralStr = literal::is_iec559>::value(); @@ -238,10 +238,10 @@ namespace detail } }; - template - struct compute_to_string > + template + struct compute_to_string > { - GLM_FUNC_QUALIFIER static std::string call(vec<4, T, P> const& x) + GLM_FUNC_QUALIFIER static std::string call(vec<4, T, Q> const& x) { char const * PrefixStr = prefix::value(); char const * LiteralStr = literal::is_iec559>::value(); @@ -258,10 +258,10 @@ namespace detail }; - template - struct compute_to_string > + template + struct compute_to_string > { - GLM_FUNC_QUALIFIER static std::string call(mat<2, 2, T, P> const& x) + GLM_FUNC_QUALIFIER static std::string call(mat<2, 2, T, Q> const& x) { char const * PrefixStr = prefix::value(); char const * LiteralStr = literal::is_iec559>::value(); @@ -276,10 +276,10 @@ namespace detail } }; - template - struct compute_to_string > + template + struct compute_to_string > { - GLM_FUNC_QUALIFIER static std::string call(mat<2, 3, T, P> const& x) + GLM_FUNC_QUALIFIER static std::string call(mat<2, 3, T, Q> const& x) { char const * PrefixStr = prefix::value(); char const * LiteralStr = literal::is_iec559>::value(); @@ -294,10 +294,10 @@ namespace detail } }; - template - struct compute_to_string > + template + struct compute_to_string > { - GLM_FUNC_QUALIFIER static std::string call(mat<2, 4, T, P> const& x) + GLM_FUNC_QUALIFIER static std::string call(mat<2, 4, T, Q> const& x) { char const * PrefixStr = prefix::value(); char const * LiteralStr = literal::is_iec559>::value(); @@ -312,10 +312,10 @@ namespace detail } }; - template - struct compute_to_string > + template + struct compute_to_string > { - GLM_FUNC_QUALIFIER static std::string call(mat<3, 2, T, P> const& x) + GLM_FUNC_QUALIFIER static std::string call(mat<3, 2, T, Q> const& x) { char const * PrefixStr = prefix::value(); char const * LiteralStr = literal::is_iec559>::value(); @@ -332,10 +332,10 @@ namespace detail } }; - template - struct compute_to_string > + template + struct compute_to_string > { - GLM_FUNC_QUALIFIER static std::string call(mat<3, 3, T, P> const& x) + GLM_FUNC_QUALIFIER static std::string call(mat<3, 3, T, Q> const& x) { char const * PrefixStr = prefix::value(); char const * LiteralStr = literal::is_iec559>::value(); @@ -352,10 +352,10 @@ namespace detail } }; - template - struct compute_to_string > + template + struct compute_to_string > { - GLM_FUNC_QUALIFIER static std::string call(mat<3, 4, T, P> const& x) + GLM_FUNC_QUALIFIER static std::string call(mat<3, 4, T, Q> const& x) { char const * PrefixStr = prefix::value(); char const * LiteralStr = literal::is_iec559>::value(); @@ -372,10 +372,10 @@ namespace detail } }; - template - struct compute_to_string > + template + struct compute_to_string > { - GLM_FUNC_QUALIFIER static std::string call(mat<4, 2, T, P> const& x) + GLM_FUNC_QUALIFIER static std::string call(mat<4, 2, T, Q> const& x) { char const * PrefixStr = prefix::value(); char const * LiteralStr = literal::is_iec559>::value(); @@ -394,10 +394,10 @@ namespace detail } }; - template - struct compute_to_string > + template + struct compute_to_string > { - GLM_FUNC_QUALIFIER static std::string call(mat<4, 3, T, P> const& x) + GLM_FUNC_QUALIFIER static std::string call(mat<4, 3, T, Q> const& x) { char const * PrefixStr = prefix::value(); char const * LiteralStr = literal::is_iec559>::value(); @@ -416,10 +416,10 @@ namespace detail } }; - template - struct compute_to_string > + template + struct compute_to_string > { - GLM_FUNC_QUALIFIER static std::string call(mat<4, 4, T, P> const& x) + GLM_FUNC_QUALIFIER static std::string call(mat<4, 4, T, Q> const& x) { char const * PrefixStr = prefix::value(); char const * LiteralStr = literal::is_iec559>::value(); @@ -439,10 +439,10 @@ namespace detail }; - template - struct compute_to_string > + template + struct compute_to_string > { - GLM_FUNC_QUALIFIER static std::string call(tquat const& x) + GLM_FUNC_QUALIFIER static std::string call(tquat const& x) { char const * PrefixStr = prefix::value(); char const * LiteralStr = literal::is_iec559>::value(); @@ -458,10 +458,10 @@ namespace detail } }; - template - struct compute_to_string > + template + struct compute_to_string > { - GLM_FUNC_QUALIFIER static std::string call(tdualquat const& x) + GLM_FUNC_QUALIFIER static std::string call(tdualquat const& x) { char const * PrefixStr = prefix::value(); char const * LiteralStr = literal::is_iec559>::value(); diff --git a/glm/gtx/transform.hpp b/glm/gtx/transform.hpp index b765f236..dd314c2b 100644 --- a/glm/gtx/transform.hpp +++ b/glm/gtx/transform.hpp @@ -35,24 +35,24 @@ namespace glm /// Transforms a matrix with a translation 4 * 4 matrix created from 3 scalars. /// @see gtc_matrix_transform /// @see gtx_transform - template - GLM_FUNC_DECL mat<4, 4, T, P> translate( - vec<3, T, P> const& v); + template + GLM_FUNC_DECL mat<4, 4, T, Q> translate( + vec<3, T, Q> const& v); /// Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in radians. /// @see gtc_matrix_transform /// @see gtx_transform - template - GLM_FUNC_DECL mat<4, 4, T, P> rotate( + template + GLM_FUNC_DECL mat<4, 4, T, Q> rotate( T angle, - vec<3, T, P> const& v); + vec<3, T, Q> const& v); /// Transforms a matrix with a scale 4 * 4 matrix created from a vector of 3 components. /// @see gtc_matrix_transform /// @see gtx_transform - template - GLM_FUNC_DECL mat<4, 4, T, P> scale( - vec<3, T, P> const& v); + template + GLM_FUNC_DECL mat<4, 4, T, Q> scale( + vec<3, T, Q> const& v); /// @} }// namespace glm diff --git a/glm/gtx/transform.inl b/glm/gtx/transform.inl index ad027ffb..56bfc902 100644 --- a/glm/gtx/transform.inl +++ b/glm/gtx/transform.inl @@ -3,22 +3,22 @@ namespace glm { - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> translate(vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> translate(vec<3, T, Q> const& v) { - return translate(mat<4, 4, T, P>(static_cast(1)), v); + return translate(mat<4, 4, T, Q>(static_cast(1)), v); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> rotate(T angle, vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rotate(T angle, vec<3, T, Q> const& v) { - return rotate(mat<4, 4, T, P>(static_cast(1)), angle, v); + return rotate(mat<4, 4, T, Q>(static_cast(1)), angle, v); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> scale(vec<3, T, P> const& v) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scale(vec<3, T, Q> const& v) { - return scale(mat<4, 4, T, P>(static_cast(1)), v); + return scale(mat<4, 4, T, Q>(static_cast(1)), v); } }//namespace glm diff --git a/glm/gtx/transform2.hpp b/glm/gtx/transform2.hpp index e1be6c96..c7c447ca 100644 --- a/glm/gtx/transform2.hpp +++ b/glm/gtx/transform2.hpp @@ -32,78 +32,56 @@ namespace glm //! Transforms a matrix with a shearing on X axis. //! From GLM_GTX_transform2 extension. - template - GLM_FUNC_DECL mat<3, 3, T, P> shearX2D( - mat<3, 3, T, P> const& m, - T y); + template + GLM_FUNC_DECL mat<3, 3, T, Q> shearX2D(mat<3, 3, T, Q> const& m, T y); //! Transforms a matrix with a shearing on Y axis. //! From GLM_GTX_transform2 extension. - template - GLM_FUNC_DECL mat<3, 3, T, P> shearY2D( - mat<3, 3, T, P> const& m, - T x); + template + GLM_FUNC_DECL mat<3, 3, T, Q> shearY2D(mat<3, 3, T, Q> const& m, T x); //! Transforms a matrix with a shearing on X axis //! From GLM_GTX_transform2 extension. - template - GLM_FUNC_DECL mat<4, 4, T, P> shearX3D( - const mat<4, 4, T, P> & m, - T y, - T z); + template + GLM_FUNC_DECL mat<4, 4, T, Q> shearX3D(mat<4, 4, T, Q> const& m, T y, T z); //! Transforms a matrix with a shearing on Y axis. //! From GLM_GTX_transform2 extension. - template - GLM_FUNC_DECL mat<4, 4, T, P> shearY3D( - const mat<4, 4, T, P> & m, - T x, - T z); + template + GLM_FUNC_DECL mat<4, 4, T, Q> shearY3D(mat<4, 4, T, Q> const& m, T x, T z); //! Transforms a matrix with a shearing on Z axis. //! From GLM_GTX_transform2 extension. - template - GLM_FUNC_DECL mat<4, 4, T, P> shearZ3D( - const mat<4, 4, T, P> & m, - T x, - T y); + template + GLM_FUNC_DECL mat<4, 4, T, Q> shearZ3D(mat<4, 4, T, Q> const& m, T x, T y); - //template GLM_FUNC_QUALIFIER mat<4, 4, T, P> shear(const mat<4, 4, T, P> & m, shearPlane, planePoint, angle) + //template GLM_FUNC_QUALIFIER mat<4, 4, T, Q> shear(const mat<4, 4, T, Q> & m, shearPlane, planePoint, angle) // Identity + tan(angle) * cross(Normal, OnPlaneVector) 0 // - dot(PointOnPlane, normal) * OnPlaneVector 1 // Reflect functions seem to don't work - //template mat<3, 3, T, P> reflect2D(const mat<3, 3, T, P> & m, const vec<3, T, P>& normal){return reflect2DGTX(m, normal);} //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension) - //template mat<4, 4, T, P> reflect3D(const mat<4, 4, T, P> & m, const vec<3, T, P>& normal){return reflect3DGTX(m, normal);} //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension) + //template mat<3, 3, T, Q> reflect2D(const mat<3, 3, T, Q> & m, const vec<3, T, Q>& normal){return reflect2DGTX(m, normal);} //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension) + //template mat<4, 4, T, Q> reflect3D(const mat<4, 4, T, Q> & m, const vec<3, T, Q>& normal){return reflect3DGTX(m, normal);} //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension) //! Build planar projection matrix along normal axis. //! From GLM_GTX_transform2 extension. - template - GLM_FUNC_DECL mat<3, 3, T, P> proj2D( - const mat<3, 3, T, P> & m, - const vec<3, T, P>& normal); + template + GLM_FUNC_DECL mat<3, 3, T, Q> proj2D(mat<3, 3, T, Q> const& m, vec<3, T, Q> const& normal); //! Build planar projection matrix along normal axis. //! From GLM_GTX_transform2 extension. - template - GLM_FUNC_DECL mat<4, 4, T, P> proj3D( - const mat<4, 4, T, P> & m, - const vec<3, T, P>& normal); + template + GLM_FUNC_DECL mat<4, 4, T, Q> proj3D(mat<4, 4, T, Q> const & m, vec<3, T, Q> const& normal); //! Build a scale bias matrix. //! From GLM_GTX_transform2 extension. - template - GLM_FUNC_DECL mat<4, 4, valType, P> scaleBias( - valType scale, - valType bias); + template + GLM_FUNC_DECL mat<4, 4, T, Q> scaleBias(T scale, T bias); //! Build a scale bias matrix. //! From GLM_GTX_transform2 extension. - template - GLM_FUNC_DECL mat<4, 4, valType, P> scaleBias( - mat<4, 4, valType, P> const& m, - valType scale, - valType bias); + template + GLM_FUNC_DECL mat<4, 4, T, Q> scaleBias(mat<4, 4, T, Q> const& m, T scale, T bias); /// @} }// namespace glm diff --git a/glm/gtx/transform2.inl b/glm/gtx/transform2.inl index 4d71fa97..7125235f 100644 --- a/glm/gtx/transform2.inl +++ b/glm/gtx/transform2.inl @@ -3,53 +3,53 @@ namespace glm { - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> shearX2D(mat<3, 3, T, P> const& m, T s) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> shearX2D(mat<3, 3, T, Q> const& m, T s) { - mat<3, 3, T, P> r(1); + mat<3, 3, T, Q> r(1); r[1][0] = s; return m * r; } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> shearY2D(mat<3, 3, T, P> const& m, T s) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> shearY2D(mat<3, 3, T, Q> const& m, T s) { - mat<3, 3, T, P> r(1); + mat<3, 3, T, Q> r(1); r[0][1] = s; return m * r; } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> shearX3D(mat<4, 4, T, P> const& m, T s, T t) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> shearX3D(mat<4, 4, T, Q> const& m, T s, T t) { - mat<4, 4, T, P> r(1); + mat<4, 4, T, Q> r(1); r[0][1] = s; r[0][2] = t; return m * r; } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> shearY3D(mat<4, 4, T, P> const& m, T s, T t) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> shearY3D(mat<4, 4, T, Q> const& m, T s, T t) { - mat<4, 4, T, P> r(1); + mat<4, 4, T, Q> r(1); r[1][0] = s; r[1][2] = t; return m * r; } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> shearZ3D(mat<4, 4, T, P> const& m, T s, T t) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> shearZ3D(mat<4, 4, T, Q> const& m, T s, T t) { - mat<4, 4, T, P> r(1); + mat<4, 4, T, Q> r(1); r[2][0] = s; r[2][1] = t; return m * r; } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> reflect2D(mat<3, 3, T, P> const& m, vec<3, T, P> const& normal) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> reflect2D(mat<3, 3, T, Q> const& m, vec<3, T, Q> const& normal) { - mat<3, 3, T, P> r(static_cast(1)); + mat<3, 3, T, Q> r(static_cast(1)); r[0][0] = static_cast(1) - static_cast(2) * normal.x * normal.x; r[0][1] = -static_cast(2) * normal.x * normal.y; r[1][0] = -static_cast(2) * normal.x * normal.y; @@ -57,10 +57,10 @@ namespace glm return m * r; } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> reflect3D(mat<4, 4, T, P> const& m, vec<3, T, P> const& normal) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> reflect3D(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& normal) { - mat<4, 4, T, P> r(static_cast(1)); + mat<4, 4, T, Q> r(static_cast(1)); r[0][0] = static_cast(1) - static_cast(2) * normal.x * normal.x; r[0][1] = -static_cast(2) * normal.x * normal.y; r[0][2] = -static_cast(2) * normal.x * normal.z; @@ -75,12 +75,12 @@ namespace glm return m * r; } - template - GLM_FUNC_QUALIFIER mat<3, 3, T, P> proj2D( - const mat<3, 3, T, P>& m, - const vec<3, T, P>& normal) + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> proj2D( + const mat<3, 3, T, Q>& m, + const vec<3, T, Q>& normal) { - mat<3, 3, T, P> r(static_cast(1)); + mat<3, 3, T, Q> r(static_cast(1)); r[0][0] = static_cast(1) - normal.x * normal.x; r[0][1] = - normal.x * normal.y; r[1][0] = - normal.x * normal.y; @@ -88,12 +88,12 @@ namespace glm return m * r; } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> proj3D( - const mat<4, 4, T, P>& m, - const vec<3, T, P>& normal) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> proj3D( + const mat<4, 4, T, Q>& m, + const vec<3, T, Q>& normal) { - mat<4, 4, T, P> r(static_cast(1)); + mat<4, 4, T, Q> r(static_cast(1)); r[0][0] = static_cast(1) - normal.x * normal.x; r[0][1] = - normal.x * normal.y; r[0][2] = - normal.x * normal.z; @@ -106,19 +106,19 @@ namespace glm return m * r; } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> scaleBias(T scale, T bias) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scaleBias(T scale, T bias) { - mat<4, 4, T, P> result; - result[3] = vec<4, T, P>(vec<3, T, P>(bias), static_cast(1)); + mat<4, 4, T, Q> result; + result[3] = vec<4, T, Q>(vec<3, T, Q>(bias), static_cast(1)); result[0][0] = scale; result[1][1] = scale; result[2][2] = scale; return result; } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, P> scaleBias(mat<4, 4, T, P> const& m, T scale, T bias) + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scaleBias(mat<4, 4, T, Q> const& m, T scale, T bias) { return m * scaleBias(scale, bias); } diff --git a/glm/gtx/type_trait.hpp b/glm/gtx/type_trait.hpp index 0433dfb1..1bb77992 100644 --- a/glm/gtx/type_trait.hpp +++ b/glm/gtx/type_trait.hpp @@ -52,8 +52,8 @@ namespace glm static length_t const rows = 0; }; - template - struct type > + template + struct type > { static bool const is_vec = true; static bool const is_mat = false; @@ -64,8 +64,8 @@ namespace glm }; }; - template - struct type > + template + struct type > { static bool const is_vec = false; static bool const is_mat = true; @@ -78,8 +78,8 @@ namespace glm }; }; - template - struct type > + template + struct type > { static bool const is_vec = false; static bool const is_mat = true; @@ -92,8 +92,8 @@ namespace glm }; }; - template - struct type > + template + struct type > { static bool const is_vec = false; static bool const is_mat = true; @@ -106,8 +106,8 @@ namespace glm }; }; - template - struct type > + template + struct type > { static bool const is_vec = false; static bool const is_mat = true; @@ -120,8 +120,8 @@ namespace glm }; }; - template - struct type > + template + struct type > { static bool const is_vec = false; static bool const is_mat = true; @@ -134,8 +134,8 @@ namespace glm }; }; - template - struct type > + template + struct type > { static bool const is_vec = false; static bool const is_mat = true; @@ -148,8 +148,8 @@ namespace glm }; }; - template - struct type > + template + struct type > { static bool const is_vec = false; static bool const is_mat = true; @@ -162,8 +162,8 @@ namespace glm }; }; - template - struct type > + template + struct type > { static bool const is_vec = false; static bool const is_mat = true; @@ -176,8 +176,8 @@ namespace glm }; }; - template - struct type > + template + struct type > { static bool const is_vec = false; static bool const is_mat = true; @@ -190,8 +190,8 @@ namespace glm }; }; - template - struct type > + template + struct type > { static bool const is_vec = false; static bool const is_mat = false; @@ -202,8 +202,8 @@ namespace glm }; }; - template - struct type > + template + struct type > { static bool const is_vec = false; static bool const is_mat = false; diff --git a/glm/gtx/vec_swizzle.hpp b/glm/gtx/vec_swizzle.hpp index f5f17aab..7a2f4046 100644 --- a/glm/gtx/vec_swizzle.hpp +++ b/glm/gtx/vec_swizzle.hpp @@ -20,2759 +20,2759 @@ namespace glm { // xx - template - GLM_INLINE glm::vec<2, T, P> xx(const glm::vec<1, T, P> &v) { - return glm::vec<2, T, P>(v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> xx(const glm::vec<2, T, P> &v) { - return glm::vec<2, T, P>(v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> xx(const glm::vec<3, T, P> &v) { - return glm::vec<2, T, P>(v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> xx(const glm::vec<4, T, P> &v) { - return glm::vec<2, T, P>(v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> xy(const glm::vec<2, T, P> &v) { - return glm::vec<2, T, P>(v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> xy(const glm::vec<3, T, P> &v) { - return glm::vec<2, T, P>(v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> xy(const glm::vec<4, T, P> &v) { - return glm::vec<2, T, P>(v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> xz(const glm::vec<3, T, P> &v) { - return glm::vec<2, T, P>(v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> xz(const glm::vec<4, T, P> &v) { - return glm::vec<2, T, P>(v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> xw(const glm::vec<4, T, P> &v) { - return glm::vec<2, T, P>(v.x, v.w); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> yx(const glm::vec<2, T, P> &v) { - return glm::vec<2, T, P>(v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> yx(const glm::vec<3, T, P> &v) { - return glm::vec<2, T, P>(v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> yx(const glm::vec<4, T, P> &v) { - return glm::vec<2, T, P>(v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> yy(const glm::vec<2, T, P> &v) { - return glm::vec<2, T, P>(v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> yy(const glm::vec<3, T, P> &v) { - return glm::vec<2, T, P>(v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> yy(const glm::vec<4, T, P> &v) { - return glm::vec<2, T, P>(v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> yz(const glm::vec<3, T, P> &v) { - return glm::vec<2, T, P>(v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> yz(const glm::vec<4, T, P> &v) { - return glm::vec<2, T, P>(v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> yw(const glm::vec<4, T, P> &v) { - return glm::vec<2, T, P>(v.y, v.w); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> zx(const glm::vec<3, T, P> &v) { - return glm::vec<2, T, P>(v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> zx(const glm::vec<4, T, P> &v) { - return glm::vec<2, T, P>(v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> zy(const glm::vec<3, T, P> &v) { - return glm::vec<2, T, P>(v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> zy(const glm::vec<4, T, P> &v) { - return glm::vec<2, T, P>(v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> zz(const glm::vec<3, T, P> &v) { - return glm::vec<2, T, P>(v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> zz(const glm::vec<4, T, P> &v) { - return glm::vec<2, T, P>(v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> zw(const glm::vec<4, T, P> &v) { - return glm::vec<2, T, P>(v.z, v.w); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> wx(const glm::vec<4, T, P> &v) { - return glm::vec<2, T, P>(v.w, v.x); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> wy(const glm::vec<4, T, P> &v) { - return glm::vec<2, T, P>(v.w, v.y); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> wz(const glm::vec<4, T, P> &v) { - return glm::vec<2, T, P>(v.w, v.z); + template + GLM_INLINE 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_INLINE glm::vec<2, T, P> ww(const glm::vec<4, T, P> &v) { - return glm::vec<2, T, P>(v.w, v.w); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xxx(const glm::vec<1, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xxx(const glm::vec<2, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xxx(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xxx(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xxy(const glm::vec<2, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xxy(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xxy(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xxz(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xxz(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xxw(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.x, v.w); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xyx(const glm::vec<2, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xyx(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xyx(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xyy(const glm::vec<2, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xyy(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xyy(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xyz(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.y, v.z); + template + GLM_INLINE 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); } - template - GLM_INLINE glm::vec<3, T, P> xyz(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.y, v.z); + template + GLM_INLINE glm::vec<3, T, Q> xyz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.y, v.z); } // xyw - template - GLM_INLINE glm::vec<3, T, P> xyw(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.y, v.w); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xzx(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xzx(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xzy(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xzy(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xzz(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xzz(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xzw(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.z, v.w); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xwx(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.w, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xwy(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.w, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xwz(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.w, v.z); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> xww(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.x, v.w, v.w); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> yxx(const glm::vec<2, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> yxx(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> yxx(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> yxy(const glm::vec<2, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> yxy(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> yxy(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> yxz(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> yxz(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> yxw(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.x, v.w); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> yyx(const glm::vec<2, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> yyx(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> yyx(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> yyy(const glm::vec<2, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> yyy(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> yyy(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> yyz(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> yyz(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> yyw(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.y, v.w); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> yzx(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> yzx(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> yzy(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> yzy(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> yzz(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> yzz(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> yzw(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.z, v.w); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> ywx(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.w, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> ywy(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.w, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> ywz(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.w, v.z); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> yww(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.y, v.w, v.w); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> zxx(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.z, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> zxx(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.z, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> zxy(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.z, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> zxy(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.z, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> zxz(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.z, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> zxz(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.z, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> zxw(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.z, v.x, v.w); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> zyx(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.z, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> zyx(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.z, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> zyy(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.z, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> zyy(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.z, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> zyz(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.z, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> zyz(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.z, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> zyw(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.z, v.y, v.w); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> zzx(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.z, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> zzx(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.z, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> zzy(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.z, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> zzy(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.z, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> zzz(const glm::vec<3, T, P> &v) { - return glm::vec<3, T, P>(v.z, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> zzz(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.z, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> zzw(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.z, v.z, v.w); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> zwx(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.z, v.w, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> zwy(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.z, v.w, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> zwz(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.z, v.w, v.z); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> zww(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.z, v.w, v.w); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> wxx(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.w, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> wxy(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.w, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> wxz(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.w, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> wxw(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.w, v.x, v.w); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> wyx(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.w, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> wyy(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.w, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> wyz(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.w, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> wyw(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.w, v.y, v.w); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> wzx(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.w, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> wzy(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.w, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> wzz(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.w, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> wzw(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.w, v.z, v.w); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> wwx(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.w, v.w, v.x); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> wwy(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.w, v.w, v.y); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> wwz(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.w, v.w, v.z); + template + GLM_INLINE 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_INLINE glm::vec<3, T, P> www(const glm::vec<4, T, P> &v) { - return glm::vec<3, T, P>(v.w, v.w, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxxx(const glm::vec<1, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxxx(const glm::vec<2, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxxx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxxx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxxy(const glm::vec<2, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxxy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxxy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxxz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxxz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxxw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.x, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxyx(const glm::vec<2, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxyx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxyx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxyy(const glm::vec<2, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxyy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxyy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxyz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxyz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxyw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.y, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxzx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxzx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxzy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxzy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxzz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxzz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxzw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.z, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxwx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.w, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxwy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.w, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxwz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.w, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xxww(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.x, v.w, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xyxx(const glm::vec<2, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xyxx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xyxx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xyxy(const glm::vec<2, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xyxy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xyxy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xyxz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xyxz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xyxw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.x, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xyyx(const glm::vec<2, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xyyx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xyyx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xyyy(const glm::vec<2, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xyyy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xyyy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xyyz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xyyz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xyyw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.y, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xyzx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xyzx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xyzy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xyzy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.z, v.y); + template + GLM_INLINE 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); } // xyzz - template - GLM_INLINE glm::vec<4, T, P> xyzz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.z, v.z); + template + GLM_INLINE glm::vec<4, T, Q> xyzz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.z, v.z); } - template - GLM_INLINE glm::vec<4, T, P> xyzz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.z, v.z); + template + GLM_INLINE glm::vec<4, T, Q> xyzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.z, v.z); } // xyzw - template - GLM_INLINE glm::vec<4, T, P> xyzw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.z, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xywx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.w, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xywy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.w, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xywz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.w, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xyww(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.y, v.w, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xzxx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.z, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xzxx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.z, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xzxy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.z, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xzxy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.z, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xzxz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.z, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xzxz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.z, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xzxw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.z, v.x, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xzyx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.z, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xzyx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.z, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xzyy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.z, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xzyy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.z, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xzyz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.z, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xzyz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.z, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xzyw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.z, v.y, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xzzx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.z, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xzzx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.z, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xzzy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.z, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xzzy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.z, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xzzz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.z, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xzzz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.z, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xzzw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.z, v.z, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xzwx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.z, v.w, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xzwy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.z, v.w, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xzwz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.z, v.w, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xzww(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.z, v.w, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xwxx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.w, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xwxy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.w, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xwxz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.w, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xwxw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.w, v.x, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xwyx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.w, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xwyy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.w, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xwyz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.w, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xwyw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.w, v.y, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xwzx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.w, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xwzy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.w, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xwzz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.w, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xwzw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.w, v.z, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xwwx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.w, v.w, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xwwy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.w, v.w, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xwwz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.w, v.w, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> xwww(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.x, v.w, v.w, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxxx(const glm::vec<2, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxxx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxxx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxxy(const glm::vec<2, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxxy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxxy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxxz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxxz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxxw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.x, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxyx(const glm::vec<2, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxyx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxyx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxyy(const glm::vec<2, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxyy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxyy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxyz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxyz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxyw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.y, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxzx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxzx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxzy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxzy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxzz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxzz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxzw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.z, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxwx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.w, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxwy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.w, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxwz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.w, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yxww(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.x, v.w, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yyxx(const glm::vec<2, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yyxx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yyxx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yyxy(const glm::vec<2, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yyxy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yyxy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yyxz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yyxz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yyxw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.x, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yyyx(const glm::vec<2, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yyyx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yyyx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yyyy(const glm::vec<2, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yyyy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yyyy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yyyz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yyyz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yyyw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.y, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yyzx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yyzx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yyzy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yyzy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yyzz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yyzz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yyzw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.z, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yywx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.w, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yywy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.w, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yywz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.w, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yyww(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.y, v.w, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yzxx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.z, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yzxx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.z, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yzxy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.z, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yzxy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.z, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yzxz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.z, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yzxz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.z, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yzxw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.z, v.x, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yzyx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.z, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yzyx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.z, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yzyy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.z, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yzyy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.z, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yzyz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.z, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yzyz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.z, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yzyw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.z, v.y, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yzzx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.z, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yzzx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.z, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yzzy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.z, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yzzy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.z, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yzzz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.z, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yzzz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.z, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yzzw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.z, v.z, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yzwx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.z, v.w, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yzwy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.z, v.w, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yzwz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.z, v.w, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> yzww(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.z, v.w, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> ywxx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.w, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> ywxy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.w, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> ywxz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.w, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> ywxw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.w, v.x, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> ywyx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.w, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> ywyy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.w, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> ywyz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.w, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> ywyw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.w, v.y, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> ywzx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.w, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> ywzy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.w, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> ywzz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.w, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> ywzw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.w, v.z, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> ywwx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.w, v.w, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> ywwy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.w, v.w, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> ywwz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.w, v.w, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> ywww(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.y, v.w, v.w, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zxxx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.x, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zxxx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.x, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zxxy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.x, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zxxy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.x, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zxxz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.x, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zxxz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.x, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zxxw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.x, v.x, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zxyx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.x, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zxyx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.x, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zxyy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.x, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zxyy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.x, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zxyz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.x, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zxyz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.x, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zxyw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.x, v.y, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zxzx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.x, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zxzx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.x, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zxzy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.x, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zxzy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.x, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zxzz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.x, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zxzz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.x, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zxzw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.x, v.z, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zxwx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.x, v.w, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zxwy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.x, v.w, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zxwz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.x, v.w, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zxww(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.x, v.w, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zyxx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.y, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zyxx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.y, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zyxy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.y, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zyxy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.y, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zyxz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.y, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zyxz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.y, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zyxw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.y, v.x, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zyyx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.y, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zyyx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.y, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zyyy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.y, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zyyy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.y, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zyyz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.y, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zyyz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.y, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zyyw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.y, v.y, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zyzx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.y, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zyzx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.y, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zyzy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.y, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zyzy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.y, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zyzz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.y, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zyzz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.y, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zyzw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.y, v.z, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zywx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.y, v.w, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zywy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.y, v.w, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zywz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.y, v.w, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zyww(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.y, v.w, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zzxx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.z, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zzxx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.z, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zzxy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.z, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zzxy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.z, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zzxz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.z, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zzxz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.z, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zzxw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.z, v.x, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zzyx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.z, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zzyx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.z, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zzyy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.z, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zzyy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.z, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zzyz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.z, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zzyz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.z, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zzyw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.z, v.y, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zzzx(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.z, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zzzx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.z, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zzzy(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.z, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zzzy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.z, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zzzz(const glm::vec<3, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.z, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zzzz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.z, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zzzw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.z, v.z, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zzwx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.z, v.w, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zzwy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.z, v.w, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zzwz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.z, v.w, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zzww(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.z, v.w, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zwxx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.w, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zwxy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.w, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zwxz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.w, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zwxw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.w, v.x, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zwyx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.w, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zwyy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.w, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zwyz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.w, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zwyw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.w, v.y, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zwzx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.w, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zwzy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.w, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zwzz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.w, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zwzw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.w, v.z, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zwwx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.w, v.w, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zwwy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.w, v.w, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zwwz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.w, v.w, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> zwww(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.z, v.w, v.w, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wxxx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.x, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wxxy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.x, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wxxz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.x, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wxxw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.x, v.x, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wxyx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.x, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wxyy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.x, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wxyz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.x, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wxyw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.x, v.y, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wxzx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.x, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wxzy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.x, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wxzz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.x, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wxzw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.x, v.z, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wxwx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.x, v.w, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wxwy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.x, v.w, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wxwz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.x, v.w, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wxww(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.x, v.w, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wyxx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.y, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wyxy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.y, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wyxz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.y, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wyxw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.y, v.x, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wyyx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.y, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wyyy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.y, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wyyz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.y, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wyyw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.y, v.y, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wyzx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.y, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wyzy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.y, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wyzz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.y, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wyzw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.y, v.z, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wywx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.y, v.w, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wywy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.y, v.w, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wywz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.y, v.w, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wyww(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.y, v.w, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wzxx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.z, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wzxy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.z, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wzxz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.z, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wzxw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.z, v.x, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wzyx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.z, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wzyy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.z, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wzyz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.z, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wzyw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.z, v.y, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wzzx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.z, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wzzy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.z, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wzzz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.z, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wzzw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.z, v.z, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wzwx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.z, v.w, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wzwy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.z, v.w, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wzwz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.z, v.w, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wzww(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.z, v.w, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wwxx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.w, v.x, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wwxy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.w, v.x, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wwxz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.w, v.x, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wwxw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.w, v.x, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wwyx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.w, v.y, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wwyy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.w, v.y, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wwyz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.w, v.y, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wwyw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.w, v.y, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wwzx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.w, v.z, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wwzy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.w, v.z, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wwzz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.w, v.z, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wwzw(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.w, v.z, v.w); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wwwx(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.w, v.w, v.x); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wwwy(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.w, v.w, v.y); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wwwz(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.w, v.w, v.z); + template + GLM_INLINE 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_INLINE glm::vec<4, T, P> wwww(const glm::vec<4, T, P> &v) { - return glm::vec<4, T, P>(v.w, v.w, v.w, v.w); + template + GLM_INLINE 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); } } diff --git a/glm/gtx/vector_angle.hpp b/glm/gtx/vector_angle.hpp index 1ac93015..47f2f13f 100644 --- a/glm/gtx/vector_angle.hpp +++ b/glm/gtx/vector_angle.hpp @@ -36,20 +36,20 @@ namespace glm //! Returns the absolute angle between two vectors. //! Parameters need to be normalized. /// @see gtx_vector_angle extension. - template - GLM_FUNC_DECL T angle(vec const& x, vec const& y); + template + GLM_FUNC_DECL T angle(vec const& x, vec const& y); //! Returns the oriented angle between two 2d vectors. //! Parameters need to be normalized. /// @see gtx_vector_angle extension. - template - GLM_FUNC_DECL T orientedAngle(vec<2, T, P> const& x, vec<2, T, P> const& y); + template + GLM_FUNC_DECL T orientedAngle(vec<2, T, Q> const& x, vec<2, T, Q> const& y); //! Returns the oriented angle between two 3d vectors based from a reference axis. //! Parameters need to be normalized. /// @see gtx_vector_angle extension. - template - GLM_FUNC_DECL T orientedAngle(vec<3, T, P> const& x, vec<3, T, P> const& y, vec<3, T, P> const& ref); + template + GLM_FUNC_DECL T orientedAngle(vec<3, T, Q> const& x, vec<3, T, Q> const& y, vec<3, T, Q> const& ref); /// @} }// namespace glm diff --git a/glm/gtx/vector_angle.inl b/glm/gtx/vector_angle.inl index 6d6ce66d..b0eac86e 100644 --- a/glm/gtx/vector_angle.inl +++ b/glm/gtx/vector_angle.inl @@ -14,16 +14,16 @@ namespace glm return acos(clamp(dot(x, y), genType(-1), genType(1))); } - template - GLM_FUNC_QUALIFIER T angle(vec const& x, vec const& y) + template + GLM_FUNC_QUALIFIER T angle(vec const& x, vec const& y) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'angle' only accept floating-point inputs"); return acos(clamp(dot(x, y), T(-1), T(1))); } //! \todo epsilon is hard coded to 0.01 - template - GLM_FUNC_QUALIFIER T orientedAngle(vec<2, T, P> const& x, vec<2, T, P> const& y) + template + GLM_FUNC_QUALIFIER T orientedAngle(vec<2, T, Q> const& x, vec<2, T, Q> const& y) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'orientedAngle' only accept floating-point inputs"); T const Angle(acos(clamp(dot(x, y), T(-1), T(1)))); @@ -34,8 +34,8 @@ namespace glm return -Angle; } - template - GLM_FUNC_QUALIFIER T orientedAngle(vec<3, T, P> const& x, vec<3, T, P> const& y, vec<3, T, P> const& ref) + template + GLM_FUNC_QUALIFIER T orientedAngle(vec<3, T, Q> const& x, vec<3, T, Q> const& y, vec<3, T, Q> const& ref) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'orientedAngle' only accept floating-point inputs"); diff --git a/glm/gtx/vector_query.hpp b/glm/gtx/vector_query.hpp index 0cad1b4c..93579109 100644 --- a/glm/gtx/vector_query.hpp +++ b/glm/gtx/vector_query.hpp @@ -32,33 +32,33 @@ namespace glm //! Check whether two vectors are collinears. /// @see gtx_vector_query extensions. - template - GLM_FUNC_DECL bool areCollinear(vec const& v0, vec const& v1, T const& epsilon); + template + GLM_FUNC_DECL bool areCollinear(vec const& v0, vec const& v1, T const& epsilon); //! Check whether two vectors are orthogonals. /// @see gtx_vector_query extensions. - template - GLM_FUNC_DECL bool areOrthogonal(vec const& v0, vec const& v1, T const& epsilon); + template + GLM_FUNC_DECL bool areOrthogonal(vec const& v0, vec const& v1, T const& epsilon); //! Check whether a vector is normalized. /// @see gtx_vector_query extensions. - template - GLM_FUNC_DECL bool isNormalized(vec const& v, T const& epsilon); + template + GLM_FUNC_DECL bool isNormalized(vec const& v, T const& epsilon); //! Check whether a vector is null. /// @see gtx_vector_query extensions. - template - GLM_FUNC_DECL bool isNull(vec const& v, T const& epsilon); + template + GLM_FUNC_DECL bool isNull(vec const& v, T const& epsilon); //! Check whether a each component of a vector is null. /// @see gtx_vector_query extensions. - template - GLM_FUNC_DECL vec isCompNull(vec const& v, T const& epsilon); + template + GLM_FUNC_DECL vec isCompNull(vec const& v, T const& epsilon); //! Check whether two vectors are orthonormal. /// @see gtx_vector_query extensions. - template - GLM_FUNC_DECL bool areOrthonormal(vec const& v0, vec const& v1, T const& epsilon); + template + GLM_FUNC_DECL bool areOrthonormal(vec const& v0, vec const& v1, T const& epsilon); /// @} }// namespace glm diff --git a/glm/gtx/vector_query.inl b/glm/gtx/vector_query.inl index 5439f2d9..0d8cddcf 100644 --- a/glm/gtx/vector_query.inl +++ b/glm/gtx/vector_query.inl @@ -6,68 +6,68 @@ namespace glm{ namespace detail { - template + template struct compute_areCollinear{}; - template - struct compute_areCollinear<2, T, P> + template + struct compute_areCollinear<2, T, Q> { - GLM_FUNC_QUALIFIER static bool call(vec<2, T, P> const& v0, vec<2, T, P> const& v1, T const& epsilon) + GLM_FUNC_QUALIFIER static bool call(vec<2, T, Q> const& v0, vec<2, T, Q> const& v1, T const& epsilon) { - return length(cross(vec<3, T, P>(v0, static_cast(0)), vec<3, T, P>(v1, static_cast(0)))) < epsilon; + return length(cross(vec<3, T, Q>(v0, static_cast(0)), vec<3, T, Q>(v1, static_cast(0)))) < epsilon; } }; - template - struct compute_areCollinear<3, T, P> + template + struct compute_areCollinear<3, T, Q> { - GLM_FUNC_QUALIFIER static bool call(vec<3, T, P> const& v0, vec<3, T, P> const& v1, T const& epsilon) + GLM_FUNC_QUALIFIER static bool call(vec<3, T, Q> const& v0, vec<3, T, Q> const& v1, T const& epsilon) { return length(cross(v0, v1)) < epsilon; } }; - template - struct compute_areCollinear<4, T, P> + template + struct compute_areCollinear<4, T, Q> { - GLM_FUNC_QUALIFIER static bool call(vec<4, T, P> const& v0, vec<4, T, P> const& v1, T const& epsilon) + GLM_FUNC_QUALIFIER static bool call(vec<4, T, Q> const& v0, vec<4, T, Q> const& v1, T const& epsilon) { - return length(cross(vec<3, T, P>(v0), vec<3, T, P>(v1))) < epsilon; + return length(cross(vec<3, T, Q>(v0), vec<3, T, Q>(v1))) < epsilon; } }; - template + template struct compute_isCompNull{}; - template - struct compute_isCompNull<2, T, P> + template + struct compute_isCompNull<2, T, Q> { - GLM_FUNC_QUALIFIER static vec<2, bool, P> call(vec<2, T, P> const& v, T const& epsilon) + GLM_FUNC_QUALIFIER static vec<2, bool, Q> call(vec<2, T, Q> const& v, T const& epsilon) { - return vec<2, bool, P>( + return vec<2, bool, Q>( (abs(v.x) < epsilon), (abs(v.y) < epsilon)); } }; - template - struct compute_isCompNull<3, T, P> + template + struct compute_isCompNull<3, T, Q> { - GLM_FUNC_QUALIFIER static vec<3, bool, P> call(vec<3, T, P> const& v, T const& epsilon) + GLM_FUNC_QUALIFIER static vec<3, bool, Q> call(vec<3, T, Q> const& v, T const& epsilon) { - return vec<3, bool, P>( + return vec<3, bool, Q>( (abs(v.x) < epsilon), (abs(v.y) < epsilon), (abs(v.z) < epsilon)); } }; - template - struct compute_isCompNull<4, T, P> + template + struct compute_isCompNull<4, T, Q> { - GLM_FUNC_QUALIFIER static vec<4, bool, P> call(vec<4, T, P> const& v, T const& epsilon) + GLM_FUNC_QUALIFIER static vec<4, bool, Q> call(vec<4, T, Q> const& v, T const& epsilon) { - return vec<4, bool, P>( + return vec<4, bool, Q>( (abs(v.x) < epsilon), (abs(v.y) < epsilon), (abs(v.z) < epsilon), @@ -77,16 +77,16 @@ namespace detail }//namespace detail - template - GLM_FUNC_QUALIFIER bool areCollinear(vec const& v0, vec const& v1, T const& epsilon) + template + GLM_FUNC_QUALIFIER bool areCollinear(vec const& v0, vec const& v1, T const& epsilon) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'areCollinear' only accept floating-point inputs"); - return detail::compute_areCollinear::call(v0, v1, epsilon); + return detail::compute_areCollinear::call(v0, v1, epsilon); } - template - GLM_FUNC_QUALIFIER bool areOrthogonal(vec const& v0, vec const& v1, T const& epsilon) + template + GLM_FUNC_QUALIFIER bool areOrthogonal(vec const& v0, vec const& v1, T const& epsilon) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'areOrthogonal' only accept floating-point inputs"); @@ -95,59 +95,59 @@ namespace detail length(v0)) * max(static_cast(1), length(v1)) * epsilon; } - template - GLM_FUNC_QUALIFIER bool isNormalized(vec const& v, T const& epsilon) + template + GLM_FUNC_QUALIFIER bool isNormalized(vec const& v, T const& epsilon) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isNormalized' only accept floating-point inputs"); return abs(length(v) - static_cast(1)) <= static_cast(2) * epsilon; } - template - GLM_FUNC_QUALIFIER bool isNull(vec const& v, T const& epsilon) + template + GLM_FUNC_QUALIFIER bool isNull(vec const& v, T const& epsilon) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isNull' only accept floating-point inputs"); return length(v) <= epsilon; } - template - GLM_FUNC_QUALIFIER vec isCompNull(vec const& v, T const& epsilon) + template + GLM_FUNC_QUALIFIER vec isCompNull(vec const& v, T const& epsilon) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isCompNull' only accept floating-point inputs"); - return detail::compute_isCompNull::call(v, epsilon); + return detail::compute_isCompNull::call(v, epsilon); } - template - GLM_FUNC_QUALIFIER vec<2, bool, P> isCompNull(vec<2, T, P> const& v, T const& epsilon) + template + GLM_FUNC_QUALIFIER vec<2, bool, Q> isCompNull(vec<2, T, Q> const& v, T const& epsilon) { - return vec<2, bool, P>( + return vec<2, bool, Q>( abs(v.x) < epsilon, abs(v.y) < epsilon); } - template - GLM_FUNC_QUALIFIER vec<3, bool, P> isCompNull(vec<3, T, P> const& v, T const& epsilon) + template + GLM_FUNC_QUALIFIER vec<3, bool, Q> isCompNull(vec<3, T, Q> const& v, T const& epsilon) { - return vec<3, bool, P>( + return vec<3, bool, Q>( abs(v.x) < epsilon, abs(v.y) < epsilon, abs(v.z) < epsilon); } - template - GLM_FUNC_QUALIFIER vec<4, bool, P> isCompNull(vec<4, T, P> const& v, T const& epsilon) + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> isCompNull(vec<4, T, Q> const& v, T const& epsilon) { - return vec<4, bool, P>( + return vec<4, bool, Q>( abs(v.x) < epsilon, abs(v.y) < epsilon, abs(v.z) < epsilon, abs(v.w) < epsilon); } - template - GLM_FUNC_QUALIFIER bool areOrthonormal(vec const& v0, vec const& v1, T const& epsilon) + template + GLM_FUNC_QUALIFIER bool areOrthonormal(vec const& v0, vec const& v1, T const& epsilon) { return isNormalized(v0, epsilon) && isNormalized(v1, epsilon) && (abs(dot(v0, v1)) <= epsilon); } diff --git a/glm/gtx/wrap.inl b/glm/gtx/wrap.inl index cdbfc63e..83e350f1 100644 --- a/glm/gtx/wrap.inl +++ b/glm/gtx/wrap.inl @@ -3,10 +3,10 @@ namespace glm { - template - GLM_FUNC_QUALIFIER vec clamp(vec const& Texcoord) + template + GLM_FUNC_QUALIFIER vec clamp(vec const& Texcoord) { - return glm::clamp(Texcoord, vec(0), vec(1)); + return glm::clamp(Texcoord, vec(0), vec(1)); } template @@ -15,8 +15,8 @@ namespace glm return clamp(vec<1, genType, defaultp>(Texcoord)).x; } - template - GLM_FUNC_QUALIFIER vec repeat(vec const& Texcoord) + template + GLM_FUNC_QUALIFIER vec repeat(vec const& Texcoord) { return glm::fract(Texcoord); } @@ -27,8 +27,8 @@ namespace glm return repeat(vec<1, genType, defaultp>(Texcoord)).x; } - template - GLM_FUNC_QUALIFIER vec mirrorClamp(vec const& Texcoord) + template + GLM_FUNC_QUALIFIER vec mirrorClamp(vec const& Texcoord) { return glm::fract(glm::abs(Texcoord)); } @@ -39,15 +39,15 @@ namespace glm return mirrorClamp(vec<1, genType, defaultp>(Texcoord)).x; } - template - GLM_FUNC_QUALIFIER vec mirrorRepeat(vec const& Texcoord) + template + GLM_FUNC_QUALIFIER vec mirrorRepeat(vec const& Texcoord) { - vec const Abs = glm::abs(Texcoord); - vec const Clamp = glm::mod(glm::floor(Abs), vec(2)); - vec const Floor = glm::floor(Abs); - vec const Rest = Abs - Floor; - vec const Mirror = Clamp + Rest; - return mix(Rest, vec(1) - Rest, glm::greaterThanEqual(Mirror, vec(1))); + vec const Abs = glm::abs(Texcoord); + vec const Clamp = glm::mod(glm::floor(Abs), vec(2)); + vec const Floor = glm::floor(Abs); + vec const Rest = Abs - Floor; + vec const Mirror = Clamp + Rest; + return mix(Rest, vec(1) - Rest, glm::greaterThanEqual(Mirror, vec(1))); } template diff --git a/glm/simd/matrix.h b/glm/simd/matrix.h index f1602dc2..4e3c9a2a 100644 --- a/glm/simd/matrix.h +++ b/glm/simd/matrix.h @@ -410,7 +410,7 @@ GLM_FUNC_QUALIFIER glm_vec4 glm_mat4_determinant_lowp(glm_vec4 const m[4]) __m128 MulC = _mm_mul_ps(Swp2C, Swp3C); __m128 SubF = _mm_sub_ps(_mm_movehl_ps(MulC, MulC), MulC); - //vec<4, T, P> DetCof( + //vec<4, T, Q> DetCof( // + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02), // - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04), // + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05), @@ -473,7 +473,7 @@ GLM_FUNC_QUALIFIER glm_vec4 glm_mat4_determinant(glm_vec4 const m[4]) __m128 MulC = _mm_mul_ps(Swp2C, Swp3C); __m128 SubF = _mm_sub_ps(_mm_movehl_ps(MulC, MulC), MulC); - //vec<4, T, P> DetCof( + //vec<4, T, Q> DetCof( // + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02), // - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04), // + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05), @@ -962,7 +962,7 @@ GLM_FUNC_QUALIFIER void glm_mat4_rotate(__m128 const in[4], float Angle, float c __m128 Sin0 = _mm_set_ss(s); __m128 SinA = _mm_shuffle_ps(Sin0, Sin0, _MM_SHUFFLE(0, 0, 0, 0)); - // vec<3, T, P> temp = (valType(1) - c) * axis; + // vec<3, T, Q> temp = (valType(1) - c) * axis; __m128 Temp0 = _mm_sub_ps(one, CosA); __m128 Temp1 = _mm_mul_ps(Temp0, AxisC); diff --git a/test/core/core_func_integer.cpp b/test/core/core_func_integer.cpp index 75cc57b8..d1a1ca8a 100644 --- a/test/core/core_func_integer.cpp +++ b/test/core/core_func_integer.cpp @@ -151,17 +151,17 @@ namespace bitfieldReverse return Result; } */ - template - GLM_FUNC_QUALIFIER glm::vec bitfieldReverseLoop(glm::vec const& v) + template + GLM_FUNC_QUALIFIER glm::vec bitfieldReverseLoop(glm::vec const& v) { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldReverse' only accept integer values"); - glm::vec Result(0); + glm::vec Result(0); T const BitSize = static_cast(sizeof(T) * 8); for(T i = 0; i < BitSize; ++i) { - glm::vec const BitSet(v & (static_cast(1) << i)); - glm::vec const BitFirst(BitSet >> i); + glm::vec const BitSet(v & (static_cast(1) << i)); + glm::vec const BitFirst(BitSet >> i); Result |= BitFirst << (BitSize - 1 - i); } return Result; @@ -197,8 +197,8 @@ namespace bitfieldReverse template struct compute_bitfieldReverseStep { - template - GLM_FUNC_QUALIFIER static glm::vec call(glm::vec const& v, T, T) + template + GLM_FUNC_QUALIFIER static glm::vec call(glm::vec const& v, T, T) { return v; } @@ -207,17 +207,17 @@ namespace bitfieldReverse template<> struct compute_bitfieldReverseStep { - template - GLM_FUNC_QUALIFIER static glm::vec call(glm::vec const& v, T Mask, T Shift) + template + GLM_FUNC_QUALIFIER static glm::vec call(glm::vec const& v, T Mask, T Shift) { return (v & Mask) << Shift | (v & (~Mask)) >> Shift; } }; - template - GLM_FUNC_QUALIFIER glm::vec bitfieldReverseOps(glm::vec const& v) + template + GLM_FUNC_QUALIFIER glm::vec bitfieldReverseOps(glm::vec const& v) { - glm::vec x(v); + glm::vec x(v); x = compute_bitfieldReverseStep= 2>::call(x, T(0x5555555555555555ull), static_cast( 1)); x = compute_bitfieldReverseStep= 4>::call(x, T(0x3333333333333333ull), static_cast( 2)); x = compute_bitfieldReverseStep= 8>::call(x, T(0x0F0F0F0F0F0F0F0Full), static_cast( 4)); @@ -1397,8 +1397,8 @@ namespace bitCount template struct compute_bitfieldBitCountStep { - template - GLM_FUNC_QUALIFIER static glm::vec call(glm::vec const& v, T, T) + template + GLM_FUNC_QUALIFIER static glm::vec call(glm::vec const& v, T, T) { return v; } @@ -1407,24 +1407,24 @@ namespace bitCount template<> struct compute_bitfieldBitCountStep { - template - GLM_FUNC_QUALIFIER static glm::vec call(glm::vec const& v, T Mask, T Shift) + template + GLM_FUNC_QUALIFIER static glm::vec call(glm::vec const& v, T Mask, T Shift) { return (v & Mask) + ((v >> Shift) & Mask); } }; - template - static glm::vec bitCount_bitfield(glm::vec const& v) + template + static glm::vec bitCount_bitfield(glm::vec const& v) { - glm::vec::type, P> x(*reinterpret_cast::type, P> const *>(&v)); + glm::vec::type, Q> x(*reinterpret_cast::type, Q> const *>(&v)); x = compute_bitfieldBitCountStep= 2>::call(x, typename glm::detail::make_unsigned::type(0x5555555555555555ull), typename glm::detail::make_unsigned::type( 1)); x = compute_bitfieldBitCountStep= 4>::call(x, typename glm::detail::make_unsigned::type(0x3333333333333333ull), typename glm::detail::make_unsigned::type( 2)); x = compute_bitfieldBitCountStep= 8>::call(x, typename glm::detail::make_unsigned::type(0x0F0F0F0F0F0F0F0Full), typename glm::detail::make_unsigned::type( 4)); x = compute_bitfieldBitCountStep= 16>::call(x, typename glm::detail::make_unsigned::type(0x00FF00FF00FF00FFull), typename glm::detail::make_unsigned::type( 8)); x = compute_bitfieldBitCountStep= 32>::call(x, typename glm::detail::make_unsigned::type(0x0000FFFF0000FFFFull), typename glm::detail::make_unsigned::type(16)); x = compute_bitfieldBitCountStep= 64>::call(x, typename glm::detail::make_unsigned::type(0x00000000FFFFFFFFull), typename glm::detail::make_unsigned::type(32)); - return glm::vec(x); + return glm::vec(x); } template diff --git a/test/gtx/gtx_fast_trigonometry.cpp b/test/gtx/gtx_fast_trigonometry.cpp index 4159b7e0..5ea34ec0 100644 --- a/test/gtx/gtx_fast_trigonometry.cpp +++ b/test/gtx/gtx_fast_trigonometry.cpp @@ -174,16 +174,17 @@ namespace fastAtan namespace taylorCos { using glm::qualifier; + using glm::length_t; glm::vec4 const AngleShift(0.0f, glm::half_pi(), glm::pi(), glm::three_over_two_pi()); - template - GLM_FUNC_QUALIFIER glm::vec taylorSeriesNewCos(glm::vec const& x) + template + GLM_FUNC_QUALIFIER glm::vec taylorSeriesNewCos(glm::vec const& x) { - glm::vec const Powed2(x * x); - glm::vec const Powed4(Powed2 * Powed2); - glm::vec const Powed6(Powed4 * Powed2); - glm::vec const Powed8(Powed4 * Powed4); + glm::vec const Powed2(x * x); + glm::vec const Powed4(Powed2 * Powed2); + glm::vec const Powed6(Powed4 * Powed2); + glm::vec const Powed8(Powed4 * Powed4); return static_cast(1) - Powed2 * static_cast(0.5) @@ -192,12 +193,12 @@ namespace taylorCos + Powed8 * static_cast(2.4801587301587301587301587301587e-5); } - template - GLM_FUNC_QUALIFIER glm::vec taylorSeriesNewCos6(glm::vec const& x) + template + GLM_FUNC_QUALIFIER glm::vec taylorSeriesNewCos6(glm::vec const& x) { - glm::vec const Powed2(x * x); - glm::vec const Powed4(Powed2 * Powed2); - glm::vec const Powed6(Powed4 * Powed2); + glm::vec const Powed2(x * x); + glm::vec const Powed4(Powed2 * Powed2); + glm::vec const Powed6(Powed4 * Powed2); return static_cast(1) - Powed2 * static_cast(0.5) @@ -205,8 +206,8 @@ namespace taylorCos - Powed6 * static_cast(0.00138888888888888888888888888889); } - template - GLM_FUNC_QUALIFIER glm::vec fastAbs(glm::vec x) + template + GLM_FUNC_QUALIFIER glm::vec fastAbs(glm::vec x) { int* Pointer = reinterpret_cast(&x[0]); Pointer[0] &= 0x7fffffff; @@ -216,17 +217,17 @@ namespace taylorCos return x; } - template - GLM_FUNC_QUALIFIER glm::vec fastCosNew(glm::vec const& x) + template + GLM_FUNC_QUALIFIER glm::vec fastCosNew(glm::vec const& x) { - glm::vec const Angle0_PI(fastAbs(fmod(x + glm::pi(), glm::two_pi()) - glm::pi())); + glm::vec const Angle0_PI(fastAbs(fmod(x + glm::pi(), glm::two_pi()) - glm::pi())); return taylorSeriesNewCos6(x); /* - vec const FirstQuarterPi(lessThanEqual(Angle0_PI, vec(glm::half_pi()))); + vec const FirstQuarterPi(lessThanEqual(Angle0_PI, vec(glm::half_pi()))); - vec const RevertAngle(mix(vec(glm::pi()), vec(0), FirstQuarterPi)); - vec const ReturnSign(mix(vec(-1), vec(1), FirstQuarterPi)); - vec const SectionAngle(RevertAngle - Angle0_PI); + vec const RevertAngle(mix(vec(glm::pi()), vec(0), FirstQuarterPi)); + vec const ReturnSign(mix(vec(-1), vec(1), FirstQuarterPi)); + vec const SectionAngle(RevertAngle - Angle0_PI); return ReturnSign * taylorSeriesNewCos(SectionAngle); */ @@ -254,21 +255,21 @@ namespace taylorCos return Error; } - template - GLM_FUNC_QUALIFIER glm::vec deterministic_fmod(glm::vec const& x, T y) + template + GLM_FUNC_QUALIFIER glm::vec deterministic_fmod(glm::vec const& x, T y) { return x - y * trunc(x / y); } - template - GLM_FUNC_QUALIFIER glm::vec fastCosDeterminisctic(glm::vec const& x) + template + GLM_FUNC_QUALIFIER glm::vec fastCosDeterminisctic(glm::vec const& x) { - glm::vec const Angle0_PI(abs(deterministic_fmod(x + glm::pi(), glm::two_pi()) - glm::pi())); - glm::vec const FirstQuarterPi(lessThanEqual(Angle0_PI, glm::vec(glm::half_pi()))); + glm::vec const Angle0_PI(abs(deterministic_fmod(x + glm::pi(), glm::two_pi()) - glm::pi())); + glm::vec const FirstQuarterPi(lessThanEqual(Angle0_PI, glm::vec(glm::half_pi()))); - glm::vec const RevertAngle(mix(glm::vec(glm::pi()), glm::vec(0), FirstQuarterPi)); - glm::vec const ReturnSign(mix(glm::vec(-1), glm::vec(1), FirstQuarterPi)); - glm::vec const SectionAngle(RevertAngle - Angle0_PI); + glm::vec const RevertAngle(mix(glm::vec(glm::pi()), glm::vec(0), FirstQuarterPi)); + glm::vec const ReturnSign(mix(glm::vec(-1), glm::vec(1), FirstQuarterPi)); + glm::vec const SectionAngle(RevertAngle - Angle0_PI); return ReturnSign * taylorSeriesNewCos(SectionAngle); } @@ -295,8 +296,8 @@ namespace taylorCos return Error; } - template - GLM_FUNC_QUALIFIER glm::vec taylorSeriesRefCos(glm::vec const& x) + template + GLM_FUNC_QUALIFIER glm::vec taylorSeriesRefCos(glm::vec const& x) { return static_cast(1) - (x * x) / glm::factorial(static_cast(2)) @@ -305,17 +306,17 @@ namespace taylorCos + (x * x * x * x * x * x * x * x) / glm::factorial(static_cast(8)); } - template - GLM_FUNC_QUALIFIER glm::vec fastRefCos(glm::vec const& x) + template + GLM_FUNC_QUALIFIER glm::vec fastRefCos(glm::vec const& x) { - glm::vec const Angle0_PI(glm::abs(fmod(x + glm::pi(), glm::two_pi()) - glm::pi())); + glm::vec const Angle0_PI(glm::abs(fmod(x + glm::pi(), glm::two_pi()) - glm::pi())); // return taylorSeriesRefCos(Angle0_PI); - glm::vec const FirstQuarterPi(lessThanEqual(Angle0_PI, glm::vec(glm::half_pi()))); + glm::vec const FirstQuarterPi(lessThanEqual(Angle0_PI, glm::vec(glm::half_pi()))); - glm::vec const RevertAngle(mix(glm::vec(glm::pi()), glm::vec(0), FirstQuarterPi)); - glm::vec const ReturnSign(mix(glm::vec(-1), glm::vec(1), FirstQuarterPi)); - glm::vec const SectionAngle(RevertAngle - Angle0_PI); + glm::vec const RevertAngle(mix(glm::vec(glm::pi()), glm::vec(0), FirstQuarterPi)); + glm::vec const ReturnSign(mix(glm::vec(-1), glm::vec(1), FirstQuarterPi)); + glm::vec const SectionAngle(RevertAngle - Angle0_PI); return ReturnSign * taylorSeriesRefCos(SectionAngle); } diff --git a/test/gtx/gtx_matrix_factorisation.cpp b/test/gtx/gtx_matrix_factorisation.cpp index bf47b74a..6771dbac 100644 --- a/test/gtx/gtx_matrix_factorisation.cpp +++ b/test/gtx/gtx_matrix_factorisation.cpp @@ -3,21 +3,21 @@ #include #include -template class matType> -int test_qr(matType m) +template +int test_qr(glm::mat m) { int Error = 0; T const epsilon = static_cast(1e-10); - matType<(C < R ? C : R), R, T, P> q(-999); - matType r(-999); + glm::mat<(C < R ? C : R), R, T, Q> q(-999); + glm::mat r(-999); glm::qr_decompose(m, q, r); //Test if q*r really equals the input matrix - matType tm = q*r; - matType err = tm - m; + glm::mat tm = q*r; + glm::mat err = tm - m; for (glm::length_t i = 0; i < C; i++) for (glm::length_t j = 0; j < R; j++) @@ -40,28 +40,28 @@ int test_qr(matType m) return Error; } -template class matType> -int test_rq(matType m) +template +int test_rq(glm::mat m) { int Error = 0; T const epsilon = static_cast(1e-10); - matType q(-999); - matType<(C < R ? C : R), R, T, P> r(-999); + glm::mat q(-999); + glm::mat<(C < R ? C : R), R, T, Q> r(-999); glm::rq_decompose(m, r, q); //Test if q*r really equals the input matrix - matType tm = r*q; - matType err = tm - m; + glm::mat tm = r*q; + glm::mat err = tm - m; for (glm::length_t i = 0; i < C; i++) for (glm::length_t j = 0; j < R; j++) Error += glm::abs(err[i][j]) > epsilon ? 1 : 0; //Test if the rows of q are orthonormal - matType<(C < R ? C : R), C, T, P> tq = transpose(q); + glm::mat<(C < R ? C : R), C, T, Q> tq = transpose(q); for (glm::length_t i = 0; i < (C < R ? C : R); i++) {