1 WebXR Device API - Input
milancharbonne edited this page 2025-09-27 02:18:40 +00:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.


This doc explains the portion of the WebXR APIs for ItagPro managing input throughout the range of XR hardware. For context, it may be useful to have first read about WebXR Session Establishment and iTagPro shop Spatial Tracking. In addition to the diversity of monitoring and show expertise, XR hardware might help a wide number of enter mechanisms together with display screen taps, iTagPro shop motion controllers (with multiple buttons, joysticks, triggers, touchpads, power sensors, and so forth), voice commands, spatially-tracked articulated fingers, single button clickers, and more. Despite this variation, iTagPro shop all XR input mechanisms have a common goal: enabling customers to goal in 3D space and perform an motion on the goal of that purpose. This idea is named "target and select" and is the inspiration for the way enter is exposed in WebXR. All WebXR input sources will be divided into one of three categories primarily based on the tactic by which users should target: gaze, tracked-pointer, and screen.


Gaze-based input sources should not have their very own tracking mechanism and as an alternative use the viewers head position for concentrating on. Example embrace 0DOF clickers, headset buttons, regular gamepads, and certain voice commands. Within this category, some enter sources are persistent (e.g. those backed by hardware) while others will come-and-go when invoked by the consumer (e.g. voice commands). Tracked pointers are input sources capable of be tracked individually from the viewer. Examples embody the Oculus Touch movement controllers and the Magic Leap hand luggage tracking device monitoring. For iTagPro shop motion controllers, the target ray will typically have an origin at the tip of movement controller and be angled slightly downward for consolation. The exact orientation of the ray relative to a given system follows platform-specific tips if there are any. In the absence of platform-specific guidance or iTagPro shop a bodily system, the target ray points in the same route because the users index finger if it was outstretched. Within this category, enter sources are considered linked even if they are briefly unable to be tracked in area.


Screen primarily based input is pushed by mouse and touch interactions on a 2D screen which can be then translated into a 3D concentrating on ray. The focusing on ray originates at the interacted level on the display as mapped into the input XRSpace and extends out into the scene alongside a line from the screens viewer pose place by that time. The particular mapped depth of the origin level depends on the user agent. It Should correspond to the precise 3D position of the purpose on the display the place available, however May even be projected onto the closest clipping airplane (defined by the smaller of the depthNear and depthFar attributes of the XRSession) if the precise display placement isn't identified. To perform this, pointer events over the related screen areas are monitored and iTagPro shop momentary enter sources are generated in response to allow unified enter handling. For inline sessions the monitored region is the canvas related to the baseLayer.


For immersive classes (e.g. hand-held AR), the entire display screen is monitored. In addition to a targeting ray, all input sources present a mechanism for iTagPro reviews the user to carry out a "select" motion. This user intent is communicated to developers by events that are mentioned intimately in the Input events part. The physical motion which triggers this selection will differ primarily based on the enter sort. The inputSources attribute on an XRSession returns an inventory of all XRInputSources that the consumer agent considers active. The properties of an XRInputSource object are immutable. If a system can be manipulated in such a method that these properties can change, iTagPro features the XRInputSource will likely be removed from the array and iTagPro smart device a new entry created. When enter sources are added to or removed from the listing of accessible enter sources the inputsourceschange occasion have to be fired on the XRSession object to indicate that any cached copies of the list needs to be refreshed. In addition, the inputsourceschange occasion may even fireplace as soon as after the session creation callback completes.