X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcamera.h;h=9a525e6b1d51077af5f06874ba0a4a56a3b6505d;hb=782344299d402dfc7e4eb038bba876d7455f50f5;hp=634557607c112abdd619e622203cfafe1b9eddd0;hpb=c6149a1e9f488f790378969ff655e6bc94369d16;p=libs%2Fgl.git diff --git a/source/camera.h b/source/camera.h index 63455760..9a525e6b 100644 --- a/source/camera.h +++ b/source/camera.h @@ -11,6 +11,7 @@ class Camera { private: Geometry::Angle fov; + float height; float aspect; // Some compilers have "near" and "far" keywords float clip_near; @@ -22,11 +23,13 @@ private: Vector3 up_dir; Matrix view_matrix; Matrix object_matrix; + Matrix proj_matrix; public: Camera(); void set_field_of_view(const Geometry::Angle &); + void set_orthographic(float, float); void set_aspect(float); void set_depth_clip(float, float); void set_frustum_axis(float, float); @@ -54,6 +57,9 @@ public: to world space. */ const Matrix &get_object_matrix() const { return object_matrix; } + /** Returns the projection matrix. */ + const Matrix &get_projection_matrix() const { return proj_matrix; } + Vector3 project(const Vector4 &) const; Vector3 project(const Vector3 &) const; Vector4 unproject(const Vector4 &) const; @@ -61,6 +67,7 @@ public: void apply() const; private: + void update_projection_matrix(); void update_object_matrix(); };