From b968defd220c887640479bb1a90d725606fbdf58 Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Sun, 13 Mar 2016 21:32:06 +0200 Subject: [PATCH 01/26] Add missing const to declaration --- glm/detail/type_mat4x4.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/detail/type_mat4x4.hpp b/glm/detail/type_mat4x4.hpp index 4766f1d6..a0008c50 100644 --- a/glm/detail/type_mat4x4.hpp +++ b/glm/detail/type_mat4x4.hpp @@ -210,7 +210,7 @@ namespace glm GLM_FUNC_DECL typename tmat4x4::col_type operator/(tmat4x4 const & m, typename tmat4x4::row_type const & v); template - GLM_FUNC_DECL typename tmat4x4::row_type operator/(typename tmat4x4::col_type & v, tmat4x4 const & m); + GLM_FUNC_DECL typename tmat4x4::row_type operator/(typename tmat4x4::col_type const & v, tmat4x4 const & m); template GLM_FUNC_DECL tmat4x4 operator/(tmat4x4 const & m1, tmat4x4 const & m2); From 8e7a3a905381538ea77631721d47502a5ddb771c Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Sun, 13 Mar 2016 21:32:33 +0200 Subject: [PATCH 02/26] Add missing operator function definitions --- glm/detail/type_vec4.inl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index 3a929a01..78622734 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -801,6 +801,16 @@ namespace glm v.w / scalar); } + template + GLM_FUNC_QUALIFIER tvec4 operator/(tvec4 const & v, tvec1 const & scalar) + { + 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) { @@ -811,6 +821,16 @@ namespace glm scalar / v.w); } + template + GLM_FUNC_DECL tvec4 operator/(tvec1 const & scalar, tvec4 const & v) + { + 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 798e4f0e78c56c6d45c0e26ed23345e9e4fb6d93 Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Sun, 13 Mar 2016 21:32:41 +0200 Subject: [PATCH 03/26] Remove (old?) operator/ member functions These don't seem to have matching definitions and they conflict with similar functions in the glm namespace (in the same header files). --- glm/detail/type_mat2x2.hpp | 5 ----- glm/detail/type_mat3x3.hpp | 5 ----- glm/detail/type_mat4x4.hpp | 5 ----- 3 files changed, 15 deletions(-) diff --git a/glm/detail/type_mat2x2.hpp b/glm/detail/type_mat2x2.hpp index 0388e759..130bc7e6 100644 --- a/glm/detail/type_mat2x2.hpp +++ b/glm/detail/type_mat2x2.hpp @@ -49,11 +49,6 @@ namespace glm typedef tmat2x2 transpose_type; typedef T value_type; - template - friend tvec2 operator/(tmat2x2 const & m, tvec2 const & v); - template - friend tvec2 operator/(tvec2 const & v, tmat2x2 const & m); - private: col_type value[2]; diff --git a/glm/detail/type_mat3x3.hpp b/glm/detail/type_mat3x3.hpp index 806ae811..3b90536b 100644 --- a/glm/detail/type_mat3x3.hpp +++ b/glm/detail/type_mat3x3.hpp @@ -49,11 +49,6 @@ namespace glm typedef tmat3x3 transpose_type; typedef T value_type; - template - friend tvec3 operator/(tmat3x3 const & m, tvec3 const & v); - template - friend tvec3 operator/(tvec3 const & v, tmat3x3 const & m); - private: col_type value[3]; diff --git a/glm/detail/type_mat4x4.hpp b/glm/detail/type_mat4x4.hpp index a0008c50..c210f396 100644 --- a/glm/detail/type_mat4x4.hpp +++ b/glm/detail/type_mat4x4.hpp @@ -49,11 +49,6 @@ namespace glm typedef tmat4x4 transpose_type; typedef T value_type; - template - friend tvec4 operator/(tmat4x4 const & m, tvec4 const & v); - template - friend tvec4 operator/(tvec4 const & v, tmat4x4 const & m); - private: col_type value[4]; From 7f1bb02a26219fdf454ddef056c9f9d62b91a2fa Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 14 Mar 2016 22:29:55 +0100 Subject: [PATCH 04/26] Invert when static and dynamic lib messages appears --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f9fc72b0..12d8abbd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,12 +17,12 @@ enable_testing() add_definitions(-D_CRT_SECURE_NO_WARNINGS) option(GLM_STATIC_LIBRARY_ENABLE "GLM static library" OFF) -if(NOT GLM_STATIC_LIBRARY_ENABLE) +if(GLM_STATIC_LIBRARY_ENABLE) message(STATUS "GLM is a header only library, no need to build it. Set the option GLM_STATIC_LIBRARY_ENABLE with ON to build an optional static library") endif() option(GLM_DYNAMIC_LIBRARY_ENABLE "GLM static library" OFF) -if(NOT GLM_DYNAMIC_LIBRARY_ENABLE) +if(GLM_DYNAMIC_LIBRARY_ENABLE) message(STATUS "GLM is a header only library, no need to build it. Set the option GLM_DYNAMIC_LIBRARY_ENABLE with ON to build an optional dynamic library") endif() From 1e192be3701e22b35b8fe24f6de28bebef98bdf6 Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Tue, 15 Mar 2016 02:20:15 +0200 Subject: [PATCH 05/26] Remove const & from POD to match other functions in class --- glm/detail/type_vec4.hpp | 8 ++++---- glm/detail/type_vec4.inl | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index 4668ff81..067b3ed7 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -346,7 +346,7 @@ namespace detail // -- Binary operators -- template - GLM_FUNC_DECL tvec4 operator+(tvec4 const & v, const T& scalar); + GLM_FUNC_DECL tvec4 operator+(tvec4 const & v, T scalar); template GLM_FUNC_DECL tvec4 operator+(tvec4 const & v1, tvec1 const & v2); @@ -361,7 +361,7 @@ namespace detail GLM_FUNC_DECL tvec4 operator+(tvec4 const & v1, tvec4 const & v2); template - GLM_FUNC_DECL tvec4 operator-(tvec4 const & v, const T& scalar); + GLM_FUNC_DECL tvec4 operator-(tvec4 const & v, T scalar); template GLM_FUNC_DECL tvec4 operator-(tvec4 const & v1, tvec1 const & v2); @@ -376,7 +376,7 @@ namespace detail GLM_FUNC_DECL tvec4 operator-(tvec4 const & v1, tvec4 const & v2); template - GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, const T& scalar); + GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, T scalar); template GLM_FUNC_DECL tvec4 operator*(tvec4 const & v1, tvec1 const & v2); @@ -391,7 +391,7 @@ namespace detail GLM_FUNC_DECL tvec4 operator*(tvec4 const & v1, tvec4 const & v2); template - GLM_FUNC_DECL tvec4 operator/(tvec4 const & v, const T& scalar); + GLM_FUNC_DECL tvec4 operator/(tvec4 const & v, T scalar); template GLM_FUNC_DECL tvec4 operator/(tvec4 const & v, tvec1 const & scalar); diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index 78622734..3ef51fdf 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -642,7 +642,7 @@ namespace glm // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER tvec4 operator+(tvec4 const & v, const T& scalar) + GLM_FUNC_QUALIFIER tvec4 operator+(tvec4 const & v, T scalar) { return tvec4( v.x + scalar, @@ -692,7 +692,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator-(tvec4 const & v, const T& scalar) + GLM_FUNC_QUALIFIER tvec4 operator-(tvec4 const & v, T scalar) { return tvec4( v.x - scalar, @@ -742,7 +742,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator*(tvec4 const & v, const T& scalar) + GLM_FUNC_QUALIFIER tvec4 operator*(tvec4 const & v, T scalar) { return tvec4( v.x * scalar, @@ -792,7 +792,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator/(tvec4 const & v, const T& scalar) + GLM_FUNC_QUALIFIER tvec4 operator/(tvec4 const & v, T scalar) { return tvec4( v.x / scalar, From 236fed9d93ac4f1363db3706823e52f47c60f12a Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Tue, 15 Mar 2016 02:21:42 +0200 Subject: [PATCH 06/26] Add const & to POD to match other functions in the class --- glm/detail/type_mat2x4.hpp | 4 ++-- glm/detail/type_mat2x4.inl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/glm/detail/type_mat2x4.hpp b/glm/detail/type_mat2x4.hpp index 7e0cc87d..45dfe142 100644 --- a/glm/detail/type_mat2x4.hpp +++ b/glm/detail/type_mat2x4.hpp @@ -177,10 +177,10 @@ namespace glm GLM_FUNC_DECL tmat3x4 operator*(tmat2x4 const & m1, tmat3x2 const & m2); template - GLM_FUNC_DECL tmat2x4 operator/(tmat2x4 const & m, const T& s); + GLM_FUNC_DECL tmat2x4 operator/(tmat2x4 const & m, T const & s); template - GLM_FUNC_DECL tmat2x4 operator/(T s, tmat2x4 const & m); + GLM_FUNC_DECL tmat2x4 operator/(T const & s, tmat2x4 const & m); // -- Boolean operators -- diff --git a/glm/detail/type_mat2x4.inl b/glm/detail/type_mat2x4.inl index cac649f6..8d6f824e 100644 --- a/glm/detail/type_mat2x4.inl +++ b/glm/detail/type_mat2x4.inl @@ -493,7 +493,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat2x4 operator/(tmat2x4 const & m, const T& s) + GLM_FUNC_QUALIFIER tmat2x4 operator/(tmat2x4 const & m, T const & s) { return tmat2x4( m[0] / s, @@ -501,7 +501,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat2x4 operator/(T s, tmat2x4 const & m) + GLM_FUNC_QUALIFIER tmat2x4 operator/(T const & s, tmat2x4 const & m) { return tmat2x4( s / m[0], From 21fb034338adbfbbbcc97dd6be9970384d837837 Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Tue, 15 Mar 2016 02:22:48 +0200 Subject: [PATCH 07/26] Add missing boolean operator declarations --- glm/gtc/quaternion.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/glm/gtc/quaternion.hpp b/glm/gtc/quaternion.hpp index a7055fae..0832f7f3 100644 --- a/glm/gtc/quaternion.hpp +++ b/glm/gtc/quaternion.hpp @@ -170,6 +170,14 @@ namespace glm template GLM_FUNC_DECL tquat operator/(tquat const & q, T const & s); + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(tquat const & q1, tquat const & q2); + + template + GLM_FUNC_DECL bool operator!=(tquat const & q1, tquat const & q2); + /// Returns the length of the quaternion. /// /// @see gtc_quaternion From 131b85f4b977048e31c290a1e55ff0486056116a Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Tue, 15 Mar 2016 02:36:33 +0200 Subject: [PATCH 08/26] Fix declarations (use tdualquat instead of tquat) --- glm/gtx/dual_quaternion.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/glm/gtx/dual_quaternion.hpp b/glm/gtx/dual_quaternion.hpp index 9bef77dd..6845bbcf 100644 --- a/glm/gtx/dual_quaternion.hpp +++ b/glm/gtx/dual_quaternion.hpp @@ -130,16 +130,16 @@ namespace glm GLM_FUNC_DECL tdualquat operator*(tdualquat const & q, tdualquat const & p); template - GLM_FUNC_DECL tvec3 operator*(tquat const & q, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator*(tdualquat const & q, tvec3 const & v); template - GLM_FUNC_DECL tvec3 operator*(tvec3 const & v, tquat const & q); + GLM_FUNC_DECL tvec3 operator*(tvec3 const & v, tdualquat const & q); template - GLM_FUNC_DECL tvec4 operator*(tquat const & q, tvec4 const & v); + GLM_FUNC_DECL tvec4 operator*(tdualquat const & q, tvec4 const & v); template - GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, tquat const & q); + GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, tdualquat const & q); template GLM_FUNC_DECL tdualquat operator*(tdualquat const & q, T const & s); From 55d7b07e123f5282438bf64d96b67c121b302a64 Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Tue, 15 Mar 2016 02:37:38 +0200 Subject: [PATCH 09/26] Add missing boolean operator declarations --- glm/gtx/dual_quaternion.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/glm/gtx/dual_quaternion.hpp b/glm/gtx/dual_quaternion.hpp index 6845bbcf..cddf1fe6 100644 --- a/glm/gtx/dual_quaternion.hpp +++ b/glm/gtx/dual_quaternion.hpp @@ -150,6 +150,14 @@ namespace glm template GLM_FUNC_DECL tdualquat operator/(tdualquat const & q, T const & s); + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(tdualquat const & q1, tdualquat const & q2); + + template + GLM_FUNC_DECL bool operator!=(tdualquat const & q1, tdualquat const & q2); + /// Returns the normalized quaternion. /// /// @see gtx_dual_quaternion From 2d54f437f1a88c33f12b8d321e369ddc8ae13749 Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Tue, 15 Mar 2016 02:38:16 +0200 Subject: [PATCH 10/26] Fix operator-(), add operator+() --- glm/gtx/dual_quaternion.inl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/glm/gtx/dual_quaternion.inl b/glm/gtx/dual_quaternion.inl index 961dd1ca..fd41dcdc 100644 --- a/glm/gtx/dual_quaternion.inl +++ b/glm/gtx/dual_quaternion.inl @@ -194,11 +194,17 @@ namespace glm // -- Unary bit operators -- template - GLM_FUNC_QUALIFIER tdualquat operator-(tdualquat const & q) + GLM_FUNC_QUALIFIER tdualquat operator+(tdualquat const & q) { return q; } + template + GLM_FUNC_QUALIFIER tdualquat operator-(tdualquat const & q) + { + return tdualquat(-q.real, -q.dual); + } + // -- Binary operators -- template From 99d3486e1fb044a524702d424b9c3f383b13b884 Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Tue, 15 Mar 2016 03:24:53 +0200 Subject: [PATCH 11/26] Rename tvec1 parameters from scalar to v1/v2 --- glm/detail/type_vec4.hpp | 4 ++-- glm/detail/type_vec4.inl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index 067b3ed7..624bcf8f 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -394,13 +394,13 @@ namespace detail GLM_FUNC_DECL tvec4 operator/(tvec4 const & v, 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 3ef51fdf..29b78bf5 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -802,7 +802,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator/(tvec4 const & v, tvec1 const & scalar) + GLM_FUNC_QUALIFIER tvec4 operator/(tvec4 const & v1, tvec1 const & v2) { return tvec4( v1.x / v2.x, @@ -822,7 +822,7 @@ namespace glm } template - GLM_FUNC_DECL tvec4 operator/(tvec1 const & scalar, tvec4 const & v) + GLM_FUNC_DECL tvec4 operator/(tvec1 const & v1, tvec4 const & v2) { return tvec4( v1.x / v2.x, From 61d58b0296b5ebcb459f312d0af586e330d020d7 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 19 Mar 2016 12:28:18 +0100 Subject: [PATCH 12/26] Fixed missing GLM_PLATFORM_CYGWIN declaration #495 --- glm/detail/setup.hpp | 1 + readme.md | 1 + 2 files changed, 2 insertions(+) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index f8378ee0..d14d0e25 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -62,6 +62,7 @@ #define GLM_PLATFORM_UNIX 0x00400000 #define GLM_PLATFORM_QNXNTO 0x00800000 #define GLM_PLATFORM_WINCE 0x01000000 +#define GLM_PLATFORM_CYGWIN 0x02000000 #ifdef GLM_FORCE_PLATFORM_UNKNOWN # define GLM_PLATFORM GLM_PLATFORM_UNKNOWN diff --git a/readme.md b/readme.md index e637bc4b..af96182c 100644 --- a/readme.md +++ b/readme.md @@ -58,6 +58,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) - Fixed outerProduct defintions and operator signatures for mat2x4 and vec4 #475 - Fixed eulerAngles precision error, returns NaN #451 - Fixed undefined reference errors #489 +- Fixed missing GLM_PLATFORM_CYGWIN declaration #495 #### [GLM 0.9.7.3](https://github.com/g-truc/glm/releases/tag/0.9.7.3) - 2016-02-21 ##### Improvements: From 6c61c332f40f6bc191e62867b10b489fe666d9c6 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 19 Mar 2016 12:31:19 +0100 Subject: [PATCH 13/26] Fixed missing GLM_PLATFORM_CYGWIN declaration #495 --- glm/detail/setup.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index d14d0e25..60cda8b3 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -42,11 +42,11 @@ #define GLM_VERSION_MAJOR 0 #define GLM_VERSION_MINOR 9 #define GLM_VERSION_PATCH 7 -#define GLM_VERSION_REVISION 3 +#define GLM_VERSION_REVISION 4 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_VERSION_DISPLAYED)) # define GLM_MESSAGE_VERSION_DISPLAYED -# pragma message ("GLM: version 0.9.7.3") +# pragma message ("GLM: version 0.9.7.4") #endif//GLM_MESSAGE /////////////////////////////////////////////////////////////////////////////////// From 785c8892d98ab1a5cb69c0e71e289012dd090d7e Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Sun, 13 Mar 2016 21:32:06 +0200 Subject: [PATCH 14/26] Add missing const to declaration --- glm/detail/type_mat4x4.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/detail/type_mat4x4.hpp b/glm/detail/type_mat4x4.hpp index 1690bf1d..a88e8152 100644 --- a/glm/detail/type_mat4x4.hpp +++ b/glm/detail/type_mat4x4.hpp @@ -225,7 +225,7 @@ namespace glm GLM_FUNC_DECL typename tmat4x4::col_type operator/(tmat4x4 const & m, typename tmat4x4::row_type const & v); template - GLM_FUNC_DECL typename tmat4x4::row_type operator/(typename tmat4x4::col_type & v, tmat4x4 const & m); + GLM_FUNC_DECL typename tmat4x4::row_type operator/(typename tmat4x4::col_type const & v, tmat4x4 const & m); template GLM_FUNC_DECL tmat4x4 operator/(tmat4x4 const & m1, tmat4x4 const & m2); From d3036fd010f431ea340a9647a88aabeeb4795aef Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Sun, 13 Mar 2016 21:32:33 +0200 Subject: [PATCH 15/26] Add missing operator function definitions --- glm/detail/type_vec4.inl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index 514161ea..916d7222 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -823,6 +823,16 @@ namespace glm v.w / scalar); } + template + GLM_FUNC_QUALIFIER tvec4 operator/(tvec4 const & v, tvec1 const & scalar) + { + 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) { @@ -833,6 +843,16 @@ namespace glm scalar / v.w); } + template + GLM_FUNC_DECL tvec4 operator/(tvec1 const & scalar, tvec4 const & v) + { + 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 b7fef63ef867d09d921a184eb68412b799a455e4 Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Tue, 15 Mar 2016 02:20:15 +0200 Subject: [PATCH 16/26] Remove const & from POD to match other functions in class --- glm/detail/type_vec4.hpp | 8 ++++---- glm/detail/type_vec4.inl | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index 37ae9a7c..84011ddf 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -360,7 +360,7 @@ namespace detail // -- Binary operators -- template - GLM_FUNC_DECL tvec4 operator+(tvec4 const & v, const T& scalar); + GLM_FUNC_DECL tvec4 operator+(tvec4 const & v, T scalar); template GLM_FUNC_DECL tvec4 operator+(tvec4 const & v1, tvec1 const & v2); @@ -375,7 +375,7 @@ namespace detail GLM_FUNC_DECL tvec4 operator+(tvec4 const & v1, tvec4 const & v2); template - GLM_FUNC_DECL tvec4 operator-(tvec4 const & v, const T& scalar); + GLM_FUNC_DECL tvec4 operator-(tvec4 const & v, T scalar); template GLM_FUNC_DECL tvec4 operator-(tvec4 const & v1, tvec1 const & v2); @@ -390,7 +390,7 @@ namespace detail GLM_FUNC_DECL tvec4 operator-(tvec4 const & v1, tvec4 const & v2); template - GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, const T& scalar); + GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, T scalar); template GLM_FUNC_DECL tvec4 operator*(tvec4 const & v1, tvec1 const & v2); @@ -405,7 +405,7 @@ namespace detail GLM_FUNC_DECL tvec4 operator*(tvec4 const & v1, tvec4 const & v2); template - GLM_FUNC_DECL tvec4 operator/(tvec4 const & v, const T& scalar); + GLM_FUNC_DECL tvec4 operator/(tvec4 const & v, T scalar); template GLM_FUNC_DECL tvec4 operator/(tvec4 const & v, tvec1 const & scalar); diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index 916d7222..0d7ed59a 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -664,7 +664,7 @@ namespace glm // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER tvec4 operator+(tvec4 const & v, const T& scalar) + GLM_FUNC_QUALIFIER tvec4 operator+(tvec4 const & v, T scalar) { return tvec4( v.x + scalar, @@ -714,7 +714,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator-(tvec4 const & v, const T& scalar) + GLM_FUNC_QUALIFIER tvec4 operator-(tvec4 const & v, T scalar) { return tvec4( v.x - scalar, @@ -764,7 +764,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator*(tvec4 const & v, const T& scalar) + GLM_FUNC_QUALIFIER tvec4 operator*(tvec4 const & v, T scalar) { return tvec4( v.x * scalar, @@ -814,7 +814,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator/(tvec4 const & v, const T& scalar) + GLM_FUNC_QUALIFIER tvec4 operator/(tvec4 const & v, T scalar) { return tvec4( v.x / scalar, From 8662a567b22053178cda9510a55b37c4752c11d9 Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Tue, 15 Mar 2016 02:21:42 +0200 Subject: [PATCH 17/26] Add const & to POD to match other functions in the class --- glm/detail/type_mat2x4.hpp | 4 ++-- glm/detail/type_mat2x4.inl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/glm/detail/type_mat2x4.hpp b/glm/detail/type_mat2x4.hpp index b06ae7c6..592ed65e 100644 --- a/glm/detail/type_mat2x4.hpp +++ b/glm/detail/type_mat2x4.hpp @@ -192,10 +192,10 @@ namespace glm GLM_FUNC_DECL tmat3x4 operator*(tmat2x4 const & m1, tmat3x2 const & m2); template - GLM_FUNC_DECL tmat2x4 operator/(tmat2x4 const & m, const T& s); + GLM_FUNC_DECL tmat2x4 operator/(tmat2x4 const & m, T const & s); template - GLM_FUNC_DECL tmat2x4 operator/(T s, tmat2x4 const & m); + GLM_FUNC_DECL tmat2x4 operator/(T const & s, tmat2x4 const & m); // -- Boolean operators -- diff --git a/glm/detail/type_mat2x4.inl b/glm/detail/type_mat2x4.inl index cac649f6..8d6f824e 100644 --- a/glm/detail/type_mat2x4.inl +++ b/glm/detail/type_mat2x4.inl @@ -493,7 +493,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat2x4 operator/(tmat2x4 const & m, const T& s) + GLM_FUNC_QUALIFIER tmat2x4 operator/(tmat2x4 const & m, T const & s) { return tmat2x4( m[0] / s, @@ -501,7 +501,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat2x4 operator/(T s, tmat2x4 const & m) + GLM_FUNC_QUALIFIER tmat2x4 operator/(T const & s, tmat2x4 const & m) { return tmat2x4( s / m[0], From ece2b8b5a2837ae87e7e5079346f429a930bf8a8 Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Tue, 15 Mar 2016 02:22:48 +0200 Subject: [PATCH 18/26] Add missing boolean operator declarations --- glm/gtc/quaternion.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/glm/gtc/quaternion.hpp b/glm/gtc/quaternion.hpp index 6fae5cc6..5e9c8cd5 100644 --- a/glm/gtc/quaternion.hpp +++ b/glm/gtc/quaternion.hpp @@ -184,6 +184,14 @@ namespace glm template GLM_FUNC_DECL tquat operator/(tquat const & q, T const & s); + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(tquat const & q1, tquat const & q2); + + template + GLM_FUNC_DECL bool operator!=(tquat const & q1, tquat const & q2); + /// Returns the length of the quaternion. /// /// @see gtc_quaternion From 42b818d4bbf9e30fc29025095d1e55cf79310194 Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Tue, 15 Mar 2016 02:36:33 +0200 Subject: [PATCH 19/26] Fix declarations (use tdualquat instead of tquat) --- glm/gtx/dual_quaternion.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/glm/gtx/dual_quaternion.hpp b/glm/gtx/dual_quaternion.hpp index 0b083295..195cd269 100644 --- a/glm/gtx/dual_quaternion.hpp +++ b/glm/gtx/dual_quaternion.hpp @@ -144,16 +144,16 @@ namespace glm GLM_FUNC_DECL tdualquat operator*(tdualquat const & q, tdualquat const & p); template - GLM_FUNC_DECL tvec3 operator*(tquat const & q, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator*(tdualquat const & q, tvec3 const & v); template - GLM_FUNC_DECL tvec3 operator*(tvec3 const & v, tquat const & q); + GLM_FUNC_DECL tvec3 operator*(tvec3 const & v, tdualquat const & q); template - GLM_FUNC_DECL tvec4 operator*(tquat const & q, tvec4 const & v); + GLM_FUNC_DECL tvec4 operator*(tdualquat const & q, tvec4 const & v); template - GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, tquat const & q); + GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, tdualquat const & q); template GLM_FUNC_DECL tdualquat operator*(tdualquat const & q, T const & s); From c7700573a44d919a388a60dfe59c7308b9473260 Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Tue, 15 Mar 2016 02:37:38 +0200 Subject: [PATCH 20/26] Add missing boolean operator declarations --- glm/gtx/dual_quaternion.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/glm/gtx/dual_quaternion.hpp b/glm/gtx/dual_quaternion.hpp index 195cd269..4670dccf 100644 --- a/glm/gtx/dual_quaternion.hpp +++ b/glm/gtx/dual_quaternion.hpp @@ -164,6 +164,14 @@ namespace glm template GLM_FUNC_DECL tdualquat operator/(tdualquat const & q, T const & s); + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(tdualquat const & q1, tdualquat const & q2); + + template + GLM_FUNC_DECL bool operator!=(tdualquat const & q1, tdualquat const & q2); + /// Returns the normalized quaternion. /// /// @see gtx_dual_quaternion From ad9bfffe65adef915de45455d97aa38339a9944f Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Tue, 15 Mar 2016 02:38:16 +0200 Subject: [PATCH 21/26] Fix operator-(), add operator+() --- glm/gtx/dual_quaternion.inl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/glm/gtx/dual_quaternion.inl b/glm/gtx/dual_quaternion.inl index 961dd1ca..fd41dcdc 100644 --- a/glm/gtx/dual_quaternion.inl +++ b/glm/gtx/dual_quaternion.inl @@ -194,11 +194,17 @@ namespace glm // -- Unary bit operators -- template - GLM_FUNC_QUALIFIER tdualquat operator-(tdualquat const & q) + GLM_FUNC_QUALIFIER tdualquat operator+(tdualquat const & q) { return q; } + template + GLM_FUNC_QUALIFIER tdualquat operator-(tdualquat const & q) + { + return tdualquat(-q.real, -q.dual); + } + // -- Binary operators -- template From 578c4f4f9f592034be30ae554360bf5fae72afb7 Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Tue, 15 Mar 2016 03:24:53 +0200 Subject: [PATCH 22/26] Rename tvec1 parameters from scalar to v1/v2 --- glm/detail/type_vec4.hpp | 4 ++-- glm/detail/type_vec4.inl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index 84011ddf..1cbcefdd 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -408,13 +408,13 @@ namespace detail GLM_FUNC_DECL tvec4 operator/(tvec4 const & v, 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 0d7ed59a..9b35d0b1 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -824,7 +824,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator/(tvec4 const & v, tvec1 const & scalar) + GLM_FUNC_QUALIFIER tvec4 operator/(tvec4 const & v1, tvec1 const & v2) { return tvec4( v1.x / v2.x, @@ -844,7 +844,7 @@ namespace glm } template - GLM_FUNC_DECL tvec4 operator/(tvec1 const & scalar, tvec4 const & v) + GLM_FUNC_DECL tvec4 operator/(tvec1 const & v1, tvec4 const & v2) { return tvec4( v1.x / v2.x, From 407d671954030b5875f3ad0328f2810ab7839f37 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 19 Mar 2016 12:37:39 +0100 Subject: [PATCH 23/26] Updated readme --- readme.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index af96182c..716328a3 100644 --- a/readme.md +++ b/readme.md @@ -51,7 +51,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) ## Release notes -#### [GLM 0.9.7.4](https://github.com/g-truc/glm/tree/0.9.7) - 2016-XX-XX +#### [GLM 0.9.7.4](https://github.com/g-truc/glm/releases/tag/0.9.7.4) - 2016-03-19 ##### Fixes: - Fixed asinh and atanh warning with C++98 STL #484 - Fixed polar coordinates function latitude #485 @@ -59,6 +59,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) - Fixed eulerAngles precision error, returns NaN #451 - Fixed undefined reference errors #489 - Fixed missing GLM_PLATFORM_CYGWIN declaration #495 +- Fixed various undefined reference errors #490 #### [GLM 0.9.7.3](https://github.com/g-truc/glm/releases/tag/0.9.7.3) - 2016-02-21 ##### Improvements: From b0091cfbc562b1ad909a17b172979dbd5f04b2f0 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 19 Mar 2016 15:38:21 +0100 Subject: [PATCH 24/26] Fixed readme --- readme.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/readme.md b/readme.md index 64161fff..1bf66230 100644 --- a/readme.md +++ b/readme.md @@ -51,7 +51,6 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) ## Release notes -<<<<<<< HEAD #### [GLM 0.9.8.0](https://github.com/g-truc/glm/releases/latest) - 2016-XX-XX ##### Features: - Added right and left handed projection and clip control support #447 #415 #119 @@ -77,10 +76,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) ##### Deprecation: - Removed GLM_FORCE_SIZE_FUNC define -#### [GLM 0.9.7.4](https://github.com/g-truc/glm/tree/0.9.7) - 2016-XX-XX -======= #### [GLM 0.9.7.4](https://github.com/g-truc/glm/releases/tag/0.9.7.4) - 2016-03-19 ->>>>>>> 0.9.7 ##### Fixes: - Fixed asinh and atanh warning with C++98 STL #484 - Fixed polar coordinates function latitude #485 From bbe076549a630d47f0e5218fcbdecd89cabfb401 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 19 Mar 2016 17:10:42 +0100 Subject: [PATCH 25/26] Improved coding style consistency, scalars are passed by copy --- glm/detail/type_mat2x2.hpp | 24 +++++------ glm/detail/type_mat2x2.inl | 78 +++++++++++++++++----------------- glm/detail/type_vec1.hpp | 62 +++++++++++++-------------- glm/detail/type_vec1.inl | 62 +++++++++++++-------------- glm/detail/type_vec2.hpp | 46 ++++++++++---------- glm/detail/type_vec2.inl | 50 +++++++++++----------- glm/detail/type_vec3.hpp | 86 +++++++++++++++++++------------------- glm/detail/type_vec3.inl | 50 +++++++++++----------- 8 files changed, 229 insertions(+), 229 deletions(-) diff --git a/glm/detail/type_mat2x2.hpp b/glm/detail/type_mat2x2.hpp index 130bc7e6..c0a99e35 100644 --- a/glm/detail/type_mat2x2.hpp +++ b/glm/detail/type_mat2x2.hpp @@ -61,7 +61,7 @@ namespace glm GLM_FUNC_DECL tmat2x2(tmat2x2 const & m); GLM_FUNC_DECL explicit tmat2x2(ctor); - GLM_FUNC_DECL explicit tmat2x2(T const & x); + GLM_FUNC_DECL explicit tmat2x2(T scalar); GLM_FUNC_DECL tmat2x2( T const & x1, T const & y1, T const & x2, T const & y2); @@ -145,28 +145,28 @@ namespace glm // -- Binary operators -- template - GLM_FUNC_DECL tmat2x2 operator+(tmat2x2 const & m, T const & s); + GLM_FUNC_DECL tmat2x2 operator+(tmat2x2 const & m, T scalar); template - GLM_FUNC_DECL tmat2x2 operator+(T const & s, tmat2x2 const & m); + GLM_FUNC_DECL tmat2x2 operator+(T scalar, tmat2x2 const & m); template - GLM_FUNC_DECL tmat2x2 operator+(tmat2x2 const & m1, tmat2x2 const & m2); + GLM_FUNC_DECL tmat2x2 operator+(tmat2x2 const & m1, tmat2x2 const & m2); template - GLM_FUNC_DECL tmat2x2 operator-(tmat2x2 const & m, T const & s); + GLM_FUNC_DECL tmat2x2 operator-(tmat2x2 const & m, T scalar); template - GLM_FUNC_DECL tmat2x2 operator-(T const & s, tmat2x2 const & m); + GLM_FUNC_DECL tmat2x2 operator-(T scalar, tmat2x2 const & m); template - GLM_FUNC_DECL tmat2x2 operator-(tmat2x2 const & m1, tmat2x2 const & m2); + GLM_FUNC_DECL tmat2x2 operator-(tmat2x2 const & m1, tmat2x2 const & m2); template - GLM_FUNC_DECL tmat2x2 operator*(tmat2x2 const & m, T const & s); + GLM_FUNC_DECL tmat2x2 operator*(tmat2x2 const & m, T scalar); template - GLM_FUNC_DECL tmat2x2 operator*(T const & s, tmat2x2 const & m); + GLM_FUNC_DECL tmat2x2 operator*(T scalar, tmat2x2 const & m); template GLM_FUNC_DECL typename tmat2x2::col_type operator*(tmat2x2 const & m, typename tmat2x2::row_type const & v); @@ -175,7 +175,7 @@ namespace glm GLM_FUNC_DECL typename tmat2x2::row_type operator*(typename tmat2x2::col_type const & v, tmat2x2 const & m); template - GLM_FUNC_DECL tmat2x2 operator*(tmat2x2 const & m1, tmat2x2 const & m2); + GLM_FUNC_DECL tmat2x2 operator*(tmat2x2 const & m1, tmat2x2 const & m2); template GLM_FUNC_DECL tmat3x2 operator*(tmat2x2 const & m1, tmat3x2 const & m2); @@ -184,10 +184,10 @@ namespace glm GLM_FUNC_DECL tmat4x2 operator*(tmat2x2 const & m1, tmat4x2 const & m2); template - GLM_FUNC_DECL tmat2x2 operator/(tmat2x2 const & m, T const & s); + GLM_FUNC_DECL tmat2x2 operator/(tmat2x2 const & m, T scalar); template - GLM_FUNC_DECL tmat2x2 operator/(T const & s, tmat2x2 const & m); + GLM_FUNC_DECL tmat2x2 operator/(T scalar, tmat2x2 const & m); template GLM_FUNC_DECL typename tmat2x2::col_type operator/(tmat2x2 const & m, typename tmat2x2::row_type const & v); diff --git a/glm/detail/type_mat2x2.inl b/glm/detail/type_mat2x2.inl index 960fee57..db4758fa 100644 --- a/glm/detail/type_mat2x2.inl +++ b/glm/detail/type_mat2x2.inl @@ -85,10 +85,10 @@ namespace detail {} template - GLM_FUNC_QUALIFIER tmat2x2::tmat2x2(T const & s) + GLM_FUNC_QUALIFIER tmat2x2::tmat2x2(T scalar) { - this->value[0] = col_type(s, 0); - this->value[1] = col_type(0, s); + this->value[0] = col_type(scalar, 0); + this->value[1] = col_type(0, scalar); } template @@ -264,10 +264,10 @@ namespace detail template template - GLM_FUNC_QUALIFIER tmat2x2& tmat2x2::operator+=(U s) + GLM_FUNC_QUALIFIER tmat2x2& tmat2x2::operator+=(U scalar) { - this->value[0] += s; - this->value[1] += s; + this->value[0] += scalar; + this->value[1] += scalar; return *this; } @@ -282,10 +282,10 @@ namespace detail template template - GLM_FUNC_QUALIFIER tmat2x2& tmat2x2::operator-=(U s) + GLM_FUNC_QUALIFIER tmat2x2& tmat2x2::operator-=(U scalar) { - this->value[0] -= s; - this->value[1] -= s; + this->value[0] -= scalar; + this->value[1] -= scalar; return *this; } @@ -300,10 +300,10 @@ namespace detail template template - GLM_FUNC_QUALIFIER tmat2x2& tmat2x2::operator*=(U s) + GLM_FUNC_QUALIFIER tmat2x2& tmat2x2::operator*=(U scalar) { - this->value[0] *= s; - this->value[1] *= s; + this->value[0] *= scalar; + this->value[1] *= scalar; return *this; } @@ -316,10 +316,10 @@ namespace detail template template - GLM_FUNC_QUALIFIER tmat2x2& tmat2x2::operator/=(U s) + GLM_FUNC_QUALIFIER tmat2x2& tmat2x2::operator/=(U scalar) { - this->value[0] /= s; - this->value[1] /= s; + this->value[0] /= scalar; + this->value[1] /= scalar; return *this; } @@ -383,19 +383,19 @@ namespace detail // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER tmat2x2 operator+(tmat2x2 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat2x2 operator+(tmat2x2 const & m, T scalar) { return tmat2x2( - m[0] + s, - m[1] + s); + m[0] + scalar, + m[1] + scalar); } template - GLM_FUNC_QUALIFIER tmat2x2 operator+(T const & s, tmat2x2 const & m) + GLM_FUNC_QUALIFIER tmat2x2 operator+(T scalar, tmat2x2 const & m) { return tmat2x2( - m[0] + s, - m[1] + s); + m[0] + scalar, + m[1] + scalar); } template @@ -407,19 +407,19 @@ namespace detail } template - GLM_FUNC_QUALIFIER tmat2x2 operator-(tmat2x2 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat2x2 operator-(tmat2x2 const & m, T scalar) { return tmat2x2( - m[0] - s, - m[1] - s); + m[0] - scalar, + m[1] - scalar); } template - GLM_FUNC_QUALIFIER tmat2x2 operator-(T const & s, tmat2x2 const & m) + GLM_FUNC_QUALIFIER tmat2x2 operator-(T scalar, tmat2x2 const & m) { return tmat2x2( - s - m[0], - s - m[1]); + scalar - m[0], + scalar - m[1]); } template @@ -431,19 +431,19 @@ namespace detail } template - GLM_FUNC_QUALIFIER tmat2x2 operator*(tmat2x2 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat2x2 operator*(tmat2x2 const & m, T scalar) { return tmat2x2( - m[0] * s, - m[1] * s); + m[0] * scalar, + m[1] * scalar); } template - GLM_FUNC_QUALIFIER tmat2x2 operator*(T const & s, tmat2x2 const & m) + GLM_FUNC_QUALIFIER tmat2x2 operator*(T scalar, tmat2x2 const & m) { return tmat2x2( - m[0] * s, - m[1] * s); + m[0] * scalar, + m[1] * scalar); } template @@ -507,19 +507,19 @@ namespace detail } template - GLM_FUNC_QUALIFIER tmat2x2 operator/(tmat2x2 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat2x2 operator/(tmat2x2 const & m, T scalar) { return tmat2x2( - m[0] / s, - m[1] / s); + m[0] / scalar, + m[1] / scalar); } template - GLM_FUNC_QUALIFIER tmat2x2 operator/(T const & s, tmat2x2 const & m) + GLM_FUNC_QUALIFIER tmat2x2 operator/(T scalar, tmat2x2 const & m) { return tmat2x2( - s / m[0], - s / m[1]); + scalar / m[0], + scalar / m[1]); } template diff --git a/glm/detail/type_vec1.hpp b/glm/detail/type_vec1.hpp index 40291ecb..c9708111 100644 --- a/glm/detail/type_vec1.hpp +++ b/glm/detail/type_vec1.hpp @@ -102,7 +102,7 @@ namespace glm // -- Explicit basic constructors -- GLM_FUNC_DECL explicit tvec1(ctor); - GLM_FUNC_DECL explicit tvec1(T const & scalar); + GLM_FUNC_DECL explicit tvec1(T scalar); // -- Conversion vector constructors -- @@ -137,19 +137,19 @@ namespace glm template GLM_FUNC_DECL tvec1 & operator=(tvec1 const & v); template - GLM_FUNC_DECL tvec1 & operator+=(U const & scalar); + GLM_FUNC_DECL tvec1 & operator+=(U scalar); template GLM_FUNC_DECL tvec1 & operator+=(tvec1 const & v); template - GLM_FUNC_DECL tvec1 & operator-=(U const & scalar); + GLM_FUNC_DECL tvec1 & operator-=(U scalar); template GLM_FUNC_DECL tvec1 & operator-=(tvec1 const & v); template - GLM_FUNC_DECL tvec1 & operator*=(U const & scalar); + GLM_FUNC_DECL tvec1 & operator*=(U scalar); template GLM_FUNC_DECL tvec1 & operator*=(tvec1 const & v); template - GLM_FUNC_DECL tvec1 & operator/=(U const & scalar); + GLM_FUNC_DECL tvec1 & operator/=(U scalar); template GLM_FUNC_DECL tvec1 & operator/=(tvec1 const & v); @@ -163,27 +163,27 @@ namespace glm // -- Unary bit operators -- template - GLM_FUNC_DECL tvec1 & operator%=(U const & scalar); + GLM_FUNC_DECL tvec1 & operator%=(U scalar); template GLM_FUNC_DECL tvec1 & operator%=(tvec1 const & v); template - GLM_FUNC_DECL tvec1 & operator&=(U const & scalar); + GLM_FUNC_DECL tvec1 & operator&=(U scalar); template GLM_FUNC_DECL tvec1 & operator&=(tvec1 const & v); template - GLM_FUNC_DECL tvec1 & operator|=(U const & scalar); + GLM_FUNC_DECL tvec1 & operator|=(U scalar); template GLM_FUNC_DECL tvec1 & operator|=(tvec1 const & v); template - GLM_FUNC_DECL tvec1 & operator^=(U const & scalar); + GLM_FUNC_DECL tvec1 & operator^=(U scalar); template GLM_FUNC_DECL tvec1 & operator^=(tvec1 const & v); template - GLM_FUNC_DECL tvec1 & operator<<=(U const & scalar); + GLM_FUNC_DECL tvec1 & operator<<=(U scalar); template GLM_FUNC_DECL tvec1 & operator<<=(tvec1 const & v); template - GLM_FUNC_DECL tvec1 & operator>>=(U const & scalar); + GLM_FUNC_DECL tvec1 & operator>>=(U scalar); template GLM_FUNC_DECL tvec1 & operator>>=(tvec1 const & v); }; @@ -199,91 +199,91 @@ namespace glm // -- Binary operators -- template - GLM_FUNC_DECL tvec1 operator+(tvec1 const & v, T const & scalar); + GLM_FUNC_DECL tvec1 operator+(tvec1 const & v, T scalar); template - GLM_FUNC_DECL tvec1 operator+(T const & scalar, tvec1 const & v); + GLM_FUNC_DECL tvec1 operator+(T scalar, 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 & scalar); + GLM_FUNC_DECL tvec1 operator-(tvec1 const & v, T scalar); template - GLM_FUNC_DECL tvec1 operator-(T const & scalar, tvec1 const & v); + GLM_FUNC_DECL tvec1 operator-(T scalar, 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 & scalar); + GLM_FUNC_DECL tvec1 operator*(tvec1 const & v, T scalar); template - GLM_FUNC_DECL tvec1 operator*(T const & scalar, tvec1 const & v); + GLM_FUNC_DECL tvec1 operator*(T scalar, 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 & scalar); + GLM_FUNC_DECL tvec1 operator/(tvec1 const & v, T scalar); template - GLM_FUNC_DECL tvec1 operator/(T const & scalar, tvec1 const & v); + GLM_FUNC_DECL tvec1 operator/(T scalar, 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 & scalar); + GLM_FUNC_DECL tvec1 operator%(tvec1 const & v, T scalar); template - GLM_FUNC_DECL tvec1 operator%(T const & scalar, tvec1 const & v); + GLM_FUNC_DECL tvec1 operator%(T scalar, 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 & scalar); + GLM_FUNC_DECL tvec1 operator&(tvec1 const & v, T scalar); template - GLM_FUNC_DECL tvec1 operator&(T const & scalar, tvec1 const & v); + GLM_FUNC_DECL tvec1 operator&(T scalar, 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 & scalar); + GLM_FUNC_DECL tvec1 operator|(tvec1 const & v, T scalar); template - GLM_FUNC_DECL tvec1 operator|(T const & scalar, tvec1 const & v); + GLM_FUNC_DECL tvec1 operator|(T scalar, 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 & scalar); + GLM_FUNC_DECL tvec1 operator^(tvec1 const & v, T scalar); template - GLM_FUNC_DECL tvec1 operator^(T const & scalar, tvec1 const & v); + GLM_FUNC_DECL tvec1 operator^(T scalar, 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 & scalar); + GLM_FUNC_DECL tvec1 operator<<(tvec1 const & v, T scalar); template - GLM_FUNC_DECL tvec1 operator<<(T const & scalar, tvec1 const & v); + GLM_FUNC_DECL tvec1 operator<<(T scalar, 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 & scalar); + GLM_FUNC_DECL tvec1 operator>>(tvec1 const & v, T scalar); template - GLM_FUNC_DECL tvec1 operator>>(T const & scalar, tvec1 const & v); + GLM_FUNC_DECL tvec1 operator>>(T scalar, tvec1 const & v); template GLM_FUNC_DECL tvec1 operator>>(tvec1 const & v1, tvec1 const & v2); diff --git a/glm/detail/type_vec1.inl b/glm/detail/type_vec1.inl index d1bf7cf5..5b4fa422 100644 --- a/glm/detail/type_vec1.inl +++ b/glm/detail/type_vec1.inl @@ -63,7 +63,7 @@ namespace glm {} template - GLM_FUNC_QUALIFIER tvec1::tvec1(T const & scalar) + GLM_FUNC_QUALIFIER tvec1::tvec1(T scalar) : x(scalar) {} @@ -136,7 +136,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec1 & tvec1::operator+=(U const & scalar) + GLM_FUNC_QUALIFIER tvec1 & tvec1::operator+=(U scalar) { this->x += static_cast(scalar); return *this; @@ -152,7 +152,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec1 & tvec1::operator-=(U const & scalar) + GLM_FUNC_QUALIFIER tvec1 & tvec1::operator-=(U scalar) { this->x -= static_cast(scalar); return *this; @@ -168,7 +168,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec1 & tvec1::operator*=(U const & scalar) + GLM_FUNC_QUALIFIER tvec1 & tvec1::operator*=(U scalar) { this->x *= static_cast(scalar); return *this; @@ -184,7 +184,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec1 & tvec1::operator/=(U const & scalar) + GLM_FUNC_QUALIFIER tvec1 & tvec1::operator/=(U scalar) { this->x /= static_cast(scalar); return *this; @@ -234,7 +234,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec1 & tvec1::operator%=(U const & scalar) + GLM_FUNC_QUALIFIER tvec1 & tvec1::operator%=(U scalar) { this->x %= static_cast(scalar); return *this; @@ -250,7 +250,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec1 & tvec1::operator&=(U const & scalar) + GLM_FUNC_QUALIFIER tvec1 & tvec1::operator&=(U scalar) { this->x &= static_cast(scalar); return *this; @@ -266,7 +266,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec1 & tvec1::operator|=(U const & scalar) + GLM_FUNC_QUALIFIER tvec1 & tvec1::operator|=(U scalar) { this->x |= static_cast(scalar); return *this; @@ -282,7 +282,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec1 & tvec1::operator^=(U const & scalar) + GLM_FUNC_QUALIFIER tvec1 & tvec1::operator^=(U scalar) { this->x ^= static_cast(scalar); return *this; @@ -298,7 +298,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec1 & tvec1::operator<<=(U const & scalar) + GLM_FUNC_QUALIFIER tvec1 & tvec1::operator<<=(U scalar) { this->x <<= static_cast(scalar); return *this; @@ -314,7 +314,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec1 & tvec1::operator>>=(U const & scalar) + GLM_FUNC_QUALIFIER tvec1 & tvec1::operator>>=(U scalar) { this->x >>= static_cast(scalar); return *this; @@ -346,14 +346,14 @@ namespace glm // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER tvec1 operator+(tvec1 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec1 operator+(tvec1 const & v, T scalar) { return tvec1( v.x + scalar); } template - GLM_FUNC_QUALIFIER tvec1 operator+(T const & scalar, tvec1 const & v) + GLM_FUNC_QUALIFIER tvec1 operator+(T scalar, tvec1 const & v) { return tvec1( scalar + v.x); @@ -368,14 +368,14 @@ namespace glm //operator- template - GLM_FUNC_QUALIFIER tvec1 operator-(tvec1 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec1 operator-(tvec1 const & v, T scalar) { return tvec1( v.x - scalar); } template - GLM_FUNC_QUALIFIER tvec1 operator-(T const & scalar, tvec1 const & v) + GLM_FUNC_QUALIFIER tvec1 operator-(T scalar, tvec1 const & v) { return tvec1( scalar - v.x); @@ -389,14 +389,14 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec1 operator*(tvec1 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec1 operator*(tvec1 const & v, T scalar) { return tvec1( v.x * scalar); } template - GLM_FUNC_QUALIFIER tvec1 operator*(T const & scalar, tvec1 const & v) + GLM_FUNC_QUALIFIER tvec1 operator*(T scalar, tvec1 const & v) { return tvec1( scalar * v.x); @@ -410,14 +410,14 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec1 operator/(tvec1 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec1 operator/(tvec1 const & v, T scalar) { return tvec1( v.x / scalar); } template - GLM_FUNC_QUALIFIER tvec1 operator/(T const & scalar, tvec1 const & v) + GLM_FUNC_QUALIFIER tvec1 operator/(T scalar, tvec1 const & v) { return tvec1( scalar / v.x); @@ -433,14 +433,14 @@ namespace glm // -- Binary bit operators -- template - GLM_FUNC_QUALIFIER tvec1 operator%(tvec1 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec1 operator%(tvec1 const & v, T scalar) { return tvec1( v.x % scalar); } template - GLM_FUNC_QUALIFIER tvec1 operator%(T const & scalar, tvec1 const & v) + GLM_FUNC_QUALIFIER tvec1 operator%(T scalar, tvec1 const & v) { return tvec1( scalar % v.x); @@ -454,14 +454,14 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec1 operator&(tvec1 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec1 operator&(tvec1 const & v, T scalar) { return tvec1( v.x & scalar); } template - GLM_FUNC_QUALIFIER tvec1 operator&(T const & scalar, tvec1 const & v) + GLM_FUNC_QUALIFIER tvec1 operator&(T scalar, tvec1 const & v) { return tvec1( scalar & v.x); @@ -475,14 +475,14 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec1 operator|(tvec1 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec1 operator|(tvec1 const & v, T scalar) { return tvec1( v.x | scalar); } template - GLM_FUNC_QUALIFIER tvec1 operator|(T const & scalar, tvec1 const & v) + GLM_FUNC_QUALIFIER tvec1 operator|(T scalar, tvec1 const & v) { return tvec1( scalar | v.x); @@ -496,14 +496,14 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec1 operator^(tvec1 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec1 operator^(tvec1 const & v, T scalar) { return tvec1( v.x ^ scalar); } template - GLM_FUNC_QUALIFIER tvec1 operator^(T const & scalar, tvec1 const & v) + GLM_FUNC_QUALIFIER tvec1 operator^(T scalar, tvec1 const & v) { return tvec1( scalar ^ v.x); @@ -517,14 +517,14 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec1 operator<<(tvec1 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec1 operator<<(tvec1 const & v, T scalar) { return tvec1( v.x << scalar); } template - GLM_FUNC_QUALIFIER tvec1 operator<<(T const & scalar, tvec1 const & v) + GLM_FUNC_QUALIFIER tvec1 operator<<(T scalar, tvec1 const & v) { return tvec1( scalar << v.x); @@ -538,14 +538,14 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec1 operator>>(tvec1 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec1 operator>>(tvec1 const & v, T scalar) { return tvec1( v.x >> scalar); } template - GLM_FUNC_QUALIFIER tvec1 operator>>(T const & scalar, tvec1 const & v) + GLM_FUNC_QUALIFIER tvec1 operator>>(T scalar, tvec1 const & v) { return tvec1( scalar >> v.x); diff --git a/glm/detail/type_vec2.hpp b/glm/detail/type_vec2.hpp index de425e10..4d9b8c70 100644 --- a/glm/detail/type_vec2.hpp +++ b/glm/detail/type_vec2.hpp @@ -102,14 +102,14 @@ namespace glm // -- Explicit basic constructors -- GLM_FUNC_DECL explicit tvec2(ctor); - GLM_FUNC_DECL explicit tvec2(T const & scalar); - GLM_FUNC_DECL tvec2(T const & s1, T const & s2); + GLM_FUNC_DECL explicit tvec2(T scalar); + GLM_FUNC_DECL tvec2(T s1, T s2); // -- Conversion constructors -- /// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL tvec2(A const & x, B const & y); + GLM_FUNC_DECL tvec2(A x, B y); template GLM_FUNC_DECL tvec2(tvec1 const & v1, tvec1 const & v2); @@ -225,13 +225,13 @@ namespace glm // -- Binary operators -- template - GLM_FUNC_DECL tvec2 operator+(tvec2 const & v, T const & scalar); + GLM_FUNC_DECL tvec2 operator+(tvec2 const & v, T scalar); template GLM_FUNC_DECL tvec2 operator+(tvec2 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec2 operator+(T const & scalar, tvec2 const & v); + GLM_FUNC_DECL tvec2 operator+(T scalar, tvec2 const & v); template GLM_FUNC_DECL tvec2 operator+(tvec1 const & v1, tvec2 const & v2); @@ -240,13 +240,13 @@ namespace glm GLM_FUNC_DECL tvec2 operator+(tvec2 const & v1, tvec2 const & v2); template - GLM_FUNC_DECL tvec2 operator-(tvec2 const & v, T const & scalar); + GLM_FUNC_DECL tvec2 operator-(tvec2 const & v, T scalar); template GLM_FUNC_DECL tvec2 operator-(tvec2 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec2 operator-(T const & scalar, tvec2 const & v); + GLM_FUNC_DECL tvec2 operator-(T scalar, tvec2 const & v); template GLM_FUNC_DECL tvec2 operator-(tvec1 const & v1, tvec2 const & v2); @@ -255,13 +255,13 @@ namespace glm GLM_FUNC_DECL tvec2 operator-(tvec2 const & v1, tvec2 const & v2); template - GLM_FUNC_DECL tvec2 operator*(tvec2 const & v, T const & scalar); + GLM_FUNC_DECL tvec2 operator*(tvec2 const & v, T scalar); template GLM_FUNC_DECL tvec2 operator*(tvec2 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec2 operator*(T const & scalar, tvec2 const & v); + GLM_FUNC_DECL tvec2 operator*(T scalar, tvec2 const & v); template GLM_FUNC_DECL tvec2 operator*(tvec1 const & v1, tvec2 const & v2); @@ -270,13 +270,13 @@ namespace glm GLM_FUNC_DECL tvec2 operator*(tvec2 const & v1, tvec2 const & v2); template - GLM_FUNC_DECL tvec2 operator/(tvec2 const & v, T const & scalar); + GLM_FUNC_DECL tvec2 operator/(tvec2 const & v, T scalar); template GLM_FUNC_DECL tvec2 operator/(tvec2 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec2 operator/(T const & scalar, tvec2 const & v); + GLM_FUNC_DECL tvec2 operator/(T scalar, tvec2 const & v); template GLM_FUNC_DECL tvec2 operator/(tvec1 const & v1, tvec2 const & v2); @@ -285,13 +285,13 @@ namespace glm GLM_FUNC_DECL tvec2 operator/(tvec2 const & v1, tvec2 const & v2); template - GLM_FUNC_DECL tvec2 operator%(tvec2 const & v, T const & scalar); + GLM_FUNC_DECL tvec2 operator%(tvec2 const & v, T scalar); template GLM_FUNC_DECL tvec2 operator%(tvec2 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec2 operator%(T const & scalar, tvec2 const & v); + GLM_FUNC_DECL tvec2 operator%(T scalar, tvec2 const & v); template GLM_FUNC_DECL tvec2 operator%(tvec1 const & v1, tvec2 const & v2); @@ -300,13 +300,13 @@ namespace glm GLM_FUNC_DECL tvec2 operator%(tvec2 const & v1, tvec2 const & v2); template - GLM_FUNC_DECL tvec2 operator&(tvec2 const & v, T const & scalar); + GLM_FUNC_DECL tvec2 operator&(tvec2 const & v, T scalar); template GLM_FUNC_DECL tvec2 operator&(tvec2 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec2 operator&(T const & scalar, tvec2 const & v); + GLM_FUNC_DECL tvec2 operator&(T scalar, tvec2 const & v); template GLM_FUNC_DECL tvec2 operator&(tvec1 const & v1, tvec2 const & v2); @@ -315,13 +315,13 @@ namespace glm GLM_FUNC_DECL tvec2 operator&(tvec2 const & v1, tvec2 const & v2); template - GLM_FUNC_DECL tvec2 operator|(tvec2 const & v, T const & scalar); + GLM_FUNC_DECL tvec2 operator|(tvec2 const & v, T scalar); template GLM_FUNC_DECL tvec2 operator|(tvec2 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec2 operator|(T const & scalar, tvec2 const & v); + GLM_FUNC_DECL tvec2 operator|(T scalar, tvec2 const & v); template GLM_FUNC_DECL tvec2 operator|(tvec1 const & v1, tvec2 const & v2); @@ -330,13 +330,13 @@ namespace glm GLM_FUNC_DECL tvec2 operator|(tvec2 const & v1, tvec2 const & v2); template - GLM_FUNC_DECL tvec2 operator^(tvec2 const & v, T const & scalar); + GLM_FUNC_DECL tvec2 operator^(tvec2 const & v, T scalar); template GLM_FUNC_DECL tvec2 operator^(tvec2 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec2 operator^(T const & scalar, tvec2 const & v); + GLM_FUNC_DECL tvec2 operator^(T scalar, tvec2 const & v); template GLM_FUNC_DECL tvec2 operator^(tvec1 const & v1, tvec2 const & v2); @@ -345,13 +345,13 @@ namespace glm GLM_FUNC_DECL tvec2 operator^(tvec2 const & v1, tvec2 const & v2); template - GLM_FUNC_DECL tvec2 operator<<(tvec2 const & v, T const & scalar); + GLM_FUNC_DECL tvec2 operator<<(tvec2 const & v, T scalar); template GLM_FUNC_DECL tvec2 operator<<(tvec2 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec2 operator<<(T const & scalar, tvec2 const & v); + GLM_FUNC_DECL tvec2 operator<<(T scalar, tvec2 const & v); template GLM_FUNC_DECL tvec2 operator<<(tvec1 const & v1, tvec2 const & v2); @@ -360,13 +360,13 @@ namespace glm GLM_FUNC_DECL tvec2 operator<<(tvec2 const & v1, tvec2 const & v2); template - GLM_FUNC_DECL tvec2 operator>>(tvec2 const & v, T const & scalar); + GLM_FUNC_DECL tvec2 operator>>(tvec2 const & v, T scalar); template GLM_FUNC_DECL tvec2 operator>>(tvec2 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec2 operator>>(T const & scalar, tvec2 const & v); + GLM_FUNC_DECL tvec2 operator>>(T scalar, tvec2 const & v); template GLM_FUNC_DECL tvec2 operator>>(tvec1 const & v1, tvec2 const & v2); diff --git a/glm/detail/type_vec2.inl b/glm/detail/type_vec2.inl index dfb3a33a..f23563f5 100644 --- a/glm/detail/type_vec2.inl +++ b/glm/detail/type_vec2.inl @@ -72,12 +72,12 @@ namespace glm {} template - GLM_FUNC_QUALIFIER tvec2::tvec2(T const & scalar) + GLM_FUNC_QUALIFIER tvec2::tvec2(T scalar) : x(scalar), y(scalar) {} template - GLM_FUNC_QUALIFIER tvec2::tvec2(T const & s1, T const & s2) + GLM_FUNC_QUALIFIER tvec2::tvec2(T s1, T s2) : x(s1), y(s2) {} @@ -85,7 +85,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec2::tvec2(A const & a, B const & b) + GLM_FUNC_QUALIFIER tvec2::tvec2(A a, B b) : x(static_cast(a)) , y(static_cast(b)) {} @@ -510,7 +510,7 @@ namespace glm // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER tvec2 operator+(tvec2 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec2 operator+(tvec2 const & v, T scalar) { return tvec2( v.x + scalar, @@ -526,7 +526,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator+(T const & scalar, tvec2 const & v) + GLM_FUNC_QUALIFIER tvec2 operator+(T scalar, tvec2 const & v) { return tvec2( scalar + v.x, @@ -550,7 +550,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator-(tvec2 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec2 operator-(tvec2 const & v, T scalar) { return tvec2( v.x - scalar, @@ -566,7 +566,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator-(T const & scalar, tvec2 const & v) + GLM_FUNC_QUALIFIER tvec2 operator-(T scalar, tvec2 const & v) { return tvec2( scalar - v.x, @@ -590,11 +590,11 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator*(tvec2 const & v1, T const & v2) + GLM_FUNC_QUALIFIER tvec2 operator*(tvec2 const & v, T scalar) { return tvec2( - v1.x * v2, - v1.y * v2); + v.x * scalar, + v.y * scalar); } template @@ -606,7 +606,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator*(T const & scalar, tvec2 const & v) + GLM_FUNC_QUALIFIER tvec2 operator*(T scalar, tvec2 const & v) { return tvec2( scalar * v.x, @@ -630,7 +630,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator/(tvec2 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec2 operator/(tvec2 const & v, T scalar) { return tvec2( v.x / scalar, @@ -646,7 +646,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator/(T const & scalar, tvec2 const & v) + GLM_FUNC_QUALIFIER tvec2 operator/(T scalar, tvec2 const & v) { return tvec2( scalar / v.x, @@ -672,7 +672,7 @@ namespace glm // -- Binary bit operators -- template - GLM_FUNC_QUALIFIER tvec2 operator%(tvec2 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec2 operator%(tvec2 const & v, T scalar) { return tvec2( v.x % scalar, @@ -688,7 +688,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator%(T const & scalar, tvec2 const & v) + GLM_FUNC_QUALIFIER tvec2 operator%(T scalar, tvec2 const & v) { return tvec2( scalar % v.x, @@ -712,7 +712,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator&(tvec2 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec2 operator&(tvec2 const & v, T scalar) { return tvec2( v.x & scalar, @@ -728,7 +728,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator&(T const & scalar, tvec2 const & v) + GLM_FUNC_QUALIFIER tvec2 operator&(T scalar, tvec2 const & v) { return tvec2( scalar & v.x, @@ -752,7 +752,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator|(tvec2 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec2 operator|(tvec2 const & v, T scalar) { return tvec2( v.x | scalar, @@ -768,7 +768,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator|(T const & scalar, tvec2 const & v) + GLM_FUNC_QUALIFIER tvec2 operator|(T scalar, tvec2 const & v) { return tvec2( scalar | v.x, @@ -792,7 +792,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator^(tvec2 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec2 operator^(tvec2 const & v, T scalar) { return tvec2( v.x ^ scalar, @@ -808,7 +808,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator^(T const & scalar, tvec2 const & v) + GLM_FUNC_QUALIFIER tvec2 operator^(T scalar, tvec2 const & v) { return tvec2( scalar ^ v.x, @@ -832,7 +832,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator<<(tvec2 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec2 operator<<(tvec2 const & v, T scalar) { return tvec2( v.x << scalar, @@ -848,7 +848,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator<<(T const & scalar, tvec2 const & v) + GLM_FUNC_QUALIFIER tvec2 operator<<(T scalar, tvec2 const & v) { return tvec2( scalar << v.x, @@ -872,7 +872,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator>>(tvec2 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec2 operator>>(tvec2 const & v, T scalar) { return tvec2( v.x >> scalar, @@ -888,7 +888,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator>>(T const & scalar, tvec2 const & v) + GLM_FUNC_QUALIFIER tvec2 operator>>(T scalar, tvec2 const & v) { return tvec2( scalar >> v.x, diff --git a/glm/detail/type_vec3.hpp b/glm/detail/type_vec3.hpp index 70e4290b..8280a219 100644 --- a/glm/detail/type_vec3.hpp +++ b/glm/detail/type_vec3.hpp @@ -103,14 +103,14 @@ namespace glm // -- Explicit basic constructors -- GLM_FUNC_DECL explicit tvec3(ctor); - GLM_FUNC_DECL explicit tvec3(T const & scalar); - GLM_FUNC_DECL tvec3(T const & a, T const & b, T const & c); + GLM_FUNC_DECL explicit tvec3(T scalar); + GLM_FUNC_DECL tvec3(T a, T b, T c); // -- Conversion scalar constructors -- /// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL tvec3(A const & a, B const & b, C const & c); + GLM_FUNC_DECL tvec3(A a, B b, C c); template GLM_FUNC_DECL tvec3(tvec1 const & a, tvec1 const & b, tvec1 const & c); @@ -118,13 +118,13 @@ namespace glm /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL tvec3(tvec2 const & a, B const & b); + GLM_FUNC_DECL tvec3(tvec2 const & a, B b); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_FUNC_DECL tvec3(tvec2 const & a, tvec1 const & b); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL tvec3(A const & a, tvec2 const & b); + GLM_FUNC_DECL tvec3(A a, tvec2 const & b); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_FUNC_DECL tvec3(tvec1 const & a, tvec2 const & b); @@ -247,151 +247,151 @@ namespace glm // -- Binary operators -- template - GLM_FUNC_DECL tvec3 operator+(tvec3 const & v, T const & scalar); + GLM_FUNC_DECL tvec3 operator+(tvec3 const & v, T scalar); template GLM_FUNC_DECL tvec3 operator+(tvec3 const & v, tvec1 const & scalar); template - GLM_FUNC_DECL tvec3 operator+(T const & scalar, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator+(T scalar, tvec3 const & v); template - GLM_FUNC_DECL tvec3 operator+(tvec1 const & scalar, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator+(tvec1 const & v1, tvec3 const & v2); template GLM_FUNC_DECL tvec3 operator+(tvec3 const & v1, tvec3 const & v2); template - GLM_FUNC_DECL tvec3 operator-(tvec3 const & v, T const & scalar); + GLM_FUNC_DECL tvec3 operator-(tvec3 const & v, T scalar); template - GLM_FUNC_DECL tvec3 operator-(tvec3 const & v, tvec1 const & scalar); + GLM_FUNC_DECL tvec3 operator-(tvec3 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec3 operator-(T const & scalar, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator-(T scalar, tvec3 const & v); template - GLM_FUNC_DECL tvec3 operator-(tvec1 const & scalar, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator-(tvec1 const & v1, tvec3 const & v2); template GLM_FUNC_DECL tvec3 operator-(tvec3 const & v1, tvec3 const & v2); template - GLM_FUNC_DECL tvec3 operator*(tvec3 const & v, T const & scalar); + GLM_FUNC_DECL tvec3 operator*(tvec3 const & v, T scalar); template - GLM_FUNC_DECL tvec3 operator*(tvec3 const & v, tvec1 const & scalar); + GLM_FUNC_DECL tvec3 operator*(tvec3 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec3 operator*(T const & scalar, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator*(T scalar, tvec3 const & v); template - GLM_FUNC_DECL tvec3 operator*(tvec1 const & scalar, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator*(tvec1 const & v1, tvec3 const & v2); template GLM_FUNC_DECL tvec3 operator*(tvec3 const & v1, tvec3 const & v2); template - GLM_FUNC_DECL tvec3 operator/(tvec3 const & v, T const & scalar); + GLM_FUNC_DECL tvec3 operator/(tvec3 const & v, T scalar); template - GLM_FUNC_DECL tvec3 operator/(tvec3 const & v, tvec1 const & scalar); + GLM_FUNC_DECL tvec3 operator/(tvec3 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec3 operator/(T const & scalar, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator/(T scalar, tvec3 const & v); template - GLM_FUNC_DECL tvec3 operator/(tvec1 const & scalar, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator/(tvec1 const & v1, tvec3 const & v2); template GLM_FUNC_DECL tvec3 operator/(tvec3 const & v1, tvec3 const & v2); template - GLM_FUNC_DECL tvec3 operator%(tvec3 const & v, T const & scalar); + GLM_FUNC_DECL tvec3 operator%(tvec3 const & v, T scalar); template - GLM_FUNC_DECL tvec3 operator%(tvec3 const & v, tvec1 const & scalar); + GLM_FUNC_DECL tvec3 operator%(tvec3 const & v1, tvec1 const & v2); template GLM_FUNC_DECL tvec3 operator%(T const & scalar, tvec3 const & v); template - GLM_FUNC_DECL tvec3 operator%(tvec1 const & scalar, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator%(tvec1 const & v1, tvec3 const & v2); template GLM_FUNC_DECL tvec3 operator%(tvec3 const & v1, tvec3 const & v2); template - GLM_FUNC_DECL tvec3 operator&(tvec3 const & v, T const & scalar); + GLM_FUNC_DECL tvec3 operator&(tvec3 const & v1, T scalar); template - GLM_FUNC_DECL tvec3 operator&(tvec3 const & v, tvec1 const & scalar); + GLM_FUNC_DECL tvec3 operator&(tvec3 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec3 operator&(T const & scalar, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator&(T scalar, tvec3 const & v); template - GLM_FUNC_DECL tvec3 operator&(tvec1 const & scalar, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator&(tvec1 const & v1, tvec3 const & v2); template GLM_FUNC_DECL tvec3 operator&(tvec3 const & v1, tvec3 const & v2); template - GLM_FUNC_DECL tvec3 operator|(tvec3 const & v, T const & scalar); + GLM_FUNC_DECL tvec3 operator|(tvec3 const & v, T scalar); template - GLM_FUNC_DECL tvec3 operator|(tvec3 const & v, tvec1 const & scalar); + GLM_FUNC_DECL tvec3 operator|(tvec3 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec3 operator|(T const & scalar, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator|(T scalar, tvec3 const & v); template - GLM_FUNC_DECL tvec3 operator|(tvec1 const & scalar, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator|(tvec1 const & v1, tvec3 const & v2); template GLM_FUNC_DECL tvec3 operator|(tvec3 const & v1, tvec3 const & v2); template - GLM_FUNC_DECL tvec3 operator^(tvec3 const & v, T const & scalar); + GLM_FUNC_DECL tvec3 operator^(tvec3 const & v, T scalar); template - GLM_FUNC_DECL tvec3 operator^(tvec3 const & v, tvec1 const & scalar); + GLM_FUNC_DECL tvec3 operator^(tvec3 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec3 operator^(T const & scalar, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator^(T scalar, tvec3 const & v); template - GLM_FUNC_DECL tvec3 operator^(tvec1 const & scalar, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator^(tvec1 const & v1, tvec3 const & v2); template GLM_FUNC_DECL tvec3 operator^(tvec3 const & v1, tvec3 const & v2); template - GLM_FUNC_DECL tvec3 operator<<(tvec3 const & v, T const & scalar); + GLM_FUNC_DECL tvec3 operator<<(tvec3 const & v, T scalar); template - GLM_FUNC_DECL tvec3 operator<<(tvec3 const & v, tvec1 const & scalar); + GLM_FUNC_DECL tvec3 operator<<(tvec3 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec3 operator<<(T const & scalar, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator<<(T scalar, tvec3 const & v); template - GLM_FUNC_DECL tvec3 operator<<(tvec1 const & scalar, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator<<(tvec1 const & v1, tvec3 const & v2); template GLM_FUNC_DECL tvec3 operator<<(tvec3 const & v1, tvec3 const & v2); template - GLM_FUNC_DECL tvec3 operator>>(tvec3 const & v, T const & scalar); + GLM_FUNC_DECL tvec3 operator>>(tvec3 const & v, T scalar); template - GLM_FUNC_DECL tvec3 operator>>(tvec3 const & v, tvec1 const & scalar); + GLM_FUNC_DECL tvec3 operator>>(tvec3 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec3 operator>>(T const & scalar, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator>>(T scalar, tvec3 const & v); template - GLM_FUNC_DECL tvec3 operator>>(tvec1 const & scalar, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator>>(tvec1 const & v1, tvec3 const & v2); template GLM_FUNC_DECL tvec3 operator>>(tvec3 const & v1, tvec3 const & v2); diff --git a/glm/detail/type_vec3.inl b/glm/detail/type_vec3.inl index 38104a3a..f8e95a30 100644 --- a/glm/detail/type_vec3.inl +++ b/glm/detail/type_vec3.inl @@ -89,12 +89,12 @@ namespace glm {} template - GLM_FUNC_QUALIFIER tvec3::tvec3(T const & scalar) + GLM_FUNC_QUALIFIER tvec3::tvec3(T scalar) : x(scalar), y(scalar), z(scalar) {} template - GLM_FUNC_QUALIFIER tvec3::tvec3(T const & a, T const & b, T const & c) + GLM_FUNC_QUALIFIER tvec3::tvec3(T a, T b, T c) : x(a), y(b), z(c) {} @@ -102,7 +102,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec3::tvec3(A const & a, B const & b, C const & c) : + GLM_FUNC_QUALIFIER tvec3::tvec3(A a, B b, C c) : x(static_cast(a)), y(static_cast(b)), z(static_cast(c)) @@ -120,7 +120,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec3::tvec3(tvec2 const & a, B const & b) : + GLM_FUNC_QUALIFIER tvec3::tvec3(tvec2 const & a, B b) : x(static_cast(a.x)), y(static_cast(a.y)), z(static_cast(b)) @@ -136,7 +136,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec3::tvec3(A const & a, tvec2 const & b) : + GLM_FUNC_QUALIFIER tvec3::tvec3(A a, tvec2 const & b) : x(static_cast(a)), y(static_cast(b.x)), z(static_cast(b.y)) @@ -591,7 +591,7 @@ namespace glm // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER tvec3 operator+(tvec3 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec3 operator+(tvec3 const & v, T scalar) { return tvec3( v.x + scalar, @@ -609,7 +609,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec3 operator+(T const & scalar, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator+(T scalar, tvec3 const & v) { return tvec3( scalar + v.x, @@ -636,7 +636,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec3 operator-(tvec3 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec3 operator-(tvec3 const & v, T scalar) { return tvec3( v.x - scalar, @@ -654,7 +654,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec3 operator-(T const & scalar, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator-(T scalar, tvec3 const & v) { return tvec3( scalar - v.x, @@ -681,7 +681,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec3 operator*(tvec3 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec3 operator*(tvec3 const & v, T scalar) { return tvec3( v.x * scalar, @@ -699,7 +699,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec3 operator*(T const & scalar, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator*(T scalar, tvec3 const & v) { return tvec3( scalar * v.x, @@ -726,7 +726,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec3 operator/(tvec3 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec3 operator/(tvec3 const & v, T scalar) { return tvec3( v.x / scalar, @@ -744,7 +744,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec3 operator/(T const & scalar, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator/(T scalar, tvec3 const & v) { return tvec3( scalar / v.x, @@ -773,7 +773,7 @@ namespace glm // -- Binary bit operators -- template - GLM_FUNC_QUALIFIER tvec3 operator%(tvec3 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec3 operator%(tvec3 const & v, T scalar) { return tvec3( v.x % scalar, @@ -791,7 +791,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec3 operator%(T const & scalar, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator%(T scalar, tvec3 const & v) { return tvec3( scalar % v.x, @@ -818,7 +818,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec3 operator&(tvec3 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec3 operator&(tvec3 const & v, T scalar) { return tvec3( v.x & scalar, @@ -836,7 +836,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec3 operator&(T const & scalar, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator&(T scalar, tvec3 const & v) { return tvec3( scalar & v.x, @@ -863,7 +863,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec3 operator|(tvec3 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec3 operator|(tvec3 const & v, T scalar) { return tvec3( v.x | scalar, @@ -881,7 +881,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec3 operator|(T const & scalar, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator|(T scalar, tvec3 const & v) { return tvec3( scalar | v.x, @@ -908,7 +908,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec3 operator^(tvec3 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec3 operator^(tvec3 const & v, T scalar) { return tvec3( v.x ^ scalar, @@ -926,7 +926,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec3 operator^(T const & scalar, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator^(T scalar, tvec3 const & v) { return tvec3( scalar ^ v.x, @@ -953,7 +953,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec3 operator<<(tvec3 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec3 operator<<(tvec3 const & v, T scalar) { return tvec3( v.x << scalar, @@ -971,7 +971,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec3 operator<<(T const & scalar, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator<<(T scalar, tvec3 const & v) { return tvec3( scalar << v.x, @@ -998,7 +998,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec3 operator>>(tvec3 const & v, T const & scalar) + GLM_FUNC_QUALIFIER tvec3 operator>>(tvec3 const & v, T scalar) { return tvec3( v.x >> scalar, @@ -1016,7 +1016,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec3 operator>>(T const & scalar, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator>>(T scalar, tvec3 const & v) { return tvec3( scalar >> v.x, From 66b714c418df19f072e08a08e4f22669ad7df5ba Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 23 Mar 2016 02:01:16 +0530 Subject: [PATCH 26/26] Finishing up removing GLM_FORCE_SIZE_FUNC define and passing by copy scalars --- glm/detail/func_common.inl | 2 +- glm/detail/func_matrix.inl | 4 +- glm/detail/func_vector_relational.inl | 30 +++--- glm/detail/setup.hpp | 25 +---- glm/detail/type_mat2x2.inl | 56 ++++------- glm/detail/type_mat2x3.hpp | 22 ++-- glm/detail/type_mat2x3.inl | 106 ++++++++----------- glm/detail/type_mat2x4.hpp | 22 ++-- glm/detail/type_mat2x4.inl | 106 ++++++++----------- glm/detail/type_mat3x2.hpp | 26 ++--- glm/detail/type_mat3x2.inl | 122 +++++++++------------- glm/detail/type_mat3x3.hpp | 30 +++--- glm/detail/type_mat3x3.inl | 140 +++++++++++--------------- glm/detail/type_mat3x4.hpp | 26 ++--- glm/detail/type_mat3x4.inl | 124 ++++++++++------------- glm/detail/type_mat4x2.hpp | 30 +++--- glm/detail/type_mat4x2.inl | 138 +++++++++++-------------- glm/detail/type_mat4x3.inl | 56 ++++------- glm/detail/type_mat4x4.inl | 56 ++++------- glm/detail/type_vec1.inl | 4 +- glm/detail/type_vec2.inl | 56 ++++------- glm/detail/type_vec3.inl | 56 ++++------- glm/detail/type_vec4.inl | 4 +- glm/gtc/matrix_access.inl | 12 +-- glm/gtc/quaternion.inl | 16 +-- glm/gtc/ulp.inl | 10 +- glm/gtx/associated_min_max.inl | 32 +++--- glm/gtx/component_wise.inl | 32 +++--- glm/gtx/dual_quaternion.inl | 56 ++++------- glm/gtx/fast_exponential.inl | 2 +- glm/gtx/matrix_query.inl | 38 +++---- glm/gtx/range.hpp | 73 ++++++++------ test/gtx/gtx_type_trait.cpp | 4 +- 33 files changed, 621 insertions(+), 895 deletions(-) diff --git a/glm/detail/func_common.inl b/glm/detail/func_common.inl index 2c32626f..3575f603 100644 --- a/glm/detail/func_common.inl +++ b/glm/detail/func_common.inl @@ -87,7 +87,7 @@ namespace detail GLM_FUNC_QUALIFIER static vecType call(vecType const & x, vecType const & y, vecType const & a) { vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) + for(length_t i = 0; i < x.length(); ++i) Result[i] = a[i] ? y[i] : x[i]; return Result; } diff --git a/glm/detail/func_matrix.inl b/glm/detail/func_matrix.inl index 1ebed1fb..8328b9eb 100644 --- a/glm/detail/func_matrix.inl +++ b/glm/detail/func_matrix.inl @@ -270,7 +270,7 @@ namespace detail GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'matrixCompMult' only accept floating-point inputs"); matType result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(result); ++i) + for(length_t i = 0; i < result.length(); ++i) result[i] = x[i] * y[i]; return result; } @@ -281,7 +281,7 @@ namespace detail GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'outerProduct' only accept floating-point inputs"); typename detail::outerProduct_trait::type m(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(m); ++i) + for(length_t i = 0; i < m.length(); ++i) m[i] = c * r[i]; return m; } diff --git a/glm/detail/func_vector_relational.inl b/glm/detail/func_vector_relational.inl index 72106d6e..a511ee8d 100644 --- a/glm/detail/func_vector_relational.inl +++ b/glm/detail/func_vector_relational.inl @@ -37,10 +37,10 @@ namespace glm template class vecType> GLM_FUNC_QUALIFIER vecType lessThan(vecType const & x, vecType const & y) { - assert(detail::component_count(x) == detail::component_count(y)); + assert(x.length() == y.length()); vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) + for(length_t i = 0; i < x.length(); ++i) Result[i] = x[i] < y[i]; return Result; @@ -49,10 +49,10 @@ namespace glm template class vecType> GLM_FUNC_QUALIFIER vecType lessThanEqual(vecType const & x, vecType const & y) { - assert(detail::component_count(x) == detail::component_count(y)); + assert(x.length() == y.length()); vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) + for(length_t i = 0; i < x.length(); ++i) Result[i] = x[i] <= y[i]; return Result; } @@ -60,10 +60,10 @@ namespace glm template class vecType> GLM_FUNC_QUALIFIER vecType greaterThan(vecType const & x, vecType const & y) { - assert(detail::component_count(x) == detail::component_count(y)); + assert(x.length() == y.length()); vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) + for(length_t i = 0; i < x.length(); ++i) Result[i] = x[i] > y[i]; return Result; } @@ -71,10 +71,10 @@ namespace glm template class vecType> GLM_FUNC_QUALIFIER vecType greaterThanEqual(vecType const & x, vecType const & y) { - assert(detail::component_count(x) == detail::component_count(y)); + assert(x.length() == y.length()); vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) + for(length_t i = 0; i < x.length(); ++i) Result[i] = x[i] >= y[i]; return Result; } @@ -82,10 +82,10 @@ namespace glm template class vecType> GLM_FUNC_QUALIFIER vecType equal(vecType const & x, vecType const & y) { - assert(detail::component_count(x) == detail::component_count(y)); + assert(x.length() == y.length()); vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) + for(length_t i = 0; i < x.length(); ++i) Result[i] = x[i] == y[i]; return Result; } @@ -93,10 +93,10 @@ namespace glm template class vecType> GLM_FUNC_QUALIFIER vecType notEqual(vecType const & x, vecType const & y) { - assert(detail::component_count(x) == detail::component_count(y)); + assert(x.length() == y.length()); vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) + for(length_t i = 0; i < x.length(); ++i) Result[i] = x[i] != y[i]; return Result; } @@ -105,7 +105,7 @@ namespace glm GLM_FUNC_QUALIFIER bool any(vecType const & v) { bool Result = false; - for(detail::component_count_t i = 0; i < detail::component_count(v); ++i) + for(length_t i = 0; i < v.length(); ++i) Result = Result || v[i]; return Result; } @@ -114,7 +114,7 @@ namespace glm GLM_FUNC_QUALIFIER bool all(vecType const & v) { bool Result = true; - for(detail::component_count_t i = 0; i < detail::component_count(v); ++i) + for(length_t i = 0; i < v.length(); ++i) Result = Result && v[i]; return Result; } @@ -123,7 +123,7 @@ namespace glm GLM_FUNC_QUALIFIER vecType not_(vecType const & v) { vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(v); ++i) + for(length_t i = 0; i < v.length(); ++i) Result[i] = !v[i]; return Result; } diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index c69852a6..b4688035 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -986,37 +986,16 @@ namespace glm { using std::size_t; -# if defined(GLM_FORCE_SIZE_T_LENGTH) || defined(GLM_FORCE_SIZE_FUNC) +# if defined(GLM_FORCE_SIZE_T_LENGTH) typedef size_t length_t; # else typedef int length_t; # endif - -namespace detail -{ -# ifdef GLM_FORCE_SIZE_FUNC - typedef size_t component_count_t; -# else - typedef length_t component_count_t; -# endif - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR component_count_t component_count(genType const & m) - { -# ifdef GLM_FORCE_SIZE_FUNC - return m.size(); -# else - return m.length(); -# endif - } -}//namespace detail }//namespace glm #if defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_FORCE_SIZE_T_LENGTH) # define GLM_MESSAGE_FORCE_SIZE_T_LENGTH -# if defined GLM_FORCE_SIZE_FUNC -# pragma message("GLM: .length() is replaced by .size() and returns a std::size_t") -# elif defined GLM_FORCE_SIZE_T_LENGTH +# if defined GLM_FORCE_SIZE_T_LENGTH # pragma message("GLM: .length() returns glm::length_t, a typedef of std::size_t") # else # pragma message("GLM: .length() returns glm::length_t, a typedef of int following the GLSL specification") diff --git a/glm/detail/type_mat2x2.inl b/glm/detail/type_mat2x2.inl index db4758fa..31e4734d 100644 --- a/glm/detail/type_mat2x2.inl +++ b/glm/detail/type_mat2x2.inl @@ -199,47 +199,25 @@ namespace detail // -- Accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x2::size_type tmat2x2::size() const - { - return 2; - } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x2::length_type tmat2x2::length() const + { + return 2; + } - template - GLM_FUNC_QUALIFIER typename tmat2x2::col_type & tmat2x2::operator[](typename tmat2x2::size_type i) - { - assert(i < this->size()); - return this->value[i]; - } + template + GLM_FUNC_QUALIFIER typename tmat2x2::col_type & tmat2x2::operator[](typename tmat2x2::length_type i) + { + assert(i < this->length()); + return this->value[i]; + } - template - GLM_FUNC_QUALIFIER typename tmat2x2::col_type const & tmat2x2::operator[](typename tmat2x2::size_type i) const - { - assert(i < this->size()); - return this->value[i]; - } -# else - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x2::length_type tmat2x2::length() const - { - return 2; - } - - template - GLM_FUNC_QUALIFIER typename tmat2x2::col_type & tmat2x2::operator[](typename tmat2x2::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template - GLM_FUNC_QUALIFIER typename tmat2x2::col_type const & tmat2x2::operator[](typename tmat2x2::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } -# endif//GLM_FORCE_SIZE_FUNC + template + GLM_FUNC_QUALIFIER typename tmat2x2::col_type const & tmat2x2::operator[](typename tmat2x2::length_type i) const + { + assert(i < this->length()); + return this->value[i]; + } // -- Unary updatable operators -- diff --git a/glm/detail/type_mat2x3.hpp b/glm/detail/type_mat2x3.hpp index da412319..e5d910f3 100644 --- a/glm/detail/type_mat2x3.hpp +++ b/glm/detail/type_mat2x3.hpp @@ -62,10 +62,10 @@ namespace glm GLM_FUNC_DECL tmat2x3(tmat2x3 const & m); GLM_FUNC_DECL explicit tmat2x3(ctor); - GLM_FUNC_DECL explicit tmat2x3(T const & s); + GLM_FUNC_DECL explicit tmat2x3(T scalar); GLM_FUNC_DECL tmat2x3( - T const & x0, T const & y0, T const & z0, - T const & x1, T const & y1, T const & z1); + T x0, T y0, T z0, + T x1, T y1, T z1); GLM_FUNC_DECL tmat2x3( col_type const & v0, col_type const & v1); @@ -74,8 +74,8 @@ namespace glm template GLM_FUNC_DECL tmat2x3( - X1 const & x1, Y1 const & y1, Z1 const & z1, - X2 const & x2, Y2 const & y2, Z2 const & z2); + X1 x1, Y1 y1, Z1 z1, + X2 x2, Y2 y2, Z2 z2); template GLM_FUNC_DECL tmat2x3( @@ -142,22 +142,22 @@ namespace glm // -- Binary operators -- template - GLM_FUNC_DECL tmat2x3 operator+(tmat2x3 const & m, T const & s); + GLM_FUNC_DECL tmat2x3 operator+(tmat2x3 const & m, T scalar); template GLM_FUNC_DECL tmat2x3 operator+(tmat2x3 const & m1, tmat2x3 const & m2); template - GLM_FUNC_DECL tmat2x3 operator-(tmat2x3 const & m, T const & s); + GLM_FUNC_DECL tmat2x3 operator-(tmat2x3 const & m, T scalar); template GLM_FUNC_DECL tmat2x3 operator-(tmat2x3 const & m1, tmat2x3 const & m2); template - GLM_FUNC_DECL tmat2x3 operator*(tmat2x3 const & m, T const & s); + GLM_FUNC_DECL tmat2x3 operator*(tmat2x3 const & m, T scalar); template - GLM_FUNC_DECL tmat2x3 operator*(T const & s, tmat2x3 const & m); + GLM_FUNC_DECL tmat2x3 operator*(T scalar, tmat2x3 const & m); template GLM_FUNC_DECL typename tmat2x3::col_type operator*(tmat2x3 const & m, typename tmat2x3::row_type const & v); @@ -175,10 +175,10 @@ namespace glm GLM_FUNC_DECL tmat4x3 operator*(tmat2x3 const & m1, tmat4x2 const & m2); template - GLM_FUNC_DECL tmat2x3 operator/(tmat2x3 const & m, T const & s); + GLM_FUNC_DECL tmat2x3 operator/(tmat2x3 const & m, T scalar); template - GLM_FUNC_DECL tmat2x3 operator/(T const & s, tmat2x3 const & m); + GLM_FUNC_DECL tmat2x3 operator/(T scalar, tmat2x3 const & m); // -- Boolean operators -- diff --git a/glm/detail/type_mat2x3.inl b/glm/detail/type_mat2x3.inl index 76c00f50..8ea5e746 100644 --- a/glm/detail/type_mat2x3.inl +++ b/glm/detail/type_mat2x3.inl @@ -67,17 +67,17 @@ namespace glm {} template - GLM_FUNC_QUALIFIER tmat2x3::tmat2x3(T const & s) + GLM_FUNC_QUALIFIER tmat2x3::tmat2x3(T scalar) { - this->value[0] = col_type(s, 0, 0); - this->value[1] = col_type(0, s, 0); + this->value[0] = col_type(scalar, 0, 0); + this->value[1] = col_type(0, scalar, 0); } template GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 ( - T const & x0, T const & y0, T const & z0, - T const & x1, T const & y1, T const & z1 + T x0, T y0, T z0, + T x1, T y1, T z1 ) { this->value[0] = col_type(x0, y0, z0); @@ -99,8 +99,8 @@ namespace glm typename X2, typename Y2, typename Z2> GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 ( - X1 const & x1, Y1 const & y1, Z1 const & z1, - X2 const & x2, Y2 const & y2, Z2 const & z2 + X1 x1, Y1 y1, Z1 z1, + X2 x2, Y2 y2, Z2 z2 ) { this->value[0] = col_type(static_cast(x1), value_type(y1), value_type(z1)); @@ -183,47 +183,25 @@ namespace glm // -- Accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x3::size_type tmat2x3::size() const - { - return 2; - } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x3::length_type tmat2x3::length() const + { + return 2; + } - template - GLM_FUNC_QUALIFIER typename tmat2x3::col_type & tmat2x3::operator[](typename tmat2x3::size_type i) - { - assert(i < this->size()); - return this->value[i]; - } + template + GLM_FUNC_QUALIFIER typename tmat2x3::col_type & tmat2x3::operator[](typename tmat2x3::length_type i) + { + assert(i < this->length()); + return this->value[i]; + } - template - GLM_FUNC_QUALIFIER typename tmat2x3::col_type const & tmat2x3::operator[](typename tmat2x3::size_type i) const - { - assert(i < this->size()); - return this->value[i]; - } -# else - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x3::length_type tmat2x3::length() const - { - return 2; - } - - template - GLM_FUNC_QUALIFIER typename tmat2x3::col_type & tmat2x3::operator[](typename tmat2x3::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template - GLM_FUNC_QUALIFIER typename tmat2x3::col_type const & tmat2x3::operator[](typename tmat2x3::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } -# endif//GLM_FORCE_SIZE_FUNC + template + GLM_FUNC_QUALIFIER typename tmat2x3::col_type const & tmat2x3::operator[](typename tmat2x3::length_type i) const + { + assert(i < this->length()); + return this->value[i]; + } // -- Unary updatable operators -- @@ -353,11 +331,11 @@ namespace glm // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER tmat2x3 operator+(tmat2x3 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat2x3 operator+(tmat2x3 const & m, T scalar) { return tmat2x3( - m[0] + s, - m[1] + s); + m[0] + scalar, + m[1] + scalar); } template @@ -369,11 +347,11 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat2x3 operator-(tmat2x3 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat2x3 operator-(tmat2x3 const & m, T scalar) { return tmat2x3( - m[0] - s, - m[1] - s); + m[0] - scalar, + m[1] - scalar); } template @@ -385,19 +363,19 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat2x3 operator*(tmat2x3 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat2x3 operator*(tmat2x3 const & m, T scalar) { return tmat2x3( - m[0] * s, - m[1] * s); + m[0] * scalar, + m[1] * scalar); } template - GLM_FUNC_QUALIFIER tmat2x3 operator*(T const & s, tmat2x3 const & m) + GLM_FUNC_QUALIFIER tmat2x3 operator*(T scalar, tmat2x3 const & m) { return tmat2x3( - m[0] * s, - m[1] * s); + m[0] * scalar, + m[1] * scalar); } template @@ -484,19 +462,19 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat2x3 operator/(tmat2x3 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat2x3 operator/(tmat2x3 const & m, T scalar) { return tmat2x3( - m[0] / s, - m[1] / s); + m[0] / scalar, + m[1] / scalar); } template - GLM_FUNC_QUALIFIER tmat2x3 operator/(T const & s, tmat2x3 const & m) + GLM_FUNC_QUALIFIER tmat2x3 operator/(T scalar, tmat2x3 const & m) { return tmat2x3( - s / m[0], - s / m[1]); + scalar / m[0], + scalar / m[1]); } // -- Boolean operators -- diff --git a/glm/detail/type_mat2x4.hpp b/glm/detail/type_mat2x4.hpp index 45dfe142..91e23272 100644 --- a/glm/detail/type_mat2x4.hpp +++ b/glm/detail/type_mat2x4.hpp @@ -62,10 +62,10 @@ namespace glm GLM_FUNC_DECL tmat2x4(tmat2x4 const & m); GLM_FUNC_DECL explicit tmat2x4(ctor); - GLM_FUNC_DECL explicit tmat2x4(T const & s); + GLM_FUNC_DECL explicit tmat2x4(T scalar); GLM_FUNC_DECL tmat2x4( - T const & x0, T const & y0, T const & z0, T const & w0, - T const & x1, T const & y1, T const & z1, T const & w1); + T x0, T y0, T z0, T w0, + T x1, T y1, T z1, T w1); GLM_FUNC_DECL tmat2x4( col_type const & v0, col_type const & v1); @@ -76,8 +76,8 @@ namespace glm typename X1, typename Y1, typename Z1, typename W1, typename X2, typename Y2, typename Z2, typename W2> GLM_FUNC_DECL tmat2x4( - X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, - X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2); + X1 x1, Y1 y1, Z1 z1, W1 w1, + X2 x2, Y2 y2, Z2 z2, W2 w2); template GLM_FUNC_DECL tmat2x4( @@ -144,22 +144,22 @@ namespace glm // -- Binary operators -- template - GLM_FUNC_DECL tmat2x4 operator+(tmat2x4 const & m, T const & s); + GLM_FUNC_DECL tmat2x4 operator+(tmat2x4 const & m, T scalar); template GLM_FUNC_DECL tmat2x4 operator+(tmat2x4 const & m1, tmat2x4 const & m2); template - GLM_FUNC_DECL tmat2x4 operator-(tmat2x4 const & m, T const & s); + GLM_FUNC_DECL tmat2x4 operator-(tmat2x4 const & m, T scalar); template GLM_FUNC_DECL tmat2x4 operator-(tmat2x4 const & m1, tmat2x4 const & m2); template - GLM_FUNC_DECL tmat2x4 operator*(tmat2x4 const & m, T const & s); + GLM_FUNC_DECL tmat2x4 operator*(tmat2x4 const & m, T scalar); template - GLM_FUNC_DECL tmat2x4 operator*(T const & s, tmat2x4 const & m); + GLM_FUNC_DECL tmat2x4 operator*(T scalar, tmat2x4 const & m); template GLM_FUNC_DECL typename tmat2x4::col_type operator*(tmat2x4 const & m, typename tmat2x4::row_type const & v); @@ -177,10 +177,10 @@ namespace glm GLM_FUNC_DECL tmat3x4 operator*(tmat2x4 const & m1, tmat3x2 const & m2); template - GLM_FUNC_DECL tmat2x4 operator/(tmat2x4 const & m, T const & s); + GLM_FUNC_DECL tmat2x4 operator/(tmat2x4 const & m, T scalar); template - GLM_FUNC_DECL tmat2x4 operator/(T const & s, tmat2x4 const & m); + GLM_FUNC_DECL tmat2x4 operator/(T scalar, tmat2x4 const & m); // -- Boolean operators -- diff --git a/glm/detail/type_mat2x4.inl b/glm/detail/type_mat2x4.inl index 8d6f824e..d7b47007 100644 --- a/glm/detail/type_mat2x4.inl +++ b/glm/detail/type_mat2x4.inl @@ -67,18 +67,18 @@ namespace glm {} template - GLM_FUNC_QUALIFIER tmat2x4::tmat2x4(T const & s) + GLM_FUNC_QUALIFIER tmat2x4::tmat2x4(T scalar) { value_type const Zero(0); - this->value[0] = col_type(s, Zero, Zero, Zero); - this->value[1] = col_type(Zero, s, Zero, Zero); + this->value[0] = col_type(scalar, Zero, Zero, Zero); + this->value[1] = col_type(Zero, scalar, Zero, Zero); } template GLM_FUNC_QUALIFIER tmat2x4::tmat2x4 ( - T const & x0, T const & y0, T const & z0, T const & w0, - T const & x1, T const & y1, T const & z1, T const & w1 + T x0, T y0, T z0, T w0, + T x1, T y1, T z1, T w1 ) { this->value[0] = col_type(x0, y0, z0, w0); @@ -100,8 +100,8 @@ namespace glm typename X2, typename Y2, typename Z2, typename W2> GLM_FUNC_QUALIFIER tmat2x4::tmat2x4 ( - X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, - X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2 + X1 x1, Y1 y1, Z1 z1, W1 w1, + X2 x2, Y2 y2, Z2 z2, W2 w2 ) { this->value[0] = col_type(static_cast(x1), value_type(y1), value_type(z1), value_type(w1)); @@ -184,47 +184,25 @@ namespace glm // -- Accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x4::size_type tmat2x4::size() const - { - return 2; - } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x4::length_type tmat2x4::length() const + { + return 2; + } - template - GLM_FUNC_QUALIFIER typename tmat2x4::col_type & tmat2x4::operator[](typename tmat2x4::size_type i) - { - assert(i < this->size()); - return this->value[i]; - } + template + GLM_FUNC_QUALIFIER typename tmat2x4::col_type & tmat2x4::operator[](typename tmat2x4::length_type i) + { + assert(i < this->length()); + return this->value[i]; + } - template - GLM_FUNC_QUALIFIER typename tmat2x4::col_type const & tmat2x4::operator[](typename tmat2x4::size_type i) const - { - assert(i < this->size()); - return this->value[i]; - } -# else - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x4::length_type tmat2x4::length() const - { - return 2; - } - - template - GLM_FUNC_QUALIFIER typename tmat2x4::col_type & tmat2x4::operator[](typename tmat2x4::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template - GLM_FUNC_QUALIFIER typename tmat2x4::col_type const & tmat2x4::operator[](typename tmat2x4::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } -# endif//GLM_FORCE_SIZE_FUNC + template + GLM_FUNC_QUALIFIER typename tmat2x4::col_type const & tmat2x4::operator[](typename tmat2x4::length_type i) const + { + assert(i < this->length()); + return this->value[i]; + } // -- Unary updatable operators -- @@ -354,11 +332,11 @@ namespace glm // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER tmat2x4 operator+(tmat2x4 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat2x4 operator+(tmat2x4 const & m, T scalar) { return tmat2x4( - m[0] + s, - m[1] + s); + m[0] + scalar, + m[1] + scalar); } template @@ -370,11 +348,11 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat2x4 operator-(tmat2x4 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat2x4 operator-(tmat2x4 const & m, T scalar) { return tmat2x4( - m[0] - s, - m[1] - s); + m[0] - scalar, + m[1] - scalar); } template @@ -386,19 +364,19 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat2x4 operator*(tmat2x4 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat2x4 operator*(tmat2x4 const & m, T scalar) { return tmat2x4( - m[0] * s, - m[1] * s); + m[0] * scalar, + m[1] * scalar); } template - GLM_FUNC_QUALIFIER tmat2x4 operator*(T const & s, tmat2x4 const & m) + GLM_FUNC_QUALIFIER tmat2x4 operator*(T scalar, tmat2x4 const & m) { return tmat2x4( - m[0] * s, - m[1] * s); + m[0] * scalar, + m[1] * scalar); } template @@ -493,19 +471,19 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat2x4 operator/(tmat2x4 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat2x4 operator/(tmat2x4 const & m, T scalar) { return tmat2x4( - m[0] / s, - m[1] / s); + m[0] / scalar, + m[1] / scalar); } template - GLM_FUNC_QUALIFIER tmat2x4 operator/(T const & s, tmat2x4 const & m) + GLM_FUNC_QUALIFIER tmat2x4 operator/(T scalar, tmat2x4 const & m) { return tmat2x4( - s / m[0], - s / m[1]); + scalar / m[0], + scalar / m[1]); } // -- Boolean operators -- diff --git a/glm/detail/type_mat3x2.hpp b/glm/detail/type_mat3x2.hpp index 06922b6b..ddaef432 100644 --- a/glm/detail/type_mat3x2.hpp +++ b/glm/detail/type_mat3x2.hpp @@ -62,11 +62,11 @@ namespace glm GLM_FUNC_DECL tmat3x2(tmat3x2 const & m); GLM_FUNC_DECL explicit tmat3x2(ctor); - GLM_FUNC_DECL explicit tmat3x2(T const & s); + GLM_FUNC_DECL explicit tmat3x2(T scalar); GLM_FUNC_DECL tmat3x2( - T const & x0, T const & y0, - T const & x1, T const & y1, - T const & x2, T const & y2); + T x0, T y0, + T x1, T y1, + T x2, T y2); GLM_FUNC_DECL tmat3x2( col_type const & v0, col_type const & v1, @@ -79,9 +79,9 @@ namespace glm typename X2, typename Y2, typename X3, typename Y3> GLM_FUNC_DECL tmat3x2( - X1 const & x1, Y1 const & y1, - X2 const & x2, Y2 const & y2, - X3 const & x3, Y3 const & y3); + X1 x1, Y1 y1, + X2 x2, Y2 y2, + X3 x3, Y3 y3); template GLM_FUNC_DECL tmat3x2( @@ -149,22 +149,22 @@ namespace glm // -- Binary operators -- template - GLM_FUNC_DECL tmat3x2 operator+(tmat3x2 const & m, T const & s); + GLM_FUNC_DECL tmat3x2 operator+(tmat3x2 const & m, T scalar); template GLM_FUNC_DECL tmat3x2 operator+(tmat3x2 const & m1, tmat3x2 const & m2); template - GLM_FUNC_DECL tmat3x2 operator-(tmat3x2 const & m, T const & s); + GLM_FUNC_DECL tmat3x2 operator-(tmat3x2 const & m, T scalar); template GLM_FUNC_DECL tmat3x2 operator-(tmat3x2 const & m1, tmat3x2 const & m2); template - GLM_FUNC_DECL tmat3x2 operator*(tmat3x2 const & m, T const & s); + GLM_FUNC_DECL tmat3x2 operator*(tmat3x2 const & m, T scalar); template - GLM_FUNC_DECL tmat3x2 operator*(T const & s, tmat3x2 const & m); + GLM_FUNC_DECL tmat3x2 operator*(T scalar, tmat3x2 const & m); template GLM_FUNC_DECL typename tmat3x2::col_type operator*(tmat3x2 const & m, typename tmat3x2::row_type const & v); @@ -182,10 +182,10 @@ namespace glm GLM_FUNC_DECL tmat4x2 operator*(tmat3x2 const & m1, tmat4x3 const & m2); template - GLM_FUNC_DECL tmat3x2 operator/(tmat3x2 const & m, T const & s); + GLM_FUNC_DECL tmat3x2 operator/(tmat3x2 const & m, T scalar); template - GLM_FUNC_DECL tmat3x2 operator/(T const & s, tmat3x2 const & m); + GLM_FUNC_DECL tmat3x2 operator/(T scalar, tmat3x2 const & m); // -- Boolean operators -- diff --git a/glm/detail/type_mat3x2.inl b/glm/detail/type_mat3x2.inl index f497e395..e39839eb 100644 --- a/glm/detail/type_mat3x2.inl +++ b/glm/detail/type_mat3x2.inl @@ -70,19 +70,19 @@ namespace glm {} template - GLM_FUNC_QUALIFIER tmat3x2::tmat3x2(T const & s) + GLM_FUNC_QUALIFIER tmat3x2::tmat3x2(T scalar) { - this->value[0] = col_type(s, 0); - this->value[1] = col_type(0, s); + this->value[0] = col_type(scalar, 0); + this->value[1] = col_type(0, scalar); this->value[2] = col_type(0, 0); } template GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 ( - T const & x0, T const & y0, - T const & x1, T const & y1, - T const & x2, T const & y2 + T x0, T y0, + T x1, T y1, + T x2, T y2 ) { this->value[0] = col_type(x0, y0); @@ -112,9 +112,9 @@ namespace glm typename X3, typename Y3> GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 ( - X1 const & x1, Y1 const & y1, - X2 const & x2, Y2 const & y2, - X3 const & x3, Y3 const & y3 + X1 x1, Y1 y1, + X2 x2, Y2 y2, + X3 x3, Y3 y3 ) { this->value[0] = col_type(static_cast(x1), value_type(y1)); @@ -213,47 +213,25 @@ namespace glm // -- Accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x2::size_type tmat3x2::size() const - { - return 3; - } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x2::length_type tmat3x2::length() const + { + return 3; + } - template - GLM_FUNC_QUALIFIER typename tmat3x2::col_type & tmat3x2::operator[](typename tmat3x2::size_type i) - { - assert(i < this->size()); - return this->value[i]; - } + template + GLM_FUNC_QUALIFIER typename tmat3x2::col_type & tmat3x2::operator[](typename tmat3x2::length_type i) + { + assert(i < this->length()); + return this->value[i]; + } - template - GLM_FUNC_QUALIFIER typename tmat3x2::col_type const & tmat3x2::operator[](typename tmat3x2::size_type i) const - { - assert(i < this->size()); - return this->value[i]; - } -# else - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x2::length_type tmat3x2::length() const - { - return 3; - } - - template - GLM_FUNC_QUALIFIER typename tmat3x2::col_type & tmat3x2::operator[](typename tmat3x2::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template - GLM_FUNC_QUALIFIER typename tmat3x2::col_type const & tmat3x2::operator[](typename tmat3x2::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } -# endif//GLM_FORCE_SIZE_FUNC + template + GLM_FUNC_QUALIFIER typename tmat3x2::col_type const & tmat3x2::operator[](typename tmat3x2::length_type i) const + { + assert(i < this->length()); + return this->value[i]; + } // -- Unary updatable operators -- @@ -394,12 +372,12 @@ namespace glm // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER tmat3x2 operator+(tmat3x2 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat3x2 operator+(tmat3x2 const & m, T scalar) { return tmat3x2( - m[0] + s, - m[1] + s, - m[2] + s); + m[0] + scalar, + m[1] + scalar, + m[2] + scalar); } template @@ -412,12 +390,12 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat3x2 operator-(tmat3x2 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat3x2 operator-(tmat3x2 const & m, T scalar) { return tmat3x2( - m[0] - s, - m[1] - s, - m[2] - s); + m[0] - scalar, + m[1] - scalar, + m[2] - scalar); } template @@ -430,21 +408,21 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat3x2 operator*(tmat3x2 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat3x2 operator*(tmat3x2 const & m, T scalar) { return tmat3x2( - m[0] * s, - m[1] * s, - m[2] * s); + m[0] * scalar, + m[1] * scalar, + m[2] * scalar); } template - GLM_FUNC_QUALIFIER tmat3x2 operator*(T const & s, tmat3x2 const & m) + GLM_FUNC_QUALIFIER tmat3x2 operator*(T scalar, tmat3x2 const & m) { return tmat3x2( - m[0] * s, - m[1] * s, - m[2] * s); + m[0] * scalar, + m[1] * scalar, + m[2] * scalar); } template @@ -516,21 +494,21 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat3x2 operator/(tmat3x2 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat3x2 operator/(tmat3x2 const & m, T scalar) { return tmat3x2( - m[0] / s, - m[1] / s, - m[2] / s); + m[0] / scalar, + m[1] / scalar, + m[2] / scalar); } template - GLM_FUNC_QUALIFIER tmat3x2 operator/(T const & s, tmat3x2 const & m) + GLM_FUNC_QUALIFIER tmat3x2 operator/(T scalar, tmat3x2 const & m) { return tmat3x2( - s / m[0], - s / m[1], - s / m[2]); + scalar / m[0], + scalar / m[1], + scalar / m[2]); } // -- Boolean operators -- diff --git a/glm/detail/type_mat3x3.hpp b/glm/detail/type_mat3x3.hpp index 3b90536b..3dd2d102 100644 --- a/glm/detail/type_mat3x3.hpp +++ b/glm/detail/type_mat3x3.hpp @@ -61,11 +61,11 @@ namespace glm GLM_FUNC_DECL tmat3x3(tmat3x3 const & m); GLM_FUNC_DECL explicit tmat3x3(ctor); - GLM_FUNC_DECL explicit tmat3x3(T const & s); + GLM_FUNC_DECL explicit tmat3x3(T scalar); GLM_FUNC_DECL tmat3x3( - T const & x0, T const & y0, T const & z0, - T const & x1, T const & y1, T const & z1, - T const & x2, T const & y2, T const & z2); + T x0, T y0, T z0, + T x1, T y1, T z1, + T x2, T y2, T z2); GLM_FUNC_DECL tmat3x3( col_type const & v0, col_type const & v1, @@ -78,9 +78,9 @@ namespace glm typename X2, typename Y2, typename Z2, typename X3, typename Y3, typename Z3> GLM_FUNC_DECL tmat3x3( - X1 const & x1, Y1 const & y1, Z1 const & z1, - X2 const & x2, Y2 const & y2, Z2 const & z2, - X3 const & x3, Y3 const & y3, Z3 const & z3); + X1 x1, Y1 y1, Z1 z1, + X2 x2, Y2 y2, Z2 z2, + X3 x3, Y3 y3, Z3 z3); template GLM_FUNC_DECL tmat3x3( @@ -152,28 +152,28 @@ namespace glm // -- Binary operators -- template - GLM_FUNC_DECL tmat3x3 operator+(tmat3x3 const & m, T const & s); + GLM_FUNC_DECL tmat3x3 operator+(tmat3x3 const & m, T scalar); template - GLM_FUNC_DECL tmat3x3 operator+(T const & s, tmat3x3 const & m); + GLM_FUNC_DECL tmat3x3 operator+(T scalar, tmat3x3 const & m); template GLM_FUNC_DECL tmat3x3 operator+(tmat3x3 const & m1, tmat3x3 const & m2); template - GLM_FUNC_DECL tmat3x3 operator-(tmat3x3 const & m, T const & s); + GLM_FUNC_DECL tmat3x3 operator-(tmat3x3 const & m, T scalar); template - GLM_FUNC_DECL tmat3x3 operator-(T const & s, tmat3x3 const & m); + GLM_FUNC_DECL tmat3x3 operator-(T scalar, tmat3x3 const & m); template GLM_FUNC_DECL tmat3x3 operator-(tmat3x3 const & m1, tmat3x3 const & m2); template - GLM_FUNC_DECL tmat3x3 operator*(tmat3x3 const & m, T const & s); + GLM_FUNC_DECL tmat3x3 operator*(tmat3x3 const & m, T scalar); template - GLM_FUNC_DECL tmat3x3 operator*(T const & s, tmat3x3 const & m); + GLM_FUNC_DECL tmat3x3 operator*(T scalar, tmat3x3 const & m); template GLM_FUNC_DECL typename tmat3x3::col_type operator*(tmat3x3 const & m, typename tmat3x3::row_type const & v); @@ -191,10 +191,10 @@ namespace glm GLM_FUNC_DECL tmat4x3 operator*(tmat3x3 const & m1, tmat4x3 const & m2); template - GLM_FUNC_DECL tmat3x3 operator/(tmat3x3 const & m, T const & s); + GLM_FUNC_DECL tmat3x3 operator/(tmat3x3 const & m, T scalar); template - GLM_FUNC_DECL tmat3x3 operator/(T const & s, tmat3x3 const & m); + GLM_FUNC_DECL tmat3x3 operator/(T scalar, tmat3x3 const & m); template GLM_FUNC_DECL typename tmat3x3::col_type operator/(tmat3x3 const & m, typename tmat3x3::row_type const & v); diff --git a/glm/detail/type_mat3x3.inl b/glm/detail/type_mat3x3.inl index 9ee0111e..24aec439 100644 --- a/glm/detail/type_mat3x3.inl +++ b/glm/detail/type_mat3x3.inl @@ -94,19 +94,19 @@ namespace detail {} template - GLM_FUNC_QUALIFIER tmat3x3::tmat3x3(T const & s) + GLM_FUNC_QUALIFIER tmat3x3::tmat3x3(T scalar) { - this->value[0] = col_type(s, 0, 0); - this->value[1] = col_type(0, s, 0); - this->value[2] = col_type(0, 0, s); + this->value[0] = col_type(scalar, 0, 0); + this->value[1] = col_type(0, scalar, 0); + this->value[2] = col_type(0, 0, scalar); } template GLM_FUNC_QUALIFIER tmat3x3::tmat3x3 ( - T const & x0, T const & y0, T const & z0, - T const & x1, T const & y1, T const & z1, - T const & x2, T const & y2, T const & z2 + T x0, T y0, T z0, + T x1, T y1, T z1, + T x2, T y2, T z2 ) { this->value[0] = col_type(x0, y0, z0); @@ -136,9 +136,9 @@ namespace detail typename X3, typename Y3, typename Z3> GLM_FUNC_QUALIFIER tmat3x3::tmat3x3 ( - X1 const & x1, Y1 const & y1, Z1 const & z1, - X2 const & x2, Y2 const & y2, Z2 const & z2, - X3 const & x3, Y3 const & y3, Z3 const & z3 + X1 x1, Y1 y1, Z1 z1, + X2 x2, Y2 y2, Z2 z2, + X3 x3, Y3 y3, Z3 z3 ) { this->value[0] = col_type(static_cast(x1), value_type(y1), value_type(z1)); @@ -237,47 +237,25 @@ namespace detail // -- Accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x3::size_type tmat3x3::size() const - { - return 3; - } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x3::length_type tmat3x3::length() const + { + return 3; + } - template - GLM_FUNC_QUALIFIER typename tmat3x3::col_type & tmat3x3::operator[](typename tmat3x3::size_type i) - { - assert(i < this->size()); - return this->value[i]; - } + template + GLM_FUNC_QUALIFIER typename tmat3x3::col_type & tmat3x3::operator[](typename tmat3x3::length_type i) + { + assert(i < this->length()); + return this->value[i]; + } - template - GLM_FUNC_QUALIFIER typename tmat3x3::col_type const & tmat3x3::operator[](typename tmat3x3::size_type i) const - { - assert(i < this->size()); - return this->value[i]; - } -# else - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x3::length_type tmat3x3::length() const - { - return 3; - } - - template - GLM_FUNC_QUALIFIER typename tmat3x3::col_type & tmat3x3::operator[](typename tmat3x3::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template - GLM_FUNC_QUALIFIER typename tmat3x3::col_type const & tmat3x3::operator[](typename tmat3x3::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } -# endif//GLM_FORCE_SIZE_FUNC + template + GLM_FUNC_QUALIFIER typename tmat3x3::col_type const & tmat3x3::operator[](typename tmat3x3::length_type i) const + { + assert(i < this->length()); + return this->value[i]; + } // -- Unary updatable operators -- @@ -432,21 +410,21 @@ namespace detail // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER tmat3x3 operator+(tmat3x3 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat3x3 operator+(tmat3x3 const & m, T scalar) { return tmat3x3( - m[0] + s, - m[1] + s, - m[2] + s); + m[0] + scalar, + m[1] + scalar, + m[2] + scalar); } template - GLM_FUNC_QUALIFIER tmat3x3 operator+(T const & s, tmat3x3 const & m) + GLM_FUNC_QUALIFIER tmat3x3 operator+(T scalar, tmat3x3 const & m) { return tmat3x3( - m[0] + s, - m[1] + s, - m[2] + s); + m[0] + scalar, + m[1] + scalar, + m[2] + scalar); } template @@ -459,21 +437,21 @@ namespace detail } template - GLM_FUNC_QUALIFIER tmat3x3 operator-(tmat3x3 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat3x3 operator-(tmat3x3 const & m, T scalar) { return tmat3x3( - m[0] - s, - m[1] - s, - m[2] - s); + m[0] - scalar, + m[1] - scalar, + m[2] - scalar); } template - GLM_FUNC_QUALIFIER tmat3x3 operator-(T const & s, tmat3x3 const & m) + GLM_FUNC_QUALIFIER tmat3x3 operator-(T scalar, tmat3x3 const & m) { return tmat3x3( - s - m[0], - s - m[1], - s - m[2]); + scalar - m[0], + scalar - m[1], + scalar - m[2]); } template @@ -486,21 +464,21 @@ namespace detail } template - GLM_FUNC_QUALIFIER tmat3x3 operator*(tmat3x3 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat3x3 operator*(tmat3x3 const & m, T scalar) { return tmat3x3( - m[0] * s, - m[1] * s, - m[2] * s); + m[0] * scalar, + m[1] * scalar, + m[2] * scalar); } template - GLM_FUNC_QUALIFIER tmat3x3 operator*(T const & s, tmat3x3 const & m) + GLM_FUNC_QUALIFIER tmat3x3 operator*(T scalar, tmat3x3 const & m) { return tmat3x3( - m[0] * s, - m[1] * s, - m[2] * s); + m[0] * scalar, + m[1] * scalar, + m[2] * scalar); } template @@ -588,21 +566,21 @@ namespace detail } template - GLM_FUNC_QUALIFIER tmat3x3 operator/(tmat3x3 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat3x3 operator/(tmat3x3 const & m, T scalar) { return tmat3x3( - m[0] / s, - m[1] / s, - m[2] / s); + m[0] / scalar, + m[1] / scalar, + m[2] / scalar); } template - GLM_FUNC_QUALIFIER tmat3x3 operator/(T const & s, tmat3x3 const & m) + GLM_FUNC_QUALIFIER tmat3x3 operator/(T scalar, tmat3x3 const & m) { return tmat3x3( - s / m[0], - s / m[1], - s / m[2]); + scalar / m[0], + scalar / m[1], + scalar / m[2]); } template diff --git a/glm/detail/type_mat3x4.hpp b/glm/detail/type_mat3x4.hpp index 445340ec..4c5691b6 100644 --- a/glm/detail/type_mat3x4.hpp +++ b/glm/detail/type_mat3x4.hpp @@ -62,11 +62,11 @@ namespace glm GLM_FUNC_DECL tmat3x4(tmat3x4 const & m); GLM_FUNC_DECL explicit tmat3x4(ctor); - GLM_FUNC_DECL explicit tmat3x4(T const & s); + GLM_FUNC_DECL explicit tmat3x4(T scalar); GLM_FUNC_DECL tmat3x4( - T const & x0, T const & y0, T const & z0, T const & w0, - T const & x1, T const & y1, T const & z1, T const & w1, - T const & x2, T const & y2, T const & z2, T const & w2); + T x0, T y0, T z0, T w0, + T x1, T y1, T z1, T w1, + T x2, T y2, T z2, T w2); GLM_FUNC_DECL tmat3x4( col_type const & v0, col_type const & v1, @@ -79,9 +79,9 @@ namespace glm typename X2, typename Y2, typename Z2, typename W2, typename X3, typename Y3, typename Z3, typename W3> GLM_FUNC_DECL tmat3x4( - X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, - X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2, - X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3); + X1 x1, Y1 y1, Z1 z1, W1 w1, + X2 x2, Y2 y2, Z2 z2, W2 w2, + X3 x3, Y3 y3, Z3 z3, W3 w3); template GLM_FUNC_DECL tmat3x4( @@ -149,22 +149,22 @@ namespace glm // -- Binary operators -- template - GLM_FUNC_DECL tmat3x4 operator+(tmat3x4 const & m, T const & s); + GLM_FUNC_DECL tmat3x4 operator+(tmat3x4 const & m, T scalar); template GLM_FUNC_DECL tmat3x4 operator+(tmat3x4 const & m1, tmat3x4 const & m2); template - GLM_FUNC_DECL tmat3x4 operator-(tmat3x4 const & m, T const & s); + GLM_FUNC_DECL tmat3x4 operator-(tmat3x4 const & m, T scalar); template GLM_FUNC_DECL tmat3x4 operator-(tmat3x4 const & m1, tmat3x4 const & m2); template - GLM_FUNC_DECL tmat3x4 operator*(tmat3x4 const & m, T const & s); + GLM_FUNC_DECL tmat3x4 operator*(tmat3x4 const & m, T scalar); template - GLM_FUNC_DECL tmat3x4 operator*(T const & s, tmat3x4 const & m); + GLM_FUNC_DECL tmat3x4 operator*(T scalar, tmat3x4 const & m); template GLM_FUNC_DECL typename tmat3x4::col_type operator*(tmat3x4 const & m, typename tmat3x4::row_type const & v); @@ -182,10 +182,10 @@ namespace glm GLM_FUNC_DECL tmat3x4 operator*(tmat3x4 const & m1, tmat3x3 const & m2); template - GLM_FUNC_DECL tmat3x4 operator/(tmat3x4 const & m, T const & s); + GLM_FUNC_DECL tmat3x4 operator/(tmat3x4 const & m, T scalar); template - GLM_FUNC_DECL tmat3x4 operator/(T const & s, tmat3x4 const & m); + GLM_FUNC_DECL tmat3x4 operator/(T scalar, tmat3x4 const & m); // -- Boolean operators -- diff --git a/glm/detail/type_mat3x4.inl b/glm/detail/type_mat3x4.inl index 3991d95d..ba6149c4 100644 --- a/glm/detail/type_mat3x4.inl +++ b/glm/detail/type_mat3x4.inl @@ -70,19 +70,19 @@ namespace glm {} template - GLM_FUNC_QUALIFIER tmat3x4::tmat3x4(T const & s) + GLM_FUNC_QUALIFIER tmat3x4::tmat3x4(T scalar) { - this->value[0] = col_type(s, 0, 0, 0); - this->value[1] = col_type(0, s, 0, 0); - this->value[2] = col_type(0, 0, s, 0); + this->value[0] = col_type(scalar, 0, 0, 0); + this->value[1] = col_type(0, scalar, 0, 0); + this->value[2] = col_type(0, 0, scalar, 0); } template GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 ( - T const & x0, T const & y0, T const & z0, T const & w0, - T const & x1, T const & y1, T const & z1, T const & w1, - T const & x2, T const & y2, T const & z2, T const & w2 + T x0, T y0, T z0, T w0, + T x1, T y1, T z1, T w1, + T x2, T y2, T z2, T w2 ) { this->value[0] = col_type(x0, y0, z0, w0); @@ -112,9 +112,9 @@ namespace glm typename X3, typename Y3, typename Z3, typename W3> GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 ( - X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, - X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2, - X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3 + X1 x1, Y1 y1, Z1 z1, W1 w1, + X2 x2, Y2 y2, Z2 z2, W2 w2, + X3 x3, Y3 y3, Z3 z3, W3 w3 ) { this->value[0] = col_type(static_cast(x1), value_type(y1), value_type(z1), value_type(w1)); @@ -213,47 +213,25 @@ namespace glm // -- Accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x4::size_type tmat3x4::size() const - { - return 3; - } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x4::length_type tmat3x4::length() const + { + return 3; + } - template - GLM_FUNC_QUALIFIER typename tmat3x4::col_type & tmat3x4::operator[](typename tmat3x4::size_type i) - { - assert(i < this->size()); - return this->value[i]; - } + template + GLM_FUNC_QUALIFIER typename tmat3x4::col_type & tmat3x4::operator[](typename tmat3x4::length_type i) + { + assert(i < this->length()); + return this->value[i]; + } - template - GLM_FUNC_QUALIFIER typename tmat3x4::col_type const & tmat3x4::operator[](typename tmat3x4::size_type i) const - { - assert(i < this->size()); - return this->value[i]; - } -# else - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x4::length_type tmat3x4::length() const - { - return 3; - } - - template - GLM_FUNC_QUALIFIER typename tmat3x4::col_type & tmat3x4::operator[](typename tmat3x4::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template - GLM_FUNC_QUALIFIER typename tmat3x4::col_type const & tmat3x4::operator[](typename tmat3x4::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } -# endif//GLM_FORCE_SIZE_FUNC + template + GLM_FUNC_QUALIFIER typename tmat3x4::col_type const & tmat3x4::operator[](typename tmat3x4::length_type i) const + { + assert(i < this->length()); + return this->value[i]; + } // -- Unary updatable operators -- @@ -394,12 +372,12 @@ namespace glm // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER tmat3x4 operator+(tmat3x4 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat3x4 operator+(tmat3x4 const & m, T scalar) { return tmat3x4( - m[0] + s, - m[1] + s, - m[2] + s); + m[0] + scalar, + m[1] + scalar, + m[2] + scalar); } template @@ -412,12 +390,12 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat3x4 operator-(tmat3x4 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat3x4 operator-(tmat3x4 const & m, T scalar) { return tmat3x4( - m[0] - s, - m[1] - s, - m[2] - s); + m[0] - scalar, + m[1] - scalar, + m[2] - scalar); } template @@ -430,21 +408,21 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat3x4 operator*(tmat3x4 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat3x4 operator*(tmat3x4 const & m, T scalar) { return tmat3x4( - m[0] * s, - m[1] * s, - m[2] * s); + m[0] * scalar, + m[1] * scalar, + m[2] * scalar); } template - GLM_FUNC_QUALIFIER tmat3x4 operator*(T const & s, tmat3x4 const & m) + GLM_FUNC_QUALIFIER tmat3x4 operator*(T scalar, tmat3x4 const & m) { return tmat3x4( - m[0] * s, - m[1] * s, - m[2] * s); + m[0] * scalar, + m[1] * scalar, + m[2] * scalar); } template @@ -556,21 +534,21 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat3x4 operator/(tmat3x4 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat3x4 operator/(tmat3x4 const & m, T scalar) { return tmat3x4( - m[0] / s, - m[1] / s, - m[2] / s); + m[0] / scalar, + m[1] / scalar, + m[2] / scalar); } template - GLM_FUNC_QUALIFIER tmat3x4 operator/(T const & s, tmat3x4 const & m) + GLM_FUNC_QUALIFIER tmat3x4 operator/(T scalar, tmat3x4 const & m) { return tmat3x4( - s / m[0], - s / m[1], - s / m[2]); + scalar / m[0], + scalar / m[1], + scalar / m[2]); } // -- Boolean operators -- diff --git a/glm/detail/type_mat4x2.hpp b/glm/detail/type_mat4x2.hpp index ad66ed19..2ce89511 100644 --- a/glm/detail/type_mat4x2.hpp +++ b/glm/detail/type_mat4x2.hpp @@ -62,12 +62,12 @@ namespace glm GLM_FUNC_DECL tmat4x2(tmat4x2 const & m); GLM_FUNC_DECL explicit tmat4x2(ctor); - GLM_FUNC_DECL explicit tmat4x2(T const & x); + GLM_FUNC_DECL explicit tmat4x2(T scalar); GLM_FUNC_DECL tmat4x2( - T const & x0, T const & y0, - T const & x1, T const & y1, - T const & x2, T const & y2, - T const & x3, T const & y3); + T x0, T y0, + T x1, T y1, + T x2, T y2, + T x3, T y3); GLM_FUNC_DECL tmat4x2( col_type const & v0, col_type const & v1, @@ -82,10 +82,10 @@ namespace glm typename X3, typename Y3, typename X4, typename Y4> GLM_FUNC_DECL tmat4x2( - X1 const & x1, Y1 const & y1, - X2 const & x2, Y2 const & y2, - X3 const & x3, Y3 const & y3, - X4 const & x4, Y4 const & y4); + X1 x1, Y1 y1, + X2 x2, Y2 y2, + X3 x3, Y3 y3, + X4 x4, Y4 y4); template GLM_FUNC_DECL tmat4x2( @@ -154,22 +154,22 @@ namespace glm // -- Binary operators -- template - GLM_FUNC_DECL tmat4x2 operator+(tmat4x2 const & m, T const & s); + GLM_FUNC_DECL tmat4x2 operator+(tmat4x2 const & m, T scalar); template GLM_FUNC_DECL tmat4x2 operator+(tmat4x2 const & m1, tmat4x2 const & m2); template - GLM_FUNC_DECL tmat4x2 operator-(tmat4x2 const & m, T const & s); + GLM_FUNC_DECL tmat4x2 operator-(tmat4x2 const & m, T scalar); template GLM_FUNC_DECL tmat4x2 operator-(tmat4x2 const & m1, tmat4x2 const & m2); template - GLM_FUNC_DECL tmat4x2 operator*(tmat4x2 const & m, T const & s); + GLM_FUNC_DECL tmat4x2 operator*(tmat4x2 const & m, T scalar); template - GLM_FUNC_DECL tmat4x2 operator*(T const & s, tmat4x2 const & m); + GLM_FUNC_DECL tmat4x2 operator*(T scalar, tmat4x2 const & m); template GLM_FUNC_DECL typename tmat4x2::col_type operator*(tmat4x2 const & m, typename tmat4x2::row_type const & v); @@ -187,10 +187,10 @@ namespace glm GLM_FUNC_DECL tmat4x2 operator*(tmat4x2 const & m1, tmat4x4 const & m2); template - GLM_FUNC_DECL tmat4x2 operator/(tmat4x2 const & m, T const & s); + GLM_FUNC_DECL tmat4x2 operator/(tmat4x2 const & m, T scalar); template - GLM_FUNC_DECL tmat4x2 operator/(T const & s, tmat4x2 const & m); + GLM_FUNC_DECL tmat4x2 operator/(T scalar, tmat4x2 const & m); // -- Boolean operators -- diff --git a/glm/detail/type_mat4x2.inl b/glm/detail/type_mat4x2.inl index 2040d4a6..1b0d048f 100644 --- a/glm/detail/type_mat4x2.inl +++ b/glm/detail/type_mat4x2.inl @@ -80,10 +80,10 @@ namespace glm {} template - GLM_FUNC_QUALIFIER tmat4x2::tmat4x2(T const & s) + GLM_FUNC_QUALIFIER tmat4x2::tmat4x2(T scalar) { - this->value[0] = col_type(s, 0); - this->value[1] = col_type(0, s); + this->value[0] = col_type(scalar, 0); + this->value[1] = col_type(0, scalar); this->value[2] = col_type(0, 0); this->value[3] = col_type(0, 0); } @@ -91,10 +91,10 @@ namespace glm template GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 ( - T const & x0, T const & y0, - T const & x1, T const & y1, - T const & x2, T const & y2, - T const & x3, T const & y3 + T x0, T y0, + T x1, T y1, + T x2, T y2, + T x3, T y3 ) { this->value[0] = col_type(x0, y0); @@ -128,10 +128,10 @@ namespace glm typename X4, typename Y4> GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 ( - X1 const & x1, Y1 const & y1, - X2 const & x2, Y2 const & y2, - X3 const & x3, Y3 const & y3, - X4 const & x4, Y4 const & y4 + X1 x1, Y1 y1, + X2 x2, Y2 y2, + X3 x3, Y3 y3, + X4 x4, Y4 y4 ) { this->value[0] = col_type(static_cast(x1), value_type(y1)); @@ -242,47 +242,25 @@ namespace glm // -- Accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x2::size_type tmat4x2::size() const - { - return 4; - } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x2::length_type tmat4x2::length() const + { + return 4; + } - template - GLM_FUNC_QUALIFIER typename tmat4x2::col_type & tmat4x2::operator[](typename tmat4x2::size_type i) - { - assert(i < this->size()); - return this->value[i]; - } + template + GLM_FUNC_QUALIFIER typename tmat4x2::col_type & tmat4x2::operator[](typename tmat4x2::length_type i) + { + assert(i < this->length()); + return this->value[i]; + } - template - GLM_FUNC_QUALIFIER typename tmat4x2::col_type const & tmat4x2::operator[](typename tmat4x2::size_type i) const - { - assert(i < this->size()); - return this->value[i]; - } -# else - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x2::length_type tmat4x2::length() const - { - return 4; - } - - template - GLM_FUNC_QUALIFIER typename tmat4x2::col_type & tmat4x2::operator[](typename tmat4x2::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template - GLM_FUNC_QUALIFIER typename tmat4x2::col_type const & tmat4x2::operator[](typename tmat4x2::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } -# endif//GLM_FORCE_SIZE_FUNC + template + GLM_FUNC_QUALIFIER typename tmat4x2::col_type const & tmat4x2::operator[](typename tmat4x2::length_type i) const + { + assert(i < this->length()); + return this->value[i]; + } // -- Unary updatable operators -- @@ -434,13 +412,13 @@ namespace glm // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER tmat4x2 operator+(tmat4x2 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat4x2 operator+(tmat4x2 const & m, T scalar) { return tmat4x2( - m[0] + s, - m[1] + s, - m[2] + s, - m[3] + s); + m[0] + scalar, + m[1] + scalar, + m[2] + scalar, + m[3] + scalar); } template @@ -454,13 +432,13 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat4x2 operator-(tmat4x2 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat4x2 operator-(tmat4x2 const & m, T scalar) { return tmat4x2( - m[0] - s, - m[1] - s, - m[2] - s, - m[3] - s); + m[0] - scalar, + m[1] - scalar, + m[2] - scalar, + m[3] - scalar); } template @@ -474,23 +452,23 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat4x2 operator*(tmat4x2 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat4x2 operator*(tmat4x2 const & m, T scalar) { return tmat4x2( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); + m[0] * scalar, + m[1] * scalar, + m[2] * scalar, + m[3] * scalar); } template - GLM_FUNC_QUALIFIER tmat4x2 operator*(T const & s, tmat4x2 const & m) + GLM_FUNC_QUALIFIER tmat4x2 operator*(T scalar, tmat4x2 const & m) { return tmat4x2( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); + m[0] * scalar, + m[1] * scalar, + m[2] * scalar, + m[3] * scalar); } template @@ -567,23 +545,23 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat4x2 operator/(tmat4x2 const & m, T const & s) + GLM_FUNC_QUALIFIER tmat4x2 operator/(tmat4x2 const & m, T scalar) { return tmat4x2( - m[0] / s, - m[1] / s, - m[2] / s, - m[3] / s); + m[0] / scalar, + m[1] / scalar, + m[2] / scalar, + m[3] / scalar); } template - GLM_FUNC_QUALIFIER tmat4x2 operator/(T const & s, tmat4x2 const & m) + GLM_FUNC_QUALIFIER tmat4x2 operator/(T scalar, tmat4x2 const & m) { return tmat4x2( - s / m[0], - s / m[1], - s / m[2], - s / m[3]); + scalar / m[0], + scalar / m[1], + scalar / m[2], + scalar / m[3]); } // -- Boolean operators -- diff --git a/glm/detail/type_mat4x3.inl b/glm/detail/type_mat4x3.inl index c2979782..9e75a19a 100644 --- a/glm/detail/type_mat4x3.inl +++ b/glm/detail/type_mat4x3.inl @@ -235,47 +235,25 @@ namespace glm // -- Accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x3::size_type tmat4x3::size() const - { - return 4; - } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x3::length_type tmat4x3::length() const + { + return 4; + } - template - GLM_FUNC_QUALIFIER typename tmat4x3::col_type & tmat4x3::operator[](typename tmat4x3::size_type i) - { - assert(i < this->size()); - return this->value[i]; - } + template + GLM_FUNC_QUALIFIER typename tmat4x3::col_type & tmat4x3::operator[](typename tmat4x3::length_type i) + { + assert(i < this->length()); + return this->value[i]; + } - template - GLM_FUNC_QUALIFIER typename tmat4x3::col_type const & tmat4x3::operator[](typename tmat4x3::size_type i) const - { - assert(i < this->size()); - return this->value[i]; - } -# else - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x3::length_type tmat4x3::length() const - { - return 4; - } - - template - GLM_FUNC_QUALIFIER typename tmat4x3::col_type & tmat4x3::operator[](typename tmat4x3::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template - GLM_FUNC_QUALIFIER typename tmat4x3::col_type const & tmat4x3::operator[](typename tmat4x3::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } -# endif//GLM_FORCE_SIZE_FUNC + template + GLM_FUNC_QUALIFIER typename tmat4x3::col_type const & tmat4x3::operator[](typename tmat4x3::length_type i) const + { + assert(i < this->length()); + return this->value[i]; + } // -- Unary updatable operators -- diff --git a/glm/detail/type_mat4x4.inl b/glm/detail/type_mat4x4.inl index 319325a7..bd80a126 100644 --- a/glm/detail/type_mat4x4.inl +++ b/glm/detail/type_mat4x4.inl @@ -323,47 +323,25 @@ namespace detail // -- Accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x4::size_type tmat4x4::size() const - { - return 4; - } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x4::length_type tmat4x4::length() const + { + return 4; + } - template - GLM_FUNC_QUALIFIER typename tmat4x4::col_type & tmat4x4::operator[](typename tmat4x4::size_type i) - { - assert(i < this->size()); - return this->value[i]; - } + template + GLM_FUNC_QUALIFIER typename tmat4x4::col_type & tmat4x4::operator[](typename tmat4x4::length_type i) + { + assert(i < this->length()); + return this->value[i]; + } - template - GLM_FUNC_QUALIFIER typename tmat4x4::col_type const & tmat4x4::operator[](typename tmat4x4::size_type i) const - { - assert(i < this->size()); - return this->value[i]; - } -# else - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x4::length_type tmat4x4::length() const - { - return 4; - } - - template - GLM_FUNC_QUALIFIER typename tmat4x4::col_type & tmat4x4::operator[](typename tmat4x4::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template - GLM_FUNC_QUALIFIER typename tmat4x4::col_type const & tmat4x4::operator[](typename tmat4x4::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } -# endif//GLM_FORCE_SIZE_FUNC + template + GLM_FUNC_QUALIFIER typename tmat4x4::col_type const & tmat4x4::operator[](typename tmat4x4::length_type i) const + { + assert(i < this->length()); + return this->value[i]; + } // -- Unary arithmetic operators -- diff --git a/glm/detail/type_vec1.inl b/glm/detail/type_vec1.inl index 5b4fa422..a3b46e5a 100644 --- a/glm/detail/type_vec1.inl +++ b/glm/detail/type_vec1.inl @@ -104,14 +104,14 @@ namespace glm template GLM_FUNC_QUALIFIER T & tvec1::operator[](typename tvec1::length_type i) { - assert(i >= 0 && static_cast(i) < detail::component_count(*this)); + assert(i >= 0 && i < this->length()); return (&x)[i]; } template GLM_FUNC_QUALIFIER T const & tvec1::operator[](typename tvec1::length_type i) const { - assert(i >= 0 && static_cast(i) < detail::component_count(*this)); + assert(i >= 0 && i < this->length()); return (&x)[i]; } diff --git a/glm/detail/type_vec2.inl b/glm/detail/type_vec2.inl index f23563f5..6caf4854 100644 --- a/glm/detail/type_vec2.inl +++ b/glm/detail/type_vec2.inl @@ -122,47 +122,25 @@ namespace glm // -- Component accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec2::size_type tvec2::size() const - { - return 2; - } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec2::length_type tvec2::length() const + { + return 2; + } - template - GLM_FUNC_QUALIFIER T & tvec2::operator[](typename tvec2::size_type i) - { - assert(i >= 0 && static_cast(i) < detail::component_count(*this)); - return (&x)[i]; - } + template + GLM_FUNC_QUALIFIER T & tvec2::operator[](typename tvec2::length_type i) + { + assert(i >= 0 && i < this->length()); + return (&x)[i]; + } - template - GLM_FUNC_QUALIFIER T const & tvec2::operator[](typename tvec2::size_type i) const - { - assert(i >= 0 && static_cast(i) < detail::component_count(*this)); - return (&x)[i]; - } -# else - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec2::length_type tvec2::length() const - { - return 2; - } - - template - GLM_FUNC_QUALIFIER T & tvec2::operator[](typename tvec2::length_type i) - { - assert(i >= 0 && static_cast(i) < detail::component_count(*this)); - return (&x)[i]; - } - - template - GLM_FUNC_QUALIFIER T const & tvec2::operator[](typename tvec2::length_type i) const - { - assert(i >= 0 && static_cast(i) < detail::component_count(*this)); - return (&x)[i]; - } -# endif//GLM_FORCE_SIZE_FUNC + template + GLM_FUNC_QUALIFIER T const & tvec2::operator[](typename tvec2::length_type i) const + { + assert(i >= 0 && i < this->length()); + return (&x)[i]; + } // -- Unary arithmetic operators -- diff --git a/glm/detail/type_vec3.inl b/glm/detail/type_vec3.inl index f8e95a30..b730ab58 100644 --- a/glm/detail/type_vec3.inl +++ b/glm/detail/type_vec3.inl @@ -168,47 +168,25 @@ namespace glm // -- Component accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec3::size_type tvec3::size() const - { - return 3; - } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec3::length_type tvec3::length() const + { + return 3; + } - template - GLM_FUNC_QUALIFIER T & tvec3::operator[](typename tvec3::size_type i) - { - assert(i >= 0 && static_cast(i) < detail::component_count(*this)); - return (&x)[i]; - } + template + GLM_FUNC_QUALIFIER T & tvec3::operator[](typename tvec3::length_type i) + { + assert(i >= 0 && i < this->length()); + return (&x)[i]; + } - template - GLM_FUNC_QUALIFIER T const & tvec3::operator[](typename tvec3::size_type i) const - { - assert(i >= 0 && static_cast(i) < detail::component_count(*this)); - return (&x)[i]; - } -# else - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec3::length_type tvec3::length() const - { - return 3; - } - - template - GLM_FUNC_QUALIFIER T & tvec3::operator[](typename tvec3::length_type i) - { - assert(i >= 0 && static_cast(i) < detail::component_count(*this)); - return (&x)[i]; - } - - template - GLM_FUNC_QUALIFIER T const & tvec3::operator[](typename tvec3::length_type i) const - { - assert(i >= 0 && static_cast(i) < detail::component_count(*this)); - return (&x)[i]; - } -# endif//GLM_FORCE_SIZE_FUNC + template + GLM_FUNC_QUALIFIER T const & tvec3::operator[](typename tvec3::length_type i) const + { + assert(i >= 0 && i < this->length()); + return (&x)[i]; + } // -- Unary arithmetic operators -- diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index 29b78bf5..625c515c 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -213,14 +213,14 @@ namespace glm template GLM_FUNC_QUALIFIER T & tvec4::operator[](typename tvec4::length_type i) { - assert(i >= 0 && static_cast(i) < detail::component_count(*this)); + assert(i >= 0 && i < this->length()); return (&x)[i]; } template GLM_FUNC_QUALIFIER T const & tvec4::operator[](typename tvec4::length_type i) const { - assert(i >= 0 && static_cast(i) < detail::component_count(*this)); + assert(i >= 0 && i < this->length()); return (&x)[i]; } diff --git a/glm/gtc/matrix_access.inl b/glm/gtc/matrix_access.inl index c0c2faad..2df23173 100644 --- a/glm/gtc/matrix_access.inl +++ b/glm/gtc/matrix_access.inl @@ -40,10 +40,10 @@ namespace glm typename genType::row_type const & x ) { - assert(index >= 0 && static_cast(index) < detail::component_count(m[0])); + assert(index >= 0 && index < m[0].length()); genType Result = m; - for(detail::component_count_t i = 0; i < detail::component_count(m); ++i) + for(length_t i = 0; i < m.length(); ++i) Result[i][index] = x[i]; return Result; } @@ -55,10 +55,10 @@ namespace glm length_t index ) { - assert(index >= 0 && static_cast(index) < detail::component_count(m[0])); + assert(index >= 0 && index < m[0].length()); typename genType::row_type Result; - for(detail::component_count_t i = 0; i < detail::component_count(m); ++i) + for(length_t i = 0; i < m.length(); ++i) Result[i] = m[i][index]; return Result; } @@ -71,7 +71,7 @@ namespace glm typename genType::col_type const & x ) { - assert(index >= 0 && static_cast(index) < detail::component_count(m)); + assert(index >= 0 && index < m.length()); genType Result = m; Result[index] = x; @@ -85,7 +85,7 @@ namespace glm length_t index ) { - assert(index >= 0 && static_cast(index) < detail::component_count(m)); + assert(index >= 0 && index < m.length()); return m[index]; } diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index ff4c2d68..7ea1b1d3 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -60,14 +60,14 @@ namespace detail template GLM_FUNC_QUALIFIER T & tquat::operator[](typename tquat::length_type i) { - assert(i >= 0 && static_cast(i) < detail::component_count(*this)); + assert(i >= 0 && i < this->length()); return (&x)[i]; } template GLM_FUNC_QUALIFIER T const & tquat::operator[](typename tquat::length_type i) const { - assert(i >= 0 && static_cast(i) < detail::component_count(*this)); + assert(i >= 0 && i < this->length()); return (&x)[i]; } @@ -717,7 +717,7 @@ namespace detail GLM_FUNC_QUALIFIER tvec4 lessThan(tquat const & x, tquat const & y) { tvec4 Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) + for(length_t i = 0; i < x.length(); ++i) Result[i] = x[i] < y[i]; return Result; } @@ -726,7 +726,7 @@ namespace detail GLM_FUNC_QUALIFIER tvec4 lessThanEqual(tquat const & x, tquat const & y) { tvec4 Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) + for(length_t i = 0; i < x.length(); ++i) Result[i] = x[i] <= y[i]; return Result; } @@ -735,7 +735,7 @@ namespace detail GLM_FUNC_QUALIFIER tvec4 greaterThan(tquat const & x, tquat const & y) { tvec4 Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) + for(length_t i = 0; i < x.length(); ++i) Result[i] = x[i] > y[i]; return Result; } @@ -744,7 +744,7 @@ namespace detail GLM_FUNC_QUALIFIER tvec4 greaterThanEqual(tquat const & x, tquat const & y) { tvec4 Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) + for(length_t i = 0; i < x.length(); ++i) Result[i] = x[i] >= y[i]; return Result; } @@ -753,7 +753,7 @@ namespace detail GLM_FUNC_QUALIFIER tvec4 equal(tquat const & x, tquat const & y) { tvec4 Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) + for(length_t i = 0; i < x.length(); ++i) Result[i] = x[i] == y[i]; return Result; } @@ -762,7 +762,7 @@ namespace detail GLM_FUNC_QUALIFIER tvec4 notEqual(tquat const & x, tquat const & y) { tvec4 Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) + for(length_t i = 0; i < x.length(); ++i) Result[i] = x[i] != y[i]; return Result; } diff --git a/glm/gtc/ulp.inl b/glm/gtc/ulp.inl index 765698b1..e5db24f9 100644 --- a/glm/gtc/ulp.inl +++ b/glm/gtc/ulp.inl @@ -232,7 +232,7 @@ namespace glm GLM_FUNC_QUALIFIER vecType next_float(vecType const & x) { vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) + for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = next_float(x[i]); return Result; } @@ -267,7 +267,7 @@ namespace glm GLM_FUNC_QUALIFIER vecType prev_float(vecType const & x) { vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) + for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = prev_float(x[i]); return Result; } @@ -285,7 +285,7 @@ namespace glm GLM_FUNC_QUALIFIER vecType next_float(vecType const & x, vecType const & ulps) { vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) + for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = next_float(x[i], ulps[i]); return Result; } @@ -303,7 +303,7 @@ namespace glm GLM_FUNC_QUALIFIER vecType prev_float(vecType const & x, vecType const & ulps) { vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) + for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = prev_float(x[i], ulps[i]); return Result; } @@ -343,7 +343,7 @@ namespace glm GLM_FUNC_QUALIFIER vecType float_distance(vecType const & x, vecType const & y) { vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) + for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = float_distance(x[i], y[i]); return Result; } diff --git a/glm/gtx/associated_min_max.inl b/glm/gtx/associated_min_max.inl index 41f08b46..f2a63f8f 100644 --- a/glm/gtx/associated_min_max.inl +++ b/glm/gtx/associated_min_max.inl @@ -47,7 +47,7 @@ GLM_FUNC_QUALIFIER tvec2 associatedMin ) { vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) + for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = x[i] < y[i] ? a[i] : b[i]; return Result; } @@ -60,7 +60,7 @@ GLM_FUNC_QUALIFIER vecType associatedMin ) { vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) + for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = x < y ? a[i] : b[i]; return Result; } @@ -73,7 +73,7 @@ GLM_FUNC_QUALIFIER vecType associatedMin ) { vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) + for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = x[i] < y[i] ? a : b; return Result; } @@ -100,7 +100,7 @@ GLM_FUNC_QUALIFIER vecType associatedMin ) { vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) + for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = x[i] < y[i] ? (x[i] < z[i] ? a[i] : c[i]) : (y[i] < z[i] ? b[i] : c[i]); return Result; } @@ -134,7 +134,7 @@ GLM_FUNC_QUALIFIER vecType associatedMin ) { vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) + for(length_t i = 0, n = Result.length(); i < n; ++i) { T Test1 = min(x[i], y[i]); T Test2 = min(z[i], w[i]); @@ -159,7 +159,7 @@ GLM_FUNC_QUALIFIER vecType associatedMin T Test2 = min(z, w); vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) + for(length_t i = 0, n = Result.length(); i < n; ++i) { U Result1 = x < y ? a[i] : b[i]; U Result2 = z < w ? c[i] : d[i]; @@ -179,7 +179,7 @@ GLM_FUNC_QUALIFIER vecType associatedMin ) { vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) + for(length_t i = 0, n = Result.length(); i < n; ++i) { T Test1 = min(x[i], y[i]); T Test2 = min(z[i], w[i]);; @@ -206,7 +206,7 @@ GLM_FUNC_QUALIFIER tvec2 associatedMax ) { vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) + for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = x[i] > y[i] ? a[i] : b[i]; return Result; } @@ -220,7 +220,7 @@ GLM_FUNC_QUALIFIER vecType associatedMax ) { vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) + for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = x > y ? a[i] : b[i]; return Result; } @@ -234,7 +234,7 @@ GLM_FUNC_QUALIFIER vecType associatedMax ) { vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) + for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = x[i] > y[i] ? a : b; return Result; } @@ -262,7 +262,7 @@ GLM_FUNC_QUALIFIER vecType associatedMax ) { vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) + for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a[i] : c[i]) : (y[i] > z[i] ? b[i] : c[i]); return Result; } @@ -277,7 +277,7 @@ GLM_FUNC_QUALIFIER vecType associatedMax ) { vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) + for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = x > y ? (x > z ? a[i] : c[i]) : (y > z ? b[i] : c[i]); return Result; } @@ -292,7 +292,7 @@ GLM_FUNC_QUALIFIER vecType associatedMax ) { vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) + for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a : c) : (y[i] > z[i] ? b : c); return Result; } @@ -326,7 +326,7 @@ GLM_FUNC_QUALIFIER vecType associatedMax ) { vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) + for(length_t i = 0, n = Result.length(); i < n; ++i) { T Test1 = max(x[i], y[i]); T Test2 = max(z[i], w[i]); @@ -351,7 +351,7 @@ GLM_FUNC_QUALIFIER vecType associatedMax T Test2 = max(z, w); vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) + for(length_t i = 0, n = Result.length(); i < n; ++i) { U Result1 = x > y ? a[i] : b[i]; U Result2 = z > w ? c[i] : d[i]; @@ -371,7 +371,7 @@ GLM_FUNC_QUALIFIER vecType associatedMax ) { vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) + for(length_t i = 0, n = Result.length(); i < n; ++i) { T Test1 = max(x[i], y[i]); T Test2 = max(z[i], w[i]);; diff --git a/glm/gtx/component_wise.inl b/glm/gtx/component_wise.inl index 42a641da..3cb17d28 100644 --- a/glm/gtx/component_wise.inl +++ b/glm/gtx/component_wise.inl @@ -122,36 +122,36 @@ namespace detail template class vecType> GLM_FUNC_QUALIFIER T compAdd(vecType const & v) { - T result(0); - for(detail::component_count_t i = 0; i < detail::component_count(v); ++i) - result += v[i]; - return result; + T Result(0); + for(length_t i = 0, n = v.length(); i < n; ++i) + Result += v[i]; + return Result; } template class vecType> GLM_FUNC_QUALIFIER T compMul(vecType const & v) { - T result(1); - for(detail::component_count_t i = 0; i < detail::component_count(v); ++i) - result *= v[i]; - return result; + T Result(1); + for(length_t i = 0, n = v.length(); i < n; ++i) + Result *= v[i]; + return Result; } template class vecType> GLM_FUNC_QUALIFIER T compMin(vecType const & v) { - T result(v[0]); - for(detail::component_count_t i = 1; i < detail::component_count(v); ++i) - result = min(result, v[i]); - return result; + T Result(v[0]); + for(length_t i = 1, n = v.length(); i < n; ++i) + Result = min(Result, v[i]); + return Result; } template class vecType> GLM_FUNC_QUALIFIER T compMax(vecType const & v) { - T result(v[0]); - for(detail::component_count_t i = 1; i < detail::component_count(v); ++i) - result = max(result, v[i]); - return result; + T Result(v[0]); + for(length_t i = 1, n = v.length(); i < n; ++i) + Result = max(Result, v[i]); + return Result; } }//namespace glm diff --git a/glm/gtx/dual_quaternion.inl b/glm/gtx/dual_quaternion.inl index fd41dcdc..f7d7ee72 100644 --- a/glm/gtx/dual_quaternion.inl +++ b/glm/gtx/dual_quaternion.inl @@ -37,47 +37,25 @@ namespace glm { // -- Component accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tdualquat::size_type tdualquat::size() const - { - return 2; - } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tdualquat::length_type tdualquat::length() const + { + return 2; + } - template - GLM_FUNC_QUALIFIER typename tdualquat::part_type & tdualquat::operator[](typename tdualquat::size_type i) - { - assert(i >= 0 && static_cast(i) < detail::component_count(*this)); - return (&real)[i]; - } + template + GLM_FUNC_QUALIFIER typename tdualquat::part_type & tdualquat::operator[](typename tdualquat::length_type i) + { + assert(i >= 0 && i < this->length()); + return (&real)[i]; + } - template - GLM_FUNC_QUALIFIER typename tdualquat::part_type const & tdualquat::operator[](typename tdualquat::size_type i) const - { - assert(i >= 0 && static_cast(i) < detail::component_count(*this)); - return (&real)[i]; - } -# else - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tdualquat::length_type tdualquat::length() const - { - return 2; - } - - template - GLM_FUNC_QUALIFIER typename tdualquat::part_type & tdualquat::operator[](typename tdualquat::length_type i) - { - assert(i >= 0 && static_cast(i) < detail::component_count(*this)); - return (&real)[i]; - } - - template - GLM_FUNC_QUALIFIER typename tdualquat::part_type const & tdualquat::operator[](typename tdualquat::length_type i) const - { - assert(i >= 0 && static_cast(i) < detail::component_count(*this)); - return (&real)[i]; - } -# endif//GLM_FORCE_SIZE_FUNC + template + GLM_FUNC_QUALIFIER typename tdualquat::part_type const & tdualquat::operator[](typename tdualquat::length_type i) const + { + assert(i >= 0 && i < this->length()); + return (&real)[i]; + } // -- Implicit basic constructors -- diff --git a/glm/gtx/fast_exponential.inl b/glm/gtx/fast_exponential.inl index 9cf882c2..3a85fd22 100644 --- a/glm/gtx/fast_exponential.inl +++ b/glm/gtx/fast_exponential.inl @@ -58,7 +58,7 @@ namespace glm GLM_FUNC_QUALIFIER vecType fastPow(vecType const & x, vecType const & y) { vecType Result(uninitialize); - for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) + for(length_t i = 0, n = x.length(); i < n; ++i) Result[i] = fastPow(x[i], y[i]); return Result; } diff --git a/glm/gtx/matrix_query.inl b/glm/gtx/matrix_query.inl index d913116f..18f810da 100644 --- a/glm/gtx/matrix_query.inl +++ b/glm/gtx/matrix_query.inl @@ -36,7 +36,7 @@ namespace glm GLM_FUNC_QUALIFIER bool isNull(tmat2x2 const & m, T const & epsilon) { bool result = true; - for(detail::component_count_t i = 0; result && i < 2 ; ++i) + for(length_t i = 0; result && i < m.length() ; ++i) result = isNull(m[i], epsilon); return result; } @@ -45,7 +45,7 @@ namespace glm GLM_FUNC_QUALIFIER bool isNull(tmat3x3 const & m, T const & epsilon) { bool result = true; - for(detail::component_count_t i = 0; result && i < 3 ; ++i) + for(length_t i = 0; result && i < m.length() ; ++i) result = isNull(m[i], epsilon); return result; } @@ -54,7 +54,7 @@ namespace glm GLM_FUNC_QUALIFIER bool isNull(tmat4x4 const & m, T const & epsilon) { bool result = true; - for(detail::component_count_t i = 0; result && i < 4 ; ++i) + for(length_t i = 0; result && i < m.length() ; ++i) result = isNull(m[i], epsilon); return result; } @@ -63,13 +63,13 @@ namespace glm GLM_FUNC_QUALIFIER bool isIdentity(matType const & m, T const & epsilon) { bool result = true; - for(detail::component_count_t i(0); result && i < detail::component_count(m[0]); ++i) + for(length_t i = 0; result && i < m[0].length() ; ++i) { - for(detail::component_count_t j(0); result && j < i ; ++j) + for(length_t j = 0; result && j < i ; ++j) result = abs(m[i][j]) <= epsilon; if(result) result = abs(m[i][i] - 1) <= epsilon; - for(detail::component_count_t j(i + 1); result && j < detail::component_count(m); ++j) + for(length_t j = i + 1; result && j < m.length(); ++j) result = abs(m[i][j]) <= epsilon; } return result; @@ -79,12 +79,12 @@ namespace glm GLM_FUNC_QUALIFIER bool isNormalized(tmat2x2 const & m, T const & epsilon) { bool result(true); - for(detail::component_count_t i(0); result && i < detail::component_count(m); ++i) + for(length_t i = 0; result && i < m.length(); ++i) result = isNormalized(m[i], epsilon); - for(detail::component_count_t i(0); result && i < detail::component_count(m); ++i) + for(length_t i = 0; result && i < m.length(); ++i) { typename tmat2x2::col_type v; - for(detail::component_count_t j(0); j < detail::component_count(m); ++j) + for(length_t j = 0; j < m.length(); ++j) v[j] = m[j][i]; result = isNormalized(v, epsilon); } @@ -95,12 +95,12 @@ namespace glm GLM_FUNC_QUALIFIER bool isNormalized(tmat3x3 const & m, T const & epsilon) { bool result(true); - for(detail::component_count_t i(0); result && i < detail::component_count(m); ++i) + for(length_t i = 0; result && i < m.length(); ++i) result = isNormalized(m[i], epsilon); - for(detail::component_count_t i(0); result && i < detail::component_count(m); ++i) + for(length_t i = 0; result && i < m.length(); ++i) { typename tmat3x3::col_type v; - for(detail::component_count_t j(0); j < detail::component_count(m); ++j) + for(length_t j = 0; j < m.length(); ++j) v[j] = m[j][i]; result = isNormalized(v, epsilon); } @@ -111,12 +111,12 @@ namespace glm GLM_FUNC_QUALIFIER bool isNormalized(tmat4x4 const & m, T const & epsilon) { bool result(true); - for(detail::component_count_t i(0); result && i < detail::component_count(m); ++i) + for(length_t i = 0; result && i < m.length(); ++i) result = isNormalized(m[i], epsilon); - for(detail::component_count_t i(0); result && i < detail::component_count(m); ++i) + for(length_t i = 0; result && i < m.length(); ++i) { typename tmat4x4::col_type v; - for(detail::component_count_t j(0); j < detail::component_count(m); ++j) + for(length_t j = 0; j < m.length(); ++j) v[j] = m[j][i]; result = isNormalized(v, epsilon); } @@ -127,15 +127,15 @@ namespace glm GLM_FUNC_QUALIFIER bool isOrthogonal(matType const & m, T const & epsilon) { bool result(true); - for(detail::component_count_t i(0); result && i < detail::component_count(m) - 1; ++i) - for(detail::component_count_t j(i + 1); result && j < detail::component_count(m); ++j) + for(length_t i(0); result && i < m.length() - 1; ++i) + for(length_t j(i + 1); result && j < m.length(); ++j) result = areOrthogonal(m[i], m[j], epsilon); if(result) { matType tmp = transpose(m); - for(detail::component_count_t i(0); result && i < detail::component_count(m) - 1 ; ++i) - for(detail::component_count_t j(i + 1); result && j < detail::component_count(m); ++j) + for(length_t i(0); result && i < m.length() - 1 ; ++i) + for(length_t j(i + 1); result && j < m.length(); ++j) result = areOrthogonal(tmp[i], tmp[j], epsilon); } return result; diff --git a/glm/gtx/range.hpp b/glm/gtx/range.hpp index 19ae2409..9fb2bb54 100644 --- a/glm/gtx/range.hpp +++ b/glm/gtx/range.hpp @@ -48,54 +48,65 @@ #endif #include "../gtc/type_ptr.hpp" +#include "../gtc/vec1.hpp" -namespace glm{ -namespace detail +namespace glm { - /* The glm types provide a .length() member, but for matrices - this only defines the number of columns, so we need to work around this */ - template - detail::component_count_t number_of_elements_(tvec2 const & v){ - return detail::component_count(v); - } - - template - detail::component_count_t number_of_elements_(tvec3 const & v){ - return detail::component_count(v); - } - - template - detail::component_count_t number_of_elements_(tvec4 const & v){ - return detail::component_count(v); - } - - template - detail::component_count_t number_of_elements_(genType const & m){ - return detail::component_count(m) * detail::component_count(m[0]); - } -}//namespace - /// @addtogroup gtx_range /// @{ + template + inline length_t components(tvec1 const & v) + { + return v.length(); + } + + template + inline length_t components(tvec2 const & v) + { + return v.length(); + } + + template + inline length_t components(tvec3 const & v) + { + return v.length(); + } + + template + inline length_t components(tvec4 const & v) + { + return v.length(); + } + template - const typename genType::value_type * begin(genType const & v){ + inline length_t components(genType const & m) + { + return m.length() * m[0].length(); + } + + template + inline typename genType::value_type const * begin(genType const & v) + { return value_ptr(v); } template - const typename genType::value_type * end(genType const & v){ - return begin(v) + detail::number_of_elements_(v); + inline typename genType::value_type const * end(genType const & v) + { + return begin(v) + components(v); } template - typename genType::value_type * begin(genType& v){ + inline typename genType::value_type * begin(genType& v) + { return value_ptr(v); } template - typename genType::value_type * end(genType& v){ - return begin(v) + detail::number_of_elements_(v); + inline typename genType::value_type * end(genType& v) + { + return begin(v) + components(v); } /// @} diff --git a/test/gtx/gtx_type_trait.cpp b/test/gtx/gtx_type_trait.cpp index 874366cf..f0829c67 100644 --- a/test/gtx/gtx_type_trait.cpp +++ b/test/gtx/gtx_type_trait.cpp @@ -17,7 +17,7 @@ struct type_gni static bool const is_quat = false; }; */ - +/* namespace detail { template