XRJointPose: radius-Eigenschaft
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Die schreibgeschützte radius
-Eigenschaft der XRJointPose
-Schnittstelle gibt den Radius (Abstand von der Haut) für ein Gelenk an.
Wert
Eine Zahl, die den Radius in Metern angibt.
Beispiele
>Ermitteln des radius
für ein Handgelenk
Rufen Sie XRFrame.getJointPose()
mit einem XRJointSpace
und einem XRReferenceSpace
auf, um ein XRJointPose
-Objekt zu erhalten, das die radius-Eigenschaft bereitstellt.
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");
const radius = frame.getJointPose(
indexFingerTipJoint,
referenceSpace,
).radius;
}
}
}
Spezifikationen
Specification |
---|
WebXR Hand Input Module - Level 1> # dom-xrjointpose-radius> |
Browser-Kompatibilität
Loading…