diff --git a/Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringJoint.cs b/Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringBoneJoint.cs similarity index 94% rename from Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringJoint.cs rename to Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringBoneJoint.cs index d9889c509..18ae0f25b 100644 --- a/Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringJoint.cs +++ b/Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringBoneJoint.cs @@ -8,7 +8,7 @@ using UnityEditor; namespace UniVRM10 { [Serializable] - public class VRM10SpringJoint : MonoBehaviour + public class VRM10SpringBoneJoint : MonoBehaviour { [SerializeField, Range(0, 4), Header("Settings")] public float m_stiffnessForce = 1.0f; @@ -46,7 +46,7 @@ namespace UniVRM10 } } - public void Process(Transform center, float deltaTime, List colliders, VRM10SpringJoint tail) + public void Process(Transform center, float deltaTime, List colliders, VRM10SpringBoneJoint tail) { if (m_logic == null) { @@ -73,5 +73,6 @@ namespace UniVRM10 m_logic.Update(center, m_stiffnessForce * deltaTime, m_dragForce, m_gravityDir * (m_gravityPower * deltaTime), colliders, m_jointRadius); } + } } diff --git a/Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringJoint.cs.meta b/Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringBoneJoint.cs.meta similarity index 83% rename from Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringJoint.cs.meta rename to Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringBoneJoint.cs.meta index 0fab6c6f8..1f0db6050 100644 --- a/Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringJoint.cs.meta +++ b/Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringBoneJoint.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5a7fc353e202e4f44a1025ba6e806262 +guid: 0a942e03b39600e41a1b161e958048f7 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/VRM10/Runtime/Components/VRM10ControllerSpringBone.cs b/Assets/VRM10/Runtime/Components/VRM10ControllerSpringBone.cs index 55861be9a..01cb8f848 100644 --- a/Assets/VRM10/Runtime/Components/VRM10ControllerSpringBone.cs +++ b/Assets/VRM10/Runtime/Components/VRM10ControllerSpringBone.cs @@ -32,10 +32,11 @@ namespace UniVRM10 public List ColliderGroups = new List(); [SerializeField] - public List Joints = new List(); + public List Joints = new List(); Transform m_center; List m_colliderList; + List<(VRM10SpringBoneJoint, SpringBoneLogic)> m_logics; public Spring(string name) { @@ -90,7 +91,7 @@ namespace UniVRM10 { // udpate joints - VRM10SpringJoint lastJoint = Joints.FirstOrDefault(x => x != null); + VRM10SpringBoneJoint lastJoint = Joints.FirstOrDefault(x => x != null); foreach (var joint in Joints.Where(x => x != null).Skip(1)) { lastJoint.Process(center, Time.deltaTime, m_colliderList, joint); @@ -100,6 +101,7 @@ namespace UniVRM10 } } } + [SerializeField] public List Springs = new List(); diff --git a/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs b/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs index 10121ce1a..a0032e254 100644 --- a/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs +++ b/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs @@ -299,7 +299,7 @@ namespace UniVRM10 return shape; } - UniGLTF.Extensions.VRMC_springBone.SpringBoneJoint ExportJoint(VRM10SpringJoint y, Func getIndexFromTransform) + UniGLTF.Extensions.VRMC_springBone.SpringBoneJoint ExportJoint(VRM10SpringBoneJoint y, Func getIndexFromTransform) { var joint = new UniGLTF.Extensions.VRMC_springBone.SpringBoneJoint { diff --git a/Assets/VRM10/Runtime/IO/Vrm10Importer.cs b/Assets/VRM10/Runtime/IO/Vrm10Importer.cs index d818d0779..82fd037fe 100644 --- a/Assets/VRM10/Runtime/IO/Vrm10Importer.cs +++ b/Assets/VRM10/Runtime/IO/Vrm10Importer.cs @@ -429,7 +429,7 @@ namespace UniVRM10 { throw new IndexOutOfRangeException($"{index} > {Nodes.Count}"); } - var joint = Nodes[gltfJoint.Node.Value].gameObject.AddComponent(); + var joint = Nodes[gltfJoint.Node.Value].gameObject.AddComponent(); joint.m_jointRadius = gltfJoint.HitRadius.Value; joint.m_dragForce = gltfJoint.DragForce.Value; joint.m_gravityDir = Vector3InvertX(gltfJoint.GravityDir);