20 #ifndef ANTKEEPER_GEOM_BOUNDING_VOLUME_HPP
21 #define ANTKEEPER_GEOM_BOUNDING_VOLUME_HPP
80 return intersects(
static_cast<const sphere<T>&
>(volume));
84 return intersects(
static_cast<const aabb<T>&
>(volume));
88 throw std::runtime_error(
"unimplemented");
Abstract base class for bounding volumes.
virtual bool intersects(const sphere< T > &sphere) const =0
Tests for intersection between this bounding volume and a bounding sphere.
virtual bool contains(const aabb< T > &aabb) const =0
Tests whether this bounding volume contains an axis-aligned bounding box.
virtual bounding_volume_type get_bounding_volume_type() const =0
Returns the enumerated type of this bounding volume.
virtual bool contains(const math::vector< T, 3 > &point) const =0
Tests whether this bounding volume contains a point.
virtual bool contains(const sphere< T > &sphere) const =0
Tests whether this bounding volume contains a sphere.
virtual bool intersects(const aabb< T > &aabb) const =0
Tests for intersection between this bounding volume and an axis-aligned bounding box.
bool intersects(const bounding_volume &volume) const
Tests for intersection between this bounding volume and another bounding volume.
hypersphere< T, 3 > sphere
3-dimensional hypersphere.
bounding_volume_type
Enumerates bounding volume types.
@ sphere
Indicates the bounding volume is a sphere.
@ aabb
Indicates the bounding volume is an axis-aligned bounding box.
Axis-aligned bounding box.
A plane-bounded convex hull.