From 9b45fb9f729f6ca07838e289df442bdf797b8ce6 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Fri, 22 Jan 2021 15:55:55 +0900 Subject: [PATCH] exclude checkbox --- .../Runtime/Components/SpringBone/VRM10SpringJoint.cs | 9 ++++++--- Assets/VRM10/Runtime/IO/Vrm10Storage.cs | 1 + Assets/VRM10/Runtime/UnityBuilder/ComponentBuilder.cs | 3 ++- Assets/VRM10/Runtime/VRMConverter/RuntimeVrmConverter.cs | 3 ++- Assets/VRM10/vrmlib/Runtime/Vrm/SpringBoneManager.cs | 2 ++ 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringJoint.cs b/Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringJoint.cs index c35efd06f1..88214a493d 100644 --- a/Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringJoint.cs +++ b/Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringJoint.cs @@ -27,8 +27,11 @@ public VRM10SpringJoint(Transform t) [SerializeField, Range(0, 1)] public float m_dragForce = 0.4f; + [SerializeField] + public bool m_exclude; + [SerializeField, Range(0, 0.5f), Header("Collision")] - public float m_hitRadius = 0.02f; + public float m_jointRadius = 0.02f; SpringBoneLogic m_logic; @@ -36,7 +39,7 @@ public void DrawGizmo(Transform center, Color color) { if (m_logic != null) { - m_logic.DrawGizmo(center, m_hitRadius, color); + m_logic.DrawGizmo(center, m_jointRadius, color); } else { @@ -69,7 +72,7 @@ public void Update(Transform center, float deltaTime, List nodes) joint.GravityDir = gltfJoint.GravityDir.ToVector3(); joint.GravityPower = gltfJoint.GravityPower.Value; joint.Stiffness = gltfJoint.Stiffness.Value; + joint.Exclude = gltfJoint.Exclude.Value; springBone.Joints.Add(joint); } diff --git a/Assets/VRM10/Runtime/UnityBuilder/ComponentBuilder.cs b/Assets/VRM10/Runtime/UnityBuilder/ComponentBuilder.cs index 45ed6c4e98..6c54bbb0aa 100644 --- a/Assets/VRM10/Runtime/UnityBuilder/ComponentBuilder.cs +++ b/Assets/VRM10/Runtime/UnityBuilder/ComponentBuilder.cs @@ -307,7 +307,8 @@ public static void Build10(VrmLib.Model model, ModelAsset asset) joint.m_gravityPower = vrmJoint.GravityPower; joint.m_gravityDir = vrmJoint.GravityDir.ToUnityVector3(); joint.m_dragForce = vrmJoint.DragForce; - joint.m_hitRadius = vrmJoint.HitRadius; + joint.m_jointRadius = vrmJoint.HitRadius; + joint.m_exclude = vrmJoint.Exclude; springBone.Joints.Add(joint); } diff --git a/Assets/VRM10/Runtime/VRMConverter/RuntimeVrmConverter.cs b/Assets/VRM10/Runtime/VRMConverter/RuntimeVrmConverter.cs index 8b1f3c94ec..978572936f 100644 --- a/Assets/VRM10/Runtime/VRMConverter/RuntimeVrmConverter.cs +++ b/Assets/VRM10/Runtime/VRMConverter/RuntimeVrmConverter.cs @@ -362,7 +362,8 @@ public VrmLib.Model ToModelFrom10(GameObject root, VRM10MetaObject metaObject = GravityPower = joint.m_gravityPower, GravityDir = joint.m_gravityDir.ToNumericsVector3(), DragForce = joint.m_dragForce, - HitRadius = joint.m_hitRadius, + HitRadius = joint.m_jointRadius, + Exclude = joint.m_exclude, }); } diff --git a/Assets/VRM10/vrmlib/Runtime/Vrm/SpringBoneManager.cs b/Assets/VRM10/vrmlib/Runtime/Vrm/SpringBoneManager.cs index 270a940e70..9639a21fa2 100644 --- a/Assets/VRM10/vrmlib/Runtime/Vrm/SpringBoneManager.cs +++ b/Assets/VRM10/vrmlib/Runtime/Vrm/SpringBoneManager.cs @@ -67,6 +67,8 @@ public SpringJoint(Node node) public float HitRadius; public float Stiffness; + + public bool Exclude; } public class SpringBone