Add gesture recognition setting

Also fixed attachmentDistance by setting it to 0f.
This commit is contained in:
NotAKidoS 2023-07-17 09:00:33 -05:00
parent c9162a766f
commit c6506727ab
3 changed files with 136 additions and 5 deletions

View file

@ -33,6 +33,7 @@ namespace ml_lme
HeadZ,
TrackElbows,
Input,
Gestures,
InteractThreadhold,
GripThreadhold,
VisualHands
@ -48,6 +49,7 @@ namespace ml_lme
public static Vector3 HeadOffset { get; private set; } = new Vector3(0f, -0.3f, 0.15f);
public static bool TrackElbows { get; private set; } = true;
public static bool Input { get; private set; } = true;
public static bool Gestures { get; private set; } = false;
public static float InteractThreadhold { get; private set; } = 0.8f;
public static float GripThreadhold { get; private set; } = 0.4f;
public static bool VisualHands { get; private set; } = false;
@ -65,6 +67,7 @@ namespace ml_lme
static public event Action<Vector3> HeadOffsetChange;
static public event Action<bool> TrackElbowsChange;
static public event Action<bool> InputChange;
static public event Action<bool> GesturesChange;
static public event Action<float> InteractThreadholdChange;
static public event Action<float> GripThreadholdChange;
static public event Action<bool> VisualHandsChange;
@ -91,6 +94,7 @@ namespace ml_lme
ms_category.CreateEntry(ModSetting.HeadZ.ToString(), (int)(HeadOffset.z * 100f)),
ms_category.CreateEntry(ModSetting.TrackElbows.ToString(), TrackElbows),
ms_category.CreateEntry(ModSetting.Input.ToString(), Input),
ms_category.CreateEntry(ModSetting.Gestures.ToString(), Gestures),
ms_category.CreateEntry(ModSetting.InteractThreadhold.ToString(), (int)(InteractThreadhold * 100f)),
ms_category.CreateEntry(ModSetting.GripThreadhold.ToString(), (int)(GripThreadhold * 100f)),
ms_category.CreateEntry(ModSetting.VisualHands.ToString(), VisualHands)
@ -148,6 +152,7 @@ namespace ml_lme
) * 0.01f;
TrackElbows = (bool)ms_entries[(int)ModSetting.TrackElbows].BoxedValue;
Input = (bool)ms_entries[(int)ModSetting.Input].BoxedValue;
Gestures = (bool)ms_entries[(int)ModSetting.Gestures].BoxedValue;
InteractThreadhold = (int)ms_entries[(int)ModSetting.InteractThreadhold].BoxedValue * 0.01f;
GripThreadhold = (int)ms_entries[(int)ModSetting.GripThreadhold].BoxedValue * 0.01f;
VisualHands = (bool)ms_entries[(int)ModSetting.VisualHands].BoxedValue;
@ -201,6 +206,13 @@ namespace ml_lme
}
break;
case ModSetting.Gestures:
{
Gestures = bool.Parse(p_value);
GesturesChange?.Invoke(Gestures);
}
break;
case ModSetting.VisualHands:
{
VisualHands = bool.Parse(p_value);