Options
All
  • Public
  • Public/Protected
  • All
Menu

Class glTFAsset

glTF assets are JSON files plus supporting external data.

Hierarchy

  • glTFAsset

Index

Constructors

constructor

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

    Parameters

    • descriptor: any

      The JSON descriptor to create the asset from.

    • Default value buffers: ArrayBuffer[] = []

      The buffers used by this asset.

    • Default value images: Texture[] = []

      The images used by this asset.

    Returns glTFAsset

Properties

buffers

buffers: ArrayBuffer[]

The buffers used by this asset.

descriptor

descriptor: any

The JSON descriptor to create the asset from.

images

images: Texture[]

The images used by this asset.

Methods

Static fromBuffer

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

    Parameters

    • data: ArrayBuffer

      The binary buffer data to read from.

    • callback: (gltf: glTFAsset) => void

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

    Returns void

Static getEmbeddedBuffer

  • getEmbeddedBuffer(value: string): ArrayBuffer | SharedArrayBuffer

Static isEmbeddedResource

  • isEmbeddedResource(uri: string): boolean

Static isValid

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

    Parameters

    • data: ArrayBuffer

      The buffer data to validate.

    Returns boolean

Static load

  • load(descriptor: any, loader?: glTFAssetResourceLoader): glTFAsset
  • 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: glTFAssetResourceLoader

      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