#ifndef VIEW_H #define VIEW_H #include #include using namespace std; #include "util.h" struct visibility_state { unsigned int generation; enum { UNKNOWN, OCCLUDED, PARTIAL, FULL } visibility; visibility_state () : generation(0), visibility(UNKNOWN) { }; }; struct view { sector orig; point p; vec3 d, u; GLfloat fov; GLfloat near, far; int w, h; GLfloat gamma; // only to be used by friends TODO GLfloat nextfar; matrix projection; struct { plane l, r, t, b, n, f; } frustum; enum mode { DEPTH, LIGHTED } mode; light *l; set drawn; unsigned int generation; map vismap; vector vislist; // octants partially or fully visible in frustum vector farlist; // octants possibly visible vector occlist; // octants currently occluded void reset_projection (); // public void begin (); void pass (enum mode m); void end (); bool may_draw (const entity *e); view (); ~view (); }; #endif