From 1c85dcefd416fdd96e2d3e247e64b7aa7cfc3d2d Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 6 May 2011 13:29:43 +0100 Subject: [PATCH] Fixed GTX_matrix_interpolation warnings --- glm/gtx/matrix_interpolation.inl | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/glm/gtx/matrix_interpolation.inl b/glm/gtx/matrix_interpolation.inl index 0571afe4..ab4d2bb4 100644 --- a/glm/gtx/matrix_interpolation.inl +++ b/glm/gtx/matrix_interpolation.inl @@ -11,9 +11,8 @@ namespace glm{ namespace gtx{ namespace matrix_interpolation { - template - inline void axisAngle( + GLM_FUNC_QUALIFIER void axisAngle( detail::tmat4x4 const & mat, detail::tvec3 & axis, T & angle) @@ -70,7 +69,7 @@ namespace matrix_interpolation return; } T s = sqrt((mat[2][1] - mat[1][2]) * (mat[2][1] - mat[1][2]) + (mat[2][0] - mat[0][2]) * (mat[2][0] - mat[0][2]) + (mat[1][0] - mat[0][1]) * (mat[1][0] - mat[0][1])); - if (fabs(s) < 0.001) + if (glm::abs(s) < T(0.001)) s = (T)1.0; angle = acos((mat[0][0] + mat[1][1] + mat[2][2] - (T)1.0) / (T)2.0); axis.x = (mat[1][2] - mat[2][1]) / s; @@ -79,25 +78,25 @@ namespace matrix_interpolation } template - inline detail::tmat4x4 axisAngleMatrix( + GLM_FUNC_QUALIFIER detail::tmat4x4 axisAngleMatrix( detail::tvec3 const & axis, T const angle) { T c = cos(angle); T s = sin(angle); - T t = 1.0 - c; + T t = T(1) - c; detail::tvec3 n = normalize(axis); return detail::tmat4x4( - t * n.x * n.x + c, t * n.x * n.y + n.z * s, t * n.x * n.z - n.y * s, 0.0, - t * n.x * n.y - n.z * s, t * n.y * n.y + c, t * n.y * n.z + n.x * s, 0.0, - t * n.x * n.z + n.y * s, t * n.y * n.z - n.x * s, t * n.z * n.z + c, 0.0, - 0.0, 0.0, 0.0, 1.0 + t * n.x * n.x + c, t * n.x * n.y + n.z * s, t * n.x * n.z - n.y * s, T(0), + t * n.x * n.y - n.z * s, t * n.y * n.y + c, t * n.y * n.z + n.x * s, T(0), + t * n.x * n.z + n.y * s, t * n.y * n.z - n.x * s, t * n.z * n.z + c, T(0), + T(0), T(0), T(0), T(1) ); } template - inline detail::tmat4x4 interpolate( + GLM_FUNC_QUALIFIER detail::tmat4x4 interpolate( detail::tmat4x4 const & m1, detail::tmat4x4 const & m2, T const delta)