MeshAssetTask

Define a task used by {BABYLON.AssetsManager} to load meshes

Hierarchy

Index

Constructors

constructor

  • new MeshAssetTask(name: string, meshesNames: any, rootUrl: string, sceneFilename: string): MeshAssetTask
  • Creates a new {BABYLON.MeshAssetTask}

    Parameters

    • name: string

      defines the name of the task

    • meshesNames: any

      defines the list of mesh's names you want to load

    • rootUrl: string

      defines the root url to use as a base to load your meshes and associated resources

    • sceneFilename: string

      defines the filename of the scene to load from

    Returns MeshAssetTask

Properties

errorObject

errorObject: object

Gets the current error object (if task is in error)

Type declaration

  • Optional exception?: any
  • Optional message?: string

isCompleted

isCompleted: boolean

Get if the task is completed

loadedMeshes

loadedMeshes: Array<AbstractMesh>

Gets the list of loaded meshes

loadedParticleSystems

loadedParticleSystems: Array<ParticleSystem>

Gets the list of loaded particle systems

loadedSkeletons

loadedSkeletons: Array<Skeleton>

Gets the list of loaded skeletons

meshesNames

meshesNames: any

Defines the list of mesh's names you want to load

name

name: string

Defines the name of the task

onError

onError: function

Callback called when the task is successful

Type declaration

    • Parameters

      • task: MeshAssetTask
      • Optional message: string
      • Optional exception: any

      Returns void

onSuccess

onSuccess: function

Callback called when the task is successful

Type declaration

rootUrl

rootUrl: string

Defines the root url to use as a base to load your meshes and associated resources

sceneFilename

sceneFilename: string

Defines the filename of the scene to load from

taskState

taskState: AssetTaskState

Gets the current state of the task

Methods

run

  • run(scene: Scene, onSuccess: function, onError: function): void
  • Execute the current task

    Parameters

    • scene: Scene

      defines the scene where you want your assets to be loaded

    • onSuccess: function

      is a callback called when the task is successfully executed

        • (): void
        • Returns void

    • onError: function

      is a callback called if an error occurs

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

          • Optional message: string
          • Optional exception: any

          Returns void

    Returns void

runTask

  • runTask(scene: Scene, onSuccess: function, onError: function): void
  • Execute the current task

    Parameters

    • scene: Scene

      defines the scene where you want your assets to be loaded

    • onSuccess: function

      is a callback called when the task is successfully executed

        • (): void
        • Returns void

    • onError: function

      is a callback called if an error occurs

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

          • Optional message: string
          • Optional exception: any

          Returns void

    Returns void

Generated using TypeDoc