#if UNITY_OPENXR_PACKAGE || PACKAGE_DOCS_GENERATION using System; using System.Collections.Generic; using System.Runtime.InteropServices; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.InputSystem.Layouts; using UnityEngine.InputSystem.XR; using UnityEngine.Scripting; using UnityEngine.XR.Hands; using UnityEngine.XR.Management; using UnityEngine.XR.OpenXR; using UnityEngine.XR.OpenXR.Input; using UnityEngine.XR.OpenXR.Features; #if UNITY_EDITOR using UnityEditor; #endif namespace UnityEngine.XR.Hands.OpenXR { public partial class MetaHandTrackingAim { /// /// (Deprecated) The left-hand that contains /// s that surface data in the Meta Hand /// Tracking Aim extension. /// [Obsolete("Use MetaAimHand.left instead. (UnityUpgradable) -> UnityEngine.XR.Hands.MetaAimHand.left", true)] public static MetaAimHand leftHand => null; /// /// (Deprecated) The right-hand that contains /// s that surface data in the Meta Hand /// Tracking Aim extension. /// [Obsolete("Use MetaAimHand.right instead. (UnityUpgradable) -> UnityEngine.XR.Hands.MetaAimHand.right", true)] public static MetaAimHand rightHand => null; /// /// (Deprecated) Use instead. /// [Obsolete("Use UnityEngine.XR.Hands.MetaAimFlags instead.")] [Flags] public enum AimFlags : ulong { /// /// No flags are valid. /// None = 0, /// /// Data for this hand has been computed. /// Computed = 1 << 0, /// /// The aim pose is valid. Retrieve this data from /// and /// that /// inherits. /// Valid = 1 << 1, /// /// Indicates whether the index finger is pinching with the thumb. /// Only valid when the pinch strength retrieved from /// is /// at a full strength of 1.0. /// IndexPinching = 1 << 2, /// /// Indicates whether the middle finger is pinching with the thumb. /// Only valid when the pinch strength retrieved from /// is /// at a full strength of 1.0. /// MiddlePinching = 1 << 3, /// /// Indicates whether the ring finger is pinching with the thumb. /// Only valid when the pinch strength retrieved from /// is /// at a full strength of 1.0. /// RingPinching = 1 << 4, /// /// Indicates whether the little finger is pinching with the thumb. /// Only valid when the pinch strength retrieved from /// is /// at a full strength of 1.0. /// LittlePinching = 1 << 5, /// /// Indicates whether a system gesture is being performed (when the /// palm of the hand is facing the headset). /// SystemGesture = 1 << 6, /// /// Indicates whether the hand these flags were retrieved from is /// the dominant hand. /// DominantHand = 1 << 7, /// /// Indicates whether the menu gesture button is pressed. /// MenuPressed = 1 << 8, } /// /// (Deprecated) A based off the data exposed in the Meta Hand Tracking Aim extension. /// Use instead of . /// [Preserve, InputControlLayout(displayName = "Meta Aim Hand (OpenXR)", commonUsages = new[] { "LeftHand", "RightHand" })] [Obsolete("Use the UnityEngine.XR.Hands.MetaAimHand instead. (UnityUpgradable) -> UnityEngine.XR.Hands.MetaAimHand", true)] public class MetaAimHand : TrackedDevice { /// /// The pinch amount required to register as being pressed for the /// purposes of , , /// , and . /// public const float pressThreshold = 0.8f; /// /// A [ButtonControl](xref:UnityEngine.InputSystem.Controls.ButtonControl) /// that represents whether the pinch between the index finger and /// the thumb is mostly pressed (greater than a threshold of 0.8 /// contained in ). /// [Preserve, InputControl(offset = 0)] public ButtonControl indexPressed { get; private set; } /// /// A [ButtonControl](xref:UnityEngine.InputSystem.Controls.ButtonControl) /// that represents whether the pinch between the middle finger and /// the thumb is mostly pressed (greater than a threshold of 0.8 /// contained in ). /// [Preserve, InputControl(offset = 1)] public ButtonControl middlePressed { get; private set; } /// /// A [ButtonControl](xref:UnityEngine.InputSystem.Controls.ButtonControl) /// that represents whether the pinch between the ring finger and /// the thumb is mostly pressed (greater than a threshold of 0.8 /// contained in ). /// [Preserve, InputControl(offset = 2)] public ButtonControl ringPressed { get; private set; } /// /// A [ButtonControl](xref:UnityEngine.InputSystem.Controls.ButtonControl) /// that represents whether the pinch between the little finger and /// the thumb is mostly pressed (greater than a threshold of 0.8 /// contained in ). /// [Preserve, InputControl(offset = 3)] public ButtonControl littlePressed { get; private set; } /// /// (Deprecated) Cast the result of reading this to to examine the value. /// Use instead of . /// [Preserve, InputControl] public IntegerControl aimFlags { get; private set; } /// /// An [AxisControl](xref:UnityEngine.InputSystem.Controls.AxisControl) /// that represents the pinch strength between the index finger and /// the thumb. /// /// /// A value of 0 denotes no pinch at all, while a value of /// 1 denotes a full pinch. /// [Preserve, InputControl] public AxisControl pinchStrengthIndex { get; private set; } /// /// An [AxisControl](xref:UnityEngine.InputSystem.Controls.AxisControl) /// that represents the pinch strength between the middle finger and /// the thumb. /// /// /// A value of 0 denotes no pinch at all, while a value of /// 1 denotes a full pinch. /// [Preserve, InputControl] public AxisControl pinchStrengthMiddle { get; private set; } /// /// An [AxisControl](xref:UnityEngine.InputSystem.Controls.AxisControl) /// that represents the pinch strength between the ring finger and /// the thumb. /// /// /// A value of 0 denotes no pinch at all, while a value of /// 1 denotes a full pinch. /// [Preserve, InputControl] public AxisControl pinchStrengthRing { get; private set; } /// /// An [AxisControl](xref:UnityEngine.InputSystem.Controls.AxisControl) /// that represents the pinch strength between the little finger and /// the thumb. /// /// /// A value of 0 denotes no pinch at all, while a value of /// 1 denotes a full pinch. /// [Preserve, InputControl] public AxisControl pinchStrengthLittle { get; private set; } /// /// Perform final initialization tasks after the control hierarchy has been put into place. /// protected override void FinishSetup() => base.FinishSetup(); } } } #endif // UNITY_OPENXR_PACKAGE || PACKAGE_DOCS_GENERATION