diff --git a/openVulkanoCpp/Math/Frustum.hpp b/openVulkanoCpp/Math/Frustum.hpp index 9b9ff64..37c39d5 100644 --- a/openVulkanoCpp/Math/Frustum.hpp +++ b/openVulkanoCpp/Math/Frustum.hpp @@ -7,6 +7,7 @@ #pragma once #include "Math.hpp" +#include "Range.hpp" #ifdef NEAR #undef NEAR @@ -76,7 +77,7 @@ namespace openVulkanoCpp::Math } // http://iquilezles.org/www/articles/frustumcorrect/frustumcorrect.htm - bool IsBoxVisible(const Math::Vector3f& minp, const Math::Vector3f& maxp) const + [[nodiscard]] bool IsBoxVisible(const Math::Vector3f& minp, const Math::Vector3f& maxp) const { // http://iquilezles.org/www/articles/frustumcorrect/frustumcorrect.htm // check box outside/inside of frustum for (int i = 0; i < COUNT; i++) @@ -118,11 +119,16 @@ namespace openVulkanoCpp::Math return true; } - bool IsBoxVisible(const Math::Vector4f& minp, const Math::Vector4f& maxp) const + [[nodiscard]] bool IsBoxVisible(const Math::Vector4f& minp, const Math::Vector4f& maxp) const { return IsBoxVisible(Math::Vector3f(minp), Math::Vector3f(maxp)); } + [[nodiscard]] bool IsBoxVisible(const Range& range) const + { + return IsBoxVisible(range.min, range.max); + } + private: template struct ij2k