]> git.tdb.fi Git - libs/vr.git/blobdiff - source/stereoview.h
Update camera pose as part of the render call
[libs/vr.git] / source / stereoview.h
index b1e0473029fec0e05ceb848f1aefd5c9f0fbe700..ff34706cc4b450d1daff8d7844b5147c282ffc5d 100644 (file)
 namespace Msp {
 namespace VR {
 
+class HeadTrackingCamera;
 class StereoCombiner;
 
-class StereoView: public GL::Renderable
+class StereoView
 {
 private:
        struct RenderTarget
@@ -42,32 +43,33 @@ private:
 
                void create_target(unsigned, unsigned);
                void setup_frame(const GL::Camera &, const GL::Vector3 &, float, const EyeParams &) const;
-               void render(const GL::Renderable &, const GL::Tag &) const;
+               void render(const GL::Renderable &) const;
        };
 
-       unsigned width;
-       unsigned height;
+       const StereoCombiner &combiner;
        const GL::Camera &base_camera;
-       const GL::Renderable &renderable;
-       const StereoCombiner *combiner;
+       HeadTrackingCamera *head_camera;
+       const GL::Renderable *content;
        Eye left;
        Eye right;
        float eye_spacing;
        Geometry::Angle<float> strabismus;
-       mutable GL::Vector3 offset_axis;
 
 public:
-       StereoView(unsigned, unsigned, const GL::Camera &, const GL::Renderable &, const StereoCombiner &);
+       StereoView(const StereoCombiner &, const GL::Camera &);
+       StereoView(const StereoCombiner &, HeadTrackingCamera &);
+private:
+       void init();
 
-       void set_combiner(const StereoCombiner &);
+public:
+       void set_content(const GL::Renderable *);
        void set_eye_spacing(float);
        void set_strabismus(const Geometry::Angle<float> &);
 
-       virtual void setup_frame() const;
-       virtual void finish_frame() const;
-
-       virtual void render(const GL::Tag & = GL::Tag()) const;
-       virtual void render(GL::Renderer &, const GL::Tag & = GL::Tag()) const;
+private:
+       void setup_frame() const;
+public:
+       void render() const;
 };
 
 } // namespace VR