Parcourir la source

Matrix3/Matrix4: Removed flattenToArray.
As far as I'm aware this is no longer needed.

Mr.doob il y a 11 ans
Parent
commit
89f72bb817
4 fichiers modifiés avec 2 ajouts et 44 suppressions
  1. 0 5
      docs/api/math/Matrix4.html
  2. 0 11
      src/math/Matrix3.js
  3. 0 12
      src/math/Matrix4.js
  4. 2 16
      src/renderers/WebGLRenderer.js

+ 0 - 5
docs/api/math/Matrix4.html

@@ -113,11 +113,6 @@
 		Transposes this matrix.
 		</div>
 
-		<h3>.flattenToArray( [page:Array flat] ) [page:Array]</h3>
-		<div>
-		Flattens this matrix into supplied *flat* array.
-		</div>
-
 		<h3>.flattenToArrayOffset( [page:Array flat], [page:Integer offset] ) [page:Array]</h3>
 		<div>
 		Flattens this matrix into supplied *flat* array starting from *offset* position in the array.

+ 0 - 11
src/math/Matrix3.js

@@ -187,17 +187,6 @@ THREE.Matrix3.prototype = {
 
 	},
 
-	flattenToArray: function ( array ) {
-
-		var te = this.elements;
-		array[ 0 ] = te[0]; array[ 1 ] = te[1]; array[ 2 ] = te[2];
-		array[ 3 ] = te[3]; array[ 4 ] = te[4]; array[ 5 ] = te[5]; 
-		array[ 6 ] = te[6]; array[ 7 ] = te[7]; array[ 8 ] = te[8];
-
-		return array;
-
-	},
-
 	flattenToArrayOffset: function( array, offset ) {
 
 		var te = this.elements;

+ 0 - 12
src/math/Matrix4.js

@@ -542,18 +542,6 @@ THREE.Matrix4.prototype = {
 
 	},
 
-	flattenToArray: function ( array ) {
-
-		var te = this.elements;
-		array[ 0 ] = te[0]; array[ 1 ] = te[1]; array[ 2 ] = te[2]; array[ 3 ] = te[3];
-		array[ 4 ] = te[4]; array[ 5 ] = te[5]; array[ 6 ] = te[6]; array[ 7 ] = te[7];
-		array[ 8 ] = te[8]; array[ 9 ] = te[9]; array[ 10 ] = te[10]; array[ 11 ] = te[11];
-		array[ 12 ] = te[12]; array[ 13 ] = te[13]; array[ 14 ] = te[14]; array[ 15 ] = te[15];
-
-		return array;
-
-	},
-
 	flattenToArrayOffset: function( array, offset ) {
 
 		var te = this.elements;

+ 2 - 16
src/renderers/WebGLRenderer.js

@@ -4857,14 +4857,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 			} else if ( type === "m3") { // single THREE.Matrix3
 
-				if ( uniform._array === undefined ) {
-
-					uniform._array = new Float32Array( 9 );
-
-				}
-
-				value.flattenToArray( uniform._array );
-				_gl.uniformMatrix3fv( location, false, uniform._array );
+				_gl.uniformMatrix3fv( location, false, value.elements );
 
 			} else if ( type === "m3v" ) { // array of THREE.Matrix3
 
@@ -4884,14 +4877,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 			} else if ( type === "m4") { // single THREE.Matrix4
 
-				if ( uniform._array === undefined ) {
-
-					uniform._array = new Float32Array( 16 );
-
-				}
-
-				value.flattenToArray( uniform._array );
-				_gl.uniformMatrix4fv( location, false, uniform._array );
+				_gl.uniformMatrix4fv( location, false, value.elements );
 
 			} else if ( type === "m4v" ) { // array of THREE.Matrix4