2
0
Mr.doob 3 жил өмнө
parent
commit
a2cc7c11e1
4 өөрчлөгдсөн 47 нэмэгдсэн , 48 устгасан
  1. 15 15
      build/three.cjs
  2. 15 15
      build/three.js
  3. 0 0
      build/three.min.js
  4. 17 18
      build/three.module.js

+ 15 - 15
build/three.cjs

@@ -7,7 +7,7 @@
 
 Object.defineProperty(exports, '__esModule', { value: true });
 
-const REVISION = '137';
+const REVISION = '138dev';
 const MOUSE = {
 	LEFT: 0,
 	MIDDLE: 1,
@@ -6759,11 +6759,11 @@ class Material extends EventDispatcher {
 		data.stencilZFail = this.stencilZFail;
 		data.stencilZPass = this.stencilZPass; // rotation (SpriteMaterial)
 
-		if (this.rotation && this.rotation !== 0) data.rotation = this.rotation;
+		if (this.rotation !== undefined && this.rotation !== 0) data.rotation = this.rotation;
 		if (this.polygonOffset === true) data.polygonOffset = true;
 		if (this.polygonOffsetFactor !== 0) data.polygonOffsetFactor = this.polygonOffsetFactor;
 		if (this.polygonOffsetUnits !== 0) data.polygonOffsetUnits = this.polygonOffsetUnits;
-		if (this.linewidth && this.linewidth !== 1) data.linewidth = this.linewidth;
+		if (this.linewidth !== undefined && this.linewidth !== 1) data.linewidth = this.linewidth;
 		if (this.dashSize !== undefined) data.dashSize = this.dashSize;
 		if (this.gapSize !== undefined) data.gapSize = this.gapSize;
 		if (this.scale !== undefined) data.scale = this.scale;
@@ -10963,7 +10963,7 @@ function WebGLBindingStates(gl, extensions, attributes, capabilities) {
 						const stride = data.stride;
 						const offset = geometryAttribute.offset;
 
-						if (data && data.isInstancedInterleavedBuffer) {
+						if (data.isInstancedInterleavedBuffer) {
 							for (let i = 0; i < programAttribute.locationSize; i++) {
 								enableAttributeAndDivisor(programAttribute.location + i, data.meshPerAttribute);
 							}
@@ -15536,7 +15536,7 @@ function WebGLShadowMap(_renderer, _objects, _capabilities) {
 		_renderer.renderBufferDirect(camera, null, geometry, shadowMaterialHorizontal, fullScreenMesh, null);
 	}
 
-	function getDepthMaterial(object, geometry, material, light, shadowCameraNear, shadowCameraFar, type) {
+	function getDepthMaterial(object, material, light, shadowCameraNear, shadowCameraFar, type) {
 		let result = null;
 		const customMaterial = light.isPointLight === true ? object.customDistanceMaterial : object.customDepthMaterial;
 
@@ -15617,13 +15617,13 @@ function WebGLShadowMap(_renderer, _objects, _capabilities) {
 						const groupMaterial = material[group.materialIndex];
 
 						if (groupMaterial && groupMaterial.visible) {
-							const depthMaterial = getDepthMaterial(object, geometry, groupMaterial, light, shadowCamera.near, shadowCamera.far, type);
+							const depthMaterial = getDepthMaterial(object, groupMaterial, light, shadowCamera.near, shadowCamera.far, type);
 
 							_renderer.renderBufferDirect(shadowCamera, null, geometry, depthMaterial, object, group);
 						}
 					}
 				} else if (material.visible) {
-					const depthMaterial = getDepthMaterial(object, geometry, material, light, shadowCamera.near, shadowCamera.far, type);
+					const depthMaterial = getDepthMaterial(object, material, light, shadowCamera.near, shadowCamera.far, type);
 
 					_renderer.renderBufferDirect(shadowCamera, null, geometry, depthMaterial, object, null);
 				}
@@ -16604,7 +16604,6 @@ function WebGLTextures(_gl, extensions, state, properties, capabilities, utils,
 		const texture = renderTarget.texture;
 		const renderTargetProperties = properties.get(renderTarget);
 		const textureProperties = properties.get(texture);
-		if (!renderTarget) return;
 
 		if (textureProperties.__webglTexture !== undefined) {
 			_gl.deleteTexture(textureProperties.__webglTexture);
@@ -17018,7 +17017,7 @@ function WebGLTextures(_gl, extensions, state, properties, capabilities, utils,
 
 		_gl.pixelStorei(_gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, _gl.NONE);
 
-		const isCompressed = texture && (texture.isCompressedTexture || texture.image[0].isCompressedTexture);
+		const isCompressed = texture.isCompressedTexture || texture.image[0].isCompressedTexture;
 		const isDataTexture = texture.image[0] && texture.image[0].isDataTexture;
 		const cubeImage = [];
 
@@ -20122,7 +20121,7 @@ function WebGLRenderer(parameters = {}) {
 			}
 		}
 
-		if (!!geometry && (geometry.morphAttributes.position !== undefined || geometry.morphAttributes.normal !== undefined)) {
+		if (geometry.morphAttributes.position !== undefined || geometry.morphAttributes.normal !== undefined) {
 			morphtargets.update(object, geometry, material, program);
 		}
 
@@ -23873,7 +23872,7 @@ class CurvePath extends Curve {
 
 		for (let i = 0, curves = this.curves; i < curves.length; i++) {
 			const curve = curves[i];
-			const resolution = curve && curve.isEllipseCurve ? divisions * 2 : curve && (curve.isLineCurve || curve.isLineCurve3) ? 1 : curve && curve.isSplineCurve ? divisions * curve.points.length : divisions;
+			const resolution = curve.isEllipseCurve ? divisions * 2 : curve.isLineCurve || curve.isLineCurve3 ? 1 : curve.isSplineCurve ? divisions * curve.points.length : divisions;
 			const pts = curve.getPoints(resolution);
 
 			for (let j = 0; j < pts.length; j++) {
@@ -26099,7 +26098,8 @@ function isUniqueEdge(start, end, edges) {
 	if (edges.has(hash1) === true || edges.has(hash2) === true) {
 		return false;
 	} else {
-		edges.add(hash1, hash2);
+		edges.add(hash1);
+		edges.add(hash2);
 		return true;
 	}
 }
@@ -33526,11 +33526,11 @@ class Raycaster {
 	}
 
 	setFromCamera(coords, camera) {
-		if (camera && camera.isPerspectiveCamera) {
+		if (camera.isPerspectiveCamera) {
 			this.ray.origin.setFromMatrixPosition(camera.matrixWorld);
 			this.ray.direction.set(coords.x, coords.y, 0.5).unproject(camera).sub(this.ray.origin).normalize();
 			this.camera = camera;
-		} else if (camera && camera.isOrthographicCamera) {
+		} else if (camera.isOrthographicCamera) {
 			this.ray.origin.set(coords.x, coords.y, (camera.near + camera.far) / (camera.near - camera.far)).unproject(camera); // set origin in plane of camera
 
 			this.ray.direction.set(0, 0, -1).transformDirection(camera.matrixWorld);
@@ -34029,7 +34029,7 @@ class SkeletonHelper extends LineSegments {
 function getBoneList(object) {
 	const boneList = [];
 
-	if (object && object.isBone) {
+	if (object.isBone === true) {
 		boneList.push(object);
 	}
 

+ 15 - 15
build/three.js

@@ -9,7 +9,7 @@
 	(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.THREE = {}));
 })(this, (function (exports) { 'use strict';
 
-	const REVISION = '137';
+	const REVISION = '138dev';
 	const MOUSE = {
 		LEFT: 0,
 		MIDDLE: 1,
@@ -6761,11 +6761,11 @@
 			data.stencilZFail = this.stencilZFail;
 			data.stencilZPass = this.stencilZPass; // rotation (SpriteMaterial)
 
-			if (this.rotation && this.rotation !== 0) data.rotation = this.rotation;
+			if (this.rotation !== undefined && this.rotation !== 0) data.rotation = this.rotation;
 			if (this.polygonOffset === true) data.polygonOffset = true;
 			if (this.polygonOffsetFactor !== 0) data.polygonOffsetFactor = this.polygonOffsetFactor;
 			if (this.polygonOffsetUnits !== 0) data.polygonOffsetUnits = this.polygonOffsetUnits;
-			if (this.linewidth && this.linewidth !== 1) data.linewidth = this.linewidth;
+			if (this.linewidth !== undefined && this.linewidth !== 1) data.linewidth = this.linewidth;
 			if (this.dashSize !== undefined) data.dashSize = this.dashSize;
 			if (this.gapSize !== undefined) data.gapSize = this.gapSize;
 			if (this.scale !== undefined) data.scale = this.scale;
@@ -10965,7 +10965,7 @@
 							const stride = data.stride;
 							const offset = geometryAttribute.offset;
 
-							if (data && data.isInstancedInterleavedBuffer) {
+							if (data.isInstancedInterleavedBuffer) {
 								for (let i = 0; i < programAttribute.locationSize; i++) {
 									enableAttributeAndDivisor(programAttribute.location + i, data.meshPerAttribute);
 								}
@@ -15538,7 +15538,7 @@
 			_renderer.renderBufferDirect(camera, null, geometry, shadowMaterialHorizontal, fullScreenMesh, null);
 		}
 
-		function getDepthMaterial(object, geometry, material, light, shadowCameraNear, shadowCameraFar, type) {
+		function getDepthMaterial(object, material, light, shadowCameraNear, shadowCameraFar, type) {
 			let result = null;
 			const customMaterial = light.isPointLight === true ? object.customDistanceMaterial : object.customDepthMaterial;
 
@@ -15619,13 +15619,13 @@
 							const groupMaterial = material[group.materialIndex];
 
 							if (groupMaterial && groupMaterial.visible) {
-								const depthMaterial = getDepthMaterial(object, geometry, groupMaterial, light, shadowCamera.near, shadowCamera.far, type);
+								const depthMaterial = getDepthMaterial(object, groupMaterial, light, shadowCamera.near, shadowCamera.far, type);
 
 								_renderer.renderBufferDirect(shadowCamera, null, geometry, depthMaterial, object, group);
 							}
 						}
 					} else if (material.visible) {
-						const depthMaterial = getDepthMaterial(object, geometry, material, light, shadowCamera.near, shadowCamera.far, type);
+						const depthMaterial = getDepthMaterial(object, material, light, shadowCamera.near, shadowCamera.far, type);
 
 						_renderer.renderBufferDirect(shadowCamera, null, geometry, depthMaterial, object, null);
 					}
@@ -16606,7 +16606,6 @@
 			const texture = renderTarget.texture;
 			const renderTargetProperties = properties.get(renderTarget);
 			const textureProperties = properties.get(texture);
-			if (!renderTarget) return;
 
 			if (textureProperties.__webglTexture !== undefined) {
 				_gl.deleteTexture(textureProperties.__webglTexture);
@@ -17020,7 +17019,7 @@
 
 			_gl.pixelStorei(_gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, _gl.NONE);
 
-			const isCompressed = texture && (texture.isCompressedTexture || texture.image[0].isCompressedTexture);
+			const isCompressed = texture.isCompressedTexture || texture.image[0].isCompressedTexture;
 			const isDataTexture = texture.image[0] && texture.image[0].isDataTexture;
 			const cubeImage = [];
 
@@ -20124,7 +20123,7 @@
 				}
 			}
 
-			if (!!geometry && (geometry.morphAttributes.position !== undefined || geometry.morphAttributes.normal !== undefined)) {
+			if (geometry.morphAttributes.position !== undefined || geometry.morphAttributes.normal !== undefined) {
 				morphtargets.update(object, geometry, material, program);
 			}
 
@@ -23875,7 +23874,7 @@
 
 			for (let i = 0, curves = this.curves; i < curves.length; i++) {
 				const curve = curves[i];
-				const resolution = curve && curve.isEllipseCurve ? divisions * 2 : curve && (curve.isLineCurve || curve.isLineCurve3) ? 1 : curve && curve.isSplineCurve ? divisions * curve.points.length : divisions;
+				const resolution = curve.isEllipseCurve ? divisions * 2 : curve.isLineCurve || curve.isLineCurve3 ? 1 : curve.isSplineCurve ? divisions * curve.points.length : divisions;
 				const pts = curve.getPoints(resolution);
 
 				for (let j = 0; j < pts.length; j++) {
@@ -26101,7 +26100,8 @@
 		if (edges.has(hash1) === true || edges.has(hash2) === true) {
 			return false;
 		} else {
-			edges.add(hash1, hash2);
+			edges.add(hash1);
+			edges.add(hash2);
 			return true;
 		}
 	}
@@ -33528,11 +33528,11 @@
 		}
 
 		setFromCamera(coords, camera) {
-			if (camera && camera.isPerspectiveCamera) {
+			if (camera.isPerspectiveCamera) {
 				this.ray.origin.setFromMatrixPosition(camera.matrixWorld);
 				this.ray.direction.set(coords.x, coords.y, 0.5).unproject(camera).sub(this.ray.origin).normalize();
 				this.camera = camera;
-			} else if (camera && camera.isOrthographicCamera) {
+			} else if (camera.isOrthographicCamera) {
 				this.ray.origin.set(coords.x, coords.y, (camera.near + camera.far) / (camera.near - camera.far)).unproject(camera); // set origin in plane of camera
 
 				this.ray.direction.set(0, 0, -1).transformDirection(camera.matrixWorld);
@@ -34031,7 +34031,7 @@
 	function getBoneList(object) {
 		const boneList = [];
 
-		if (object && object.isBone) {
+		if (object.isBone === true) {
 			boneList.push(object);
 		}
 

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
build/three.min.js


+ 17 - 18
build/three.module.js

@@ -3,7 +3,7 @@
  * Copyright 2010-2022 Three.js Authors
  * SPDX-License-Identifier: MIT
  */
-const REVISION = '137';
+const REVISION = '138dev';
 const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
 const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
 const CullFaceNone = 0;
@@ -8766,13 +8766,13 @@ class Material extends EventDispatcher {
 		data.stencilZPass = this.stencilZPass;
 
 		// rotation (SpriteMaterial)
-		if ( this.rotation && this.rotation !== 0 ) data.rotation = this.rotation;
+		if ( this.rotation !== undefined && this.rotation !== 0 ) data.rotation = this.rotation;
 
 		if ( this.polygonOffset === true ) data.polygonOffset = true;
 		if ( this.polygonOffsetFactor !== 0 ) data.polygonOffsetFactor = this.polygonOffsetFactor;
 		if ( this.polygonOffsetUnits !== 0 ) data.polygonOffsetUnits = this.polygonOffsetUnits;
 
-		if ( this.linewidth && this.linewidth !== 1 ) data.linewidth = this.linewidth;
+		if ( this.linewidth !== undefined && this.linewidth !== 1 ) data.linewidth = this.linewidth;
 		if ( this.dashSize !== undefined ) data.dashSize = this.dashSize;
 		if ( this.gapSize !== undefined ) data.gapSize = this.gapSize;
 		if ( this.scale !== undefined ) data.scale = this.scale;
@@ -14243,7 +14243,7 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
 						const stride = data.stride;
 						const offset = geometryAttribute.offset;
 
-						if ( data && data.isInstancedInterleavedBuffer ) {
+						if ( data.isInstancedInterleavedBuffer ) {
 
 							for ( let i = 0; i < programAttribute.locationSize; i ++ ) {
 
@@ -20705,7 +20705,7 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
 
 	}
 
-	function getDepthMaterial( object, geometry, material, light, shadowCameraNear, shadowCameraFar, type ) {
+	function getDepthMaterial( object, material, light, shadowCameraNear, shadowCameraFar, type ) {
 
 		let result = null;
 
@@ -20817,7 +20817,7 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
 
 						if ( groupMaterial && groupMaterial.visible ) {
 
-							const depthMaterial = getDepthMaterial( object, geometry, groupMaterial, light, shadowCamera.near, shadowCamera.far, type );
+							const depthMaterial = getDepthMaterial( object, groupMaterial, light, shadowCamera.near, shadowCamera.far, type );
 
 							_renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, group );
 
@@ -20827,7 +20827,7 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
 
 				} else if ( material.visible ) {
 
-					const depthMaterial = getDepthMaterial( object, geometry, material, light, shadowCamera.near, shadowCamera.far, type );
+					const depthMaterial = getDepthMaterial( object, material, light, shadowCamera.near, shadowCamera.far, type );
 
 					_renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, null );
 
@@ -22325,8 +22325,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 		const renderTargetProperties = properties.get( renderTarget );
 		const textureProperties = properties.get( texture );
 
-		if ( ! renderTarget ) return;
-
 		if ( textureProperties.__webglTexture !== undefined ) {
 
 			_gl.deleteTexture( textureProperties.__webglTexture );
@@ -22939,7 +22937,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 		_gl.pixelStorei( 3317, texture.unpackAlignment );
 		_gl.pixelStorei( 37443, 0 );
 
-		const isCompressed = ( texture && ( texture.isCompressedTexture || texture.image[ 0 ].isCompressedTexture ) );
+		const isCompressed = ( texture.isCompressedTexture || texture.image[ 0 ].isCompressedTexture );
 		const isDataTexture = ( texture.image[ 0 ] && texture.image[ 0 ].isDataTexture );
 
 		const cubeImage = [];
@@ -27481,7 +27479,7 @@ function WebGLRenderer( parameters = {} ) {
 
 		}
 
-		if ( !! geometry && ( geometry.morphAttributes.position !== undefined || geometry.morphAttributes.normal !== undefined ) ) {
+		if ( geometry.morphAttributes.position !== undefined || geometry.morphAttributes.normal !== undefined ) {
 
 			morphtargets.update( object, geometry, material, program );
 
@@ -32762,9 +32760,9 @@ class CurvePath extends Curve {
 		for ( let i = 0, curves = this.curves; i < curves.length; i ++ ) {
 
 			const curve = curves[ i ];
-			const resolution = ( curve && curve.isEllipseCurve ) ? divisions * 2
-				: ( curve && ( curve.isLineCurve || curve.isLineCurve3 ) ) ? 1
-					: ( curve && curve.isSplineCurve ) ? divisions * curve.points.length
+			const resolution = curve.isEllipseCurve ? divisions * 2
+				: ( curve.isLineCurve || curve.isLineCurve3 ) ? 1
+					: curve.isSplineCurve ? divisions * curve.points.length
 						: divisions;
 
 			const pts = curve.getPoints( resolution );
@@ -36054,7 +36052,8 @@ function isUniqueEdge( start, end, edges ) {
 
 	} else {
 
-		edges.add( hash1, hash2 );
+		edges.add( hash1 );
+		edges.add( hash2 );
 		return true;
 
 	}
@@ -46552,13 +46551,13 @@ class Raycaster {
 
 	setFromCamera( coords, camera ) {
 
-		if ( camera && camera.isPerspectiveCamera ) {
+		if ( camera.isPerspectiveCamera ) {
 
 			this.ray.origin.setFromMatrixPosition( camera.matrixWorld );
 			this.ray.direction.set( coords.x, coords.y, 0.5 ).unproject( camera ).sub( this.ray.origin ).normalize();
 			this.camera = camera;
 
-		} else if ( camera && camera.isOrthographicCamera ) {
+		} else if ( camera.isOrthographicCamera ) {
 
 			this.ray.origin.set( coords.x, coords.y, ( camera.near + camera.far ) / ( camera.near - camera.far ) ).unproject( camera ); // set origin in plane of camera
 			this.ray.direction.set( 0, 0, - 1 ).transformDirection( camera.matrixWorld );
@@ -47256,7 +47255,7 @@ function getBoneList( object ) {
 
 	const boneList = [];
 
-	if ( object && object.isBone ) {
+	if ( object.isBone === true ) {
 
 		boneList.push( object );
 

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