11#ifndef JAU_AABBOX2F_HPP_
12#define JAU_AABBOX2F_HPP_
53 :
bl( bl_ ),
tr( tr_ ) {
66 bl.x = std::numeric_limits<float>::max();
67 bl.y = std::numeric_limits<float>::max();
68 tr.x = -std::numeric_limits<float>::max();
69 tr.y = -std::numeric_limits<float>::max();
140 bool contains(
const float x,
const float y)
const noexcept {
141 return bl.x<=x && x<=
tr.x &&
163 return lo.
x <= hi.
x && lo.
y <= hi.
y;
167 bool intersection(aabbox_t a, aabbox_t b){
168 if(aabbox_t::intersects(a)){
177 return tr.x >= o.tr.x &&
183 return "aabb[bl " +
bl.toString() +
184 ", tr " +
tr.toString() +
AABBox2f & operator=(AABBox2f &&) noexcept=default
AABBox2f & operator=(const AABBox2f &) noexcept=default
constexpr AABBox2f(AABBox2f &&o) noexcept=default
AABBox2f & resize(const AABBox2f &o) noexcept
Resize the AABBox to encapsulate another AABox.
constexpr AABBox2f(const AABBox2f &o) noexcept=default
AABBox2f & resize(float x, float y) noexcept
Resize the AABBox to encapsulate the passed coordinates.
bool contains(const Point2f &p) const noexcept
Check if the point is bounded/contained by this AABBox.
Point2f bl
bottom left (low)
Point2f tr
top right (high)
AABBox2f() noexcept
Create an Axis Aligned bounding box (AABBox) where the low and and high MAX float Values.
AABBox2f & reset() noexcept
Reset this box to the inverse low/high, allowing the next resize(float, float, float) command to hit.
bool contains(const AABBox2f &o) const noexcept
Returns whether this aabbox2f fully contains given aabbox2f.
std::string toString() const noexcept
AABBox2f(const Point2f &bl_, const Point2f &tr_) noexcept
Create an AABBox with given bl (low) and tr (high)
bool intersects(const AABBox2f &o) const noexcept
AABBox2f box() const noexcept
AABBox2f & resize(const Point2f &p) noexcept
Resize the AABBox to encapsulate the passed point.
bool contains(const float x, const float y) const noexcept
Check if the point is bounded/contained by this AABBox.
constexpr Vector2F< T > max(const Vector2F< T > &lhs, const Vector2F< T > &rhs) noexcept
constexpr Vector2F< T > min(const Vector2F< T > &lhs, const Vector2F< T > &rhs) noexcept