summaryrefslogtreecommitdiff
path: root/test/test-terrain.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-10-31 01:26:58 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-10-31 02:38:22 +0000
commita0f1dc90aabd4cb5cfe2aef7116af170e6d0b953 (patch)
tree6d31ec9e79f94d04d7270c754d5bd8c0814d57d7 /test/test-terrain.cpp
parentInitial commit of walk/walkUtil terrain (diff)
downloadilt-a0f1dc90aabd4cb5cfe2aef7116af170e6d0b953.tar.bz2
ilt-a0f1dc90aabd4cb5cfe2aef7116af170e6d0b953.tar.xz
ilt-a0f1dc90aabd4cb5cfe2aef7116af170e6d0b953.zip
Helper type for storing/passing/returning a point and its containing face
point is const as face is mutable as a cache of the face containing point.
Diffstat (limited to 'test/test-terrain.cpp')
-rw-r--r--test/test-terrain.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test-terrain.cpp b/test/test-terrain.cpp
index 429207c..f737f4f 100644
--- a/test/test-terrain.cpp
+++ b/test/test-terrain.cpp
@@ -46,6 +46,15 @@ BOOST_AUTO_TEST_CASE(trianglesContainsPoints)
}
}
+BOOST_AUTO_TEST_CASE(locatePointFace)
+{
+ const PointFace pf {{310002, 490003}};
+ BOOST_CHECK(!pf.face.is_valid());
+ BOOST_CHECK(locate(pf));
+ BOOST_CHECK(pf.face.is_valid());
+ BOOST_CHECK_EQUAL(pf.face.idx(), 0);
+}
+
BOOST_AUTO_TEST_SUITE_END();
using FindPointData = std::tuple<glm::vec2, int>;