XRTransientInputHitTestResult: inputSource property
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.
Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.
Theread-onlyinputSource property of theXRTransientInputHitTestResult interface represents anXRInputSource object that was used to compute theresults array.
In this article
Value
AnXRInputSource object.
Examples
>Filtering input sources
TheinputSource property allows you to filter hit test results by input source.
js
// frame loopfunction onXRFrame(time, xrFrame) { let hitTestResults = xrFrame.getHitTestResultsForTransientInput( transientHitTestSource, ); hitTestResults.forEach((resultsPerInputSource) => { if (resultsPerInputSource.inputSource === myPreferredInputSource) { // act on hit test results from the preferred input source } });}Specifications
| Specification |
|---|
| WebXR Hit Test Module> # dom-xrtransientinputhittestresult-inputsource> |