nice
This commit is contained in:
37
include/td/render/Camera.h
Normal file
37
include/td/render/Camera.h
Normal 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
|
||||
Reference in New Issue
Block a user