提交 eeb6753e 编写于 作者: M Michael Herzog 提交者: Mr.doob

JSONLoader: Update docs and clean up (#8761)

上级 1820cc4d
......@@ -16,27 +16,33 @@
<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>
Creates a new [name].
</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>
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>
<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>
[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>
<h3>[method:Object3D parse]( [page:Object json], [page:String texturePath] )</h3>
......@@ -45,10 +51,9 @@
[page:String texturePath] — Base path for textures.
</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>
<h2>Example</h2>
<code>
......
......@@ -399,7 +399,7 @@ THREE.JSONLoader.prototype = {
}
};
}
function parseSkin() {
......@@ -444,7 +444,7 @@ THREE.JSONLoader.prototype = {
}
};
}
function parseMorphing( scale ) {
......@@ -536,7 +536,7 @@ THREE.JSONLoader.prototype = {
if ( outputAnimations.length > 0 ) geometry.animations = outputAnimations;
};
}
if ( json.materials === undefined || json.materials.length === 0 ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册