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();
- }
- }
}
}