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

The base camera class. More...

#include <Camera.hpp>

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

Public Member Functions

 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

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 base camera class.

A camera is simply defined in terms of its projection matrix, which will be used in the render pipeline to transform the view-space coordinates into normalized device coordinates (NDC).

A note on normalized device coordinates

The normalized device coordinates range from \((-1, -1, -1)\) to \((1, 1, 1)\), and the bottom left corner is \((-1, -1, z)\). By default, the Rasterizer use the less-than-or-equal-to comparison when performing the depth test. This implies that higher Z values are further away from the camera.

Constructor & Destructor Documentation

◆ Camera()

t::Camera::Camera ( const Matrix4x4 & projectionMatrix)
inlineexplicit

Creates a new camera instance with the specified projection matrix.

Parameters
projectionMatrixThe projection matrix of the new camera. After being transformed by this matrix, the vertex should be in normalized device coordinates.

Member Data Documentation

◆ projectionMatrix

Matrix4x4 t::Camera::projectionMatrix

The projection matrix of this camera.

The Rasterizer will assume that vertices transformed by this matrix will be in normalized device coordinates.


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