private void OnTouchStart(VRC_Pickup.PickupHand hand) { var time = Time.time; if (time - lastTouchStartTime < throttlingDelay) { return; } lastTouchStartTime = time; if ((hand == VRC_Pickup.PickupHand.None || !knobMode) && eventTarget != null && (!ownerOnly || Networking.IsOwner(eventTarget.gameObject))) { PlaySound(); SendCustomEventToTarget(eventName); } if (enableHaptics) { PlayHaptic(hand); } if (hand != VRC_Pickup.PickupHand.None) { inverseHandRotaion = Quaternion.Inverse(Networking.LocalPlayer.GetTrackingData(hand == VRC_Pickup.PickupHand.Left ? VRCPlayerApi.TrackingDataType.LeftHand : VRCPlayerApi.TrackingDataType.RightHand).rotation); } }
public VRC_Pickup GetHeldPickup(VRC_Pickup.PickupHand hand) { if (hand == VRC_Pickup.PickupHand.Right) { return(currentPickup_?.GetComponent <VRC_Pickup>()); } return(null); }
public static void PlayHapticEventInHand(VRCPlayerApi player, VRC_Pickup.PickupHand hand, float f1, float f2, float f3) { if (!player.isLocal) { player.LogWarning("[VRCPlayerAPI.PlayHapticEventInHand] PlayHapticEventInHand for remote players will do nothing."); return; } // TODO }
private bool DetectTouch(VRC_Pickup.PickupHand hand, Vector3 switchPosition, float radius) { var isLeft = hand == VRC_Pickup.PickupHand.Left; var localPlayer = Networking.LocalPlayer; var distalPosition = localPlayer.GetBonePosition(isLeft ? HumanBodyBones.LeftIndexDistal : HumanBodyBones.RightIndexDistal); var intermediatePosition = localPlayer.GetBonePosition(isLeft ? HumanBodyBones.LeftIndexIntermediate : HumanBodyBones.RightIndexIntermediate); var tipPosition = distalPosition + distalPosition - intermediatePosition; return((switchPosition - tipPosition).sqrMagnitude < Mathf.Pow(radius, 2)); }
// Token: 0x060051E7 RID: 20967 RVA: 0x001C0B68 File Offset: 0x001BEF68 public static void PlayHapticEventInHand(VRC_PlayerApi player, VRC_Pickup.PickupHand hand, float duration, float amplitude, float frequency) { VRCHandGrasper[] graspers = InternalSDKPlayer.GetGraspers(player); if (graspers.Length == 2) { if (hand != VRC_Pickup.PickupHand.Right) { if (hand == VRC_Pickup.PickupHand.Left) { if (graspers[0] != null) { graspers[0].HapticEvent(duration, amplitude, frequency); } } } else if (graspers[1] != null) { graspers[1].HapticEvent(duration, amplitude, frequency); } } }
// Token: 0x060051E5 RID: 20965 RVA: 0x001C0B14 File Offset: 0x001BEF14 public static VRC_Pickup GetPickupInHand(VRC_PlayerApi player, VRC_Pickup.PickupHand hand) { VRC_Pickup result = null; VRCHandGrasper[] graspers = InternalSDKPlayer.GetGraspers(player); if (graspers.Length == 2) { if (hand != VRC_Pickup.PickupHand.Right) { if (hand == VRC_Pickup.PickupHand.Left) { result = graspers[0].GetGraspedPickup(); } } else { result = graspers[1].GetGraspedPickup(); } } return(result); }
public static VRC_Pickup GetPickupInHand(VRCPlayerApi player, VRC_Pickup.PickupHand hand) { return(player.GetPlayerController().GetHeldPickup(hand)); }
private void PlayHaptic(VRC_Pickup.PickupHand hand) { Networking.LocalPlayer.PlayHapticEventInHand(hand, hapticDuration, hapticAmplitude, hapticFrequency); }
public void PlayHapticEventInHand(VRC_Pickup.PickupHand hand, float duration, float amplitude, float frequency) { _PlayHapticEventInHand(this, hand, duration, amplitude, frequency); }
public void SetPickupInHand(VRC_Pickup pickup, VRC_Pickup.PickupHand hand) { }
public VRC_Pickup GetPickupInHand(VRC_Pickup.PickupHand hand) { return(_GetPickupInHand(this, hand)); }
public static void PlayHapticEventInHand(VRCPlayerApi player, VRC_Pickup.PickupHand hand, float f1, float f2, float f3) { // TODO }
// Token: 0x060051E6 RID: 20966 RVA: 0x001C0B63 File Offset: 0x001BEF63 public static void SetPickupInHand(VRC_PlayerApi player, VRC_Pickup pickup, VRC_Pickup.PickupHand hand) { }