X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcamera.h;h=b10ccb93e200ceaadbe62e8498c7cb69e427409a;hb=3e555c51a85b97090ae8c9b16ee425ee5ffe6ef8;hp=d96ada81e45c4c26840e79c4b813f6034c1a8d82;hpb=05d70b38a546f35a7687cae6ae3fcd6ab78898b2;p=libs%2Fgl.git diff --git a/source/camera.h b/source/camera.h index d96ada81..b10ccb93 100644 --- a/source/camera.h +++ b/source/camera.h @@ -1,6 +1,7 @@ #ifndef MSP_GL_CAMERA_H_ #define MSP_GL_CAMERA_H_ +#include #include "placeable.h" namespace Msp { @@ -8,6 +9,23 @@ namespace GL { class Camera: public Placeable { +public: + class Loader: public DataFile::ObjectLoader + { + public: + Loader(Camera &); + + private: + void aspect_ratio(float); + void depth_clip(float, float); + void field_of_view(float); + void look_at(float, float, float); + void look_direction(float, float, float); + void orthographic(float, float); + void position(float, float, float); + void up_direction(float, float, float); + }; + private: Geometry::Angle fov; float height; @@ -29,7 +47,7 @@ public: void set_field_of_view(const Geometry::Angle &); void set_orthographic(float, float); - void set_aspect(float); + void set_aspect_ratio(float); void set_depth_clip(float, float); void set_frustum_axis(float, float); void set_frustum_rotation(const Geometry::Angle &); @@ -37,7 +55,7 @@ public: bool is_orthographic() const { return fov==Geometry::Angle::zero(); } float get_orthographic_width() const { return height*aspect; } float get_orthographic_height() const { return height; } - float get_aspect() const { return aspect; } + float get_aspect_ratio() const { return aspect; } float get_near_clip() const { return clip_near; } float get_far_clip() const { return clip_far; } const Geometry::Angle &get_frustum_rotation() const { return rotate; } @@ -71,8 +89,6 @@ public: Vector4 unproject(const Vector4 &) const; Vector3 unproject(const Vector3 &) const; - void apply() const; - private: void update_projection_matrix(); void update_object_matrix();