mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-07 19:38:13 -05:00
VRM10SpringBone.m_center を VRM10Controller.SpringBoneCenter に移動 (SpringごとではなくModel全体の設定に)
springの設定ではなくて、springが動く環境の設定。アプリが任意に設定する想定。
This commit is contained in:
@@ -31,9 +31,6 @@ namespace UniVRM10
|
||||
[SerializeField]
|
||||
public List<VRM10SpringBoneColliderGroup> ColliderGroups = new List<VRM10SpringBoneColliderGroup>();
|
||||
|
||||
[SerializeField]
|
||||
public Transform m_center;
|
||||
|
||||
[ContextMenu("Reset bones")]
|
||||
public void ResetJoints()
|
||||
{
|
||||
@@ -46,9 +43,12 @@ namespace UniVRM10
|
||||
}
|
||||
}
|
||||
|
||||
Transform m_center;
|
||||
|
||||
List<SpringBoneLogic.InternalCollider> m_colliderList = new List<SpringBoneLogic.InternalCollider>();
|
||||
public void Process()
|
||||
public void Process(Transform center)
|
||||
{
|
||||
m_center = center;
|
||||
if (Joints == null)
|
||||
{
|
||||
return;
|
||||
@@ -96,10 +96,10 @@ namespace UniVRM10
|
||||
VRM10SpringJoint lastJoint = Joints.FirstOrDefault(x => x != null);
|
||||
foreach (var joint in Joints.Where(x => x != null).Skip(1))
|
||||
{
|
||||
lastJoint.Update(m_center, Time.deltaTime, m_colliderList, joint);
|
||||
lastJoint.Update(center, Time.deltaTime, m_colliderList, joint);
|
||||
lastJoint = joint;
|
||||
}
|
||||
lastJoint.Update(m_center, Time.deltaTime, m_colliderList, null);
|
||||
lastJoint.Update(center, Time.deltaTime, m_colliderList, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,9 @@ namespace UniVRM10
|
||||
|
||||
[SerializeField, Header("UpdateSetting")]
|
||||
public UpdateTypes UpdateType = UpdateTypes.LateUpdate;
|
||||
|
||||
[SerializeField, Header("SpringBone")]
|
||||
public Transform SpringBoneCenter;
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
@@ -128,7 +131,7 @@ namespace UniVRM10
|
||||
}
|
||||
foreach (var spring in m_springs)
|
||||
{
|
||||
spring.Process();
|
||||
spring.Process(Controller.SpringBoneCenter);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user