[DesktopVRIK] Fixed an issue where tracking status would update a frame late

This commit is contained in:
NotAKidoS 2023-07-29 16:49:06 -05:00
parent 02d6c7ec89
commit d3db894acf
6 changed files with 61 additions and 35 deletions

View file

@ -80,11 +80,12 @@ internal abstract class IKHandler
Update_PelvisWeight();
Update_LocomotionWeight();
ResetSolverIfNeeded();
Update_IKPositionWeight();
}
public virtual void UpdateTracking() { }
protected virtual void Update_HeadWeight()
{
// There is no Head tracking setting
@ -153,17 +154,5 @@ internal abstract class IKHandler
return isTracking && hasTarget ? 1f : 0f;
}
private void ResetSolverIfNeeded()
{
if (_wasTrackingLocomotion == BodySystem.TrackingLocomotionEnabled)
return;
_wasTrackingLocomotion = BodySystem.TrackingLocomotionEnabled;
if (ModSettings.EntryResetFootstepsOnIdle.Value)
VRIKUtils.ResetToInitialFootsteps(_vrik, _locomotionData, _scaleDifference);
_solver.Reset();
}
#endregion
}