2
3
4
5
9#include "Core/Math/Math.h"
10#include "Render/FrameInfo.h"
11#include "Slate/SlateInfoBar.h"
57 SlateInfoBar::Create<
float>(
"Refrush frame", [=]() ->
float {
58 return static_cast<
float>(
this->m_StableFrames) / 100.0f;
59 }, [=](SlateInfoBar* that) {
60 return std::any_cast<
float>(that->GetRate()) >= 1.0f;
73 case ProjectionType::Perspective:
74 return PerspectiveMatrix(
75 m_PerspectiveParam.fov ,
76 m_PerspectiveParam.nearPlane ,
78 m_PerspectiveParam.aspectRatio
80 case ProjectionType::Orthographic:
81 return OtrhographicMatrix(
82 m_OrthographicParam.left ,
83 m_OrthographicParam.right ,
84 m_OrthographicParam.top ,
85 m_OrthographicParam.bottom ,
86 m_OrthographicParam.nearPlane ,
87 m_OrthographicParam.farPlane
91 return glm::mat4(1.0f);
100 case ProjectionType::Perspective:
101 m_ProjectionMatrix = PerspectiveMatrixInverseZ(
102 m_PerspectiveParam.fov ,
103 m_PerspectiveParam.nearPlane ,
104 m_PerspectiveParam.aspectRatio
107 case ProjectionType::Orthographic:
108 m_ProjectionMatrix = OtrhographicMatrix(
109 m_OrthographicParam.left ,
110 m_OrthographicParam.right ,
111 m_OrthographicParam.top ,
112 m_OrthographicParam.bottom ,
113 m_OrthographicParam.nearPlane ,
114 m_OrthographicParam.farPlane
#define SPICES_PROFILE_ZONE
unsigned int m_StableFrames
Camera Stable Frames Number.
void CalculatePMatrixReverseZ()
Calculate Projection Matrix by parameter.
const glm::mat4 GetPMatrix() const
Get camera projection matrix.
OrthographicParam m_OrthographicParam
Camera OrthographicParam.
void SetOrthographic(float left, float right, float top, float bottom, float nearPlane, float farPlane)
Set ProjectionMatrix by using orthographic type.
void SetPerspective(float aspectRatio)
Set ProjectionMatrix by using perspective type with one param.
void SetPerspective(float fov, float nearPlane, float aspectRatio=1.777f)
Set ProjectionMatrix by using perspective type.
void ResetStableFrames()
Reset m_StableFrames to 0.
ProjectionType m_ProjectionType
PerspectiveParam m_PerspectiveParam
Camera PerspectiveParam.
Camera Class. This class just encapsulate Projection Matrix.
static FrameInfo & Get()
Get FrameInfo.
RendererType m_RendererType
The renderer type of current world.
FrameInfo Class. This class defines the FrameInfo data.
ProjectionType
This Struct defines camera projection type.
@ Orthographic
orthographic