mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-05 03:19:23 +00:00
Stuck device detection
This commit is contained in:
parent
2a7e796862
commit
f6d16f25b7
3 changed files with 13 additions and 13 deletions
|
@ -4,7 +4,7 @@ namespace ml_lme_cvr
|
||||||
{
|
{
|
||||||
[RequireComponent(typeof(Animator))]
|
[RequireComponent(typeof(Animator))]
|
||||||
[DisallowMultipleComponent]
|
[DisallowMultipleComponent]
|
||||||
public class LeapIK : MonoBehaviour
|
class LeapIK : MonoBehaviour
|
||||||
{
|
{
|
||||||
bool m_enabled = true;
|
bool m_enabled = true;
|
||||||
bool m_fingersOnly = false;
|
bool m_fingersOnly = false;
|
||||||
|
|
|
@ -12,6 +12,7 @@ namespace ml_lme_cvr
|
||||||
static LeapMotionExtension ms_instance = null;
|
static LeapMotionExtension ms_instance = null;
|
||||||
|
|
||||||
Leap.Controller m_leapController = null;
|
Leap.Controller m_leapController = null;
|
||||||
|
long m_lastFrameId = 0;
|
||||||
GestureMatcher.GesturesData m_gesturesData = null;
|
GestureMatcher.GesturesData m_gesturesData = null;
|
||||||
|
|
||||||
GameObject m_leapTrackingRoot = null;
|
GameObject m_leapTrackingRoot = null;
|
||||||
|
@ -102,11 +103,15 @@ namespace ml_lme_cvr
|
||||||
{
|
{
|
||||||
if(Settings.Enabled && (m_leapController != null))
|
if(Settings.Enabled && (m_leapController != null))
|
||||||
{
|
{
|
||||||
Leap.Frame l_frame = m_leapController.Frame();
|
for(int i = 0; i < GestureMatcher.GesturesData.ms_handsCount; i++)
|
||||||
if(l_frame != null)
|
m_gesturesData.m_handsPresenses[i] = false;
|
||||||
{
|
|
||||||
GestureMatcher.GetGestures(l_frame, ref m_gesturesData);
|
|
||||||
|
|
||||||
|
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++)
|
for(int i = 0; i < GestureMatcher.GesturesData.ms_handsCount; i++)
|
||||||
{
|
{
|
||||||
if((m_leapHands[i] != null) && m_gesturesData.m_handsPresenses[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)
|
if(m_leapTracked != null)
|
||||||
m_leapTracked.UpdateTracking(m_gesturesData);
|
m_leapTracked.UpdateTracking(m_gesturesData);
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
[assembly: AssemblyTitle("LeapMotionExtension")]
|
[assembly: AssemblyTitle("LeapMotionExtension")]
|
||||||
[assembly: AssemblyVersion("1.0.1")]
|
[assembly: AssemblyVersion("1.0.2")]
|
||||||
[assembly: AssemblyFileVersion("1.0.1")]
|
[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.MelonGame(null, "ChilloutVR")]
|
||||||
[assembly: MelonLoader.MelonPlatform(MelonLoader.MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
|
[assembly: MelonLoader.MelonPlatform(MelonLoader.MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
|
||||||
[assembly: MelonLoader.MelonPlatformDomain(MelonLoader.MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
|
[assembly: MelonLoader.MelonPlatformDomain(MelonLoader.MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue