summaryrefslogtreecommitdiff
path: root/gfx/frustum.h
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/frustum.h')
-rw-r--r--gfx/frustum.h7
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;