docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Class XRHandSkeletonDriver

    Controls a hierarchy of Transforms driven by joints in an XRHand. This component subscribes to events from an XRHandTrackingEvents component to move and rotate the joints when the hand is updated.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    XRHandSkeletonDriver
    Implements
    ISerializationCallbackReceiver
    Inherited Members
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(string, float)
    MonoBehaviour.InvokeRepeating(string, float, float)
    MonoBehaviour.CancelInvoke(string)
    MonoBehaviour.IsInvoking(string)
    MonoBehaviour.StartCoroutine(string)
    MonoBehaviour.StartCoroutine(string, object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StartCoroutine_Auto(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(string)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(object)
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, out Component)
    Component.TryGetComponent<T>(out T)
    Component.GetComponent(string)
    Component.GetComponentInChildren(Type, bool)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(bool)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, bool)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(bool)
    Component.GetComponentsInChildren<T>(bool, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type, bool)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>(bool)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, bool)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(bool)
    Component.GetComponentsInParent<T>(bool, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.CompareTag(string)
    Component.SendMessageUpwards(string, object, SendMessageOptions)
    Component.SendMessageUpwards(string, object)
    Component.SendMessageUpwards(string)
    Component.SendMessageUpwards(string, SendMessageOptions)
    Component.SendMessage(string, object)
    Component.SendMessage(string)
    Component.SendMessage(string, object, SendMessageOptions)
    Component.SendMessage(string, SendMessageOptions)
    Component.BroadcastMessage(string, object, SendMessageOptions)
    Component.BroadcastMessage(string, object)
    Component.BroadcastMessage(string)
    Component.BroadcastMessage(string, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    object.MemberwiseClone()
    Namespace: UnityEngine.XR.Hands
    Assembly: solution.dll
    Syntax
    [HelpURL("https://docs.unity.cn/Packages/com.unity.xr.hands@1.4/api/UnityEngine.XR.Hands.XRHandSkeletonDriver.html")]
    public class XRHandSkeletonDriver : MonoBehaviour, ISerializationCallbackReceiver

    Fields

    Name Description
    m_HasJointTransformMask

    An array of booleans tracking which joint indexes have a valid transform to drive. This is calculated once when the references change to avoid a null check every time the joint is updated.

    m_HasRootTransform

    A boolean tracking whether the root transform is valid. This is calculated once when the root transform changes to avoid a null check every time the root is updated.

    m_JointLocalPoses

    The array of joint local poses indexed by the XRHandJointID which is updated by the method UpdateJointLocalPoses(XRHandJointsUpdatedEventArgs) and then applied to the joint transforms by the method ApplyUpdatedTransformPoses().

    m_JointTransformReferences

    The list of joint to transform references

    m_JointTransforms

    The array of joint data indexed by the XRHandJointID which is accessible via ToIndex(XRHandJointID).

    Properties

    Name Description
    handTrackingEvents

    The XRHandTrackingEvents component that will be the source of hand tracking events for this driver.

    hasRootOffset

    Bool tracking whether the root requires an offset to be applied to it.

    jointTransformReferences

    The serialized list of XRHandJointID with a reference to a transform to drive. After this list is finished being assigned or modified, use the method InitializeFromSerializedReferences() to update the runtime mapping of transforms to drive.

    rootOffset

    Offset translation applied to hand root position.

    rootTransform

    The Transform that will be driven by the hand's root position and rotation.

    Methods

    Name Description
    ApplyRootPoseOffset(Vector3)

    Applies an offset to the root pose of the hand skeleton. This can be used to adjust the position of the hand in situations where you want the hand visual to stop moving when interacting with an object. The offset is applied in the local space of the hand's root transform.

    ApplyUpdatedTransformPoses()

    Applies the values in the m_JointLocalPoses array to the m_JointTransforms array.

    FindJointsFromRoot(List<string>)

    Finds the joint transform references from the root.

    InitializeFromSerializedReferences()

    Converts the serialized list jointTransformReferences to a mapping of Transforms to drive. This method is called automatically via OnAfterDeserialize. It can be called manually after the list of Transform references is modified at runtime to apply the changes.

    OnDisable()

    See MonoBehaviour. MonoBehaviour OnDisable method that unsubscribes from hand tracking events and disposes the joint local poses array.

    OnEnable()

    See MonoBehaviour. MonoBehaviour OnEnable method that subscribes to hand tracking events and allocates the joint local poses array.

    OnJointsUpdated(XRHandJointsUpdatedEventArgs)

    Updates all the joints of the hand. This method calls UpdateJointLocalPoses(XRHandJointsUpdatedEventArgs) to calculate the local poses of the joints and then immediately calls ApplyUpdatedTransformPoses() to apply the changes to the joint Transforms.

    OnRootPoseUpdated(Pose)

    Update the rootTransform's local position and rotation with the hand's root pose.

    Reset()

    See MonoBehaviour.

    ResetRootPoseOffset()

    Resets the offset of the root pose of the hand skeleton back to zero. This can be used to remove any previously applied offset, restoring the hand's root pose to its original position.

    UpdateJointLocalPoses(XRHandJointsUpdatedEventArgs)

    Calculates the local poses for all the joints in the hand using the standard parent hierarchy. Call this method to update the m_JointLocalPoses array with the latest joint data.

    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)