minor cleanup

This commit is contained in:
Hartmut Seichter 2023-07-01 22:43:05 +02:00
parent e9d0de8cdd
commit c33211182a
2 changed files with 4 additions and 8 deletions

View file

@ -24,6 +24,7 @@
#ifndef PARADISO_AABB_HPP
#define PARADISO_AABB_HPP
#include <paradiso/globals.hpp>
#include <paradiso/vector.hpp>
namespace paradiso {
@ -32,7 +33,7 @@ struct AABB final {
Vector2<float> top_left{};
Vector2<float> bottom_right{};
static constexpr AABB from_vertices(auto& vertices) noexcept {
static constexpr AABB from_vertices(const auto& vertices) noexcept {
Matrix<2, 2, float> min_max;
min_max.set_slice<2, 1>(0, 0) = vertices.front();
@ -51,7 +52,7 @@ struct AABB final {
}
bool constexpr is_inside(const Vector2<float>& v) const {
return (v.x() >= top_left.x() && v.x() <= bottom_right.x() &&
return (v.x() >= top_left.x() && v.x() <= bottom_right.x() &&
v.y() >= top_left.y() && v.y() <= bottom_right.y());
}
};