#include <Ray.h>
Public Member Functions | |
Constructors | |
Ray () | |
Instantiation constructor for the Raytracer class. More... | |
Ray (Vec3 origin, Vec3 direction) | |
Instantiation constructor for the Raytracer class. More... | |
Get functions | |
const Vec3 & | getOrigin () const |
Returns the origin point of the ray. More... | |
const Vec3 & | getDirection () const |
Returns the normalized direction vector of the ray. More... | |
real_t | getDirection (size_t axis) const |
Returns the normalized direction vector of the ray for a given axis. More... | |
real_t | xDir () const |
Returns the x component of the ray direction. More... | |
real_t | yDir () const |
Returns the y component of the ray direction. More... | |
real_t | zDir () const |
Returns the z component of the ray direction. More... | |
const Vec3 & | getInvDirection () const |
Returns the inverse of the direction vector of the ray. More... | |
real_t | getInvDirection (size_t axis) const |
Returns the inverse of the direction vector of the ray for a given axis. More... | |
real_t | xInvDir () const |
Returns the x component of the inverse ray direction. More... | |
real_t | yInvDir () const |
Returns the y component of the inverse ray direction. More... | |
real_t | zInvDir () const |
Returns the z component of the inverse ray direction. More... | |
const Vector3< int8_t > & | getInvDirectionSigns () const |
Returns the signs of the inverted direction vector of the ray. More... | |
size_t | getImageX () const |
Returns the X value of the pixel coordinate this ray intersects. More... | |
size_t | getImageY () const |
Returns the Y value of the pixel coordinate this ray intersects. More... | |
Set functions | |
void | setOrigin (const Vec3 &origin) |
Set the origin point of the ray. More... | |
void | setDirection (const Vec3 &direction) |
Set the normalized direction vector of the ray. More... | |
void | setImageCoordinate (size_t x, size_t y) |
Sets the X and Y values of the image pixel coordinate this ray intersects. More... | |
void | setImageX (size_t x) |
Sets the X value of the image pixel coordinate this ray intersects. More... | |
void | setImageY (size_t y) |
Sets the Y value of the image pixel coordinate this ray intersects. More... | |
Utility functions | |
void | calcInvDirection () |
Calculates the inverse of the direction vector and saves its signs. More... | |
Ray | transformedToBF (const BodyID body) const |
Transforms the ray to the body frame. More... | |
Private Attributes | |
Member variables | |
Vec3 | origin_ |
Origin of the ray. More... | |
Vec3 | direction_ |
The normalized direction of the ray. More... | |
Vec3 | inv_direction_ |
The inverted direction of the ray. More... | |
Vector3< int8_t > | sign_ |
The signs of the inverted direction of the ray. More... | |
size_t | imageX_ |
Y value of the pixel coordinate this ray intersects. More... | |
size_t | imageY_ |
X value of the pixel coordinate this ray intersects. More... | |
|
inline |
Instantiation constructor for the Raytracer class.
Instantiation constructor for the Raytracer class.
origin | Origin of the ray. () |
direction | Normalized direction of the ray. |
|
inline |
Calculates the inverse of the direction vector and saves its signs.
|
inline |
Returns the normalized direction vector of the ray.
Returns the normalized direction vector of the ray for a given axis.
|
inline |
Returns the X value of the pixel coordinate this ray intersects.
|
inline |
Returns the Y value of the pixel coordinate this ray intersects.
|
inline |
Returns the inverse of the direction vector of the ray.
Returns the inverse of the direction vector of the ray for a given axis.
Returns the signs of the inverted direction vector of the ray.
Returns the signs of the inverted direction vector of the ray as required for the ray-box intersection algorithm.
|
inline |
Returns the origin point of the ray.
|
inline |
Set the normalized direction vector of the ray.
direction | Normalized direction vector |
Sets the X and Y values of the image pixel coordinate this ray intersects.
x | X value of the pixel coordinate |
y | Y value of the pixel coordinate |
|
inline |
Sets the X value of the image pixel coordinate this ray intersects.
x | X value of the pixel coordinate |
|
inline |
Sets the Y value of the image pixel coordinate this ray intersects.
y | Y value of the pixel coordinate |
|
inline |
Set the origin point of the ray.
origin | Origin point |
Transforms the ray to the body frame.
|
inline |
Returns the x component of the ray direction.
|
inline |
Returns the x component of the inverse ray direction.
|
inline |
Returns the y component of the ray direction.
|
inline |
Returns the y component of the inverse ray direction.
|
inline |
Returns the z component of the ray direction.
|
inline |
Returns the z component of the inverse ray direction.
|
private |
The normalized direction of the ray.
|
private |
Y value of the pixel coordinate this ray intersects.
|
private |
X value of the pixel coordinate this ray intersects.
|
private |
The inverted direction of the ray.
|
private |
Origin of the ray.
The signs of the inverted direction of the ray.
(Required for Ray-Box intersection code.)