diff --git a/glm/core/setup.hpp b/glm/core/setup.hpp index c08a39a6..4b2eefb1 100644 --- a/glm/core/setup.hpp +++ b/glm/core/setup.hpp @@ -149,13 +149,10 @@ // G++ #elif defined(__GNUC__) || defined(__llvm__) || defined(__clang__) # if defined (__llvm__) -# pragma message("LLVM") # define GLM_COMPILER_GCC_EXTRA GLM_COMPILER_GCC_LLVM # elif defined (__clang__) -# pragma message("CLANG") # define GLM_COMPILER_GCC_EXTRA GLM_COMPILER_GCC_CLANG # else -# pragma message("GCC") # define GLM_COMPILER_GCC_EXTRA 0 # endif # diff --git a/glm/gtc/quaternion.hpp b/glm/gtc/quaternion.hpp index 923b810c..25a886f8 100644 --- a/glm/gtc/quaternion.hpp +++ b/glm/gtc/quaternion.hpp @@ -80,6 +80,11 @@ namespace detail detail::tquat operator- ( detail::tquat const & q); + template + detail::tquat operator+ ( + detail::tquat const & q, + detail::tquat const & p); + template detail::tquat operator* ( detail::tquat const & q, @@ -160,7 +165,7 @@ namespace quaternion ///< GLM_GTC_quaternion extension: Quaternion types and fun detail::tquat mix( detail::tquat const & x, detail::tquat const & y, - typename detail::tquat::value_type const & a); + T const & a); //! Returns the q conjugate. //! From GLM_GTC_quaternion extension. diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index 27a5c541..e262c663 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -156,6 +156,20 @@ namespace detail{ return detail::tquat(-q.w, -q.x, -q.y, -q.z); } + template + GLM_FUNC_QUALIFIER detail::tquat operator+ + ( + detail::tquat const & q, + detail::tquat const & p + ) + { + return detail::tquat( + q.w + p.w, + q.x + p.x, + q.y + p.y, + q.z + p.z); + } + template GLM_FUNC_QUALIFIER detail::tquat operator* ( diff --git a/glm/gtx/integer.inl b/glm/gtx/integer.inl index aef659e0..e9c93c0f 100644 --- a/glm/gtx/integer.inl +++ b/glm/gtx/integer.inl @@ -49,9 +49,10 @@ namespace integer template GLM_FUNC_QUALIFIER genType factorial(genType const & x) { + genType Temp = x; genType Result; - for(Result = 1; x > 1; --x) - Result *= x; + for(Result = 1; Temp > 1; --Temp) + Result *= Temp; return Result; } diff --git a/test/gtc/gtc_quaternion.cpp b/test/gtc/gtc_quaternion.cpp index 689cfe27..00ed0503 100644 --- a/test/gtc/gtc_quaternion.cpp +++ b/test/gtc/gtc_quaternion.cpp @@ -27,7 +27,7 @@ int test_quat_slerp() glm::quat B(90.0f, glm::vec3(0, 0, 1)); glm::quat C = glm::mix(A, B, 0.5f); - Error += C != glm::quat(45.f, glm::vec3(0, 0, 1)) ? 0 : 1; + Error += C == glm::quat(45.f, glm::vec3(0, 0, 1)) ? 0 : 1; return Error; }