view.set_eye_matrices(GL::Matrix::translation(GL::Vector3(l.x, l.y, l.z)), GL::Matrix::translation(GL::Vector3(r.x, r.y, r.z)));
}
-void LibOVRSystem::set_absolute_tracking(bool a)
-{
- if(a)
- throw invalid_argument("absolute tracking not supported");
-}
-
LibOVRCamera *LibOVRSystem::create_camera(const GL::Camera &bc)
{
return new LibOVRCamera(*this, bc);
virtual void configure_window(Graphics::Window &) const;
virtual void configure_view(StereoView &) const;
- virtual void set_absolute_tracking(bool);
virtual LibOVRCamera *create_camera(const GL::Camera &);
virtual LibOVRCombiner *create_combiner(GL::View &);
public:
OpenVRCombiner(OpenVRSystem &, GL::View &);
+ virtual bool is_mirroring_supported() const { return true; }
virtual void prepare() const;
virtual void render(const GL::Texture2D &, const GL::Texture2D &) const;
};
vr::VRCompositor()->SetTrackingSpace(a ? vr::TrackingUniverseStanding : vr::TrackingUniverseSeated);
}
+bool OpenVRSystem::get_absolute_tracking() const
+{
+ return vr::VRCompositor()->GetTrackingSpace()==vr::TrackingUniverseStanding;
+}
+
OpenVRCamera *OpenVRSystem::create_camera(const GL::Camera &bc)
{
return new OpenVRCamera(*this, bc);
virtual void configure_window(Graphics::Window &) const { }
virtual void configure_view(StereoView &) const;
+ virtual bool is_absolute_tracking_supported() const { return true; }
virtual void set_absolute_tracking(bool);
+ virtual bool get_absolute_tracking() const;
virtual OpenVRCamera *create_camera(const GL::Camera &);
virtual OpenVRCombiner *create_combiner(GL::View &);
void StereoCombiner::set_mirroring(bool m)
{
+ if(m && !is_mirroring_supported())
+ throw runtime_error("mirroring not supported");
+
if(m && !mirror)
mirror = new MirrorView;
else if(!m && mirror)
const Geometry::Angle<float> &get_field_of_view() const { return fov; }
float get_frustum_skew() const { return frustum_skew; }
+ virtual bool is_mirroring_supported() const { return false; }
void set_mirroring(bool);
+ bool get_mirroring() const { return mirror; }
virtual void prepare() const { }
virtual void render(const GL::Texture2D &, const GL::Texture2D &) const = 0;
return 0;
}
+void System::set_absolute_tracking(bool a)
+{
+ if(a)
+ throw invalid_argument("absolute tracking not supported");
+}
+
} // namespace VR
} // namespace Msp
virtual void configure_window(Graphics::Window &) const = 0;
virtual void configure_view(StereoView &) const = 0;
- virtual void set_absolute_tracking(bool) = 0;
+ virtual bool is_absolute_tracking_supported() const { return false; }
+ virtual void set_absolute_tracking(bool);
+ virtual bool get_absolute_tracking() const { return false; }
virtual HeadTrackingCamera *create_camera(const GL::Camera &) = 0;
virtual StereoCombiner *create_combiner(GL::View &) = 0;
};