Browse Source

Merge branch '0.9.2' into 0.9.3

Christophe Riccio 14 years ago
parent
commit
fc8a5d4c0a
5 changed files with 24 additions and 7 deletions
  1. 0 3
      glm/core/setup.hpp
  2. 6 1
      glm/gtc/quaternion.hpp
  3. 14 0
      glm/gtc/quaternion.inl
  4. 3 2
      glm/gtx/integer.inl
  5. 1 1
      test/gtc/gtc_quaternion.cpp

+ 0 - 3
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
 #

+ 6 - 1
glm/gtc/quaternion.hpp

@@ -80,6 +80,11 @@ namespace detail
 	detail::tquat<T> operator- (
 		detail::tquat<T> const & q);
 
+	template <typename T> 
+	detail::tquat<T> operator+ ( 
+		detail::tquat<T> const & q, 
+		detail::tquat<T> const & p); 
+
 	template <typename T> 
 	detail::tquat<T> operator* ( 
 		detail::tquat<T> const & q, 
@@ -160,7 +165,7 @@ namespace quaternion ///< GLM_GTC_quaternion extension: Quaternion types and fun
 	detail::tquat<T> mix(
 		detail::tquat<T> const & x, 
 		detail::tquat<T> const & y, 
-		typename detail::tquat<T>::value_type const & a);
+		T const & a);
 		
 	//! Returns the q conjugate. 
 	//! From GLM_GTC_quaternion extension.

+ 14 - 0
glm/gtc/quaternion.inl

@@ -156,6 +156,20 @@ namespace detail{
 		return detail::tquat<T>(-q.w, -q.x, -q.y, -q.z);
 	}
 
+	template <typename T> 
+	GLM_FUNC_QUALIFIER detail::tquat<T> operator+
+	( 
+		detail::tquat<T> const & q, 
+		detail::tquat<T> const & p
+	) 
+	{ 
+        return detail::tquat<T>(
+            q.w + p.w,
+	        q.x + p.x,
+	        q.y + p.y,
+	        q.z + p.z);
+	} 
+
 	template <typename T> 
 	GLM_FUNC_QUALIFIER detail::tquat<T> operator*
 	( 

+ 3 - 2
glm/gtx/integer.inl

@@ -49,9 +49,10 @@ namespace integer
 	template <typename genType>
     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;
     }
 

+ 1 - 1
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;
 }