Skip to content

Commit

Permalink
Merge pull request #293 from DougReeder/master
Browse files Browse the repository at this point in the history
Fixes look-at, so vector can be used after selector (Issue #292)
  • Loading branch information
dmarcos committed Sep 27, 2021
2 parents 11faeab + 8e7e80d commit 59f997f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion components/look-at/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ AFRAME.registerComponent('look-at', {

// Look at a position.
if (typeof target === 'object') {
return this.lookAt(new THREE.Vector3(target.x, target.y, target.z));
this.lookAt(new THREE.Vector3(target.x, target.y, target.z));
return this.endTracking();
}

// Assume target is a string.
Expand Down Expand Up @@ -102,6 +103,10 @@ AFRAME.registerComponent('look-at', {
this.target3D = targetEl.object3D;
},

endTracking: function () {
this.target3D = null;
},

cameraListener: function (e) {
if (e.detail && e.detail.name === 'camera') {
this.update();
Expand Down
2 changes: 1 addition & 1 deletion components/look-at/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"homepage": "https://github.com/supermedium/superframe/tree/look-at#readme",
"devDependencies": {
"aframe": "^0.5.0",
"aframe": "^1.2.0",
"browserify": "^12.0.1",
"budo": "^7.1.0",
"shelljs": "^0.6.0",
Expand Down

0 comments on commit 59f997f

Please sign in to comment.