@galacean/engine-loader 1.0.0-beta.0 → 1.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -398,9 +398,7 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
398
398
  return _this;
399
399
  }
400
400
  var _proto = GLTFContentRestorer.prototype;
401
- /**
402
- * @override
403
- */ _proto.restoreContent = function restoreContent() {
401
+ _proto.restoreContent = function restoreContent() {
404
402
  var _this = this;
405
403
  return new miniprogram.AssetPromise(function(resolve, reject) {
406
404
  Promise.all(_this.bufferRequests.map(function(bufferRequestInfo) {
@@ -2330,9 +2328,7 @@ var GLTFValidator = /*#__PURE__*/ function(GLTFParser1) {
2330
2328
  return _this;
2331
2329
  }
2332
2330
  var _proto = GLTFResource.prototype;
2333
- /**
2334
- * @override
2335
- */ _proto._onDestroy = function _onDestroy() {
2331
+ _proto._onDestroy = function _onDestroy() {
2336
2332
  EngineObject.prototype._onDestroy.call(this);
2337
2333
  this.defaultSceneRoot.destroy();
2338
2334
  this.textures = null;
@@ -2355,9 +2351,7 @@ var GLTFLoader = /*#__PURE__*/ function(Loader) {
2355
2351
  return Loader.apply(this, arguments);
2356
2352
  }
2357
2353
  var _proto = GLTFLoader.prototype;
2358
- /**
2359
- * @override
2360
- */ _proto.load = function load(item, resourceManager) {
2354
+ _proto.load = function load(item, resourceManager) {
2361
2355
  var url = item.url;
2362
2356
  var params = item.params;
2363
2357
  var context = new GLTFParserContext(url);
@@ -4204,9 +4198,7 @@ SpriteLoader = __decorate([
4204
4198
  return _this;
4205
4199
  }
4206
4200
  var _proto = Texture2DContentRestorer.prototype;
4207
- /**
4208
- * @override
4209
- */ _proto.restoreContent = function restoreContent() {
4201
+ _proto.restoreContent = function restoreContent() {
4210
4202
  var _this = this;
4211
4203
  return miniprogram.request(this.url, this.requestConfig).then(function(image) {
4212
4204
  var resource = _this.resource;
@@ -4224,9 +4216,7 @@ var Texture2DLoader = /*#__PURE__*/ function(Loader) {
4224
4216
  return Loader.apply(this, arguments);
4225
4217
  }
4226
4218
  var _proto = Texture2DLoader.prototype;
4227
- /**
4228
- * @override
4229
- */ _proto.load = function load(item, resourceManager) {
4219
+ _proto.load = function load(item, resourceManager) {
4230
4220
  var _this = this;
4231
4221
  return new miniprogram.AssetPromise(function(resolve, reject) {
4232
4222
  var url = item.url;
@@ -4272,9 +4262,7 @@ Texture2DLoader = __decorate([
4272
4262
  return _this;
4273
4263
  }
4274
4264
  var _proto = TextureCubeContentRestorer.prototype;
4275
- /**
4276
- * @override
4277
- */ _proto.restoreContent = function restoreContent() {
4265
+ _proto.restoreContent = function restoreContent() {
4278
4266
  var _this = this;
4279
4267
  return new miniprogram.AssetPromise(function(resolve, reject) {
4280
4268
  Promise.all(_this.urls.map(function(url) {
@@ -4300,9 +4288,7 @@ var TextureCubeLoader = /*#__PURE__*/ function(Loader) {
4300
4288
  return Loader.apply(this, arguments);
4301
4289
  }
4302
4290
  var _proto = TextureCubeLoader.prototype;
4303
- /**
4304
- * @override
4305
- */ _proto.load = function load(item, resourceManager) {
4291
+ _proto.load = function load(item, resourceManager) {
4306
4292
  var _this = this;
4307
4293
  return new miniprogram.AssetPromise(function(resolve, reject) {
4308
4294
  var urls = item.urls;
@@ -4468,16 +4454,12 @@ var KHR_draco_mesh_compression = (_KHR_draco_mesh_compression = /*#__PURE__*/ fu
4468
4454
  return GLTFExtensionParser.apply(this, arguments);
4469
4455
  }
4470
4456
  var _proto = KHR_draco_mesh_compression1.prototype;
4471
- /**
4472
- * @override
4473
- */ _proto.initialize = function initialize() {
4457
+ _proto.initialize = function initialize() {
4474
4458
  if (!KHR_draco_mesh_compression._decoder) {
4475
4459
  KHR_draco_mesh_compression._decoder = new miniprogram$3.DRACODecoder();
4476
4460
  }
4477
4461
  };
4478
- /**
4479
- * @override
4480
- */ _proto.createAndParse = function createAndParse(context, schema, glTFPrimitive, glTFMesh) {
4462
+ _proto.createAndParse = function createAndParse(context, schema, glTFPrimitive, glTFMesh) {
4481
4463
  var _this = this;
4482
4464
  var glTF = context.glTF, buffers = context.buffers, engine = context.glTFResource.engine;
4483
4465
  var bufferViews = glTF.bufferViews, accessors = glTF.accessors;
@@ -4632,9 +4614,7 @@ var KHR_lights_punctual = /*#__PURE__*/ function(GLTFExtensionParser) {
4632
4614
  return GLTFExtensionParser.apply(this, arguments);
4633
4615
  }
4634
4616
  var _proto = KHR_lights_punctual.prototype;
4635
- /**
4636
- * @override
4637
- */ _proto.additiveParse = function additiveParse(context, entity, extensionSchema) {
4617
+ _proto.additiveParse = function additiveParse(context, entity, extensionSchema) {
4638
4618
  var lightsSchema = context.glTF.extensions.KHR_lights_punctual.lights;
4639
4619
  var lightSchema = lightsSchema[extensionSchema.light];
4640
4620
  var color = lightSchema.color, _lightSchema_intensity = lightSchema.intensity, intensity = _lightSchema_intensity === void 0 ? 1 : _lightSchema_intensity, type = lightSchema.type, range = lightSchema.range, spot = lightSchema.spot;
@@ -4674,9 +4654,7 @@ var KHR_materials_clearcoat = /*#__PURE__*/ function(GLTFExtensionParser) {
4674
4654
  return GLTFExtensionParser.apply(this, arguments);
4675
4655
  }
4676
4656
  var _proto = KHR_materials_clearcoat.prototype;
4677
- /**
4678
- * @override
4679
- */ _proto.additiveParse = function additiveParse(context, material, schema) {
4657
+ _proto.additiveParse = function additiveParse(context, material, schema) {
4680
4658
  var textures = context.glTFResource.textures;
4681
4659
  var _schema_clearcoatFactor = schema.clearcoatFactor, clearcoatFactor = _schema_clearcoatFactor === void 0 ? 0 : _schema_clearcoatFactor, clearcoatTexture = schema.clearcoatTexture, _schema_clearcoatRoughnessFactor = schema.clearcoatRoughnessFactor, clearcoatRoughnessFactor = _schema_clearcoatRoughnessFactor === void 0 ? 0 : _schema_clearcoatRoughnessFactor, clearcoatRoughnessTexture = schema.clearcoatRoughnessTexture, clearcoatNormalTexture = schema.clearcoatNormalTexture;
4682
4660
  material.clearCoat = clearcoatFactor;
@@ -4706,9 +4684,7 @@ var KHR_materials_pbrSpecularGlossiness = /*#__PURE__*/ function(GLTFExtensionPa
4706
4684
  return GLTFExtensionParser.apply(this, arguments);
4707
4685
  }
4708
4686
  var _proto = KHR_materials_pbrSpecularGlossiness.prototype;
4709
- /**
4710
- * @override
4711
- */ _proto.createAndParse = function createAndParse(context, schema, ownerSchema) {
4687
+ _proto.createAndParse = function createAndParse(context, schema, ownerSchema) {
4712
4688
  var _context_glTFResource = context.glTFResource, engine = _context_glTFResource.engine, textures = _context_glTFResource.textures;
4713
4689
  var material = new miniprogram.PBRSpecularMaterial(engine);
4714
4690
  var diffuseFactor = schema.diffuseFactor, diffuseTexture = schema.diffuseTexture, specularFactor = schema.specularFactor, glossinessFactor = schema.glossinessFactor, specularGlossinessTexture = schema.specularGlossinessTexture;
@@ -4745,9 +4721,7 @@ var KHR_materials_unlit = /*#__PURE__*/ function(GLTFExtensionParser) {
4745
4721
  return GLTFExtensionParser.apply(this, arguments);
4746
4722
  }
4747
4723
  var _proto = KHR_materials_unlit.prototype;
4748
- /**
4749
- * @override
4750
- */ _proto.createAndParse = function createAndParse(context, _, ownerSchema) {
4724
+ _proto.createAndParse = function createAndParse(context, _, ownerSchema) {
4751
4725
  var engine = context.glTFResource.engine;
4752
4726
  var material = new miniprogram.UnlitMaterial(engine);
4753
4727
  material.name = ownerSchema.name;
@@ -4777,9 +4751,7 @@ var KHR_texture_transform = /*#__PURE__*/ function(GLTFExtensionParser) {
4777
4751
  return GLTFExtensionParser.apply(this, arguments);
4778
4752
  }
4779
4753
  var _proto = KHR_texture_transform.prototype;
4780
- /**
4781
- * @override
4782
- */ _proto.additiveParse = function additiveParse(context, material, schema) {
4754
+ _proto.additiveParse = function additiveParse(context, material, schema) {
4783
4755
  var offset = schema.offset, rotation = schema.rotation, scale = schema.scale, texCoord = schema.texCoord;
4784
4756
  if (offset) {
4785
4757
  material.tilingOffset.z = offset[0];
@@ -4808,9 +4780,7 @@ var GALACEAN_materials_remap = /*#__PURE__*/ function(GLTFExtensionParser) {
4808
4780
  return GLTFExtensionParser.apply(this, arguments);
4809
4781
  }
4810
4782
  var _proto = GALACEAN_materials_remap.prototype;
4811
- /**
4812
- * @override
4813
- */ _proto.createAndParse = function createAndParse(context, schema) {
4783
+ _proto.createAndParse = function createAndParse(context, schema) {
4814
4784
  var engine = context.glTFResource.engine;
4815
4785
  // @ts-ignore
4816
4786
  return engine.resourceManager.getResourceByRef(schema);
@@ -4827,9 +4797,7 @@ var GALACEAN_animation_event = /*#__PURE__*/ function(GLTFExtensionParser) {
4827
4797
  return GLTFExtensionParser.apply(this, arguments);
4828
4798
  }
4829
4799
  var _proto = GALACEAN_animation_event.prototype;
4830
- /**
4831
- * @override
4832
- */ _proto.additiveParse = function additiveParse(context, animationClip, schema) {
4800
+ _proto.additiveParse = function additiveParse(context, animationClip, schema) {
4833
4801
  context.glTFResource.engine;
4834
4802
  var events = schema.events;
4835
4803
  events.map(function(eventData) {
package/dist/module.js CHANGED
@@ -393,9 +393,7 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
393
393
  return _this;
394
394
  }
395
395
  var _proto = GLTFContentRestorer.prototype;
396
- /**
397
- * @override
398
- */ _proto.restoreContent = function restoreContent() {
396
+ _proto.restoreContent = function restoreContent() {
399
397
  var _this = this;
400
398
  return new AssetPromise(function(resolve, reject) {
401
399
  Promise.all(_this.bufferRequests.map(function(bufferRequestInfo) {
@@ -2325,9 +2323,7 @@ var GLTFValidator = /*#__PURE__*/ function(GLTFParser1) {
2325
2323
  return _this;
2326
2324
  }
2327
2325
  var _proto = GLTFResource.prototype;
2328
- /**
2329
- * @override
2330
- */ _proto._onDestroy = function _onDestroy() {
2326
+ _proto._onDestroy = function _onDestroy() {
2331
2327
  EngineObject.prototype._onDestroy.call(this);
2332
2328
  this.defaultSceneRoot.destroy();
2333
2329
  this.textures = null;
@@ -2350,9 +2346,7 @@ var GLTFLoader = /*#__PURE__*/ function(Loader) {
2350
2346
  return Loader.apply(this, arguments);
2351
2347
  }
2352
2348
  var _proto = GLTFLoader.prototype;
2353
- /**
2354
- * @override
2355
- */ _proto.load = function load(item, resourceManager) {
2349
+ _proto.load = function load(item, resourceManager) {
2356
2350
  var url = item.url;
2357
2351
  var params = item.params;
2358
2352
  var context = new GLTFParserContext(url);
@@ -4199,9 +4193,7 @@ SpriteLoader = __decorate([
4199
4193
  return _this;
4200
4194
  }
4201
4195
  var _proto = Texture2DContentRestorer.prototype;
4202
- /**
4203
- * @override
4204
- */ _proto.restoreContent = function restoreContent() {
4196
+ _proto.restoreContent = function restoreContent() {
4205
4197
  var _this = this;
4206
4198
  return request(this.url, this.requestConfig).then(function(image) {
4207
4199
  var resource = _this.resource;
@@ -4219,9 +4211,7 @@ var Texture2DLoader = /*#__PURE__*/ function(Loader) {
4219
4211
  return Loader.apply(this, arguments);
4220
4212
  }
4221
4213
  var _proto = Texture2DLoader.prototype;
4222
- /**
4223
- * @override
4224
- */ _proto.load = function load(item, resourceManager) {
4214
+ _proto.load = function load(item, resourceManager) {
4225
4215
  var _this = this;
4226
4216
  return new AssetPromise(function(resolve, reject) {
4227
4217
  var url = item.url;
@@ -4267,9 +4257,7 @@ Texture2DLoader = __decorate([
4267
4257
  return _this;
4268
4258
  }
4269
4259
  var _proto = TextureCubeContentRestorer.prototype;
4270
- /**
4271
- * @override
4272
- */ _proto.restoreContent = function restoreContent() {
4260
+ _proto.restoreContent = function restoreContent() {
4273
4261
  var _this = this;
4274
4262
  return new AssetPromise(function(resolve, reject) {
4275
4263
  Promise.all(_this.urls.map(function(url) {
@@ -4295,9 +4283,7 @@ var TextureCubeLoader = /*#__PURE__*/ function(Loader) {
4295
4283
  return Loader.apply(this, arguments);
4296
4284
  }
4297
4285
  var _proto = TextureCubeLoader.prototype;
4298
- /**
4299
- * @override
4300
- */ _proto.load = function load(item, resourceManager) {
4286
+ _proto.load = function load(item, resourceManager) {
4301
4287
  var _this = this;
4302
4288
  return new AssetPromise(function(resolve, reject) {
4303
4289
  var urls = item.urls;
@@ -4463,16 +4449,12 @@ var KHR_draco_mesh_compression = (_KHR_draco_mesh_compression = /*#__PURE__*/ fu
4463
4449
  return GLTFExtensionParser.apply(this, arguments);
4464
4450
  }
4465
4451
  var _proto = KHR_draco_mesh_compression1.prototype;
4466
- /**
4467
- * @override
4468
- */ _proto.initialize = function initialize() {
4452
+ _proto.initialize = function initialize() {
4469
4453
  if (!KHR_draco_mesh_compression._decoder) {
4470
4454
  KHR_draco_mesh_compression._decoder = new DRACODecoder();
4471
4455
  }
4472
4456
  };
4473
- /**
4474
- * @override
4475
- */ _proto.createAndParse = function createAndParse(context, schema, glTFPrimitive, glTFMesh) {
4457
+ _proto.createAndParse = function createAndParse(context, schema, glTFPrimitive, glTFMesh) {
4476
4458
  var _this = this;
4477
4459
  var glTF = context.glTF, buffers = context.buffers, engine = context.glTFResource.engine;
4478
4460
  var bufferViews = glTF.bufferViews, accessors = glTF.accessors;
@@ -4627,9 +4609,7 @@ var KHR_lights_punctual = /*#__PURE__*/ function(GLTFExtensionParser) {
4627
4609
  return GLTFExtensionParser.apply(this, arguments);
4628
4610
  }
4629
4611
  var _proto = KHR_lights_punctual.prototype;
4630
- /**
4631
- * @override
4632
- */ _proto.additiveParse = function additiveParse(context, entity, extensionSchema) {
4612
+ _proto.additiveParse = function additiveParse(context, entity, extensionSchema) {
4633
4613
  var lightsSchema = context.glTF.extensions.KHR_lights_punctual.lights;
4634
4614
  var lightSchema = lightsSchema[extensionSchema.light];
4635
4615
  var color = lightSchema.color, _lightSchema_intensity = lightSchema.intensity, intensity = _lightSchema_intensity === void 0 ? 1 : _lightSchema_intensity, type = lightSchema.type, range = lightSchema.range, spot = lightSchema.spot;
@@ -4669,9 +4649,7 @@ var KHR_materials_clearcoat = /*#__PURE__*/ function(GLTFExtensionParser) {
4669
4649
  return GLTFExtensionParser.apply(this, arguments);
4670
4650
  }
4671
4651
  var _proto = KHR_materials_clearcoat.prototype;
4672
- /**
4673
- * @override
4674
- */ _proto.additiveParse = function additiveParse(context, material, schema) {
4652
+ _proto.additiveParse = function additiveParse(context, material, schema) {
4675
4653
  var textures = context.glTFResource.textures;
4676
4654
  var _schema_clearcoatFactor = schema.clearcoatFactor, clearcoatFactor = _schema_clearcoatFactor === void 0 ? 0 : _schema_clearcoatFactor, clearcoatTexture = schema.clearcoatTexture, _schema_clearcoatRoughnessFactor = schema.clearcoatRoughnessFactor, clearcoatRoughnessFactor = _schema_clearcoatRoughnessFactor === void 0 ? 0 : _schema_clearcoatRoughnessFactor, clearcoatRoughnessTexture = schema.clearcoatRoughnessTexture, clearcoatNormalTexture = schema.clearcoatNormalTexture;
4677
4655
  material.clearCoat = clearcoatFactor;
@@ -4701,9 +4679,7 @@ var KHR_materials_pbrSpecularGlossiness = /*#__PURE__*/ function(GLTFExtensionPa
4701
4679
  return GLTFExtensionParser.apply(this, arguments);
4702
4680
  }
4703
4681
  var _proto = KHR_materials_pbrSpecularGlossiness.prototype;
4704
- /**
4705
- * @override
4706
- */ _proto.createAndParse = function createAndParse(context, schema, ownerSchema) {
4682
+ _proto.createAndParse = function createAndParse(context, schema, ownerSchema) {
4707
4683
  var _context_glTFResource = context.glTFResource, engine = _context_glTFResource.engine, textures = _context_glTFResource.textures;
4708
4684
  var material = new PBRSpecularMaterial(engine);
4709
4685
  var diffuseFactor = schema.diffuseFactor, diffuseTexture = schema.diffuseTexture, specularFactor = schema.specularFactor, glossinessFactor = schema.glossinessFactor, specularGlossinessTexture = schema.specularGlossinessTexture;
@@ -4740,9 +4716,7 @@ var KHR_materials_unlit = /*#__PURE__*/ function(GLTFExtensionParser) {
4740
4716
  return GLTFExtensionParser.apply(this, arguments);
4741
4717
  }
4742
4718
  var _proto = KHR_materials_unlit.prototype;
4743
- /**
4744
- * @override
4745
- */ _proto.createAndParse = function createAndParse(context, _, ownerSchema) {
4719
+ _proto.createAndParse = function createAndParse(context, _, ownerSchema) {
4746
4720
  var engine = context.glTFResource.engine;
4747
4721
  var material = new UnlitMaterial(engine);
4748
4722
  material.name = ownerSchema.name;
@@ -4772,9 +4746,7 @@ var KHR_texture_transform = /*#__PURE__*/ function(GLTFExtensionParser) {
4772
4746
  return GLTFExtensionParser.apply(this, arguments);
4773
4747
  }
4774
4748
  var _proto = KHR_texture_transform.prototype;
4775
- /**
4776
- * @override
4777
- */ _proto.additiveParse = function additiveParse(context, material, schema) {
4749
+ _proto.additiveParse = function additiveParse(context, material, schema) {
4778
4750
  var offset = schema.offset, rotation = schema.rotation, scale = schema.scale, texCoord = schema.texCoord;
4779
4751
  if (offset) {
4780
4752
  material.tilingOffset.z = offset[0];
@@ -4803,9 +4775,7 @@ var GALACEAN_materials_remap = /*#__PURE__*/ function(GLTFExtensionParser) {
4803
4775
  return GLTFExtensionParser.apply(this, arguments);
4804
4776
  }
4805
4777
  var _proto = GALACEAN_materials_remap.prototype;
4806
- /**
4807
- * @override
4808
- */ _proto.createAndParse = function createAndParse(context, schema) {
4778
+ _proto.createAndParse = function createAndParse(context, schema) {
4809
4779
  var engine = context.glTFResource.engine;
4810
4780
  // @ts-ignore
4811
4781
  return engine.resourceManager.getResourceByRef(schema);
@@ -4822,9 +4792,7 @@ var GALACEAN_animation_event = /*#__PURE__*/ function(GLTFExtensionParser) {
4822
4792
  return GLTFExtensionParser.apply(this, arguments);
4823
4793
  }
4824
4794
  var _proto = GALACEAN_animation_event.prototype;
4825
- /**
4826
- * @override
4827
- */ _proto.additiveParse = function additiveParse(context, animationClip, schema) {
4795
+ _proto.additiveParse = function additiveParse(context, animationClip, schema) {
4828
4796
  context.glTFResource.engine;
4829
4797
  var events = schema.events;
4830
4798
  events.map(function(eventData) {