From db4671e8e854aef37330abf628bafc93c723cbed Mon Sep 17 00:00:00 2001 From: Will Eastcott Date: Fri, 22 Nov 2024 15:46:35 +0000 Subject: [PATCH] Add XrJoint#id (#7132) --- src/framework/xr/xr-joint.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/framework/xr/xr-joint.js b/src/framework/xr/xr-joint.js index 35d980042b9..4d98aa89b6d 100644 --- a/src/framework/xr/xr-joint.js +++ b/src/framework/xr/xr-joint.js @@ -35,7 +35,7 @@ class XrJoint { _index; /** - * @type {string} + * @type {XRHandJoint} * @private */ _id; @@ -47,7 +47,7 @@ class XrJoint { _hand; /** - * @type {XrFinger} + * @type {XrFinger|null} * @private */ _finger; @@ -65,7 +65,7 @@ class XrJoint { _tip; /** - * @type {number} + * @type {number|null} * @private */ _radius = null; @@ -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. @@ -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.