Skip to content

Commit

Permalink
Fix 2c97ce9 regression. Cannot iterate a map like an array
Browse files Browse the repository at this point in the history
  • Loading branch information
dmarcos committed Nov 9, 2023
1 parent 11d8805 commit 36a53e7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@
"ecmaVersion": 8
}
},
{
/* This module uses ES8 async / await due to WebXR Anchor Module integration */

This comment has been minimized.

Copy link
@diarmidmackenzie

diarmidmackenzie Nov 10, 2023

Contributor

This comment is incorrect - should refer to hand tracking using a Map, which is introduced only in ES6.

This comment has been minimized.

Copy link
@dmarcos

dmarcos Nov 12, 2023

Author Member

fixed the comment. thanks

"files": ["./src/components/hand-tracking-controls.js"],
"parserOptions": {
"ecmaVersion": 6
}
},
{
/* This code is external, and the ES5 restrictions do not apply to it. */
"files": ["./src/lib/**/*.js"],
Expand Down
5 changes: 2 additions & 3 deletions src/components/hand-tracking-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,13 @@ module.exports.Component = registerComponent('hand-tracking-controls', {
updateHandMeshModel: (function () {
var jointPose = new THREE.Matrix4();
return function () {
var i = 0;
var jointPoses = this.jointPoses;
var controller = this.el.components['tracked-controls'] && this.el.components['tracked-controls'].controller;
if (!controller || !this.mesh) { return; }
this.mesh.visible = false;
if (!this.hasPoses) { return; }
var inputjoints = controller.hand.values();
for (var i = 0; i < inputjoints.length; i++) {
var inputjoint = inputjoints[i];
for (var inputjoint of controller.hand.values()) {
var bone = this.getBone(inputjoint.jointName);
if (bone != null) {
this.mesh.visible = true;
Expand Down

0 comments on commit 36a53e7

Please sign in to comment.