mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-04 02:49:23 +00:00
Only fingers tracking for VR mode
This commit is contained in:
parent
0794564563
commit
f61e1b20c5
7 changed files with 20 additions and 62 deletions
|
@ -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 |
|
| 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 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 |
|
| Desktop Reticle Switch | ml_drs | 1.0.0 | Yes | Working |
|
||||||
| Four Point Tracking | ml_fpt | 1.0.2 | 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 |
|
| Server Connection Info | ml_sci | 1.0.1 | Yes | Working |
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
[assembly: AssemblyTitle("AvatarMotionTweaker")]
|
[assembly: AssemblyTitle("AvatarMotionTweaker")]
|
||||||
[assembly: AssemblyVersion("1.0.3")]
|
[assembly: AssemblyVersion("1.0.5")]
|
||||||
[assembly: AssemblyFileVersion("1.0.3")]
|
[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.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)]
|
|
@ -16,6 +16,9 @@ Available mod's settings in `Settings - Implementation - Avatar Motion Tweaker`:
|
||||||
Available additional parameters for AAS animator:
|
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).
|
* **`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.
|
* 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
|
## 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:
|
* 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:
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
using ABI_RC.Core.Player;
|
using ABI_RC.Core.Player;
|
||||||
using ABI_RC.Core.Savior;
|
using ABI_RC.Core.Savior;
|
||||||
using RootMotion.FinalIK;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace ml_lme
|
namespace ml_lme
|
||||||
|
@ -8,12 +7,11 @@ namespace ml_lme
|
||||||
[DisallowMultipleComponent]
|
[DisallowMultipleComponent]
|
||||||
class LeapTracked : MonoBehaviour
|
class LeapTracked : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
IndexIK m_indexIK = null;
|
||||||
|
|
||||||
bool m_enabled = true;
|
bool m_enabled = true;
|
||||||
bool m_fingersOnly = false;
|
bool m_fingersOnly = false;
|
||||||
|
|
||||||
IndexIK m_indexIK = null;
|
|
||||||
VRIK m_vrIK = null;
|
|
||||||
|
|
||||||
LeapIK m_leapIK = null;
|
LeapIK m_leapIK = null;
|
||||||
Transform m_leftHand = null;
|
Transform m_leftHand = null;
|
||||||
Transform m_rightHand = null;
|
Transform m_rightHand = null;
|
||||||
|
@ -49,9 +47,6 @@ namespace ml_lme
|
||||||
{
|
{
|
||||||
m_leftHand = p_left;
|
m_leftHand = p_left;
|
||||||
m_rightHand = p_right;
|
m_rightHand = p_right;
|
||||||
|
|
||||||
if(m_leapIK != null)
|
|
||||||
m_leapIK.SetHands(m_leftHand, m_rightHand);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateTracking(GestureMatcher.GesturesData p_gesturesData)
|
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()
|
public void OnAvatarClear()
|
||||||
{
|
{
|
||||||
m_leapIK = null;
|
m_leapIK = null;
|
||||||
m_vrIK = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnSetupAvatarGeneral()
|
public void OnSetupAvatarGeneral()
|
||||||
{
|
{
|
||||||
if(m_indexIK != null)
|
if(m_indexIK != null)
|
||||||
|
{
|
||||||
m_indexIK.activeControl = (m_enabled || Utils.AreKnucklesInUse());
|
m_indexIK.activeControl = (m_enabled || Utils.AreKnucklesInUse());
|
||||||
CVRInputManager.Instance.individualFingerTracking = (m_enabled || Utils.AreKnucklesInUse());
|
CVRInputManager.Instance.individualFingerTracking = (m_enabled || Utils.AreKnucklesInUse());
|
||||||
|
}
|
||||||
m_vrIK = PlayerSetup.Instance._animator.GetComponent<VRIK>();
|
|
||||||
|
|
||||||
if(!PlayerSetup.Instance._inVr)
|
if(!PlayerSetup.Instance._inVr)
|
||||||
{
|
{
|
||||||
m_leapIK = PlayerSetup.Instance._animator.gameObject.AddComponent<LeapIK>();
|
m_leapIK = PlayerSetup.Instance._animator.gameObject.AddComponent<LeapIK>();
|
||||||
|
m_leapIK.SetHands(m_leftHand, m_rightHand);
|
||||||
m_leapIK.SetEnabled(m_enabled);
|
m_leapIK.SetEnabled(m_enabled);
|
||||||
m_leapIK.SetFingersOnly(m_fingersOnly);
|
m_leapIK.SetFingersOnly(m_fingersOnly);
|
||||||
m_leapIK.SetHands(m_leftHand, m_rightHand);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
// Settings changes
|
||||||
void OnSettingsEnableChange(bool p_state)
|
void OnSettingsEnableChange(bool p_state)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
[assembly: AssemblyTitle("LeapMotionExtension")]
|
[assembly: AssemblyTitle("LeapMotionExtension")]
|
||||||
[assembly: AssemblyVersion("1.1.5")]
|
[assembly: AssemblyVersion("1.1.7")]
|
||||||
[assembly: AssemblyFileVersion("1.1.5")]
|
[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.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)]
|
||||||
|
|
|
@ -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.
|
* **Offset angle:** rotation around X axis, useful for neck mounts, 0 by default.
|
||||||
* **Fingers tracking only:** apply only fingers tracking, disabled 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.
|
* **Model visibility:** show Leap Motion controller model, useful for tracking visualizing, disabled by default.
|
||||||
|
|
||||||
|
# Notes
|
||||||
|
* Only fingers tracking in VR mode.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue