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

@ -4,7 +4,7 @@ namespace ml_lme_cvr
{
[RequireComponent(typeof(Animator))]
[DisallowMultipleComponent]
public class LeapIK : MonoBehaviour
class LeapIK : MonoBehaviour
{
bool m_enabled = true;
bool m_fingersOnly = false;

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);

View file

@ -1,10 +1,10 @@
using System.Reflection;
[assembly: AssemblyTitle("LeapMotionExtension")]
[assembly: AssemblyVersion("1.0.1")]
[assembly: AssemblyFileVersion("1.0.1")]
[assembly: AssemblyVersion("1.0.2")]
[assembly: AssemblyFileVersion("1.0.2")]
[assembly: MelonLoader.MelonInfo(typeof(ml_lme_cvr.LeapMotionExtension), "LeapMotionExtension", "1.0.1", "SDraw", "https://github.com/SDraw")]
[assembly: MelonLoader.MelonInfo(typeof(ml_lme_cvr.LeapMotionExtension), "LeapMotionExtension", "1.0.2", "SDraw", "https://github.com/SDraw")]
[assembly: MelonLoader.MelonGame(null, "ChilloutVR")]
[assembly: MelonLoader.MelonPlatform(MelonLoader.MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
[assembly: MelonLoader.MelonPlatformDomain(MelonLoader.MelonPlatformDomainAttribute.CompatibleDomains.MONO)]