mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-12 05:48:47 -05:00
rename VRM10SpringJoint to VRM10SpringBoneJoint
This commit is contained in:
@@ -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<SpringBoneLogic.InternalCollider> colliders, VRM10SpringJoint tail)
|
||||
public void Process(Transform center, float deltaTime, List<SpringBoneLogic.InternalCollider> 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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5a7fc353e202e4f44a1025ba6e806262
|
||||
guid: 0a942e03b39600e41a1b161e958048f7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -32,10 +32,11 @@ namespace UniVRM10
|
||||
public List<VRM10SpringBoneColliderGroup> ColliderGroups = new List<VRM10SpringBoneColliderGroup>();
|
||||
|
||||
[SerializeField]
|
||||
public List<VRM10SpringJoint> Joints = new List<VRM10SpringJoint>();
|
||||
public List<VRM10SpringBoneJoint> Joints = new List<VRM10SpringBoneJoint>();
|
||||
|
||||
Transform m_center;
|
||||
List<SpringBoneLogic.InternalCollider> 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<Spring> Springs = new List<Spring>();
|
||||
|
||||
|
||||
@@ -299,7 +299,7 @@ namespace UniVRM10
|
||||
return shape;
|
||||
}
|
||||
|
||||
UniGLTF.Extensions.VRMC_springBone.SpringBoneJoint ExportJoint(VRM10SpringJoint y, Func<Transform, int> getIndexFromTransform)
|
||||
UniGLTF.Extensions.VRMC_springBone.SpringBoneJoint ExportJoint(VRM10SpringBoneJoint y, Func<Transform, int> getIndexFromTransform)
|
||||
{
|
||||
var joint = new UniGLTF.Extensions.VRMC_springBone.SpringBoneJoint
|
||||
{
|
||||
|
||||
@@ -429,7 +429,7 @@ namespace UniVRM10
|
||||
{
|
||||
throw new IndexOutOfRangeException($"{index} > {Nodes.Count}");
|
||||
}
|
||||
var joint = Nodes[gltfJoint.Node.Value].gameObject.AddComponent<VRM10SpringJoint>();
|
||||
var joint = Nodes[gltfJoint.Node.Value].gameObject.AddComponent<VRM10SpringBoneJoint>();
|
||||
joint.m_jointRadius = gltfJoint.HitRadius.Value;
|
||||
joint.m_dragForce = gltfJoint.DragForce.Value;
|
||||
joint.m_gravityDir = Vector3InvertX(gltfJoint.GravityDir);
|
||||
|
||||
Reference in New Issue
Block a user