Optional_hash: stringOptionalasset: anytrue if the uri is a valid URL (http, https, blob)
This is the loaded asset root object. If the asset is a glb/gltf file this will be the three#Scene object.
The url of the loaded asset (or the asset to be loaded)
The name of the assigned url. This name is deduced from the url and might not reflect the actual name of the asset
loads and returns a new instance of asset - this call is networked so an instance will be created on all connected users
Optionalparent: Object3D<Object3DEventMap> | SyncInstantiateOptionstrue if the asset has been loaded (via preload) or if it exists already (assigned to asset)
loads the asset binary without creating an instance
frees previously allocated memory and destroys the current asset instance (if any)
StaticgetGet an AssetReference for a URL to be easily loaded.
AssetReferences are cached so calling this method multiple times with the same arguments will always return the same AssetReference.
Optionalcontext: ContextStaticgetGet an AssetReference for a URL to be easily loaded.
AssetReferences are cached so calling this method multiple times with the same arguments will always return the same AssetReference.
The URL of the asset to load. The url can be relative or absolute.
Optionalcontext: ContextThe context to use for loading the asset
the AssetReference for the URL
AssetReferences can be used to load glTF or GLB assets
Use AssetReference.getOrCreateFromUrl to get an AssetReference for a URL to be easily loaded. When using the same URL multiple times the same AssetReference will be returned, this avoids loading or creating the same asset multiple times.
Important methods:
Example: Loading an asset from a URL
Example: Referencing an asset in a component and loading it on start
Related: