]> git.tdb.fi Git - libs/vr.git/blob - source/motioncontroller.h
9cdd6221318bbf84b6c9c75f1e61f25c593d1a14
[libs/vr.git] / source / motioncontroller.h
1 #ifndef MSP_VR_MOTIONCONTROLLER_H_
2 #define MSP_VR_MOTIONCONTROLLER_H_
3
4 #include <msp/gl/matrix.h>
5 #include <msp/input/device.h>
6
7 namespace Msp {
8 namespace VR {
9
10 class StereoView;
11
12 class MotionController: public Input::Device
13 {
14 protected:
15         StereoView *view;
16         Msp::GL::Matrix matrix;
17
18         MotionController();
19 public:
20         virtual ~MotionController();
21
22         void attach_to_view(StereoView &);
23         void detach_from_view();
24         const GL::Matrix &get_matrix() const { return matrix; }
25         virtual void update() = 0;
26 protected:
27         void update_from_matrix(const Msp::GL::Matrix &);
28 };
29
30 } // namespace VR
31 } // namespace Msp
32
33 #endif