Options
All
  • Public
  • Public/Protected
  • All
Menu

glTF assets are JSON files plus supporting external data.

Hierarchy

  • glTFAsset

Index

Constructors

constructor

  • new glTFAsset(descriptor: any, buffers?: ArrayBuffer[], images?: Texture<Resource>[]): glTFAsset
  • Creates a new glTF asset using the specified JSON descriptor.

    Parameters

    • descriptor: any

      The JSON descriptor to create the asset from.

    • buffers: ArrayBuffer[] = []

      The buffers used by this asset.

    • images: Texture<Resource>[] = []

      The images used by this asset.

    Returns glTFAsset

Properties

Readonly buffers

buffers: ArrayBuffer[] = []

Readonly descriptor

descriptor: any

Readonly images

images: Texture<Resource>[] = []

Methods

Static fromBuffer

  • fromBuffer(data: ArrayBuffer, cb: (gltf: glTFAsset) => void): void
  • Creates a new glTF asset from binary (glb) buffer data.

    Parameters

    • data: ArrayBuffer

      The binary buffer data to read from.

    • cb: (gltf: glTFAsset) => void

      The function which gets called when the asset has been created.

    Returns void

Static isEmbeddedResource

  • isEmbeddedResource(uri: string): boolean
  • Returns a value indicating if the specified uri is embedded.

    Parameters

    • uri: string

      The uri to check.

    Returns boolean

Static isValidBuffer

  • isValidBuffer(buffer: ArrayBuffer): boolean
  • Returns a value indicating if the specified data buffer is a valid glTF.

    Parameters

    • buffer: ArrayBuffer

      The buffer data to validate.

    Returns boolean

Static load

  • Loads a new glTF asset (including resources) using the specified JSON descriptor.

    Parameters

    • descriptor: any

      The JSON descriptor to create the asset from.

    • Optional loader: glTFResourceLoader

      The resource loader to use for external resources. The loader can be empty when all resources in the descriptor is embedded.

    Returns glTFAsset

Generated using TypeDoc