]> git.tdb.fi Git - libs/vr.git/blob - source/openvr/openvrsystem.h
Receive events from OpenVR
[libs/vr.git] / source / openvr / openvrsystem.h
1 #ifndef MSP_VR_OPENVRSYSTEM_H_
2 #define MSP_VR_OPENVRSYSTEM_H_
3
4 #include <msp/gl/matrix.h>
5 #include <msp/vr/system.h>
6 #include "openvrcamera.h"
7 #include "openvrcombiner.h"
8
9 namespace Msp {
10 namespace VR {
11
12 class OpenVRSystem: public System
13 {
14 private:
15         unsigned n_tracked_devices;
16         std::vector<GL::Matrix> tracking_matrices;
17
18         static unsigned n_instances;
19
20 public:
21         OpenVRSystem();
22         ~OpenVRSystem();
23
24         static bool is_maybe_available();
25
26         virtual void configure_window(Graphics::Window &) const { }
27         virtual void configure_view(StereoView &) const;
28         virtual bool is_absolute_tracking_supported() const { return true; }
29         virtual void set_absolute_tracking(bool);
30         virtual bool get_absolute_tracking() const;
31         virtual OpenVRCamera *create_camera(const GL::Camera &);
32         virtual OpenVRCombiner *create_combiner(GL::View &);
33
34         virtual void tick();
35
36         void update_pose_matrices();
37         const GL::Matrix &get_tracking_matrix(unsigned) const;
38         const GL::Matrix &get_hmd_matrix() const;
39 };
40
41 } // namespace VR
42 } // namespace Msp
43
44 #endif