docs.unity3d.com
    Show / Hide Table of Contents

    Class TrackedPoseDriver

    The TrackedPoseDriver component applies the current pose value of a tracked device to the Transform of the GameObject. TrackedPoseDriver can track multiple types of devices including XR HMDs, controllers, and remotes.

    Inheritance
    Object
    Object
    Component
    Behaviour
    MonoBehaviour
    TrackedPoseDriver
    Inherited Members
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(String, Single)
    MonoBehaviour.InvokeRepeating(String, Single, Single)
    MonoBehaviour.CancelInvoke(String)
    MonoBehaviour.IsInvoking(String)
    MonoBehaviour.StartCoroutine(String)
    MonoBehaviour.StartCoroutine(String, Object)
    MonoBehaviour.StartCoroutine(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, Component)
    Component.TryGetComponent<T>(T)
    Component.GetComponent(String)
    Component.GetComponentInChildren(Type, Boolean)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(Boolean)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, Boolean)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(Boolean)
    Component.GetComponentsInChildren<T>(Boolean, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, Boolean)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(Boolean)
    Component.GetComponentsInParent<T>(Boolean, 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, Boolean)
    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, Boolean)
    Object.Destroy(Object, Single)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, Boolean)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.DontDestroyOnLoad(Object)
    Object.FindObjectsOfType<T>()
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType(Type)
    Object.ToString()
    Object.name
    Object.hideFlags
    Namespace: UnityEngine.InputSystem.XR
    Syntax
    [Serializable]
    [AddComponentMenu("XR/Tracked Pose Driver (Input System)")]
    public class TrackedPoseDriver : MonoBehaviour, ISerializationCallbackReceiver
    Remarks

    For positionInput and rotationInput, if an action is directly defined in the InputActionProperty, as opposed to a reference to an action externally defined in an InputActionAsset, the action will automatically be enabled and disabled by this behavior during OnEnable() and OnDisable(). The enabled state for actions externally defined must be managed externally from this behavior.

    Properties

    ignoreTrackingState

    Ignore tracking state and always treat the input pose as valid when updating the Transform properties. The recommended value is false so the tracking state input is used.

    Declaration
    public bool ignoreTrackingState { get; set; }
    Property Value
    Type Description
    Boolean
    See Also
    trackingStateInput

    positionAction

    (Deprecated) The action to read the position value of a tracked device. Must support reading a value of type Vector3.

    Declaration
    public InputAction positionAction { get; set; }
    Property Value
    Type Description
    InputAction
    See Also
    positionInput

    positionInput

    The input action to read the position value of a tracked device. Must support reading a value of type Vector3.

    Declaration
    public InputActionProperty positionInput { get; set; }
    Property Value
    Type Description
    InputActionProperty
    See Also
    rotationInput

    rotationAction

    (Deprecated) The action to read the rotation value of a tracked device. Must support reading a value of type Quaternion.

    Declaration
    public InputAction rotationAction { get; set; }
    Property Value
    Type Description
    InputAction
    See Also
    rotationInput

    rotationInput

    The input action to read the rotation value of a tracked device. Must support reading a value of type Quaternion.

    Declaration
    public InputActionProperty rotationInput { get; set; }
    Property Value
    Type Description
    InputActionProperty
    See Also
    positionInput

    trackingStateInput

    The input action to read the tracking state value of a tracked device. Identifies if position and rotation have valid data. Must support reading a value of type Int32.

    Declaration
    public InputActionProperty trackingStateInput { get; set; }
    Property Value
    Type Description
    InputActionProperty
    Remarks

    See InputTrackingState enum for values the input action represents.

    • InputTrackingState.None (0)to indicate neither position nor rotation is valid.
    • InputTrackingState.Position (1)to indicate position is valid.
    • InputTrackingState.Rotation (2)to indicate rotation is valid.
    • InputTrackingState.Position | InputTrackingState.Rotation (3)to indicate position and rotation is valid.

    See Also
    ignoreTrackingState

    trackingType

    The tracking type being used by the Tracked Pose Driver to control which Transform properties to update.

    Declaration
    public TrackedPoseDriver.TrackingType trackingType { get; set; }
    Property Value
    Type Description
    TrackedPoseDriver.TrackingType
    See Also
    TrackedPoseDriver.TrackingType

    updateType

    The update type being used by the Tracked Pose Driver to control which phases of the player loop will update Transform properties.

    Declaration
    public TrackedPoseDriver.UpdateType updateType { get; set; }
    Property Value
    Type Description
    TrackedPoseDriver.UpdateType
    See Also
    TrackedPoseDriver.UpdateType

    Methods

    Awake()

    This function is called when the script instance is being loaded.

    Declaration
    protected virtual void Awake()

    OnBeforeRender()

    This method is called after the Input System has completed an update and processed all pending events when the type of update is BeforeRender.

    Declaration
    protected virtual void OnBeforeRender()

    OnDestroy()

    This function is called when the MonoBehaviour will be destroyed.

    Declaration
    protected virtual void OnDestroy()

    OnDisable()

    This function is called when the object becomes disabled or inactive.

    Declaration
    protected void OnDisable()

    OnEnable()

    This function is called when the object becomes enabled and active.

    Declaration
    protected void OnEnable()

    OnUpdate()

    This method is called after the Input System has completed an update and processed all pending events when the type of update is not BeforeRender.

    Declaration
    protected virtual void OnUpdate()

    PerformUpdate()

    Updates Transform properties with the current input pose values that have been read, constrained by tracking type and tracking state.

    Declaration
    protected virtual void PerformUpdate()
    See Also
    SetLocalTransform(Vector3, Quaternion)

    Reset()

    This function is called when the user hits the Reset button in the Inspector's context menu or when adding the component the first time. This function is only called in editor mode.

    Declaration
    protected void Reset()

    SetLocalTransform(Vector3, Quaternion)

    Updates Transform properties, constrained by tracking type and tracking state.

    Declaration
    protected virtual void SetLocalTransform(Vector3 newPosition, Quaternion newRotation)
    Parameters
    Type Name Description
    Vector3 newPosition

    The new local position to possibly set.

    Quaternion newRotation

    The new local rotation to possibly set.

    UpdateCallback()

    The callback method called after the Input System has completed an update and processed all pending events.

    Declaration
    protected void UpdateCallback()
    See Also
    onAfterUpdate

    Explicit Interface Implementations

    ISerializationCallbackReceiver.OnAfterDeserialize()

    Declaration
    void ISerializationCallbackReceiver.OnAfterDeserialize()
    Implements
    ISerializationCallbackReceiver.OnAfterDeserialize()

    ISerializationCallbackReceiver.OnBeforeSerialize()

    Declaration
    void ISerializationCallbackReceiver.OnBeforeSerialize()
    Implements
    ISerializationCallbackReceiver.OnBeforeSerialize()
    In This Article
    • Properties
      • ignoreTrackingState
      • positionAction
      • positionInput
      • rotationAction
      • rotationInput
      • trackingStateInput
      • trackingType
      • updateType
    • Methods
      • Awake()
      • OnBeforeRender()
      • OnDestroy()
      • OnDisable()
      • OnEnable()
      • OnUpdate()
      • PerformUpdate()
      • Reset()
      • SetLocalTransform(Vector3, Quaternion)
      • UpdateCallback()
    • Explicit Interface Implementations
      • ISerializationCallbackReceiver.OnAfterDeserialize()
      • ISerializationCallbackReceiver.OnBeforeSerialize()
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023