WebXR Device API - Input

Aus Vokipedia
Version vom 16. Oktober 2025, 15:47 Uhr von CornellFowler33 (Diskussion | Beiträge)

(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu: Navigation, Suche


This document explains the portion of the WebXR APIs for managing enter throughout the vary of XR hardware. For context, it could also be useful to have first read about WebXR Session Establishment and Spatial Tracking. In addition to the range of monitoring and show technology, XR hardware might assist a wide number of enter mechanisms together with display screen taps, movement controllers (with multiple buttons, joysticks, triggers, touchpads, drive sensors, and so forth), voice commands, spatially-tracked articulated fingers, iTagPro device single button clickers, iTagPro portable and more. Despite this variation, all XR input mechanisms have a standard goal: iTagPro enabling customers to goal in 3D area and carry out an action on the target of that aim. This concept is called "target and select" and is the inspiration for how input is uncovered in WebXR. All WebXR enter sources will be divided into considered one of three classes based on the method by which users must target: ‘gaze’, ‘tracked-pointer’, and iTagPro device ‘screen’.



Gaze-primarily based enter sources shouldn't have their own tracking mechanism and itagpro tracker instead use the viewer’s head place for targeting. Example embody 0DOF clickers, headset buttons, iTagPro device common gamepads, and certain voice commands. Within this category, some input sources are persistent (e.g. those backed by hardware) while others will come-and-go when invoked by the person (e.g. voice commands). Tracked pointers are enter sources able to be tracked individually from the viewer. Examples embrace the Oculus Touch motion controllers and ItagPro the Magic Leap hand monitoring. For motion controllers, the target ray will typically have an origin on the tip of movement controller and be angled barely downward for comfort. The precise orientation of the ray relative to a given machine follows platform-specific tips if there are any. Within the absence of platform-particular steerage or iTagPro device a physical iTagPro device, the target ray factors in the same direction because the user’s index finger if it was outstretched. Within this class, enter sources are thought-about related even if they're briefly unable to be tracked in space.



Screen based mostly input is driven by mouse and touch interactions on a 2D display screen which are then translated right into a 3D focusing on ray. The targeting ray originates at the interacted point on the screen as mapped into the enter XRSpace and extends out into the scene alongside a line from the screen’s viewer pose position by that time. The specific mapped depth of the origin level relies on the user agent. It Should correspond to the precise 3D place of the point on the display where available, however May also be projected onto the closest clipping plane (outlined by the smaller of the depthNear and depthFar attributes of the XRSession) if the precise display placement will not be identified. To accomplish this, pointer events over the relevant display screen areas are monitored and momentary enter sources are generated in response to allow unified input handling. For itagpro device inline sessions the monitored area is the canvas related to the baseLayer.



For immersive classes (e.g. hand-held AR), your entire display screen is monitored. Along with a concentrating on ray, all input sources present a mechanism for the user to perform a "select" motion. This consumer intent is communicated to developers by means of occasions that are mentioned intimately in the Input events section. The physical action which triggers this choice will differ based on the input type. 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 device might be manipulated in such a method that these properties can change, the XRInputSource might be removed from the array and iTagPro portable a new entry created. When enter sources are added to or removed from the checklist of out there input sources the inputsourceschange event have to be fired on the XRSession object to indicate that any cached copies of the listing must be refreshed. In addition, the inputsourceschange occasion may also hearth once after the session creation callback completes.

Meine Werkzeuge
Namensräume

Varianten
Aktionen
Navigation
Werkzeuge