From b29e9fbb6ffd6fddcca90bde9e1b054757825f1c Mon Sep 17 00:00:00 2001 From: NotAKidoS <37721153+NotAKidOnSteam@users.noreply.github.com> Date: Mon, 25 Sep 2023 14:08:47 -0500 Subject: [PATCH] [DesktopVRIK] Fixed Prone Thrusting & potential fix for avatar targeting far away before solving. --- DesktopVRIK/IK/IKHandlers/IKHandlerDesktop.cs | 8 +++++--- DesktopVRIK/Properties/AssemblyInfo.cs | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/DesktopVRIK/IK/IKHandlers/IKHandlerDesktop.cs b/DesktopVRIK/IK/IKHandlers/IKHandlerDesktop.cs index 52bdcb7..f4183ba 100644 --- a/DesktopVRIK/IK/IKHandlers/IKHandlerDesktop.cs +++ b/DesktopVRIK/IK/IKHandlers/IKHandlerDesktop.cs @@ -29,8 +29,7 @@ internal class IKHandlerDesktop : IKHandler public override void UpdateWeights() { // Reset avatar local position - _vrik.transform.localPosition = Vector3.zero; - _vrik.transform.localRotation = Quaternion.identity; + _vrik.transform.SetLocalPositionAndRotation(Vector3.zero, Quaternion.identity); base.UpdateWeights(); } @@ -48,12 +47,15 @@ internal class IKHandlerDesktop : IKHandler private void OnPreSolverUpdateDesktop() { + // Reset avatar local position + _vrik.transform.SetLocalPositionAndRotation(Vector3.zero, Quaternion.identity); + _solver.plantFeet = ModSettings.EntryPlantFeet.Value; // Emulate old VRChat hip movement if (ModSettings.EntryBodyLeanWeight.Value > 0) { - float weightedAngle = ModSettings.EntryProneThrusting.Value ? 1f : ModSettings.EntryBodyLeanWeight.Value * _solver.locomotion.weight; + float weightedAngle = ModSettings.EntryBodyLeanWeight.Value * (ModSettings.EntryProneThrusting.Value ? 1f: _solver.locomotion.weight); float angle = IKManager.Instance._desktopCamera.localEulerAngles.x; angle = angle > 180 ? angle - 360 : angle; Quaternion rotation = Quaternion.AngleAxis(angle * weightedAngle, _vrik.transform.right); diff --git a/DesktopVRIK/Properties/AssemblyInfo.cs b/DesktopVRIK/Properties/AssemblyInfo.cs index 400b8d2..90a633e 100644 --- a/DesktopVRIK/Properties/AssemblyInfo.cs +++ b/DesktopVRIK/Properties/AssemblyInfo.cs @@ -28,6 +28,6 @@ using System.Reflection; namespace NAK.DesktopVRIK.Properties; internal static class AssemblyInfoParams { - public const string Version = "4.2.6"; + public const string Version = "4.2.7"; public const string Author = "NotAKidoS"; } \ No newline at end of file