CMSC23740 Common Code Library
Support code for CS23740 programming projects
Loading...
Searching...
No Matches
cs237::__detail::AABB< T > Struct Template Reference

Axis-Aligned Bounding Box parameterized over the scalar type. More...

#include <aabb.hpp>

Public Types

using vec3 = glm::vec<3, T, glm::defaultp>

Public Member Functions

 AABB ()
 AABB (AABB const &bbox)
 AABB (vec3 const &pt)
 AABB (vec3 const &min, vec3 const &max)
bool isEmpty () const
 is the box empty
void clear ()
 clear the box (i.e., make it empty)
bool includesPt (vec3 const &pt) const
 is a point inside the box?
T distanceToPt (vec3 const &pt) const
 distance to a point; will be 0.0 if the point is inside the box
void addPt (vec3 const &pt)
 extend this box as necessary to include the point
AABB & operator+= (AABB const &bb)
AABB & operator+= (vec3 const &pt)
vec3 const & min () const
 minimum extents of the box
vec3 const & max () const
 maximum extents of the box
vec3 center () const
 center of the box
T minX () const
 minimum X-coordinate of the box
T minY () const
 minimum Y-coordinate of the box
T minZ () const
 minimum Z-coordinate of the box
T maxX () const
 maximum X-coordinate of the box
T maxY () const
 maximum Y-coordinate of the box
T maxZ () const
 maximum Z-coordinate of the box
vec3 corner (int i) const
std::array< vec3, 8 > corners () const
 return an array of the corners of the box

Public Attributes

vec3 _min
vec3 _max
bool _empty

Detailed Description

template<typename T>
struct cs237::__detail::AABB< T >

Axis-Aligned Bounding Box parameterized over the scalar type.

Member Typedef Documentation

◆ vec3

template<typename T>
using cs237::__detail::AABB< T >::vec3 = glm::vec<3, T, glm::defaultp>

Constructor & Destructor Documentation

◆ AABB() [1/4]

template<typename T>
cs237::__detail::AABB< T >::AABB ( )
inline

◆ AABB() [2/4]

template<typename T>
cs237::__detail::AABB< T >::AABB ( AABB< T > const & bbox)
inline

◆ AABB() [3/4]

template<typename T>
cs237::__detail::AABB< T >::AABB ( vec3 const & pt)
inline

◆ AABB() [4/4]

template<typename T>
cs237::__detail::AABB< T >::AABB ( vec3 const & min,
vec3 const & max )
inline

Member Function Documentation

◆ addPt()

template<typename T>
void cs237::__detail::AABB< T >::addPt ( vec3 const & pt)
inline

extend this box as necessary to include the point

◆ center()

template<typename T>
vec3 cs237::__detail::AABB< T >::center ( ) const
inline

center of the box

◆ clear()

template<typename T>
void cs237::__detail::AABB< T >::clear ( )
inline

clear the box (i.e., make it empty)

◆ corner()

template<typename T>
vec3 cs237::__detail::AABB< T >::corner ( int i) const
inline

return the coordinates of the i'th corner of the box, where _min is corner 0 and _max is corner 7.

◆ corners()

template<typename T>
std::array< vec3, 8 > cs237::__detail::AABB< T >::corners ( ) const
inline

return an array of the corners of the box

◆ distanceToPt()

template<typename T>
T cs237::__detail::AABB< T >::distanceToPt ( vec3 const & pt) const
inline

distance to a point; will be 0.0 if the point is inside the box

◆ includesPt()

template<typename T>
bool cs237::__detail::AABB< T >::includesPt ( vec3 const & pt) const
inline

is a point inside the box?

◆ isEmpty()

template<typename T>
bool cs237::__detail::AABB< T >::isEmpty ( ) const
inline

is the box empty

◆ max()

template<typename T>
vec3 const & cs237::__detail::AABB< T >::max ( ) const
inline

maximum extents of the box

◆ maxX()

template<typename T>
T cs237::__detail::AABB< T >::maxX ( ) const
inline

maximum X-coordinate of the box

◆ maxY()

template<typename T>
T cs237::__detail::AABB< T >::maxY ( ) const
inline

maximum Y-coordinate of the box

◆ maxZ()

template<typename T>
T cs237::__detail::AABB< T >::maxZ ( ) const
inline

maximum Z-coordinate of the box

◆ min()

template<typename T>
vec3 const & cs237::__detail::AABB< T >::min ( ) const
inline

minimum extents of the box

◆ minX()

template<typename T>
T cs237::__detail::AABB< T >::minX ( ) const
inline

minimum X-coordinate of the box

◆ minY()

template<typename T>
T cs237::__detail::AABB< T >::minY ( ) const
inline

minimum Y-coordinate of the box

◆ minZ()

template<typename T>
T cs237::__detail::AABB< T >::minZ ( ) const
inline

minimum Z-coordinate of the box

◆ operator+=() [1/2]

template<typename T>
AABB & cs237::__detail::AABB< T >::operator+= ( AABB< T > const & bb)
inline

merge the bounding box into this bounding box

Parameters
bbthe bounding box to merge into this box

◆ operator+=() [2/2]

template<typename T>
AABB & cs237::__detail::AABB< T >::operator+= ( vec3 const & pt)
inline

extend this box as necessary to include the point

Parameters
ptthe point to include in this box

Member Data Documentation

◆ _empty

template<typename T>
bool cs237::__detail::AABB< T >::_empty

◆ _max

template<typename T>
vec3 cs237::__detail::AABB< T >::_max

◆ _min

template<typename T>
vec3 cs237::__detail::AABB< T >::_min

The documentation for this struct was generated from the following file:
  • /Users/jhr/Classes/23740/f2026/solutions/cs237-library/include/cs237/aabb.hpp