#include <darts/ray.h>
template<size_t N, typename T>
Ray struct

Simple ray segment data structure.

Along with the ray origin and direction, this data structure additionally stores the segment interval [mint, maxt], which may include positive/negative infinity.

Public static variables

static float epsilon constexpr
"Ray epsilon": relative error threshold for ray intersection computations
static float infinity constexpr
infinity for type

Constructors, destructors, conversion operators

Ray()
Construct a new ray.
Ray(const Vec<N, T>& o, const Vec<N, T>& d)
Construct a new ray.
Ray(const Vec<N, T>& o, const Vec<N, T>& d, T mint, T maxt)
Construct a new ray.
Ray(const Ray& ray, T mint, T maxt)
Copy a ray, but change the covered segment of the copy.

Public functions

auto operator()(T t) const -> Vec<N, T>
Return the position of a point along the ray.

Public variables

Vec<N, T> o
The origin of the ray.
Vec<N, T> d
The direction of the ray.
T mint
Minimum distance along the ray segment.
T maxt
Maximum distance along the ray segment.