From efce35f901c6698c194604665bf0ba47b4910ca8 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 19 Jan 2011 11:56:48 +0000 Subject: [PATCH 1/4] Updated equal and not equal operators for vectors --- glm/core/type_vec1.inl | 23 +++++++++++++++++++++++ glm/core/type_vec2.inl | 23 +++++++++++++++++++++++ glm/core/type_vec3.inl | 23 +++++++++++++++++++++++ glm/core/type_vec4.inl | 36 ++++++++++++++++++++++++++++++++++++ glm/gtx/comparison.hpp | 7 ++++--- glm/gtx/comparison.inl | 4 ++-- 6 files changed, 111 insertions(+), 5 deletions(-) diff --git a/glm/core/type_vec1.inl b/glm/core/type_vec1.inl index 47c586a2..a64b93f3 100644 --- a/glm/core/type_vec1.inl +++ b/glm/core/type_vec1.inl @@ -234,6 +234,29 @@ namespace glm return *this; } + ////////////////////////////////////// + // Boolean operators + + template + inline bool operator== + ( + tvec1 const & v1, + tvec1 const & v2 + ) + { + return (v1.x == v2.x); + } + + template + inline bool operator!= + ( + tvec1 const & v1, + tvec1 const & v2 + ) + { + return (v1.x != v2.x); + } + ////////////////////////////////////// // Unary bit operators diff --git a/glm/core/type_vec2.inl b/glm/core/type_vec2.inl index 4620b687..ac40c966 100644 --- a/glm/core/type_vec2.inl +++ b/glm/core/type_vec2.inl @@ -296,6 +296,29 @@ namespace glm return *this; } + ////////////////////////////////////// + // Boolean operators + + template + inline bool operator== + ( + tvec2 const & v1, + tvec2 const & v2 + ) + { + return (v1.x == v2.x) && (v1.y == v2.y); + } + + template + inline bool operator!= + ( + tvec2 const & v1, + tvec2 const & v2 + ) + { + return (v1.x != v2.x) || (v1.y != v2.y); + } + ////////////////////////////////////// // Unary bit operators diff --git a/glm/core/type_vec3.inl b/glm/core/type_vec3.inl index d2b1ae29..bd849208 100644 --- a/glm/core/type_vec3.inl +++ b/glm/core/type_vec3.inl @@ -333,6 +333,29 @@ namespace glm return *this; } + ////////////////////////////////////// + // Boolean operators + + template + inline bool operator== + ( + tvec3 const & v1, + tvec3 const & v2 + ) + { + return (v1.x == v2.x) && (v1.y == v2.y) && (v1.z == v2.z); + } + + template + inline bool operator!= + ( + tvec3 const & v1, + tvec3 const & v2 + ) + { + return (v1.x != v2.x) || (v1.y != v2.y) || (v1.z != v2.z); + } + ////////////////////////////////////// // Unary bit operators diff --git a/glm/core/type_vec4.inl b/glm/core/type_vec4.inl index cb2ff4cc..28e5f356 100644 --- a/glm/core/type_vec4.inl +++ b/glm/core/type_vec4.inl @@ -861,6 +861,29 @@ namespace glm v.w - One); } + ////////////////////////////////////// + // Boolean operators + + template + inline bool operator== + ( + tvec4 const & v1, + tvec4 const & v2 + ) + { + return (v1.x == v2.x) && (v1.y == v2.y) && (v1.z == v2.z) && (v1.w == v2.w); + } + + template + inline bool operator!= + ( + tvec4 const & v1, + tvec4 const & v2 + ) + { + return (v1.x != v2.x) || (v1.y != v2.y) || (v1.z != v2.z) || (v1.w != v2.w); + } + ////////////////////////////////////// // Binary bit operators @@ -1129,6 +1152,19 @@ namespace glm ~v.w); } + template + inline tvec4 operator~ + ( + tvec4 const & v + ) + { + return tvec4( + ~v.x, + ~v.y, + ~v.z, + ~v.w); + } + ////////////////////////////////////// // tref definition diff --git a/glm/gtx/comparison.hpp b/glm/gtx/comparison.hpp index a035e936..6928e7b5 100644 --- a/glm/gtx/comparison.hpp +++ b/glm/gtx/comparison.hpp @@ -24,8 +24,9 @@ namespace glm namespace gtx{ //! GLM_GTX_comparison extension: Defined comparison operators for vectors. - namespace comparison{ - + namespace comparison + { +/* //! Define == operator for vectors //! From GLM_GTX_comparison extension. template @@ -67,7 +68,7 @@ namespace glm bool operator!= ( detail::tvec4 const & x, detail::tvec4 const & y); - +*/ }//namespace comparison }//namespace gtx }//namespace glm diff --git a/glm/gtx/comparison.inl b/glm/gtx/comparison.inl index 6db48eb2..4b847246 100644 --- a/glm/gtx/comparison.inl +++ b/glm/gtx/comparison.inl @@ -10,7 +10,7 @@ namespace glm{ namespace gtx{ namespace comparison{ - +/* template inline bool operator== ( @@ -70,7 +70,7 @@ inline bool operator!= { return glm::any(glm::notEqual(x, y)); } - +*/ }//namespace comparison }//namespace gtx }//namespace glm From c6e7d1455595e4e5f79ae66ad788cfbfdc31a279 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 19 Jan 2011 12:05:28 +0000 Subject: [PATCH 2/4] Updated equal and not equal operators for matrices --- glm/core/type_mat2x2.inl | 23 +++++++++++++++++++++++ glm/core/type_mat2x3.inl | 23 +++++++++++++++++++++++ glm/core/type_mat2x4.inl | 23 +++++++++++++++++++++++ glm/core/type_mat3x2.inl | 23 +++++++++++++++++++++++ glm/core/type_mat3x3.inl | 23 +++++++++++++++++++++++ glm/core/type_mat3x4.inl | 23 +++++++++++++++++++++++ glm/core/type_mat4x2.inl | 23 +++++++++++++++++++++++ glm/core/type_mat4x3.inl | 23 +++++++++++++++++++++++ glm/core/type_mat4x4.inl | 23 +++++++++++++++++++++++ 9 files changed, 207 insertions(+) diff --git a/glm/core/type_mat2x2.inl b/glm/core/type_mat2x2.inl index 33673c0f..6ab1260c 100644 --- a/glm/core/type_mat2x2.inl +++ b/glm/core/type_mat2x2.inl @@ -583,5 +583,28 @@ namespace detail m[1] - T(1)); } + ////////////////////////////////////// + // Boolean operators + + template + inline bool operator== + ( + tmat2x2 const & m1, + tmat2x2 const & m2 + ) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]); + } + + template + inline bool operator!= + ( + tmat2x2 const & m1, + tmat2x2 const & m2 + ) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]); + } + } //namespace detail } //namespace glm diff --git a/glm/core/type_mat2x3.inl b/glm/core/type_mat2x3.inl index 1b2f3a3f..aa8a58a4 100644 --- a/glm/core/type_mat2x3.inl +++ b/glm/core/type_mat2x3.inl @@ -514,5 +514,28 @@ namespace detail m[1] - typename tmat2x3::value_type(1)); } + ////////////////////////////////////// + // Boolean operators + + template + inline bool operator== + ( + tmat2x3 const & m1, + tmat2x3 const & m2 + ) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]); + } + + template + inline bool operator!= + ( + tmat2x3 const & m1, + tmat2x3 const & m2 + ) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]); + } + } //namespace detail } //namespace glm diff --git a/glm/core/type_mat2x4.inl b/glm/core/type_mat2x4.inl index 007aae74..98b7069e 100644 --- a/glm/core/type_mat2x4.inl +++ b/glm/core/type_mat2x4.inl @@ -542,5 +542,28 @@ namespace detail m[1] - typename tmat2x4::value_type(1)); } + ////////////////////////////////////// + // Boolean operators + + template + inline bool operator== + ( + tmat2x4 const & m1, + tmat2x4 const & m2 + ) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]); + } + + template + inline bool operator!= + ( + tmat2x4 const & m1, + tmat2x4 const & m2 + ) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]); + } + } //namespace detail } //namespace glm diff --git a/glm/core/type_mat3x2.inl b/glm/core/type_mat3x2.inl index 3f2d3b05..4ac61ff4 100644 --- a/glm/core/type_mat3x2.inl +++ b/glm/core/type_mat3x2.inl @@ -548,5 +548,28 @@ namespace detail m[2] - One); } + ////////////////////////////////////// + // Boolean operators + + template + inline bool operator== + ( + tmat3x2 const & m1, + tmat3x2 const & m2 + ) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]); + } + + template + inline bool operator!= + ( + tmat3x2 const & m1, + tmat3x2 const & m2 + ) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]); + } + } //namespace detail } //namespace glm diff --git a/glm/core/type_mat3x3.inl b/glm/core/type_mat3x3.inl index b99ab3c6..1fdc3f63 100644 --- a/glm/core/type_mat3x3.inl +++ b/glm/core/type_mat3x3.inl @@ -677,5 +677,28 @@ namespace detail m[2] - T(1)); } + ////////////////////////////////////// + // Boolean operators + + template + inline bool operator== + ( + tmat3x3 const & m1, + tmat3x3 const & m2 + ) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]); + } + + template + inline bool operator!= + ( + tmat3x3 const & m1, + tmat3x3 const & m2 + ) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]); + } + } //namespace detail } //namespace glm diff --git a/glm/core/type_mat3x4.inl b/glm/core/type_mat3x4.inl index 6fd8f2c8..f2ef904d 100644 --- a/glm/core/type_mat3x4.inl +++ b/glm/core/type_mat3x4.inl @@ -582,5 +582,28 @@ namespace detail m[2] - T(1)); } + ////////////////////////////////////// + // Boolean operators + + template + inline bool operator== + ( + tmat3x4 const & m1, + tmat3x4 const & m2 + ) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]); + } + + template + inline bool operator!= + ( + tmat3x4 const & m1, + tmat3x4 const & m2 + ) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]); + } + } //namespace detail } //namespace glm diff --git a/glm/core/type_mat4x2.inl b/glm/core/type_mat4x2.inl index 232675b8..7f6ed80a 100644 --- a/glm/core/type_mat4x2.inl +++ b/glm/core/type_mat4x2.inl @@ -591,5 +591,28 @@ namespace detail m[3] - typename tmat4x2::value_type(1)); } + ////////////////////////////////////// + // Boolean operators + + template + inline bool operator== + ( + tmat4x2 const & m1, + tmat4x2 const & m2 + ) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]); + } + + template + inline bool operator!= + ( + tmat4x2 const & m1, + tmat4x2 const & m2 + ) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]); + } + } //namespace detail } //namespace glm diff --git a/glm/core/type_mat4x3.inl b/glm/core/type_mat4x3.inl index c66ccbec..080dbd8e 100644 --- a/glm/core/type_mat4x3.inl +++ b/glm/core/type_mat4x3.inl @@ -595,6 +595,29 @@ namespace detail m[3] - T(1)); } + ////////////////////////////////////// + // Boolean operators + + template + inline bool operator== + ( + tmat4x3 const & m1, + tmat4x3 const & m2 + ) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]); + } + + template + inline bool operator!= + ( + tmat4x3 const & m1, + tmat4x3 const & m2 + ) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]); + } + } //namespace detail } //namespace glm diff --git a/glm/core/type_mat4x4.inl b/glm/core/type_mat4x4.inl index a344952d..a307d9e8 100644 --- a/glm/core/type_mat4x4.inl +++ b/glm/core/type_mat4x4.inl @@ -732,5 +732,28 @@ namespace detail m[3] - typename tmat4x4::value_type(1)); } + ////////////////////////////////////// + // Boolean operators + + template + inline bool operator== + ( + tmat4x4 const & m1, + tmat4x4 const & m2 + ) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]); + } + + template + inline bool operator!= + ( + tmat4x4 const & m1, + tmat4x4 const & m2 + ) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]); + } + } //namespace detail } //namespace glm From 7110f4febdec0d037a6c58f63b65eeefa03b4e51 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 19 Jan 2011 12:06:12 +0000 Subject: [PATCH 3/4] Updated version --- glm/setup.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/setup.hpp b/glm/setup.hpp index b38e8696..d189d835 100644 --- a/glm/setup.hpp +++ b/glm/setup.hpp @@ -17,7 +17,7 @@ #define GLM_VERSION_MAJOR 0 #define GLM_VERSION_MINOR 9 #define GLM_VERSION_PATCH 0 -#define GLM_VERSION_REVISION 4 +#define GLM_VERSION_REVISION 7 /////////////////////////////////////////////////////////////////////////////////////////////////// // Common values From 02bd23bee7ee6eab4e2cbd5a34cfa4d9b12c259c Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 19 Jan 2011 12:08:47 +0000 Subject: [PATCH 4/4] Improved 64 bits support on GCC --- glm/setup.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/setup.hpp b/glm/setup.hpp index d189d835..33640240 100644 --- a/glm/setup.hpp +++ b/glm/setup.hpp @@ -126,7 +126,7 @@ #elif defined(__GNUC__) -#if(defined(__WORDSIZE) && (__WORDSIZE == 64)) || defined(__arch64__) +#if(defined(__WORDSIZE) && (__WORDSIZE == 64)) || defined(__arch64__) || defined(__LP64__) #define GLM_MODEL GLM_MODEL_64 #else #define GLM_MODEL GLM_MODEL_32