XRJointSpace: jointName 屬性
XRJointSpace 介面的只讀 jointName 屬性包含其跟蹤的關節的名稱。
值
一個表示關節名稱的字串。請參閱 XRHand 頁面上的手部關節列表。
示例
獲取 jointName
給定一個 XRJointSpace,jointName 屬性將包含手部關節的名稱。
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"); // XRJointSpace
indexFingerTipJoint.jointName; // "index-finger-tip"
}
}
}
規範
| 規範 |
|---|
| WebXR Hand Input 模組 - Level 1 # dom-xrjointspace-jointname |
瀏覽器相容性
載入中…