loadGlb method

  1. @override
Future<ThermionEntity> loadGlb(
  1. String path, {
  2. bool unlit = false,
  3. int numInstances = 1,
})
override

Implementation

@override
Future<ThermionEntity> loadGlb(String path,
    {bool unlit = false, int numInstances = 1}) async {
  if (unlit) {
    throw Exception("Not yet implemented");
  }
  final pathPtr = path.toNativeUtf8(allocator: allocator).cast<Char>();
  var entity = await withIntCallback((callback) =>
      load_glb_ffi(_sceneManager!, pathPtr, numInstances, callback));
  allocator.free(pathPtr);
  if (entity == _FILAMENT_ASSET_ERROR) {
    throw Exception("An error occurred loading the asset at $path");
  }
  _scene!.registerEntity(entity);

  return entity;
}