This commit is contained in:
2025-07-16 00:32:40 +02:00
parent d1690192db
commit aaf76a3ff0
41 changed files with 2963 additions and 599 deletions

View File

@@ -0,0 +1,37 @@
#pragma once
#include <td/Maths.h>
namespace td {
namespace render {
class Camera {
private:
Mat4f m_ViewMatrix;
Mat4f m_ProjectionMatrix;
Mat4f m_InvViewMatrix;
Mat4f m_InvProjectionMatrix;
float m_CamDistance = 25.0f;
Vec3f m_CamPos{0, m_CamDistance, 0};
Vec2f m_CamLook{};
float m_Yaw = -PI / 2.0f;
float m_Pitch = -PI / 2.0f + 0.0000001f;
public:
const Mat4f& GetViewMatrix() const {
return m_ViewMatrix;
}
const Mat4f& GetProjectionMatrix() const {
return m_ProjectionMatrix;
}
void UpdatePerspective(float a_AspectRatio);
void SetCamPos(const Vec3f& a_NewPos);
};
} // namespace render
} // namespace td