Documentation
    Preparing search index...

    Class GltfAsset

    A parsed, validated glTF document — plain data plus decoded textures, with an explicit lifetime (§83).

    Everything in it is a pure function of the input bytes (§33). Assembly into scene nodes is four's instantiateGltf; an assets-only consumer may read the records directly.

    Implements

    Index
    animations: readonly GltfAnimationRecord[]

    The animations, in file order.

    defaultScene: number | null

    Index of the file's default scene, or null.

    extras?: JsonValue

    §78 user metadata: the document's own extras, when present.

    ignored: readonly string[]

    What the file carried that this tier deliberately does not: one entry per ignored feature, in parse order (§85-warned once each at parse). Empty for a file entirely inside the tier.

    materials: readonly GltfMaterialRecord[]

    The materials, in file order.

    meshes: readonly GltfMeshRecord[]

    The meshes, in file order.

    nodes: readonly GltfNodeRecord[]

    The nodes, in file order — the index is the animation-binding ABI.

    scenes: readonly GltfSceneRecord[]

    The scenes, in file order.

    skins: readonly GltfSkinRecord[]

    The skins, in file order.

    textures: readonly (TextureAsset | null)[]

    Decoded base-colour textures, index-aligned with the file's textures array; null for entries no supported material slot references (they are validated, never decoded).

    url: string

    The URL the asset was loaded from — diagnostics and warning keys.

    • get isDisposed(): boolean

      Whether dispose has run.

      Returns boolean

    • Disposes every decoded TextureAsset (§83). Idempotent. The plain records stay readable — they are data, and dropping them would only turn a use-after-dispose into a TypeError instead of a legible empty read.

      Returns void