值
如果 XRSession 沒有使用 hand-tracking 功能描述符 請求,則返回一個 XRHand 物件或 null。
示例
js
navigator.xr
.requestSession({ optionalFeatures: ["hand-tracking"] })
.then(/* … */);
function renderFrame(session, frame) {
// …
for (const inputSource of session.inputSources) {
if (inputSource.hand) {
// render a hand model, perform gesture detection, etc.
}
}
}
規範
| 規範 |
|---|
| WebXR Hand Input 模組 - Level 1 # dom-xrinputsource-hand |
瀏覽器相容性
載入中…