GLTFParser constructor

GLTFParser(
  1. dynamic json,
  2. Map<String, dynamic>? options
)

Implementation

GLTFParser(json, Map<String, dynamic>? options) {
  this.json = json ?? {};
  extensions = {};
  plugins = {};
  this.options = options ?? {};

  // loader object cache
  cache = GLTFRegistry();

  textureCache = {};
  sourceCache = {};

  // associations between Three.js objects and glTF elements
  associations = {};

  // BufferGeometry caching
  primitiveCache = {};

  // Object3D instance caches
  meshCache = {"refs": {}, "uses": {}};
  cameraCache = {"refs": {}, "uses": {}};
  lightCache = {"refs": {}, "uses": {}};

  // Track node names, to ensure no duplicates
  nodeNamesUsed = {};

  // Use an ImageBitmapLoader if imageBitmaps are supported. Moves much of the
  // expensive work of uploading a texture to the GPU off the main thread.
  // if ( createImageBitmap != null && /Firefox/.test( navigator.userAgent ) == false ) {
  //   this.textureLoader = new ImageBitmapLoader( this.options.manager );
  // } else {
  textureLoader = TextureLoader(this.options["manager"]);
  // }

  textureLoader.setCrossOrigin(this.options["crossOrigin"]);
  textureLoader.setRequestHeader(this.options["requestHeader"]);

  fileLoader = FileLoader(this.options["manager"]);
  fileLoader.setResponseType('arraybuffer');

  if (this.options["crossOrigin"] == 'use-credentials') {
    fileLoader.setWithCredentials(true);
  }

  loadBufferView = loadBufferView2;
}