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

The eye of the 2D world. More...

#include <camera2d.h>

Public Member Functions

 Camera2D (glm::mat4 projection)
 Creates a camera by taking in a projection matrix. More...
 
void update ()
 Updates the camera. More...
 
void setPosition (const glm::vec3 &pos)
 Sets the position of the camera. More...
 
void setRotaion (float rot)
 Sets the rotation of the camera. More...
 
const glm::vec3 & getPosition () const
 Gets the position of the camera in the world. More...
 
const float getRotation () const
 Gets the rotation of the camera in the world. More...
 
const glm::mat4 & getProjectionMatrix () const
 Gets the projection matrix with which the camera is rendering the scene. More...
 
const glm::mat4 & getViewMatrix () const
 Gets the view matrix of the camera. More...
 
const glm::mat4 & getProjectionViewMatrix () const
 Gets the View * Projection matrix. More...
 

Detailed Description

The eye of the 2D world.

aka Orthographic Camera, every scene and renderer requires a camera to see anything

Constructor & Destructor Documentation

◆ Camera2D()

fireworks::graphics::Camera2D::Camera2D ( glm::mat4  projection)

Creates a camera by taking in a projection matrix.

Parameters
projectionThe projection matrix onto which the world will be mapped to

Member Function Documentation

◆ getPosition()

const glm::vec3& fireworks::graphics::Camera2D::getPosition ( ) const
inline

Gets the position of the camera in the world.

◆ getProjectionMatrix()

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

Gets the projection matrix with which the camera is rendering the scene.

◆ getProjectionViewMatrix()

const glm::mat4& fireworks::graphics::Camera2D::getProjectionViewMatrix ( ) const
inline

Gets the View * Projection matrix.

◆ getRotation()

const float fireworks::graphics::Camera2D::getRotation ( ) const
inline

Gets the rotation of the camera in the world.

◆ getViewMatrix()

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

Gets the view matrix of the camera.

◆ setPosition()

void fireworks::graphics::Camera2D::setPosition ( const glm::vec3 &  pos)
inline

Sets the position of the camera.

Parameters
posThe position of the camera in the world

◆ setRotaion()

void fireworks::graphics::Camera2D::setRotaion ( float  rot)
inline

Sets the rotation of the camera.

Parameters
rotThe rotation of the camera in the world

◆ update()

void fireworks::graphics::Camera2D::update ( )

Updates the camera.


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