X-Git-Url: https://eleni.mutantstargoat.com/git/?p=vkrt;a=blobdiff_plain;f=src%2Fcamera.h;fp=src%2Fcamera.h;h=0f70040c991c42bf2d4fa2695909cf9713ce6411;hp=0000000000000000000000000000000000000000;hb=470723fe1cc3902759399a023a062051c460bd1f;hpb=6c8e0d1dcf1e08982b54a1b2d2e914e409e09386 diff --git a/src/camera.h b/src/camera.h new file mode 100644 index 0000000..0f70040 --- /dev/null +++ b/src/camera.h @@ -0,0 +1,34 @@ +#ifndef CAMERA_H_ +#define CAMERA_H_ + +#include + +class Camera { +public: + Camera(); + virtual ~Camera(); + + virtual Mat4 get_view_matrix() const = 0; +}; + +class OrbitCamera : public Camera { +protected: + float theta; + float phi; + float distance; + + Vec3 position; + +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_