@galacean/engine-loader 1.0.0-beta.19 → 1.0.0-beta.21

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.
@@ -41,61 +41,56 @@ function _inherits(subClass, superClass) {
41
41
  if (superClass) _set_prototype_of(subClass, superClass);
42
42
  }
43
43
 
44
- /******************************************************************************
45
- Copyright (c) Microsoft Corporation.
46
-
47
- Permission to use, copy, modify, and/or distribute this software for any
48
- purpose with or without fee is hereby granted.
49
-
50
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
51
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
52
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
53
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
54
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
55
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
56
- PERFORMANCE OF THIS SOFTWARE.
57
- ***************************************************************************** */
58
-
59
- function __decorate(decorators, target, key, desc) {
60
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
61
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
62
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
63
- return c > 3 && r && Object.defineProperty(target, key, r), r;
44
+ /******************************************************************************
45
+ Copyright (c) Microsoft Corporation.
46
+
47
+ Permission to use, copy, modify, and/or distribute this software for any
48
+ purpose with or without fee is hereby granted.
49
+
50
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
51
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
52
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
53
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
54
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
55
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
56
+ PERFORMANCE OF THIS SOFTWARE.
57
+ ***************************************************************************** */
58
+
59
+ function __decorate(decorators, target, key, desc) {
60
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
61
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
62
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
63
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
64
+ }
65
+
66
+ function __generator(thisArg, body) {
67
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
68
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
69
+ function verb(n) { return function (v) { return step([n, v]); }; }
70
+ function step(op) {
71
+ if (f) throw new TypeError("Generator is already executing.");
72
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
73
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
74
+ if (y = 0, t) op = [op[0] & 2, t.value];
75
+ switch (op[0]) {
76
+ case 0: case 1: t = op; break;
77
+ case 4: _.label++; return { value: op[1], done: false };
78
+ case 5: _.label++; y = op[1]; op = [0]; continue;
79
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
80
+ default:
81
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
82
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
83
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
84
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
85
+ if (t[2]) _.ops.pop();
86
+ _.trys.pop(); continue;
87
+ }
88
+ op = body.call(thisArg, _);
89
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
90
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
91
+ }
64
92
  }
65
93
 
66
- function __generator(thisArg, body) {
67
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
68
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
69
- function verb(n) { return function (v) { return step([n, v]); }; }
70
- function step(op) {
71
- if (f) throw new TypeError("Generator is already executing.");
72
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
73
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
74
- if (y = 0, t) op = [op[0] & 2, t.value];
75
- switch (op[0]) {
76
- case 0: case 1: t = op; break;
77
- case 4: _.label++; return { value: op[1], done: false };
78
- case 5: _.label++; y = op[1]; op = [0]; continue;
79
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
80
- default:
81
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
82
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
83
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
84
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
85
- if (t[2]) _.ops.pop();
86
- _.trys.pop(); continue;
87
- }
88
- op = body.call(thisArg, _);
89
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
90
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
91
- }
92
- }
93
-
94
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
95
- var e = new Error(message);
96
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
97
- };
98
-
99
94
  var AnimatorControllerLoader = /*#__PURE__*/ function(Loader1) {
100
95
  _inherits(AnimatorControllerLoader, Loader1);
101
96
  function AnimatorControllerLoader() {
@@ -1674,13 +1669,13 @@ var GLTFEntityParser = /*#__PURE__*/ function(GLTFParser) {
1674
1669
  }
1675
1670
  sceneRoots[i] = rootEntity;
1676
1671
  }
1672
+ // @ts-ignore
1673
+ sceneRoots[i]._hookResource = glTFResource;
1674
+ // @ts-ignore
1675
+ glTFResource._addReferCount(1);
1677
1676
  }
1678
1677
  glTFResource.sceneRoots = sceneRoots;
1679
1678
  glTFResource.defaultSceneRoot = sceneRoots[sceneID];
1680
- // @ts-ignore
1681
- glTFResource.defaultSceneRoot._hookResource = glTFResource;
1682
- // @ts-ignore
1683
- glTFResource._addReferCount(1);
1684
1679
  };
1685
1680
  return GLTFEntityParser;
1686
1681
  }(GLTFParser);
@@ -4548,6 +4543,10 @@ var SceneLoader = /*#__PURE__*/ function(Loader) {
4548
4543
  scene.ambientLight.diffuseSolidColor.copyFrom(ambient.diffuseSolidColor);
4549
4544
  });
4550
4545
  promises.push(ambientLightPromise);
4546
+ } else {
4547
+ scene.ambientLight.diffuseIntensity = ambient.diffuseIntensity;
4548
+ scene.ambientLight.specularIntensity = ambient.specularIntensity;
4549
+ scene.ambientLight.diffuseSolidColor.copyFrom(ambient.diffuseSolidColor);
4551
4550
  }
4552
4551
  var background = data.scene.background;
4553
4552
  scene.background.mode = background.mode;
package/dist/module.js CHANGED
@@ -36,61 +36,56 @@ function _inherits(subClass, superClass) {
36
36
  if (superClass) _set_prototype_of(subClass, superClass);
37
37
  }
38
38
 
39
- /******************************************************************************
40
- Copyright (c) Microsoft Corporation.
41
-
42
- Permission to use, copy, modify, and/or distribute this software for any
43
- purpose with or without fee is hereby granted.
44
-
45
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
46
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
47
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
48
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
49
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
50
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
51
- PERFORMANCE OF THIS SOFTWARE.
52
- ***************************************************************************** */
53
-
54
- function __decorate(decorators, target, key, desc) {
55
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
56
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
57
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
58
- return c > 3 && r && Object.defineProperty(target, key, r), r;
39
+ /******************************************************************************
40
+ Copyright (c) Microsoft Corporation.
41
+
42
+ Permission to use, copy, modify, and/or distribute this software for any
43
+ purpose with or without fee is hereby granted.
44
+
45
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
46
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
47
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
48
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
49
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
50
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
51
+ PERFORMANCE OF THIS SOFTWARE.
52
+ ***************************************************************************** */
53
+
54
+ function __decorate(decorators, target, key, desc) {
55
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
56
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
57
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
58
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
59
+ }
60
+
61
+ function __generator(thisArg, body) {
62
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
63
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
64
+ function verb(n) { return function (v) { return step([n, v]); }; }
65
+ function step(op) {
66
+ if (f) throw new TypeError("Generator is already executing.");
67
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
68
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
69
+ if (y = 0, t) op = [op[0] & 2, t.value];
70
+ switch (op[0]) {
71
+ case 0: case 1: t = op; break;
72
+ case 4: _.label++; return { value: op[1], done: false };
73
+ case 5: _.label++; y = op[1]; op = [0]; continue;
74
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
75
+ default:
76
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
77
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
78
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
79
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
80
+ if (t[2]) _.ops.pop();
81
+ _.trys.pop(); continue;
82
+ }
83
+ op = body.call(thisArg, _);
84
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
85
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
86
+ }
59
87
  }
60
88
 
61
- function __generator(thisArg, body) {
62
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
63
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
64
- function verb(n) { return function (v) { return step([n, v]); }; }
65
- function step(op) {
66
- if (f) throw new TypeError("Generator is already executing.");
67
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
68
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
69
- if (y = 0, t) op = [op[0] & 2, t.value];
70
- switch (op[0]) {
71
- case 0: case 1: t = op; break;
72
- case 4: _.label++; return { value: op[1], done: false };
73
- case 5: _.label++; y = op[1]; op = [0]; continue;
74
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
75
- default:
76
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
77
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
78
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
79
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
80
- if (t[2]) _.ops.pop();
81
- _.trys.pop(); continue;
82
- }
83
- op = body.call(thisArg, _);
84
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
85
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
86
- }
87
- }
88
-
89
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
90
- var e = new Error(message);
91
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
92
- };
93
-
94
89
  var AnimatorControllerLoader = /*#__PURE__*/ function(Loader1) {
95
90
  _inherits(AnimatorControllerLoader, Loader1);
96
91
  function AnimatorControllerLoader() {
@@ -1669,13 +1664,13 @@ var GLTFEntityParser = /*#__PURE__*/ function(GLTFParser) {
1669
1664
  }
1670
1665
  sceneRoots[i] = rootEntity;
1671
1666
  }
1667
+ // @ts-ignore
1668
+ sceneRoots[i]._hookResource = glTFResource;
1669
+ // @ts-ignore
1670
+ glTFResource._addReferCount(1);
1672
1671
  }
1673
1672
  glTFResource.sceneRoots = sceneRoots;
1674
1673
  glTFResource.defaultSceneRoot = sceneRoots[sceneID];
1675
- // @ts-ignore
1676
- glTFResource.defaultSceneRoot._hookResource = glTFResource;
1677
- // @ts-ignore
1678
- glTFResource._addReferCount(1);
1679
1674
  };
1680
1675
  return GLTFEntityParser;
1681
1676
  }(GLTFParser);
@@ -4543,6 +4538,10 @@ var SceneLoader = /*#__PURE__*/ function(Loader) {
4543
4538
  scene.ambientLight.diffuseSolidColor.copyFrom(ambient.diffuseSolidColor);
4544
4539
  });
4545
4540
  promises.push(ambientLightPromise);
4541
+ } else {
4542
+ scene.ambientLight.diffuseIntensity = ambient.diffuseIntensity;
4543
+ scene.ambientLight.specularIntensity = ambient.specularIntensity;
4544
+ scene.ambientLight.diffuseSolidColor.copyFrom(ambient.diffuseSolidColor);
4546
4545
  }
4547
4546
  var background = data.scene.background;
4548
4547
  scene.background.mode = background.mode;