|
RobinTrace
|
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. | |
Class for individual rays.
| ray::ray | ( | ) |
Default constructor.
The ray is initialized with all its components set to 0, and a 'Success' status code.
Initialization constructor.
Construct a ray with initial point component _p and orientation component _v.
| _p | Initial point component of the ray. |
| _v | Initial orientation component of the ray. The status code is initialized to 0. |
| bool ray::is_valid | ( | ) | const |
Check whether the ray holds valid data.
Status code shorthand for checking ray validity.
| 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.
| 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.
| 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.