From 9ad060a8aa05c1454696f2625ad6a857fec1fed6 Mon Sep 17 00:00:00 2001 From: Nikolay Kuznetsov Date: Thu, 30 Dec 2021 15:32:43 +0100 Subject: [PATCH] IKT: removed the option to bring viewpoint drift back --- IKTweaks/CustomSpineSolver.cs | 5 +---- IKTweaks/IKTweaks.csproj | 2 +- IKTweaks/IKTweaksMod.cs | 6 +----- IKTweaks/IkTweaksSettings.cs | 18 +++--------------- README.md | 3 --- ReleaseChangelog.md | 4 +--- 6 files changed, 7 insertions(+), 31 deletions(-) diff --git a/IKTweaks/CustomSpineSolver.cs b/IKTweaks/CustomSpineSolver.cs index bdb432c..e68e50b 100644 --- a/IKTweaks/CustomSpineSolver.cs +++ b/IKTweaks/CustomSpineSolver.cs @@ -163,10 +163,7 @@ private void SolvePelvis() { Quaternion.FromToRotation(head.solverPosition - pelvis.solverPosition, headSolverPosition - IKPositionPelvis)); - var deltaHead = headSolverPosition - head.solverPosition; - var deltaHips = IKPositionPelvis - pelvis.solverPosition; - var mix = IkTweaksSettings.GetHeadDriftFactor(); - delta = deltaHips * mix + deltaHead * (1f - mix); + delta = headSolverPosition - head.solverPosition; foreach (VirtualBone bone in bones) bone.solverPosition += delta; var currentDistance = (head.solverPosition - pelvis.solverPosition).magnitude; diff --git a/IKTweaks/IKTweaks.csproj b/IKTweaks/IKTweaks.csproj index fbe4402..ed0b28b 100644 --- a/IKTweaks/IKTweaks.csproj +++ b/IKTweaks/IKTweaks.csproj @@ -4,7 +4,7 @@ true latest true - 1.0.22 + 1.0.23 diff --git a/IKTweaks/IKTweaksMod.cs b/IKTweaks/IKTweaksMod.cs index 2d5e0d1..9860056 100644 --- a/IKTweaks/IKTweaksMod.cs +++ b/IKTweaks/IKTweaksMod.cs @@ -19,7 +19,7 @@ using Delegate = Il2CppSystem.Delegate; using Object = UnityEngine.Object; -[assembly:MelonInfo(typeof(IKTweaksMod), "IKTweaks", "1.0.22", "knah", "https://github.com/knah/VRCMods")] +[assembly:MelonInfo(typeof(IKTweaksMod), "IKTweaks", "1.0.23", "knah", "https://github.com/knah/VRCMods")] [assembly:MelonGame("VRChat", "VRChat")] [assembly:MelonOptionalDependencies("UIExpansionKit")] @@ -137,10 +137,6 @@ private static void AddUixActions() (nameof(MeasureAvatarMode.ImprovedWingspan), "Wingspan (accurate)"), (nameof(MeasureAvatarMode.Height), "Height"), }); - - var updateVisibility = ExpansionKitApi.RegisterSettingsVisibilityCallback(IkTweaksSettings.IkTweaksCategory, - nameof(IkTweaksSettings.DriftMix), () => IkTweaksSettings.DriftMode.Value == DriftPreference.Custom); - IkTweaksSettings.DriftMode.OnValueChangedUntyped += updateVisibility; } private static void ShowIKTweaksMenu() diff --git a/IKTweaks/IkTweaksSettings.cs b/IKTweaks/IkTweaksSettings.cs index a5daf54..5bd7cef 100644 --- a/IKTweaks/IkTweaksSettings.cs +++ b/IKTweaks/IkTweaksSettings.cs @@ -58,8 +58,8 @@ internal static void RegisterSettings() OneHandedCalibration = category.CreateEntry(nameof(OneHandedCalibration), false, "One-handed calibration"); NoWallFreeze = category.CreateEntry(nameof(NoWallFreeze), true, "Don't freeze head/hands inside walls"); - DriftMode = category.CreateEntry(nameof(DriftMode), DriftPreference.Hips, "Which body part will drift?"); - DriftMix = category.CreateEntry(nameof(DriftMix), 0.5f, "Drift mix (0=hips, 1=viewpoint, 0.5=both equally)"); + + ExperimentalSettingOne = category.CreateEntry(nameof(ExperimentalSettingOne), false, "Experimental setting", dont_save_default: true, is_hidden: true); HandAngleOffset = category.CreateEntry(nameof(HandAngleOffset), DefaultHandAngle, "Hand angle offset", null, true); HandPositionOffset = category.CreateEntry(nameof(HandPositionOffset), DefaultHandOffset, "Hand position offset", null, true); @@ -118,25 +118,13 @@ private static void UpdateIgnoreAnimationMode(string value) public static MelonPreferences_Entry WingspanMeasurementAdjustFactor; public static MelonPreferences_Entry OneHandedCalibration; public static MelonPreferences_Entry NoWallFreeze; - public static MelonPreferences_Entry DriftMode; - public static MelonPreferences_Entry DriftMix; + public static MelonPreferences_Entry ExperimentalSettingOne; public static MelonPreferences_Entry HandAngleOffset; public static MelonPreferences_Entry HandPositionOffset; public static IgnoreAnimationsMode IgnoreAnimationsModeParsed; public static MeasureAvatarMode MeasureModeParsed; - - public static float GetHeadDriftFactor() - { - return DriftMode.Value switch - { - DriftPreference.Hips => 0, - DriftPreference.Viewpoint => 1, - DriftPreference.Custom => DriftMix.Value, - _ => throw new ArgumentOutOfRangeException() - }; - } } [Flags] diff --git a/README.md b/README.md index 6ce09c3..9f03cc4 100644 --- a/README.md +++ b/README.md @@ -259,8 +259,6 @@ Given that this mod is still work in progress, these are subject to change. * Improved wingspan adjustment factor - your wingspan is adjusted by this factor in "Improved wingspan" scaling mode. If you consistently get avatar arms too long/short, consider tweaking this a tiny bit (to like 1.05 or 1.15) * One-handed calibration - pressing one trigger will be enough to calibrate. Holding the trigger slightly pressed will freeze the avatar (if enabled). * Don't freeze head/hands inside walls - prevents your hands/head from freezing if your head gets inside a wall. - * Which body part will drift? - in case you want your viewpoint drift back, you monster. - * Drift mix - if the previous setting is set to custom, decides how much viewpoint and hips can drift. 0 means viewpoint/head is fixed to the headset, 1 means hip is fixed to the tracker, values inbetween make both drift in different proportions. * Hand angles/offsets (found in VRChat Settings menu -> left blue panel -> More IKTweaks -> Adjust hand angles/offsets) - you can configure how avatar hands are positioned relative to controllers. Defaults were tuned for Index controllers, but should be applicable to most other controllers too. ### Partial source code @@ -274,7 +272,6 @@ If you want to build the mod yourself, you'll need to do the following: * Rename `RootMotionNew.FinalIK.IKSolverVR.Leg.ApplyOffsets` to `ApplyOffsetsOld`, remove `override` from it * Add `ApplyBendGoal();` to the second line of `RootMotionNew.FinalIK.IKSolverVR.Leg.Solve(bool)` * Rename `Update`, `FixedUpdate` and `LateUpdate` on VRIK_New by adding `_ManualDrive` suffix to them and make them `internal` instead of `private` -* In `IKSolverVR.Solve` comment out `spine.InverseTranslateToHead` in legs section * Fix compilation if broken ## JoinNotifier diff --git a/ReleaseChangelog.md b/ReleaseChangelog.md index 3a3d4ea..8c040bd 100644 --- a/ReleaseChangelog.md +++ b/ReleaseChangelog.md @@ -1,9 +1,7 @@ Read the [Malicious Mods and you](https://github.com/knah/VRCMods/blob/master/Malicious-Mods.md) doc! Changes: - * IKTweaks: fix calibration not saving often/recalibrating randomly - * IKTweaks: added detection of AFK state - * IKTweaks: added an option to bring viewpoint drift back + * IKTweaks: removed the option to bring viewpoint drift back as it caused too many issues. It might return someday. **USE IT AT YOUR OWN RISK.** Modding the client is against VRChat ToS. I am not responsible for any bans or other punishments you may get by using these mods! \ No newline at end of file