Browse Source

Ignore scale of light.matrixWorld (#21848)

WestLangley 4 years ago
parent
commit
3c16ded83f

+ 3 - 2
examples/js/helpers/RectAreaLightHelper.js

@@ -50,9 +50,10 @@
 				if ( max > 1 ) c.multiplyScalar( 1 / max );
 				this.children[ 0 ].material.color.copy( this.material.color );
 
-			}
+			} // ignore world scale on light
 
-			this.matrixWorld.copy( this.light.matrixWorld ).scale( this.scale );
+
+			this.matrixWorld.extractRotation( this.light.matrixWorld ).scale( this.scale ).copyPosition( this.light.matrixWorld );
 			this.children[ 0 ].matrixWorld.copy( this.matrixWorld );
 
 		}

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

@@ -64,7 +64,9 @@ class RectAreaLightHelper extends Line {
 
 		}
 
-		this.matrixWorld.copy( this.light.matrixWorld ).scale( this.scale );
+		// ignore world scale on light
+		this.matrixWorld.extractRotation( this.light.matrixWorld ).scale( this.scale ).copyPosition( this.light.matrixWorld );
+
 		this.children[ 0 ].matrixWorld.copy( this.matrixWorld );
 
 	}