Skip to content

Add XrJoint#id #7132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions src/framework/xr/xr-joint.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class XrJoint {
_index;

/**
* @type {string}
* @type {XRHandJoint}
* @private
*/
_id;
Expand All @@ -47,7 +47,7 @@ class XrJoint {
_hand;

/**
* @type {XrFinger}
* @type {XrFinger|null}
* @private
*/
_finger;
Expand All @@ -65,7 +65,7 @@ class XrJoint {
_tip;

/**
* @type {number}
* @type {number|null}
* @private
*/
_radius = null;
Expand Down Expand Up @@ -116,7 +116,7 @@ class XrJoint {
* Create an XrJoint instance.
*
* @param {number} index - Index of a joint within a finger.
* @param {string} id - Id of a joint based on WebXR Hand Input Specs.
* @param {XRHandJoint} id - Id of a joint based on WebXR Hand Input Specs.
* @param {XrHand} hand - Hand that joint relates to.
* @param {XrFinger|null} finger - Finger that joint is related to. Can be null in the case of
* the wrist joint.
Expand Down Expand Up @@ -181,6 +181,15 @@ class XrJoint {
return this._rotation;
}

/**
* Id of a joint based on WebXR Hand Input Specs.
*
* @type {XRHandJoint}
*/
get id() {
return this._id;
}

/**
* Index of a joint within a finger, starting from 0 (root of a finger) all the way to tip of
* the finger.
Expand Down