class Loader3D
package away3d.loaders
extends ObjectContainer3D › Object3D › NamedAssetBase
Available on all platforms
Loader3D can load any file format that Away3D supports (or for which a third-party parser has been plugged in) and be added directly to the scene. As assets are encountered they are added to the Loader3D container. Assets that can not be displayed in the scene graph (e.g. unused bitmaps/materials/skeletons etc) will be ignored.
This provides a fast and easy way to load models (no need for event listeners) but is not very versatile since many types of assets are ignored.
Loader3D by default uses the Asset3DLibrary to load all assets, which means that they also ends up in the library. To circumvent this, Loader3D can be configured to not use the Asset3DLibrary in which case it will use the AssetLoader directly.
See also:
away3d.loaders.AssetLoader
away3d.library.Asset3DLibrary
Static methods
staticenableParser(parserClass:Class<ParserBase>):Void
Enables a specific parser. When no specific parser is set for a loading/parsing opperation, loader3d can autoselect the correct parser to use. A parser must have been enabled, to be considered when autoselecting the parser.
Parameters:
parserClass | The parser class to enable. |
|---|
See also:
away3d.loaders.parsers.Parsers
staticenableParsers(parserClasses:Array<Dynamic>):Void
Enables a list of parsers. When no specific parser is set for a loading/parsing opperation, loader3d can autoselect the correct parser to use. A parser must have been enabled, to be considered when autoselecting the parser.
Parameters:
parserClasses | A Vector of parser classes to enable. |
|---|
See also:
away3d.loaders.parsers.Parsers
Constructor
Methods
load(req:URLRequest, ?context:AssetLoaderContext, ?ns:String, ?parser:ParserBase):AssetLoaderToken
Loads a file and (optionally) all of its dependencies.
Parameters:
req | The URLRequest object containing the URL of the file to be loaded. |
|---|---|
context | An optional context object providing additional parameters for loading |
ns | An optional namespace string under which the file is to be loaded, allowing the differentiation of two resources with identical assets |
parser | An optional parser object for translating the loaded data into a usable resource. If not provided, AssetLoader will attempt to auto-detect the file type. |
loadData(data:Dynamic, ?context:AssetLoaderContext, ?ns:String, ?parser:ParserBase):AssetLoaderToken
Loads a resource from already loaded data.
Parameters:
data | The data object containing all resource information. |
|---|---|
context | An optional context object providing additional parameters for loading |
ns | An optional namespace string under which the file is to be loaded, allowing the differentiation of two resources with identical assets |
parser | An optional parser object for translating the loaded data into a usable resource. If not provided, AssetLoader will attempt to auto-detect the file type. |