Browse Source

Updated builds.

Mr.doob 4 years ago
parent
commit
276652c83b
3 changed files with 86 additions and 40 deletions
  1. 43 20
      build/three.js
  2. 0 0
      build/three.min.js
  3. 43 20
      build/three.module.js

+ 43 - 20
build/three.js

@@ -23452,7 +23452,7 @@
 
 			if ( controller ) {
 
-				controller.dispatchEvent( { type: event.type } );
+				controller.dispatchEvent( { type: event.type, data: event.inputSource } );
 
 			}
 
@@ -28073,13 +28073,13 @@
 			var vEnd = new Vector3();
 			var interSegment = new Vector3();
 			var interRay = new Vector3();
-			var step = ( this && this.isLineSegments ) ? 2 : 1;
+			var step = this.isLineSegments ? 2 : 1;
 
 			if ( geometry.isBufferGeometry ) {
 
 				var index = geometry.index;
 				var attributes = geometry.attributes;
-				var positions = attributes.position.array;
+				var positionAttribute = attributes.position;
 
 				if ( index !== null ) {
 
@@ -28090,8 +28090,8 @@
 						var a = indices[ i ];
 						var b = indices[ i + 1 ];
 
-						vStart.fromArray( positions, a * 3 );
-						vEnd.fromArray( positions, b * 3 );
+						vStart.fromBufferAttribute( positionAttribute, a );
+						vEnd.fromBufferAttribute( positionAttribute, b );
 
 						var distSq = _ray$1.distanceSqToSegment( vStart, vEnd, interRay, interSegment );
 
@@ -28120,10 +28120,10 @@
 
 				} else {
 
-					for ( var i$1 = 0, l$1 = positions.length / 3 - 1; i$1 < l$1; i$1 += step ) {
+					for ( var i$1 = 0, l$1 = positionAttribute.count - 1; i$1 < l$1; i$1 += step ) {
 
-						vStart.fromArray( positions, 3 * i$1 );
-						vEnd.fromArray( positions, 3 * i$1 + 3 );
+						vStart.fromBufferAttribute( positionAttribute, i$1 );
+						vEnd.fromBufferAttribute( positionAttribute, i$1 + 1 );
 
 						var distSq$1 = _ray$1.distanceSqToSegment( vStart, vEnd, interRay, interSegment );
 
@@ -28444,7 +28444,7 @@
 
 				var index = geometry.index;
 				var attributes = geometry.attributes;
-				var positions = attributes.position.array;
+				var positionAttribute = attributes.position;
 
 				if ( index !== null ) {
 
@@ -28454,7 +28454,7 @@
 
 						var a = indices[ i ];
 
-						_position$1.fromArray( positions, a * 3 );
+						_position$1.fromBufferAttribute( positionAttribute, a );
 
 						testPoint( _position$1, a, localThresholdSq, matrixWorld, raycaster, intersects, this );
 
@@ -28462,9 +28462,9 @@
 
 				} else {
 
-					for ( var i$1 = 0, l = positions.length / 3; i$1 < l; i$1 ++ ) {
+					for ( var i$1 = 0, l = positionAttribute.count; i$1 < l; i$1 ++ ) {
 
-						_position$1.fromArray( positions, i$1 * 3 );
+						_position$1.fromBufferAttribute( positionAttribute, i$1 );
 
 						testPoint( _position$1, i$1, localThresholdSq, matrixWorld, raycaster, intersects, this );
 
@@ -33342,6 +33342,7 @@
 	 *  clearcoatNormalMap: new THREE.Texture( <Image> ),
 	 *
 	 *  reflectivity: <float>,
+	 *  ior: <float>,
 	 *
 	 *  sheen: <Color>,
 	 *
@@ -33372,6 +33373,19 @@
 
 		this.reflectivity = 0.5; // maps to F0 = 0.04
 
+		Object.defineProperty( this, 'ior', {
+			get: function () {
+
+				return ( 1 + 0.4 * this.reflectivity ) / ( 1 - 0.4 * this.reflectivity );
+
+			},
+			set: function ( ior ) {
+
+				this.reflectivity = MathUtils.clamp( 2.5 * ( ior - 1 ) / ( ior + 1 ), 0, 1 );
+
+			}
+		} );
+
 		this.sheen = null; // null will disable sheen bsdf
 
 		this.transmission = 0.0;
@@ -36203,6 +36217,7 @@
 		this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;
 
 		this.crossOrigin = 'anonymous';
+		this.withCredentials = false;
 		this.path = '';
 		this.resourcePath = '';
 		this.requestHeader = {};
@@ -36234,6 +36249,13 @@
 
 		},
 
+		setWithCredentials: function ( value ) {
+
+			this.withCredentials = value;
+			return this;
+
+		},
+
 		setPath: function ( path ) {
 
 			this.path = path;
@@ -36542,13 +36564,6 @@
 
 		},
 
-		setWithCredentials: function ( value ) {
-
-			this.withCredentials = value;
-			return this;
-
-		},
-
 		setMimeType: function ( value ) {
 
 			this.mimeType = value;
@@ -36575,6 +36590,7 @@
 			var loader = new FileLoader( scope.manager );
 			loader.setPath( scope.path );
 			loader.setRequestHeader( scope.requestHeader );
+			loader.setWithCredentials( scope.withCredentials );
 			loader.load( url, function ( text ) {
 
 				try {
@@ -36648,6 +36664,7 @@
 			loader.setPath( this.path );
 			loader.setResponseType( 'arraybuffer' );
 			loader.setRequestHeader( this.requestHeader );
+			loader.setWithCredentials( scope.withCredentials );
 
 			var loaded = 0;
 
@@ -36906,6 +36923,7 @@
 			loader.setResponseType( 'arraybuffer' );
 			loader.setRequestHeader( this.requestHeader );
 			loader.setPath( this.path );
+			loader.setWithCredentials( scope.withCredentials );
 			loader.load( url, function ( buffer ) {
 
 				var texData = scope.parse( buffer );
@@ -40004,6 +40022,7 @@
 			var loader = new FileLoader( scope.manager );
 			loader.setPath( scope.path );
 			loader.setRequestHeader( scope.requestHeader );
+			loader.setWithCredentials( scope.withCredentials );
 			loader.load( url, function ( text ) {
 
 				try {
@@ -40428,6 +40447,7 @@
 			var loader = new FileLoader( scope.manager );
 			loader.setPath( scope.path );
 			loader.setRequestHeader( scope.requestHeader );
+			loader.setWithCredentials( scope.withCredentials );
 			loader.load( url, function ( text ) {
 
 				try {
@@ -40643,9 +40663,10 @@
 			var path = ( this.path === '' ) ? LoaderUtils.extractUrlBase( url ) : this.path;
 			this.resourcePath = this.resourcePath || path;
 
-			var loader = new FileLoader( scope.manager );
+			var loader = new FileLoader( this.manager );
 			loader.setPath( this.path );
 			loader.setRequestHeader( this.requestHeader );
+			loader.setWithCredentials( this.withCredentials );
 			loader.load( url, function ( text ) {
 
 				var json = null;
@@ -42122,6 +42143,7 @@
 			var loader = new FileLoader( this.manager );
 			loader.setPath( this.path );
 			loader.setRequestHeader( this.requestHeader );
+			loader.setWithCredentials( scope.withCredentials );
 			loader.load( url, function ( text ) {
 
 				var json;
@@ -42195,6 +42217,7 @@
 			loader.setResponseType( 'arraybuffer' );
 			loader.setPath( scope.path );
 			loader.setRequestHeader( scope.requestHeader );
+			loader.setWithCredentials( scope.withCredentials );
 			loader.load( url, function ( buffer ) {
 
 				try {

File diff suppressed because it is too large
+ 0 - 0
build/three.min.js


+ 43 - 20
build/three.module.js

@@ -23514,7 +23514,7 @@ function WebXRManager( renderer, gl ) {
 
 		if ( controller ) {
 
-			controller.dispatchEvent( { type: event.type } );
+			controller.dispatchEvent( { type: event.type, data: event.inputSource } );
 
 		}
 
@@ -28141,13 +28141,13 @@ Line.prototype = Object.assign( Object.create( Object3D.prototype ), {
 		const vEnd = new Vector3();
 		const interSegment = new Vector3();
 		const interRay = new Vector3();
-		const step = ( this && this.isLineSegments ) ? 2 : 1;
+		const step = this.isLineSegments ? 2 : 1;
 
 		if ( geometry.isBufferGeometry ) {
 
 			const index = geometry.index;
 			const attributes = geometry.attributes;
-			const positions = attributes.position.array;
+			const positionAttribute = attributes.position;
 
 			if ( index !== null ) {
 
@@ -28158,8 +28158,8 @@ Line.prototype = Object.assign( Object.create( Object3D.prototype ), {
 					const a = indices[ i ];
 					const b = indices[ i + 1 ];
 
-					vStart.fromArray( positions, a * 3 );
-					vEnd.fromArray( positions, b * 3 );
+					vStart.fromBufferAttribute( positionAttribute, a );
+					vEnd.fromBufferAttribute( positionAttribute, b );
 
 					const distSq = _ray$1.distanceSqToSegment( vStart, vEnd, interRay, interSegment );
 
@@ -28188,10 +28188,10 @@ Line.prototype = Object.assign( Object.create( Object3D.prototype ), {
 
 			} else {
 
-				for ( let i = 0, l = positions.length / 3 - 1; i < l; i += step ) {
+				for ( let i = 0, l = positionAttribute.count - 1; i < l; i += step ) {
 
-					vStart.fromArray( positions, 3 * i );
-					vEnd.fromArray( positions, 3 * i + 3 );
+					vStart.fromBufferAttribute( positionAttribute, i );
+					vEnd.fromBufferAttribute( positionAttribute, i + 1 );
 
 					const distSq = _ray$1.distanceSqToSegment( vStart, vEnd, interRay, interSegment );
 
@@ -28512,7 +28512,7 @@ Points.prototype = Object.assign( Object.create( Object3D.prototype ), {
 
 			const index = geometry.index;
 			const attributes = geometry.attributes;
-			const positions = attributes.position.array;
+			const positionAttribute = attributes.position;
 
 			if ( index !== null ) {
 
@@ -28522,7 +28522,7 @@ Points.prototype = Object.assign( Object.create( Object3D.prototype ), {
 
 					const a = indices[ i ];
 
-					_position$1.fromArray( positions, a * 3 );
+					_position$1.fromBufferAttribute( positionAttribute, a );
 
 					testPoint( _position$1, a, localThresholdSq, matrixWorld, raycaster, intersects, this );
 
@@ -28530,9 +28530,9 @@ Points.prototype = Object.assign( Object.create( Object3D.prototype ), {
 
 			} else {
 
-				for ( let i = 0, l = positions.length / 3; i < l; i ++ ) {
+				for ( let i = 0, l = positionAttribute.count; i < l; i ++ ) {
 
-					_position$1.fromArray( positions, i * 3 );
+					_position$1.fromBufferAttribute( positionAttribute, i );
 
 					testPoint( _position$1, i, localThresholdSq, matrixWorld, raycaster, intersects, this );
 
@@ -33442,6 +33442,7 @@ MeshStandardMaterial.prototype.copy = function ( source ) {
  *  clearcoatNormalMap: new THREE.Texture( <Image> ),
  *
  *  reflectivity: <float>,
+ *  ior: <float>,
  *
  *  sheen: <Color>,
  *
@@ -33472,6 +33473,19 @@ function MeshPhysicalMaterial( parameters ) {
 
 	this.reflectivity = 0.5; // maps to F0 = 0.04
 
+	Object.defineProperty( this, 'ior', {
+		get: function () {
+
+			return ( 1 + 0.4 * this.reflectivity ) / ( 1 - 0.4 * this.reflectivity );
+
+		},
+		set: function ( ior ) {
+
+			this.reflectivity = MathUtils.clamp( 2.5 * ( ior - 1 ) / ( ior + 1 ), 0, 1 );
+
+		}
+	} );
+
 	this.sheen = null; // null will disable sheen bsdf
 
 	this.transmission = 0.0;
@@ -36301,6 +36315,7 @@ function Loader( manager ) {
 	this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;
 
 	this.crossOrigin = 'anonymous';
+	this.withCredentials = false;
 	this.path = '';
 	this.resourcePath = '';
 	this.requestHeader = {};
@@ -36332,6 +36347,13 @@ Object.assign( Loader.prototype, {
 
 	},
 
+	setWithCredentials: function ( value ) {
+
+		this.withCredentials = value;
+		return this;
+
+	},
+
 	setPath: function ( path ) {
 
 		this.path = path;
@@ -36640,13 +36662,6 @@ FileLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 	},
 
-	setWithCredentials: function ( value ) {
-
-		this.withCredentials = value;
-		return this;
-
-	},
-
 	setMimeType: function ( value ) {
 
 		this.mimeType = value;
@@ -36673,6 +36688,7 @@ AnimationLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 		const loader = new FileLoader( scope.manager );
 		loader.setPath( scope.path );
 		loader.setRequestHeader( scope.requestHeader );
+		loader.setWithCredentials( scope.withCredentials );
 		loader.load( url, function ( text ) {
 
 			try {
@@ -36746,6 +36762,7 @@ CompressedTextureLoader.prototype = Object.assign( Object.create( Loader.prototy
 		loader.setPath( this.path );
 		loader.setResponseType( 'arraybuffer' );
 		loader.setRequestHeader( this.requestHeader );
+		loader.setWithCredentials( scope.withCredentials );
 
 		let loaded = 0;
 
@@ -37004,6 +37021,7 @@ DataTextureLoader.prototype = Object.assign( Object.create( Loader.prototype ),
 		loader.setResponseType( 'arraybuffer' );
 		loader.setRequestHeader( this.requestHeader );
 		loader.setPath( this.path );
+		loader.setWithCredentials( scope.withCredentials );
 		loader.load( url, function ( buffer ) {
 
 			const texData = scope.parse( buffer );
@@ -40106,6 +40124,7 @@ MaterialLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 		const loader = new FileLoader( scope.manager );
 		loader.setPath( scope.path );
 		loader.setRequestHeader( scope.requestHeader );
+		loader.setWithCredentials( scope.withCredentials );
 		loader.load( url, function ( text ) {
 
 			try {
@@ -40530,6 +40549,7 @@ BufferGeometryLoader.prototype = Object.assign( Object.create( Loader.prototype
 		const loader = new FileLoader( scope.manager );
 		loader.setPath( scope.path );
 		loader.setRequestHeader( scope.requestHeader );
+		loader.setWithCredentials( scope.withCredentials );
 		loader.load( url, function ( text ) {
 
 			try {
@@ -40744,9 +40764,10 @@ class ObjectLoader extends Loader {
 		const path = ( this.path === '' ) ? LoaderUtils.extractUrlBase( url ) : this.path;
 		this.resourcePath = this.resourcePath || path;
 
-		const loader = new FileLoader( scope.manager );
+		const loader = new FileLoader( this.manager );
 		loader.setPath( this.path );
 		loader.setRequestHeader( this.requestHeader );
+		loader.setWithCredentials( this.withCredentials );
 		loader.load( url, function ( text ) {
 
 			let json = null;
@@ -42225,6 +42246,7 @@ FontLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 		const loader = new FileLoader( this.manager );
 		loader.setPath( this.path );
 		loader.setRequestHeader( this.requestHeader );
+		loader.setWithCredentials( scope.withCredentials );
 		loader.load( url, function ( text ) {
 
 			let json;
@@ -42298,6 +42320,7 @@ AudioLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 		loader.setResponseType( 'arraybuffer' );
 		loader.setPath( scope.path );
 		loader.setRequestHeader( scope.requestHeader );
+		loader.setWithCredentials( scope.withCredentials );
 		loader.load( url, function ( buffer ) {
 
 			try {

Some files were not shown because too many files changed in this diff