From 3e5535cb72d80e10b28075b92b3ebebd3f7c67d1 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Fri, 9 Dec 2022 21:37:55 +0900 Subject: [PATCH] fix hand rotation --- .../ControlRig/Rigs/XR_FB_body_tracking.cs | 60 ++++++++++--------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/Assets/VRM10/Runtime/Components/Vrm10Runtime/ControlRig/Rigs/XR_FB_body_tracking.cs b/Assets/VRM10/Runtime/Components/Vrm10Runtime/ControlRig/Rigs/XR_FB_body_tracking.cs index 066ef4c27..296cee4e8 100644 --- a/Assets/VRM10/Runtime/Components/Vrm10Runtime/ControlRig/Rigs/XR_FB_body_tracking.cs +++ b/Assets/VRM10/Runtime/Components/Vrm10Runtime/ControlRig/Rigs/XR_FB_body_tracking.cs @@ -27,10 +27,14 @@ namespace UniVRM10 } public static Quaternion Spine = GetRotation(Vector3.forward, Vector3.left); + public static Quaternion Left = GetRotation(Vector3.forward, Vector3.down); - public static Quaternion LeftThumb = GetRotation((Vector3.left + Vector3.forward).normalized, Vector3.up); + public static Quaternion LeftThumb = GetRotation((Vector3.left + Vector3.back).normalized, Vector3.up); + public static Quaternion LeftHand = GetRotation(Vector3.down, Vector3.back); + public static Quaternion Right = GetRotation(Vector3.back, Vector3.up); - public static Quaternion RightThumb = GetRotation((Vector3.left + Vector3.back).normalized, Vector3.down); + public static Quaternion RightThumb = GetRotation((Vector3.left + Vector3.forward).normalized, Vector3.down); + public static Quaternion RightHand = GetRotation(Vector3.up, Vector3.forward); public static IReadOnlyDictionary InitialRotations => new Dictionary() { @@ -43,43 +47,43 @@ namespace UniVRM10 {HumanBodyBones.LeftShoulder, Left}, {HumanBodyBones.LeftUpperArm, Left}, {HumanBodyBones.LeftLowerArm, Left}, - {HumanBodyBones.LeftHand, Left}, {HumanBodyBones.RightShoulder, Right}, {HumanBodyBones.RightUpperArm, Right}, {HumanBodyBones.RightLowerArm, Right}, - {HumanBodyBones.RightHand, Right}, // left + {HumanBodyBones.LeftHand, LeftHand}, {HumanBodyBones.LeftThumbProximal, LeftThumb}, {HumanBodyBones.LeftThumbIntermediate, LeftThumb}, {HumanBodyBones.LeftThumbDistal, LeftThumb}, - {HumanBodyBones.LeftIndexProximal, Left}, - {HumanBodyBones.LeftIndexIntermediate, Left}, - {HumanBodyBones.LeftIndexDistal, Left}, - {HumanBodyBones.LeftMiddleProximal, Left}, - {HumanBodyBones.LeftMiddleIntermediate, Left}, - {HumanBodyBones.LeftMiddleDistal, Left}, - {HumanBodyBones.LeftRingProximal, Left}, - {HumanBodyBones.LeftRingIntermediate, Left}, - {HumanBodyBones.LeftRingDistal, Left}, - {HumanBodyBones.LeftLittleProximal, Left}, - {HumanBodyBones.LeftLittleIntermediate, Left}, - {HumanBodyBones.LeftLittleDistal, Left}, + {HumanBodyBones.LeftIndexProximal, LeftHand}, + {HumanBodyBones.LeftIndexIntermediate, LeftHand}, + {HumanBodyBones.LeftIndexDistal, LeftHand}, + {HumanBodyBones.LeftMiddleProximal, LeftHand}, + {HumanBodyBones.LeftMiddleIntermediate, LeftHand}, + {HumanBodyBones.LeftMiddleDistal, LeftHand}, + {HumanBodyBones.LeftRingProximal, LeftHand}, + {HumanBodyBones.LeftRingIntermediate, LeftHand}, + {HumanBodyBones.LeftRingDistal, LeftHand}, + {HumanBodyBones.LeftLittleProximal, LeftHand}, + {HumanBodyBones.LeftLittleIntermediate, LeftHand}, + {HumanBodyBones.LeftLittleDistal, LeftHand}, // right + {HumanBodyBones.RightHand, RightHand}, {HumanBodyBones.RightThumbProximal, RightThumb}, {HumanBodyBones.RightThumbIntermediate, RightThumb}, {HumanBodyBones.RightThumbDistal, RightThumb}, - {HumanBodyBones.RightIndexProximal, Right}, - {HumanBodyBones.RightIndexIntermediate, Right}, - {HumanBodyBones.RightIndexDistal, Right}, - {HumanBodyBones.RightMiddleProximal, Right}, - {HumanBodyBones.RightMiddleIntermediate, Right}, - {HumanBodyBones.RightMiddleDistal, Right}, - {HumanBodyBones.RightRingProximal, Right}, - {HumanBodyBones.RightRingIntermediate, Right}, - {HumanBodyBones.RightRingDistal, Right}, - {HumanBodyBones.RightLittleProximal, Right}, - {HumanBodyBones.RightLittleIntermediate, Right}, - {HumanBodyBones.RightLittleDistal, Right}, + {HumanBodyBones.RightIndexProximal, RightHand}, + {HumanBodyBones.RightIndexIntermediate, RightHand}, + {HumanBodyBones.RightIndexDistal, RightHand}, + {HumanBodyBones.RightMiddleProximal, RightHand}, + {HumanBodyBones.RightMiddleIntermediate, RightHand}, + {HumanBodyBones.RightMiddleDistal, RightHand}, + {HumanBodyBones.RightRingProximal, RightHand}, + {HumanBodyBones.RightRingIntermediate, RightHand}, + {HumanBodyBones.RightRingDistal, RightHand}, + {HumanBodyBones.RightLittleProximal, RightHand}, + {HumanBodyBones.RightLittleIntermediate, RightHand}, + {HumanBodyBones.RightLittleDistal, RightHand}, }; } } \ No newline at end of file