files/en-us/web/api/xrframe/getjointpose/index.md
{{APIRef("WebXR Device API")}}{{SeeCompatTable}}{{SecureContext_Header}}
The getJointPose() method of the {{domxref("XRFrame")}} interface returns an {{domxref("XRJointPose")}} object providing the pose of a hand joint (see {{domxref("XRHand")}}) relative to a given base space.
getJointPose(joint, baseSpace)
joint
baseSpace
An {{domxref("XRJointPose")}} object specifying the position and orientation of the hand joint, relative to
the {{domxref("XRSpace")}} indicated by baseSpace.
getJointPose()Call getJointPose() with an {{domxref("XRJointSpace")}} and an {{domxref("XRReferenceSpace")}} to get an {{domxref("XRJointPose")}} object.
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
}
}
}
{{Specifications}}
{{Compat}}