docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class VisionOSSpatialPointerDevice

    Inheritance
    object
    InputControl
    InputDevice
    VisionOSSpatialPointerDevice
    Implements
    IInputStateCallbackReceiver
    Inherited Members
    InputDevice.InvalidDeviceId
    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
    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*)
    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.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.m_StateBlock
    InputControl.currentStatePtr
    InputControl.previousFrameStatePtr
    InputControl.defaultStatePtr
    InputControl.noiseMaskPtr
    InputControl.stateOffsetRelativeToDeviceRoot
    InputControl.optimizedControlDataType
    InputControl.CalculateOptimizedControlDataType()
    InputControl.ApplyParameterChanges()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.VisionOS.InputDevices
    Assembly: Unity.XR.VisionOS.dll
    Syntax
    public class VisionOSSpatialPointerDevice : InputDevice, IInputStateCallbackReceiver

    Properties

    inputs

    Declaration
    public ReadOnlyArray<VisionOSSpatialPointerControl> inputs { get; protected set; }
    Property Value
    Type Description
    ReadOnlyArray<VisionOSSpatialPointerControl>

    primaryInput

    Declaration
    public VisionOSSpatialPointerControl primaryInput { get; protected set; }
    Property Value
    Type Description
    VisionOSSpatialPointerControl

    Methods

    FinishSetup()

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

    Declaration
    protected override void FinishSetup()
    Overrides
    UnityEngine.InputSystem.InputControl.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>
    

    GetStateOffsetForEvent(InputControl, InputEventPtr, ref uint)

    Compute an offset that correlates control with the state in eventPtr.

    Declaration
    public bool GetStateOffsetForEvent(InputControl control, InputEventPtr eventPtr, ref uint offset)
    Parameters
    Type Name Description
    InputControl control

    Control the state of which we want to access within eventPtr.

    InputEventPtr eventPtr

    An input event. Must be a UnityEngine.InputSystem.LowLevel.StateEvent or UnityEngine.InputSystem.LowLevel.DeltaStateEvent

    uint offset
    Returns
    Type Description
    bool

    False if the correlation failed or true if offset has been set and should be used as the offset for the state of control.

    Remarks

    This method will only be called if the given state event has a state format different than that of the device. In that case, the memory of the input state captured in the given state event cannot be trivially correlated with the control.

    The input system calls the method to know which offset (if any) in the device's state block to consider the state in eventPtr relative to when accessing the state for control as found in the event.

    An example of when this is called is for touch events. These are normally sent in UnityEngine.InputSystem.LowLevel.TouchState format which, however, is not the state format of UnityEngine.InputSystem.Touchscreen (which uses a composite of several TouchStates). When trying to access the state in eventPtr to, for example, read out the touch position,

    See Also
    GetStatePtrFromStateEvent(InputControl, InputEventPtr)

    OnNextUpdate()

    A new input update begins. This means that the current state of the device is being carried over into the next frame.

    Declaration
    public void OnNextUpdate()
    Remarks

    This is called without the front and back buffer for the device having been flipped. You can use UnityEngine.InputSystem.LowLevel.InputState.Change(UnityEngine.InputSystem.InputDevice, UnityEngine.InputSystem.LowLevel.InputEventPtr, UnityEngine.InputSystem.LowLevel.InputUpdateType) to write values into the device's state (e.g. to reset a given control to its default state) which will implicitly perform the buffer flip.

    Implements

    UnityEngine.InputSystem.LowLevel.IInputStateCallbackReceiver
    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)