Class GLTFFileLoader
Hierarchy
- GLTFFileLoader
Implements
Index
Properties
- always
Compute Bounding Box - animation
Start Mode - compile
Materials - compile
Shadow Generators - coordinate
System Mode - create
Instances - load
All Materials - name
- on
Camera Loaded Observable - on
Complete Observable - on
Dispose Observable - on
Error Observable - on
Extension Loaded Observable - on
Material Loaded Observable - on
Mesh Loaded Observable - on
Parsed Observable - on
Texture Loaded Observable - on
Validated Observable - preprocess
Url Async - transparency
AsCoverage - use
Clip Plane - use
Range Requests - validate
Accessors
Methods
Properties
always Compute Bounding BoxSearch playground for alwaysComputeBoundingBox
Defines if the loader should always compute the bounding boxes of meshes and not use the min/max values from the position accessor. Defaults to false.
animation Start ModeSearch playground for animationStartMode
The animation start mode. Defaults to FIRST.
compile MaterialsSearch playground for compileMaterials
Defines if the loader should compile materials before raising the success callback. Defaults to false.
compile Shadow GeneratorsSearch playground for compileShadowGenerators
Defines if the loader should compile shadow generators before raising the success callback. Defaults to false.
coordinate System ModeSearch playground for coordinateSystemMode
The coordinate system mode. Defaults to AUTO.
create InstancesSearch playground for createInstances
Defines if the loader should create instances when multiple glTF nodes point to the same glTF mesh. Defaults to true.
load All MaterialsSearch playground for loadAllMaterials
If true, load all materials defined in the file, even if not used by any mesh. Defaults to false.
nameSearch playground for name
Name of the loader ("gltf")
Readonly on Camera Loaded ObservableSearch playground for onCameraLoadedObservable
Observable raised when the loader creates a camera after parsing the glTF properties of the camera.
Readonly on Complete ObservableSearch playground for onCompleteObservable
Observable raised when the asset is completely loaded, immediately before the loader is disposed. For assets with LODs, raised when all of the LODs are complete. For assets without LODs, raised when the model is complete, immediately after the loader resolves the returned promise.
Readonly on Dispose ObservableSearch playground for onDisposeObservable
Observable raised after the loader is disposed.
Readonly on Error ObservableSearch playground for onErrorObservable
Observable raised when an error occurs.
Readonly on Extension Loaded ObservableSearch playground for onExtensionLoadedObservable
Observable raised after a loader extension is created. Set additional options for a loader extension in this event.
Readonly on Material Loaded ObservableSearch playground for onMaterialLoadedObservable
Observable raised when the loader creates a material after parsing the glTF properties of the material.
Readonly on Mesh Loaded ObservableSearch playground for onMeshLoadedObservable
Observable raised when the loader creates a mesh after parsing the glTF properties of the mesh. Note that the observable is raised as soon as the mesh object is created, meaning some data may not have been setup yet for this mesh (vertex data, morph targets, material, ...)
on Parsed ObservableSearch playground for onParsedObservable
Raised when the asset has been parsed
Readonly on Texture Loaded ObservableSearch playground for onTextureLoadedObservable
Observable raised when the loader creates a texture after parsing the glTF properties of the texture.
Readonly on Validated ObservableSearch playground for onValidatedObservable
Observable raised after validation when validate is set to true. The event data is the result of the validation.
preprocess Url AsyncSearch playground for preprocessUrlAsync
Function called before loading a url referenced by the asset.
Type declaration
-
-
Parameters
-
url: string
Returns Promise<string>
-
-
transparency AsCoverageSearch playground for transparencyAsCoverage
Defines if the Alpha blended materials are only applied as coverage. If false, (default) The luminance of each pixel will reduce its opacity to simulate the behaviour of most physical materials. If true, no extra effects are applied to transparent pixels.
use Clip PlaneSearch playground for useClipPlane
Defines if the loader should also compile materials with clip planes. Defaults to false.
use Range RequestsSearch playground for useRangeRequests
Defines if the loader should use range requests when load binary glTF files from HTTP. Enabling will disable offline support and glTF validator. Defaults to false.
validateSearch playground for validate
Defines if the loader should validate the asset.
Accessors
capture Performance Counters
-
Defines if the loader should capture performance counters.
Returns boolean
-
Defines if the loader should capture performance counters.
Parameters
-
value: boolean
Returns any
-
loader State
-
The loader state or null if the loader is not active.
Returns Nullable<GLTFLoaderState>
logging Enabled
-
Defines if the loader logging is enabled.
Returns boolean
-
Defines if the loader logging is enabled.
Parameters
-
value: boolean
Returns any
-
on Camera Loaded
on Complete
-
Callback raised when the asset is completely loaded, immediately before the loader is disposed. For assets with LODs, raised when all of the LODs are complete. For assets without LODs, raised when the model is complete, immediately after the loader resolves the returned promise.
Parameters
-
callback: () => void
-
-
Returns void
-
-
Returns any
-
on Dispose
-
Callback raised after the loader is disposed.
Parameters
-
callback: () => void
-
-
Returns void
-
-
Returns any
-
on Error
-
Callback raised when an error occurs.
Parameters
-
callback: (reason: any) => void
-
-
Parameters
-
reason: any
Returns void
-
-
-
Returns any
-
on Extension Loaded
-
Callback raised after a loader extension is created.
Parameters
-
callback: (extension: IGLTFLoaderExtension) => void
-
-
Parameters
-
extension: IGLTFLoaderExtension
Returns void
-
-
-
Returns any
-
on Material Loaded
on Mesh Loaded
-
Callback raised when the loader creates a mesh after parsing the glTF properties of the mesh. Note that the callback is called as soon as the mesh object is created, meaning some data may not have been setup yet for this mesh (vertex data, morph targets, material, ...)
Parameters
-
callback: (mesh: AbstractMesh) => void
-
-
Parameters
-
mesh: AbstractMesh
Returns void
-
-
-
Returns any
-
on Parsed
-
Raised when the asset has been parsed
Parameters
-
callback: (loaderData: IGLTFLoaderData) => void
-
-
Parameters
-
loaderData: IGLTFLoaderData
Returns void
-
-
-
Returns any
-
on Texture Loaded
-
Callback raised when the loader creates a texture after parsing the glTF properties of the texture.
Parameters
-
callback: (texture: BaseTexture) => void
-
-
Parameters
-
texture: BaseTexture
Returns void
-
-
-
Returns any
-
on Validated
-
Callback raised after a loader extension is created.
Parameters
-
callback: (results: IGLTFValidationResults) => void
-
-
Parameters
-
results: IGLTFValidationResults
Returns void
-
-
-
Returns any
-
Methods
disposeSearch playground for dispose
-
Disposes the loader, releases resources during load, and cancels any outstanding requests.
Returns void
Optional rewrite RootURLSearch playground for rewriteRootURL
-
The callback that allows custom handling of the root url based on the response url.
Parameters
-
rootUrl: string
the original root url
-
Optional responseURL: string
the response url if available
Returns string
the new root url
-
when Complete AsyncSearch playground for whenCompleteAsync
-
Returns a promise that resolves when the asset is completely loaded.
Returns Promise<void>
a promise that resolves when the asset is completely loaded.
File loader for loading glTF files into a scene.