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

#include <Camera.hpp>

Inheritance diagram for MobileRT::Camera:
Inheritance graph
Collaboration diagram for MobileRT::Camera:
Collaboration graph

Public Member Functions

 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 Ray generateRay (float u, float v, float deviationU, float deviationV) const =0
 
virtual AABB getAABB () const
 

Public Attributes

::glm::vec3 position_ {}
 
::glm::vec3 direction_ {}
 
::glm::vec3 right_ {}
 
::glm::vec3 up_ {}
 

Static Protected Member Functions

static float degToRad (float deg)
 
static float radToDeg (float rad)
 

Detailed Description

A class which represents a camera in the scene.

Constructor & Destructor Documentation

◆ Camera() [1/3]

Camera::Camera ( const ::glm::vec3 &  position,
const ::glm::vec3 &  lookAt,
const ::glm::vec3 &  up 
)
explicit

The constructor.

Parameters
positionThe position of the camera.
lookAtThe point where the camera is looking at.
upThe up vector.
Here is the call graph for this function:

◆ Camera() [2/3]

Camera::Camera ( const Camera camera)

The copy constructor.

Parameters
cameraA camera to copy.

◆ Camera() [3/3]

MobileRT::Camera::Camera ( Camera &&  camera)
defaultnoexcept

◆ ~Camera()

virtual MobileRT::Camera::~Camera ( )
virtualdefault

Member Function Documentation

◆ degToRad()

float Camera::degToRad ( float  deg)
staticprotected

A helper method which converts degrees to radians.

Parameters
degThe number of degrees.
Returns
The number of radians.

◆ generateRay()

virtual Ray MobileRT::Camera::generateRay ( float  u,
float  v,
float  deviationU,
float  deviationV 
) const
pure virtual

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.

Implemented in Components::Orthographic, and Components::Perspective.

◆ getAABB()

AABB Camera::getAABB ( ) const
virtual

Calculates the bounding box of the camera.

Returns
The bounding box which surrounds the camera.

Reimplemented in Components::Orthographic.

◆ operator=() [1/2]

Camera& MobileRT::Camera::operator= ( const Camera camera)
default

◆ operator=() [2/2]

Camera& MobileRT::Camera::operator= ( Camera &&  camera)
defaultnoexcept

◆ radToDeg()

float Camera::radToDeg ( float  rad)
staticprotected

A helper method which converts radians to degrees.

Parameters
radThe number of radians.
Returns
The number of degrees.
Here is the caller graph for this function:

Member Data Documentation

◆ direction_

::glm::vec3 MobileRT::Camera::direction_ {}

The direction of the camera (in axis X, Y, Z).

◆ position_

::glm::vec3 MobileRT::Camera::position_ {}

The position of the camera (in axis X, Y, Z).

◆ right_

::glm::vec3 MobileRT::Camera::right_ {}

The right vector of the camera (in axis X, Y, Z).

◆ up_

::glm::vec3 MobileRT::Camera::up_ {}

The up vector of the camera (in axis X, Y, Z).


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