实例属性
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 |
浏览器兼容性
加载中…