Kaynağa Gözat

Loader: Removed showStatus.

Mr.doob 10 yıl önce
ebeveyn
işleme
dd430fc9fa

+ 1 - 76
docs/api/loaders/JSONLoader.html

@@ -15,10 +15,7 @@
 
 		<h2>Constructor</h2>
 
-		<h3>[name]( [page:Boolean showStatus] )</h3>
-		<div>
-		[page:Boolean showStatus] — Show the status of loading div.
-		</div>
+		<h3>[name]()</h3>
 		<div>
 		Creates a new [name].
 		</div>
@@ -32,29 +29,6 @@
 		</div>
 
 
-		<h2>Properties inherited from [page:Loader]</h2>
-
-		<h3>[property:Boolean showStatus]</h3>
-		<div>If true, show loading status in the statusDomElement.</div>
-
-		<h3>[property:DOMElement statusDomElement]</h3>
-		<div>This is the recipient of status messages.</div>
-
-		<h3>[property:Function onLoadStart]</h3>
-		<div>Will be called when load starts.</div>
-		<div>The default is a function with empty body.</div>
-
-		<!--
-		<h3>[property:Function onLoadProgress]</h3>
-		<div>Will be called while load progresses.</div>
-		<div>The default is a function with empty body.</div>
-		-->
-
-		<h3>[property:Function onLoadComplete]</h3>
-		<div>Will be called when load completes.</div>
-		<div>The default is a function with empty body.</div>
-
-
 		<h2>Methods</h2>
 
 		<h3>[method:null load]( [page:String url], [page:Function callback], [page:String texturePath] )</h3>
@@ -85,55 +59,6 @@
 		Parse a <em>JSON</em> structure and return an [page:Object] containing the parsed .[page:Geometry] and .[page:Array materials].
 		</div>
 
-		<h2>Methods inherited from [page:Loader]</h2>
-
-		<h3>[method:Boolean needsTangents]( [page:Array materials] )</h3>
-		<div>
-		[page:Array materials] — an array of [page:Material]
-		</div>
-		<div>
-		Checks if the loaded object needs tangents based on its materials.
-		</div>
-
-		<h3>[method:null updateProgress]( [page:object progress] )</h3>
-		<div>
-		[page:Object progress] — an object containing loaded(contains the amount of bytes loaded) and optionally total (containing the total amount of bytes).
-		</div>
-		<div>
-		Updates the DOM object with the progress made.
-		</div>
-
-		<h3>[method:Material createMaterial]( [page:object m], [page:string texturePath] )</h3>
-		<div>
-		[page:Object m] — The parameters to create the material. <br />
-		[page:String texturePath] — The base path of the textures.
-		</div>
-		<div>
-		Creates the Material based on the parameters m.
-		</div>
-
-		<h3>[method:Array initMaterials]( [page:Array materials], [page:string texturePath] )</h3>
-		<div>
-		[page:Array materials] — an array of parameters to create materials. <br />
-		[page:String texturePath] —  The base path of the textures.
-		</div>
-		<div>
-		Creates an array of [page:Material] based on the array of parameters m. The index of the parameters decide the correct index of the materials.
-		</div>
-
-		<h3>[method:String extractUrlBase]( [page:string url] )</h3>
-		<div>
-		[page:String url] —  The url to extract the base url from.
-		</div>
-		<div>
-		Extract the base from the URL.
-		</div>
-
-		<h3>[method:DOMElement addStatusElement]()</h3>
-		<div>
-		Add a DOM element to indicate the progress and return the DOMElement
-		</div>
-
 
 		<h2>Example</h2>
 

+ 1 - 18
docs/api/loaders/Loader.html

@@ -15,10 +15,7 @@
 		<h2>Constructor</h2>
 
 
-		<h3>[name]( [page:Boolean showStatus] )</h3>
-		<div>
-		[page:Boolean showStatus] — Show the status of loading div.
-		</div>
+		<h3>[name]()</h3>
 		<div>
 		Creates a new [name]. This should be called as base class.
 		</div>
@@ -26,12 +23,6 @@
 
 		<h2>Properties</h2>
 
-		<h3>[property:Boolean showStatus]</h3>
-		<div>If true, show loading status in the statusDomElement.</div>
-
-		<h3>[property:DOMElement statusDomElement]</h3>
-		<div>This is the recipient of status messages.</div>
-
 		<h3>[property:Function onLoadStart]</h3>
 		<div>Will be called when load starts.</div>
 		<div>The default is a function with empty body.</div>
@@ -59,14 +50,6 @@
 		Checks if the loaded object needs tangents based on its materials.
 		</div>
 
-		<h3>[method:null updateProgress]( [page:object progress] )</h3>
-		<div>
-		[page:Object progress] — an object containing loaded(contains the amount of bytes loaded) and optionally total (containing the total amount of bytes).
-		</div>
-		<div>
-		Updates the DOM object with the progress made.
-		</div>
-
 		<h3>[method:Material createMaterial]( [page:object m], [page:string texturePath] )</h3>
 		<div>
 		[page:Object m] — The parameters to create the material. <br />

+ 1 - 1
examples/canvas_morphtargets_horse.html

@@ -62,7 +62,7 @@
 				light.position.set( -1, -1, -1 ).normalize();
 				scene.add( light );
 
-				var loader = new THREE.JSONLoader( true );
+				var loader = new THREE.JSONLoader();
 				loader.load( "models/animated/horse.js", function ( geometry ) {
 
 					mesh = new THREE.Mesh( geometry, new THREE.MeshLambertMaterial( { color: 0x606060, morphTargets: true, overdraw: 0.5 } ) );

+ 2 - 2
examples/js/loaders/ctm/CTMLoader.js

@@ -8,9 +8,9 @@
  * @author alteredq / http://alteredqualia.com/
  */
 
-THREE.CTMLoader = function ( showStatus ) {
+THREE.CTMLoader = function () {
 
-	THREE.Loader.call( this, showStatus );
+	THREE.Loader.call( this );
 
 };
 

Dosya farkı çok büyük olduğundan ihmal edildi
+ 148 - 148
examples/js/loaders/gltf/glTFLoader.js


+ 1 - 8
examples/webgl_effects_parallaxbarrier.html

@@ -151,8 +151,7 @@
 			var windowHalfX = window.innerWidth / 2;
 			var windowHalfY = window.innerHeight / 2;
 
-			var loader = new THREE.BinaryLoader( true );
-			document.body.appendChild( loader.statusDomElement );
+			var loader = new THREE.BinaryLoader();
 
 			init();
 			animate();
@@ -486,7 +485,6 @@
 
 					if ( ! CARS[ car ].object ) {
 
-						loader.statusDomElement.style.display = "block";
 						loader.load( CARS[ car ].url, function( geometry ) { createScene( geometry, car ) } );
 
 					} else {
@@ -562,8 +560,6 @@
 
 			function createScene( geometry, car ) {
 
-				loader.statusDomElement.innerHTML = "Creating model ...";
-
 				var m = new THREE.MeshFaceMaterial(),
 					s = CARS[ car ].scale * 1,
 					r = CARS[ car ].init_rotation,
@@ -591,9 +587,6 @@
 
 				switchCar( car );
 
-				loader.statusDomElement.style.display = "none";
-				loader.statusDomElement.innerHTML = "Loading model ...";
-
 			}
 
 			function onDocumentMouseMove(event) {

+ 1 - 4
examples/webgl_geometry_large_mesh.html

@@ -162,8 +162,7 @@
 				bcanvas.addEventListener( "click", toggleCanvas, false );
 				bwebgl.addEventListener( "click", toggleWebGL, false );
 
-				loader = new THREE.BinaryLoader( true );
-				document.body.appendChild( loader.statusDomElement );
+				loader = new THREE.BinaryLoader();
 
 				var start = Date.now();
 
@@ -174,8 +173,6 @@
 					addMesh( geometry, 0.75, -300, 0, 0, 0,0,0, new THREE.MeshPhongMaterial( { color: 0x111111, specular: 0xffaa00, shininess: 10 } ) );
 					addMesh( geometry, 0.75, -900, 0, 0, 0,0,0, new THREE.MeshPhongMaterial( { color: 0x555555, specular: 0x666666, shininess: 10 } ) );
 
-					loader.statusDomElement.style.display = "none";
-
 					log( "geometry.vertices: " + geometry.vertices.length );
 					log( "geometry.faces: " + geometry.faces.length );
 

+ 2 - 7
examples/webgl_loader_ctm_materials.html

@@ -178,8 +178,7 @@
 
 				// new way via CTMLoader and separate parts
 
-				loaderCTM = new THREE.CTMLoader( true );
-				document.body.appendChild( loaderCTM.statusDomElement );
+				loaderCTM = new THREE.CTMLoader();
 
 				var position = new THREE.Vector3( -105, -78, -40 );
 				var scale = new THREE.Vector3( 30, 30, 30 );
@@ -197,8 +196,6 @@
 
 					}
 
-					loaderCTM.statusDomElement.style.display = "none";
-
 					var end = Date.now();
 
 					console.log( "load time:", end - start, "ms" );
@@ -269,10 +266,8 @@
 
 			function createScene( geometry, materials, x, y, z, s ) {
 
-				loader.statusDomElement.style.display = "none";
-
 				geometry.center();
-				
+
 				hackMaterials( materials );
 
 				var material = new THREE.MeshFaceMaterial( materials );

+ 1 - 5
examples/webgl_materials_bumpmap.html

@@ -171,9 +171,7 @@
 
 				var material = new THREE.MeshPhongMaterial( { color: 0x552811, specular: 0x333333, shininess: 25, bumpMap: mapHeight, bumpScale: 19, metal: false } );
 
-				loader = new THREE.JSONLoader( true );
-				document.body.appendChild( loader.statusDomElement );
-
+				loader = new THREE.JSONLoader();
 				loader.load( "obj/leeperrysmith/LeePerrySmith.js", function( geometry ) { createScene( geometry, 100, material ) } );
 
 				renderer = new THREE.WebGLRenderer( { antialias: false } );
@@ -218,8 +216,6 @@
 
 				scene.add( mesh );
 
-				loader.statusDomElement.style.display = "none";
-
 			}
 
 			//

+ 1 - 5
examples/webgl_materials_bumpmap_skin.html

@@ -172,9 +172,7 @@
 
 				//
 
-				loader = new THREE.JSONLoader( true );
-				document.body.appendChild( loader.statusDomElement );
-
+				loader = new THREE.JSONLoader();
 				loader.load( "obj/leeperrysmith/LeePerrySmith.js", function( geometry ) { createScene( geometry, 100 ) } );
 
 				//
@@ -294,8 +292,6 @@
 
 				scene.add( mesh );
 
-				loader.statusDomElement.style.display = "none";
-
 			}
 
 			//

+ 1 - 8
examples/webgl_materials_cars.html

@@ -151,8 +151,7 @@
 			var windowHalfX = window.innerWidth / 2;
 			var windowHalfY = window.innerHeight / 2;
 
-			var loader = new THREE.BinaryLoader( true );
-			document.body.appendChild( loader.statusDomElement );
+			var loader = new THREE.BinaryLoader();
 
 			init();
 			animate();
@@ -494,7 +493,6 @@
 
 					if ( ! CARS[ car ].object ) {
 
-						loader.statusDomElement.style.display = "block";
 						loader.load( CARS[ car ].url, function( geometry ) { createScene( geometry, car ) } );
 
 					} else {
@@ -570,8 +568,6 @@
 
 			function createScene( geometry, car ) {
 
-				loader.statusDomElement.innerHTML = "Creating model ...";
-
 				var m = new THREE.MeshFaceMaterial(),
 					s = CARS[ car ].scale * 1,
 					r = CARS[ car ].init_rotation,
@@ -602,9 +598,6 @@
 
 				switchCar( car );
 
-				loader.statusDomElement.style.display = "none";
-				loader.statusDomElement.innerHTML = "Loading model ...";
-
 			}
 
 			function onDocumentMouseMove(event) {

+ 1 - 5
examples/webgl_materials_cubemap.html

@@ -152,9 +152,7 @@
 
 				//
 
-				loader = new THREE.BinaryLoader( true );
-				document.body.appendChild( loader.statusDomElement );
-
+				loader = new THREE.BinaryLoader();
 				loader.load( "obj/walt/WaltHead_bin.js", function( geometry ) { createScene( geometry, cubeMaterial1, cubeMaterial2, cubeMaterial3 ) } );
 
 				//
@@ -199,8 +197,6 @@
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = s;
 				scene.add( mesh );
 
-				loader.statusDomElement.style.display = "none";
-
 			}
 
 			function onDocumentMouseMove(event) {

+ 1 - 5
examples/webgl_materials_cubemap_refraction.html

@@ -140,9 +140,7 @@
 				stats.domElement.style.zIndex = 100;
 				container.appendChild( stats.domElement );
 
-				loader = new THREE.BinaryLoader( true );
-				document.body.appendChild( loader.statusDomElement );
-
+				loader = new THREE.BinaryLoader();
 				loader.load( 'obj/lucy/Lucy100k_bin.js', function( geometry ) { createScene( geometry, cubeMaterial1, cubeMaterial2, cubeMaterial3 ) } );
 
 				document.addEventListener('mousemove', onDocumentMouseMove, false);
@@ -189,8 +187,6 @@
 				mesh.scale.x = mesh.scale.y = mesh.scale.z = s;
 				scene.add( mesh );
 
-				loader.statusDomElement.style.display = "none";
-
 			}
 
 			function onDocumentMouseMove(event) {

+ 1 - 5
examples/webgl_materials_normaldisplacementmap.html

@@ -194,9 +194,7 @@
 
 				//
 
-				loader = new THREE.BinaryLoader( true );
-				document.body.appendChild( loader.statusDomElement );
-
+				loader = new THREE.BinaryLoader();
 				loader.load( "obj/ninja/NinjaLo_bin.js", function( geometry ) { createScene( geometry, scale, material1, material2 ) } );
 
 				//
@@ -272,8 +270,6 @@
 				mesh2.receiveShadow = true;
 				scene.add( mesh2 );
 
-				loader.statusDomElement.style.display = "none";
-
 			}
 
 			function onDocumentMouseMove(event) {

+ 1 - 5
examples/webgl_materials_normalmap.html

@@ -128,9 +128,7 @@
 					normalScale: new THREE.Vector2( 0.8, 0.8 )
 				} );
 
-				loader = new THREE.JSONLoader( true );
-				document.body.appendChild( loader.statusDomElement );
-
+				loader = new THREE.JSONLoader();
 				loader.load( "obj/leeperrysmith/LeePerrySmith.js", function( geometry ) { createScene( geometry, 100, material ) } );
 
 				renderer = new THREE.WebGLRenderer( { antialias: false } );
@@ -201,8 +199,6 @@
 
 				scene.add( mesh1 );
 
-				loader.statusDomElement.style.display = "none";
-
 			}
 
 			//

+ 1 - 5
examples/webgl_materials_skin.html

@@ -148,9 +148,7 @@
 
 				// LOADER
 
-				loader = new THREE.JSONLoader( true );
-				document.body.appendChild( loader.statusDomElement );
-
+				loader = new THREE.JSONLoader();
 				loader.load(  "obj/leeperrysmith/LeePerrySmith.js", function( geometry ) { createScene( geometry, 100, material ) } );
 
 				// RENDERER
@@ -283,8 +281,6 @@
 
 				scene.add( mesh );
 
-				loader.statusDomElement.style.display = "none";
-
 			}
 
 			function onDocumentMouseMove( event ) {

+ 1 - 1
examples/webgl_morphtargets_horse.html

@@ -59,7 +59,7 @@
 				light.position.set( -1, -1, -1 ).normalize();
 				scene.add( light );
 
-				var loader = new THREE.JSONLoader( true );
+				var loader = new THREE.JSONLoader();
 				loader.load( "models/animated/horse.js", function( geometry ) {
 
 					mesh = new THREE.Mesh( geometry, new THREE.MeshLambertMaterial( { color: 0x606060, morphTargets: true } ) );

+ 2 - 7
examples/webgl_particles_dynamic.html

@@ -95,11 +95,8 @@
 
 				//
 
-				aloader = new THREE.JSONLoader( );
-				bloader = new THREE.BinaryLoader( true );
-
-				document.body.appendChild( bloader.statusDomElement );
-
+				aloader = new THREE.JSONLoader();
+				bloader = new THREE.BinaryLoader();
 				aloader.load( "obj/terrain.js", function( geometry ) {
 
 					createMesh( geometry, scene, 16.8, -11000, -200,  -5000, 0x00ff44, false );
@@ -265,8 +262,6 @@
 
 				}
 
-				bloader.statusDomElement.style.display = "none";
-
 				meshes.push( {
 					mesh: mesh, vertices: geometry.vertices, vertices_tmp: vertices_tmp, vl: vl,
 					down: 0, up: 0, direction: 0, speed: 35, delay: Math.floor( 200 + 200 * Math.random() ),

+ 1 - 4
examples/webgl_postprocessing_advanced.html

@@ -111,8 +111,7 @@
 				directionalLight.position.set( 0, -0.1, 1 ).normalize();
 				sceneModel.add( directionalLight );
 
-				loader = new THREE.JSONLoader( true );
-				document.body.appendChild( loader.statusDomElement );
+				loader = new THREE.JSONLoader();
 				loader.load( "obj/leeperrysmith/LeePerrySmith.js", function( geometry ) { createMesh( geometry, sceneModel, 100 ) } );
 
 				//
@@ -349,8 +348,6 @@
 
 				scene.add( mesh );
 
-				loader.statusDomElement.style.display = "none";
-
 			}
 
 			//

+ 1 - 44
src/loaders/Loader.js

@@ -2,10 +2,7 @@
  * @author alteredq / http://alteredqualia.com/
  */
 
-THREE.Loader = function ( showStatus ) {
-
-	this.showStatus = showStatus;
-	this.statusDomElement = showStatus ? THREE.Loader.prototype.addStatusElement() : null;
+THREE.Loader = function () {
 
 	this.onLoadStart = function () {};
 	this.onLoadProgress = function () {};
@@ -19,46 +16,6 @@ THREE.Loader.prototype = {
 
 	crossOrigin: undefined,
 
-	addStatusElement: function () {
-
-		var e = document.createElement( 'div' );
-
-		e.style.position = 'absolute';
-		e.style.right = '0px';
-		e.style.top = '0px';
-		e.style.fontSize = '0.8em';
-		e.style.textAlign = 'left';
-		e.style.background = 'rgba(0,0,0,0.25)';
-		e.style.color = '#fff';
-		e.style.width = '120px';
-		e.style.padding = '0.5em 0.5em 0.5em 0.5em';
-		e.style.zIndex = 1000;
-
-		e.innerHTML = 'Loading ...';
-
-		return e;
-
-	},
-
-	updateProgress: function ( progress ) {
-
-		var message = 'Loaded ';
-
-		if ( progress.total ) {
-
-			message += ( 100 * progress.loaded / progress.total ).toFixed( 0 ) + '%';
-
-
-		} else {
-
-			message += ( progress.loaded / 1024 ).toFixed( 2 ) + ' KB';
-
-		}
-
-		this.statusDomElement.innerHTML = message;
-
-	},
-
 	extractUrlBase: function ( url ) {
 
 		var parts = url.split( '/' );

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor