Static
_getInternal
Merges default options with glTF asset extras and user-provided options. Handles loader extension initialization based on the extension name.
The base default options to merge into
The glTF JSON data that may contain loader options in asset.extras
User-provided options to override defaults
The merged and processed options object
Static
_importInternal
Imports and processes a binary glTF (.glb) file from ArrayBuffer. Validates the GLB format, extracts JSON and binary chunks, and processes the content.
The GLB file data as ArrayBuffer
Additional resource files for resolving dependencies
Configuration options for the loading process
A Promise that resolves to the processed glTF2 data in RnM2 format
Static
_importInternal
Imports and processes a JSON glTF (.gltf) file with external resources. Handles resource loading from external files and applies processing options.
The parsed glTF JSON data
Collection of external resource files
Configuration options for the loading process
Optional
uri: stringOptional base URI for resolving relative resource paths
Optional
callback: RnPromiseCallbackOptional callback for progress tracking
A Promise that resolves to the processed glTF2 data in RnM2 format
Static
_importInternal
Internal method to import glTF2 data from ArrayBuffer, handling both .gltf and .glb formats. Determines the file format by checking the magic number and processes accordingly.
The main glTF/GLB file as ArrayBuffer
Additional resource files (textures, bins) as ArrayBuffers
Optional
options: GltfLoadOptionOptional configuration for the loading process
Optional
uri: stringOptional URI of the glTF file for resolving relative paths
A Result containing the processed RnM2 data or an error
Static
_loadInternal
Resolves dependencies for glTF accessors including buffer views and sparse data. Links accessors to their underlying buffer data for vertex attributes and indices.
The glTF JSON data containing accessors
Static
_loadInternal
Resolves dependencies for glTF animations including channels, samplers, and targets. Handles different interpolation modes and sets up animation data structures.
The glTF JSON data containing animations
Static
_loadInternal
Resolves dependencies for glTF buffer views by linking them to their buffers. Establishes the connection between buffer views and the actual buffer data.
The glTF JSON data containing buffer views
Static
_loadInternal
Resolves dependencies for glTF skins including skeleton, joints, and inverse bind matrices. Sets up the skeletal animation structure with proper object references.
The glTF JSON data containing skins
Static
_loadInternal
Resolves dependencies for glTF materials including all texture references. Handles PBR textures, normal maps, occlusion, emissive, and various extensions like clearcoat, transmission, sheen, specular, iridescence, anisotropy, and MToon.
The glTF JSON data containing materials
Static
_loadInternal
Resolves dependencies for glTF meshes including materials, attributes, indices, and morph targets. Handles material variants and creates direct object references for efficient access.
The glTF JSON data containing meshes
Static
_loadInternal
Resolves dependencies for glTF nodes including hierarchy, meshes, skins, cameras, and lights. Establishes parent-child relationships and links to associated objects.
The glTF JSON data containing nodes
Static
_loadInternal
Resolves dependencies for glTF scenes by linking node references. Creates nodesObjects array with direct references to node objects.
The glTF JSON data containing scenes
Static
_loadInternal
Resolves dependencies for glTF textures including samplers and image sources. Handles KHR_texture_basisu extension for Basis Universal texture compression.
The glTF JSON data containing textures
Static
_loadInternal
Orchestrates the loading of resources and JSON content processing. Creates promises for both resource loading and JSON dependency resolution.
The glTF JSON data to process
Collection of resource files
Loading configuration options
Optional
uint8arrayOfGlb: Uint8ArrayOptional binary data from GLB file
Optional
basePath: stringOptional base path for resolving relative URIs
Optional
callback: RnPromiseCallbackOptional progress callback
A Promise that resolves when all loading operations complete
Static
_loadInternal
Processes the glTF JSON content by resolving all internal dependencies. Sets up object references between scenes, nodes, meshes, materials, textures, etc.
The glTF JSON data to process
Static
_loadInternal
Loads all external resources referenced by the glTF file including buffers and images. Handles various URI formats including data URIs, file references, and embedded data. Supports multiple image formats including Basis Universal and KTX2 compression.
Binary data from GLB file (if applicable)
The glTF JSON data containing resource references
Collection of external files to load from
Loading configuration options
Optional
basePath: stringBase path for resolving relative URIs
Optional
callback: RnPromiseCallbackOptional progress callback
A Promise that resolves when all resources are loaded
Static
_mergeInternal
Merges extended JSON data into the main glTF JSON structure. Supports ArrayBuffer, string, or object formats for extended data.
The main glTF JSON to merge into
Additional data to merge (ArrayBuffer, string, or object)
Static
importImports glTF2 data from a collection of ArrayBuffer files. Automatically identifies the main glTF or GLB file from the provided files.
A collection of file buffers where keys are filenames and values are ArrayBuffers
Optional
options: GltfLoadOptionOptional configuration for the loading process
A Promise that resolves to the processed glTF2 data in RnM2 format
Static
importImports a glTF2 file from a URL and processes it into RnM2 format. Automatically detects whether the file is in .gltf or .glb format.
The URL of the glTF file to import
Optional
options: GltfLoadOptionOptional configuration for the loading process
A Promise that resolves to the processed glTF2 data in RnM2 format
The glTF2 Importer class for loading and processing glTF 2.0 files. Supports both .gltf (JSON) and .glb (binary) formats with comprehensive extension support and resource loading capabilities.