diff --git a/glm/detail/type_vec1.hpp b/glm/detail/type_vec1.hpp index ae4b1369..4926a82a 100644 --- a/glm/detail/type_vec1.hpp +++ b/glm/detail/type_vec1.hpp @@ -95,18 +95,6 @@ namespace detail GLM_FUNC_DECL explicit tvec1( T const & s); - ////////////////////////////////////// - // Swizzle constructors - - - - ////////////////////////////////////// - // Conversion scalar constructors - - //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec1(U const & s); - ////////////////////////////////////// // Conversion vector constructors @@ -184,6 +172,109 @@ namespace detail GLM_FUNC_DECL tvec1 & operator>>=(tvec1 const & v); }; + + template + GLM_FUNC_DECL tvec1 operator+(tvec1 const & v, T const & s); + + template + GLM_FUNC_DECL tvec1 operator+(T const & s, tvec1 const & v); + + template + GLM_FUNC_DECL tvec1 operator+(tvec1 const & v1, tvec1 const & v2); + + template + GLM_FUNC_DECL tvec1 operator-(tvec1 const & v, T const & s); + + template + GLM_FUNC_DECL tvec1 operator-(T const & s, tvec1 const & v); + + template + GLM_FUNC_DECL tvec1 operator- (tvec1 const & v1, tvec1 const & v2); + + template + GLM_FUNC_DECL tvec1 operator*(tvec1 const & v, T const & s); + + template + GLM_FUNC_DECL tvec1 operator*(T const & s, tvec1 const & v); + + template + GLM_FUNC_DECL tvec1 operator*(tvec1 const & v1, tvec1 const & v2); + + template + GLM_FUNC_DECL tvec1 operator/(tvec1 const & v, T const & s); + + template + GLM_FUNC_DECL tvec1 operator/(T const & s, tvec1 const & v); + + template + GLM_FUNC_DECL tvec1 operator/(tvec1 const & v1, tvec1 const & v2); + + template + GLM_FUNC_DECL tvec1 operator-(tvec1 const & v); + + template + GLM_FUNC_DECL bool operator==(tvec1 const & v1, tvec1 const & v2); + + template + GLM_FUNC_DECL bool operator!=(tvec1 const & v1, tvec1 const & v2); + + template + GLM_FUNC_DECL tvec1 operator%(tvec1 const & v, T const & s); + + template + GLM_FUNC_DECL tvec1 operator%(T const & s, tvec1 const & v); + + template + GLM_FUNC_DECL tvec1 operator%(tvec1 const & v1, tvec1 const & v2); + + template + GLM_FUNC_DECL tvec1 operator&(tvec1 const & v, T const & s); + + template + GLM_FUNC_DECL tvec1 operator&(T const & s, tvec1 const & v); + + template + GLM_FUNC_DECL tvec1 operator&(tvec1 const & v1, tvec1 const & v2); + + template + GLM_FUNC_DECL tvec1 operator|(tvec1 const & v, T const & s); + + template + GLM_FUNC_DECL tvec1 operator|(T const & s, tvec1 const & v); + + template + GLM_FUNC_DECL tvec1 operator|(tvec1 const & v1, tvec1 const & v2); + + template + GLM_FUNC_DECL tvec1 operator^(tvec1 const & v, T const & s); + + template + GLM_FUNC_DECL tvec1 operator^(T const & s, tvec1 const & v); + + template + GLM_FUNC_DECL tvec1 operator^(tvec1 const & v1, tvec1 const & v2); + + template + GLM_FUNC_DECL tvec1 operator<<(tvec1 const & v, T const & s); + + template + GLM_FUNC_DECL tvec1 operator<<(T const & s, tvec1 const & v); + + template + GLM_FUNC_DECL tvec1 operator<<(tvec1 const & v1, tvec1 const & v2); + + template + GLM_FUNC_DECL tvec1 operator>>(tvec1 const & v, T const & s); + + template + GLM_FUNC_DECL tvec1 operator>>(T const & s, tvec1 const & v); + + template + GLM_FUNC_DECL tvec1 operator>>(tvec1 const & v1, tvec1 const & v2); + + template + GLM_FUNC_DECL tvec1 operator~(tvec1 const & v); + }//namespace detail }//namespace glm diff --git a/glm/detail/type_vec1.inl b/glm/detail/type_vec1.inl index fdbdf61e..4917c9e6 100644 --- a/glm/detail/type_vec1.inl +++ b/glm/detail/type_vec1.inl @@ -93,18 +93,6 @@ namespace detail x(s) {} - ////////////////////////////////////// - // Conversion scalar constructors - - template - template - GLM_FUNC_QUALIFIER tvec1::tvec1 - ( - U const & s - ) : - x(static_cast(s)) - {} - ////////////////////////////////////// // Conversion vector constructors @@ -454,7 +442,7 @@ namespace detail GLM_FUNC_QUALIFIER tvec1 operator+ ( tvec1 const & v, - typename tvec1::T const & s + T const & s ) { return tvec1( @@ -464,7 +452,7 @@ namespace detail template GLM_FUNC_QUALIFIER tvec1 operator+ ( - typename tvec1::T const & s, + T const & s, tvec1 const & v ) { @@ -488,7 +476,7 @@ namespace detail GLM_FUNC_QUALIFIER tvec1 operator- ( tvec1 const & v, - typename tvec1::T const & s + T const & s ) { return tvec1( @@ -498,7 +486,7 @@ namespace detail template GLM_FUNC_QUALIFIER tvec1 operator- ( - typename tvec1::T const & s, + T const & s, tvec1 const & v ) { @@ -522,7 +510,7 @@ namespace detail GLM_FUNC_QUALIFIER tvec1 operator* ( tvec1 const & v, - typename tvec1::T const & s + T const & s ) { return tvec1( @@ -532,7 +520,7 @@ namespace detail template GLM_FUNC_QUALIFIER tvec1 operator* ( - typename tvec1::T const & s, + T const & s, tvec1 const & v ) { @@ -556,7 +544,7 @@ namespace detail GLM_FUNC_QUALIFIER tvec1 operator/ ( tvec1 const & v, - typename tvec1::T const & s + T const & s ) { return tvec1( @@ -566,7 +554,7 @@ namespace detail template GLM_FUNC_QUALIFIER tvec1 operator/ ( - typename tvec1::T const & s, + T const & s, tvec1 const & v ) { @@ -625,7 +613,7 @@ namespace detail GLM_FUNC_QUALIFIER tvec1 operator% ( tvec1 const & v, - typename tvec1::T const & s + T const & s ) { return tvec1( @@ -635,7 +623,7 @@ namespace detail template GLM_FUNC_QUALIFIER tvec1 operator% ( - typename tvec1::T const & s, + T const & s, tvec1 const & v ) { @@ -658,7 +646,7 @@ namespace detail GLM_FUNC_QUALIFIER tvec1 operator& ( tvec1 const & v, - typename tvec1::T const & s + T const & s ) { return tvec1( @@ -668,7 +656,7 @@ namespace detail template GLM_FUNC_QUALIFIER tvec1 operator& ( - typename tvec1::T const & s, + T const & s, tvec1 const & v ) { @@ -691,7 +679,7 @@ namespace detail GLM_FUNC_QUALIFIER tvec1 operator| ( tvec1 const & v, - typename tvec1::T const & s + T const & s ) { return tvec1( @@ -701,7 +689,7 @@ namespace detail template GLM_FUNC_QUALIFIER tvec1 operator| ( - typename tvec1::T const & s, + T const & s, tvec1 const & v ) { @@ -724,7 +712,7 @@ namespace detail GLM_FUNC_QUALIFIER tvec1 operator^ ( tvec1 const & v, - typename tvec1::T const & s + T const & s ) { return tvec1( @@ -734,7 +722,7 @@ namespace detail template GLM_FUNC_QUALIFIER tvec1 operator^ ( - typename tvec1::T const & s, + T const & s, tvec1 const & v ) { @@ -757,7 +745,7 @@ namespace detail GLM_FUNC_QUALIFIER tvec1 operator<< ( tvec1 const & v, - typename tvec1::T const & s + T const & s ) { return tvec1( @@ -767,7 +755,7 @@ namespace detail template GLM_FUNC_QUALIFIER tvec1 operator<< ( - typename tvec1::T const & s, + T const & s, tvec1 const & v ) { @@ -790,7 +778,7 @@ namespace detail GLM_FUNC_QUALIFIER tvec1 operator>> ( tvec1 const & v, - typename tvec1::T const & s + T const & s ) { return tvec1( @@ -800,7 +788,7 @@ namespace detail template GLM_FUNC_QUALIFIER tvec1 operator>> ( - typename tvec1::T const & s, + T const & s, tvec1 const & v ) { diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index b772a3fe..fd233d67 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -457,7 +457,7 @@ namespace detail ( detail::tquat const & x, detail::tquat const & y, - typename detail::tquat::T const & a + T const & a ) { if(a <= T(0)) return x; diff --git a/glm/gtx/fast_square_root.inl b/glm/gtx/fast_square_root.inl index 83c80b39..0119f1bc 100644 --- a/glm/gtx/fast_square_root.inl +++ b/glm/gtx/fast_square_root.inl @@ -26,7 +26,7 @@ namespace glm // fastInversesqrt GLM_FUNC_QUALIFIER float fastInverseSqrt(float x) { - return detail::compute_inversesqrt::call(x).x; + return detail::compute_inversesqrt::call(detail::tvec1(x)).x; } template