@galacean/engine-core 1.1.0-beta.0 → 1.1.0-beta.10

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.
Files changed (122) hide show
  1. package/dist/main.js +745 -396
  2. package/dist/main.js.map +1 -1
  3. package/dist/miniprogram.js +745 -396
  4. package/dist/module.js +734 -397
  5. package/dist/module.js.map +1 -1
  6. package/package.json +3 -3
  7. package/types/Background.d.ts +8 -0
  8. package/types/Component.d.ts +1 -1
  9. package/types/DisorderedArray.d.ts +1 -1
  10. package/types/RenderPipeline/MeshRenderElement.d.ts +3 -1
  11. package/types/RenderPipeline/SpriteElement.d.ts +3 -1
  12. package/types/RenderPipeline/SpriteMaskElement.d.ts +3 -1
  13. package/types/RenderPipeline/TextRenderElement.d.ts +3 -1
  14. package/types/Scene.d.ts +6 -0
  15. package/types/lighting/DirectLight.d.ts +8 -1
  16. package/types/lighting/Light.d.ts +0 -4
  17. package/types/lighting/LightManager.d.ts +7 -0
  18. package/types/lighting/PointLight.d.ts +9 -1
  19. package/types/lighting/SpotLight.d.ts +12 -1
  20. package/types/particle/ParticleGenerator.d.ts +0 -2
  21. package/types/particle/index.d.ts +10 -0
  22. package/types/particle/modules/MainModule.d.ts +7 -5
  23. package/types/particle/modules/ParticleGeneratorModule.d.ts +0 -1
  24. package/types/particle/modules/RotationOverLifetimeModule.d.ts +1 -1
  25. package/types/particle/modules/TextureSheetAnimationModule.d.ts +0 -4
  26. package/types/physics/Collider.d.ts +3 -1
  27. package/types/physics/PhysicsMaterial.d.ts +1 -0
  28. package/types/physics/joint/HingeJoint.d.ts +1 -1
  29. package/types/physics/joint/Joint.d.ts +4 -3
  30. package/types/physics/shape/ColliderShape.d.ts +2 -1
  31. package/types/physics/shape/SphereColliderShape.d.ts +1 -0
  32. package/types/RenderPipeline/RenderElementX.d.ts +0 -12
  33. package/types/SafeLoopArray.d.ts +0 -37
  34. package/types/Ticker.d.ts +0 -30
  35. package/types/animation/internal/AnimationCurveOwnerLayerData.d.ts +0 -1
  36. package/types/graphic/PrimitiveVertexBinding.d.ts +0 -1
  37. package/types/particle/ParticleData.d.ts +0 -1
  38. package/types/particle/ParticleMesh.d.ts +0 -289
  39. package/types/particle/ParticleShaderDeclaration.d.ts +0 -1
  40. package/types/particle/ParticleShaderMacro.d.ts +0 -1
  41. package/types/particle/ParticleShaderProperty.d.ts +0 -1
  42. package/types/particle/ParticleSystem.d.ts +0 -41
  43. package/types/particle/ParticleVertexElements.d.ts +0 -1
  44. package/types/particle/ParticleVertexUtils.d.ts +0 -1
  45. package/types/particle/enum/ParticleAnimationRowMode.d.ts +0 -9
  46. package/types/particle/enum/ParticleAnimationType.d.ts +0 -9
  47. package/types/particle/enum/ParticleCurveMode.d.ts +0 -13
  48. package/types/particle/enum/ParticleGradientMode.d.ts +0 -13
  49. package/types/particle/enum/ParticleRenderMode.d.ts +0 -17
  50. package/types/particle/enum/ParticleScaleMode.d.ts +0 -11
  51. package/types/particle/enum/ParticleShapeMultiModeValue.d.ts +0 -9
  52. package/types/particle/enum/ParticleShapeType.d.ts +0 -15
  53. package/types/particle/enum/ParticleSimulationSpace.d.ts +0 -9
  54. package/types/particle/enum/index.d.ts +0 -9
  55. package/types/particle/module/Burst.d.ts +0 -38
  56. package/types/particle/module/ColorGradient.d.ts +0 -75
  57. package/types/particle/module/ColorOverLifetimeModule.d.ts +0 -20
  58. package/types/particle/module/EmissionModule.d.ts +0 -63
  59. package/types/particle/module/FrameOverTime.d.ts +0 -73
  60. package/types/particle/module/ParticleCurve.d.ts +0 -37
  61. package/types/particle/module/RotationOverLifetimeModule.d.ts +0 -21
  62. package/types/particle/module/RotationVelocityGradient.d.ts +0 -184
  63. package/types/particle/module/SizeGradient.d.ts +0 -151
  64. package/types/particle/module/SizeOverLifetimeModule.d.ts +0 -21
  65. package/types/particle/module/StartFrame.d.ts +0 -46
  66. package/types/particle/module/TextureSheetAnimationModule.d.ts +0 -37
  67. package/types/particle/module/VelocityGradient.d.ts +0 -110
  68. package/types/particle/module/VelocityOverLifetimeModule.d.ts +0 -22
  69. package/types/particle/module/index.d.ts +0 -15
  70. package/types/particle/module/shape/BaseShape.d.ts +0 -26
  71. package/types/particle/module/shape/BoxShape.d.ts +0 -20
  72. package/types/particle/module/shape/CircleShape.d.ts +0 -27
  73. package/types/particle/module/shape/ConeShape.d.ts +0 -35
  74. package/types/particle/module/shape/HemisphereShape.d.ts +0 -23
  75. package/types/particle/module/shape/ShapeUtils.d.ts +0 -1
  76. package/types/particle/module/shape/SphereShape.d.ts +0 -23
  77. package/types/particle/module/shape/index.d.ts +0 -5
  78. package/types/particle/modules/ShapeModule.d.ts +0 -9
  79. package/types/particle/modules/shape/enums/ParticleShapeMultiModeValue.d.ts +0 -9
  80. package/types/particle/moudules/Burst.d.ts +0 -25
  81. package/types/particle/moudules/Emission.d.ts +0 -47
  82. package/types/particle/moudules/EmissionModule.d.ts +0 -49
  83. package/types/particle/moudules/MainModule.d.ts +0 -59
  84. package/types/particle/moudules/ParticleCurve.d.ts +0 -27
  85. package/types/particle/moudules/ParticleGradient.d.ts +0 -28
  86. package/types/particle/moudules/ShapeModule.d.ts +0 -7
  87. package/types/particle/moudules/shape/BaseShape.d.ts +0 -28
  88. package/types/particle/moudules/shape/BoxShape.d.ts +0 -20
  89. package/types/particle/moudules/shape/CircleShape.d.ts +0 -27
  90. package/types/particle/moudules/shape/ConeShape.d.ts +0 -35
  91. package/types/particle/moudules/shape/HemisphereShape.d.ts +0 -23
  92. package/types/particle/moudules/shape/ShapeUtils.d.ts +0 -1
  93. package/types/particle/moudules/shape/SphereShape.d.ts +0 -23
  94. package/types/particle/moudules/shape/enums/ParticleShapeMultiModeValue.d.ts +0 -9
  95. package/types/particle/moudules/shape/enums/ParticleShapeType.d.ts +0 -15
  96. package/types/particle/moudules/shape/index.d.ts +0 -5
  97. package/types/shadow/PipelinePass.d.ts +0 -16
  98. package/types/utils/BoolUpdateFlag.d.ts +0 -12
  99. package/types/utils/DisorderedArray.d.ts +0 -18
  100. package/types/utils/UpdateFlag.d.ts +0 -20
  101. package/types/utils/UpdateFlagManager.d.ts +0 -1
  102. package/types/utils/Utils.d.ts +0 -31
  103. package/types/xr/XRManager.d.ts +0 -31
  104. package/types/xr/component/XRPoseDriver.d.ts +0 -10
  105. package/types/xr/data/XRCamera.d.ts +0 -6
  106. package/types/xr/data/XRDevice.d.ts +0 -9
  107. package/types/xr/data/XRHandle.d.ts +0 -10
  108. package/types/xr/enum/EnumXRButton.d.ts +0 -5
  109. package/types/xr/enum/EnumXRDevicePhase.d.ts +0 -4
  110. package/types/xr/enum/EnumXRFeature.d.ts +0 -9
  111. package/types/xr/enum/EnumXRInputSource.d.ts +0 -8
  112. package/types/xr/enum/EnumXRMode.d.ts +0 -7
  113. package/types/xr/enum/EnumXRSubsystem.d.ts +0 -4
  114. package/types/xr/enum/EnumXRTrackingMode.d.ts +0 -7
  115. package/types/xr/feature/XRCameraManager.d.ts +0 -21
  116. package/types/xr/feature/XRFeature.d.ts +0 -29
  117. package/types/xr/feature/XRImageTrackManager.d.ts +0 -10
  118. package/types/xr/feature/XRInputManager.d.ts +0 -16
  119. package/types/xr/index.d.ts +0 -18
  120. package/types/xr/provider/XRProvider.d.ts +0 -19
  121. package/types/xr/subsystem/XRInputSubsystem.d.ts +0 -5
  122. package/types/xr/subsystem/XRSubsystem.d.ts +0 -30
@@ -554,6 +554,7 @@ function _instanceof(left, right) {
554
554
  for(var i = 0; i < length; i++){
555
555
  CloneManager.cloneProperty(sourceProperty, targetPropertyA, i, cloneMode);
556
556
  }
557
+ break;
557
558
  default:
558
559
  var _target, _k;
559
560
  var targetOProperty = (_target = target)[_k = k] || (_target[_k] = new sourceProperty.constructor());
@@ -2542,8 +2543,8 @@ var ActiveChangeFlag;
2542
2543
  var _this;
2543
2544
  _this = EngineObject1.call(this, entity.engine) || this;
2544
2545
  /** @internal */ _this._awoken = false;
2545
- _this._phasedActive = false;
2546
2546
  _this._phasedActiveInScene = false;
2547
+ _this._phasedActive = false;
2547
2548
  _this._enabled = true;
2548
2549
  _this._entity = entity;
2549
2550
  return _this;
@@ -2675,10 +2676,10 @@ __decorate([
2675
2676
  ], Component.prototype, "_awoken", void 0);
2676
2677
  __decorate([
2677
2678
  ignoreClone
2678
- ], Component.prototype, "_phasedActive", void 0);
2679
+ ], Component.prototype, "_phasedActiveInScene", void 0);
2679
2680
  __decorate([
2680
2681
  ignoreClone
2681
- ], Component.prototype, "_phasedActiveInScene", void 0);
2682
+ ], Component.prototype, "_phasedActive", void 0);
2682
2683
  __decorate([
2683
2684
  assignmentClone
2684
2685
  ], Component.prototype, "_enabled", void 0);
@@ -2835,14 +2836,14 @@ exports.DependentMode = void 0;
2835
2836
  }
2836
2837
  return end;
2837
2838
  };
2838
- _proto.forEach = function forEach(callbackFn) {
2839
+ _proto.forEach = function forEach(callbackFn, swapFn) {
2839
2840
  this._startLoop();
2840
2841
  var elements = this._elements;
2841
2842
  for(var i = 0; i < this.length; i++){
2842
2843
  var element = elements[i];
2843
2844
  element && callbackFn(element);
2844
2845
  }
2845
- this._endLoop();
2846
+ this._endLoop(swapFn);
2846
2847
  };
2847
2848
  _proto.forEachAndClean = function forEachAndClean(callbackFn) {
2848
2849
  this._startLoop();
@@ -2859,16 +2860,24 @@ exports.DependentMode = void 0;
2859
2860
  _proto._startLoop = function _startLoop() {
2860
2861
  this._isLooping = true;
2861
2862
  };
2862
- _proto._endLoop = function _endLoop() {
2863
+ _proto._endLoop = function _endLoop(swapFn) {
2863
2864
  this._isLooping = false;
2864
2865
  if (this._blankCount) {
2866
+ var from = 0;
2867
+ var to = this.length - 1;
2865
2868
  var elements = this._elements;
2866
- for(var i = 0, j = 0, n = this.length; i < n; i++){
2867
- var element = elements[i];
2868
- if (element) {
2869
- elements[j++] = element;
2870
- }
2871
- }
2869
+ partition: do {
2870
+ while(elements[from])if (++from >= to) {
2871
+ break partition;
2872
+ }
2873
+ while(!elements[to])if (from >= --to) {
2874
+ break partition;
2875
+ }
2876
+ var swapElement = elements[to];
2877
+ swapFn(swapElement, from);
2878
+ elements[from++] = swapElement;
2879
+ elements[to--] = null;
2880
+ }while (from < to);
2872
2881
  this.length -= this._blankCount;
2873
2882
  this._blankCount = 0;
2874
2883
  }
@@ -4232,12 +4241,6 @@ var ComponentCloner = /*#__PURE__*/ function() {
4232
4241
  this._hookResource._addReferCount(-1);
4233
4242
  this._hookResource = null;
4234
4243
  }
4235
- this.isActive = false;
4236
- if (this._isRoot) {
4237
- this._scene.removeRootEntity(this);
4238
- } else {
4239
- this._setParent(null);
4240
- }
4241
4244
  var components = this._components;
4242
4245
  for(var i = components.length - 1; i >= 0; i--){
4243
4246
  components[i].destroy();
@@ -4247,6 +4250,12 @@ var ComponentCloner = /*#__PURE__*/ function() {
4247
4250
  while(children.length > 0){
4248
4251
  children[0].destroy();
4249
4252
  }
4253
+ if (this._isRoot) {
4254
+ this._scene.removeRootEntity(this);
4255
+ } else {
4256
+ this._setParent(null);
4257
+ }
4258
+ this.isActive = false;
4250
4259
  };
4251
4260
  /**
4252
4261
  * @internal
@@ -6229,6 +6238,12 @@ var ShaderFactory = /*#__PURE__*/ function() {
6229
6238
  };
6230
6239
  return BlendState;
6231
6240
  }();
6241
+ __decorate([
6242
+ deepClone
6243
+ ], BlendState.prototype, "targetBlendState", void 0);
6244
+ __decorate([
6245
+ deepClone
6246
+ ], BlendState.prototype, "blendColor", void 0);
6232
6247
 
6233
6248
  /**
6234
6249
  * Depth state.
@@ -6611,6 +6626,18 @@ var ShaderFactory = /*#__PURE__*/ function() {
6611
6626
  };
6612
6627
  return RenderState;
6613
6628
  }();
6629
+ __decorate([
6630
+ deepClone
6631
+ ], RenderState.prototype, "blendState", void 0);
6632
+ __decorate([
6633
+ deepClone
6634
+ ], RenderState.prototype, "depthState", void 0);
6635
+ __decorate([
6636
+ deepClone
6637
+ ], RenderState.prototype, "stencilState", void 0);
6638
+ __decorate([
6639
+ deepClone
6640
+ ], RenderState.prototype, "rasterState", void 0);
6614
6641
 
6615
6642
  /**
6616
6643
  * Shader for rendering.
@@ -7519,7 +7546,7 @@ __decorate([
7519
7546
  ignoreClone
7520
7547
  ], exports.Renderer.prototype, "_globalShaderMacro", void 0);
7521
7548
  __decorate([
7522
- deepClone
7549
+ ignoreClone
7523
7550
  ], exports.Renderer.prototype, "_bounds", void 0);
7524
7551
  __decorate([
7525
7552
  ignoreClone
@@ -12296,7 +12323,7 @@ var SpriteMaskBatcher = /*#__PURE__*/ function(Basic2DBatcher1) {
12296
12323
  _proto.drawBatches = function drawBatches(camera) {
12297
12324
  var _this = this, engine = _this._engine, batchedQueue = _this._batchedQueue;
12298
12325
  var mesh = this._meshes[this._flushId];
12299
- var subMeshes = mesh.subMeshes;
12326
+ var subMeshes = mesh.subMeshes, primitive = mesh._primitive;
12300
12327
  var sceneData = camera.scene.shaderData;
12301
12328
  var cameraData = camera.shaderData;
12302
12329
  for(var i = 0, len = subMeshes.length; i < len; i++){
@@ -12328,7 +12355,7 @@ var SpriteMaskBatcher = /*#__PURE__*/ function(Basic2DBatcher1) {
12328
12355
  program.uploadAll(program.rendererUniformBlock, renderer.shaderData);
12329
12356
  program.uploadAll(program.materialUniformBlock, material.shaderData);
12330
12357
  material.renderState._apply(engine, false, pass._renderStateDataMap, material.shaderData);
12331
- engine._hardwareRenderer.drawPrimitive(mesh, subMesh, program);
12358
+ engine._hardwareRenderer.drawPrimitive(primitive, subMesh, program);
12332
12359
  }
12333
12360
  };
12334
12361
  return SpriteMaskBatcher;
@@ -12574,16 +12601,31 @@ var SafeLoopArray = /*#__PURE__*/ function() {
12574
12601
  }
12575
12602
  var _proto = SceneManager.prototype;
12576
12603
  _proto.addScene = function addScene(indexOrScene, scene) {
12604
+ var scenes = this._scenes;
12605
+ var index;
12577
12606
  if (typeof indexOrScene === "number") {
12578
- this._scenes.add(indexOrScene, scene);
12607
+ if (indexOrScene < 0 || indexOrScene > scenes.length) {
12608
+ throw "The index is out of range.";
12609
+ }
12610
+ index = indexOrScene;
12579
12611
  } else {
12612
+ index = scenes.length;
12580
12613
  scene = indexOrScene;
12581
- this._scenes.push(scene);
12582
12614
  }
12583
12615
  if (scene.engine !== this.engine) {
12584
12616
  throw "The scene is not belong to this engine.";
12585
12617
  }
12586
- scene._processActive(true);
12618
+ if (scene._sceneManager) {
12619
+ var currentIndex = scenes.indexOf(scene);
12620
+ if (currentIndex !== index) {
12621
+ scenes.removeByIndex(currentIndex);
12622
+ scenes.add(index, scene);
12623
+ }
12624
+ } else {
12625
+ scene._sceneManager = this;
12626
+ scenes.add(index, scene);
12627
+ scene.isActive && scene._processActive(true);
12628
+ }
12587
12629
  };
12588
12630
  /**
12589
12631
  * Remove scene.
@@ -12594,7 +12636,8 @@ var SafeLoopArray = /*#__PURE__*/ function() {
12594
12636
  if (index !== -1) {
12595
12637
  var removedScene = scenes.getArray()[index];
12596
12638
  scenes.removeByIndex(index);
12597
- removedScene._processActive(false);
12639
+ scene._sceneManager = null;
12640
+ removedScene.isActive && removedScene._processActive(false);
12598
12641
  }
12599
12642
  };
12600
12643
  /**
@@ -13251,11 +13294,15 @@ var rePropName = RegExp(// Match anything that isn't a dot or bracket.
13251
13294
  if (this._currentEnteredEntity) {
13252
13295
  this._currentEnteredEntity._scripts.forEach(function(element) {
13253
13296
  element.onPointerExit(_this);
13297
+ }, function(element, index) {
13298
+ element._entityScriptsIndex = index;
13254
13299
  });
13255
13300
  }
13256
13301
  if (rayCastEntity) {
13257
13302
  rayCastEntity._scripts.forEach(function(element) {
13258
13303
  element.onPointerEnter(_this);
13304
+ }, function(element, index) {
13305
+ element._entityScriptsIndex = index;
13259
13306
  });
13260
13307
  }
13261
13308
  this._currentEnteredEntity = rayCastEntity;
@@ -13268,6 +13315,8 @@ var rePropName = RegExp(// Match anything that isn't a dot or bracket.
13268
13315
  if (rayCastEntity) {
13269
13316
  rayCastEntity._scripts.forEach(function(element) {
13270
13317
  element.onPointerDown(_this);
13318
+ }, function(element, index) {
13319
+ element._entityScriptsIndex = index;
13271
13320
  });
13272
13321
  }
13273
13322
  this._currentPressedEntity = rayCastEntity;
@@ -13279,6 +13328,8 @@ var rePropName = RegExp(// Match anything that isn't a dot or bracket.
13279
13328
  if (this._currentPressedEntity) {
13280
13329
  this._currentPressedEntity._scripts.forEach(function(element) {
13281
13330
  element.onPointerDrag(_this);
13331
+ }, function(element, index) {
13332
+ element._entityScriptsIndex = index;
13282
13333
  });
13283
13334
  }
13284
13335
  };
@@ -13292,6 +13343,8 @@ var rePropName = RegExp(// Match anything that isn't a dot or bracket.
13292
13343
  pressedEntity._scripts.forEach(function(element) {
13293
13344
  sameTarget && element.onPointerClick(_this);
13294
13345
  element.onPointerUp(_this);
13346
+ }, function(element, index) {
13347
+ element._entityScriptsIndex = index;
13295
13348
  });
13296
13349
  this._currentPressedEntity = null;
13297
13350
  }
@@ -13798,9 +13851,9 @@ exports.Collider = /*#__PURE__*/ function(Component1) {
13798
13851
  oldCollider.removeShape(shape);
13799
13852
  }
13800
13853
  this._shapes.push(shape);
13801
- this.scene.physics._addColliderShape(shape);
13802
13854
  shape._collider = this;
13803
13855
  this._nativeCollider.addShape(shape._nativeShape);
13856
+ this._phasedActiveInScene && this.scene.physics._addColliderShape(shape);
13804
13857
  }
13805
13858
  };
13806
13859
  /**
@@ -13810,7 +13863,7 @@ exports.Collider = /*#__PURE__*/ function(Component1) {
13810
13863
  var index = this._shapes.indexOf(shape);
13811
13864
  if (index !== -1) {
13812
13865
  this._shapes.splice(index, 1);
13813
- this.scene.physics._removeColliderShape(shape);
13866
+ this._phasedActiveInScene && this.scene.physics._removeColliderShape(shape);
13814
13867
  shape._collider = null;
13815
13868
  this._nativeCollider.removeShape(shape._nativeShape);
13816
13869
  }
@@ -13821,7 +13874,7 @@ exports.Collider = /*#__PURE__*/ function(Component1) {
13821
13874
  var shapes = this._shapes;
13822
13875
  for(var i = 0, n = shapes.length; i < n; i++){
13823
13876
  var shape = shapes[i];
13824
- this.scene.physics._removeColliderShape(shape);
13877
+ this._phasedActiveInScene && this.scene.physics._removeColliderShape(shape);
13825
13878
  shape._destroy();
13826
13879
  this._nativeCollider.removeShape(shape._nativeShape);
13827
13880
  }
@@ -13846,12 +13899,30 @@ exports.Collider = /*#__PURE__*/ function(Component1) {
13846
13899
  /**
13847
13900
  * @internal
13848
13901
  */ _proto._onEnableInScene = function _onEnableInScene() {
13849
- this.scene.physics._addCollider(this);
13902
+ var physics = this.scene.physics;
13903
+ physics._addCollider(this);
13904
+ var shapes = this.shapes;
13905
+ for(var i = 0, n = shapes.length; i < n; i++){
13906
+ physics._addColliderShape(shapes[i]);
13907
+ }
13850
13908
  };
13851
13909
  /**
13852
13910
  * @internal
13853
13911
  */ _proto._onDisableInScene = function _onDisableInScene() {
13854
- this.scene.physics._removeCollider(this);
13912
+ var physics = this.scene.physics;
13913
+ physics._removeCollider(this);
13914
+ var shapes = this.shapes;
13915
+ for(var i = 0, n = shapes.length; i < n; i++){
13916
+ physics._removeColliderShape(shapes[i]);
13917
+ }
13918
+ };
13919
+ /**
13920
+ * @internal
13921
+ */ _proto._cloneTo = function _cloneTo(target) {
13922
+ var shapes = target._shapes;
13923
+ for(var i = 0, n = shapes.length; i < n; i++){
13924
+ target._addPhysicsShape(shapes[i]);
13925
+ }
13855
13926
  };
13856
13927
  /**
13857
13928
  * @internal
@@ -13860,6 +13931,11 @@ exports.Collider = /*#__PURE__*/ function(Component1) {
13860
13931
  this.clearShapes();
13861
13932
  this._nativeCollider.destroy();
13862
13933
  };
13934
+ _proto._addPhysicsShape = function _addPhysicsShape(shape) {
13935
+ shape._collider = this;
13936
+ this._nativeCollider.addShape(shape._nativeShape);
13937
+ this._phasedActiveInScene && this.scene.physics._addColliderShape(shape);
13938
+ };
13863
13939
  _create_class(Collider, [
13864
13940
  {
13865
13941
  key: "shapes",
@@ -13875,6 +13951,15 @@ exports.Collider = /*#__PURE__*/ function(Component1) {
13875
13951
  __decorate([
13876
13952
  ignoreClone
13877
13953
  ], exports.Collider.prototype, "_index", void 0);
13954
+ __decorate([
13955
+ ignoreClone
13956
+ ], exports.Collider.prototype, "_nativeCollider", void 0);
13957
+ __decorate([
13958
+ ignoreClone
13959
+ ], exports.Collider.prototype, "_updateFlag", void 0);
13960
+ __decorate([
13961
+ deepClone
13962
+ ], exports.Collider.prototype, "_shapes", void 0);
13878
13963
  exports.Collider = __decorate([
13879
13964
  dependentComponents(Transform, exports.DependentMode.CheckOnly)
13880
13965
  ], exports.Collider);
@@ -13899,11 +13984,15 @@ var Collision = function Collision() {
13899
13984
  var collision = PhysicsScene._collision;
13900
13985
  collision.shape = shape2;
13901
13986
  element.onCollisionEnter(collision);
13987
+ }, function(element, index) {
13988
+ element._entityScriptsIndex = index;
13902
13989
  });
13903
13990
  shape2.collider.entity._scripts.forEach(function(element) {
13904
13991
  var collision = PhysicsScene._collision;
13905
13992
  collision.shape = shape1;
13906
13993
  element.onCollisionEnter(collision);
13994
+ }, function(element, index) {
13995
+ element._entityScriptsIndex = index;
13907
13996
  });
13908
13997
  };
13909
13998
  this._onContactExit = function(obj1, obj2) {
@@ -13914,11 +14003,15 @@ var Collision = function Collision() {
13914
14003
  var collision = PhysicsScene._collision;
13915
14004
  collision.shape = shape2;
13916
14005
  element.onCollisionExit(collision);
14006
+ }, function(element, index) {
14007
+ element._entityScriptsIndex = index;
13917
14008
  });
13918
14009
  shape2.collider.entity._scripts.forEach(function(element) {
13919
14010
  var collision = PhysicsScene._collision;
13920
14011
  collision.shape = shape1;
13921
14012
  element.onCollisionExit(collision);
14013
+ }, function(element, index) {
14014
+ element._entityScriptsIndex = index;
13922
14015
  });
13923
14016
  };
13924
14017
  this._onContactStay = function(obj1, obj2) {
@@ -13929,11 +14022,15 @@ var Collision = function Collision() {
13929
14022
  var collision = PhysicsScene._collision;
13930
14023
  collision.shape = shape2;
13931
14024
  element.onCollisionStay(collision);
14025
+ }, function(element, index) {
14026
+ element._entityScriptsIndex = index;
13932
14027
  });
13933
14028
  shape2.collider.entity._scripts.forEach(function(element) {
13934
14029
  var collision = PhysicsScene._collision;
13935
14030
  collision.shape = shape1;
13936
14031
  element.onCollisionStay(collision);
14032
+ }, function(element, index) {
14033
+ element._entityScriptsIndex = index;
13937
14034
  });
13938
14035
  };
13939
14036
  this._onTriggerEnter = function(obj1, obj2) {
@@ -13942,9 +14039,13 @@ var Collision = function Collision() {
13942
14039
  var shape2 = physicalObjectsMap[obj2];
13943
14040
  shape1.collider.entity._scripts.forEach(function(element) {
13944
14041
  element.onTriggerEnter(shape2);
14042
+ }, function(element, index) {
14043
+ element._entityScriptsIndex = index;
13945
14044
  });
13946
14045
  shape2.collider.entity._scripts.forEach(function(element) {
13947
14046
  element.onTriggerEnter(shape1);
14047
+ }, function(element, index) {
14048
+ element._entityScriptsIndex = index;
13948
14049
  });
13949
14050
  };
13950
14051
  this._onTriggerExit = function(obj1, obj2) {
@@ -13953,9 +14054,13 @@ var Collision = function Collision() {
13953
14054
  var shape2 = physicalObjectsMap[obj2];
13954
14055
  shape1.collider.entity._scripts.forEach(function(element) {
13955
14056
  element.onTriggerExit(shape2);
14057
+ }, function(element, index) {
14058
+ element._entityScriptsIndex = index;
13956
14059
  });
13957
14060
  shape2.collider.entity._scripts.forEach(function(element) {
13958
14061
  element.onTriggerExit(shape1);
14062
+ }, function(element, index) {
14063
+ element._entityScriptsIndex = index;
13959
14064
  });
13960
14065
  };
13961
14066
  this._onTriggerStay = function(obj1, obj2) {
@@ -13964,9 +14069,13 @@ var Collision = function Collision() {
13964
14069
  var shape2 = physicalObjectsMap[obj2];
13965
14070
  shape1.collider.entity._scripts.forEach(function(element) {
13966
14071
  element.onTriggerStay(shape2);
14072
+ }, function(element, index) {
14073
+ element._entityScriptsIndex = index;
13967
14074
  });
13968
14075
  shape2.collider.entity._scripts.forEach(function(element) {
13969
14076
  element.onTriggerStay(shape1);
14077
+ }, function(element, index) {
14078
+ element._entityScriptsIndex = index;
13970
14079
  });
13971
14080
  };
13972
14081
  this._scene = scene;
@@ -13999,6 +14108,9 @@ var Collision = function Collision() {
13999
14108
  }
14000
14109
  var onRaycast = function(obj) {
14001
14110
  var shape = _this._scene.engine._physicalObjectsMap[obj];
14111
+ if (!shape) {
14112
+ return false;
14113
+ }
14002
14114
  return shape.collider.entity.layer & layerMask && shape.isSceneQuery;
14003
14115
  };
14004
14116
  if (hitResult != undefined) {
@@ -14223,18 +14335,27 @@ var Collision = function Collision() {
14223
14335
  */ _proto._onLateUpdate = function _onLateUpdate() {
14224
14336
  var position = this.entity.transform.worldPosition;
14225
14337
  this._nativeCollider.getWorldPosition(position);
14226
- this.entity.transform.worldPosition = position;
14227
14338
  this._updateFlag.flag = false;
14228
14339
  };
14229
14340
  /**
14230
14341
  * @internal
14231
14342
  */ _proto._onEnableInScene = function _onEnableInScene() {
14232
- this.scene.physics._addCharacterController(this);
14343
+ var physics = this.scene.physics;
14344
+ physics._addCharacterController(this);
14345
+ var shapes = this.shapes;
14346
+ for(var i = 0, n = shapes.length; i < n; i++){
14347
+ physics._addColliderShape(shapes[i]);
14348
+ }
14233
14349
  };
14234
14350
  /**
14235
14351
  * @internal
14236
14352
  */ _proto._onDisableInScene = function _onDisableInScene() {
14237
- this.scene.physics._removeCharacterController(this);
14353
+ var physics = this.scene.physics;
14354
+ physics._removeCharacterController(this);
14355
+ var shapes = this.shapes;
14356
+ for(var i = 0, n = shapes.length; i < n; i++){
14357
+ physics._removeColliderShape(shapes[i]);
14358
+ }
14238
14359
  };
14239
14360
  _proto._setUpDirection = function _setUpDirection() {
14240
14361
  this._nativeCollider.setUpDirection(this._upDirection);
@@ -14370,6 +14491,25 @@ var Collision = function Collision() {
14370
14491
  this._nativeCollider.getWorldTransform(worldPosition, worldRotationQuaternion);
14371
14492
  this._updateFlag.flag = false;
14372
14493
  };
14494
+ /**
14495
+ * @internal
14496
+ */ _proto._cloneTo = function _cloneTo(target) {
14497
+ Collider1.prototype._cloneTo.call(this, target);
14498
+ target.linearDamping = this.linearDamping;
14499
+ target.angularDamping = this.angularDamping;
14500
+ target.linearVelocity = this.linearVelocity;
14501
+ target.angularVelocity = this.angularVelocity;
14502
+ target.mass = this.mass;
14503
+ target.centerOfMass = this.centerOfMass;
14504
+ target.inertiaTensor = this.inertiaTensor;
14505
+ target.maxAngularVelocity = this.maxAngularVelocity;
14506
+ target.maxDepenetrationVelocity = this.maxDepenetrationVelocity;
14507
+ target.sleepThreshold = this.sleepThreshold;
14508
+ target.solverIterations = this.solverIterations;
14509
+ target.isKinematic = this.isKinematic;
14510
+ target.constraints = this.constraints;
14511
+ target.collisionDetectionMode = this.collisionDetectionMode;
14512
+ };
14373
14513
  _proto._setLinearVelocity = function _setLinearVelocity() {
14374
14514
  this._nativeCollider.setLinearVelocity(this._linearVelocity);
14375
14515
  };
@@ -14578,6 +14718,48 @@ var Collision = function Collision() {
14578
14718
  ]);
14579
14719
  return DynamicCollider;
14580
14720
  }(exports.Collider);
14721
+ __decorate([
14722
+ ignoreClone
14723
+ ], DynamicCollider.prototype, "_linearDamping", void 0);
14724
+ __decorate([
14725
+ ignoreClone
14726
+ ], DynamicCollider.prototype, "_angularDamping", void 0);
14727
+ __decorate([
14728
+ ignoreClone
14729
+ ], DynamicCollider.prototype, "_linearVelocity", void 0);
14730
+ __decorate([
14731
+ ignoreClone
14732
+ ], DynamicCollider.prototype, "_angularVelocity", void 0);
14733
+ __decorate([
14734
+ ignoreClone
14735
+ ], DynamicCollider.prototype, "_mass", void 0);
14736
+ __decorate([
14737
+ ignoreClone
14738
+ ], DynamicCollider.prototype, "_centerOfMass", void 0);
14739
+ __decorate([
14740
+ ignoreClone
14741
+ ], DynamicCollider.prototype, "_inertiaTensor", void 0);
14742
+ __decorate([
14743
+ ignoreClone
14744
+ ], DynamicCollider.prototype, "_maxAngularVelocity", void 0);
14745
+ __decorate([
14746
+ ignoreClone
14747
+ ], DynamicCollider.prototype, "_maxDepenetrationVelocity", void 0);
14748
+ __decorate([
14749
+ ignoreClone
14750
+ ], DynamicCollider.prototype, "_solverIterations", void 0);
14751
+ __decorate([
14752
+ ignoreClone
14753
+ ], DynamicCollider.prototype, "_isKinematic", void 0);
14754
+ __decorate([
14755
+ ignoreClone
14756
+ ], DynamicCollider.prototype, "_constraints", void 0);
14757
+ __decorate([
14758
+ ignoreClone
14759
+ ], DynamicCollider.prototype, "_collisionDetectionMode", void 0);
14760
+ __decorate([
14761
+ ignoreClone
14762
+ ], DynamicCollider.prototype, "_sleepThreshold", void 0);
14581
14763
  exports.CollisionDetectionMode = void 0;
14582
14764
  (function(CollisionDetectionMode) {
14583
14765
  CollisionDetectionMode[CollisionDetectionMode["Discrete"] = 0] = "Discrete";
@@ -14630,7 +14812,8 @@ exports.DynamicColliderConstraints = void 0;
14630
14812
  /**
14631
14813
  * @internal
14632
14814
  */ _proto._destroy = function _destroy() {
14633
- this._nativeMaterial.destroy();
14815
+ !this._destroyed && this._nativeMaterial.destroy();
14816
+ this._destroyed = true;
14634
14817
  };
14635
14818
  _create_class(PhysicsMaterial, [
14636
14819
  {
@@ -14745,24 +14928,37 @@ exports.Joint = /*#__PURE__*/ function(Component1) {
14745
14928
  function Joint(entity) {
14746
14929
  var _this;
14747
14930
  _this = Component1.call(this, entity) || this;
14748
- _this._connectedCollider = new JointCollider();
14749
- _this._collider = new JointCollider();
14931
+ _this._colliderInfo = new JointColliderInfo();
14932
+ _this._connectedColliderInfo = new JointColliderInfo();
14750
14933
  _this._force = 0;
14751
14934
  _this._torque = 0;
14752
- _this._connectedCollider.localPosition = new miniprogram.Vector3();
14935
+ _this._connectedColliderInfo.localPosition = new miniprogram.Vector3();
14753
14936
  return _this;
14754
14937
  }
14938
+ var _proto = Joint.prototype;
14939
+ /**
14940
+ * @internal
14941
+ */ _proto._cloneTo = function _cloneTo(target) {
14942
+ target.connectedCollider = this.connectedCollider;
14943
+ target.connectedAnchor = this.connectedAnchor;
14944
+ target.connectedMassScale = this.connectedMassScale;
14945
+ target.connectedInertiaScale = this.connectedInertiaScale;
14946
+ target.massScale = this.massScale;
14947
+ target.inertiaScale = this.inertiaScale;
14948
+ target.breakForce = this.breakForce;
14949
+ target.breakTorque = this.breakTorque;
14950
+ };
14755
14951
  _create_class(Joint, [
14756
14952
  {
14757
14953
  key: "connectedCollider",
14758
14954
  get: /**
14759
14955
  * The connected collider.
14760
14956
  */ function get() {
14761
- return this._connectedCollider.collider;
14957
+ return this._connectedColliderInfo.collider;
14762
14958
  },
14763
14959
  set: function set(value) {
14764
- if (this._connectedCollider.collider !== value) {
14765
- this._connectedCollider.collider = value;
14960
+ if (this._connectedColliderInfo.collider !== value) {
14961
+ this._connectedColliderInfo.collider = value;
14766
14962
  this._nativeJoint.setConnectedCollider(value._nativeCollider);
14767
14963
  }
14768
14964
  }
@@ -14773,10 +14969,10 @@ exports.Joint = /*#__PURE__*/ function(Component1) {
14773
14969
  * The connected anchor position.
14774
14970
  * @remarks If connectedCollider is set, this anchor is relative offset, or the anchor is world position.
14775
14971
  */ function get() {
14776
- return this._connectedCollider.localPosition;
14972
+ return this._connectedColliderInfo.localPosition;
14777
14973
  },
14778
14974
  set: function set(value) {
14779
- var connectedAnchor = this._connectedCollider.localPosition;
14975
+ var connectedAnchor = this._connectedColliderInfo.localPosition;
14780
14976
  if (value !== connectedAnchor) {
14781
14977
  connectedAnchor.copyFrom(value);
14782
14978
  }
@@ -14788,11 +14984,11 @@ exports.Joint = /*#__PURE__*/ function(Component1) {
14788
14984
  get: /**
14789
14985
  * The scale to apply to the inverse mass of collider 0 for resolving this constraint.
14790
14986
  */ function get() {
14791
- return this._connectedCollider.massScale;
14987
+ return this._connectedColliderInfo.massScale;
14792
14988
  },
14793
14989
  set: function set(value) {
14794
- if (value !== this._connectedCollider.massScale) {
14795
- this._connectedCollider.massScale = value;
14990
+ if (value !== this._connectedColliderInfo.massScale) {
14991
+ this._connectedColliderInfo.massScale = value;
14796
14992
  this._nativeJoint.setConnectedMassScale(value);
14797
14993
  }
14798
14994
  }
@@ -14802,11 +14998,11 @@ exports.Joint = /*#__PURE__*/ function(Component1) {
14802
14998
  get: /**
14803
14999
  * The scale to apply to the inverse inertia of collider0 for resolving this constraint.
14804
15000
  */ function get() {
14805
- return this._connectedCollider.inertiaScale;
15001
+ return this._connectedColliderInfo.inertiaScale;
14806
15002
  },
14807
15003
  set: function set(value) {
14808
- if (value !== this._connectedCollider.inertiaScale) {
14809
- this._connectedCollider.inertiaScale = value;
15004
+ if (value !== this._connectedColliderInfo.inertiaScale) {
15005
+ this._connectedColliderInfo.inertiaScale = value;
14810
15006
  this._nativeJoint.setConnectedInertiaScale(value);
14811
15007
  }
14812
15008
  }
@@ -14816,11 +15012,11 @@ exports.Joint = /*#__PURE__*/ function(Component1) {
14816
15012
  get: /**
14817
15013
  * The scale to apply to the inverse mass of collider 1 for resolving this constraint.
14818
15014
  */ function get() {
14819
- return this._collider.massScale;
15015
+ return this._colliderInfo.massScale;
14820
15016
  },
14821
15017
  set: function set(value) {
14822
- if (value !== this._collider.massScale) {
14823
- this._collider.massScale = value;
15018
+ if (value !== this._colliderInfo.massScale) {
15019
+ this._colliderInfo.massScale = value;
14824
15020
  this._nativeJoint.setMassScale(value);
14825
15021
  }
14826
15022
  }
@@ -14830,11 +15026,11 @@ exports.Joint = /*#__PURE__*/ function(Component1) {
14830
15026
  get: /**
14831
15027
  * The scale to apply to the inverse inertia of collider1 for resolving this constraint.
14832
15028
  */ function get() {
14833
- return this._collider.inertiaScale;
15029
+ return this._colliderInfo.inertiaScale;
14834
15030
  },
14835
15031
  set: function set(value) {
14836
- if (value !== this._collider.inertiaScale) {
14837
- this._collider.inertiaScale = value;
15032
+ if (value !== this._colliderInfo.inertiaScale) {
15033
+ this._colliderInfo.inertiaScale = value;
14838
15034
  this._nativeJoint.setInertiaScale(value);
14839
15035
  }
14840
15036
  }
@@ -14870,12 +15066,27 @@ exports.Joint = /*#__PURE__*/ function(Component1) {
14870
15066
  ]);
14871
15067
  return Joint;
14872
15068
  }(Component);
15069
+ __decorate([
15070
+ ignoreClone
15071
+ ], exports.Joint.prototype, "_colliderInfo", void 0);
15072
+ __decorate([
15073
+ ignoreClone
15074
+ ], exports.Joint.prototype, "_connectedColliderInfo", void 0);
15075
+ __decorate([
15076
+ ignoreClone
15077
+ ], exports.Joint.prototype, "_nativeJoint", void 0);
15078
+ __decorate([
15079
+ ignoreClone
15080
+ ], exports.Joint.prototype, "_force", void 0);
15081
+ __decorate([
15082
+ ignoreClone
15083
+ ], exports.Joint.prototype, "_torque", void 0);
14873
15084
  exports.Joint = __decorate([
14874
15085
  dependentComponents(exports.Collider, exports.DependentMode.CheckOnly)
14875
15086
  ], exports.Joint);
14876
15087
  /**
14877
15088
  * @internal
14878
- */ var JointCollider = function JointCollider() {
15089
+ */ var JointColliderInfo = function JointColliderInfo() {
14879
15090
  this.collider = null;
14880
15091
  this.massScale = 0;
14881
15092
  this.inertiaScale = 0;
@@ -14892,7 +15103,7 @@ exports.Joint = __decorate([
14892
15103
  /**
14893
15104
  * @internal
14894
15105
  */ _proto._onAwake = function _onAwake() {
14895
- var collider = this._collider;
15106
+ var collider = this._colliderInfo;
14896
15107
  collider.collider = this.entity.getComponent(exports.Collider);
14897
15108
  this._nativeJoint = PhysicsScene._nativePhysics.createFixedJoint(collider.collider._nativeCollider);
14898
15109
  };
@@ -14926,11 +15137,22 @@ exports.Joint = __decorate([
14926
15137
  /**
14927
15138
  * @internal
14928
15139
  */ _proto._onAwake = function _onAwake() {
14929
- var collider = this._collider;
15140
+ var collider = this._colliderInfo;
14930
15141
  collider.localPosition = new miniprogram.Vector3();
14931
15142
  collider.collider = this.entity.getComponent(exports.Collider);
14932
15143
  this._nativeJoint = PhysicsScene._nativePhysics.createHingeJoint(collider.collider._nativeCollider);
14933
15144
  };
15145
+ /**
15146
+ * @internal
15147
+ */ _proto._cloneTo = function _cloneTo(target) {
15148
+ target.axis = this.axis;
15149
+ target.swingOffset = this.swingOffset;
15150
+ target.useLimits = this.useLimits;
15151
+ target.useMotor = this.useMotor;
15152
+ target.useSpring = this.useSpring;
15153
+ target.motor = this.motor;
15154
+ target.limits = this.limits;
15155
+ };
14934
15156
  _create_class(HingeJoint, [
14935
15157
  {
14936
15158
  key: "axis",
@@ -14952,10 +15174,10 @@ exports.Joint = __decorate([
14952
15174
  get: /**
14953
15175
  * The swing offset.
14954
15176
  */ function get() {
14955
- return this._collider.localPosition;
15177
+ return this._colliderInfo.localPosition;
14956
15178
  },
14957
15179
  set: function set(value) {
14958
- var swingOffset = this._collider.localPosition;
15180
+ var swingOffset = this._colliderInfo.localPosition;
14959
15181
  if (value !== swingOffset) {
14960
15182
  swingOffset.copyFrom(value);
14961
15183
  }
@@ -15058,6 +15280,21 @@ exports.Joint = __decorate([
15058
15280
  ]);
15059
15281
  return HingeJoint;
15060
15282
  }(exports.Joint);
15283
+ __decorate([
15284
+ ignoreClone
15285
+ ], HingeJoint.prototype, "_axis", void 0);
15286
+ __decorate([
15287
+ ignoreClone
15288
+ ], HingeJoint.prototype, "_hingeFlags", void 0);
15289
+ __decorate([
15290
+ ignoreClone
15291
+ ], HingeJoint.prototype, "_useSpring", void 0);
15292
+ __decorate([
15293
+ ignoreClone
15294
+ ], HingeJoint.prototype, "_jointMonitor", void 0);
15295
+ __decorate([
15296
+ ignoreClone
15297
+ ], HingeJoint.prototype, "_limits", void 0);
15061
15298
 
15062
15299
  /**
15063
15300
  * A joint that maintains an upper or lower bound (or both) on the distance between two points on different objects.
@@ -15077,21 +15314,31 @@ exports.Joint = __decorate([
15077
15314
  /**
15078
15315
  * @internal
15079
15316
  */ _proto._onAwake = function _onAwake() {
15080
- var collider = this._collider;
15317
+ var collider = this._colliderInfo;
15081
15318
  collider.localPosition = new miniprogram.Vector3();
15082
15319
  collider.collider = this.entity.getComponent(exports.Collider);
15083
15320
  this._nativeJoint = PhysicsScene._nativePhysics.createSpringJoint(collider.collider._nativeCollider);
15084
15321
  };
15322
+ /**
15323
+ * @internal
15324
+ */ _proto._cloneTo = function _cloneTo(target) {
15325
+ target.swingOffset = this.swingOffset;
15326
+ target.minDistance = this.minDistance;
15327
+ target.maxDistance = this.maxDistance;
15328
+ target.tolerance = this.tolerance;
15329
+ target.stiffness = this.stiffness;
15330
+ target.damping = this.damping;
15331
+ };
15085
15332
  _create_class(SpringJoint, [
15086
15333
  {
15087
15334
  key: "swingOffset",
15088
15335
  get: /**
15089
15336
  * The swing offset.
15090
15337
  */ function get() {
15091
- return this._collider.localPosition;
15338
+ return this._colliderInfo.localPosition;
15092
15339
  },
15093
15340
  set: function set(value) {
15094
- var swingOffset = this._collider.localPosition;
15341
+ var swingOffset = this._colliderInfo.localPosition;
15095
15342
  if (value !== swingOffset) {
15096
15343
  swingOffset.copyFrom(value);
15097
15344
  }
@@ -15216,6 +15463,15 @@ exports.Joint = __decorate([
15216
15463
  var _proto = ColliderShape.prototype;
15217
15464
  /**
15218
15465
  * @internal
15466
+ */ _proto._cloneTo = function _cloneTo(target) {
15467
+ target.contactOffset = this.contactOffset;
15468
+ target.rotation = this.rotation;
15469
+ target.position = this.position;
15470
+ target.isTrigger = this.isTrigger;
15471
+ target.material = this.material;
15472
+ };
15473
+ /**
15474
+ * @internal
15219
15475
  */ _proto._destroy = function _destroy() {
15220
15476
  this._material._destroy();
15221
15477
  this._nativeShape.destroy();
@@ -15317,6 +15573,30 @@ exports.Joint = __decorate([
15317
15573
  (function() {
15318
15574
  ColliderShape._idGenerator = 0;
15319
15575
  })();
15576
+ __decorate([
15577
+ ignoreClone
15578
+ ], ColliderShape.prototype, "_collider", void 0);
15579
+ __decorate([
15580
+ ignoreClone
15581
+ ], ColliderShape.prototype, "_nativeShape", void 0);
15582
+ __decorate([
15583
+ ignoreClone
15584
+ ], ColliderShape.prototype, "_id", void 0);
15585
+ __decorate([
15586
+ ignoreClone
15587
+ ], ColliderShape.prototype, "_material", void 0);
15588
+ __decorate([
15589
+ ignoreClone
15590
+ ], ColliderShape.prototype, "_isTrigger", void 0);
15591
+ __decorate([
15592
+ ignoreClone
15593
+ ], ColliderShape.prototype, "_rotation", void 0);
15594
+ __decorate([
15595
+ ignoreClone
15596
+ ], ColliderShape.prototype, "_position", void 0);
15597
+ __decorate([
15598
+ ignoreClone
15599
+ ], ColliderShape.prototype, "_contactOffset", void 0);
15320
15600
 
15321
15601
  /**
15322
15602
  * Physical collider shape for box.
@@ -15333,6 +15613,12 @@ exports.Joint = __decorate([
15333
15613
  return _this;
15334
15614
  }
15335
15615
  var _proto = BoxColliderShape.prototype;
15616
+ /**
15617
+ * @internal
15618
+ */ _proto._cloneTo = function _cloneTo(target) {
15619
+ ColliderShape1.prototype._cloneTo.call(this, target);
15620
+ target.size = this.size;
15621
+ };
15336
15622
  _proto._setSize = function _setSize() {
15337
15623
  this._nativeShape.setSize(this._size);
15338
15624
  };
@@ -15353,6 +15639,9 @@ exports.Joint = __decorate([
15353
15639
  ]);
15354
15640
  return BoxColliderShape;
15355
15641
  }(ColliderShape);
15642
+ __decorate([
15643
+ ignoreClone
15644
+ ], BoxColliderShape.prototype, "_size", void 0);
15356
15645
 
15357
15646
  /**
15358
15647
  * Physical collider shape for sphere.
@@ -15365,6 +15654,11 @@ exports.Joint = __decorate([
15365
15654
  _this._nativeShape = PhysicsScene._nativePhysics.createSphereColliderShape(_this._id, _this._radius, _this._material._nativeMaterial);
15366
15655
  return _this;
15367
15656
  }
15657
+ var _proto = SphereColliderShape.prototype;
15658
+ _proto._cloneTo = function _cloneTo(target) {
15659
+ ColliderShape1.prototype._cloneTo.call(this, target);
15660
+ target.radius = this.radius;
15661
+ };
15368
15662
  _create_class(SphereColliderShape, [
15369
15663
  {
15370
15664
  key: "radius",
@@ -15383,6 +15677,9 @@ exports.Joint = __decorate([
15383
15677
  ]);
15384
15678
  return SphereColliderShape;
15385
15679
  }(ColliderShape);
15680
+ __decorate([
15681
+ ignoreClone
15682
+ ], SphereColliderShape.prototype, "_radius", void 0);
15386
15683
 
15387
15684
  /**
15388
15685
  * Physical collider shape plane.
@@ -15410,6 +15707,15 @@ exports.Joint = __decorate([
15410
15707
  _this._nativeShape = PhysicsScene._nativePhysics.createCapsuleColliderShape(_this._id, _this._radius, _this._height, _this._material._nativeMaterial);
15411
15708
  return _this;
15412
15709
  }
15710
+ var _proto = CapsuleColliderShape.prototype;
15711
+ /**
15712
+ * @internal
15713
+ */ _proto._cloneTo = function _cloneTo(target) {
15714
+ ColliderShape1.prototype._cloneTo.call(this, target);
15715
+ target.radius = this.radius;
15716
+ target.height = this.height;
15717
+ target.upAxis = this.upAxis;
15718
+ };
15413
15719
  _create_class(CapsuleColliderShape, [
15414
15720
  {
15415
15721
  key: "radius",
@@ -15456,6 +15762,15 @@ exports.Joint = __decorate([
15456
15762
  ]);
15457
15763
  return CapsuleColliderShape;
15458
15764
  }(ColliderShape);
15765
+ __decorate([
15766
+ ignoreClone
15767
+ ], CapsuleColliderShape.prototype, "_radius", void 0);
15768
+ __decorate([
15769
+ ignoreClone
15770
+ ], CapsuleColliderShape.prototype, "_height", void 0);
15771
+ __decorate([
15772
+ ignoreClone
15773
+ ], CapsuleColliderShape.prototype, "_upAxis", void 0);
15459
15774
 
15460
15775
  /**
15461
15776
  * Pointer Manager.
@@ -15693,8 +16008,8 @@ exports.Joint = __decorate([
15693
16008
  continue;
15694
16009
  }
15695
16010
  var cameras = scene._activeCameras;
15696
- for(var j = 0; j < cameras.length; j++){
15697
- var camera = cameras[i];
16011
+ for(var j = cameras.length - 1; j >= 0; j--){
16012
+ var camera = cameras[j];
15698
16013
  if (!camera.enabled || camera.renderTarget) {
15699
16014
  continue;
15700
16015
  }
@@ -16386,10 +16701,6 @@ ShaderPool.init();
16386
16701
  magentaMaterial.isGCIgnored = true;
16387
16702
  magentaMaterial.shaderData.setColor("material_BaseColor", new Color(1.0, 0.0, 1.01, 1.0));
16388
16703
  _this._magentaMaterial = magentaMaterial;
16389
- var backgroundTextureMaterial = new Material(_assert_this_initialized(_this), Shader.find("background-texture"));
16390
- backgroundTextureMaterial.isGCIgnored = true;
16391
- backgroundTextureMaterial.renderState.depthState.compareFunction = exports.CompareFunction.LessEqual;
16392
- _this._backgroundTextureMaterial = backgroundTextureMaterial;
16393
16704
  var innerSettings = _this._settings;
16394
16705
  var colorSpace = configuration.colorSpace || exports.ColorSpace.Linear;
16395
16706
  colorSpace === exports.ColorSpace.Gamma && _this._macroCollection.enable(Engine._gammaMacro);
@@ -16939,7 +17250,7 @@ ShaderPool.init();
16939
17250
  program.uploadAll(program.materialUniformBlock, materialShaderData);
16940
17251
  program.uploadUnGroupTextures();
16941
17252
  renderState._apply(engine, false, pass._renderStateDataMap, materialShaderData);
16942
- rhi.drawPrimitive(mesh, mesh.subMesh, program);
17253
+ rhi.drawPrimitive(mesh._primitive, mesh.subMesh, program);
16943
17254
  cameraShaderData.setMatrix(RenderContext.vpMatrixProperty, originViewProjMatrix);
16944
17255
  };
16945
17256
  _create_class(Sky, [
@@ -17007,34 +17318,29 @@ ShaderPool.init();
17007
17318
  this./** @internal */ _textureFillMode = exports.BackgroundTextureFillMode.AspectFitHeight;
17008
17319
  this._texture = null;
17009
17320
  this._initMesh(_engine);
17321
+ this._initMaterial(_engine);
17010
17322
  }
17011
17323
  var _proto = Background.prototype;
17012
17324
  /**
17013
17325
  * @internal
17014
17326
  */ _proto.destroy = function destroy() {
17327
+ this.texture = null;
17015
17328
  this._mesh._addReferCount(-1);
17016
17329
  this._mesh = null;
17017
- this.texture = null;
17330
+ this._material._addReferCount(-1);
17331
+ this._material = null;
17018
17332
  this.solidColor = null;
17019
17333
  this.sky.destroy();
17020
17334
  };
17021
17335
  /**
17022
17336
  * @internal
17023
- * Standalone for CanvasRenderer plugin.
17024
- */ _proto._initMesh = function _initMesh(engine) {
17025
- this._mesh = this._createPlane(engine);
17026
- this._mesh._addReferCount(1);
17027
- };
17028
- /**
17029
- * @internal
17030
17337
  */ _proto._resizeBackgroundTexture = function _resizeBackgroundTexture() {
17338
+ var _this = this, texture = _this._texture, mesh = _this._mesh;
17031
17339
  if (!this._texture) {
17032
17340
  return;
17033
17341
  }
17034
- var canvas = this._engine.canvas;
17035
- var width = canvas.width, height = canvas.height;
17036
- var _this = this, _backgroundTextureMesh = _this._mesh;
17037
- var positions = _backgroundTextureMesh.getPositions();
17342
+ var _this__engine_canvas = this._engine.canvas, width = _this__engine_canvas.width, height = _this__engine_canvas.height;
17343
+ var positions = mesh.getPositions();
17038
17344
  switch(this._textureFillMode){
17039
17345
  case exports.BackgroundTextureFillMode.Fill:
17040
17346
  positions[0].set(-1, -1, 1);
@@ -17043,22 +17349,31 @@ ShaderPool.init();
17043
17349
  positions[3].set(1, 1, 1);
17044
17350
  break;
17045
17351
  case exports.BackgroundTextureFillMode.AspectFitWidth:
17046
- var fitWidthScale = this._texture.height * width / this.texture.width / height;
17352
+ var fitWidthScale = texture.height * width / texture.width / height;
17047
17353
  positions[0].set(-1, -fitWidthScale, 1);
17048
17354
  positions[1].set(1, -fitWidthScale, 1);
17049
17355
  positions[2].set(-1, fitWidthScale, 1);
17050
17356
  positions[3].set(1, fitWidthScale, 1);
17051
17357
  break;
17052
17358
  case exports.BackgroundTextureFillMode.AspectFitHeight:
17053
- var fitHeightScale = this._texture.width * height / this.texture.height / width;
17359
+ var fitHeightScale = texture.width * height / texture.height / width;
17054
17360
  positions[0].set(-fitHeightScale, -1, 1);
17055
17361
  positions[1].set(fitHeightScale, -1, 1);
17056
17362
  positions[2].set(-fitHeightScale, 1, 1);
17057
17363
  positions[3].set(fitHeightScale, 1, 1);
17058
17364
  break;
17059
17365
  }
17060
- _backgroundTextureMesh.setPositions(positions);
17061
- _backgroundTextureMesh.uploadData(false);
17366
+ mesh.setPositions(positions);
17367
+ mesh.uploadData(false);
17368
+ };
17369
+ _proto._initMesh = function _initMesh(engine) {
17370
+ this._mesh = this._createPlane(engine);
17371
+ this._mesh._addReferCount(1);
17372
+ };
17373
+ _proto._initMaterial = function _initMaterial(engine) {
17374
+ var material = this._material = new Material(engine, Shader.find("background-texture"));
17375
+ material.renderState.depthState.compareFunction = exports.CompareFunction.LessEqual;
17376
+ material._addReferCount(1);
17062
17377
  };
17063
17378
  _proto._createPlane = function _createPlane(engine) {
17064
17379
  var mesh = new ModelMesh(engine);
@@ -17099,14 +17414,14 @@ ShaderPool.init();
17099
17414
  (_value = value) == null ? void 0 : _value._addReferCount(1);
17100
17415
  (_this__texture = this._texture) == null ? void 0 : _this__texture._addReferCount(-1);
17101
17416
  this._texture = value;
17102
- this._engine._backgroundTextureMaterial.shaderData.setTexture("material_BaseTexture", value);
17417
+ this._material.shaderData.setTexture("material_BaseTexture", value);
17418
+ this._resizeBackgroundTexture();
17103
17419
  }
17104
17420
  }
17105
17421
  },
17106
17422
  {
17107
17423
  key: "textureFillMode",
17108
17424
  get: /**
17109
- * @internal
17110
17425
  * Background texture fill mode.
17111
17426
  * @remarks When `mode` is `BackgroundMode.Texture`, the property will take effects.
17112
17427
  * @defaultValue `BackgroundTextureFillMode.FitHeight`
@@ -17224,40 +17539,44 @@ ShaderPool.init();
17224
17539
  };
17225
17540
  _proto.callScriptOnUpdate = function callScriptOnUpdate(deltaTime) {
17226
17541
  this._onUpdateScripts.forEach(function(element) {
17227
- if (element._started) {
17228
- element.onUpdate(deltaTime);
17229
- }
17542
+ element._started && element.onUpdate(deltaTime);
17543
+ }, function(element, index) {
17544
+ element._onUpdateIndex = index;
17230
17545
  });
17231
17546
  };
17232
17547
  _proto.callScriptOnLateUpdate = function callScriptOnLateUpdate(deltaTime) {
17233
17548
  this._onLateUpdateScripts.forEach(function(element) {
17234
- if (element._started) {
17235
- element.onLateUpdate(deltaTime);
17236
- }
17549
+ element._started && element.onLateUpdate(deltaTime);
17550
+ }, function(element, index) {
17551
+ element._onLateUpdateIndex = index;
17237
17552
  });
17238
17553
  };
17239
17554
  _proto.callScriptOnPhysicsUpdate = function callScriptOnPhysicsUpdate() {
17240
17555
  this._onPhysicsUpdateScripts.forEach(function(element) {
17241
- if (element._started) {
17242
- element.onPhysicsUpdate();
17243
- }
17556
+ element._started && element.onPhysicsUpdate();
17557
+ }, function(element, index) {
17558
+ element._onPhysicsUpdateIndex = index;
17244
17559
  });
17245
17560
  };
17246
17561
  _proto.callAnimationUpdate = function callAnimationUpdate(deltaTime) {
17247
17562
  this._onUpdateAnimations.forEach(function(element) {
17248
17563
  element.engine.time.frameCount > element._playFrameCount && element.update(deltaTime);
17564
+ }, function(element, index) {
17565
+ element._onUpdateIndex = index;
17249
17566
  });
17250
17567
  };
17251
17568
  _proto.callRendererOnUpdate = function callRendererOnUpdate(deltaTime) {
17252
17569
  this._onUpdateRenderers.forEach(function(element) {
17253
17570
  element.update(deltaTime);
17571
+ }, function(element, index) {
17572
+ element._onUpdateIndex = index;
17254
17573
  });
17255
17574
  };
17256
17575
  _proto.handlingInvalidScripts = function handlingInvalidScripts() {
17257
17576
  var _this = this, pendingDestroyScripts = _this._disposeDestroyScripts, disposeDestroyScripts = _this._pendingDestroyScripts;
17258
17577
  this._disposeDestroyScripts = disposeDestroyScripts;
17259
17578
  this._pendingDestroyScripts = pendingDestroyScripts;
17260
- length = disposeDestroyScripts.length;
17579
+ var length = disposeDestroyScripts.length;
17261
17580
  if (length > 0) {
17262
17581
  for(var i = length - 1; i >= 0; i--){
17263
17582
  disposeDestroyScripts[i].onDestroy();
@@ -17268,11 +17587,15 @@ ShaderPool.init();
17268
17587
  _proto.callCameraOnBeginRender = function callCameraOnBeginRender(camera) {
17269
17588
  camera.entity._scripts.forEach(function(element) {
17270
17589
  element.onBeginRender(camera);
17590
+ }, function(element, index) {
17591
+ element._entityScriptsIndex = index;
17271
17592
  });
17272
17593
  };
17273
17594
  _proto.callCameraOnEndRender = function callCameraOnEndRender(camera) {
17274
17595
  camera.entity._scripts.forEach(function(element) {
17275
17596
  element.onEndRender(camera);
17597
+ }, function(element, index) {
17598
+ element._entityScriptsIndex = index;
17276
17599
  });
17277
17600
  };
17278
17601
  _proto.getActiveChangedTempList = function getActiveChangedTempList() {
@@ -17674,11 +17997,6 @@ ShaderPool.init();
17674
17997
  ]);
17675
17998
  return Light;
17676
17999
  }(Component);
17677
- (function() {
17678
- /**
17679
- * Each type of light source is at most 10, beyond which it will not take effect.
17680
- * */ Light._maxLight = 10;
17681
- })();
17682
18000
  __decorate([
17683
18001
  ignoreClone
17684
18002
  ], Light.prototype, "_lightIndex", void 0);
@@ -17696,13 +18014,12 @@ __decorate([
17696
18014
  var _proto = DirectLight.prototype;
17697
18015
  /**
17698
18016
  * @internal
17699
- */ _proto._appendData = function _appendData(lightIndex) {
18017
+ */ _proto._appendData = function _appendData(lightIndex, data) {
17700
18018
  var cullingMaskStart = lightIndex * 2;
17701
18019
  var colorStart = lightIndex * 3;
17702
18020
  var directionStart = lightIndex * 3;
17703
18021
  var lightColor = this._getLightIntensityColor();
17704
18022
  var direction = this.direction;
17705
- var data = DirectLight._combinedData;
17706
18023
  var cullingMask = this.cullingMask;
17707
18024
  data.cullingMask[cullingMaskStart] = cullingMask & 65535;
17708
18025
  data.cullingMask[cullingMaskStart + 1] = cullingMask >>> 16 & 65535;
@@ -17731,8 +18048,7 @@ __decorate([
17731
18048
  };
17732
18049
  /**
17733
18050
  * @internal
17734
- */ DirectLight._updateShaderData = function _updateShaderData(shaderData) {
17735
- var data = DirectLight._combinedData;
18051
+ */ DirectLight._updateShaderData = function _updateShaderData(shaderData, data) {
17736
18052
  shaderData.setIntArray(DirectLight._cullingMaskProperty, data.cullingMask);
17737
18053
  shaderData.setFloatArray(DirectLight._colorProperty, data.color);
17738
18054
  shaderData.setFloatArray(DirectLight._directionProperty, data.direction);
@@ -17775,13 +18091,6 @@ __decorate([
17775
18091
  (function() {
17776
18092
  DirectLight._directionProperty = ShaderProperty.getByName("scene_DirectLightDirection");
17777
18093
  })();
17778
- (function() {
17779
- DirectLight._combinedData = {
17780
- cullingMask: new Int32Array(Light._maxLight * 2),
17781
- color: new Float32Array(Light._maxLight * 3),
17782
- direction: new Float32Array(Light._maxLight * 3)
17783
- };
17784
- })();
17785
18094
 
17786
18095
  /**
17787
18096
  * Point light.
@@ -17796,14 +18105,13 @@ __decorate([
17796
18105
  var _proto = PointLight.prototype;
17797
18106
  /**
17798
18107
  * @internal
17799
- */ _proto._appendData = function _appendData(lightIndex) {
18108
+ */ _proto._appendData = function _appendData(lightIndex, data) {
17800
18109
  var cullingMaskStart = lightIndex * 2;
17801
18110
  var colorStart = lightIndex * 3;
17802
18111
  var positionStart = lightIndex * 3;
17803
18112
  var distanceStart = lightIndex;
17804
18113
  var lightColor = this._getLightIntensityColor();
17805
18114
  var lightPosition = this.position;
17806
- var data = PointLight._combinedData;
17807
18115
  var cullingMask = this.cullingMask;
17808
18116
  data.cullingMask[cullingMaskStart] = cullingMask & 65535;
17809
18117
  data.cullingMask[cullingMaskStart + 1] = cullingMask >>> 16 & 65535;
@@ -17833,8 +18141,7 @@ __decorate([
17833
18141
  };
17834
18142
  /**
17835
18143
  * @internal
17836
- */ PointLight._updateShaderData = function _updateShaderData(shaderData) {
17837
- var data = PointLight._combinedData;
18144
+ */ PointLight._updateShaderData = function _updateShaderData(shaderData, data) {
17838
18145
  shaderData.setIntArray(PointLight._cullingMaskProperty, data.cullingMask);
17839
18146
  shaderData.setFloatArray(PointLight._colorProperty, data.color);
17840
18147
  shaderData.setFloatArray(PointLight._positionProperty, data.position);
@@ -17872,14 +18179,6 @@ __decorate([
17872
18179
  (function() {
17873
18180
  PointLight._distanceProperty = ShaderProperty.getByName("scene_PointLightDistance");
17874
18181
  })();
17875
- (function() {
17876
- PointLight._combinedData = {
17877
- cullingMask: new Int32Array(Light._maxLight * 2),
17878
- color: new Float32Array(Light._maxLight * 3),
17879
- position: new Float32Array(Light._maxLight * 3),
17880
- distance: new Float32Array(Light._maxLight)
17881
- };
17882
- })();
17883
18182
 
17884
18183
  /**
17885
18184
  * Spot light.
@@ -17898,7 +18197,7 @@ __decorate([
17898
18197
  var _proto = SpotLight.prototype;
17899
18198
  /**
17900
18199
  * @internal
17901
- */ _proto._appendData = function _appendData(lightIndex) {
18200
+ */ _proto._appendData = function _appendData(lightIndex, data) {
17902
18201
  var cullingMaskStart = lightIndex * 2;
17903
18202
  var colorStart = lightIndex * 3;
17904
18203
  var positionStart = lightIndex * 3;
@@ -17909,7 +18208,6 @@ __decorate([
17909
18208
  var lightColor = this._getLightIntensityColor();
17910
18209
  var position = this.position;
17911
18210
  var direction = this.direction;
17912
- var data = SpotLight._combinedData;
17913
18211
  var cullingMask = this.cullingMask;
17914
18212
  data.cullingMask[cullingMaskStart] = cullingMask & 65535;
17915
18213
  data.cullingMask[cullingMaskStart + 1] = cullingMask >>> 16 & 65535;
@@ -17944,8 +18242,7 @@ __decorate([
17944
18242
  };
17945
18243
  /**
17946
18244
  * @internal
17947
- */ SpotLight._updateShaderData = function _updateShaderData(shaderData) {
17948
- var data = SpotLight._combinedData;
18245
+ */ SpotLight._updateShaderData = function _updateShaderData(shaderData, data) {
17949
18246
  shaderData.setIntArray(SpotLight._cullingMaskProperty, data.cullingMask);
17950
18247
  shaderData.setFloatArray(SpotLight._colorProperty, data.color);
17951
18248
  shaderData.setFloatArray(SpotLight._positionProperty, data.position);
@@ -18015,17 +18312,6 @@ __decorate([
18015
18312
  (function() {
18016
18313
  SpotLight._penumbraCosProperty = ShaderProperty.getByName("scene_SpotLightPenumbraCos");
18017
18314
  })();
18018
- (function() {
18019
- SpotLight._combinedData = {
18020
- cullingMask: new Int32Array(Light._maxLight * 2),
18021
- color: new Float32Array(Light._maxLight * 3),
18022
- position: new Float32Array(Light._maxLight * 3),
18023
- direction: new Float32Array(Light._maxLight * 3),
18024
- distance: new Float32Array(Light._maxLight),
18025
- angleCos: new Float32Array(Light._maxLight),
18026
- penumbraCos: new Float32Array(Light._maxLight)
18027
- };
18028
- })();
18029
18315
 
18030
18316
  /**
18031
18317
  * Light manager.
@@ -18034,6 +18320,26 @@ __decorate([
18034
18320
  /** @internal */ this._spotLights = new DisorderedArray();
18035
18321
  /** @internal */ this._pointLights = new DisorderedArray();
18036
18322
  /** @internal */ this._directLights = new DisorderedArray();
18323
+ this._directData = {
18324
+ cullingMask: new Int32Array(LightManager._maxLight * 2),
18325
+ color: new Float32Array(LightManager._maxLight * 3),
18326
+ direction: new Float32Array(LightManager._maxLight * 3)
18327
+ };
18328
+ this._pointData = {
18329
+ cullingMask: new Int32Array(LightManager._maxLight * 2),
18330
+ color: new Float32Array(LightManager._maxLight * 3),
18331
+ position: new Float32Array(LightManager._maxLight * 3),
18332
+ distance: new Float32Array(LightManager._maxLight)
18333
+ };
18334
+ this._spotData = {
18335
+ cullingMask: new Int32Array(LightManager._maxLight * 2),
18336
+ color: new Float32Array(LightManager._maxLight * 3),
18337
+ position: new Float32Array(LightManager._maxLight * 3),
18338
+ direction: new Float32Array(LightManager._maxLight * 3),
18339
+ distance: new Float32Array(LightManager._maxLight),
18340
+ angleCos: new Float32Array(LightManager._maxLight),
18341
+ penumbraCos: new Float32Array(LightManager._maxLight)
18342
+ };
18037
18343
  }
18038
18344
  var _proto = LightManager.prototype;
18039
18345
  /**
@@ -18093,38 +18399,34 @@ __decorate([
18093
18399
  /**
18094
18400
  * @internal
18095
18401
  */ _proto._updateShaderData = function _updateShaderData(shaderData) {
18096
- var spotLight = this._spotLights;
18097
- var pointLight = this._pointLights;
18098
- var directLight = this._directLights;
18402
+ var _this = this, spotLight = _this._spotLights, pointLight = _this._pointLights, directLight = _this._directLights;
18403
+ var _this1 = this, spotData = _this1._spotData, pointData = _this1._pointData, directData = _this1._directData;
18099
18404
  var spotLightCount = spotLight.length;
18100
18405
  var pointLightCount = pointLight.length;
18101
18406
  var directLightCount = directLight.length;
18102
- for(var i = 0, len = spotLightCount; i < len; i++){
18103
- var light = spotLight.get(i);
18104
- light._appendData(i);
18407
+ for(var i = 0; i < spotLightCount; i++){
18408
+ spotLight.get(i)._appendData(i, spotData);
18105
18409
  }
18106
- for(var i1 = 0, len1 = pointLightCount; i1 < len1; i1++){
18107
- var light1 = pointLight.get(i1);
18108
- light1._appendData(i1);
18410
+ for(var i1 = 0; i1 < pointLightCount; i1++){
18411
+ pointLight.get(i1)._appendData(i1, pointData);
18109
18412
  }
18110
- for(var i2 = 0, len2 = directLightCount; i2 < len2; i2++){
18111
- var light2 = directLight.get(i2);
18112
- light2._appendData(i2);
18413
+ for(var i2 = 0; i2 < directLightCount; i2++){
18414
+ directLight.get(i2)._appendData(i2, directData);
18113
18415
  }
18114
18416
  if (directLightCount) {
18115
- DirectLight._updateShaderData(shaderData);
18417
+ DirectLight._updateShaderData(shaderData, directData);
18116
18418
  shaderData.enableMacro("SCENE_DIRECT_LIGHT_COUNT", directLightCount.toString());
18117
18419
  } else {
18118
18420
  shaderData.disableMacro("SCENE_DIRECT_LIGHT_COUNT");
18119
18421
  }
18120
18422
  if (pointLightCount) {
18121
- PointLight._updateShaderData(shaderData);
18423
+ PointLight._updateShaderData(shaderData, pointData);
18122
18424
  shaderData.enableMacro("SCENE_POINT_LIGHT_COUNT", pointLightCount.toString());
18123
18425
  } else {
18124
18426
  shaderData.disableMacro("SCENE_POINT_LIGHT_COUNT");
18125
18427
  }
18126
18428
  if (spotLightCount) {
18127
- SpotLight._updateShaderData(shaderData);
18429
+ SpotLight._updateShaderData(shaderData, spotData);
18128
18430
  shaderData.enableMacro("SCENE_SPOT_LIGHT_COUNT", spotLightCount.toString());
18129
18431
  } else {
18130
18432
  shaderData.disableMacro("SCENE_SPOT_LIGHT_COUNT");
@@ -18165,6 +18467,11 @@ __decorate([
18165
18467
  };
18166
18468
  return LightManager;
18167
18469
  }();
18470
+ (function() {
18471
+ /**
18472
+ * Each type of light source is at most 10, beyond which it will not take effect.
18473
+ * */ LightManager._maxLight = 10;
18474
+ })();
18168
18475
 
18169
18476
  /**
18170
18477
  * Scene.
@@ -18195,6 +18502,7 @@ __decorate([
18195
18502
  _this._fogEnd = 300;
18196
18503
  _this._fogDensity = 0.01;
18197
18504
  _this._fogParams = new miniprogram.Vector4();
18505
+ _this._isActive = true;
18198
18506
  _this.name = name || "";
18199
18507
  var shaderData = _this.shaderData;
18200
18508
  shaderData._addReferCount(1);
@@ -18442,6 +18750,24 @@ __decorate([
18442
18750
  this._fogParams.w = density / Math.sqrt(Math.LN2);
18443
18751
  };
18444
18752
  _create_class(Scene, [
18753
+ {
18754
+ key: "isActive",
18755
+ get: /**
18756
+ * Whether the scene is active.
18757
+ */ function get() {
18758
+ return this._isActive;
18759
+ },
18760
+ set: function set(value) {
18761
+ if (this._isActive !== value) {
18762
+ this._isActive = value;
18763
+ if (value) {
18764
+ this._sceneManager && this._processActive(true);
18765
+ } else {
18766
+ this._sceneManager && this._processActive(false);
18767
+ }
18768
+ }
18769
+ }
18770
+ },
18445
18771
  {
18446
18772
  key: "shaderData",
18447
18773
  get: /**
@@ -18760,7 +19086,11 @@ __decorate([
18760
19086
  * @internal
18761
19087
  */ _proto._onDestroy = function _onDestroy() {
18762
19088
  Component1.prototype._onDestroy.call(this);
18763
- this.scene._componentsManager.addPendingDestroyScript(this);
19089
+ if (this.scene) {
19090
+ this.scene._componentsManager.addPendingDestroyScript(this);
19091
+ } else {
19092
+ this.onDestroy();
19093
+ }
18764
19094
  };
18765
19095
  return Script;
18766
19096
  }(Component);
@@ -18903,7 +19233,7 @@ var passNum = 0;
18903
19233
  _proto.drawBatches = function drawBatches(camera) {
18904
19234
  var _this = this, engine = _this._engine, batchedQueue = _this._batchedQueue;
18905
19235
  var mesh = this._meshes[this._flushId];
18906
- var subMeshes = mesh.subMeshes;
19236
+ var subMeshes = mesh.subMeshes, primitive = mesh._primitive;
18907
19237
  var maskManager = engine._spriteMaskManager;
18908
19238
  var sceneData = camera.scene.shaderData;
18909
19239
  var cameraData = camera.shaderData;
@@ -18933,7 +19263,7 @@ var passNum = 0;
18933
19263
  program.uploadAll(program.rendererUniformBlock, renderer.shaderData);
18934
19264
  program.uploadAll(program.materialUniformBlock, material.shaderData);
18935
19265
  material.renderState._apply(engine, false, shaderPass._renderStateDataMap, material.shaderData);
18936
- engine._hardwareRenderer.drawPrimitive(mesh._primitive, subMesh, program);
19266
+ engine._hardwareRenderer.drawPrimitive(primitive, subMesh, program);
18937
19267
  maskManager.postRender(renderer);
18938
19268
  }
18939
19269
  };
@@ -20310,8 +20640,8 @@ var /**
20310
20640
  };
20311
20641
  _proto._drawBackgroundTexture = function _drawBackgroundTexture(engine, background) {
20312
20642
  var rhi = engine._hardwareRenderer;
20313
- var material = engine._backgroundTextureMaterial, canvas = engine.canvas;
20314
- var mesh = background._mesh;
20643
+ var canvas = engine.canvas;
20644
+ var material = background._material, mesh = background._mesh;
20315
20645
  if ((this._lastCanvasSize.x !== canvas.width || this._lastCanvasSize.y !== canvas.height) && background._textureFillMode !== exports.BackgroundTextureFillMode.Fill) {
20316
20646
  this._lastCanvasSize.set(canvas.width, canvas.height);
20317
20647
  background._resizeBackgroundTexture();
@@ -20322,7 +20652,7 @@ var /**
20322
20652
  program.uploadAll(program.materialUniformBlock, material.shaderData);
20323
20653
  program.uploadUnGroupTextures();
20324
20654
  (pass._renderState || material.renderState)._apply(engine, false, pass._renderStateDataMap, material.shaderData);
20325
- rhi.drawPrimitive(mesh, mesh.subMesh, program);
20655
+ rhi.drawPrimitive(mesh._primitive, mesh.subMesh, program);
20326
20656
  };
20327
20657
  _proto._callRender = function _callRender(context) {
20328
20658
  var engine = context.camera.engine;
@@ -20486,7 +20816,7 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component1) {
20486
20816
  // Use the intersection of the near clipping plane as the origin point.
20487
20817
  var origin = this._innerViewportToWorldPoint(point.x, point.y, 0.0, invViewProjMat, out.origin);
20488
20818
  // Use the intersection of the far clipping plane as the origin point.
20489
- var direction = this._innerViewportToWorldPoint(point.x, point.y, 1.0, invViewProjMat, out.direction);
20819
+ var direction = this._innerViewportToWorldPoint(point.x, point.y, 1 - miniprogram.MathUtil.zeroTolerance, invViewProjMat, out.direction);
20490
20820
  miniprogram.Vector3.subtract(direction, origin, direction);
20491
20821
  direction.normalize();
20492
20822
  return out;
@@ -24124,6 +24454,9 @@ var DirtyFlag;
24124
24454
  this.property = property;
24125
24455
  this.component = target.getComponent(type);
24126
24456
  this.cureType = cureType;
24457
+ var isBlendShape = _instanceof(this.component, SkinnedMeshRenderer);
24458
+ // @todo: Temp solution with blendShape
24459
+ this._isCopyMode = cureType._isCopyMode && !isBlendShape;
24127
24460
  var assemblerType = AnimationCurveOwner.getAssemblerType(type, property);
24128
24461
  this._assembler = new assemblerType();
24129
24462
  this._assembler.initialize(this);
@@ -24155,7 +24488,7 @@ var DirtyFlag;
24155
24488
  this._assembler.setTargetValue(this.defaultValue);
24156
24489
  };
24157
24490
  _proto.getEvaluateValue = function getEvaluateValue(out) {
24158
- if (this.cureType._isCopyMode) {
24491
+ if (this._isCopyMode) {
24159
24492
  this.cureType._setValue(this.baseEvaluateData.value, out);
24160
24493
  return out;
24161
24494
  } else {
@@ -24163,14 +24496,14 @@ var DirtyFlag;
24163
24496
  }
24164
24497
  };
24165
24498
  _proto.saveDefaultValue = function saveDefaultValue() {
24166
- if (this.cureType._isCopyMode) {
24499
+ if (this._isCopyMode) {
24167
24500
  this.cureType._setValue(this.referenceTargetValue, this.defaultValue);
24168
24501
  } else {
24169
24502
  this.defaultValue = this._assembler.getTargetValue();
24170
24503
  }
24171
24504
  };
24172
24505
  _proto.saveFixedPoseValue = function saveFixedPoseValue() {
24173
- if (this.cureType._isCopyMode) {
24506
+ if (this._isCopyMode) {
24174
24507
  this.cureType._setValue(this.referenceTargetValue, this.fixedPoseValue);
24175
24508
  } else {
24176
24509
  this.fixedPoseValue = this._assembler.getTargetValue();
@@ -24179,7 +24512,7 @@ var DirtyFlag;
24179
24512
  _proto.applyValue = function applyValue(value, weight, additive) {
24180
24513
  var cureType = this.cureType;
24181
24514
  if (additive) {
24182
- if (cureType._isCopyMode) {
24515
+ if (this._isCopyMode) {
24183
24516
  cureType._additiveValue(value, weight, this.referenceTargetValue);
24184
24517
  } else {
24185
24518
  var assembler = this._assembler;
@@ -24189,13 +24522,13 @@ var DirtyFlag;
24189
24522
  }
24190
24523
  } else {
24191
24524
  if (weight === 1.0) {
24192
- if (cureType._isCopyMode) {
24525
+ if (this._isCopyMode) {
24193
24526
  cureType._setValue(value, this.referenceTargetValue);
24194
24527
  } else {
24195
24528
  this._assembler.setTargetValue(value);
24196
24529
  }
24197
24530
  } else {
24198
- if (cureType._isCopyMode) {
24531
+ if (this._isCopyMode) {
24199
24532
  var targetValue = this.referenceTargetValue;
24200
24533
  cureType._lerpValue(targetValue, value, weight, targetValue);
24201
24534
  } else {
@@ -24207,7 +24540,7 @@ var DirtyFlag;
24207
24540
  }
24208
24541
  };
24209
24542
  _proto._lerpValue = function _lerpValue(srcValue, destValue, crossWeight) {
24210
- if (this.cureType._isCopyMode) {
24543
+ if (this._isCopyMode) {
24211
24544
  return this.cureType._lerpValue(srcValue, destValue, crossWeight, this.baseEvaluateData.value);
24212
24545
  } else {
24213
24546
  this.baseEvaluateData.value = this.cureType._lerpValue(srcValue, destValue, crossWeight);
@@ -24290,16 +24623,22 @@ AnimationCurveOwner.registerAssembler(Transform, "scale", ScaleAnimationCurveOwn
24290
24623
  /**
24291
24624
  * @internal
24292
24625
  */ var BlendShapeWeightsAnimationCurveOwnerAssembler = /*#__PURE__*/ function() {
24293
- function BlendShapeWeightsAnimationCurveOwnerAssembler() {}
24626
+ function BlendShapeWeightsAnimationCurveOwnerAssembler() {
24627
+ this._skinnedMeshRenderer = [];
24628
+ }
24294
24629
  var _proto = BlendShapeWeightsAnimationCurveOwnerAssembler.prototype;
24295
24630
  _proto.initialize = function initialize(owner) {
24296
- this._skinnedMeshRenderer = owner.target.getComponent(SkinnedMeshRenderer);
24631
+ // @todo: Compatible with multiple SkinnedMeshRenderer in a entity, optimize later.
24632
+ owner.target.getComponents(SkinnedMeshRenderer, this._skinnedMeshRenderer);
24297
24633
  };
24298
24634
  _proto.getTargetValue = function getTargetValue() {
24299
- return this._skinnedMeshRenderer.blendShapeWeights;
24635
+ return this._skinnedMeshRenderer[0].blendShapeWeights;
24300
24636
  };
24301
24637
  _proto.setTargetValue = function setTargetValue(value) {
24302
- this._skinnedMeshRenderer.blendShapeWeights = value;
24638
+ var skinnedMeshRenderer = this._skinnedMeshRenderer;
24639
+ for(var i = 0, n = skinnedMeshRenderer.length; i < n; i++){
24640
+ skinnedMeshRenderer[i].blendShapeWeights = value;
24641
+ }
24303
24642
  };
24304
24643
  return BlendShapeWeightsAnimationCurveOwnerAssembler;
24305
24644
  }();
@@ -26176,7 +26515,6 @@ exports.AnimatorLayerBlendingMode = void 0;
26176
26515
  var state = playState.state;
26177
26516
  var clipDuration = state.clip.length;
26178
26517
  if (this.speed * state.speed >= 0) {
26179
- console.log(999, clipTime, lastClipTime);
26180
26518
  if (clipTime < lastClipTime) {
26181
26519
  this._checkSubTransition(playState, transitions, layerIndex, lastClipTime, state.clipEndTime * clipDuration);
26182
26520
  playState.currentTransitionIndex = 0;
@@ -26965,64 +27303,203 @@ exports.SunMode = void 0;
26965
27303
  SkyProceduralMaterial._sunSimpleMacro = ShaderMacro.getByName("MATERIAL_SUN_SIMPLE");
26966
27304
  })();
26967
27305
 
27306
+ var SubPrimitive = function SubPrimitive() {
27307
+ };
27308
+
26968
27309
  /**
26969
- * Particle Material.
26970
- */ var ParticleMaterial = /*#__PURE__*/ function(BaseMaterial1) {
26971
- _inherits(ParticleMaterial, BaseMaterial1);
26972
- function ParticleMaterial(engine) {
27310
+ * The rendering mode for particle renderer.
27311
+ */ exports.ParticleRenderMode = void 0;
27312
+ (function(ParticleRenderMode) {
27313
+ ParticleRenderMode[ParticleRenderMode[/** Render particles as billboards facing the active camera. */ "Billboard"] = 0] = "Billboard";
27314
+ ParticleRenderMode[ParticleRenderMode[/** Stretch particles in the direction of motion. */ "StretchBillboard"] = 1] = "StretchBillboard";
27315
+ ParticleRenderMode[ParticleRenderMode[/** Render particles as billboards always facing up along the y-Axis. */ "HorizontalBillboard"] = 2] = "HorizontalBillboard";
27316
+ ParticleRenderMode[ParticleRenderMode[/** Render particles as billboards always facing the player, but not pitching along the x-Axis. */ "VerticalBillboard"] = 3] = "VerticalBillboard";
27317
+ ParticleRenderMode[ParticleRenderMode[/** Render particles as meshes. */ "Mesh"] = 4] = "Mesh";
27318
+ ParticleRenderMode[ParticleRenderMode[/** Do not render particles. */ "None"] = 5] = "None";
27319
+ })(exports.ParticleRenderMode || (exports.ParticleRenderMode = {}));
27320
+
27321
+ exports.ParticleStopMode = void 0;
27322
+ (function(ParticleStopMode) {
27323
+ ParticleStopMode[ParticleStopMode[/** Stop emitting new particles and clear existing particles immediately. */ "StopEmittingAndClear"] = 0] = "StopEmittingAndClear";
27324
+ ParticleStopMode[ParticleStopMode[/** Stop emitting new particles, but keep existing particles until they expire. */ "StopEmitting"] = 1] = "StopEmitting";
27325
+ })(exports.ParticleStopMode || (exports.ParticleStopMode = {}));
27326
+
27327
+ /**
27328
+ * Particle Renderer Component.
27329
+ */ var ParticleRenderer = /*#__PURE__*/ function(Renderer1) {
27330
+ _inherits(ParticleRenderer, Renderer1);
27331
+ function ParticleRenderer(entity) {
26973
27332
  var _this;
26974
- _this = BaseMaterial1.call(this, engine, Shader.find("particle-shader")) || this;
26975
- var shaderData = _this.shaderData;
26976
- shaderData.enableMacro("MATERIAL_OMIT_NORMAL");
26977
- shaderData.setColor(BaseMaterial._baseColorProp, new miniprogram.Color(1, 1, 1, 1));
26978
- _this.isTransparent = true;
27333
+ _this = Renderer1.call(this, entity) || this;
27334
+ /** Particle generator. */ _this.generator = new ParticleGenerator(_assert_this_initialized(_this));
27335
+ /** Specifies how much particles stretch depending on their velocity. */ _this.velocityScale = 0;
27336
+ /** How much are the particles stretched in their direction of motion, defined as the length of the particle compared to its width. */ _this.lengthScale = 2;
27337
+ /** The pivot of particle. */ _this.pivot = new miniprogram.Vector3();
27338
+ _this._currentRenderModeMacro = ParticleRenderer._billboardModeMacro;
27339
+ _this.shaderData.enableMacro(ParticleRenderer._billboardModeMacro);
27340
+ _this._supportInstancedArrays = _this.engine._hardwareRenderer.canIUse(exports.GLCapabilityType.instancedArrays);
26979
27341
  return _this;
26980
27342
  }
26981
- var _proto = ParticleMaterial.prototype;
27343
+ var _proto = ParticleRenderer.prototype;
26982
27344
  /**
26983
- * @inheritdoc
26984
- */ _proto.clone = function clone() {
26985
- var dest = new ParticleMaterial(this._engine);
26986
- this.cloneTo(dest);
26987
- return dest;
27345
+ * @internal
27346
+ */ _proto._onEnable = function _onEnable() {
27347
+ if (this.generator.main.playOnEnabled) {
27348
+ this.generator.play(false);
27349
+ }
26988
27350
  };
26989
- _create_class(ParticleMaterial, [
27351
+ /**
27352
+ * @internal
27353
+ */ _proto._onDisable = function _onDisable() {
27354
+ this.generator.stop(false, exports.ParticleStopMode.StopEmittingAndClear);
27355
+ };
27356
+ /**
27357
+ * @internal
27358
+ */ _proto._prepareRender = function _prepareRender(context) {
27359
+ if (!this._supportInstancedArrays) {
27360
+ return;
27361
+ }
27362
+ var generator = this.generator;
27363
+ generator._update(this.engine.time.deltaTime);
27364
+ // No particles to render
27365
+ if (generator._firstActiveElement === generator._firstFreeElement) {
27366
+ return;
27367
+ }
27368
+ Renderer1.prototype._prepareRender.call(this, context);
27369
+ };
27370
+ /**
27371
+ * @internal
27372
+ */ _proto._updateBounds = function _updateBounds(worldBounds) {
27373
+ worldBounds.min.set(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
27374
+ worldBounds.max.set(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
27375
+ };
27376
+ /**
27377
+ * @internal
27378
+ */ _proto._updateShaderData = function _updateShaderData(context) {
27379
+ var shaderData = this.shaderData;
27380
+ shaderData.setFloat(ParticleRenderer._lengthScale, this.lengthScale);
27381
+ shaderData.setFloat(ParticleRenderer._speedScale, this.velocityScale);
27382
+ shaderData.setFloat(ParticleRenderer._currentTime, this.generator._playTime);
27383
+ shaderData.setVector3(ParticleRenderer._pivotOffsetProperty, this.pivot);
27384
+ this.generator._updateShaderData(shaderData);
27385
+ };
27386
+ _proto._render = function _render(context) {
27387
+ var generator = this.generator;
27388
+ var primitive = generator._primitive;
27389
+ if (generator._firstActiveElement < generator._firstFreeElement) {
27390
+ primitive.instanceCount = generator._firstFreeElement - generator._firstActiveElement;
27391
+ } else {
27392
+ var instanceCount = generator._currentParticleCount - generator._firstActiveElement;
27393
+ if (generator._firstFreeElement > 0) {
27394
+ instanceCount += generator._firstFreeElement;
27395
+ }
27396
+ primitive.instanceCount = instanceCount;
27397
+ }
27398
+ var material = this.getMaterial();
27399
+ var renderData = this._engine._renderDataPool.getFromPool();
27400
+ renderData.setX(this, material, generator._primitive, generator._subPrimitive);
27401
+ context.camera._renderPipeline.pushRenderData(context, renderData);
27402
+ };
27403
+ _proto._onDestroy = function _onDestroy() {
27404
+ this.generator._destroy();
27405
+ };
27406
+ _create_class(ParticleRenderer, [
26990
27407
  {
26991
- key: "baseColor",
27408
+ key: "renderMode",
26992
27409
  get: /**
26993
- * Base color.
27410
+ * Specifies how particles are rendered.
26994
27411
  */ function get() {
26995
- return this.shaderData.getColor(BaseMaterial._baseColorProp);
27412
+ return this._renderMode;
26996
27413
  },
26997
27414
  set: function set(value) {
26998
- var baseColor = this.shaderData.getColor(BaseMaterial._baseColorProp);
26999
- if (value !== baseColor) {
27000
- baseColor.copyFrom(value);
27415
+ if (this._renderMode !== value) {
27416
+ var lastRenderMode = this._renderMode;
27417
+ this._renderMode = value;
27418
+ var renderModeMacro = null;
27419
+ var shaderData = this.shaderData;
27420
+ switch(value){
27421
+ case exports.ParticleRenderMode.Billboard:
27422
+ renderModeMacro = ParticleRenderer._billboardModeMacro;
27423
+ break;
27424
+ case exports.ParticleRenderMode.StretchBillboard:
27425
+ renderModeMacro = ParticleRenderer._stretchedBillboardModeMacro;
27426
+ break;
27427
+ case exports.ParticleRenderMode.HorizontalBillboard:
27428
+ throw "Not implemented";
27429
+ case exports.ParticleRenderMode.VerticalBillboard:
27430
+ throw "Not implemented";
27431
+ case exports.ParticleRenderMode.Mesh:
27432
+ throw "Not implemented";
27433
+ }
27434
+ if (this._currentRenderModeMacro !== renderModeMacro) {
27435
+ this._currentRenderModeMacro && shaderData.disableMacro(this._currentRenderModeMacro);
27436
+ renderModeMacro && shaderData.enableMacro(renderModeMacro);
27437
+ this._currentRenderModeMacro = renderModeMacro;
27438
+ }
27439
+ // @ts-ignore
27440
+ if (lastRenderMode !== exports.ParticleRenderMode.Mesh !== (value === exports.ParticleRenderMode.Mesh)) {
27441
+ this.generator._reorganizeGeometryBuffers();
27442
+ }
27001
27443
  }
27002
27444
  }
27003
27445
  },
27004
27446
  {
27005
- key: "baseTexture",
27447
+ key: "mesh",
27006
27448
  get: /**
27007
- * Base texture.
27449
+ * The mesh of particle.
27450
+ * @remarks Valid when `renderMode` is `Mesh`.
27008
27451
  */ function get() {
27009
- return this.shaderData.getTexture(BaseMaterial._baseTextureProp);
27452
+ return this._mesh;
27010
27453
  },
27011
27454
  set: function set(value) {
27012
- this.shaderData.setTexture(BaseMaterial._baseTextureProp, value);
27013
- if (value) {
27014
- this.shaderData.enableMacro(BaseMaterial._baseTextureMacro);
27015
- } else {
27016
- this.shaderData.disableMacro(BaseMaterial._baseTextureMacro);
27455
+ var lastMesh = this._mesh;
27456
+ if (lastMesh !== value) {
27457
+ var _lastMesh, _value;
27458
+ this._mesh = value;
27459
+ (_lastMesh = lastMesh) == null ? void 0 : _lastMesh._addReferCount(-1);
27460
+ (_value = value) == null ? void 0 : _value._addReferCount(1);
27461
+ if (this.renderMode === exports.ParticleRenderMode.Mesh) {
27462
+ this.generator._reorganizeGeometryBuffers();
27463
+ }
27017
27464
  }
27018
27465
  }
27019
27466
  }
27020
27467
  ]);
27021
- return ParticleMaterial;
27022
- }(BaseMaterial);
27023
-
27024
- var SubPrimitive = function SubPrimitive() {
27025
- };
27468
+ return ParticleRenderer;
27469
+ }(exports.Renderer);
27470
+ (function() {
27471
+ ParticleRenderer._billboardModeMacro = ShaderMacro.getByName("RENDERER_MODE_SPHERE_BILLBOARD");
27472
+ })();
27473
+ (function() {
27474
+ ParticleRenderer._stretchedBillboardModeMacro = ShaderMacro.getByName("RENDERER_MODE_STRETCHED_BILLBOARD");
27475
+ })();
27476
+ (function() {
27477
+ ParticleRenderer._horizontalBillboardModeMacro = ShaderMacro.getByName("RENDERER_MODE_HORIZONTAL_BILLBOARD");
27478
+ })();
27479
+ (function() {
27480
+ ParticleRenderer._verticalBillboardModeMacro = ShaderMacro.getByName("RENDERER_MODE_VERTICAL_BILLBOARD");
27481
+ })();
27482
+ (function() {
27483
+ ParticleRenderer._renderModeMeshMacro = ShaderMacro.getByName("RENDERER_MODE_MESH");
27484
+ })();
27485
+ (function() {
27486
+ ParticleRenderer._pivotOffsetProperty = ShaderProperty.getByName("renderer_PivotOffset");
27487
+ })();
27488
+ (function() {
27489
+ ParticleRenderer._lengthScale = ShaderProperty.getByName("renderer_StretchedBillboardLengthScale");
27490
+ })();
27491
+ (function() {
27492
+ ParticleRenderer._speedScale = ShaderProperty.getByName("renderer_StretchedBillboardSpeedScale");
27493
+ })();
27494
+ (function() {
27495
+ ParticleRenderer._currentTime = ShaderProperty.getByName("renderer_CurrentTime");
27496
+ })();
27497
+ __decorate([
27498
+ deepClone
27499
+ ], ParticleRenderer.prototype, "generator", void 0);
27500
+ __decorate([
27501
+ shallowClone
27502
+ ], ParticleRenderer.prototype, "pivot", void 0);
27026
27503
 
27027
27504
  /**
27028
27505
  * Particle curve mode.
@@ -27044,18 +27521,6 @@ var SubPrimitive = function SubPrimitive() {
27044
27521
  ParticleGradientMode[ParticleGradientMode[/* Random value between two color gradients. */ "TwoGradients"] = 3] = "TwoGradients";
27045
27522
  })(exports.ParticleGradientMode || (exports.ParticleGradientMode = {}));
27046
27523
 
27047
- /**
27048
- * The rendering mode for particle renderer.
27049
- */ exports.ParticleRenderMode = void 0;
27050
- (function(ParticleRenderMode) {
27051
- ParticleRenderMode[ParticleRenderMode[/** Render particles as billboards facing the active camera. */ "Billboard"] = 0] = "Billboard";
27052
- ParticleRenderMode[ParticleRenderMode[/** Stretch particles in the direction of motion. */ "StretchBillboard"] = 1] = "StretchBillboard";
27053
- ParticleRenderMode[ParticleRenderMode[/** Render particles as billboards always facing up along the y-Axis. */ "HorizontalBillboard"] = 2] = "HorizontalBillboard";
27054
- ParticleRenderMode[ParticleRenderMode[/** Render particles as billboards always facing the player, but not pitching along the x-Axis. */ "VerticalBillboard"] = 3] = "VerticalBillboard";
27055
- ParticleRenderMode[ParticleRenderMode[/** Render particles as meshes. */ "Mesh"] = 4] = "Mesh";
27056
- ParticleRenderMode[ParticleRenderMode[/** Do not render particles. */ "None"] = 5] = "None";
27057
- })(exports.ParticleRenderMode || (exports.ParticleRenderMode = {}));
27058
-
27059
27524
  /**
27060
27525
  * The space to simulate particles in.
27061
27526
  */ exports.ParticleSimulationSpace = void 0;
@@ -27064,12 +27529,6 @@ var SubPrimitive = function SubPrimitive() {
27064
27529
  ParticleSimulationSpace[ParticleSimulationSpace[/** Simulate particles in world space. */ "World"] = 1] = "World";
27065
27530
  })(exports.ParticleSimulationSpace || (exports.ParticleSimulationSpace = {}));
27066
27531
 
27067
- exports.ParticleStopMode = void 0;
27068
- (function(ParticleStopMode) {
27069
- ParticleStopMode[ParticleStopMode[/** Stop emitting new particles and clear existing particles immediately. */ "StopEmittingAndClear"] = 0] = "StopEmittingAndClear";
27070
- ParticleStopMode[ParticleStopMode[/** Stop emitting new particles, but keep existing particles until they expire. */ "StopEmitting"] = 1] = "StopEmitting";
27071
- })(exports.ParticleStopMode || (exports.ParticleStopMode = {}));
27072
-
27073
27532
  /**
27074
27533
  * @internal
27075
27534
  */ var ParticleRandomSubSeeds;
@@ -27697,15 +28156,13 @@ var MainModule = /*#__PURE__*/ function() {
27697
28156
  /** The initial lifetime of particles when emitted. */ this.startLifetime = new ParticleCompositeCurve(5);
27698
28157
  /** The initial speed of particles when the Particle Generator first spawns them. */ this.startSpeed = new ParticleCompositeCurve(5);
27699
28158
  /** A flag to enable specifying particle size individually for each axis. */ this.startSize3D = false;
27700
- /** The initial size of particles when the Particle Generator first spawns them. */ this.startSize = new ParticleCompositeCurve(1);
27701
28159
  /** The initial size of particles along the x-axis when the Particle Generator first spawns them. */ this.startSizeX = new ParticleCompositeCurve(1);
27702
28160
  /** The initial size of particles along the y-axis when the Particle Generator first spawns them. */ this.startSizeY = new ParticleCompositeCurve(1);
27703
28161
  /** The initial size of particles along the z-axis when the Particle Generator first spawns them. */ this.startSizeZ = new ParticleCompositeCurve(1);
27704
- /** A flag to enable 3D particle rotation. */ this.startRotation3D = false;
27705
- /** The initial rotation of particles when the Particle Generator first spawns them. */ this.startRotation = new ParticleCompositeCurve(0);
28162
+ /** A flag to enable 3D particle rotation, when disabled, only `startRotationZ` is used. */ this.startRotation3D = false;
27706
28163
  /** The initial rotation of particles around the x-axis when emitted.*/ this.startRotationX = new ParticleCompositeCurve(0);
27707
28164
  /** The initial rotation of particles around the y-axis when emitted. */ this.startRotationY = new ParticleCompositeCurve(0);
27708
- this.startRotationZ = new ParticleCompositeCurve(0);
28165
+ /** The initial rotation of particles around the z-axis when emitted. */ this.startRotationZ = new ParticleCompositeCurve(0);
27709
28166
  /** Makes some particles spin in the opposite direction. */ this.flipRotation = 0;
27710
28167
  /** The mode of start color */ this.startColor = new ParticleCompositeGradient(new miniprogram.Color(1, 1, 1, 1));
27711
28168
  /** A scale that this Particle Generator applies to gravity, defined by Physics.gravity. */ this.gravityModifier = new ParticleCompositeCurve(0);
@@ -27808,6 +28265,17 @@ var MainModule = /*#__PURE__*/ function() {
27808
28265
  }
27809
28266
  }
27810
28267
  }
28268
+ },
28269
+ {
28270
+ key: "startSize",
28271
+ get: /**
28272
+ * The initial size of particles when the Particle Generator first spawns them.
28273
+ */ function get() {
28274
+ return this.startSizeX;
28275
+ },
28276
+ set: function set(value) {
28277
+ this.startSizeX = value;
28278
+ }
27811
28279
  }
27812
28280
  ]);
27813
28281
  return MainModule;
@@ -27851,9 +28319,6 @@ __decorate([
27851
28319
  __decorate([
27852
28320
  deepClone
27853
28321
  ], MainModule.prototype, "startSpeed", void 0);
27854
- __decorate([
27855
- deepClone
27856
- ], MainModule.prototype, "startSize", void 0);
27857
28322
  __decorate([
27858
28323
  deepClone
27859
28324
  ], MainModule.prototype, "startSizeX", void 0);
@@ -27863,9 +28328,6 @@ __decorate([
27863
28328
  __decorate([
27864
28329
  deepClone
27865
28330
  ], MainModule.prototype, "startSizeZ", void 0);
27866
- __decorate([
27867
- deepClone
27868
- ], MainModule.prototype, "startRotation", void 0);
27869
28331
  __decorate([
27870
28332
  deepClone
27871
28333
  ], MainModule.prototype, "startRotationX", void 0);
@@ -27873,7 +28335,6 @@ __decorate([
27873
28335
  deepClone
27874
28336
  ], MainModule.prototype, "startRotationY", void 0);
27875
28337
  __decorate([
27876
- deepClone,
27877
28338
  deepClone
27878
28339
  ], MainModule.prototype, "startRotationZ", void 0);
27879
28340
  __decorate([
@@ -27914,7 +28375,7 @@ __decorate([
27914
28375
  function RotationOverLifetimeModule() {
27915
28376
  var _this;
27916
28377
  _this = ParticleGeneratorModule1.apply(this, arguments) || this;
27917
- /** Specifies whether the rotation is separate on each axis, when disabled only z axis is used. */ _this.separateAxes = false;
28378
+ /** Specifies whether the rotation is separate on each axis, when disabled, only `rotationZ` is used. */ _this.separateAxes = false;
27918
28379
  /** Rotation over lifetime for z axis. */ _this.rotationX = new ParticleCompositeCurve(0);
27919
28380
  /** Rotation over lifetime for z axis. */ _this.rotationY = new ParticleCompositeCurve(0);
27920
28381
  /** Rotation over lifetime for z axis. */ _this.rotationZ = new ParticleCompositeCurve(45);
@@ -28268,9 +28729,6 @@ __decorate([
28268
28729
  }
28269
28730
  var _proto = TextureSheetAnimationModule.prototype;
28270
28731
  /**
28271
- * @inheritDoc
28272
- */ _proto.cloneTo = function cloneTo(dest) {};
28273
- /**
28274
28732
  * @internal
28275
28733
  */ _proto._updateShaderData = function _updateShaderData(shaderData) {
28276
28734
  var frameMacro = null;
@@ -28758,7 +29216,7 @@ __decorate([
28758
29216
  instanceVertices[offset + 16] = miniprogram.MathUtil.degreeToRadian(main.startRotationY.evaluate(undefined, startRotationRand.random()));
28759
29217
  instanceVertices[offset + 17] = miniprogram.MathUtil.degreeToRadian(main.startRotationZ.evaluate(undefined, startRotationRand.random()));
28760
29218
  } else {
28761
- instanceVertices[offset + 15] = miniprogram.MathUtil.degreeToRadian(main.startRotation.evaluate(undefined, startRotationRand.random()));
29219
+ instanceVertices[offset + 15] = miniprogram.MathUtil.degreeToRadian(main.startRotationZ.evaluate(undefined, startRotationRand.random()));
28762
29220
  }
28763
29221
  // Start speed
28764
29222
  instanceVertices[offset + 18] = startSpeed;
@@ -29021,181 +29479,60 @@ __decorate([
29021
29479
  ], ParticleGenerator.prototype, "_instanceVertices", void 0);
29022
29480
 
29023
29481
  /**
29024
- * Particle Renderer Component.
29025
- */ var ParticleRenderer = /*#__PURE__*/ function(Renderer1) {
29026
- _inherits(ParticleRenderer, Renderer1);
29027
- function ParticleRenderer(entity) {
29482
+ * Particle Material.
29483
+ */ var ParticleMaterial = /*#__PURE__*/ function(BaseMaterial1) {
29484
+ _inherits(ParticleMaterial, BaseMaterial1);
29485
+ function ParticleMaterial(engine) {
29028
29486
  var _this;
29029
- _this = Renderer1.call(this, entity) || this;
29030
- /** Particle generator. */ _this.generator = new ParticleGenerator(_assert_this_initialized(_this));
29031
- /** Specifies how much particles stretch depending on their velocity. */ _this.velocityScale = 0;
29032
- /** How much are the particles stretched in their direction of motion, defined as the length of the particle compared to its width. */ _this.lengthScale = 2;
29033
- /** The pivot of particle. */ _this.pivot = new miniprogram.Vector3();
29034
- _this._currentRenderModeMacro = ParticleRenderer._billboardModeMacro;
29035
- _this.shaderData.enableMacro(ParticleRenderer._billboardModeMacro);
29036
- _this._supportInstancedArrays = _this.engine._hardwareRenderer.canIUse(exports.GLCapabilityType.instancedArrays);
29487
+ _this = BaseMaterial1.call(this, engine, Shader.find("particle-shader")) || this;
29488
+ var shaderData = _this.shaderData;
29489
+ shaderData.enableMacro("MATERIAL_OMIT_NORMAL");
29490
+ shaderData.setColor(BaseMaterial._baseColorProp, new miniprogram.Color(1, 1, 1, 1));
29491
+ _this.isTransparent = true;
29037
29492
  return _this;
29038
29493
  }
29039
- var _proto = ParticleRenderer.prototype;
29040
- /**
29041
- * @internal
29042
- */ _proto._onEnable = function _onEnable() {
29043
- if (this.generator.main.playOnEnabled) {
29044
- this.generator.play(false);
29045
- }
29046
- };
29047
- /**
29048
- * @internal
29049
- */ _proto._onDisable = function _onDisable() {
29050
- this.generator.stop(false, exports.ParticleStopMode.StopEmittingAndClear);
29051
- };
29052
- /**
29053
- * @internal
29054
- */ _proto._prepareRender = function _prepareRender(context) {
29055
- if (!this._supportInstancedArrays) {
29056
- return;
29057
- }
29058
- var generator = this.generator;
29059
- generator._update(this.engine.time.deltaTime);
29060
- // No particles to render
29061
- if (generator._firstActiveElement === generator._firstFreeElement) {
29062
- return;
29063
- }
29064
- Renderer1.prototype._prepareRender.call(this, context);
29065
- };
29066
- /**
29067
- * @internal
29068
- */ _proto._updateBounds = function _updateBounds(worldBounds) {
29069
- worldBounds.min.set(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
29070
- worldBounds.max.set(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
29071
- };
29494
+ var _proto = ParticleMaterial.prototype;
29072
29495
  /**
29073
- * @internal
29074
- */ _proto._updateShaderData = function _updateShaderData(context) {
29075
- var shaderData = this.shaderData;
29076
- shaderData.setFloat(ParticleRenderer._lengthScale, this.lengthScale);
29077
- shaderData.setFloat(ParticleRenderer._speedScale, this.velocityScale);
29078
- shaderData.setFloat(ParticleRenderer._currentTime, this.generator._playTime);
29079
- shaderData.setVector3(ParticleRenderer._pivotOffsetProperty, this.pivot);
29080
- this.generator._updateShaderData(shaderData);
29081
- };
29082
- _proto._render = function _render(context) {
29083
- var generator = this.generator;
29084
- var primitive = generator._primitive;
29085
- if (generator._firstActiveElement < generator._firstFreeElement) {
29086
- primitive.instanceCount = generator._firstFreeElement - generator._firstActiveElement;
29087
- } else {
29088
- var instanceCount = generator._currentParticleCount - generator._firstActiveElement;
29089
- if (generator._firstFreeElement > 0) {
29090
- instanceCount += generator._firstFreeElement;
29091
- }
29092
- primitive.instanceCount = instanceCount;
29093
- }
29094
- var material = this.getMaterial();
29095
- var renderData = this._engine._renderDataPool.getFromPool();
29096
- renderData.setX(this, material, generator._primitive, generator._subPrimitive);
29097
- context.camera._renderPipeline.pushRenderData(context, renderData);
29098
- };
29099
- _proto._onDestroy = function _onDestroy() {
29100
- this.generator._destroy();
29496
+ * @inheritdoc
29497
+ */ _proto.clone = function clone() {
29498
+ var dest = new ParticleMaterial(this._engine);
29499
+ this.cloneTo(dest);
29500
+ return dest;
29101
29501
  };
29102
- _create_class(ParticleRenderer, [
29502
+ _create_class(ParticleMaterial, [
29103
29503
  {
29104
- key: "renderMode",
29504
+ key: "baseColor",
29105
29505
  get: /**
29106
- * Specifies how particles are rendered.
29506
+ * Base color.
29107
29507
  */ function get() {
29108
- return this._renderMode;
29508
+ return this.shaderData.getColor(BaseMaterial._baseColorProp);
29109
29509
  },
29110
29510
  set: function set(value) {
29111
- if (this._renderMode !== value) {
29112
- var lastRenderMode = this._renderMode;
29113
- this._renderMode = value;
29114
- var renderModeMacro = null;
29115
- var shaderData = this.shaderData;
29116
- switch(value){
29117
- case exports.ParticleRenderMode.Billboard:
29118
- renderModeMacro = ParticleRenderer._billboardModeMacro;
29119
- break;
29120
- case exports.ParticleRenderMode.StretchBillboard:
29121
- renderModeMacro = ParticleRenderer._stretchedBillboardModeMacro;
29122
- break;
29123
- case exports.ParticleRenderMode.HorizontalBillboard:
29124
- throw "Not implemented";
29125
- case exports.ParticleRenderMode.VerticalBillboard:
29126
- throw "Not implemented";
29127
- case exports.ParticleRenderMode.Mesh:
29128
- throw "Not implemented";
29129
- }
29130
- if (this._currentRenderModeMacro !== renderModeMacro) {
29131
- this._currentRenderModeMacro && shaderData.disableMacro(this._currentRenderModeMacro);
29132
- renderModeMacro && shaderData.enableMacro(renderModeMacro);
29133
- this._currentRenderModeMacro = renderModeMacro;
29134
- }
29135
- // @ts-ignore
29136
- if (lastRenderMode !== exports.ParticleRenderMode.Mesh !== (value === exports.ParticleRenderMode.Mesh)) {
29137
- this.generator._reorganizeGeometryBuffers();
29138
- }
29511
+ var baseColor = this.shaderData.getColor(BaseMaterial._baseColorProp);
29512
+ if (value !== baseColor) {
29513
+ baseColor.copyFrom(value);
29139
29514
  }
29140
29515
  }
29141
29516
  },
29142
29517
  {
29143
- key: "mesh",
29518
+ key: "baseTexture",
29144
29519
  get: /**
29145
- * The mesh of particle.
29146
- * @remarks Valid when `renderMode` is `Mesh`.
29520
+ * Base texture.
29147
29521
  */ function get() {
29148
- return this._mesh;
29522
+ return this.shaderData.getTexture(BaseMaterial._baseTextureProp);
29149
29523
  },
29150
29524
  set: function set(value) {
29151
- var lastMesh = this._mesh;
29152
- if (lastMesh !== value) {
29153
- var _lastMesh, _value;
29154
- this._mesh = value;
29155
- (_lastMesh = lastMesh) == null ? void 0 : _lastMesh._addReferCount(-1);
29156
- (_value = value) == null ? void 0 : _value._addReferCount(1);
29157
- if (this.renderMode === exports.ParticleRenderMode.Mesh) {
29158
- this.generator._reorganizeGeometryBuffers();
29159
- }
29525
+ this.shaderData.setTexture(BaseMaterial._baseTextureProp, value);
29526
+ if (value) {
29527
+ this.shaderData.enableMacro(BaseMaterial._baseTextureMacro);
29528
+ } else {
29529
+ this.shaderData.disableMacro(BaseMaterial._baseTextureMacro);
29160
29530
  }
29161
29531
  }
29162
29532
  }
29163
29533
  ]);
29164
- return ParticleRenderer;
29165
- }(exports.Renderer);
29166
- (function() {
29167
- ParticleRenderer._billboardModeMacro = ShaderMacro.getByName("RENDERER_MODE_SPHERE_BILLBOARD");
29168
- })();
29169
- (function() {
29170
- ParticleRenderer._stretchedBillboardModeMacro = ShaderMacro.getByName("RENDERER_MODE_STRETCHED_BILLBOARD");
29171
- })();
29172
- (function() {
29173
- ParticleRenderer._horizontalBillboardModeMacro = ShaderMacro.getByName("RENDERER_MODE_HORIZONTAL_BILLBOARD");
29174
- })();
29175
- (function() {
29176
- ParticleRenderer._verticalBillboardModeMacro = ShaderMacro.getByName("RENDERER_MODE_VERTICAL_BILLBOARD");
29177
- })();
29178
- (function() {
29179
- ParticleRenderer._renderModeMeshMacro = ShaderMacro.getByName("RENDERER_MODE_MESH");
29180
- })();
29181
- (function() {
29182
- ParticleRenderer._pivotOffsetProperty = ShaderProperty.getByName("renderer_PivotOffset");
29183
- })();
29184
- (function() {
29185
- ParticleRenderer._lengthScale = ShaderProperty.getByName("renderer_StretchedBillboardLengthScale");
29186
- })();
29187
- (function() {
29188
- ParticleRenderer._speedScale = ShaderProperty.getByName("renderer_StretchedBillboardSpeedScale");
29189
- })();
29190
- (function() {
29191
- ParticleRenderer._currentTime = ShaderProperty.getByName("renderer_CurrentTime");
29192
- })();
29193
- __decorate([
29194
- deepClone
29195
- ], ParticleRenderer.prototype, "generator", void 0);
29196
- __decorate([
29197
- shallowClone
29198
- ], ParticleRenderer.prototype, "pivot", void 0);
29534
+ return ParticleMaterial;
29535
+ }(BaseMaterial);
29199
29536
 
29200
29537
  /**
29201
29538
  * A burst is a particle emission event, where a number of particles are all emitted at the same time
@@ -29867,6 +30204,7 @@ exports.CharacterController = CharacterController;
29867
30204
  exports.CircleShape = CircleShape;
29868
30205
  exports.CloneManager = CloneManager;
29869
30206
  exports.ColliderShape = ColliderShape;
30207
+ exports.ColorOverLifetimeModule = ColorOverLifetimeModule;
29870
30208
  exports.Component = Component;
29871
30209
  exports.ConeShape = ConeShape;
29872
30210
  exports.ContentRestorer = ContentRestorer;
@@ -29875,12 +30213,15 @@ exports.CurveKey = CurveKey;
29875
30213
  exports.DepthState = DepthState;
29876
30214
  exports.DirectLight = DirectLight;
29877
30215
  exports.DynamicCollider = DynamicCollider;
30216
+ exports.EmissionModule = EmissionModule;
29878
30217
  exports.Engine = Engine;
29879
30218
  exports.EngineObject = EngineObject;
29880
30219
  exports.Entity = Entity;
29881
30220
  exports.EventDispatcher = EventDispatcher;
29882
30221
  exports.FixedJoint = FixedJoint;
29883
30222
  exports.Font = Font;
30223
+ exports.GradientAlphaKey = GradientAlphaKey;
30224
+ exports.GradientColorKey = GradientColorKey;
29884
30225
  exports.HemisphereShape = HemisphereShape;
29885
30226
  exports.HingeJoint = HingeJoint;
29886
30227
  exports.HitResult = HitResult;
@@ -29892,6 +30233,7 @@ exports.Keyframe = Keyframe;
29892
30233
  exports.Light = Light;
29893
30234
  exports.Loader = Loader;
29894
30235
  exports.Logger = Logger;
30236
+ exports.MainModule = MainModule;
29895
30237
  exports.Material = Material;
29896
30238
  exports.Mesh = Mesh;
29897
30239
  exports.MeshRenderer = MeshRenderer;
@@ -29900,7 +30242,10 @@ exports.PBRBaseMaterial = PBRBaseMaterial;
29900
30242
  exports.PBRMaterial = PBRMaterial;
29901
30243
  exports.PBRSpecularMaterial = PBRSpecularMaterial;
29902
30244
  exports.ParticleCompositeCurve = ParticleCompositeCurve;
30245
+ exports.ParticleCompositeGradient = ParticleCompositeGradient;
29903
30246
  exports.ParticleCurve = ParticleCurve;
30247
+ exports.ParticleGenerator = ParticleGenerator;
30248
+ exports.ParticleGradient = ParticleGradient;
29904
30249
  exports.ParticleMaterial = ParticleMaterial;
29905
30250
  exports.ParticleRenderer = ParticleRenderer;
29906
30251
  exports.PhysicsMaterial = PhysicsMaterial;
@@ -29919,6 +30264,7 @@ exports.RenderState = RenderState;
29919
30264
  exports.RenderTarget = RenderTarget;
29920
30265
  exports.RenderTargetBlendState = RenderTargetBlendState;
29921
30266
  exports.ResourceManager = ResourceManager;
30267
+ exports.RotationOverLifetimeModule = RotationOverLifetimeModule;
29922
30268
  exports.Scene = Scene;
29923
30269
  exports.SceneManager = SceneManager;
29924
30270
  exports.Script = Script;
@@ -29930,6 +30276,7 @@ exports.ShaderMacroCollection = ShaderMacroCollection;
29930
30276
  exports.ShaderPass = ShaderPass;
29931
30277
  exports.ShaderProperty = ShaderProperty;
29932
30278
  exports.ShaderTagKey = ShaderTagKey;
30279
+ exports.SizeOverLifetimeModule = SizeOverLifetimeModule;
29933
30280
  exports.Skin = Skin;
29934
30281
  exports.SkinnedMeshRenderer = SkinnedMeshRenderer;
29935
30282
  exports.Sky = Sky;
@@ -29955,12 +30302,14 @@ exports.Texture = Texture;
29955
30302
  exports.Texture2D = Texture2D;
29956
30303
  exports.Texture2DArray = Texture2DArray;
29957
30304
  exports.TextureCube = TextureCube;
30305
+ exports.TextureSheetAnimationModule = TextureSheetAnimationModule;
29958
30306
  exports.Time = Time;
29959
30307
  exports.TrailMaterial = TrailMaterial;
29960
30308
  exports.TrailRenderer = TrailRenderer;
29961
30309
  exports.Transform = Transform;
29962
30310
  exports.UnlitMaterial = UnlitMaterial;
29963
30311
  exports.Utils = Utils;
30312
+ exports.VelocityOverLifetimeModule = VelocityOverLifetimeModule;
29964
30313
  exports.VertexBufferBinding = VertexBufferBinding;
29965
30314
  exports.VertexElement = VertexElement;
29966
30315
  exports.assignmentClone = assignmentClone;