]> git.tdb.fi Git - r2c2.git/blob - 3d/view.h
Don't crash if a train has no router
[r2c2.git] / 3d / view.h
1 #ifndef R2C2_3D_VIEW_H_
2 #define R2C2_3D_VIEW_H_
3
4 #include <msp/gl/camera.h>
5 #include <msp/gl/pipeline.h>
6
7 namespace R2C2 {
8
9 class Layout3D;
10
11 class View3D
12 {
13 protected:
14         Layout3D &layout;
15         unsigned width;
16         unsigned height;
17         Msp::GL::Camera camera;
18         Msp::GL::Pipeline pipeline;
19
20 public:
21         View3D(Layout3D &, unsigned, unsigned);
22
23         Layout3D &get_layout() const { return layout; }
24         Msp::GL::Camera &get_camera() { return camera; }
25         Msp::GL::Pipeline &get_pipeline() { return pipeline; }
26
27         Ray create_ray(int, int) const;
28         Ray create_ray(float, float) const;
29
30         void view_all(bool = false);
31
32         void render();
33 };
34
35 } // namespace R2C2
36
37 #endif