Avatars position fix

This commit is contained in:
SDraw 2022-12-27 00:12:29 +03:00
parent 551e1a577f
commit 027e6c29cd
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
3 changed files with 16 additions and 4 deletions

View file

@ -8,5 +8,5 @@ Merged set of MelonLoader mods for ChilloutVR.
| Desktop Head Tracking | ml_dht | 1.1.1 | Yes | Working |
| Desktop Reticle Switch | ml_drs | 1.0.0 | Yes | Working |
| Four Point Tracking | ml_fpt | 1.0.9 | Retired | Deprecated | In-game feature since 2022r170 update
| Leap Motion Extension | ml_lme | 1.2.8 | Yes | Working |
| Leap Motion Extension | ml_lme | 1.2.9 | Yes, pending review | Working |
| Server Connection Info | ml_sci | 1.0.2 | Yes | Working |

View file

@ -23,6 +23,8 @@ namespace ml_lme
bool m_isInVR = false;
Transform m_origElbowLeft = null;
Transform m_origElbowRight = null;
Transform m_hips = null;
Vector3 m_hipsLocal = Vector3.zero;
bool m_enabled = true;
bool m_fingersOnly = false;
@ -204,9 +206,15 @@ namespace ml_lme
{
if(m_enabled && !m_isInVR && (m_poseHandler != null))
{
if(m_hips != null)
m_hipsLocal = m_hips.localPosition;
m_poseHandler.GetHumanPose(ref m_pose);
UpdateFingers(p_data);
m_poseHandler.SetHumanPose(ref m_pose);
if(m_hips != null)
m_hips.localPosition = m_hipsLocal;
}
}
@ -274,6 +282,8 @@ namespace ml_lme
m_vrIK = null;
m_origElbowLeft = null;
m_origElbowRight = null;
m_hips = null;
m_hipsLocal = Vector3.zero;
m_armsWeights = Vector2.zero;
m_leftIK = null;
m_rightIK = null;
@ -299,6 +309,8 @@ namespace ml_lme
if(PlayerSetup.Instance._animator.isHuman)
{
m_hips = PlayerSetup.Instance._animator.GetBoneTransform(HumanBodyBones.Hips);
if(!m_isInVR)
{
// Force desktop avatar into T-Pose

View file

@ -1,10 +1,10 @@
using System.Reflection;
[assembly: AssemblyTitle("LeapMotionExtension")]
[assembly: AssemblyVersion("1.2.8")]
[assembly: AssemblyFileVersion("1.2.8")]
[assembly: AssemblyVersion("1.2.9")]
[assembly: AssemblyFileVersion("1.2.9")]
[assembly: MelonLoader.MelonInfo(typeof(ml_lme.LeapMotionExtension), "LeapMotionExtension", "1.2.8", "SDraw", "https://github.com/SDraw/ml_mods_cvr")]
[assembly: MelonLoader.MelonInfo(typeof(ml_lme.LeapMotionExtension), "LeapMotionExtension", "1.2.9", "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)]