From 411db43ad7f0b4c2d7fbd3ac5790d13a91df6443 Mon Sep 17 00:00:00 2001 From: Masataka SUMI Date: Tue, 6 Sep 2022 19:43:59 +0900 Subject: [PATCH] remove unused --- .../ControlRig/Vrm10ControlBone.cs | 30 ++++++++----------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/Assets/VRM10/Runtime/Components/Vrm10Runtime/ControlRig/Vrm10ControlBone.cs b/Assets/VRM10/Runtime/Components/Vrm10Runtime/ControlRig/Vrm10ControlBone.cs index 0506752b7..f6b441c5c 100644 --- a/Assets/VRM10/Runtime/Components/Vrm10Runtime/ControlRig/Vrm10ControlBone.cs +++ b/Assets/VRM10/Runtime/Components/Vrm10Runtime/ControlRig/Vrm10ControlBone.cs @@ -54,6 +54,18 @@ namespace UniVRM10 _initialTargetGlobalRotation = controlTarget.rotation; } + /// + /// 親から再帰的にNormalized の ローカル回転を初期回転を加味して Target に適用する。 + /// + internal void ProcessRecursively() + { + ControlTarget.localRotation = _initialTargetLocalRotation * Quaternion.Inverse(_initialTargetGlobalRotation) * ControlBone.localRotation * _initialTargetGlobalRotation; + foreach (var child in _children) + { + child.ProcessRecursively(); + } + } + public static Vrm10ControlBone Build(UniHumanoid.Humanoid humanoid, Dictionary boneMap) { var hips = new Vrm10ControlBone(humanoid.Hips, HumanBodyBones.Hips); @@ -71,12 +83,6 @@ namespace UniVRM10 { if (humanoid.TryGetBoneForTransform(current, out var bone)) { - - // ヒューマンボーンだけを対象にするので、 - // parent が current の直接の親でない場合がある。 - // ワールド回転 parent^-1 * current からローカル回転を算出する。 - var parentInverse = Quaternion.Inverse(parent.ControlTarget.rotation); - var newBone = new Vrm10ControlBone(current, bone); newBone.ControlBone.SetParent(parent.ControlBone, true); parent._children.Add(newBone); @@ -89,17 +95,5 @@ namespace UniVRM10 BuildRecursively(humanoid, child, parent, boneMap); } } - - /// - /// 親から再帰的にNormalized の ローカル回転を初期回転を加味して Target に適用する。 - /// - internal void ProcessRecursively() - { - ControlTarget.localRotation = _initialTargetLocalRotation * Quaternion.Inverse(_initialTargetGlobalRotation) * ControlBone.localRotation * _initialTargetGlobalRotation; - foreach (var child in _children) - { - child.ProcessRecursively(); - } - } } }