From a6cec1f8eeb54a12fb2ee058f07a451d3b549958 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 8 Mar 2025 19:54:10 +0000 Subject: Template AxisAlignedBoundingBox on unit type --- gfx/frustum.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'gfx/frustum.h') 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 #include -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; + [[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; -- cgit v1.2.3