Fireworks Engine  v2.0
Lightweight Sandbox Game Engine using OpenGL for additional Customisation and Quick Prototyping
fireworks::graphics::PerspectiveCamera Class Reference

A perspective camera to view objects in perspective projection. More...

#include <perspectivecamera.h>

Inheritance diagram for fireworks::graphics::PerspectiveCamera:

Public Member Functions

 PerspectiveCamera (glm::vec3 position=glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3 worldUp=glm::vec3(0.0f, 1.0f, 0.0f), float aspectRatio=1.33f, float fov=45.0f)
 Creates a perspective camera. More...
 
 PerspectiveCamera (float posX, float posY, float posZ, float upX, float upY, float upZ)
 Creates a perspective camera using default settings and scalar quantities. More...
 
const glm::mat4 & getViewMatrix ()
 Gets the reference to the camera's view matrix. More...
 
const glm::mat4 & getProjectionMatrix () const
 Gets the reference to the camera's projection matrix. More...
 
const glm::mat4 & getViewProjectionsMatrix () const
 Gets the reference to the camera's ViewProjections matrix. More...
 

Public Attributes

glm::vec3 position
 The position of the camera in 3d space. More...
 
glm::vec3 camFront
 The front vector of the camera. More...
 
glm::vec3 camUp
 The up vector of the camera. More...
 
glm::vec3 camRight
 The right vector of the camera. More...
 
glm::vec3 worldUp
 The world up vector. More...
 
float FOV
 Field of view angle of the camera. More...
 
float aspectRatio
 Camera view's aspect ratio. More...
 
float nearClipping
 near clipping distance of the camera More...
 
float farClipping
 far clipping distance of the camera More...
 
float yaw
 The yaw angle of the camera in world space. More...
 
float pitch
 The pitch angle of the camera in world space. More...
 

Protected Member Functions

void updateCameraVectors ()
 
void updateViewMatrix ()
 
void updateProjectionMatrix ()
 

Detailed Description

A perspective camera to view objects in perspective projection.

Constructor & Destructor Documentation

◆ PerspectiveCamera() [1/2]

fireworks::graphics::PerspectiveCamera::PerspectiveCamera ( glm::vec3  position = glm::vec3(0.0f, 0.0f, 0.0f),
glm::vec3  worldUp = glm::vec3(0.0f, 1.0f, 0.0f),
float  aspectRatio = 1.33f,
float  fov = 45.0f 
)

Creates a perspective camera.

Parameters
positionThe position of the camera in 3d space
worldUpThe world up vector
aspectRatioThe aspect ratio of the scene
fovThe field of view for the perspective projection

◆ PerspectiveCamera() [2/2]

fireworks::graphics::PerspectiveCamera::PerspectiveCamera ( float  posX,
float  posY,
float  posZ,
float  upX,
float  upY,
float  upZ 
)

Creates a perspective camera using default settings and scalar quantities.

Parameters
posXThe x position of the camera
posYThe y position of the camera
posZThe z position of the camera
upXThe x position of the world Up vector
upYThe y position of the world Up vector
upZThe z position of the world Up vector

Member Function Documentation

◆ getProjectionMatrix()

const glm::mat4& fireworks::graphics::PerspectiveCamera::getProjectionMatrix ( ) const
inline

Gets the reference to the camera's projection matrix.

◆ getViewMatrix()

const glm::mat4& fireworks::graphics::PerspectiveCamera::getViewMatrix ( )
inline

Gets the reference to the camera's view matrix.

◆ getViewProjectionsMatrix()

const glm::mat4& fireworks::graphics::PerspectiveCamera::getViewProjectionsMatrix ( ) const
inline

Gets the reference to the camera's ViewProjections matrix.

◆ updateCameraVectors()

void fireworks::graphics::PerspectiveCamera::updateCameraVectors ( )
protected

◆ updateProjectionMatrix()

void fireworks::graphics::PerspectiveCamera::updateProjectionMatrix ( )
protected

◆ updateViewMatrix()

void fireworks::graphics::PerspectiveCamera::updateViewMatrix ( )
protected

Member Data Documentation

◆ aspectRatio

float fireworks::graphics::PerspectiveCamera::aspectRatio

Camera view's aspect ratio.

◆ camFront

glm::vec3 fireworks::graphics::PerspectiveCamera::camFront

The front vector of the camera.

◆ camRight

glm::vec3 fireworks::graphics::PerspectiveCamera::camRight

The right vector of the camera.

◆ camUp

glm::vec3 fireworks::graphics::PerspectiveCamera::camUp

The up vector of the camera.

◆ farClipping

float fireworks::graphics::PerspectiveCamera::farClipping

far clipping distance of the camera

◆ FOV

float fireworks::graphics::PerspectiveCamera::FOV

Field of view angle of the camera.

◆ nearClipping

float fireworks::graphics::PerspectiveCamera::nearClipping

near clipping distance of the camera

◆ pitch

float fireworks::graphics::PerspectiveCamera::pitch

The pitch angle of the camera in world space.

◆ position

glm::vec3 fireworks::graphics::PerspectiveCamera::position

The position of the camera in 3d space.

◆ worldUp

glm::vec3 fireworks::graphics::PerspectiveCamera::worldUp

The world up vector.

◆ yaw

float fireworks::graphics::PerspectiveCamera::yaw

The yaw angle of the camera in world space.


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