@galacean/engine-loader 1.1.0-alpha.2 → 1.1.0-alpha.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.
@@ -3608,16 +3608,16 @@ exports.GLTFBufferParser = __decorate([
3608
3608
  registerGLTFParser(exports.GLTFParserType.Buffer)
3609
3609
  ], exports.GLTFBufferParser);
3610
3610
 
3611
- exports.GLTFEntityParser = /*#__PURE__*/ function(GLTFParser) {
3612
- _inherits(GLTFEntityParser, GLTFParser);
3611
+ exports.GLTFEntityParser = /*#__PURE__*/ function(GLTFParser1) {
3612
+ _inherits(GLTFEntityParser, GLTFParser1);
3613
3613
  function GLTFEntityParser() {
3614
- return GLTFParser.apply(this, arguments);
3614
+ return GLTFParser1.apply(this, arguments);
3615
3615
  }
3616
3616
  var _proto = GLTFEntityParser.prototype;
3617
3617
  _proto.parse = function parse(context, index) {
3618
3618
  var entityInfo = context.glTF.nodes[index];
3619
3619
  var engine = context.glTFResource.engine;
3620
- var matrix = entityInfo.matrix, translation = entityInfo.translation, rotation = entityInfo.rotation, scale = entityInfo.scale;
3620
+ var matrix = entityInfo.matrix, translation = entityInfo.translation, rotation = entityInfo.rotation, scale = entityInfo.scale, extensions = entityInfo.extensions;
3621
3621
  var entity = new miniprogram.Entity(engine, entityInfo.name || "_GLTF_ENTITY_" + index);
3622
3622
  var transform = entity.transform;
3623
3623
  if (matrix) {
@@ -3643,6 +3643,7 @@ exports.GLTFEntityParser = /*#__PURE__*/ function(GLTFParser) {
3643
3643
  entity.addChild(childEntity);
3644
3644
  }
3645
3645
  }
3646
+ GLTFParser.executeExtensionsAdditiveAndParse(extensions, context, entity, entityInfo);
3646
3647
  return entity;
3647
3648
  };
3648
3649
  return GLTFEntityParser;
@@ -4041,7 +4042,7 @@ exports.GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
4041
4042
  var _this = this;
4042
4043
  var glTF = context.glTF, glTFResource = context.glTFResource;
4043
4044
  var entityInfo = glTF.nodes[index];
4044
- var cameraID = entityInfo.camera, meshID = entityInfo.mesh, extensions = entityInfo.extensions;
4045
+ var cameraID = entityInfo.camera, meshID = entityInfo.mesh;
4045
4046
  var entity = context.get(exports.GLTFParserType.Entity, index);
4046
4047
  var promise;
4047
4048
  if (cameraID !== undefined) {
@@ -4058,7 +4059,6 @@ exports.GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
4058
4059
  promises.push(_this._parseEntityComponent(context, children[i]));
4059
4060
  }
4060
4061
  }
4061
- GLTFParser.executeExtensionsAdditiveAndParse(extensions, context, entity, entityInfo);
4062
4062
  return Promise.all(promises);
4063
4063
  });
4064
4064
  };
@@ -5434,8 +5434,6 @@ var SceneLoader = /*#__PURE__*/ function(Loader) {
5434
5434
  _this.request(item.url, {
5435
5435
  type: "json"
5436
5436
  }).then(function(data) {
5437
- // @ts-ignore
5438
- engine.resourceManager.initVirtualResources(data.files);
5439
5437
  return SceneParser.parse(engine, data).then(function(scene) {
5440
5438
  var promises = [];
5441
5439
  // parse ambient light
@@ -5463,6 +5461,10 @@ var SceneLoader = /*#__PURE__*/ function(Loader) {
5463
5461
  scene.ambientLight.diffuseSolidColor.copyFrom(ambient.diffuseSolidColor);
5464
5462
  });
5465
5463
  promises.push(ambientLightPromise);
5464
+ } else {
5465
+ scene.ambientLight.diffuseIntensity = ambient.diffuseIntensity;
5466
+ scene.ambientLight.specularIntensity = ambient.specularIntensity;
5467
+ scene.ambientLight.diffuseSolidColor.copyFrom(ambient.diffuseSolidColor);
5466
5468
  }
5467
5469
  var background = data.scene.background;
5468
5470
  scene.background.mode = background.mode;
package/dist/module.js CHANGED
@@ -3603,16 +3603,16 @@ GLTFBufferParser = __decorate([
3603
3603
  registerGLTFParser(GLTFParserType.Buffer)
3604
3604
  ], GLTFBufferParser);
3605
3605
 
3606
- var GLTFEntityParser = /*#__PURE__*/ function(GLTFParser) {
3607
- _inherits(GLTFEntityParser, GLTFParser);
3606
+ var GLTFEntityParser = /*#__PURE__*/ function(GLTFParser1) {
3607
+ _inherits(GLTFEntityParser, GLTFParser1);
3608
3608
  function GLTFEntityParser() {
3609
- return GLTFParser.apply(this, arguments);
3609
+ return GLTFParser1.apply(this, arguments);
3610
3610
  }
3611
3611
  var _proto = GLTFEntityParser.prototype;
3612
3612
  _proto.parse = function parse(context, index) {
3613
3613
  var entityInfo = context.glTF.nodes[index];
3614
3614
  var engine = context.glTFResource.engine;
3615
- var matrix = entityInfo.matrix, translation = entityInfo.translation, rotation = entityInfo.rotation, scale = entityInfo.scale;
3615
+ var matrix = entityInfo.matrix, translation = entityInfo.translation, rotation = entityInfo.rotation, scale = entityInfo.scale, extensions = entityInfo.extensions;
3616
3616
  var entity = new Entity(engine, entityInfo.name || "_GLTF_ENTITY_" + index);
3617
3617
  var transform = entity.transform;
3618
3618
  if (matrix) {
@@ -3638,6 +3638,7 @@ var GLTFEntityParser = /*#__PURE__*/ function(GLTFParser) {
3638
3638
  entity.addChild(childEntity);
3639
3639
  }
3640
3640
  }
3641
+ GLTFParser.executeExtensionsAdditiveAndParse(extensions, context, entity, entityInfo);
3641
3642
  return entity;
3642
3643
  };
3643
3644
  return GLTFEntityParser;
@@ -4036,7 +4037,7 @@ var GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
4036
4037
  var _this = this;
4037
4038
  var glTF = context.glTF, glTFResource = context.glTFResource;
4038
4039
  var entityInfo = glTF.nodes[index];
4039
- var cameraID = entityInfo.camera, meshID = entityInfo.mesh, extensions = entityInfo.extensions;
4040
+ var cameraID = entityInfo.camera, meshID = entityInfo.mesh;
4040
4041
  var entity = context.get(GLTFParserType.Entity, index);
4041
4042
  var promise;
4042
4043
  if (cameraID !== undefined) {
@@ -4053,7 +4054,6 @@ var GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
4053
4054
  promises.push(_this._parseEntityComponent(context, children[i]));
4054
4055
  }
4055
4056
  }
4056
- GLTFParser.executeExtensionsAdditiveAndParse(extensions, context, entity, entityInfo);
4057
4057
  return Promise.all(promises);
4058
4058
  });
4059
4059
  };
@@ -5429,8 +5429,6 @@ var SceneLoader = /*#__PURE__*/ function(Loader) {
5429
5429
  _this.request(item.url, {
5430
5430
  type: "json"
5431
5431
  }).then(function(data) {
5432
- // @ts-ignore
5433
- engine.resourceManager.initVirtualResources(data.files);
5434
5432
  return SceneParser.parse(engine, data).then(function(scene) {
5435
5433
  var promises = [];
5436
5434
  // parse ambient light
@@ -5458,6 +5456,10 @@ var SceneLoader = /*#__PURE__*/ function(Loader) {
5458
5456
  scene.ambientLight.diffuseSolidColor.copyFrom(ambient.diffuseSolidColor);
5459
5457
  });
5460
5458
  promises.push(ambientLightPromise);
5459
+ } else {
5460
+ scene.ambientLight.diffuseIntensity = ambient.diffuseIntensity;
5461
+ scene.ambientLight.specularIntensity = ambient.specularIntensity;
5462
+ scene.ambientLight.diffuseSolidColor.copyFrom(ambient.diffuseSolidColor);
5461
5463
  }
5462
5464
  var background = data.scene.background;
5463
5465
  scene.background.mode = background.mode;