From a848fa69be8dc46a9516203de0c2f6c88700d5df Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Sat, 12 Mar 2016 18:30:07 +0200 Subject: [PATCH 1/4] 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 76029f49..24e9a846 100644 --- a/glm/detail/type_vec2.hpp +++ b/glm/detail/type_vec2.hpp @@ -298,9 +298,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 e941b766..84d4f0b6 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -419,12 +419,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 3ec43e9522083cf2eed2edec3f3fb48df93c2d1c Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Sat, 12 Mar 2016 18:31:43 +0200 Subject: [PATCH 2/4] 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 62cd7aed..43db6ef6 100644 --- a/glm/detail/type_mat4x2.hpp +++ b/glm/detail/type_mat4x2.hpp @@ -192,15 +192,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 e60273daff68d7a0d66d329bcdc1d1f7c8fff155 Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Sat, 12 Mar 2016 18:34:40 +0200 Subject: [PATCH 3/4] 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 84d4f0b6..37ae9a7c 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -363,13 +363,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); @@ -378,13 +378,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); @@ -393,13 +393,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 5927d99e..514161ea 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -673,6 +673,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) { @@ -683,6 +693,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) { @@ -703,6 +723,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) { @@ -713,6 +743,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) { @@ -733,6 +773,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) { @@ -743,6 +793,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) { From 444cf0f36aadafaa2e66267bb1608bb9e20d5b02 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 12 Mar 2016 20:35:06 +0100 Subject: [PATCH 4/4] Fixed undefined reference errors #489 --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index f464a4a3..e637bc4b 100644 --- a/readme.md +++ b/readme.md @@ -57,6 +57,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) - Fixed polar coordinates function latitude #485 - Fixed outerProduct defintions and operator signatures for mat2x4 and vec4 #475 - Fixed eulerAngles precision error, returns NaN #451 +- Fixed undefined reference errors #489 #### [GLM 0.9.7.3](https://github.com/g-truc/glm/releases/tag/0.9.7.3) - 2016-02-21 ##### Improvements: