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.cpp | |
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.cpp')
-rw-r--r-- | gfx/frustum.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gfx/frustum.cpp b/gfx/frustum.cpp index 8031d85..865dcde 100644 --- a/gfx/frustum.cpp +++ b/gfx/frustum.cpp @@ -1,5 +1,4 @@ #include "frustum.h" -#include "aabb.h" #include <algorithm> #include <collections.h> #include <glm/ext/matrix_transform.hpp> @@ -20,11 +19,11 @@ Frustum::updateView(const glm::mat4 & newView) } bool -Frustum::contains(const AxisAlignedBoundingBox & aabb) const +Frustum::contains(const BoundingBox & aabb) const { static constexpr auto EXTENT_CORNER_IDXS = [] { - using Extent = GlobalPosition3D AxisAlignedBoundingBox::*; - constexpr auto EXTENTS = std::array {&AxisAlignedBoundingBox::min, &AxisAlignedBoundingBox::max}; + using Extent = GlobalPosition3D BoundingBox::*; + constexpr auto EXTENTS = std::array {&BoundingBox::min, &BoundingBox::max}; std::array<glm::vec<3, Extent>, 2ZU * 2ZU * 2ZU> out {}; std::ranges::copy(std::views::cartesian_product(EXTENTS, EXTENTS, EXTENTS) | std::views::transform( |