|
Path Tracer
|
#include "DoubleUnitVec3D.h"Functions | |
| DoubleUnitVec3D | operator- (const DoubleUnitVec3D &vec) |
| Unary minus. More... | |
| DoubleUnitVec3D | randomVectorOnUnitRadiusSphere () |
| Generates a random unit vector on a sphere. More... | |
| DoubleUnitVec3D operator- | ( | const DoubleUnitVec3D & | vec | ) |
Unary minus.
Allows to skip the conversion from DoubleVec3D to DoubleUnitVec3D.
| vec | The vector that will be inversed. |
| DoubleUnitVec3D randomVectorOnUnitRadiusSphere | ( | ) |
Generates a random unit vector on a sphere.
Every vector has the same probability to show up. We can combine this function with a dot product between the resulting vector and a normal to a surface. If we inverse the vector when the dot product is negative, then we get a random vector on a unit hemisphere.