Class GLTFLoader
Hierarchy
- GLTFLoader
Implements
- IGLTFLoader
Index
Properties
Accessors
Methods
- create
Material - end
Performance Counter - is
Extension Used - load
Animation Async - load
Buffer Async - load
Buffer View Async - load
Camera Async - load
Image Async - load
Material Alpha Properties - load
Material Base Properties Async - load
Material Properties Async - load
Node Async - load
Scene Async - load
Texture Info Async - load
Uri Async - log
- log
Close - log
Open - start
Performance Counter - Add
Pointer Metadata - Load
Extension Async - Load
Extra Async - Register
Extension - Unregister
Extension
Properties
_babylon LightsSearch playground for _babylonLights
Storage
Static Readonly Default SamplerSearch playground for DefaultSampler
The default glTF sampler.
Accessors
babylon Scene
The Babylon scene when loading the asset.
Returns Scene
bin
The BIN chunk of a binary glTF.
Returns Nullable<IDataBuffer>
gltf
parent
The parent file loader.
Returns GLTFFileLoader
root Babylon Mesh
Methods
create MaterialSearch playground for createMaterial
end Performance CounterSearch playground for endPerformanceCounter
Ends a performance counter.
Parameters
counterName: string
The name of the performance counter
Returns void
is Extension UsedSearch playground for isExtensionUsed
Checks for presence of an extension.
Parameters
name: string
The name of the extension to check
Returns boolean
A boolean indicating the presence of the given extension name in
extensionsUsed
load Animation AsyncSearch playground for loadAnimationAsync
Loads a glTF animation.
Parameters
context: string
The context when loading the asset
animation: BABYLON.GLTF2.Loader.IAnimation
The glTF animation property
Returns Promise<AnimationGroup>
A promise that resolves with the loaded Babylon animation group when the load is complete
load Buffer AsyncSearch playground for loadBufferAsync
Loads a glTF buffer.
Parameters
context: string
The context when loading the asset
buffer: BABYLON.GLTF2.Loader.IBuffer
The glTF buffer property
byteOffset: number
The byte offset to use
byteLength: number
The byte length to use
Returns Promise<ArrayBufferView>
A promise that resolves with the loaded data when the load is complete
load Buffer View AsyncSearch playground for loadBufferViewAsync
Loads a glTF buffer view.
Parameters
context: string
The context when loading the asset
bufferView: BABYLON.GLTF2.Loader.IBufferView
The glTF buffer view property
Returns Promise<ArrayBufferView>
A promise that resolves with the loaded data when the load is complete
load Camera AsyncSearch playground for loadCameraAsync
Loads a glTF camera.
Parameters
context: string
The context when loading the asset
camera: BABYLON.GLTF2.Loader.ICamera
The glTF camera property
Optional assign: ((babylonCamera: Camera) => void)
A function called synchronously after parsing the glTF properties
Parameters
babylonCamera: Camera
Returns void
Returns Promise<Camera>
A promise that resolves with the loaded Babylon camera when the load is complete
load Image AsyncSearch playground for loadImageAsync
load Material Alpha PropertiesSearch playground for loadMaterialAlphaProperties
Loads the alpha properties from a glTF material into a Babylon material. Must be called after the setting the albedo texture of the Babylon material when the material has an albedo texture.
Parameters
context: string
The context when loading the asset
material: BABYLON.GLTF2.Loader.IMaterial
The glTF material property
babylonMaterial: Material
The Babylon material
Returns void
load Material Base Properties AsyncSearch playground for loadMaterialBasePropertiesAsync
Loads the normal, occlusion, and emissive properties from a glTF material into a Babylon material.
Parameters
context: string
The context when loading the asset
material: BABYLON.GLTF2.Loader.IMaterial
The glTF material property
babylonMaterial: Material
The Babylon material
Returns Promise<void>
A promise that resolves when the load is complete
load Material Properties AsyncSearch playground for loadMaterialPropertiesAsync
Loads properties from a glTF material into a Babylon material.
Parameters
context: string
The context when loading the asset
material: BABYLON.GLTF2.Loader.IMaterial
The glTF material property
babylonMaterial: Material
The Babylon material
Returns Promise<void>
A promise that resolves when the load is complete
load Node AsyncSearch playground for loadNodeAsync
Loads a glTF node.
Parameters
context: string
The context when loading the asset
node: BABYLON.GLTF2.Loader.INode
The glTF node property
Optional assign: ((babylonTransformNode: TransformNode) => void)
A function called synchronously after parsing the glTF properties
Parameters
babylonTransformNode: TransformNode
Returns void
Returns Promise<TransformNode>
A promise that resolves with the loaded Babylon mesh when the load is complete
load Scene AsyncSearch playground for loadSceneAsync
load Texture Info AsyncSearch playground for loadTextureInfoAsync
Loads a glTF texture info.
Parameters
context: string
The context when loading the asset
textureInfo: BABYLON.GLTF2.Loader.ITextureInfo
The glTF texture info property
Optional assign: ((babylonTexture: BaseTexture) => void)
A function called synchronously after parsing the glTF properties
Parameters
babylonTexture: BaseTexture
Returns void
Returns Promise<BaseTexture>
A promise that resolves with the loaded Babylon texture when the load is complete
load Uri AsyncSearch playground for loadUriAsync
Loads a glTF uri.
Parameters
context: string
The context when loading the asset
property: IProperty
The glTF property associated with the uri
uri: string
The base64 or relative uri
Returns Promise<ArrayBufferView>
A promise that resolves with the loaded data when the load is complete
logSearch playground for log
Logs a message
Parameters
message: string
The message to log
Returns void
log CloseSearch playground for logClose
Decrements the indentation level.
Returns void
log OpenSearch playground for logOpen
Increments the indentation level and logs a message.
Parameters
message: string
The message to log
Returns void
start Performance CounterSearch playground for startPerformanceCounter
Starts a performance counter.
Parameters
counterName: string
The name of the performance counter
Returns void
Static Add Pointer MetadataSearch playground for AddPointerMetadata
Adds a JSON pointer to the metadata of the Babylon object at
<object>.metadata.gltf.pointers
.Parameters
babylonObject: IWithMetadata
the Babylon object with metadata
pointer: string
the JSON pointer
Returns void
Static Load Extension AsyncSearch playground for LoadExtensionAsync
Helper method called by a loader extension to load an glTF extension.
Type Parameters
TExtension = any
TResult = void
Parameters
context: string
The context when loading the asset
property: IProperty
The glTF property to load the extension from
extensionName: string
The name of the extension to load
actionAsync: ((extensionContext: string, extension: TExtension) => Nullable<Promise<TResult>>)
The action to run
Parameters
extensionContext: string
extension: TExtension
Returns Nullable<Promise<TResult>>
Returns Nullable<Promise<TResult>>
The promise returned by actionAsync or null if the extension does not exist
Static Load Extra AsyncSearch playground for LoadExtraAsync
Helper method called by a loader extension to load a glTF extra.
Type Parameters
TExtra = any
TResult = void
Parameters
context: string
The context when loading the asset
property: IProperty
The glTF property to load the extra from
extensionName: string
The name of the extension to load
actionAsync: ((extraContext: string, extra: TExtra) => Nullable<Promise<TResult>>)
The action to run
Parameters
extraContext: string
extra: TExtra
Returns Nullable<Promise<TResult>>
Returns Nullable<Promise<TResult>>
The promise returned by actionAsync or null if the extra does not exist
Static Register ExtensionSearch playground for RegisterExtension
Registers a loader extension.
Parameters
name: string
The name of the loader extension.
factory: ((loader: GLTFLoader) => BABYLON.GLTF2.IGLTFLoaderExtension)
The factory function that creates the loader extension.
Parameters
loader: GLTFLoader
Returns BABYLON.GLTF2.IGLTFLoaderExtension
Returns void
Static Unregister ExtensionSearch playground for UnregisterExtension
Unregisters a loader extension.
Parameters
name: string
The name of the loader extension.
Returns boolean
A boolean indicating whether the extension has been unregistered
The glTF 2.0 loader