From a2583caa0f9b3b9ae0a7ce7762d43ac0c111ea1c Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 10 May 2013 14:03:54 +0200 Subject: [PATCH] Added vector type operator declarations --- glm/core/type_vec2.hpp | 96 ++++++++++++++++++++++++++++++++++++++ glm/core/type_vec2.inl | 10 ++-- glm/core/type_vec3.hpp | 97 ++++++++++++++++++++++++++++++++++++++ glm/core/type_vec4.hpp | 103 +++++++++++++++++++++++++++++++++++++++++ glm/core/type_vec4.inl | 10 ++-- 5 files changed, 306 insertions(+), 10 deletions(-) diff --git a/glm/core/type_vec2.hpp b/glm/core/type_vec2.hpp index 69c35f38..2590d635 100644 --- a/glm/core/type_vec2.hpp +++ b/glm/core/type_vec2.hpp @@ -235,6 +235,102 @@ namespace detail GLM_DETAIL_IS_VECTOR(tvec2); + template + GLM_FUNC_DECL tvec2 operator+(tvec2 const & v, T const & s); + + template + GLM_FUNC_DECL tvec2 operator+(T const & s, tvec2 const & v); + + template + GLM_FUNC_DECL tvec2 operator+(tvec2 const & v1, tvec2 const & v2); + + template + GLM_FUNC_DECL tvec2 operator-(tvec2 const & v, T const & s); + + template + GLM_FUNC_DECL tvec2 operator-(T const & s, tvec2 const & v); + + template + GLM_FUNC_DECL tvec2 operator- (tvec2 const & v1, tvec2 const & v2); + + template + GLM_FUNC_DECL tvec2 operator*(tvec2 const & v, T const & s); + + template + GLM_FUNC_DECL tvec2 operator*(T const & s, tvec2 const & v); + + template + GLM_FUNC_DECL tvec2 operator*(tvec2 const & v1, tvec2 const & v2); + + template + GLM_FUNC_DECL tvec2 operator/(tvec2 const & v, T const & s); + + template + GLM_FUNC_DECL tvec2 operator/(T const & s, tvec2 const & v); + + template + GLM_FUNC_DECL tvec2 operator/(tvec2 const & v1, tvec2 const & v2); + + template + GLM_FUNC_DECL tvec2 operator-(tvec2 const & v); + + template + GLM_FUNC_DECL tvec2 operator%(tvec2 const & v, T const & s); + + template + GLM_FUNC_DECL tvec2 operator%(T const & s, tvec2 const & v); + + template + GLM_FUNC_DECL tvec2 operator%(tvec2 const & v1, tvec2 const & v2); + + template + GLM_FUNC_DECL tvec2 operator&(tvec2 const & v, T const & s); + + template + GLM_FUNC_DECL tvec2 operator&(T const & s, tvec2 const & v); + + template + GLM_FUNC_DECL tvec2 operator&(tvec2 const & v1, tvec2 const & v2); + + template + GLM_FUNC_DECL tvec2 operator|(tvec2 const & v, T const & s); + + template + GLM_FUNC_DECL tvec2 operator|(T const & s, tvec2 const & v); + + template + GLM_FUNC_DECL tvec2 operator|(tvec2 const & v1, tvec2 const & v2); + + template + GLM_FUNC_DECL tvec2 operator^(tvec2 const & v, T const & s); + + template + GLM_FUNC_DECL tvec2 operator^(T const & s, tvec2 const & v); + + template + GLM_FUNC_DECL tvec2 operator^(tvec2 const & v1, tvec2 const & v2); + + template + GLM_FUNC_DECL tvec2 operator<<(tvec2 const & v, T const & s); + + template + GLM_FUNC_DECL tvec2 operator<<(T const & s, tvec2 const & v); + + template + GLM_FUNC_DECL tvec2 operator<<(tvec2 const & v1, tvec2 const & v2); + + template + GLM_FUNC_DECL tvec2 operator>>(tvec2 const & v, T const & s); + + template + GLM_FUNC_DECL tvec2 operator>>(T const & s, tvec2 const & v); + + template + GLM_FUNC_DECL tvec2 operator>>(tvec2 const & v1, tvec2 const & v2); + + template + GLM_FUNC_DECL tvec2 operator~(tvec2 const & v); + }//namespace detail }//namespace glm diff --git a/glm/core/type_vec2.inl b/glm/core/type_vec2.inl index 290d9cd1..980309dc 100644 --- a/glm/core/type_vec2.inl +++ b/glm/core/type_vec2.inl @@ -957,7 +957,7 @@ namespace detail // tref definition template - tref2::tref2 + GLM_FUNC_QUALIFIER tref2::tref2 ( T & x, T & y @@ -967,7 +967,7 @@ namespace detail {} template - tref2::tref2 + GLM_FUNC_QUALIFIER tref2::tref2 ( tref2 const & r ) : @@ -976,7 +976,7 @@ namespace detail {} template - tref2::tref2 + GLM_FUNC_QUALIFIER tref2::tref2 ( tvec2 const & v ) : @@ -985,7 +985,7 @@ namespace detail {} template - tref2& tref2::operator= + GLM_FUNC_QUALIFIER tref2& tref2::operator= ( tref2 const & r ) @@ -996,7 +996,7 @@ namespace detail } template - tref2& tref2::operator= + GLM_FUNC_QUALIFIER tref2& tref2::operator= ( tvec2 const & v ) diff --git a/glm/core/type_vec3.hpp b/glm/core/type_vec3.hpp index 739b9c8c..44175246 100644 --- a/glm/core/type_vec3.hpp +++ b/glm/core/type_vec3.hpp @@ -260,6 +260,103 @@ namespace detail }; GLM_DETAIL_IS_VECTOR(tvec3); + + template + GLM_FUNC_DECL tvec3 operator+(tvec3 const & v, T const & s); + + template + GLM_FUNC_DECL tvec3 operator+(T const & s, tvec3 const & v); + + template + GLM_FUNC_DECL tvec3 operator+(tvec3 const & v1, tvec3 const & v2); + + template + GLM_FUNC_DECL tvec3 operator-(tvec3 const & v, T const & s); + + template + GLM_FUNC_DECL tvec3 operator-(T const & s, tvec3 const & v); + + template + GLM_FUNC_DECL tvec3 operator- (tvec3 const & v1, tvec3 const & v2); + + template + GLM_FUNC_DECL tvec3 operator*(tvec3 const & v, T const & s); + + template + GLM_FUNC_DECL tvec3 operator*(T const & s, tvec3 const & v); + + template + GLM_FUNC_DECL tvec3 operator*(tvec3 const & v1, tvec3 const & v2); + + template + GLM_FUNC_DECL tvec3 operator/(tvec3 const & v, T const & s); + + template + GLM_FUNC_DECL tvec3 operator/(T const & s, tvec3 const & v); + + template + GLM_FUNC_DECL tvec3 operator/(tvec3 const & v1, tvec3 const & v2); + + template + GLM_FUNC_DECL tvec3 operator-(tvec3 const & v); + + template + GLM_FUNC_DECL tvec3 operator%(tvec3 const & v, T const & s); + + template + GLM_FUNC_DECL tvec3 operator%(T const & s, tvec3 const & v); + + template + GLM_FUNC_DECL tvec3 operator%(tvec3 const & v1, tvec3 const & v2); + + template + GLM_FUNC_DECL tvec3 operator&(tvec3 const & v, T const & s); + + template + GLM_FUNC_DECL tvec3 operator&(T const & s, tvec3 const & v); + + template + GLM_FUNC_DECL tvec3 operator&(tvec3 const & v1, tvec3 const & v2); + + template + GLM_FUNC_DECL tvec3 operator|(tvec3 const & v, T const & s); + + template + GLM_FUNC_DECL tvec3 operator|(T const & s, tvec3 const & v); + + template + GLM_FUNC_DECL tvec3 operator|(tvec3 const & v1, tvec3 const & v2); + + template + GLM_FUNC_DECL tvec3 operator^(tvec3 const & v, T const & s); + + template + GLM_FUNC_DECL tvec3 operator^(T const & s, tvec3 const & v); + + template + GLM_FUNC_DECL tvec3 operator^(tvec3 const & v1, tvec3 const & v2); + + template + GLM_FUNC_DECL tvec3 operator<<(tvec3 const & v, T const & s); + + template + GLM_FUNC_DECL tvec3 operator<<(T const & s, tvec3 const & v); + + template + GLM_FUNC_DECL tvec3 operator<<(tvec3 const & v1, tvec3 const & v2); + + template + GLM_FUNC_DECL tvec3 operator>>(tvec3 const & v, T const & s); + + template + GLM_FUNC_DECL tvec3 operator>>(T const & s, tvec3 const & v); + + template + GLM_FUNC_DECL tvec3 operator>>(tvec3 const & v1, tvec3 const & v2); + + template + GLM_FUNC_DECL tvec3 operator~(tvec3 const & v); + }//namespace detail }//namespace glm diff --git a/glm/core/type_vec4.hpp b/glm/core/type_vec4.hpp index 11eec86e..f41a6f5b 100644 --- a/glm/core/type_vec4.hpp +++ b/glm/core/type_vec4.hpp @@ -317,6 +317,109 @@ namespace detail }; GLM_DETAIL_IS_VECTOR(tvec4); + + template + GLM_FUNC_DECL tvec4 operator+(tvec4 const & v, typename tvec4::value_type const & s); + + template + GLM_FUNC_DECL tvec4 operator+(typename tvec4::value_type const & s, tvec4 const & v); + + template + GLM_FUNC_DECL tvec4 operator+(tvec4 const & v1, tvec4 const & v2); + + template + GLM_FUNC_DECL tvec4 operator-(tvec4 const & v, typename tvec4::value_type const & s); + + template + GLM_FUNC_DECL tvec4 operator-(typename tvec4::value_type const & s, tvec4 const & v); + + template + GLM_FUNC_DECL tvec4 operator- (tvec4 const & v1, tvec4 const & v2); + + template + GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, typename tvec4::value_type const & s); + + template + GLM_FUNC_DECL tvec4 operator*(typename tvec4::value_type const & s, tvec4 const & v); + + template + GLM_FUNC_DECL tvec4 operator*(tvec4 const & v1, tvec4 const & v2); + + template + GLM_FUNC_DECL tvec4 operator/(tvec4 const & v, typename tvec4::value_type const & s); + + template + GLM_FUNC_DECL tvec4 operator/(typename tvec4::value_type const & s, tvec4 const & v); + + template + GLM_FUNC_DECL tvec4 operator/(tvec4 const & v1, tvec4 const & v2); + + template + GLM_FUNC_DECL tvec4 operator-(tvec4 const & v); + + template + GLM_FUNC_DECL bool operator==(tvec4 const & v1, tvec4 const & v2); + + template + GLM_FUNC_DECL bool operator!=(tvec4 const & v1, tvec4 const & v2); + + template + GLM_FUNC_DECL tvec4 operator%(tvec4 const & v, typename tvec4::value_type const & s); + + template + GLM_FUNC_DECL tvec4 operator%(typename tvec4::value_type const & s, tvec4 const & v); + + template + GLM_FUNC_DECL tvec4 operator%(tvec4 const & v1, tvec4 const & v2); + + template + GLM_FUNC_DECL tvec4 operator&(tvec4 const & v, typename tvec4::value_type const & s); + + template + GLM_FUNC_DECL tvec4 operator&(typename tvec4::value_type const & s, tvec4 const & v); + + template + GLM_FUNC_DECL tvec4 operator&(tvec4 const & v1, tvec4 const & v2); + + template + GLM_FUNC_DECL tvec4 operator|(tvec4 const & v, typename tvec4::value_type const & s); + + template + GLM_FUNC_DECL tvec4 operator|(typename tvec4::value_type const & s, tvec4 const & v); + + template + GLM_FUNC_DECL tvec4 operator|(tvec4 const & v1, tvec4 const & v2); + + template + GLM_FUNC_DECL tvec4 operator^(tvec4 const & v, typename tvec4::value_type const & s); + + template + GLM_FUNC_DECL tvec4 operator^(typename tvec4::value_type const & s, tvec4 const & v); + + template + GLM_FUNC_DECL tvec4 operator^(tvec4 const & v1, tvec4 const & v2); + + template + GLM_FUNC_DECL tvec4 operator<<(tvec4 const & v, typename tvec4::value_type const & s); + + template + GLM_FUNC_DECL tvec4 operator<<(typename tvec4::value_type const & s, tvec4 const & v); + + template + GLM_FUNC_DECL tvec4 operator<<(tvec4 const & v1, tvec4 const & v2); + + template + GLM_FUNC_DECL tvec4 operator>>(tvec4 const & v, typename tvec4::value_type const & s); + + template + GLM_FUNC_DECL tvec4 operator>>(typename tvec4::value_type const & s, tvec4 const & v); + + template + GLM_FUNC_DECL tvec4 operator>>(tvec4 const & v1, tvec4 const & v2); + + template + GLM_FUNC_DECL tvec4 operator~(tvec4 const & v); + }//namespace detail }//namespace glm diff --git a/glm/core/type_vec4.inl b/glm/core/type_vec4.inl index 695f26a9..f8df571d 100644 --- a/glm/core/type_vec4.inl +++ b/glm/core/type_vec4.inl @@ -1294,7 +1294,7 @@ namespace detail // tref definition template - tref4::tref4 + GLM_FUNC_QUALIFIER tref4::tref4 ( T & x, T & y, @@ -1308,7 +1308,7 @@ namespace detail {} template - tref4::tref4 + GLM_FUNC_QUALIFIER tref4::tref4 ( tref4 const & r ) : @@ -1319,7 +1319,7 @@ namespace detail {} template - tref4::tref4 + GLM_FUNC_QUALIFIER tref4::tref4 ( tvec4 const & v ) : @@ -1330,7 +1330,7 @@ namespace detail {} template - tref4& tref4::operator= + GLM_FUNC_QUALIFIER tref4& tref4::operator= ( tref4 const & r ) @@ -1343,7 +1343,7 @@ namespace detail } template - tref4& tref4::operator= + GLM_FUNC_QUALIFIER tref4& tref4::operator= ( tvec4 const & v )