MobileRT  1.0
A multi platform C++ CPU progressive Ray Tracer.
MobileRT::Ray Class Referencefinal

#include <Ray.hpp>

Collaboration diagram for MobileRT::Ray:
Collaboration graph

Public Member Functions

 Ray ()=delete
 
 Ray (const ::glm::vec3 &dir, const ::glm::vec3 &origin, ::std::int32_t depth, bool shadowTrace, const void *primitive=nullptr)
 
 Ray (const Ray &ray)=default
 
 Ray (Ray &&ray) noexcept=default
 
 ~Ray ()=default
 
Rayoperator= (const Ray &ray)=delete
 
Rayoperator= (Ray &&ray) noexcept
 

Static Public Member Functions

::std::uint64_t getNumberOfCastedRays () noexcept
 
static void resetIdGenerator () noexcept
 

Public Attributes

::glm::vec3 origin_ {0}
 
::glm::vec3 direction_ {0}
 
::std::int32_t depth_ {-1}
 
::std::uint64_t id_ {0L}
 
const void * primitive_ {nullptr}
 
bool shadowTrace_ {false}
 

Private Member Functions

void checkArguments () const
 

Detailed Description

A class which represents a ray casted into the scene.
A ray consists of an origin and a direction of a vector.

Constructor & Destructor Documentation

◆ Ray() [1/4]

MobileRT::Ray::Ray ( )
explicitdelete

◆ Ray() [2/4]

MobileRT::Ray::Ray ( const ::glm::vec3 &  dir,
const ::glm::vec3 &  origin,
::std::int32_t  depth,
bool  shadowTrace,
const void *  primitive = nullptr 
)
explicit

◆ Ray() [3/4]

MobileRT::Ray::Ray ( const Ray ray)
default

◆ Ray() [4/4]

MobileRT::Ray::Ray ( Ray &&  ray)
defaultnoexcept

◆ ~Ray()

MobileRT::Ray::~Ray ( )
default

Member Function Documentation

◆ checkArguments()

void Ray::checkArguments ( ) const
private

Helper method which checks for invalid fields.

Here is the call graph for this function:

◆ getNumberOfCastedRays()

std::uint64_t Ray::getNumberOfCastedRays ( )
staticnoexcept

Helper method that gets the number of casted rays in the scene.

Returns
The number of casted rays.
Here is the call graph for this function:

◆ operator=() [1/2]

Ray& MobileRT::Ray::operator= ( const Ray ray)
delete

◆ operator=() [2/2]

Ray& MobileRT::Ray::operator= ( Ray &&  ray)
noexcept

◆ resetIdGenerator()

void Ray::resetIdGenerator ( )
staticnoexcept

A helper method that resets the Ray id generator counter.

Here is the call graph for this function:

Member Data Documentation

◆ depth_

::std::int32_t MobileRT::Ray::depth_ {-1}

The number of bounces of the ray.

◆ direction_

::glm::vec3 MobileRT::Ray::direction_ {0}

The direction of the ray.

◆ id_

::std::uint64_t MobileRT::Ray::id_ {0L}

The identifier of the ray.

◆ origin_

::glm::vec3 MobileRT::Ray::origin_ {0}

The origin of the ray.

◆ primitive_

const void* MobileRT::Ray::primitive_ {nullptr}

The pointer to the primitive from where the ray was casted from. This is useful to avoid a plane casting a ray that intersects itself.

◆ shadowTrace_

bool MobileRT::Ray::shadowTrace_ {false}

Whether it shouldn't find the nearest intersection point.


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