From ba69d51cc372197ef55feb87a33ed03afd1b0ca3 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 6 Mar 2025 02:41:09 +0000 Subject: Create AxisAlignedBoundingBox Used to define the extents of GeoData mesh --- gfx/aabb.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 gfx/aabb.h (limited to 'gfx/aabb.h') diff --git a/gfx/aabb.h b/gfx/aabb.h new file mode 100644 index 0000000..568e91a --- /dev/null +++ b/gfx/aabb.h @@ -0,0 +1,17 @@ +#pragma once + +#include "config/types.h" +#include + +class AxisAlignedBoundingBox { +public: + AxisAlignedBoundingBox() = default; + + AxisAlignedBoundingBox(const GlobalPosition3D & min, const GlobalPosition3D & max) : min {min}, max {max} { } + + AxisAlignedBoundingBox & operator+=(const GlobalPosition3D & point); + + [[nodiscard]] static AxisAlignedBoundingBox fromPoints(std::span points); + + GlobalPosition3D min, max; +}; -- cgit v1.2.3