Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ISceneLoaderPlugin

Interface used to define a SceneLoader plugin

Hierarchy

Implemented by

Index

Properties

extensionsSearch playground for extensions

extensions: string | ISceneLoaderPluginExtensions

The file extensions supported by this plugin.

nameSearch playground for name

name: string

The friendly name of this plugin.

Methods

Optional canDirectLoadSearch playground for canDirectLoad

  • 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 directLoadSearch playground for directLoad

  • 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

importMeshSearch playground for importMesh

  • importMesh(meshesNames: any, scene: Scene, data: any, rootUrl: string, meshes: AbstractMesh[], particleSystems: IParticleSystem[], skeletons: Skeleton[], onError?: (message: string, exception?: any) => void): boolean
  • Import meshes into a scene.

    Parameters

    • 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

    • meshes: AbstractMesh[]

      The meshes array to import into

    • particleSystems: IParticleSystem[]

      The particle systems array to import into

    • skeletons: Skeleton[]

      The skeletons array to import into

    • Optional onError: (message: string, exception?: any) => void

      The callback when import fails

        • (message: string, exception?: any): void
        • Parameters

          • message: string
          • Optional exception: any

          Returns void

    Returns boolean

    True if successful or false otherwise

loadSearch playground for load

  • load(scene: Scene, data: any, rootUrl: string, onError?: (message: string, exception?: any) => void): boolean
  • Load into a scene.

    Parameters

    • scene: Scene

      The scene to load into

    • data: any

      The data to import

    • rootUrl: string

      The root url for scene and resources

    • Optional onError: (message: string, exception?: any) => void

      The callback when import fails

        • (message: string, exception?: any): void
        • Parameters

          • message: string
          • Optional exception: any

          Returns void

    Returns boolean

    True if successful or false otherwise

loadAssetContainerSearch playground for loadAssetContainer

  • loadAssetContainer(scene: Scene, data: any, rootUrl: string, onError?: (message: string, exception?: any) => void): AssetContainer
  • Load into an asset container.

    Parameters

    • scene: Scene

      The scene to load into

    • data: any

      The data to import

    • rootUrl: string

      The root url for scene and resources

    • Optional onError: (message: string, exception?: any) => void

      The callback when import fails

        • (message: string, exception?: any): void
        • Parameters

          • message: string
          • Optional exception: any

          Returns void

    Returns AssetContainer

    The loaded asset container

Optional readFileSearch playground for readFile

  • The callback called when loading from a file object.

    Parameters

    • scene: Scene

      scene loading this file

    • file: File

      defines the file to load

    • onSuccess: (data: any) => void

      defines the callback to call when data is loaded

        • (data: any): void
        • Parameters

          • data: any

          Returns void

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

      defines the callback to call during loading process

    • Optional useArrayBuffer: boolean

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

    • Optional onError: (error: any) => void

      defines the callback to call when an error occurs

        • (error: any): void
        • Parameters

          • error: any

          Returns void

    Returns IFileRequest

    a file request object

Optional requestFileSearch playground for requestFile

  • The callback called when loading from a url.

    Parameters

    • scene: Scene

      scene loading this url

    • url: string

      url to load

    • onSuccess: (data: any, request?: WebRequest) => void

      callback called when the file successfully loads

        • Parameters

          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: (error: any) => void

      callback called when the file fails to load

        • (error: any): void
        • Parameters

          • error: any

          Returns void

    Returns IFileRequest

    a file request object

Optional rewriteRootURLSearch playground for rewriteRootURL

  • 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

Legend

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