docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class PoseControl

    A control representing a Pose in 3D space, relative to an XR tracking origin

    Inheritance
    object
    InputControl
    InputControl<PoseState>
    PoseControl
    Inherited Members
    InputControl<PoseState>.valueType
    InputControl<PoseState>.valueSizeInBytes
    InputControl<PoseState>.value
    InputControl<PoseState>.ReadValue()
    InputControl<PoseState>.ReadValueFromPreviousFrame()
    InputControl<PoseState>.ReadDefaultValue()
    InputControl<PoseState>.ReadValueFromState(void*)
    InputControl<PoseState>.ReadValueFromStateWithCaching(void*)
    InputControl<PoseState>.ReadUnprocessedValueFromStateWithCaching(void*)
    InputControl<PoseState>.ReadUnprocessedValue()
    InputControl<PoseState>.ReadValueFromStateAsObject(void*)
    InputControl<PoseState>.ReadValueFromStateIntoBuffer(void*, void*, int)
    InputControl<PoseState>.WriteValueFromBufferIntoState(void*, int, void*)
    InputControl<PoseState>.WriteValueFromObjectIntoState(object, void*)
    InputControl<PoseState>.ReadValueFromBufferAsObject(void*, int)
    InputControl<PoseState>.CompareValue(void*, void*)
    InputControl<PoseState>.ProcessValue(PoseState)
    InputControl<PoseState>.ProcessValue(ref PoseState)
    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.ToString()
    InputControl.EvaluateMagnitude()
    InputControl.EvaluateMagnitude(void*)
    InputControl.TryGetChildControl(string)
    InputControl.TryGetChildControl<TControl>(string)
    InputControl.GetChildControl(string)
    InputControl.GetChildControl<TControl>(string)
    InputControl.RefreshConfigurationIfNeeded()
    InputControl.RefreshConfiguration()
    InputControl.m_StateBlock
    InputControl.currentStatePtr
    InputControl.previousFrameStatePtr
    InputControl.defaultStatePtr
    InputControl.noiseMaskPtr
    InputControl.stateOffsetRelativeToDeviceRoot
    InputControl.optimizedControlDataType
    InputControl.ApplyParameterChanges()
    Namespace: UnityEngine.InputSystem.XR
    Assembly: Unity.InputSystem.dll
    Syntax
    [Preserve]
    public class PoseControl : InputControl<PoseState>
    Remarks

    Note that unlike most other control types, PoseControls do not have a flexible memory layout. They are hardwired to PoseState and will not work correctly with a different memory layouts. Additional fields may be appended to the struct but what's there in the struct has to be located at exactly those memory addresses.

    For more information on tracking origins see TrackingOriginModeFlags.

    Constructors

    PoseControl()

    Default-initialize the pose control.

    Declaration
    public PoseControl()
    Remarks

    Sets the format to "Pose".

    Properties

    angularVelocity

    The angular velocity of this tracked pose relative to the tracking origin.

    Declaration
    public Vector3Control angularVelocity { get; set; }
    Property Value
    Type Description
    Vector3Control

    Control representing whether the pose is being fully tracked. Maps to the angularVelocity value of the pose retrieved from this control.

    Remarks

    The data for this control is only valid if the value returned from trackingState contains AngularVelocity value.

    See Also
    angularVelocity

    isTracked

    Represents whether this pose is fully tracked or unavailable/simulated.

    Declaration
    public ButtonControl isTracked { get; set; }
    Property Value
    Type Description
    ButtonControl

    Control representing whether the pose is being fully tracked. Maps to the isTracked value.

    See Also
    isTracked

    position

    The position, in meters, of this tracked pose relative to the tracking origin.

    Declaration
    public Vector3Control position { get; set; }
    Property Value
    Type Description
    Vector3Control

    Control representing whether the pose is being fully tracked. Maps to the position value of the pose retrieved from this control.

    Remarks

    The data for this control is only valid if the value returned from trackingState contains Position value.

    See Also
    position

    rotation

    The rotation of this tracked pose relative to the tracking origin.

    Declaration
    public QuaternionControl rotation { get; set; }
    Property Value
    Type Description
    QuaternionControl

    Control representing whether the pose is being fully tracked. Maps to the rotation value of the pose retrieved from this control.

    Remarks

    The data for this control is only valid if the value returned from trackingState contains Rotation value.

    See Also
    rotation

    trackingState

    The other controls on this PoseControl that are currently reporting data.

    Declaration
    public IntegerControl trackingState { get; set; }
    Property Value
    Type Description
    IntegerControl

    Control representing whether the pose is being fully tracked. Maps to the trackingState value of the pose retrieved from this control.

    Remarks

    This can be missing values when the device tracking this pose is restricted or not tracking properly.

    See Also
    trackingState

    velocity

    The velocity, in meters per second, of this tracked pose relative to the tracking origin.

    Declaration
    public Vector3Control velocity { get; set; }
    Property Value
    Type Description
    Vector3Control

    Control representing whether the pose is being fully tracked. Maps to the velocity value of the pose retrieved from this control.

    Remarks

    The data for this control is only valid if the value returned from trackingState contains Velocity value.

    See Also
    velocity

    Methods

    CalculateOptimizedControlDataType()

    Calculates and returns a optimized data type that can represent a control's value in memory directly. The value then is cached in optimizedControlDataType. This method is for internal use only, you should not call this from your own code.

    Declaration
    protected override FourCC CalculateOptimizedControlDataType()
    Returns
    Type Description
    FourCC
    Overrides
    InputControl.CalculateOptimizedControlDataType()

    FinishSetup()

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

    Declaration
    protected override void FinishSetup()
    Overrides
    InputControl<PoseState>.FinishSetup()
    Remarks

    This method can be overridden to perform control- or device-specific setup work. The most common use case is for looking up child controls and storing them in local getters.

    public class MyDevice : InputDevice
    {
    public ButtonControl button { get; private set; }
    public AxisControl axis { get; private set; }

             protected override void OnFinishSetup()
             {
                 // Cache controls in getters.
                 button = GetChildControl("button");
                 axis = GetChildControl("axis");
             }
         }</code></pre></example>
    

    ReadUnprocessedValueFromState(void*)

    Declaration
    public override PoseState ReadUnprocessedValueFromState(void* statePtr)
    Parameters
    Type Name Description
    void* statePtr
    Returns
    Type Description
    PoseState
    Overrides
    InputControl<PoseState>.ReadUnprocessedValueFromState(void*)

    WriteValueIntoState(PoseState, void*)

    Declaration
    public override void WriteValueIntoState(PoseState value, void* statePtr)
    Parameters
    Type Name Description
    PoseState value
    void* statePtr
    Overrides
    InputControl<PoseState>.WriteValueIntoState(PoseState, void*)

    Extension Methods

    InputControlExtensions.CheckStateIsAtDefault(InputControl)
    InputControlExtensions.CheckStateIsAtDefault(InputControl, void*, void*)
    InputControlExtensions.CheckStateIsAtDefaultIgnoringNoise(InputControl)
    InputControlExtensions.CheckStateIsAtDefaultIgnoringNoise(InputControl, void*)
    InputControlExtensions.CompareState(InputControl, void*, void*)
    InputControlExtensions.CompareState(InputControl, void*, void*, void*)
    InputControlExtensions.CompareStateIgnoringNoise(InputControl, void*)
    InputControlExtensions.FindControlsRecursive<TControl>(InputControl, IList<TControl>, Func<TControl, bool>)
    InputControlExtensions.FindInParentChain<TControl>(InputControl)
    InputControlExtensions.GetStatePtrFromStateEvent(InputControl, InputEventPtr)
    InputControlExtensions.HasValueChangeInEvent(InputControl, InputEventPtr)
    InputControlExtensions.HasValueChangeInState(InputControl, void*)
    InputControlExtensions.IsActuated(InputControl, float)
    InputControlExtensions.IsPressed(InputControl, float)
    InputControlExtensions.ReadDefaultValueAsObject(InputControl)
    InputControlExtensions.ReadValueAsObject(InputControl)
    InputControlExtensions.ReadValueFromEventAsObject(InputControl, InputEventPtr)
    InputControlExtensions.ReadValueIntoBuffer(InputControl, void*, int)
    InputControlExtensions.ResetToDefaultStateInEvent(InputControl, InputEventPtr)
    InputControlExtensions.WriteValueFromObjectIntoEvent(InputControl, InputEventPtr, object)
    InputControlExtensions.WriteValueIntoEvent<TValue>(InputControl, TValue, InputEventPtr)
    InputControlExtensions.WriteValueIntoState(InputControl, void*)
    InputControlExtensions.WriteValueIntoState<TValue>(InputControl, TValue, void*)
    InputControlExtensions.QueueValueChange<TValue>(InputControl<TValue>, TValue, double)
    InputControlExtensions.ReadUnprocessedValueFromEvent<TValue>(InputControl<TValue>, InputEventPtr)
    InputControlExtensions.ReadUnprocessedValueFromEvent<TValue>(InputControl<TValue>, InputEventPtr, out TValue)
    InputControlExtensions.ReadValueFromEvent<TValue>(InputControl<TValue>, InputEventPtr)
    InputControlExtensions.ReadValueFromEvent<TValue>(InputControl<TValue>, InputEventPtr, out TValue)
    InputControlExtensions.WriteValueIntoEvent<TValue>(InputControl<TValue>, TValue, InputEventPtr)
    InputControlExtensions.WriteValueIntoState<TValue>(InputControl<TValue>, void*)
    InputControlExtensions.WriteValueIntoState<TValue>(InputControl<TValue>, TValue, void*)
    InputControlExtensions.WriteValueIntoState<TValue, TState>(InputControl<TValue>, TValue, ref TState)
    In This Article
    Back to top
    Copyright © 2024 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)