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

#include <Perspective.hpp>

Inheritance diagram for Components::Perspective:
Inheritance graph
Collaboration diagram for Components::Perspective:
Collaboration graph

Public Member Functions

 Perspective ()=delete
 
 Perspective (const ::glm::vec3 &position, const ::glm::vec3 &lookAt, const ::glm::vec3 &up, float hFov, float vFov)
 
 Perspective (const Perspective &perspective)=default
 
 Perspective (Perspective &&perspective) noexcept=delete
 
 ~Perspective () final=default
 
Perspectiveoperator= (const Perspective &perspective)=delete
 
Perspectiveoperator= (Perspective &&perspective) noexcept=delete
 
::MobileRT::Ray generateRay (float u, float v, float deviationU, float deviationV) const final
 
float getHFov () const
 
float getVFov () const
 
- Public Member Functions inherited from MobileRT::Camera
 Camera (const ::glm::vec3 &position, const ::glm::vec3 &lookAt, const ::glm::vec3 &up)
 
 Camera (const Camera &camera)
 
 Camera (Camera &&camera) noexcept=default
 
virtual ~Camera ()=default
 
Cameraoperator= (const Camera &camera)=default
 
Cameraoperator= (Camera &&camera) noexcept=default
 
virtual AABB getAABB () const
 

Static Private Member Functions

static float fastArcTan (float value)
 

Private Attributes

float hFov_ {}
 
float vFov_ {}
 

Additional Inherited Members

- Public Attributes inherited from MobileRT::Camera
::glm::vec3 position_ {}
 
::glm::vec3 direction_ {}
 
::glm::vec3 right_ {}
 
::glm::vec3 up_ {}
 
- Static Protected Member Functions inherited from MobileRT::Camera
static float degToRad (float deg)
 
static float radToDeg (float rad)
 

Detailed Description

A class which represents a Perspective camera in the scene.

This type of camera is designed to mimic the way the human eye sees. It is the most common projection mode used for rendering a 3D scene.

Constructor & Destructor Documentation

◆ Perspective() [1/4]

Components::Perspective::Perspective ( )
explicitdelete

◆ Perspective() [2/4]

Components::Perspective::Perspective ( const ::glm::vec3 &  position,
const ::glm::vec3 &  lookAt,
const ::glm::vec3 &  up,
float  hFov,
float  vFov 
)
explicit

◆ Perspective() [3/4]

Components::Perspective::Perspective ( const Perspective perspective)
default

◆ Perspective() [4/4]

Components::Perspective::Perspective ( Perspective &&  perspective)
deletenoexcept

◆ ~Perspective()

Components::Perspective::~Perspective ( )
finaldefault

Member Function Documentation

◆ fastArcTan()

float Perspective::fastArcTan ( float  value)
staticprivate

Helper method that calculates the inverse tangent function. This is an approximate algorithm from this source .

Parameters
valueThe value to calculate the arc tangent.
Returns
The principal arc tangent of a value, in the interval [-pi/2,+pi/2] radians.

◆ generateRay()

Ray Perspective::generateRay ( float  u,
float  v,
float  deviationU,
float  deviationV 
) const
finalvirtual

Generates a ray with the origin in the camera.

Parameters
uu = x / width
vv = y / height
deviationUdeviationU = [-0.5F / width, 0.5F / width]
deviationVdeviationV = [-0.5F / height, 0.5F / height]
Returns
The new generated ray.

Implements MobileRT::Camera.

Here is the call graph for this function:

◆ getHFov()

float Perspective::getHFov ( ) const

Gets the horizontal field of view, in degrees.

Returns
The horizontal field of view, in degrees.
Here is the call graph for this function:

◆ getVFov()

float Perspective::getVFov ( ) const

Gets the vertical field of view, in degrees.

Returns
The vertical field of view, in degrees.
Here is the call graph for this function:

◆ operator=() [1/2]

Perspective& Components::Perspective::operator= ( const Perspective perspective)
delete

◆ operator=() [2/2]

Perspective& Components::Perspective::operator= ( Perspective &&  perspective)
deletenoexcept

Member Data Documentation

◆ hFov_

float Components::Perspective::hFov_ {}
private

◆ vFov_

float Components::Perspective::vFov_ {}
private

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