Nori

TRay< _PointType, _VectorType > Struct Template Reference

Simple n-dimensional ray segment data structure. More...

#include <ray.h>

List of all members.

Public Types

typedef _PointType PointType
typedef _VectorType VectorType
typedef PointType::Scalar Scalar

Public Member Functions

 TRay ()
 Construct a new ray.
 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 (const TRay &ray)
 Copy constructor.
 TRay (const TRay &ray, Scalar mint, Scalar maxt)
 Copy a ray, but change the covered segment of the copy.
void update ()
 Update the reciprocal ray directions after changing 'd'.
PointType operator() (Scalar t) const
 Return the position of a point along the ray.
Ray3f reverse () const
 Return a ray that points into the opposite direction.
QString toString () const
 Return a human-readable string summary of this ray.

Public Attributes

PointType o
 Ray origin.
VectorType d
 Ray direction.
VectorType dRcp
 Componentwise reciprocals of the ray direction.
Scalar mint
 Minimum position on the ray segment.
Scalar maxt
 Maximum position on the ray segment.

Detailed Description

template<typename _PointType, typename _VectorType>
struct TRay< _PointType, _VectorType >

Simple n-dimensional ray segment data structure.

Along with the ray origin and direction, this data structure additionally stores a ray segment [mint, maxt] (whose entries may include positive/negative infinity), as well as the componentwise reciprocals of the ray direction. That is just done for convenience, as these values are frequently required.

Remarks:
Important: be careful when changing the ray direction. You must call update() to compute the componentwise reciprocals as well, or Nori's ray-triangle intersection code will go haywire.

Definition at line 38 of file ray.h.


Member Typedef Documentation

template<typename _PointType, typename _VectorType>
typedef _PointType TRay< _PointType, _VectorType >::PointType

Definition at line 39 of file ray.h.

template<typename _PointType, typename _VectorType>
typedef PointType::Scalar TRay< _PointType, _VectorType >::Scalar

Definition at line 41 of file ray.h.

template<typename _PointType, typename _VectorType>
typedef _VectorType TRay< _PointType, _VectorType >::VectorType

Definition at line 40 of file ray.h.


Constructor & Destructor Documentation

template<typename _PointType, typename _VectorType>
TRay< _PointType, _VectorType >::TRay ( ) [inline]

Construct a new ray.

Definition at line 50 of file ray.h.

template<typename _PointType, typename _VectorType>
TRay< _PointType, _VectorType >::TRay ( const PointType o,
const VectorType d 
) [inline]

Construct a new ray.

Definition at line 54 of file ray.h.

template<typename _PointType, typename _VectorType>
TRay< _PointType, _VectorType >::TRay ( const PointType o,
const VectorType d,
Scalar  mint,
Scalar  maxt 
) [inline]

Construct a new ray.

Definition at line 60 of file ray.h.

template<typename _PointType, typename _VectorType>
TRay< _PointType, _VectorType >::TRay ( const TRay< _PointType, _VectorType > &  ray) [inline]

Copy constructor.

Definition at line 66 of file ray.h.

template<typename _PointType, typename _VectorType>
TRay< _PointType, _VectorType >::TRay ( const TRay< _PointType, _VectorType > &  ray,
Scalar  mint,
Scalar  maxt 
) [inline]

Copy a ray, but change the covered segment of the copy.

Definition at line 71 of file ray.h.


Member Function Documentation

template<typename _PointType, typename _VectorType>
PointType TRay< _PointType, _VectorType >::operator() ( Scalar  t) const [inline]

Return the position of a point along the ray.

Definition at line 80 of file ray.h.

template<typename _PointType, typename _VectorType>
Ray3f TRay< _PointType, _VectorType >::reverse ( ) const [inline]

Return a ray that points into the opposite direction.

Definition at line 83 of file ray.h.

template<typename _PointType, typename _VectorType>
QString TRay< _PointType, _VectorType >::toString ( ) const [inline]

Return a human-readable string summary of this ray.

Definition at line 91 of file ray.h.

template<typename _PointType, typename _VectorType>
void TRay< _PointType, _VectorType >::update ( ) [inline]

Update the reciprocal ray directions after changing 'd'.

Definition at line 75 of file ray.h.


Member Data Documentation

template<typename _PointType, typename _VectorType>
VectorType TRay< _PointType, _VectorType >::d

Ray direction.

Definition at line 44 of file ray.h.

template<typename _PointType, typename _VectorType>
VectorType TRay< _PointType, _VectorType >::dRcp

Componentwise reciprocals of the ray direction.

Definition at line 45 of file ray.h.

template<typename _PointType, typename _VectorType>
Scalar TRay< _PointType, _VectorType >::maxt

Maximum position on the ray segment.

Definition at line 47 of file ray.h.

template<typename _PointType, typename _VectorType>
Scalar TRay< _PointType, _VectorType >::mint

Minimum position on the ray segment.

Definition at line 46 of file ray.h.

template<typename _PointType, typename _VectorType>
PointType TRay< _PointType, _VectorType >::o

Ray origin.

Definition at line 43 of file ray.h.


The documentation for this struct was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines