refactor rendering

This commit is contained in:
2025-07-16 13:38:02 +02:00
parent 1bee6aed9c
commit 9667454811
14 changed files with 130 additions and 105 deletions

View File

@@ -1,20 +1,12 @@
#pragma once
#include <td/Maths.h>
#include <td/misc/ObjectNotifier.h>
#include <td/misc/Signal.h>
namespace td {
namespace render {
class ICameraListener {
public:
virtual void OnPerspectiveChange() {}
virtual void OnViewChange() {}
};
using CameraNotifier = utils::ObjectNotifier<ICameraListener>;
class Camera : public CameraNotifier {
class Camera {
private:
Mat4f m_ViewMatrix;
Mat4f m_ProjectionMatrix;
@@ -29,6 +21,9 @@ class Camera : public CameraNotifier {
float m_Pitch = -PI / 2.0f + 0.0000001f;
public:
utils::Signal<> OnPerspectiveChange;
utils::Signal<> OnViewChange;
const Mat4f& GetViewMatrix() const {
return m_ViewMatrix;
}