CoriEngine
Loading...
Searching...
No Matches
Cori::Graphics::CameraController Class Reference

A class that is used to manipulate Camera of the Scene. Each Scene has one of those. More...

#include <CameraController.hpp>

Public Member Functions

 ~CameraController ()=default
void CreateOrthoCamera (const float left, float right, const float bottom, const float top, const uint8_t depth=50)
 Creates or recreate an orthographic camera.
void SetPosition (const glm::vec2 newPos)
 Sets the position of the camera.
void SetRotation (const float angle)
 Sets the rotational angle of the camera.
void SetScale (const glm::vec2 scale)
 Changes camera scale to the requested value.
glm::vec2 GetPosition () const
 Gets the current camera position.
float GetRotation () const
 Gets the current camera rotation.
glm::vec2 GetScale () const
 Gets the current camera scale.
glm::vec2 GetSize () const
 Gets the current camera size.
void RecalculateVP ()
 Recalculates the view projection matrix.

Detailed Description

A class that is used to manipulate Camera of the Scene. Each Scene has one of those.

Definition at line 14 of file CameraController.hpp.

Constructor & Destructor Documentation

◆ ~CameraController()

Cori::Graphics::CameraController::~CameraController ( )
default

Member Function Documentation

◆ CreateOrthoCamera()

void Cori::Graphics::CameraController::CreateOrthoCamera ( const float left,
float right,
const float bottom,
const float top,
const uint8_t depth = 50 )

Creates or recreate an orthographic camera.

Parameters
leftLeft camera border.
rightRight camera border.
bottomBottom camera border.
topTop camera border.
depthDepth of the camera. All object that have a depth higher that this value will not be rendered.

Definition at line 8 of file CameraController.cpp.

Here is the call graph for this function:

◆ GetPosition()

glm::vec2 Cori::Graphics::CameraController::GetPosition ( ) const

Gets the current camera position.

Returns
Current position.

Definition at line 25 of file CameraController.cpp.

◆ GetRotation()

float Cori::Graphics::CameraController::GetRotation ( ) const

Gets the current camera rotation.

Returns
Current rotation in degrees.

Definition at line 29 of file CameraController.cpp.

◆ GetScale()

glm::vec2 Cori::Graphics::CameraController::GetScale ( ) const

Gets the current camera scale.

Returns
Current scale.

Definition at line 33 of file CameraController.cpp.

◆ GetSize()

glm::vec2 Cori::Graphics::CameraController::GetSize ( ) const

Gets the current camera size.

Returns
Current camera size, values are always positive.

Definition at line 37 of file CameraController.cpp.

◆ RecalculateVP()

void Cori::Graphics::CameraController::RecalculateVP ( )

Recalculates the view projection matrix.

It is necessarily to call after you've changes camera properties to apply then.

Definition at line 52 of file CameraController.cpp.

Here is the call graph for this function:

◆ SetPosition()

void Cori::Graphics::CameraController::SetPosition ( const glm::vec2 newPos)

Sets the position of the camera.

Parameters
newPosPosition to set.

Definition at line 21 of file CameraController.cpp.

◆ SetRotation()

void Cori::Graphics::CameraController::SetRotation ( const float angle)

Sets the rotational angle of the camera.

Parameters
angleAngle in degrees.

Definition at line 42 of file CameraController.cpp.

◆ SetScale()

void Cori::Graphics::CameraController::SetScale ( const glm::vec2 scale)

Changes camera scale to the requested value.

Parameters
scaleScale to apply.

Definition at line 47 of file CameraController.cpp.


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