XRJointPose

Limited availability

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

Giao diện XRJointPose là một XRPose có thêm thông tin về kích thước của khớp xương mà nó đại diện.

XRPose XRJointPose

Thuộc tính phiên bản

XRJointPose.radius Read only

Bán kính (khoảng cách từ da) của khớp.

Ví dụ

Sử dụng các đối tượng XRJointPose

Gọi XRFrame.getJointPose() với một XRJointSpace và một XRReferenceSpace để lấy đối tượng XRJointPose.

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");
      frame.getJointPose(indexFingerTipJoint, referenceSpace); // XRJointPose
    }
  }
}

Thông số kỹ thuật

Specification
WebXR Hand Input Module - Level 1
# xrjointpose-interface

Tương thích trình duyệt

Xem thêm