]> git.tdb.fi Git - libs/vr.git/blobdiff - source/motioncontroller.h
Add support for motion controllers
[libs/vr.git] / source / motioncontroller.h
diff --git a/source/motioncontroller.h b/source/motioncontroller.h
new file mode 100644 (file)
index 0000000..9cdd622
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef MSP_VR_MOTIONCONTROLLER_H_
+#define MSP_VR_MOTIONCONTROLLER_H_
+
+#include <msp/gl/matrix.h>
+#include <msp/input/device.h>
+
+namespace Msp {
+namespace VR {
+
+class StereoView;
+
+class MotionController: public Input::Device
+{
+protected:
+       StereoView *view;
+       Msp::GL::Matrix matrix;
+
+       MotionController();
+public:
+       virtual ~MotionController();
+
+       void attach_to_view(StereoView &);
+       void detach_from_view();
+       const GL::Matrix &get_matrix() const { return matrix; }
+       virtual void update() = 0;
+protected:
+       void update_from_matrix(const Msp::GL::Matrix &);
+};
+
+} // namespace VR
+} // namespace Msp
+
+#endif