RobinTrace
Public Member Functions | Public Attributes | Friends | List of all members
ray Class Reference

Class for individual rays. More...

#include <ray.h>

Public Member Functions

 ray ()
 Default constructor. More...
 
 ray (Vec3 _p, Vec3 _v)
 Initialization constructor. More...
 
bool is_valid () const
 Check whether the ray holds valid data. More...
 

Public Attributes

Vec3 p
 Point component. More...
 
Vec3 v
 Orientation component. More...
 
int code
 Status code. More...
 

Friends

std::ostream & operator<< (std::ostream &out, const ray &r)
 Printer.
 

Detailed Description

Class for individual rays.

Constructor & Destructor Documentation

◆ ray() [1/2]

ray::ray ( )

Default constructor.

The ray is initialized with all its components set to 0, and a 'Success' status code.

◆ ray() [2/2]

ray::ray ( Vec3  _p,
Vec3  _v 
)

Initialization constructor.

Construct a ray with initial point component _p and orientation component _v.

Parameters
_pInitial point component of the ray.
_vInitial orientation component of the ray. The status code is initialized to 0.

Member Function Documentation

◆ is_valid()

bool ray::is_valid ( ) const

Check whether the ray holds valid data.

Status code shorthand for checking ray validity.

Member Data Documentation

◆ code

int ray::code

Status code.

Status code for signaling error cases in raytracing operations. The status codes are tabulated hereafter.

Code Meaning
0 Valid
3 refract(): TIR
4 transfer.apply(): ray is parallel to the new local plane.
5 standard::intersect(): No intersection.

A status code of 0 means the ray is holding valid values.

◆ p

Vec3 ray::p

Point component.

Holds the three components \((x,y,z)\) of the ray. It describes where the ray is resting in the current LCS.

◆ v

Vec3 ray::v

Orientation component.

Holds the three components \((l,m,n)\) of the ray. It orients the ray from its point component in the light propagation direction. The light propagates along the positive v direction.


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