summaryrefslogtreecommitdiff
path: root/gfx/frustum.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2025-03-07 00:43:25 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2025-03-11 01:13:59 +0000
commitd0aceb54752078200bc75a96888ffaf7483678cb (patch)
treeb28332738e1446771c42c8ddd37261bdf380b14b /gfx/frustum.h
parentPosition is moved to Frustum (diff)
downloadilt-d0aceb54752078200bc75a96888ffaf7483678cb.tar.bz2
ilt-d0aceb54752078200bc75a96888ffaf7483678cb.tar.xz
ilt-d0aceb54752078200bc75a96888ffaf7483678cb.zip
Add function to test if an AABB is visible in a frustum
Diffstat (limited to 'gfx/frustum.h')
-rw-r--r--gfx/frustum.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gfx/frustum.h b/gfx/frustum.h
index 46f4108..5ee7d2c 100644
--- a/gfx/frustum.h
+++ b/gfx/frustum.h
@@ -4,6 +4,8 @@
#include <array>
#include <glm/mat4x4.hpp>
+class AxisAlignedBoundingBox;
+
class Frustum {
public:
Frustum(const GlobalPosition3D & pos, const glm::mat4 & view, const glm::mat4 & projection);
@@ -28,6 +30,8 @@ public:
void updateView(const glm::mat4 & view);
+ [[nodiscard]] bool contains(const AxisAlignedBoundingBox &) const;
+
protected:
static constexpr size_t FACES = 6;
void updateCache();