|
@@ -19,11 +19,10 @@
|
|
|
[page:LoaderSupport.WorkerSupport]<br>
|
|
|
[page:LoaderSupport.WorkerRunnerRefImpl]<br>
|
|
|
[page:LoaderSupport.WorkerDirector]<br>
|
|
|
+ [page:LoaderSupport.ResourceDescriptor]<br>
|
|
|
[page:LoaderSupport.PrepData]<br>
|
|
|
- [page:LoaderSupport.LoaderBase]<br>
|
|
|
[page:LoaderSupport.Callbacks]<br>
|
|
|
[page:LoaderSupport.Validator]<br>
|
|
|
- [page:LoaderSupport.ConsoleLogger]
|
|
|
|
|
|
|
|
|
<h2>Example</h2>
|
|
@@ -45,6 +44,22 @@
|
|
|
|
|
|
<h2>Methods</h2>
|
|
|
|
|
|
+ <h3>[method:null setLogging] ( [param:Boolean enabled], [param:Boolean debug] )</h3>
|
|
|
+ <div>
|
|
|
+ [page:Boolean enabled] True or false.<br>
|
|
|
+ [page:Boolean debug] True or false.
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ Enable or disable logging in general (except warn and error), plus enable or disable debug logging.
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ <h3>[method:null init] ()</h3>
|
|
|
+ <div>
|
|
|
+ Initializes the Builder (currently only default material initialisation).
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
<h3>[method:null setMaterials] ( Array of [param:Material materials] )</h3>
|
|
|
<div>
|
|
|
Array of [page:Material materials] - Array of [page:Material Materials]
|
|
@@ -61,8 +76,6 @@
|
|
|
<div>
|
|
|
Delegates processing of the payload (mesh building or material update) to the corresponding functions (BW-compatibility).
|
|
|
</div>
|
|
|
- <br>
|
|
|
- <br>
|
|
|
|
|
|
|
|
|
<h3>[method:Array buildMeshes] ( Object meshPayload )</h3>
|
|
@@ -72,8 +85,6 @@
|
|
|
<div>
|
|
|
Builds one or multiple meshes from the data described in the payload (buffers, params, material info).
|
|
|
</div>
|
|
|
- <br>
|
|
|
- <br>
|
|
|
|
|
|
|
|
|
<h3>[method:null updateMaterials] ( Object materialPayload )</h3>
|
|
@@ -83,16 +94,12 @@
|
|
|
<div>
|
|
|
Updates the materials with contained material objects (sync) or from alteration instructions (async).
|
|
|
</div>
|
|
|
- <br>
|
|
|
- <br>
|
|
|
|
|
|
|
|
|
<h3>[method:Object getMaterialsJSON] ()</h3>
|
|
|
<div>
|
|
|
Returns the mapping object of material name and corresponding jsonified material.
|
|
|
</div>
|
|
|
- <br>
|
|
|
- <br>
|
|
|
|
|
|
|
|
|
<h3>[method:Object getMaterials] ()</h3>
|
|
@@ -144,10 +151,7 @@
|
|
|
<a name="WorkerSupport"></a><h1>WorkerSupport</h1>
|
|
|
<h2>Constructor</h2>
|
|
|
|
|
|
- <h3>WorkerSupport( [param:LoaderSupport.ConsoleLogger logger] )</h3>
|
|
|
- <div>
|
|
|
- [page:LoaderSupport.ConsoleLogger logger] - logger to be used
|
|
|
- </div>
|
|
|
+ <h3>WorkerSupport()</h3>
|
|
|
<div>
|
|
|
This class provides means to transform existing parser code into a web worker.
|
|
|
It defines a simple communication protocol which allows to configure the worker and receive raw mesh data during execution.
|
|
@@ -156,6 +160,25 @@
|
|
|
|
|
|
<h2>Methods</h2>
|
|
|
|
|
|
+ <h3>[method:null setLogging]( [param:Boolean enabled], [param:Boolean debug] )</h3>
|
|
|
+ <div>
|
|
|
+ [page:Boolean enabled] True or false.<br>
|
|
|
+ [page:Boolean debug] True or false.
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ Enable or disable logging in general (except warn and error), plus enable or disable debug logging.
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ <h3>[method:null setForceWorkerDataCopy]( [param:Boolean forceWorkerDataCopy] )</h3>
|
|
|
+ <div>
|
|
|
+ [page:Boolean forceWorkerDataCopy] True or false.
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ Forces all ArrayBuffers to be transferred to worker to be copied.
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
<h3>[method:null validate] ( [param:Function functionCodeBuilder], Array of [param:String libLocations], [param:String libPath], [param:LoaderSupport.WorkerRunnerRefImpl runnerImpl] )</h3>
|
|
|
<div>
|
|
|
[page:Function functionCodeBuilder] - Function that is invoked with funcBuildObject and funcBuildSingleton that allows stringification of objects and singletons.<br>
|
|
@@ -233,10 +256,9 @@
|
|
|
<a name="WorkerDirector"></a><h1>WorkerDirector</h1>
|
|
|
<h2>Constructor</h2>
|
|
|
|
|
|
- <h3>WorkerDirector( [param:String classDef], [param:LoaderSupport.ConsoleLogger logger] )</h3>
|
|
|
+ <h3>WorkerDirector( [param:String classDef] )</h3>
|
|
|
<div>
|
|
|
- [page:String classDef] - Class definition to be used for construction<br>
|
|
|
- [page:LoaderSupport.ConsoleLogger logger] - logger to be used
|
|
|
+ [page:String classDef] - Class definition to be used for construction
|
|
|
</div>
|
|
|
<div>
|
|
|
Orchestrate loading of multiple OBJ files/data from an instruction queue with a configurable amount of workers (1-16).<br>
|
|
@@ -250,6 +272,25 @@
|
|
|
|
|
|
<h2>Methods</h2>
|
|
|
|
|
|
+ <h3>[method:null setLogging]( [param:Boolean enabled], [param:Boolean debug] )</h3>
|
|
|
+ <div>
|
|
|
+ [page:Boolean enabled] True or false.<br>
|
|
|
+ [page:Boolean debug] True or false.
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ Enable or disable logging in general (except warn and error), plus enable or disable debug logging.
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ <h3>[method:null setForceWorkerDataCopy]( [param:Boolean forceWorkerDataCopy] )</h3>
|
|
|
+ <div>
|
|
|
+ [page:Boolean forceWorkerDataCopy] True or false.
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ Forces all ArrayBuffers to be transferred to worker to be copied.
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
<h3>[method:null prepareWorkers]( [param:WWOBJLoader2.Callbacks globalCallbacks], [param:Number maxQueueSize], [param:Number maxWebWorkers] )</h3>
|
|
|
<div>
|
|
|
[page:LoaderSupport.Callbacks globalCallbacks] - Register global callbacks used by all web workers<br>
|
|
@@ -309,199 +350,88 @@
|
|
|
<div>
|
|
|
Sets the CORS string to be used.
|
|
|
</div>
|
|
|
+ <br>
|
|
|
+ <br>
|
|
|
|
|
|
|
|
|
- <a name="PrepData"></a><h1>PrepData</h1>
|
|
|
+ <a name="ResourceDescriptor"></a><h1>ResourceDescriptor</h1>
|
|
|
<h2>Constructor</h2>
|
|
|
|
|
|
- <h3>PrepData( [param:String modelName] )</h3>
|
|
|
+ <h3>ResourceDescriptor( [param:String url], [param:String extension] )</h3>
|
|
|
<div>
|
|
|
- [page:String modelName] - Overall name of the model
|
|
|
+ [page:String url] - URL to the file<br>
|
|
|
+ [page:String extension] - The file extension (type)
|
|
|
</div>
|
|
|
<div>
|
|
|
- Configuration instructions to be used by run method.
|
|
|
+ A resource description used by [page:LoaderSupport.PrepData] and others.
|
|
|
</div>
|
|
|
|
|
|
-
|
|
|
<h2>Methods</h2>
|
|
|
|
|
|
- <h3>[method:null setStreamMeshesTo] ( [param:Object3D streamMeshesTo] )</h3>
|
|
|
- <div>
|
|
|
- [page:Object3D streamMeshesTo] - Object already attached to scenegraph where new meshes will be attached to
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- Set the node where the loaded objects will be attached directly.
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
- <h3>[method:null setMaterialPerSmoothingGroup] ( [param:boolean materialPerSmoothingGroup] )</h3>
|
|
|
- <div>
|
|
|
- [page:boolean materialPerSmoothingGroup]
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- Tells whether a material shall be created per smoothing group.
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
- <h3>[method:null setUseIndices]( [param:Boolean useIndices] )</h3>
|
|
|
- <div>
|
|
|
- [page:Boolean useIndices] - Default is false
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- Instructs loaders to create indexed [page:BufferGeometry].
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
- <h3>[method:null setDisregardNormals]( [param:Boolean disregardNormals] )</h3>
|
|
|
- <div>
|
|
|
- [page:Boolean disregardNormals]
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- Tells whether normals should be completely disregarded and regenerated.
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
- <h3>[method:Callbacks getCallbacks]()</h3>
|
|
|
- <div>
|
|
|
- Returns all callbacks as [page:LoaderSupport.Callbacks].
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
- <h3>[method:null setCrossOrigin]( [param:String crossOrigin] )</h3>
|
|
|
- <div>
|
|
|
- [page:String crossOrigin] - CORS value
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- Sets the CORS string to be used.
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
- <h3>[method:null addResource]( [param:LoaderSupport.ResourceDescriptor resource] )</h3>
|
|
|
- <div>
|
|
|
- [page:LoaderSupport.ResourceDescriptor resource]
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- Add a resource description.
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
- <h3>[method:null setUseAsync]( [param:Boolean useAsync] )</h3>
|
|
|
+ <h3>[method:null setContent]( [param:Object content )</h3>
|
|
|
<div>
|
|
|
- [page:Boolean useAsync]
|
|
|
+ [page:Object content] - The file content as ArrayBuffer or text
|
|
|
</div>
|
|
|
<div>
|
|
|
- If true uses async loading with worker, if false loads data synchronously.
|
|
|
+ Set the content of this resource
|
|
|
</div>
|
|
|
<br>
|
|
|
<br>
|
|
|
|
|
|
|
|
|
- <a name="LoaderBase"></a><h1>LoaderBase</h1>
|
|
|
+ <a name="PrepData"></a><h1>PrepData</h1>
|
|
|
<h2>Constructor</h2>
|
|
|
|
|
|
- <h3>LoaderBase( [param:LoadingManager manager], [param:LoaderSupport.ConsoleLogger logger] )</h3>
|
|
|
+ <h3>PrepData( [param:String modelName] )</h3>
|
|
|
<div>
|
|
|
- [page:LoadingManager manager] - The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
|
|
|
- [page:LoaderSupport.ConsoleLogger logger] - logger to be used
|
|
|
+ [page:String modelName] - Overall name of the model
|
|
|
</div>
|
|
|
<div>
|
|
|
- Base class to be used by Loaders that provide load, parse, parseAsync and run
|
|
|
+ Configuration instructions to be used by run method.
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<h2>Methods</h2>
|
|
|
|
|
|
- <h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError], [param:Function onMeshAlter], [param:boolean useAsync] )</h3>
|
|
|
+ <h3>[method:null setLogging]( [param:Boolean enabled], [param:Boolean debug] )</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.
|
|
|
+ [page:Boolean enabled] True or false.<br>
|
|
|
+ [page:Boolean debug] True or false.
|
|
|
</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] ( [param:THREE.LoaderSupport.ResourceDescriptor resources], [param: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].
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
- <h3>[method:null setModelName] ( [param:String modelName] )</h3>
|
|
|
- <div>
|
|
|
- [page:String modelName]
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- Set the name of the model.
|
|
|
+ Enable or disable logging in general (except warn and error), plus enable or disable debug logging.
|
|
|
</div>
|
|
|
|
|
|
|
|
|
- <h3>[method:null setPath] ( [param:String path] )</h3>
|
|
|
- <div>
|
|
|
- [page:String path] - URL
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- The URL of the base path.
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
- <h3>[method:null setStreamMeshesTo] ( [param:Object3D streamMeshesTo] )</h3>
|
|
|
- <div>
|
|
|
- [page:Object3D streamMeshesTo] - Object already attached to scenegraph where new meshes will be attached to
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- Set the node where the loaded objects will be attached directly.
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
- <h3>[method:null setMaterials] ( Array of [param:Material materials] )</h3>
|
|
|
- <div>
|
|
|
- Array of [page:Material materials] - Array of [page:Material Materials]
|
|
|
- </div>
|
|
|
+ <h3>[method:Callbacks getCallbacks]()</h3>
|
|
|
<div>
|
|
|
- Set materials loaded by MTLLoader or any other supplier of an Array of [page:Material Materials].
|
|
|
+ Returns all callbacks as [page:LoaderSupport.Callbacks].
|
|
|
</div>
|
|
|
|
|
|
|
|
|
- <h3>[method:null setUseIndices]( [param:Boolean useIndices] )</h3>
|
|
|
+ <h3>[method:null addResource]( [param:LoaderSupport.ResourceDescriptor resource] )</h3>
|
|
|
<div>
|
|
|
- [page:Boolean useIndices]
|
|
|
+ [page:LoaderSupport.ResourceDescriptor resource] Adds a [page:LoaderSupport.ResourceDescriptor]
|
|
|
</div>
|
|
|
<div>
|
|
|
- Instructs loaders to create indexed [page:BufferGeometry].
|
|
|
+ Add a resource description.
|
|
|
</div>
|
|
|
|
|
|
|
|
|
- <h3>[method:null setDisregardNormals]( [param:Boolean disregardNormals] )</h3>
|
|
|
+ <h3>[method:null checkResourceDescriptorFiles] ( [param:LoaderSupport.ResourceDescriptor resources], [param:Object fileDesc] )</h3>
|
|
|
<div>
|
|
|
- [page:Boolean disregardNormals]
|
|
|
+ [page:LoaderSupport.ResourceDescriptor resources] - Array of [page:LoaderSupport.ResourceDescriptor]<br>
|
|
|
+ [page:Object fileDesc] - Object describing which resources are of interest (ext, type (string or UInt8Array) and ignore (boolean))
|
|
|
</div>
|
|
|
<div>
|
|
|
- Tells whether normals should be completely disregarded and regenerated.
|
|
|
+ Identify files or content of interest from an Array of [page:LoaderSupport.ResourceDescriptor].
|
|
|
+ Returns Object with each "ext" and the corresponding [page:LoaderSupport.ResourceDescriptor]
|
|
|
</div>
|
|
|
|
|
|
|
|
|
- <h3>[method:null onProgress]( [param:String type], [param:String text], [param:Number numericalValue] )</h3>
|
|
|
- <div>
|
|
|
- [page:String type] - The type of event<br>
|
|
|
- [page:String text] - Textual description of the event<br>
|
|
|
- [page:Number numericalValue] - Numerical value describing the progress
|
|
|
- </div>
|
|
|
+ <h3>[method:PrepData clone] ()</h3>
|
|
|
<div>
|
|
|
- Announce feedback which is give to the registered [page:LoaderSupport.Callbacks].
|
|
|
+ Clones this object and returns it afterwards. Callbacks and resources are not cloned deep (references!).
|
|
|
</div>
|
|
|
<br>
|
|
|
<br>
|
|
@@ -578,7 +508,7 @@
|
|
|
|
|
|
<h3>[method:null verifyInput]( [param:Object input], [param:Object defaultValue] )</h3>
|
|
|
<div>
|
|
|
- [page:Object input] - Can be anything
|
|
|
+ [page:Object input] - Can be anything<br>
|
|
|
[page:Object defaultValue] - Can be anything
|
|
|
</div>
|
|
|
<div>
|
|
@@ -587,109 +517,6 @@
|
|
|
<br>
|
|
|
<br>
|
|
|
|
|
|
-
|
|
|
- <a name="ConsoleLogger"></a><h1>ConsoleLogger</h1>
|
|
|
- <h2>Constructor</h2>
|
|
|
-
|
|
|
- <h3>ConsoleLogger( [param:Boolean enabled], [param:Boolean debug] )</h3>
|
|
|
- <div>
|
|
|
- [page:Boolean enabled] - Tell if logger is enabled.
|
|
|
- [page:Boolean debug] - Toggle debug logging.
|
|
|
- <div>
|
|
|
- Logging wrapper for console.
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
- <h2>Methods</h2>
|
|
|
-
|
|
|
- <h3>[method:null setDebug]( [param:Boolean debug] )</h3>
|
|
|
- <div>
|
|
|
- [page:Boolean debug] - True or False
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- Enable or disable debug logging.
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
- <h3>[method:Boolean isDebug]()</h3>
|
|
|
- <div>
|
|
|
- Returns if is enabled and debug.
|
|
|
- </div>
|
|
|
-
|
|
|
- <h3>[method:null setEnabled]( [param:Boolean enabled] )</h3>
|
|
|
- <div>
|
|
|
- [page:Boolean enabled] - True or False
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- Enable or disable info, debug and time logging.
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
- <h3>[method:Boolean isEnabled]()</h3>
|
|
|
- <div>
|
|
|
- Returns if is enabled.
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
- <h3>[method:null logDebug]( [param:String message], Array of [param: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]( [param:String message], Array of [param: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]( [param:String message], Array of [param: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]( [param:String message], Array of [param: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).
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
- <h3>[method:null logTimeStart]( [param:String id] )</h3>
|
|
|
- <div>
|
|
|
- [page:String id] - Time identification
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- Start time measurement with provided id.
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
- <h3>[method:null logTimeEnd]( [param:String id] )</h3>
|
|
|
- <div>
|
|
|
- [page:String id] - Time identification
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- Stop time measurement started with provided id.
|
|
|
- </div>
|
|
|
- <br>
|
|
|
- <br>
|
|
|
-
|
|
|
<h2>Source</h2>
|
|
|
|
|
|
[link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/LoaderSupport.js examples/js/loaders/LoaderSupport.js]
|