@galacean/engine-core 1.0.0-beta.18 → 1.0.0-beta.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -3954,6 +3954,23 @@ var rePropName = RegExp(// Match anything that isn't a dot or bracket.
3954
3954
  scale.z < 0 && (isInvert = !isInvert);
3955
3955
  return isInvert;
3956
3956
  };
3957
+ _proto._onDestroy = function _onDestroy() {
3958
+ Component.prototype._onDestroy.call(this);
3959
+ //@ts-ignore
3960
+ this._worldPosition._onValueChanged = null;
3961
+ //@ts-ignore
3962
+ this._rotation._onValueChanged = null;
3963
+ //@ts-ignore
3964
+ this._worldRotation._onValueChanged = null;
3965
+ //@ts-ignore
3966
+ this._rotationQuaternion._onValueChanged = null;
3967
+ //@ts-ignore
3968
+ this._worldRotationQuaternion._onValueChanged = null;
3969
+ //@ts-ignore
3970
+ this._position._onValueChanged = null;
3971
+ //@ts-ignore
3972
+ this._scale._onValueChanged = null;
3973
+ };
3957
3974
  /**
3958
3975
  * Get worldMatrix: Will trigger the worldMatrix update of itself and all parent entities.
3959
3976
  * Get worldPosition: Will trigger the worldMatrix, local position update of itself and the worldMatrix update of all parent entities.
@@ -4647,6 +4664,7 @@ var ComponentCloner = /*#__PURE__*/ function() {
4647
4664
  return component;
4648
4665
  }
4649
4666
  }
4667
+ return null;
4650
4668
  };
4651
4669
  /**
4652
4670
  * Get components which match the type.
@@ -5642,6 +5660,7 @@ var Collision = function Collision() {
5642
5660
  var _this = this;
5643
5661
  /** @internal */ this._initialized = false;
5644
5662
  this._restTime = 0;
5663
+ this._fixedTimeStep = 1 / 60;
5645
5664
  this._colliders = new DisorderedArray();
5646
5665
  this._gravity = new engineMath.Vector3(0, -9.81, 0);
5647
5666
  this._physicalObjectsMap = {};
@@ -5753,7 +5772,6 @@ var Collision = function Collision() {
5753
5772
  script1._waitHandlingInValid || script1.onTriggerStay(shape1);
5754
5773
  }
5755
5774
  };
5756
- /** The fixed time step in seconds at which physics are performed. */ this.fixedTimeStep = 1 / 60;
5757
5775
  this._engine = engine;
5758
5776
  this._setGravity = this._setGravity.bind(this);
5759
5777
  //@ts-ignore
@@ -5813,7 +5831,7 @@ var Collision = function Collision() {
5813
5831
  * Call on every frame to update pose of objects.
5814
5832
  * @internal
5815
5833
  */ _proto._update = function _update(deltaTime) {
5816
- var _this = this, fixedTimeStep = _this.fixedTimeStep, nativePhysicsManager = _this._nativePhysicsManager;
5834
+ var _this = this, fixedTimeStep = _this._fixedTimeStep, nativePhysicsManager = _this._nativePhysicsManager;
5817
5835
  var componentsManager = this._engine._componentsManager;
5818
5836
  var simulateTime = this._restTime + deltaTime;
5819
5837
  var step = Math.floor(simulateTime / fixedTimeStep);
@@ -5921,6 +5939,15 @@ var Collision = function Collision() {
5921
5939
  gravity.copyFrom(value);
5922
5940
  }
5923
5941
  }
5942
+ },
5943
+ {
5944
+ key: "fixedTimeStep",
5945
+ get: /** The fixed time step in seconds at which physics are performed. */ function get() {
5946
+ return this._fixedTimeStep;
5947
+ },
5948
+ set: function set(value) {
5949
+ this._fixedTimeStep = Math.max(value, engineMath.MathUtil.zeroTolerance);
5950
+ }
5924
5951
  }
5925
5952
  ]);
5926
5953
  return PhysicsManager;
@@ -9513,6 +9540,7 @@ __decorate([
9513
9540
  CloneManager.deepCloneObject(this.renderStates, target.renderStates);
9514
9541
  };
9515
9542
  _proto._addReferCount = function _addReferCount(value) {
9543
+ if (this._destroyed) return;
9516
9544
  ReferResource.prototype._addReferCount.call(this, value);
9517
9545
  this.shaderData._addReferCount(value);
9518
9546
  };