Skip to content

Commit

Permalink
Removes intersector when hands exits scene (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
james-h-stephens authored and donmccurdy committed Nov 22, 2016
1 parent 657b066 commit ccb35f2
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/leap-hand.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,19 @@ module.exports = {
this.release(null);
}

if ( hand && !this.isVisible) this.handMesh.show();
if (!hand && this.isVisible) this.handMesh.hide();
if (hand && !this.isVisible) {
this.handMesh.show();
if (this.intersector.getMesh()) {
this.el.object3D.add(this.intersector.getMesh());
}
}

if (!hand && this.isVisible) {
this.handMesh.hide();
if (this.intersector.getMesh()) {
this.el.object3D.remove(this.intersector.getMesh());
}
}
this.isVisible = !!hand;
},

Expand Down

0 comments on commit ccb35f2

Please sign in to comment.