Explorar o código

Removed GeometryUtils.triangulateQuads.

Mr.doob %!s(int64=11) %!d(string=hai) anos
pai
achega
5a3e4b9a14
Modificáronse 2 ficheiros con 1 adicións e 42 borrados
  1. 1 4
      examples/webgl_geometry_terrain_raycast.html
  2. 0 38
      src/extras/GeometryUtils.js

+ 1 - 4
examples/webgl_geometry_terrain_raycast.html

@@ -95,10 +95,7 @@
 
 				}
 
-				// PLEASE NOTE!! With raycasting faces must be planar!  PlaneGeometry is made up of
-				// quads and now that we have changed the height value of the verts, the quads are no
-				// longer planar.  We must break it down into triangles in order to preserve this information.
-				THREE.GeometryUtils.triangulateQuads(geometry);
+				geometry.computeFaceNormals();
 
 				texture = new THREE.Texture( generateTexture( data, worldWidth, worldDepth ), new THREE.UVMapping(), THREE.ClampToEdgeWrapping, THREE.ClampToEdgeWrapping );
 				texture.needsUpdate = true;

+ 0 - 38
src/extras/GeometryUtils.js

@@ -314,44 +314,6 @@ THREE.GeometryUtils = {
 
 		return offset;
 
-	},
-
-	triangulateQuads: function ( geometry ) {
-
-		var i, il, j, jl;
-
-		var faces = [];
-		var faceVertexUvs = [];
-
-		for ( i = 0, il = geometry.faceVertexUvs.length; i < il; i ++ ) {
-
-			faceVertexUvs[ i ] = [];
-
-		}
-
-		for ( i = 0, il = geometry.faces.length; i < il; i ++ ) {
-
-			var face = geometry.faces[ i ];
-
-			faces.push( face );
-
-			for ( j = 0, jl = geometry.faceVertexUvs.length; j < jl; j ++ ) {
-
-				faceVertexUvs[ j ].push( geometry.faceVertexUvs[ j ][ i ] );
-
-			}
-
-		}
-
-		geometry.faces = faces;
-		geometry.faceVertexUvs = faceVertexUvs;
-
-		geometry.computeCentroids();
-		geometry.computeFaceNormals();
-		geometry.computeVertexNormals();
-
-		if ( geometry.hasTangents ) geometry.computeTangents();
-
 	}
 
 };