GLTFParser constructor

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

Implementation

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

  // 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 = ImageBitmapLoader( this.options.manager );
  // } else {
  textureLoader = TextureLoader(manager: this.options["manager"], flipY: this.options['flipY']);
  // }

  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;
}