mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-03 10:29:22 +00:00
LeapCSharp update to 6.14.0
Fixed interaction input
This commit is contained in:
parent
f3aa0bc72d
commit
56686834d0
32 changed files with 89 additions and 34 deletions
|
@ -1,4 +1,5 @@
|
|||
using ABI_RC.Core.InteractionSystem;
|
||||
using ABI.CCK.Components;
|
||||
using ABI_RC.Core.InteractionSystem;
|
||||
using ABI_RC.Core.Player;
|
||||
using ABI_RC.Core.Savior;
|
||||
using ABI_RC.Systems.IK;
|
||||
|
@ -34,11 +35,13 @@ namespace ml_lme
|
|||
|
||||
m_handRayLeft = LeapTracking.Instance.GetLeftHand().gameObject.AddComponent<ControllerRay>();
|
||||
m_handRayLeft.hand = true;
|
||||
m_handRayLeft.generalMask = -1485;
|
||||
m_handRayLeft.generalMask = -269;
|
||||
m_handRayLeft.isInteractionRay = true;
|
||||
m_handRayLeft.triggerGazeEvents = false;
|
||||
m_handRayLeft.holderRoot = m_handRayLeft.gameObject;
|
||||
m_handRayLeft.attachmentDistance = 0f;
|
||||
m_handRayLeft.uiMask = 32;
|
||||
m_handRayLeft.isDesktopRay = true;
|
||||
|
||||
m_lineLeft = m_handRayLeft.gameObject.AddComponent<LineRenderer>();
|
||||
m_lineLeft.endWidth = 1f;
|
||||
|
@ -54,11 +57,13 @@ namespace ml_lme
|
|||
|
||||
m_handRayRight = LeapTracking.Instance.GetRightHand().gameObject.AddComponent<ControllerRay>();
|
||||
m_handRayRight.hand = false;
|
||||
m_handRayRight.generalMask = -1485;
|
||||
m_handRayRight.generalMask = -269;
|
||||
m_handRayRight.isInteractionRay = true;
|
||||
m_handRayRight.triggerGazeEvents = false;
|
||||
m_handRayRight.holderRoot = m_handRayRight.gameObject;
|
||||
m_handRayRight.attachmentDistance = 0f;
|
||||
m_handRayRight.uiMask = 32;
|
||||
m_handRayRight.isDesktopRay = true;
|
||||
|
||||
m_lineRight = m_handRayRight.gameObject.AddComponent<LineRenderer>();
|
||||
m_lineRight.endWidth = 1f;
|
||||
|
@ -72,6 +77,9 @@ namespace ml_lme
|
|||
m_lineRight.receiveShadows = false;
|
||||
m_handRayRight.lineRenderer = m_lineRight;
|
||||
|
||||
m_handRayLeft.otherRay = m_handRayRight;
|
||||
m_handRayRight.otherRay = m_handRayLeft;
|
||||
|
||||
Settings.EnabledChange += this.OnEnableChange;
|
||||
Settings.InteractionChange += this.OnInteractionChange;
|
||||
Settings.GesturesChange += this.OnGesturesChange;
|
||||
|
@ -108,8 +116,11 @@ namespace ml_lme
|
|||
|
||||
m_lineLeft.material = PlayerSetup.Instance.vrRayLeft.lineRenderer.material;
|
||||
m_lineLeft.gameObject.layer = PlayerSetup.Instance.vrRayLeft.gameObject.layer;
|
||||
m_handRayLeft.highlightMaterial = PlayerSetup.Instance.vrRayLeft.highlightMaterial;
|
||||
|
||||
m_lineRight.material = PlayerSetup.Instance.vrRayLeft.lineRenderer.material;
|
||||
m_lineRight.gameObject.layer = PlayerSetup.Instance.vrRayLeft.gameObject.layer;
|
||||
m_handRayLeft.highlightMaterial = PlayerSetup.Instance.vrRayLeft.highlightMaterial;
|
||||
}
|
||||
|
||||
public override void ModuleDestroyed()
|
||||
|
@ -413,6 +424,23 @@ namespace ml_lme
|
|||
m_handRayRight.SetRayScale(p_scale);
|
||||
}
|
||||
|
||||
internal void OnPickupGrab(CVRPickupObject p_pickup)
|
||||
{
|
||||
if(p_pickup.gripType == CVRPickupObject.GripType.Origin)
|
||||
{
|
||||
if(p_pickup._controllerRay == m_handRayLeft)
|
||||
{
|
||||
m_handRayLeft.attachmentPoint.localPosition = Vector3.zero;
|
||||
m_handRayLeft.attachmentPoint.localRotation = Quaternion.Euler(0f, 0f, 270f);
|
||||
}
|
||||
if(p_pickup._controllerRay == m_handRayRight)
|
||||
{
|
||||
m_handRayRight.attachmentPoint.localPosition = Vector3.zero;
|
||||
m_handRayRight.attachmentPoint.localRotation = Quaternion.Euler(0f, 0f, 90f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Arbitrary
|
||||
void SetFingersInput(LeapParser.HandData p_hand, bool p_left)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using ABI_RC.Core.Player;
|
||||
using ABI.CCK.Components;
|
||||
using ABI_RC.Core.Player;
|
||||
using ABI_RC.Systems.InputManagement;
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
@ -196,6 +197,11 @@ namespace ml_lme
|
|||
m_leapTracking.OnPlayspaceScale(p_relation);
|
||||
}
|
||||
|
||||
internal void OnPickupGrab(CVRPickupObject p_pickup)
|
||||
{
|
||||
m_leapInput?.OnPickupGrab(p_pickup);
|
||||
}
|
||||
|
||||
// Arbitrary
|
||||
void UpdateDeviceTrackingMode()
|
||||
{
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using ABI_RC.Core.Player;
|
||||
using ABI.CCK.Components;
|
||||
using ABI_RC.Core.Player;
|
||||
using System.Collections;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
|
@ -42,6 +43,12 @@ namespace ml_lme
|
|||
null,
|
||||
new HarmonyLib.HarmonyMethod(typeof(LeapMotionExtension).GetMethod(nameof(OnPlayspaceScale_Postfix), BindingFlags.Static | BindingFlags.NonPublic))
|
||||
);
|
||||
HarmonyInstance.Patch(
|
||||
|
||||
typeof(CVRPickupObject).GetMethod(nameof(CVRPickupObject.Grab), BindingFlags.Public | BindingFlags.Instance),
|
||||
null,
|
||||
new HarmonyLib.HarmonyMethod(typeof(LeapMotionExtension).GetMethod(nameof(OnPickupGrab_Postfix), BindingFlags.Static | BindingFlags.NonPublic))
|
||||
);
|
||||
|
||||
ModSupporter.Init();
|
||||
MelonLoader.MelonCoroutines.Start(WaitForRootLogic());
|
||||
|
@ -121,5 +128,19 @@ namespace ml_lme
|
|||
MelonLoader.MelonLogger.Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
static void OnPickupGrab_Postfix(ref CVRPickupObject __instance) => ms_instance?.OnPickupGrab(__instance);
|
||||
void OnPickupGrab(CVRPickupObject p_pickup)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(m_leapManager != null)
|
||||
m_leapManager.OnPickupGrab(p_pickup);
|
||||
}
|
||||
catch(System.Exception e)
|
||||
{
|
||||
MelonLoader.MelonLogger.Error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
2
ml_lme/vendor/LeapCSharp/Arm.cs
vendored
2
ml_lme/vendor/LeapCSharp/Arm.cs
vendored
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
2
ml_lme/vendor/LeapCSharp/Bone.cs
vendored
2
ml_lme/vendor/LeapCSharp/Bone.cs
vendored
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
2
ml_lme/vendor/LeapCSharp/CSharpExtensions.cs
vendored
2
ml_lme/vendor/LeapCSharp/CSharpExtensions.cs
vendored
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
2
ml_lme/vendor/LeapCSharp/Config.cs
vendored
2
ml_lme/vendor/LeapCSharp/Config.cs
vendored
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
2
ml_lme/vendor/LeapCSharp/Connection.cs
vendored
2
ml_lme/vendor/LeapCSharp/Connection.cs
vendored
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
2
ml_lme/vendor/LeapCSharp/Controller.cs
vendored
2
ml_lme/vendor/LeapCSharp/Controller.cs
vendored
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
2
ml_lme/vendor/LeapCSharp/Device.cs
vendored
2
ml_lme/vendor/LeapCSharp/Device.cs
vendored
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
2
ml_lme/vendor/LeapCSharp/DeviceList.cs
vendored
2
ml_lme/vendor/LeapCSharp/DeviceList.cs
vendored
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
2
ml_lme/vendor/LeapCSharp/DistortionData.cs
vendored
2
ml_lme/vendor/LeapCSharp/DistortionData.cs
vendored
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
2
ml_lme/vendor/LeapCSharp/Events.cs
vendored
2
ml_lme/vendor/LeapCSharp/Events.cs
vendored
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
2
ml_lme/vendor/LeapCSharp/FailedDevice.cs
vendored
2
ml_lme/vendor/LeapCSharp/FailedDevice.cs
vendored
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
2
ml_lme/vendor/LeapCSharp/FailedDeviceList.cs
vendored
2
ml_lme/vendor/LeapCSharp/FailedDeviceList.cs
vendored
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
2
ml_lme/vendor/LeapCSharp/Finger.cs
vendored
2
ml_lme/vendor/LeapCSharp/Finger.cs
vendored
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
2
ml_lme/vendor/LeapCSharp/Frame.cs
vendored
2
ml_lme/vendor/LeapCSharp/Frame.cs
vendored
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
2
ml_lme/vendor/LeapCSharp/Hand.cs
vendored
2
ml_lme/vendor/LeapCSharp/Hand.cs
vendored
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
2
ml_lme/vendor/LeapCSharp/IController.cs
vendored
2
ml_lme/vendor/LeapCSharp/IController.cs
vendored
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
2
ml_lme/vendor/LeapCSharp/Image.cs
vendored
2
ml_lme/vendor/LeapCSharp/Image.cs
vendored
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
2
ml_lme/vendor/LeapCSharp/ImageData.cs
vendored
2
ml_lme/vendor/LeapCSharp/ImageData.cs
vendored
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
2
ml_lme/vendor/LeapCSharp/LeapC.cs
vendored
2
ml_lme/vendor/LeapCSharp/LeapC.cs
vendored
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
2
ml_lme/vendor/LeapCSharp/LeapTransform.cs
vendored
2
ml_lme/vendor/LeapCSharp/LeapTransform.cs
vendored
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
2
ml_lme/vendor/LeapCSharp/Logger.cs
vendored
2
ml_lme/vendor/LeapCSharp/Logger.cs
vendored
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
2
ml_lme/vendor/LeapCSharp/MemoryManager.cs
vendored
2
ml_lme/vendor/LeapCSharp/MemoryManager.cs
vendored
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
2
ml_lme/vendor/LeapCSharp/MessageSeverity.cs
vendored
2
ml_lme/vendor/LeapCSharp/MessageSeverity.cs
vendored
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
2
ml_lme/vendor/LeapCSharp/PointMapping.cs
vendored
2
ml_lme/vendor/LeapCSharp/PointMapping.cs
vendored
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
2
ml_lme/vendor/LeapCSharp/StructMarshal.cs
vendored
2
ml_lme/vendor/LeapCSharp/StructMarshal.cs
vendored
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2023. *
|
||||
* Copyright (C) Ultraleap, Inc. 2011-2024. *
|
||||
* *
|
||||
* Use subject to the terms of the Apache License 2.0 available at *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue