loadGlb method

  1. @JSExport()
JSPromise<JSNumber> loadGlb(
  1. String path, {
  2. int numInstances = 1,
})

Implementation

@JSExport()
JSPromise<JSNumber> loadGlb(String path, {int numInstances = 1}) {
  _logger.info("Loading GLB from path $path with numInstances $numInstances");
  return viewer
      .loadGlb(path, numInstances: numInstances)
      .then((entity) => entity.toJS)
      .catchError((err) {
    _logger.info("Error: $err");
  }).toJS;
}