Browse Source

Merge branch '0.9.0' into 0.9.1

Christophe Riccio 15 years ago
parent
commit
0a2873f83b
3 changed files with 23 additions and 0 deletions
  1. 4 0
      CMakeLists.txt
  2. 5 0
      glm/gtc/quaternion.hpp
  3. 14 0
      glm/gtc/quaternion.inl

+ 4 - 0
CMakeLists.txt

@@ -19,5 +19,9 @@ add_subdirectory(test)
 add_subdirectory(bench)
 add_subdirectory(bench)
 add_subdirectory(doc)
 add_subdirectory(doc)
 
 
+option(GLM_DEVELOPMENT_MODE "GLM development" OFF)
+if(NOT GLM_DEVELOPMENT_MODE)
+	message(FATAL_ERROR "GLM is a header only library, no need to build it")
+endif()
 
 
 
 

+ 5 - 0
glm/gtc/quaternion.hpp

@@ -78,6 +78,11 @@ namespace glm
 		detail::tquat<T> operator- (
 		detail::tquat<T> operator- (
 			detail::tquat<T> const & q);
 			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> 
 		template <typename T> 
 		detail::tvec3<T> operator* (
 		detail::tvec3<T> operator* (
 			detail::tquat<T> const & q, 
 			detail::tquat<T> const & q, 

+ 14 - 0
glm/gtc/quaternion.inl

@@ -156,6 +156,20 @@ namespace detail{
 		return detail::tquat<T>(-q.w, -q.x, -q.y, -q.z);
 		return detail::tquat<T>(-q.w, -q.x, -q.y, -q.z);
 	}
 	}
 
 
+	template <typename T> 
+	inline 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,
+	        q.w * p.x + q.x * p.w + q.y * p.z - q.z * p.y,
+	        q.w * p.y + q.y * p.w + q.z * p.x - q.x * p.z,
+	        q.w * p.z + q.z * p.w + q.x * p.y - q.y * p.x);
+	} 
+
 	// Transformation
 	// Transformation
 	template <typename T>
 	template <typename T>
 	inline detail::tvec3<T> operator* 
 	inline detail::tvec3<T> operator*