summaryrefslogtreecommitdiff
path: root/test/test-lib.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2025-03-06 02:41:09 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2025-03-11 01:13:52 +0000
commitba69d51cc372197ef55feb87a33ed03afd1b0ca3 (patch)
treece50ac42a8d30d5246ca767107d76886d7237e69 /test/test-lib.cpp
parentPass frustum into render functions (diff)
downloadilt-ba69d51cc372197ef55feb87a33ed03afd1b0ca3.tar.bz2
ilt-ba69d51cc372197ef55feb87a33ed03afd1b0ca3.tar.xz
ilt-ba69d51cc372197ef55feb87a33ed03afd1b0ca3.zip
Create AxisAlignedBoundingBox
Used to define the extents of GeoData mesh
Diffstat (limited to 'test/test-lib.cpp')
-rw-r--r--test/test-lib.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/test-lib.cpp b/test/test-lib.cpp
index 17c0f63..8dadc70 100644
--- a/test/test-lib.cpp
+++ b/test/test-lib.cpp
@@ -6,6 +6,7 @@
#include <stream_support.h>
#include <collections.h>
+#include <gfx/aabb.h>
#include <glArrays.h>
#include <glad/gl.h>
#include <set>
@@ -110,3 +111,14 @@ BOOST_DATA_TEST_CASE(mergeCloseInts,
tolerance)));
BOOST_CHECK_EQUAL_COLCOL(mutableCollection, expected);
}
+
+BOOST_AUTO_TEST_CASE(aabb_from_points)
+{
+ const auto aabb = AxisAlignedBoundingBox::fromPoints(std::vector<GlobalPosition3D> {
+ {1, 2, 3},
+ {4, 2, 1},
+ {9, 1, 7},
+ });
+ BOOST_CHECK_EQUAL(aabb.min, GlobalPosition3D(1, 1, 1));
+ BOOST_CHECK_EQUAL(aabb.max, GlobalPosition3D(9, 2, 7));
+}