diff --git a/include/omath/3d_primitives/aabb.hpp b/include/omath/3d_primitives/aabb.hpp index 2744e4b..f2e2be2 100644 --- a/include/omath/3d_primitives/aabb.hpp +++ b/include/omath/3d_primitives/aabb.hpp @@ -8,9 +8,14 @@ namespace omath::primitives { - enum class UpAxis { X, Y, Z }; + enum class UpAxis + { + X, + Y, + Z + }; - template + template struct Aabb final { Vector3 min; @@ -33,7 +38,6 @@ namespace omath::primitives return (max - min) / static_cast(2); } - template [[nodiscard]] constexpr Vector3 top() const noexcept { @@ -48,7 +52,6 @@ namespace omath::primitives std::unreachable(); } - template [[nodiscard]] constexpr Vector3 bottom() const noexcept { @@ -77,8 +80,8 @@ namespace omath::primitives [[nodiscard]] constexpr bool is_collide(const Aabb& other) const noexcept { - return min.x <= other.max.x && max.x >= other.min.x && - min.y <= other.max.y && max.y >= other.min.y &&min.z <= other.max.z && max.z >= other.min.z; + return min.x <= other.max.x && max.x >= other.min.x && min.y <= other.max.y && max.y >= other.min.y + && min.z <= other.max.z && max.z >= other.min.z; } }; } // namespace omath::primitives