ThreePipe
    Preparing search index...

    Class AssetImporter

    Asset Importer

    Utility class to import assets from local files, blobs, urls, etc. Used in AssetManager to import assets. Acts as a wrapper over three.js LoadingManager and adds support for dynamically loading loaders, caching assets, better event dispatching and file tracking.

    Hierarchy

    Implements

    Index

    Constructors

    Properties

    _rootContext?: { path: string; rootUrl: string }
    _urlModifiers: ((url: string) => string)[] = []
    cacheImportedAssets: boolean = true

    If true, imported assets are cached in memory(as js/three.js objects) and can be reused later. They will be cleared when dispose event is fired on the object or clearCache is called.

    importers: IImporter[] = ...

    Accessors

    Methods

    • Adds a listener to an event type.

      Type Parameters

      • T extends keyof IAssetImporterEventMap

      Parameters

      • type: T

        The type of event to listen to.

      • listener: EventListener<IAssetImporterEventMap[T], T, AssetImporter>

        The function that gets called when the event is fired.

      Returns void