Class ModelLoader
Defined in: ModelLoader.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
ModelLoader(modelExtension)
Creates an instance of a model loader.
|
| Method Attributes | Method Name and Description |
|---|---|
|
clear()
Clears the list of 3D models waiting to be parsed by this loader.
|
|
|
getModelContent(modelEntry)
Returns the content of the model stored in the given entry.
|
|
|
load(url, synchronous, loadingModelObserver)
Loads the 3D model from the given URL.
|
|
|
parseDependencies(modelContent, modelEntryName, zip, modelContext)
Parses the dependencies of the model content if any and returns the materials it describes.
|
|
|
parseEntryScene(modelContent, modelEntryName, zip, modelContext, onmodelloaded, onprogression)
Parses the given model content and calls onmodelloaded asynchronously or
returns the scene it describes if onmodelloaded is null.
|
Class Detail
ModelLoader(modelExtension)
Creates an instance of a model loader.
Author: Emmanuel Puybaret.
Author: Emmanuel Puybaret.
- Parameters:
- {string} modelExtension
Method Detail
clear()
Clears the list of 3D models waiting to be parsed by this loader.
getModelContent(modelEntry)
Returns the content of the model stored in the given entry.
- Parameters:
- modelEntry
load(url, synchronous, loadingModelObserver)
Loads the 3D model from the given URL. This method is reentrant when run asynchronously.
- Parameters:
- {string} url
- The URL of a zip file containing an entry with the extension given in constructor that will be loaded or an URL noted as jar:url!/modelEntry where modelEntry will be loaded.
- {boolean} synchronous Optional
- optional parameter equal to false by default
- {{modelLoaded|modelError|progression}} loadingModelObserver
- the observer containing
modelLoaded(model),modelError(error),progression(part, info, percentage)methods that will be called at various phases, withmodelbeing an instance ofNode3D,error,part,infostrings andpercentagea number.
parseDependencies(modelContent, modelEntryName, zip, modelContext)
Parses the dependencies of the model content if any and returns the materials it describes.
- Parameters:
- modelContent
- modelEntryName
- zip
- modelContext
parseEntryScene(modelContent, modelEntryName, zip, modelContext, onmodelloaded, onprogression)
Parses the given model content and calls onmodelloaded asynchronously or
returns the scene it describes if onmodelloaded is null.
- Parameters:
- modelContent
- modelEntryName
- zip
- modelContext
- onmodelloaded
- onprogression
