docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class VisionOSSpatialPointerDevice

    Spatial pointer device for VisionOS that manages inputs and events.

    Inheritance
    object
    InputControl
    InputDevice
    VisionOSSpatialPointerDevice
    Implements
    IInputStateCallbackReceiver
    IInputUpdateCallbackReceiver
    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, IInputUpdateCallbackReceiver

    Properties

    inputs

    A list of spatial pointer control input states managed by this device.

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

    primaryInput

    The primary visionOS spatial pointer control's input state managed by this input device.

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

    Methods

    FinishSetup()

    Initializes the input controls managed by the spatial pointer device.

    Declaration
    protected override void FinishSetup()
    Overrides
    UnityEngine.InputSystem.InputControl.FinishSetup()

    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()

    Immediately sends a Moved input state for every Began event, and a None input state for every Ended event.

    Declaration
    public void OnNextUpdate()

    Implements

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