From 8496bd9720888701267f8f39a2f3a74a65f1006f Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 15 Feb 2026 00:50:02 +0000 Subject: Support for testing if a point/sphere is within a Frustum Use case is the sphere approximating a scenery item such as a tree. --- gfx/frustum.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gfx/frustum.h') diff --git a/gfx/frustum.h b/gfx/frustum.h index a2d90e9..1493a36 100644 --- a/gfx/frustum.h +++ b/gfx/frustum.h @@ -4,6 +4,7 @@ #include "config/types.h" #include #include +#include class Frustum { public: @@ -31,12 +32,15 @@ public: using BoundingBox = AxisAlignedBoundingBox; [[nodiscard]] bool contains(const BoundingBox &) const; + [[nodiscard]] bool contains(GlobalPosition3D, RelativeDistance size = 0) const; [[nodiscard]] bool shadedBy(const BoundingBox &) const; + [[nodiscard]] bool shadedBy(GlobalPosition3D, RelativeDistance size = 0) const; protected: static constexpr size_t FACES = 6; void updateCache(); [[nodiscard]] bool boundByPlanes(const BoundingBox &, size_t nplanes) const; + [[nodiscard]] bool contains(std::span, size_t nplanes, RelativeDistance) const; GlobalPosition3D position; glm::mat4 view, projection; -- cgit v1.3