diff --git a/Assets/Scripts/Avatar/MotionTracking/IKManager.cs b/Assets/Scripts/Avatar/MotionTracking/IKManager.cs index d0f5cf35..031b83e2 100644 --- a/Assets/Scripts/Avatar/MotionTracking/IKManager.cs +++ b/Assets/Scripts/Avatar/MotionTracking/IKManager.cs @@ -265,6 +265,11 @@ public void ModelInitialize() { wristRotationFix.SetVRIK(vrik); + animator.GetBoneTransform(HumanBodyBones.LeftLowerArm).eulerAngles = new Vector3(LeftLowerArmAngle, 0, 0); + animator.GetBoneTransform(HumanBodyBones.RightLowerArm).eulerAngles = new Vector3(RightLowerArmAngle, 0, 0); + animator.GetBoneTransform(HumanBodyBones.LeftUpperArm).eulerAngles = new Vector3(LeftUpperArmAngle, 0, 0); + animator.GetBoneTransform(HumanBodyBones.RightUpperArm).eulerAngles = new Vector3(RightUpperArmAngle, 0, 0); + HandController.SetDefaultAngle(animator); //初期の指を自然に閉じたポーズにする @@ -402,7 +407,7 @@ private void SetVRIK(VirtualAvatar virtualAvatar) FixArmDirection(virtualAvatar); } - vrik = virtualAvatar.AddComponent(); + vrik = virtualAvatar.AddComponent(); virtualAvatar.AddComponent(); vrik.AutoDetectReferences(); @@ -703,6 +708,12 @@ public IEnumerator Calibrate(PipeCommands.CalibrateType calibrateType) yield break; } + animator.GetBoneTransform(HumanBodyBones.LeftLowerArm).localEulerAngles = new Vector3(0, 0, 0); + animator.GetBoneTransform(HumanBodyBones.RightLowerArm).localEulerAngles = new Vector3(0, 0, 0); + animator.GetBoneTransform(HumanBodyBones.LeftUpperArm).localEulerAngles = new Vector3(0, 0, 0); + animator.GetBoneTransform(HumanBodyBones.RightUpperArm).localEulerAngles = new Vector3(0, 0, 0); + animator.GetBoneTransform(HumanBodyBones.LeftHand).localEulerAngles = new Vector3(0, 0, 0); + animator.GetBoneTransform(HumanBodyBones.RightHand).localEulerAngles = new Vector3(0, 0, 0); SetVRIK(virtualAvatar); wristRotationFix.SetVRIK(vrik); diff --git a/Assets/Scripts/Avatar/MotionTracking/MotionManager.cs b/Assets/Scripts/Avatar/MotionTracking/MotionManager.cs index f82486da..d3d63cec 100644 --- a/Assets/Scripts/Avatar/MotionTracking/MotionManager.cs +++ b/Assets/Scripts/Avatar/MotionTracking/MotionManager.cs @@ -17,6 +17,7 @@ public class MotionManager : MonoBehaviour private VRIK vrik; private IKSolver ikSolver; + [SerializeField] private List VirtualAvatars = new List(); private static MotionManager instance; diff --git a/Assets/Scripts/Avatar/MotionTracking/VirtualAvatar.cs b/Assets/Scripts/Avatar/MotionTracking/VirtualAvatar.cs index b8bd7444..ea8abd32 100644 --- a/Assets/Scripts/Avatar/MotionTracking/VirtualAvatar.cs +++ b/Assets/Scripts/Avatar/MotionTracking/VirtualAvatar.cs @@ -7,6 +7,7 @@ namespace VMC { + [Serializable] public class VirtualAvatar { private Transform parent;