Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::Ray Class Referencefinal

Represents a ray in space. More...

#include <Ray.h>

Public Member Functions

 Ray ()=default
 A ray with unspecified state.
 
 Ray (const math::Vector3R &origin, const math::Vector3R &direction)
 A longest possible ray.
 
 Ray (const math::Vector3R &origin, const math::Vector3R &direction, const Time &time)
 A longest possible ray.
 
 Ray (const math::Vector3R &origin, const math::Vector3R &direction, real minT, real maxT)
 A ray segment.
 
 Ray (const math::Vector3R &origin, const math::Vector3R &direction, real minT, real maxT, const Time &time)
 A ray segment.
 
 Ray (const math::TLineSegment< real > &segment, const Time &time)
 A ray segment.
 
Rayreverse ()
 Points this ray in opposite direction.
 
void setMinT (real t)
 Set the parametric distance where the ray starts.
 
void setMaxT (real t)
 Set the parametric distance where the ray ends.
 
void setRange (real minT, real maxT)
 Set the parametric range where the ray extends.
 
void setOrigin (const math::Vector3R &pos)
 Set the origin of the ray.
 
void setDir (const math::Vector3R &dir)
 Set the direction vector of the ray.
 
void setSegment (const math::TLineSegment< real > &segment)
 
void setTime (const Time &time)
 Set the associated time of this ray.
 
const TimegetTime () const
 Get the associated time of this ray.
 
Getters

Basic getters for line attributes. See corresponding setters (if present) for more info.

const math::Vector3RgetOrigin () const
 
const math::Vector3RgetDir () const
 
real getMinT () const
 
real getMaxT () const
 
const math::TLineSegment< real > & getSegment () const
 
math::Vector3R getTail () const
 Get the coordinates on minimum parametric distance.
 
math::Vector3R getHead () const
 Get the coordinates on maximum parametric distance.
 

Detailed Description

Represents a ray in space.

A ray is essentially a line segment in space with additional attributes (for example, time). Note the direction vector of the ray does not need to be normalized.

Constructor & Destructor Documentation

◆ Ray() [1/6]

ph::Ray::Ray ( )
default

A ray with unspecified state.

◆ Ray() [2/6]

ph::Ray::Ray ( const math::Vector3R & origin,
const math::Vector3R & direction )
inline

A longest possible ray.

Parameters
directionDoes not need to be normalized.

◆ Ray() [3/6]

ph::Ray::Ray ( const math::Vector3R & origin,
const math::Vector3R & direction,
const Time & time )
inline

A longest possible ray.

Parameters
directionDoes not need to be normalized.

◆ Ray() [4/6]

ph::Ray::Ray ( const math::Vector3R & origin,
const math::Vector3R & direction,
real minT,
real maxT )
inline

A ray segment.

Parameters
minTParametric distance where the ray begins.
maxTParametric distance where the ray ends.

◆ Ray() [5/6]

ph::Ray::Ray ( const math::Vector3R & origin,
const math::Vector3R & direction,
real minT,
real maxT,
const Time & time )
inline

A ray segment.

Parameters
minTParametric distance where the ray begins.
maxTParametric distance where the ray ends.
timeThe associated time of this ray.

◆ Ray() [6/6]

ph::Ray::Ray ( const math::TLineSegment< real > & segment,
const Time & time )
inline

A ray segment.

Parameters
minTParametric distance where the ray begins.
maxTParametric distance where the ray ends.
timeThe associated time of this ray.

Member Function Documentation

◆ getDir()

const math::Vector3R & ph::Ray::getDir ( ) const
inline

◆ getHead()

math::Vector3R ph::Ray::getHead ( ) const
inline

Get the coordinates on maximum parametric distance.

◆ getMaxT()

real ph::Ray::getMaxT ( ) const
inline

◆ getMinT()

real ph::Ray::getMinT ( ) const
inline

◆ getOrigin()

const math::Vector3R & ph::Ray::getOrigin ( ) const
inline

◆ getSegment()

const math::TLineSegment< real > & ph::Ray::getSegment ( ) const
inline

◆ getTail()

math::Vector3R ph::Ray::getTail ( ) const
inline

Get the coordinates on minimum parametric distance.

◆ getTime()

const Time & ph::Ray::getTime ( ) const
inline

Get the associated time of this ray.

◆ reverse()

Ray & ph::Ray::reverse ( )
inline

Points this ray in opposite direction.

This method essentially mirrored the ray with respect to its origin, with other attributes remain the same.

◆ setDir()

void ph::Ray::setDir ( const math::Vector3R & dir)
inline

Set the direction vector of the ray.

Note that the vector does not need to be normalized.

◆ setMaxT()

void ph::Ray::setMaxT ( real t)
inline

Set the parametric distance where the ray ends.

◆ setMinT()

void ph::Ray::setMinT ( real t)
inline

Set the parametric distance where the ray starts.

◆ setOrigin()

void ph::Ray::setOrigin ( const math::Vector3R & pos)
inline

Set the origin of the ray.

◆ setRange()

void ph::Ray::setRange ( real minT,
real maxT )
inline

Set the parametric range where the ray extends.

The range is [minT, maxT). This is equivalent to calling setMinT(real) and setMaxT(real) together.

◆ setSegment()

void ph::Ray::setSegment ( const math::TLineSegment< real > & segment)
inline

◆ setTime()

void ph::Ray::setTime ( const Time & time)
inline

Set the associated time of this ray.


The documentation for this class was generated from the following file: