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

#include <SceneCamera.h>

Inheritance diagram for Muto::SceneCamera:
Muto::Camera

Public Types

enum class  ProjectionType { Perspective = 0 , Orthographic = 1 }
 

Public Member Functions

float GetOrthographicFarClip () const
 
float GetOrthographicNearClip () const
 
float GetOrthographicSize () const
 
float GetPerspectiveFarClip () const
 
float GetPerspectiveNearClip () const
 
float GetPerspectiveVerticalFOV () const
 
ProjectionType GetProjectionType () const
 
 SceneCamera ()
 
void SetOrthographic (float size, float nearClip, float farClip)
 
void SetOrthographicFarClip (float farClip)
 
void SetOrthographicNearClip (float nearClip)
 
void SetOrthographicSize (float size)
 
void SetPerspective (float verticalFOV, float nearClip, float farClip)
 
void SetPerspectiveFarClip (float farClip)
 
void SetPerspectiveNearClip (float nearClip)
 
void SetPerspectiveVerticalFOV (float verticalFov)
 
void SetProjectionType (ProjectionType type)
 
void SetViewportSize (uint32_t width, uint32_t height)
 
virtual ~SceneCamera ()=default
 
- Public Member Functions inherited from Muto::Camera
 Camera ()=default
 
 Camera (const glm::mat4 &projection)
 
const glm::mat4 & GetProjection () const
 
 ~Camera ()=default
 

Private Member Functions

void RecalculateProjection ()
 

Private Attributes

float m_AspectRatio = 0.0f
 
float m_OrthographicFar = 1.0f
 
float m_OrthographicNear = -1.0f
 
float m_OrthographicSize = 10.0f
 
float m_PerspectiveFar = 1000.0f
 
float m_PerspectiveFOV = glm::radians(45.0f)
 
float m_PerspectiveNear = 0.01f
 
ProjectionType m_ProjectionType = ProjectionType::Orthographic
 

Additional Inherited Members

- Protected Attributes inherited from Muto::Camera
glm::mat4 m_Projection = glm::mat4(1.0f)
 

Member Enumeration Documentation

◆ ProjectionType

Enumerator
Perspective 
Orthographic 
14{ Perspective = 0, Orthographic = 1 };
Responsible for rendering a scene in an Orthographic view.

Constructor & Destructor Documentation

◆ SceneCamera()

Muto::SceneCamera::SceneCamera ( )
10 {
12 }
void RecalculateProjection()
Definition SceneCamera.cpp:37

References RecalculateProjection().

◆ ~SceneCamera()

virtual Muto::SceneCamera::~SceneCamera ( )
virtualdefault

Member Function Documentation

◆ GetOrthographicFarClip()

float Muto::SceneCamera::GetOrthographicFarClip ( ) const
inline
35{ return m_OrthographicFar; }
float m_OrthographicFar
Definition SceneCamera.h:49

References m_OrthographicFar.

◆ GetOrthographicNearClip()

float Muto::SceneCamera::GetOrthographicNearClip ( ) const
inline
33{ return m_OrthographicNear; }
float m_OrthographicNear
Definition SceneCamera.h:49

References m_OrthographicNear.

◆ GetOrthographicSize()

float Muto::SceneCamera::GetOrthographicSize ( ) const
inline
31{ return m_OrthographicSize; }
float m_OrthographicSize
Definition SceneCamera.h:48

References m_OrthographicSize.

◆ GetPerspectiveFarClip()

float Muto::SceneCamera::GetPerspectiveFarClip ( ) const
inline
28{ return m_PerspectiveFar; }
float m_PerspectiveFar
Definition SceneCamera.h:46

References m_PerspectiveFar.

◆ GetPerspectiveNearClip()

float Muto::SceneCamera::GetPerspectiveNearClip ( ) const
inline
26{ return m_PerspectiveNear; }
float m_PerspectiveNear
Definition SceneCamera.h:46

References m_PerspectiveNear.

◆ GetPerspectiveVerticalFOV()

float Muto::SceneCamera::GetPerspectiveVerticalFOV ( ) const
inline
24{ return m_PerspectiveFOV; }
float m_PerspectiveFOV
Definition SceneCamera.h:45

◆ GetProjectionType()

ProjectionType Muto::SceneCamera::GetProjectionType ( ) const
inline
38{ return m_ProjectionType; }
ProjectionType m_ProjectionType
Definition SceneCamera.h:43

References m_ProjectionType.

◆ RecalculateProjection()

void Muto::SceneCamera::RecalculateProjection ( )
private
38 {
40 {
42 }
43 else
44 {
47 float orthoBottom = -m_OrthographicSize * 0.5f;
48 float orthoTop = m_OrthographicSize * 0.5f;
49
50 m_Projection = glm::ortho(orthoLeft, orthoRight,
52 }
53
54 }
glm::mat4 m_Projection
Definition Camera.h:25
float m_AspectRatio
Definition SceneCamera.h:51
constexpr Scope< T > CreateScope(Args &&... args)
Creates a Scope (unique_ptr) for the given type and constructor arguments.
Definition Defines_Macros.h:51

References m_AspectRatio, m_OrthographicSize, m_ProjectionType, and Perspective.

Referenced by SceneCamera(), SetOrthographic(), SetOrthographicFarClip(), SetOrthographicNearClip(), SetOrthographicSize(), SetPerspective(), SetPerspectiveFarClip(), SetPerspectiveNearClip(), SetPerspectiveVerticalFOV(), SetProjectionType(), and SetViewportSize().

◆ SetOrthographic()

void Muto::SceneCamera::SetOrthographic ( float  size,
float  nearClip,
float  farClip 
)

◆ SetOrthographicFarClip()

void Muto::SceneCamera::SetOrthographicFarClip ( float  farClip)
inline

◆ SetOrthographicNearClip()

void Muto::SceneCamera::SetOrthographicNearClip ( float  nearClip)
inline

◆ SetOrthographicSize()

void Muto::SceneCamera::SetOrthographicSize ( float  size)
inline

◆ SetPerspective()

◆ SetPerspectiveFarClip()

void Muto::SceneCamera::SetPerspectiveFarClip ( float  farClip)
inline

◆ SetPerspectiveNearClip()

void Muto::SceneCamera::SetPerspectiveNearClip ( float  nearClip)
inline

◆ SetPerspectiveVerticalFOV()

void Muto::SceneCamera::SetPerspectiveVerticalFOV ( float  verticalFov)
inline

◆ SetProjectionType()

void Muto::SceneCamera::SetProjectionType ( ProjectionType  type)
inline

◆ SetViewportSize()

void Muto::SceneCamera::SetViewportSize ( uint32_t  width,
uint32_t  height 
)

Member Data Documentation

◆ m_AspectRatio

float Muto::SceneCamera::m_AspectRatio = 0.0f
private

◆ m_OrthographicFar

float Muto::SceneCamera::m_OrthographicFar = 1.0f
private

◆ m_OrthographicNear

float Muto::SceneCamera::m_OrthographicNear = -1.0f
private

◆ m_OrthographicSize

float Muto::SceneCamera::m_OrthographicSize = 10.0f
private

◆ m_PerspectiveFar

float Muto::SceneCamera::m_PerspectiveFar = 1000.0f
private

◆ m_PerspectiveFOV

float Muto::SceneCamera::m_PerspectiveFOV = glm::radians(45.0f)
private

◆ m_PerspectiveNear

float Muto::SceneCamera::m_PerspectiveNear = 0.01f
private

◆ m_ProjectionType


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