// 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
}
});
}XRTransientInputHitTestResult: inputSource property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.