2
0
Mr.doob 2 жил өмнө
parent
commit
757dadf233
1 өөрчлөгдсөн 8 нэмэгдсэн , 4 устгасан
  1. 8 4
      src/core/Object3D.js

+ 8 - 4
src/core/Object3D.js

@@ -586,9 +586,11 @@ class Object3D extends EventDispatcher {
 
 		for ( let i = 0, l = children.length; i < l; i ++ ) {
 
-			if ( children[ i ].matrixWorldAutoUpdate === true || force === true ) {
+			const child = children[ i ];
 
-				children[ i ].updateMatrixWorld( force );
+			if ( child.matrixWorldAutoUpdate === true || force === true ) {
+
+				child.updateMatrixWorld( force );
 
 			}
 
@@ -626,9 +628,11 @@ class Object3D extends EventDispatcher {
 
 			for ( let i = 0, l = children.length; i < l; i ++ ) {
 
-				if ( children[ i ].matrixWorldAutoUpdate === true ) {
+				const child = children[ i ];
+
+				if ( child.matrixWorldAutoUpdate === true ) {
 
-					children[ i ].updateWorldMatrix( false, true );
+					child.updateWorldMatrix( false, true );
 
 				}