mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01: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;
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
_lastFrameID = frameID;
|
||||
}
|
||||
|
||||
controller::Input::NamedVector LeapMotionPlugin::InputDevice::getAvailableInputs() const {
|
||||
|
|
|
@ -63,6 +63,8 @@ private:
|
|||
|
||||
Leap::Controller _controller;
|
||||
|
||||
bool _hasLeapMotionBeenConnected { false };
|
||||
int64_t _lastFrameID { -1 };
|
||||
};
|
||||
|
||||
#endif // hifi_LeapMotionPlugin_h
|
||||
|
|
Loading…
Reference in a new issue