|
@@ -10,23 +10,23 @@
|
|
<body>
|
|
<body>
|
|
<h1>[name]</h1>
|
|
<h1>[name]</h1>
|
|
|
|
|
|
- <div class="desc">
|
|
|
|
|
|
+ <p class="desc">
|
|
A loader for loading a JSON resource. Unlike the [page:JSONLoader], this one make use of the
|
|
A loader for loading a JSON resource. Unlike the [page:JSONLoader], this one make use of the
|
|
<em>.type</em> attributes of objects to map them to their original classes.<br /><br />
|
|
<em>.type</em> attributes of objects to map them to their original classes.<br /><br />
|
|
|
|
|
|
Note that this loader can't load [page:Geometries]. Use [page:JSONLoader] instead for that.<br /><br />
|
|
Note that this loader can't load [page:Geometries]. Use [page:JSONLoader] instead for that.<br /><br />
|
|
|
|
|
|
This uses the [page:FileLoader] internally for loading files.
|
|
This uses the [page:FileLoader] internally for loading files.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h2>Example</h2>
|
|
<h2>Example</h2>
|
|
|
|
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
|
|
|
|
[example:webgl_animation_scene WebGL / animation / scene]<br />
|
|
[example:webgl_animation_scene WebGL / animation / scene]<br />
|
|
[example:webgl_loader_json_claraio WebGL / loader / json / claraio]<br />
|
|
[example:webgl_loader_json_claraio WebGL / loader / json / claraio]<br />
|
|
[example:webgl_loader_msgpack WebGL / loader / msgpack]
|
|
[example:webgl_loader_msgpack WebGL / loader / msgpack]
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<code>
|
|
<code>
|
|
var loader = new THREE.ObjectLoader();
|
|
var loader = new THREE.ObjectLoader();
|
|
@@ -65,96 +65,96 @@
|
|
<h2>Constructor</h2>
|
|
<h2>Constructor</h2>
|
|
|
|
|
|
<h3>[name]( [param:LoadingManager manager] )</h3>
|
|
<h3>[name]( [param:LoadingManager manager] )</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
[page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].<br /><br />
|
|
[page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].<br /><br />
|
|
|
|
|
|
Creates a new [name].
|
|
Creates a new [name].
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
|
|
|
|
<h2>Properties</h2>
|
|
<h2>Properties</h2>
|
|
|
|
|
|
<h3>[property:String crossOrigin]</h3>
|
|
<h3>[property:String crossOrigin]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
If set, assigns the [link:https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes crossOrigin]
|
|
If set, assigns the [link:https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes crossOrigin]
|
|
attribute of the image to the value of *crossOrigin*,
|
|
attribute of the image to the value of *crossOrigin*,
|
|
prior to starting the load. Default is *undefined*.
|
|
prior to starting the load. Default is *undefined*.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:LoadingManager manager]</h3>
|
|
<h3>[property:LoadingManager manager]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager].
|
|
The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager].
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:String texturePath]</h3>
|
|
<h3>[property:String texturePath]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
The base path or URL from which textures will be loaded. See [page:.setTexturePath].
|
|
The base path or URL from which textures will be loaded. See [page:.setTexturePath].
|
|
Default is the empty string.
|
|
Default is the empty string.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h2>Methods</h2>
|
|
<h2>Methods</h2>
|
|
|
|
|
|
<h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
|
|
<h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
[page:String url] — the path or URL to the file. This can also be a
|
|
[page:String url] — the path or URL to the file. This can also be a
|
|
[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
|
|
[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
|
|
[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Object3D object].<br />
|
|
[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Object3D object].<br />
|
|
[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
|
|
[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
|
|
[page:Function onError] — Will be called when load errors.<br />
|
|
[page:Function onError] — Will be called when load errors.<br />
|
|
- </div>
|
|
|
|
- <div>
|
|
|
|
|
|
+ </p>
|
|
|
|
+ <p>
|
|
Begin loading from url and call onLoad with the parsed response content.
|
|
Begin loading from url and call onLoad with the parsed response content.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
|
|
|
|
<h3>[method:Object3D parse]( [param:Object json], [param:Function onLoad] )</h3>
|
|
<h3>[method:Object3D parse]( [param:Object json], [param:Function onLoad] )</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
[page:Object json] — required. The JSON source to parse.<br /><br />
|
|
[page:Object json] — required. The JSON source to parse.<br /><br />
|
|
[page:Function onLoad] — Will be called when parsed completes. The argument will be the parsed [page:Object3D object].<br />
|
|
[page:Function onLoad] — Will be called when parsed completes. The argument will be the parsed [page:Object3D object].<br />
|
|
|
|
|
|
Parse a <em>JSON</em> structure and return a threejs object.
|
|
Parse a <em>JSON</em> structure and return a threejs object.
|
|
This is used internally by [page:.load], but can also be used directly to parse
|
|
This is used internally by [page:.load], but can also be used directly to parse
|
|
a previously loaded JSON structure.
|
|
a previously loaded JSON structure.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[method:Object3D parseGeometries]( [param:Object json] )</h3>
|
|
<h3>[method:Object3D parseGeometries]( [param:Object json] )</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
[page:Object json] — required. The JSON source to parse.<br /><br />
|
|
[page:Object json] — required. The JSON source to parse.<br /><br />
|
|
|
|
|
|
This is used [page:.parse] to parse any [page:Geometry geometries] or [page:BufferGeometry buffer geometries] in the JSON structure.
|
|
This is used [page:.parse] to parse any [page:Geometry geometries] or [page:BufferGeometry buffer geometries] in the JSON structure.
|
|
Internally it uses [page:JSONLoader] for geometries and [page:BufferGeometryLoader] for buffer geometries.
|
|
Internally it uses [page:JSONLoader] for geometries and [page:BufferGeometryLoader] for buffer geometries.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[method:Object3D parseMaterials]( [param:Object json] )</h3>
|
|
<h3>[method:Object3D parseMaterials]( [param:Object json] )</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
[page:Object json] — required. The JSON source to parse.<br /><br />
|
|
[page:Object json] — required. The JSON source to parse.<br /><br />
|
|
|
|
|
|
This is used [page:.parse] to parse any materials in the JSON structure using [page:MaterialLoader].
|
|
This is used [page:.parse] to parse any materials in the JSON structure using [page:MaterialLoader].
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[method:Object3D parseAnimations]( [param:Object json] )</h3>
|
|
<h3>[method:Object3D parseAnimations]( [param:Object json] )</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
[page:Object json] — required. The JSON source to parse.<br /><br />
|
|
[page:Object json] — required. The JSON source to parse.<br /><br />
|
|
|
|
|
|
This is used [page:.parse] to parse any animations in the JSON structure, using [page:AnimationClip.parse].
|
|
This is used [page:.parse] to parse any animations in the JSON structure, using [page:AnimationClip.parse].
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[method:Object3D parseImages]( [param:Object json] )</h3>
|
|
<h3>[method:Object3D parseImages]( [param:Object json] )</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
[page:Object json] — required. The JSON source to parse.<br /><br />
|
|
[page:Object json] — required. The JSON source to parse.<br /><br />
|
|
|
|
|
|
This is used [page:.parse] to parse any images in the JSON structure, using [page:ImageLoader].
|
|
This is used [page:.parse] to parse any images in the JSON structure, using [page:ImageLoader].
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[method:Object3D parseTextures]( [param:Object json] )</h3>
|
|
<h3>[method:Object3D parseTextures]( [param:Object json] )</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
[page:Object json] — required. The JSON source to parse.<br /><br />
|
|
[page:Object json] — required. The JSON source to parse.<br /><br />
|
|
|
|
|
|
This is used [page:.parse] to parse any textures in the JSON structure.
|
|
This is used [page:.parse] to parse any textures in the JSON structure.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[method:Object3D parseObject]( [param:Object json] )</h3>
|
|
<h3>[method:Object3D parseObject]( [param:Object json] )</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
[page:Object json] — required. The JSON source to parse.<br /><br />
|
|
[page:Object json] — required. The JSON source to parse.<br /><br />
|
|
|
|
|
|
This is used [page:.parse] to parse any objects in the JSON structure.
|
|
This is used [page:.parse] to parse any objects in the JSON structure.
|
|
@@ -211,19 +211,19 @@
|
|
</li>
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
</ul>
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[method:null setCrossOrigin]( [param:String value] )</h3>
|
|
<h3>[method:null setCrossOrigin]( [param:String value] )</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
[page:String value] — The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
|
|
[page:String value] — The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[method:null setTexturePath]( [param:String value] )</h3>
|
|
<h3>[method:null setTexturePath]( [param:String value] )</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
[page:String value] — The base path or URL from which textures will be loaded.<br /><br />
|
|
[page:String value] — The base path or URL from which textures will be loaded.<br /><br />
|
|
|
|
|
|
|
|
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h2>Source</h2>
|
|
<h2>Source</h2>
|
|
|
|
|