|
@@ -279,6 +279,13 @@ Object.assign( Object3D.prototype, EventDispatcher.prototype, {
|
|
|
|
|
|
return function lookAt( vector ) {
|
|
|
|
|
|
+ if ( this.position.distanceToSquared( vector ) === 0 ) {
|
|
|
+
|
|
|
+ console.warn( 'THREE.Object3D.lookAt(): target vector is the same as object position.' );
|
|
|
+ return;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
m1.lookAt( vector, this.position, this.up );
|
|
|
|
|
|
this.quaternion.setFromRotationMatrix( m1 );
|