Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. XRTransientInputHitTestResult
  4. inputSource

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.

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

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp