XRTransientInputHitTestResult: inputSource property
WebXR Device API
WebXR Device API
The read-only inputSource property of the XRTransientInputHitTestResult interface represents an XRInputSource object that was used to compute the results array.
Value
An XRInputSource object.
Examples
Filtering input sources
The inputSource property allows you to filter hit test results by input source.
// frame loop
function 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
Browser compatibility
See also
- XRInputSource