]> git.tdb.fi Git - libs/vr.git/blobdiff - source/openvr/openvrcontroller.h
Add support for motion controllers
[libs/vr.git] / source / openvr / openvrcontroller.h
diff --git a/source/openvr/openvrcontroller.h b/source/openvr/openvrcontroller.h
new file mode 100644 (file)
index 0000000..18c5774
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef MSP_VR_OPENVRCONTROLLER_H_
+#define MSP_VR_OPENVRCONTROLLER_H_
+
+#include <msp/vr/motioncontroller.h>
+
+namespace Msp {
+namespace VR {
+
+class OpenVRSystem;
+
+class OpenVRController: public MotionController
+{
+public:
+       struct Event;
+
+private:
+       OpenVRSystem &system;
+       int index;
+       unsigned last_packet_number;
+
+public:
+       OpenVRController(OpenVRSystem &);
+       virtual ~OpenVRController();
+
+       virtual std::string get_button_name(unsigned) const;
+       virtual std::string get_axis_name(unsigned) const;
+
+       int get_index() const { return index; }
+
+       void event(const Event &);
+       virtual void update();
+       void update_input_state();
+};
+
+} // namespace VR
+} // namespace Msp
+
+#endif