Stuck device detection

This commit is contained in:
SDraw 2022-03-23 19:38:02 +03:00
parent 2a7e796862
commit f6d16f25b7
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
3 changed files with 13 additions and 13 deletions

View file

@ -12,6 +12,7 @@ namespace ml_lme_cvr
static LeapMotionExtension ms_instance = null;
Leap.Controller m_leapController = null;
long m_lastFrameId = 0;
GestureMatcher.GesturesData m_gesturesData = null;
GameObject m_leapTrackingRoot = null;
@ -102,11 +103,15 @@ namespace ml_lme_cvr
{
if(Settings.Enabled && (m_leapController != null))
{
Leap.Frame l_frame = m_leapController.Frame();
if(l_frame != null)
{
GestureMatcher.GetGestures(l_frame, ref m_gesturesData);
for(int i = 0; i < GestureMatcher.GesturesData.ms_handsCount; i++)
m_gesturesData.m_handsPresenses[i] = false;
Leap.Frame l_frame = m_leapController.Frame();
if((l_frame != null) && (m_lastFrameId != l_frame.Id))
{
m_lastFrameId = l_frame.Id;
GestureMatcher.GetGestures(l_frame, ref m_gesturesData);
for(int i = 0; i < GestureMatcher.GesturesData.ms_handsCount; i++)
{
if((m_leapHands[i] != null) && m_gesturesData.m_handsPresenses[i])
@ -119,11 +124,6 @@ namespace ml_lme_cvr
}
}
}
else
{
for(int i = 0; i < GestureMatcher.GesturesData.ms_handsCount; i++)
m_gesturesData.m_handsPresenses[i] = false;
}
if(m_leapTracked != null)
m_leapTracked.UpdateTracking(m_gesturesData);