mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-03 18:39:23 +00:00
Better T-posed bind hierarchy
Fingers rotation limits Update README.md
This commit is contained in:
parent
55d7aa465a
commit
5bec2fcdb1
7 changed files with 36 additions and 7 deletions
|
@ -129,7 +129,7 @@ namespace ml_bft
|
|||
OnAvatarSetup();
|
||||
}
|
||||
|
||||
internal void OnIKSystemLateUpdate(HumanPoseHandler p_handler)
|
||||
internal void OnIKSystemLateUpdate(HumanPoseHandler p_handler, Transform p_hips)
|
||||
{
|
||||
if(m_ready && MetaPort.Instance.isUsingVr && (p_handler != null) && Settings.SkeletalInput)
|
||||
{
|
||||
|
@ -188,6 +188,15 @@ namespace ml_bft
|
|||
m_lastValues[37] = m_pose.muscles[(int)MuscleIndex.RightLittle2Stretched];
|
||||
m_lastValues[38] = m_pose.muscles[(int)MuscleIndex.RightLittle3Stretched];
|
||||
m_lastValues[39] = m_pose.muscles[(int)MuscleIndex.RightLittleSpread];
|
||||
|
||||
if(Settings.MechanimFilter && (p_hips != null))
|
||||
{
|
||||
// Yoinked from IKSystem.OnPostSolverUpdateGeneral
|
||||
Vector3 l_pos = p_hips.position;
|
||||
Quaternion l_rot = p_hips.rotation;
|
||||
p_handler.SetHumanPose(ref m_pose);
|
||||
p_hips.SetPositionAndRotation(l_pos, l_rot);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -238,7 +238,7 @@ namespace ml_bft
|
|||
}
|
||||
|
||||
if(m_bones[(int)SteamVR_Skeleton_JointIndexEnum.root] != null)
|
||||
m_bones[(int)SteamVR_Skeleton_JointIndexEnum.root].rotation = p_base * (m_left ? Quaternion.Euler(0f, -90f, 0f) : Quaternion.Euler(0f, 90f, 0f));
|
||||
m_bones[(int)SteamVR_Skeleton_JointIndexEnum.root].rotation = p_base * (m_left ? Quaternion.Euler(0f, -90f, -90f) : Quaternion.Euler(0f, 90f, 90f));
|
||||
}
|
||||
|
||||
void OnMotionRangeChange(Settings.MotionRangeType p_mode)
|
||||
|
|
|
@ -125,12 +125,12 @@ namespace ml_bft
|
|||
}
|
||||
}
|
||||
|
||||
static void OnIKSystemLateUpdate_Postfix(HumanPoseHandler ____humanPoseHandler) => ms_instance?.OnIKSystemLateUpdate(____humanPoseHandler);
|
||||
void OnIKSystemLateUpdate(HumanPoseHandler p_handler)
|
||||
static void OnIKSystemLateUpdate_Postfix(HumanPoseHandler ____humanPoseHandler, Transform ____hipTransform) => ms_instance?.OnIKSystemLateUpdate(____humanPoseHandler, ____hipTransform);
|
||||
void OnIKSystemLateUpdate(HumanPoseHandler p_handler, Transform p_hips)
|
||||
{
|
||||
try
|
||||
{
|
||||
m_fingerSystem?.OnIKSystemLateUpdate(p_handler);
|
||||
m_fingerSystem?.OnIKSystemLateUpdate(p_handler, p_hips);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
|
|
|
@ -10,6 +10,8 @@ Mod that overhauls behaviour of fingers tracking.
|
|||
Available mod's settings in `Settings - Input & Key-Bindings - Better Fingers Tracking`:
|
||||
* **Force SteamVR skeletal input:** forced usage of SteamVR skeletal input (works as long as controllers' driver supplies skeletal pose throught OpenVR interfaces); `false` by default
|
||||
* **Motion range:** fingers tracking motion range/mode/type; `With controller` by default
|
||||
* **Filter humanoid limits:** Limits fingers rotations to be valid for Unity's Mechanim; `false` by default
|
||||
* Note: Enabling this option ensures that visual representation of your fingers will be same for you and remote players, but it cancels out additional finger segments rotations that can be better visually in most cases.
|
||||
* **Show hands model:** shows transparent hands model (mostly as debug option); `false` by default
|
||||
|
||||
# Notes
|
||||
|
|
|
@ -15,12 +15,14 @@ namespace ml_bft
|
|||
{
|
||||
SkeletalInput = 0,
|
||||
MotionRange,
|
||||
ShowHands
|
||||
ShowHands,
|
||||
MechanimFilter
|
||||
}
|
||||
|
||||
public static bool SkeletalInput { get; private set; } = false;
|
||||
public static MotionRangeType MotionRange { get; private set; } = MotionRangeType.WithController;
|
||||
public static bool ShowHands { get; private set; } = false;
|
||||
public static bool MechanimFilter { get; private set; } = false;
|
||||
|
||||
static MelonLoader.MelonPreferences_Category ms_category = null;
|
||||
static List<MelonLoader.MelonPreferences_Entry> ms_entries = null;
|
||||
|
@ -28,6 +30,7 @@ namespace ml_bft
|
|||
public static event Action<bool> SkeletalInputChange;
|
||||
public static event Action<MotionRangeType> MotionRangeChange;
|
||||
public static event Action<bool> ShowHandsChange;
|
||||
public static event Action<bool> MechanimFilterChange;
|
||||
|
||||
internal static void Init()
|
||||
{
|
||||
|
@ -37,7 +40,8 @@ namespace ml_bft
|
|||
{
|
||||
ms_category.CreateEntry(ModSetting.SkeletalInput.ToString(), SkeletalInput),
|
||||
ms_category.CreateEntry(ModSetting.MotionRange.ToString(), (int)MotionRange),
|
||||
ms_category.CreateEntry(ModSetting.ShowHands.ToString(), ShowHands)
|
||||
ms_category.CreateEntry(ModSetting.ShowHands.ToString(), ShowHands),
|
||||
ms_category.CreateEntry(ModSetting.MechanimFilter.ToString(), MechanimFilter)
|
||||
};
|
||||
|
||||
SkeletalInput = (bool)ms_entries[(int)ModSetting.SkeletalInput].BoxedValue;
|
||||
|
@ -89,6 +93,13 @@ namespace ml_bft
|
|||
ShowHandsChange?.Invoke(ShowHands);
|
||||
}
|
||||
break;
|
||||
|
||||
case ModSetting.MechanimFilter:
|
||||
{
|
||||
MechanimFilter = bool.Parse(p_value);
|
||||
MechanimFilterChange?.Invoke(MechanimFilter);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
ms_entries[(int)l_setting].BoxedValue = bool.Parse(p_value);
|
||||
|
|
|
@ -20,6 +20,13 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class ="row-wrapper">
|
||||
<div class ="option-caption">Filter humanoid limits: </div>
|
||||
<div class ="option-input">
|
||||
<div id="MechanimFilter" class ="inp_toggle no-scroll" data-current="false"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class ="row-wrapper">
|
||||
<div class ="option-caption">Show hands model: </div>
|
||||
<div class ="option-input">
|
||||
|
|
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue