@loaders.gl/gltf
Version:
Framework-independent loader for the glTF format
33 lines • 854 B
JavaScript
import { VERSION } from "./lib/utils/version.js";
import { parseGLBSync } from "./lib/parsers/parse-glb.js";
/**
* GLB Loader -
* GLB is the binary container format for GLTF
*/
export const GLBLoader = {
dataType: null,
batchType: null,
name: 'GLB',
id: 'glb',
module: 'gltf',
version: VERSION,
extensions: ['glb'],
mimeTypes: ['model/gltf-binary'],
binary: true,
parse,
parseSync,
options: {
glb: {
strict: false // Enables deprecated XVIZ support (illegal CHUNK formats)
}
}
};
async function parse(arrayBuffer, options) {
return parseSync(arrayBuffer, options);
}
function parseSync(arrayBuffer, options) {
const glb = {};
parseGLBSync(glb, arrayBuffer, options?.glb?.byteOffset || 0, options?.glb);
return glb;
}
//# sourceMappingURL=glb-loader.js.map