Browse Source

RectAreaLightHelper: Override updateMatrixWorld.

Mr.doob 4 years ago
parent
commit
3238bc3903
1 changed files with 4 additions and 3 deletions
  1. 4 3
      examples/jsm/helpers/RectAreaLightHelper.js

+ 4 - 3
examples/jsm/helpers/RectAreaLightHelper.js

@@ -40,14 +40,12 @@ function RectAreaLightHelper( light, color ) {
 
 	this.add( new Mesh( geometry2, new MeshBasicMaterial( { side: BackSide, fog: false } ) ) );
 
-	this.update();
-
 }
 
 RectAreaLightHelper.prototype = Object.create( Line.prototype );
 RectAreaLightHelper.prototype.constructor = RectAreaLightHelper;
 
-RectAreaLightHelper.prototype.update = function () {
+RectAreaLightHelper.prototype.updateMatrixWorld = function () {
 
 	this.scale.set( 0.5 * this.light.width, 0.5 * this.light.height, 1 );
 
@@ -69,6 +67,9 @@ RectAreaLightHelper.prototype.update = function () {
 
 	}
 
+	this.matrixWorld.copy( this.light.matrixWorld ).scale( this.scale );
+	this.children[ 0 ].matrixWorld.copy( this.matrixWorld );
+
 };
 
 RectAreaLightHelper.prototype.dispose = function () {