]> git.tdb.fi Git - libs/vr.git/blob - source/motioncontroller.h
959e056cd8c6c1b537951bb8161d7f0d6c1dfd83
[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 public:
15         sigc::signal<void, bool> signal_tracking_state_changed;
16
17 protected:
18         StereoView *view;
19         Msp::GL::Matrix matrix;
20
21         MotionController();
22 public:
23         virtual ~MotionController();
24
25         void attach_to_view(StereoView &);
26         void detach_from_view();
27         virtual bool is_tracked() const = 0;
28         const GL::Matrix &get_matrix() const { return matrix; }
29         virtual void update() = 0;
30 protected:
31         void update_from_matrix(const Msp::GL::Matrix &);
32 };
33
34 } // namespace VR
35 } // namespace Msp
36
37 #endif