]> git.tdb.fi Git - libs/vr.git/blobdiff - source/stereoview.h
Add support for motion controllers
[libs/vr.git] / source / stereoview.h
index ff34706cc4b450d1daff8d7844b5147c282ffc5d..e31fa3d561b9adaa51f81a916b30d5c66f3483e5 100644 (file)
@@ -12,6 +12,7 @@ namespace Msp {
 namespace VR {
 
 class HeadTrackingCamera;
+class MotionController;
 class StereoCombiner;
 
 class StereoView
@@ -37,12 +38,13 @@ private:
        struct Eye
        {
                mutable GL::Camera camera;
+               GL::Matrix offset_matrix;
                RenderTarget *target;
 
                Eye();
 
                void create_target(unsigned, unsigned);
-               void setup_frame(const GL::Camera &, const GL::Vector3 &, float, const EyeParams &) const;
+               void setup_frame(const GL::Camera &, float, const EyeParams &) const;
                void render(const GL::Renderable &) const;
        };
 
@@ -52,8 +54,8 @@ private:
        const GL::Renderable *content;
        Eye left;
        Eye right;
-       float eye_spacing;
        Geometry::Angle<float> strabismus;
+       std::vector<MotionController *> controllers;
 
 public:
        StereoView(const StereoCombiner &, const GL::Camera &);
@@ -62,10 +64,16 @@ private:
        void init();
 
 public:
+       const GL::Camera &get_base_camera() const { return base_camera; }
+       const HeadTrackingCamera *get_head_camera() const { return head_camera; }
        void set_content(const GL::Renderable *);
        void set_eye_spacing(float);
+       void set_eye_matrices(const GL::Matrix &, const GL::Matrix &);
        void set_strabismus(const Geometry::Angle<float> &);
 
+       void add_controller(MotionController &);
+       void remove_controller(MotionController &);
+
 private:
        void setup_frame() const;
 public: