1 #ifndef BLOBS_GRAPHICS_CAMERA_HPP_
2 #define BLOBS_GRAPHICS_CAMERA_HPP_
4 #include "../math/glm.hpp"
19 explicit Camera(const world::Body &) noexcept;
22 Camera(const Camera &) = delete;
23 Camera &operator =(const Camera &) = delete;
25 Camera(Camera &&) = delete;
26 Camera &operator =(Camera &&) = delete;
29 Camera &FOV(float f) noexcept;
30 Camera &Aspect(float r) noexcept;
31 Camera &Aspect(float w, float h) noexcept;
32 Camera &Clip(float near, float far) noexcept;
34 const world::Body &Reference() const noexcept { return *ref; }
35 Camera &Reference(const world::Body &) noexcept;
37 /// look at center, position relative to orbital reference plane for children
38 Camera &Orbital(const glm::vec3 &pos) noexcept;
39 /// look at creature from the side, angle in euler (ZXY in surface reference plane)
40 Camera &Radial(const creature::Creature &, double distance, const glm::dvec3 &angle);
42 const glm::mat4 &Projection() const noexcept { return projection; }
43 const glm::mat4 &View() const noexcept { return view; }
44 glm::mat4 Model(const world::Body &) const noexcept;
47 void UpdateProjection() noexcept;
59 const world::Body *ref;
60 // track reference body's orientation