24#ifndef JAU_AABBOX2F_HPP_
25#define JAU_AABBOX2F_HPP_
66 :
bl( bl_ ),
tr( tr_ ) {
153 bool contains(
const float x,
const float y)
const noexcept {
154 return !( x<
bl.
x || x>
tr.
x ||
165 return !(
tr.
x < o.bl.x ||
172 bool intersection(aabbox_t a, aabbox_t b){
173 if(aabbox_t::intersects(a)){
std::string toString() const noexcept
Axis Aligned Bounding Box.
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.
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 T max(const T x, const T y) noexcept
Returns the maximum of two integrals (w/ branching) in O(1)