Browse Source

Merge pull request #15320 from WestLangley/dev-spotlight_helper

SpotLightHelper: correctly orient helper to face light target
Mr.doob 6 years ago
parent
commit
5a42f19087
1 changed files with 2 additions and 4 deletions
  1. 2 4
      src/helpers/SpotLightHelper.js

+ 2 - 4
src/helpers/SpotLightHelper.js

@@ -69,7 +69,6 @@ SpotLightHelper.prototype.dispose = function () {
 SpotLightHelper.prototype.update = function () {
 
 	var vector = new Vector3();
-	var vector2 = new Vector3();
 
 	return function update() {
 
@@ -80,10 +79,9 @@ SpotLightHelper.prototype.update = function () {
 
 		this.cone.scale.set( coneWidth, coneWidth, coneLength );
 
-		vector.setFromMatrixPosition( this.light.matrixWorld );
-		vector2.setFromMatrixPosition( this.light.target.matrixWorld );
+		vector.setFromMatrixPosition( this.light.target.matrixWorld );
 
-		this.cone.lookAt( vector2.sub( vector ) );
+		this.cone.lookAt( vector );
 
 		if ( this.color !== undefined ) {