diff --git a/Assets/Behaviours/BoneBehaviour.cs b/Assets/Behaviours/BoneBehaviour.cs index 5d5dbcd..d86b700 100644 --- a/Assets/Behaviours/BoneBehaviour.cs +++ b/Assets/Behaviours/BoneBehaviour.cs @@ -65,17 +65,12 @@ private void HipUpdate() private void RShoulderUpdate() { + var direction = _transforms[PoseLandmarkType.RightElbow] + - _transforms[PoseLandmarkType.RightShoulder]; + var absolutelyRotation = Quaternion.LookRotation(direction); - var relativeRot = _transforms[PoseLandmarkType.RightElbow] - _transforms[PoseLandmarkType.RightShoulder]; - relativeRot.Normalize(); - - var hipRot = _animator.GetBoneTransform(HumanBodyBones.Hips).rotation; - hipRot.Normalize(); - - var interal = Quaternion.FromToRotation(relativeRot, hipRot.eulerAngles); - interal.Normalize(); - - _animator.GetBoneTransform(HumanBodyBones.RightUpperArm).rotation = interal; //Quaternion.LookRotation(relativeRot + hipRot); + _animator.GetBoneTransform(HumanBodyBones.RightUpperArm).rotation + = absolutelyRotation * Quaternion.Inverse(_animator.GetBoneTransform(HumanBodyBones.Hips).rotation); }