Skip to content

Commit

Permalink
fix image target aframe obj still clickable when lost
Browse files Browse the repository at this point in the history
  • Loading branch information
hiukim committed Feb 8, 2023
1 parent 1efb686 commit 270c341
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/image-target/aframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ AFRAME.registerComponent('mindar-image-target', {
const arSystem = this.el.sceneEl.systems['mindar-image-system'];
arSystem.registerAnchor(this, this.data.targetIndex);

this.invisibleMatrix = new AFRAME.THREE.Matrix4(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1);

const root = this.el.object3D;
root.visible = false;
root.matrixAutoUpdate = false;
Expand Down Expand Up @@ -283,6 +285,7 @@ AFRAME.registerComponent('mindar-image-target', {

this.el.object3D.visible = worldMatrix !== null;
if (worldMatrix === null) {
this.el.object3D.matrix = this.invisibleMatrix;
return;
}
var m = new AFRAME.THREE.Matrix4();
Expand Down

0 comments on commit 270c341

Please sign in to comment.