]> git.tdb.fi Git - libs/gl.git/blobdiff - source/camera.h
Store and expose the projection matrix
[libs/gl.git] / source / camera.h
index 634557607c112abdd619e622203cfafe1b9eddd0..bfcc2987d860b8e258e3f4fa6bcaad3906853295 100644 (file)
@@ -22,6 +22,7 @@ private:
        Vector3 up_dir;
        Matrix view_matrix;
        Matrix object_matrix;
+       Matrix proj_matrix;
 
 public:
        Camera();
@@ -54,6 +55,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 +65,7 @@ public:
        void apply() const;
 
 private:
+       void update_projection_matrix();
        void update_object_matrix();
 };