From 60940264cda8a5f314fb2221e484b0e4ecc46bfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 7 Jun 2018 12:58:52 +0200 Subject: [PATCH] Math/Geometry: remove unused parameter. --- src/Magnum/Math/Geometry/Intersection.h | 16 +++++----------- .../Math/Geometry/Test/IntersectionBenchmark.cpp | 3 +-- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/Magnum/Math/Geometry/Intersection.h b/src/Magnum/Math/Geometry/Intersection.h index ee60cadd6..c68f27ecb 100644 --- a/src/Magnum/Math/Geometry/Intersection.h +++ b/src/Magnum/Math/Geometry/Intersection.h @@ -287,7 +287,7 @@ template bool pointDoubleCone(const Vector3& point, const Vector3 otherwise Precomputes a portion of the intersection equation from @p coneAngle and calls -@ref sphereConeView(const Vector3&, T, const Matrix4&, T, T, T). +@ref sphereConeView(const Vector3&, T, const Matrix4&, T, T). */ template bool sphereConeView(const Vector3& sphereCenter, T sphereRadius, const Matrix4& coneView, Rad coneAngle); @@ -297,8 +297,7 @@ template bool sphereConeView(const Vector3& sphereCenter, T sphereRa @param sphereRadius Sphere radius @param coneView View matrix with translation and rotation of the cone @param sinAngle Precomputed sine of half the cone's opening angle -@param cosAngle Precomputed cosine of half the cone's opening angle -@param tanAngle Precomputed tangens of half the cone's opening angle +@param tanAngle Precomputed tangent of half the cone's opening angle @return @cpp true @ce if the sphere intersects the cone, @cpp false @ce otherwise @@ -308,11 +307,10 @@ The @p sinAngle, @p cosAngle, @p tanAngle can be precomputed like this: @code{.cpp} T sinAngle = Math::sin(angle*T(0.5)); -T cosAngle = Math::cos(angle*T(0.5)); T tanAngle = Math::tan(angle*T(0.5)); @endcode */ -template bool sphereConeView(const Vector3& sphereCenter, T sphereRadius, const Matrix4& coneView, T sinAngle, T cosAngle, T tanAngle); +template bool sphereConeView(const Vector3& sphereCenter, T sphereRadius, const Matrix4& coneView, T sinAngle, T tanAngle); /** @brief Intersection of a sphere and a cone @@ -515,16 +513,12 @@ template bool pointDoubleCone(const Vector3& point, const Vector3 template bool sphereConeView(const Vector3& sphereCenter, const T sphereRadius, const Matrix4& coneView, const Rad coneAngle) { const Rad halfAngle = coneAngle*T(0.5); const T sinAngle = Math::sin(halfAngle); - const T cosAngle = Math::cos(halfAngle); const T tanAngle = Math::tan(halfAngle); - return sphereConeView(sphereCenter, sphereRadius, coneView, sinAngle, cosAngle, tanAngle); + return sphereConeView(sphereCenter, sphereRadius, coneView, sinAngle, tanAngle); } -template bool sphereConeView( - const Vector3& sphereCenter, const T sphereRadius, const Matrix4& coneView, - const T sinAngle, const T cosAngle, const T tanAngle) -{ +template bool sphereConeView(const Vector3& sphereCenter, const T sphereRadius, const Matrix4& coneView, const T sinAngle, const T tanAngle) { CORRADE_ASSERT(coneView.isRigidTransformation(), "Math::Geometry::Intersection::sphereConeView(): coneView does not represent a rigid transformation", false); /* Transform the sphere so that we can test against Z axis aligned origin diff --git a/src/Magnum/Math/Geometry/Test/IntersectionBenchmark.cpp b/src/Magnum/Math/Geometry/Test/IntersectionBenchmark.cpp index 91f5a6579..f285fe348 100644 --- a/src/Magnum/Math/Geometry/Test/IntersectionBenchmark.cpp +++ b/src/Magnum/Math/Geometry/Test/IntersectionBenchmark.cpp @@ -212,10 +212,9 @@ void IntersectionBenchmark::sphereConeView() { volatile bool b = false; CORRADE_BENCHMARK(50) { const Float sinAngle = Math::sin(std::get<2>(_cone)); - const Float cosAngle = Math::cos(std::get<2>(_cone)); const Float tanAngle = Math::tan(std::get<2>(_cone)); for(auto& sphere: _spheres) { - b = b ^ Intersection::sphereConeView(sphere.xyz(), sphere.w(), _coneView, sinAngle, cosAngle, tanAngle); + b = b ^ Intersection::sphereConeView(sphere.xyz(), sphere.w(), _coneView, sinAngle, tanAngle); } } }