Browse Source

Back ported to GLM 0.9.4 of glm::oriented[angle] not supporting GLM_FORCE_RADIANS #143

Christophe Riccio 12 years ago
parent
commit
e95993407c
1 changed files with 9 additions and 1 deletions
  1. 9 1
      glm/gtx/vector_angle.inl

+ 9 - 1
glm/gtx/vector_angle.inl

@@ -16,7 +16,11 @@ namespace glm
 		genType const & y
 	)
 	{
+#ifdef GLM_FORCE_RADIANS
+		return acos(dot(x, y));
+#else
 		return degrees(acos(dot(x, y)));
+#endif
 	}
 
 	//! \todo epsilon is hard coded to 0.01
@@ -47,7 +51,11 @@ namespace glm
 		detail::tvec3<valType> const & ref
 	)
 	{
-		valType const Angle(glm::degrees(glm::acos(glm::dot(x, y))));
+#ifdef GLM_FORCE_RADIANS
+		valType const Angle(acos(dot(x, y)));
+#else
+		valType const Angle(glm::degrees(acos(dot(x, y))));
+#endif
 
 		if(glm::dot(ref, glm::cross(x, y)) < valType(0))
 			return -Angle;