1 #ifndef MSP_VR_STEREOVIEW_H_
2 #define MSP_VR_STEREOVIEW_H_
4 #include <msp/geometry/angle.h>
5 #include <msp/gl/camera.h>
6 #include <msp/gl/framebuffer.h>
7 #include <msp/gl/renderable.h>
8 #include <msp/gl/renderbuffer.h>
9 #include <msp/gl/texture2d.h>
14 class HeadTrackingCamera;
15 class MotionController;
25 GL::Renderbuffer depth;
27 RenderTarget(unsigned, unsigned);
32 Geometry::Angle<float> fov;
40 mutable GL::Camera camera;
41 GL::Matrix offset_matrix;
47 void create_target(unsigned, unsigned);
48 void setup_frame(const GL::Camera &, float, const EyeParams &) const;
49 void render(const GL::Renderable &) const;
52 const StereoCombiner &combiner;
53 const GL::Camera &base_camera;
54 HeadTrackingCamera *head_camera;
55 const GL::Renderable *content;
58 Geometry::Angle<float> strabismus;
59 std::vector<MotionController *> controllers;
62 StereoView(const StereoCombiner &, const GL::Camera &);
63 StereoView(const StereoCombiner &, HeadTrackingCamera &);
68 const GL::Camera &get_base_camera() const { return base_camera; }
69 const HeadTrackingCamera *get_head_camera() const { return head_camera; }
70 void set_content(const GL::Renderable *);
71 void set_eye_spacing(float);
72 void set_eye_matrices(const GL::Matrix &, const GL::Matrix &);
73 void set_strabismus(const Geometry::Angle<float> &);
75 void add_controller(MotionController &);
76 void remove_controller(MotionController &);
79 void setup_frame() const;