This commit is contained in:
NotAKidoS 2023-04-25 15:04:09 -05:00
parent dc577c3a2f
commit a468487850
24 changed files with 484 additions and 121 deletions

View file

@ -7,7 +7,7 @@ using HarmonyLib;
using RootMotion.FinalIK;
using UnityEngine;
namespace NAK.Melons.IKFixes.HarmonyPatches;
namespace NAK.IKFixes.HarmonyPatches;
internal static class BodySystemPatches
{
@ -213,6 +213,7 @@ internal static class VRIKPatches
internal static class PlayerSetupPatches
{
// Last Movement Parent Info
static CVRMovementParent lastMovementParent;
static Vector3 lastMovementPosition;
static Quaternion lastMovementRotation;
@ -234,10 +235,15 @@ internal static class PlayerSetupPatches
Vector3 deltaPosition = currentPosition - lastMovementPosition;
Quaternion deltaRotation = Quaternion.Inverse(lastMovementRotation) * currentRotation;
// Add platform motion to IK solver
IKSystem.vrik.solver.AddPlatformMotion(deltaPosition, deltaRotation, currentPosition);
// Prevent targeting other parent position
if (lastMovementParent == currentParent || lastMovementParent == null)
{
// Add platform motion to IK solver
IKSystem.vrik.solver.AddPlatformMotion(deltaPosition, deltaRotation, currentPosition);
}
// Store for next frame
lastMovementParent = currentParent;
lastMovementPosition = currentPosition;
lastMovementRotation = currentRotation;
return false;

View file

@ -1,6 +1,6 @@
using MelonLoader;
namespace NAK.Melons.IKFixes;
namespace NAK.IKFixes;
public class IKFixes : MelonMod
{

View file

@ -1,17 +1,17 @@
using MelonLoader;
using NAK.Melons.IKFixes.Properties;
using NAK.IKFixes.Properties;
using System.Reflection;
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyTitle(nameof(NAK.Melons.IKFixes))]
[assembly: AssemblyTitle(nameof(NAK.IKFixes))]
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
[assembly: AssemblyProduct(nameof(NAK.Melons.IKFixes))]
[assembly: AssemblyProduct(nameof(NAK.IKFixes))]
[assembly: MelonInfo(
typeof(NAK.Melons.IKFixes.IKFixes),
nameof(NAK.Melons.IKFixes),
typeof(NAK.IKFixes.IKFixes),
nameof(NAK.IKFixes),
AssemblyInfoParams.Version,
AssemblyInfoParams.Author,
downloadLink: "https://github.com/NotAKidOnSteam/IKFixes"
@ -22,9 +22,9 @@ using System.Reflection;
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
[assembly: HarmonyDontPatchAll]
namespace NAK.Melons.IKFixes.Properties;
namespace NAK.IKFixes.Properties;
internal static class AssemblyInfoParams
{
public const string Version = "1.0.2";
public const string Version = "1.0.3";
public const string Author = "NotAKidoS";
}

View file

@ -1,7 +1,7 @@
{
"_id": 142,
"name": "IKFixes",
"modversion": "1.0.2",
"modversion": "1.0.3",
"gameversion": "2022r170",
"loaderversion": "0.5.7",
"modtype": "Mod",
@ -16,8 +16,8 @@
"requirements": [
"None"
],
"downloadlink": "https://github.com/NotAKidOnSteam/IKFixes/releases/download/v1.0.2/IKFixes.dll",
"sourcelink": "https://github.com/NotAKidOnSteam/IKFixes/",
"changelog": "- Initial Release\n- Added FakeRootAngle fix for Halfbody. Feet will no longer only point in the direction of head while looking around/turning. This can be disabled in mod settings.",
"downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r2/IKFixes.dll",
"sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/",
"changelog": "- Fixed feet targeting previous movement parent position for a frame.",
"embedcolor": "f46e49"
}