diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-03-08 19:54:10 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-03-11 01:13:59 +0000 |
commit | a6cec1f8eeb54a12fb2ee058f07a451d3b549958 (patch) | |
tree | 3a4337bf6b29117fd17eecb713c420e5a1bcf8ee /gfx/frustum.h | |
parent | Current tile in frustum as we loop (diff) | |
download | ilt-a6cec1f8eeb54a12fb2ee058f07a451d3b549958.tar.bz2 ilt-a6cec1f8eeb54a12fb2ee058f07a451d3b549958.tar.xz ilt-a6cec1f8eeb54a12fb2ee058f07a451d3b549958.zip |
Template AxisAlignedBoundingBox on unit type
Diffstat (limited to 'gfx/frustum.h')
-rw-r--r-- | gfx/frustum.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gfx/frustum.h b/gfx/frustum.h index 5ee7d2c..2624ba1 100644 --- a/gfx/frustum.h +++ b/gfx/frustum.h @@ -1,11 +1,10 @@ #pragma once +#include "aabb.h" #include "config/types.h" #include <array> #include <glm/mat4x4.hpp> -class AxisAlignedBoundingBox; - class Frustum { public: Frustum(const GlobalPosition3D & pos, const glm::mat4 & view, const glm::mat4 & projection); @@ -30,11 +29,13 @@ public: void updateView(const glm::mat4 & view); - [[nodiscard]] bool contains(const AxisAlignedBoundingBox &) const; + using BoundingBox = AxisAlignedBoundingBox<GlobalDistance>; + [[nodiscard]] bool contains(const BoundingBox &) const; protected: static constexpr size_t FACES = 6; void updateCache(); + [[nodiscard]] bool boundByPlanes(const BoundingBox &, size_t nplanes) const; GlobalPosition3D position; glm::mat4 view, projection; |