docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Class MetaAimHand

    A TrackedDevice based off the data exposed in the Meta Hand Tracking Aim extension. Enabled through Meta Hand Tracking Aim or by enabling hand-tracking in the Oculus plug-in if the Input System back-end is enabled.

    Inheritance
    object
    InputControl
    InputDevice
    TrackedDevice
    MetaAimHand
    Inherited Members
    TrackedDevice.trackingState
    TrackedDevice.isTracked
    TrackedDevice.devicePosition
    TrackedDevice.deviceRotation
    InputDevice.InvalidDeviceId
    InputDevice.ReadValueFromBufferAsObject(void*, int)
    InputDevice.ReadValueFromStateAsObject(void*)
    InputDevice.ReadValueFromStateIntoBuffer(void*, void*, int)
    InputDevice.CompareValue(void*, void*)
    InputDevice.MakeCurrent()
    InputDevice.OnAdded()
    InputDevice.OnRemoved()
    InputDevice.OnConfigurationChanged()
    InputDevice.ExecuteCommand<TCommand>(ref TCommand)
    InputDevice.ExecuteCommand(InputDeviceCommand*)
    InputDevice.description
    InputDevice.enabled
    InputDevice.canRunInBackground
    InputDevice.added
    InputDevice.remote
    InputDevice.native
    InputDevice.updateBeforeRender
    InputDevice.deviceId
    InputDevice.lastUpdateTime
    InputDevice.wasUpdatedThisFrame
    InputDevice.allControls
    InputDevice.valueType
    InputDevice.valueSizeInBytes
    InputDevice.all
    InputControl.m_StateBlock
    InputControl.ToString()
    InputControl.EvaluateMagnitude()
    InputControl.EvaluateMagnitude(void*)
    InputControl.WriteValueFromBufferIntoState(void*, int, void*)
    InputControl.WriteValueFromObjectIntoState(object, void*)
    InputControl.TryGetChildControl(string)
    InputControl.TryGetChildControl<TControl>(string)
    InputControl.GetChildControl(string)
    InputControl.GetChildControl<TControl>(string)
    InputControl.RefreshConfigurationIfNeeded()
    InputControl.RefreshConfiguration()
    InputControl.CalculateOptimizedControlDataType()
    InputControl.ApplyParameterChanges()
    InputControl.name
    InputControl.displayName
    InputControl.shortDisplayName
    InputControl.path
    InputControl.layout
    InputControl.variants
    InputControl.device
    InputControl.parent
    InputControl.children
    InputControl.usages
    InputControl.aliases
    InputControl.stateBlock
    InputControl.noisy
    InputControl.synthetic
    InputControl.this[string]
    InputControl.magnitude
    InputControl.currentStatePtr
    InputControl.previousFrameStatePtr
    InputControl.defaultStatePtr
    InputControl.noiseMaskPtr
    InputControl.stateOffsetRelativeToDeviceRoot
    InputControl.optimizedControlDataType
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: UnityEngine.XR.Hands
    Assembly: solution.dll
    Syntax
    [Preserve]
    [InputControlLayout(displayName = "Meta Aim Hand", commonUsages = new string[] { "LeftHand", "RightHand" })]
    public class MetaAimHand : TrackedDevice
    Remarks

    For this type to function, you must enable hand-tracking and be running with either the OpenXR or Oculus plug-in.

    The devicePosition and deviceRotation inherited from TrackedDevice represent the aim pose. You can use these values to discover the target for pinch gestures, when appropriate.

    Use the XROrigin in the scene to position and orient the device properly. If you are using this data to set the Transform of a GameObject in the scene hierarchy, you can set the local position and rotation of the Transform and make it a child of the CameraOffset object below the XROrigin. Otherwise, you can use the Transform of the CameraOffset to transform the data into world space.

    Fields

    Name Description
    pressThreshold

    The pinch amount required to register as being pressed for the purposes of indexPressed, middlePressed, ringPressed, and littlePressed.

    Properties

    Name Description
    aimFlags

    Cast the result of reading this to MetaAimFlags to examine the value.

    indexPressed

    A 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 pressThreshold).

    left

    The left-hand InputDevice that contains InputControls that surface data in the Meta Hand Tracking Aim extension.

    littlePressed

    A 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 pressThreshold).

    middlePressed

    A 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 pressThreshold).

    pinchStrengthIndex

    An AxisControl that represents the pinch strength between the index finger and the thumb.

    pinchStrengthLittle

    An AxisControl that represents the pinch strength between the little finger and the thumb.

    pinchStrengthMiddle

    An AxisControl that represents the pinch strength between the middle finger and the thumb.

    pinchStrengthRing

    An AxisControl that represents the pinch strength between the ring finger and the thumb.

    right

    The right-hand InputDevice that contains InputControls that surface data in the Meta Hand Tracking Aim extension.

    ringPressed

    A 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 pressThreshold).

    Methods

    Name Description
    CreateHand(InputDeviceCharacteristics)

    Creates a MetaAimHand and adds it to the Input System.

    FinishSetup()

    Perform final initialization tasks after the control hierarchy has been put into place.

    UpdateHand(bool, MetaAimFlags, Pose, float, float, float, float)

    Queues update events in the Input System based on the supplied hand. It is not recommended that you call this directly. This will be called for you when appropriate.

    UpdateHand(MetaAimFlags, Pose, float, float, float, float)

    Queues update events in the Input System based on the supplied hand. It is not recommended that you call this directly. This will be called for you when appropriate.

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)