jaulib v1.3.6
Jau Support Library (C++, Java, ..)
Loading...
Searching...
No Matches
jau::math::geom::AABBox2f Class Reference

Axis Aligned Bounding Box. More...

#include <aabbox2f.hpp>

Collaboration diagram for jau::math::geom::AABBox2f:

Public Member Functions

 AABBox2f () noexcept
 Create an Axis Aligned bounding box (AABBox) where the low and and high MAX float Values.
 
constexpr AABBox2f (AABBox2f &&o) noexcept=default
 
constexpr AABBox2f (const AABBox2f &o) noexcept=default
 
 AABBox2f (const Point2f &bl_, const Point2f &tr_) noexcept
 Create an AABBox with given bl (low) and tr (high)
 
AABBox2f box () const noexcept
 
bool contains (const AABBox2f &o) const noexcept
 Returns whether this aabbox2f fully contains given aabbox2f.
 
bool contains (const float x, const float y) const noexcept
 Check if the point is bounded/contained by this AABBox.
 
bool contains (const Point2f &p) const noexcept
 Check if the point is bounded/contained by this AABBox.
 
bool intersects (const AABBox2f &o) const noexcept
 
AABBox2foperator= (AABBox2f &&) noexcept=default
 
AABBox2foperator= (const AABBox2f &) noexcept=default
 
AABBox2freset () noexcept
 Reset this box to the inverse low/high, allowing the next resize(float, float, float) command to hit.
 
AABBox2fresize (const AABBox2f &o) noexcept
 Resize the AABBox to encapsulate another AABox.
 
AABBox2fresize (const Point2f &p) noexcept
 Resize the AABBox to encapsulate the passed point.
 
AABBox2fresize (float x, float y) noexcept
 Resize the AABBox to encapsulate the passed coordinates.
 
std::string toString () const noexcept
 

Public Attributes

Point2f bl
 bottom left (low)
 
Point2f tr
 top right (high)
 

Detailed Description

Axis Aligned Bounding Box.

Defined by two 3D coordinates (low and high) The low being the the lower left corner of the box, and the high being the upper right corner of the box.

A few references for collision detection, intersections:

Definition at line 34 of file aabbox2f.hpp.

Constructor & Destructor Documentation

◆ AABBox2f() [1/4]

jau::math::geom::AABBox2f::AABBox2f ( )
inlinenoexcept

Create an Axis Aligned bounding box (AABBox) where the low and and high MAX float Values.

Definition at line 45 of file aabbox2f.hpp.

Here is the caller graph for this function:

◆ AABBox2f() [2/4]

jau::math::geom::AABBox2f::AABBox2f ( const Point2f & bl_,
const Point2f & tr_ )
inlinenoexcept

Create an AABBox with given bl (low) and tr (high)

Definition at line 52 of file aabbox2f.hpp.

◆ AABBox2f() [3/4]

jau::math::geom::AABBox2f::AABBox2f ( const AABBox2f & o)
constexprdefaultnoexcept

◆ AABBox2f() [4/4]

jau::math::geom::AABBox2f::AABBox2f ( AABBox2f && o)
constexprdefaultnoexcept

Member Function Documentation

◆ operator=() [1/2]

AABBox2f & jau::math::geom::AABBox2f::operator= ( const AABBox2f & )
defaultnoexcept

◆ operator=() [2/2]

AABBox2f & jau::math::geom::AABBox2f::operator= ( AABBox2f && )
defaultnoexcept

◆ reset()

AABBox2f & jau::math::geom::AABBox2f::reset ( )
inlinenoexcept

Reset this box to the inverse low/high, allowing the next resize(float, float, float) command to hit.

Returns
this AABBox for chaining

Definition at line 65 of file aabbox2f.hpp.

Here is the caller graph for this function:

◆ resize() [1/3]

AABBox2f & jau::math::geom::AABBox2f::resize ( const AABBox2f & o)
inlinenoexcept

Resize the AABBox to encapsulate another AABox.

Parameters
newBoxAABBox to be encapsulated in
Returns
this AABBox for chaining

Definition at line 78 of file aabbox2f.hpp.

Here is the caller graph for this function:

◆ resize() [2/3]

AABBox2f & jau::math::geom::AABBox2f::resize ( float x,
float y )
inlinenoexcept

Resize the AABBox to encapsulate the passed coordinates.

Parameters
xx-axis coordinate value
yy-axis coordinate value
Returns
this AABBox for chaining

Definition at line 104 of file aabbox2f.hpp.

◆ resize() [3/3]

AABBox2f & jau::math::geom::AABBox2f::resize ( const Point2f & p)
inlinenoexcept

Resize the AABBox to encapsulate the passed point.

Parameters
xx-axis coordinate value
yy-axis coordinate value
Returns
this AABBox for chaining

Definition at line 130 of file aabbox2f.hpp.

◆ box()

AABBox2f jau::math::geom::AABBox2f::box ( ) const
inlinenoexcept

Definition at line 134 of file aabbox2f.hpp.

◆ contains() [1/3]

bool jau::math::geom::AABBox2f::contains ( const float x,
const float y ) const
inlinenoexcept

Check if the point is bounded/contained by this AABBox.

Returns
true if {x, y} belongs to (low.x, high.x) and y belong to (low.y, high.y)

Definition at line 140 of file aabbox2f.hpp.

◆ contains() [2/3]

bool jau::math::geom::AABBox2f::contains ( const Point2f & p) const
inlinenoexcept

Check if the point is bounded/contained by this AABBox.

Returns
true if p belongs to (low.x, high.x) and y belong to (low.y, high.y)

Definition at line 149 of file aabbox2f.hpp.

Here is the caller graph for this function:

◆ intersects()

bool jau::math::geom::AABBox2f::intersects ( const AABBox2f & o) const
inlinenoexcept

Definition at line 151 of file aabbox2f.hpp.

Here is the caller graph for this function:

◆ contains() [3/3]

bool jau::math::geom::AABBox2f::contains ( const AABBox2f & o) const
inlinenoexcept

Returns whether this aabbox2f fully contains given aabbox2f.

Definition at line 176 of file aabbox2f.hpp.

◆ toString()

std::string jau::math::geom::AABBox2f::toString ( ) const
inlinenoexcept

Definition at line 182 of file aabbox2f.hpp.

Member Data Documentation

◆ bl

Point2f jau::math::geom::AABBox2f::bl

bottom left (low)

Definition at line 37 of file aabbox2f.hpp.

◆ tr

Point2f jau::math::geom::AABBox2f::tr

top right (high)

Definition at line 39 of file aabbox2f.hpp.


The documentation for this class was generated from the following file: