From 2e5e3f2f0ae0ee5741934eb6baf2d23156dc0ebf Mon Sep 17 00:00:00 2001 From: ousttrue Date: Fri, 26 Sep 2025 14:17:42 +0900 Subject: [PATCH] phi to pitch. theta to yaw. --- .../SpringBone/VRM10SpringBoneJointEditor.cs | 24 +++++++++---------- .../SpringBone/VRM10SpringBoneJoint.cs | 8 +++---- .../Format/SpringBoneLimit/Deserializer.g.cs | 8 +++---- .../Format/SpringBoneLimit/Format.g.cs | 4 ++-- .../Format/SpringBoneLimit/Serializer.g.cs | 12 +++++----- Assets/VRM10/Runtime/IO/Vrm10Exporter.cs | 8 +++---- Assets/VRM10/Runtime/IO/Vrm10Importer.cs | 8 +++---- 7 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Assets/VRM10/Editor/Components/SpringBone/VRM10SpringBoneJointEditor.cs b/Assets/VRM10/Editor/Components/SpringBone/VRM10SpringBoneJointEditor.cs index e3ae013c3..1f70031da 100644 --- a/Assets/VRM10/Editor/Components/SpringBone/VRM10SpringBoneJointEditor.cs +++ b/Assets/VRM10/Editor/Components/SpringBone/VRM10SpringBoneJointEditor.cs @@ -18,8 +18,8 @@ namespace UniVRM10 private SerializedProperty m_jointRadiusProp; private SerializedProperty m_angleLimitType; private SerializedProperty m_angleLimitRotation; - private SerializedProperty m_angleLimitAngle1; - private SerializedProperty m_angleLimitAngle2; + private SerializedProperty m_angleLimitPitch; + private SerializedProperty m_angleLimitYaw; private Vrm10Instance m_root; @@ -39,8 +39,8 @@ namespace UniVRM10 m_jointRadiusProp = serializedObject.FindProperty(nameof(VRM10SpringBoneJoint.m_jointRadius)); m_angleLimitType = serializedObject.FindProperty(nameof(VRM10SpringBoneJoint.m_anglelimitType)); m_angleLimitRotation = serializedObject.FindProperty(nameof(VRM10SpringBoneJoint.m_limitSpaceOffset)); - m_angleLimitAngle1 = serializedObject.FindProperty(nameof(VRM10SpringBoneJoint.m_phi)); - m_angleLimitAngle2 = serializedObject.FindProperty(nameof(VRM10SpringBoneJoint.m_theta)); + m_angleLimitPitch = serializedObject.FindProperty(nameof(VRM10SpringBoneJoint.m_pitch)); + m_angleLimitYaw = serializedObject.FindProperty(nameof(VRM10SpringBoneJoint.m_yaw)); m_root = m_target.GetComponentInParent(); } @@ -106,18 +106,18 @@ namespace UniVRM10 case UniGLTF.SpringBoneJobs.AnglelimitTypes.Cone: EditorGUILayout.PropertyField(m_angleLimitRotation); - EditorGUILayout.PropertyField(m_angleLimitAngle1); + EditorGUILayout.PropertyField(m_angleLimitPitch); break; case UniGLTF.SpringBoneJobs.AnglelimitTypes.Hinge: EditorGUILayout.PropertyField(m_angleLimitRotation); - EditorGUILayout.PropertyField(m_angleLimitAngle1); + EditorGUILayout.PropertyField(m_angleLimitPitch); break; case UniGLTF.SpringBoneJobs.AnglelimitTypes.Spherical: EditorGUILayout.PropertyField(m_angleLimitRotation); - EditorGUILayout.PropertyField(m_angleLimitAngle1); - EditorGUILayout.PropertyField(m_angleLimitAngle2); + EditorGUILayout.PropertyField(m_angleLimitPitch); + EditorGUILayout.PropertyField(m_angleLimitYaw); break; } } @@ -323,16 +323,16 @@ namespace UniVRM10 switch (m_target.m_anglelimitType) { case UniGLTF.SpringBoneJobs.AnglelimitTypes.Cone: - DrawCone(limit_tail_pos, m_target.m_phi); + DrawCone(limit_tail_pos, m_target.m_pitch); break; case UniGLTF.SpringBoneJobs.AnglelimitTypes.Hinge: - DrawHinge(limit_tail_pos, m_target.m_phi, Color.cyan); + DrawHinge(limit_tail_pos, m_target.m_pitch, Color.cyan); break; case UniGLTF.SpringBoneJobs.AnglelimitTypes.Spherical: - DrawHinge(limit_tail_pos, m_target.m_phi, Color.cyan * 0.5f); - DrawSpherical(limit_tail_pos, m_target.m_phi, m_target.m_theta); + DrawHinge(limit_tail_pos, m_target.m_pitch, Color.cyan * 0.5f); + DrawSpherical(limit_tail_pos, m_target.m_pitch, m_target.m_yaw); break; } } diff --git a/Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringBoneJoint.cs b/Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringBoneJoint.cs index d19330974..d6a7949d7 100644 --- a/Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringBoneJoint.cs +++ b/Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringBoneJoint.cs @@ -33,10 +33,10 @@ namespace UniVRM10 public Quaternion m_limitSpaceOffset = Quaternion.identity; [SerializeField, Range(0, Mathf.PI)] - public float m_phi = Mathf.PI; + public float m_pitch = Mathf.PI; [SerializeField, Range(0, Mathf.PI / 2)] - public float m_theta = 0; + public float m_yaw = 0; public BlittableJointMutable Blittable => new BlittableJointMutable( stiffnessForce: m_stiffnessForce, @@ -46,8 +46,8 @@ namespace UniVRM10 radius: m_jointRadius, // v0.129.4 angleLimitType: (float)m_anglelimitType, - angleLimit1: m_phi, - angleLimit2: m_theta, + angleLimit1: m_pitch, + angleLimit2: m_yaw, angleLimitOffset: m_limitSpaceOffset ); diff --git a/Assets/VRM10/Runtime/Format/SpringBoneLimit/Deserializer.g.cs b/Assets/VRM10/Runtime/Format/SpringBoneLimit/Deserializer.g.cs index 16fb7981a..72240ac9d 100644 --- a/Assets/VRM10/Runtime/Format/SpringBoneLimit/Deserializer.g.cs +++ b/Assets/VRM10/Runtime/Format/SpringBoneLimit/Deserializer.g.cs @@ -202,13 +202,13 @@ public static SphericalLimit __limit_Deserialize_Spherical(JsonNode parsed) continue; } - if(key=="phi"){ - value.Phi = kv.Value.GetSingle(); + if(key=="pitch"){ + value.Pitch = kv.Value.GetSingle(); continue; } - if(key=="theta"){ - value.Theta = kv.Value.GetSingle(); + if(key=="yaw"){ + value.Yaw = kv.Value.GetSingle(); continue; } diff --git a/Assets/VRM10/Runtime/Format/SpringBoneLimit/Format.g.cs b/Assets/VRM10/Runtime/Format/SpringBoneLimit/Format.g.cs index 069ed2edd..f820abb77 100644 --- a/Assets/VRM10/Runtime/Format/SpringBoneLimit/Format.g.cs +++ b/Assets/VRM10/Runtime/Format/SpringBoneLimit/Format.g.cs @@ -45,10 +45,10 @@ namespace UniGLTF.Extensions.VRMC_springBone_limit public object Extras; // The phi angle of the spherical limit in radians. If the phi angle is set to π or greater, the angle will be interpreted as π by the implementation. - public float? Phi; + public float? Pitch; // The theta angle of the spherical limit in radians. If the theta angle is set to π/2 or greater, the angle will be interpreted as π/2 by the implementation. - public float? Theta; + public float? Yaw; // The rotation from the default orientation of the spherical limit. The rotation is represented as a quaternion (x, y, z, w), where w is the scalar. public float[] Rotation; diff --git a/Assets/VRM10/Runtime/Format/SpringBoneLimit/Serializer.g.cs b/Assets/VRM10/Runtime/Format/SpringBoneLimit/Serializer.g.cs index 1056a8989..316c94eb8 100644 --- a/Assets/VRM10/Runtime/Format/SpringBoneLimit/Serializer.g.cs +++ b/Assets/VRM10/Runtime/Format/SpringBoneLimit/Serializer.g.cs @@ -184,14 +184,14 @@ public static void __limit_Serialize_Spherical(JsonFormatter f, SphericalLimit v (value.Extras as glTFExtension).Serialize(f); } - if(value.Phi.HasValue){ - f.Key("phi"); - f.Value(value.Phi.GetValueOrDefault()); + if(value.Pitch.HasValue){ + f.Key("pitch"); + f.Value(value.Pitch.GetValueOrDefault()); } - if(value.Theta.HasValue){ - f.Key("theta"); - f.Value(value.Theta.GetValueOrDefault()); + if(value.Yaw.HasValue){ + f.Key("yaw"); + f.Value(value.Yaw.GetValueOrDefault()); } if(value.Rotation!=null&&value.Rotation.Count()>=4){ diff --git a/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs b/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs index 45d24fcaf..a0bf43867 100644 --- a/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs +++ b/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs @@ -462,7 +462,7 @@ namespace UniVRM10 Cone = new UniGLTF.Extensions.VRMC_springBone_limit.ConeLimit { Rotation = ReverseX(y.m_limitSpaceOffset), - Angle = y.m_phi, + Angle = y.m_pitch, } } }; @@ -480,7 +480,7 @@ namespace UniVRM10 Hinge = new UniGLTF.Extensions.VRMC_springBone_limit.HingeLimit { Rotation = ReverseX(y.m_limitSpaceOffset), - Angle = y.m_phi, + Angle = y.m_pitch, } } }; @@ -498,8 +498,8 @@ namespace UniVRM10 Spherical = new UniGLTF.Extensions.VRMC_springBone_limit.SphericalLimit { Rotation = ReverseX(y.m_limitSpaceOffset), - Theta = y.m_theta, - Phi = y.m_phi, + Pitch = y.m_pitch, + Yaw = y.m_yaw, } } }; diff --git a/Assets/VRM10/Runtime/IO/Vrm10Importer.cs b/Assets/VRM10/Runtime/IO/Vrm10Importer.cs index df3157be9..e0541a57d 100644 --- a/Assets/VRM10/Runtime/IO/Vrm10Importer.cs +++ b/Assets/VRM10/Runtime/IO/Vrm10Importer.cs @@ -636,20 +636,20 @@ namespace UniVRM10 { joint.m_anglelimitType = UniGLTF.SpringBoneJobs.AnglelimitTypes.Cone; joint.m_limitSpaceOffset = QuaternionFromFloat4(cone.Rotation); - joint.m_phi = cone.Angle.GetValueOrDefault(Mathf.PI * 0.5f); + joint.m_pitch = cone.Angle.GetValueOrDefault(); } else if (extensionSpringBoneLimit.Limit.Hinge is UniGLTF.Extensions.VRMC_springBone_limit.HingeLimit hinge) { joint.m_anglelimitType = UniGLTF.SpringBoneJobs.AnglelimitTypes.Hinge; joint.m_limitSpaceOffset = QuaternionFromFloat4(hinge.Rotation); - joint.m_phi = hinge.Angle.GetValueOrDefault(Mathf.PI * 0.5f); + joint.m_pitch = hinge.Angle.GetValueOrDefault(); } else if (extensionSpringBoneLimit.Limit.Spherical is UniGLTF.Extensions.VRMC_springBone_limit.SphericalLimit spherical) { joint.m_anglelimitType = UniGLTF.SpringBoneJobs.AnglelimitTypes.Spherical; joint.m_limitSpaceOffset = QuaternionFromFloat4(spherical.Rotation); - joint.m_phi = spherical.Phi.GetValueOrDefault(Mathf.PI * 0.5f); - joint.m_theta = spherical.Theta.GetValueOrDefault(Mathf.PI * 0.5f); + joint.m_pitch = spherical.Pitch.GetValueOrDefault(); + joint.m_yaw = spherical.Yaw.GetValueOrDefault(); } }