Skip to content

Commit 5b0bfba

Browse files
committed
Update documentation at /docs/?q=gltf#Reference/Loaders/GLTFLoader to reference new GLTFLoader
1 parent ec54400 commit 5b0bfba

File tree

4 files changed

+108
-77
lines changed

4 files changed

+108
-77
lines changed

docs/api/loaders/GLTFLoader.html

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<base href="../../" />
6+
<script src="list.js"></script>
7+
<script src="page.js"></script>
8+
<link type="text/css" rel="stylesheet" href="page.css" />
9+
</head>
10+
<body>
11+
[page:Loader] &rarr;
12+
<h1>[name]</h1>
13+
14+
<div class="desc">
15+
A loader for loading a <em>.gltf</em> resource in <em>JSON</em> format.
16+
<br /><br />
17+
The <a href="https://www.khronos.org/gltf">glTF file format</a> is a JSON file format to enable rapid delivery and loading of 3D content.
18+
</div>
19+
20+
21+
<h2>Constructor</h2>
22+
23+
<h3>[name]( [page:LoadingManager manager] )</h3>
24+
<div>
25+
[page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
26+
</div>
27+
<div>
28+
Creates a new [name].
29+
</div>
30+
31+
<h2>Properties</h2>
32+
33+
34+
<h2>Methods</h2>
35+
36+
<h3>[method:null load]( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )</h3>
37+
<div>
38+
[page:String url] — required<br />
39+
[page:Function onLoad] — Will be called when load completes. The argument will be the loaded JSON response returned from [page:Function parse].<br />
40+
[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, that contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
41+
[page:Function onError] — Will be called when load errors.<br />
42+
</div>
43+
<div>
44+
Begin loading from url and call the callback function with the parsed response content.
45+
</div>
46+
47+
<h3>[method:null setPath]( [page:String path] )</h3>
48+
<div>
49+
[page:String path] — Base path for loading additional resources e.g. textures, GLSL shaders, .bin data.
50+
</div>
51+
<div>
52+
Set the base path for additional resources.
53+
</div>
54+
55+
<h3>[method:null setCrossOrigin]( [page:String value] )</h3>
56+
<div>
57+
[page:String value] — The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
58+
</div>
59+
60+
<h3>[method:null parse]( [page:Object json], [page:Function callBack], [page:String path] )</h3>
61+
<div>
62+
[page:Object json] — <em>JSON</em> object to parse.<br />
63+
[page:Function callBack] — Will be called when parse completes.<br />
64+
[page:String path] — The base path from which to find subsequent glTF resources such as textures, GLSL shaders and .bin data files.<br />
65+
</div>
66+
<div>
67+
Parse a glTF-based <em>JSON</em> structure and fire [page:Function callback] when complete. The argument to [page:Function callback] will be an [page:object] that contains loaded parts: .[page:Scene scene], .[page:Array cameras], .[page:Array animations] and .[page:Array shaders]
68+
</div>
69+
70+
71+
<h2>Notes</h2>
72+
73+
<div>
74+
When using custom shaders provided within a glTF file [page:THREE.GLTFLoader.Shaders] should be updated on each render loop. See [example:webgl_loader_gltf] demo source code for example usage.
75+
</div>
76+
77+
<div>
78+
This class is often used with [page:THREE.GLTFLoader.Animations THREE.GLTFLoader.Animations] to animate parsed animations. See [example:webgl_loader_gltf] demo source code for example usage.
79+
</div>
80+
81+
<h2>Example</h2>
82+
83+
<code>
84+
// instantiate a loader
85+
var loader = new THREE.GLTFLoader();
86+
87+
// load a glTF resource
88+
loader.load(
89+
// resource URL
90+
'models/gltf/duck/duck.json',
91+
// Function when resource is loaded
92+
function ( object ) {
93+
scene.add( object.scene );
94+
}
95+
);
96+
</code>
97+
98+
[example:webgl_loader_gltf]
99+
100+
101+
<h2>Source</h2>
102+
103+
[link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/GLTFLoader.js examples/js/loaders/GLTFLoader.js]
104+
</body>
105+
</html>

docs/api/loaders/glTFLoader.html

-74
This file was deleted.

docs/list.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ var list = {
8787
[ "BufferGeometryLoader", "api/loaders/BufferGeometryLoader" ],
8888
[ "Cache", "api/loaders/Cache" ],
8989
[ "ColladaLoader", "api/loaders/ColladaLoader" ],
90-
[ "glTFLoader", "api/loaders/glTFLoader" ],
90+
[ "GLTFLoader", "api/loaders/GLTFLoader" ],
9191
[ "ImageLoader", "api/loaders/ImageLoader" ],
9292
[ "JSONLoader", "api/loaders/JSONLoader" ],
9393
[ "Loader", "api/loaders/Loader" ],

editor/js/libs/tern-threejs/threejs.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2544,8 +2544,8 @@
25442544
"!doc": "A low level class for loading resources with XmlHttpRequest, used internaly by most loaders.",
25452545
"!type": "fn(manager: +THREE.LoadingManager)"
25462546
},
2547-
"glTFLoader": {
2548-
"!url": "http://threejs.org/docs/#Reference/loaders/glTFLoader",
2547+
"GLTFLoader": {
2548+
"!url": "http://threejs.org/docs/#Reference/loaders/GLTFLoader",
25492549
"prototype": {
25502550
"!proto": "THREE.Loader.prototype",
25512551
"load": {

0 commit comments

Comments
 (0)