mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 12:38:27 +02:00
Signal when Leap Motion is connected
This commit is contained in:
parent
8d84e86d19
commit
0d986b8dc2
2 changed files with 16 additions and 0 deletions
|
@ -32,7 +32,21 @@ void LeapMotionPlugin::pluginUpdate(float deltaTime, const controller::InputCali
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto frame = _controller.frame();
|
||||||
|
const auto frameID = frame.id();
|
||||||
|
if (_lastFrameID >= frameID) {
|
||||||
|
// Leap Motion not connected or duplicate frame.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!_hasLeapMotionBeenConnected) {
|
||||||
|
emit deviceConnected(getName());
|
||||||
|
_hasLeapMotionBeenConnected = true;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
|
_lastFrameID = frameID;
|
||||||
}
|
}
|
||||||
|
|
||||||
controller::Input::NamedVector LeapMotionPlugin::InputDevice::getAvailableInputs() const {
|
controller::Input::NamedVector LeapMotionPlugin::InputDevice::getAvailableInputs() const {
|
||||||
|
|
|
@ -63,6 +63,8 @@ private:
|
||||||
|
|
||||||
Leap::Controller _controller;
|
Leap::Controller _controller;
|
||||||
|
|
||||||
|
bool _hasLeapMotionBeenConnected { false };
|
||||||
|
int64_t _lastFrameID { -1 };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_LeapMotionPlugin_h
|
#endif // hifi_LeapMotionPlugin_h
|
||||||
|
|
Loading…
Reference in a new issue