1 #ifndef BLOBS_GRAPHICS_CAMERA_HPP_
2 #define BLOBS_GRAPHICS_CAMERA_HPP_
4 #include "../math/glm.hpp"
16 explicit Camera(const world::Body &) noexcept;
19 Camera(const Camera &) = delete;
20 Camera &operator =(const Camera &) = delete;
22 Camera(Camera &&) = delete;
23 Camera &operator =(Camera &&) = delete;
26 Camera &FOV(float f) noexcept;
27 Camera &Aspect(float r) noexcept;
28 Camera &Aspect(float w, float h) noexcept;
29 Camera &Clip(float near, float far) noexcept;
31 const world::Body &Reference() const noexcept { return *ref; }
32 Camera &Reference(const world::Body &) noexcept;
34 Camera &LookAt(const glm::vec3 &pos, const glm::vec3 &tgt, const glm::vec3 &up) noexcept;
36 /// track orientation of reference body
37 void TrackOrientation(bool b = true) noexcept { track_orient = b; }
39 const glm::mat4 &Projection() const noexcept { return projection; }
40 const glm::mat4 &View() const noexcept { return view; }
41 glm::mat4 Model(const world::Body &) const noexcept;
42 glm::mat4 Universe() const noexcept;
45 void UpdateProjection() noexcept;
57 const world::Body *ref;
58 // track reference body's orientation