• Public
  • Public/Protected
  • All

Interface used to define an async SceneLoader plugin




extensions: string | ISceneLoaderPluginExtensions

The file extensions supported by this plugin.

name: string

The friendly name of this plugin.


  • canDirectLoad(data: string): boolean
  • The callback that returns true if the data can be directly loaded.


    • data: string

      string containing the file data

    Returns boolean

    if the data can be loaded directly

  • directLoad(scene: Scene, data: string): any
  • The callback that returns the data to pass to the plugin if the data can be directly loaded.


    • scene: Scene

      scene loading this data

    • data: string

      string containing the data

    Returns any

    data to pass to the plugin

  • Import meshes into a scene.


    • meshesNames: any

      An array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported

    • scene: Scene

      The scene to import into

    • data: any

      The data to import

    • rootUrl: string

      The root url for scene and resources

    • Optional onProgress: ((event: ISceneLoaderProgressEvent) => void)

      The callback when the load progresses

    • Optional fileName: string

      Defines the name of the file to load

    Returns Promise<ISceneLoaderAsyncResult>

    The loaded objects (e.g. meshes, particle systems, skeletons, animation groups, etc.)

  • Load into an asset container.


    Returns Promise<AssetContainer>

    The loaded asset container

  • Load into a scene.


    Returns Promise<void>


  • loadFile(scene: Scene, fileOrUrl: string | File | ArrayBufferView, rootUrl: string, onSuccess: ((data: any, responseURL?: string) => void), onProgress?: ((ev: ISceneLoaderProgressEvent) => void), useArrayBuffer?: boolean, onError?: ((request?: WebRequest, exception?: LoadFileError) => void), name?: string): Nullable<IFileRequest>
  • The callback called when loading from a url.


    • scene: Scene

      scene loading this url

    • fileOrUrl: string | File | ArrayBufferView

      file or url to load

    • rootUrl: string
    • onSuccess: ((data: any, responseURL?: string) => void)

      callback called when the file successfully loads

        • (data: any, responseURL?: string): void
        • Parameters

          • data: any
          • Optional responseURL: string

          Returns void

    • Optional onProgress: ((ev: ISceneLoaderProgressEvent) => void)

      callback called while file is loading (if the server supports this mode)

    • Optional useArrayBuffer: boolean

      defines a boolean indicating that date must be returned as ArrayBuffer

    • Optional onError: ((request?: WebRequest, exception?: LoadFileError) => void)

      callback called when the file fails to load

        • (request?: WebRequest, exception?: LoadFileError): void
        • Parameters

          • Optional request: WebRequest
          • Optional exception: LoadFileError

          Returns void

    • Optional name: string

    Returns Nullable<IFileRequest>

    a file request object

  • rewriteRootURL(rootUrl: string, responseURL?: string): string
  • The callback that allows custom handling of the root url based on the response url.


    • rootUrl: string

      the original root url

    • Optional responseURL: string

      the response url if available

    Returns string

    the new root url


  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Static method