Преглед изворни кода

Simplified Object3D.applyMatrix()

WestLangley пре 11 година
родитељ
комит
17e10eefae
1 измењених фајлова са 4 додато и 16 уклоњено
  1. 4 16
      src/core/Object3D.js

+ 4 - 16
src/core/Object3D.js

@@ -107,25 +107,13 @@ THREE.Object3D.prototype = {
 
 	},
 
-	applyMatrix: function () {
+	applyMatrix: function ( matrix ) {
 
-		var m1 = new THREE.Matrix4();
-
-		return function ( matrix ) {
-
-			this.matrix.multiplyMatrices( matrix, this.matrix );
+		this.matrix.multiplyMatrices( matrix, this.matrix );
 
-			this.position.setFromMatrixPosition( this.matrix );
+		this.matrix.decompose( this.position, this.quaternion, this.scale );
 
-			this.scale.setFromMatrixScale( this.matrix );
-
-			m1.extractRotation( this.matrix );
-
-			this.quaternion.setFromRotationMatrix( m1 );
-
-		}
-
-	}(),
+	},
 
 	setRotationFromAxisAngle: function ( axis, angle ) {