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

Bounding sphere. More...

#include <sphere.hpp>

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

Public Types

typedef math::vector< T, 3 > vector_type
 

Public Member Functions

 sphere (const vector_type &center, T radius)
 
 sphere ()
 
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...
 
- 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...
 

Public Attributes

vector_type center
 
radius
 

Detailed Description

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

Bounding sphere.

Definition at line 34 of file sphere.hpp.

Member Typedef Documentation

◆ vector_type

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

Definition at line 36 of file sphere.hpp.

Constructor & Destructor Documentation

◆ sphere() [1/2]

template<class T >
geom::sphere< T >::sphere ( const vector_type center,
radius 
)

Definition at line 53 of file sphere.hpp.

◆ sphere() [2/2]

template<class T >
geom::sphere< T >::sphere

Definition at line 59 of file sphere.hpp.

Member Function Documentation

◆ contains() [1/3]

template<class T >
bool geom::sphere< 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 94 of file sphere.hpp.

◆ contains() [2/3]

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

Tests whether this bounding volume contains a sphere.

Implements geom::bounding_volume< T >.

Definition at line 83 of file sphere.hpp.

◆ contains() [3/3]

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

Tests whether this bounding volume contains a point.

Implements geom::bounding_volume< T >.

Definition at line 109 of file sphere.hpp.

◆ get_bounding_volume_type()

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

Returns the enumerated type of this bounding volume.

Implements geom::bounding_volume< T >.

Definition at line 63 of file sphere.hpp.

◆ intersects() [1/2]

template<class T >
bool geom::sphere< 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 77 of file sphere.hpp.

◆ intersects() [2/2]

template<class T >
bool geom::sphere< 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 69 of file sphere.hpp.

Member Data Documentation

◆ center

template<class T >
vector_type geom::sphere< T >::center

Definition at line 38 of file sphere.hpp.

◆ radius

template<class T >
T geom::sphere< T >::radius

Definition at line 39 of file sphere.hpp.


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