diff --git a/include/Nazara/Math/Angle.inl b/include/Nazara/Math/Angle.inl index 4596029e9..ee405c6a5 100644 --- a/include/Nazara/Math/Angle.inl +++ b/include/Nazara/Math/Angle.inl @@ -142,7 +142,7 @@ namespace Nz #ifdef NAZARA_PLATFORM_LINUX template - void SinCos(std::enable_if_t::value && !std::is_same::value, double> x, T* sin, T* cos) + void SinCos(T x, T* sin, T* cos) { double s, c; ::sincos(x, &s, &c); @@ -151,14 +151,14 @@ namespace Nz *cos = static_cast(c); } - template - void SinCos(std::enable_if_t::value, float> x, float* s, float* c) + template<> + inline void SinCos(float x, float* s, float* c) { ::sincosf(x, s, c); } - template - void SinCos(std::enable_if_t::value, long double> x, long double* s, long double* c) + template<> + inline void SinCos(long double x, long double* s, long double* c) { ::sincosl(x, s, c); } diff --git a/include/Nazara/Math/EulerAngles.inl b/include/Nazara/Math/EulerAngles.inl index 130f06a41..2eb3d7c73 100644 --- a/include/Nazara/Math/EulerAngles.inl +++ b/include/Nazara/Math/EulerAngles.inl @@ -115,13 +115,9 @@ namespace Nz Quaternion EulerAngles::ToQuaternion() const { // XYZ - T c1 = (yaw / T(2.0)).GetCos(); - T c2 = (roll / T(2.0)).GetCos(); - T c3 = (pitch / T(2.0)).GetCos(); - - T s1 = (yaw / T(2.0)).GetSin(); - T s2 = (roll / T(2.0)).GetSin(); - T s3 = (pitch / T(2.0)).GetSin(); + auto [s1, c1] = (yaw / T(2.0)).GetSinCos(); + auto [s2, c2] = (roll / T(2.0)).GetSinCos(); + auto [s3, c3] = (pitch / T(2.0)).GetSinCos(); return Quaternion(c1 * c2 * c3 - s1 * s2 * s3, s1 * s2 * c3 + c1 * c2 * s3,