diff --git a/glm/core/_detail.hpp b/glm/core/_detail.hpp index 069a9831..f78ea470 100644 --- a/glm/core/_detail.hpp +++ b/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) diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index 426a20f4..78e311fd 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -107,7 +107,7 @@ namespace detail{ tmat3x3 const & m ) { - *this = toQuat(m); + *this = gtc::quaternion::quat_cast(m); } template @@ -116,7 +116,7 @@ namespace detail{ tmat4x4 const & m ) { - *this = toQuat(m); + *this = gtc::quaternion::quat_cast(m); } ////////////////////////////////////////////////////////////// diff --git a/glm/gtx/matrix_interpolation.inl b/glm/gtx/matrix_interpolation.inl index 224f61cf..df99b9e8 100644 --- a/glm/gtx/matrix_interpolation.inl +++ b/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; diff --git a/glm/gtx/matrix_query.hpp b/glm/gtx/matrix_query.hpp index aa68b284..1d76e868 100644 --- a/glm/gtx/matrix_query.hpp +++ b/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")