MobileRT  1.0
A multi platform C++ CPU progressive Ray Tracer.
MobileRT::Naive< T > Class Template Referencefinal

#include <Naive.hpp>

Collaboration diagram for MobileRT::Naive< T >:
Collaboration graph

Public Member Functions

 Naive ()=default
 
 Naive (::std::vector< T > &&primitives)
 
 Naive (const Naive &naive)=delete
 
 Naive (Naive &&naive) noexcept=default
 
 ~Naive ()
 
Naiveoperator= (const Naive &naive)=delete
 
Naiveoperator= (Naive &&naive) noexcept=default
 
Intersection trace (Intersection intersection)
 
Intersection shadowTrace (Intersection intersection)
 
const ::std::vector< T > & getPrimitives () const
 

Private Member Functions

Intersection intersect (Intersection intersection)
 

Private Attributes

::std::vector< T > primitives_ {}
 

Detailed Description

template<typename T>
class MobileRT::Naive< T >

A class which represents the Naive acceleration structure.
This is basically a structure where all the primitives are just stored in a vector without any specific order. So, there is no acceleration structure and the intersection method must try to intersect the ray with all the primitives in the vector.

Template Parameters
TThe type of the primitives.

Constructor & Destructor Documentation

◆ Naive() [1/4]

template<typename T>
MobileRT::Naive< T >::Naive ( )
explicitdefault

◆ Naive() [2/4]

template<typename T>
MobileRT::Naive< T >::Naive ( ::std::vector< T > &&  primitives)
explicit

The constructor.

Template Parameters
TThe type of the primitives.
Parameters
primitivesThe primitives.

◆ Naive() [3/4]

template<typename T>
MobileRT::Naive< T >::Naive ( const Naive< T > &  naive)
delete

◆ Naive() [4/4]

template<typename T>
MobileRT::Naive< T >::Naive ( Naive< T > &&  naive)
defaultnoexcept

◆ ~Naive()

template<typename T >
MobileRT::Naive< T >::~Naive ( )

The destructor.

Template Parameters
TThe type of the primitives.

Member Function Documentation

◆ getPrimitives()

template<typename T >
const ::std::vector< T > & MobileRT::Naive< T >::getPrimitives ( ) const

Gets the primitives.

Template Parameters
TThe type of the primitives.
Returns
The primitives.

◆ intersect()

template<typename T >
Intersection MobileRT::Naive< T >::intersect ( Intersection  intersection)
private

Helper method which calculates the intersection point from the origin of the ray.
This method supports two modes:

  • trace the ray until finding the nearest intersection point from the origin of the ray
  • trace the ray until finding any intersection point from the origin of the ray
Template Parameters
TThe type of the primitives.
Parameters
intersectionThe previous intersection point of the ray (used to update its data in case it is found a nearest intersection point.
Returns
The intersection point of the ray in the scene.

◆ operator=() [1/2]

template<typename T>
Naive& MobileRT::Naive< T >::operator= ( const Naive< T > &  naive)
delete

◆ operator=() [2/2]

template<typename T>
Naive& MobileRT::Naive< T >::operator= ( Naive< T > &&  naive)
defaultnoexcept

◆ shadowTrace()

template<typename T >
Intersection MobileRT::Naive< T >::shadowTrace ( Intersection  intersection)

This method casts a ray into the geometry and calculates a random intersection point. The intersection point itself is not important, the important is to determine if the ray intersects some primitive in the scene or not.

Template Parameters
TThe type of the primitives.
Parameters
intersectionThe current intersection of the ray with previous primitives.
Returns
The intersection of the ray with the geometry.

◆ trace()

template<typename T >
Intersection MobileRT::Naive< T >::trace ( Intersection  intersection)

This method casts a ray into the geometry and calculates the nearest intersection point from the origin of the ray.

Template Parameters
TThe type of the primitives.
Parameters
intersectionThe current intersection of the ray with previous primitives.
Returns
The intersection of the ray with the geometry.

Member Data Documentation

◆ primitives_

template<typename T>
::std::vector<T> MobileRT::Naive< T >::primitives_ {}
private

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