Skip to content

Commit 6217b74

Browse files
PR feedback
Previous attempt didn't preserve this in forEach() callback. This version should work better (while still only using ES5 constructs).
1 parent b9d3133 commit 6217b74

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/hand-tracking-controls.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,9 @@ module.exports.Component = registerComponent('hand-tracking-controls', {
187187
if (!controller || !this.mesh) { return; }
188188
this.mesh.visible = false;
189189
if (!this.hasPoses) { return; }
190-
controller.hand.values().forEach(function (inputjoint) {
190+
var inputjoints = controller.hand.values();
191+
for (var i = 0; i < inputjoints.length; i++) {
192+
var inputjoint = inputjoints[i];
191193
var bone = this.getBone(inputjoint.jointName);
192194
if (bone != null) {
193195
this.mesh.visible = true;
@@ -196,7 +198,7 @@ module.exports.Component = registerComponent('hand-tracking-controls', {
196198
bone.quaternion.setFromRotationMatrix(jointPose);
197199
}
198200
i++;
199-
});
201+
}
200202
};
201203
})(),
202204

0 commit comments

Comments
 (0)