Class VisionOSSpatialPointerDevice
Spatial pointer device for VisionOS that manages inputs and events.
Implements
Inherited Members
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 |
---|---|
Read |
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 |
---|---|
Vision |
Methods
FinishSetup()
Initializes the input controls managed by the spatial pointer device.
Declaration
protected override void FinishSetup()
Overrides
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 |
---|---|---|
Input |
control | Control the state of which we want to access within |
Input |
eventPtr | An input event. Must be a Unity |
uint | offset |
Returns
Type | Description |
---|---|
bool | False if the correlation failed or true if |
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 UnityeventPtr
to, for example, read out the touch position,
See Also
OnNextUpdate()
Immediately sends a Moved input state for every Began event, and a None input state for every Ended event.
Declaration
public void OnNextUpdate()