From cb00fdce57e7344a9f16ac2776fd9e52cb32f6b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 5 Dec 2013 00:32:46 +0100 Subject: [PATCH] MSVC 2013 compatibility: some explicit typing is needed. --- src/Math/Geometry/Test/DistanceTest.cpp | 8 +++---- src/Math/Geometry/Test/IntersectionTest.cpp | 26 ++++++++++----------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Math/Geometry/Test/DistanceTest.cpp b/src/Math/Geometry/Test/DistanceTest.cpp index ffc1eeb7e..136638ec6 100644 --- a/src/Math/Geometry/Test/DistanceTest.cpp +++ b/src/Math/Geometry/Test/DistanceTest.cpp @@ -84,7 +84,7 @@ void DistanceTest::linePoint3D() { Constants::sqrt2()/Constants::sqrt3()); /* Check that 3D implementation gives the same result as 2D implementation */ - CORRADE_COMPARE(Distance::linePoint(a, {1.0f, 1.0f, 0.0f}, Vector3(1.0f, 0.0f, 0.0f)), + CORRADE_COMPARE(Distance::linePoint(a, Vector3(1.0f, 1.0f, 0.0f), Vector3(1.0f, 0.0f, 0.0f)), 1.0f/Constants::sqrt2()); } @@ -110,9 +110,9 @@ void DistanceTest::lineSegmentPoint2D() { 1.0f); /* Point next to the line segment */ - CORRADE_COMPARE(Distance::lineSegmentPoint(a, b, {1.0f, 0.0f}), + CORRADE_COMPARE(Distance::lineSegmentPoint(a, b, Vector2(1.0f, 0.0f)), 1.0f/Constants::sqrt2()); - CORRADE_COMPARE(Distance::lineSegmentPointSquared(a, b, {1.0f, 0.0f}), + CORRADE_COMPARE(Distance::lineSegmentPointSquared(a, b, Vector2(1.0f, 0.0f)), 0.5f); /* Point outside the line segment, closer to A */ @@ -145,7 +145,7 @@ void DistanceTest::lineSegmentPoint3D() { 1.0f); /* Point next to the line segment */ - CORRADE_COMPARE(Distance::lineSegmentPoint(a, b, {1.0f, 0.0f, 1.0f}), + CORRADE_COMPARE(Distance::lineSegmentPoint(a, b, Vector3(1.0f, 0.0f, 1.0f)), Constants::sqrt2()/Constants::sqrt3()); /* Point outside the line segment, closer to A */ diff --git a/src/Math/Geometry/Test/IntersectionTest.cpp b/src/Math/Geometry/Test/IntersectionTest.cpp index 86a84c5fd..97b65bbe2 100644 --- a/src/Math/Geometry/Test/IntersectionTest.cpp +++ b/src/Math/Geometry/Test/IntersectionTest.cpp @@ -51,19 +51,19 @@ void IntersectionTest::planeLine() { /* Inside line segment */ CORRADE_COMPARE(Intersection::planeLine(planePosition, planeNormal, - {0.0f, 0.0f, -1.0f}, {0.0f, 0.0f, 2.0f}), 0.75f); + Vector3{0.0f, 0.0f, -1.0f}, Vector3{0.0f, 0.0f, 2.0f}), 0.75f); /* Outside line segment */ CORRADE_COMPARE(Intersection::planeLine(planePosition, planeNormal, - {0.0f, 0.0f, 1.0f}, {0.0f, 0.0f, 1.0f}), -0.5f); + Vector3{0.0f, 0.0f, 1.0f}, Vector3{0.0f, 0.0f, 1.0f}), -0.5f); /* Line lies on the plane */ CORRADE_COMPARE(Intersection::planeLine(planePosition, planeNormal, - {1.0f, 0.5f, 0.5f}, {-1.0f, 0.5f, 0.0f}), std::numeric_limits::quiet_NaN()); + Vector3{1.0f, 0.5f, 0.5f}, Vector3{-1.0f, 0.5f, 0.0f}), std::numeric_limits::quiet_NaN()); /* Line is parallel to the plane */ CORRADE_COMPARE(Intersection::planeLine(planePosition, planeNormal, - {1.0f, 0.0f, 1.0f}, {-1.0f, 0.0f, 0.0f}), -std::numeric_limits::infinity()); + Vector3{1.0f, 0.0f, 1.0f}, Vector3{-1.0f, 0.0f, 0.0f}), -std::numeric_limits::infinity()); } void IntersectionTest::lineLine() { @@ -72,30 +72,30 @@ void IntersectionTest::lineLine() { /* Inside both line segments */ CORRADE_COMPARE(Intersection::lineSegmentLineSegment(p, r, - {0.0f, 0.0f}, {-1.0f, 0.0f}), std::make_pair(0.5f, 0.5f)); + Vector2{0.0f, 0.0f}, Vector2{-1.0f, 0.0f}), std::make_pair(0.5f, 0.5f)); CORRADE_COMPARE(Intersection::lineSegmentLine(p, r, - {0.0f, 0.0f}, {-1.0f, 0.0f}), 0.5); + Vector2{0.0f, 0.0f}, Vector2{-1.0f, 0.0f}), 0.5); /* Outside both line segments */ CORRADE_COMPARE(Intersection::lineSegmentLineSegment(p, r, - {0.0f, -2.0f}, {-1.0f, 0.0f}), std::make_pair(-0.5f, 1.5f)); + Vector2{0.0f, -2.0f}, Vector2{-1.0f, 0.0f}), std::make_pair(-0.5f, 1.5f)); CORRADE_COMPARE(Intersection::lineSegmentLine(p, r, - {0.0f, -2.0f}, {-1.0f, 0.0f}), -0.5f); + Vector2{0.0f, -2.0f}, Vector2{-1.0f, 0.0f}), -0.5f); /* Collinear lines */ const auto tu = Intersection::lineSegmentLineSegment(p, r, - {0.0f, 1.0f}, {-1.0f, -2.0f}); + Vector2{0.0f, 1.0f}, Vector2{-1.0f, -2.0f}); CORRADE_COMPARE(tu.first, -std::numeric_limits::quiet_NaN()); CORRADE_COMPARE(tu.second, -std::numeric_limits::quiet_NaN()); CORRADE_COMPARE(Intersection::lineSegmentLine(p, r, - {0.0f, 1.0f}, {-1.0f, -2.0f}), -std::numeric_limits::quiet_NaN()); + Vector2{0.0f, 1.0f}, Vector2{-1.0f, -2.0f}), -std::numeric_limits::quiet_NaN()); /* Parallel lines */ CORRADE_COMPARE(Intersection::lineSegmentLineSegment(p, r, - {0.0f, 0.0f}, {1.0f, 2.0f}), std::make_pair(std::numeric_limits::infinity(), - std::numeric_limits::infinity())); + Vector2{0.0f, 0.0f}, Vector2{1.0f, 2.0f}), std::make_pair(std::numeric_limits::infinity(), + std::numeric_limits::infinity())); CORRADE_COMPARE(Intersection::lineSegmentLine(p, r, - {0.0f, 0.0f}, {1.0f, 2.0f}), std::numeric_limits::infinity()); + Vector2{0.0f, 0.0f}, Vector2{1.0f, 2.0f}), std::numeric_limits::infinity()); } }}}}