Browse Source

Fixed space characters

Christophe Riccio 12 years ago
parent
commit
d68fd2d97e
2 changed files with 18 additions and 13 deletions
  1. 12 12
      glm/gtx/vector_angle.inl
  2. 6 1
      readme.txt

+ 12 - 12
glm/gtx/vector_angle.inl

@@ -18,12 +18,12 @@ namespace glm
 	{
 	{
 		GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'angle' only accept floating-point inputs");
 		GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'angle' only accept floating-point inputs");
 
 
-        genType Dot = clamp(dot(x, y), genType(0), genType(1));
+		genType const Angle(acos(clamp(dot(x, y), genType(0), genType(1))));
 
 
 #ifdef GLM_FORCE_RADIANS
 #ifdef GLM_FORCE_RADIANS
-        return acos(Dot);
+		return Angle;
 #else
 #else
-        return degrees(acos(Dot));
+		return degrees(Angle);
 #endif
 #endif
 	}
 	}
 
 
@@ -36,12 +36,12 @@ namespace glm
 	{
 	{
 		GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'angle' only accept floating-point inputs");
 		GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'angle' only accept floating-point inputs");
 
 
-        T Dot = clamp(dot(x, y), T(0), T(1));
+		genType const Angle(acos(clamp(dot(x, y), T(0), T(1)));
 
 
 #ifdef GLM_FORCE_RADIANS
 #ifdef GLM_FORCE_RADIANS
-        return acos(Dot);
+		return Angle;
 #else
 #else
-        return degrees(acos(Dot));
+		return degrees(Angle);
 #endif
 #endif
 	}
 	}
 
 
@@ -55,12 +55,12 @@ namespace glm
 	{
 	{
 		GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'orientedAngle' only accept floating-point inputs");
 		GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'orientedAngle' only accept floating-point inputs");
 
 
-        T Dot = clamp(dot(x, y), T(0), T(1));
+		T const Dot = clamp(dot(x, y), T(0), T(1));
 
 
 #ifdef GLM_FORCE_RADIANS
 #ifdef GLM_FORCE_RADIANS
-        T const Angle(acos(Dot));
+		T const Angle(acos(Dot));
 #else
 #else
-        T const Angle(degrees(acos(Dot)));
+		T const Angle(degrees(acos(Dot)));
 #endif
 #endif
 		detail::tvec2<T, P> const TransformedVector(glm::rotate(x, Angle));
 		detail::tvec2<T, P> const TransformedVector(glm::rotate(x, Angle));
 		if(all(epsilonEqual(y, TransformedVector, T(0.01))))
 		if(all(epsilonEqual(y, TransformedVector, T(0.01))))
@@ -79,12 +79,12 @@ namespace glm
 	{
 	{
 		GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'orientedAngle' only accept floating-point inputs");
 		GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'orientedAngle' only accept floating-point inputs");
 
 
-        T Dot = clamp(dot(x, y), T(0), T(1));
+		T const Dot = clamp(dot(x, y), T(0), T(1));
 
 
 #ifdef GLM_FORCE_RADIANS
 #ifdef GLM_FORCE_RADIANS
-        T const Angle(acos(Dot));
+		T const Angle(acos(Dot));
 #else
 #else
-        T const Angle(degrees(acos(Dot)));
+		T const Angle(degrees(acos(Dot)));
 #endif
 #endif
 
 
 		if(dot(ref, cross(x, y)) < T(0))
 		if(dot(ref, cross(x, y)) < T(0))

+ 6 - 1
readme.txt

@@ -36,7 +36,12 @@ GLM is a header only library, there is nothing to build, just include it.
 More informations in GLM manual:
 More informations in GLM manual:
 http://glm.g-truc.net/glm.pdf
 http://glm.g-truc.net/glm.pdf
 
 
-================================================================================s
+================================================================================
+GLM 0.9.5.1: 2014-XX-XX
+--------------------------------------------------------------------------------
+- Fixed angle and orientedAngle that sometimes return NaN values (#145)
+
+================================================================================
 GLM 0.9.5.0: 2013-12-25
 GLM 0.9.5.0: 2013-12-25
 --------------------------------------------------------------------------------
 --------------------------------------------------------------------------------
 - Added forward declarations (glm/fwd.hpp) for faster compilations
 - Added forward declarations (glm/fwd.hpp) for faster compilations