Browse Source

Fixed merge

Christophe Riccio 14 năm trước cách đây
mục cha
commit
8eee19e183

+ 1 - 1
glm/core/_detail.hpp

@@ -37,7 +37,7 @@ namespace detail
 {
 	class thalf;
 
-#if(__STDC_VERSION__ && (__STDC_VERSION__ >= 199901L)) // C99 detected, 64 bit types available
+#if(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) // C99 detected, 64 bit types available
 	typedef int64_t								sint64;
 	typedef uint64_t							uint64;
 #elif(GLM_COMPILER & GLM_COMPILER_VC)

+ 2 - 2
glm/gtc/quaternion.inl

@@ -107,7 +107,7 @@ namespace detail{
 		tmat3x3<T> const & m
 	)
     {
-		*this = toQuat(m);
+		*this = gtc::quaternion::quat_cast(m);
     }
 
     template <typename T> 
@@ -116,7 +116,7 @@ namespace detail{
 		tmat4x4<T> const & m
 	)
     {
-		*this = toQuat(m);
+		*this = gtc::quaternion::quat_cast(m);
     }
 
     //////////////////////////////////////////////////////////////

+ 28 - 0
glm/gtx/matrix_interpolation.inl

@@ -58,6 +58,34 @@ GLM_FUNC_QUALIFIER void axisAngle(
                 axis.x = (T)0.7071;
                 axis.y = (T)0.7071;
                 axis.z = (T)0.0;
+
+            angle = T(3.1415926535897932384626433832795);
+            T xx = (mat[0][0] + (T)1.0) / (T)2.0;
+            T yy = (mat[1][1] + (T)1.0) / (T)2.0;
+            T zz = (mat[2][2] + (T)1.0) / (T)2.0;
+            T xy = (mat[1][0] + mat[0][1]) / (T)4.0;
+            T xz = (mat[2][0] + mat[0][2]) / (T)4.0;
+            T yz = (mat[2][1] + mat[1][2]) / (T)4.0;
+            if ((xx > yy) && (xx > zz)) {
+                if (xx < epsilon) {
+                    axis.x = (T)0.0;
+                    axis.y = (T)0.7071;
+                    axis.z = (T)0.7071;
+                } else {
+                    axis.x = sqrt(xx);
+                    axis.y = xy / axis.x;
+                    axis.z = xz / axis.x;
+                }
+            } else if (yy > zz) {
+                if (yy < epsilon) {
+                    axis.x = (T)0.7071;
+                    axis.y = (T)0.0;
+                    axis.z = (T)0.7071;
+                } else {
+                    axis.y = sqrt(yy);
+                    axis.x = xy / axis.y;
+                    axis.z = yz / axis.y;
+                }
             } else {
                 axis.z = sqrt(zz);
                 axis.x = xz / axis.z;

+ 3 - 2
glm/gtx/matrix_query.hpp

@@ -22,11 +22,11 @@
 ///
 /// @ref gtx_matrix_query
 /// @file glm/gtx/matrix_query.hpp
-/// @date 2007-03-05 / 2011-06-07
+/// @date 2007-03-05 / 2011-08-28
 /// @author Christophe Riccio
 ///
 /// @see core (dependence)
-/// @see gtx_extented_min_max (dependence)
+/// @see gtx_vector_query (dependence)
 ///
 /// @defgroup gtx_matrix_query GLM_GTX_matrix_query: Query matrix properties
 /// @ingroup gtx
@@ -41,6 +41,7 @@
 
 // Dependency:
 #include "../glm.hpp"
+#include "../gtx/vector_query.hpp"
 
 #if(defined(GLM_MESSAGES) && !defined(glm_ext))
 #	pragma message("GLM: GLM_GTX_matrix_query extension included")