From 4aa07d3029ecba28be3ce9dfefd813ea30012ca4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 6 Aug 2012 16:04:53 +0200 Subject: [PATCH] Use std:: variants for sin(), cos() and sqrt(). They should have overloads for given type, so we're not using doubles when only float is needed. --- src/Math/Matrix4.h | 4 ++-- src/Math/Vector.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Math/Matrix4.h b/src/Math/Matrix4.h index 9674d2159..fcecef081 100644 --- a/src/Math/Matrix4.h +++ b/src/Math/Matrix4.h @@ -75,8 +75,8 @@ template class Matrix4: public Matrix<4, T> { static Matrix4 rotation(T angle, const Vector3& vec) { Vector3 vn = vec.normalized(); - T sine = sin(angle); - T cosine = cos(angle); + T sine = std::sin(angle); + T cosine = std::cos(angle); T oneMinusCosine = T(1) - cosine; T xx = vn.x()*vn.x(); diff --git a/src/Math/Vector.h b/src/Math/Vector.h index 6c4242529..1d075e241 100644 --- a/src/Math/Vector.h +++ b/src/Math/Vector.h @@ -90,7 +90,7 @@ template class Vector { * @todo optimize - Assume the vectors are normalized? */ inline static T angle(const Vector& a, const Vector& b) { - return acos(dot(a, b)/(a.length()*b.length())); + return std::acos(dot(a, b)/(a.length()*b.length())); } /** @brief Default constructor */ @@ -248,7 +248,7 @@ template class Vector { * @see lengthSquared() */ inline T length() const { - return sqrt(dot(*this, *this)); + return std::sqrt(dot(*this, *this)); } /**