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