diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-03-06 02:41:09 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-03-11 01:13:52 +0000 |
commit | ba69d51cc372197ef55feb87a33ed03afd1b0ca3 (patch) | |
tree | ce50ac42a8d30d5246ca767107d76886d7237e69 /gfx/aabb.h | |
parent | Pass frustum into render functions (diff) | |
download | ilt-ba69d51cc372197ef55feb87a33ed03afd1b0ca3.tar.bz2 ilt-ba69d51cc372197ef55feb87a33ed03afd1b0ca3.tar.xz ilt-ba69d51cc372197ef55feb87a33ed03afd1b0ca3.zip |
Create AxisAlignedBoundingBox
Used to define the extents of GeoData mesh
Diffstat (limited to 'gfx/aabb.h')
-rw-r--r-- | gfx/aabb.h | 17 |
1 files changed, 17 insertions, 0 deletions
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 <span> + +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<const GlobalPosition3D> points); + + GlobalPosition3D min, max; +}; |