|
raytracer
Parallel Ray Tracer written from scratch (no graphics API).
|
#include <vec3.h>

Public Member Functions | |
| constexpr | Vec3 (const double _x, const double _y, const double _z) |
| void | normalize () |
| Vec3 | to_normalized () const |
| double | length () const |
| constexpr Vec3 | cross (Vec3 const &other) const |
| constexpr bool | operator== (Vec3 const &other) const |
| constexpr Vec3 | operator+ (Vec3 const &other) const |
| constexpr void | operator+= (Vec3 const &other) |
| constexpr Vec3 | operator- (Vec3 const &other) const |
| constexpr Vec3 | operator- () const |
| constexpr double | operator* (Vec3 const &other) const |
| constexpr Vec3 | operator* (const double d) const |
| constexpr Vec3 | operator/ (const double d) const |
Public Attributes | |
| double | x |
| double | y |
| double | z |
Static Public Attributes | |
| static const Vec3 | ZERO = {0, 0, 0} |
A 3D vector, used for directions, positions in 3D space, and colors
|
inlineconstexpr |

Returns the cross product between this vector and the vector passed as a parameter.
| other | The vector with which to compute the cross product. |


|
inlinenodiscard |
Returns the length of the vector, which is equal to the square root of its squared dimensions.

|
inline |
Normalizes the current vector in-place by dividing its dimension by its length, making the length one while keeping the ratios between the dimensions.

|
inlineconstexpr |

|
inlineconstexpr |


|
inlineconstexpr |

|
inlineconstexpr |


|
inlineconstexpr |

|
inlineconstexpr |

|
inlinenodiscard |
Returns a normalized instance of the current vector, without modifying it.


| double raytracer::common::Vec3::x |
| double raytracer::common::Vec3::y |
| double raytracer::common::Vec3::z |
|
inlinestaticconstexpr |
The zero vector.