Browse Source

Fixed GLM_FORCE_RADIANS with <glm/ext.hpp> build error (#165)

Christophe Riccio 12 years ago
parent
commit
6aa34be6ad
3 changed files with 7 additions and 3 deletions
  1. 2 2
      glm/gtc/quaternion.inl
  2. 1 0
      readme.txt
  3. 4 1
      test/gtx/gtx_quaternion.cpp

+ 2 - 2
glm/gtc/quaternion.inl

@@ -661,7 +661,7 @@ namespace detail
 	)
 	)
 	{
 	{
 #ifdef GLM_FORCE_RADIANS
 #ifdef GLM_FORCE_RADIANS
-		return T(atan2(T(2) * (q.x * q.y + q.w * q.z), q.w * q.w + q.x * q.x - q.y * q.y - q.z * q.z));
+		return T(atan(T(2) * (q.x * q.y + q.w * q.z), q.w * q.w + q.x * q.x - q.y * q.y - q.z * q.z));
 #else
 #else
 #		pragma message("GLM: roll function returning degrees is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.")
 #		pragma message("GLM: roll function returning degrees is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.")
 		return glm::degrees(atan(T(2) * (q.x * q.y + q.w * q.z), q.w * q.w + q.x * q.x - q.y * q.y - q.z * q.z));
 		return glm::degrees(atan(T(2) * (q.x * q.y + q.w * q.z), q.w * q.w + q.x * q.x - q.y * q.y - q.z * q.z));
@@ -675,7 +675,7 @@ namespace detail
 	)
 	)
 	{
 	{
 #ifdef GLM_FORCE_RADIANS
 #ifdef GLM_FORCE_RADIANS
-		return T(atan2(T(2) * (q.y * q.z + q.w * q.x), q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z));
+		return T(atan(T(2) * (q.y * q.z + q.w * q.x), q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z));
 #else
 #else
 #		pragma message("GLM: pitch function returning degrees is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.")
 #		pragma message("GLM: pitch function returning degrees is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.")
 		return glm::degrees(atan(T(2) * (q.y * q.z + q.w * q.x), q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z));
 		return glm::degrees(atan(T(2) * (q.y * q.z + q.w * q.x), q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z));

+ 1 - 0
readme.txt

@@ -45,6 +45,7 @@ GLM 0.9.5.2: 2014-02-08
 - Fixed mix function link error
 - Fixed mix function link error
 - Fixed SSE code included in GLM tests on "pure" platforms
 - Fixed SSE code included in GLM tests on "pure" platforms
 - Fixed undefined reference to fastInverseSqrt (#161)
 - Fixed undefined reference to fastInverseSqrt (#161)
+- Fixed GLM_FORCE_RADIANS with <glm/ext.hpp> build error (#165)
 
 
 ================================================================================
 ================================================================================
 GLM 0.9.5.1: 2014-01-11
 GLM 0.9.5.1: 2014-01-11

+ 4 - 1
test/gtx/gtx_quaternion.cpp

@@ -8,9 +8,12 @@
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 
 #define GLM_FORCE_RADIANS
 #define GLM_FORCE_RADIANS
-#include <glm/glm.hpp>
 #include <glm/gtc/epsilon.hpp>
 #include <glm/gtc/epsilon.hpp>
+#include <glm/gtc/type_ptr.hpp>
+#include <glm/gtc/matrix_transform.hpp>
+#include <glm/gtx/transform.hpp>
 #include <glm/gtx/quaternion.hpp>
 #include <glm/gtx/quaternion.hpp>
+#include <glm/ext.hpp>
 
 
 int test_quat_fastMix()
 int test_quat_fastMix()
 {
 {