Skip to content

Commit

Permalink
Initialize hand opacity
Browse files Browse the repository at this point in the history
Added hand opacity to mesh and dot model initialization functions.
  • Loading branch information
ehammons11 committed Jan 17, 2024
1 parent a607550 commit 3cf1431
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/components/hand-tracking-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,11 @@ module.exports.Component = registerComponent('hand-tracking-controls', {
primitive: 'sphere',
radius: 1.0
});
jointEl.setAttribute('material', {color: this.data.modelColor});
jointEl.setAttribute('material', {
color: this.data.modelColor,
transparent: !(this.data.modelOpacity === 1.0),
opacity: this.data.modelOpacity
});
jointEl.object3D.visible = false;
this.el.appendChild(jointEl);
this.jointEls.push(jointEl);
Expand All @@ -382,7 +386,11 @@ module.exports.Component = registerComponent('hand-tracking-controls', {
mesh.position.set(0, 0, 0);
mesh.rotation.set(0, 0, 0);
skinnedMesh.frustumCulled = false;
skinnedMesh.material = new THREE.MeshStandardMaterial({color: this.data.modelColor});
skinnedMesh.material = new THREE.MeshStandardMaterial( {
color: this.data.modelColor,
transparent: !(this.data.modelOpacity === 1.0),
opacity: this.data.modelOpacity
});
this.setupChildrenEntities();
this.el.setObject3D('mesh', mesh);
},
Expand Down

0 comments on commit 3cf1431

Please sign in to comment.