description "OpenGL-based virtual reality library";
version "0.1";
+ require "sigc++-2.0";
require "mspcore";
require "mspgl";
require "mspgui";
class MotionController: public Input::Device
{
+public:
+ sigc::signal<void, bool> signal_tracking_state_changed;
+
protected:
StereoView *view;
Msp::GL::Matrix matrix;
void attach_to_view(StereoView &);
void detach_from_view();
+ virtual bool is_tracked() const = 0;
const GL::Matrix &get_matrix() const { return matrix; }
virtual void update() = 0;
protected:
{
case vr::VREvent_TrackedDeviceActivated:
index = ev.trackedDeviceIndex;
+ signal_tracking_state_changed.emit(true);
break;
case vr::VREvent_TrackedDeviceDeactivated:
index = -1;
+ signal_tracking_state_changed.emit(false);
break;
case vr::VREvent_ButtonPress:
set_button_state(ev.data.controller.button, true, true);
virtual std::string get_axis_name(unsigned) const;
int get_index() const { return index; }
+ virtual bool is_tracked() const { return index>=0; }
void event(const Event &);
virtual void update();