From 42e35e6a544b90499e63a927500baf70aa15e569 Mon Sep 17 00:00:00 2001 From: ohyzha Date: Thu, 22 Aug 2024 13:27:38 +0300 Subject: [PATCH] add convenient method for bounding box --- openVulkanoCpp/Math/AABB.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openVulkanoCpp/Math/AABB.hpp b/openVulkanoCpp/Math/AABB.hpp index 4f9b944..88469df 100644 --- a/openVulkanoCpp/Math/AABB.hpp +++ b/openVulkanoCpp/Math/AABB.hpp @@ -106,6 +106,11 @@ namespace OpenVulkano::Math return Math::Utils::all(Math::Utils::greaterThan(min, position)) && Math::Utils::all(Math::Utils::lessThan(position, max)); } + [[nodiscard]] bool IsEmpty() const + { + return min == Math::Vector3f(INFINITY) && max == Math::Vector3f(-INFINITY); + } + /** * \brief Resets the AABB to min=Inf, max=-Inf, same as Init() */