Explorar o código

Object3D.updateMatrixWorld() performance improvements.

Mr.doob %!s(int64=8) %!d(string=hai) anos
pai
achega
1be390c03d
Modificáronse 1 ficheiros con 5 adicións e 5 borrados
  1. 5 5
      src/core/Object3D.js

+ 5 - 5
src/core/Object3D.js

@@ -526,17 +526,17 @@ Object.assign( Object3D.prototype, EventDispatcher.prototype, {
 
 	updateMatrixWorld: function ( force ) {
 
-		if ( this.matrixAutoUpdate === true ) this.updateMatrix();
+		if ( this.matrixAutoUpdate ) this.updateMatrix();
 
-		if ( this.matrixWorldNeedsUpdate === true || force === true ) {
+		if ( this.matrixWorldNeedsUpdate || force ) {
 
-			if ( this.parent === null ) {
+			if ( this.parent ) {
 
-				this.matrixWorld.copy( this.matrix );
+				this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );
 
 			} else {
 
-				this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );
+				this.matrixWorld.copy( this.matrix );
 
 			}