[DesktopVRIK] Fixed Prone Thrusting & potential fix for avatar targeting far away before solving.

This commit is contained in:
NotAKidoS 2023-09-25 14:08:47 -05:00
parent 53c369b950
commit b29e9fbb6f
2 changed files with 6 additions and 4 deletions

View file

@ -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);

View file

@ -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";
}