1 #ifndef MSP_GL_CAMERA_H_
2 #define MSP_GL_CAMERA_H_
13 Geometry::Angle<float> fov;
16 // Some compilers have "near" and "far" keywords
31 void set_field_of_view(const Geometry::Angle<float> &);
32 void set_orthographic(float, float);
33 void set_aspect(float);
34 void set_depth_clip(float, float);
35 void set_frustum_axis(float, float);
36 const Geometry::Angle<float> &get_field_of_view() const { return fov; }
37 float get_aspect() const { return aspect; }
38 float get_near_clip() const { return clip_near; }
39 float get_far_clip() const { return clip_far; }
41 void set_position(const Vector3 &);
42 void set_look_direction(const Vector3 &);
43 void look_at(const Vector3 &);
44 void set_up_direction(const Vector3 &);
45 const Vector3 &get_position() const { return position; }
46 const Vector3 &get_look_direction() const { return look_dir; }
47 const Vector3 &get_up_direction() const { return up_dir; }
49 /** Deprecated alias for get_view_matrix. */
50 const Matrix &get_matrix() const { return get_view_matrix(); }
52 /** Returns the view matrix, used to transform coordinates from world space
54 const Matrix &get_view_matrix() const { return view_matrix; }
56 /** Returns the object matrix, used to transform coordinates from eye space
58 const Matrix &get_object_matrix() const { return object_matrix; }
60 /** Returns the projection matrix. */
61 const Matrix &get_projection_matrix() const { return proj_matrix; }
63 Vector3 project(const Vector4 &) const;
64 Vector3 project(const Vector3 &) const;
65 Vector4 unproject(const Vector4 &) const;
70 void update_projection_matrix();
71 void update_object_matrix();