Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MeshAssetTask

Define a task used by AssetsManager to load meshes

Hierarchy

Index

Constructors

constructor

  • new MeshAssetTask(name: string, meshesNames: any, rootUrl: string, sceneFilename: string | File): MeshAssetTask
  • Creates a new 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 | File

      defines the filename or File of the scene to load from

    Returns MeshAssetTask

Properties

loadedAnimationGroupsSearch playground for loadedAnimationGroups

loadedAnimationGroups: Array<AnimationGroup>

Gets the list of loaded animation groups

loadedMeshesSearch playground for loadedMeshes

loadedMeshes: Array<AbstractMesh>

Gets the list of loaded meshes

loadedParticleSystemsSearch playground for loadedParticleSystems

loadedParticleSystems: Array<IParticleSystem>

Gets the list of loaded particle systems

loadedSkeletonsSearch playground for loadedSkeletons

loadedSkeletons: Array<Skeleton>

Gets the list of loaded skeletons

meshesNamesSearch playground for meshesNames

meshesNames: any

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

nameSearch playground for name

name: string

Defines the name of the task

onErrorSearch playground for onError

onError: (task: MeshAssetTask, message?: string, exception?: any) => void

Callback called when the task is successful

Type declaration

    • Parameters

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

      Returns void

onSuccessSearch playground for onSuccess

onSuccess: (task: MeshAssetTask) => void

Callback called when the task is successful

Type declaration

rootUrlSearch playground for rootUrl

rootUrl: string

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

sceneFilenameSearch playground for sceneFilename

sceneFilename: string | File

Defines the filename or File of the scene to load from

Accessors

errorObject

  • get errorObject(): { exception?: any; message?: string }
  • Gets the current error object (if task is in error)

    Returns { exception?: any; message?: string }

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

isCompleted

  • get isCompleted(): boolean

taskState

Methods

resetSearch playground for reset

  • reset(): void
  • Reset will set the task state back to INIT, so the next load call of the assets manager will execute this task again. This can be used with failed tasks that have the reason for failure fixed.

    Returns void

runSearch playground for run

  • run(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void): void
  • Execute the current task

    Parameters

    • scene: Scene

      defines the scene where you want your assets to be loaded

    • onSuccess: () => void

      is a callback called when the task is successfully executed

        • (): void
        • Returns void

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

      is a callback called if an error occurs

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

          • Optional message: string
          • Optional exception: any

          Returns void

    Returns void

runTaskSearch playground for runTask

  • runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void): void
  • Execute the current task

    Parameters

    • scene: Scene

      defines the scene where you want your assets to be loaded

    • onSuccess: () => void

      is a callback called when the task is successfully executed

        • (): void
        • Returns void

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

      is a callback called if an error occurs

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

          • Optional message: string
          • Optional exception: any

          Returns void

    Returns void

Legend

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