XRJointPose: thuộc tính radius

Limited availability

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

Thuộc tính chỉ đọc radius của giao diện XRJointPose cho biết bán kính (khoảng cách từ da) của khớp.

Giá trị

Một số cho biết bán kính tính bằng mét.

Ví dụ

Lấy radius cho khớp bàn tay

Gọi XRFrame.getJointPose() với một XRJointSpace và một XRReferenceSpace để lấy đối tượng XRJointPose cung cấp thuộc tính radius.

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;
    }
  }
}

Thông số kỹ thuật

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

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

Xem thêm