diff --git a/glm/gtc/matrix_transform.inl b/glm/gtc/matrix_transform.inl index 965fffd7..bd64eae7 100644 --- a/glm/gtc/matrix_transform.inl +++ b/glm/gtc/matrix_transform.inl @@ -75,6 +75,7 @@ namespace glm #ifdef GLM_FORCE_RADIANS T a = angle; #else +# pragma message("GLM: rotate function taking degrees as a parameter is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") T a = radians(angle); #endif T c = cos(a); @@ -116,6 +117,7 @@ namespace glm #ifdef GLM_FORCE_RADIANS T const a = angle; #else +# pragma message("GLM: rotate_slow function taking degrees as a parameter is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") T const a = radians(angle); #endif T c = cos(a); @@ -248,6 +250,7 @@ namespace glm #ifdef GLM_FORCE_RADIANS valType const rad = fovy; #else +# pragma message("GLM: perspective function taking degrees as a parameter is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") valType const rad = glm::radians(fovy); #endif @@ -279,6 +282,7 @@ namespace glm #ifdef GLM_FORCE_RADIANS valType rad = fov; #else +# pragma message("GLM: perspectiveFov function taking degrees as a parameter is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") valType rad = glm::radians(fov); #endif valType h = glm::cos(valType(0.5) * rad) / glm::sin(valType(0.5) * rad); @@ -304,6 +308,7 @@ namespace glm #ifdef GLM_FORCE_RADIANS T const range = tan(fovy / T(2)) * zNear; #else +# pragma message("GLM: infinitePerspective function taking degrees as a parameter is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") T const range = tan(radians(fovy / T(2))) * zNear; #endif T left = -range * aspect; @@ -331,6 +336,7 @@ namespace glm #ifdef GLM_FORCE_RADIANS T range = tan(fovy / T(2)) * zNear; #else +# pragma message("GLM: tweakedInfinitePerspective function taking degrees as a parameter is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") T range = tan(radians(fovy / T(2))) * zNear; #endif T left = -range * aspect; diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index 2cf8a903..c407a4ae 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -617,7 +617,7 @@ namespace detail GLM_FUNC_QUALIFIER detail::tquat rotate ( detail::tquat const & q, - typename detail::tquat::T const & angle, + typename detail::tquat::value_type const & angle, detail::tvec3 const & v ) { @@ -636,6 +636,7 @@ namespace detail #ifdef GLM_FORCE_RADIANS T const AngleRad(angle); #else +# pragma message("GLM: rotate function taking degrees as a parameter is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") T const AngleRad = radians(angle); #endif T const Sin = sin(AngleRad * T(0.5)); @@ -662,6 +663,7 @@ namespace detail #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)); #else +# 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)); #endif } @@ -675,6 +677,7 @@ namespace detail #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)); #else +# 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)); #endif } @@ -688,6 +691,7 @@ namespace detail #ifdef GLM_FORCE_RADIANS return asin(T(-2) * (q.x * q.z - q.w * q.y)); #else +# pragma message("GLM: yaw function returning degrees is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") return glm::degrees(asin(T(-2) * (q.x * q.z - q.w * q.y))); #endif } @@ -817,6 +821,7 @@ namespace detail #ifdef GLM_FORCE_RADIANS return acos(x.w) * T(2); #else +# pragma message("GLM: angle function returning degrees is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") return glm::degrees(acos(x.w) * T(2)); #endif } @@ -846,6 +851,7 @@ namespace detail #ifdef GLM_FORCE_RADIANS T const a(angle); #else +# pragma message("GLM: angleAxis function taking degrees as a parameter is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") T const a(glm::radians(angle)); #endif T s = glm::sin(a * T(0.5)); diff --git a/glm/gtx/polar_coordinates.inl b/glm/gtx/polar_coordinates.inl index 43718d7f..aed981f7 100644 --- a/glm/gtx/polar_coordinates.inl +++ b/glm/gtx/polar_coordinates.inl @@ -25,6 +25,7 @@ namespace glm atan(tmp.x, tmp.z), // longitude xz_dist); // xz distance #else +# pragma message("GLM: polar function returning degrees is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") return detail::tvec3( degrees(atan(xz_dist, tmp.y)), // latitude degrees(atan(tmp.x, tmp.z)), // longitude @@ -42,6 +43,7 @@ namespace glm T const latitude(polar.x); T const longitude(polar.y); #else +# pragma message("GLM: euclidean function taking degrees as parameters is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") T const latitude(radians(polar.x)); T const longitude(radians(polar.y)); #endif diff --git a/glm/gtx/rotate_normalized_axis.inl b/glm/gtx/rotate_normalized_axis.inl index e9aa3cee..343f9185 100644 --- a/glm/gtx/rotate_normalized_axis.inl +++ b/glm/gtx/rotate_normalized_axis.inl @@ -39,6 +39,7 @@ namespace glm #ifdef GLM_FORCE_RADIANS T a = angle; #else +# pragma message("GLM: rotateNormalizedAxis function taking degrees as parameters is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") T a = radians(angle); #endif T c = cos(a); @@ -82,6 +83,7 @@ namespace glm #ifdef GLM_FORCE_RADIANS T const AngleRad(angle); #else +# pragma message("GLM: rotateNormalizedAxis function taking degrees as parameters is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") T const AngleRad = radians(angle); #endif T const Sin = sin(AngleRad * T(0.5)); diff --git a/glm/gtx/rotate_vector.inl b/glm/gtx/rotate_vector.inl index bbec1e20..6f621fab 100644 --- a/glm/gtx/rotate_vector.inl +++ b/glm/gtx/rotate_vector.inl @@ -21,6 +21,7 @@ namespace glm T const Cos(cos(angle)); T const Sin(sin(angle)); #else +# pragma message("GLM: rotate function taking degrees as parameters is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") T const Cos = cos(radians(angle)); T const Sin = sin(radians(angle)); #endif @@ -75,6 +76,7 @@ namespace glm T const Cos(cos(angle)); T const Sin(sin(angle)); #else +# pragma message("GLM: rotateX function taking degrees as parameters is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") T const Cos = cos(radians(angle)); T const Sin = sin(radians(angle)); #endif @@ -97,6 +99,7 @@ namespace glm T const Cos(cos(angle)); T const Sin(sin(angle)); #else +# pragma message("GLM: rotateY function taking degrees as parameters is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") T const Cos(cos(radians(angle))); T const Sin(sin(radians(angle))); #endif @@ -119,6 +122,7 @@ namespace glm T const Cos(cos(angle)); T const Sin(sin(angle)); #else +# pragma message("GLM: rotateZ function taking degrees as parameters is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") T const Cos(cos(radians(angle))); T const Sin(sin(radians(angle))); #endif @@ -141,6 +145,7 @@ namespace glm T const Cos(cos(angle)); T const Sin(sin(angle)); #else +# pragma message("GLM: rotateX function taking degrees as parameters is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") T const Cos(cos(radians(angle))); T const Sin(sin(radians(angle))); #endif @@ -163,6 +168,7 @@ namespace glm T const Cos(cos(angle)); T const Sin(sin(angle)); #else +# pragma message("GLM: rotateX function taking degrees as parameters is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") T const Cos(cos(radians(angle))); T const Sin(sin(radians(angle))); #endif @@ -185,6 +191,7 @@ namespace glm T const Cos(cos(angle)); T const Sin(sin(angle)); #else +# pragma message("GLM: rotateZ function taking degrees as parameters is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") T const Cos(cos(radians(angle))); T const Sin(sin(radians(angle))); #endif @@ -208,6 +215,7 @@ namespace glm # ifdef GLM_FORCE_RADIANS T Angle = acos(dot(Normal, Up)); # else +# pragma message("GLM: rotateZ function taking degrees as parameters is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") T Angle = degrees(acos(dot(Normal, Up))); # endif return rotate(Angle, RotationAxis); diff --git a/glm/gtx/simd_quat.inl b/glm/gtx/simd_quat.inl index 1eb14f62..7c21e178 100644 --- a/glm/gtx/simd_quat.inl +++ b/glm/gtx/simd_quat.inl @@ -584,15 +584,16 @@ GLM_FUNC_QUALIFIER detail::fquatSIMD angleAxisSIMD #ifdef GLM_FORCE_RADIANS float a(angle); #else +# pragma message("GLM: rotateZ function taking degrees as parameters is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") float a(glm::radians(angle)); #endif float s = glm::sin(a * 0.5f); - return _mm_set_ps( - glm::cos(a * 0.5f), - v.z * s, - v.y * s, - v.x * s); + return _mm_set_ps( + glm::cos(a * 0.5f), + v.z * s, + v.y * s, + v.x * s); } GLM_FUNC_QUALIFIER detail::fquatSIMD angleAxisSIMD diff --git a/glm/gtx/vector_angle.inl b/glm/gtx/vector_angle.inl index c361314b..a6f85a3d 100644 --- a/glm/gtx/vector_angle.inl +++ b/glm/gtx/vector_angle.inl @@ -23,6 +23,7 @@ namespace glm #ifdef GLM_FORCE_RADIANS return Angle; #else +# pragma message("GLM: angle function returning degrees is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") return degrees(Angle); #endif } @@ -41,6 +42,7 @@ namespace glm #ifdef GLM_FORCE_RADIANS return Angle; #else +# pragma message("GLM: angle function returning degrees is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") return degrees(Angle); #endif } @@ -60,6 +62,7 @@ namespace glm #ifdef GLM_FORCE_RADIANS T const Angle(acos(Dot)); #else +# pragma message("GLM: orientedAngle function returning degrees is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") T const Angle(degrees(acos(Dot))); #endif detail::tvec2 const TransformedVector(glm::rotate(x, Angle)); @@ -84,6 +87,7 @@ namespace glm #ifdef GLM_FORCE_RADIANS T const Angle(acos(Dot)); #else +# pragma message("GLM: orientedAngle function returning degrees is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.") T const Angle(degrees(acos(Dot))); #endif diff --git a/readme.txt b/readme.txt index ea6fc64a..90588369 100644 --- a/readme.txt +++ b/readme.txt @@ -40,6 +40,7 @@ http://glm.g-truc.net/glm.pdf GLM 0.9.5.1: 2014-XX-XX -------------------------------------------------------------------------------- - Fixed angle and orientedAngle that sometimes return NaN values (#145) +- Deprecated degrees for function parameters and display a message. ================================================================================ GLM 0.9.5.0: 2013-12-25