t
Loading...
Searching...
No Matches
t::OrthographicCamera Class Reference

The orthographic projection camera. More...

#include <OrthographicCamera.hpp>

Inheritance diagram for t::OrthographicCamera:
t::Camera t::Object3D

Public Member Functions

 OrthographicCamera (double _left, double _right, double _top, double _bottom, double _near, double _far)
 Creates a new orthographic camera with the specified planes as the view frustum.
 
- Public Member Functions inherited from t::Camera
 Camera (const Matrix4x4 &projectionMatrix)
 Creates a new camera instance with the specified projection matrix.
 
- Public Member Functions inherited from t::Object3D
virtual bool isMesh () const
 Returns whether this 3D object is a mesh.
 
virtual bool isLight () const
 Returns whether this 3D object is a light.
 
Object3Dadd (Object3D &child)
 Adds another 3D object as a child of this 3D object.
 
Object3Dtranslate (double x, double y, double z)
 Translates this 3D object by the specified amounts along the x, y, and z axes in local space.
 
Object3Drotate (double x, double y, double z, EulerRotationOrder order)
 Rotates this 3D object by the specified angles around the x, y, and z axes in local space.
 
Object3Dscale (double x, double y, double z)
 Scales this 3D object by the specified amounts along the x, y, and z axes in local space.
 
Object3DupdateLocalMatrix ()
 Updates the local transformation matrix of this 3D object.
 
Object3DupdateModelMatrix ()
 Updates the model matrix of this 3D object.
 

Public Attributes

double left
 The left plane of this camera's view frustum.
 
double right
 The right plane of this camera's view frustum.
 
double top
 The top plane of this camera's view frustum.
 
double bottom
 The bottom plane of this camera's view frustum.
 
double near
 The near plane of this camera's view frustum.
 
double far
 The far plane of this camera's view frustum.
 
- Public Attributes inherited from t::Camera
Matrix4x4 projectionMatrix
 The projection matrix of this camera.
 
- Public Attributes inherited from t::Object3D
std::optional< std::reference_wrapper< Object3D > > parent
 The parent of this 3D object.
 
Vector3 up = DEFAULT_UP
 The vector pointing to the up direction in object space.
 
Vector3 localPosition
 The position of this 3D object relative to its parent.
 
EulerRotation localRotation
 The rotation of this 3D object relative to its parent.
 
Vector3 localScale
 The scale of this 3D object relative to its parent.
 
Matrix4x4 localMatrix
 The matrix of the local transformation of this 3D object.
 
Matrix4x4 modelMatrix
 The model matrix of this 3D object, transformating local space to world space.
 
std::vector< std::reference_wrapper< Object3D > > children
 The children of this 3D object.
 

Detailed Description

The orthographic projection camera.

A typical orthographic camera instantiation might look like the following:

const auto camera = OrthographicCamera(width / -2, width / 2, height / 2, height
/ -2, 0.1, 2000 );
OrthographicCamera(double _left, double _right, double _top, double _bottom, double _near, double _far)
Creates a new orthographic camera with the specified planes as the view frustum.
Definition OrthographicCamera.hpp:62

…where width and height are the output image's width and height.

The orthographic camera will use the following projection matrix:

\[ \begin{bmatrix} \frac{2}{r - l} & 0 & 0 & -\frac{r + l}{r - l} \\ 0 & \frac{2}{t - b} & 0 & -\frac{t + b}{t - b} \\ 0 & 0 & -\frac{2}{f - n} & -\frac{f + n}{f - n} \\ 0 & 0 & 0 & 1 \end{bmatrix} \]

…where \(r\), \(l\), \(t\), \(b\), \(f\), \(n\) are the right, left, top, bottom, far, and near planes of the camera's view frustum, respectively.

Constructor & Destructor Documentation

◆ OrthographicCamera()

t::OrthographicCamera::OrthographicCamera ( double _left,
double _right,
double _top,
double _bottom,
double _near,
double _far )
inline

Creates a new orthographic camera with the specified planes as the view frustum.

The view frustum of the orthographic camera is in the shape of a box. Only objects in this box may appear in the render.

The planes should be set such that _right > _left and _top > _bottom.

Parameters
_leftThe left plane of the new camera's view frustum.
_rightThe right plane of the new camera's view frustum.
_topThe top plane of the new camera's view frustum.
_bottomThe bottom plane of the new camera's view frustum.
_nearThe near plane of the new camera's view frustum.
_farThe far plane of the new camera's view frustum.

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