diff --git a/glm/detail/type_vec1.hpp b/glm/detail/type_vec1.hpp index b80aacf1..1b7bfabe 100644 --- a/glm/detail/type_vec1.hpp +++ b/glm/detail/type_vec1.hpp @@ -83,9 +83,9 @@ namespace glm // -- Implicit basic constructors -- GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR; - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const & v) GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const& v) GLM_DEFAULT; template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, T, Q> const & v); + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, T, Q> const& v); // -- Explicit basic constructors -- @@ -96,17 +96,17 @@ namespace glm /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<2, U, Q> const & v); + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<2, U, Q> const& v); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, Q> const & v); + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, Q> const& v); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, Q> const & v); + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, Q> const& v); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<1, U, Q> const & v); + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<1, U, Q> const& v); // -- Swizzle constructors -- /* @@ -123,23 +123,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, P> 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, P> 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, P> 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, P> 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, P> const& v); // -- Increment and decrement operators -- @@ -153,56 +153,56 @@ 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, P> 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, P> 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, P> 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, P> 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, P> 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, P> const& v); }; // -- Unary operators -- template - GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const & v); + GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const& v); template - GLM_FUNC_DECL vec<1, T, P> operator-(vec<1, T, P> const & v); + GLM_FUNC_DECL vec<1, T, P> operator-(vec<1, T, P> const& v); // -- Binary operators -- template - GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const & v, T scalar); + GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const& v, T scalar); template - GLM_FUNC_DECL vec<1, T, P> operator+(T scalar, vec<1, T, P> const & v); + GLM_FUNC_DECL vec<1, T, P> operator+(T scalar, vec<1, T, P> const& v); template - GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const & v1, vec<1, T, P> const & v2); + 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, P> operator-(vec<1, T, P> const & v, T scalar); template - GLM_FUNC_DECL vec<1, T, P> operator-(T scalar, vec<1, T, P> const & v); + GLM_FUNC_DECL vec<1, T, P> operator-(T scalar, vec<1, T, P> const& v); template - GLM_FUNC_DECL vec<1, T, P> operator- (vec<1, T, P> const & v1, vec<1, T, P> const & v2); + 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, P> operator*(vec<1, T, P> const & v, T scalar); diff --git a/glm/detail/type_vec2.hpp b/glm/detail/type_vec2.hpp index 427ed850..b0588703 100644 --- a/glm/detail/type_vec2.hpp +++ b/glm/detail/type_vec2.hpp @@ -92,7 +92,7 @@ namespace glm GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit vec(ctor); GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR vec(T s1, T s2); + GLM_FUNC_DECL GLM_CONSTEXPR vec(T x, T y); // -- Conversion constructors -- @@ -100,20 +100,20 @@ namespace glm template GLM_FUNC_DECL GLM_CONSTEXPR vec(A x, B y); template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const & v1, vec<1, B, P> const & v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& x, vec<1, B, P> const& y); // -- Conversion vector constructors -- /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, Q> const & v); + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, Q> const& v); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, Q> const & v); + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, Q> const& v); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<2, U, Q> const & v); + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<2, U, Q> const& v); // -- Swizzle constructors -- # if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED) @@ -129,31 +129,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, P> 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, P> const& v); template - GLM_FUNC_DECL vec& operator+=(vec<2, U, P> const & v); + GLM_FUNC_DECL vec& operator+=(vec<2, U, P> 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, P> const& v); template - GLM_FUNC_DECL vec& operator-=(vec<2, U, P> const & v); + GLM_FUNC_DECL vec& operator-=(vec<2, U, P> 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, P> const& v); template - GLM_FUNC_DECL vec& operator*=(vec<2, U, P> const & v); + GLM_FUNC_DECL vec& operator*=(vec<2, U, P> 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, P> const& v); template - GLM_FUNC_DECL vec& operator/=(vec<2, U, P> const & v); + GLM_FUNC_DECL vec& operator/=(vec<2, U, P> const& v); // -- Increment and decrement operators -- diff --git a/glm/detail/type_vec2.inl b/glm/detail/type_vec2.inl index 856c6278..46ffd34c 100644 --- a/glm/detail/type_vec2.inl +++ b/glm/detail/type_vec2.inl @@ -16,14 +16,14 @@ namespace glm # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<2, T, P> const & v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<2, T, P> const& v) : x(v.x), y(v.y) {} # endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<2, T, Q> const & v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<2, T, Q> const& v) : x(v.x), y(v.y) {} @@ -39,45 +39,45 @@ namespace glm {} template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(T s1, T s2) - : x(s1), y(s2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(T _x, T _y) + : x(_x), y(_y) {} // -- Conversion scalar constructors -- template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(A a, B b) - : x(static_cast(a)) - , y(static_cast(b)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(A _x, B _y) + : x(static_cast(_x)) + , y(static_cast(_y)) {} template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<1, A, P> const & a, vec<1, B, P> const & b) - : x(static_cast(a.x)) - , y(static_cast(b.x)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<1, A, P> const& _x, vec<1, B, P> const& _y) + : x(static_cast(_x.x)) + , y(static_cast(_y.x)) {} // -- Conversion vector constructors -- template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<2, U, Q> const & v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<2, U, Q> const& v) : x(static_cast(v.x)) , y(static_cast(v.y)) {} template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<3, U, Q> const & v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<3, U, Q> const& v) : x(static_cast(v.x)) , y(static_cast(v.y)) {} template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<4, U, Q> const & v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<4, U, Q> const& v) : x(static_cast(v.x)) , y(static_cast(v.y)) {} @@ -102,7 +102,7 @@ namespace glm # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator=(vec<2, T, P> const & v) + GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator=(vec<2, T, P> const& v) { this->x = v.x; this->y = v.y; @@ -112,7 +112,7 @@ namespace glm 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, P> & vec<2, T, P>::operator=(vec<2, U, P> const& v) { this->x = static_cast(v.x); this->y = static_cast(v.y); @@ -130,7 +130,7 @@ namespace glm 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, P> & vec<2, T, P>::operator+=(vec<1, U, P> const& v) { this->x += static_cast(v.x); this->y += static_cast(v.x); @@ -139,7 +139,7 @@ namespace glm 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, P> & vec<2, T, P>::operator+=(vec<2, U, P> const& v) { this->x += static_cast(v.x); this->y += static_cast(v.y); @@ -157,7 +157,7 @@ namespace glm 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, P> & vec<2, T, P>::operator-=(vec<1, U, P> const& v) { this->x -= static_cast(v.x); this->y -= static_cast(v.x); @@ -166,7 +166,7 @@ namespace glm 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, P> & vec<2, T, P>::operator-=(vec<2, U, P> const& v) { this->x -= static_cast(v.x); this->y -= static_cast(v.y); @@ -184,7 +184,7 @@ namespace glm 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, P> & vec<2, T, P>::operator*=(vec<1, U, P> const& v) { this->x *= static_cast(v.x); this->y *= static_cast(v.x); @@ -193,7 +193,7 @@ namespace glm 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, P> & vec<2, T, P>::operator*=(vec<2, U, P> const& v) { this->x *= static_cast(v.x); this->y *= static_cast(v.y); @@ -211,7 +211,7 @@ namespace glm 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, P> & vec<2, T, P>::operator/=(vec<1, U, P> const& v) { this->x /= static_cast(v.x); this->y /= static_cast(v.x); @@ -220,7 +220,7 @@ namespace glm 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, P> & vec<2, T, P>::operator/=(vec<2, U, P> const& v) { this->x /= static_cast(v.x); this->y /= static_cast(v.y); @@ -274,7 +274,7 @@ namespace glm 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, P> & vec<2, T, P>::operator%=(vec<1, U, P> const& v) { this->x %= static_cast(v.x); this->y %= static_cast(v.x); @@ -283,7 +283,7 @@ namespace glm 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, P> & vec<2, T, P>::operator%=(vec<2, U, P> const& v) { this->x %= static_cast(v.x); this->y %= static_cast(v.y); @@ -301,7 +301,7 @@ namespace glm 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, P> & vec<2, T, P>::operator&=(vec<1, U, P> const& v) { this->x &= static_cast(v.x); this->y &= static_cast(v.x); @@ -310,7 +310,7 @@ namespace glm 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, P> & vec<2, T, P>::operator&=(vec<2, U, P> const& v) { this->x &= static_cast(v.x); this->y &= static_cast(v.y); @@ -328,7 +328,7 @@ namespace glm 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, P> & vec<2, T, P>::operator|=(vec<1, U, P> const& v) { this->x |= static_cast(v.x); this->y |= static_cast(v.x); @@ -337,7 +337,7 @@ namespace glm 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, P> & vec<2, T, P>::operator|=(vec<2, U, P> const& v) { this->x |= static_cast(v.x); this->y |= static_cast(v.y); @@ -355,7 +355,7 @@ namespace glm 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, P> & vec<2, T, P>::operator^=(vec<1, U, P> const& v) { this->x ^= static_cast(v.x); this->y ^= static_cast(v.x); @@ -364,7 +364,7 @@ namespace glm 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, P> & vec<2, T, P>::operator^=(vec<2, U, P> const& v) { this->x ^= static_cast(v.x); this->y ^= static_cast(v.y); @@ -382,7 +382,7 @@ namespace glm 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, P> & vec<2, T, P>::operator<<=(vec<1, U, P> const& v) { this->x <<= static_cast(v.x); this->y <<= static_cast(v.x); @@ -391,7 +391,7 @@ namespace glm 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, P> & vec<2, T, P>::operator<<=(vec<2, U, P> const& v) { this->x <<= static_cast(v.x); this->y <<= static_cast(v.y); @@ -409,7 +409,7 @@ namespace glm 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, P> & vec<2, T, P>::operator>>=(vec<1, U, P> const& v) { this->x >>= static_cast(v.x); this->y >>= static_cast(v.x); @@ -418,7 +418,7 @@ namespace glm 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, P> & vec<2, T, P>::operator>>=(vec<2, U, P> const& v) { this->x >>= static_cast(v.x); this->y >>= static_cast(v.y); @@ -428,13 +428,13 @@ namespace glm // -- Unary arithmetic operators -- template - GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<2, T, P> const & v) + GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<2, T, P> const& v) { return v; } template - GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<2, T, P> const & v) + GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<2, T, P> const& v) { return vec<2, T, P>( -v.x, @@ -444,7 +444,7 @@ namespace glm // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<2, T, P> const & v, T scalar) + GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<2, T, P> const& v, T scalar) { return vec<2, T, P>( v.x + scalar, @@ -452,7 +452,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<2, T, P> const & v1, vec<1, T, P> const & v2) + GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<2, T, P> const& v1, vec<1, T, P> const& v2) { return vec<2, T, P>( v1.x + v2.x, @@ -460,7 +460,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, P> operator+(T scalar, vec<2, T, P> const & v) + GLM_FUNC_QUALIFIER vec<2, T, P> operator+(T scalar, vec<2, T, P> const& v) { return vec<2, T, P>( scalar + v.x, @@ -468,7 +468,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<1, T, P> const & v1, vec<2, T, P> const & v2) + GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<1, T, P> const& v1, vec<2, T, P> const& v2) { return vec<2, T, P>( v1.x + v2.x, diff --git a/glm/detail/type_vec3.hpp b/glm/detail/type_vec3.hpp index c3ca1ca9..8e742a22 100644 --- a/glm/detail/type_vec3.hpp +++ b/glm/detail/type_vec3.hpp @@ -97,32 +97,32 @@ namespace glm // -- Conversion scalar constructors -- /// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(A a, B b, C c); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const & a, vec<1, B, P> const & b, vec<1, C, P> const & c); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(X x, Y y, Z z); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, P> const& _x, vec<1, Y, P> const& _y, vec<1, Z, P> const& _z); // -- Conversion vector constructors -- /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const & a, B b); + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const& _xy, B _z); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const & a, vec<1, B, Q> const & b); + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const& _xy, vec<1, B, Q> const& _z); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR vec(A a, vec<2, B, Q> const & b); + GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<2, B, Q> const& _yz); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const & a, vec<2, B, Q> const & b); + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const& _x, vec<2, B, Q> const& _yz); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, Q> const & v); + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, Q> const& v); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, Q> const & v); + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, Q> const& v); // -- Swizzle constructors -- # if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED) diff --git a/glm/detail/type_vec3.inl b/glm/detail/type_vec3.inl index 55b17efe..aadfeabf 100644 --- a/glm/detail/type_vec3.inl +++ b/glm/detail/type_vec3.inl @@ -38,74 +38,74 @@ namespace glm : x(scalar), y(scalar), z(scalar) {} - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(T a, T b, T c) - : x(a), y(b), z(c) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(T _x, T _y, T _z) + : x(_x), y(_y), z(_z) {} // -- Conversion scalar constructors -- template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(A a, B b, C c) : - x(static_cast(a)), - y(static_cast(b)), - z(static_cast(c)) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(X _x, Y _y, Z _z) + : x(static_cast(_x)) + , y(static_cast(_y)) + , z(static_cast(_z)) {} template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<1, A, P> const & a, vec<1, B, P> const & b, vec<1, C, P> const & c) : - x(static_cast(a)), - y(static_cast(b)), - z(static_cast(c)) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<1, X, P> const& _x, vec<1, Y, P> const& _y, vec<1, Z, P> const& _z) + : x(static_cast(_x)) + , y(static_cast(_y)) + , z(static_cast(_z)) {} // -- Conversion vector constructors -- template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<2, A, Q> const & a, B b) : - x(static_cast(a.x)), - y(static_cast(a.y)), - z(static_cast(b)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<2, A, Q> 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 vec<3, T, P>::vec(vec<2, A, Q> const & a, vec<1, B, Q> const & b) : - x(static_cast(a.x)), - y(static_cast(a.y)), - z(static_cast(b.x)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<2, A, Q> const& _xy, vec<1, B, Q> const& _z) + : x(static_cast(_xy.x)) + , y(static_cast(_xy.y)) + , z(static_cast(_z.x)) {} template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(A a, vec<2, B, Q> const & b) : - x(static_cast(a)), - y(static_cast(b.x)), - z(static_cast(b.y)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(A _x, vec<2, B, Q> const& _yz) + : x(static_cast(_x)) + , y(static_cast(_yz.x)) + , z(static_cast(_yz.y)) {} template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<1, A, Q> const & a, vec<2, B, Q> const & b) : - x(static_cast(a.x)), - y(static_cast(b.x)), - z(static_cast(b.y)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<1, A, Q> const& _x, vec<2, B, Q> const& _yz) + : x(static_cast(_x.x)) + , y(static_cast(_yz.x)) + , z(static_cast(_yz.y)) {} template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<3, U, Q> const & v) : - x(static_cast(v.x)), - y(static_cast(v.y)), - z(static_cast(v.z)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<3, 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 vec<3, T, P>::vec(vec<4, U, Q> const & v) : + GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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)) diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index 35a5ff4c..ff1850a0 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -95,51 +95,51 @@ namespace glm GLM_FUNC_DECL GLM_CONSTEXPR_SIMD explicit vec(ctor); GLM_FUNC_DECL GLM_CONSTEXPR_SIMD explicit vec(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(T a, T b, T c, T d); + GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(T x, T y, T z, T w); // -- Conversion scalar constructors -- /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(A a, B b, C c, D d); - template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, A, P> const& a, vec<1, B, P> const& b, vec<1, C, P> const& c, vec<1, D, P> const& d); + 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); // -- Conversion vector constructors -- /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const & a, B b, C c); + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const& _xy, B _z, C _w); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const & a, vec<1, B, Q> const & b, vec<1, C, Q> const & c); + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const& _xy, vec<1, B, Q> const& _z, vec<1, C, Q> const& _w); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR vec(A a, vec<2, B, Q> const & b, C c); + GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<2, B, Q> const& _yz, C _w); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const & a, vec<2, B, Q> const & b, vec<1, C, Q> const & c); + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const& _x, vec<2, B, Q> const& _yz, vec<1, C, Q> const& _w); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR vec(A a, B b, vec<2, C, Q> const & c); + GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, B _y, vec<2, C, Q> const& _zw); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const & a, vec<1, B, Q> const & b, vec<2, C, Q> const & c); + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const& _x, vec<1, B, Q> const& _y, vec<2, C, Q> const& _zw); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, A, Q> const & a, B b); + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, A, Q> const& _xyz, B _w); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, A, Q> const & a, vec<1, B, Q> const & b); + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, A, Q> const& _xyz, vec<1, B, Q> const& _w); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR vec(A a, vec<3, B, Q> const & b); + GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<3, B, Q> const& _yzw); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const & a, vec<3, B, Q> const & b); + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const& _x, vec<3, B, Q> const& _yzw); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const & a, vec<2, B, Q> const & b); + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const& _xy, vec<2, B, Q> const& _zw); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index 0310c50e..9aa3558d 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -187,135 +187,135 @@ namespace detail : x(scalar), y(scalar), z(scalar), w(scalar) {} - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, P>::vec(T a, T b, T c, T d) - : x(a), y(b), z(c), w(d) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, P>::vec(T _x, T _y, T _z, T _w) + : x(_x), y(_y), z(_z), w(_w) {} // -- Conversion scalar constructors -- template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, P>::vec(A a, B b, C c, D d) : - x(static_cast(a)), - y(static_cast(b)), - z(static_cast(c)), - w(static_cast(d)) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, P>::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 - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, P>::vec(vec<1, A, P> const & a, vec<1, B, P> const & b, vec<1, C, P> const & c, vec<1, D, P> const & d) : - x(static_cast(a.x)), - y(static_cast(b.x)), - z(static_cast(c.x)), - w(static_cast(d.x)) + 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) + : x(static_cast(_x.x)) + , y(static_cast(_y.x)) + , z(static_cast(_z.x)) + , w(static_cast(_w.x)) {} // -- Conversion vector constructors -- template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, P>::vec(vec<2, A, Q> const & a, B b, C c) : - x(static_cast(a.x)), - y(static_cast(a.y)), - z(static_cast(b)), - w(static_cast(c)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, P>::vec(vec<2, A, Q> 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 vec<4, T, P>::vec(vec<2, A, Q> const & a, vec<1, B, Q> const & b, vec<1, C, Q> const & c) : - x(static_cast(a.x)), - y(static_cast(a.y)), - z(static_cast(b.x)), - w(static_cast(c.x)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, P>::vec(vec<2, A, Q> const& _xy, vec<1, B, Q> const& _z, vec<1, C, Q> 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 vec<4, T, P>::vec(A s1, vec<2, B, Q> const & v, C s2) : - x(static_cast(s1)), - y(static_cast(v.x)), - z(static_cast(v.y)), - w(static_cast(s2)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, P>::vec(A _x, vec<2, B, Q> 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 vec<4, T, P>::vec(vec<1, A, Q> const & a, vec<2, B, Q> const & b, vec<1, C, Q> const & c) : - x(static_cast(a.x)), - y(static_cast(b.x)), - z(static_cast(b.y)), - w(static_cast(c.x)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, P>::vec(vec<1, A, Q> const& _x, vec<2, B, Q> const& _yz, vec<1, C, Q> 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 vec<4, T, P>::vec(A s1, B s2, vec<2, C, Q> const & v) : - x(static_cast(s1)), - y(static_cast(s2)), - z(static_cast(v.x)), - w(static_cast(v.y)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, P>::vec(A _x, B _y, vec<2, C, Q> 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 vec<4, T, P>::vec(vec<1, A, Q> const & a, vec<1, B, Q> const & b, vec<2, C, Q> const & c) : - x(static_cast(a.x)), - y(static_cast(b.x)), - z(static_cast(c.x)), - w(static_cast(c.y)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, P>::vec(vec<1, A, Q> const& _x, vec<1, B, Q> const& _y, vec<2, C, Q> 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 vec<4, T, P>::vec(vec<3, A, Q> const & a, B b) : - x(static_cast(a.x)), - y(static_cast(a.y)), - z(static_cast(a.z)), - w(static_cast(b)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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 vec<4, T, P>::vec(vec<3, A, Q> const & a, vec<1, B, Q> const & b) : - x(static_cast(a.x)), - y(static_cast(a.y)), - z(static_cast(a.z)), - w(static_cast(b.x)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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 vec<4, T, P>::vec(A a, vec<3, B, Q> const & b) : - x(static_cast(a)), - y(static_cast(b.x)), - z(static_cast(b.y)), - w(static_cast(b.z)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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 vec<4, T, P>::vec(vec<1, A, Q> const & a, vec<3, B, Q> const & b) : - x(static_cast(a.x)), - y(static_cast(b.x)), - z(static_cast(b.y)), - w(static_cast(b.z)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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 vec<4, T, P>::vec(vec<2, A, Q> const & a, vec<2, B, Q> const & b) : - x(static_cast(a.x)), - y(static_cast(a.y)), - z(static_cast(b.x)), - w(static_cast(b.y)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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 vec<4, T, P>::vec(vec<4, U, Q> const & v) : + GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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)), @@ -325,14 +325,14 @@ namespace detail // -- Component accesses -- template - GLM_FUNC_QUALIFIER T & vec<4, T, P>::operator[](typename vec<4, T, P>::length_type i) + GLM_FUNC_QUALIFIER T& vec<4, T, P>::operator[](typename vec<4, T, P>::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 + GLM_FUNC_QUALIFIER T const& vec<4, T, P>::operator[](typename vec<4, T, P>::length_type i) const { assert(i >= 0 && i < this->length()); return (&x)[i]; diff --git a/glm/detail/type_vec4_simd.inl b/glm/detail/type_vec4_simd.inl index 3511ed7c..ce82a6a5 100644 --- a/glm/detail/type_vec4_simd.inl +++ b/glm/detail/type_vec4_simd.inl @@ -362,6 +362,7 @@ namespace detail {} # endif//!GLM_HAS_DEFAULTED_FUNCTIONS +<<<<<<< HEAD template<> GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_lowp>::vec(float s) : data(_mm_set1_ps(s)) @@ -475,6 +476,121 @@ namespace detail template<> GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_highp>::vec(int32 a, int32 b, int32 c, int32 d) : data(_mm_castsi128_ps(_mm_set_epi32(d, c, b, a))) +======= + template <> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(float _s) : + data(_mm_set1_ps(_s)) + {} + + template <> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(float _s) : + data(_mm_set1_ps(_s)) + {} + + template <> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(float _s) : + data(_mm_set1_ps(_s)) + {} + +# if GLM_ARCH & GLM_ARCH_AVX_BIT + template <> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(double _s) : + data(_mm256_set1_pd(_s)) + {} + + template <> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(double _s) : + data(_mm256_set1_pd(_s)) + {} + + template <> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(double _s) : + data(_mm256_set1_pd(_s)) + {} +# endif + + template <> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 _s) : + data(_mm_set1_epi32(_s)) + {} + + template <> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 _s) : + data(_mm_set1_epi32(_s)) + {} + + template <> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 _s) : + data(_mm_set1_epi32(_s)) + {} + +# if GLM_ARCH & GLM_ARCH_AVX2_BIT + template <> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int64 _s) : + data(_mm256_set1_epi64x(_s)) + {} + + template <> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int64 _s) : + data(_mm256_set1_epi64x(_s)) + {} + + template <> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int64 _s) : + data(_mm256_set1_epi64x(_s)) + {} +# endif + + template <> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(float _a, float _b, float c, float d) : + data(_mm_set_ps(d, c, _b, _a)) + {} + + template <> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(float _a, float _b, float c, float d) : + data(_mm_set_ps(d, c, _b, _a)) + {} + + template <> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(float _a, float _b, float c, float d) : + data(_mm_set_ps(d, c, _b, _a)) + {} + + template <> + template <> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 _a, int32 _b, int32 c, int32 d) : + data(_mm_set_epi32(d, c, _b, _a)) + {} + + template <> + template <> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 _a, int32 _b, int32 c, int32 d) : + data(_mm_set_epi32(d, c, _b, _a)) + {} + + template <> + template <> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 _a, int32 _b, int32 c, int32 d) : + data(_mm_set_epi32(d, c, _b, _a)) + {} + + template <> + template <> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 _a, int32 _b, int32 c, int32 d) : + data(_mm_castsi128_ps(_mm_set_epi32(d, c, _b, _a))) + {} + + template <> + template <> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 _a, int32 _b, int32 c, int32 d) : + data(_mm_castsi128_ps(_mm_set_epi32(d, c, _b, _a))) + {} + + template <> + template <> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 _a, int32 _b, int32 c, int32 d) : + data(_mm_castsi128_ps(_mm_set_epi32(d, c, _b, _a))) +>>>>>>> 9e45b450625bcc6c883ac049257b36fef934b0ae {} }//namespace glm diff --git a/glm/gtc/quaternion.hpp b/glm/gtc/quaternion.hpp index 2486d4db..769bab84 100644 --- a/glm/gtc/quaternion.hpp +++ b/glm/gtc/quaternion.hpp @@ -78,20 +78,20 @@ namespace glm // -- Implicit basic constructors -- GLM_FUNC_DECL GLM_CONSTEXPR tquat() GLM_DEFAULT_CTOR; - 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); + GLM_FUNC_DECL GLM_CONSTEXPR tquat(tquat const& q); // -- Explicit basic constructors -- GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tquat(ctor); - GLM_FUNC_DECL GLM_CONSTEXPR tquat(T const & s, vec<3, T, P> const & v); - GLM_FUNC_DECL GLM_CONSTEXPR tquat(T const & w, T const & x, T const & y, T const & z); + GLM_FUNC_DECL GLM_CONSTEXPR tquat(T s, vec<3, T, P> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR tquat(T w, T x, T y, T z); // -- Conversion constructors -- template - GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tquat(tquat const & q); + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tquat(tquat const& q); /// Explicit conversion operators # if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS @@ -108,22 +108,22 @@ namespace glm GLM_FUNC_DECL tquat(vec<3, T, P> const & u, vec<3, T, P> 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 & m); - GLM_FUNC_DECL GLM_EXPLICIT tquat(mat<4, 4, T, P> const & m); + 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); // -- Unary arithmetic operators -- - GLM_FUNC_DECL tquat & operator=(tquat const & m) GLM_DEFAULT; + GLM_FUNC_DECL tquat & operator=(tquat const& q) GLM_DEFAULT; template - GLM_FUNC_DECL tquat & operator=(tquat const & m); + 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); template @@ -133,10 +133,10 @@ namespace glm // -- Unary bit operators -- 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); // -- Binary operators -- diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index cb76abb7..442cb4bf 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -101,7 +101,7 @@ namespace detail template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat(tquat const & q) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat(tquat const& q) : x(q.x), y(q.y), z(q.z), w(q.w) {} @@ -112,20 +112,20 @@ namespace detail {} template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat(T const & s, vec<3, T, P> const & v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat(T s, vec<3, T, P> const& v) : x(v.x), y(v.y), z(v.z), w(s) {} - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat(T const & w, T const & x, T const & y, T const & z) - : x(x), y(y), z(z), w(w) + 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) + 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)) @@ -151,7 +151,7 @@ namespace detail //} template - GLM_FUNC_QUALIFIER tquat::tquat(vec<3, T, P> const & u, vec<3, T, P> const & v) + GLM_FUNC_QUALIFIER tquat::tquat(vec<3, T, P> const& u, vec<3, T, P> const& v) { vec<3, T, P> const LocalW(cross(u, v)); T Dot = detail::compute_dot, T, detail::is_aligned

::value>::call(u, v); @@ -161,7 +161,7 @@ namespace detail } template - GLM_FUNC_QUALIFIER tquat::tquat(vec<3, T, P> const & eulerAngle) + GLM_FUNC_QUALIFIER tquat::tquat(vec<3, T, P> const& eulerAngle) { vec<3, T, P> c = glm::cos(eulerAngle * T(0.5)); vec<3, T, P> s = glm::sin(eulerAngle * T(0.5)); @@ -173,13 +173,13 @@ namespace detail } template - GLM_FUNC_QUALIFIER tquat::tquat(mat<3, 3, T, P> const & m) + GLM_FUNC_QUALIFIER tquat::tquat(mat<3, 3, T, P> const& m) { *this = quat_cast(m); } template - GLM_FUNC_QUALIFIER tquat::tquat(mat<4, 4, T, P> const & m) + GLM_FUNC_QUALIFIER tquat::tquat(mat<4, 4, T, P> const& m) { *this = quat_cast(m); } @@ -199,7 +199,7 @@ namespace detail # endif//GLM_HAS_EXPLICIT_CONVERSION_OPERATORS template - GLM_FUNC_QUALIFIER tquat conjugate(tquat const & q) + GLM_FUNC_QUALIFIER tquat conjugate(tquat const& q) { return tquat(q.w, -q.x, -q.y, -q.z); }