2
0
Эх сурвалжийг харах

BufferGeometryUtils: allow tree-shaking (#22267)

* BufferGeometryUtils: convert to esmodules

* IFCLoader: update BufferGeometryUtils import

* Tests: update BufferGeometryUtils import
Marco Fugaro 4 жил өмнө
parent
commit
c7b19accd6

+ 1 - 1
examples/jsm/loaders/IFCLoader.js

@@ -18,7 +18,7 @@ import {
 	Loader,
 	FileLoader,
 } from "../../../build/three.module.js";
-import { BufferGeometryUtils } from "../utils/BufferGeometryUtils.js";
+import * as BufferGeometryUtils from "../utils/BufferGeometryUtils.js";
 
 const IdAttrName = "expressID";
 const merge = (geoms, createGroups = false) => {

+ 1 - 1
examples/jsm/modifiers/EdgeSplitModifier.js

@@ -3,7 +3,7 @@ import {
 	BufferGeometry,
 	Vector3
 } from '../../../build/three.module.js';
-import { BufferGeometryUtils } from '../utils/BufferGeometryUtils.js';
+import * as BufferGeometryUtils from '../utils/BufferGeometryUtils.js';
 
 const _A = new Vector3();
 const _B = new Vector3();

+ 2 - 2
examples/jsm/modifiers/SimplifyModifier.js

@@ -3,7 +3,7 @@ import {
 	Float32BufferAttribute,
 	Vector3
 } from '../../../build/three.module.js';
-import { BufferGeometryUtils } from '../utils/BufferGeometryUtils.js';
+import * as BufferGeometryUtils from '../utils/BufferGeometryUtils.js';
 
 /**
  *	Simplification Geometry Modifier
@@ -500,7 +500,7 @@ class Vertex {
 	constructor( v ) {
 
 		this.position = v;
-			
+
 		this.id = -1; // external use position in vertices list (for e.g. face generation)
 
 		this.faces = []; // faces vertex is connected

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 450 - 486
examples/jsm/utils/BufferGeometryUtils.js


+ 3 - 3
examples/physics_ammo_volume.html

@@ -26,7 +26,7 @@
 			import Stats from './jsm/libs/stats.module.js';
 
 			import { OrbitControls } from './jsm/controls/OrbitControls.js';
-			import { BufferGeometryUtils } from './jsm/utils/BufferGeometryUtils.js';
+			import * as BufferGeometryUtils from './jsm/utils/BufferGeometryUtils.js';
 
 			// Graphics variables
 			let container, stats;
@@ -149,7 +149,7 @@
 				const ground = createParalellepiped( 40, 1, 40, 0, pos, quat, new THREE.MeshPhongMaterial( { color: 0xFFFFFF } ) );
 				ground.castShadow = true;
 				ground.receiveShadow = true;
-				textureLoader.load( "textures/grid.png", function ( texture ) {
+				textureLoader.load( 'textures/grid.png', function ( texture ) {
 
 					texture.wrapS = THREE.RepeatWrapping;
 					texture.wrapT = THREE.RepeatWrapping;
@@ -251,7 +251,7 @@
 				volume.frustumCulled = false;
 				scene.add( volume );
 
-				textureLoader.load( "textures/colors.png", function ( texture ) {
+				textureLoader.load( 'textures/colors.png', function ( texture ) {
 
 					volume.material.map = texture;
 					volume.material.needsUpdate = true;

+ 1 - 1
examples/webgl_buffergeometry_compression.html

@@ -19,7 +19,7 @@
 			import Stats from './jsm/libs/stats.module.js';
 			import { OrbitControls } from './jsm/controls/OrbitControls.js';
 			import { GeometryCompressionUtils } from './jsm/utils/GeometryCompressionUtils.js';
-			import { BufferGeometryUtils } from './jsm/utils/BufferGeometryUtils.js';
+			import * as BufferGeometryUtils from './jsm/utils/BufferGeometryUtils.js';
 			import { TeapotGeometry } from './jsm/geometries/TeapotGeometry.js';
 			import { GUI } from './jsm/libs/dat.gui.module.js';
 

+ 1 - 1
examples/webgl_custom_attributes_points2.html

@@ -55,7 +55,7 @@
 
 			import Stats from './jsm/libs/stats.module.js';
 
-			import { BufferGeometryUtils } from './jsm/utils/BufferGeometryUtils.js';
+			import * as BufferGeometryUtils from './jsm/utils/BufferGeometryUtils.js';
 
 			let renderer, scene, camera, stats;
 			let sphere, length1;

+ 1 - 1
examples/webgl_custom_attributes_points3.html

@@ -63,7 +63,7 @@
 
 			import Stats from './jsm/libs/stats.module.js';
 
-			import { BufferGeometryUtils } from './jsm/utils/BufferGeometryUtils.js';
+			import * as BufferGeometryUtils from './jsm/utils/BufferGeometryUtils.js';
 
 			let renderer, scene, camera, stats;
 

+ 1 - 1
examples/webgl_geometry_convex.html

@@ -16,7 +16,7 @@
 
 			import { OrbitControls } from './jsm/controls/OrbitControls.js';
 			import { ConvexGeometry } from './jsm/geometries/ConvexGeometry.js';
-			import { BufferGeometryUtils } from './jsm/utils/BufferGeometryUtils.js';
+			import * as BufferGeometryUtils from './jsm/utils/BufferGeometryUtils.js';
 
 			let group, camera, scene, renderer;
 

+ 1 - 1
examples/webgl_geometry_minecraft.html

@@ -28,7 +28,7 @@
 
 			import { FirstPersonControls } from './jsm/controls/FirstPersonControls.js';
 			import { ImprovedNoise } from './jsm/math/ImprovedNoise.js';
-			import { BufferGeometryUtils } from './jsm/utils/BufferGeometryUtils.js';
+			import * as BufferGeometryUtils from './jsm/utils/BufferGeometryUtils.js';
 
 			let container, stats;
 

+ 1 - 1
examples/webgl_instancing_performance.html

@@ -32,7 +32,7 @@
 		import { GUI } from './jsm/libs/dat.gui.module.js';
 
 		import { OrbitControls } from './jsm/controls/OrbitControls.js';
-		import { BufferGeometryUtils } from './jsm/utils/BufferGeometryUtils.js';
+		import * as BufferGeometryUtils from './jsm/utils/BufferGeometryUtils.js';
 
 		let container, stats, gui, guiStatsEl;
 		let camera, controls, scene, renderer, material;

+ 1 - 1
examples/webgl_interactive_cubes_gpu.html

@@ -30,7 +30,7 @@
 			import Stats from './jsm/libs/stats.module.js';
 
 			import { TrackballControls } from './jsm/controls/TrackballControls.js';
-			import { BufferGeometryUtils } from './jsm/utils/BufferGeometryUtils.js';
+			import * as BufferGeometryUtils from './jsm/utils/BufferGeometryUtils.js';
 
 			let container, stats;
 			let camera, controls, scene, renderer;

+ 1 - 1
examples/webgl_interactive_points.html

@@ -57,7 +57,7 @@
 
 			import Stats from './jsm/libs/stats.module.js';
 
-			import { BufferGeometryUtils } from './jsm/utils/BufferGeometryUtils.js';
+			import * as BufferGeometryUtils from './jsm/utils/BufferGeometryUtils.js';
 
 			let renderer, scene, camera, stats;
 

+ 1 - 1
examples/webgl_modifier_edgesplit.html

@@ -15,7 +15,7 @@
 			import { OrbitControls } from './jsm/controls/OrbitControls.js';
 			import { OBJLoader } from './jsm/loaders/OBJLoader.js';
 			import { EdgeSplitModifier } from './jsm/modifiers/EdgeSplitModifier.js';
-			import { BufferGeometryUtils } from './jsm/utils/BufferGeometryUtils.js';
+			import * as BufferGeometryUtils from './jsm/utils/BufferGeometryUtils.js';
 
 			import { GUI } from './jsm/libs/dat.gui.module.js';
 

+ 1 - 1
examples/webgl_postprocessing_crossfade.html

@@ -22,7 +22,7 @@
 			import Stats from './jsm/libs/stats.module.js';
 			import { GUI } from './jsm/libs/dat.gui.module.js';
 
-			import { BufferGeometryUtils } from './jsm/utils/BufferGeometryUtils.js';
+			import * as BufferGeometryUtils from './jsm/utils/BufferGeometryUtils.js';
 
 			let container, stats;
 			let renderer;

+ 1 - 1
test/unit/example/utils/BufferGeometryUtils.tests.js

@@ -1,6 +1,6 @@
 /* global QUnit */
 
-import { BufferGeometryUtils } from '../../../../examples/jsm/utils/BufferGeometryUtils';
+import * as BufferGeometryUtils from '../../../../examples/jsm/utils/BufferGeometryUtils';
 
 import { BufferAttribute } from '../../../../src/core/BufferAttribute';
 import { BufferGeometry } from '../../../../src/core/BufferGeometry';

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно