X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Frender%2Fcamera.h;h=59a0ac2e62f677c4c356339a97f5c794515d7562;hb=4f2f558123db15393607d8b21b949d7798561dec;hp=c713f7e49608c500f572be8e28b853cfdabca050;hpb=99ca354f18119f82f1adeca100cd665a8f640317;p=libs%2Fgl.git diff --git a/source/render/camera.h b/source/render/camera.h index c713f7e4..59a0ac2e 100644 --- a/source/render/camera.h +++ b/source/render/camera.h @@ -2,7 +2,6 @@ #define MSP_GL_CAMERA_H_ #include -#include "camera_backend.h" #include "placeable.h" #include "programdata.h" @@ -23,7 +22,7 @@ YZ plane of eye space is aligned to the plane formed by the look and up directions. Setting the up direction to the opposite of gravity direction is an easy way to keep the camera upright. */ -class Camera: public CameraBackend, public Placeable +class Camera: public Placeable { public: class Loader: public DataFile::ObjectLoader @@ -58,6 +57,7 @@ private: Matrix view_matrix; Matrix proj_matrix; ProgramData shdata; + Vector4 frustum_planes[6]; public: Camera(); @@ -125,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 &);