浏览代码

JSONLoader: Update docs and clean up (#8761)

Michael Herzog 9 年之前
父节点
当前提交
eeb6753e74
共有 2 个文件被更改,包括 22 次插入17 次删除
  1. 19 14
      docs/api/loaders/JSONLoader.html
  2. 3 3
      src/loaders/JSONLoader.js

+ 19 - 14
docs/api/loaders/JSONLoader.html

@@ -16,27 +16,33 @@
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
-		<h3>[name]()</h3>
+		<h3>[name]( [page:LoadingManager manager] )</h3>
+		<div>
+		[page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
+		</div>
 		<div>
 		<div>
 		Creates a new [name].
 		Creates a new [name].
 		</div>
 		</div>
 
 
+		<h2>Methods</h2>
 
 
-		<h2>Properties</h2>
-
-		<h3>[property:boolean withCredentials]</h3>
+		<h3>[method:null load]( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )</h3>
 		<div>
 		<div>
-		If true, the ajax request will use cookies.
+		[page:String url] — required.<br />
+		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded text response.<br />
+		[page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
+		[page:Function onError] — Will be called when load errors.<br />
+		</div>
+		<div>
+		Begin loading from url and pass the <em>JSON</em> to onLoad.
 		</div>
 		</div>
 
 
-
-		<h2>Methods</h2>
-
-		<h3>[method:null load]( [page:String url], [page:Function callback], [page:String texturePath] )</h3>
+		<h3>[method:null setTexturePath]( [page:String texturePath] )</h3>
+		<div>
+		[page:String texturePath] — Base path for textures.
+		</div>
 		<div>
 		<div>
-		[page:String url] — required<br />
-		[page:Function callback] — required. Will be called when load completes. The arguments will be the loaded [page:Object3D] and the loaded [page:Array materials].<br />
-		[page:String texturePath] — optional. If not specified, textures will be assumed to be in the same folder as the Javascript model file.
+		Set the base path for textures.
 		</div>
 		</div>
 
 
 		<h3>[method:Object3D parse]( [page:Object json], [page:String texturePath] )</h3>
 		<h3>[method:Object3D parse]( [page:Object json], [page:String texturePath] )</h3>
@@ -45,10 +51,9 @@
 		[page:String texturePath] — Base path for textures.
 		[page:String texturePath] — Base path for textures.
 		</div>
 		</div>
 		<div>
 		<div>
-		Parse a <em>JSON</em> structure and return an [page:Object] containing the parsed .[page:Geometry] and .[page:Array materials].
+		Parse a <em>JSON</em> structure and return an [page:object] containing the parsed [page:Geometry geometry] and [page:Array materials].
 		</div>
 		</div>
 
 
-
 		<h2>Example</h2>
 		<h2>Example</h2>
 
 
 		<code>
 		<code>

+ 3 - 3
src/loaders/JSONLoader.js

@@ -399,7 +399,7 @@ THREE.JSONLoader.prototype = {
 
 
 			}
 			}
 
 
-		};
+		}
 
 
 		function parseSkin() {
 		function parseSkin() {
 
 
@@ -444,7 +444,7 @@ THREE.JSONLoader.prototype = {
 
 
 			}
 			}
 
 
-		};
+		}
 
 
 		function parseMorphing( scale ) {
 		function parseMorphing( scale ) {
 
 
@@ -536,7 +536,7 @@ THREE.JSONLoader.prototype = {
 
 
 			if ( outputAnimations.length > 0 ) geometry.animations = outputAnimations;
 			if ( outputAnimations.length > 0 ) geometry.animations = outputAnimations;
 
 
-		};
+		}
 
 
 		if ( json.materials === undefined || json.materials.length === 0 ) {
 		if ( json.materials === undefined || json.materials.length === 0 ) {