diff --git a/README.md b/README.md index 4232ca8..8f6fcff 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ Merged set of MelonLoader mods for ChilloutVR. | Full name | Short name | Latest version | Available in [CVRMA](https://github.com/knah/CVRMelonAssistant) | Current Status | Notes | |-----------|------------|----------------|-----------------------------------------------------------------|----------------|-------| | Avatar Change Info | ml_aci | 1.0.1 | Yes | Working | -| Avatar Motion Tweaker | ml_amt | 1.0.3 | Yes | Working | +| Avatar Motion Tweaker | ml_amt | 1.0.5 | Yes, 1.0.3 | Working | FBT autostep problem | | Desktop Reticle Switch | ml_drs | 1.0.0 | Yes | Working | | Four Point Tracking | ml_fpt | 1.0.2 | Yes | Working | -| Leap Motion Extension | ml_lme | 1.1.5 | Yes | Working | +| Leap Motion Extension | ml_lme | 1.1.7 | Pending | Working | | Server Connection Info | ml_sci | 1.0.1 | Yes | Working | diff --git a/ml_amt/Properties/AssemblyInfo.cs b/ml_amt/Properties/AssemblyInfo.cs index 3429308..5338db4 100644 --- a/ml_amt/Properties/AssemblyInfo.cs +++ b/ml_amt/Properties/AssemblyInfo.cs @@ -1,10 +1,10 @@ using System.Reflection; [assembly: AssemblyTitle("AvatarMotionTweaker")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.5")] +[assembly: AssemblyFileVersion("1.0.5")] -[assembly: MelonLoader.MelonInfo(typeof(ml_amt.AvatarMotionTweaker), "AvatarMotionTweaker", "1.0.3", "SDraw", "https://github.com/SDraw/ml_mods_cvr")] +[assembly: MelonLoader.MelonInfo(typeof(ml_amt.AvatarMotionTweaker), "AvatarMotionTweaker", "1.0.5", "SDraw", "https://github.com/SDraw/ml_mods_cvr")] [assembly: MelonLoader.MelonGame(null, "ChilloutVR")] [assembly: MelonLoader.MelonPlatform(MelonLoader.MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)] [assembly: MelonLoader.MelonPlatformDomain(MelonLoader.MelonPlatformDomainAttribute.CompatibleDomains.MONO)] \ No newline at end of file diff --git a/ml_amt/README.md b/ml_amt/README.md index 6da4be3..e9e2b45 100644 --- a/ml_amt/README.md +++ b/ml_amt/README.md @@ -16,6 +16,9 @@ Available mod's settings in `Settings - Implementation - Avatar Motion Tweaker`: Available additional parameters for AAS animator: * **`Upright`:** defines linear coefficient between current viewpoint height and avatar's viewpoint height. Range - [0.0,1.0] (0.0 - floor, 1.0 - full standing). * Note: can be set as local-only (not synced) if starts with `#` character. + +Additional avatars tweaks: +* If avatar has child object with name `LocomotionOffset` its local position will be used for offsetting VRIK locomotion center. ## Example of usage in AAS animator for mixed desktop and VR * To differentiate between desktop and VR players use `CVR Parameter Stream` component on avatar's root gameobject. As example, `InVR` and `InFBT` are boolean typed animator parameters: diff --git a/ml_lme/LeapTracked.cs b/ml_lme/LeapTracked.cs index 138df39..fe1fc12 100644 --- a/ml_lme/LeapTracked.cs +++ b/ml_lme/LeapTracked.cs @@ -1,6 +1,5 @@ using ABI_RC.Core.Player; using ABI_RC.Core.Savior; -using RootMotion.FinalIK; using UnityEngine; namespace ml_lme @@ -8,12 +7,11 @@ namespace ml_lme [DisallowMultipleComponent] class LeapTracked : MonoBehaviour { + IndexIK m_indexIK = null; + bool m_enabled = true; bool m_fingersOnly = false; - IndexIK m_indexIK = null; - VRIK m_vrIK = null; - LeapIK m_leapIK = null; Transform m_leftHand = null; Transform m_rightHand = null; @@ -49,9 +47,6 @@ namespace ml_lme { m_leftHand = p_left; m_rightHand = p_right; - - if(m_leapIK != null) - m_leapIK.SetHands(m_leftHand, m_rightHand); } public void UpdateTracking(GestureMatcher.GesturesData p_gesturesData) @@ -99,62 +94,25 @@ namespace ml_lme } } - public void UpdateTrackingLate(GestureMatcher.GesturesData p_gesturesData) - { - if(m_enabled && !m_fingersOnly && (m_vrIK != null) && m_vrIK.enabled) - { - if(p_gesturesData.m_handsPresenses[0]) - { - IKSolverVR.Arm l_arm = m_vrIK.solver?.leftArm; - if(l_arm?.target != null) - { - if(l_arm.positionWeight < 1f) - l_arm.positionWeight = 1f; - l_arm.target.position = p_gesturesData.m_handsPositons[0]; - - if(l_arm.rotationWeight < 1f) - l_arm.rotationWeight = 1f; - l_arm.target.rotation = p_gesturesData.m_handsRotations[0]; - } - } - - if(p_gesturesData.m_handsPresenses[1]) - { - IKSolverVR.Arm l_arm = m_vrIK.solver?.rightArm; - if(l_arm?.target != null) - { - if(l_arm.positionWeight < 1f) - l_arm.positionWeight = 1f; - l_arm.target.position = p_gesturesData.m_handsPositons[1]; - - if(l_arm.rotationWeight < 1f) - l_arm.rotationWeight = 1f; - l_arm.target.rotation = p_gesturesData.m_handsRotations[1]; - } - } - } - } - public void OnAvatarClear() { m_leapIK = null; - m_vrIK = null; } public void OnSetupAvatarGeneral() { if(m_indexIK != null) + { m_indexIK.activeControl = (m_enabled || Utils.AreKnucklesInUse()); - CVRInputManager.Instance.individualFingerTracking = (m_enabled || Utils.AreKnucklesInUse()); - - m_vrIK = PlayerSetup.Instance._animator.GetComponent(); + CVRInputManager.Instance.individualFingerTracking = (m_enabled || Utils.AreKnucklesInUse()); + } if(!PlayerSetup.Instance._inVr) { m_leapIK = PlayerSetup.Instance._animator.gameObject.AddComponent(); + m_leapIK.SetHands(m_leftHand, m_rightHand); m_leapIK.SetEnabled(m_enabled); m_leapIK.SetFingersOnly(m_fingersOnly); - m_leapIK.SetHands(m_leftHand, m_rightHand); } } } diff --git a/ml_lme/Main.cs b/ml_lme/Main.cs index 9a049c3..8f5822e 100644 --- a/ml_lme/Main.cs +++ b/ml_lme/Main.cs @@ -144,12 +144,6 @@ namespace ml_lme } } - public override void OnLateUpdate() - { - if(ms_vrState && Settings.Enabled && (m_leapTracked != null)) - m_leapTracked.UpdateTrackingLate(m_gesturesData); - } - // Settings changes void OnSettingsEnableChange(bool p_state) { diff --git a/ml_lme/Properties/AssemblyInfo.cs b/ml_lme/Properties/AssemblyInfo.cs index 3590c40..cb490f2 100644 --- a/ml_lme/Properties/AssemblyInfo.cs +++ b/ml_lme/Properties/AssemblyInfo.cs @@ -1,10 +1,10 @@ using System.Reflection; [assembly: AssemblyTitle("LeapMotionExtension")] -[assembly: AssemblyVersion("1.1.5")] -[assembly: AssemblyFileVersion("1.1.5")] +[assembly: AssemblyVersion("1.1.7")] +[assembly: AssemblyFileVersion("1.1.7")] -[assembly: MelonLoader.MelonInfo(typeof(ml_lme.LeapMotionExtension), "LeapMotionExtension", "1.1.5", "SDraw", "https://github.com/SDraw/ml_mods_cvr")] +[assembly: MelonLoader.MelonInfo(typeof(ml_lme.LeapMotionExtension), "LeapMotionExtension", "1.1.7", "SDraw", "https://github.com/SDraw/ml_mods_cvr")] [assembly: MelonLoader.MelonGame(null, "ChilloutVR")] [assembly: MelonLoader.MelonPlatform(MelonLoader.MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)] [assembly: MelonLoader.MelonPlatformDomain(MelonLoader.MelonPlatformDomainAttribute.CompatibleDomains.MONO)] diff --git a/ml_lme/README.md b/ml_lme/README.md index 652700e..5ffb83f 100644 --- a/ml_lme/README.md +++ b/ml_lme/README.md @@ -20,3 +20,6 @@ Available mod's settings in `Settings - Implementation - Leap Motion Tracking`: * **Offset angle:** rotation around X axis, useful for neck mounts, 0 by default. * **Fingers tracking only:** apply only fingers tracking, disabled by default. * **Model visibility:** show Leap Motion controller model, useful for tracking visualizing, disabled by default. + +# Notes +* Only fingers tracking in VR mode.