Skip to content

Commit 8e7e80d

Browse files
committed
Fixes look-at, so vector can be used after selector (Issue supermedium#292)
1 parent 3214e25 commit 8e7e80d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

components/look-at/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ AFRAME.registerComponent('look-at', {
6060

6161
// Look at a position.
6262
if (typeof target === 'object') {
63-
return this.lookAt(new THREE.Vector3(target.x, target.y, target.z));
63+
this.lookAt(new THREE.Vector3(target.x, target.y, target.z));
64+
return this.endTracking();
6465
}
6566

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

106+
endTracking: function () {
107+
this.target3D = null;
108+
},
109+
105110
cameraListener: function (e) {
106111
if (e.detail && e.detail.name === 'camera') {
107112
this.update();

components/look-at/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
"homepage": "https://github.com/supermedium/superframe/tree/look-at#readme",
3030
"devDependencies": {
31-
"aframe": "^0.5.0",
31+
"aframe": "^1.2.0",
3232
"browserify": "^12.0.1",
3333
"budo": "^7.1.0",
3434
"shelljs": "^0.6.0",

0 commit comments

Comments
 (0)