mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
[DesktopVRIK] Remove bone reset mask stuff.
Game has IKTweaks built in. Might as well use it. Don't really think this is needed, but I am including it solely for limb grabber.
This commit is contained in:
parent
9dde916bb6
commit
ba6a5f4778
3 changed files with 14 additions and 55 deletions
|
@ -251,28 +251,23 @@ public class IKManager : MonoBehaviour
|
||||||
|
|
||||||
for (var i = 0; i < _humanPose.muscles.Length; i++)
|
for (var i = 0; i < _humanPose.muscles.Length; i++)
|
||||||
{
|
{
|
||||||
//if (IkTweaksSettings.IgnoreAnimationsModeParsed == IgnoreAnimationsMode.All && IKTweaksMod.ourRandomPuck.activeInHierarchy)
|
switch (BodySystem.boneResetMasks[i])
|
||||||
//{
|
|
||||||
// muscles[i] *= ourBoneResetMasks[i] == BoneResetMask.Never ? 1 : 0;
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
switch (ourBoneResetMasks[i])
|
|
||||||
{
|
{
|
||||||
case BoneResetMask.Never:
|
case BodySystem.BoneResetMask.Never:
|
||||||
break;
|
break;
|
||||||
case BoneResetMask.Spine:
|
case BodySystem.BoneResetMask.Spine:
|
||||||
_humanPose.muscles[i] *= 1 - _solver.spine.pelvisPositionWeight;
|
_humanPose.muscles[i] *= 1 - _solver.spine.pelvisPositionWeight;
|
||||||
break;
|
break;
|
||||||
case BoneResetMask.LeftArm:
|
case BodySystem.BoneResetMask.LeftArm:
|
||||||
_humanPose.muscles[i] *= 1 - _solver.leftArm.positionWeight;
|
_humanPose.muscles[i] *= 1 - _solver.leftArm.positionWeight;
|
||||||
break;
|
break;
|
||||||
case BoneResetMask.RightArm:
|
case BodySystem.BoneResetMask.RightArm:
|
||||||
_humanPose.muscles[i] *= 1 - _solver.rightArm.positionWeight;
|
_humanPose.muscles[i] *= 1 - _solver.rightArm.positionWeight;
|
||||||
break;
|
break;
|
||||||
case BoneResetMask.LeftLeg:
|
case BodySystem.BoneResetMask.LeftLeg:
|
||||||
_humanPose.muscles[i] *= 1 - _solver.leftLeg.positionWeight;
|
_humanPose.muscles[i] *= 1 - _solver.leftLeg.positionWeight;
|
||||||
break;
|
break;
|
||||||
case BoneResetMask.RightLeg:
|
case BodySystem.BoneResetMask.RightLeg:
|
||||||
_humanPose.muscles[i] *= 1 - _solver.rightLeg.positionWeight;
|
_humanPose.muscles[i] *= 1 - _solver.rightLeg.positionWeight;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -357,9 +352,9 @@ public class IKManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
_humanPoseHandler.GetHumanPose(ref _humanPose);
|
_humanPoseHandler.GetHumanPose(ref _humanPose);
|
||||||
|
|
||||||
for (var i = 0; i < ourBoneResetMasks.Length; i++)
|
for (var i = 0; i < BodySystem.boneResetMasks.Length; i++)
|
||||||
{
|
{
|
||||||
if (ourBoneResetMasks[i] != BoneResetMask.Never)
|
if (BodySystem.boneResetMasks[i] != BodySystem.BoneResetMask.Never)
|
||||||
_humanPose.muscles[i] = value;
|
_humanPose.muscles[i] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -372,9 +367,9 @@ public class IKManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
_humanPoseHandler.GetHumanPose(ref _humanPose);
|
_humanPoseHandler.GetHumanPose(ref _humanPose);
|
||||||
|
|
||||||
for (var i = 0; i < ourBoneResetMasks.Length; i++)
|
for (var i = 0; i < BodySystem.boneResetMasks.Length; i++)
|
||||||
{
|
{
|
||||||
if (ourBoneResetMasks[i] != BoneResetMask.Never)
|
if (BodySystem.boneResetMasks[i] != BodySystem.BoneResetMask.Never)
|
||||||
_humanPose.muscles[i] = muscles[i];
|
_humanPose.muscles[i] = muscles[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -384,40 +379,4 @@ public class IKManager : MonoBehaviour
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region BodyHandling
|
|
||||||
|
|
||||||
public enum BoneResetMask
|
|
||||||
{
|
|
||||||
Never,
|
|
||||||
Spine,
|
|
||||||
LeftArm,
|
|
||||||
RightArm,
|
|
||||||
LeftLeg,
|
|
||||||
RightLeg,
|
|
||||||
}
|
|
||||||
|
|
||||||
private static readonly string[] ourNeverBones = { "Index", "Thumb", "Middle", "Ring", "Little", "Jaw", "Eye" };
|
|
||||||
private static readonly string[] ourArmBones = { "Arm", "Forearm", "Hand", "Shoulder" };
|
|
||||||
private static readonly string[] ourLegBones = { "Leg", "Foot", "Toes" };
|
|
||||||
|
|
||||||
private static BoneResetMask JudgeBone(string name)
|
|
||||||
{
|
|
||||||
if (ourNeverBones.Any(name.Contains))
|
|
||||||
return BoneResetMask.Never;
|
|
||||||
|
|
||||||
if (ourArmBones.Any(name.Contains))
|
|
||||||
{
|
|
||||||
return name.Contains("Left") ? BoneResetMask.LeftArm : BoneResetMask.RightArm;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ourLegBones.Any(name.Contains))
|
|
||||||
return name.Contains("Left") ? BoneResetMask.LeftLeg : BoneResetMask.RightLeg;
|
|
||||||
|
|
||||||
return BoneResetMask.Spine;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static readonly BoneResetMask[] ourBoneResetMasks = HumanTrait.MuscleName.Select(JudgeBone).ToArray();
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
}
|
|
@ -28,6 +28,6 @@ using System.Reflection;
|
||||||
namespace NAK.DesktopVRIK.Properties;
|
namespace NAK.DesktopVRIK.Properties;
|
||||||
internal static class AssemblyInfoParams
|
internal static class AssemblyInfoParams
|
||||||
{
|
{
|
||||||
public const string Version = "4.2.3";
|
public const string Version = "4.2.4";
|
||||||
public const string Author = "NotAKidoS";
|
public const string Author = "NotAKidoS";
|
||||||
}
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"_id": 117,
|
"_id": 117,
|
||||||
"name": "DesktopVRIK",
|
"name": "DesktopVRIK",
|
||||||
"modversion": "4.2.3",
|
"modversion": "4.2.4",
|
||||||
"gameversion": "2023r171",
|
"gameversion": "2023r171",
|
||||||
"loaderversion": "0.6.1",
|
"loaderversion": "0.6.1",
|
||||||
"modtype": "Mod",
|
"modtype": "Mod",
|
||||||
|
@ -19,6 +19,6 @@
|
||||||
],
|
],
|
||||||
"downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r17/DesktopVRIK.dll",
|
"downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r17/DesktopVRIK.dll",
|
||||||
"sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/DesktopVRIK/",
|
"sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/DesktopVRIK/",
|
||||||
"changelog": "- Fixed an issue where tracking status would update a frame late.",
|
"changelog": "- Fixed an issue where tracking status would update a frame late.\n- Fixed an error with getting muscle traits on start (i was lazy).",
|
||||||
"embedcolor": "#9b59b6"
|
"embedcolor": "#9b59b6"
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue