From 3d082505f7ca720bd34b1311a2ae7bca5e20a5f0 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 4 Mar 2025 20:15:43 +0000 Subject: Have Camera keep an array of frustum plane definitions Based on code from https://ktstephano.github.io/rendering/stratusgfx/aabbs --- gfx/gl/camera.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gfx/gl/camera.h') diff --git a/gfx/gl/camera.h b/gfx/gl/camera.h index 5c37744..d4fe6de 100644 --- a/gfx/gl/camera.h +++ b/gfx/gl/camera.h @@ -70,6 +70,12 @@ public: return position; } + [[nodiscard]] auto & + getFrustumPlanes() const + { + return frustumPlanes; + } + [[nodiscard]] std::array extentsAtDist(GlobalDistance) const; [[nodiscard]] static Direction3D upFromForward(const Direction3D & forward); @@ -84,4 +90,5 @@ private: GlobalDistance near, far; glm::mat4 view, projection; glm::mat4 viewProjection, inverseViewProjection; + std::array frustumPlanes; }; -- cgit v1.2.3