RobinTrace
Functions
rop.h File Reference
#include "base/Vec3.h"
#include "ray/ray.h"
#include <cmath>
Include dependency graph for rop.h:
This graph shows which files directly or indirectly include this file:

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...
 

Function Documentation

◆ reflect()

void reflect ( ray r,
const Vec3 N 
)

Reflect ray operation.

This applies a specular reflection to the orientation of ray r incident to a mirror with local normal vector N.

Parameters
rThe ray to apply the operation to. Modified in-place.
NThe normal vector of the reflective element.

This operation does not have error cases.

Here is the caller graph for this function:

◆ refract()

void refract ( ray r,
const Vec3 N,
double  nr 
)

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.

Parameters
rThe ray to apply the operation to. Modified in-place.
NThe normal vector of the diopter.
nrThe 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.

Here is the caller graph for this function: