Class MeshAssetTask
Hierarchy (View Summary)
- AbstractAssetTask
- MeshAssetTask
Constructors
constructor
-
new MeshAssetTask(
name: string,
meshesNames: any,
rootUrl: string,
sceneFilename: string | File,
extension?: string,
fileName?: string,
pluginOptions?: {
[key: string]:
| { enabled?: boolean; [key: string]: unknown }
| undefined;
},
): MeshAssetTaskCreates 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
Optionalextension: stringdefines the extension to use to load the scene (if not defined, ".babylon" will be used)
OptionalfileName: stringdefines the name of the file, if the data is binary
OptionalpluginOptions: { [key: string]: { enabled?: boolean; [key: string]: unknown } | undefined }defines the options to use with the plugin
Returns MeshAssetTask
- name: string
Properties
Optionalextension
Defines the extension to use to load the scene (if not defined, ".babylon" will be used)
Optionalfile Name
defines the name of the file, if the data is binary
loaded Animation Groups
Gets the list of loaded animation groups
loaded Meshes
Gets the list of loaded meshes
loaded Particle Systems
Gets the list of loaded particle systems
loaded Skeletons
Gets the list of loaded skeletons
loaded Transform Nodes
Gets the list of loaded transforms
meshes Names
Defines the list of mesh's names you want to load
name
Defines the name of the task
on Error
Callback called when the task is successful
on Success
Callback called when the task is successful
Optionalplugin Options
[key: string]: { enabled?: boolean; [key: string]: unknown } | undefined;
}
defines the options to use with the plugin
root Url
Defines the root url to use as a base to load your meshes and associated resources
scene Filename
Defines the filename or File of the scene to load from
Accessors
error Object
-
get errorObject(): { exception?: any; message?: string }
Gets the current error object (if task is in error)
Returns { exception?: any; message?: string }
is Completed
-
get isCompleted(): boolean
Get if the task is completed
Returns boolean
task State
-
Gets the current state of the task
Returns AssetTaskState
Methods
reset
-
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
run
-
run(
scene: Scene,
onSuccess: () => void,
onError: (message?: string, exception?: any) => void,
): voidExecute 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
- onError: (message?: string, exception?: any) => void
is a callback called if an error occurs
Returns void
- scene: Scene
run Task
-
runTask(
scene: Scene,
onSuccess: () => void,
onError: (message?: string, exception?: any) => void,
): voidExecute 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
- onError: (message?: string, exception?: any) => void
is a callback called if an error occurs
Returns void
- scene: Scene
Define a task used by AssetsManager to load meshes