]> git.tdb.fi Git - r2c2.git/blob - source/3d/view.h
225e3937297a36c33202acee728fe890d58462eb
[r2c2.git] / source / 3d / view.h
1 #ifndef R2C2_3D_VIEW_H_
2 #define R2C2_3D_VIEW_H_
3
4 #include <msp/gl/ambientocclusion.h>
5 #include <msp/gl/camera.h>
6 #include <msp/gl/colorcurve.h>
7 #include <msp/gl/pipeline.h>
8 #include <msp/gl/shadowmap.h>
9 #include "sky.h"
10
11 namespace R2C2 {
12
13 class Layout3D;
14
15 class View3D
16 {
17 protected:
18         Layout3D &layout;
19         unsigned width;
20         unsigned height;
21         Msp::GL::Camera camera;
22         Msp::GL::Pipeline pipeline;
23         Sky3D sky;
24         Msp::GL::ShadowMap shadow;
25         Msp::GL::ColorCurve colorcurve;
26         Msp::GL::AmbientOcclusion ambient_occlusion;
27
28 public:
29         View3D(Layout3D &, unsigned, unsigned);
30
31         Layout3D &get_layout() const { return layout; }
32         Msp::GL::Camera &get_camera() { return camera; }
33         Msp::GL::Pipeline &get_pipeline() { return pipeline; }
34
35         Ray create_ray(int, int) const;
36         Ray create_ray(float, float) const;
37
38 private:
39         void compute_bounds(Vector &, Vector &);
40 public:
41         void view_all(bool = false);
42
43         void render();
44
45 private:
46         void update_shadow_area();
47 };
48
49 } // namespace R2C2
50
51 #endif