Explorar el Código

Moved BufferGeometryUtils and UvsUtils to examples/js/utils. See #4835.

Mr.doob hace 11 años
padre
commit
eecc8f7c5c

+ 1 - 1
editor/index.html

@@ -34,7 +34,7 @@
 
 
 		<!-- WIP -->
 		<!-- WIP -->
 
 
-		<script src="../examples/js/BufferGeometryUtils.js"></script>
+		<script src="../examples/js/utils/BufferGeometryUtils.js"></script>
 
 
 		<script src="../examples/js/exporters/BufferGeometryExporter.js"></script>
 		<script src="../examples/js/exporters/BufferGeometryExporter.js"></script>
 		<script src="../examples/js/exporters/TypedGeometryExporter.js"></script>
 		<script src="../examples/js/exporters/TypedGeometryExporter.js"></script>

+ 1 - 1
examples/css3d_molecules.html

@@ -346,7 +346,7 @@
 
 
 				loader.load( url, function ( geometry, geometryBonds ) {
 				loader.load( url, function ( geometry, geometryBonds ) {
 
 
-					var offset = THREE.GeometryUtils.center( geometry );
+					var offset = geometry.center();
 					geometryBonds.applyMatrix( new THREE.Matrix4().makeTranslation( offset.x, offset.y, offset.z ) );
 					geometryBonds.applyMatrix( new THREE.Matrix4().makeTranslation( offset.x, offset.y, offset.z ) );
 
 
 					for ( var i = 0; i < geometry.vertices.length; i ++ ) {
 					for ( var i = 0; i < geometry.vertices.length; i ++ ) {

+ 1 - 1
examples/js/Car.js

@@ -274,7 +274,7 @@ THREE.Car = function () {
 
 
 				scope.wheelDiameter = bb.max.y - bb.min.y;
 				scope.wheelDiameter = bb.max.y - bb.min.y;
 
 
-				THREE.GeometryUtils.center( scope.wheelGeometry );
+				scope.wheelGeometry.center();
 
 
 			}
 			}
 
 

+ 1 - 1
examples/js/loaders/ColladaLoader.js

@@ -1123,7 +1123,7 @@ THREE.ColladaLoader = function () {
 
 
 		if ( options.centerGeometry && obj.geometry ) {
 		if ( options.centerGeometry && obj.geometry ) {
 
 
-			var delta = THREE.GeometryUtils.center( obj.geometry );
+			var delta = obj.geometry.center();
 			delta.multiply( obj.scale );
 			delta.multiply( obj.scale );
 			delta.applyQuaternion( obj.quaternion );
 			delta.applyQuaternion( obj.quaternion );
 
 

+ 0 - 0
examples/js/BufferGeometryUtils.js → examples/js/utils/BufferGeometryUtils.js


+ 1 - 4
examples/js/utils/GeometryUtils.js

@@ -271,7 +271,7 @@ THREE.GeometryUtils = {
 	},
 	},
 
 
 	// Get triangle area (half of parallelogram)
 	// Get triangle area (half of parallelogram)
-	//	http://mathworld.wolfram.com/TriangleArea.html
+	// http://mathworld.wolfram.com/TriangleArea.html
 
 
 	triangleArea: function () {
 	triangleArea: function () {
 
 
@@ -290,9 +290,6 @@ THREE.GeometryUtils = {
 
 
 	}(),
 	}(),
 
 
-
-	,
-
 	center: function ( geometry ) {
 	center: function ( geometry ) {
 
 
 		console.warn( 'THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.' );
 		console.warn( 'THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.' );

+ 0 - 2
examples/js/UVsUtils.js → examples/js/utils/UVsUtils.js

@@ -1,8 +1,6 @@
 /*
 /*
  * @author gyuque / http://github.com/gyuque
  * @author gyuque / http://github.com/gyuque
- *
  * Cylinder Mapping for ExtrudeGeometry
  * Cylinder Mapping for ExtrudeGeometry
- *
  */
  */
 
 
 THREE.UVsUtils = {
 THREE.UVsUtils = {

+ 1 - 1
examples/misc_uv_tests.html

@@ -6,7 +6,7 @@
 	</head>
 	</head>
 	<body>
 	<body>
 		<script src="../build/three.min.js"></script>
 		<script src="../build/three.min.js"></script>
-		<script src="js/UVsUtils.js"></script>
+		<script src="js/utils/UVsUtils.js"></script>
 		<script>
 		<script>
 			/* 
 			/* 
 			 * This is to help debug UVs problems in geometry, 
 			 * This is to help debug UVs problems in geometry, 

+ 1 - 1
examples/webgl_custom_attributes_lines.html

@@ -163,7 +163,7 @@
 
 
 			geometry.dynamic = true;
 			geometry.dynamic = true;
 
 
-			THREE.GeometryUtils.center( geometry );
+			geometry.center();
 
 
 			object = new THREE.Line( geometry, shaderMaterial, THREE.LineStrip );
 			object = new THREE.Line( geometry, shaderMaterial, THREE.LineStrip );
 
 

+ 2 - 7
examples/webgl_geometries2.html

@@ -20,19 +20,14 @@
 		<script src="js/Detector.js"></script>
 		<script src="js/Detector.js"></script>
 		<script src="js/libs/stats.min.js"></script>
 		<script src="js/libs/stats.min.js"></script>
 
 
-		<!--
-		<script src="../src/core/Geometry.js"></script>
-		<script src="../src/extras/geometries/ParametricGeometry.js"></script>
-		-->
-
 		<script src="js/CurveExtras.js"></script>
 		<script src="js/CurveExtras.js"></script>
-		<script src="js/UVsUtils.js"></script>
 		<script src="js/ParametricGeometries.js"></script>
 		<script src="js/ParametricGeometries.js"></script>
+		<script src="js/utils/UVsUtils.js"></script>
+
 		<script>
 		<script>
 
 
 			/* Testing the new Parametric Surfaces Geometries*/
 			/* Testing the new Parametric Surfaces Geometries*/
 
 
-
 			if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
 			if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
 
 
 			var container, stats;
 			var container, stats;

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 2 - 1
examples/webgl_geometry_extrude_uvs2.html


+ 1 - 1
examples/webgl_geometry_tessellation.html

@@ -161,7 +161,7 @@
 
 
 			geometry.dynamic = true;
 			geometry.dynamic = true;
 
 
-			THREE.GeometryUtils.center( geometry );
+			geometry.center();
 
 
 			var tessellateModifier = new THREE.TessellateModifier( 4 );
 			var tessellateModifier = new THREE.TessellateModifier( 4 );
 
 

+ 1 - 0
examples/webgl_geometry_text.html

@@ -39,6 +39,7 @@
 
 
 
 
 		<script src="../build/three.min.js"></script>
 		<script src="../build/three.min.js"></script>
+		<script src="js/utils/GeometryUtils.js"></script>
 
 
 		<script src="js/shaders/ConvolutionShader.js"></script>
 		<script src="js/shaders/ConvolutionShader.js"></script>
 		<script src="js/shaders/CopyShader.js"></script>
 		<script src="js/shaders/CopyShader.js"></script>

+ 2 - 1
examples/webgl_loader_ctm_materials.html

@@ -270,7 +270,8 @@
 
 
 				loader.statusDomElement.style.display = "none";
 				loader.statusDomElement.style.display = "none";
 
 
-				THREE.GeometryUtils.center( geometry );
+				geometry.center();
+				
 				hackMaterials( materials );
 				hackMaterials( materials );
 
 
 				var material = new THREE.MeshFaceMaterial( materials );
 				var material = new THREE.MeshFaceMaterial( materials );

+ 1 - 1
examples/webgl_loader_pdb.html

@@ -193,7 +193,7 @@
 					var boxGeometry = new THREE.BoxGeometry( 1, 1, 1 );
 					var boxGeometry = new THREE.BoxGeometry( 1, 1, 1 );
 					var sphereGeometry = new THREE.IcosahedronGeometry( 1, 2 );
 					var sphereGeometry = new THREE.IcosahedronGeometry( 1, 2 );
 
 
-					var offset = THREE.GeometryUtils.center( geometry );
+					var offset = geometry.center();
 					geometryBonds.applyMatrix( new THREE.Matrix4().makeTranslation( offset.x, offset.y, offset.z ) );
 					geometryBonds.applyMatrix( new THREE.Matrix4().makeTranslation( offset.x, offset.y, offset.z ) );
 
 
 					for ( var i = 0; i < geometry.vertices.length; i ++ ) {
 					for ( var i = 0; i < geometry.vertices.length; i ++ ) {

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio