walberla::pe::raytracing::Ray Class Reference

#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 Vec3getOrigin () const
 Returns the origin point of the ray. More...
 
const Vec3getDirection () 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 Vec3getInvDirection () 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_tsign_
 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...
 

Constructor & Destructor Documentation

◆ Ray() [1/2]

walberla::pe::raytracing::Ray::Ray ( )
inline

Instantiation constructor for the Raytracer class.

◆ Ray() [2/2]

walberla::pe::raytracing::Ray::Ray ( Vec3  origin,
Vec3  direction 
)
inline

Instantiation constructor for the Raytracer class.

Parameters
originOrigin of the ray. ()
directionNormalized direction of the ray.

Member Function Documentation

◆ calcInvDirection()

void walberla::pe::raytracing::Ray::calcInvDirection ( )
inline

Calculates the inverse of the direction vector and saves its signs.

◆ getDirection() [1/2]

const Vec3& walberla::pe::raytracing::Ray::getDirection ( ) const
inline

Returns the normalized direction vector of the ray.

◆ getDirection() [2/2]

real_t walberla::pe::raytracing::Ray::getDirection ( size_t  axis) const
inline

Returns the normalized direction vector of the ray for a given axis.

◆ getImageX()

size_t walberla::pe::raytracing::Ray::getImageX ( ) const
inline

Returns the X value of the pixel coordinate this ray intersects.

Returns
X value of pixel coordinate.

◆ getImageY()

size_t walberla::pe::raytracing::Ray::getImageY ( ) const
inline

Returns the Y value of the pixel coordinate this ray intersects.

Returns
Y value of pixel coordinate.

◆ getInvDirection() [1/2]

const Vec3& walberla::pe::raytracing::Ray::getInvDirection ( ) const
inline

Returns the inverse of the direction vector of the ray.

◆ getInvDirection() [2/2]

real_t walberla::pe::raytracing::Ray::getInvDirection ( size_t  axis) const
inline

Returns the inverse of the direction vector of the ray for a given axis.

◆ getInvDirectionSigns()

const Vector3<int8_t>& walberla::pe::raytracing::Ray::getInvDirectionSigns ( ) const
inline

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.

◆ getOrigin()

const Vec3& walberla::pe::raytracing::Ray::getOrigin ( ) const
inline

Returns the origin point of the ray.

◆ setDirection()

void walberla::pe::raytracing::Ray::setDirection ( const Vec3 direction)
inline

Set the normalized direction vector of the ray.

Parameters
directionNormalized direction vector

◆ setImageCoordinate()

void walberla::pe::raytracing::Ray::setImageCoordinate ( size_t  x,
size_t  y 
)
inline

Sets the X and Y values of the image pixel coordinate this ray intersects.

Parameters
xX value of the pixel coordinate
yY value of the pixel coordinate

◆ setImageX()

void walberla::pe::raytracing::Ray::setImageX ( size_t  x)
inline

Sets the X value of the image pixel coordinate this ray intersects.

Parameters
xX value of the pixel coordinate

◆ setImageY()

void walberla::pe::raytracing::Ray::setImageY ( size_t  y)
inline

Sets the Y value of the image pixel coordinate this ray intersects.

Parameters
yY value of the pixel coordinate

◆ setOrigin()

void walberla::pe::raytracing::Ray::setOrigin ( const Vec3 origin)
inline

Set the origin point of the ray.

Parameters
originOrigin point

◆ transformedToBF()

Ray walberla::pe::raytracing::Ray::transformedToBF ( const BodyID  body) const
inline

Transforms the ray to the body frame.

Returns
Ray transformed to the body frame.

◆ xDir()

real_t walberla::pe::raytracing::Ray::xDir ( ) const
inline

Returns the x component of the ray direction.

◆ xInvDir()

real_t walberla::pe::raytracing::Ray::xInvDir ( ) const
inline

Returns the x component of the inverse ray direction.

◆ yDir()

real_t walberla::pe::raytracing::Ray::yDir ( ) const
inline

Returns the y component of the ray direction.

◆ yInvDir()

real_t walberla::pe::raytracing::Ray::yInvDir ( ) const
inline

Returns the y component of the inverse ray direction.

◆ zDir()

real_t walberla::pe::raytracing::Ray::zDir ( ) const
inline

Returns the z component of the ray direction.

◆ zInvDir()

real_t walberla::pe::raytracing::Ray::zInvDir ( ) const
inline

Returns the z component of the inverse ray direction.

Member Data Documentation

◆ direction_

Vec3 walberla::pe::raytracing::Ray::direction_
private

The normalized direction of the ray.

◆ imageX_

size_t walberla::pe::raytracing::Ray::imageX_
private

Y value of the pixel coordinate this ray intersects.

◆ imageY_

size_t walberla::pe::raytracing::Ray::imageY_
private

X value of the pixel coordinate this ray intersects.

◆ inv_direction_

Vec3 walberla::pe::raytracing::Ray::inv_direction_
private

The inverted direction of the ray.

◆ origin_

Vec3 walberla::pe::raytracing::Ray::origin_
private

Origin of the ray.

◆ sign_

Vector3<int8_t> walberla::pe::raytracing::Ray::sign_
private

The signs of the inverted direction of the ray.

(Required for Ray-Box intersection code.)


The documentation for this class was generated from the following file: