X-Git-Url: http://git.tdb.fi/?p=libs%2Fvr.git;a=blobdiff_plain;f=source%2Fstereoview.h;h=bc9073ed5808ebf8e9802bdbd92f21d673fd584f;hp=842636e6697ce780f23c39531c2d1d30dec4f19b;hb=f5248334e741a6409fb3e7bd82ae784aaf1edcb5;hpb=fa43a20e8274638b84c26e052dd8f7cc8993edd9 diff --git a/source/stereoview.h b/source/stereoview.h index 842636e..bc9073e 100644 --- a/source/stereoview.h +++ b/source/stereoview.h @@ -11,6 +11,7 @@ namespace Msp { namespace VR { +class HeadTrackingCamera; class StereoCombiner; class StereoView @@ -36,31 +37,34 @@ 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; }; - 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 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_eye_matrices(const GL::Matrix &, const GL::Matrix &); void set_strabismus(const Geometry::Angle &); private: