Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 34 additions & 7 deletions docs/examples/loaders/LoaderSupport.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ <h2>Methods</h2>

<h3>[method:null validate] ( [page:Function functionCodeBuilder], Array of [page:String libLocations], [page:String libPath], [page:LoaderSupport.WorkerRunnerRefImpl runnerImpl] )</h3>
<div>
[page:Function functionCodeBuilder] - Function that is invoked with funcBuildObject and funcBuildSingelton that allows stringification of objects and singletons.<br>
[page:Function functionCodeBuilder] - Function that is invoked with funcBuildObject and funcBuildSingleton that allows stringification of objects and singletons.<br>
Array of [page:String libLocations] - URL of libraries that shall be added to worker code relative to libPath.<br>
[page:String libPath] - Base path used for loading libraries.<br>
[page:LoaderSupport.WorkerRunnerRefImpl runnerImpl] - The default worker parser wrapper implementation (communication and execution). An extended class could be passed here.
Expand Down Expand Up @@ -405,12 +405,35 @@ <h3>LoaderBase( [page:LoadingManager manager], [page:LoaderSupport.ConsoleLogger
[page:LoaderSupport.ConsoleLogger logger] - logger to be used
</div>
<div>
Base class to be used by loaders.
Base class to be used by Loaders that provide load, parse, parseAsync and run
</div>


<h2>Methods</h2>


<h3>[method:null load]( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError], [page:Function onMeshAlter], [page:boolean useAsync] )</h3>
<div>
[page:String url] - A string containing the path/URL of the file to be loaded.<br>
[page:Function onLoad] - A function to be called after loading is successfully completed. The function receives loaded [page:Object3D] as an argument.<br>
[page:Function onProgress] - (optional) A function to be called while the loading is in progress. The argument will be the XMLHttpRequest instance, which contains [page:Integer total] and [page:Integer loaded] bytes.<br>
[page:Function onError] - (optional) A function to be called if an error occurs during loading. The function receives the error as an argument.<br>
[page:Function onMeshAlter] - (optional) A function to be called after a new mesh raw data becomes available for alteration.<br>
[page:boolean useAsync] - (optional) If true, uses async loading with worker, if false loads data synchronously.
</div>
<div>
Use this convenient method to load a file at the given URL. By default the fileLoader uses an ArrayBuffer.
</div>

<h3>[method:ConsoleLogger checkResourceDescriptorFiles] ( [page:THREE.LoaderSupport.ResourceDescriptor resources], [page:Object fileDesc] )</h3>
<div>
[page:THREE.LoaderSupport.ResourceDescriptor resources] - Array of {@link THREE.LoaderSupport.ResourceDescriptor}
[page:Object fileDesc] - Object describing which resources are of interest (ext, type (string or UInt8Array) and ignore (boolean))
</div>
<div>
Identify files or content of interest from an Array of {@link THREE.LoaderSupport.ResourceDescriptor}. Returns Object with each "ext" and the corresponding {@link THREE.LoaderSupport.ResourceDescriptor}
</div>


<h3>[method:ConsoleLogger getLogger] ()</h3>
<div>
Returns [page:LoaderSupport.ConsoleLogger].
Expand Down Expand Up @@ -608,36 +631,40 @@ <h3>[method:Boolean isEnabled]()</h3>
</div>


<h3>[method:null logDebug]( [page:String message] )</h3>
<h3>[method:null logDebug]( [page:String message], Array of [page:String additional] )</h3>
<div>
[page:String message] - Message to log
Array of [page:String additional] - Array of [page:String strings] containing additional content to be logged
</div>
<div>
Log a debug message if enabled and debug is set.
</div>


<h3>[method:null logInfo]( [page:String message] )</h3>
<h3>[method:null logInfo]( [page:String message], Array of [page:String additional] )</h3>
<div>
[page:String message] - Message to log
Array of [page:String additional] - Array of [page:String strings] containing additional content to be logged
</div>
<div>
Log an info message if enabled.
</div>


<h3>[method:null logWarn]( [page:String message] )</h3>
<h3>[method:null logWarn]( [page:String message], Array of [page:String additional] )</h3>
<div>
[page:String message] - Message to log
Array of [page:String additional] - Array of [page:String strings] containing additional content to be logged
</div>
<div>
Log a warn message (always).
</div>


<h3>[method:null logError]( [page:String message] )</h3>
<h3>[method:null logError]( [page:String message], Array of [page:String additional] )</h3>
<div>
[page:String message] - Message to log
Array of [page:String additional] - Array of [page:String strings] containing additional content to be logged
</div>
<div>
Log an error message (always).
Expand Down
38 changes: 22 additions & 16 deletions docs/examples/loaders/OBJLoader2.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<h1>[name]</h1>

<div class="desc">A loader for loading a <em>.obj</em> resource. <br />
<div class="desc">A loader for loading a <em>.obj</em> resource.<br />
The <a href="https://en.wikipedia.org/wiki/Wavefront_.obj_file">OBJ file format</a> is a simple data-format
that represents 3D geometry in a human redeable format as, the position of each vertex, the UV position of
each texture coordinate vertex, vertex normals, and the faces that make each polygon defined as a list of
Expand Down Expand Up @@ -42,7 +42,7 @@ <h2>Constructor</h2>

<h3>[name]( [page:LoadingManager manager], [page:LoaderSupport.ConsoleLogger logger] )</h3>
<div>
[page:LoadingManager manager] - The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
[page:LoadingManager manager] - The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].<br>
[page:LoaderSupport.ConsoleLogger logger] - logger to be used
</div>
<div>
Expand Down Expand Up @@ -71,19 +71,8 @@ <h3>[method:Object3D parseAsync]( [page:arraybuffer content], [page:Function onL
</div>


<h3>[method:null load]( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError], [page:Function onMeshAlter], [page:boolean useAsync] )</h3>
<div>
[page:String url] - A string containing the path/URL of the <em>.obj</em> file.<br>
[page:Function onLoad] - A function to be called after loading is successfully completed. The function receives loaded [page:Object3D] as an argument.<br>
[page:Function onProgress] - (optional) A function to be called while the loading is in progress. The argument will be the XMLHttpRequest instance, which contains [page:Integer total] and [page:Integer loaded] bytes.<br>
[page:Function onError] - (optional) A function to be called if an error occurs during loading. The function receives the error as an argument.<br>
[page:Function onMeshAlter] - (optional) A function to be called after a new mesh raw data becomes available for alteration.<br>
[page:boolean useAsync] - (optional) If true, uses async loading with worker, if false loads data synchronously.
</div>
<div>
Use this convenient method to load an OBJ file at the given URL. By default the fileLoader uses an arraybuffer.
</div>

<h3>[method:null load] => [page:LoaderSupport.LoaderBase.load]</h3>


<h3>[method:null run]( [page:LoaderSupport.PrepData params], [page:LoaderSupport.WorkerSupport workerSupportExternal] )</h3>
<div>
Expand All @@ -94,7 +83,10 @@ <h3>[method:null run]( [page:LoaderSupport.PrepData params], [page:LoaderSupport
Run the loader according the provided instructions.
</div>



<h3>[method:Object checkResourceDescriptorFiles] => [page:LoaderSupport.LoaderBase.checkResourceDescriptorFiles]</h3>


<h3>[method:null setMaterialPerSmoothingGroup] ( [page:boolean materialPerSmoothingGroup] )</h3>
<div>
[page:boolean materialPerSmoothingGroup]
Expand Down Expand Up @@ -164,7 +156,21 @@ <h3>[method:null setDisregardNormals]( [page:Boolean disregardNormals] )</h3>
<div>
Tells whether normals should be completely disregarded and regenerated.
</div>


<h3>[method:null loadMtl]( [page:String url], [page:Object content], [page:Function callbackOnLoad], [page:String crossOrigin], [page:Object materialOptions]) </h3>
<div>
[page:String url] - URL to the file
[page:Object content] - The file content as arraybuffer or text
[page:Function callbackOnLoad] - Callback to be called after successful load
[page:String crossOrigin] - (optional) CORS value
[page:Function materialOptions] - (optional) Set material loading options for MTLLoader
</div>
<div>
Utility method for loading an mtl file according resource description. Provide url or content..
</div>


<h2>Source</h2>

[link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/OBJLoader2.js examples/js/loaders/OBJLoader2.js]
Expand Down
Loading