#include <Camera.h>
Definition at line 13 of file Camera.h.
◆ Camera()
| Elevate::Camera::Camera |
( |
float |
fov, |
|
|
float |
aspectRatio, |
|
|
bool |
overrideCurrent = true |
|
) |
| |
Definition at line 13 of file Camera.cpp.
14{
15 m_FOV = fov;
17 m_aspectRatio = (float)window.GetWidth() / (float)window.GetHeight();
18
20}
static Application & Get()
◆ BEGIN_COMPONENT()
◆ Destroy()
| void Elevate::Camera::Destroy |
( |
| ) |
|
|
overridevirtual |
◆ GenViewMatrix()
| glm::mat4 Elevate::Camera::GenViewMatrix |
( |
| ) |
const |
◆ GenViewProjectionMatrix()
| glm::mat4 Elevate::Camera::GenViewProjectionMatrix |
( |
| ) |
const |
Definition at line 64 of file Camera.cpp.
65{
67}
glm::mat4 GenViewMatrix() const
◆ GetAspectRatio()
| const float Elevate::Camera::GetAspectRatio |
( |
| ) |
const |
|
inline |
Definition at line 42 of file Camera.h.
42{ return m_aspectRatio; }
◆ GetFar()
| const float Elevate::Camera::GetFar |
( |
| ) |
const |
|
inline |
◆ GetFOV()
| const float Elevate::Camera::GetFOV |
( |
| ) |
const |
|
inline |
◆ GetFrontVec()
| const glm::vec3 & Elevate::Camera::GetFrontVec |
( |
| ) |
const |
|
inline |
◆ GetNear()
| const float Elevate::Camera::GetNear |
( |
| ) |
const |
|
inline |
◆ GetProjectionMatrix()
| const glm::mat4 & Elevate::Camera::GetProjectionMatrix |
( |
| ) |
const |
|
inline |
Definition at line 25 of file Camera.h.
25{ return m_projectionMatrix; }
◆ GetRightVec()
| const glm::vec3 & Elevate::Camera::GetRightVec |
( |
| ) |
const |
|
inline |
◆ GetUpVec()
| const glm::vec3 & Elevate::Camera::GetUpVec |
( |
| ) |
const |
|
inline |
◆ Init()
| void Elevate::Camera::Init |
( |
| ) |
|
|
overridevirtual |
Reimplemented from Elevate::Component.
Reimplemented in Elevate::EditorCamera.
Definition at line 31 of file Camera.cpp.
32{
33 UpdateProjectionMatrix();
35
36 if (m_canBeMainCamera)
37 {
39 }
40
41
43}
static void SetCurrent(Camera *current)
void UpdateCameraVectors()
static void SetDefaultListener(GameObject *obj)
◆ OnSetRotation()
| void Elevate::Camera::OnSetRotation |
( |
| ) |
|
|
overridevirtual |
◆ RenderWhenSelected()
| void Elevate::Camera::RenderWhenSelected |
( |
| ) |
|
|
inlineoverridevirtual |
◆ SetFar()
| void Elevate::Camera::SetFar |
( |
float |
farPlane | ) |
|
|
inline |
Definition at line 92 of file Camera.cpp.
93{
94 if (m_far != farPlane)
95 {
96 m_far = farPlane;
97 UpdateProjectionMatrix();
98 }
99}
◆ SetFOV()
| void Elevate::Camera::SetFOV |
( |
float |
fov | ) |
|
|
inline |
Definition at line 74 of file Camera.cpp.
75{
76 if (m_FOV != fov)
77 {
78 m_FOV = fov;
79 UpdateProjectionMatrix();
80 }
81}
◆ SetNear()
| void Elevate::Camera::SetNear |
( |
float |
nearPlane | ) |
|
|
inline |
Definition at line 83 of file Camera.cpp.
84{
85 if (m_near != nearPlane)
86 {
87 m_near = nearPlane;
88 UpdateProjectionMatrix();
89 }
90}
◆ UpdateAspectRatio()
| const void Elevate::Camera::UpdateAspectRatio |
( |
float |
aspectRatio | ) |
|
Definition at line 55 of file Camera.cpp.
56{
57 if (m_aspectRatio != aspectRatio)
58 {
59 m_aspectRatio = aspectRatio;
60 UpdateProjectionMatrix();
61 }
62}
◆ UpdateCameraVectors()
| void Elevate::Camera::UpdateCameraVectors |
( |
| ) |
|
Definition at line 111 of file Camera.cpp.
112{
115
116 glm::vec3 front;
117 front.x = cos(yaw) * cos(pitch);
118 front.y = sin(pitch);
119 front.z = sin(yaw) * cos(pitch);
120 m_front = glm::normalize(front);
121
122 m_right = glm::normalize(glm::cross(glm::vec3(0.0f, 1.0f, 0.0f), m_front));
123
124 m_up = glm::normalize(glm::cross(m_front, m_right));
125}
◆ overrideCurrent
| bool Elevate::Camera::overrideCurrent = true) |
The documentation for this class was generated from the following files:
- ElevateEngine/src/ElevateEngine/Renderer/Camera.h
- ElevateEngine/src/ElevateEngine/Renderer/Camera.cpp