例項屬性
XRJointPose.radius只讀-
關節的半徑(與皮膚的距離)。
示例
使用 XRJointPose 物件
呼叫 XRFrame.getJointPose(),傳入一個 XRJointSpace 和一個 XRReferenceSpace 來獲取一個 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
}
}
}
規範
| 規範 |
|---|
| WebXR Hand Input 模組 - Level 1 # xrjointpose-interface |
瀏覽器相容性
載入中…