2
0
Mr.doob 7 жил өмнө
parent
commit
06a56a1aa7
3 өөрчлөгдсөн 387 нэмэгдсэн , 339 устгасан
  1. 63 39
      build/three.js
  2. 261 261
      build/three.min.js
  3. 63 39
      build/three.module.js

+ 63 - 39
build/three.js

@@ -2849,18 +2849,11 @@
 
 
 		},
 		},
 
 
-		project: function () {
+		project: function ( camera ) {
 
 
-			var matrix = new Matrix4();
-
-			return function project( camera ) {
-
-				matrix.multiplyMatrices( camera.projectionMatrix, matrix.getInverse( camera.matrixWorld ) );
-				return this.applyMatrix4( matrix );
-
-			};
+			return this.applyMatrix4( camera.matrixWorldInverse ).applyMatrix4( camera.projectionMatrix );
 
 
-		}(),
+		},
 
 
 		unproject: function () {
 		unproject: function () {
 
 
@@ -2868,8 +2861,7 @@
 
 
 			return function unproject( camera ) {
 			return function unproject( camera ) {
 
 
-				matrix.multiplyMatrices( camera.matrixWorld, matrix.getInverse( camera.projectionMatrix ) );
-				return this.applyMatrix4( matrix );
+				return this.applyMatrix4( matrix.getInverse( camera.projectionMatrix ) ).applyMatrix4( camera.matrixWorld );
 
 
 			};
 			};
 
 
@@ -6936,6 +6928,28 @@
 
 
 		},
 		},
 
 
+		lerpHSL: function () {
+
+			var hslA = { h: 0, s: 0, l: 0 };
+			var hslB = { h: 0, s: 0, l: 0 };
+
+			return function lerpHSL( color, alpha ) {
+
+				this.getHSL( hslA );
+				color.getHSL( hslB );
+
+				var h = _Math.lerp( hslA.h, hslB.h, alpha );
+				var s = _Math.lerp( hslA.s, hslB.s, alpha );
+				var l = _Math.lerp( hslA.l, hslB.l, alpha );
+
+				this.setHSL( h, s, l );
+
+				return this;
+
+			};
+
+		}(),
+
 		equals: function ( c ) {
 		equals: function ( c ) {
 
 
 			return ( c.r === this.r ) && ( c.g === this.g ) && ( c.b === this.b );
 			return ( c.r === this.r ) && ( c.g === this.g ) && ( c.b === this.b );
@@ -8514,26 +8528,22 @@
 
 
 		}(),
 		}(),
 
 
-		getWorldDirection: function () {
-
-			var quaternion = new Quaternion();
-
-			return function getWorldDirection( target ) {
+		getWorldDirection: function ( target ) {
 
 
-				if ( target === undefined ) {
+			if ( target === undefined ) {
 
 
-					console.warn( 'THREE.Object3D: .getWorldDirection() target is now required' );
-					target = new Vector3();
+				console.warn( 'THREE.Object3D: .getWorldDirection() target is now required' );
+				target = new Vector3();
 
 
-				}
+			}
 
 
-				this.getWorldQuaternion( quaternion );
+			this.updateMatrixWorld( true );
 
 
-				return target.set( 0, 0, 1 ).applyQuaternion( quaternion );
+			var e = this.matrixWorld.elements;
 
 
-			};
+			return target.set( e[ 8 ], e[ 9 ], e[ 10 ] ).normalize();
 
 
-		}(),
+		},
 
 
 		raycast: function () {},
 		raycast: function () {},
 
 
@@ -8877,26 +8887,22 @@
 
 
 		},
 		},
 
 
-		getWorldDirection: function () {
-
-			var quaternion = new Quaternion();
-
-			return function getWorldDirection( target ) {
+		getWorldDirection: function ( target ) {
 
 
-				if ( target === undefined ) {
+			if ( target === undefined ) {
 
 
-					console.warn( 'THREE.Camera: .getWorldDirection() target is now required' );
-					target = new Vector3();
+				console.warn( 'THREE.Camera: .getWorldDirection() target is now required' );
+				target = new Vector3();
 
 
-				}
+			}
 
 
-				this.getWorldQuaternion( quaternion );
+			this.updateMatrixWorld( true );
 
 
-				return target.set( 0, 0, - 1 ).applyQuaternion( quaternion );
+			var e = this.matrixWorld.elements;
 
 
-			};
+			return target.set( - e[ 8 ], - e[ 9 ], - e[ 10 ] ).normalize();
 
 
-		}(),
+		},
 
 
 		updateMatrixWorld: function ( force ) {
 		updateMatrixWorld: function ( force ) {
 
 
@@ -31873,6 +31879,24 @@
 
 
 				}, false );
 				}, false );
 
 
+				request.addEventListener( 'abort', function ( event ) {
+
+					var callbacks = loading[ url ];
+
+					delete loading[ url ];
+
+					for ( var i = 0, il = callbacks.length; i < il; i ++ ) {
+
+						var callback = callbacks[ i ];
+						if ( callback.onError ) callback.onError( event );
+
+					}
+
+					scope.manager.itemEnd( url );
+					scope.manager.itemError( url );
+
+				}, false );
+
 				if ( this.responseType !== undefined ) request.responseType = this.responseType;
 				if ( this.responseType !== undefined ) request.responseType = this.responseType;
 				if ( this.withCredentials !== undefined ) request.withCredentials = this.withCredentials;
 				if ( this.withCredentials !== undefined ) request.withCredentials = this.withCredentials;
 
 
@@ -32355,7 +32379,7 @@
 				texture.image = image;
 				texture.image = image;
 
 
 				// JPEGs can't have an alpha channel, so memory can be saved by storing them as RGB.
 				// JPEGs can't have an alpha channel, so memory can be saved by storing them as RGB.
-				var isJPEG = url.search( /\.(jpg|jpeg)$/ ) > 0 || url.search( /^data\:image\/jpeg/ ) === 0;
+				var isJPEG = url.search( /\.jpe?g$/i ) > 0 || url.search( /^data\:image\/jpeg/ ) === 0;
 
 
 				texture.format = isJPEG ? RGBFormat : RGBAFormat;
 				texture.format = isJPEG ? RGBFormat : RGBAFormat;
 				texture.needsUpdate = true;
 				texture.needsUpdate = true;

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


+ 63 - 39
build/three.module.js

@@ -2843,18 +2843,11 @@ Object.assign( Vector3.prototype, {
 
 
 	},
 	},
 
 
-	project: function () {
+	project: function ( camera ) {
 
 
-		var matrix = new Matrix4();
-
-		return function project( camera ) {
-
-			matrix.multiplyMatrices( camera.projectionMatrix, matrix.getInverse( camera.matrixWorld ) );
-			return this.applyMatrix4( matrix );
-
-		};
+		return this.applyMatrix4( camera.matrixWorldInverse ).applyMatrix4( camera.projectionMatrix );
 
 
-	}(),
+	},
 
 
 	unproject: function () {
 	unproject: function () {
 
 
@@ -2862,8 +2855,7 @@ Object.assign( Vector3.prototype, {
 
 
 		return function unproject( camera ) {
 		return function unproject( camera ) {
 
 
-			matrix.multiplyMatrices( camera.matrixWorld, matrix.getInverse( camera.projectionMatrix ) );
-			return this.applyMatrix4( matrix );
+			return this.applyMatrix4( matrix.getInverse( camera.projectionMatrix ) ).applyMatrix4( camera.matrixWorld );
 
 
 		};
 		};
 
 
@@ -6930,6 +6922,28 @@ Object.assign( Color.prototype, {
 
 
 	},
 	},
 
 
+	lerpHSL: function () {
+
+		var hslA = { h: 0, s: 0, l: 0 };
+		var hslB = { h: 0, s: 0, l: 0 };
+
+		return function lerpHSL( color, alpha ) {
+
+			this.getHSL( hslA );
+			color.getHSL( hslB );
+
+			var h = _Math.lerp( hslA.h, hslB.h, alpha );
+			var s = _Math.lerp( hslA.s, hslB.s, alpha );
+			var l = _Math.lerp( hslA.l, hslB.l, alpha );
+
+			this.setHSL( h, s, l );
+
+			return this;
+
+		};
+
+	}(),
+
 	equals: function ( c ) {
 	equals: function ( c ) {
 
 
 		return ( c.r === this.r ) && ( c.g === this.g ) && ( c.b === this.b );
 		return ( c.r === this.r ) && ( c.g === this.g ) && ( c.b === this.b );
@@ -8508,26 +8522,22 @@ Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
 
 
 	}(),
 	}(),
 
 
-	getWorldDirection: function () {
-
-		var quaternion = new Quaternion();
-
-		return function getWorldDirection( target ) {
+	getWorldDirection: function ( target ) {
 
 
-			if ( target === undefined ) {
+		if ( target === undefined ) {
 
 
-				console.warn( 'THREE.Object3D: .getWorldDirection() target is now required' );
-				target = new Vector3();
+			console.warn( 'THREE.Object3D: .getWorldDirection() target is now required' );
+			target = new Vector3();
 
 
-			}
+		}
 
 
-			this.getWorldQuaternion( quaternion );
+		this.updateMatrixWorld( true );
 
 
-			return target.set( 0, 0, 1 ).applyQuaternion( quaternion );
+		var e = this.matrixWorld.elements;
 
 
-		};
+		return target.set( e[ 8 ], e[ 9 ], e[ 10 ] ).normalize();
 
 
-	}(),
+	},
 
 
 	raycast: function () {},
 	raycast: function () {},
 
 
@@ -8871,26 +8881,22 @@ Camera.prototype = Object.assign( Object.create( Object3D.prototype ), {
 
 
 	},
 	},
 
 
-	getWorldDirection: function () {
-
-		var quaternion = new Quaternion();
-
-		return function getWorldDirection( target ) {
+	getWorldDirection: function ( target ) {
 
 
-			if ( target === undefined ) {
+		if ( target === undefined ) {
 
 
-				console.warn( 'THREE.Camera: .getWorldDirection() target is now required' );
-				target = new Vector3();
+			console.warn( 'THREE.Camera: .getWorldDirection() target is now required' );
+			target = new Vector3();
 
 
-			}
+		}
 
 
-			this.getWorldQuaternion( quaternion );
+		this.updateMatrixWorld( true );
 
 
-			return target.set( 0, 0, - 1 ).applyQuaternion( quaternion );
+		var e = this.matrixWorld.elements;
 
 
-		};
+		return target.set( - e[ 8 ], - e[ 9 ], - e[ 10 ] ).normalize();
 
 
-	}(),
+	},
 
 
 	updateMatrixWorld: function ( force ) {
 	updateMatrixWorld: function ( force ) {
 
 
@@ -31867,6 +31873,24 @@ Object.assign( FileLoader.prototype, {
 
 
 			}, false );
 			}, false );
 
 
+			request.addEventListener( 'abort', function ( event ) {
+
+				var callbacks = loading[ url ];
+
+				delete loading[ url ];
+
+				for ( var i = 0, il = callbacks.length; i < il; i ++ ) {
+
+					var callback = callbacks[ i ];
+					if ( callback.onError ) callback.onError( event );
+
+				}
+
+				scope.manager.itemEnd( url );
+				scope.manager.itemError( url );
+
+			}, false );
+
 			if ( this.responseType !== undefined ) request.responseType = this.responseType;
 			if ( this.responseType !== undefined ) request.responseType = this.responseType;
 			if ( this.withCredentials !== undefined ) request.withCredentials = this.withCredentials;
 			if ( this.withCredentials !== undefined ) request.withCredentials = this.withCredentials;
 
 
@@ -32349,7 +32373,7 @@ Object.assign( TextureLoader.prototype, {
 			texture.image = image;
 			texture.image = image;
 
 
 			// JPEGs can't have an alpha channel, so memory can be saved by storing them as RGB.
 			// JPEGs can't have an alpha channel, so memory can be saved by storing them as RGB.
-			var isJPEG = url.search( /\.(jpg|jpeg)$/ ) > 0 || url.search( /^data\:image\/jpeg/ ) === 0;
+			var isJPEG = url.search( /\.jpe?g$/i ) > 0 || url.search( /^data\:image\/jpeg/ ) === 0;
 
 
 			texture.format = isJPEG ? RGBFormat : RGBAFormat;
 			texture.format = isJPEG ? RGBFormat : RGBAFormat;
 			texture.needsUpdate = true;
 			texture.needsUpdate = true;

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