From eecc8f7c5c13c11fd07147faaaac868804400b3f Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Thu, 22 May 2014 14:18:58 +0100 Subject: [PATCH] Moved BufferGeometryUtils and UvsUtils to examples/js/utils. See #4835. --- editor/index.html | 2 +- examples/css3d_molecules.html | 2 +- examples/js/Car.js | 2 +- examples/js/loaders/ColladaLoader.js | 2 +- examples/js/{ => utils}/BufferGeometryUtils.js | 0 examples/js/utils/GeometryUtils.js | 5 +---- examples/js/{ => utils}/UVsUtils.js | 2 -- examples/misc_uv_tests.html | 2 +- examples/webgl_custom_attributes_lines.html | 2 +- examples/webgl_geometries2.html | 9 ++------- examples/webgl_geometry_extrude_uvs2.html | 4 +++- examples/webgl_geometry_tessellation.html | 2 +- examples/webgl_geometry_text.html | 1 + examples/webgl_loader_ctm_materials.html | 3 ++- examples/webgl_loader_pdb.html | 2 +- 15 files changed, 17 insertions(+), 23 deletions(-) rename examples/js/{ => utils}/BufferGeometryUtils.js (100%) rename examples/js/{ => utils}/UVsUtils.js (99%) diff --git a/editor/index.html b/editor/index.html index 422049d3ba..a9bb35566b 100644 --- a/editor/index.html +++ b/editor/index.html @@ -34,7 +34,7 @@ - + diff --git a/examples/css3d_molecules.html b/examples/css3d_molecules.html index dd4df1ef54..5f94d61ce2 100644 --- a/examples/css3d_molecules.html +++ b/examples/css3d_molecules.html @@ -346,7 +346,7 @@ 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 ) ); for ( var i = 0; i < geometry.vertices.length; i ++ ) { diff --git a/examples/js/Car.js b/examples/js/Car.js index 05e6c8ef10..d4f9d66f2e 100644 --- a/examples/js/Car.js +++ b/examples/js/Car.js @@ -274,7 +274,7 @@ THREE.Car = function () { scope.wheelDiameter = bb.max.y - bb.min.y; - THREE.GeometryUtils.center( scope.wheelGeometry ); + scope.wheelGeometry.center(); } diff --git a/examples/js/loaders/ColladaLoader.js b/examples/js/loaders/ColladaLoader.js index 30b96b1640..a708b06134 100644 --- a/examples/js/loaders/ColladaLoader.js +++ b/examples/js/loaders/ColladaLoader.js @@ -1123,7 +1123,7 @@ THREE.ColladaLoader = function () { if ( options.centerGeometry && obj.geometry ) { - var delta = THREE.GeometryUtils.center( obj.geometry ); + var delta = obj.geometry.center(); delta.multiply( obj.scale ); delta.applyQuaternion( obj.quaternion ); diff --git a/examples/js/BufferGeometryUtils.js b/examples/js/utils/BufferGeometryUtils.js similarity index 100% rename from examples/js/BufferGeometryUtils.js rename to examples/js/utils/BufferGeometryUtils.js diff --git a/examples/js/utils/GeometryUtils.js b/examples/js/utils/GeometryUtils.js index a0670e0b44..d6f584a289 100644 --- a/examples/js/utils/GeometryUtils.js +++ b/examples/js/utils/GeometryUtils.js @@ -271,7 +271,7 @@ THREE.GeometryUtils = { }, // Get triangle area (half of parallelogram) - // http://mathworld.wolfram.com/TriangleArea.html + // http://mathworld.wolfram.com/TriangleArea.html triangleArea: function () { @@ -290,9 +290,6 @@ THREE.GeometryUtils = { }(), - - , - center: function ( geometry ) { console.warn( 'THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.' ); diff --git a/examples/js/UVsUtils.js b/examples/js/utils/UVsUtils.js similarity index 99% rename from examples/js/UVsUtils.js rename to examples/js/utils/UVsUtils.js index 42399d1085..1a8435396c 100644 --- a/examples/js/UVsUtils.js +++ b/examples/js/utils/UVsUtils.js @@ -1,8 +1,6 @@ /* * @author gyuque / http://github.com/gyuque - * * Cylinder Mapping for ExtrudeGeometry - * */ THREE.UVsUtils = { diff --git a/examples/misc_uv_tests.html b/examples/misc_uv_tests.html index 0993b21e0b..e33b6d8825 100644 --- a/examples/misc_uv_tests.html +++ b/examples/misc_uv_tests.html @@ -6,7 +6,7 @@ - + - - - + + - + diff --git a/examples/webgl_geometry_tessellation.html b/examples/webgl_geometry_tessellation.html index 9e56411389..a9eb4f0317 100644 --- a/examples/webgl_geometry_tessellation.html +++ b/examples/webgl_geometry_tessellation.html @@ -161,7 +161,7 @@ geometry.dynamic = true; - THREE.GeometryUtils.center( geometry ); + geometry.center(); var tessellateModifier = new THREE.TessellateModifier( 4 ); diff --git a/examples/webgl_geometry_text.html b/examples/webgl_geometry_text.html index e0b09415d8..bcd75fffce 100644 --- a/examples/webgl_geometry_text.html +++ b/examples/webgl_geometry_text.html @@ -39,6 +39,7 @@ + diff --git a/examples/webgl_loader_ctm_materials.html b/examples/webgl_loader_ctm_materials.html index a8289bccaf..a9a5fd9b7b 100644 --- a/examples/webgl_loader_ctm_materials.html +++ b/examples/webgl_loader_ctm_materials.html @@ -270,7 +270,8 @@ loader.statusDomElement.style.display = "none"; - THREE.GeometryUtils.center( geometry ); + geometry.center(); + hackMaterials( materials ); var material = new THREE.MeshFaceMaterial( materials ); diff --git a/examples/webgl_loader_pdb.html b/examples/webgl_loader_pdb.html index 18a927505e..140bb9580d 100644 --- a/examples/webgl_loader_pdb.html +++ b/examples/webgl_loader_pdb.html @@ -193,7 +193,7 @@ var boxGeometry = new THREE.BoxGeometry( 1, 1, 1 ); 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 ) ); for ( var i = 0; i < geometry.vertices.length; i ++ ) { -- GitLab