XRJointPose: radius-Eigenschaft

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Die schreibgeschützte radius-Eigenschaft der XRJointPose-Schnittstelle gibt den Radius (Abstand von der Haut) für ein Gelenk an.

Wert

Eine Zahl, die den Radius in Metern angibt.

Beispiele

Ermitteln des radius für ein Handgelenk

Rufen Sie XRFrame.getJointPose() mit einem XRJointSpace und einem XRReferenceSpace auf, um ein XRJointPose-Objekt zu erhalten, das die radius-Eigenschaft bereitstellt.

js
navigator.xr
  .requestSession({ optionalFeatures: ["hand-tracking"] })
  .then(/** … */);

function renderFrame(session, frame) {
  // …

  for (const inputSource of session.inputSources) {
    if (inputSource.hand) {
      const indexFingerTipJoint = inputSource.hand.get("index-finger-tip");
      const radius = frame.getJointPose(
        indexFingerTipJoint,
        referenceSpace,
      ).radius;
    }
  }
}

Spezifikationen

Specification
WebXR Hand Input Module - Level 1
# dom-xrjointpose-radius

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
radius

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support

Siehe auch