mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-04 02:49:23 +00:00
Fix for latest build
This commit is contained in:
parent
24849e25ca
commit
d11bf46f1a
4 changed files with 18 additions and 19 deletions
|
@ -8,5 +8,5 @@ Merged set of MelonLoader mods for ChilloutVR.
|
||||||
| Desktop Head Tracking | ml_dht | 1.0.3 | On review | Working |
|
| Desktop Head Tracking | ml_dht | 1.0.3 | On review | Working |
|
||||||
| 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.7 | On review | Working |
|
| Four Point Tracking | ml_fpt | 1.0.7 | On review | Working |
|
||||||
| Leap Motion Extension | ml_lme | 1.1.8 | Yes | Working partially | No tracking in VR |
|
| Leap Motion Extension | ml_lme | 1.1.9 | On review | Working |
|
||||||
| Server Connection Info | ml_sci | 1.0.1 | Yes | Working |
|
| Server Connection Info | ml_sci | 1.0.1 | Yes | Working |
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using ABI_RC.Core.Player;
|
using ABI_RC.Core.Player;
|
||||||
using ABI_RC.Core.Savior;
|
using ABI_RC.Core.Savior;
|
||||||
|
using ABI_RC.Systems.IK;
|
||||||
using RootMotion.FinalIK;
|
using RootMotion.FinalIK;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
@ -8,11 +9,10 @@ namespace ml_lme
|
||||||
[DisallowMultipleComponent]
|
[DisallowMultipleComponent]
|
||||||
class LeapTracked : MonoBehaviour
|
class LeapTracked : MonoBehaviour
|
||||||
{
|
{
|
||||||
static readonly Quaternion ms_offsetLeft = Quaternion.Euler(0f, 90f, 330f);
|
static readonly Quaternion ms_offsetLeft = Quaternion.Euler(0f, 0f, 270f);
|
||||||
static readonly Quaternion ms_offsetRight = Quaternion.Euler(0f, 270f, 30f);
|
static readonly Quaternion ms_offsetRight = Quaternion.Euler(0f, 0f, 90f);
|
||||||
|
|
||||||
IndexIK m_indexIK = null;
|
IndexIK m_indexIK = null;
|
||||||
CVR_IK_Calibrator m_ikCalibrator = null;
|
|
||||||
VRIK m_vrIK = null;
|
VRIK m_vrIK = null;
|
||||||
|
|
||||||
bool m_enabled = true;
|
bool m_enabled = true;
|
||||||
|
@ -29,7 +29,6 @@ namespace ml_lme
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
m_indexIK = this.GetComponent<IndexIK>();
|
m_indexIK = this.GetComponent<IndexIK>();
|
||||||
m_ikCalibrator = this.GetComponent<CVR_IK_Calibrator>();
|
|
||||||
|
|
||||||
if(m_leftHand != null)
|
if(m_leftHand != null)
|
||||||
{
|
{
|
||||||
|
@ -133,7 +132,7 @@ namespace ml_lme
|
||||||
}
|
}
|
||||||
if(!p_gesturesData.m_handsPresenses[0] && m_leftTargetActive)
|
if(!p_gesturesData.m_handsPresenses[0] && m_leftTargetActive)
|
||||||
{
|
{
|
||||||
m_vrIK.solver.leftArm.target = m_ikCalibrator.leftHandAnchor;
|
m_vrIK.solver.leftArm.target = IKSystem.Instance.leftHandAnchor;
|
||||||
m_leftTargetActive = false;
|
m_leftTargetActive = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,7 +143,7 @@ namespace ml_lme
|
||||||
}
|
}
|
||||||
if(!p_gesturesData.m_handsPresenses[1] && m_rightTargetActive)
|
if(!p_gesturesData.m_handsPresenses[1] && m_rightTargetActive)
|
||||||
{
|
{
|
||||||
m_vrIK.solver.rightArm.target = m_ikCalibrator.rightHandAnchor;
|
m_vrIK.solver.rightArm.target = IKSystem.Instance.rightHandAnchor;
|
||||||
m_rightTargetActive = false;
|
m_rightTargetActive = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -159,7 +158,7 @@ namespace ml_lme
|
||||||
m_rightTargetActive = false;
|
m_rightTargetActive = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnSetupAvatarGeneral()
|
public void OnCalibrateAvatar()
|
||||||
{
|
{
|
||||||
m_vrIK = PlayerSetup.Instance._animator.GetComponent<VRIK>();
|
m_vrIK = PlayerSetup.Instance._animator.GetComponent<VRIK>();
|
||||||
|
|
||||||
|
@ -217,16 +216,16 @@ namespace ml_lme
|
||||||
|
|
||||||
void RestoreIK()
|
void RestoreIK()
|
||||||
{
|
{
|
||||||
if((m_ikCalibrator != null) && (m_vrIK != null))
|
if(m_vrIK != null)
|
||||||
{
|
{
|
||||||
if(m_leftTargetActive)
|
if(m_leftTargetActive)
|
||||||
{
|
{
|
||||||
m_vrIK.solver.leftArm.target = m_ikCalibrator.leftHandAnchor;
|
m_vrIK.solver.leftArm.target = IKSystem.Instance.leftHandAnchor;
|
||||||
m_leftTargetActive = false;
|
m_leftTargetActive = false;
|
||||||
}
|
}
|
||||||
if(m_rightTargetActive)
|
if(m_rightTargetActive)
|
||||||
{
|
{
|
||||||
m_vrIK.solver.rightArm.target = m_ikCalibrator.rightHandAnchor;
|
m_vrIK.solver.rightArm.target = IKSystem.Instance.rightHandAnchor;
|
||||||
m_rightTargetActive = false;
|
m_rightTargetActive = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,9 +54,9 @@ namespace ml_lme
|
||||||
new HarmonyLib.HarmonyMethod(typeof(LeapMotionExtension).GetMethod(nameof(OnAvatarClear_Postfix), System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic))
|
new HarmonyLib.HarmonyMethod(typeof(LeapMotionExtension).GetMethod(nameof(OnAvatarClear_Postfix), System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic))
|
||||||
);
|
);
|
||||||
HarmonyInstance.Patch(
|
HarmonyInstance.Patch(
|
||||||
typeof(PlayerSetup).GetMethod("SetupAvatarGeneral", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic),
|
typeof(PlayerSetup).GetMethod(nameof(PlayerSetup.CalibrateAvatar)),
|
||||||
null,
|
null,
|
||||||
new HarmonyLib.HarmonyMethod(typeof(LeapMotionExtension).GetMethod(nameof(OnSetupAvatarGeneral_Postfix), System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic))
|
new HarmonyLib.HarmonyMethod(typeof(LeapMotionExtension).GetMethod(nameof(OnCalibrateAvatar_Postfix), System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@ -329,13 +329,13 @@ namespace ml_lme
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sneaky forced IndexIK calibration
|
// Sneaky forced IndexIK calibration
|
||||||
static void OnSetupAvatarGeneral_Postfix() => ms_instance?.OnSetupAvatarGeneral();
|
static void OnCalibrateAvatar_Postfix() => ms_instance?.OnCalibrateAvatar();
|
||||||
void OnSetupAvatarGeneral()
|
void OnCalibrateAvatar()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if(m_leapTracked != null)
|
if(m_leapTracked != null)
|
||||||
m_leapTracked.OnSetupAvatarGeneral();
|
m_leapTracked.OnCalibrateAvatar();
|
||||||
|
|
||||||
OnSettingsHeadAttachChange(Settings.HeadAttach);
|
OnSettingsHeadAttachChange(Settings.HeadAttach);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
[assembly: AssemblyTitle("LeapMotionExtension")]
|
[assembly: AssemblyTitle("LeapMotionExtension")]
|
||||||
[assembly: AssemblyVersion("1.1.8")]
|
[assembly: AssemblyVersion("1.1.9")]
|
||||||
[assembly: AssemblyFileVersion("1.1.8")]
|
[assembly: AssemblyFileVersion("1.1.9")]
|
||||||
|
|
||||||
[assembly: MelonLoader.MelonInfo(typeof(ml_lme.LeapMotionExtension), "LeapMotionExtension", "1.1.8", "SDraw", "https://github.com/SDraw/ml_mods_cvr")]
|
[assembly: MelonLoader.MelonInfo(typeof(ml_lme.LeapMotionExtension), "LeapMotionExtension", "1.1.9", "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)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue