X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Frender%2Fcamera.h;h=59a0ac2e62f677c4c356339a97f5c794515d7562;hb=274b6fb1b02692cc422bad9040d1abe5d545505a;hp=ed81a9511b3fcd9640fa4170f5adf28c23091a34;hpb=190a7e11237351f6b730c28f7b16f183e8adc69c;p=libs%2Fgl.git diff --git a/source/render/camera.h b/source/render/camera.h index ed81a951..59a0ac2e 100644 --- a/source/render/camera.h +++ b/source/render/camera.h @@ -57,10 +57,13 @@ private: Matrix view_matrix; Matrix proj_matrix; ProgramData shdata; + Vector4 frustum_planes[6]; public: Camera(); + void copy_parameters(const Camera &); + /** Sets the camera projection to perspective, characterised by the vertical field of view. Horizontal FoV is computed with the aspect ratio. */ void set_field_of_view(const Geometry::Angle &); @@ -122,9 +125,12 @@ public: /** Returns a ProgramData object containing the camera matrices. */ const ProgramData &get_shader_data() const { return shdata; } + bool is_in_frustum(const Renderable &) const; + private: void update_projection_matrix(); void update_object_matrix(); + void update_frustum_planes(); public: void set_debug_name(const std::string &);