MobileRT
1.0
A multi platform C++ CPU progressive Ray Tracer.
|
#include <Camera.hpp>
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 |
Camera & | operator= (const Camera &camera)=default |
Camera & | operator= (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) |
A class which represents a camera in the scene.
|
explicit |
The constructor.
position | The position of the camera. |
lookAt | The point where the camera is looking at. |
up | The up vector. |
Camera::Camera | ( | const Camera & | camera | ) |
The copy constructor.
camera | A camera to copy. |
|
defaultnoexcept |
|
virtualdefault |
|
staticprotected |
A helper method which converts degrees to radians.
deg | The number of degrees. |
|
pure virtual |
Generates a ray with the origin in the camera.
u | u = x / width |
v | v = y / height |
deviationU | deviationU = [-0.5F / width, 0.5F / width] |
deviationV | deviationV = [-0.5F / height, 0.5F / height] |
Implemented in Components::Orthographic, and Components::Perspective.
|
virtual |
Calculates the bounding box of the camera.
Reimplemented in Components::Orthographic.
|
staticprotected |
A helper method which converts radians to degrees.
rad | The number of radians. |
::glm::vec3 MobileRT::Camera::direction_ {} |
The direction of the camera (in axis X, Y, Z).
::glm::vec3 MobileRT::Camera::position_ {} |
The position of the camera (in axis X, Y, Z).
::glm::vec3 MobileRT::Camera::right_ {} |
The right vector of the camera (in axis X, Y, Z).
::glm::vec3 MobileRT::Camera::up_ {} |
The up vector of the camera (in axis X, Y, Z).