X-Git-Url: https://eleni.mutantstargoat.com/git/?p=demo;a=blobdiff_plain;f=src%2Fcamera.h;h=1fbbf9c88eb7c3844374d5cc653f28de504d6205;hp=8b3a895443341d764c0a16c5b2cb76b0546dd652;hb=0d3454cbd5e803b8dea601110d403cd5563df9be;hpb=f906c6d5d6b93dcc4c0f3d54e679cf86c829b91e diff --git a/src/camera.h b/src/camera.h index 8b3a895..1fbbf9c 100644 --- a/src/camera.h +++ b/src/camera.h @@ -5,16 +5,31 @@ class Camera { public: - float phi; + Camera(); + virtual ~Camera(); + + virtual Mat4 get_view_matrix() const = 0; + virtual void use() const; +}; + +class OrbitCamera : public Camera { +protected: float theta; + float phi; float distance; - Mat4 m_projection; - float fov; + Vec3 position; - Camera(); - Camera(float phi, float theta, float distance, float fov); - ~Camera(); +public: + OrbitCamera(); + virtual ~OrbitCamera(); + + virtual Mat4 get_view_matrix() const override; + + void set_orbit_params(float theta, float phi, float distance); + void set_position(float x, float y, float z); }; +Mat4 calc_projection_matrix(float fov_deg, float aspect, float n, float f); + #endif // CAMERA_H_ \ No newline at end of file