]> git.tdb.fi Git - libs/vr.git/blob - source/openvr/openvrcontroller.h
Provide objects for visualizing controllers
[libs/vr.git] / source / openvr / openvrcontroller.h
1 #ifndef MSP_VR_OPENVRCONTROLLER_H_
2 #define MSP_VR_OPENVRCONTROLLER_H_
3
4 #include <msp/vr/motioncontroller.h>
5
6 namespace Msp {
7 namespace VR {
8
9 class OpenVRSystem;
10
11 class OpenVRController: public MotionController
12 {
13 public:
14         struct Event;
15
16 private:
17         OpenVRSystem &system;
18         int index;
19         unsigned last_packet_number;
20
21 public:
22         OpenVRController(OpenVRSystem &);
23         virtual ~OpenVRController();
24
25         virtual std::string get_button_name(unsigned) const;
26         virtual std::string get_axis_name(unsigned) const;
27
28         int get_index() const { return index; }
29         virtual bool is_tracked() const { return index>=0; }
30
31         void event(const Event &);
32         virtual void update();
33         void update_input_state();
34
35         virtual const GL::Object *get_object() const;
36 };
37
38 } // namespace VR
39 } // namespace Msp
40
41 #endif