From 5222e0baca05bc5bd74030d54b9a3ec5d10da31c Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Sat, 12 Mar 2016 18:30:07 +0200 Subject: [PATCH 1/3] Remove duplicate function declarations --- glm/detail/type_vec2.hpp | 3 --- glm/detail/type_vec4.hpp | 6 ------ 2 files changed, 9 deletions(-) diff --git a/glm/detail/type_vec2.hpp b/glm/detail/type_vec2.hpp index 13c5d05f..1af3e31a 100644 --- a/glm/detail/type_vec2.hpp +++ b/glm/detail/type_vec2.hpp @@ -305,9 +305,6 @@ namespace glm 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 & scalar); diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index fe7235ac..d290631b 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -438,12 +438,6 @@ namespace detail template GLM_FUNC_DECL tvec4 operator/(tvec4 const & v1, tvec4 const & v2); - 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, T scalar); From 780d5f403b1da864ab46fb363f78d2124c5e5c9b Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Sat, 12 Mar 2016 18:31:43 +0200 Subject: [PATCH 2/3] Fix incorrect declaration (now matches definition) --- glm/detail/type_mat4x2.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/glm/detail/type_mat4x2.hpp b/glm/detail/type_mat4x2.hpp index a52675b8..bd71e121 100644 --- a/glm/detail/type_mat4x2.hpp +++ b/glm/detail/type_mat4x2.hpp @@ -197,15 +197,15 @@ namespace glm template GLM_FUNC_DECL typename tmat4x2::row_type operator*(typename tmat4x2::col_type const & v, tmat4x2 const & m); + template + GLM_FUNC_DECL tmat2x2 operator*(tmat4x2 const & m1, tmat2x4 const & m2); + template GLM_FUNC_DECL tmat3x2 operator*(tmat4x2 const & m1, tmat3x4 const & m2); template GLM_FUNC_DECL tmat4x2 operator*(tmat4x2 const & m1, tmat4x4 const & m2); - template - GLM_FUNC_DECL tmat2x3 operator*(tmat4x3 const & m1, tmat2x4 const & m2); - template GLM_FUNC_DECL tmat4x2 operator/(tmat4x2 const & m, T const & s); From 3860fbaa9ae38560ed12de253c47819eba03389c Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Sat, 12 Mar 2016 18:34:40 +0200 Subject: [PATCH 3/3] Add missing vec4 operator definitions Also rename the parameters to match similar functions in other vector classes. --- glm/detail/type_vec4.hpp | 12 ++++---- glm/detail/type_vec4.inl | 60 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 6 deletions(-) diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index d290631b..86156e5f 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -382,13 +382,13 @@ namespace detail GLM_FUNC_DECL tvec4 operator+(tvec4 const & v, const T& scalar); template - GLM_FUNC_DECL tvec4 operator+(tvec4 const & v, tvec1 const & scalar); + GLM_FUNC_DECL tvec4 operator+(tvec4 const & v1, tvec1 const & v2); template GLM_FUNC_DECL tvec4 operator+(T scalar, tvec4 const & v); template - GLM_FUNC_DECL tvec4 operator+(tvec1 const & scalar, tvec4 const & v); + GLM_FUNC_DECL tvec4 operator+(tvec1 const & v1, tvec4 const & v2); template GLM_FUNC_DECL tvec4 operator+(tvec4 const & v1, tvec4 const & v2); @@ -397,13 +397,13 @@ namespace detail GLM_FUNC_DECL tvec4 operator-(tvec4 const & v, const T& scalar); template - GLM_FUNC_DECL tvec4 operator-(tvec4 const & v, tvec1 const & scalar); + GLM_FUNC_DECL tvec4 operator-(tvec4 const & v1, tvec1 const & v2); template GLM_FUNC_DECL tvec4 operator-(T scalar, tvec4 const & v); template - GLM_FUNC_DECL tvec4 operator-(tvec1 const & scalar, tvec4 const & v); + GLM_FUNC_DECL tvec4 operator-(tvec1 const & v1, tvec4 const & v2); template GLM_FUNC_DECL tvec4 operator-(tvec4 const & v1, tvec4 const & v2); @@ -412,13 +412,13 @@ namespace detail GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, const T& scalar); template - GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, tvec1 const & scalar); + GLM_FUNC_DECL tvec4 operator*(tvec4 const & v1, tvec1 const & v2); template GLM_FUNC_DECL tvec4 operator*(T scalar, tvec4 const & v); template - GLM_FUNC_DECL tvec4 operator*(tvec1 const & scalar, tvec4 const & v); + GLM_FUNC_DECL tvec4 operator*(tvec1 const & v1, tvec4 const & v2); template GLM_FUNC_DECL tvec4 operator*(tvec4 const & v1, tvec4 const & v2); diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index 6712ce33..f8d30b57 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -739,6 +739,16 @@ namespace glm v.w + scalar); } + template + GLM_FUNC_QUALIFIER tvec4 operator+(tvec4 const & v1, tvec1 const & v2) + { + return tvec4( + v1.x + v2.x, + v1.y + v2.x, + v1.z + v2.x, + v1.w + v2.x); + } + template GLM_FUNC_QUALIFIER tvec4 operator+(T scalar, tvec4 const & v) { @@ -749,6 +759,16 @@ namespace glm scalar + v.w); } + template + GLM_FUNC_QUALIFIER tvec4 operator+(tvec1 const & v1, tvec4 const & v2) + { + return tvec4( + v1.x + v2.x, + v1.x + v2.y, + v1.x + v2.z, + v1.x + v2.w); + } + template GLM_FUNC_QUALIFIER tvec4 operator+(tvec4 const & v1, tvec4 const & v2) { @@ -769,6 +789,16 @@ namespace glm v.w - scalar); } + template + GLM_FUNC_QUALIFIER tvec4 operator-(tvec4 const & v1, tvec1 const & v2) + { + return tvec4( + v1.x - v2.x, + v1.y - v2.x, + v1.z - v2.x, + v1.w - v2.x); + } + template GLM_FUNC_QUALIFIER tvec4 operator-(T scalar, tvec4 const & v) { @@ -779,6 +809,16 @@ namespace glm scalar - v.w); } + template + GLM_FUNC_DECL tvec4 operator-(tvec1 const & v1, tvec4 const & v2) + { + return tvec4( + v1.x - v2.x, + v1.x - v2.y, + v1.x - v2.z, + v1.x - v2.w); + } + template GLM_FUNC_QUALIFIER tvec4 operator-(tvec4 const & v1, tvec4 const & v2) { @@ -799,6 +839,16 @@ namespace glm v.w * scalar); } + template + GLM_FUNC_QUALIFIER tvec4 operator*(tvec4 const & v1, tvec1 const & v2) + { + return tvec4( + v1.x * v2.x, + v1.y * v2.x, + v1.z * v2.x, + v1.w * v2.x); + } + template GLM_FUNC_QUALIFIER tvec4 operator*(T scalar, tvec4 const & v) { @@ -809,6 +859,16 @@ namespace glm scalar * v.w); } + template + GLM_FUNC_DECL tvec4 operator*(tvec1 const & v1, tvec4 const & v2) + { + return tvec4( + v1.x * v2.x, + v1.x * v2.y, + v1.x * v2.z, + v1.x * v2.w); + } + template GLM_FUNC_QUALIFIER tvec4 operator*(tvec4 const & v1, tvec4 const & v2) {