|
Path Tracer
|
Defines the DoubleUnitVec3D class and some functions around it. More...
#include "DoubleVec3D.h"Go to the source code of this file.
Classes | |
| class | DoubleUnitVec3D |
| A three-dimensional unit vector using doubles. More... | |
Functions | |
| DoubleUnitVec3D | operator- (const DoubleUnitVec3D &vec) |
| Unary minus. More... | |
| DoubleUnitVec3D | randomVectorOnUnitRadiusSphere () |
| Generates a random unit vector on a sphere. More... | |
Defines the DoubleUnitVec3D class and some functions around it.
| 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.