Skip to content

Commit

Permalink
Fix also setting hand color in updateHandMeshColor (refs #451)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentfretin committed Feb 4, 2024
1 parent 5ccb8af commit 1bce189
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/components/networked-hand-controls.js
Expand Up @@ -217,10 +217,10 @@ AFRAME.registerComponent('networked-hand-controls', {

const handColor = this.data.color;
newMesh.traverse(function (object) {
if (!object.isMesh) {
return;
}
object.material.color = new THREE.Color(handColor);
if (!object.isMesh) {
return;
}
object.material.color = new THREE.Color(handColor);
});
newMesh.position.set(0, 0, 0);
newMesh.rotation.set(0, 0, handModelOrientation);
Expand All @@ -230,9 +230,13 @@ AFRAME.registerComponent('networked-hand-controls', {
updateHandMeshColor() {
const mesh = this.getMesh();
if (!mesh) return;
const handMaterial = mesh.children[1].material;
handMaterial.color.set(this.data.color);
this.rendererSystem.applyColorCorrection(handMaterial.color);
const handColor = this.data.color;
mesh.traverse(function (object) {
if (!object.isMesh) {
return;
}
object.material.color.set(handColor);
});
},

controllerComponents: [
Expand Down

0 comments on commit 1bce189

Please sign in to comment.