19 #if !defined(__NORI_RAY_H)
22 #include <nori/vector.h>
38 template <
typename _Po
intType,
typename _VectorType>
struct TRay {
39 typedef _PointType PointType;
40 typedef _VectorType VectorType;
41 typedef typename PointType::Scalar Scalar;
51 maxt(std::numeric_limits<Scalar>::infinity()) { }
54 TRay(
const PointType &
o,
const VectorType &
d) :
o(
o),
d(
d),
55 mint(Epsilon),
maxt(std::numeric_limits<Scalar>::infinity()) {
60 TRay(
const PointType &
o,
const VectorType &
d,
76 dRcp =
d.cwiseInverse();
Simple n-dimensional ray segment data structure.
VectorType d
Ray direction.
Scalar mint
Minimum position on the ray segment.
std::string toString() const
Return a human-readable string summary of this ray.
TRay(const TRay &ray, Scalar mint, Scalar maxt)
Copy a ray, but change the covered segment of the copy.
TRay(const TRay &ray)
Copy constructor.
void update()
Update the reciprocal ray directions after changing 'd'.
PointType operator()(Scalar t) const
Return the position of a point along the ray.
Scalar maxt
Maximum position on the ray segment.
TRay(const PointType &o, const VectorType &d)
Construct a new ray.
TRay(const PointType &o, const VectorType &d, Scalar mint, Scalar maxt)
Construct a new ray.
TRay reverse() const
Return a ray that points into the opposite direction.
VectorType dRcp
Componentwise reciprocals of the ray direction.
TRay()
Construct a new ray.