Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GltfLoader

Main class of the library

Hierarchy

  • GltfLoader

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Private manager

Methods

load

  • load(url: string, onProgress?: undefined | function): Promise<GltfAsset>
  • Load glTF from a URL. Only the main file is loaded - external buffer and image files are loaded lazily when needed. To load all, you can use GltfAsset.preFetchAll()

    Parameters

    • url: string
    • Optional onProgress: undefined | function

    Returns Promise<GltfAsset>

loadFromFiles

  • loadFromFiles(fileMap: Map<string, File>): Promise<GltfAsset>
  • Load from Files you might get from a file input or via drag-and-drop. fileMap is expected to map from a full file path (including directories if present). This matches the format provided by simple-dropzone. If you don't need support for directories/zip files, you can use File.name as the key.

    Note that preFetchAll is called on the result GltfAsset before returning it so that the uploaded files can be garbage-collected immediately.

    Parameters

    • fileMap: Map<string, File>

    Returns Promise<GltfAsset>

Private parse

  • parse(data: ArrayBuffer, path: string): Promise<GltfAsset>