ソースを参照

Updated builds.

Mr.doob 3 年 前
コミット
dbec13013a
4 ファイル変更120 行追加78 行削除
  1. 39 26
      build/three.cjs
  2. 39 26
      build/three.js
  3. 0 0
      build/three.min.js
  4. 42 26
      build/three.module.js

+ 39 - 26
build/three.cjs

@@ -6107,7 +6107,8 @@ class Object3D extends EventDispatcher {
 				images: {},
 				shapes: {},
 				skeletons: {},
-				animations: {}
+				animations: {},
+				nodes: {}
 			};
 			output.metadata = {
 				version: 4.5,
@@ -6228,6 +6229,7 @@ class Object3D extends EventDispatcher {
 			const shapes = extractFromCache(meta.shapes);
 			const skeletons = extractFromCache(meta.skeletons);
 			const animations = extractFromCache(meta.animations);
+			const nodes = extractFromCache(meta.nodes);
 			if (geometries.length > 0) output.geometries = geometries;
 			if (materials.length > 0) output.materials = materials;
 			if (textures.length > 0) output.textures = textures;
@@ -6235,6 +6237,7 @@ class Object3D extends EventDispatcher {
 			if (shapes.length > 0) output.shapes = shapes;
 			if (skeletons.length > 0) output.skeletons = skeletons;
 			if (animations.length > 0) output.animations = animations;
+			if (nodes.length > 0) output.nodes = nodes;
 		}
 
 		output.object = object;
@@ -6664,9 +6667,9 @@ class Material extends EventDispatcher {
 	}
 
 	toJSON(meta) {
-		const isRoot = meta === undefined || typeof meta === 'string';
+		const isRootObject = meta === undefined || typeof meta === 'string';
 
-		if (isRoot) {
+		if (isRootObject) {
 			meta = {
 				textures: {},
 				images: {}
@@ -6823,7 +6826,7 @@ class Material extends EventDispatcher {
 			return values;
 		}
 
-		if (isRoot) {
+		if (isRootObject) {
 			const textures = extractFromCache(meta.textures);
 			const images = extractFromCache(meta.images);
 			if (textures.length > 0) data.textures = textures;
@@ -6907,6 +6910,13 @@ class Material extends EventDispatcher {
 
 Material.prototype.isMaterial = true;
 
+Material.fromType = function
+	/*type*/
+() {
+	// TODO: Behavior added in Materials.js
+	return null;
+};
+
 /**
  * parameters = {
  *	color: <hex>,
@@ -27128,27 +27138,30 @@ class LineDashedMaterial extends LineBasicMaterial {
 
 LineDashedMaterial.prototype.isLineDashedMaterial = true;
 
-var Materials = /*#__PURE__*/Object.freeze({
-	__proto__: null,
-	ShadowMaterial: ShadowMaterial,
-	SpriteMaterial: SpriteMaterial,
-	RawShaderMaterial: RawShaderMaterial,
-	ShaderMaterial: ShaderMaterial,
-	PointsMaterial: PointsMaterial,
-	MeshPhysicalMaterial: MeshPhysicalMaterial,
-	MeshStandardMaterial: MeshStandardMaterial,
-	MeshPhongMaterial: MeshPhongMaterial,
-	MeshToonMaterial: MeshToonMaterial,
-	MeshNormalMaterial: MeshNormalMaterial,
-	MeshLambertMaterial: MeshLambertMaterial,
-	MeshDepthMaterial: MeshDepthMaterial,
-	MeshDistanceMaterial: MeshDistanceMaterial,
-	MeshBasicMaterial: MeshBasicMaterial,
-	MeshMatcapMaterial: MeshMatcapMaterial,
-	LineDashedMaterial: LineDashedMaterial,
-	LineBasicMaterial: LineBasicMaterial,
-	Material: Material
-});
+const materialLib = {
+	ShadowMaterial,
+	SpriteMaterial,
+	RawShaderMaterial,
+	ShaderMaterial,
+	PointsMaterial,
+	MeshPhysicalMaterial,
+	MeshStandardMaterial,
+	MeshPhongMaterial,
+	MeshToonMaterial,
+	MeshNormalMaterial,
+	MeshLambertMaterial,
+	MeshDepthMaterial,
+	MeshDistanceMaterial,
+	MeshBasicMaterial,
+	MeshMatcapMaterial,
+	LineDashedMaterial,
+	LineBasicMaterial,
+	Material
+};
+
+Material.fromType = function (type) {
+	return new materialLib[type]();
+};
 
 const AnimationUtils = {
 	// same as Array.prototype.slice, but also works on typed arrays
@@ -29739,7 +29752,7 @@ class MaterialLoader extends Loader {
 			return textures[name];
 		}
 
-		const material = new Materials[json.type]();
+		const material = Material.fromType(json.type);
 		if (json.uuid !== undefined) material.uuid = json.uuid;
 		if (json.name !== undefined) material.name = json.name;
 		if (json.color !== undefined && material.color !== undefined) material.color.setHex(json.color);

+ 39 - 26
build/three.js

@@ -6109,7 +6109,8 @@
 					images: {},
 					shapes: {},
 					skeletons: {},
-					animations: {}
+					animations: {},
+					nodes: {}
 				};
 				output.metadata = {
 					version: 4.5,
@@ -6230,6 +6231,7 @@
 				const shapes = extractFromCache(meta.shapes);
 				const skeletons = extractFromCache(meta.skeletons);
 				const animations = extractFromCache(meta.animations);
+				const nodes = extractFromCache(meta.nodes);
 				if (geometries.length > 0) output.geometries = geometries;
 				if (materials.length > 0) output.materials = materials;
 				if (textures.length > 0) output.textures = textures;
@@ -6237,6 +6239,7 @@
 				if (shapes.length > 0) output.shapes = shapes;
 				if (skeletons.length > 0) output.skeletons = skeletons;
 				if (animations.length > 0) output.animations = animations;
+				if (nodes.length > 0) output.nodes = nodes;
 			}
 
 			output.object = object;
@@ -6666,9 +6669,9 @@
 		}
 
 		toJSON(meta) {
-			const isRoot = meta === undefined || typeof meta === 'string';
+			const isRootObject = meta === undefined || typeof meta === 'string';
 
-			if (isRoot) {
+			if (isRootObject) {
 				meta = {
 					textures: {},
 					images: {}
@@ -6825,7 +6828,7 @@
 				return values;
 			}
 
-			if (isRoot) {
+			if (isRootObject) {
 				const textures = extractFromCache(meta.textures);
 				const images = extractFromCache(meta.images);
 				if (textures.length > 0) data.textures = textures;
@@ -6909,6 +6912,13 @@
 
 	Material.prototype.isMaterial = true;
 
+	Material.fromType = function
+		/*type*/
+	() {
+		// TODO: Behavior added in Materials.js
+		return null;
+	};
+
 	/**
 	 * parameters = {
 	 *	color: <hex>,
@@ -27130,27 +27140,30 @@
 
 	LineDashedMaterial.prototype.isLineDashedMaterial = true;
 
-	var Materials = /*#__PURE__*/Object.freeze({
-		__proto__: null,
-		ShadowMaterial: ShadowMaterial,
-		SpriteMaterial: SpriteMaterial,
-		RawShaderMaterial: RawShaderMaterial,
-		ShaderMaterial: ShaderMaterial,
-		PointsMaterial: PointsMaterial,
-		MeshPhysicalMaterial: MeshPhysicalMaterial,
-		MeshStandardMaterial: MeshStandardMaterial,
-		MeshPhongMaterial: MeshPhongMaterial,
-		MeshToonMaterial: MeshToonMaterial,
-		MeshNormalMaterial: MeshNormalMaterial,
-		MeshLambertMaterial: MeshLambertMaterial,
-		MeshDepthMaterial: MeshDepthMaterial,
-		MeshDistanceMaterial: MeshDistanceMaterial,
-		MeshBasicMaterial: MeshBasicMaterial,
-		MeshMatcapMaterial: MeshMatcapMaterial,
-		LineDashedMaterial: LineDashedMaterial,
-		LineBasicMaterial: LineBasicMaterial,
-		Material: Material
-	});
+	const materialLib = {
+		ShadowMaterial,
+		SpriteMaterial,
+		RawShaderMaterial,
+		ShaderMaterial,
+		PointsMaterial,
+		MeshPhysicalMaterial,
+		MeshStandardMaterial,
+		MeshPhongMaterial,
+		MeshToonMaterial,
+		MeshNormalMaterial,
+		MeshLambertMaterial,
+		MeshDepthMaterial,
+		MeshDistanceMaterial,
+		MeshBasicMaterial,
+		MeshMatcapMaterial,
+		LineDashedMaterial,
+		LineBasicMaterial,
+		Material
+	};
+
+	Material.fromType = function (type) {
+		return new materialLib[type]();
+	};
 
 	const AnimationUtils = {
 		// same as Array.prototype.slice, but also works on typed arrays
@@ -29741,7 +29754,7 @@
 				return textures[name];
 			}
 
-			const material = new Materials[json.type]();
+			const material = Material.fromType(json.type);
 			if (json.uuid !== undefined) material.uuid = json.uuid;
 			if (json.name !== undefined) material.name = json.name;
 			if (json.color !== undefined && material.color !== undefined) material.color.setHex(json.color);

ファイルの差分が大きいため隠しています
+ 0 - 0
build/three.min.js


+ 42 - 26
build/three.module.js

@@ -7922,7 +7922,8 @@ class Object3D extends EventDispatcher {
 				images: {},
 				shapes: {},
 				skeletons: {},
-				animations: {}
+				animations: {},
+				nodes: {}
 			};
 
 			output.metadata = {
@@ -8106,6 +8107,7 @@ class Object3D extends EventDispatcher {
 			const shapes = extractFromCache( meta.shapes );
 			const skeletons = extractFromCache( meta.skeletons );
 			const animations = extractFromCache( meta.animations );
+			const nodes = extractFromCache( meta.nodes );
 
 			if ( geometries.length > 0 ) output.geometries = geometries;
 			if ( materials.length > 0 ) output.materials = materials;
@@ -8114,6 +8116,7 @@ class Object3D extends EventDispatcher {
 			if ( shapes.length > 0 ) output.shapes = shapes;
 			if ( skeletons.length > 0 ) output.skeletons = skeletons;
 			if ( animations.length > 0 ) output.animations = animations;
+			if ( nodes.length > 0 ) output.nodes = nodes;
 
 		}
 
@@ -8651,9 +8654,9 @@ class Material extends EventDispatcher {
 
 	toJSON( meta ) {
 
-		const isRoot = ( meta === undefined || typeof meta === 'string' );
+		const isRootObject = ( meta === undefined || typeof meta === 'string' );
 
-		if ( isRoot ) {
+		if ( isRootObject ) {
 
 			meta = {
 				textures: {},
@@ -8861,7 +8864,7 @@ class Material extends EventDispatcher {
 
 		}
 
-		if ( isRoot ) {
+		if ( isRootObject ) {
 
 			const textures = extractFromCache( meta.textures );
 			const images = extractFromCache( meta.images );
@@ -8976,6 +8979,14 @@ class Material extends EventDispatcher {
 
 Material.prototype.isMaterial = true;
 
+Material.fromType = function ( /*type*/ ) {
+
+	// TODO: Behavior added in Materials.js
+
+	return null;
+
+};
+
 /**
  * parameters = {
  *  color: <hex>,
@@ -37377,27 +37388,32 @@ class LineDashedMaterial extends LineBasicMaterial {
 
 LineDashedMaterial.prototype.isLineDashedMaterial = true;
 
-var Materials = /*#__PURE__*/Object.freeze({
-	__proto__: null,
-	ShadowMaterial: ShadowMaterial,
-	SpriteMaterial: SpriteMaterial,
-	RawShaderMaterial: RawShaderMaterial,
-	ShaderMaterial: ShaderMaterial,
-	PointsMaterial: PointsMaterial,
-	MeshPhysicalMaterial: MeshPhysicalMaterial,
-	MeshStandardMaterial: MeshStandardMaterial,
-	MeshPhongMaterial: MeshPhongMaterial,
-	MeshToonMaterial: MeshToonMaterial,
-	MeshNormalMaterial: MeshNormalMaterial,
-	MeshLambertMaterial: MeshLambertMaterial,
-	MeshDepthMaterial: MeshDepthMaterial,
-	MeshDistanceMaterial: MeshDistanceMaterial,
-	MeshBasicMaterial: MeshBasicMaterial,
-	MeshMatcapMaterial: MeshMatcapMaterial,
-	LineDashedMaterial: LineDashedMaterial,
-	LineBasicMaterial: LineBasicMaterial,
-	Material: Material
-});
+const materialLib = {
+	ShadowMaterial,
+	SpriteMaterial,
+	RawShaderMaterial,
+	ShaderMaterial,
+	PointsMaterial,
+	MeshPhysicalMaterial,
+	MeshStandardMaterial,
+	MeshPhongMaterial,
+	MeshToonMaterial,
+	MeshNormalMaterial,
+	MeshLambertMaterial,
+	MeshDepthMaterial,
+	MeshDistanceMaterial,
+	MeshBasicMaterial,
+	MeshMatcapMaterial,
+	LineDashedMaterial,
+	LineBasicMaterial,
+	Material
+};
+
+Material.fromType = function ( type ) {
+
+	return new materialLib[ type ]();
+
+};
 
 const AnimationUtils = {
 
@@ -41113,7 +41129,7 @@ class MaterialLoader extends Loader {
 
 		}
 
-		const material = new Materials[ json.type ]();
+		const material = Material.fromType( json.type );
 
 		if ( json.uuid !== undefined ) material.uuid = json.uuid;
 		if ( json.name !== undefined ) material.name = json.name;

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません