From b51f4e89817c8d41fab2b693786f60f11fcc7e6e Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 14 Nov 2015 13:25:06 +0100 Subject: [PATCH 001/110] Added test --- test/core/core_func_packing.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/core/core_func_packing.cpp b/test/core/core_func_packing.cpp index 411121bc..52f606eb 100644 --- a/test/core/core_func_packing.cpp +++ b/test/core/core_func_packing.cpp @@ -80,7 +80,13 @@ int test_packSnorm2x16() int test_packUnorm4x8() { int Error = 0; - + + glm::uint32 Packed = glm::packUnorm4x8(glm::vec4(1.0f, 0.5f, 0.0f, 1.0f)); + glm::u8vec4 Vec(255, 128, 0, 255); + glm::uint32 & Ref = *reinterpret_cast(&Vec[0]); + + Error += Packed == Ref ? 0 : 1; + std::vector A; A.push_back(glm::vec4(1.0f, 0.7f, 0.3f, 0.0f)); A.push_back(glm::vec4(0.5f, 0.1f, 0.2f, 0.3f)); From 2edd8b8d44360709818e5a734a7cf74612248172 Mon Sep 17 00:00:00 2001 From: Erik Sejersen Date: Mon, 23 Nov 2015 00:52:38 +0100 Subject: [PATCH 002/110] frustumLH compile error fix. --- glm/gtc/matrix_transform.inl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glm/gtc/matrix_transform.inl b/glm/gtc/matrix_transform.inl index 7e2c05bc..2cd2645c 100644 --- a/glm/gtc/matrix_transform.inl +++ b/glm/gtc/matrix_transform.inl @@ -274,8 +274,8 @@ namespace glm Result[2][3] = static_cast(1); #ifdef GLM_DEPTH_ZERO_TO_ONE - Result[2][2] = farVal / (zFar - nearVal); - Result[3][2] = -(farVal * nearVal) / (zFar - nearVal); + Result[2][2] = farVal / (farVal - nearVal); + Result[3][2] = -(farVal * nearVal) / (farVal - nearVal); #else Result[2][2] = (farVal + nearVal) / (farVal - nearVal); Result[3][2] = - (static_cast(2) * farVal * nearVal) / (farVal - nearVal); From 8fd8c56074bafc855dd2696b2f5aafaa9b4735be Mon Sep 17 00:00:00 2001 From: Adrian Krupa Date: Sun, 29 Nov 2015 20:53:04 +0100 Subject: [PATCH 003/110] Fixed frexp compilation error --- glm/detail/func_common.inl | 4 ++-- readme.md | 1 + test/core/core_func_common.cpp | 43 ++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/glm/detail/func_common.inl b/glm/detail/func_common.inl index 83252de4..c3982e82 100644 --- a/glm/detail/func_common.inl +++ b/glm/detail/func_common.inl @@ -662,7 +662,7 @@ namespace detail { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'frexp' only accept floating-point inputs"); - return std::frexp(x, exp); + return std::frexp(x, &exp); } template @@ -670,7 +670,7 @@ namespace detail { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'frexp' only accept floating-point inputs"); - return tvec1(std::frexp(x.x, exp.x)); + return tvec1(std::frexp(x.x, &exp.x)); } template diff --git a/readme.md b/readme.md index 521a1b69..2b4c91d1 100644 --- a/readme.md +++ b/readme.md @@ -69,6 +69,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) ##### Fixes: - Fixed GTX_extended_min_max filename typo #386 - Fixed intersectRayTriangle to not do any unintentional backface culling +- Fixed frexp compilation error #### [GLM 0.9.7.2](https://github.com/g-truc/glm/tree/0.9.7) - 2015-XX-XX ##### Fixes: diff --git a/test/core/core_func_common.cpp b/test/core/core_func_common.cpp index 43dade52..6b9940b8 100644 --- a/test/core/core_func_common.cpp +++ b/test/core/core_func_common.cpp @@ -1153,6 +1153,48 @@ namespace sign } }//namespace sign +namespace frexp_ +{ + int test() + { + int Error(0); + + { + glm::vec1 x(1024); + glm::ivec1 exp; + glm::vec1 A = glm::frexp(x, exp); + Error += glm::all(glm::epsilonEqual(A, glm::vec1(0.5), 0.00001f)) ? 0 : 1; + Error += glm::all(glm::equal(exp, glm::ivec1(11))) ? 0 : 1; + } + + { + glm::vec2 x(1024, 0.24); + glm::ivec2 exp; + glm::vec2 A = glm::frexp(x, exp); + Error += glm::all(glm::epsilonEqual(A, glm::vec2(0.5, 0.96), 0.00001f)) ? 0 : 1; + Error += glm::all(glm::equal(exp, glm::ivec2(11, -2))) ? 0 : 1; + } + + { + glm::vec3 x(1024, 0.24, 0); + glm::ivec3 exp; + glm::vec3 A = glm::frexp(x, exp); + Error += glm::all(glm::epsilonEqual(A, glm::vec3(0.5, 0.96, 0.0), 0.00001f)) ? 0 : 1; + Error += glm::all(glm::equal(exp, glm::ivec3(11, -2, 0))) ? 0 : 1; + } + + { + glm::vec4 x(1024, 0.24, 0, -1.33); + glm::ivec4 exp; + glm::vec4 A = glm::frexp(x, exp); + Error += glm::all(glm::epsilonEqual(A, glm::vec4(0.5, 0.96, 0.0, -0.665), 0.00001f)) ? 0 : 1; + Error += glm::all(glm::equal(exp, glm::ivec4(11, -2, 0, 1))) ? 0 : 1; + } + + return Error; + } +}//namespace frexp_ + int main() { int Error(0); @@ -1171,6 +1213,7 @@ int main() Error += roundEven::test(); Error += isnan_::test(); Error += isinf_::test(); + Error += frexp_::test(); # ifdef NDEBUG std::size_t Samples = 1000; From 014a7f8404410b9f384f91db4cc961852ebc7c87 Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Wed, 16 Dec 2015 15:57:29 +0100 Subject: [PATCH 004/110] This fixes #461 --- glm/gtc/quaternion.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index e5fe5505..b46cd62c 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -664,7 +664,7 @@ namespace detail template GLM_FUNC_QUALIFIER T yaw(tquat const & q) { - return asin(T(-2) * (q.x * q.z - q.w * q.y)); + return asin(clamp(T(-2) * (q.x * q.z - q.w * q.y), T(-1), T(1))); } template From 8c55a64fdd7b8fe6a72d70f5449b8469cfbab379 Mon Sep 17 00:00:00 2001 From: humbletim Date: Sat, 19 Dec 2015 19:22:33 -0500 Subject: [PATCH 005/110] Fixed ldexp compilation error --- glm/detail/func_common.inl | 2 +- readme.md | 2 +- test/core/core_func_common.cpp | 48 ++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 2 deletions(-) diff --git a/glm/detail/func_common.inl b/glm/detail/func_common.inl index c3982e82..6b78b2b4 100644 --- a/glm/detail/func_common.inl +++ b/glm/detail/func_common.inl @@ -706,7 +706,7 @@ namespace detail frexp(x.w, exp.w)); } - template + template GLM_FUNC_QUALIFIER genType ldexp(genType const & x, int const & exp) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'ldexp' only accept floating-point inputs"); diff --git a/readme.md b/readme.md index 2b4c91d1..bda461a9 100644 --- a/readme.md +++ b/readme.md @@ -69,7 +69,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) ##### Fixes: - Fixed GTX_extended_min_max filename typo #386 - Fixed intersectRayTriangle to not do any unintentional backface culling -- Fixed frexp compilation error +- Fixed ldexp and frexp compilation errors #### [GLM 0.9.7.2](https://github.com/g-truc/glm/tree/0.9.7) - 2015-XX-XX ##### Fixes: diff --git a/test/core/core_func_common.cpp b/test/core/core_func_common.cpp index 6b9940b8..780151e5 100644 --- a/test/core/core_func_common.cpp +++ b/test/core/core_func_common.cpp @@ -1195,6 +1195,53 @@ namespace frexp_ } }//namespace frexp_ +namespace ldexp_ +{ + int test() + { + int Error(0); + + { + glm::vec1 A = glm::vec1(0.5); + glm::ivec1 exp = glm::ivec1(11); + glm::vec1 x = glm::ldexp(A, exp); + Error += glm::all(glm::epsilonEqual(x, glm::vec1(1024),0.00001f)) ? 0 : 1; + } + + { + glm::vec2 A = glm::vec2(0.5, 0.96); + glm::ivec2 exp = glm::ivec2(11, -2); + glm::vec2 x = glm::ldexp(A, exp); + Error += glm::all(glm::epsilonEqual(x, glm::vec2(1024, .24),0.00001f)) ? 0 : 1; + } + + { + glm::vec3 A = glm::vec3(0.5, 0.96, 0.0); + glm::ivec3 exp = glm::ivec3(11, -2, 0); + glm::vec3 x = glm::ldexp(A, exp); + Error += glm::all(glm::epsilonEqual(x, glm::vec3(1024, .24, 0),0.00001f)) ? 0 : 1; + } + + { + glm::vec4 A = glm::vec4(0.5, 0.96, 0.0, -0.665); + glm::ivec4 exp = glm::ivec4(11, -2, 0, 1); + glm::vec4 x = glm::ldexp(A, exp); + Error += glm::all(glm::epsilonEqual(x, glm::vec4(1024, .24, 0, -1.33),0.00001f)) ? 0 : 1; + } + + + { + glm::vec4 x(1024, 0.24, 0, -1.33); + glm::ivec4 exp; + glm::vec4 A = glm::frexp(x, exp); + Error += glm::all(glm::epsilonEqual(A, glm::vec4(0.5, 0.96, 0.0, -0.665), 0.00001f)) ? 0 : 1; + Error += glm::all(glm::equal(exp, glm::ivec4(11, -2, 0, 1))) ? 0 : 1; + } + + return Error; + } +}//namespace ldexp_ + int main() { int Error(0); @@ -1214,6 +1261,7 @@ int main() Error += isnan_::test(); Error += isinf_::test(); Error += frexp_::test(); + Error += ldexp_::test(); # ifdef NDEBUG std::size_t Samples = 1000; From ac7ae328560225443e46f9168e13dcb00524f96b Mon Sep 17 00:00:00 2001 From: humbletim Date: Sat, 19 Dec 2015 19:30:00 -0500 Subject: [PATCH 006/110] remove extraneous test block --- test/core/core_func_common.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/test/core/core_func_common.cpp b/test/core/core_func_common.cpp index 780151e5..a610dd51 100644 --- a/test/core/core_func_common.cpp +++ b/test/core/core_func_common.cpp @@ -1229,15 +1229,6 @@ namespace ldexp_ Error += glm::all(glm::epsilonEqual(x, glm::vec4(1024, .24, 0, -1.33),0.00001f)) ? 0 : 1; } - - { - glm::vec4 x(1024, 0.24, 0, -1.33); - glm::ivec4 exp; - glm::vec4 A = glm::frexp(x, exp); - Error += glm::all(glm::epsilonEqual(A, glm::vec4(0.5, 0.96, 0.0, -0.665), 0.00001f)) ? 0 : 1; - Error += glm::all(glm::equal(exp, glm::ivec4(11, -2, 0, 1))) ? 0 : 1; - } - return Error; } }//namespace ldexp_ From 816b6b8c34d9204298b49fa810d02d094be7ca62 Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Wed, 23 Dec 2015 01:24:48 +0100 Subject: [PATCH 007/110] Fix wrong docs The function this function is a helper of is using radians. In fact, glm is using radians everywhere! --- glm/gtx/transform.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/gtx/transform.hpp b/glm/gtx/transform.hpp index 7e6a4a73..5d22fba5 100644 --- a/glm/gtx/transform.hpp +++ b/glm/gtx/transform.hpp @@ -64,7 +64,7 @@ namespace glm GLM_FUNC_DECL tmat4x4 translate( tvec3 const & v); - /// Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees. + /// Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in radians. /// @see gtc_matrix_transform /// @see gtx_transform template From 22467f00f89a2d436e57b9980b29e259f5683c88 Mon Sep 17 00:00:00 2001 From: Stephen Hill Date: Wed, 23 Dec 2015 12:16:31 -0500 Subject: [PATCH 008/110] Fixed "Declaration shadows a field" warning --- glm/detail/type_half.inl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/glm/detail/type_half.inl b/glm/detail/type_half.inl index ff8740c8..b9f9f0ed 100644 --- a/glm/detail/type_half.inl +++ b/glm/detail/type_half.inl @@ -52,12 +52,12 @@ namespace detail i(0) {} - GLM_FUNC_QUALIFIER uif32(float f) : - f(f) + GLM_FUNC_QUALIFIER uif32(float f_) : + f(f_) {} - GLM_FUNC_QUALIFIER uif32(uint32 i) : - i(i) + GLM_FUNC_QUALIFIER uif32(uint32 i_) : + i(i_) {} float f; From 89cecd373a2acec765e77927448c76aad2e881dd Mon Sep 17 00:00:00 2001 From: Stephen Hill Date: Wed, 23 Dec 2015 12:18:14 -0500 Subject: [PATCH 009/110] Fixed 'GLM_COMPILER_VC2005 is not defined' warning This GLM compiler version isn't defined, so I just removed the legacy functions. --- glm/detail/setup.hpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 2478c3ef..dbbb730a 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -457,13 +457,6 @@ #endif//GLM_ARCH #if GLM_ARCH & GLM_ARCH_SSE2 # include -# if(GLM_COMPILER == GLM_COMPILER_VC2005) // VC2005 is missing some intrinsics, workaround - inline float _mm_cvtss_f32(__m128 A) { return A.m128_f32[0]; } - inline __m128 _mm_castpd_ps(__m128d PD) { union { __m128 ps; __m128d pd; } c; c.pd = PD; return c.ps; } - inline __m128d _mm_castps_pd(__m128 PS) { union { __m128 ps; __m128d pd; } c; c.ps = PS; return c.pd; } - inline __m128i _mm_castps_si128(__m128 PS) { union { __m128 ps; __m128i pi; } c; c.ps = PS; return c.pi; } - inline __m128 _mm_castsi128_ps(__m128i PI) { union { __m128 ps; __m128i pi; } c; c.pi = PI; return c.ps; } -# endif #endif//GLM_ARCH #if defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_ARCH_DISPLAYED) From 47a2a6adfbb58bf3104165cf67d916573336b926 Mon Sep 17 00:00:00 2001 From: Stephen Hill Date: Wed, 23 Dec 2015 12:19:13 -0500 Subject: [PATCH 010/110] Fixed various 'X is not defined' warnings --- glm/detail/setup.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index dbbb730a..237d41ea 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -395,13 +395,13 @@ #elif defined(GLM_FORCE_SSE2) # define GLM_ARCH (GLM_ARCH_SSE2) #elif (GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM | GLM_COMPILER_GCC)) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_LINUX)) -# if(__AVX2__) +# if defined(__AVX2__) # define GLM_ARCH (GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -# elif(__AVX__) +# elif defined(__AVX__) # define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -# elif(__SSE3__) +# elif defined(__SSE3__) # define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -# elif(__SSE2__) +# elif defined(__SSE2__) # define GLM_ARCH (GLM_ARCH_SSE2) # else # define GLM_ARCH GLM_ARCH_PURE @@ -1001,7 +1001,7 @@ namespace detail } }//namespace glm # define GLM_COUNTOF(arr) glm::countof(arr) -#elif _MSC_VER +#elif defined(_MSC_VER) # define GLM_COUNTOF(arr) _countof(arr) #else # define GLM_COUNTOF(arr) sizeof(arr) / sizeof(arr[0]) From e9febd9ee731b204377d7c5ba8f55ba03acdf9db Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 1 Jan 2016 14:30:14 +0100 Subject: [PATCH 011/110] Fixed log from GTX_lob_base build error with tests #470, #471 --- glm/gtx/log_base.hpp | 12 +++++------ test/gtx/gtx_log_base.cpp | 45 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 6 deletions(-) diff --git a/glm/gtx/log_base.hpp b/glm/gtx/log_base.hpp index 94d03472..e6c89ea2 100644 --- a/glm/gtx/log_base.hpp +++ b/glm/gtx/log_base.hpp @@ -53,15 +53,15 @@ namespace glm /// @addtogroup gtx_log_base /// @{ - //! Logarithm for any base. - //! From GLM_GTX_log_base. + /// Logarithm for any base. + /// From GLM_GTX_log_base. template GLM_FUNC_DECL genType log( - genType x, - genType base); + genType const & x, + genType const & base); - //! Logarithm for any base. - //! From GLM_GTX_log_base. + /// Logarithm for any base. + /// From GLM_GTX_log_base. template class vecType> GLM_FUNC_DECL vecType sign( vecType const & x, diff --git a/test/gtx/gtx_log_base.cpp b/test/gtx/gtx_log_base.cpp index b7cc9ae0..464b6eb1 100644 --- a/test/gtx/gtx_log_base.cpp +++ b/test/gtx/gtx_log_base.cpp @@ -30,10 +30,55 @@ /////////////////////////////////////////////////////////////////////////////////// #include +#include +#include +#include + +namespace test_log +{ + int run() + { + int Error = 0; + + { + float A = glm::log(10.f, 2.0f); + float B = glm::log2(10.f); + Error += glm::epsilonEqual(A, B, 0.00001f) ? 0 : 1; + } + + { + glm::vec1 A = glm::log(glm::vec1(10.f), glm::vec1(2.0f)); + glm::vec1 B = glm::log2(glm::vec1(10.f)); + Error += glm::all(glm::epsilonEqual(A, B, glm::vec1(0.00001f))) ? 0 : 1; + } + + { + glm::vec2 A = glm::log(glm::vec2(10.f), glm::vec2(2.0f)); + glm::vec2 B = glm::log2(glm::vec2(10.f)); + Error += glm::all(glm::epsilonEqual(A, B, glm::vec2(0.00001f))) ? 0 : 1; + } + + { + glm::vec3 A = glm::log(glm::vec3(10.f), glm::vec3(2.0f)); + glm::vec3 B = glm::log2(glm::vec3(10.f)); + Error += glm::all(glm::epsilonEqual(A, B, glm::vec3(0.00001f))) ? 0 : 1; + } + + { + glm::vec4 A = glm::log(glm::vec4(10.f), glm::vec4(2.0f)); + glm::vec4 B = glm::log2(glm::vec4(10.f)); + Error += glm::all(glm::epsilonEqual(A, B, glm::vec4(0.00001f))) ? 0 : 1; + } + + return Error; + } +}//namespace test_log int main() { int Error(0); + Error += test_log::run(); + return Error; } From 2f2782d72ae38b1e3bde46378a7e487255d665d7 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 3 Jan 2016 16:03:30 +0100 Subject: [PATCH 012/110] Fixed ICC on Linux build errors #449 --- glm/detail/func_common.inl | 16 +++++++++++----- readme.md | 5 +++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/glm/detail/func_common.inl b/glm/detail/func_common.inl index 6b78b2b4..2c32626f 100644 --- a/glm/detail/func_common.inl +++ b/glm/detail/func_common.inl @@ -548,14 +548,16 @@ namespace detail # if GLM_HAS_CXX11_STL return std::isnan(x); -# elif GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_INTEL) +# elif GLM_COMPILER & GLM_COMPILER_VC return _isnan(x) != 0; -# elif GLM_COMPILER & (GLM_COMPILER_GCC | (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) -# if GLM_PLATFORM & GLM_PLATFORM_ANDROID && __cplusplus < 201103L +# elif GLM_COMPILER & GLM_COMPILER_INTEL +# if GLM_PLATFORM & GLM_PLATFORM_WINDOWS return _isnan(x) != 0; # else - return std::isnan(x); + return ::isnan(x) != 0; # endif +# elif (GLM_COMPILER & (GLM_COMPILER_GCC | (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM))) && (GLM_PLATFORM & GLM_PLATFORM_ANDROID) && __cplusplus < 201103L + return _isnan(x) != 0; # elif GLM_COMPILER & GLM_COMPILER_CUDA return isnan(x) != 0; # else @@ -583,7 +585,11 @@ namespace detail # if GLM_HAS_CXX11_STL return std::isinf(x); # elif GLM_COMPILER & (GLM_COMPILER_INTEL | GLM_COMPILER_VC) - return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF; +# if(GLM_PLATFORM & GLM_PLATFORM_WINDOWS) + return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF; +# else + return ::isinf(x); +# endif # elif GLM_COMPILER & (GLM_COMPILER_GCC | (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) # if(GLM_PLATFORM & GLM_PLATFORM_ANDROID && __cplusplus < 201103L) return _isinf(x) != 0; diff --git a/readme.md b/readme.md index bda461a9..649c25fb 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.8.0](https://github.com/g-truc/glm/releases/latest) - 201X-XX-XX +#### [GLM 0.9.8.0](https://github.com/g-truc/glm/releases/latest) - 2016-XX-XX ##### Features: - Added compNormalize and compScale functions to GTX_component_wise - Added packF3x9_E1x5 and unpackF3x9_E1x5 to GTC_packing for RGB9E5 #416 @@ -70,8 +70,9 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) - Fixed GTX_extended_min_max filename typo #386 - Fixed intersectRayTriangle to not do any unintentional backface culling - Fixed ldexp and frexp compilation errors +- Fixed ICC on Linux build errors #449 -#### [GLM 0.9.7.2](https://github.com/g-truc/glm/tree/0.9.7) - 2015-XX-XX +#### [GLM 0.9.7.2](https://github.com/g-truc/glm/tree/0.9.7) - 2016-XX-XX ##### Fixes: - Fixed GTC_round floorMultiple/ceilMultiple #412 - Fixed GTC_packing unpackUnorm3x10_1x2 #414 From 7a1c042d8ba0ff9057ee77d262b35d4ee1b997c9 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 3 Jan 2016 17:10:24 +0100 Subject: [PATCH 013/110] Fixed ICC on Linux build errors #449 --- glm/detail/setup.hpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 237d41ea..077bf0b8 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -574,22 +574,18 @@ # ifdef _MSC_EXTENSIONS # define GLM_MSC_EXT GLM_LANG_CXXMS_FLAG # else -# define GLM_MSC_EXT +# define GLM_MSC_EXT 0 # endif -# if __INTEL_CXX11_MODE__ -# if __cplusplus >= 201402L -# define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_CXXMS_FLAG) -# elif __cplusplus >= 201103L -# define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_CXXMS_FLAG) -# else -# define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_CXXMS_FLAG) -# endif +# if __cplusplus >= 201402L +# define GLM_LANG (GLM_LANG_CXX14 | GLM_MSC_EXT) +# elif __cplusplus >= 201103L +# define GLM_LANG (GLM_LANG_CXX11 | GLM_MSC_EXT) +# elif __INTEL_CXX11_MODE__ +# define GLM_LANG (GLM_LANG_CXX0X | GLM_MSC_EXT) +# elif __cplusplus >= 199711L +# define GLM_LANG (GLM_LANG_CXX98 | GLM_MSC_EXT) # else -# if __cplusplus >= 199711L -# define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_CXXMS_FLAG) -# else -# define GLM_LANG (GLM_LANG_CXX | GLM_LANG_CXXMS_FLAG) -# endif +# define GLM_LANG (GLM_LANG_CXX | GLM_MSC_EXT) # endif # else // Unkown compiler # if __cplusplus >= 201402L From df39980121ef6deae7d8bcb10b096ab1e924650d Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 3 Jan 2016 17:36:31 +0100 Subject: [PATCH 014/110] Tentative fix for 64 bits on GCC --- glm/gtc/bitfield.inl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/glm/gtc/bitfield.inl b/glm/gtc/bitfield.inl index 11702627..0ccba8aa 100644 --- a/glm/gtc/bitfield.inl +++ b/glm/gtc/bitfield.inl @@ -87,20 +87,20 @@ namespace detail glm::uint64 REG1(x); glm::uint64 REG2(y); - REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF); - REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF); + REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFFull); + REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFFull); - REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF); - REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF); + REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FFull); + REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FFull); - REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F); - REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F); + REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0Full); + REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0Full); - REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333); - REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333); + REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333ull); + REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333ull); - REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555); - REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555); + REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555ull); + REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555ull); return REG1 | (REG2 << 1); } From 846e88a147040cdab83975ddd3c429812eee47d4 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 3 Jan 2016 18:01:56 +0100 Subject: [PATCH 015/110] Updated version --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 860a6eed..f9e188e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 2.6 FATAL_ERROR) project(glm) -set(GLM_VERSION "0.9.7") +set(GLM_VERSION "0.9.8") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") From adb03bee5cf430824a2e08c5d175311694a27397 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 3 Jan 2016 16:03:30 +0100 Subject: [PATCH 016/110] Fixed ICC on Linux build errors #449 --- glm/detail/func_common.inl | 16 +++++++++++----- readme.md | 3 ++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/glm/detail/func_common.inl b/glm/detail/func_common.inl index 83252de4..338700b1 100644 --- a/glm/detail/func_common.inl +++ b/glm/detail/func_common.inl @@ -548,14 +548,16 @@ namespace detail # if GLM_HAS_CXX11_STL return std::isnan(x); -# elif GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_INTEL) +# elif GLM_COMPILER & GLM_COMPILER_VC return _isnan(x) != 0; -# elif GLM_COMPILER & (GLM_COMPILER_GCC | (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) -# if GLM_PLATFORM & GLM_PLATFORM_ANDROID && __cplusplus < 201103L +# elif GLM_COMPILER & GLM_COMPILER_INTEL +# if GLM_PLATFORM & GLM_PLATFORM_WINDOWS return _isnan(x) != 0; # else - return std::isnan(x); + return ::isnan(x) != 0; # endif +# elif (GLM_COMPILER & (GLM_COMPILER_GCC | (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM))) && (GLM_PLATFORM & GLM_PLATFORM_ANDROID) && __cplusplus < 201103L + return _isnan(x) != 0; # elif GLM_COMPILER & GLM_COMPILER_CUDA return isnan(x) != 0; # else @@ -583,7 +585,11 @@ namespace detail # if GLM_HAS_CXX11_STL return std::isinf(x); # elif GLM_COMPILER & (GLM_COMPILER_INTEL | GLM_COMPILER_VC) - return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF; +# if(GLM_PLATFORM & GLM_PLATFORM_WINDOWS) + return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF; +# else + return ::isinf(x); +# endif # elif GLM_COMPILER & (GLM_COMPILER_GCC | (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) # if(GLM_PLATFORM & GLM_PLATFORM_ANDROID && __cplusplus < 201103L) return _isinf(x) != 0; diff --git a/readme.md b/readme.md index 8097856f..093dd0d1 100644 --- a/readme.md +++ b/readme.md @@ -51,11 +51,12 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) ## Release notes -#### [GLM 0.9.7.2](https://github.com/g-truc/glm/tree/0.9.7) - 2015-XX-XX +#### [GLM 0.9.7.2](https://github.com/g-truc/glm/tree/0.9.7) - 2016-01-XX ##### Fixes: - Fixed GTC_round floorMultiple/ceilMultiple #412 - Fixed GTC_packing unpackUnorm3x10_1x2 #414 - Fixed GTC_matrix_inverse affineInverse #192 +- Fixed ICC on Linux build errors #449 #### [GLM 0.9.7.1](https://github.com/g-truc/glm/releases/tag/0.9.7.1) - 2015-09-07 ##### Improvements: From a754ab2e7eb522bf50629687d0208bae287d95ca Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 3 Jan 2016 17:10:24 +0100 Subject: [PATCH 017/110] Fixed ICC on Linux build errors #449 --- glm/detail/setup.hpp | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index ebbdd45d..71a7b098 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -577,29 +577,20 @@ # endif # elif GLM_COMPILER & GLM_COMPILER_INTEL # ifdef _MSC_EXTENSIONS -# if __cplusplus >= 201402L -# define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_CXXMS_FLAG) -# elif __cplusplus >= 201103L -# define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_CXXMS_FLAG) -# elif GLM_COMPILER >= GLM_COMPILER_INTEL13 -# define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_CXXMS_FLAG) -# elif __cplusplus >= 199711L -# define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_CXXMS_FLAG) -# else -# define GLM_LANG (GLM_LANG_CXX | GLM_LANG_CXXMS_FLAG) -# endif +# define GLM_MSC_EXT GLM_LANG_CXXMS_FLAG # else -# if __cplusplus >= 201402L -# define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_CXXMS_FLAG) -# elif __cplusplus >= 201103L -# define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_CXXMS_FLAG) -# elif GLM_COMPILER >= GLM_COMPILER_INTEL13 -# define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_CXXMS_FLAG) -# elif __cplusplus >= 199711L -# define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_CXXMS_FLAG) -# else -# define GLM_LANG (GLM_LANG_CXX | GLM_LANG_CXXMS_FLAG) -# endif +# define GLM_MSC_EXT 0 +# endif +# if __cplusplus >= 201402L +# define GLM_LANG (GLM_LANG_CXX14 | GLM_MSC_EXT) +# elif __cplusplus >= 201103L +# define GLM_LANG (GLM_LANG_CXX11 | GLM_MSC_EXT) +# elif __INTEL_CXX11_MODE__ +# define GLM_LANG (GLM_LANG_CXX0X | GLM_MSC_EXT) +# elif __cplusplus >= 199711L +# define GLM_LANG (GLM_LANG_CXX98 | GLM_MSC_EXT) +# else +# define GLM_LANG (GLM_LANG_CXX | GLM_MSC_EXT) # endif # else // Unkown compiler # if __cplusplus >= 201402L From a827b248ef50a2623ae5cf893a4d89f417eeae4c Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Wed, 23 Dec 2015 01:24:48 +0100 Subject: [PATCH 018/110] Fix wrong docs The function this function is a helper of is using radians. In fact, glm is using radians everywhere! --- glm/gtx/transform.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/gtx/transform.hpp b/glm/gtx/transform.hpp index 7e6a4a73..5d22fba5 100644 --- a/glm/gtx/transform.hpp +++ b/glm/gtx/transform.hpp @@ -64,7 +64,7 @@ namespace glm GLM_FUNC_DECL tmat4x4 translate( tvec3 const & v); - /// Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees. + /// Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in radians. /// @see gtc_matrix_transform /// @see gtx_transform template From 1936921ec7db980ee001c4b898fc689aca36ebf6 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 1 Jan 2016 14:30:14 +0100 Subject: [PATCH 019/110] Fixed log from GTX_lob_base build error with tests #470, #471 --- glm/gtx/log_base.hpp | 12 +++++------ test/gtx/gtx_log_base.cpp | 45 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 6 deletions(-) diff --git a/glm/gtx/log_base.hpp b/glm/gtx/log_base.hpp index 94d03472..e6c89ea2 100644 --- a/glm/gtx/log_base.hpp +++ b/glm/gtx/log_base.hpp @@ -53,15 +53,15 @@ namespace glm /// @addtogroup gtx_log_base /// @{ - //! Logarithm for any base. - //! From GLM_GTX_log_base. + /// Logarithm for any base. + /// From GLM_GTX_log_base. template GLM_FUNC_DECL genType log( - genType x, - genType base); + genType const & x, + genType const & base); - //! Logarithm for any base. - //! From GLM_GTX_log_base. + /// Logarithm for any base. + /// From GLM_GTX_log_base. template class vecType> GLM_FUNC_DECL vecType sign( vecType const & x, diff --git a/test/gtx/gtx_log_base.cpp b/test/gtx/gtx_log_base.cpp index b7cc9ae0..464b6eb1 100644 --- a/test/gtx/gtx_log_base.cpp +++ b/test/gtx/gtx_log_base.cpp @@ -30,10 +30,55 @@ /////////////////////////////////////////////////////////////////////////////////// #include +#include +#include +#include + +namespace test_log +{ + int run() + { + int Error = 0; + + { + float A = glm::log(10.f, 2.0f); + float B = glm::log2(10.f); + Error += glm::epsilonEqual(A, B, 0.00001f) ? 0 : 1; + } + + { + glm::vec1 A = glm::log(glm::vec1(10.f), glm::vec1(2.0f)); + glm::vec1 B = glm::log2(glm::vec1(10.f)); + Error += glm::all(glm::epsilonEqual(A, B, glm::vec1(0.00001f))) ? 0 : 1; + } + + { + glm::vec2 A = glm::log(glm::vec2(10.f), glm::vec2(2.0f)); + glm::vec2 B = glm::log2(glm::vec2(10.f)); + Error += glm::all(glm::epsilonEqual(A, B, glm::vec2(0.00001f))) ? 0 : 1; + } + + { + glm::vec3 A = glm::log(glm::vec3(10.f), glm::vec3(2.0f)); + glm::vec3 B = glm::log2(glm::vec3(10.f)); + Error += glm::all(glm::epsilonEqual(A, B, glm::vec3(0.00001f))) ? 0 : 1; + } + + { + glm::vec4 A = glm::log(glm::vec4(10.f), glm::vec4(2.0f)); + glm::vec4 B = glm::log2(glm::vec4(10.f)); + Error += glm::all(glm::epsilonEqual(A, B, glm::vec4(0.00001f))) ? 0 : 1; + } + + return Error; + } +}//namespace test_log int main() { int Error(0); + Error += test_log::run(); + return Error; } From 52c9f124e3cc9c3287d2f32299cae15a7996ef98 Mon Sep 17 00:00:00 2001 From: humbletim Date: Sat, 19 Dec 2015 19:22:33 -0500 Subject: [PATCH 020/110] Fixed ldexp and frexp compilation errors --- glm/detail/func_common.inl | 2 +- readme.md | 1 + test/core/core_func_common.cpp | 91 ++++++++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 1 deletion(-) diff --git a/glm/detail/func_common.inl b/glm/detail/func_common.inl index 338700b1..9634255d 100644 --- a/glm/detail/func_common.inl +++ b/glm/detail/func_common.inl @@ -712,7 +712,7 @@ namespace detail frexp(x.w, exp.w)); } - template + template GLM_FUNC_QUALIFIER genType ldexp(genType const & x, int const & exp) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'ldexp' only accept floating-point inputs"); diff --git a/readme.md b/readme.md index 093dd0d1..256e65ac 100644 --- a/readme.md +++ b/readme.md @@ -57,6 +57,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) - Fixed GTC_packing unpackUnorm3x10_1x2 #414 - Fixed GTC_matrix_inverse affineInverse #192 - Fixed ICC on Linux build errors #449 +- Fixed ldexp and frexp compilation errors #### [GLM 0.9.7.1](https://github.com/g-truc/glm/releases/tag/0.9.7.1) - 2015-09-07 ##### Improvements: diff --git a/test/core/core_func_common.cpp b/test/core/core_func_common.cpp index ed4e5d5d..ec86ec76 100644 --- a/test/core/core_func_common.cpp +++ b/test/core/core_func_common.cpp @@ -1153,6 +1153,95 @@ namespace sign } }//namespace sign +namespace frexp_ +{ + int test() + { + int Error(0); + + { + glm::vec1 x(1024); + glm::ivec1 exp; + glm::vec1 A = glm::frexp(x, exp); + Error += glm::all(glm::epsilonEqual(A, glm::vec1(0.5), 0.00001f)) ? 0 : 1; + Error += glm::all(glm::equal(exp, glm::ivec1(11))) ? 0 : 1; + } + + { + glm::vec2 x(1024, 0.24); + glm::ivec2 exp; + glm::vec2 A = glm::frexp(x, exp); + Error += glm::all(glm::epsilonEqual(A, glm::vec2(0.5, 0.96), 0.00001f)) ? 0 : 1; + Error += glm::all(glm::equal(exp, glm::ivec2(11, -2))) ? 0 : 1; + } + + { + glm::vec3 x(1024, 0.24, 0); + glm::ivec3 exp; + glm::vec3 A = glm::frexp(x, exp); + Error += glm::all(glm::epsilonEqual(A, glm::vec3(0.5, 0.96, 0.0), 0.00001f)) ? 0 : 1; + Error += glm::all(glm::equal(exp, glm::ivec3(11, -2, 0))) ? 0 : 1; + } + + { + glm::vec4 x(1024, 0.24, 0, -1.33); + glm::ivec4 exp; + glm::vec4 A = glm::frexp(x, exp); + Error += glm::all(glm::epsilonEqual(A, glm::vec4(0.5, 0.96, 0.0, -0.665), 0.00001f)) ? 0 : 1; + Error += glm::all(glm::equal(exp, glm::ivec4(11, -2, 0, 1))) ? 0 : 1; + } + + return Error; + } +}//namespace frexp_ + +namespace ldexp_ +{ + int test() + { + int Error(0); + + { + glm::vec1 A = glm::vec1(0.5); + glm::ivec1 exp = glm::ivec1(11); + glm::vec1 x = glm::ldexp(A, exp); + Error += glm::all(glm::epsilonEqual(x, glm::vec1(1024),0.00001f)) ? 0 : 1; + } + + { + glm::vec2 A = glm::vec2(0.5, 0.96); + glm::ivec2 exp = glm::ivec2(11, -2); + glm::vec2 x = glm::ldexp(A, exp); + Error += glm::all(glm::epsilonEqual(x, glm::vec2(1024, .24),0.00001f)) ? 0 : 1; + } + + { + glm::vec3 A = glm::vec3(0.5, 0.96, 0.0); + glm::ivec3 exp = glm::ivec3(11, -2, 0); + glm::vec3 x = glm::ldexp(A, exp); + Error += glm::all(glm::epsilonEqual(x, glm::vec3(1024, .24, 0),0.00001f)) ? 0 : 1; + } + + { + glm::vec4 A = glm::vec4(0.5, 0.96, 0.0, -0.665); + glm::ivec4 exp = glm::ivec4(11, -2, 0, 1); + glm::vec4 x = glm::ldexp(A, exp); + Error += glm::all(glm::epsilonEqual(x, glm::vec4(1024, .24, 0, -1.33),0.00001f)) ? 0 : 1; + } + + + { + glm::vec4 x(1024, 0.24, 0, -1.33); + glm::ivec4 exp; + glm::vec4 A = glm::frexp(x, exp); + Error += glm::all(glm::epsilonEqual(A, glm::vec4(0.5, 0.96, 0.0, -0.665), 0.00001f)) ? 0 : 1; + Error += glm::all(glm::equal(exp, glm::ivec4(11, -2, 0, 1))) ? 0 : 1; + } + + return Error; + } +}//namespace ldexp_ + int main() { int Error(0); @@ -1171,6 +1260,8 @@ int main() Error += roundEven::test(); Error += isnan_::test(); Error += isinf_::test(); + Error += frexp_::test(); + Error += ldexp_::test(); # ifdef NDEBUG std::size_t Samples = 1000; From c9400562ecd3bc8e66fd557efb352fe07b9770cd Mon Sep 17 00:00:00 2001 From: Adrian Krupa Date: Sun, 29 Nov 2015 20:53:04 +0100 Subject: [PATCH 021/110] Fixed build --- glm/detail/func_common.inl | 4 ++-- test/core/core_func_common.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/glm/detail/func_common.inl b/glm/detail/func_common.inl index 9634255d..2c32626f 100644 --- a/glm/detail/func_common.inl +++ b/glm/detail/func_common.inl @@ -668,7 +668,7 @@ namespace detail { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'frexp' only accept floating-point inputs"); - return std::frexp(x, exp); + return std::frexp(x, &exp); } template @@ -676,7 +676,7 @@ namespace detail { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'frexp' only accept floating-point inputs"); - return tvec1(std::frexp(x.x, exp.x)); + return tvec1(std::frexp(x.x, &exp.x)); } template diff --git a/test/core/core_func_common.cpp b/test/core/core_func_common.cpp index ec86ec76..780151e5 100644 --- a/test/core/core_func_common.cpp +++ b/test/core/core_func_common.cpp @@ -1100,7 +1100,7 @@ namespace sign { int Error = 0; - glm::uint32 const Count = Samples; + glm::int32 const Count = static_cast(Samples); std::clock_t Timestamp0 = std::clock(); glm::int32 Sum = 0; From 4bb352b6280bc65cf13349baf018f4c4bd5d72c8 Mon Sep 17 00:00:00 2001 From: Stephen Hill Date: Wed, 23 Dec 2015 12:16:31 -0500 Subject: [PATCH 022/110] Fixed "Declaration shadows a field" warning --- glm/detail/type_half.inl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/glm/detail/type_half.inl b/glm/detail/type_half.inl index ff8740c8..b9f9f0ed 100644 --- a/glm/detail/type_half.inl +++ b/glm/detail/type_half.inl @@ -52,12 +52,12 @@ namespace detail i(0) {} - GLM_FUNC_QUALIFIER uif32(float f) : - f(f) + GLM_FUNC_QUALIFIER uif32(float f_) : + f(f_) {} - GLM_FUNC_QUALIFIER uif32(uint32 i) : - i(i) + GLM_FUNC_QUALIFIER uif32(uint32 i_) : + i(i_) {} float f; From ba46e0500e4b5b130303108626aabc55d2fb4234 Mon Sep 17 00:00:00 2001 From: Stephen Hill Date: Wed, 23 Dec 2015 12:18:14 -0500 Subject: [PATCH 023/110] Fixed 'GLM_COMPILER_VC2005 is not defined' warning This GLM compiler version isn't defined, so I just removed the legacy functions. --- glm/detail/setup.hpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 71a7b098..34244ee9 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -455,13 +455,6 @@ #endif//GLM_ARCH #if GLM_ARCH & GLM_ARCH_SSE2 # include -# if(GLM_COMPILER == GLM_COMPILER_VC2005) // VC2005 is missing some intrinsics, workaround - inline float _mm_cvtss_f32(__m128 A) { return A.m128_f32[0]; } - inline __m128 _mm_castpd_ps(__m128d PD) { union { __m128 ps; __m128d pd; } c; c.pd = PD; return c.ps; } - inline __m128d _mm_castps_pd(__m128 PS) { union { __m128 ps; __m128d pd; } c; c.ps = PS; return c.pd; } - inline __m128i _mm_castps_si128(__m128 PS) { union { __m128 ps; __m128i pi; } c; c.ps = PS; return c.pi; } - inline __m128 _mm_castsi128_ps(__m128i PI) { union { __m128 ps; __m128i pi; } c; c.pi = PI; return c.ps; } -# endif #endif//GLM_ARCH #if defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_ARCH_DISPLAYED) From c83add59b30efc7f952d23ea0adee8dfc332fd48 Mon Sep 17 00:00:00 2001 From: Stephen Hill Date: Wed, 23 Dec 2015 12:19:13 -0500 Subject: [PATCH 024/110] Fixed various 'X is not defined' warnings --- glm/detail/setup.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 34244ee9..05b3780c 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -393,13 +393,13 @@ #elif defined(GLM_FORCE_SSE2) # define GLM_ARCH (GLM_ARCH_SSE2) #elif (GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM | GLM_COMPILER_GCC)) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_LINUX)) -# if(__AVX2__) +# if defined(__AVX2__) # define GLM_ARCH (GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -# elif(__AVX__) +# elif defined(__AVX__) # define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -# elif(__SSE3__) +# elif defined(__SSE3__) # define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -# elif(__SSE2__) +# elif defined(__SSE2__) # define GLM_ARCH (GLM_ARCH_SSE2) # else # define GLM_ARCH GLM_ARCH_PURE @@ -995,7 +995,7 @@ namespace detail } }//namespace glm # define GLM_COUNTOF(arr) glm::countof(arr) -#elif _MSC_VER +#elif defined(_MSC_VER) # define GLM_COUNTOF(arr) _countof(arr) #else # define GLM_COUNTOF(arr) sizeof(arr) / sizeof(arr[0]) From fc1e45bbde231fbdf529b3a88763455c4f8aa280 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 3 Jan 2016 18:30:08 +0100 Subject: [PATCH 025/110] Updated readme --- readme.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/readme.md b/readme.md index 256e65ac..b4c261d3 100644 --- a/readme.md +++ b/readme.md @@ -58,6 +58,9 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) - Fixed GTC_matrix_inverse affineInverse #192 - Fixed ICC on Linux build errors #449 - Fixed ldexp and frexp compilation errors +- Fixed "Declaration shadows a field" warning #468 +- Fixed 'GLM_COMPILER_VC2005 is not defined' warning #468 +- Fixed various 'X is not defined' warnings #468 #### [GLM 0.9.7.1](https://github.com/g-truc/glm/releases/tag/0.9.7.1) - 2015-09-07 ##### Improvements: From 5d46e5186d55310df6108b36829669a8156fc3bf Mon Sep 17 00:00:00 2001 From: humbletim Date: Sat, 19 Dec 2015 19:30:00 -0500 Subject: [PATCH 026/110] remove extraneous test block --- test/core/core_func_common.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/test/core/core_func_common.cpp b/test/core/core_func_common.cpp index 780151e5..a610dd51 100644 --- a/test/core/core_func_common.cpp +++ b/test/core/core_func_common.cpp @@ -1229,15 +1229,6 @@ namespace ldexp_ Error += glm::all(glm::epsilonEqual(x, glm::vec4(1024, .24, 0, -1.33),0.00001f)) ? 0 : 1; } - - { - glm::vec4 x(1024, 0.24, 0, -1.33); - glm::ivec4 exp; - glm::vec4 A = glm::frexp(x, exp); - Error += glm::all(glm::epsilonEqual(A, glm::vec4(0.5, 0.96, 0.0, -0.665), 0.00001f)) ? 0 : 1; - Error += glm::all(glm::equal(exp, glm::ivec4(11, -2, 0, 1))) ? 0 : 1; - } - return Error; } }//namespace ldexp_ From 4ea72b312872597cebc01dde8e31a47e1c6bc939 Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Sun, 22 Nov 2015 06:48:23 +0100 Subject: [PATCH 027/110] Fix docs --- glm/gtx/vector_angle.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/glm/gtx/vector_angle.hpp b/glm/gtx/vector_angle.hpp index 80288701..a05b988f 100644 --- a/glm/gtx/vector_angle.hpp +++ b/glm/gtx/vector_angle.hpp @@ -58,15 +58,15 @@ namespace glm /// @addtogroup gtx_vector_angle /// @{ - //! Returns the absolute angle between two vectors + //! Returns the absolute angle between two vectors. //! Parameters need to be normalized. - /// @see gtx_vector_angle extension + /// @see gtx_vector_angle extension. template GLM_FUNC_DECL typename vecType::value_type angle( vecType const & x, vecType const & y); - //! Returns the oriented angle between two 2d vectors + //! Returns the oriented angle between two 2d vectors. //! Parameters need to be normalized. /// @see gtx_vector_angle extension. template From 268af877ab767b1ddab792cc583cf7d529ce1c23 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 22 Oct 2015 00:27:10 +0200 Subject: [PATCH 028/110] Cygwin GCC doesn't have a C++11 STL library --- glm/detail/setup.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 05b3780c..51375cc5 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -65,6 +65,8 @@ #ifdef GLM_FORCE_PLATFORM_UNKNOWN # define GLM_PLATFORM GLM_PLATFORM_UNKNOWN +#elif defined(__CYGWIN__) +# define GLM_PLATFORM GLM_PLATFORM_CYGWIN #elif defined(__QNXNTO__) # define GLM_PLATFORM GLM_PLATFORM_QNXNTO #elif defined(__APPLE__) @@ -634,7 +636,7 @@ // http://gcc.gnu.org/projects/cxx0x.html // http://msdn.microsoft.com/en-us/library/vstudio/hh567368(v=vs.120).aspx -#if GLM_PLATFORM == GLM_PLATFORM_ANDROID +#if GLM_PLATFORM == GLM_PLATFORM_ANDROID || GLM_PLATFORM == GLM_PLATFORM_CYGWIN # define GLM_HAS_CXX11_STL 0 #elif GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) # if __has_include(<__config>) // libc++ From 7db048b851c967a85fe20a1524085c90e1802b95 Mon Sep 17 00:00:00 2001 From: Jesse Talavera-Greenberg Date: Mon, 28 Sep 2015 19:33:35 -0400 Subject: [PATCH 029/110] Move dependencies from intersect.inl to intersect.hpp --- glm/gtx/intersect.hpp | 4 ++++ glm/gtx/intersect.inl | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/glm/gtx/intersect.hpp b/glm/gtx/intersect.hpp index d35b4c54..3bce7081 100644 --- a/glm/gtx/intersect.hpp +++ b/glm/gtx/intersect.hpp @@ -43,8 +43,12 @@ #pragma once // Dependency: +#include +#include #include "../glm.hpp" +#include "../geometric.hpp" #include "../gtx/closest_point.hpp" +#include "../gtx/vector_query.hpp" #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) # pragma message("GLM: GLM_GTX_closest_point extension included") diff --git a/glm/gtx/intersect.inl b/glm/gtx/intersect.inl index 0c1cc935..3b1b9e8c 100644 --- a/glm/gtx/intersect.inl +++ b/glm/gtx/intersect.inl @@ -7,10 +7,6 @@ // File : glm/gtx/intersect.inl /////////////////////////////////////////////////////////////////////////////////////////////////// -#include "../geometric.hpp" -#include -#include - namespace glm { template From 1709e9abcabb5c1a2655cd85f27cee13d8f0aa3b Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 17 Oct 2015 04:11:52 +0200 Subject: [PATCH 030/110] Added unary + operator #435 --- glm/detail/type_mat2x2.hpp | 5 ++++- glm/detail/type_mat2x2.inl | 8 +++++++- glm/detail/type_mat2x3.hpp | 5 ++++- glm/detail/type_mat2x3.inl | 8 +++++++- glm/detail/type_mat2x4.hpp | 5 ++++- glm/detail/type_mat2x4.inl | 8 +++++++- glm/detail/type_mat3x2.hpp | 5 ++++- glm/detail/type_mat3x2.inl | 8 +++++++- glm/detail/type_mat3x3.hpp | 5 ++++- glm/detail/type_mat3x3.inl | 8 +++++++- glm/detail/type_mat3x4.hpp | 5 ++++- glm/detail/type_mat3x4.inl | 8 +++++++- glm/detail/type_mat4x2.hpp | 5 ++++- glm/detail/type_mat4x2.inl | 8 +++++++- glm/detail/type_mat4x3.hpp | 5 ++++- glm/detail/type_mat4x3.inl | 8 +++++++- glm/detail/type_mat4x4.hpp | 5 ++++- glm/detail/type_mat4x4.inl | 8 +++++++- glm/detail/type_vec1.hpp | 3 +++ glm/detail/type_vec1.inl | 6 ++++++ glm/detail/type_vec2.hpp | 3 +++ glm/detail/type_vec2.inl | 6 ++++++ glm/detail/type_vec3.hpp | 3 +++ glm/detail/type_vec3.inl | 6 ++++++ glm/detail/type_vec4.hpp | 3 +++ glm/detail/type_vec4.inl | 6 ++++++ glm/gtc/quaternion.hpp | 3 +++ glm/gtc/quaternion.inl | 6 ++++++ glm/gtx/dual_quaternion.hpp | 5 ++++- glm/gtx/dual_quaternion.inl | 2 +- readme.md | 1 + 31 files changed, 150 insertions(+), 20 deletions(-) diff --git a/glm/detail/type_mat2x2.hpp b/glm/detail/type_mat2x2.hpp index aa0c81d7..9761adfe 100644 --- a/glm/detail/type_mat2x2.hpp +++ b/glm/detail/type_mat2x2.hpp @@ -157,7 +157,10 @@ namespace glm // -- Unary operators -- template - GLM_FUNC_DECL tmat2x2 const operator-(tmat2x2 const & m); + GLM_FUNC_DECL tmat2x2 operator+(tmat2x2 const & m); + + template + GLM_FUNC_DECL tmat2x2 operator-(tmat2x2 const & m); // -- Binary operators -- diff --git a/glm/detail/type_mat2x2.inl b/glm/detail/type_mat2x2.inl index 202839f4..960fee57 100644 --- a/glm/detail/type_mat2x2.inl +++ b/glm/detail/type_mat2x2.inl @@ -367,7 +367,13 @@ namespace detail // -- Unary arithmetic operators -- template - GLM_FUNC_QUALIFIER tmat2x2 const operator-(tmat2x2 const & m) + GLM_FUNC_QUALIFIER tmat2x2 operator+(tmat2x2 const & m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER tmat2x2 operator-(tmat2x2 const & m) { return tmat2x2( -m[0], diff --git a/glm/detail/type_mat2x3.hpp b/glm/detail/type_mat2x3.hpp index 4cacc46c..eeb69ad2 100644 --- a/glm/detail/type_mat2x3.hpp +++ b/glm/detail/type_mat2x3.hpp @@ -149,7 +149,10 @@ namespace glm // -- Unary operators -- template - GLM_FUNC_DECL tmat2x3 const operator-(tmat2x3 const & m); + GLM_FUNC_DECL tmat2x3 operator+(tmat2x3 const & m); + + template + GLM_FUNC_DECL tmat2x3 operator-(tmat2x3 const & m); // -- Binary operators -- diff --git a/glm/detail/type_mat2x3.inl b/glm/detail/type_mat2x3.inl index 267f0c0c..76c00f50 100644 --- a/glm/detail/type_mat2x3.inl +++ b/glm/detail/type_mat2x3.inl @@ -337,7 +337,13 @@ namespace glm // -- Unary arithmetic operators -- template - GLM_FUNC_QUALIFIER tmat2x3 const operator-(tmat2x3 const & m) + GLM_FUNC_QUALIFIER tmat2x3 operator+(tmat2x3 const & m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER tmat2x3 operator-(tmat2x3 const & m) { return tmat2x3( -m[0], diff --git a/glm/detail/type_mat2x4.hpp b/glm/detail/type_mat2x4.hpp index d87ce074..8e3c616a 100644 --- a/glm/detail/type_mat2x4.hpp +++ b/glm/detail/type_mat2x4.hpp @@ -151,7 +151,10 @@ namespace glm // -- Unary operators -- template - GLM_FUNC_DECL tmat2x4 const operator-(tmat2x4 const & m); + GLM_FUNC_DECL tmat2x4 operator+(tmat2x4 const & m); + + template + GLM_FUNC_DECL tmat2x4 operator-(tmat2x4 const & m); // -- Binary operators -- diff --git a/glm/detail/type_mat2x4.inl b/glm/detail/type_mat2x4.inl index 766640e4..42299787 100644 --- a/glm/detail/type_mat2x4.inl +++ b/glm/detail/type_mat2x4.inl @@ -338,7 +338,13 @@ namespace glm // -- Unary arithmetic operators -- template - GLM_FUNC_QUALIFIER tmat2x4 const operator-(tmat2x4 const & m) + GLM_FUNC_QUALIFIER tmat2x4 operator+(tmat2x4 const & m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER tmat2x4 operator-(tmat2x4 const & m) { return tmat2x4( -m[0], diff --git a/glm/detail/type_mat3x2.hpp b/glm/detail/type_mat3x2.hpp index ac2ea0d4..fedf8c9e 100644 --- a/glm/detail/type_mat3x2.hpp +++ b/glm/detail/type_mat3x2.hpp @@ -156,7 +156,10 @@ namespace glm // -- Unary operators -- template - GLM_FUNC_DECL tmat3x2 const operator-(tmat3x2 const & m); + GLM_FUNC_DECL tmat3x2 operator+(tmat3x2 const & m); + + template + GLM_FUNC_DECL tmat3x2 operator-(tmat3x2 const & m); // -- Binary operators -- diff --git a/glm/detail/type_mat3x2.inl b/glm/detail/type_mat3x2.inl index d112a054..f497e395 100644 --- a/glm/detail/type_mat3x2.inl +++ b/glm/detail/type_mat3x2.inl @@ -376,8 +376,14 @@ namespace glm // -- Unary arithmetic operators -- + template + GLM_FUNC_QUALIFIER tmat3x2 operator+(tmat3x2 const & m) + { + return m; + } + template - GLM_FUNC_QUALIFIER tmat3x2 const operator-(tmat3x2 const & m) + GLM_FUNC_QUALIFIER tmat3x2 operator-(tmat3x2 const & m) { return tmat3x2( -m[0], diff --git a/glm/detail/type_mat3x3.hpp b/glm/detail/type_mat3x3.hpp index 7b0945ac..e7e2e6de 100644 --- a/glm/detail/type_mat3x3.hpp +++ b/glm/detail/type_mat3x3.hpp @@ -164,7 +164,10 @@ namespace glm // -- Unary operators -- template - GLM_FUNC_DECL tmat3x3 const operator-(tmat3x3 const & m); + GLM_FUNC_DECL tmat3x3 operator+(tmat3x3 const & m); + + template + GLM_FUNC_DECL tmat3x3 operator-(tmat3x3 const & m); // -- Binary operators -- diff --git a/glm/detail/type_mat3x3.inl b/glm/detail/type_mat3x3.inl index 6f936036..9ee0111e 100644 --- a/glm/detail/type_mat3x3.inl +++ b/glm/detail/type_mat3x3.inl @@ -415,7 +415,13 @@ namespace detail // -- Unary arithmetic operators -- template - GLM_FUNC_QUALIFIER tmat3x3 const operator-(tmat3x3 const & m) + GLM_FUNC_QUALIFIER tmat3x3 operator+(tmat3x3 const & m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER tmat3x3 operator-(tmat3x3 const & m) { return tmat3x3( -m[0], diff --git a/glm/detail/type_mat3x4.hpp b/glm/detail/type_mat3x4.hpp index 8f59f2ad..11261589 100644 --- a/glm/detail/type_mat3x4.hpp +++ b/glm/detail/type_mat3x4.hpp @@ -156,7 +156,10 @@ namespace glm // -- Unary operators -- template - GLM_FUNC_DECL tmat3x4 const operator-(tmat3x4 const & m); + GLM_FUNC_DECL tmat3x4 operator+(tmat3x4 const & m); + + template + GLM_FUNC_DECL tmat3x4 operator-(tmat3x4 const & m); // -- Binary operators -- diff --git a/glm/detail/type_mat3x4.inl b/glm/detail/type_mat3x4.inl index 8862df47..3991d95d 100644 --- a/glm/detail/type_mat3x4.inl +++ b/glm/detail/type_mat3x4.inl @@ -377,7 +377,13 @@ namespace glm // -- Unary arithmetic operators -- template - GLM_FUNC_QUALIFIER tmat3x4 const operator-(tmat3x4 const & m) + GLM_FUNC_QUALIFIER tmat3x4 operator+(tmat3x4 const & m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER tmat3x4 operator-(tmat3x4 const & m) { return tmat3x4( -m[0], diff --git a/glm/detail/type_mat4x2.hpp b/glm/detail/type_mat4x2.hpp index 65666d5c..62cd7aed 100644 --- a/glm/detail/type_mat4x2.hpp +++ b/glm/detail/type_mat4x2.hpp @@ -161,7 +161,10 @@ namespace glm // -- Unary operators -- template - GLM_FUNC_DECL tmat4x2 const operator-(tmat4x2 const & m); + GLM_FUNC_DECL tmat4x2 operator+(tmat4x2 const & m); + + template + GLM_FUNC_DECL tmat4x2 operator-(tmat4x2 const & m); // -- Binary operators -- diff --git a/glm/detail/type_mat4x2.inl b/glm/detail/type_mat4x2.inl index d012b884..811f4622 100644 --- a/glm/detail/type_mat4x2.inl +++ b/glm/detail/type_mat4x2.inl @@ -409,7 +409,13 @@ namespace glm // -- Unary arithmetic operators -- template - GLM_FUNC_QUALIFIER tmat4x2 const operator-(tmat4x2 const & m) + GLM_FUNC_QUALIFIER tmat4x2 operator+(tmat4x2 const & m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER tmat4x2 operator-(tmat4x2 const & m) { return tmat4x2( -m[0], diff --git a/glm/detail/type_mat4x3.hpp b/glm/detail/type_mat4x3.hpp index 55c0b516..eea24667 100644 --- a/glm/detail/type_mat4x3.hpp +++ b/glm/detail/type_mat4x3.hpp @@ -161,7 +161,10 @@ namespace glm // -- Unary operators -- template - GLM_FUNC_DECL tmat4x3 const operator-(tmat4x3 const & m); + GLM_FUNC_DECL tmat4x3 operator+(tmat4x3 const & m); + + template + GLM_FUNC_DECL tmat4x3 operator-(tmat4x3 const & m); // -- Binary operators -- diff --git a/glm/detail/type_mat4x3.inl b/glm/detail/type_mat4x3.inl index e7368619..c2979782 100644 --- a/glm/detail/type_mat4x3.inl +++ b/glm/detail/type_mat4x3.inl @@ -409,7 +409,13 @@ namespace glm // -- Unary arithmetic operators -- template - GLM_FUNC_QUALIFIER tmat4x3 const operator-(tmat4x3 const & m) + GLM_FUNC_QUALIFIER tmat4x3 operator+(tmat4x3 const & m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER tmat4x3 operator-(tmat4x3 const & m) { return tmat4x3( -m[0], diff --git a/glm/detail/type_mat4x4.hpp b/glm/detail/type_mat4x4.hpp index 5d36b490..1690bf1d 100644 --- a/glm/detail/type_mat4x4.hpp +++ b/glm/detail/type_mat4x4.hpp @@ -169,7 +169,10 @@ namespace glm // -- Unary operators -- template - GLM_FUNC_DECL tmat4x4 const operator-(tmat4x4 const & m); + GLM_FUNC_DECL tmat4x4 operator+(tmat4x4 const & m); + + template + GLM_FUNC_DECL tmat4x4 operator-(tmat4x4 const & m); // -- Binary operators -- diff --git a/glm/detail/type_mat4x4.inl b/glm/detail/type_mat4x4.inl index c075122b..319325a7 100644 --- a/glm/detail/type_mat4x4.inl +++ b/glm/detail/type_mat4x4.inl @@ -515,7 +515,13 @@ namespace detail // -- Unary constant operators -- template - GLM_FUNC_QUALIFIER tmat4x4 const operator-(tmat4x4 const & m) + GLM_FUNC_QUALIFIER tmat4x4 operator+(tmat4x4 const & m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER tmat4x4 operator-(tmat4x4 const & m) { return tmat4x4( -m[0], diff --git a/glm/detail/type_vec1.hpp b/glm/detail/type_vec1.hpp index e18c8a3a..6c30a438 100644 --- a/glm/detail/type_vec1.hpp +++ b/glm/detail/type_vec1.hpp @@ -204,6 +204,9 @@ namespace glm // -- Unary operators -- + template + GLM_FUNC_DECL tvec1 operator+(tvec1 const & v); + template GLM_FUNC_DECL tvec1 operator-(tvec1 const & v); diff --git a/glm/detail/type_vec1.inl b/glm/detail/type_vec1.inl index 39485782..effac06f 100644 --- a/glm/detail/type_vec1.inl +++ b/glm/detail/type_vec1.inl @@ -352,6 +352,12 @@ namespace glm // -- Unary constant operators -- + template + GLM_FUNC_QUALIFIER tvec1 operator+(tvec1 const & v) + { + return v; + } + template GLM_FUNC_QUALIFIER tvec1 operator-(tvec1 const & v) { diff --git a/glm/detail/type_vec2.hpp b/glm/detail/type_vec2.hpp index 2f78c67e..76029f49 100644 --- a/glm/detail/type_vec2.hpp +++ b/glm/detail/type_vec2.hpp @@ -230,6 +230,9 @@ namespace glm // -- Unary operators -- + template + GLM_FUNC_DECL tvec2 operator+(tvec2 const & v); + template GLM_FUNC_DECL tvec2 operator-(tvec2 const & v); diff --git a/glm/detail/type_vec2.inl b/glm/detail/type_vec2.inl index 39d0549e..b8cb1ff8 100644 --- a/glm/detail/type_vec2.inl +++ b/glm/detail/type_vec2.inl @@ -480,6 +480,12 @@ namespace glm // -- Unary arithmetic operators -- + template + GLM_FUNC_QUALIFIER tvec2 operator+(tvec2 const & v) + { + return v; + } + template GLM_FUNC_QUALIFIER tvec2 operator-(tvec2 const & v) { diff --git a/glm/detail/type_vec3.hpp b/glm/detail/type_vec3.hpp index 4b7fa1a6..f155b076 100644 --- a/glm/detail/type_vec3.hpp +++ b/glm/detail/type_vec3.hpp @@ -252,6 +252,9 @@ namespace glm // -- Unary operators -- + template + GLM_FUNC_DECL tvec3 operator+(tvec3 const & v); + template GLM_FUNC_DECL tvec3 operator-(tvec3 const & v); diff --git a/glm/detail/type_vec3.inl b/glm/detail/type_vec3.inl index 1e5081d4..fa8102c8 100644 --- a/glm/detail/type_vec3.inl +++ b/glm/detail/type_vec3.inl @@ -547,6 +547,12 @@ namespace glm // -- Unary arithmetic operators -- + template + GLM_FUNC_QUALIFIER tvec3 operator+(tvec3 const & v) + { + return v; + } + template GLM_FUNC_QUALIFIER tvec3 operator-(tvec3 const & v) { diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index ffe8066f..e9fe6c1d 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -351,6 +351,9 @@ namespace detail // -- Unary operators -- + template + GLM_FUNC_DECL tvec4 operator+(tvec4 const & v); + template GLM_FUNC_DECL tvec4 operator-(tvec4 const & v); diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index 80c75945..8e215d00 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -645,6 +645,12 @@ namespace glm // -- Unary constant operators -- + template + GLM_FUNC_QUALIFIER tvec4 operator+(tvec4 const & v) + { + return v; + } + template GLM_FUNC_QUALIFIER tvec4 operator-(tvec4 const & v) { diff --git a/glm/gtc/quaternion.hpp b/glm/gtc/quaternion.hpp index 71817dfa..6fae5cc6 100644 --- a/glm/gtc/quaternion.hpp +++ b/glm/gtc/quaternion.hpp @@ -149,6 +149,9 @@ namespace glm // -- Unary bit operators -- + template + GLM_FUNC_DECL tquat operator+(tquat const & q); + template GLM_FUNC_DECL tquat operator-(tquat const & q); diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index 4c8565bc..83a1b66f 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -296,6 +296,12 @@ namespace detail // -- Unary bit operators -- + template + GLM_FUNC_QUALIFIER tquat operator+(tquat const & q) + { + return q; + } + template GLM_FUNC_QUALIFIER tquat operator-(tquat const & q) { diff --git a/glm/gtx/dual_quaternion.hpp b/glm/gtx/dual_quaternion.hpp index 1c26b34d..0b083295 100644 --- a/glm/gtx/dual_quaternion.hpp +++ b/glm/gtx/dual_quaternion.hpp @@ -130,7 +130,10 @@ namespace glm // -- Unary bit operators -- template - GLM_FUNC_DECL tquat operator-(tquat const & q); + GLM_FUNC_DECL tdualquat operator+(tdualquat const & q); + + template + GLM_FUNC_DECL tdualquat operator-(tdualquat const & q); // -- Binary operators -- diff --git a/glm/gtx/dual_quaternion.inl b/glm/gtx/dual_quaternion.inl index c6b057f2..961dd1ca 100644 --- a/glm/gtx/dual_quaternion.inl +++ b/glm/gtx/dual_quaternion.inl @@ -196,7 +196,7 @@ namespace glm template GLM_FUNC_QUALIFIER tdualquat operator-(tdualquat const & q) { - return tdualquat(-q.real,-q.dual); + return q; } // -- Binary operators -- diff --git a/readme.md b/readme.md index b4c261d3..17134d10 100644 --- a/readme.md +++ b/readme.md @@ -61,6 +61,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) - Fixed "Declaration shadows a field" warning #468 - Fixed 'GLM_COMPILER_VC2005 is not defined' warning #468 - Fixed various 'X is not defined' warnings #468 +- Fixed missing unary + operator #435 #### [GLM 0.9.7.1](https://github.com/g-truc/glm/releases/tag/0.9.7.1) - 2015-09-07 ##### Improvements: From 8f0d85460557dc5fbf4f44dc23a7708d065d7683 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 3 Jan 2016 18:50:08 +0100 Subject: [PATCH 031/110] Release 0.9.7.2 --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index cb8a0337..2548c94d 100644 --- a/readme.md +++ b/readme.md @@ -69,7 +69,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) - Fixed GTX_extended_min_max filename typo #386 - Fixed intersectRayTriangle to not do any unintentional backface culling -#### [GLM 0.9.7.2](https://github.com/g-truc/glm/tree/0.9.7) - 2016-01-XX +#### [GLM 0.9.7.2](https://github.com/g-truc/glm/releases/tag/0.9.7.2) - 2016-01-03 ##### Fixes: - Fixed GTC_round floorMultiple/ceilMultiple #412 - Fixed GTC_packing unpackUnorm3x10_1x2 #414 From eb4a19805a68d77ede6bed6fb51987838b9cf6b2 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 3 Jan 2016 18:56:10 +0100 Subject: [PATCH 032/110] Fixed release note --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 1d5ff3c3..ddc6f274 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.2](https://github.com/g-truc/glm/tree/0.9.7) - 2016-01-XX +#### [GLM 0.9.7.2](https://github.com/g-truc/glm/releases/tag/0.9.7.2) - 2016-01-03 ##### Fixes: - Fixed GTC_round floorMultiple/ceilMultiple #412 - Fixed GTC_packing unpackUnorm3x10_1x2 #414 From 2c7430e9bcd1c7e2406c70bdfe4d81f507243a21 Mon Sep 17 00:00:00 2001 From: Paul Konstantin Gerke Date: Sun, 24 Jan 2016 19:34:26 +0100 Subject: [PATCH 033/110] Fixed: operator signatures of mat2x4 and vec4 (no guaratees that I found all issues) --- glm/detail/type_mat2x4.hpp | 2 +- glm/detail/type_mat2x4.inl | 2 +- glm/detail/type_vec4.hpp | 8 ++++---- glm/detail/type_vec4.inl | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/glm/detail/type_mat2x4.hpp b/glm/detail/type_mat2x4.hpp index e15714ca..e180a2da 100644 --- a/glm/detail/type_mat2x4.hpp +++ b/glm/detail/type_mat2x4.hpp @@ -197,7 +197,7 @@ namespace glm GLM_FUNC_DECL tmat3x4 operator*(tmat2x4 const & m1, tmat3x2 const & m2); template - GLM_FUNC_DECL tmat2x4 operator/(tmat2x4 const & m, T s); + GLM_FUNC_DECL tmat2x4 operator/(tmat2x4 const & m, const T& s); template GLM_FUNC_DECL tmat2x4 operator/(T s, tmat2x4 const & m); diff --git a/glm/detail/type_mat2x4.inl b/glm/detail/type_mat2x4.inl index 4399e0be..f92b4df5 100644 --- a/glm/detail/type_mat2x4.inl +++ b/glm/detail/type_mat2x4.inl @@ -500,7 +500,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat2x4 operator/(tmat2x4 const & m, T s) + GLM_FUNC_QUALIFIER tmat2x4 operator/(tmat2x4 const & m, const T& s) { return tmat2x4( m[0] / s, diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index f26350c6..ef2b3f44 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -379,7 +379,7 @@ namespace detail // -- Binary operators -- template - GLM_FUNC_DECL tvec4 operator+(tvec4 const & v, T scalar); + GLM_FUNC_DECL tvec4 operator+(tvec4 const & v, const T& scalar); template GLM_FUNC_DECL tvec4 operator+(tvec4 const & v, tvec1 const & scalar); @@ -394,7 +394,7 @@ namespace detail GLM_FUNC_DECL tvec4 operator+(tvec4 const & v1, tvec4 const & v2); template - GLM_FUNC_DECL tvec4 operator-(tvec4 const & v, T scalar); + GLM_FUNC_DECL tvec4 operator-(tvec4 const & v, const T& scalar); template GLM_FUNC_DECL tvec4 operator-(tvec4 const & v, tvec1 const & scalar); @@ -409,7 +409,7 @@ namespace detail GLM_FUNC_DECL tvec4 operator-(tvec4 const & v1, tvec4 const & v2); template - GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, T scalar); + GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, const T& scalar); template GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, tvec1 const & scalar); @@ -424,7 +424,7 @@ namespace detail GLM_FUNC_DECL tvec4 operator*(tvec4 const & v1, tvec4 const & v2); template - GLM_FUNC_DECL tvec4 operator/(tvec4 const & v, T scalar); + GLM_FUNC_DECL tvec4 operator/(tvec4 const & v, const 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 a650e494..6712ce33 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -730,7 +730,7 @@ namespace glm // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER tvec4 operator+(tvec4 const & v, T scalar) + GLM_FUNC_QUALIFIER tvec4 operator+(tvec4 const & v, const T& scalar) { return tvec4( v.x + scalar, @@ -760,7 +760,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator-(tvec4 const & v, T scalar) + GLM_FUNC_QUALIFIER tvec4 operator-(tvec4 const & v, const T& scalar) { return tvec4( v.x - scalar, @@ -790,7 +790,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator*(tvec4 const & v, T scalar) + GLM_FUNC_QUALIFIER tvec4 operator*(tvec4 const & v, const T& scalar) { return tvec4( v.x * scalar, @@ -820,7 +820,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator/(tvec4 const & v, T scalar) + GLM_FUNC_QUALIFIER tvec4 operator/(tvec4 const & v, const T& scalar) { return tvec4( v.x / scalar, From fb309e0effe317e16a64fa595a6d9c35c9769162 Mon Sep 17 00:00:00 2001 From: Paul Konstantin Gerke Date: Sun, 24 Jan 2016 21:14:25 +0100 Subject: [PATCH 034/110] Fixed: outerProduct was defined incorrectly for unmatched vecX types. E.g. outerProduct(vec2, vec4) did not succeed because the matrix return types were wrong. The computing function seemed fine. I used https://en.wikipedia.org/wiki/Outer_product as reference on what the number of columns/rows ''should'' be and fixed it so that it matches the description from wikipedia Added: tests for outerProduct with unmatched vector dimensions (actually testing all combinations now) --- glm/detail/func_matrix.hpp | 12 ++++++------ test/core/core_func_matrix.cpp | 13 ++++++++++++- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/glm/detail/func_matrix.hpp b/glm/detail/func_matrix.hpp index 5a9cb11f..56d16d2b 100644 --- a/glm/detail/func_matrix.hpp +++ b/glm/detail/func_matrix.hpp @@ -72,19 +72,19 @@ namespace detail template struct outerProduct_trait { - typedef tmat2x3 type; + typedef tmat3x2 type; }; template struct outerProduct_trait { - typedef tmat2x4 type; + typedef tmat4x2 type; }; template struct outerProduct_trait { - typedef tmat3x2 type; + typedef tmat2x3 type; }; template @@ -96,19 +96,19 @@ namespace detail template struct outerProduct_trait { - typedef tmat3x4 type; + typedef tmat4x3 type; }; template struct outerProduct_trait { - typedef tmat4x2 type; + typedef tmat2x4 type; }; template struct outerProduct_trait { - typedef tmat4x3 type; + typedef tmat3x4 type; }; template diff --git a/test/core/core_func_matrix.cpp b/test/core/core_func_matrix.cpp index add5dfd9..80562e0f 100644 --- a/test/core/core_func_matrix.cpp +++ b/test/core/core_func_matrix.cpp @@ -101,7 +101,18 @@ int test_matrixCompMult() int test_outerProduct() { - glm::mat4 m = glm::outerProduct(glm::vec4(1.0f), glm::vec4(1.0f)); + { glm::mat2 m = glm::outerProduct(glm::vec2(1.0f), glm::vec2(1.0f)); } + { glm::mat3 m = glm::outerProduct(glm::vec3(1.0f), glm::vec3(1.0f)); } + { glm::mat4 m = glm::outerProduct(glm::vec4(1.0f), glm::vec4(1.0f)); } + + { glm::mat2x3 m = glm::outerProduct(glm::vec3(1.0f), glm::vec2(1.0f)); } + { glm::mat2x4 m = glm::outerProduct(glm::vec4(1.0f), glm::vec2(1.0f)); } + + { glm::mat3x2 m = glm::outerProduct(glm::vec2(1.0f), glm::vec3(1.0f)); } + { glm::mat3x4 m = glm::outerProduct(glm::vec4(1.0f), glm::vec3(1.0f)); } + + { glm::mat4x2 m = glm::outerProduct(glm::vec2(1.0f), glm::vec4(1.0f)); } + { glm::mat4x3 m = glm::outerProduct(glm::vec3(1.0f), glm::vec4(1.0f)); } return 0; } From f0acbbd4aca300a5e7942977fe0ace996d849b89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joonas=20Saraj=C3=A4rvi?= Date: Thu, 4 Feb 2016 19:42:25 +0200 Subject: [PATCH 035/110] setup: detect GCC 6.0 --- glm/detail/setup.hpp | 3 +++ test/core/core_setup_message.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index e455a43b..f3c8609f 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -151,6 +151,7 @@ #define GLM_COMPILER_GCC51 0x02000300 #define GLM_COMPILER_GCC52 0x02000400 #define GLM_COMPILER_GCC53 0x02000500 +#define GLM_COMPILER_GCC60 0x02000600 // CUDA #define GLM_COMPILER_CUDA 0x10000000 @@ -312,6 +313,8 @@ # define GLM_COMPILER (GLM_COMPILER_GCC52) # elif (__GNUC__ == 5) && (__GNUC_MINOR__ >= 3) # define GLM_COMPILER (GLM_COMPILER_GCC53) +# elif (__GNUC__ == 6) && (__GNUC_MINOR__ >= 0) +# define GLM_COMPILER (GLM_COMPILER_GCC60) # else # define GLM_COMPILER (GLM_COMPILER_GCC) # endif diff --git a/test/core/core_setup_message.cpp b/test/core/core_setup_message.cpp index 6c9a3765..3808dece 100644 --- a/test/core/core_setup_message.cpp +++ b/test/core/core_setup_message.cpp @@ -71,6 +71,9 @@ int test_compiler() case GLM_COMPILER_GCC53: std::printf("GLM_COMPILER_GCC53\n"); break; + case GLM_COMPILER_GCC60: + std::printf("GLM_COMPILER_GCC60\n"); + break; default: std::printf("GCC version not detected\n"); Error += 1; From 6ee8b030633d0586582031ad287e23d6ab138d37 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Tue, 9 Feb 2016 01:18:24 +0100 Subject: [PATCH 036/110] Fixed CMake policy warning --- CMakeLists.txt | 4 ++++ readme.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 860a6eed..d89a25d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,8 @@ cmake_minimum_required(VERSION 2.6 FATAL_ERROR) +cmake_policy(VERSION 2.6) +if (NOT CMAKE_VERSION VERSION_LESS "3.1") + cmake_policy(SET CMP0054 NEW) +endif() project(glm) set(GLM_VERSION "0.9.7") diff --git a/readme.md b/readme.md index ddc6f274..fe558bc7 100644 --- a/readme.md +++ b/readme.md @@ -51,6 +51,10 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) ## Release notes +#### [GLM 0.9.7.3](https://github.com/g-truc/glm/tree/0.9.7) - 2016-XX-XX +##### Fixes: +- Fixed CMake policy warning + #### [GLM 0.9.7.2](https://github.com/g-truc/glm/releases/tag/0.9.7.2) - 2016-01-03 ##### Fixes: - Fixed GTC_round floorMultiple/ceilMultiple #412 From 0476be3e74b3afadbb4810e2203f7cc3e1f37885 Mon Sep 17 00:00:00 2001 From: Hendrik Sollich Date: Tue, 9 Feb 2016 12:40:06 +0100 Subject: [PATCH 037/110] fixed a typo --- glm/gtc/quaternion.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/gtc/quaternion.hpp b/glm/gtc/quaternion.hpp index daf9cc19..2fd6135e 100644 --- a/glm/gtc/quaternion.hpp +++ b/glm/gtc/quaternion.hpp @@ -279,7 +279,7 @@ namespace glm template GLM_FUNC_DECL tquat rotate(tquat const & q, T const & angle, tvec3 const & axis); - /// Returns euler angles, yitch as x, yaw as y, roll as z. + /// Returns euler angles, pitch as x, yaw as y, roll as z. /// The result is expressed in radians if GLM_FORCE_RADIANS is defined or degrees otherwise. /// /// @see gtc_quaternion From 191e2d715b78702bef68c0190c87b9e7d851de10 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 11 Feb 2016 00:06:05 +0100 Subject: [PATCH 038/110] Removed CDash config --- CTestConfig.cmake | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 CTestConfig.cmake diff --git a/CTestConfig.cmake b/CTestConfig.cmake deleted file mode 100644 index d3388358..00000000 --- a/CTestConfig.cmake +++ /dev/null @@ -1,13 +0,0 @@ -## This file should be placed in the root directory of your project. -## Then modify the CMakeLists.txt file in the root directory of your -## project to incorporate the testing dashboard. -## # The following are required to uses Dart and the Cdash dashboard -## ENABLE_TESTING() -## INCLUDE(CTest) -set(CTEST_PROJECT_NAME "GLM") -set(CTEST_NIGHTLY_START_TIME "00:00:00 EST") - -set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "my.cdash.org") -set(CTEST_DROP_LOCATION "/submit.php?project=GLM") -set(CTEST_DROP_SITE_CDASH TRUE) From bc09ecf898f8c29c3dfa57bad2e8265640177567 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joonas=20Saraj=C3=A4rvi?= Date: Thu, 4 Feb 2016 19:42:25 +0200 Subject: [PATCH 039/110] setup: detect GCC 6.0 --- glm/detail/setup.hpp | 3 +++ test/core/core_setup_message.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 97d4c976..b700a78d 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -151,6 +151,7 @@ #define GLM_COMPILER_GCC51 0x02000300 #define GLM_COMPILER_GCC52 0x02000400 #define GLM_COMPILER_GCC53 0x02000500 +#define GLM_COMPILER_GCC60 0x02000600 // CUDA #define GLM_COMPILER_CUDA 0x10000000 @@ -312,6 +313,8 @@ # define GLM_COMPILER (GLM_COMPILER_GCC52) # elif (__GNUC__ == 5) && (__GNUC_MINOR__ >= 3) # define GLM_COMPILER (GLM_COMPILER_GCC53) +# elif (__GNUC__ == 6) && (__GNUC_MINOR__ >= 0) +# define GLM_COMPILER (GLM_COMPILER_GCC60) # else # define GLM_COMPILER (GLM_COMPILER_GCC) # endif diff --git a/test/core/core_setup_message.cpp b/test/core/core_setup_message.cpp index 6c9a3765..3808dece 100644 --- a/test/core/core_setup_message.cpp +++ b/test/core/core_setup_message.cpp @@ -71,6 +71,9 @@ int test_compiler() case GLM_COMPILER_GCC53: std::printf("GLM_COMPILER_GCC53\n"); break; + case GLM_COMPILER_GCC60: + std::printf("GLM_COMPILER_GCC60\n"); + break; default: std::printf("GCC version not detected\n"); Error += 1; From 407a7598aa0f181f356a595896caa351be6016df Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 15 Feb 2016 20:29:55 +0100 Subject: [PATCH 040/110] Improved new version of GCC detection #477 --- glm/detail/setup.hpp | 6 +++--- readme.md | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index b700a78d..8fc04d2e 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 2 +#define GLM_VERSION_REVISION 3 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_VERSION_DISPLAYED)) # define GLM_MESSAGE_VERSION_DISPLAYED -# pragma message ("GLM: version 0.9.7.2") +# pragma message ("GLM: version 0.9.7.3") #endif//GLM_MESSAGE /////////////////////////////////////////////////////////////////////////////////// @@ -313,7 +313,7 @@ # define GLM_COMPILER (GLM_COMPILER_GCC52) # elif (__GNUC__ == 5) && (__GNUC_MINOR__ >= 3) # define GLM_COMPILER (GLM_COMPILER_GCC53) -# elif (__GNUC__ == 6) && (__GNUC_MINOR__ >= 0) +# elif (__GNUC__ >= 6) # define GLM_COMPILER (GLM_COMPILER_GCC60) # else # define GLM_COMPILER (GLM_COMPILER_GCC) diff --git a/readme.md b/readme.md index fe558bc7..9e79a01e 100644 --- a/readme.md +++ b/readme.md @@ -54,6 +54,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) #### [GLM 0.9.7.3](https://github.com/g-truc/glm/tree/0.9.7) - 2016-XX-XX ##### Fixes: - Fixed CMake policy warning +- Fixed GCC 6.0 detection #### [GLM 0.9.7.2](https://github.com/g-truc/glm/releases/tag/0.9.7.2) - 2016-01-03 ##### Fixes: From cc2f15803e2ae116b6db378719758643801a95d2 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 15 Feb 2016 21:11:55 +0100 Subject: [PATCH 041/110] Added AVX512 detection --- glm/detail/setup.hpp | 12 +++++++++--- readme.md | 3 +++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 8fc04d2e..adc35a1d 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -202,7 +202,7 @@ # define GLM_COMPILER GLM_COMPILER_INTEL13 # elif __INTEL_COMPILER == 1400 # define GLM_COMPILER GLM_COMPILER_INTEL14 -# elif __INTEL_COMPILER >= 1500 +# elif __INTEL_COMPILER == 1500 # define GLM_COMPILER GLM_COMPILER_INTEL15 # elif __INTEL_COMPILER >= 1600 # define GLM_COMPILER GLM_COMPILER_INTEL16 @@ -374,7 +374,7 @@ /////////////////////////////////////////////////////////////////////////////////// // Platform -// User defines: GLM_FORCE_PURE GLM_FORCE_SSE2 GLM_FORCE_SSE3 GLM_FORCE_AVX GLM_FORCE_AVX2 +// User defines: GLM_FORCE_PURE GLM_FORCE_SSE2 GLM_FORCE_SSE3 GLM_FORCE_AVX GLM_FORCE_AVX2 GLM_FORCE_AVX2 #define GLM_ARCH_PURE 0x0000 #define GLM_ARCH_ARM 0x0001 @@ -384,9 +384,12 @@ #define GLM_ARCH_SSE4 0x0010 #define GLM_ARCH_AVX 0x0020 #define GLM_ARCH_AVX2 0x0040 +#define GLM_ARCH_AVX512 0x0080 // Skylake set #if defined(GLM_FORCE_PURE) # define GLM_ARCH GLM_ARCH_PURE +#elif defined(GLM_FORCE_AVX512) +# define GLM_ARCH (GLM_ARCH_AVX512 | GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) #elif defined(GLM_FORCE_AVX2) # define GLM_ARCH (GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) #elif defined(GLM_FORCE_AVX) @@ -398,7 +401,10 @@ #elif defined(GLM_FORCE_SSE2) # define GLM_ARCH (GLM_ARCH_SSE2) #elif (GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM | GLM_COMPILER_GCC)) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_LINUX)) -# if defined(__AVX2__) +// This is Skylake set of instruction set +# if defined(__AVX512BW__) && defined(__AVX512F__) && defined(__AVX512CD__) && defined(__AVX512VL__) && defined(__AVX512DQ__) +# define GLM_ARCH (GLM_ARCH_AVX512 | GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) +# elif defined(__AVX2__) # define GLM_ARCH (GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) # elif defined(__AVX__) # define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) diff --git a/readme.md b/readme.md index 9e79a01e..886afbe0 100644 --- a/readme.md +++ b/readme.md @@ -52,6 +52,9 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) ## Release notes #### [GLM 0.9.7.3](https://github.com/g-truc/glm/tree/0.9.7) - 2016-XX-XX +##### Improvements: +- Added AVX512 detection + ##### Fixes: - Fixed CMake policy warning - Fixed GCC 6.0 detection From 449f785a60e44c25061e0b7c7b1caa3316354f06 Mon Sep 17 00:00:00 2001 From: ReadmeCritic Date: Tue, 16 Feb 2016 13:40:43 -0800 Subject: [PATCH 042/110] Correct the spelling of Xcode in README --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index b341a679..10a439a0 100644 --- a/readme.md +++ b/readme.md @@ -416,7 +416,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) - Fixed isnan and isinf for CUDA compiler - Fixed GLM_FORCE_RADIANS on glm::perspective - Fixed GCC warnings -- Fixed packDouble2x32 on XCode +- Fixed packDouble2x32 on Xcode - Fixed mix for vec4 SSE implementation - Fixed 0x2013 dash character in comments that cause issue in Windows Japanese mode From 907cb9d968f1e7e41e832c7c6e61a694bb6d962b Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 21 Feb 2016 13:24:29 +0100 Subject: [PATCH 043/110] Fixed bad merge #483 --- glm/detail/setup.hpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 3f65eb44..174ba2ad 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -313,11 +313,7 @@ # define GLM_COMPILER (GLM_COMPILER_GCC52) # elif (__GNUC__ == 5) && (__GNUC_MINOR__ >= 3) # define GLM_COMPILER (GLM_COMPILER_GCC53) -<<<<<<< HEAD -# elif (__GNUC__ == 6) && (__GNUC_MINOR__ >= 0) -======= # elif (__GNUC__ >= 6) ->>>>>>> 0.9.7 # define GLM_COMPILER (GLM_COMPILER_GCC60) # else # define GLM_COMPILER (GLM_COMPILER_GCC) From 14e0a5576a003dba03b447006731d34fa12132d6 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 21 Feb 2016 14:15:17 +0100 Subject: [PATCH 044/110] Fixed Clang on Windows build #479 --- glm/detail/setup.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 174ba2ad..d815ea6e 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -803,7 +803,7 @@ # define GLM_HAS_BITSCAN_WINDOWS 0 #else # define GLM_HAS_BITSCAN_WINDOWS ((GLM_PLATFORM & GLM_PLATFORM_WINDOWS) && (\ - (GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_LLVM | GLM_COMPILER_INTEL)))) + (GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_INTEL)))) #endif // OpenMP From 54ad2639747b57f0ae1219972a274319e6a5ae8e Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 21 Feb 2016 14:15:17 +0100 Subject: [PATCH 045/110] Fixed Clang on Windows build #479 --- glm/detail/setup.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index adc35a1d..f8378ee0 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -803,7 +803,7 @@ # define GLM_HAS_BITSCAN_WINDOWS 0 #else # define GLM_HAS_BITSCAN_WINDOWS ((GLM_PLATFORM & GLM_PLATFORM_WINDOWS) && (\ - (GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_LLVM | GLM_COMPILER_INTEL)))) + (GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_INTEL)))) #endif // OpenMP From 904db64afd43b0c23fe47f13a3dc4d38fad92f37 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 21 Feb 2016 14:22:19 +0100 Subject: [PATCH 046/110] Updated readme for fixed Clang build on Windows #479 --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index 886afbe0..7c1ab16b 100644 --- a/readme.md +++ b/readme.md @@ -58,6 +58,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) ##### Fixes: - Fixed CMake policy warning - Fixed GCC 6.0 detection +- Fixed Clang build on Windows #### [GLM 0.9.7.2](https://github.com/g-truc/glm/releases/tag/0.9.7.2) - 2016-01-03 ##### Fixes: From 500a955d45afcf5aa8fd4c29e2751421e013a537 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 21 Feb 2016 14:29:07 +0100 Subject: [PATCH 047/110] Fixed 64 bits constants warnings on GCC #463 --- glm/gtc/bitfield.inl | 92 ++++++++++++++++++++++---------------------- readme.md | 5 ++- 2 files changed, 49 insertions(+), 48 deletions(-) diff --git a/glm/gtc/bitfield.inl b/glm/gtc/bitfield.inl index 11702627..a9eeb2eb 100644 --- a/glm/gtc/bitfield.inl +++ b/glm/gtc/bitfield.inl @@ -138,25 +138,25 @@ namespace detail glm::uint64 REG2(y); glm::uint64 REG3(z); - REG1 = ((REG1 << 32) | REG1) & glm::uint64(0xFFFF00000000FFFF); - REG2 = ((REG2 << 32) | REG2) & glm::uint64(0xFFFF00000000FFFF); - REG3 = ((REG3 << 32) | REG3) & glm::uint64(0xFFFF00000000FFFF); + REG1 = ((REG1 << 32) | REG1) & glm::uint64(0xFFFF00000000FFFFull); + REG2 = ((REG2 << 32) | REG2) & glm::uint64(0xFFFF00000000FFFFull); + REG3 = ((REG3 << 32) | REG3) & glm::uint64(0xFFFF00000000FFFFull); - REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x00FF0000FF0000FF); - REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x00FF0000FF0000FF); - REG3 = ((REG3 << 16) | REG3) & glm::uint64(0x00FF0000FF0000FF); + REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x00FF0000FF0000FFull); + REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x00FF0000FF0000FFull); + REG3 = ((REG3 << 16) | REG3) & glm::uint64(0x00FF0000FF0000FFull); - REG1 = ((REG1 << 8) | REG1) & glm::uint64(0xF00F00F00F00F00F); - REG2 = ((REG2 << 8) | REG2) & glm::uint64(0xF00F00F00F00F00F); - REG3 = ((REG3 << 8) | REG3) & glm::uint64(0xF00F00F00F00F00F); + REG1 = ((REG1 << 8) | REG1) & glm::uint64(0xF00F00F00F00F00Full); + REG2 = ((REG2 << 8) | REG2) & glm::uint64(0xF00F00F00F00F00Full); + REG3 = ((REG3 << 8) | REG3) & glm::uint64(0xF00F00F00F00F00Full); - REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x30C30C30C30C30C3); - REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x30C30C30C30C30C3); - REG3 = ((REG3 << 4) | REG3) & glm::uint64(0x30C30C30C30C30C3); + REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x30C30C30C30C30C3ull); + REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x30C30C30C30C30C3ull); + REG3 = ((REG3 << 4) | REG3) & glm::uint64(0x30C30C30C30C30C3ull); - REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x9249249249249249); - REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x9249249249249249); - REG3 = ((REG3 << 2) | REG3) & glm::uint64(0x9249249249249249); + REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x9249249249249249ull); + REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x9249249249249249ull); + REG3 = ((REG3 << 2) | REG3) & glm::uint64(0x9249249249249249ull); return REG1 | (REG2 << 1) | (REG3 << 2); } @@ -168,25 +168,25 @@ namespace detail glm::uint64 REG2(y); glm::uint64 REG3(z); - REG1 = ((REG1 << 32) | REG1) & glm::uint64(0xFFFF00000000FFFF); - REG2 = ((REG2 << 32) | REG2) & glm::uint64(0xFFFF00000000FFFF); - REG3 = ((REG3 << 32) | REG3) & glm::uint64(0xFFFF00000000FFFF); + REG1 = ((REG1 << 32) | REG1) & glm::uint64(0xFFFF00000000FFFFull); + REG2 = ((REG2 << 32) | REG2) & glm::uint64(0xFFFF00000000FFFFull); + REG3 = ((REG3 << 32) | REG3) & glm::uint64(0xFFFF00000000FFFFull); - REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x00FF0000FF0000FF); - REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x00FF0000FF0000FF); - REG3 = ((REG3 << 16) | REG3) & glm::uint64(0x00FF0000FF0000FF); + REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x00FF0000FF0000FFull); + REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x00FF0000FF0000FFull); + REG3 = ((REG3 << 16) | REG3) & glm::uint64(0x00FF0000FF0000FFull); - REG1 = ((REG1 << 8) | REG1) & glm::uint64(0xF00F00F00F00F00F); - REG2 = ((REG2 << 8) | REG2) & glm::uint64(0xF00F00F00F00F00F); - REG3 = ((REG3 << 8) | REG3) & glm::uint64(0xF00F00F00F00F00F); + REG1 = ((REG1 << 8) | REG1) & glm::uint64(0xF00F00F00F00F00Full); + REG2 = ((REG2 << 8) | REG2) & glm::uint64(0xF00F00F00F00F00Full); + REG3 = ((REG3 << 8) | REG3) & glm::uint64(0xF00F00F00F00F00Full); - REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x30C30C30C30C30C3); - REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x30C30C30C30C30C3); - REG3 = ((REG3 << 4) | REG3) & glm::uint64(0x30C30C30C30C30C3); + REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x30C30C30C30C30C3ull); + REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x30C30C30C30C30C3ull); + REG3 = ((REG3 << 4) | REG3) & glm::uint64(0x30C30C30C30C30C3ull); - REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x9249249249249249); - REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x9249249249249249); - REG3 = ((REG3 << 2) | REG3) & glm::uint64(0x9249249249249249); + REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x9249249249249249ull); + REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x9249249249249249ull); + REG3 = ((REG3 << 2) | REG3) & glm::uint64(0x9249249249249249ull); return REG1 | (REG2 << 1) | (REG3 << 2); } @@ -225,25 +225,25 @@ namespace detail glm::uint64 REG3(z); glm::uint64 REG4(w); - REG1 = ((REG1 << 24) | REG1) & glm::uint64(0x000000FF000000FF); - REG2 = ((REG2 << 24) | REG2) & glm::uint64(0x000000FF000000FF); - REG3 = ((REG3 << 24) | REG3) & glm::uint64(0x000000FF000000FF); - REG4 = ((REG4 << 24) | REG4) & glm::uint64(0x000000FF000000FF); + REG1 = ((REG1 << 24) | REG1) & glm::uint64(0x000000FF000000FFull); + REG2 = ((REG2 << 24) | REG2) & glm::uint64(0x000000FF000000FFull); + REG3 = ((REG3 << 24) | REG3) & glm::uint64(0x000000FF000000FFull); + REG4 = ((REG4 << 24) | REG4) & glm::uint64(0x000000FF000000FFull); - REG1 = ((REG1 << 12) | REG1) & glm::uint64(0x000F000F000F000F); - REG2 = ((REG2 << 12) | REG2) & glm::uint64(0x000F000F000F000F); - REG3 = ((REG3 << 12) | REG3) & glm::uint64(0x000F000F000F000F); - REG4 = ((REG4 << 12) | REG4) & glm::uint64(0x000F000F000F000F); + REG1 = ((REG1 << 12) | REG1) & glm::uint64(0x000F000F000F000Full); + REG2 = ((REG2 << 12) | REG2) & glm::uint64(0x000F000F000F000Full); + REG3 = ((REG3 << 12) | REG3) & glm::uint64(0x000F000F000F000Full); + REG4 = ((REG4 << 12) | REG4) & glm::uint64(0x000F000F000F000Full); - REG1 = ((REG1 << 6) | REG1) & glm::uint64(0x0303030303030303); - REG2 = ((REG2 << 6) | REG2) & glm::uint64(0x0303030303030303); - REG3 = ((REG3 << 6) | REG3) & glm::uint64(0x0303030303030303); - REG4 = ((REG4 << 6) | REG4) & glm::uint64(0x0303030303030303); + REG1 = ((REG1 << 6) | REG1) & glm::uint64(0x0303030303030303ull); + REG2 = ((REG2 << 6) | REG2) & glm::uint64(0x0303030303030303ull); + REG3 = ((REG3 << 6) | REG3) & glm::uint64(0x0303030303030303ull); + REG4 = ((REG4 << 6) | REG4) & glm::uint64(0x0303030303030303ull); - REG1 = ((REG1 << 3) | REG1) & glm::uint64(0x1111111111111111); - REG2 = ((REG2 << 3) | REG2) & glm::uint64(0x1111111111111111); - REG3 = ((REG3 << 3) | REG3) & glm::uint64(0x1111111111111111); - REG4 = ((REG4 << 3) | REG4) & glm::uint64(0x1111111111111111); + REG1 = ((REG1 << 3) | REG1) & glm::uint64(0x1111111111111111ull); + REG2 = ((REG2 << 3) | REG2) & glm::uint64(0x1111111111111111ull); + REG3 = ((REG3 << 3) | REG3) & glm::uint64(0x1111111111111111ull); + REG4 = ((REG4 << 3) | REG4) & glm::uint64(0x1111111111111111ull); return REG1 | (REG2 << 1) | (REG3 << 2) | (REG4 << 3); } diff --git a/readme.md b/readme.md index 7c1ab16b..1dfff21a 100644 --- a/readme.md +++ b/readme.md @@ -57,8 +57,9 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) ##### Fixes: - Fixed CMake policy warning -- Fixed GCC 6.0 detection -- Fixed Clang build on Windows +- Fixed GCC 6.0 detection #477 +- Fixed Clang build on Windows #479 +- Fixed 64 bits constants warnings on GCC #463 #### [GLM 0.9.7.2](https://github.com/g-truc/glm/releases/tag/0.9.7.2) - 2016-01-03 ##### Fixes: From 5809830f641c570f88e6ada2dcb3f94be840d6b8 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 21 Feb 2016 14:36:38 +0100 Subject: [PATCH 048/110] Get ready for 0.9.7.3 release --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 1dfff21a..4dace914 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.3](https://github.com/g-truc/glm/tree/0.9.7) - 2016-XX-XX +#### [GLM 0.9.7.3](https://github.com/g-truc/glm/releases/tag/0.9.7.3) - 2016-02-21 ##### Improvements: - Added AVX512 detection From 0d48c433851e8fc2dcb313fd3d5ea53e39ee2436 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 21 Feb 2016 18:59:26 +0100 Subject: [PATCH 049/110] Fixed asinh warning with C++98 STL #484 --- glm/detail/func_trigonometric.inl | 2 +- readme.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/glm/detail/func_trigonometric.inl b/glm/detail/func_trigonometric.inl index f723de47..dacd0eee 100644 --- a/glm/detail/func_trigonometric.inl +++ b/glm/detail/func_trigonometric.inl @@ -170,7 +170,7 @@ namespace glm { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'asinh' only accept floating-point input"); - return (x < static_cast(0) ? static_cast(-1) : (x > static_cast(0) ? static_cast(1) : static_cast(0))) * log(abs(x) + sqrt(static_cast(1) + x * x)); + return (x < static_cast(0) ? static_cast(-1) : (x > static_cast(0) ? static_cast(1) : static_cast(0))) * log(std::abs(x) + sqrt(static_cast(1) + x * x)); } # endif diff --git a/readme.md b/readme.md index 4dace914..f422d084 100644 --- a/readme.md +++ b/readme.md @@ -51,6 +51,10 @@ 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 +##### Fixes: +- Fixed asinh warning with C++98 STL #484 + #### [GLM 0.9.7.3](https://github.com/g-truc/glm/releases/tag/0.9.7.3) - 2016-02-21 ##### Improvements: - Added AVX512 detection From 045aa8e541b656ac5cfdd99fa6d50db2c43ec641 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 21 Feb 2016 19:40:24 +0100 Subject: [PATCH 050/110] Fixed atanh warning #484 --- glm/detail/func_trigonometric.inl | 2 +- readme.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/glm/detail/func_trigonometric.inl b/glm/detail/func_trigonometric.inl index dacd0eee..1e70158d 100644 --- a/glm/detail/func_trigonometric.inl +++ b/glm/detail/func_trigonometric.inl @@ -210,7 +210,7 @@ namespace glm { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'atanh' only accept floating-point input"); - if(abs(x) >= static_cast(1)) + if(std::abs(x) >= static_cast(1)) return 0; return static_cast(0.5) * log((static_cast(1) + x) / (static_cast(1) - x)); } diff --git a/readme.md b/readme.md index f422d084..a044dd14 100644 --- a/readme.md +++ b/readme.md @@ -53,7 +53,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) #### [GLM 0.9.7.4](https://github.com/g-truc/glm/tree/0.9.7) - 2016-XX-XX ##### Fixes: -- Fixed asinh warning with C++98 STL #484 +- Fixed asinh and atanh warning with C++98 STL #484 #### [GLM 0.9.7.3](https://github.com/g-truc/glm/releases/tag/0.9.7.3) - 2016-02-21 ##### Improvements: From b189cb2f29ad68c5318b49babf120a9edb09e9d9 Mon Sep 17 00:00:00 2001 From: NouberNou Date: Thu, 25 Feb 2016 18:18:02 -0800 Subject: [PATCH 051/110] Fix polar coordinates function latitude. Latitude was being computed from `atan`, should be `asin`. --- glm/gtx/polar_coordinates.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/gtx/polar_coordinates.inl b/glm/gtx/polar_coordinates.inl index d1afbb23..9d7f6aea 100644 --- a/glm/gtx/polar_coordinates.inl +++ b/glm/gtx/polar_coordinates.inl @@ -43,7 +43,7 @@ namespace glm T const xz_dist(sqrt(tmp.x * tmp.x + tmp.z * tmp.z)); return tvec3( - atan(xz_dist, tmp.y), // latitude + asin(tmp.y), // latitude atan(tmp.x, tmp.z), // longitude xz_dist); // xz distance } From c6aa981e2a6267e9f40b2d84b9597d900aaf3a0f Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 2 Mar 2016 21:32:44 +0100 Subject: [PATCH 052/110] Added ceilMultiple test with integers --- test/gtc/gtc_round.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/test/gtc/gtc_round.cpp b/test/gtc/gtc_round.cpp index aa6cf1a1..074987f6 100644 --- a/test/gtc/gtc_round.cpp +++ b/test/gtc/gtc_round.cpp @@ -354,7 +354,7 @@ namespace ceilMultiple }; int Error(0); - + for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) { glm::float64 Result = glm::ceilMultiple(Data[i].Source, Data[i].Multiple); @@ -364,10 +364,31 @@ namespace ceilMultiple return Error; } + int test_int() + { + type const Data[] = + { + {3, 4, 4}, + {7, 8, 4}, + {5, 8, 4}, + }; + + int Error(0); + + for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + int Result = glm::ceilMultiple(Data[i].Source, Data[i].Multiple); + Error += Data[i].Return == Result ? 0 : 1; + } + + return Error; + } + int test() { int Error(0); + Error += test_int(); Error += test_float(); return Error; From 57316860a1789902bfa75beda9a6e37399b0a911 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 2 Mar 2016 21:42:13 +0100 Subject: [PATCH 053/110] Fixed ceilMultiple test --- test/gtc/gtc_round.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/gtc/gtc_round.cpp b/test/gtc/gtc_round.cpp index 074987f6..112e3015 100644 --- a/test/gtc/gtc_round.cpp +++ b/test/gtc/gtc_round.cpp @@ -368,9 +368,12 @@ namespace ceilMultiple { type const Data[] = { - {3, 4, 4}, - {7, 8, 4}, - {5, 8, 4}, + {3, 4, 4, 0}, + {7, 4, 8, 0}, + {5, 4, 8, 0}, + {1, 4, 4, 0}, + {1, 3, 3, 0}, + {4, 3, 6, 0}, }; int Error(0); From 5fad3f437df785bf12d8d8903e577b971def8557 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 2 Mar 2016 21:44:59 +0100 Subject: [PATCH 054/110] Added more tests for ceilMultiple --- test/gtc/gtc_round.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/gtc/gtc_round.cpp b/test/gtc/gtc_round.cpp index 112e3015..6e961e95 100644 --- a/test/gtc/gtc_round.cpp +++ b/test/gtc/gtc_round.cpp @@ -374,6 +374,9 @@ namespace ceilMultiple {1, 4, 4, 0}, {1, 3, 3, 0}, {4, 3, 6, 0}, + {4, 1, 4, 0}, + {1, 1, 1, 0}, + {7, 1, 7, 0}, }; int Error(0); From 082272421a19e30e2dec4a2a337fc89872ceffd2 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 5 Mar 2016 22:25:17 +0100 Subject: [PATCH 055/110] Fixed long long warnings when using C++98 on GCC and Clang #482 --- CMakeLists.txt | 6 ++++++ readme.md | 1 + 2 files changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5dfe2976..112d7bbe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,6 +53,12 @@ if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") OR ("${CMAKE_CXX_COMPILER_ID}" set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++98") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") set(CMAKE_CXX_FLAGS "-std=c++98") + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")) + # GLM is using GCC 64 bits integer extension + add_definitions(-Wno-long-long) + elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + add_definitions(-Wno-c++11-long-long) + endif() endif() endif() diff --git a/readme.md b/readme.md index c4923049..44b02dda 100644 --- a/readme.md +++ b/readme.md @@ -68,6 +68,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) ##### Fixes: - Fixed GTX_extended_min_max filename typo #386 - Fixed intersectRayTriangle to not do any unintentional backface culling +- Fixed long long warnings when using C++98 on GCC and Clang #482 #### [GLM 0.9.7.4](https://github.com/g-truc/glm/tree/0.9.7) - 2016-XX-XX ##### Fixes: From 57bf985fe502c3edbbbfa99a1f39c64c0176cac6 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 5 Mar 2016 22:29:52 +0100 Subject: [PATCH 056/110] Fixed build --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 112d7bbe..fd10009e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,7 +53,7 @@ if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") OR ("${CMAKE_CXX_COMPILER_ID}" set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++98") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") set(CMAKE_CXX_FLAGS "-std=c++98") - if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")) + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") # GLM is using GCC 64 bits integer extension add_definitions(-Wno-long-long) elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") From 251ad15b688410a81bf99e0a4bac98c67c9cdab3 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 5 Mar 2016 23:01:01 +0100 Subject: [PATCH 057/110] Improved GLM_FORCE_EXPLICIT_CTOR coverage #481 --- glm/detail/type_mat2x2.hpp | 16 ++++++++-------- glm/detail/type_mat2x3.hpp | 16 ++++++++-------- glm/detail/type_mat2x4.hpp | 16 ++++++++-------- glm/detail/type_mat3x2.hpp | 16 ++++++++-------- glm/detail/type_mat3x3.hpp | 16 ++++++++-------- glm/detail/type_mat3x4.hpp | 16 ++++++++-------- glm/detail/type_mat4x2.hpp | 16 ++++++++-------- glm/detail/type_mat4x3.hpp | 16 ++++++++-------- glm/detail/type_mat4x4.hpp | 16 ++++++++-------- glm/detail/type_vec1.hpp | 6 +++--- glm/detail/type_vec2.hpp | 4 ++-- glm/detail/type_vec3.hpp | 10 +++++----- glm/detail/type_vec4.hpp | 22 +++++++++++----------- glm/gtc/quaternion.hpp | 10 +++++----- glm/gtx/dual_quaternion.hpp | 6 +++--- readme.md | 1 + 16 files changed, 102 insertions(+), 101 deletions(-) diff --git a/glm/detail/type_mat2x2.hpp b/glm/detail/type_mat2x2.hpp index 9df68720..a263d54d 100644 --- a/glm/detail/type_mat2x2.hpp +++ b/glm/detail/type_mat2x2.hpp @@ -102,14 +102,14 @@ namespace glm template GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat2x2 const & m); - GLM_FUNC_DECL explicit tmat2x2(tmat3x3 const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat4x4 const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat2x3 const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat3x2 const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat2x4 const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat4x2 const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat3x4 const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat4x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat3x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat4x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat2x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat3x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat2x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat4x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat3x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat4x3 const & x); // -- Accesses -- diff --git a/glm/detail/type_mat2x3.hpp b/glm/detail/type_mat2x3.hpp index 493548f4..7fc67faa 100644 --- a/glm/detail/type_mat2x3.hpp +++ b/glm/detail/type_mat2x3.hpp @@ -99,14 +99,14 @@ namespace glm template GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat2x3 const & m); - GLM_FUNC_DECL explicit tmat2x3(tmat2x2 const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat3x3 const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat4x4 const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat2x4 const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat3x2 const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat3x4 const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat4x2 const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat4x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat2x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat3x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat4x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat2x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat3x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat3x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat4x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat4x3 const & x); // -- Accesses -- diff --git a/glm/detail/type_mat2x4.hpp b/glm/detail/type_mat2x4.hpp index e15714ca..c27243fd 100644 --- a/glm/detail/type_mat2x4.hpp +++ b/glm/detail/type_mat2x4.hpp @@ -101,14 +101,14 @@ namespace glm template GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat2x4 const & m); - GLM_FUNC_DECL explicit tmat2x4(tmat2x2 const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat3x3 const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat4x4 const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat2x3 const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat3x2 const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat3x4 const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat4x2 const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat4x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat2x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat3x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat4x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat2x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat3x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat3x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat4x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat4x3 const & x); // -- Accesses -- diff --git a/glm/detail/type_mat3x2.hpp b/glm/detail/type_mat3x2.hpp index 63e0a659..2f594bb1 100644 --- a/glm/detail/type_mat3x2.hpp +++ b/glm/detail/type_mat3x2.hpp @@ -106,14 +106,14 @@ namespace glm template GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat3x2 const & m); - GLM_FUNC_DECL explicit tmat3x2(tmat2x2 const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat3x3 const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat4x4 const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat2x3 const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat2x4 const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat3x4 const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat4x2 const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat4x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat2x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat3x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat4x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat2x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat2x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat3x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat4x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat4x3 const & x); // -- Accesses -- diff --git a/glm/detail/type_mat3x3.hpp b/glm/detail/type_mat3x3.hpp index 799d645d..2aaae21e 100644 --- a/glm/detail/type_mat3x3.hpp +++ b/glm/detail/type_mat3x3.hpp @@ -110,14 +110,14 @@ namespace glm template GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat3x3 const & m); - GLM_FUNC_DECL explicit tmat3x3(tmat2x2 const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat4x4 const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat2x3 const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat3x2 const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat2x4 const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat4x2 const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat3x4 const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat4x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat2x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat4x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat2x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat3x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat2x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat4x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat3x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat4x3 const & x); // -- Accesses -- diff --git a/glm/detail/type_mat3x4.hpp b/glm/detail/type_mat3x4.hpp index 7453673b..6b5c1dbe 100644 --- a/glm/detail/type_mat3x4.hpp +++ b/glm/detail/type_mat3x4.hpp @@ -106,14 +106,14 @@ namespace glm template GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat3x4 const & m); - GLM_FUNC_DECL explicit tmat3x4(tmat2x2 const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat3x3 const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat4x4 const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat2x3 const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat3x2 const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat2x4 const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat4x2 const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat4x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat2x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat3x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat4x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat2x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat3x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat2x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat4x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat4x3 const & x); // -- Accesses -- diff --git a/glm/detail/type_mat4x2.hpp b/glm/detail/type_mat4x2.hpp index 8cb7d70e..a52675b8 100644 --- a/glm/detail/type_mat4x2.hpp +++ b/glm/detail/type_mat4x2.hpp @@ -111,14 +111,14 @@ namespace glm template GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat4x2 const & m); - GLM_FUNC_DECL explicit tmat4x2(tmat2x2 const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat3x3 const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat4x4 const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat2x3 const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat3x2 const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat2x4 const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat4x3 const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat3x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat2x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat3x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat4x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat2x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat3x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat2x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat4x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat3x4 const & x); // -- Accesses -- diff --git a/glm/detail/type_mat4x3.hpp b/glm/detail/type_mat4x3.hpp index 0a5de95b..9ee26169 100644 --- a/glm/detail/type_mat4x3.hpp +++ b/glm/detail/type_mat4x3.hpp @@ -111,14 +111,14 @@ namespace glm template GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat4x3 const & m); - GLM_FUNC_DECL explicit tmat4x3(tmat2x2 const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat3x3 const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat4x4 const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat2x3 const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat3x2 const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat2x4 const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat4x2 const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat3x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat2x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat3x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat4x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat2x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat3x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat2x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat4x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat3x4 const & x); // -- Accesses -- diff --git a/glm/detail/type_mat4x4.hpp b/glm/detail/type_mat4x4.hpp index a90a5978..bb5fba0b 100644 --- a/glm/detail/type_mat4x4.hpp +++ b/glm/detail/type_mat4x4.hpp @@ -115,14 +115,14 @@ namespace glm template GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat4x4 const & m); - GLM_FUNC_DECL explicit tmat4x4(tmat2x2 const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat3x3 const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat2x3 const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat3x2 const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat2x4 const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat4x2 const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat3x4 const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat4x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat2x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat3x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat2x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat3x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat2x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat4x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat3x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat4x3 const & x); // -- Accesses -- diff --git a/glm/detail/type_vec1.hpp b/glm/detail/type_vec1.hpp index 833468d8..2e811a36 100644 --- a/glm/detail/type_vec1.hpp +++ b/glm/detail/type_vec1.hpp @@ -126,13 +126,13 @@ namespace glm /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec1(tvec2 const & v); + GLM_FUNC_DECL GLM_EXPLICIT tvec1(tvec2 const & v); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec1(tvec3 const & v); + GLM_FUNC_DECL GLM_EXPLICIT tvec1(tvec3 const & v); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec1(tvec4 const & v); + GLM_FUNC_DECL GLM_EXPLICIT tvec1(tvec4 const & v); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template diff --git a/glm/detail/type_vec2.hpp b/glm/detail/type_vec2.hpp index 1d857ac7..13c5d05f 100644 --- a/glm/detail/type_vec2.hpp +++ b/glm/detail/type_vec2.hpp @@ -138,10 +138,10 @@ namespace glm /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec2(tvec3 const & v); + GLM_FUNC_DECL GLM_EXPLICIT tvec2(tvec3 const & v); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec2(tvec4 const & v); + GLM_FUNC_DECL GLM_EXPLICIT tvec2(tvec4 const & v); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template diff --git a/glm/detail/type_vec3.hpp b/glm/detail/type_vec3.hpp index d4d8ff6a..72d32286 100644 --- a/glm/detail/type_vec3.hpp +++ b/glm/detail/type_vec3.hpp @@ -143,19 +143,19 @@ namespace glm /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec3(tvec2 const & a, B const & b); + GLM_FUNC_DECL tvec3(tvec2 const & a, B const & b); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec3(tvec2 const & a, tvec1 const & b); + 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 explicit tvec3(A const & a, tvec2 const & b); + GLM_FUNC_DECL tvec3(A const & 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 explicit tvec3(tvec1 const & a, tvec2 const & b); + GLM_FUNC_DECL tvec3(tvec1 const & 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 explicit tvec3(tvec4 const & v); + GLM_FUNC_DECL GLM_EXPLICIT tvec3(tvec4 const & v); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index f26350c6..5ff33e07 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -208,37 +208,37 @@ namespace detail /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec4(tvec2 const & a, B b, C c); + GLM_FUNC_DECL tvec4(tvec2 const & a, B b, C c); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec4(tvec2 const & a, tvec1 const & b, tvec1 const & c); + GLM_FUNC_DECL tvec4(tvec2 const & a, tvec1 const & b, tvec1 const & c); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec4(A a, tvec2 const & b, C c); + GLM_FUNC_DECL tvec4(A a, tvec2 const & b, C c); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec4(tvec1 const & a, tvec2 const & b, tvec1 const & c); + GLM_FUNC_DECL tvec4(tvec1 const & a, tvec2 const & b, tvec1 const & c); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec4(A a, B b, tvec2 const & c); + GLM_FUNC_DECL tvec4(A a, B b, tvec2 const & c); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec4(tvec1 const & a, tvec1 const & b, tvec2 const & c); + GLM_FUNC_DECL tvec4(tvec1 const & a, tvec1 const & b, tvec2 const & c); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec4(tvec3 const & a, B b); + GLM_FUNC_DECL tvec4(tvec3 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 explicit tvec4(tvec3 const & a, tvec1 const & b); + GLM_FUNC_DECL tvec4(tvec3 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 explicit tvec4(A a, tvec3 const & b); + GLM_FUNC_DECL tvec4(A a, tvec3 const & b); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec4(tvec1 const & a, tvec3 const & b); + GLM_FUNC_DECL tvec4(tvec1 const & a, tvec3 const & b); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec4(tvec2 const & a, tvec2 const & b); + GLM_FUNC_DECL tvec4(tvec2 const & a, tvec2 const & b); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template diff --git a/glm/gtc/quaternion.hpp b/glm/gtc/quaternion.hpp index daf9cc19..9a6817fa 100644 --- a/glm/gtc/quaternion.hpp +++ b/glm/gtc/quaternion.hpp @@ -124,7 +124,7 @@ namespace glm // -- Explicit basic constructors -- GLM_FUNC_DECL explicit tquat(ctor); - GLM_FUNC_DECL explicit tquat(T const & s, tvec3 const & v); + GLM_FUNC_DECL tquat(T const & s, tvec3 const & v); GLM_FUNC_DECL tquat(T const & w, T const & x, T const & y, T const & z); // -- Conversion constructors -- @@ -144,12 +144,12 @@ namespace glm /// @param v A second normalized axis /// @see gtc_quaternion /// @see http://lolengine.net/blog/2013/09/18/beautiful-maths-quaternion-from-vectors - GLM_FUNC_DECL explicit tquat(tvec3 const & u, tvec3 const & v); + GLM_FUNC_DECL tquat(tvec3 const & u, tvec3 const & v); /// Build a quaternion from euler angles (pitch, yaw, roll), in radians. - GLM_FUNC_DECL explicit tquat(tvec3 const & eulerAngles); - GLM_FUNC_DECL explicit tquat(tmat3x3 const & m); - GLM_FUNC_DECL explicit tquat(tmat4x4 const & m); + GLM_FUNC_DECL GLM_EXPLICIT tquat(tvec3 const & eulerAngles); + GLM_FUNC_DECL GLM_EXPLICIT tquat(tmat3x3 const & m); + GLM_FUNC_DECL GLM_EXPLICIT tquat(tmat4x4 const & m); // -- Unary arithmetic operators -- diff --git a/glm/gtx/dual_quaternion.hpp b/glm/gtx/dual_quaternion.hpp index c62fcda4..35a5d850 100644 --- a/glm/gtx/dual_quaternion.hpp +++ b/glm/gtx/dual_quaternion.hpp @@ -103,7 +103,7 @@ namespace glm // -- Explicit basic constructors -- GLM_FUNC_DECL explicit tdualquat(ctor); - GLM_FUNC_DECL explicit tdualquat(tquat const & real); + GLM_FUNC_DECL tdualquat(tquat const & real); GLM_FUNC_DECL tdualquat(tquat const & orientation, tvec3 const & translation); GLM_FUNC_DECL tdualquat(tquat const & real, tquat const & dual); @@ -112,8 +112,8 @@ namespace glm template GLM_FUNC_DECL GLM_EXPLICIT tdualquat(tdualquat const & q); - GLM_FUNC_DECL explicit tdualquat(tmat2x4 const & holder_mat); - GLM_FUNC_DECL explicit tdualquat(tmat3x4 const & aug_mat); + GLM_FUNC_DECL GLM_EXPLICIT tdualquat(tmat2x4 const & holder_mat); + GLM_FUNC_DECL GLM_EXPLICIT tdualquat(tmat3x4 const & aug_mat); // -- Unary arithmetic operators -- diff --git a/readme.md b/readme.md index 44b02dda..17a7a1cc 100644 --- a/readme.md +++ b/readme.md @@ -64,6 +64,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) ##### Improvements: - Improved GTC_random linearRand documentation - Improved GTC_reciprocal documentation +- Improved GLM_FORCE_EXPLICIT_CTOR coverage #481 ##### Fixes: - Fixed GTX_extended_min_max filename typo #386 From bd68af60bdce1d7cf5d53c9744c64b6cd92797ad Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 5 Mar 2016 23:20:12 +0100 Subject: [PATCH 058/110] - Fixed outerProduct defintions and operator signatures for mat2x4 and vec4 #475 --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index 17a7a1cc..bb273be5 100644 --- a/readme.md +++ b/readme.md @@ -70,6 +70,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) - Fixed GTX_extended_min_max filename typo #386 - Fixed intersectRayTriangle to not do any unintentional backface culling - Fixed long long warnings when using C++98 on GCC and Clang #482 +- Fixed outerProduct defintions and operator signatures for mat2x4 and vec4 #475 #### [GLM 0.9.7.4](https://github.com/g-truc/glm/tree/0.9.7) - 2016-XX-XX ##### Fixes: From 62717b515933a2db29057596054cad20c4012164 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 5 Mar 2016 23:36:18 +0100 Subject: [PATCH 059/110] - Fixed polar coordinates function latitude #485 --- readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.md b/readme.md index 9a041abc..6fcc7b75 100644 --- a/readme.md +++ b/readme.md @@ -71,6 +71,8 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) - Fixed intersectRayTriangle to not do any unintentional backface culling - Fixed long long warnings when using C++98 on GCC and Clang #482 - Fixed outerProduct defintions and operator signatures for mat2x4 and vec4 #475 +- Fixed eulerAngles precision error, returns NaN #461 #462 +- Fixed polar coordinates function latitude #485 #### [GLM 0.9.7.4](https://github.com/g-truc/glm/tree/0.9.7) - 2016-XX-XX ##### Fixes: From 30ab2ee25b3cca238a26c56a1baab9b2465659c8 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 5 Mar 2016 23:36:18 +0100 Subject: [PATCH 060/110] Fixed polar coordinates function latitude #485 --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index a044dd14..e3a5e421 100644 --- a/readme.md +++ b/readme.md @@ -54,6 +54,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) #### [GLM 0.9.7.4](https://github.com/g-truc/glm/tree/0.9.7) - 2016-XX-XX ##### Fixes: - Fixed asinh and atanh warning with C++98 STL #484 +- Fixed polar coordinates function latitude #485 #### [GLM 0.9.7.3](https://github.com/g-truc/glm/releases/tag/0.9.7.3) - 2016-02-21 ##### Improvements: From eb33d9c18829b414071fb9f3c22bf02e7f30cfb7 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 5 Mar 2016 23:20:12 +0100 Subject: [PATCH 061/110] - Fixed outerProduct defintions and operator signatures for mat2x4 and vec4 #475 --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index e3a5e421..fb63f4c1 100644 --- a/readme.md +++ b/readme.md @@ -55,6 +55,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) ##### Fixes: - Fixed asinh and atanh warning with C++98 STL #484 - Fixed polar coordinates function latitude #485 +- Fixed outerProduct defintions and operator signatures for mat2x4 and vec4 #475 #### [GLM 0.9.7.3](https://github.com/g-truc/glm/releases/tag/0.9.7.3) - 2016-02-21 ##### Improvements: From 2d813b587a1e5cd954ead889b89f91dcd68250c6 Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Wed, 16 Dec 2015 15:57:29 +0100 Subject: [PATCH 062/110] This fixes #461 --- glm/gtc/quaternion.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index 83a1b66f..043a6a1b 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -597,7 +597,7 @@ namespace detail template GLM_FUNC_QUALIFIER T yaw(tquat const & q) { - return asin(T(-2) * (q.x * q.z - q.w * q.y)); + return asin(clamp(T(-2) * (q.x * q.z - q.w * q.y), T(-1), T(1))); } template From 8e411733b23f3bdb46b91e255156f738222f1fec Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 5 Mar 2016 23:49:07 +0100 Subject: [PATCH 063/110] - Fixed eulerAngles precision error, returns NaN #451 --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index fb63f4c1..f464a4a3 100644 --- a/readme.md +++ b/readme.md @@ -56,6 +56,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) - Fixed asinh and atanh warning with C++98 STL #484 - Fixed polar coordinates function latitude #485 - Fixed outerProduct defintions and operator signatures for mat2x4 and vec4 #475 +- Fixed eulerAngles precision error, returns NaN #451 #### [GLM 0.9.7.3](https://github.com/g-truc/glm/releases/tag/0.9.7.3) - 2016-02-21 ##### Improvements: From b3b72527b13173bddb4a8377bfdc61a9003cfaf6 Mon Sep 17 00:00:00 2001 From: Paul Konstantin Gerke Date: Sun, 24 Jan 2016 19:34:26 +0100 Subject: [PATCH 064/110] Fixed: operator signatures of mat2x4 and vec4 (no guaratees that I found all issues) --- glm/detail/type_mat2x4.hpp | 2 +- glm/detail/type_mat2x4.inl | 2 +- glm/detail/type_vec4.hpp | 8 ++++---- glm/detail/type_vec4.inl | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/glm/detail/type_mat2x4.hpp b/glm/detail/type_mat2x4.hpp index 8e3c616a..b06ae7c6 100644 --- a/glm/detail/type_mat2x4.hpp +++ b/glm/detail/type_mat2x4.hpp @@ -192,7 +192,7 @@ namespace glm GLM_FUNC_DECL tmat3x4 operator*(tmat2x4 const & m1, tmat3x2 const & m2); template - GLM_FUNC_DECL tmat2x4 operator/(tmat2x4 const & m, T s); + GLM_FUNC_DECL tmat2x4 operator/(tmat2x4 const & m, const T& s); template GLM_FUNC_DECL tmat2x4 operator/(T s, tmat2x4 const & m); diff --git a/glm/detail/type_mat2x4.inl b/glm/detail/type_mat2x4.inl index 42299787..cac649f6 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, T s) + GLM_FUNC_QUALIFIER tmat2x4 operator/(tmat2x4 const & m, const T& s) { return tmat2x4( m[0] / s, diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index e9fe6c1d..e941b766 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, T scalar); + GLM_FUNC_DECL tvec4 operator+(tvec4 const & v, const T& scalar); template GLM_FUNC_DECL tvec4 operator+(tvec4 const & v, tvec1 const & scalar); @@ -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, T scalar); + GLM_FUNC_DECL tvec4 operator-(tvec4 const & v, const T& scalar); template GLM_FUNC_DECL tvec4 operator-(tvec4 const & v, tvec1 const & scalar); @@ -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, T scalar); + GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, const T& scalar); template GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, tvec1 const & scalar); @@ -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, T scalar); + GLM_FUNC_DECL tvec4 operator/(tvec4 const & v, const 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 8e215d00..5927d99e 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, T scalar) + GLM_FUNC_QUALIFIER tvec4 operator+(tvec4 const & v, const T& scalar) { return tvec4( v.x + scalar, @@ -694,7 +694,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator-(tvec4 const & v, T scalar) + GLM_FUNC_QUALIFIER tvec4 operator-(tvec4 const & v, const T& scalar) { return tvec4( v.x - scalar, @@ -724,7 +724,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator*(tvec4 const & v, T scalar) + GLM_FUNC_QUALIFIER tvec4 operator*(tvec4 const & v, const T& scalar) { return tvec4( v.x * scalar, @@ -754,7 +754,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator/(tvec4 const & v, T scalar) + GLM_FUNC_QUALIFIER tvec4 operator/(tvec4 const & v, const T& scalar) { return tvec4( v.x / scalar, From 239cf70ade606cb03b922d4290057f554d56b088 Mon Sep 17 00:00:00 2001 From: Paul Konstantin Gerke Date: Sun, 24 Jan 2016 21:14:25 +0100 Subject: [PATCH 065/110] Fixed: outerProduct was defined incorrectly for unmatched vecX types. E.g. outerProduct(vec2, vec4) did not succeed because the matrix return types were wrong. The computing function seemed fine. I used https://en.wikipedia.org/wiki/Outer_product as reference on what the number of columns/rows ''should'' be and fixed it so that it matches the description from wikipedia Added: tests for outerProduct with unmatched vector dimensions (actually testing all combinations now) --- glm/detail/func_matrix.hpp | 12 ++++++------ test/core/core_func_matrix.cpp | 13 ++++++++++++- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/glm/detail/func_matrix.hpp b/glm/detail/func_matrix.hpp index 5a9cb11f..56d16d2b 100644 --- a/glm/detail/func_matrix.hpp +++ b/glm/detail/func_matrix.hpp @@ -72,19 +72,19 @@ namespace detail template struct outerProduct_trait { - typedef tmat2x3 type; + typedef tmat3x2 type; }; template struct outerProduct_trait { - typedef tmat2x4 type; + typedef tmat4x2 type; }; template struct outerProduct_trait { - typedef tmat3x2 type; + typedef tmat2x3 type; }; template @@ -96,19 +96,19 @@ namespace detail template struct outerProduct_trait { - typedef tmat3x4 type; + typedef tmat4x3 type; }; template struct outerProduct_trait { - typedef tmat4x2 type; + typedef tmat2x4 type; }; template struct outerProduct_trait { - typedef tmat4x3 type; + typedef tmat3x4 type; }; template diff --git a/test/core/core_func_matrix.cpp b/test/core/core_func_matrix.cpp index add5dfd9..80562e0f 100644 --- a/test/core/core_func_matrix.cpp +++ b/test/core/core_func_matrix.cpp @@ -101,7 +101,18 @@ int test_matrixCompMult() int test_outerProduct() { - glm::mat4 m = glm::outerProduct(glm::vec4(1.0f), glm::vec4(1.0f)); + { glm::mat2 m = glm::outerProduct(glm::vec2(1.0f), glm::vec2(1.0f)); } + { glm::mat3 m = glm::outerProduct(glm::vec3(1.0f), glm::vec3(1.0f)); } + { glm::mat4 m = glm::outerProduct(glm::vec4(1.0f), glm::vec4(1.0f)); } + + { glm::mat2x3 m = glm::outerProduct(glm::vec3(1.0f), glm::vec2(1.0f)); } + { glm::mat2x4 m = glm::outerProduct(glm::vec4(1.0f), glm::vec2(1.0f)); } + + { glm::mat3x2 m = glm::outerProduct(glm::vec2(1.0f), glm::vec3(1.0f)); } + { glm::mat3x4 m = glm::outerProduct(glm::vec4(1.0f), glm::vec3(1.0f)); } + + { glm::mat4x2 m = glm::outerProduct(glm::vec2(1.0f), glm::vec4(1.0f)); } + { glm::mat4x3 m = glm::outerProduct(glm::vec3(1.0f), glm::vec4(1.0f)); } return 0; } From 45d18796e3defd31e5851d34a0b248067cd63921 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 5 Mar 2016 23:58:38 +0100 Subject: [PATCH 066/110] merge 0.9.7 branch --- readme.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/readme.md b/readme.md index 151aaee4..caa17243 100644 --- a/readme.md +++ b/readme.md @@ -70,9 +70,6 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) - Fixed GTX_extended_min_max filename typo #386 - Fixed intersectRayTriangle to not do any unintentional backface culling - Fixed long long warnings when using C++98 on GCC and Clang #482 -- Fixed outerProduct defintions and operator signatures for mat2x4 and vec4 #475 -- Fixed eulerAngles precision error, returns NaN #461 #462 -- Fixed polar coordinates function latitude #485 #### [GLM 0.9.7.4](https://github.com/g-truc/glm/tree/0.9.7) - 2016-XX-XX ##### Fixes: From fe18a36c107f3d49ace74f7be3bd83b9e1a71fd7 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 6 Mar 2016 00:16:09 +0100 Subject: [PATCH 067/110] - Added right and left handed projection and clip control support #447 #119 --- glm/gtc/matrix_transform.inl | 10 ++++++++++ readme.md | 1 + 2 files changed, 11 insertions(+) diff --git a/glm/gtc/matrix_transform.inl b/glm/gtc/matrix_transform.inl index 2cd2645c..c79f822a 100644 --- a/glm/gtc/matrix_transform.inl +++ b/glm/gtc/matrix_transform.inl @@ -578,7 +578,12 @@ namespace glm tmp = proj * tmp; tmp /= tmp.w; +#ifdef GLM_DEPTH_ZERO_TO_ONE + tmp.x = tmp.x * T(0.5) + T(0.5); + tmp.y = tmp.y * T(0.5) + T(0.5); +#else tmp = tmp * T(0.5) + T(0.5); +#endif tmp[0] = tmp[0] * T(viewport[2]) + T(viewport[0]); tmp[1] = tmp[1] * T(viewport[3]) + T(viewport[1]); @@ -599,7 +604,12 @@ namespace glm tvec4 tmp = tvec4(win, T(1)); tmp.x = (tmp.x - T(viewport[0])) / T(viewport[2]); tmp.y = (tmp.y - T(viewport[1])) / T(viewport[3]); +#ifdef GLM_DEPTH_ZERO_TO_ONE + tmp.x = tmp.x * T(2) - T(1); + tmp.y = tmp.y * T(2) - T(1); +#else tmp = tmp * T(2) - T(1); +#endif tvec4 obj = Inverse * tmp; obj /= obj.w; diff --git a/readme.md b/readme.md index caa17243..dee3416b 100644 --- a/readme.md +++ b/readme.md @@ -53,6 +53,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) #### [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 #119 - Added compNormalize and compScale functions to GTX_component_wise - Added packF3x9_E1x5 and unpackF3x9_E1x5 to GTC_packing for RGB9E5 #416 - Added (un)packHalf to GTC_packing From 58f432b76d4ac20ed37986fc466dcaa9e735ace3 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 6 Mar 2016 00:18:05 +0100 Subject: [PATCH 068/110] Updated release note to mention #415 --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index dee3416b..dee81544 100644 --- a/readme.md +++ b/readme.md @@ -53,7 +53,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) #### [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 #119 +- Added right and left handed projection and clip control support #447 #415 #119 - Added compNormalize and compScale functions to GTX_component_wise - Added packF3x9_E1x5 and unpackF3x9_E1x5 to GTC_packing for RGB9E5 #416 - Added (un)packHalf to GTC_packing From ecfebe640f483b539938a8bca4dd6ec4280467fe Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 6 Mar 2016 02:13:45 +0100 Subject: [PATCH 069/110] Clean up to close model matrix decompose #227 --- glm/gtx/matrix_decompose.hpp | 1 + glm/gtx/matrix_decompose.inl | 36 ++++++++++++++---------------------- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/glm/gtx/matrix_decompose.hpp b/glm/gtx/matrix_decompose.hpp index e7fc83e2..e68ab498 100644 --- a/glm/gtx/matrix_decompose.hpp +++ b/glm/gtx/matrix_decompose.hpp @@ -45,6 +45,7 @@ #include "../mat4x4.hpp" #include "../vec3.hpp" #include "../vec4.hpp" +#include "../geometric.hpp" #include "../gtc/quaternion.hpp" #include "../gtc/matrix_transform.hpp" diff --git a/glm/gtx/matrix_decompose.inl b/glm/gtx/matrix_decompose.inl index dec79572..47986660 100644 --- a/glm/gtx/matrix_decompose.inl +++ b/glm/gtx/matrix_decompose.inl @@ -30,7 +30,8 @@ /// @author Christophe Riccio /////////////////////////////////////////////////////////////////////////////////// -namespace glm +namespace glm{ +namespace detail { /// Make a linear combination of two vectors and return the result. // result = (a * ascl) + (b * bscl) @@ -44,24 +45,15 @@ namespace glm } template - GLM_FUNC_QUALIFIER void v3Scale(tvec3 & v, T desiredLength) + GLM_FUNC_QUALIFIER tvec3 scale(tvec3 const& v, T desiredLength) { - T len = glm::length(v); - if(len != 0) - { - T l = desiredLength / len; - v[0] *= l; - v[1] *= l; - v[2] *= l; - } + return v * desiredLength / length(v); } +}//namespace detail - /** - * Matrix decompose - * http://www.opensource.apple.com/source/WebCore/WebCore-514/platform/graphics/transforms/TransformationMatrix.cpp - * Decomposes the mode matrix to translations,rotation scale components - * - */ + // Matrix decompose + // http://www.opensource.apple.com/source/WebCore/WebCore-514/platform/graphics/transforms/TransformationMatrix.cpp + // Decomposes the mode matrix to translations,rotation scale components template GLM_FUNC_QUALIFIER bool decompose(tmat4x4 const & ModelMatrix, tvec3 & Scale, tquat & Orientation, tvec3 & Translation, tvec3 & Skew, tvec4 & Perspective) @@ -131,26 +123,26 @@ namespace glm // Compute X scale factor and normalize first row. Scale.x = length(Row[0]);// v3Length(Row[0]); - v3Scale(Row[0], static_cast(1)); + Row[0] = detail::scale(Row[0], static_cast(1)); // Compute XY shear factor and make 2nd row orthogonal to 1st. Skew.z = dot(Row[0], Row[1]); - Row[1] = combine(Row[1], Row[0], static_cast(1), -Skew.z); + Row[1] = detail::combine(Row[1], Row[0], static_cast(1), -Skew.z); // Now, compute Y scale and normalize 2nd row. Scale.y = length(Row[1]); - v3Scale(Row[1], static_cast(1)); + Row[1] = detail::scale(Row[1], static_cast(1)); Skew.z /= Scale.y; // Compute XZ and YZ shears, orthogonalize 3rd row. Skew.y = glm::dot(Row[0], Row[2]); - Row[2] = combine(Row[2], Row[0], static_cast(1), -Skew.y); + Row[2] = detail::combine(Row[2], Row[0], static_cast(1), -Skew.y); Skew.x = glm::dot(Row[1], Row[2]); - Row[2] = combine(Row[2], Row[1], static_cast(1), -Skew.x); + Row[2] = detail::combine(Row[2], Row[1], static_cast(1), -Skew.x); // Next, get Z scale and normalize 3rd row. Scale.z = length(Row[2]); - v3Scale(Row[2], static_cast(1)); + Row[2] = detail::scale(Row[2], static_cast(1)); Skew.y /= Scale.z; Skew.x /= Scale.z; From a391bc1be61dcd1ee89542c376e2c3bc429f150c Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 6 Mar 2016 02:28:21 +0100 Subject: [PATCH 070/110] Clean up GTX_matrix_transform coding style --- glm/gtc/matrix_transform.inl | 289 ++++++++++++++++------------------- 1 file changed, 134 insertions(+), 155 deletions(-) diff --git a/glm/gtc/matrix_transform.inl b/glm/gtc/matrix_transform.inl index c79f822a..e8c13d6b 100644 --- a/glm/gtc/matrix_transform.inl +++ b/glm/gtc/matrix_transform.inl @@ -150,30 +150,24 @@ namespace glm template GLM_FUNC_QUALIFIER tmat4x4 ortho ( - T left, - T right, - T bottom, - T top, - T zNear, - T zFar + T left, T right, + T bottom, T top, + T zNear, T zFar ) { - #ifdef GLM_LEFT_HANDED +# ifdef GLM_LEFT_HANDED return orthoLH(left, right, bottom, top, zNear, zFar); - #else +# else return orthoRH(left, right, bottom, top, zNear, zFar); - #endif +# endif } template GLM_FUNC_QUALIFIER tmat4x4 orthoLH ( - T left, - T right, - T bottom, - T top, - T zNear, - T zFar + T left, T right, + T bottom, T top, + T zNear, T zFar ) { tmat4x4 Result(1); @@ -182,25 +176,23 @@ namespace glm Result[3][0] = - (right + left) / (right - left); Result[3][1] = - (top + bottom) / (top - bottom); -#ifdef GLM_DEPTH_ZERO_TO_ONE - Result[2][2] = static_cast(1) / (zFar - zNear); - Result[3][2] = - zNear / (zFar - zNear); -#else - Result[2][2] = static_cast(2) / (zFar - zNear); - Result[3][2] = - (zFar + zNear) / (zFar - zNear); -#endif +# ifdef GLM_DEPTH_ZERO_TO_ONE + Result[2][2] = static_cast(1) / (zFar - zNear); + Result[3][2] = - zNear / (zFar - zNear); +# else + Result[2][2] = static_cast(2) / (zFar - zNear); + Result[3][2] = - (zFar + zNear) / (zFar - zNear); +# endif + return Result; } template GLM_FUNC_QUALIFIER tmat4x4 orthoRH ( - T left, - T right, - T bottom, - T top, - T zNear, - T zFar + T left, T right, + T bottom, T top, + T zNear, T zFar ) { tmat4x4 Result(1); @@ -209,61 +201,54 @@ namespace glm Result[3][0] = - (right + left) / (right - left); Result[3][1] = - (top + bottom) / (top - bottom); -#ifdef GLM_DEPTH_ZERO_TO_ONE - Result[2][2] = - static_cast(1) / (zFar - zNear); - Result[3][2] = - zNear / (zFar - zNear); -#else - Result[2][2] = - static_cast(2) / (zFar - zNear); - Result[3][2] = - (zFar + zNear) / (zFar - zNear); -#endif +# ifdef GLM_DEPTH_ZERO_TO_ONE + Result[2][2] = - static_cast(1) / (zFar - zNear); + Result[3][2] = - zNear / (zFar - zNear); +# else + Result[2][2] = - static_cast(2) / (zFar - zNear); + Result[3][2] = - (zFar + zNear) / (zFar - zNear); +# endif + return Result; } template GLM_FUNC_QUALIFIER tmat4x4 ortho ( - T left, - T right, - T bottom, - T top + T left, T right, + T bottom, T top ) { - tmat4x4 Result(1); - Result[0][0] = static_cast(2) / (right - left); - Result[1][1] = static_cast(2) / (top - bottom); - Result[2][2] = - static_cast(1); - Result[3][0] = - (right + left) / (right - left); - Result[3][1] = - (top + bottom) / (top - bottom); - return Result; + tmat4x4 Result(1); + Result[0][0] = static_cast(2) / (right - left); + Result[1][1] = static_cast(2) / (top - bottom); + Result[2][2] = - static_cast(1); + Result[3][0] = - (right + left) / (right - left); + Result[3][1] = - (top + bottom) / (top - bottom); + return Result; } template GLM_FUNC_QUALIFIER tmat4x4 frustum ( - T left, - T right, - T bottom, - T top, - T nearVal, - T farVal + T left, T right, + T bottom, T top, + T nearVal, T farVal ) { -#ifdef GLM_LEFT_HANDED - return frustumLH(left, right, bottom, top, nearVal, farVal); -#else - return frustumRH(left, right, bottom, top, nearVal, farVal); -#endif +# ifdef GLM_LEFT_HANDED + return frustumLH(left, right, bottom, top, nearVal, farVal); +# else + return frustumRH(left, right, bottom, top, nearVal, farVal); +# endif } template GLM_FUNC_QUALIFIER tmat4x4 frustumLH ( - T left, - T right, - T bottom, - T top, - T nearVal, - T farVal + T left, T right, + T bottom, T top, + T nearVal, T farVal ) { tmat4x4 Result(0); @@ -273,25 +258,23 @@ namespace glm Result[2][1] = (top + bottom) / (top - bottom); Result[2][3] = static_cast(1); -#ifdef GLM_DEPTH_ZERO_TO_ONE - Result[2][2] = farVal / (farVal - nearVal); - Result[3][2] = -(farVal * nearVal) / (farVal - nearVal); -#else - Result[2][2] = (farVal + nearVal) / (farVal - nearVal); - Result[3][2] = - (static_cast(2) * farVal * nearVal) / (farVal - nearVal); -#endif +# ifdef GLM_DEPTH_ZERO_TO_ONE + Result[2][2] = farVal / (farVal - nearVal); + Result[3][2] = -(farVal * nearVal) / (farVal - nearVal); +# else + Result[2][2] = (farVal + nearVal) / (farVal - nearVal); + Result[3][2] = - (static_cast(2) * farVal * nearVal) / (farVal - nearVal); +# endif + return Result; } template GLM_FUNC_QUALIFIER tmat4x4 frustumRH ( - T left, - T right, - T bottom, - T top, - T nearVal, - T farVal + T left, T right, + T bottom, T top, + T nearVal, T farVal ) { tmat4x4 Result(0); @@ -301,13 +284,14 @@ namespace glm Result[2][1] = (top + bottom) / (top - bottom); Result[2][3] = static_cast(-1); -#ifdef GLM_DEPTH_ZERO_TO_ONE - Result[2][2] = farVal / (nearVal - farVal); - Result[3][2] = -(farVal * nearVal) / (farVal - nearVal); -#else - Result[2][2] = - (farVal + nearVal) / (farVal - nearVal); - Result[3][2] = - (static_cast(2) * farVal * nearVal) / (farVal - nearVal); -#endif +# ifdef GLM_DEPTH_ZERO_TO_ONE + Result[2][2] = farVal / (nearVal - farVal); + Result[3][2] = -(farVal * nearVal) / (farVal - nearVal); +# else + Result[2][2] = - (farVal + nearVal) / (farVal - nearVal); + Result[3][2] = - (static_cast(2) * farVal * nearVal) / (farVal - nearVal); +# endif + return Result; } @@ -320,11 +304,11 @@ namespace glm T zFar ) { - #ifdef GLM_LEFT_HANDED +# ifdef GLM_LEFT_HANDED return perspectiveLH(fovy, aspect, zNear, zFar); - #else +# else return perspectiveRH(fovy, aspect, zNear, zFar); - #endif +# endif } template @@ -332,8 +316,7 @@ namespace glm ( T fovy, T aspect, - T zNear, - T zFar + T zNear, T zFar ) { assert(abs(aspect - std::numeric_limits::epsilon()) > static_cast(0)); @@ -345,24 +328,24 @@ namespace glm Result[1][1] = static_cast(1) / (tanHalfFovy); Result[2][3] = - static_cast(1); -#ifdef GLM_DEPTH_ZERO_TO_ONE - Result[2][2] = zFar / (zNear - zFar); - Result[3][2] = -(zFar * zNear) / (zFar - zNear); -#else - Result[2][2] = - (zFar + zNear) / (zFar - zNear); - Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); -#endif +# ifdef GLM_DEPTH_ZERO_TO_ONE + Result[2][2] = zFar / (zNear - zFar); + Result[3][2] = -(zFar * zNear) / (zFar - zNear); +# else + Result[2][2] = - (zFar + zNear) / (zFar - zNear); + Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); +# endif + return Result; } template GLM_FUNC_QUALIFIER tmat4x4 perspectiveLH - ( + ( T fovy, T aspect, - T zNear, - T zFar - ) + T zNear, T zFar + ) { assert(abs(aspect - std::numeric_limits::epsilon()) > static_cast(0)); @@ -373,13 +356,14 @@ namespace glm Result[1][1] = static_cast(1) / (tanHalfFovy); Result[2][3] = static_cast(1); -#ifdef GLM_DEPTH_ZERO_TO_ONE - Result[2][2] = zFar / (zFar - zNear); - Result[3][2] = -(zFar * zNear) / (zFar - zNear); -#else - Result[2][2] = (zFar + zNear) / (zFar - zNear); - Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); -#endif +# ifdef GLM_DEPTH_ZERO_TO_ONE + Result[2][2] = zFar / (zFar - zNear); + Result[3][2] = -(zFar * zNear) / (zFar - zNear); +# else + Result[2][2] = (zFar + zNear) / (zFar - zNear); + Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); +# endif + return Result; } @@ -387,27 +371,23 @@ namespace glm GLM_FUNC_QUALIFIER tmat4x4 perspectiveFov ( T fov, - T width, - T height, - T zNear, - T zFar + T width, T height, + T zNear, T zFar ) { - #ifdef GLM_LEFT_HANDED +# ifdef GLM_LEFT_HANDED return perspectiveFovLH(fov, width, height, zNear, zFar); - #else +# else return perspectiveFovRH(fov, width, height, zNear, zFar); - #endif +# endif } template GLM_FUNC_QUALIFIER tmat4x4 perspectiveFovRH ( T fov, - T width, - T height, - T zNear, - T zFar + T width, T height, + T zNear, T zFar ) { assert(width > static_cast(0)); @@ -423,13 +403,14 @@ namespace glm Result[1][1] = h; Result[2][3] = - static_cast(1); -#ifdef GLM_DEPTH_ZERO_TO_ONE - Result[2][2] = zFar / (zNear - zFar); - Result[3][2] = -(zFar * zNear) / (zFar - zNear); -#else - Result[2][2] = - (zFar + zNear) / (zFar - zNear); - Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); -#endif +# ifdef GLM_DEPTH_ZERO_TO_ONE + Result[2][2] = zFar / (zNear - zFar); + Result[3][2] = -(zFar * zNear) / (zFar - zNear); +# else + Result[2][2] = - (zFar + zNear) / (zFar - zNear); + Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); +# endif + return Result; } @@ -437,10 +418,8 @@ namespace glm GLM_FUNC_QUALIFIER tmat4x4 perspectiveFovLH ( T fov, - T width, - T height, - T zNear, - T zFar + T width, T height, + T zNear, T zFar ) { assert(width > static_cast(0)); @@ -456,13 +435,13 @@ namespace glm Result[1][1] = h; Result[2][3] = static_cast(1); -#ifdef GLM_DEPTH_ZERO_TO_ONE - Result[2][2] = zFar / (zFar - zNear); - Result[3][2] = -(zFar * zNear) / (zFar - zNear); -#else - Result[2][2] = (zFar + zNear) / (zFar - zNear); - Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); -#endif +# ifdef GLM_DEPTH_ZERO_TO_ONE + Result[2][2] = zFar / (zFar - zNear); + Result[3][2] = -(zFar * zNear) / (zFar - zNear); +# else + Result[2][2] = (zFar + zNear) / (zFar - zNear); + Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); +# endif return Result; } @@ -475,11 +454,11 @@ namespace glm T zNear ) { -#ifdef GLM_LEFT_HANDED - return infinitePerspectiveLH(fovy, aspect, zNear); -#else - return infinitePerspectiveRH(fovy, aspect, zNear); -#endif +# ifdef GLM_LEFT_HANDED + return infinitePerspectiveLH(fovy, aspect, zNear); +# else + return infinitePerspectiveRH(fovy, aspect, zNear); +# endif } template @@ -578,12 +557,12 @@ namespace glm tmp = proj * tmp; tmp /= tmp.w; -#ifdef GLM_DEPTH_ZERO_TO_ONE - tmp.x = tmp.x * T(0.5) + T(0.5); - tmp.y = tmp.y * T(0.5) + T(0.5); -#else - tmp = tmp * T(0.5) + T(0.5); -#endif +# ifdef GLM_DEPTH_ZERO_TO_ONE + tmp.x = tmp.x * T(0.5) + T(0.5); + tmp.y = tmp.y * T(0.5) + T(0.5); +# else + tmp = tmp * T(0.5) + T(0.5); +# endif tmp[0] = tmp[0] * T(viewport[2]) + T(viewport[0]); tmp[1] = tmp[1] * T(viewport[3]) + T(viewport[1]); @@ -604,12 +583,12 @@ namespace glm tvec4 tmp = tvec4(win, T(1)); tmp.x = (tmp.x - T(viewport[0])) / T(viewport[2]); tmp.y = (tmp.y - T(viewport[1])) / T(viewport[3]); -#ifdef GLM_DEPTH_ZERO_TO_ONE - tmp.x = tmp.x * T(2) - T(1); - tmp.y = tmp.y * T(2) - T(1); -#else - tmp = tmp * T(2) - T(1); -#endif +# ifdef GLM_DEPTH_ZERO_TO_ONE + tmp.x = tmp.x * T(2) - T(1); + tmp.y = tmp.y * T(2) - T(1); +# else + tmp = tmp * T(2) - T(1); +# endif tvec4 obj = Inverse * tmp; obj /= obj.w; @@ -649,11 +628,11 @@ namespace glm tvec3 const & up ) { - #ifdef GLM_LEFT_HANDED +# ifdef GLM_LEFT_HANDED return lookAtLH(eye, center, up); - #else +# else return lookAtRH(eye, center, up); - #endif +# endif } template From f48fe286ad88f9ffd5c5e9f0d95a6cd1107ac40b Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 6 Mar 2016 03:36:20 +0100 Subject: [PATCH 071/110] Consolidate setup options in setup.hpp --- glm/detail/setup.hpp | 33 +++++++++++++++++++++++++++++++++ glm/gtc/matrix_transform.inl | 32 ++++++++++++++++---------------- 2 files changed, 49 insertions(+), 16 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index d815ea6e..27c96521 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -892,6 +892,39 @@ # endif #endif//GLM_MESSAGE +/////////////////////////////////////////////////////////////////////////////////// +// Clip control + +#ifdef GLM_DEPTH_ZERO_TO_ONE // Legacy 0.9.8 development +# error Define GLM_FORECE_DEPTH_ZERO_TO_ONE instead of GLM_DEPTH_ZERO_TO_ONE to use 0 to 1 clip space. +#endif + +#define GLM_DEPTH_ZERO_TO_ONE 0x00000001 +#define GLM_DEPTH_NEGATIVE_ONE_TO_ONE 0x00000002 + +#ifdef GLM_FORCE_DEPTH_ZERO_TO_ONE +# define GLM_DEPTH_CLIP_SPACE GLM_DEPTH_ZERO_TO_ONE +#else +# define GLM_DEPTH_CLIP_SPACE GLM_DEPTH_NEGATIVE_ONE_TO_ONE +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Coordinate system, define GLM_FORCE_LEFT_HANDED before including GLM +// to use left handed coordinate system by default. + +#ifdef GLM_LEFT_HANDED // Legacy 0.9.8 development +# error Define GLM_FORCE_LEFT_HANDED instead of GLM_LEFT_HANDED left handed coordinate system by default. +#endif + +#define GLM_LEFT_HANDED 0x00000001 // For DirectX, Metal, Vulkan +#define GLM_RIGHT_HANDED 0x00000002 // For OpenGL, default in GLM + +#ifdef GLM_FORCE_LEFT_HANDED +# define GLM_COORDINATE_SYSTEM GLM_LEFT_HANDED +#else +# define GLM_COORDINATE_SYSTEM GLM_RIGHT_HANDED +#endif + /////////////////////////////////////////////////////////////////////////////////// // Qualifiers diff --git a/glm/gtc/matrix_transform.inl b/glm/gtc/matrix_transform.inl index e8c13d6b..d8929c81 100644 --- a/glm/gtc/matrix_transform.inl +++ b/glm/gtc/matrix_transform.inl @@ -155,7 +155,7 @@ namespace glm T zNear, T zFar ) { -# ifdef GLM_LEFT_HANDED +# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED return orthoLH(left, right, bottom, top, zNear, zFar); # else return orthoRH(left, right, bottom, top, zNear, zFar); @@ -176,7 +176,7 @@ namespace glm Result[3][0] = - (right + left) / (right - left); Result[3][1] = - (top + bottom) / (top - bottom); -# ifdef GLM_DEPTH_ZERO_TO_ONE +# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE Result[2][2] = static_cast(1) / (zFar - zNear); Result[3][2] = - zNear / (zFar - zNear); # else @@ -201,7 +201,7 @@ namespace glm Result[3][0] = - (right + left) / (right - left); Result[3][1] = - (top + bottom) / (top - bottom); -# ifdef GLM_DEPTH_ZERO_TO_ONE +# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE Result[2][2] = - static_cast(1) / (zFar - zNear); Result[3][2] = - zNear / (zFar - zNear); # else @@ -236,7 +236,7 @@ namespace glm T nearVal, T farVal ) { -# ifdef GLM_LEFT_HANDED +# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED return frustumLH(left, right, bottom, top, nearVal, farVal); # else return frustumRH(left, right, bottom, top, nearVal, farVal); @@ -258,7 +258,7 @@ namespace glm Result[2][1] = (top + bottom) / (top - bottom); Result[2][3] = static_cast(1); -# ifdef GLM_DEPTH_ZERO_TO_ONE +# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE Result[2][2] = farVal / (farVal - nearVal); Result[3][2] = -(farVal * nearVal) / (farVal - nearVal); # else @@ -284,7 +284,7 @@ namespace glm Result[2][1] = (top + bottom) / (top - bottom); Result[2][3] = static_cast(-1); -# ifdef GLM_DEPTH_ZERO_TO_ONE +# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE Result[2][2] = farVal / (nearVal - farVal); Result[3][2] = -(farVal * nearVal) / (farVal - nearVal); # else @@ -304,7 +304,7 @@ namespace glm T zFar ) { -# ifdef GLM_LEFT_HANDED +# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED return perspectiveLH(fovy, aspect, zNear, zFar); # else return perspectiveRH(fovy, aspect, zNear, zFar); @@ -328,7 +328,7 @@ namespace glm Result[1][1] = static_cast(1) / (tanHalfFovy); Result[2][3] = - static_cast(1); -# ifdef GLM_DEPTH_ZERO_TO_ONE +# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE Result[2][2] = zFar / (zNear - zFar); Result[3][2] = -(zFar * zNear) / (zFar - zNear); # else @@ -356,7 +356,7 @@ namespace glm Result[1][1] = static_cast(1) / (tanHalfFovy); Result[2][3] = static_cast(1); -# ifdef GLM_DEPTH_ZERO_TO_ONE +# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE Result[2][2] = zFar / (zFar - zNear); Result[3][2] = -(zFar * zNear) / (zFar - zNear); # else @@ -375,7 +375,7 @@ namespace glm T zNear, T zFar ) { -# ifdef GLM_LEFT_HANDED +# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED return perspectiveFovLH(fov, width, height, zNear, zFar); # else return perspectiveFovRH(fov, width, height, zNear, zFar); @@ -403,7 +403,7 @@ namespace glm Result[1][1] = h; Result[2][3] = - static_cast(1); -# ifdef GLM_DEPTH_ZERO_TO_ONE +# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE Result[2][2] = zFar / (zNear - zFar); Result[3][2] = -(zFar * zNear) / (zFar - zNear); # else @@ -435,7 +435,7 @@ namespace glm Result[1][1] = h; Result[2][3] = static_cast(1); -# ifdef GLM_DEPTH_ZERO_TO_ONE +# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE Result[2][2] = zFar / (zFar - zNear); Result[3][2] = -(zFar * zNear) / (zFar - zNear); # else @@ -454,7 +454,7 @@ namespace glm T zNear ) { -# ifdef GLM_LEFT_HANDED +# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED return infinitePerspectiveLH(fovy, aspect, zNear); # else return infinitePerspectiveRH(fovy, aspect, zNear); @@ -557,7 +557,7 @@ namespace glm tmp = proj * tmp; tmp /= tmp.w; -# ifdef GLM_DEPTH_ZERO_TO_ONE +# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE tmp.x = tmp.x * T(0.5) + T(0.5); tmp.y = tmp.y * T(0.5) + T(0.5); # else @@ -583,7 +583,7 @@ namespace glm tvec4 tmp = tvec4(win, T(1)); tmp.x = (tmp.x - T(viewport[0])) / T(viewport[2]); tmp.y = (tmp.y - T(viewport[1])) / T(viewport[3]); -# ifdef GLM_DEPTH_ZERO_TO_ONE +# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE tmp.x = tmp.x * T(2) - T(1); tmp.y = tmp.y * T(2) - T(1); # else @@ -628,7 +628,7 @@ namespace glm tvec3 const & up ) { -# ifdef GLM_LEFT_HANDED +# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED return lookAtLH(eye, center, up); # else return lookAtRH(eye, center, up); From 6e5f42bd289dd9dc8007f9e32b4ec4efb92b6c37 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 6 Mar 2016 12:52:34 +0100 Subject: [PATCH 072/110] Fixed error message type --- glm/detail/setup.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 27c96521..6182f62b 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -896,7 +896,7 @@ // Clip control #ifdef GLM_DEPTH_ZERO_TO_ONE // Legacy 0.9.8 development -# error Define GLM_FORECE_DEPTH_ZERO_TO_ONE instead of GLM_DEPTH_ZERO_TO_ONE to use 0 to 1 clip space. +# error Define GLM_FORCE_DEPTH_ZERO_TO_ONE instead of GLM_DEPTH_ZERO_TO_ONE to use 0 to 1 clip space. #endif #define GLM_DEPTH_ZERO_TO_ONE 0x00000001 From c853df16382c5d427697a4725e5ee2c372fbc66a Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 10 Mar 2016 21:17:46 +0100 Subject: [PATCH 073/110] Added uround to GTC_integer, fast round on positive values --- glm/gtc/integer.hpp | 13 +++++++++++++ glm/gtc/integer.inl | 18 ++++++++++++++++++ readme.md | 1 + test/core/core_func_common.cpp | 2 +- test/gtc/gtc_integer.cpp | 19 +++++++++++++++++++ 5 files changed, 52 insertions(+), 1 deletion(-) diff --git a/glm/gtc/integer.hpp b/glm/gtc/integer.hpp index 96c19348..ef0df86e 100644 --- a/glm/gtc/integer.hpp +++ b/glm/gtc/integer.hpp @@ -99,6 +99,19 @@ namespace glm template class vecType> GLM_FUNC_DECL vecType mod(vecType const & x, vecType const & y); + /// Returns a value equal to the nearest integer to x. + /// The fraction 0.5 will round in a direction chosen by the + /// implementation, presumably the direction that is fastest. + /// + /// @param x The values of the argument must be greater or equal to zero. + /// @tparam T floating point scalar types. + /// @tparam vecType vector types. + /// + /// @see GLSL round man page + /// @see gtc_integer + template class vecType> + GLM_FUNC_DECL vecType uround(vecType const & x); + /// @} } //namespace glm diff --git a/glm/gtc/integer.inl b/glm/gtc/integer.inl index 8ddf1238..d57f906e 100644 --- a/glm/gtc/integer.inl +++ b/glm/gtc/integer.inl @@ -62,4 +62,22 @@ namespace detail }; # endif//GLM_HAS_BITSCAN_WINDOWS }//namespace detail + + template + GLM_FUNC_QUALIFIER uint uround(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'round' only accept floating-point inputs"); + assert(static_cast(0.0) <= x); + + return static_cast(x + static_cast(0.5)); + } + + template class vecType> + GLM_FUNC_QUALIFIER vecType uround(vecType const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'uround' only accept floating-point inputs"); + assert(all(lessThanEqual(vecType(0), x))); + + return vecType(x + static_cast(0.5)); + } }//namespace glm diff --git a/readme.md b/readme.md index dee81544..d842fb7e 100644 --- a/readme.md +++ b/readme.md @@ -61,6 +61,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) - Added 16bit pack and unpack to GTC_packing - Added 8bit pack and unpack to GTC_packing - Added missing bvec* && and || operators +- Added uround to GTC_integer, fast round on positive values ##### Improvements: - Improved GTC_random linearRand documentation diff --git a/test/core/core_func_common.cpp b/test/core/core_func_common.cpp index a610dd51..ed6cb2df 100644 --- a/test/core/core_func_common.cpp +++ b/test/core/core_func_common.cpp @@ -599,7 +599,7 @@ namespace round_ int test() { int Error = 0; - + { float A = glm::round(0.0f); Error += A == 0.0f ? 0 : 1; diff --git a/test/gtc/gtc_integer.cpp b/test/gtc/gtc_integer.cpp index 40832822..98614780 100644 --- a/test/gtc/gtc_integer.cpp +++ b/test/gtc/gtc_integer.cpp @@ -210,11 +210,30 @@ namespace log2_ } }//namespace log2_ +namespace uround +{ + int test() + { + int Error = 0; + + for(float f = 0.0f; f < 3.1f; f += 0.05f) + { + int RoundFast = glm::uround(f); + int RoundSTD = std::round(f); + Error += RoundFast == RoundSTD ? 0 : 1; + assert(!Error); + } + + return Error; + } +}//namespace uround + int main() { int Error(0); Error += ::log2_::test(); + Error += ::uround::test(); # ifdef NDEBUG std::size_t const Samples(1000); From 52d05aee76d836dae57611193645448853146275 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 10 Mar 2016 21:24:37 +0100 Subject: [PATCH 074/110] Fixed build --- test/gtc/gtc_integer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/gtc/gtc_integer.cpp b/test/gtc/gtc_integer.cpp index 98614780..36bfc44e 100644 --- a/test/gtc/gtc_integer.cpp +++ b/test/gtc/gtc_integer.cpp @@ -219,7 +219,7 @@ namespace uround for(float f = 0.0f; f < 3.1f; f += 0.05f) { int RoundFast = glm::uround(f); - int RoundSTD = std::round(f); + int RoundSTD = glm::round(f); Error += RoundFast == RoundSTD ? 0 : 1; assert(!Error); } From 86c58b8b8be2dd967f3311078d911d3382be41cf Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 10 Mar 2016 21:53:08 +0100 Subject: [PATCH 075/110] Added iround and uround to GTC_integer, fast round on positive values --- glm/gtc/integer.hpp | 13 +++++++++++++ glm/gtc/integer.inl | 19 ++++++++++++++++++- readme.md | 2 +- test/gtc/gtc_integer.cpp | 19 +++++++++++++++++++ 4 files changed, 51 insertions(+), 2 deletions(-) diff --git a/glm/gtc/integer.hpp b/glm/gtc/integer.hpp index ef0df86e..714e4c5a 100644 --- a/glm/gtc/integer.hpp +++ b/glm/gtc/integer.hpp @@ -99,6 +99,19 @@ namespace glm template class vecType> GLM_FUNC_DECL vecType mod(vecType const & x, vecType const & y); + /// Returns a value equal to the nearest integer to x. + /// The fraction 0.5 will round in a direction chosen by the + /// implementation, presumably the direction that is fastest. + /// + /// @param x The values of the argument must be greater or equal to zero. + /// @tparam T floating point scalar types. + /// @tparam vecType vector types. + /// + /// @see GLSL round man page + /// @see gtc_integer + template class vecType> + GLM_FUNC_DECL vecType iround(vecType const & x); + /// Returns a value equal to the nearest integer to x. /// The fraction 0.5 will round in a direction chosen by the /// implementation, presumably the direction that is fastest. diff --git a/glm/gtc/integer.inl b/glm/gtc/integer.inl index d57f906e..2c4d7c40 100644 --- a/glm/gtc/integer.inl +++ b/glm/gtc/integer.inl @@ -62,11 +62,28 @@ namespace detail }; # endif//GLM_HAS_BITSCAN_WINDOWS }//namespace detail + template + GLM_FUNC_QUALIFIER int iround(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'iround' only accept floating-point inputs"); + assert(static_cast(0.0) <= x); + + return static_cast(x + static_cast(0.5)); + } + + template class vecType> + GLM_FUNC_QUALIFIER vecType iround(vecType const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'iround' only accept floating-point inputs"); + assert(all(lessThanEqual(vecType(0), x))); + + return vecType(x + static_cast(0.5)); + } template GLM_FUNC_QUALIFIER uint uround(genType x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'round' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'uround' only accept floating-point inputs"); assert(static_cast(0.0) <= x); return static_cast(x + static_cast(0.5)); diff --git a/readme.md b/readme.md index d842fb7e..78c40184 100644 --- a/readme.md +++ b/readme.md @@ -61,7 +61,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) - Added 16bit pack and unpack to GTC_packing - Added 8bit pack and unpack to GTC_packing - Added missing bvec* && and || operators -- Added uround to GTC_integer, fast round on positive values +- Added iround and uround to GTC_integer, fast round on positive values ##### Improvements: - Improved GTC_random linearRand documentation diff --git a/test/gtc/gtc_integer.cpp b/test/gtc/gtc_integer.cpp index 36bfc44e..4c320b0d 100644 --- a/test/gtc/gtc_integer.cpp +++ b/test/gtc/gtc_integer.cpp @@ -210,6 +210,24 @@ namespace log2_ } }//namespace log2_ +namespace iround +{ + int test() + { + int Error = 0; + + for(float f = 0.0f; f < 3.1f; f += 0.05f) + { + int RoundFast = glm::iround(f); + int RoundSTD = glm::round(f); + Error += RoundFast == RoundSTD ? 0 : 1; + assert(!Error); + } + + return Error; + } +}//namespace iround + namespace uround { int test() @@ -233,6 +251,7 @@ int main() int Error(0); Error += ::log2_::test(); + Error += ::iround::test(); Error += ::uround::test(); # ifdef NDEBUG From b14e39b4cf063b0b50d84fc2b5d713a932eea85c Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 12 Mar 2016 01:32:40 +0100 Subject: [PATCH 076/110] Added target to build optional static and dynamic GLM library --- CMakeLists.txt | 10 ++++++++++ glm/CMakeLists.txt | 17 +++++++++++++++-- glm/detail/dummy.cpp | 11 +++++++---- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fd10009e..f9fc72b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,16 @@ enable_testing() add_definitions(-D_CRT_SECURE_NO_WARNINGS) +option(GLM_STATIC_LIBRARY_ENABLE "GLM static library" OFF) +if(NOT 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) + 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() + option(GLM_TEST_ENABLE "GLM test" OFF) if(NOT GLM_TEST_ENABLE) message(STATUS "GLM is a header only library, no need to build it. Set the option GLM_TEST_ENABLE with ON to build and run the test bench") diff --git a/glm/CMakeLists.txt b/glm/CMakeLists.txt index 8f2f552e..66f81067 100644 --- a/glm/CMakeLists.txt +++ b/glm/CMakeLists.txt @@ -40,5 +40,18 @@ if(GLM_TEST_ENABLE) ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}) endif(GLM_TEST_ENABLE) -#add_library(glm STATIC glm.cpp) -#add_library(glm_shared SHARED glm.cpp) +if(GLM_STATIC_LIBRARY_ENABLE) + add_library(glm_static STATIC ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT} + ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} + ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} + ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} + ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}) +endif(GLM_STATIC_LIBRARY_ENABLE) + +if(GLM_DYNAMIC_LIBRARY_ENABLE) + add_library(glm_shared SHARED ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT} + ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} + ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} + ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} + ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}) +endif(GLM_DYNAMIC_LIBRARY_ENABLE) diff --git a/glm/detail/dummy.cpp b/glm/detail/dummy.cpp index 09a2ae59..4da61968 100644 --- a/glm/detail/dummy.cpp +++ b/glm/detail/dummy.cpp @@ -32,7 +32,7 @@ /// GLM is a header only library. There is nothing to compile. /// dummy.cpp exist only a wordaround for CMake file. /////////////////////////////////////////////////////////////////////////////////// - +/* #define GLM_MESSAGES #include #include @@ -149,6 +149,8 @@ struct intersection glm::vec4 position; glm::vec3 normal; }; +*/ + /* // Sample 4 @@ -191,7 +193,7 @@ glm::vec3 lighting } */ - +/* template class vecType> T normalizeDotA(vecType const & x, vecType const & y) { @@ -211,9 +213,10 @@ typename vecType::value_type normalizeDotC(vecType const & a, vecType const & b) { return glm::dot(a, b) * glm::inversesqrt(glm::dot(a, a) * glm::dot(b, b)); } - +*/ int main() { +/* glm::vec1 o(1); glm::vec2 a(1); glm::vec3 b(1); @@ -227,6 +230,6 @@ int main() float a0 = normalizeDotA(a, a); float b0 = normalizeDotB(b, b); float c0 = normalizeDotC(c, c); - +*/ return 0; } From 5222e0baca05bc5bd74030d54b9a3ec5d10da31c Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Sat, 12 Mar 2016 18:30:07 +0200 Subject: [PATCH 077/110] Remove duplicate function declarations --- glm/detail/type_vec2.hpp | 3 --- glm/detail/type_vec4.hpp | 6 ------ 2 files changed, 9 deletions(-) diff --git a/glm/detail/type_vec2.hpp b/glm/detail/type_vec2.hpp index 13c5d05f..1af3e31a 100644 --- a/glm/detail/type_vec2.hpp +++ b/glm/detail/type_vec2.hpp @@ -305,9 +305,6 @@ namespace glm template GLM_FUNC_DECL tvec2 operator/(tvec2 const & v1, tvec2 const & v2); - template - GLM_FUNC_DECL tvec2 operator-(tvec2 const & v); - template GLM_FUNC_DECL tvec2 operator%(tvec2 const & v, T const & scalar); diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index fe7235ac..d290631b 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -438,12 +438,6 @@ namespace detail template GLM_FUNC_DECL tvec4 operator/(tvec4 const & v1, tvec4 const & v2); - template - GLM_FUNC_DECL bool operator==(tvec4 const & v1, tvec4 const & v2); - - template - GLM_FUNC_DECL bool operator!=(tvec4 const & v1, tvec4 const & v2); - template GLM_FUNC_DECL tvec4 operator%(tvec4 const & v, T scalar); From 780d5f403b1da864ab46fb363f78d2124c5e5c9b Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Sat, 12 Mar 2016 18:31:43 +0200 Subject: [PATCH 078/110] Fix incorrect declaration (now matches definition) --- glm/detail/type_mat4x2.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/glm/detail/type_mat4x2.hpp b/glm/detail/type_mat4x2.hpp index a52675b8..bd71e121 100644 --- a/glm/detail/type_mat4x2.hpp +++ b/glm/detail/type_mat4x2.hpp @@ -197,15 +197,15 @@ namespace glm template GLM_FUNC_DECL typename tmat4x2::row_type operator*(typename tmat4x2::col_type const & v, tmat4x2 const & m); + template + GLM_FUNC_DECL tmat2x2 operator*(tmat4x2 const & m1, tmat2x4 const & m2); + template GLM_FUNC_DECL tmat3x2 operator*(tmat4x2 const & m1, tmat3x4 const & m2); template GLM_FUNC_DECL tmat4x2 operator*(tmat4x2 const & m1, tmat4x4 const & m2); - template - GLM_FUNC_DECL tmat2x3 operator*(tmat4x3 const & m1, tmat2x4 const & m2); - template GLM_FUNC_DECL tmat4x2 operator/(tmat4x2 const & m, T const & s); From 3860fbaa9ae38560ed12de253c47819eba03389c Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Sat, 12 Mar 2016 18:34:40 +0200 Subject: [PATCH 079/110] Add missing vec4 operator definitions Also rename the parameters to match similar functions in other vector classes. --- glm/detail/type_vec4.hpp | 12 ++++---- glm/detail/type_vec4.inl | 60 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 6 deletions(-) diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index d290631b..86156e5f 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -382,13 +382,13 @@ namespace detail GLM_FUNC_DECL tvec4 operator+(tvec4 const & v, const T& scalar); template - GLM_FUNC_DECL tvec4 operator+(tvec4 const & v, tvec1 const & scalar); + GLM_FUNC_DECL tvec4 operator+(tvec4 const & v1, tvec1 const & v2); template GLM_FUNC_DECL tvec4 operator+(T scalar, tvec4 const & v); template - GLM_FUNC_DECL tvec4 operator+(tvec1 const & scalar, tvec4 const & v); + GLM_FUNC_DECL tvec4 operator+(tvec1 const & v1, tvec4 const & v2); template GLM_FUNC_DECL tvec4 operator+(tvec4 const & v1, tvec4 const & v2); @@ -397,13 +397,13 @@ namespace detail GLM_FUNC_DECL tvec4 operator-(tvec4 const & v, const T& scalar); template - GLM_FUNC_DECL tvec4 operator-(tvec4 const & v, tvec1 const & scalar); + GLM_FUNC_DECL tvec4 operator-(tvec4 const & v1, tvec1 const & v2); template GLM_FUNC_DECL tvec4 operator-(T scalar, tvec4 const & v); template - GLM_FUNC_DECL tvec4 operator-(tvec1 const & scalar, tvec4 const & v); + GLM_FUNC_DECL tvec4 operator-(tvec1 const & v1, tvec4 const & v2); template GLM_FUNC_DECL tvec4 operator-(tvec4 const & v1, tvec4 const & v2); @@ -412,13 +412,13 @@ namespace detail GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, const T& scalar); template - GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, tvec1 const & scalar); + GLM_FUNC_DECL tvec4 operator*(tvec4 const & v1, tvec1 const & v2); template GLM_FUNC_DECL tvec4 operator*(T scalar, tvec4 const & v); template - GLM_FUNC_DECL tvec4 operator*(tvec1 const & scalar, tvec4 const & v); + GLM_FUNC_DECL tvec4 operator*(tvec1 const & v1, tvec4 const & v2); template GLM_FUNC_DECL tvec4 operator*(tvec4 const & v1, tvec4 const & v2); diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index 6712ce33..f8d30b57 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -739,6 +739,16 @@ namespace glm v.w + scalar); } + template + GLM_FUNC_QUALIFIER tvec4 operator+(tvec4 const & v1, tvec1 const & v2) + { + return tvec4( + v1.x + v2.x, + v1.y + v2.x, + v1.z + v2.x, + v1.w + v2.x); + } + template GLM_FUNC_QUALIFIER tvec4 operator+(T scalar, tvec4 const & v) { @@ -749,6 +759,16 @@ namespace glm scalar + v.w); } + template + GLM_FUNC_QUALIFIER tvec4 operator+(tvec1 const & v1, tvec4 const & v2) + { + return tvec4( + v1.x + v2.x, + v1.x + v2.y, + v1.x + v2.z, + v1.x + v2.w); + } + template GLM_FUNC_QUALIFIER tvec4 operator+(tvec4 const & v1, tvec4 const & v2) { @@ -769,6 +789,16 @@ namespace glm v.w - scalar); } + template + GLM_FUNC_QUALIFIER tvec4 operator-(tvec4 const & v1, tvec1 const & v2) + { + return tvec4( + v1.x - v2.x, + v1.y - v2.x, + v1.z - v2.x, + v1.w - v2.x); + } + template GLM_FUNC_QUALIFIER tvec4 operator-(T scalar, tvec4 const & v) { @@ -779,6 +809,16 @@ namespace glm scalar - v.w); } + template + GLM_FUNC_DECL tvec4 operator-(tvec1 const & v1, tvec4 const & v2) + { + return tvec4( + v1.x - v2.x, + v1.x - v2.y, + v1.x - v2.z, + v1.x - v2.w); + } + template GLM_FUNC_QUALIFIER tvec4 operator-(tvec4 const & v1, tvec4 const & v2) { @@ -799,6 +839,16 @@ namespace glm v.w * scalar); } + template + GLM_FUNC_QUALIFIER tvec4 operator*(tvec4 const & v1, tvec1 const & v2) + { + return tvec4( + v1.x * v2.x, + v1.y * v2.x, + v1.z * v2.x, + v1.w * v2.x); + } + template GLM_FUNC_QUALIFIER tvec4 operator*(T scalar, tvec4 const & v) { @@ -809,6 +859,16 @@ namespace glm scalar * v.w); } + template + GLM_FUNC_DECL tvec4 operator*(tvec1 const & v1, tvec4 const & v2) + { + return tvec4( + v1.x * v2.x, + v1.x * v2.y, + v1.x * v2.z, + v1.x * v2.w); + } + template GLM_FUNC_QUALIFIER tvec4 operator*(tvec4 const & v1, tvec4 const & v2) { From a848fa69be8dc46a9516203de0c2f6c88700d5df Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Sat, 12 Mar 2016 18:30:07 +0200 Subject: [PATCH 080/110] Remove duplicate function declarations --- glm/detail/type_vec2.hpp | 3 --- glm/detail/type_vec4.hpp | 6 ------ 2 files changed, 9 deletions(-) diff --git a/glm/detail/type_vec2.hpp b/glm/detail/type_vec2.hpp index 76029f49..24e9a846 100644 --- a/glm/detail/type_vec2.hpp +++ b/glm/detail/type_vec2.hpp @@ -298,9 +298,6 @@ namespace glm template GLM_FUNC_DECL tvec2 operator/(tvec2 const & v1, tvec2 const & v2); - template - GLM_FUNC_DECL tvec2 operator-(tvec2 const & v); - template GLM_FUNC_DECL tvec2 operator%(tvec2 const & v, T const & scalar); diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index e941b766..84d4f0b6 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -419,12 +419,6 @@ namespace detail template GLM_FUNC_DECL tvec4 operator/(tvec4 const & v1, tvec4 const & v2); - template - GLM_FUNC_DECL bool operator==(tvec4 const & v1, tvec4 const & v2); - - template - GLM_FUNC_DECL bool operator!=(tvec4 const & v1, tvec4 const & v2); - template GLM_FUNC_DECL tvec4 operator%(tvec4 const & v, T scalar); From 3ec43e9522083cf2eed2edec3f3fb48df93c2d1c Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Sat, 12 Mar 2016 18:31:43 +0200 Subject: [PATCH 081/110] Fix incorrect declaration (now matches definition) --- glm/detail/type_mat4x2.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/glm/detail/type_mat4x2.hpp b/glm/detail/type_mat4x2.hpp index 62cd7aed..43db6ef6 100644 --- a/glm/detail/type_mat4x2.hpp +++ b/glm/detail/type_mat4x2.hpp @@ -192,15 +192,15 @@ namespace glm template GLM_FUNC_DECL typename tmat4x2::row_type operator*(typename tmat4x2::col_type const & v, tmat4x2 const & m); + template + GLM_FUNC_DECL tmat2x2 operator*(tmat4x2 const & m1, tmat2x4 const & m2); + template GLM_FUNC_DECL tmat3x2 operator*(tmat4x2 const & m1, tmat3x4 const & m2); template GLM_FUNC_DECL tmat4x2 operator*(tmat4x2 const & m1, tmat4x4 const & m2); - template - GLM_FUNC_DECL tmat2x3 operator*(tmat4x3 const & m1, tmat2x4 const & m2); - template GLM_FUNC_DECL tmat4x2 operator/(tmat4x2 const & m, T const & s); From e60273daff68d7a0d66d329bcdc1d1f7c8fff155 Mon Sep 17 00:00:00 2001 From: Sami Kankaristo Date: Sat, 12 Mar 2016 18:34:40 +0200 Subject: [PATCH 082/110] Add missing vec4 operator definitions Also rename the parameters to match similar functions in other vector classes. --- glm/detail/type_vec4.hpp | 12 ++++---- glm/detail/type_vec4.inl | 60 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 6 deletions(-) diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index 84d4f0b6..37ae9a7c 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -363,13 +363,13 @@ namespace detail GLM_FUNC_DECL tvec4 operator+(tvec4 const & v, const T& scalar); template - GLM_FUNC_DECL tvec4 operator+(tvec4 const & v, tvec1 const & scalar); + GLM_FUNC_DECL tvec4 operator+(tvec4 const & v1, tvec1 const & v2); template GLM_FUNC_DECL tvec4 operator+(T scalar, tvec4 const & v); template - GLM_FUNC_DECL tvec4 operator+(tvec1 const & scalar, tvec4 const & v); + GLM_FUNC_DECL tvec4 operator+(tvec1 const & v1, tvec4 const & v2); template GLM_FUNC_DECL tvec4 operator+(tvec4 const & v1, tvec4 const & v2); @@ -378,13 +378,13 @@ namespace detail GLM_FUNC_DECL tvec4 operator-(tvec4 const & v, const T& scalar); template - GLM_FUNC_DECL tvec4 operator-(tvec4 const & v, tvec1 const & scalar); + GLM_FUNC_DECL tvec4 operator-(tvec4 const & v1, tvec1 const & v2); template GLM_FUNC_DECL tvec4 operator-(T scalar, tvec4 const & v); template - GLM_FUNC_DECL tvec4 operator-(tvec1 const & scalar, tvec4 const & v); + GLM_FUNC_DECL tvec4 operator-(tvec1 const & v1, tvec4 const & v2); template GLM_FUNC_DECL tvec4 operator-(tvec4 const & v1, tvec4 const & v2); @@ -393,13 +393,13 @@ namespace detail GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, const T& scalar); template - GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, tvec1 const & scalar); + GLM_FUNC_DECL tvec4 operator*(tvec4 const & v1, tvec1 const & v2); template GLM_FUNC_DECL tvec4 operator*(T scalar, tvec4 const & v); template - GLM_FUNC_DECL tvec4 operator*(tvec1 const & scalar, tvec4 const & v); + GLM_FUNC_DECL tvec4 operator*(tvec1 const & v1, tvec4 const & v2); template GLM_FUNC_DECL tvec4 operator*(tvec4 const & v1, tvec4 const & v2); diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index 5927d99e..514161ea 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -673,6 +673,16 @@ namespace glm v.w + scalar); } + template + GLM_FUNC_QUALIFIER tvec4 operator+(tvec4 const & v1, tvec1 const & v2) + { + return tvec4( + v1.x + v2.x, + v1.y + v2.x, + v1.z + v2.x, + v1.w + v2.x); + } + template GLM_FUNC_QUALIFIER tvec4 operator+(T scalar, tvec4 const & v) { @@ -683,6 +693,16 @@ namespace glm scalar + v.w); } + template + GLM_FUNC_QUALIFIER tvec4 operator+(tvec1 const & v1, tvec4 const & v2) + { + return tvec4( + v1.x + v2.x, + v1.x + v2.y, + v1.x + v2.z, + v1.x + v2.w); + } + template GLM_FUNC_QUALIFIER tvec4 operator+(tvec4 const & v1, tvec4 const & v2) { @@ -703,6 +723,16 @@ namespace glm v.w - scalar); } + template + GLM_FUNC_QUALIFIER tvec4 operator-(tvec4 const & v1, tvec1 const & v2) + { + return tvec4( + v1.x - v2.x, + v1.y - v2.x, + v1.z - v2.x, + v1.w - v2.x); + } + template GLM_FUNC_QUALIFIER tvec4 operator-(T scalar, tvec4 const & v) { @@ -713,6 +743,16 @@ namespace glm scalar - v.w); } + template + GLM_FUNC_DECL tvec4 operator-(tvec1 const & v1, tvec4 const & v2) + { + return tvec4( + v1.x - v2.x, + v1.x - v2.y, + v1.x - v2.z, + v1.x - v2.w); + } + template GLM_FUNC_QUALIFIER tvec4 operator-(tvec4 const & v1, tvec4 const & v2) { @@ -733,6 +773,16 @@ namespace glm v.w * scalar); } + template + GLM_FUNC_QUALIFIER tvec4 operator*(tvec4 const & v1, tvec1 const & v2) + { + return tvec4( + v1.x * v2.x, + v1.y * v2.x, + v1.z * v2.x, + v1.w * v2.x); + } + template GLM_FUNC_QUALIFIER tvec4 operator*(T scalar, tvec4 const & v) { @@ -743,6 +793,16 @@ namespace glm scalar * v.w); } + template + GLM_FUNC_DECL tvec4 operator*(tvec1 const & v1, tvec4 const & v2) + { + return tvec4( + v1.x * v2.x, + v1.x * v2.y, + v1.x * v2.z, + v1.x * v2.w); + } + template GLM_FUNC_QUALIFIER tvec4 operator*(tvec4 const & v1, tvec4 const & v2) { From 444cf0f36aadafaa2e66267bb1608bb9e20d5b02 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 12 Mar 2016 20:35:06 +0100 Subject: [PATCH 083/110] Fixed undefined reference errors #489 --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index f464a4a3..e637bc4b 100644 --- a/readme.md +++ b/readme.md @@ -57,6 +57,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) - Fixed polar coordinates function latitude #485 - Fixed outerProduct defintions and operator signatures for mat2x4 and vec4 #475 - Fixed eulerAngles precision error, returns NaN #451 +- Fixed undefined reference errors #489 #### [GLM 0.9.7.3](https://github.com/g-truc/glm/releases/tag/0.9.7.3) - 2016-02-21 ##### Improvements: From 234d7d4ba9fccc76d60439637a170e97f0690fbd Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 13 Mar 2016 12:56:26 +0100 Subject: [PATCH 084/110] Simplify code removing GLM_FORCE_SIZE_FUNC, GLM_META_PROG_HELPERS, GLM_STATIC_CONST_MEMBERS and 'type' type trait. Added experiments for GTX_type_trait --- glm/detail/precision.hpp | 8 - glm/detail/type_mat2x2.hpp | 37 +---- glm/detail/type_mat2x2.inl | 7 - glm/detail/type_mat2x3.hpp | 38 +---- glm/detail/type_mat2x3.inl | 7 - glm/detail/type_mat2x4.hpp | 38 +---- glm/detail/type_mat2x4.inl | 7 - glm/detail/type_mat3x2.hpp | 37 +---- glm/detail/type_mat3x2.inl | 7 - glm/detail/type_mat3x3.hpp | 38 +---- glm/detail/type_mat3x3.inl | 8 - glm/detail/type_mat3x4.hpp | 38 +---- glm/detail/type_mat3x4.inl | 7 - glm/detail/type_mat4x2.hpp | 38 +---- glm/detail/type_mat4x3.hpp | 38 +---- glm/detail/type_mat4x3.inl | 7 - glm/detail/type_mat4x4.hpp | 38 +---- glm/detail/type_mat4x4.inl | 7 - glm/detail/type_vec1.hpp | 38 +---- glm/detail/type_vec1.inl | 63 +++----- glm/detail/type_vec2.hpp | 43 +----- glm/detail/type_vec3.hpp | 45 +----- glm/detail/type_vec4.hpp | 55 +------ glm/detail/type_vec4.inl | 122 +++------------ glm/gtc/quaternion.hpp | 54 +------ glm/gtc/quaternion.inl | 123 +++------------ glm/gtx/dual_quaternion.hpp | 34 +---- glm/gtx/simd_mat4.hpp | 12 -- glm/gtx/simd_mat4.inl | 5 - glm/gtx/simd_quat.hpp | 25 ---- glm/gtx/simd_quat.inl | 20 --- glm/gtx/simd_vec4.hpp | 24 --- glm/gtx/simd_vec4.inl | 19 --- glm/gtx/type_trait.hpp | 224 ++++++++++++++++++++++++++++ glm/gtx/type_trait.inl | 0 readme.md | 3 + test/core/CMakeLists.txt | 1 - test/core/core_type_length_size.cpp | 116 -------------- test/core/core_type_mat2x2.cpp | 16 -- test/core/core_type_mat2x3.cpp | 17 --- test/core/core_type_mat2x4.cpp | 16 -- test/core/core_type_mat3x2.cpp | 17 --- test/core/core_type_mat3x3.cpp | 16 -- test/core/core_type_mat3x4.cpp | 16 -- test/core/core_type_mat4x2.cpp | 16 -- test/core/core_type_mat4x3.cpp | 16 -- test/core/core_type_mat4x4.cpp | 16 -- test/core/core_type_vec1.cpp | 23 --- test/core/core_type_vec2.cpp | 22 --- test/core/core_type_vec3.cpp | 26 ---- test/core/core_type_vec4.cpp | 32 ---- test/gtc/gtc_quaternion.cpp | 6 - test/gtx/CMakeLists.txt | 1 + test/gtx/gtx_dual_quaternion.cpp | 4 - test/gtx/gtx_simd_mat4.cpp | 10 -- test/gtx/gtx_simd_vec4.cpp | 7 - test/gtx/gtx_type_trait.cpp | 79 ++++++++++ 57 files changed, 426 insertions(+), 1361 deletions(-) create mode 100644 glm/gtx/type_trait.hpp create mode 100644 glm/gtx/type_trait.inl delete mode 100644 test/core/core_type_length_size.cpp create mode 100644 test/gtx/gtx_type_trait.cpp diff --git a/glm/detail/precision.hpp b/glm/detail/precision.hpp index 32785b94..c657d031 100644 --- a/glm/detail/precision.hpp +++ b/glm/detail/precision.hpp @@ -42,12 +42,4 @@ namespace glm simd, defaultp = highp }; - - template class genType> - struct type - { - static bool const is_vec = false; - static bool const is_mat = false; - static bool const is_quat = false; - }; }//namespace glm diff --git a/glm/detail/type_mat2x2.hpp b/glm/detail/type_mat2x2.hpp index a263d54d..0388e759 100644 --- a/glm/detail/type_mat2x2.hpp +++ b/glm/detail/type_mat2x2.hpp @@ -54,17 +54,6 @@ namespace glm template friend tvec2 operator/(tvec2 const & v, tmat2x2 const & m); -# ifdef GLM_META_PROG_HELPERS - static GLM_RELAXED_CONSTEXPR length_t components = 2; - static GLM_RELAXED_CONSTEXPR length_t cols = 2; - static GLM_RELAXED_CONSTEXPR length_t rows = 2; - static GLM_RELAXED_CONSTEXPR precision prec = P; -# endif//GLM_META_PROG_HELPERS - -# ifdef GLM_STATIC_CONST_MEMBERS - static const type ZERO; - static const type IDENTITY; -# endif private: col_type value[2]; @@ -113,19 +102,11 @@ namespace glm // -- Accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - typedef size_t size_type; - GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const; + typedef length_t length_type; + GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; -# else - typedef length_t length_type; - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC + GLM_FUNC_DECL col_type & operator[](length_type i); + GLM_FUNC_DECL col_type const & operator[](length_type i) const; // -- Unary arithmetic operators -- @@ -229,16 +210,6 @@ namespace glm template GLM_FUNC_DECL bool operator!=(tmat2x2 const & m1, tmat2x2 const & m2); - - // -- Is type -- - - template - struct type - { - static bool const is_vec = false; - static bool const is_mat = true; - static bool const is_quat = false; - }; } //namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_mat2x2.inl b/glm/detail/type_mat2x2.inl index 3f215e3f..960fee57 100644 --- a/glm/detail/type_mat2x2.inl +++ b/glm/detail/type_mat2x2.inl @@ -50,13 +50,6 @@ namespace detail } }//namespace detail -# ifdef GLM_STATIC_CONST_MEMBERS - template - const tmat2x2 tmat2x2::ZERO(static_cast(0)); - - template - const tmat2x2 tmat2x2::IDENTITY(static_cast(1)); -# endif // -- Constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) diff --git a/glm/detail/type_mat2x3.hpp b/glm/detail/type_mat2x3.hpp index 7fc67faa..da412319 100644 --- a/glm/detail/type_mat2x3.hpp +++ b/glm/detail/type_mat2x3.hpp @@ -50,18 +50,6 @@ namespace glm typedef tmat3x2 transpose_type; typedef T value_type; -# ifdef GLM_META_PROG_HELPERS - static GLM_RELAXED_CONSTEXPR length_t components = 2; - static GLM_RELAXED_CONSTEXPR length_t cols = 2; - static GLM_RELAXED_CONSTEXPR length_t rows = 3; - static GLM_RELAXED_CONSTEXPR precision prec = P; -# endif//GLM_META_PROG_HELPERS - -# ifdef GLM_STATIC_CONST_MEMBERS - static const type ZERO; - static const type IDENTITY; -# endif - private: col_type value[2]; @@ -110,19 +98,11 @@ namespace glm // -- Accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - typedef size_t size_type; - GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const; + typedef length_t length_type; + GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; -# else - typedef length_t length_type; - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC + GLM_FUNC_DECL col_type & operator[](length_type i); + GLM_FUNC_DECL col_type const & operator[](length_type i) const; // -- Unary arithmetic operators -- @@ -207,16 +187,6 @@ namespace glm template GLM_FUNC_DECL bool operator!=(tmat2x3 const & m1, tmat2x3 const & m2); - - // -- Is type -- - - template - struct type - { - static bool const is_vec = false; - static bool const is_mat = true; - static bool const is_quat = false; - }; }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_mat2x3.inl b/glm/detail/type_mat2x3.inl index e7cabb72..76c00f50 100644 --- a/glm/detail/type_mat2x3.inl +++ b/glm/detail/type_mat2x3.inl @@ -32,13 +32,6 @@ namespace glm { -# ifdef GLM_STATIC_CONST_MEMBERS - template - const tmat2x3 tmat2x3::ZERO(static_cast(0)); - - template - const tmat2x3 tmat2x3::IDENTITY(static_cast(1)); -# endif // -- Constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) diff --git a/glm/detail/type_mat2x4.hpp b/glm/detail/type_mat2x4.hpp index e03e0948..7e0cc87d 100644 --- a/glm/detail/type_mat2x4.hpp +++ b/glm/detail/type_mat2x4.hpp @@ -50,18 +50,6 @@ namespace glm typedef tmat4x2 transpose_type; typedef T value_type; -# ifdef GLM_META_PROG_HELPERS - static GLM_RELAXED_CONSTEXPR length_t components = 2; - static GLM_RELAXED_CONSTEXPR length_t cols = 2; - static GLM_RELAXED_CONSTEXPR length_t rows = 4; - static GLM_RELAXED_CONSTEXPR precision prec = P; -# endif//GLM_META_PROG_HELPERS - -# ifdef GLM_STATIC_CONST_MEMBERS - static const type ZERO; - static const type IDENTITY; -# endif - private: col_type value[2]; @@ -112,19 +100,11 @@ namespace glm // -- Accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - typedef size_t size_type; - GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const; + typedef length_t length_type; + GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; -# else - typedef length_t length_type; - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC + GLM_FUNC_DECL col_type & operator[](length_type i); + GLM_FUNC_DECL col_type const & operator[](length_type i) const; // -- Unary arithmetic operators -- @@ -209,16 +189,6 @@ namespace glm template GLM_FUNC_DECL bool operator!=(tmat2x4 const & m1, tmat2x4 const & m2); - - // -- Is type -- - - template - struct type - { - static bool const is_vec = false; - static bool const is_mat = true; - static bool const is_quat = false; - }; }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_mat2x4.inl b/glm/detail/type_mat2x4.inl index f92b4df5..cac649f6 100644 --- a/glm/detail/type_mat2x4.inl +++ b/glm/detail/type_mat2x4.inl @@ -32,13 +32,6 @@ namespace glm { -# ifdef GLM_STATIC_CONST_MEMBERS - template - const tmat2x4 tmat2x4::ZERO(static_cast(0)); - - template - const tmat2x4 tmat2x4::IDENTITY(static_cast(1)); -# endif // -- Constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) diff --git a/glm/detail/type_mat3x2.hpp b/glm/detail/type_mat3x2.hpp index 2f594bb1..06922b6b 100644 --- a/glm/detail/type_mat3x2.hpp +++ b/glm/detail/type_mat3x2.hpp @@ -50,18 +50,6 @@ namespace glm typedef tmat2x3 transpose_type; typedef T value_type; -# ifdef GLM_META_PROG_HELPERS - static GLM_RELAXED_CONSTEXPR length_t components = 3; - static GLM_RELAXED_CONSTEXPR length_t cols = 3; - static GLM_RELAXED_CONSTEXPR length_t rows = 2; - static GLM_RELAXED_CONSTEXPR precision prec = P; -# endif//GLM_META_PROG_HELPERS - -# ifdef GLM_STATIC_CONST_MEMBERS - static const type ZERO; - static const type IDENTITY; -# endif - private: col_type value[3]; @@ -117,19 +105,11 @@ namespace glm // -- Accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - typedef size_t size_type; - GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const; + typedef length_t length_type; + GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; -# else - typedef length_t length_type; - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC + GLM_FUNC_DECL col_type & operator[](length_type i); + GLM_FUNC_DECL col_type const & operator[](length_type i) const; // -- Unary arithmetic operators -- @@ -215,15 +195,6 @@ namespace glm template GLM_FUNC_DECL bool operator!=(tmat3x2 const & m1, tmat3x2 const & m2); - // -- Is type -- - - template - struct type - { - static bool const is_vec = false; - static bool const is_mat = true; - static bool const is_quat = false; - }; }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_mat3x2.inl b/glm/detail/type_mat3x2.inl index 24079cfe..f497e395 100644 --- a/glm/detail/type_mat3x2.inl +++ b/glm/detail/type_mat3x2.inl @@ -32,13 +32,6 @@ namespace glm { -# ifdef GLM_STATIC_CONST_MEMBERS - template - const tmat3x2 tmat3x2::ZERO(static_cast(0)); - - template - const tmat3x2 tmat3x2::IDENTITY(static_cast(1)); -# endif // -- Constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) diff --git a/glm/detail/type_mat3x3.hpp b/glm/detail/type_mat3x3.hpp index 2aaae21e..806ae811 100644 --- a/glm/detail/type_mat3x3.hpp +++ b/glm/detail/type_mat3x3.hpp @@ -49,18 +49,6 @@ namespace glm typedef tmat3x3 transpose_type; typedef T value_type; -# ifdef GLM_META_PROG_HELPERS - static GLM_RELAXED_CONSTEXPR length_t components = 3; - static GLM_RELAXED_CONSTEXPR length_t cols = 3; - static GLM_RELAXED_CONSTEXPR length_t rows = 3; - static GLM_RELAXED_CONSTEXPR precision prec = P; -# endif//GLM_META_PROG_HELPERS - -# ifdef GLM_STATIC_CONST_MEMBERS - static const type ZERO; - static const type IDENTITY; -# endif - template friend tvec3 operator/(tmat3x3 const & m, tvec3 const & v); template @@ -121,19 +109,11 @@ namespace glm // -- Accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - typedef size_t size_type; - GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const; + typedef length_t length_type; + GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; -# else - typedef length_t length_type; - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC + GLM_FUNC_DECL col_type & operator[](length_type i); + GLM_FUNC_DECL col_type const & operator[](length_type i) const; // -- Unary arithmetic operators -- @@ -237,16 +217,6 @@ namespace glm template GLM_FUNC_DECL bool operator!=(tmat3x3 const & m1, tmat3x3 const & m2); - - // -- Is type -- - - template - struct type - { - static bool const is_vec = false; - static bool const is_mat = true; - static bool const is_quat = false; - }; }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_mat3x3.inl b/glm/detail/type_mat3x3.inl index c3b07108..9ee0111e 100644 --- a/glm/detail/type_mat3x3.inl +++ b/glm/detail/type_mat3x3.inl @@ -56,14 +56,6 @@ namespace detail } }//namespace detail -# ifdef GLM_STATIC_CONST_MEMBERS - template - const tmat3x3 tmat3x3::ZERO(static_cast(0)); - - template - const tmat3x3 tmat3x3::IDENTITY(static_cast(1)); -# endif - // -- Constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) diff --git a/glm/detail/type_mat3x4.hpp b/glm/detail/type_mat3x4.hpp index 6b5c1dbe..445340ec 100644 --- a/glm/detail/type_mat3x4.hpp +++ b/glm/detail/type_mat3x4.hpp @@ -50,18 +50,6 @@ namespace glm typedef tmat4x3 transpose_type; typedef T value_type; -# ifdef GLM_META_PROG_HELPERS - static GLM_RELAXED_CONSTEXPR length_t components = 3; - static GLM_RELAXED_CONSTEXPR length_t cols = 3; - static GLM_RELAXED_CONSTEXPR length_t rows = 4; - static GLM_RELAXED_CONSTEXPR precision prec = P; -# endif//GLM_META_PROG_HELPERS - -# ifdef GLM_STATIC_CONST_MEMBERS - static const type ZERO; - static const type IDENTITY; -# endif - private: col_type value[3]; @@ -117,19 +105,11 @@ namespace glm // -- Accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - typedef size_t size_type; - GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const; + typedef length_t length_type; + GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; -# else - typedef length_t length_type; - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC + GLM_FUNC_DECL col_type & operator[](length_type i); + GLM_FUNC_DECL col_type const & operator[](length_type i) const; // -- Unary arithmetic operators -- @@ -214,16 +194,6 @@ namespace glm template GLM_FUNC_DECL bool operator!=(tmat3x4 const & m1, tmat3x4 const & m2); - - // -- Is type -- - - template - struct type - { - static bool const is_vec = false; - static bool const is_mat = true; - static bool const is_quat = false; - }; }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_mat3x4.inl b/glm/detail/type_mat3x4.inl index dd1f0563..3991d95d 100644 --- a/glm/detail/type_mat3x4.inl +++ b/glm/detail/type_mat3x4.inl @@ -32,13 +32,6 @@ namespace glm { -# ifdef GLM_STATIC_CONST_MEMBERS - template - const tmat3x4 tmat3x4::ZERO(static_cast(0)); - - template - const tmat3x4 tmat3x4::IDENTITY(static_cast(1)); -# endif // -- Constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) diff --git a/glm/detail/type_mat4x2.hpp b/glm/detail/type_mat4x2.hpp index bd71e121..ad66ed19 100644 --- a/glm/detail/type_mat4x2.hpp +++ b/glm/detail/type_mat4x2.hpp @@ -50,18 +50,6 @@ namespace glm typedef tmat2x4 transpose_type; typedef T value_type; -# ifdef GLM_META_PROG_HELPERS - static GLM_RELAXED_CONSTEXPR length_t components = 4; - static GLM_RELAXED_CONSTEXPR length_t cols = 4; - static GLM_RELAXED_CONSTEXPR length_t rows = 2; - static GLM_RELAXED_CONSTEXPR precision prec = P; -# endif//GLM_META_PROG_HELPERS - -# ifdef GLM_STATIC_CONST_MEMBERS - static const type ZERO; - static const type IDENTITY; -# endif - private: col_type value[4]; @@ -122,19 +110,11 @@ namespace glm // -- Accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - typedef size_t size_type; - GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const; + typedef length_t length_type; + GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; -# else - typedef length_t length_type; - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC + GLM_FUNC_DECL col_type & operator[](length_type i); + GLM_FUNC_DECL col_type const & operator[](length_type i) const; // -- Unary arithmetic operators -- @@ -219,16 +199,6 @@ namespace glm template GLM_FUNC_DECL bool operator!=(tmat4x2 const & m1, tmat4x2 const & m2); - - // -- Is type -- - - template - struct type - { - static bool const is_vec = false; - static bool const is_mat = true; - static bool const is_quat = false; - }; }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_mat4x3.hpp b/glm/detail/type_mat4x3.hpp index 9ee26169..22d772c2 100644 --- a/glm/detail/type_mat4x3.hpp +++ b/glm/detail/type_mat4x3.hpp @@ -50,18 +50,6 @@ namespace glm typedef tmat3x4 transpose_type; typedef T value_type; -# ifdef GLM_META_PROG_HELPERS - static GLM_RELAXED_CONSTEXPR length_t components = 4; - static GLM_RELAXED_CONSTEXPR length_t cols = 4; - static GLM_RELAXED_CONSTEXPR length_t rows = 3; - static GLM_RELAXED_CONSTEXPR precision prec = P; -# endif//GLM_META_PROG_HELPERS - -# ifdef GLM_STATIC_CONST_MEMBERS - static const type ZERO; - static const type IDENTITY; -# endif - private: col_type value[4]; @@ -122,19 +110,11 @@ namespace glm // -- Accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - typedef size_t size_type; - GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const; + typedef length_t length_type; + GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; -# else - typedef length_t length_type; - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC + GLM_FUNC_DECL col_type & operator[](length_type i); + GLM_FUNC_DECL col_type const & operator[](length_type i) const; // -- Unary arithmetic operators -- @@ -219,16 +199,6 @@ namespace glm template GLM_FUNC_DECL bool operator!=(tmat4x3 const & m1, tmat4x3 const & m2); - - // -- Is type -- - - template - struct type - { - static bool const is_vec = false; - static bool const is_mat = true; - static bool const is_quat = false; - }; }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_mat4x3.inl b/glm/detail/type_mat4x3.inl index 58eeb6f9..c2979782 100644 --- a/glm/detail/type_mat4x3.inl +++ b/glm/detail/type_mat4x3.inl @@ -32,13 +32,6 @@ namespace glm { -# ifdef GLM_STATIC_CONST_MEMBERS - template - const tmat4x3 tmat4x3::ZERO(static_cast(0)); - - template - const tmat4x3 tmat4x3::IDENTITY(static_cast(1)); -# endif // -- Constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) diff --git a/glm/detail/type_mat4x4.hpp b/glm/detail/type_mat4x4.hpp index bb5fba0b..4766f1d6 100644 --- a/glm/detail/type_mat4x4.hpp +++ b/glm/detail/type_mat4x4.hpp @@ -49,18 +49,6 @@ namespace glm typedef tmat4x4 transpose_type; typedef T value_type; -# ifdef GLM_META_PROG_HELPERS - static GLM_RELAXED_CONSTEXPR length_t components = 4; - static GLM_RELAXED_CONSTEXPR length_t cols = 4; - static GLM_RELAXED_CONSTEXPR length_t rows = 4; - static GLM_RELAXED_CONSTEXPR precision prec = P; -# endif//GLM_META_PROG_HELPERS - -# ifdef GLM_STATIC_CONST_MEMBERS - static const type ZERO; - static const type IDENTITY; -# endif - template friend tvec4 operator/(tmat4x4 const & m, tvec4 const & v); template @@ -126,19 +114,11 @@ namespace glm // -- Accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - typedef size_t size_type; - GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const; + typedef length_t length_type; + GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; -# else - typedef length_t length_type; - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC + GLM_FUNC_DECL col_type & operator[](length_type i); + GLM_FUNC_DECL col_type const & operator[](length_type i) const; // -- Unary arithmetic operators -- @@ -242,16 +222,6 @@ namespace glm template GLM_FUNC_DECL bool operator!=(tmat4x4 const & m1, tmat4x4 const & m2); - - // -- Is type -- - - template - struct type - { - static bool const is_vec = false; - static bool const is_mat = true; - static bool const is_quat = false; - }; }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_mat4x4.inl b/glm/detail/type_mat4x4.inl index acfa318c..319325a7 100644 --- a/glm/detail/type_mat4x4.inl +++ b/glm/detail/type_mat4x4.inl @@ -92,13 +92,6 @@ namespace detail } }//namespace detail -# ifdef GLM_STATIC_CONST_MEMBERS - template - const tmat4x4 tmat4x4::ZERO(static_cast(0)); - - template - const tmat4x4 tmat4x4::IDENTITY(static_cast(1)); -# endif // -- Constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) diff --git a/glm/detail/type_vec1.hpp b/glm/detail/type_vec1.hpp index 2e811a36..40291ecb 100644 --- a/glm/detail/type_vec1.hpp +++ b/glm/detail/type_vec1.hpp @@ -54,15 +54,6 @@ namespace glm typedef tvec1 bool_type; typedef T value_type; -# ifdef GLM_META_PROG_HELPERS - static GLM_RELAXED_CONSTEXPR length_t components = 1; - static GLM_RELAXED_CONSTEXPR precision prec = P; -# endif//GLM_META_PROG_HELPERS - -# ifdef GLM_STATIC_CONST_MEMBERS - static const type ZERO; - static const type X; -# endif // -- Data -- # if GLM_HAS_ANONYMOUS_UNION @@ -94,21 +85,12 @@ namespace glm // -- Component accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - /// Return the count of components of the vector - typedef size_t size_type; - GLM_FUNC_DECL GLM_CONSTEXPR size_type size() const; + /// Return the count of components of the vector + typedef length_t length_type; + GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - GLM_FUNC_DECL T & operator[](size_type i); - GLM_FUNC_DECL T const & operator[](size_type i) const; -# else - /// Return the count of components of the vector - typedef length_t length_type; - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL T & operator[](length_type i); - GLM_FUNC_DECL T const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC + GLM_FUNC_DECL T & operator[](length_type i); + GLM_FUNC_DECL T const & operator[](length_type i) const; // -- Implicit basic constructors -- @@ -322,16 +304,6 @@ namespace glm template GLM_FUNC_DECL tvec1 operator||(tvec1 const & v1, tvec1 const & v2); - - // -- Is type -- - - template - struct type - { - static bool const is_vec = true; - static bool const is_mat = false; - static bool const is_quat = false; - }; }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_vec1.inl b/glm/detail/type_vec1.inl index 9d397d64..d1bf7cf5 100644 --- a/glm/detail/type_vec1.inl +++ b/glm/detail/type_vec1.inl @@ -32,13 +32,6 @@ namespace glm { -# ifdef GLM_STATIC_CONST_MEMBERS - template - const tvec1 tvec1::X(static_cast(1)); - - template - const tvec1 tvec1::ZERO(static_cast(0)); -# endif // -- Implicit basic constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) @@ -102,47 +95,25 @@ namespace glm // -- Component accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec1::size_type tvec1::size() const - { - return 1; - } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec1::length_type tvec1::length() const + { + return 1; + } - template - GLM_FUNC_QUALIFIER T & tvec1::operator[](typename tvec1::size_type i) - { - assert(i >= 0 && static_cast(i) < detail::component_count(*this)); - return (&x)[i]; - } + template + GLM_FUNC_QUALIFIER T & tvec1::operator[](typename tvec1::length_type i) + { + assert(i >= 0 && static_cast(i) < detail::component_count(*this)); + return (&x)[i]; + } - template - GLM_FUNC_QUALIFIER T const & tvec1::operator[](typename tvec1::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 tvec1::length_type tvec1::length() const - { - return 1; - } - - template - GLM_FUNC_QUALIFIER T & tvec1::operator[](typename tvec1::length_type i) - { - assert(i >= 0 && static_cast(i) < detail::component_count(*this)); - 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)); - return (&x)[i]; - } -# endif//GLM_FORCE_SIZE_FUNC + template + GLM_FUNC_QUALIFIER T const & tvec1::operator[](typename tvec1::length_type i) const + { + assert(i >= 0 && static_cast(i) < detail::component_count(*this)); + return (&x)[i]; + } // -- Unary arithmetic operators -- diff --git a/glm/detail/type_vec2.hpp b/glm/detail/type_vec2.hpp index 1af3e31a..de425e10 100644 --- a/glm/detail/type_vec2.hpp +++ b/glm/detail/type_vec2.hpp @@ -49,21 +49,9 @@ namespace glm { // -- Implementation detail -- + typedef T value_type; typedef tvec2 type; typedef tvec2 bool_type; - typedef T value_type; - -# ifdef GLM_META_PROG_HELPERS - static GLM_RELAXED_CONSTEXPR length_t components = 2; - static GLM_RELAXED_CONSTEXPR precision prec = P; -# endif//GLM_META_PROG_HELPERS - -# ifdef GLM_STATIC_CONST_MEMBERS - static const type ZERO; - static const type X; - static const type Y; - static const type XY; -# endif // -- Data -- @@ -97,21 +85,12 @@ namespace glm // -- Component accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - /// Return the count of components of the vector - typedef size_t size_type; - GLM_FUNC_DECL GLM_CONSTEXPR size_type size() const; + /// Return the count of components of the vector + typedef length_t length_type; + GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - GLM_FUNC_DECL T & operator[](size_type i); - GLM_FUNC_DECL T const & operator[](size_type i) const; -# else - /// Return the count of components of the vector - typedef length_t length_type; - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL T & operator[](length_type i); - GLM_FUNC_DECL T const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC + GLM_FUNC_DECL T & operator[](length_type i); + GLM_FUNC_DECL T const & operator[](length_type i) const; // -- Implicit basic constructors -- @@ -411,16 +390,6 @@ namespace glm template GLM_FUNC_DECL tvec2 operator||(tvec2 const & v1, tvec2 const & v2); - - // -- Is type -- - - template - struct type - { - static bool const is_vec = true; - static bool const is_mat = false; - static bool const is_quat = false; - }; }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_vec3.hpp b/glm/detail/type_vec3.hpp index 72d32286..70e4290b 100644 --- a/glm/detail/type_vec3.hpp +++ b/glm/detail/type_vec3.hpp @@ -53,22 +53,6 @@ namespace glm typedef tvec3 bool_type; typedef T value_type; -# ifdef GLM_META_PROG_HELPERS - static GLM_RELAXED_CONSTEXPR length_t components = 3; - static GLM_RELAXED_CONSTEXPR precision prec = P; -# endif//GLM_META_PROG_HELPERS - -# ifdef GLM_STATIC_CONST_MEMBERS - static const type ZERO; - static const type X; - static const type Y; - static const type Z; - static const type XY; - static const type XZ; - static const type YZ; - static const type XYZ; -# endif - // -- Data -- # if GLM_HAS_ANONYMOUS_UNION @@ -102,21 +86,12 @@ namespace glm // -- Component accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - /// Return the count of components of the vector - typedef size_t size_type; - GLM_FUNC_DECL GLM_CONSTEXPR size_type size() const; + /// Return the count of components of the vector + typedef length_t length_type; + GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - GLM_FUNC_DECL T & operator[](size_type i); - GLM_FUNC_DECL T const & operator[](size_type i) const; -# else - /// Return the count of components of the vector - typedef length_t length_type; - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL T & operator[](length_type i); - GLM_FUNC_DECL T const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC + GLM_FUNC_DECL T & operator[](length_type i); + GLM_FUNC_DECL T const & operator[](length_type i) const; // -- Implicit basic constructors -- @@ -437,16 +412,6 @@ namespace glm template GLM_FUNC_DECL tvec3 operator||(tvec3 const & v1, tvec3 const & v2); - - // -- Is type -- - - template - struct type - { - static bool const is_vec = true; - static bool const is_mat = false; - static bool const is_quat = false; - }; }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index 86156e5f..4668ff81 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -103,33 +103,9 @@ namespace detail { // -- Implementation detail -- + typedef T value_type; typedef tvec4 type; typedef tvec4 bool_type; - typedef T value_type; - -# ifdef GLM_META_PROG_HELPERS - static GLM_RELAXED_CONSTEXPR length_t components = 4; - static GLM_RELAXED_CONSTEXPR precision prec = P; -# endif//GLM_META_PROG_HELPERS - -# ifdef GLM_STATIC_CONST_MEMBERS - static const type ZERO; - static const type X; - static const type Y; - static const type Z; - static const type W; - static const type XY; - static const type XZ; - static const type XW; - static const type YZ; - static const type YW; - static const type ZW; - static const type XYZ; - static const type XYW; - static const type XZW; - static const type YZW; - static const type XYZW; -# endif // -- Data -- @@ -167,21 +143,12 @@ namespace detail // -- Component accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - /// Return the count of components of the vector - typedef size_t size_type; - GLM_FUNC_DECL GLM_CONSTEXPR size_type size() const; + /// Return the count of components of the vector + typedef length_t length_type; + GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - GLM_FUNC_DECL T & operator[](size_type i); - GLM_FUNC_DECL T const & operator[](size_type i) const; -# else - /// Return the count of components of the vector - typedef length_t length_type; - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL T & operator[](length_type i); - GLM_FUNC_DECL T const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC + GLM_FUNC_DECL T & operator[](length_type i); + GLM_FUNC_DECL T const & operator[](length_type i) const; // -- Implicit basic constructors -- @@ -544,16 +511,6 @@ namespace detail template GLM_FUNC_DECL tvec4 operator||(tvec4 const & v1, tvec4 const & v2); - - // -- Is type -- - - template - struct type - { - static bool const is_vec = true; - static bool const is_mat = false; - static bool const is_quat = false; - }; }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index f8d30b57..3a929a01 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -32,72 +32,6 @@ namespace glm { - -# ifdef GLM_STATIC_CONST_MEMBERS - template - const tvec4 tvec4::ZERO - (static_cast(0), static_cast(0), static_cast(0), static_cast(0)); - - template - const tvec4 tvec4::X - (static_cast(1), static_cast(0), static_cast(0), static_cast(0)); - - template - const tvec4 tvec4::Y - (static_cast(0), static_cast(1), static_cast(0), static_cast(0)); - - template - const tvec4 tvec4::Z - (static_cast(0), static_cast(0), static_cast(1), static_cast(0)); - - template - const tvec4 tvec4::W - (static_cast(0), static_cast(0), static_cast(0), static_cast(1)); - - template - const tvec4 tvec4::XY - (static_cast(1), static_cast(1), static_cast(0), static_cast(0)); - - template - const tvec4 tvec4::XZ - (static_cast(1), static_cast(0), static_cast(1), static_cast(0)); - - template - const tvec4 tvec4::XW - (static_cast(1), static_cast(0), static_cast(0), static_cast(1)); - - template - const tvec4 tvec4::YZ - (static_cast(0), static_cast(1), static_cast(1), static_cast(0)); - - template - const tvec4 tvec4::YW - (static_cast(0), static_cast(1), static_cast(0), static_cast(1)); - - template - const tvec4 tvec4::ZW - (static_cast(0), static_cast(0), static_cast(1), static_cast(1)); - - template - const tvec4 tvec4::XYZ - (static_cast(1), static_cast(1), static_cast(1), static_cast(0)); - - template - const tvec4 tvec4::XYW - (static_cast(1), static_cast(1), static_cast(0), static_cast(1)); - - template - const tvec4 tvec4::XZW - (static_cast(1), static_cast(0), static_cast(1), static_cast(1)); - - template - const tvec4 tvec4::YZW - (static_cast(0), static_cast(1), static_cast(1), static_cast(1)); - - template - const tvec4 tvec4::XYZW - (static_cast(1), static_cast(1), static_cast(1), static_cast(1)); -# endif // -- Implicit basic constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) @@ -270,47 +204,25 @@ namespace glm // -- Component accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec4::size_type tvec4::size() const - { - return 4; - } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec4::length_type tvec4::length() const + { + return 4; + } - template - GLM_FUNC_QUALIFIER T & tvec4::operator[](typename tvec4::size_type i) - { - assert(i >= 0 && static_cast(i) < detail::component_count(*this)); - return (&x)[i]; - } + template + GLM_FUNC_QUALIFIER T & tvec4::operator[](typename tvec4::length_type i) + { + assert(i >= 0 && static_cast(i) < detail::component_count(*this)); + return (&x)[i]; + } - template - GLM_FUNC_QUALIFIER T const & tvec4::operator[](typename tvec4::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 tvec4::length_type tvec4::length() const - { - return 4; - } - - template - GLM_FUNC_QUALIFIER T & tvec4::operator[](typename tvec4::length_type i) - { - assert(i >= 0 && static_cast(i) < detail::component_count(*this)); - 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)); - return (&x)[i]; - } -# endif//GLM_FORCE_SIZE_FUNC + template + GLM_FUNC_QUALIFIER T const & tvec4::operator[](typename tvec4::length_type i) const + { + assert(i >= 0 && static_cast(i) < detail::component_count(*this)); + return (&x)[i]; + } // -- Unary arithmetic operators -- diff --git a/glm/gtc/quaternion.hpp b/glm/gtc/quaternion.hpp index 431228d7..a7055fae 100644 --- a/glm/gtc/quaternion.hpp +++ b/glm/gtc/quaternion.hpp @@ -67,52 +67,18 @@ namespace glm typedef tquat type; typedef T value_type; -# ifdef GLM_META_PROG_HELPERS - static GLM_RELAXED_CONSTEXPR length_t components = 4; - static GLM_RELAXED_CONSTEXPR precision prec = P; -# endif//GLM_META_PROG_HELPERS - // -- Data -- T x, y, z, w; -# ifdef GLM_STATIC_CONST_MEMBERS - static const type ZERO; - static const type IDENTITY; - static const type X; - static const type Y; - static const type Z; - static const type W; - static const type XY; - static const type XZ; - static const type XW; - static const type YZ; - static const type YW; - static const type ZW; - static const type XYZ; - static const type XYW; - static const type XZW; - static const type YZW; - static const type XYZW; -# endif - // -- Component accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - typedef size_t size_type; - /// Return the count of components of a quaternion - GLM_FUNC_DECL GLM_CONSTEXPR size_type size() const; + typedef length_t length_type; + /// Return the count of components of a quaternion + GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - GLM_FUNC_DECL T & operator[](size_type i); - GLM_FUNC_DECL T const & operator[](size_type i) const; -# else - typedef length_t length_type; - /// Return the count of components of a quaternion - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL T & operator[](length_type i); - GLM_FUNC_DECL T const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC + GLM_FUNC_DECL T & operator[](length_type i); + GLM_FUNC_DECL T const & operator[](length_type i) const; // -- Implicit basic constructors -- @@ -397,16 +363,6 @@ namespace glm template GLM_FUNC_DECL tvec4 notEqual(tquat const & x, tquat const & y); /// @} - - // -- Is type -- - - template - struct type - { - static bool const is_vec = false; - static bool const is_mat = false; - static bool const is_quat = true; - }; } //namespace glm #include "quaternion.inl" diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index b46cd62c..ff4c2d68 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -49,116 +49,27 @@ namespace detail }; }//namespace detail -# ifdef GLM_STATIC_CONST_MEMBERS - template - const tquat tquat::ZERO - (static_cast(0), static_cast(0), static_cast(0), static_cast(0)); - - template const tquat tquat::IDENTITY; - - template - const tquat tquat::X - (static_cast(0), static_cast(1), static_cast(0), static_cast(0)); - - template - const tquat tquat::Y - (static_cast(0), static_cast(0), static_cast(1), static_cast(0)); - - template - const tquat tquat::Z - (static_cast(0), static_cast(0), static_cast(0), static_cast(1)); - - template - const tquat tquat::W - (static_cast(1), static_cast(0), static_cast(0), static_cast(0)); - - template - const tquat tquat::XY - (static_cast(0), static_cast(1), static_cast(1), static_cast(0)); - - template - const tquat tquat::XZ - (static_cast(0), static_cast(0), static_cast(1), static_cast(1)); - - template - const tquat tquat::XW - (static_cast(1), static_cast(1), static_cast(0), static_cast(0)); - - template - const tquat tquat::YZ - (static_cast(0), static_cast(0), static_cast(1), static_cast(1)); - - template - const tquat tquat::YW - (static_cast(1), static_cast(0), static_cast(1), static_cast(0)); - - template - const tquat tquat::ZW - (static_cast(1), static_cast(0), static_cast(0), static_cast(1)); - - template - const tquat tquat::XYZ - (static_cast(0), static_cast(1), static_cast(1), static_cast(1)); - - template - const tquat tquat::XYW - (static_cast(1), static_cast(1), static_cast(1), static_cast(0)); - - template - const tquat tquat::XZW - (static_cast(1), static_cast(1), static_cast(0), static_cast(1)); - - template - const tquat tquat::YZW - (static_cast(1), static_cast(0), static_cast(1), static_cast(1)); - - template - const tquat tquat::XYZW - (static_cast(1), static_cast(1), static_cast(1), static_cast(1)); -# endif // -- Component accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tquat::size_type tquat::size() const - { - return 4; - } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tquat::length_type tquat::length() const + { + return 4; + } - template - GLM_FUNC_QUALIFIER T & tquat::operator[](typename tquat::size_type i) - { - assert(i >= 0 && static_cast(i) < detail::component_count(*this)); - return (&x)[i]; - } + template + GLM_FUNC_QUALIFIER T & tquat::operator[](typename tquat::length_type i) + { + assert(i >= 0 && static_cast(i) < detail::component_count(*this)); + return (&x)[i]; + } - template - GLM_FUNC_QUALIFIER T const & tquat::operator[](typename tquat::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 tquat::length_type tquat::length() const - { - return 4; - } - - template - GLM_FUNC_QUALIFIER T & tquat::operator[](typename tquat::length_type i) - { - assert(i >= 0 && static_cast(i) < detail::component_count(*this)); - 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)); - return (&x)[i]; - } -# endif//GLM_FORCE_SIZE_FUNC + template + GLM_FUNC_QUALIFIER T const & tquat::operator[](typename tquat::length_type i) const + { + assert(i >= 0 && static_cast(i) < detail::component_count(*this)); + return (&x)[i]; + } // -- Implicit basic constructors -- diff --git a/glm/gtx/dual_quaternion.hpp b/glm/gtx/dual_quaternion.hpp index 35a5d850..9bef77dd 100644 --- a/glm/gtx/dual_quaternion.hpp +++ b/glm/gtx/dual_quaternion.hpp @@ -66,32 +66,18 @@ namespace glm typedef T value_type; typedef glm::tquat part_type; -# ifdef GLM_META_PROG_HELPERS - static GLM_RELAXED_CONSTEXPR length_t components = 2; - static GLM_RELAXED_CONSTEXPR precision prec = P; -# endif//GLM_META_PROG_HELPERS - // -- Data -- glm::tquat real, dual; // -- Component accesses -- -# ifdef GLM_FORCE_SIZE_FUNC - typedef size_t size_type; - /// Return the count of components of a dual quaternion - GLM_FUNC_DECL GLM_CONSTEXPR size_type size() const; + typedef length_t length_type; + /// Return the count of components of a dual quaternion + GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - GLM_FUNC_DECL part_type & operator[](size_type i); - GLM_FUNC_DECL part_type const & operator[](size_type i) const; -# else - typedef length_t length_type; - /// Return the count of components of a dual quaternion - GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const; - - GLM_FUNC_DECL part_type & operator[](length_type i); - GLM_FUNC_DECL part_type const & operator[](length_type i) const; -# endif//GLM_FORCE_SIZE_FUNC + GLM_FUNC_DECL part_type & operator[](length_type i); + GLM_FUNC_DECL part_type const & operator[](length_type i) const; // -- Implicit basic constructors -- @@ -295,16 +281,6 @@ namespace glm #endif /// @} - - // -- Is type -- - - template - struct type - { - static bool const is_vec = false; - static bool const is_mat = false; - static bool const is_quat = true; - }; } //namespace glm #include "dual_quaternion.inl" diff --git a/glm/gtx/simd_mat4.hpp b/glm/gtx/simd_mat4.hpp index e1567610..ae5790ae 100644 --- a/glm/gtx/simd_mat4.hpp +++ b/glm/gtx/simd_mat4.hpp @@ -76,18 +76,6 @@ namespace detail typedef tvec4 pure_col_type; typedef tmat4x4 pure_transpose_type; -# ifdef GLM_META_PROG_HELPERS - static GLM_RELAXED_CONSTEXPR length_t components = 4; - static GLM_RELAXED_CONSTEXPR length_t cols = 4; - static GLM_RELAXED_CONSTEXPR length_t rows = 4; - static GLM_RELAXED_CONSTEXPR precision prec = defaultp; -# endif//GLM_META_PROG_HELPERS - -# ifdef GLM_STATIC_CONST_MEMBERS - static const type ZERO; - static const type IDENTITY; -# endif - GLM_FUNC_DECL length_t length() const; fvec4SIMD Data[4]; diff --git a/glm/gtx/simd_mat4.inl b/glm/gtx/simd_mat4.inl index c436ab1f..13dcb20f 100644 --- a/glm/gtx/simd_mat4.inl +++ b/glm/gtx/simd_mat4.inl @@ -61,11 +61,6 @@ GLM_FUNC_QUALIFIER fvec4SIMD const & fmat4x4SIMD::operator[] return this->Data[i]; } -#ifdef GLM_STATIC_CONST_MEMBERS - const fmat4x4SIMD fmat4x4SIMD::ZERO(static_cast(0)); - const fmat4x4SIMD fmat4x4SIMD::IDENTITY(static_cast(1)); -#endif - ////////////////////////////////////////////////////////////// // Constructors diff --git a/glm/gtx/simd_quat.hpp b/glm/gtx/simd_quat.hpp index 16782081..d06093eb 100644 --- a/glm/gtx/simd_quat.hpp +++ b/glm/gtx/simd_quat.hpp @@ -76,11 +76,6 @@ namespace detail typedef tquat bool_type; typedef tquat pure_type; -# ifdef GLM_META_PROG_HELPERS - static GLM_RELAXED_CONSTEXPR length_t components = 4; - static GLM_RELAXED_CONSTEXPR precision prec = defaultp; -# endif//GLM_META_PROG_HELPERS - #ifdef GLM_SIMD_ENABLE_XYZW_UNION union { @@ -91,26 +86,6 @@ namespace detail __m128 Data; #endif -# ifdef GLM_STATIC_CONST_MEMBERS - static const type ZERO; - static const type IDENTITY; - static const type X; - static const type Y; - static const type Z; - static const type W; - static const type XY; - static const type XZ; - static const type XW; - static const type YZ; - static const type YW; - static const type ZW; - static const type XYZ; - static const type XYW; - static const type XZW; - static const type YZW; - static const type XYZW; -# endif - ////////////////////////////////////// // Implicit basic constructors diff --git a/glm/gtx/simd_quat.inl b/glm/gtx/simd_quat.inl index c301988a..1fe9c93f 100644 --- a/glm/gtx/simd_quat.inl +++ b/glm/gtx/simd_quat.inl @@ -51,26 +51,6 @@ void print(const fvec4SIMD &v) } #endif -# ifdef GLM_STATIC_CONST_MEMBERS - const fquatSIMD fquatSIMD::ZERO(0, 0, 0, 0); - const fquatSIMD fquatSIMD::IDENTITY(1, 0, 0, 0); - const fquatSIMD fquatSIMD::X(0, 1, 0, 0); - const fquatSIMD fquatSIMD::Y(0, 0, 1, 0); - const fquatSIMD fquatSIMD::Z(0, 0, 0, 1); - const fquatSIMD fquatSIMD::W(1, 0, 0, 0); - const fquatSIMD fquatSIMD::XY(0, 1, 1, 0); - const fquatSIMD fquatSIMD::XZ(0, 1, 0, 1); - const fquatSIMD fquatSIMD::XW(1, 1, 0, 0); - const fquatSIMD fquatSIMD::YZ(0, 0, 1, 1); - const fquatSIMD fquatSIMD::YW(1, 0, 1, 0); - const fquatSIMD fquatSIMD::ZW(1, 0, 0, 1); - const fquatSIMD fquatSIMD::XYZ(0, 1, 1, 1); - const fquatSIMD fquatSIMD::XYW(1, 1, 1, 0); - const fquatSIMD fquatSIMD::XZW(1, 1, 0, 1); - const fquatSIMD fquatSIMD::YZW(1, 0, 1, 1); - const fquatSIMD fquatSIMD::XYZW(1, 1, 1, 1); -# endif - ////////////////////////////////////// // Implicit basic constructors diff --git a/glm/gtx/simd_vec4.hpp b/glm/gtx/simd_vec4.hpp index 3877f821..8e61311c 100644 --- a/glm/gtx/simd_vec4.hpp +++ b/glm/gtx/simd_vec4.hpp @@ -99,11 +99,6 @@ namespace detail typedef tvec4 pure_type; typedef tvec4 bool_type; -# ifdef GLM_META_PROG_HELPERS - static GLM_RELAXED_CONSTEXPR length_t components = 4; - static GLM_RELAXED_CONSTEXPR precision prec = defaultp; -# endif//GLM_META_PROG_HELPERS - #ifdef GLM_SIMD_ENABLE_XYZW_UNION union { @@ -114,25 +109,6 @@ namespace detail __m128 Data; #endif -# ifdef GLM_STATIC_CONST_MEMBERS - static const type ZERO; - static const type X; - static const type Y; - static const type Z; - static const type W; - static const type XY; - static const type XZ; - static const type XW; - static const type YZ; - static const type YW; - static const type ZW; - static const type XYZ; - static const type XYW; - static const type XZW; - static const type YZW; - static const type XYZW; -# endif - ////////////////////////////////////// // Implicit basic constructors diff --git a/glm/gtx/simd_vec4.inl b/glm/gtx/simd_vec4.inl index b1413eea..6271d0cf 100644 --- a/glm/gtx/simd_vec4.inl +++ b/glm/gtx/simd_vec4.inl @@ -16,25 +16,6 @@ struct shuffle_mask enum{value = Value}; }; -# ifdef GLM_STATIC_CONST_MEMBERS - const fvec4SIMD fvec4SIMD::ZERO(0, 0, 0, 0); - const fvec4SIMD fvec4SIMD::X(1, 0, 0, 0); - const fvec4SIMD fvec4SIMD::Y(0, 1, 0, 0); - const fvec4SIMD fvec4SIMD::Z(0, 0, 1, 0); - const fvec4SIMD fvec4SIMD::W(0, 0, 0, 1); - const fvec4SIMD fvec4SIMD::XY(1, 1, 0, 0); - const fvec4SIMD fvec4SIMD::XZ(1, 0, 1, 0); - const fvec4SIMD fvec4SIMD::XW(1, 0, 0, 1); - const fvec4SIMD fvec4SIMD::YZ(0, 1, 1, 0); - const fvec4SIMD fvec4SIMD::YW(0, 1, 0, 1); - const fvec4SIMD fvec4SIMD::ZW(0, 0, 1, 1); - const fvec4SIMD fvec4SIMD::XYZ(1, 1, 1, 0); - const fvec4SIMD fvec4SIMD::XYW(1, 1, 0, 1); - const fvec4SIMD fvec4SIMD::XZW(1, 0, 1, 1); - const fvec4SIMD fvec4SIMD::YZW(0, 1, 1, 1); - const fvec4SIMD fvec4SIMD::XYZW(1, 1, 1, 1); -# endif - ////////////////////////////////////// // Implicit basic constructors diff --git a/glm/gtx/type_trait.hpp b/glm/gtx/type_trait.hpp new file mode 100644 index 00000000..1875b1a0 --- /dev/null +++ b/glm/gtx/type_trait.hpp @@ -0,0 +1,224 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2016 G-Truc Creation (www.g-truc.net) +/// Permission is hereby granted, free of charge, to any person obtaining a copy +/// of this software and associated documentation files (the "Software"), to deal +/// in the Software without restriction, including without limitation the rights +/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +/// copies of the Software, and to permit persons to whom the Software is +/// furnished to do so, subject to the following conditions: +/// +/// The above copyright notice and this permission notice shall be included in +/// all copies or substantial portions of the Software. +/// +/// Restrictions: +/// By making use of the Software for military purposes, you choose to make +/// a Bunny unhappy. +/// +/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +/// THE SOFTWARE. +/// +/// @ref gtx_type_info +/// @file glm/gtx/type_info.hpp +/// @date 2016-03-12 / 2016-03-12 +/// @author Christophe Riccio +/// +/// @see core (dependence) +/// +/// @defgroup gtx_type_info GLM_GTX_type_info +/// @ingroup gtx +/// +/// @brief Defines aligned types. +/// +/// need to be included to use these functionalities. +/////////////////////////////////////////////////////////////////////////////////// + +#pragma once + +// Dependency: +#include "../detail/precision.hpp" +#include "../detail/setup.hpp" + +#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) +# pragma message("GLM: GLM_GTX_type_info extension included") +#endif + +namespace glm +{ + /// @addtogroup gtx_type_info + /// @{ + + template struct tvec1; + template struct tvec2; + template struct tvec3; + template struct tvec4; + + template struct tmat2x2; + template struct tmat2x3; + template struct tmat2x4; + template struct tmat3x2; + template struct tmat3x3; + template struct tmat3x4; + template struct tmat4x2; + template struct tmat4x3; + template struct tmat4x4; + + template struct tquat; + template struct tdualquat; + + template