From 3931bda936aba6ddae26c1d9f1d450781df800e8 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 3 Nov 2023 20:12:03 +0000 Subject: Implement terrain intersect ray --- test/test-terrain.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/test-terrain.cpp b/test/test-terrain.cpp index 38cb51f..53eebfb 100644 --- a/test/test-terrain.cpp +++ b/test/test-terrain.cpp @@ -104,6 +104,18 @@ BOOST_DATA_TEST_CASE(findPositionAt, BOOST_CHECK_CLOSE_VEC(fixedTerrtain.positionAt(p), p ^ h); } +using FindRayIntersectData = std::tuple; + +BOOST_DATA_TEST_CASE(findRayIntersect, + boost::unit_test::data::make({ + {{310000, 490000, 50}, {1, 1, -2}, {310008.59, 490008.59, 32.834301}}, + {{310000, 490000, 50}, {1, 1, -1}, {310017.12, 490017.12, 32.868526}}, + }), + p, d, i) +{ + BOOST_CHECK_CLOSE_VEC(fixedTerrtain.intersectRay({p, d}).value(), i); +} + using WalkTerrainData = std::tuple>; BOOST_DATA_TEST_CASE(walkTerrain, -- cgit v1.2.3