From a563c0ad019d351fa235a7da8a160f011325cf03 Mon Sep 17 00:00:00 2001 From: NotAKidoS <37721153+NotAKidOnSteam@users.noreply.github.com> Date: Mon, 10 Apr 2023 01:45:14 -0500 Subject: [PATCH] halfbody hip direction fix --- IKFixes/HarmonyPatches.cs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/IKFixes/HarmonyPatches.cs b/IKFixes/HarmonyPatches.cs index 115be5d..592b86e 100644 --- a/IKFixes/HarmonyPatches.cs +++ b/IKFixes/HarmonyPatches.cs @@ -53,7 +53,8 @@ internal static class BodySystemPatches // Allow avatar to rotate seperatly from Player (Desktop&VR) // 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) { @@ -73,7 +74,7 @@ internal static class BodySystemPatches if (BodySystem.isCalibratedAsFullBody) { bool isRunning = BodySystem.PlayRunningAnimationInFullBody && MovementSystem.Instance.movementVector.magnitude > 0f; - SetPelvisWeight(solver.spine, isRunning ? 0f : 1f); + if (isRunning) SetPelvisWeight(solver.spine, 0f); } } else @@ -131,16 +132,8 @@ internal static class BodySystemPatches void SetPelvisWeight(IKSolverVR.Spine spine, float weight) { // looks better when hips are disabled while running - if (spine.pelvisTarget != null) - { - spine.pelvisPositionWeight = weight; - spine.pelvisRotationWeight = weight; - } - else - { - spine.pelvisPositionWeight = 0f; - spine.pelvisRotationWeight = 0f; - } + spine.pelvisPositionWeight = weight; + spine.pelvisRotationWeight = weight; } return false;