7 Camera::Camera(Handle<Entity> e, const CameraSetup &s):
8 BufferedComponent<CameraData>(e),
11 CameraData &d = write();
12 d.fov_y = setup.field_of_view_y;
14 d.near_clip = setup.near_clip;
15 d.far_clip = setup.far_clip;
17 if(!d.is_orthographic())
18 d.size = { d.get_aspect(), 1.0f };
21 void Camera::set_field_of_view(Geometry::Angle<float> f, float a)
24 if(d.is_orthographic())
25 throw logic_error("Camera is not perspective");
31 void Camera::set_size(const LinAl::Vector<float, 2> &s)
34 if(!d.is_orthographic())
35 throw logic_error("Camera is not orthographic");
40 } // namespace Msp::Game