mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-03 18:39:23 +00:00
Scaled locomotion steps
Funny C# properties Minor fixes
This commit is contained in:
parent
fc60219a4e
commit
28aca1bb49
11 changed files with 343 additions and 410 deletions
|
@ -98,7 +98,7 @@ namespace ml_amt
|
|||
m_localTweaker = PlayerSetup.Instance.gameObject.AddComponent<MotionTweaker>();
|
||||
m_localTweaker.SetIKOverrideCrouch(Settings.IKOverrideCrouch);
|
||||
m_localTweaker.SetCrouchLimit(Settings.CrouchLimit);
|
||||
m_localTweaker.SetIKOverrideCrouch(Settings.IKOverrideProne);
|
||||
m_localTweaker.SetIKOverrideProne(Settings.IKOverrideProne);
|
||||
m_localTweaker.SetProneLimit(Settings.ProneLimit);
|
||||
m_localTweaker.SetPoseTransitions(Settings.PoseTransitions);
|
||||
m_localTweaker.SetAdjustedMovement(Settings.AdjustedMovement);
|
||||
|
@ -260,13 +260,10 @@ namespace ml_amt
|
|||
{
|
||||
try
|
||||
{
|
||||
if(Settings.OverrideFix)
|
||||
if(Settings.OverrideFix && (__instance.animator != null))
|
||||
{
|
||||
if(__instance.animator != null)
|
||||
{
|
||||
__instance.animator.enabled = false;
|
||||
__instance.animator.WriteDefaultValues();
|
||||
}
|
||||
__instance.animator.enabled = false;
|
||||
__instance.animator.WriteDefaultValues();
|
||||
}
|
||||
}
|
||||
catch(System.Exception l_exception)
|
||||
|
@ -278,13 +275,10 @@ namespace ml_amt
|
|||
{
|
||||
try
|
||||
{
|
||||
if(Settings.OverrideFix)
|
||||
if(Settings.OverrideFix && (__instance.animator != null))
|
||||
{
|
||||
if(__instance.animator != null)
|
||||
{
|
||||
__instance.animator.enabled = true;
|
||||
__instance.animator.Update(0f);
|
||||
}
|
||||
__instance.animator.enabled = true;
|
||||
__instance.animator.Update(0f);
|
||||
}
|
||||
}
|
||||
catch(System.Exception l_exception)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using ABI_RC.Core.Player;
|
||||
using ABI_RC.Systems.IK;
|
||||
using ABI_RC.Systems.IK.SubSystems;
|
||||
using ABI_RC.Systems.MovementSystem;
|
||||
using RootMotion.FinalIK;
|
||||
|
@ -65,6 +66,7 @@ namespace ml_amt
|
|||
bool m_followHips = true;
|
||||
Vector3 m_hipsToPlayer = Vector3.zero;
|
||||
|
||||
Vector2 m_stepDistance = Vector2.zero;
|
||||
Vector3 m_massCenter = Vector3.zero;
|
||||
|
||||
readonly List<AvatarParameter> m_parameters = null;
|
||||
|
@ -74,6 +76,7 @@ namespace ml_amt
|
|||
m_parameters = new List<AvatarParameter>();
|
||||
}
|
||||
|
||||
// Unity events
|
||||
void Start()
|
||||
{
|
||||
m_inVR = Utils.IsInVR();
|
||||
|
@ -88,7 +91,8 @@ namespace ml_amt
|
|||
Settings.IKOverrideJumpChange += this.SetIKOverrideJump;
|
||||
Settings.DetectEmotesChange += this.SetDetectEmotes;
|
||||
Settings.FollowHipsChange += this.SetFollowHips;
|
||||
Settings.MassCenterChange += this.SetMassCenter;
|
||||
Settings.MassCenterChange += this.OnMassCenterChange;
|
||||
Settings.ScaledStepsChange += this.OnScaledStepsChange;
|
||||
}
|
||||
|
||||
void OnDestroy()
|
||||
|
@ -103,7 +107,7 @@ namespace ml_amt
|
|||
Settings.IKOverrideJumpChange -= this.SetIKOverrideJump;
|
||||
Settings.DetectEmotesChange -= this.SetDetectEmotes;
|
||||
Settings.FollowHipsChange -= this.SetFollowHips;
|
||||
Settings.MassCenterChange -= this.SetMassCenter;
|
||||
Settings.MassCenterChange -= this.OnMassCenterChange;
|
||||
}
|
||||
|
||||
void Update()
|
||||
|
@ -163,6 +167,7 @@ namespace ml_amt
|
|||
}
|
||||
}
|
||||
|
||||
// Game events
|
||||
internal void OnAvatarClear()
|
||||
{
|
||||
m_vrIk = null;
|
||||
|
@ -183,6 +188,7 @@ namespace ml_amt
|
|||
m_avatarHips = null;
|
||||
m_viewPointHeight = 1f;
|
||||
m_massCenter = Vector3.zero;
|
||||
m_stepDistance = Vector2.zero;
|
||||
m_parameters.Clear();
|
||||
}
|
||||
|
||||
|
@ -253,6 +259,8 @@ namespace ml_amt
|
|||
|
||||
m_vrIk.solver.locomotion.offset = (Settings.MassCenter ? m_massCenter : m_locomotionOffset);
|
||||
|
||||
m_stepDistance.Set(m_vrIk.solver.locomotion.stepThreshold, m_vrIk.solver.locomotion.footDistance);
|
||||
|
||||
m_vrIk.onPreSolverUpdate.AddListener(this.OnIKPreUpdate);
|
||||
m_vrIk.onPostSolverUpdate.AddListener(this.OnIKPostUpdate);
|
||||
}
|
||||
|
@ -276,12 +284,23 @@ namespace ml_amt
|
|||
|
||||
internal void OnPlayspaceScale()
|
||||
{
|
||||
if((m_vrIk != null) && Settings.MassCenter)
|
||||
if(m_vrIk != null)
|
||||
{
|
||||
m_vrIk.solver.locomotion.offset = m_massCenter * GetRelativeScale();
|
||||
if(Settings.MassCenter)
|
||||
m_vrIk.solver.locomotion.offset = m_massCenter * GetRelativeScale();
|
||||
|
||||
if(Settings.ScaledSteps)
|
||||
{
|
||||
m_vrIk.solver.locomotion.stepThreshold = m_stepDistance.x * GetRelativeScale();
|
||||
m_vrIk.solver.locomotion.footDistance = m_stepDistance.y * GetRelativeScale();
|
||||
|
||||
m_vrIk.solver.locomotion.stepHeight.keys = Utils.GetSineKeyframes(Mathf.Clamp01(PlayerSetup.Instance.GetAvatarHeight()) * 0.03f);
|
||||
m_vrIk.solver.locomotion.heelHeight.keys = Utils.GetSineKeyframes(Mathf.Clamp01(PlayerSetup.Instance.GetAvatarHeight()) * 0.03f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// IK events
|
||||
void OnIKPreUpdate()
|
||||
{
|
||||
bool l_locomotionOverride = false;
|
||||
|
@ -342,25 +361,26 @@ namespace ml_amt
|
|||
m_vrIk.solver.rightLeg.useAnimatedBendNormal = m_bendNormalRight;
|
||||
}
|
||||
|
||||
public void SetIKOverrideCrouch(bool p_state)
|
||||
// Settings
|
||||
internal void SetIKOverrideCrouch(bool p_state)
|
||||
{
|
||||
m_ikOverrideCrouch = p_state;
|
||||
}
|
||||
public void SetCrouchLimit(float p_value)
|
||||
internal void SetCrouchLimit(float p_value)
|
||||
{
|
||||
if(!m_customCrouchLimit)
|
||||
m_crouchLimit = Mathf.Clamp01(p_value);
|
||||
}
|
||||
public void SetIKOverrideProne(bool p_state)
|
||||
internal void SetIKOverrideProne(bool p_state)
|
||||
{
|
||||
m_ikOverrideProne = p_state;
|
||||
}
|
||||
public void SetProneLimit(float p_value)
|
||||
internal void SetProneLimit(float p_value)
|
||||
{
|
||||
if(!m_customProneLimit)
|
||||
m_proneLimit = Mathf.Clamp01(p_value);
|
||||
}
|
||||
public void SetPoseTransitions(bool p_state)
|
||||
internal void SetPoseTransitions(bool p_state)
|
||||
{
|
||||
m_poseTransitions = p_state;
|
||||
|
||||
|
@ -370,7 +390,7 @@ namespace ml_amt
|
|||
PlayerSetup.Instance.animatorManager.SetAnimatorParameterBool("Prone", false);
|
||||
}
|
||||
}
|
||||
public void SetAdjustedMovement(bool p_state)
|
||||
internal void SetAdjustedMovement(bool p_state)
|
||||
{
|
||||
m_adjustedMovement = p_state;
|
||||
|
||||
|
@ -380,33 +400,54 @@ namespace ml_amt
|
|||
MovementSystem.Instance.ChangeProne(false);
|
||||
}
|
||||
}
|
||||
public void SetIKOverrideFly(bool p_state)
|
||||
internal void SetIKOverrideFly(bool p_state)
|
||||
{
|
||||
m_ikOverrideFly = p_state;
|
||||
}
|
||||
public void SetIKOverrideJump(bool p_state)
|
||||
internal void SetIKOverrideJump(bool p_state)
|
||||
{
|
||||
m_ikOverrideJump = p_state;
|
||||
}
|
||||
public void SetDetectEmotes(bool p_state)
|
||||
internal void SetDetectEmotes(bool p_state)
|
||||
{
|
||||
m_detectEmotes = p_state;
|
||||
}
|
||||
public void SetFollowHips(bool p_state)
|
||||
internal void SetFollowHips(bool p_state)
|
||||
{
|
||||
m_followHips = p_state;
|
||||
}
|
||||
public void SetMassCenter(bool p_state)
|
||||
void OnMassCenterChange(bool p_state)
|
||||
{
|
||||
if(m_vrIk != null)
|
||||
m_vrIk.solver.locomotion.offset = (Settings.MassCenter ? (m_massCenter * GetRelativeScale()) : m_locomotionOffset);
|
||||
}
|
||||
void OnScaledStepsChange(bool p_state)
|
||||
{
|
||||
if(m_vrIk != null)
|
||||
{
|
||||
if(p_state)
|
||||
{
|
||||
m_vrIk.solver.locomotion.stepThreshold = m_stepDistance.x * GetRelativeScale();
|
||||
m_vrIk.solver.locomotion.footDistance = m_stepDistance.y * GetRelativeScale();
|
||||
m_vrIk.solver.locomotion.stepHeight.keys = Utils.GetSineKeyframes(Mathf.Clamp01(PlayerSetup.Instance.GetAvatarHeight()) * 0.03f);
|
||||
m_vrIk.solver.locomotion.heelHeight.keys = Utils.GetSineKeyframes(Mathf.Clamp01(PlayerSetup.Instance.GetAvatarHeight()) * 0.03f);
|
||||
}
|
||||
else
|
||||
{
|
||||
IKSystem.Instance.ApplyAvatarScaleToIk(PlayerSetup.Instance.GetAvatarHeight());
|
||||
m_vrIk.solver.locomotion.stepHeight.keys = Utils.GetSineKeyframes(0.03f);
|
||||
m_vrIk.solver.locomotion.heelHeight.keys = Utils.GetSineKeyframes(0.03f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Arbitrary
|
||||
float GetRelativeScale()
|
||||
{
|
||||
return ((m_avatarScale > 0f) ? (PlayerSetup.Instance._avatar.transform.localScale.y / m_avatarScale) : 0f);
|
||||
}
|
||||
|
||||
// Parameters access
|
||||
public float GetUpright() => m_upright;
|
||||
public bool GetGroundedRaw() => m_groundedRaw;
|
||||
public bool GetMoving() => m_moving;
|
||||
|
|
|
@ -20,23 +20,25 @@ namespace ml_amt
|
|||
DetectEmotes,
|
||||
FollowHips,
|
||||
CollisionScale,
|
||||
ScaledSteps,
|
||||
MassCenter,
|
||||
OverrideFix
|
||||
};
|
||||
|
||||
static bool ms_ikOverrideCrouch = true;
|
||||
static float ms_crouchLimit = 0.65f;
|
||||
static bool ms_ikOverrideProne = true;
|
||||
static float ms_proneLimit = 0.3f;
|
||||
static bool ms_poseTransitions = true;
|
||||
static bool ms_adjustedMovement = true;
|
||||
static bool ms_ikOverrideFly = true;
|
||||
static bool ms_ikOverrideJump = true;
|
||||
static bool ms_detectEmotes = true;
|
||||
static bool ms_followHips = true;
|
||||
static bool ms_collisionScale = true;
|
||||
static bool ms_massCenter = true;
|
||||
static bool ms_overrideFix = true;
|
||||
public static bool IKOverrideCrouch { get; private set; } = true;
|
||||
public static float CrouchLimit { get; private set; } = 0.65f;
|
||||
public static bool IKOverrideProne { get; private set; } = true;
|
||||
public static float ProneLimit { get; private set; } = 0.3f;
|
||||
public static bool PoseTransitions { get; private set; } = true;
|
||||
public static bool AdjustedMovement { get; private set; } = true;
|
||||
public static bool IKOverrideFly { get; private set; } = true;
|
||||
public static bool IKOverrideJump { get; private set; } = true;
|
||||
public static bool DetectEmotes { get; private set; } = true;
|
||||
public static bool FollowHips { get; private set; } = true;
|
||||
public static bool MassCenter { get; private set; } = true;
|
||||
public static bool ScaledSteps { get; private set; } = true;
|
||||
public static bool CollisionScale { get; private set; } = true;
|
||||
public static bool OverrideFix { get; private set; } = true;
|
||||
|
||||
static MelonLoader.MelonPreferences_Category ms_category = null;
|
||||
static List<MelonLoader.MelonPreferences_Entry> ms_entries = null;
|
||||
|
@ -51,8 +53,9 @@ namespace ml_amt
|
|||
static public event Action<bool> IKOverrideJumpChange;
|
||||
static public event Action<bool> DetectEmotesChange;
|
||||
static public event Action<bool> FollowHipsChange;
|
||||
static public event Action<bool> CollisionScaleChange;
|
||||
static public event Action<bool> MassCenterChange;
|
||||
static public event Action<bool> ScaledStepsChange;
|
||||
static public event Action<bool> CollisionScaleChange;
|
||||
static public event Action<bool> OverrideFixChange;
|
||||
|
||||
internal static void Init()
|
||||
|
@ -61,19 +64,20 @@ namespace ml_amt
|
|||
|
||||
ms_entries = new List<MelonLoader.MelonPreferences_Entry>()
|
||||
{
|
||||
ms_category.CreateEntry(ModSetting.IKOverrideCrouch.ToString(), true),
|
||||
ms_category.CreateEntry(ModSetting.CrouchLimit.ToString(), 65),
|
||||
ms_category.CreateEntry(ModSetting.IKOverrideProne.ToString(), true),
|
||||
ms_category.CreateEntry(ModSetting.ProneLimit.ToString(), 30),
|
||||
ms_category.CreateEntry(ModSetting.PoseTransitions.ToString(), true),
|
||||
ms_category.CreateEntry(ModSetting.AdjustedMovement.ToString(), true),
|
||||
ms_category.CreateEntry(ModSetting.IKOverrideFly.ToString(), true),
|
||||
ms_category.CreateEntry(ModSetting.IKOverrideJump.ToString(), true),
|
||||
ms_category.CreateEntry(ModSetting.DetectEmotes.ToString(), true),
|
||||
ms_category.CreateEntry(ModSetting.FollowHips.ToString(), true),
|
||||
ms_category.CreateEntry(ModSetting.CollisionScale.ToString(), true),
|
||||
ms_category.CreateEntry(ModSetting.MassCenter.ToString(), true),
|
||||
ms_category.CreateEntry(ModSetting.OverrideFix.ToString(), true)
|
||||
ms_category.CreateEntry(ModSetting.IKOverrideCrouch.ToString(), IKOverrideCrouch),
|
||||
ms_category.CreateEntry(ModSetting.CrouchLimit.ToString(), (int)(CrouchLimit * 100f)),
|
||||
ms_category.CreateEntry(ModSetting.IKOverrideProne.ToString(), IKOverrideProne),
|
||||
ms_category.CreateEntry(ModSetting.ProneLimit.ToString(), (int)(ProneLimit * 100f)),
|
||||
ms_category.CreateEntry(ModSetting.PoseTransitions.ToString(), PoseTransitions),
|
||||
ms_category.CreateEntry(ModSetting.AdjustedMovement.ToString(), AdjustedMovement),
|
||||
ms_category.CreateEntry(ModSetting.IKOverrideFly.ToString(), IKOverrideFly),
|
||||
ms_category.CreateEntry(ModSetting.IKOverrideJump.ToString(), IKOverrideJump),
|
||||
ms_category.CreateEntry(ModSetting.DetectEmotes.ToString(), DetectEmotes),
|
||||
ms_category.CreateEntry(ModSetting.FollowHips.ToString(), FollowHips),
|
||||
ms_category.CreateEntry(ModSetting.MassCenter.ToString(), MassCenter),
|
||||
ms_category.CreateEntry(ModSetting.ScaledSteps.ToString(), ScaledSteps),
|
||||
ms_category.CreateEntry(ModSetting.CollisionScale.ToString(), CollisionScale),
|
||||
ms_category.CreateEntry(ModSetting.OverrideFix.ToString(), OverrideFix)
|
||||
};
|
||||
|
||||
Load();
|
||||
|
@ -105,19 +109,20 @@ namespace ml_amt
|
|||
|
||||
static void Load()
|
||||
{
|
||||
ms_ikOverrideCrouch = (bool)ms_entries[(int)ModSetting.IKOverrideCrouch].BoxedValue;
|
||||
ms_crouchLimit = ((int)ms_entries[(int)ModSetting.CrouchLimit].BoxedValue) * 0.01f;
|
||||
ms_ikOverrideProne = (bool)ms_entries[(int)ModSetting.IKOverrideProne].BoxedValue;
|
||||
ms_proneLimit = ((int)ms_entries[(int)ModSetting.ProneLimit].BoxedValue) * 0.01f;
|
||||
ms_poseTransitions = (bool)ms_entries[(int)ModSetting.PoseTransitions].BoxedValue;
|
||||
ms_adjustedMovement = (bool)ms_entries[(int)ModSetting.AdjustedMovement].BoxedValue;
|
||||
ms_ikOverrideFly = (bool)ms_entries[(int)ModSetting.IKOverrideFly].BoxedValue;
|
||||
ms_ikOverrideJump = (bool)ms_entries[(int)ModSetting.IKOverrideJump].BoxedValue;
|
||||
ms_detectEmotes = (bool)ms_entries[(int)ModSetting.DetectEmotes].BoxedValue;
|
||||
ms_followHips = (bool)ms_entries[(int)ModSetting.FollowHips].BoxedValue;
|
||||
ms_collisionScale = (bool)ms_entries[(int)ModSetting.CollisionScale].BoxedValue;
|
||||
ms_massCenter = (bool)ms_entries[(int)ModSetting.MassCenter].BoxedValue;
|
||||
ms_overrideFix = (bool)ms_entries[(int)ModSetting.OverrideFix].BoxedValue;
|
||||
IKOverrideCrouch = (bool)ms_entries[(int)ModSetting.IKOverrideCrouch].BoxedValue;
|
||||
CrouchLimit = ((int)ms_entries[(int)ModSetting.CrouchLimit].BoxedValue) * 0.01f;
|
||||
IKOverrideProne = (bool)ms_entries[(int)ModSetting.IKOverrideProne].BoxedValue;
|
||||
ProneLimit = ((int)ms_entries[(int)ModSetting.ProneLimit].BoxedValue) * 0.01f;
|
||||
PoseTransitions = (bool)ms_entries[(int)ModSetting.PoseTransitions].BoxedValue;
|
||||
AdjustedMovement = (bool)ms_entries[(int)ModSetting.AdjustedMovement].BoxedValue;
|
||||
IKOverrideFly = (bool)ms_entries[(int)ModSetting.IKOverrideFly].BoxedValue;
|
||||
IKOverrideJump = (bool)ms_entries[(int)ModSetting.IKOverrideJump].BoxedValue;
|
||||
DetectEmotes = (bool)ms_entries[(int)ModSetting.DetectEmotes].BoxedValue;
|
||||
FollowHips = (bool)ms_entries[(int)ModSetting.FollowHips].BoxedValue;
|
||||
MassCenter = (bool)ms_entries[(int)ModSetting.MassCenter].BoxedValue;
|
||||
ScaledSteps = (bool)ms_entries[(int)ModSetting.ScaledSteps].BoxedValue;
|
||||
CollisionScale = (bool)ms_entries[(int)ModSetting.CollisionScale].BoxedValue;
|
||||
OverrideFix = (bool)ms_entries[(int)ModSetting.OverrideFix].BoxedValue;
|
||||
}
|
||||
|
||||
static void OnSliderUpdate(string p_name, string p_value)
|
||||
|
@ -128,15 +133,15 @@ namespace ml_amt
|
|||
{
|
||||
case ModSetting.CrouchLimit:
|
||||
{
|
||||
ms_crouchLimit = int.Parse(p_value) * 0.01f;
|
||||
CrouchLimitChange?.Invoke(ms_crouchLimit);
|
||||
CrouchLimit = int.Parse(p_value) * 0.01f;
|
||||
CrouchLimitChange?.Invoke(CrouchLimit);
|
||||
}
|
||||
break;
|
||||
|
||||
case ModSetting.ProneLimit:
|
||||
{
|
||||
ms_proneLimit = int.Parse(p_value) * 0.01f;
|
||||
ProneLimitChange?.Invoke(ms_proneLimit);
|
||||
ProneLimit = int.Parse(p_value) * 0.01f;
|
||||
ProneLimitChange?.Invoke(ProneLimit);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -153,78 +158,85 @@ namespace ml_amt
|
|||
{
|
||||
case ModSetting.IKOverrideCrouch:
|
||||
{
|
||||
ms_ikOverrideCrouch = bool.Parse(p_value);
|
||||
IKOverrideCrouchChange?.Invoke(ms_ikOverrideCrouch);
|
||||
IKOverrideCrouch = bool.Parse(p_value);
|
||||
IKOverrideCrouchChange?.Invoke(IKOverrideCrouch);
|
||||
}
|
||||
break;
|
||||
|
||||
case ModSetting.IKOverrideProne:
|
||||
{
|
||||
ms_ikOverrideProne = bool.Parse(p_value);
|
||||
IKOverrideProneChange?.Invoke(ms_ikOverrideProne);
|
||||
IKOverrideProne = bool.Parse(p_value);
|
||||
IKOverrideProneChange?.Invoke(IKOverrideProne);
|
||||
}
|
||||
break;
|
||||
|
||||
case ModSetting.PoseTransitions:
|
||||
{
|
||||
ms_poseTransitions = bool.Parse(p_value);
|
||||
PoseTransitionsChange?.Invoke(ms_poseTransitions);
|
||||
PoseTransitions = bool.Parse(p_value);
|
||||
PoseTransitionsChange?.Invoke(PoseTransitions);
|
||||
}
|
||||
break;
|
||||
|
||||
case ModSetting.AdjustedMovement:
|
||||
{
|
||||
ms_adjustedMovement = bool.Parse(p_value);
|
||||
AdjustedMovementChange?.Invoke(ms_adjustedMovement);
|
||||
AdjustedMovement = bool.Parse(p_value);
|
||||
AdjustedMovementChange?.Invoke(AdjustedMovement);
|
||||
}
|
||||
break;
|
||||
|
||||
case ModSetting.IKOverrideFly:
|
||||
{
|
||||
ms_ikOverrideFly = bool.Parse(p_value);
|
||||
IKOverrideFlyChange?.Invoke(ms_ikOverrideFly);
|
||||
IKOverrideFly = bool.Parse(p_value);
|
||||
IKOverrideFlyChange?.Invoke(IKOverrideFly);
|
||||
}
|
||||
break;
|
||||
|
||||
case ModSetting.IKOverrideJump:
|
||||
{
|
||||
ms_ikOverrideJump = bool.Parse(p_value);
|
||||
IKOverrideJumpChange?.Invoke(ms_ikOverrideJump);
|
||||
IKOverrideJump = bool.Parse(p_value);
|
||||
IKOverrideJumpChange?.Invoke(IKOverrideJump);
|
||||
}
|
||||
break;
|
||||
|
||||
case ModSetting.DetectEmotes:
|
||||
{
|
||||
ms_detectEmotes = bool.Parse(p_value);
|
||||
DetectEmotesChange?.Invoke(ms_detectEmotes);
|
||||
DetectEmotes = bool.Parse(p_value);
|
||||
DetectEmotesChange?.Invoke(DetectEmotes);
|
||||
}
|
||||
break;
|
||||
|
||||
case ModSetting.FollowHips:
|
||||
{
|
||||
ms_followHips = bool.Parse(p_value);
|
||||
FollowHipsChange?.Invoke(ms_followHips);
|
||||
}
|
||||
break;
|
||||
|
||||
case ModSetting.CollisionScale:
|
||||
{
|
||||
ms_collisionScale = bool.Parse(p_value);
|
||||
CollisionScaleChange?.Invoke(ms_collisionScale);
|
||||
FollowHips = bool.Parse(p_value);
|
||||
FollowHipsChange?.Invoke(FollowHips);
|
||||
}
|
||||
break;
|
||||
|
||||
case ModSetting.MassCenter:
|
||||
{
|
||||
ms_massCenter = bool.Parse(p_value);
|
||||
MassCenterChange?.Invoke(ms_massCenter);
|
||||
MassCenter = bool.Parse(p_value);
|
||||
MassCenterChange?.Invoke(MassCenter);
|
||||
}
|
||||
break;
|
||||
|
||||
case ModSetting.ScaledSteps:
|
||||
{
|
||||
ScaledSteps = bool.Parse(p_value);
|
||||
ScaledStepsChange?.Invoke(ScaledSteps);
|
||||
}
|
||||
break;
|
||||
|
||||
case ModSetting.CollisionScale:
|
||||
{
|
||||
CollisionScale = bool.Parse(p_value);
|
||||
CollisionScaleChange?.Invoke(CollisionScale);
|
||||
}
|
||||
break;
|
||||
|
||||
case ModSetting.OverrideFix:
|
||||
{
|
||||
ms_overrideFix = bool.Parse(p_value);
|
||||
OverrideFixChange?.Invoke(ms_overrideFix);
|
||||
OverrideFix = bool.Parse(p_value);
|
||||
OverrideFixChange?.Invoke(OverrideFix);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -232,58 +244,5 @@ namespace ml_amt
|
|||
ms_entries[(int)l_setting].BoxedValue = bool.Parse(p_value);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IKOverrideCrouch
|
||||
{
|
||||
get => ms_ikOverrideCrouch;
|
||||
}
|
||||
public static float CrouchLimit
|
||||
{
|
||||
get => ms_crouchLimit;
|
||||
}
|
||||
public static bool IKOverrideProne
|
||||
{
|
||||
get => ms_ikOverrideProne;
|
||||
}
|
||||
public static float ProneLimit
|
||||
{
|
||||
get => ms_proneLimit;
|
||||
}
|
||||
public static bool PoseTransitions
|
||||
{
|
||||
get => ms_poseTransitions;
|
||||
}
|
||||
public static bool AdjustedMovement
|
||||
{
|
||||
get => ms_adjustedMovement;
|
||||
}
|
||||
public static bool IKOverrideFly
|
||||
{
|
||||
get => ms_ikOverrideFly;
|
||||
}
|
||||
public static bool IKOverrideJump
|
||||
{
|
||||
get => ms_ikOverrideJump;
|
||||
}
|
||||
public static bool DetectEmotes
|
||||
{
|
||||
get => ms_detectEmotes;
|
||||
}
|
||||
public static bool FollowHips
|
||||
{
|
||||
get => ms_followHips;
|
||||
}
|
||||
public static bool CollisionScale
|
||||
{
|
||||
get => ms_collisionScale;
|
||||
}
|
||||
public static bool MassCenter
|
||||
{
|
||||
get => ms_massCenter;
|
||||
}
|
||||
public static bool OverrideFix
|
||||
{
|
||||
get => ms_overrideFix;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
using UnityEngine;
|
||||
using ABI_RC.Systems.IK;
|
||||
using System.Reflection;
|
||||
|
||||
namespace ml_amt
|
||||
{
|
||||
static class Utils
|
||||
{
|
||||
static MethodInfo ms_getSineKeyframes = typeof(RootMotion.FinalIK.IKSolverVR).GetMethod("GetSineKeyframes", BindingFlags.NonPublic | BindingFlags.Static);
|
||||
|
||||
public static bool IsInVR() => ((ABI_RC.Core.Savior.CheckVR.Instance != null) && ABI_RC.Core.Savior.CheckVR.Instance.hasVrDeviceLoaded);
|
||||
|
||||
// Extensions
|
||||
|
@ -12,5 +14,10 @@ namespace ml_amt
|
|||
{
|
||||
return Matrix4x4.TRS(p_pos ? p_transform.position : Vector3.zero, p_rot ? p_transform.rotation : Quaternion.identity, p_scl ? p_transform.localScale : Vector3.one);
|
||||
}
|
||||
|
||||
public static Keyframe[] GetSineKeyframes(float p_mag)
|
||||
{
|
||||
return (Keyframe[])ms_getSineKeyframes.Invoke(null, new object[] { p_mag });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -256,6 +256,13 @@ function inp_toggle_mod_amt(_obj, _callbackName) {
|
|||
<div id="MassCenter" class ="inp_toggle no-scroll" data-current="true"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class ="row-wrapper">
|
||||
<div class ="option-caption">Scaled locomotion steps: </div>
|
||||
<div class ="option-input">
|
||||
<div id="ScaledSteps" class ="inp_toggle no-scroll" data-current="true"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class ="row-wrapper">
|
||||
<div class ="option-caption">Alternative avatar collider scale: </div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue