|
RobinTrace
|
Go to the source code of this file.
Functions | |
| void | reflect (ray &r, const Vec3 &N) |
| Reflect ray operation. More... | |
| void | refract (ray &r, const Vec3 &N, double nr) |
| Refract ray operation. More... | |
Reflect ray operation.
This applies a specular reflection to the orientation of ray r incident to a mirror with local normal vector N.
| r | The ray to apply the operation to. Modified in-place. |
| N | The normal vector of the reflective element. |
This operation does not have error cases.
Refract ray operation.
This applies a refraction to the orientation of ray r incident to a diopter with local normal vector N and relative index of refraction nr.
| r | The ray to apply the operation to. Modified in-place. |
| N | The normal vector of the diopter. |
| nr | The relative index of refraction of the diopter, \(n_r = n_1/n_2\) with \(n1\) and \(n2\) the refractive indices of the incident and exit media respectively. |
Possible error: TIR.