diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-03-07 00:43:25 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-03-11 01:13:59 +0000 |
commit | d0aceb54752078200bc75a96888ffaf7483678cb (patch) | |
tree | b28332738e1446771c42c8ddd37261bdf380b14b /gfx/aabb.cpp | |
parent | Position is moved to Frustum (diff) | |
download | ilt-d0aceb54752078200bc75a96888ffaf7483678cb.tar.bz2 ilt-d0aceb54752078200bc75a96888ffaf7483678cb.tar.xz ilt-d0aceb54752078200bc75a96888ffaf7483678cb.zip |
Add function to test if an AABB is visible in a frustum
Diffstat (limited to 'gfx/aabb.cpp')
-rw-r--r-- | gfx/aabb.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gfx/aabb.cpp b/gfx/aabb.cpp index 862dacb..0a04ef4 100644 --- a/gfx/aabb.cpp +++ b/gfx/aabb.cpp @@ -22,3 +22,9 @@ AxisAlignedBoundingBox::operator+=(const GlobalPosition3D & point) max = glm::max(max, point); return *this; } + +AxisAlignedBoundingBox +AxisAlignedBoundingBox::operator-(const GlobalPosition3D & viewPoint) const +{ + return {min - viewPoint, max - viewPoint}; +} |