WebXR Hand Input Module: Difference between revisions
Jump to navigation
Jump to search
(Add short summary) |
(Add WebIDL) |
||
Line 8: | Line 8: | ||
The WebXR Hand Input module expands the [[WebXR Device API]] with the functionality to track articulated hand poses. | The WebXR Hand Input module expands the [[WebXR Device API]] with the functionality to track articulated hand poses. | ||
==WebIDL== | |||
<syntaxhighlight lang="idl"> | |||
partial interface XRInputSource { | |||
[SameObject] readonly attribute XRHand? hand; | |||
}; | |||
enum XRHandJoint { | |||
"wrist", | |||
"thumb-metacarpal", | |||
"thumb-phalanx-proximal", | |||
"thumb-phalanx-distal", | |||
"thumb-tip", | |||
"index-finger-metacarpal", | |||
"index-finger-phalanx-proximal", | |||
"index-finger-phalanx-intermediate", | |||
"index-finger-phalanx-distal", | |||
"index-finger-tip", | |||
"middle-finger-metacarpal", | |||
"middle-finger-phalanx-proximal", | |||
"middle-finger-phalanx-intermediate", | |||
"middle-finger-phalanx-distal", | |||
"middle-finger-tip", | |||
"ring-finger-metacarpal", | |||
"ring-finger-phalanx-proximal", | |||
"ring-finger-phalanx-intermediate", | |||
"ring-finger-phalanx-distal", | |||
"ring-finger-tip", | |||
"pinky-finger-metacarpal", | |||
"pinky-finger-phalanx-proximal", | |||
"pinky-finger-phalanx-intermediate", | |||
"pinky-finger-phalanx-distal", | |||
"pinky-finger-tip" | |||
}; | |||
[Exposed=Window] | |||
interface XRHand { | |||
iterable<XRHandJoint, XRJointSpace>; | |||
readonly attribute unsigned long size; | |||
XRJointSpace get(XRHandJoint key); | |||
}; | |||
[Exposed=Window] | |||
interface XRJointSpace: XRSpace { | |||
readonly attribute XRHandJoint jointName; | |||
}; | |||
partial interface XRFrame { | |||
XRJointPose? getJointPose(XRJointSpace joint, XRSpace baseSpace); | |||
boolean fillJointRadii(sequence<XRJointSpace> jointSpaces, Float32Array radii); | |||
boolean fillPoses(sequence<XRSpace> spaces, XRSpace baseSpace, Float32Array transforms); | |||
}; | |||
[Exposed=Window] | |||
interface XRJointPose: XRPose { | |||
readonly attribute float radius; | |||
}; | |||
</syntaxhighlight> | |||
== External Links == | == External Links == |
Latest revision as of 00:25, 1 March 2023
Status | WD |
---|---|
Last Updated | 19 April 2022 |
Editor(s) | Manish Goregaokar |
CG or WG? | WG |
The WebXR Hand Input module expands the WebXR Device API with the functionality to track articulated hand poses.
WebIDL[edit]
partial interface XRInputSource {
[SameObject] readonly attribute XRHand? hand;
};
enum XRHandJoint {
"wrist",
"thumb-metacarpal",
"thumb-phalanx-proximal",
"thumb-phalanx-distal",
"thumb-tip",
"index-finger-metacarpal",
"index-finger-phalanx-proximal",
"index-finger-phalanx-intermediate",
"index-finger-phalanx-distal",
"index-finger-tip",
"middle-finger-metacarpal",
"middle-finger-phalanx-proximal",
"middle-finger-phalanx-intermediate",
"middle-finger-phalanx-distal",
"middle-finger-tip",
"ring-finger-metacarpal",
"ring-finger-phalanx-proximal",
"ring-finger-phalanx-intermediate",
"ring-finger-phalanx-distal",
"ring-finger-tip",
"pinky-finger-metacarpal",
"pinky-finger-phalanx-proximal",
"pinky-finger-phalanx-intermediate",
"pinky-finger-phalanx-distal",
"pinky-finger-tip"
};
[Exposed=Window]
interface XRHand {
iterable<XRHandJoint, XRJointSpace>;
readonly attribute unsigned long size;
XRJointSpace get(XRHandJoint key);
};
[Exposed=Window]
interface XRJointSpace: XRSpace {
readonly attribute XRHandJoint jointName;
};
partial interface XRFrame {
XRJointPose? getJointPose(XRJointSpace joint, XRSpace baseSpace);
boolean fillJointRadii(sequence<XRJointSpace> jointSpaces, Float32Array radii);
boolean fillPoses(sequence<XRSpace> spaces, XRSpace baseSpace, Float32Array transforms);
};
[Exposed=Window]
interface XRJointPose: XRPose {
readonly attribute float radius;
};