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