diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-03-04 20:15:43 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-03-05 20:08:25 +0000 |
commit | 3d082505f7ca720bd34b1311a2ae7bca5e20a5f0 (patch) | |
tree | c02ba7cdfb703089c0df779f682aea820abe7455 /gfx/gl/camera.h | |
parent | Constrain operator* for array*functor (diff) | |
download | ilt-3d082505f7ca720bd34b1311a2ae7bca5e20a5f0.tar.bz2 ilt-3d082505f7ca720bd34b1311a2ae7bca5e20a5f0.tar.xz ilt-3d082505f7ca720bd34b1311a2ae7bca5e20a5f0.zip |
Based on code from https://ktstephano.github.io/rendering/stratusgfx/aabbs
Diffstat (limited to 'gfx/gl/camera.h')
-rw-r--r-- | gfx/gl/camera.h | 7 |
1 files changed, 7 insertions, 0 deletions
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<GlobalPosition4D, 4> 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<glm::vec4, 6> frustumPlanes; }; |