Removed last references to GLM_FORCE_RADIANS
This commit is contained in:
@@ -29,7 +29,6 @@
|
||||
/// dummy.cpp exist only a wordaround for CMake file.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define GLM_FORCE_RADIANS
|
||||
#define GLM_MESSAGES
|
||||
#include "../glm.hpp"
|
||||
#include <limits>
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace glm
|
||||
/// Builds a rotation 4 * 4 matrix created from an axis vector and an angle.
|
||||
///
|
||||
/// @param m Input matrix multiplied by this rotation matrix.
|
||||
/// @param angle Rotation angle expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise.
|
||||
/// @param angle Rotation angle expressed in radians.
|
||||
/// @param axis Rotation axis, recommanded to be normalized.
|
||||
/// @tparam T Value type used to build the matrix. Supported: half, float or double.
|
||||
/// @see gtc_matrix_transform
|
||||
@@ -175,7 +175,7 @@ namespace glm
|
||||
|
||||
/// Creates a matrix for a symetric perspective-view frustum.
|
||||
///
|
||||
/// @param fovy Expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise.
|
||||
/// @param fovy Expressed in radians.
|
||||
/// @param aspect
|
||||
/// @param near
|
||||
/// @param far
|
||||
@@ -190,7 +190,7 @@ namespace glm
|
||||
|
||||
/// Builds a perspective projection matrix based on a field of view.
|
||||
///
|
||||
/// @param fov Expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise.
|
||||
/// @param fov Expressed in radians.
|
||||
/// @param width
|
||||
/// @param height
|
||||
/// @param near
|
||||
@@ -207,7 +207,7 @@ namespace glm
|
||||
|
||||
/// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite.
|
||||
///
|
||||
/// @param fovy Expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise.
|
||||
/// @param fovy Expressed in radians.
|
||||
/// @param aspect
|
||||
/// @param near
|
||||
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
|
||||
@@ -218,7 +218,7 @@ namespace glm
|
||||
|
||||
/// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping.
|
||||
///
|
||||
/// @param fovy Expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise.
|
||||
/// @param fovy Expressed in radians.
|
||||
/// @param aspect
|
||||
/// @param near
|
||||
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
|
||||
@@ -229,7 +229,7 @@ namespace glm
|
||||
|
||||
/// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping.
|
||||
///
|
||||
/// @param fovy Expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise.
|
||||
/// @param fovy Expressed in radians.
|
||||
/// @param aspect
|
||||
/// @param near
|
||||
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
|
||||
|
||||
@@ -52,14 +52,9 @@ namespace glm
|
||||
detail::tvec3<T, P> const & v
|
||||
)
|
||||
{
|
||||
#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);
|
||||
T s = sin(a);
|
||||
T const a = angle;
|
||||
T const c = cos(a);
|
||||
T const s = sin(a);
|
||||
|
||||
detail::tvec3<T, P> axis(normalize(v));
|
||||
detail::tvec3<T, P> temp((T(1) - c) * axis);
|
||||
@@ -93,14 +88,9 @@ namespace glm
|
||||
detail::tvec3<T, P> const & v
|
||||
)
|
||||
{
|
||||
#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);
|
||||
T s = sin(a);
|
||||
T const c = cos(a);
|
||||
T const s = sin(a);
|
||||
detail::tmat4x4<T, P> Result;
|
||||
|
||||
detail::tvec3<T, P> axis = normalize(v);
|
||||
@@ -126,10 +116,10 @@ namespace glm
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> scale
|
||||
(
|
||||
(
|
||||
detail::tmat4x4<T, P> const & m,
|
||||
detail::tvec3<T, P> const & v
|
||||
)
|
||||
)
|
||||
{
|
||||
detail::tmat4x4<T, P> Result(detail::tmat4x4<T, P>::_null);
|
||||
Result[0] = m[0] * v[0];
|
||||
@@ -226,14 +216,8 @@ namespace glm
|
||||
assert(aspect != static_cast<T>(0));
|
||||
assert(zFar != zNear);
|
||||
|
||||
#ifdef GLM_FORCE_RADIANS
|
||||
T 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.")
|
||||
T const rad = glm::radians(fovy);
|
||||
#endif
|
||||
|
||||
T tanHalfFovy = tan(rad / static_cast<T>(2));
|
||||
T const tanHalfFovy = tan(rad / static_cast<T>(2));
|
||||
|
||||
detail::tmat4x4<T, defaultp> Result(static_cast<T>(0));
|
||||
Result[0][0] = static_cast<T>(1) / (aspect * tanHalfFovy);
|
||||
@@ -258,14 +242,9 @@ namespace glm
|
||||
assert(height > static_cast<T>(0));
|
||||
assert(fov > static_cast<T>(0));
|
||||
|
||||
#ifdef GLM_FORCE_RADIANS
|
||||
T 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.")
|
||||
T rad = glm::radians(fov);
|
||||
#endif
|
||||
T h = glm::cos(static_cast<T>(0.5) * rad) / glm::sin(static_cast<T>(0.5) * rad);
|
||||
T w = h * height / width; ///todo max(width , Height) / min(width , Height)?
|
||||
T const rad = fov;
|
||||
T const h = glm::cos(static_cast<T>(0.5) * rad) / glm::sin(static_cast<T>(0.5) * rad);
|
||||
T const w = h * height / width; ///todo max(width , Height) / min(width , Height)?
|
||||
|
||||
detail::tmat4x4<T, defaultp> Result(static_cast<T>(0));
|
||||
Result[0][0] = w;
|
||||
@@ -284,16 +263,11 @@ namespace glm
|
||||
T zNear
|
||||
)
|
||||
{
|
||||
#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;
|
||||
T right = range * aspect;
|
||||
T bottom = -range;
|
||||
T top = range;
|
||||
T const range = tan(fovy / T(2)) * zNear;
|
||||
T const left = -range * aspect;
|
||||
T const right = range * aspect;
|
||||
T const bottom = -range;
|
||||
T const top = range;
|
||||
|
||||
detail::tmat4x4<T, defaultp> Result(T(0));
|
||||
Result[0][0] = (T(2) * zNear) / (right - left);
|
||||
@@ -314,16 +288,11 @@ namespace glm
|
||||
T ep
|
||||
)
|
||||
{
|
||||
#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;
|
||||
T right = range * aspect;
|
||||
T bottom = -range;
|
||||
T top = range;
|
||||
T const range = tan(fovy / T(2)) * zNear;
|
||||
T const left = -range * aspect;
|
||||
T const right = range * aspect;
|
||||
T const bottom = -range;
|
||||
T const top = range;
|
||||
|
||||
detail::tmat4x4<T, defaultp> Result(T(0));
|
||||
Result[0][0] = (static_cast<T>(2) * zNear) / (right - left);
|
||||
@@ -420,9 +389,9 @@ namespace glm
|
||||
detail::tvec3<T, P> const & up
|
||||
)
|
||||
{
|
||||
detail::tvec3<T, P> f(normalize(center - eye));
|
||||
detail::tvec3<T, P> s(normalize(cross(f, up)));
|
||||
detail::tvec3<T, P> u(cross(s, f));
|
||||
detail::tvec3<T, P> const f(normalize(center - eye));
|
||||
detail::tvec3<T, P> const s(normalize(cross(f, up)));
|
||||
detail::tvec3<T, P> const u(cross(s, f));
|
||||
|
||||
detail::tmat4x4<T, P> Result(1);
|
||||
Result[0][0] = s.x;
|
||||
|
||||
@@ -247,7 +247,7 @@ namespace detail
|
||||
/// Rotates a quaternion from a vector of 3 components axis and an angle.
|
||||
///
|
||||
/// @param q Source orientation
|
||||
/// @param angle Angle expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise.
|
||||
/// @param angle Angle expressed in radians.
|
||||
/// @param axis Axis of the rotation
|
||||
///
|
||||
/// @see gtc_quaternion
|
||||
@@ -265,19 +265,19 @@ namespace detail
|
||||
GLM_FUNC_DECL detail::tvec3<T, P> eulerAngles(
|
||||
detail::tquat<T, P> const & x);
|
||||
|
||||
/// Returns roll value of euler angles expressed in radians if GLM_FORCE_RADIANS is defined or degrees otherwise.
|
||||
/// Returns roll value of euler angles expressed in radians.
|
||||
///
|
||||
/// @see gtx_quaternion
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL T roll(detail::tquat<T, P> const & x);
|
||||
|
||||
/// Returns pitch value of euler angles expressed in radians if GLM_FORCE_RADIANS is defined or degrees otherwise.
|
||||
/// Returns pitch value of euler angles expressed in radians.
|
||||
///
|
||||
/// @see gtx_quaternion
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL T pitch(detail::tquat<T, P> const & x);
|
||||
|
||||
/// Returns yaw value of euler angles expressed in radians if GLM_FORCE_RADIANS is defined or degrees otherwise.
|
||||
/// Returns yaw value of euler angles expressed in radians.
|
||||
///
|
||||
/// @see gtx_quaternion
|
||||
template <typename T, precision P>
|
||||
@@ -326,7 +326,7 @@ namespace detail
|
||||
|
||||
/// Build a quaternion from an angle and a normalized axis.
|
||||
///
|
||||
/// @param angle Angle expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise.
|
||||
/// @param angle Angle expressed in radians.
|
||||
/// @param axis Axis of the quaternion, must be normalized.
|
||||
///
|
||||
/// @see gtc_quaternion
|
||||
|
||||
@@ -615,12 +615,7 @@ namespace detail
|
||||
Tmp.z *= oneOverLen;
|
||||
}
|
||||
|
||||
#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));
|
||||
|
||||
return q * detail::tquat<T, P>(cos(AngleRad * T(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin);
|
||||
@@ -642,12 +637,7 @@ namespace detail
|
||||
detail::tquat<T, P> const & q
|
||||
)
|
||||
{
|
||||
#ifdef GLM_FORCE_RADIANS
|
||||
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
|
||||
# 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
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@@ -656,12 +646,7 @@ namespace detail
|
||||
detail::tquat<T, P> const & q
|
||||
)
|
||||
{
|
||||
#ifdef GLM_FORCE_RADIANS
|
||||
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
|
||||
# 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
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@@ -670,12 +655,7 @@ namespace detail
|
||||
detail::tquat<T, P> const & q
|
||||
)
|
||||
{
|
||||
#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
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@@ -800,12 +780,7 @@ namespace detail
|
||||
detail::tquat<T, P> const & x
|
||||
)
|
||||
{
|
||||
#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
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@@ -830,15 +805,10 @@ namespace detail
|
||||
{
|
||||
detail::tquat<T, P> result;
|
||||
|
||||
#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));
|
||||
T const s = glm::sin(a * static_cast<T>(0.5));
|
||||
|
||||
result.w = glm::cos(a * T(0.5));
|
||||
result.w = glm::cos(a * static_cast<T>(0.5));
|
||||
result.x = v.x * s;
|
||||
result.y = v.y * s;
|
||||
result.z = v.z * s;
|
||||
|
||||
@@ -47,13 +47,9 @@ namespace glm
|
||||
detail::tmat3x3<T, P> const & m,
|
||||
T const & angle)
|
||||
{
|
||||
#ifdef GLM_FORCE_RADIANS
|
||||
T a = angle;
|
||||
#else
|
||||
T a = radians(angle);
|
||||
#endif
|
||||
T c = cos(a);
|
||||
T s = sin(a);
|
||||
T const a = angle;
|
||||
T const c = cos(a);
|
||||
T const s = sin(a);
|
||||
|
||||
detail::tmat3x3<T, P> Result(detail::tmat3x3<T, P>::_null);
|
||||
Result[0] = m[0] * c + m[1] * s;
|
||||
|
||||
@@ -19,18 +19,10 @@ namespace glm
|
||||
detail::tvec3<T, P> const tmp(euclidean / Length);
|
||||
T const xz_dist(sqrt(tmp.x * tmp.x + tmp.z * tmp.z));
|
||||
|
||||
#ifdef GLM_FORCE_RADIANS
|
||||
return detail::tvec3<T, P>(
|
||||
atan(xz_dist, tmp.y), // latitude
|
||||
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<T, P>(
|
||||
degrees(atan(xz_dist, tmp.y)), // latitude
|
||||
degrees(atan(tmp.x, tmp.z)), // longitude
|
||||
xz_dist); // xz distance
|
||||
#endif
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@@ -39,14 +31,8 @@ namespace glm
|
||||
detail::tvec2<T, P> const & polar
|
||||
)
|
||||
{
|
||||
#ifdef GLM_FORCE_RADIANS
|
||||
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
|
||||
|
||||
return detail::tvec3<T, P>(
|
||||
cos(latitude) * sin(longitude),
|
||||
|
||||
@@ -36,18 +36,13 @@ namespace glm
|
||||
detail::tvec3<T, P> const & v
|
||||
)
|
||||
{
|
||||
#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);
|
||||
T s = sin(a);
|
||||
T const a = angle;
|
||||
T const c = cos(a);
|
||||
T const s = sin(a);
|
||||
|
||||
detail::tvec3<T, P> axis = v;
|
||||
detail::tvec3<T, P> const axis(v);
|
||||
|
||||
detail::tvec3<T, P> temp = (T(1) - c) * axis;
|
||||
detail::tvec3<T, P> const temp((static_cast<T>(1) - c) * axis);
|
||||
|
||||
detail::tmat4x4<T, P> Rotate(detail::tmat4x4<T, P>::_null);
|
||||
Rotate[0][0] = c + temp[0] * axis[0];
|
||||
@@ -78,14 +73,9 @@ namespace glm
|
||||
detail::tvec3<T, P> const & v
|
||||
)
|
||||
{
|
||||
detail::tvec3<T, P> Tmp = v;
|
||||
detail::tvec3<T, P> const Tmp(v);
|
||||
|
||||
#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));
|
||||
|
||||
return q * detail::tquat<T, P>(cos(AngleRad * static_cast<T>(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin);
|
||||
|
||||
@@ -296,7 +296,7 @@ namespace detail
|
||||
|
||||
/// Build a quaternion from an angle and a normalized axis.
|
||||
///
|
||||
/// @param angle Angle expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise.
|
||||
/// @param angle Angle expressed in radians.
|
||||
/// @param axis Axis of the quaternion, must be normalized.
|
||||
///
|
||||
/// @see gtc_quaternion
|
||||
@@ -306,7 +306,7 @@ namespace detail
|
||||
|
||||
/// Build a quaternion from an angle and a normalized axis.
|
||||
///
|
||||
/// @param angle Angle expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise.
|
||||
/// @param angle Angle expressed in radians.
|
||||
/// @param x x component of the x-axis, x, y, z must be a normalized axis
|
||||
/// @param y y component of the y-axis, x, y, z must be a normalized axis
|
||||
/// @param z z component of the z-axis, x, y, z must be a normalized axis
|
||||
|
||||
Reference in New Issue
Block a user