diff --git a/openVulkanoCpp/Math/AABB.hpp b/openVulkanoCpp/Math/AABB.hpp index 45f065c..4f9b944 100644 --- a/openVulkanoCpp/Math/AABB.hpp +++ b/openVulkanoCpp/Math/AABB.hpp @@ -20,6 +20,12 @@ namespace OpenVulkano::Math AABB() : Range(Math::Vector3f(INFINITY), Math::Vector3f(-INFINITY)) {} AABB(const Math::Vector3f& min, const Math::Vector3f& max) : Range(min, max) {} + + AABB(const Vector3f& point) : Range(point, point) + {} + + AABB(const Vector3f& point, float radius) : Range(point - radius, point + radius) + {} /** * \brief Initiates the AABB to a single point (min=max=point) @@ -92,12 +98,12 @@ namespace OpenVulkano::Math [[nodiscard]] bool InBounds(const Math::Vector3f& position) const { - return min >= position && position <= max; + return Math::Utils::all(Math::Utils::greaterThanEqual(min, position)) && Math::Utils::all(Math::Utils::lessThanEqual(position, max)); } [[nodiscard]] bool Inside(const Math::Vector3f& position) const { - return min > position && position < max; + return Math::Utils::all(Math::Utils::greaterThan(min, position)) && Math::Utils::all(Math::Utils::lessThan(position, max)); } /**