浏览代码

Ignore scale of light.matrixWorld (#21848)

WestLangley 4 年之前
父节点
当前提交
3c16ded83f
共有 2 个文件被更改,包括 6 次插入3 次删除
  1. 3 2
      examples/js/helpers/RectAreaLightHelper.js
  2. 3 1
      examples/jsm/helpers/RectAreaLightHelper.js

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

@@ -50,9 +50,10 @@
 				if ( max > 1 ) c.multiplyScalar( 1 / max );
 				if ( max > 1 ) c.multiplyScalar( 1 / max );
 				this.children[ 0 ].material.color.copy( this.material.color );
 				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 );
 			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 );
 		this.children[ 0 ].matrixWorld.copy( this.matrixWorld );
 
 
 	}
 	}