1
This commit is contained in:
@@ -24,12 +24,15 @@ namespace BITKit.Physics
|
||||
[SerializeField] private Optional<ConfigurableJointMotion> overrideMotion;
|
||||
[SerializeField] private Optional<ConfigurableJointMotion> overrideAngularMotion;
|
||||
|
||||
|
||||
private void Start()
|
||||
{
|
||||
foreach (var x in jointConfigures)
|
||||
{
|
||||
x.InitialRotation=x.animate.localRotation;
|
||||
x.InitialRotation= x.animate.localRotation;
|
||||
if (x.animate.localRotation != x.joint.transform.localRotation)
|
||||
{
|
||||
BIT4Log.Log<PhysicsBasedAnimation>($"{x.animate.name}初始旋转与关节旋转不一致,将会导致动画不正确");
|
||||
}
|
||||
}
|
||||
}
|
||||
private void FixedUpdate()
|
||||
@@ -45,12 +48,10 @@ namespace BITKit.Physics
|
||||
{
|
||||
jointConfigure.joint.angularXDrive = drive;
|
||||
jointConfigure.joint.angularYZDrive = drive;
|
||||
// jointConfigure.joint.targetRotation =
|
||||
// Quaternion.Lerp(
|
||||
// Quaternion.identity,
|
||||
// Quaternion.Inverse(jointConfigure.animate.localRotation) * jointConfigure.InitialRotation,
|
||||
// Blend
|
||||
// );
|
||||
jointConfigure.joint.xDrive = drive;
|
||||
jointConfigure.joint.yDrive = drive;
|
||||
jointConfigure.joint.zDrive = drive;
|
||||
|
||||
jointConfigure.joint.targetRotation = Quaternion.Inverse(jointConfigure.animate.localRotation) *
|
||||
jointConfigure.InitialRotation;
|
||||
jointConfigure.joint.targetPosition = jointConfigure.animate.localPosition;
|
||||
|
Reference in New Issue
Block a user