#include <darts/box.h>
template<int N, typename T>
Box struct
An N-D axis-aligned bounding box consisting of two N-D points min and max.
Constructors, destructors, conversion operators
Public functions
- auto contains(const Vec<N, T>& point, bool proper = false) const -> bool
- Check whether the box contains this
point
. - auto volume() const -> T
- Calculate the N-dimensional volume of the bounding box.
- auto area() const -> T
- Calculate the N-1 dimensional volume of the boundary.
- auto intersect(const Ray<N, T>& ray, T* hitt0 = nullptr, T* hitt1 = nullptr) const -> bool
- Check whether a Ray intersects this Box.
Public variables
Function documentation
template<int N, typename T>
bool Box<N, T>:: intersect(const Ray<N, T>& ray,
T* hitt0 = nullptr,
T* hitt1 = nullptr) const
Check whether a Ray intersects this Box.
Parameters | |
---|---|
ray | The ray along which to check for intersection |
hitt0 | If not null, stores the lower bound of the intersection interval |
hitt1 | If not null, stores the upper bound of the intersection interval |
Returns | true if there is an intersection |