[EzCurls] Added EntryOnlySmoothNearbyCurl test option

This commit is contained in:
NotAKidoS 2023-07-10 10:02:22 -05:00
parent 623df261b0
commit 6fc809692d
2 changed files with 38 additions and 12 deletions

View file

@ -16,6 +16,7 @@ internal class InputModuleCurlAdjuster : CVRInputModule
// Curl smoothing/averaging
public bool UseCurlSmoothing = false;
public bool DontSmoothExtremes = true;
public bool OnlySmoothNearbyCurl = false;
public float CurlSimilarityThreshold = 0.5f;
public float CurlSmoothingFactor = 0.5f;
@ -36,19 +37,38 @@ internal class InputModuleCurlAdjuster : CVRInputModule
if (UseCurlSmoothing)
{
SmoothCurls(
ref _inputManager.fingerCurlLeftIndex,
ref _inputManager.fingerCurlLeftMiddle,
ref _inputManager.fingerCurlLeftRing,
ref _inputManager.fingerCurlLeftPinky
);
if (OnlySmoothNearbyCurl)
{
SmoothCurlsNear(
ref _inputManager.fingerCurlLeftIndex,
ref _inputManager.fingerCurlLeftMiddle,
ref _inputManager.fingerCurlLeftRing,
ref _inputManager.fingerCurlLeftPinky
);
SmoothCurls(
ref _inputManager.fingerCurlRightIndex,
ref _inputManager.fingerCurlRightMiddle,
ref _inputManager.fingerCurlRightRing,
ref _inputManager.fingerCurlRightPinky
);
SmoothCurlsNear(
ref _inputManager.fingerCurlRightIndex,
ref _inputManager.fingerCurlRightMiddle,
ref _inputManager.fingerCurlRightRing,
ref _inputManager.fingerCurlRightPinky
);
}
else
{
SmoothCurls(
ref _inputManager.fingerCurlLeftIndex,
ref _inputManager.fingerCurlLeftMiddle,
ref _inputManager.fingerCurlLeftRing,
ref _inputManager.fingerCurlLeftPinky
);
SmoothCurls(
ref _inputManager.fingerCurlRightIndex,
ref _inputManager.fingerCurlRightMiddle,
ref _inputManager.fingerCurlRightRing,
ref _inputManager.fingerCurlRightPinky
);
}
}
if (UseCurlSnapping)

View file

@ -31,6 +31,11 @@ public class EzCurls : MelonMod
Category.CreateEntry("UseCurlSmoothing", false,
description: "Finger curl smoothing to average out similar finger positions.");
public static readonly MelonPreferences_Entry<bool> EntryOnlySmoothNearbyCurl =
Category.CreateEntry("OnlySmoothNearbyCurl", false,
description: "Should the curl smoothing only influence the nearest curl?");
public static readonly MelonPreferences_Entry<bool> EntryDontSmoothExtremes =
Category.CreateEntry("DontSmoothExtremes", true,
description: "Should the finger curl smoothing be less effective on curls towards 0 or 1?");
@ -67,6 +72,7 @@ public class EzCurls : MelonMod
// curl smoothing
InputModuleCurlAdjuster.Instance.UseCurlSmoothing = EntryUseCurlSmoothing.Value;
InputModuleCurlAdjuster.Instance.OnlySmoothNearbyCurl = EntryOnlySmoothNearbyCurl.Value;
InputModuleCurlAdjuster.Instance.DontSmoothExtremes = EntryDontSmoothExtremes.Value;
InputModuleCurlAdjuster.Instance.CurlSimilarityThreshold = EntryCurlSimilarityThreshold.Value;
InputModuleCurlAdjuster.Instance.CurlSmoothingFactor = EntryCurlSmoothingFactor.Value;