GLTFFileLoader

File loader for loading glTF files into a scene.

Hierarchy

  • GLTFFileLoader

Implements

Index

Properties

animationStartMode

Find examples in Playground
animationStartMode: GLTFLoaderAnimationStartMode

The animation start mode. Defaults to FIRST.

capturePerformanceCounters

Find examples in Playground
capturePerformanceCounters: boolean

Defines if the loader should capture performance counters.

compileMaterials

Find examples in Playground
compileMaterials: boolean

Defines if the loader should compile materials before raising the success callback. Defaults to false.

compileShadowGenerators

Find examples in Playground
compileShadowGenerators: boolean

Defines if the loader should compile shadow generators before raising the success callback. Defaults to false.

coordinateSystemMode

Find examples in Playground
coordinateSystemMode: GLTFLoaderCoordinateSystemMode

The coordinate system mode. Defaults to AUTO.

createInstances

Find examples in Playground
createInstances: boolean

Defines if the loader should create instances when multiple glTF nodes point to the same glTF mesh. Defaults to true.

loaderState

Find examples in Playground

The loader state or null if the loader is not active.

loggingEnabled

Find examples in Playground
loggingEnabled: boolean

Defines if the loader logging is enabled.

name

Find examples in Playground
name: string

Name of the loader ("gltf")

onCameraLoaded

Find examples in Playground
onCameraLoaded: function

Callback raised when the loader creates a camera after parsing the glTF properties of the camera.

Type declaration

    • Parameters

      Returns void

onCameraLoadedObservable

Find examples in Playground
onCameraLoadedObservable: Observable<Camera>

Observable raised when the loader creates a camera after parsing the glTF properties of the camera.

onComplete

Find examples in Playground
onComplete: function

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.

Type declaration

    • (): void
    • Returns void

onCompleteObservable

Find examples in Playground
onCompleteObservable: Observable<void>

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.

onDispose

Find examples in Playground
onDispose: function

Callback raised after the loader is disposed.

Type declaration

    • (): void
    • Returns void

onDisposeObservable

Find examples in Playground
onDisposeObservable: Observable<void>

Observable raised after the loader is disposed.

onError

Find examples in Playground
onError: function

Callback raised when an error occurs.

Type declaration

    • (reason: any): void
    • Parameters

      • reason: any

      Returns void

onErrorObservable

Find examples in Playground
onErrorObservable: Observable<any>

Observable raised when an error occurs.

onExtensionLoaded

Find examples in Playground
onExtensionLoaded: function

Callback raised after a loader extension is created.

Type declaration

onExtensionLoadedObservable

Find examples in Playground
onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>

Observable raised after a loader extension is created. Set additional options for a loader extension in this event.

onMaterialLoaded

Find examples in Playground
onMaterialLoaded: function

Callback raised when the loader creates a material after parsing the glTF properties of the material.

Type declaration

onMaterialLoadedObservable

Find examples in Playground
onMaterialLoadedObservable: Observable<Material>

Observable raised when the loader creates a material after parsing the glTF properties of the material.

onMeshLoaded

Find examples in Playground
onMeshLoaded: function

Callback raised when the loader creates a mesh after parsing the glTF properties of the mesh.

Type declaration

onMeshLoadedObservable

Find examples in Playground
onMeshLoadedObservable: Observable<AbstractMesh>

Observable raised when the loader creates a mesh after parsing the glTF properties of the mesh.

onParsed

Find examples in Playground
onParsed: function

Raised when the asset has been parsed

Type declaration

onParsedObservable

Find examples in Playground
onParsedObservable: Observable<IGLTFLoaderData>

Raised when the asset has been parsed

onTextureLoaded

Find examples in Playground
onTextureLoaded: function

Callback raised when the loader creates a texture after parsing the glTF properties of the texture.

Type declaration

onTextureLoadedObservable

Find examples in Playground
onTextureLoadedObservable: Observable<BaseTexture>

Observable raised when the loader creates a texture after parsing the glTF properties of the texture.

onValidated

Find examples in Playground
onValidated: function

Callback raised after a loader extension is created.

Type declaration

    • (results: IGLTFValidationResults): void
    • Parameters

      • results: IGLTFValidationResults

      Returns void

onValidatedObservable

Find examples in Playground
onValidatedObservable: Observable<IGLTFValidationResults>

Observable raised after validation when validate is set to true. The event data is the result of the validation.

preprocessUrlAsync

Find examples in Playground
preprocessUrlAsync: function

Function called before loading a url referenced by the asset.

Type declaration

    • (url: string): Promise<string>
    • Parameters

      • url: string

      Returns Promise<string>

transparencyAsCoverage

Find examples in Playground
transparencyAsCoverage: boolean

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.

useClipPlane

Find examples in Playground
useClipPlane: boolean

Defines if the loader should also compile materials with clip planes. Defaults to false.

useRangeRequests

Find examples in Playground
useRangeRequests: boolean

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.

validate

Find examples in Playground
validate: boolean

Defines if the loader should validate the asset.

Methods

dispose

Find examples in Playground
  • dispose(): void
  • Disposes the loader, releases resources during load, and cancels any outstanding requests.

    Returns void

Optional rewriteRootURL

Find examples in Playground
  • rewriteRootURL(rootUrl: string, responseURL?: string): string
  • 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

whenCompleteAsync

Find examples in Playground
  • whenCompleteAsync(): Promise<void>
  • Returns a promise that resolves when the asset is completely loaded.

    Returns Promise<void>

    a promise that resolves when the asset is completely loaded.

Generated using TypeDoc