// // Created by Иван Ильин on 14.01.2021. // #ifndef ENGINE_CAMERA_H #define ENGINE_CAMERA_H #include #include "Screen.h" #include "Plane.h" #include "Mesh.h" class Camera final : public Object{ private: Matrix4x4 _S; // screen space matrix Matrix4x4 _P; // projections matrix Matrix4x4 _V; // camera matrix // To accelerate calculations we can use precalculated matrix that does not chance Matrix4x4 _SP; // screen-space-projections matrix std::vector> _triangles{}; std::vector _clipPlanes{}; bool _ready = false; double _aspect = 0; public: Camera() = default; Camera(const Camera& camera) = delete; void init(int width, int height, double fov = 110.0, double ZNear = 0.1, double ZFar = 5000.0); std::vector> project(std::shared_ptr mesh); void clear(); [[nodiscard]] int buffSize() const { return _triangles.size(); } std::vector> sorted(); }; #endif //INC_3DZAVR_CAMERA_H