Jelajahi Sumber

Removed removeMaterials and setMaterialIndex from GeometryUtils. See #3713.

Mr.doob 12 tahun lalu
induk
melakukan
40432e2ba5
2 mengubah file dengan 1 tambahan dan 55 penghapusan
  1. 0 17
      docs/api/extras/GeometryUtils.html
  2. 1 38
      src/extras/GeometryUtils.js

+ 0 - 17
docs/api/extras/GeometryUtils.html

@@ -21,12 +21,6 @@
 		materialIndexOffset — Offset applied to the materialIndex of all the new faces in the merged geometry. Default : 0 <br />
 		</div>
 
-		<h3> .removeMaterials( [page:Geometry geometry1] , [page:Material materialIndexArray] )</h3>
-		<div>
-		geometry — Geometry that need to remove material <br />
-		materialIndex — Material index<br />
-		</div>
-
 		<h3> .randomPointInTriangle( [page:Vector VectorA] , [page:Vector VectorB]  , [page:Vector VectorC])</h3>
 		<div>
 		VectorA — Vector  <br />
@@ -83,17 +77,6 @@
 
 		</div>
 
-		<h3> .setMaterialIndex ( [page:geometry Geometry] , [page:Integer index], [page:Face startFace], [page:Face endFace]) </h3>
-
-		<div>
-
-		Geometry — Geometry <br />
-		Index — New index value for the material <br />
-		startFace — Starting range of Face <br />
-		endFace — Final range of Face  <br />
-
-		</div>
-
 
 		<h2>Source</h2>
 

+ 1 - 38
src/extras/GeometryUtils.js

@@ -118,29 +118,6 @@ THREE.GeometryUtils = {
 
 	},
 
-	removeMaterials: function ( geometry, materialIndexArray ) {
-
-		var materialIndexMap = {};
-
-		for ( var i = 0, il = materialIndexArray.length; i < il; i ++ ) {
-
-			materialIndexMap[ materialIndexArray[i] ] = true;
-
-		}
-
-		var face, newFaces = [];
-
-		for ( var i = 0, il = geometry.faces.length; i < il; i ++ ) {
-
-			face = geometry.faces[ i ];
-			if ( ! ( face.materialIndex in materialIndexMap ) ) newFaces.push( face );
-
-		}
-
-		geometry.faces = newFaces;
-
-	},
-
 	// Get random point in triangle (via barycentric coordinates)
 	// 	(uniform distribution)
 	// 	http://www.cgafaq.info/wiki/Random_Point_In_Triangle
@@ -375,20 +352,6 @@ THREE.GeometryUtils = {
 
 		if ( geometry.hasTangents ) geometry.computeTangents();
 
-	},
-
-	setMaterialIndex: function ( geometry, index, startFace, endFace ){
-
-		var faces = geometry.faces;
-		var start = startFace || 0;
-		var end = endFace || faces.length - 1;
-
-		for ( var i = start; i <= end; i ++ ) {
-
-			faces[i].materialIndex = index;
-
-		}
-
-    }
+	}
 
 };