Vesper 0.5.1
Vesper is short form for the Latin word for "Bat", as Vesper is designed to be small, lightweight, and easily handle things like particles and flocking behaviors in accordance with the nature of bats. \n It is meant to be a particle simulation, VFX editor, and CAN be used secondarily as a small game engine.
GitHub | Vesper Updates | Creator
Loading...
Searching...
No Matches
Vesper::OrthographicCamera Class Reference

#include <OrthographicCamera.h>

Public Member Functions

 OrthographicCamera (float left, float right, float bottom, float top)
void SetProjection (float left, float right, float bottom, float top)
void SetPosition (const glm::vec3 &position)
const glm::vec3 & GetPosition () const
void SetRotation (float rotation)
const float GetRotation () const
const glm::mat4 & GetProjectionMatrix () const
const glm::mat4 & GetViewMatrix () const
const glm::mat4 & GetViewProjectionMatrix () const

Private Member Functions

void RecalculateViewMatrix ()

Private Attributes

glm::mat4 m_ProjectionMatrix
glm::mat4 m_ViewMatrix
glm::mat4 m_ViewProjectionMatrix
glm::vec3 m_Position = { 0.0f, 0.0f, 0.0f }
float m_Rotation = 0.0f

Constructor & Destructor Documentation

◆ OrthographicCamera()

Vesper::OrthographicCamera::OrthographicCamera ( float left,
float right,
float bottom,
float top )
9 : m_ProjectionMatrix(glm::ortho(left, right, bottom, top, -1.0f, 1.0f)), m_ViewMatrix(1.0f)
10 {
13 }
#define VZ_PROFILE_FUNCTION()
Definition Instrumentor.h:240
glm::mat4 m_ViewProjectionMatrix
Definition OrthographicCamera.h:28
glm::mat4 m_ViewMatrix
Definition OrthographicCamera.h:27
glm::mat4 m_ProjectionMatrix
Definition OrthographicCamera.h:26

References OrthographicCamera().

Referenced by OrthographicCamera().

Member Function Documentation

◆ GetPosition()

const glm::vec3 & Vesper::OrthographicCamera::GetPosition ( ) const
inline
14{ return m_Position; }
glm::vec3 m_Position
Definition OrthographicCamera.h:30

◆ GetProjectionMatrix()

const glm::mat4 & Vesper::OrthographicCamera::GetProjectionMatrix ( ) const
inline
20{ return m_ProjectionMatrix; }

◆ GetRotation()

const float Vesper::OrthographicCamera::GetRotation ( ) const
inline
17{ return m_Rotation; }
float m_Rotation
Definition OrthographicCamera.h:31

References m_Rotation.

◆ GetViewMatrix()

const glm::mat4 & Vesper::OrthographicCamera::GetViewMatrix ( ) const
inline
21{ return m_ViewMatrix; }

◆ GetViewProjectionMatrix()

const glm::mat4 & Vesper::OrthographicCamera::GetViewProjectionMatrix ( ) const
inline
22{ return m_ViewProjectionMatrix; }

◆ RecalculateViewMatrix()

void Vesper::OrthographicCamera::RecalculateViewMatrix ( )
private
23 {
25 glm::mat4 transform = glm::translate(glm::mat4(1.0f), m_Position) *
26 glm::rotate(glm::mat4(1.0f), glm::radians(m_Rotation), glm::vec3(0, 0, 1));
27 m_ViewMatrix = glm::inverse(transform);
29 }

Referenced by SetPosition(), and SetRotation().

◆ SetPosition()

void Vesper::OrthographicCamera::SetPosition ( const glm::vec3 & position)
inline
13{ m_Position = position; RecalculateViewMatrix(); }
void RecalculateViewMatrix()
Definition OrthographicCamera.cpp:22

References RecalculateViewMatrix().

◆ SetProjection()

void Vesper::OrthographicCamera::SetProjection ( float left,
float right,
float bottom,
float top )
16 {
18 m_ProjectionMatrix = glm::ortho(left, right, bottom, top, -1.0f, 1.0f);
20 }

◆ SetRotation()

void Vesper::OrthographicCamera::SetRotation ( float rotation)
inline
16{ m_Rotation = rotation; RecalculateViewMatrix(); }

References m_Rotation, and RecalculateViewMatrix().

Member Data Documentation

◆ m_Position

glm::vec3 Vesper::OrthographicCamera::m_Position = { 0.0f, 0.0f, 0.0f }
private
30{ 0.0f, 0.0f, 0.0f };

◆ m_ProjectionMatrix

glm::mat4 Vesper::OrthographicCamera::m_ProjectionMatrix
private

◆ m_Rotation

float Vesper::OrthographicCamera::m_Rotation = 0.0f
private

Referenced by GetRotation(), and SetRotation().

◆ m_ViewMatrix

glm::mat4 Vesper::OrthographicCamera::m_ViewMatrix
private

◆ m_ViewProjectionMatrix

glm::mat4 Vesper::OrthographicCamera::m_ViewProjectionMatrix
private

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