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

Constructors

Properties

_cachedAssets: IAsset[] = []
_fileDatabase: Map<string, IFile> = ...
_loaderCache: {
    ext: string[];
    loader: ILoader<any, any>;
    mime: string[];
}[] = []

Type declaration

  • ext: string[]
  • loader: ILoader<any, any>
  • mime: string[]
_loadingManager: LoadingManager
_logger: {
    (...data): void;
    (message?, ...optionalParams): void;
} = console.log

Type declaration

    • (...data): void
    • Parameters

      • Rest ...data: any[]

      Returns void

    • (message?, ...optionalParams): void
    • Prints to stdout with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution values similar to printf(3) (the arguments are all passed to util.format()).

      const count = 5;
      console.log('count: %d', count);
      // Prints: count: 5, to stdout
      console.log('count:', count);
      // Prints: count: 5, to stdout

      See util.format() for more information.

      Parameters

      • Optional message: any
      • Rest ...optionalParams: any[]

      Returns void

      Since

      v0.1.100

_rootContext?: {
    path: string;
    rootUrl: string;
}

Type declaration

  • path: string
  • rootUrl: string
importers: IImporter[] = ...

Accessors

Methods

  • Type Parameters

    • T extends "processRaw" | "onLoad" | "onProgress" | "onStop" | "onError" | "onStart" | "loaderCreate" | "importFile" | "importFiles" | "processRawStart"

    Parameters

    Returns void

Generated using TypeDoc