Static_getInternalMerges 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_importInternalImports 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_importInternalImports 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
Optionaluri: stringOptional base URI for resolving relative resource paths
Optionalcallback: RnPromiseCallbackOptional callback for progress tracking
A Promise that resolves to the processed glTF2 data in RnM2 format
Static_importInternalInternal 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
Optionaloptions: GltfLoadOptionOptional configuration for the loading process
Optionaluri: stringOptional URI of the glTF file for resolving relative paths
A Result containing the processed RnM2 data or an error
Static_loadInternalResolves 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_loadInternalResolves 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_loadInternalResolves 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_loadInternalResolves 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_loadInternalResolves 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_loadInternalResolves 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_loadInternalResolves 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_loadInternalResolves dependencies for glTF scenes by linking node references. Creates nodesObjects array with direct references to node objects.
The glTF JSON data containing scenes
Static_loadInternalResolves 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_loadInternalOrchestrates 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
Optionaluint8arrayOfGlb: Uint8ArrayOptional binary data from GLB file
OptionalbasePath: stringOptional base path for resolving relative URIs
Optionalcallback: RnPromiseCallbackOptional progress callback
A Promise that resolves when all loading operations complete
Static_loadInternalProcesses 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_loadInternalLoads 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
OptionalbasePath: stringBase path for resolving relative URIs
Optionalcallback: RnPromiseCallbackOptional progress callback
A Promise that resolves when all resources are loaded
Static_mergeInternalMerges 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)
StaticimportImports 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
Optionaloptions: GltfLoadOptionOptional configuration for the loading process
A Promise that resolves to the processed glTF2 data in RnM2 format
StaticimportImports 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
Optionaloptions: 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.