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;
46 void create_target(unsigned, unsigned);
47 void setup_frame(const GL::Camera &, float, const EyeParams &) const;
48 void render(const GL::Renderable &) const;
51 const StereoCombiner &combiner;
52 const GL::Camera &base_camera;
53 HeadTrackingCamera *head_camera;
54 const GL::Renderable *content;
57 Geometry::Angle<float> strabismus;
58 std::vector<MotionController *> controllers;
61 StereoView(const StereoCombiner &, const GL::Camera &);
62 StereoView(const StereoCombiner &, HeadTrackingCamera &);
67 const GL::Camera &get_base_camera() const { return base_camera; }
68 const HeadTrackingCamera *get_head_camera() const { return head_camera; }
69 void set_content(const GL::Renderable *);
70 void set_eye_spacing(float);
71 void set_eye_matrices(const GL::Matrix &, const GL::Matrix &);
72 void set_strabismus(const Geometry::Angle<float> &);
74 void add_controller(MotionController &);
75 void remove_controller(MotionController &);
78 void setup_frame() const;