diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-01 15:53:54 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-01 15:53:54 +0000 |
commit | 69e6b7d2d349dcc42d2d415a72181ba729d5a19d (patch) | |
tree | 5d7dff2f2775701069806eceb4eaef23b22eba3f /test | |
parent | Remove legacy Position types from shadowMapper (diff) | |
download | ilt-69e6b7d2d349dcc42d2d415a72181ba729d5a19d.tar.bz2 ilt-69e6b7d2d349dcc42d2d415a72181ba729d5a19d.tar.xz ilt-69e6b7d2d349dcc42d2d415a72181ba729d5a19d.zip |
Remove more use of legacy types
Diffstat (limited to 'test')
-rw-r--r-- | test/test-maths.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/test-maths.cpp b/test/test-maths.cpp index ede884d..b363c17 100644 --- a/test/test-maths.cpp +++ b/test/test-maths.cpp @@ -177,7 +177,7 @@ BOOST_AUTO_TEST_CASE(test_find_arcs_radius) struct TestLinkStraight : public LinkStraight { explicit TestLinkStraight(glm::vec3 v) : - Link {{std::make_shared<Node>(origin), vector_yaw(v)}, {std::make_shared<Node>(v), vector_yaw(-v)}, + Link {{std::make_shared<Node>(Position3D {}), vector_yaw(v)}, {std::make_shared<Node>(v), vector_yaw(-v)}, glm::length(v)} { } @@ -197,7 +197,7 @@ BOOST_DATA_TEST_CASE(straight1, const TestLinkStraight l(v); { const auto p = l.positionAt(0, 0); - BOOST_CHECK_EQUAL(p.pos, GlobalPosition3D {origin}); + BOOST_CHECK_EQUAL(p.pos, GlobalPosition3D {}); BOOST_CHECK_EQUAL(p.rot, glm::vec3(0, angFor, 0)); } { @@ -228,11 +228,11 @@ BOOST_DATA_TEST_CASE(curve1, e1, ctr, angFor, angBack) { { // One-way... - const TestLinkCurve l(origin, e1, ctr); + const TestLinkCurve l({}, e1, ctr); BOOST_CHECK_EQUAL(l.radius, 1.F); { const auto p = l.positionAt(0, 0); - BOOST_CHECK_CLOSE_VEC(RelativePosition3D {p.pos}, origin); + BOOST_CHECK_CLOSE_VEC(RelativePosition3D {p.pos}, RelativePosition3D {}); BOOST_CHECK_CLOSE_VEC(p.rot, glm::vec3(0, angFor, 0)); } { @@ -243,18 +243,18 @@ BOOST_DATA_TEST_CASE(curve1, } { // The other way... - const TestLinkCurve l(e1, origin, ctr); + const TestLinkCurve l(e1, {}, ctr); BOOST_CHECK_EQUAL(l.radius, 1.F); { const auto p = l.positionAt(0, 0); - const auto angForReversed = normalize(vector_yaw(origin - e1) * 2 - angFor); + const auto angForReversed = normalize(vector_yaw(-e1) * 2 - angFor); BOOST_CHECK_CLOSE_VECI(RelativePosition3D {p.pos}, e1); BOOST_CHECK_CLOSE_VECI(p.rot, glm::vec3(0, angForReversed, 0)); } { const auto p = l.positionAt(0, 1); - const auto angBackReversed = normalize(vector_yaw(e1 - origin) * 2 - angBack); - BOOST_CHECK_CLOSE_VEC(RelativePosition3D {p.pos}, origin); + const auto angBackReversed = normalize(vector_yaw(e1) * 2 - angBack); + BOOST_CHECK_CLOSE_VEC(RelativePosition3D {p.pos}, Position3D {}); BOOST_CHECK_CLOSE_VEC(p.rot, glm::vec3(0, angBackReversed, 0)); } } @@ -262,10 +262,10 @@ BOOST_DATA_TEST_CASE(curve1, BOOST_AUTO_TEST_CASE(camera_clicks) { - Camera camera {::origin, ::half_pi, 1.25F, 1000, 10000000}; + Camera camera {{}, ::half_pi, 1.25F, 1000, 10000000}; constexpr float centre {0.5F}, right {0.9F}, left {0.1F}, top {1.F}, bottom {0.F}; camera.setForward(::north); - BOOST_CHECK_EQUAL(camera.unProject({centre, centre}).start, ::origin); + BOOST_CHECK_EQUAL(camera.unProject({centre, centre}).start, RelativePosition3D {}); BOOST_CHECK_CLOSE_VEC(camera.unProject({centre, centre}).direction, ::north); BOOST_CHECK_CLOSE_VEC(camera.unProject({left, centre}).direction, glm::normalize(::north + ::west)); BOOST_CHECK_CLOSE_VEC(camera.unProject({right, centre}).direction, glm::normalize(::north + ::east)); |