XRJointSpace
例項屬性
XRJointSpace.jointName只讀-
被跟蹤關節的名稱。有關可能的的雙手關節名稱,請參閱
XRHand。
示例
使用 XRJointSpace 物件
您可以透過呼叫 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"); // XRJointSpace
indexFingerTipJoint.jointName; // "index-finger-tip"
frame.getJointPose(indexFingerTipJoint, referenceSpace); // XRJointPose
}
}
}
規範
| 規範 |
|---|
| WebXR Hand Input 模組 - Level 1 # xrhand-interface |
瀏覽器相容性
載入中…