Antkeeper  0.0.1
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
geom::aabb< T > Struct Template Reference

Axis-aligned bounding box. More...

#include <aabb.hpp>

Inheritance diagram for geom::aabb< T >:
geom::bounding_volume< T >

Public Types

typedef math::vector< T, 3 > vector_type
 
typedef math::matrix< T, 4, 4 > matrix_type
 
typedef math::transform< T > transform_type
 

Public Member Functions

 aabb (const vector_type &min_point, const vector_type &max_point)
 
 aabb ()
 
virtual bounding_volume_type get_bounding_volume_type () const
 Returns the enumerated type of this bounding volume. More...
 
virtual bool intersects (const sphere< T > &sphere) const
 Tests for intersection between this bounding volume and a bounding sphere. More...
 
virtual bool intersects (const aabb< T > &aabb) const
 Tests for intersection between this bounding volume and an axis-aligned bounding box. More...
 
virtual bool contains (const sphere< T > &sphere) const
 Tests whether this bounding volume contains a sphere. More...
 
virtual bool contains (const aabb< T > &aabb) const
 Tests whether this bounding volume contains an axis-aligned bounding box. More...
 
virtual bool contains (const vector_type &point) const
 Tests whether this bounding volume contains a point. More...
 
vector_type corner (std::size_t index) const noexcept
 Returns the position of the specified corner. More...
 
- Public Member Functions inherited from geom::bounding_volume< T >
bool intersects (const bounding_volume &volume) const
 Tests for intersection between this bounding volume and another bounding volume. More...
 

Static Public Member Functions

static aabb transform (const aabb &a, const transform_type &t)
 Transforms an AABB. More...
 
static aabb transform (const aabb &a, const matrix_type &m)
 Transforms an AABB. More...
 

Public Attributes

vector_type min_point
 
vector_type max_point
 

Detailed Description

template<class T>
struct geom::aabb< T >

Axis-aligned bounding box.

Definition at line 36 of file aabb.hpp.

Member Typedef Documentation

◆ matrix_type

template<class T >
typedef math::matrix<T, 4, 4> geom::aabb< T >::matrix_type

Definition at line 39 of file aabb.hpp.

◆ transform_type

template<class T >
typedef math::transform<T> geom::aabb< T >::transform_type

Definition at line 40 of file aabb.hpp.

◆ vector_type

template<class T >
typedef math::vector<T, 3> geom::aabb< T >::vector_type

Definition at line 38 of file aabb.hpp.

Constructor & Destructor Documentation

◆ aabb() [1/2]

template<class T >
geom::aabb< T >::aabb ( const vector_type min_point,
const vector_type max_point 
)

Definition at line 124 of file aabb.hpp.

◆ aabb() [2/2]

template<class T >
geom::aabb< T >::aabb

Definition at line 130 of file aabb.hpp.

Member Function Documentation

◆ contains() [1/3]

template<class T >
bool geom::aabb< T >::contains ( const aabb< T > &  aabb) const
virtual

Tests whether this bounding volume contains an axis-aligned bounding box.

Implements geom::bounding_volume< T >.

Definition at line 171 of file aabb.hpp.

◆ contains() [2/3]

template<class T >
bool geom::aabb< T >::contains ( const sphere< T > &  sphere) const
virtual

Tests whether this bounding volume contains a sphere.

Implements geom::bounding_volume< T >.

Definition at line 159 of file aabb.hpp.

◆ contains() [3/3]

template<class T >
bool geom::aabb< T >::contains ( const vector_type point) const
virtual

Tests whether this bounding volume contains a point.

Implements geom::bounding_volume< T >.

Definition at line 183 of file aabb.hpp.

◆ corner()

template<class T >
aabb< T >::vector_type geom::aabb< T >::corner ( std::size_t  index) const
noexcept

Returns the position of the specified corner.

Parameters
indexIndex of a corner.
Returns
Position of the specified corner.

Definition at line 195 of file aabb.hpp.

◆ get_bounding_volume_type()

template<class T >
bounding_volume_type geom::aabb< T >::get_bounding_volume_type ( ) const
inlinevirtual

Returns the enumerated type of this bounding volume.

Implements geom::bounding_volume< T >.

Definition at line 134 of file aabb.hpp.

◆ intersects() [1/2]

template<class T >
bool geom::aabb< T >::intersects ( const aabb< T > &  aabb) const
virtual

Tests for intersection between this bounding volume and an axis-aligned bounding box.

Implements geom::bounding_volume< T >.

Definition at line 147 of file aabb.hpp.

◆ intersects() [2/2]

template<class T >
bool geom::aabb< T >::intersects ( const sphere< T > &  sphere) const
virtual

Tests for intersection between this bounding volume and a bounding sphere.

Implements geom::bounding_volume< T >.

Definition at line 140 of file aabb.hpp.

◆ transform() [1/2]

template<class T >
aabb< T > geom::aabb< T >::transform ( const aabb< T > &  a,
const matrix_type m 
)
static

Transforms an AABB.

Parameters
aAABB to be transformed.
mMatrix by which the AABB should be transformed.
Returns
Transformed AABB.

Definition at line 103 of file aabb.hpp.

◆ transform() [2/2]

template<class T >
aabb< T > geom::aabb< T >::transform ( const aabb< T > &  a,
const transform_type t 
)
static

Transforms an AABB.

Parameters
aAABB to be transformed.
tTransform by which the AABB should be transformed.
Returns
Transformed AABB.

Definition at line 83 of file aabb.hpp.

Member Data Documentation

◆ max_point

template<class T >
vector_type geom::aabb< T >::max_point

Definition at line 43 of file aabb.hpp.

◆ min_point

template<class T >
vector_type geom::aabb< T >::min_point

Definition at line 42 of file aabb.hpp.


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