summaryrefslogtreecommitdiff
path: root/gfx/frustum.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2025-03-07 00:11:07 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2025-03-11 01:13:59 +0000
commitc310240881e9d1b474db6ef8f8f2891ce1646795 (patch)
tree4529b28457ef805015242f4579299cc39240ddde /gfx/frustum.h
parentCreate AxisAlignedBoundingBox (diff)
downloadilt-c310240881e9d1b474db6ef8f8f2891ce1646795.tar.bz2
ilt-c310240881e9d1b474db6ef8f8f2891ce1646795.tar.xz
ilt-c310240881e9d1b474db6ef8f8f2891ce1646795.zip
Position is moved to Frustum
Diffstat (limited to 'gfx/frustum.h')
-rw-r--r--gfx/frustum.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/gfx/frustum.h b/gfx/frustum.h
index 25dcc18..46f4108 100644
--- a/gfx/frustum.h
+++ b/gfx/frustum.h
@@ -1,11 +1,12 @@
#pragma once
+#include "config/types.h"
#include <array>
#include <glm/mat4x4.hpp>
class Frustum {
public:
- Frustum(const glm::mat4 & view, const glm::mat4 & projection);
+ Frustum(const GlobalPosition3D & pos, const glm::mat4 & view, const glm::mat4 & projection);
[[nodiscard]] auto &
getFrustumPlanes() const
@@ -19,12 +20,19 @@ public:
return viewProjection;
}
+ [[nodiscard]] auto
+ getPosition() const
+ {
+ return position;
+ }
+
void updateView(const glm::mat4 & view);
protected:
static constexpr size_t FACES = 6;
void updateCache();
+ GlobalPosition3D position;
glm::mat4 view, projection;
glm::mat4 viewProjection, inverseViewProjection;
std::array<glm::vec4, FACES> planes;