值
如果 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 |
浏览器兼容性
加载中…