Pārlūkot izejas kodu

Examples: Clean up.

Mugen87 4 gadi atpakaļ
vecāks
revīzija
437f8242ab

+ 2 - 1
examples/js/lines/LineGeometry.js

@@ -68,7 +68,8 @@ THREE.LineGeometry.prototype = Object.assign( Object.create( THREE.LineSegmentsG
 
 		if ( geometry.isGeometry ) {
 
-			this.setPositions( geometry.vertices );
+			console.error( 'THREE.LineGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.' );
+			return;
 
 		} else if ( geometry.isBufferGeometry ) {
 

+ 2 - 1
examples/js/lines/LineSegmentsGeometry.js

@@ -134,7 +134,8 @@ THREE.LineSegmentsGeometry.prototype = Object.assign( Object.create( THREE.Insta
 
 		if ( geometry.isGeometry ) {
 
-			this.setPositions( geometry.vertices );
+			console.error( 'THREE.LineSegmentsGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.' );
+			return;
 
 		} else if ( geometry.isBufferGeometry ) {
 

+ 2 - 10
examples/js/math/ConvexHull.js

@@ -79,16 +79,8 @@ THREE.ConvexHull = ( function () {
 
 					if ( geometry.isGeometry ) {
 
-						var vertices = geometry.vertices;
-
-						for ( i = 0, l = vertices.length; i < l; i ++ ) {
-
-							point = vertices[ i ].clone();
-							point.applyMatrix4( node.matrixWorld );
-
-							points.push( point );
-
-						}
+						console.error( 'THREE.ConvexHull no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.' );
+						return;
 
 					} else if ( geometry.isBufferGeometry ) {
 

+ 2 - 19
examples/js/utils/UVsDebug.js

@@ -40,25 +40,8 @@ THREE.UVsDebug = function ( geometry, size ) {
 
 	if ( geometry.isGeometry ) {
 
-		var faces = geometry.faces;
-		var uvSet = geometry.faceVertexUvs[ 0 ];
-
-		for ( var i = 0, il = uvSet.length; i < il; i ++ ) {
-
-			var face = faces[ i ];
-			var uv = uvSet[ i ];
-
-			face[ 0 ] = face.a;
-			face[ 1 ] = face.b;
-			face[ 2 ] = face.c;
-
-			uvs[ 0 ].copy( uv[ 0 ] );
-			uvs[ 1 ].copy( uv[ 1 ] );
-			uvs[ 2 ].copy( uv[ 2 ] );
-
-			processFace( face, uvs, i );
-
-		}
+		console.error( 'THREE.UVsDebug no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.' );
+		return;
 
 	} else {
 

+ 2 - 1
examples/jsm/lines/LineGeometry.js

@@ -70,7 +70,8 @@ LineGeometry.prototype = Object.assign( Object.create( LineSegmentsGeometry.prot
 
 		if ( geometry.isGeometry ) {
 
-			this.setPositions( geometry.vertices );
+			console.error( 'THREE.LineGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.' );
+			return;
 
 		} else if ( geometry.isBufferGeometry ) {
 

+ 2 - 1
examples/jsm/lines/LineSegmentsGeometry.js

@@ -145,7 +145,8 @@ LineSegmentsGeometry.prototype = Object.assign( Object.create( InstancedBufferGe
 
 		if ( geometry.isGeometry ) {
 
-			this.setPositions( geometry.vertices );
+			console.error( 'THREE.LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.' );
+			return;
 
 		} else if ( geometry.isBufferGeometry ) {
 

+ 2 - 10
examples/jsm/math/ConvexHull.js

@@ -86,16 +86,8 @@ var ConvexHull = ( function () {
 
 					if ( geometry.isGeometry ) {
 
-						var vertices = geometry.vertices;
-
-						for ( i = 0, l = vertices.length; i < l; i ++ ) {
-
-							point = vertices[ i ].clone();
-							point.applyMatrix4( node.matrixWorld );
-
-							points.push( point );
-
-						}
+						console.error( 'THREE.ConvexHull no longer supports Geometry. Use THREE.BufferGeometry instead.' );
+						return;
 
 					} else if ( geometry.isBufferGeometry ) {
 

+ 2 - 19
examples/jsm/utils/UVsDebug.js

@@ -44,25 +44,8 @@ var UVsDebug = function ( geometry, size ) {
 
 	if ( geometry.isGeometry ) {
 
-		var faces = geometry.faces;
-		var uvSet = geometry.faceVertexUvs[ 0 ];
-
-		for ( var i = 0, il = uvSet.length; i < il; i ++ ) {
-
-			var face = faces[ i ];
-			var uv = uvSet[ i ];
-
-			face[ 0 ] = face.a;
-			face[ 1 ] = face.b;
-			face[ 2 ] = face.c;
-
-			uvs[ 0 ].copy( uv[ 0 ] );
-			uvs[ 1 ].copy( uv[ 1 ] );
-			uvs[ 2 ].copy( uv[ 2 ] );
-
-			processFace( face, uvs, i );
-
-		}
+		console.error( 'THREE.UVsDebug no longer supports Geometry. Use THREE.BufferGeometry instead.' );
+		return;
 
 	} else {
 

+ 4 - 4
utils/modularize.js

@@ -56,10 +56,10 @@ var files = [
 	{ path: 'lights/RectAreaLightUniformsLib.js', dependencies: [], ignoreList: [] },
 
 	{ path: 'lines/Line2.js', dependencies: [ { name: 'LineSegments2', path: 'lines/LineSegments2.js' }, { name: 'LineGeometry', path: 'lines/LineGeometry.js' }, { name: 'LineMaterial', path: 'lines/LineMaterial.js' } ], ignoreList: [] },
-	{ path: 'lines/LineGeometry.js', dependencies: [ { name: 'LineSegmentsGeometry', path: 'lines/LineSegmentsGeometry.js' } ], ignoreList: [] },
+	{ path: 'lines/LineGeometry.js', dependencies: [ { name: 'LineSegmentsGeometry', path: 'lines/LineSegmentsGeometry.js' } ], ignoreList: [ 'BufferGeometry' ] },
 	{ path: 'lines/LineMaterial.js', dependencies: [], ignoreList: [] },
 	{ path: 'lines/LineSegments2.js', dependencies: [ { name: 'LineSegmentsGeometry', path: 'lines/LineSegmentsGeometry.js' }, { name: 'LineMaterial', path: 'lines/LineMaterial.js' } ], ignoreList: [] },
-	{ path: 'lines/LineSegmentsGeometry.js', dependencies: [], ignoreList: [] },
+	{ path: 'lines/LineSegmentsGeometry.js', dependencies: [], ignoreList: [ 'BufferGeometry' ] },
 	{ path: 'lines/Wireframe.js', dependencies: [ { name: 'LineSegmentsGeometry', path: 'lines/LineSegmentsGeometry.js' }, { name: 'LineMaterial', path: 'lines/LineMaterial.js' } ], ignoreList: [] },
 	{ path: 'lines/WireframeGeometry2.js', dependencies: [ { name: 'LineSegmentsGeometry', path: 'lines/LineSegmentsGeometry.js' } ], ignoreList: [] },
 
@@ -101,7 +101,7 @@ var files = [
 	{ path: 'loaders/XLoader.js', dependencies: [], ignoreList: [] },
 
 	{ path: 'math/ColorConverter.js', dependencies: [], ignoreList: [] },
-	{ path: 'math/ConvexHull.js', dependencies: [], ignoreList: [] },
+	{ path: 'math/ConvexHull.js', dependencies: [], ignoreList: [ 'BufferGeometry' ] },
 	{ path: 'math/ImprovedNoise.js', dependencies: [], ignoreList: [] },
 	{ path: 'math/Lut.js', dependencies: [], ignoreList: [] },
 	{ path: 'math/SimplexNoise.js', dependencies: [], ignoreList: [] },
@@ -220,7 +220,7 @@ var files = [
 	{ path: 'utils/SceneUtils.js', dependencies: [], ignoreList: [] },
 	{ path: 'utils/ShadowMapViewer.js', dependencies: [ { name: 'UnpackDepthRGBAShader', path: 'shaders/UnpackDepthRGBAShader.js' } ], ignoreList: [] },
 	{ path: 'utils/SkeletonUtils.js', dependencies: [], ignoreList: [] },
-	{ path: 'utils/UVsDebug.js', dependencies: [], ignoreList: [ 'SphereGeometry' ] },
+	{ path: 'utils/UVsDebug.js', dependencies: [], ignoreList: [ 'SphereGeometry', 'BufferGeometry' ] },
 
 	{ path: 'WebGL.js', dependencies: [], ignoreList: [] },
 ];