Skip to content

Commit

Permalink
A more robust fix that doesn't depend on hardcoded indices (#5340)
Browse files Browse the repository at this point in the history
* A more robust fix that doesn't depend on hardcoded indices

* ES6 not allowed in A-Frame.

* No single letter variables

* nit - early return

---------

Co-authored-by: Diego Marcos <[email protected]>
  • Loading branch information
diarmidmackenzie and dmarcos authored Jul 20, 2023
1 parent d15bf5a commit d4c1b87
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/hand-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,10 @@ module.exports.Component = registerComponent('hand-controls', {
mesh.mixer = new THREE.AnimationMixer(mesh);
self.clips = gltf.animations;
el.setObject3D('mesh', mesh);

var handMaterial = mesh.children[0].material;
handMaterial.color = new THREE.Color(handColor);
mesh.traverse(function (object) {
if (!object.isMesh) { return; }
object.material.color = new THREE.Color(handColor);
});
mesh.position.set(0, 0, 0);
mesh.rotation.set(handModelOrientationX, 0, handModelOrientationZ);
el.setAttribute('magicleap-controls', controlConfiguration);
Expand Down

0 comments on commit d4c1b87

Please sign in to comment.