Răsfoiți Sursa

Cache, LoadingManager, OBJLoader, ObjectLoader, TextureLoader and XHRLoader documentation

Vincent Lark 10 ani în urmă
părinte
comite
7bad42cb94

+ 37 - 15
docs/api/loaders/Cache.html

@@ -9,36 +9,58 @@
 	<body>
 	<body>
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
-		<div class="desc">todo</div>
+		<div class="desc">A simple caching classe.</div>
 
 
-		<h2>Example</h2>
-
-		<code>todo</code>
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
-
-		<h3>todo</h3>
-		<div></div>
+		<h3>[name]()</h3>
+		<div>
+		Creates a new [name].
+		</div>
 
 
 
 
 		<h2>Properties</h2>
 		<h2>Properties</h2>
 
 
-		<h3>todo</h3>
+		<h3>.[page:Object files]</h3>
 		<div>
 		<div>
-		todo
-		</div> 
+		An [page:Object object] that hold cached values.
+		</div>
 
 
 
 
 		<h2>Methods</h2>
 		<h2>Methods</h2>
-		
 
 
-		<h3>todo</h3>
-		<div>todo</div>
+		<h3>.add( [page:String key], value )</h3>
+		<div>
+		key — required. A string key <br />
+		value — <br />
+		</div>
+		<div>
+		Adds a cache entry with that key to hold the value. If this key already holds a value, it is overwritten.
+		</div>
+
+		<h3>.get( [page:String key] )</h3>
+		<div>
+		key — required. A string key <br />
+		</div>
+		<div>
+		Get the value of key. If the key does not exist the null value is returned.
+		</div>
+
+		<h3>.remove( [page:String key] )</h3>
+		<div>
+		key — required. A string key <br />
+		</div>
 		<div>
 		<div>
-		todo
+		Remove the cached value associated with the key.
 		</div>
 		</div>
-		
+
+		<h3>.clear()</h3>
+		<div>
+		Remove all values from the cache.
+		</div>
+
+
 		<h2>Source</h2>
 		<h2>Source</h2>
 
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]

+ 15 - 8
docs/api/loaders/LoadingManager.html

@@ -26,6 +26,7 @@ loader.load( 'file.obj', function ( object ) {
 } );
 } );
 		</code>
 		</code>
 
 
+
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
 		<h3>[name]([page:function onLoad], [page:function onProgress], [page:function onError])</h3>
 		<h3>[name]([page:function onLoad], [page:function onProgress], [page:function onError])</h3>
@@ -37,27 +38,27 @@ loader.load( 'file.obj', function ( object ) {
 		<div>
 		<div>
 		Creates a [name].
 		Creates a [name].
 		</div>
 		</div>
-		
-		
+
+
 		<h2>Properties</h2>
 		<h2>Properties</h2>
 
 
 		<h3>.[page:function onLoad]</h3>
 		<h3>.[page:function onLoad]</h3>
 		<div>
 		<div>
-		The function that needs to be called when all loaders are done. 
-		</div> 
+		The function that needs to be called when all loaders are done.
+		</div>
 
 
 		<h3>.[page:function onProgress]</h3>
 		<h3>.[page:function onProgress]</h3>
 		<div>
 		<div>
 		The function that needs to be called when an item is complete. The arguments are url(The url of the item just loaded),<br />
 		The function that needs to be called when an item is complete. The arguments are url(The url of the item just loaded),<br />
 		loaded(the amount of items already loaded), total( The total amount of items to be loaded.)
 		loaded(the amount of items already loaded), total( The total amount of items to be loaded.)
-		</div> 
+		</div>
 
 
 		<h3>.[page:function onError]</h3>
 		<h3>.[page:function onError]</h3>
 		<div>
 		<div>
 		The function that needs to be called when an item errors.
 		The function that needs to be called when an item errors.
-		</div> 
-		
-		
+		</div>
+
+
 		<h2>Methods</h2>
 		<h2>Methods</h2>
 
 
 		<h3>.itemStart( [page:String url] )</h3>
 		<h3>.itemStart( [page:String url] )</h3>
@@ -76,6 +77,12 @@ loader.load( 'file.obj', function ( object ) {
 		This should be called by any loader used by the manager when the loader ended loading an url.  These shouldn't be called outside a loader.
 		This should be called by any loader used by the manager when the loader ended loading an url.  These shouldn't be called outside a loader.
 		</div>
 		</div>
 
 
+
+		<h2>Example</h2>
+
+		<a target="_parent" href="http://threejs.org/examples/#webgl_loader_obj">webgl_loader_obj</a>
+
+
 		<h2>Source</h2>
 		<h2>Source</h2>
 
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]

+ 42 - 42
docs/api/loaders/OBJLoader.html

@@ -1,60 +1,60 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
-    <head>
-        <meta charset="utf-8" />
-        <script src="../../list.js"></script>
-        <script src="../../page.js"></script>
-        <link type="text/css" rel="stylesheet" href="../../page.css" />
-    </head>
-    <body>
+	<head>
+		<meta charset="utf-8" />
+		<script src="../../list.js"></script>
+		<script src="../../page.js"></script>
+		<link type="text/css" rel="stylesheet" href="../../page.css" />
+	</head>
+	<body>
 
 
-        <h1>[name]</h1>
+		<h1>[name]</h1>
 
 
-        <div class="desc">A loader for loading an <em>.obj</em> resource.</div>
+		<div class="desc">A loader for loading an <em>.obj</em> resource.</div>
 
 
 
 
-        <h2>Constructor</h2>
+		<h2>Constructor</h2>
 
 
-        <h3>[name]([page:LoadingManager manager])</h3>
-        <div>
-        manager — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
-        </div>
-        <div>
-        Creates a new [name].
-        </div>
+		<h3>[name]([page:LoadingManager manager])</h3>
+		<div>
+		manager — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
+		</div>
+		<div>
+		Creates a new [name].
+		</div>
 
 
-        <h2>Properties</h2>
+		<h2>Properties</h2>
 
 
 
 
-        <h2>Methods</h2>
+		<h2>Methods</h2>
 
 
-        <h3>.load( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )</h3>
-        <div>
-        url — required<br />
-        onLoad — Will be called when load completes. The argument will be the loaded [page:Object3D object].<br />
-        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 />
-        onError — Will be called when load errors.<br />
-        </div>
-        <div>
-        Begin loading from url and return the [page:String text] response that will contain the data.
-        </div>
+		<h3>.load( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )</h3>
+		<div>
+		url — required<br />
+		onLoad — Will be called when load completes. The argument will be the loaded [page:Object3D object].<br />
+		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 />
+		onError — Will be called when load errors.<br />
+		</div>
+		<div>
+		Begin loading from url and call onLoad with the parsed response content.
+		</div>
 
 
-        <h3>.parse([page:String text])</h3>
-        <div>
-        text — The textual <em>obj</em> structure to parse.
-        </div>
-        <div>
-        Parse an <em>obj</em> text structure and returns an [page:Object3D object].<br />
-        Found objects are converted to [page:Mesh meshs] with a [page:BufferGeometry BufferGeometry] and a default [page:MeshLambertMaterial MeshLambertMaterial].
-        </div>
+		<h3>.parse([page:String text])</h3>
+		<div>
+		text — The textual <em>obj</em> structure to parse.
+		</div>
+		<div>
+		Parse an <em>obj</em> text structure and returns an [page:Object3D object].<br />
+		Found objects are converted to [page:Mesh meshs] with a [page:BufferGeometry BufferGeometry] and a default [page:MeshLambertMaterial MeshLambertMaterial].
+		</div>
 
 
-        <h2>Example</h2>
+		<h2>Example</h2>
 
 
-        [link:http://threejs.org/examples/#webgl_loader_obj]
+		<a target="_parent" href="http://threejs.org/examples/#webgl_loader_obj">webgl_loader_obj</a>
 
 
 
 
-        <h2>Source</h2>
+		<h2>Source</h2>
 
 
-        [link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/OBJLoader.js examples/js/loaders/OBJLoader.js]
-    </body>
+		[link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/OBJLoader.js examples/js/loaders/OBJLoader.js]
+	</body>
 </html>
 </html>

+ 36 - 16
docs/api/loaders/ObjectLoader.html

@@ -9,36 +9,56 @@
 	<body>
 	<body>
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
-		<div class="desc">todo</div>
+		<div class="desc">A loader for loading a JSON resource. Unlike the [page:JSONLoader JSONLoader], this one make use of the <em>.type</em> attributes of objects to map them to their original classes.</div>
 
 
-		<h2>Example</h2>
-
-		<code>todo</code>
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
-
-		<h3>todo</h3>
-		<div></div>
+		<h3>[name]([page:LoadingManager manager])</h3>
+		<div>
+		manager — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
+		</div>
+		<div>
+		Creates a new [name].
+		</div>
 
 
 
 
 		<h2>Properties</h2>
 		<h2>Properties</h2>
 
 
-		<h3>todo</h3>
+
+		<h2>Methods</h2>
+
+		<h3>.load( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )</h3>
+		<div>
+		url — required<br />
+		onLoad — Will be called when load completes. The argument will be the loaded [page:Object3D object].<br />
+		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 />
+		onError — Will be called when load errors.<br />
+		</div>
 		<div>
 		<div>
-		todo
-		</div> 
+		Begin loading from url and call onLoad with the parsed response content.
+		</div>
 
 
 
 
-		<h2>Methods</h2>
-		
+		<h3>.parse( [page:String json] )</h3>
+		<div>
+		json — required. The JSON source to parse<br />
+		</div>
+		<div>
+		Parses a JSON content and return a threejs object.
+		</div>
 
 
-		<h3>todo</h3>
-		<div>todo</div>
+		<h3>.setCrossOrigin([page:String value]</h3>
 		<div>
 		<div>
-		todo
+		value — The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
 		</div>
 		</div>
-		
+
+
+		<h2>Example</h2>
+
+		<a target="_parent" href="http://threejs.org/examples/#webgl_loader_msgpack">webgl_loader_msgpack</a>
+
+
 		<h2>Source</h2>
 		<h2>Source</h2>
 
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]

+ 17 - 57
docs/api/loaders/TextureLoader.html

@@ -10,35 +10,19 @@
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
 		<div class="desc">Class for loading a [page:Texture texture].</div>
 		<div class="desc">Class for loading a [page:Texture texture].</div>
-		<div class="desc">Unlike other loaders, this one emits events instead of using predefined callbacks. So if you're interested in getting notified when <em>things</em> happen, you need to add listeners to the object.</div>
-
-		<h2>Constructor</h2>
 
 
 
 
-		<h3>[name]()</h3>
-		<div>
-		todo
-		</div>
-
+		<h2>Constructor</h2>
 
 
-		<h2>Events</h2>
-		
-		<h3>load</h3>
-		<div class="desc">
-		Dispatched when the texture has completed loading
-		</div>
+		<h3>[name]([page:LoadingManager manager])</h3>
 		<div>
 		<div>
-		content — loaded texture object
-		</div>
-		
-		<h3>error</h3>
-		<div class="desc">
-		Dispatched when the texture can't be loaded
+		manager — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
 		</div>
 		</div>
 		<div>
 		<div>
-		message — error message
+		Creates a new [name].
 		</div>
 		</div>
-		
+
+
 		<h2>Properties</h2>
 		<h2>Properties</h2>
 
 
 		<h3>.[page:todo crossOrigin]</h3>
 		<h3>.[page:todo crossOrigin]</h3>
@@ -46,50 +30,26 @@
 		default — *null*.<br />
 		default — *null*.<br />
 		If set, assigns the *crossOrigin* attribute of the image to the value of *crossOrigin*, prior to starting the load.
 		If set, assigns the *crossOrigin* attribute of the image to the value of *crossOrigin*, prior to starting the load.
 		</div>
 		</div>
-		
-		<h2>Methods</h2>
 
 
-		<h3>.load( [page:String url] )</h3>
-		<div>
-		url — required
-		</div>
-		
-		<div class="desc">Begin loading from <em>url</em></div>
 
 
-		<h3>.dispatchEvent([page:todo event]) [page:todo]</h3>
-		<div>
-		event -- todo
-		</div>
-		<div>
-		todo
-		</div>
+		<h2>Methods</h2>
 
 
-		<h3>.hasEventListener([page:todo type], [page:todo listener]) [page:todo]</h3>
+		<h3>.load( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )</h3>
 		<div>
 		<div>
-		type -- todo <br />
-		listener -- todo
+		url — required<br />
+		onLoad — Will be called when load completes. The argument will be the loaded text response.<br />
+		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 />
+		onError — Will be called when load errors.<br />
 		</div>
 		</div>
 		<div>
 		<div>
-		todo
+		Begin loading from url and pass the loaded [page:Texture texture] to onLoad.
 		</div>
 		</div>
 
 
-		<h3>.removeEventListener([page:todo type], [page:todo listener]) [page:todo]</h3>
-		<div>
-		type -- todo <br />
-		listener -- todo
-		</div>
-		<div>
-		todo
-		</div>
 
 
-		<h3>.addEventListener([page:todo type], [page:todo listener]) [page:todo]</h3>
-		<div>
-		type -- todo <br />
-		listener -- todo
-		</div>
-		<div>
-		todo
-		</div>
+		<h2>Example</h2>
+
+		<a target="_parent" href="http://threejs.org/examples/#canvas_geometry_earth">canvas_geometry_earth</a>
+
 
 
 		<h2>Source</h2>
 		<h2>Source</h2>
 
 

+ 58 - 52
docs/api/loaders/XHRLoader.html

@@ -1,72 +1,78 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
-    <head>
-        <meta charset="utf-8" />
-        <script src="../../list.js"></script>
-        <script src="../../page.js"></script>
-        <link type="text/css" rel="stylesheet" href="../../page.css" />
-    </head>
-    <body>
+	<head>
+		<meta charset="utf-8" />
+		<script src="../../list.js"></script>
+		<script src="../../page.js"></script>
+		<link type="text/css" rel="stylesheet" href="../../page.css" />
+	</head>
+	<body>
 
 
-        <h1>[name]</h1>
+		<h1>[name]</h1>
 
 
-        <div class="desc">A low level class for loading resources with XmlHttpRequest.</div>
+		<div class="desc">A low level class for loading resources with XmlHttpRequest.</div>
 
 
 
 
-        <h2>Constructor</h2>
+		<h2>Constructor</h2>
 
 
-        <h3>[name]([page:LoadingManager manager])</h3>
-        <div>
-        manager — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
-        </div>
-        <div>
-        Creates a new [name].
-        </div>
+		<h3>[name]([page:LoadingManager manager])</h3>
+		<div>
+		manager — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
+		</div>
+		<div>
+		Creates a new [name].
+		</div>
 
 
 
 
-        <h2>Properties</h2>
+		<h2>Properties</h2>
 
 
-        <h3>.[page:Cache cache]</h3>
-        <div>
-        A [page:Cache cache] instance that hold the response from each request made through this loader, so each file is requested once.
-        </div>
+		<h3>.[page:Cache cache]</h3>
+		<div>
+		A [page:Cache cache] instance that hold the response from each request made through this loader, so each file is requested once.
+		</div>
 
 
-        <h3>.[page:string crossOrigin]</h3>
-        <div>
-        The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
-        </div>
+		<h3>.[page:string crossOrigin]</h3>
+		<div>
+		The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
+		</div>
 
 
-        <h3>.[page:string responseType]</h3>
-        <div>
-        Can be set to change the response type.
-        </div>
+		<h3>.[page:string responseType]</h3>
+		<div>
+		Can be set to change the response type.
+		</div>
 
 
 
 
-        <h2>Methods</h2>
+		<h2>Methods</h2>
 
 
-        <h3>.load( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )</h3>
-        <div>
-        url — required<br />
-        onLoad — Will be called when load completes. The argument will be the loaded text response.<br />
-        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 />
-        onError — Will be called when load errors.<br />
-        </div>
-        <div>
-        Begin loading from url and return the [page:String text] response that will contain the data.
-        </div>
+		<h3>.load( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )</h3>
+		<div>
+		url — required<br />
+		onLoad — Will be called when load completes. The argument will be the loaded text response.<br />
+		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 />
+		onError — Will be called when load errors.<br />
+		</div>
+		<div>
+		Begin loading from url and return the [page:String text] response that will contain the data.
+		</div>
 
 
-        <h3>.setCrossOrigin([page:String value]</h3>
-        <div>
-        value — The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
-        </div>
+		<h3>.setCrossOrigin([page:String value]</h3>
+		<div>
+		value — The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
+		</div>
 
 
-        <h3>.setResponseType([page:String value]</h3>
-        <div>
-        value — the empty string (default), "arraybuffer", "blob", "document", "json", or "text".
-        </div>
+		<h3>.setResponseType([page:String value]</h3>
+		<div>
+		value — the empty string (default), "arraybuffer", "blob", "document", "json", or "text".
+		</div>
 
 
-        <h2>Source</h2>
 
 
-        [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
-    </body>
+		<h2>Example</h2>
+
+		<a target="_parent" href="http://threejs.org/examples/#webgl_morphtargets_human">webgl_morphtargets_human</a>
+
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
 </html>
 </html>