diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-03-07 00:43:25 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-03-11 01:13:59 +0000 |
commit | d0aceb54752078200bc75a96888ffaf7483678cb (patch) | |
tree | b28332738e1446771c42c8ddd37261bdf380b14b /gfx/frustum.h | |
parent | Position is moved to Frustum (diff) | |
download | ilt-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.h | 4 |
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(); |