refactor rendering
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user