]> git.tdb.fi Git - libs/vr.git/blob - source/openvr/openvrsystem.h
Store matrices for all tracked OpenVR devices, not just the HMD
[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         void update_pose_matrices();
35         const GL::Matrix &get_tracking_matrix(unsigned) const;
36         const GL::Matrix &get_hmd_matrix() const;
37 };
38
39 } // namespace VR
40 } // namespace Msp
41
42 #endif