@galacean/engine 1.1.0-beta.10 → 1.1.0-beta.12

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.
package/dist/.DS_Store ADDED
Binary file
package/dist/browser.js CHANGED
@@ -20610,6 +20610,7 @@
20610
20610
  case "pointercancel":
20611
20611
  pointer.phase = exports.PointerPhase.Leave;
20612
20612
  pointer._firePointerExitAndEnter(null);
20613
+ break;
20613
20614
  }
20614
20615
  }
20615
20616
  events.length = 0;
@@ -20737,7 +20738,7 @@
20737
20738
  var point = PointerManager._tempPoint, ray = PointerManager._tempRay, hitResult = PointerManager._tempHitResult;
20738
20739
  for(var i = scenes.length - 1; i >= 0; i--){
20739
20740
  var scene = scenes[i];
20740
- if (scene.destroyed) {
20741
+ if (!scene.isActive || scene.destroyed) {
20741
20742
  continue;
20742
20743
  }
20743
20744
  var cameras = scene._activeCameras;
@@ -21268,7 +21269,7 @@
21268
21269
  * @internal
21269
21270
  */ var ShaderProgramPool = /*#__PURE__*/ function() {
21270
21271
  var ShaderProgramPool = function ShaderProgramPool() {
21271
- this._cacheHierarchy = 1;
21272
+ this._cacheHierarchyDepth = 1;
21272
21273
  this._cacheMap = Object.create(null);
21273
21274
  };
21274
21275
  var _proto = ShaderProgramPool.prototype;
@@ -21279,12 +21280,14 @@
21279
21280
  */ _proto.get = function get(macros) {
21280
21281
  var cacheMap = this._cacheMap;
21281
21282
  var maskLength = macros._length;
21282
- if (maskLength > this._cacheHierarchy) {
21283
- this._resizeCacheMapHierarchy(cacheMap, 0, maskLength);
21283
+ var cacheHierarchyDepth = this._cacheHierarchyDepth;
21284
+ if (maskLength > cacheHierarchyDepth) {
21285
+ this._resizeCacheMapHierarchy(cacheMap, 0, cacheHierarchyDepth, maskLength - cacheHierarchyDepth);
21286
+ this._cacheHierarchyDepth = maskLength;
21284
21287
  }
21285
21288
  var mask = macros._mask;
21286
21289
  var endIndex = macros._length - 1;
21287
- var maxEndIndex = this._cacheHierarchy - 1;
21290
+ var maxEndIndex = this._cacheHierarchyDepth - 1;
21288
21291
  for(var i = 0; i < maxEndIndex; i++){
21289
21292
  var subMask = endIndex < i ? 0 : mask[i];
21290
21293
  var subCacheShaders = cacheMap[subMask];
@@ -21309,25 +21312,21 @@
21309
21312
  */ _proto.cache = function cache(shaderProgram) {
21310
21313
  this._lastQueryMap[this._lastQueryKey] = shaderProgram;
21311
21314
  };
21312
- _proto._resizeCacheMapHierarchy = function _resizeCacheMapHierarchy(cacheMap, hierarchy, resizeLength) {
21313
- // only expand but not shrink.
21314
- var end = this._cacheHierarchy - 1;
21315
- if (hierarchy == end) {
21315
+ _proto._resizeCacheMapHierarchy = function _resizeCacheMapHierarchy(cacheMap, hierarchy, currentHierarchy, increaseHierarchy) {
21316
+ // Only expand but not shrink
21317
+ if (hierarchy == currentHierarchy - 1) {
21316
21318
  for(var k in cacheMap){
21317
21319
  var shader = cacheMap[k];
21318
21320
  var subCacheMap = cacheMap;
21319
- for(var i = 0, n = resizeLength - end; i < n; i++){
21320
- if (i == n - 1) {
21321
- subCacheMap[0] = shader;
21322
- } else {
21323
- subCacheMap = subCacheMap[i == 0 ? k : 0] = Object.create(null);
21324
- }
21321
+ for(var i = 0; i < increaseHierarchy; i++){
21322
+ subCacheMap[i == 0 ? k : 0] = subCacheMap = Object.create(null);
21325
21323
  }
21324
+ subCacheMap[0] = shader;
21326
21325
  }
21327
- this._cacheHierarchy = resizeLength;
21328
21326
  } else {
21327
+ hierarchy++;
21329
21328
  for(var k1 in cacheMap){
21330
- this._resizeCacheMapHierarchy(cacheMap[k1], ++hierarchy, resizeLength);
21329
+ this._resizeCacheMapHierarchy(cacheMap[k1], hierarchy, currentHierarchy, increaseHierarchy);
21331
21330
  }
21332
21331
  }
21333
21332
  };
@@ -21446,57 +21445,56 @@
21446
21445
  this._textRenderDataPool.resetPool();
21447
21446
  var _this = this, inputManager = _this.inputManager, physicsInitialized = _this._physicsInitialized;
21448
21447
  inputManager._update();
21449
- var loopScenes = this._sceneManager._scenes.getLoopArray();
21450
- var sceneCount = loopScenes.length;
21448
+ var scenes = this._sceneManager._scenes.getLoopArray();
21449
+ var sceneCount = scenes.length;
21451
21450
  // Sort cameras and fire script `onStart`
21452
21451
  for(var i = 0; i < sceneCount; i++){
21453
- var scene = loopScenes[i];
21454
- if (scene.destroyed) continue;
21452
+ var scene = scenes[i];
21453
+ if (!scene.isActive || scene.destroyed) continue;
21455
21454
  scene._cameraNeedSorting && scene._sortCameras();
21456
21455
  scene._componentsManager.callScriptOnStart();
21457
21456
  }
21458
21457
  // Update physics and fire `onPhysicsUpdate`
21459
21458
  if (physicsInitialized) {
21460
21459
  for(var i1 = 0; i1 < sceneCount; i1++){
21461
- var scene1 = loopScenes[i1];
21462
- if (scene1.destroyed) continue;
21460
+ var scene1 = scenes[i1];
21461
+ if (!scene1.isActive || scene1.destroyed) continue;
21463
21462
  scene1.physics._update(deltaTime);
21464
21463
  }
21465
21464
  }
21466
21465
  // Fire `onPointerXX`
21467
- physicsInitialized && inputManager._firePointerScript(loopScenes);
21466
+ physicsInitialized && inputManager._firePointerScript(scenes);
21468
21467
  // Fire `onUpdate`
21469
21468
  for(var i2 = 0; i2 < sceneCount; i2++){
21470
- var scene2 = loopScenes[i2];
21471
- if (scene2.destroyed) continue;
21469
+ var scene2 = scenes[i2];
21470
+ if (!scene2.isActive || scene2.destroyed) continue;
21472
21471
  scene2._componentsManager.callScriptOnUpdate(deltaTime);
21473
21472
  }
21474
21473
  // Update `Animator` logic
21475
21474
  for(var i3 = 0; i3 < sceneCount; i3++){
21476
- var scene3 = loopScenes[i3];
21477
- if (scene3.destroyed) continue;
21475
+ var scene3 = scenes[i3];
21476
+ if (!scene3.isActive || scene3.destroyed) continue;
21478
21477
  scene3._componentsManager.callAnimationUpdate(deltaTime);
21479
21478
  }
21480
21479
  // Fire `onLateUpdate`
21481
21480
  for(var i4 = 0; i4 < sceneCount; i4++){
21482
- var scene4 = loopScenes[i4];
21483
- if (scene4.destroyed) continue;
21481
+ var scene4 = scenes[i4];
21482
+ if (!scene4.isActive || scene4.destroyed) continue;
21484
21483
  scene4._componentsManager.callScriptOnLateUpdate(deltaTime);
21485
21484
  }
21486
21485
  // Render scene and fire `onBeginRender` and `onEndRender`
21487
21486
  if (!this._isDeviceLost) {
21488
- this._render(loopScenes);
21489
- }
21490
- // Handling invalid scripts and fire `onDestroy`
21491
- for(var i5 = 0; i5 < sceneCount; i5++){
21492
- var scene5 = loopScenes[i5];
21493
- if (scene5.destroyed) continue;
21494
- if (!this._waitingDestroy) {
21495
- scene5._componentsManager.handlingInvalidScripts();
21496
- }
21487
+ this._render(scenes);
21497
21488
  }
21498
21489
  if (this._waitingDestroy) {
21499
21490
  this._destroy();
21491
+ } else {
21492
+ // Handling invalid scripts and fire `onDestroy`
21493
+ for(var i5 = 0; i5 < sceneCount; i5++){
21494
+ var scene5 = scenes[i5];
21495
+ if (!scene5.isActive || scene5.destroyed) continue;
21496
+ scene5._componentsManager.handlingInvalidScripts();
21497
+ }
21500
21498
  }
21501
21499
  if (this._waitingGC) {
21502
21500
  this._gc();
@@ -21575,19 +21573,19 @@
21575
21573
  };
21576
21574
  /**
21577
21575
  * @internal
21578
- */ _proto._render = function _render(loopScenes) {
21576
+ */ _proto._render = function _render(scenes) {
21579
21577
  // Update `Renderer` logic and shader data
21580
- for(var i = 0, n = loopScenes.length; i < n; i++){
21581
- var scene = loopScenes[i];
21582
- if (scene.destroyed) continue;
21583
- var deltaTime = this.time.deltaTime;
21578
+ var deltaTime = this.time.deltaTime;
21579
+ for(var i = 0, n = scenes.length; i < n; i++){
21580
+ var scene = scenes[i];
21581
+ if (!scene.isActive || scene.destroyed) continue;
21584
21582
  scene._componentsManager.callRendererOnUpdate(deltaTime);
21585
21583
  scene._updateShaderData();
21586
21584
  }
21587
21585
  // Fire script `onBeginRender` and `onEndRender`
21588
- for(var i1 = 0, n1 = loopScenes.length; i1 < n1; i1++){
21589
- var scene1 = loopScenes[i1];
21590
- if (scene1.destroyed) continue;
21586
+ for(var i1 = 0, n1 = scenes.length; i1 < n1; i1++){
21587
+ var scene1 = scenes[i1];
21588
+ if (!scene1.isActive || scene1.destroyed) continue;
21591
21589
  var cameras = scene1._activeCameras;
21592
21590
  var cameraCount = cameras.length;
21593
21591
  if (cameraCount > 0) {
@@ -39659,6 +39657,25 @@
39659
39657
  return AbstractTranscoder;
39660
39658
  }();
39661
39659
  /** @internal */ function TranscodeWorkerCode$1() {
39660
+ var initPromise;
39661
+ var init = function init(wasmBinary) {
39662
+ if (!initPromise) {
39663
+ initPromise = new Promise(function(resolve, reject) {
39664
+ var BasisModule = {
39665
+ wasmBinary: wasmBinary,
39666
+ onRuntimeInitialized: function onRuntimeInitialized() {
39667
+ return resolve(BasisModule);
39668
+ },
39669
+ onAbort: reject
39670
+ };
39671
+ self["BASIS"](BasisModule);
39672
+ }).then(function(BasisModule) {
39673
+ BasisModule.initializeBasis();
39674
+ return BasisModule.KTX2File;
39675
+ });
39676
+ }
39677
+ return initPromise;
39678
+ };
39662
39679
  self.onmessage = function onmessage(event) {
39663
39680
  var message = event.data;
39664
39681
  switch(message.type){
@@ -39858,7 +39875,7 @@
39858
39875
  } else {
39859
39876
  var funcCode = TranscodeWorkerCode$1.toString();
39860
39877
  var transcodeString = funcCode.substring(funcCode.indexOf("{"), funcCode.lastIndexOf("}") + 1);
39861
- var workerCode = "\n " + jsCode + "\n var init = (" + _init.toString() + ")();\n " + transcode.toString() + "\n " + transcodeString + "\n ";
39878
+ var workerCode = "\n " + jsCode + "\n " + transcode.toString() + "\n " + transcodeString + "\n ";
39862
39879
  var workerURL = URL.createObjectURL(new Blob([
39863
39880
  workerCode
39864
39881
  ], {
@@ -42781,13 +42798,13 @@
42781
42798
  "scene"
42782
42799
  ], true)
42783
42800
  ], SceneLoader);
42784
- ReflectionParser.registerCustomParseComponent("TextRenderer", /*#__PURE__*/ _async_to_generator(function(instance, item, engine) {
42801
+ ReflectionParser.registerCustomParseComponent("TextRenderer", /*#__PURE__*/ _async_to_generator(function(instance, item) {
42785
42802
  var props;
42786
42803
  return __generator(this, function(_state) {
42787
42804
  props = item.props;
42788
42805
  if (!props.font) {
42789
42806
  // @ts-ignore
42790
- instance.font = Font.createFromOS(engine, props.fontFamily || "Arial");
42807
+ instance.font = Font.createFromOS(instance.engine, props.fontFamily || "Arial");
42791
42808
  }
42792
42809
  return [
42793
42810
  2,
@@ -43277,7 +43294,7 @@
43277
43294
  ], GALACEAN_animation_event);
43278
43295
 
43279
43296
  //@ts-ignore
43280
- var version = "1.1.0-beta.10";
43297
+ var version = "1.1.0-beta.12";
43281
43298
  console.log("Galacean engine version: " + version);
43282
43299
  for(var key in CoreObjects){
43283
43300
  Loader.registerClass(key, CoreObjects[key]);