4#ifndef LODESTONE_BOUNDS2I_H
5#define LODESTONE_BOUNDS2I_H
19 return std::format(
"Bounds2[min={}, max={}]",
min.toString(),
26 constexpr Bounds2(
const int x0,
const int z0,
const int x1,
28 :
min({x0, z0}), max({x1, z1}) {};
67 return vec.x >=
min.x && vec.x <=
max.x && vec.y >=
min.y &&
71 constexpr bool empty() const noexcept {
76 if (
empty() || rhs.empty())
79 return !(rhs.max.x <
min.x || rhs.min.x >
max.x ||
80 rhs.max.y <
min.y || rhs.min.y >
max.y);
Bounds2< double > Bounds2d
Definition Bounds2.h:94
Bounds2< float > Bounds2f
Definition Bounds2.h:93
Bounds2< int > Bounds2i
Definition Bounds2.h:92
constexpr Bounds2 operator*(const int v) const
Definition Bounds2.h:42
std::string toString() const override
Definition Bounds2.h:18
constexpr Bounds2(const int x0, const int z0, const int x1, const int z1)
Definition Bounds2.h:26
constexpr Bounds2 operator+(const Bounds2 &rhs) const
Definition Bounds2.h:50
constexpr Bounds2 operator+(const int v) const
Definition Bounds2.h:34
constexpr int getLength() const noexcept
Definition Bounds2.h:87
constexpr Bounds2 operator-(const int v) const
Definition Bounds2.h:38
constexpr bool intersects(const Bounds2 &rhs) const noexcept
Definition Bounds2.h:75
constexpr Bounds2(const Vec2< T > &min, const Vec2< T > &max)
Definition Bounds2.h:23
Vec2< int > min
Definition Bounds2.h:15
constexpr bool operator==(const Bounds2 &rhs) const
Definition Bounds2.h:30
constexpr Bounds2 operator/(const int v) const
Definition Bounds2.h:46
constexpr Bounds2 operator-(const Bounds2 &rhs) const
Definition Bounds2.h:54
constexpr bool contains(const Vec2< T > &vec) const noexcept
Definition Bounds2.h:66
constexpr Bounds2 operator*(const Bounds2 &rhs) const
Definition Bounds2.h:58
constexpr int getWidth() const noexcept
Definition Bounds2.h:83
Vec2< int > max
Definition Bounds2.h:16
constexpr Bounds2 operator/(const Bounds2 &rhs) const
Definition Bounds2.h:62
constexpr bool empty() const noexcept
Definition Bounds2.h:71