ISceneLoaderPluginBase

Interface used to define the base of ISceneLoaderPlugin and ISceneLoaderPluginAsync

Hierarchy

Index

Properties

extensions

Find examples in Playground
extensions: string | ISceneLoaderPluginExtensions

The file extensions supported by this plugin.

name

Find examples in Playground
name: string

The friendly name of this plugin.

Methods

Optional canDirectLoad

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

    Parameters

    • data: string

      string containing the file data

    Returns boolean

    if the data can be loaded directly

Optional directLoad

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

    Parameters

    • scene: Scene

      scene loading this data

    • data: string

      string containing the data

    Returns any

    data to pass to the plugin

Optional readFile

Find examples in Playground
  • readFile(scene: Scene, file: File, onSuccess: function, onProgress?: function, useArrayBuffer?: boolean, onError?: function): IFileRequest
  • The callback called when loading from a file object.

    Parameters

    • scene: Scene

      scene loading this file

    • file: File

      defines the file to load

    • onSuccess: function

      defines the callback to call when data is loaded

        • (data: any): void
        • Parameters

          • data: any

          Returns void

    • Optional onProgress: function

      defines the callback to call during loading process

        • (ev: ProgressEvent): any
        • Parameters

          • ev: ProgressEvent

          Returns any

    • Optional useArrayBuffer: boolean

      defines a boolean indicating that data must be returned as an ArrayBuffer

    • Optional onError: function

      defines the callback to call when an error occurs

        • (error: any): void
        • Parameters

          • error: any

          Returns void

    Returns IFileRequest

    a file request object

Optional requestFile

Find examples in Playground
  • requestFile(scene: Scene, url: string, onSuccess: function, onProgress?: function, useArrayBuffer?: boolean, onError?: function): IFileRequest
  • The callback called when loading from a url.

    Parameters

    • scene: Scene

      scene loading this url

    • url: string

      url to load

    • onSuccess: function

      callback called when the file successfully loads

        • Parameters

          Returns void

    • Optional onProgress: function

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

        • (ev: ProgressEvent): void
        • Parameters

          • ev: ProgressEvent

          Returns void

    • Optional useArrayBuffer: boolean

      defines a boolean indicating that date must be returned as ArrayBuffer

    • Optional onError: function

      callback called when the file fails to load

        • (error: any): void
        • Parameters

          • error: any

          Returns void

    Returns IFileRequest

    a file request object

Optional rewriteRootURL

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

    Parameters

    • rootUrl: string

      the original root url

    • Optional responseURL: string

      the response url if available

    Returns string

    the new root url

Generated using TypeDoc