halfbody hip direction fix

This commit is contained in:
NotAKidoS 2023-04-10 01:45:14 -05:00
parent 8ddea91194
commit a563c0ad01

View file

@ -53,7 +53,8 @@ internal static class BodySystemPatches
// Allow avatar to rotate seperatly from Player (Desktop&VR) // Allow avatar to rotate seperatly from Player (Desktop&VR)
// FBT needs avatar root to follow head // FBT needs avatar root to follow head
solver.spine.maxRootAngle = BodySystem.isCalibratedAsFullBody ? 0f : 180f; // VR default is 25 degrees
solver.spine.maxRootAngle = BodySystem.isCalibratedAsFullBody ? 0f : 25f;
if (BodySystem.TrackingEnabled) if (BodySystem.TrackingEnabled)
{ {
@ -73,7 +74,7 @@ internal static class BodySystemPatches
if (BodySystem.isCalibratedAsFullBody) if (BodySystem.isCalibratedAsFullBody)
{ {
bool isRunning = BodySystem.PlayRunningAnimationInFullBody && MovementSystem.Instance.movementVector.magnitude > 0f; bool isRunning = BodySystem.PlayRunningAnimationInFullBody && MovementSystem.Instance.movementVector.magnitude > 0f;
SetPelvisWeight(solver.spine, isRunning ? 0f : 1f); if (isRunning) SetPelvisWeight(solver.spine, 0f);
} }
} }
else else
@ -131,16 +132,8 @@ internal static class BodySystemPatches
void SetPelvisWeight(IKSolverVR.Spine spine, float weight) void SetPelvisWeight(IKSolverVR.Spine spine, float weight)
{ {
// looks better when hips are disabled while running // looks better when hips are disabled while running
if (spine.pelvisTarget != null) spine.pelvisPositionWeight = weight;
{ spine.pelvisRotationWeight = weight;
spine.pelvisPositionWeight = weight;
spine.pelvisRotationWeight = weight;
}
else
{
spine.pelvisPositionWeight = 0f;
spine.pelvisRotationWeight = 0f;
}
} }
return false; return false;