docs.unity.cn
    Show / Hide Table of Contents

    Class TrackedPoseDriver

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

    Inheritance
    Object
    TrackedPoseDriver
    Namespace: UnityEngine.InputSystem.XR
    Syntax
    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

    positionAction

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

    positionInput

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

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

    rotationAction

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

    rotationInput

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

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

    trackingType

    The tracking type being used by the Tracked Pose Driver to control which 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 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()

    Declaration
    protected virtual void OnBeforeRender()

    OnDestroy()

    This function is called when the 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()

    Declaration
    protected virtual void OnUpdate()

    PerformUpdate()

    Declaration
    protected virtual void PerformUpdate()

    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)

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

    UpdateCallback()

    Declaration
    protected void UpdateCallback()
    Back to top Copyright © 2021 Unity Technologies
    Generated by DocFX
    on Tuesday, November 2, 2021
    Terms of use