Muto 0.0.1
Cross-Platform Application Template
GitHub Repo | Muto Updates | Muto's Author
Loading...
Searching...
No Matches
Muto::OrthographicCamera Class Reference

#include <OrthographicCamera.h>

Public Member Functions

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

Private Member Functions

void RecalculateViewMatrix ()
 

Private Attributes

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

Constructor & Destructor Documentation

◆ OrthographicCamera()

Muto::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 MU_PROFILE_FUNCTION()
Definition Instrumentor.h:240
glm::mat4 m_ProjectionMatrix
Definition OrthographicCamera.h:34
glm::mat4 m_ViewMatrix
Definition OrthographicCamera.h:35
glm::mat4 m_ViewProjectionMatrix
Definition OrthographicCamera.h:36
constexpr Scope< T > CreateScope(Args &&... args)
Creates a Scope (unique_ptr) for the given type and constructor arguments.
Definition Defines_Macros.h:51

References OrthographicCamera().

Referenced by OrthographicCamera().

Member Function Documentation

◆ GetPosition()

const glm::vec3 & Muto::OrthographicCamera::GetPosition ( ) const
inline
22{ return m_Position; }
glm::vec3 m_Position
Definition OrthographicCamera.h:38

◆ GetProjectionMatrix()

const glm::mat4 & Muto::OrthographicCamera::GetProjectionMatrix ( ) const
inline
28{ return m_ProjectionMatrix; }

◆ GetRotation()

const float Muto::OrthographicCamera::GetRotation ( ) const
inline
25{ return m_Rotation; }
float m_Rotation
Definition OrthographicCamera.h:39

References m_Rotation.

◆ GetViewMatrix()

const glm::mat4 & Muto::OrthographicCamera::GetViewMatrix ( ) const
inline
29{ return m_ViewMatrix; }

◆ GetViewProjectionMatrix()

const glm::mat4 & Muto::OrthographicCamera::GetViewProjectionMatrix ( ) const
inline
30{ return m_ViewProjectionMatrix; }

◆ RecalculateViewMatrix()

void Muto::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 Muto::OrthographicCamera::SetPosition ( const glm::vec3 &  position)
inline
void RecalculateViewMatrix()
Definition OrthographicCamera.cpp:22

References RecalculateViewMatrix().

◆ SetProjection()

void Muto::OrthographicCamera::SetProjection ( float  left,
float  right,
float  bottom,
float  top 
)

◆ SetRotation()

void Muto::OrthographicCamera::SetRotation ( float  rotation)
inline

Member Data Documentation

◆ m_Position

glm::vec3 Muto::OrthographicCamera::m_Position = { 0.0f, 0.0f, 0.0f }
private
38{ 0.0f, 0.0f, 0.0f };

◆ m_ProjectionMatrix

glm::mat4 Muto::OrthographicCamera::m_ProjectionMatrix
private

◆ m_Rotation

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

Referenced by GetRotation(), and SetRotation().

◆ m_ViewMatrix

glm::mat4 Muto::OrthographicCamera::m_ViewMatrix
private

◆ m_ViewProjectionMatrix

glm::mat4 Muto::OrthographicCamera::m_ViewProjectionMatrix
private

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