XRJointSpace: thuộc tính jointName
Khả dụng hạn chế
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Thuộc tính chỉ đọc jointName của giao diện XRJointSpace chứa tên của khớp mà nó theo dõi.
Giá trị
Một chuỗi cho biết tên của khớp. Xem danh sách các khớp bàn tay trên trang XRHand.
Ví dụ
>Lấy jointName
Với một XRJointSpace, thuộc tính jointName sẽ chứa tên khớp bàn tay.
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"
}
}
}
Thông số kỹ thuật
| Thông số kỹ thuật |
|---|
| WebXR Hand Input Module - Level 1> # dom-xrjointspace-jointname> |