Class: AssetImporter
Core-API.AssetImporter
Hierarchy
SimpleEventDispatcher
<AssetImportEventTypes
>↳
AssetImporter
Implements
Accessors
cachedAssets
• get
cachedAssets(): IAsset
[]
Returns
IAsset
[]
processors
• get
processors(): ObjectProcessorMap
<TAssetTypes
>
Returns
ObjectProcessorMap
<TAssetTypes
>
Implementation of
loadingManager
• get
loadingManager(): LoadingManager
Returns
LoadingManager
Implementation of
Properties
Importers
• Readonly
Importers: IImporter
[]
Constructors
constructor
• new AssetImporter(viewer
, logging?
)
Parameters
Name | Type | Default value |
---|---|---|
viewer | ViewerApp | undefined |
logging | boolean | false |
Overrides
SimpleEventDispatcher<AssetImportEventTypes\>.constructor
Methods
addEventListener
▸ addEventListener(type
, listener
): void
Parameters
Name | Type |
---|---|
type | AssetImportEventTypes |
listener | (event : IEvent <AssetImportEventTypes >) => void |
Returns
void
Implementation of
IAssetImporter.addEventListener
Overrides
SimpleEventDispatcher.addEventListener
importFiles
▸ importFiles(files
, options?
): Promise
<Map
<string
, ISceneObject
<any
>[]>>
Parameters
Name | Type |
---|---|
files | Map <string , IFile > |
options | ImportFilesOptions |
Returns
Promise
<Map
<string
, ISceneObject
<any
>[]>>
Implementation of
registerFile
▸ registerFile(path
, file?
): undefined
| ILoader
<any
, any
>
Parameters
Name | Type |
---|---|
path | string |
file? | IFile |
Returns
undefined
| ILoader
<any
, any
>
Implementation of
unregisterFile
▸ unregisterFile(path
): void
Parameters
Name | Type |
---|---|
path | string |
Returns
void
Implementation of
resolveURL
▸ resolveURL(url
): string
Parameters
Name | Type |
---|---|
url | string |
Returns
string
importAsset
▸ importAsset(asset?
, options?
, onDownloadProgress?
): Promise
<ISceneObject
<any
>[]>
Returns the object or undefined
Parameters
Name | Type |
---|---|
asset? | IAsset |
options | ImportAssetOptions |
onDownloadProgress? | (e : ProgressEvent <EventTarget >) => void |
Returns
Promise
<ISceneObject
<any
>[]>
Implementation of
importSingle
▸ importSingle<T
>(asset?
, options?
): Promise
<undefined
| T
>
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
asset? | string | IAsset |
options | ImportAssetOptions |
Returns
Promise
<undefined
| T
>
Implementation of
importSinglePath
▸ importSinglePath<T
>(path
, options?
): Promise
<undefined
| T
>
Type parameters
Name | Type |
---|---|
T | extends ISceneObject <any > |
Parameters
Name | Type |
---|---|
path | string |
options? | ImportAssetOptions |
Returns
Promise
<undefined
| T
>
importPath
▸ importPath(path
, options?
): Promise
<ISceneObject
<any
>[]>
Parameters
Name | Type |
---|---|
path | string |
options | ImportAssetOptions |
Returns
Promise
<ISceneObject
<any
>[]>
Implementation of
processImportedSingle
▸ processImportedSingle<T
>(res
, options?
): Promise
<T
>
Type parameters
Name | Type |
---|---|
T | extends ISceneObject <any > |
Parameters
Name | Type |
---|---|
res | any |
options | ProcessImportedOptions |
Returns
Promise
<T
>
processImported
▸ processImported(imported
, options?
): Promise
<any
[]>
Parameters
Name | Type |
---|---|
imported | any |
options | ProcessImportedOptions |
Returns
Promise
<any
[]>
Implementation of
IAssetImporter.processImported
dispose
▸ dispose(): void
Returns
void
Implementation of
IAssetImporter.dispose
clearLoaderCache
▸ clearLoaderCache(): void
Returns
void
clearCache
▸ clearCache(): void
Clear memory asset and loader cache. Browser cache and custom cache storage is not cleared with this.
Returns
void