|
constexpr | Ray () noexcept |
| Default constructor.
|
constexpr | Ray (const Point< T, N > &origin, const Vector< T, N > &direction) |
| Constructs a ray from an origin point and a direction vector.
|
constexpr | Ray (const Point< T, N > &origin, const Point< T, N > &target) |
| Constructs a ray from a starting point to a target point.
|
constexpr const Point< T, N > & | origin () const noexcept |
| Gets the origin point of the ray.
|
constexpr const Vector< T, N > & | direction () const noexcept |
| Gets the direction vector of the ray.
|
constexpr Point< T, N > | at (T t) const noexcept |
| Calculates a point along the ray using the parametric equation.
|
template<typename T, int N>
class pbpt::math::Ray< T, N >
A template class for an N-dimensional geometric ray.
This class represents a ray in N-dimensional space, defined by a starting point (origin) and a direction vector. A key design feature of this class is that the direction vector is always stored as a normalized (unit) vector. This invariant is enforced by the constructors, simplifying calculations and ensuring consistent behavior.
The ray is described by the parametric equation P(t) = origin + t * direction.
- Template Parameters
-
T | The underlying floating-point type of the ray's components. |
N | The number of dimensions. |
- See also
- Point
-
Vec