From beb37abe3b084ed640fcdd62c65b3e7731319e42 Mon Sep 17 00:00:00 2001 From: Masataka SUMI Date: Tue, 6 Sep 2022 18:33:17 +0900 Subject: [PATCH] Remove unused variables --- .../Vrm10Runtime/ControlRig/Vrm10ControlBone.cs | 10 +++++----- .../Components/Vrm10Runtime/Vrm10RuntimeControlRig.cs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Assets/VRM10/Runtime/Components/Vrm10Runtime/ControlRig/Vrm10ControlBone.cs b/Assets/VRM10/Runtime/Components/Vrm10Runtime/ControlRig/Vrm10ControlBone.cs index 7c022fc3a..1fb06b77d 100644 --- a/Assets/VRM10/Runtime/Components/Vrm10Runtime/ControlRig/Vrm10ControlBone.cs +++ b/Assets/VRM10/Runtime/Components/Vrm10Runtime/ControlRig/Vrm10ControlBone.cs @@ -33,7 +33,7 @@ namespace UniVRM10 public List Children = new List(); - public Vrm10ControlBone(Transform current, Quaternion parentInverse, HumanBodyBones bone) + public Vrm10ControlBone(Transform current, HumanBodyBones bone) { if (bone == HumanBodyBones.LastBone) { @@ -55,7 +55,7 @@ namespace UniVRM10 public static Vrm10ControlBone Build(UniHumanoid.Humanoid humanoid, Dictionary boneMap) { - var hips = new Vrm10ControlBone(humanoid.Hips, Quaternion.identity, HumanBodyBones.Hips); + var hips = new Vrm10ControlBone(humanoid.Hips, HumanBodyBones.Hips); boneMap.Add(HumanBodyBones.Hips, hips); foreach (Transform child in humanoid.Hips) @@ -76,7 +76,7 @@ namespace UniVRM10 // ワールド回転 parent^-1 * current からローカル回転を算出する。 var parentInverse = Quaternion.Inverse(parent.Target.rotation); - var newBone = new Vrm10ControlBone(current, parentInverse, bone); + var newBone = new Vrm10ControlBone(current, bone); newBone.Normalized.SetParent(parent.Normalized, true); parent.Children.Add(newBone); parent = newBone; @@ -92,12 +92,12 @@ namespace UniVRM10 /// /// 親から再帰的にNormalized の ローカル回転を初期回転を加味して Target に適用する。 /// - public void ApplyRecursive(Quaternion worldParentRotation) + public void ApplyRecursively() { Target.localRotation = InitialLocalRotation * Quaternion.Inverse(ToLocal) * Normalized.localRotation * ToLocal; foreach (var child in Children) { - child.ApplyRecursive(Normalized.rotation); + child.ApplyRecursively(); } } } diff --git a/Assets/VRM10/Runtime/Components/Vrm10Runtime/Vrm10RuntimeControlRig.cs b/Assets/VRM10/Runtime/Components/Vrm10Runtime/Vrm10RuntimeControlRig.cs index 65224f4f2..b7fc7c640 100644 --- a/Assets/VRM10/Runtime/Components/Vrm10Runtime/Vrm10RuntimeControlRig.cs +++ b/Assets/VRM10/Runtime/Components/Vrm10Runtime/Vrm10RuntimeControlRig.cs @@ -27,7 +27,7 @@ namespace UniVRM10 public void Process() { _rootBone.Target.position = _rootBone.Normalized.position; - _rootBone.ApplyRecursive(Quaternion.identity); + _rootBone.ApplyRecursively(); } public Transform GetBoneTransform(HumanBodyBones bone)