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

@ -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