mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-03 18:39:23 +00:00
Grounded for jump
This commit is contained in:
parent
a2ce54f2fe
commit
0a298b853b
3 changed files with 10 additions and 6 deletions
|
@ -10,8 +10,9 @@ namespace ml_amt
|
|||
[DisallowMultipleComponent]
|
||||
class MotionTweaker : MonoBehaviour
|
||||
{
|
||||
static readonly FieldInfo ms_rootVelocity = typeof(IKSolverVR).GetField("rootVelocity", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
static readonly FieldInfo ms_grounded = typeof(MovementSystem).GetField("_isGrounded", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
static readonly FieldInfo ms_groundedRaw = typeof(MovementSystem).GetField("_isGroundedRaw", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
static readonly FieldInfo ms_rootVelocity = typeof(IKSolverVR).GetField("rootVelocity", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
static readonly int ms_emoteHash = Animator.StringToHash("Emote");
|
||||
|
||||
enum ParameterType
|
||||
|
@ -54,6 +55,7 @@ namespace ml_amt
|
|||
float m_upright = 1f;
|
||||
PoseState m_poseState = PoseState.Standing;
|
||||
bool m_grounded = false;
|
||||
bool m_groundedRaw = false;
|
||||
|
||||
bool m_ikOverrideCrouch = true;
|
||||
float m_crouchLimit = 0.65f;
|
||||
|
@ -111,7 +113,8 @@ namespace ml_amt
|
|||
{
|
||||
if(m_avatarReady)
|
||||
{
|
||||
m_grounded = (bool)ms_groundedRaw.GetValue(MovementSystem.Instance);
|
||||
m_grounded = (bool)ms_grounded.GetValue(MovementSystem.Instance);
|
||||
m_groundedRaw = (bool)ms_groundedRaw.GetValue(MovementSystem.Instance);
|
||||
|
||||
// Update upright
|
||||
Matrix4x4 l_hmdMatrix = PlayerSetup.Instance.transform.GetMatrix().inverse * (PlayerSetup.Instance._inVr ? PlayerSetup.Instance.vrHeadTracker.transform.GetMatrix() : PlayerSetup.Instance.desktopCameraRig.transform.GetMatrix());
|
||||
|
@ -204,6 +207,7 @@ namespace ml_amt
|
|||
m_vrIk = null;
|
||||
m_locomotionLayer = -1;
|
||||
m_grounded = false;
|
||||
m_groundedRaw = false;
|
||||
m_avatarReady = false;
|
||||
m_compatibleAvatar = false;
|
||||
m_poseState = PoseState.Standing;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyTitle("AvatarMotionTweaker")]
|
||||
[assembly: AssemblyVersion("1.1.6")]
|
||||
[assembly: AssemblyFileVersion("1.1.6")]
|
||||
[assembly: AssemblyVersion("1.1.7")]
|
||||
[assembly: AssemblyFileVersion("1.1.7")]
|
||||
|
||||
[assembly: MelonLoader.MelonInfo(typeof(ml_amt.AvatarMotionTweaker), "AvatarMotionTweaker", "1.1.6", "SDraw", "https://github.com/SDraw/ml_mods_cvr")]
|
||||
[assembly: MelonLoader.MelonInfo(typeof(ml_amt.AvatarMotionTweaker), "AvatarMotionTweaker", "1.1.7", "SDraw", "https://github.com/SDraw/ml_mods_cvr")]
|
||||
[assembly: MelonLoader.MelonGame(null, "ChilloutVR")]
|
||||
[assembly: MelonLoader.MelonPlatform(MelonLoader.MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
|
||||
[assembly: MelonLoader.MelonPlatformDomain(MelonLoader.MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
|
Loading…
Add table
Add a link
Reference in a new issue