11#ifndef JAU_MATH_GEOM_AABBOX2F_HPP_
12#define JAU_MATH_GEOM_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 constexpr 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 constexpr 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() +
constexpr AABBox2f & operator=(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.
constexpr bool intersects(const AABBox2f &o) const noexcept
Point2f bl
bottom left (low)
Point2f tr
top right (high)
constexpr AABBox2f() noexcept
Create an Axis Aligned bounding box (AABBox) where the low and and high MAX float Values.
constexpr bool contains(const AABBox2f &o) const noexcept
Returns whether this aabbox2f fully contains given aabbox2f.
constexpr bool contains(const float x, const float y) const noexcept
Check if the point is bounded/contained by this AABBox.
constexpr AABBox2f & reset() noexcept
Reset this box to the inverse low/high, allowing the next resize(float, float, float) command to hit.
constexpr AABBox2f(const Point2f &bl_, const Point2f &tr_) noexcept
Create an AABBox with given bl (low) and tr (high)
constexpr AABBox2f & operator=(const AABBox2f &) noexcept=default
std::string toString() const noexcept
constexpr AABBox2f box() const noexcept
constexpr bool contains(const Point2f &p) const noexcept
Check if the point is bounded/contained by this AABBox.
AABBox2f & resize(const Point2f &p) noexcept
Resize the AABBox to encapsulate the passed point.
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