Skip to main content

Class: AssetImporter

Core-API.AssetImporter

Hierarchy

  • SimpleEventDispatcher<"onLoad" | "onProgress" | "onStop" | "onError" | "onStart" | "loaderCreate" | "importFile" | "importFiles">

    AssetImporter

Implements

Properties

Importers

Static Readonly Importers: IImporter[]

Defined in

webgi/src/extras/asset_manager/importer/threejs/AssetImporter.ts:58

Accessors

processors

get processors(): ObjectProcessorMap<TAssetTypes>

Returns

ObjectProcessorMap<TAssetTypes>

Implementation of

IAssetImporter.processors

Defined in

webgi/src/extras/asset_manager/importer/threejs/AssetImporter.ts:46


loadingManager

get loadingManager(): LoadingManager

Returns

LoadingManager

Implementation of

IAssetImporter.loadingManager

Defined in

webgi/src/extras/asset_manager/importer/threejs/AssetImporter.ts:50

Constructors

constructor

new AssetImporter(viewer, logging?)

Parameters

NameTypeDefault value
viewerIViewerAppundefined
loggingbooleanfalse

Overrides

SimpleEventDispatcher.constructor

Defined in

webgi/src/extras/asset_manager/importer/threejs/AssetImporter.ts:67

Methods

importFiles

importFiles(files, options?): Promise<Map<string, ISceneObject<any>[]>>

Parameters

NameType
filesMap<string, IFile>
optionsImportFilesOptions

Returns

Promise<Map<string, ISceneObject<any>[]>>

Implementation of

IAssetImporter.importFiles

Defined in

webgi/src/extras/asset_manager/importer/threejs/AssetImporter.ts:151


registerFile

registerFile(path, file?): undefined | ILoader

Parameters

NameType
pathstring
file?IFile

Returns

undefined | ILoader

Implementation of

IAssetImporter.registerFile

Defined in

webgi/src/extras/asset_manager/importer/threejs/AssetImporter.ts:206


unregisterFile

unregisterFile(path): void

Parameters

NameType
pathstring

Returns

void

Implementation of

IAssetImporter.unregisterFile

Defined in

webgi/src/extras/asset_manager/importer/threejs/AssetImporter.ts:233


resolveURL

resolveURL(url): string

Parameters

NameType
urlstring

Returns

string

Defined in

webgi/src/extras/asset_manager/importer/threejs/AssetImporter.ts:247


importAsset

importAsset(asset?, options?, onDownloadProgress?): Promise<ISceneObject<any>[]>

Returns the object or undefined

Parameters

NameType
asset?IAsset
optionsImportAssetOptions
onDownloadProgress?(e: ProgressEvent<EventTarget>) => void

Returns

Promise<ISceneObject<any>[]>

Implementation of

IAssetImporter.importAsset

Defined in

webgi/src/extras/asset_manager/importer/threejs/AssetImporter.ts:338


importSingle

importSingle<T>(asset?, options?): Promise<undefined | T>

Type parameters

Name
T

Parameters

NameType
asset?IAsset
optionsImportAssetOptions

Returns

Promise<undefined | T>

Implementation of

IAssetImporter.importSingle

Defined in

webgi/src/extras/asset_manager/importer/threejs/AssetImporter.ts:377


importSinglePath

importSinglePath<T>(path, options?): Promise<undefined | T>

Type parameters

NameType
Textends ISceneObject<any>

Parameters

NameType
pathstring
options?ImportAssetOptions

Returns

Promise<undefined | T>

Defined in

webgi/src/extras/asset_manager/importer/threejs/AssetImporter.ts:380


importPath

importPath(path, options?): Promise<ISceneObject<any>[]>

Parameters

NameType
pathstring
optionsImportAssetOptions

Returns

Promise<ISceneObject<any>[]>

Implementation of

IAssetImporter.importPath

Defined in

webgi/src/extras/asset_manager/importer/threejs/AssetImporter.ts:383


processImportedSingle

processImportedSingle<T>(res, options?): Promise<T>

Type parameters

NameType
Textends ISceneObject<any>

Parameters

NameType
resany
optionsProcessImportedOptions

Returns

Promise<T>

Defined in

webgi/src/extras/asset_manager/importer/threejs/AssetImporter.ts:399


processImported

processImported(imported, options?): Promise<any[]>

Parameters

NameType
importedany
optionsProcessImportedOptions

Returns

Promise<any[]>

Implementation of

IAssetImporter.processImported

Defined in

webgi/src/extras/asset_manager/importer/threejs/AssetImporter.ts:402


dispose

dispose(): void

Returns

void

Implementation of

IAssetImporter.dispose

Defined in

webgi/src/extras/asset_manager/importer/threejs/AssetImporter.ts:550


addEventListener

addEventListener(type, listener): void

Adds a listener to an event type.

Parameters

NameType
type"onLoad" | "onProgress" | "onStop" | "onError" | "onStart" | "loaderCreate" | "importFile" | "importFiles"
listener(event: IEvent<"onLoad" | "onProgress" | "onStop" | "onError" | "onStart" | "loaderCreate" | "importFile" | "importFiles">) => void

Returns

void

Implementation of

IAssetImporter.addEventListener

Inherited from

SimpleEventDispatcher.addEventListener

Defined in

webgi/src/helpers/EventDispatcher.ts:48


hasEventListener

hasEventListener(type, listener): boolean

Checks if listener is added to an event type.

Parameters

NameType
type"onLoad" | "onProgress" | "onStop" | "onError" | "onStart" | "loaderCreate" | "importFile" | "importFiles"
listener(event: IEvent<"onLoad" | "onProgress" | "onStop" | "onError" | "onStart" | "loaderCreate" | "importFile" | "importFiles">) => void

Returns

boolean

Implementation of

IAssetImporter.hasEventListener

Inherited from

SimpleEventDispatcher.hasEventListener

Defined in

webgi/src/helpers/EventDispatcher.ts:56


removeEventListener

removeEventListener(type, listener): void

Removes a listener from an event type.

Parameters

NameType
type"onLoad" | "onProgress" | "onStop" | "onError" | "onStart" | "loaderCreate" | "importFile" | "importFiles"
listener(event: IEvent<"onLoad" | "onProgress" | "onStop" | "onError" | "onStart" | "loaderCreate" | "importFile" | "importFiles">) => void

Returns

void

Implementation of

IAssetImporter.removeEventListener

Inherited from

SimpleEventDispatcher.removeEventListener

Defined in

webgi/src/helpers/EventDispatcher.ts:63


dispatchEvent

dispatchEvent(event): void

Fire an event type.

Parameters

NameType
eventIEvent<"onLoad" | "onProgress" | "onStop" | "onError" | "onStart" | "loaderCreate" | "importFile" | "importFiles">

Returns

void

Implementation of

IAssetImporter.dispatchEvent

Inherited from

SimpleEventDispatcher.dispatchEvent

Defined in

webgi/src/helpers/EventDispatcher.ts:74