mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-19 17:27:56 -05:00
Revert "Vrm10Runtime.ReconstructSpringBoneを呼んだ時点のSpringBoneの形状を維持する方向に剛性が働いてしまう問題を修正"
This reverts commit 904b82c114.
This commit is contained in:
parent
904b82c114
commit
63eb58d6b7
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UniVRM10.FastSpringBones.Blittables;
|
||||
|
|
@ -16,8 +15,6 @@ namespace UniVRM10
|
|||
private readonly IVrm10Constraint[] m_constraints;
|
||||
private readonly Transform m_head;
|
||||
private readonly FastSpringBoneService m_fastSpringBoneService;
|
||||
private readonly Dictionary<Transform, Quaternion> m_initialLocalRotations = new Dictionary<Transform, Quaternion>();
|
||||
private readonly bool m_initialized;
|
||||
|
||||
private FastSpringBoneBuffer m_fastSpringBoneBuffer;
|
||||
|
||||
|
|
@ -54,7 +51,6 @@ namespace UniVRM10
|
|||
m_fastSpringBoneService = FastSpringBoneService.Instance;
|
||||
m_fastSpringBoneBuffer = CreateFastSpringBoneBuffer(m_target.SpringBone);
|
||||
m_fastSpringBoneService.BufferCombiner.Register(m_fastSpringBoneBuffer);
|
||||
m_initialized = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -101,11 +97,7 @@ namespace UniVRM10
|
|||
gravityDir = joint.m_gravityDir,
|
||||
gravityPower = joint.m_gravityPower,
|
||||
stiffnessForce = joint.m_stiffnessForce
|
||||
},
|
||||
InitialLocalRotation =
|
||||
m_initialized && m_initialLocalRotations.TryGetValue(joint.transform, out var initialLocalRotation)
|
||||
? initialLocalRotation
|
||||
: m_initialLocalRotations[joint.transform] = joint.transform.localRotation
|
||||
}
|
||||
}).ToArray(),
|
||||
}).ToArray());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ namespace UniVRM10.FastSpringBones.System
|
|||
parentTransformIndex = parent != null ? transformIndexDictionary[parent] : -1,
|
||||
currentTail = currentTail,
|
||||
prevTail = currentTail,
|
||||
localRotation = joint.InitialLocalRotation,
|
||||
localRotation = joint.Transform.localRotation,
|
||||
boneAxis = localChildPosition.normalized,
|
||||
length = localChildPosition.magnitude
|
||||
});
|
||||
|
|
|
|||
|
|
@ -9,6 +9,5 @@ namespace UniVRM10.FastSpringBones.System
|
|||
{
|
||||
public Transform Transform;
|
||||
public BlittableJoint Joint;
|
||||
public Quaternion InitialLocalRotation;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user