@galacean/engine-physics-physx 0.9.18 → 0.9.19

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.
@@ -21261,6 +21261,7 @@ var DirtyFlag;
21261
21261
  curKeyframeIndex: 0,
21262
21262
  value: null
21263
21263
  };
21264
+ this.updateMark = 0;
21264
21265
  this.target = target;
21265
21266
  this.type = type;
21266
21267
  this.property = property;
@@ -22701,9 +22702,9 @@ exports.AnimatorLayerBlendingMode = void 0;
22701
22702
  _this = Component.call(this, entity) || this;
22702
22703
  /** Culling mode of this Animator. */ _this.cullingMode = exports.AnimatorCullingMode.None;
22703
22704
  /** The playback speed of the Animator, 1.0 is normal playback speed. */ _this.speed = 1.0;
22705
+ _this._updateMark = 0;
22704
22706
  _this._animatorLayersData = [];
22705
22707
  _this._curveOwnerPool = Object.create(null);
22706
- _this._needRevertCurveOwners = [];
22707
22708
  _this._animationEventHandlerPool = new ClassPool(AnimationEventHandler);
22708
22709
  _this._tempAnimatorStateInfo = {
22709
22710
  layerIndex: -1,
@@ -22788,7 +22789,7 @@ exports.AnimatorLayerBlendingMode = void 0;
22788
22789
  return;
22789
22790
  }
22790
22791
  deltaTime *= this.speed;
22791
- this._revertCurveOwners();
22792
+ this._updateMark++;
22792
22793
  for(var i1 = 0, n1 = animatorController.layers.length; i1 < n1; i1++){
22793
22794
  var animatorLayerData = this._getAnimatorLayerData(i1);
22794
22795
  if (animatorLayerData.layerState === LayerState.Standby) {
@@ -22838,7 +22839,6 @@ exports.AnimatorLayerBlendingMode = void 0;
22838
22839
  }
22839
22840
  }
22840
22841
  this._animatorLayersData.length = 0;
22841
- this._needRevertCurveOwners.length = 0;
22842
22842
  this._curveOwnerPool = {};
22843
22843
  this._animationEventHandlerPool.resetPool();
22844
22844
  if (this._controllerUpdateFlag) {
@@ -22889,17 +22889,9 @@ exports.AnimatorLayerBlendingMode = void 0;
22889
22889
  var _curveOwnerPool, _instanceId, _propertyOwners, _property, _layerCurveOwnerPool, _instanceId1, _layerPropertyOwners, _property1;
22890
22890
  var property = curve.property;
22891
22891
  var instanceId = targetEntity.instanceId;
22892
- var needRevert = false;
22893
- if (this.animatorController.layers[layerIndex].blendingMode === exports.AnimatorLayerBlendingMode.Additive && layerIndex > 0) {
22894
- needRevert = true;
22895
- }
22896
22892
  // Get owner
22897
22893
  var propertyOwners = (_curveOwnerPool = curveOwnerPool)[_instanceId = instanceId] || (_curveOwnerPool[_instanceId] = Object.create(null));
22898
22894
  var owner = (_propertyOwners = propertyOwners)[_property = property] || (_propertyOwners[_property] = curve._createCurveOwner(targetEntity));
22899
- //@todo: There is performance waste here, which will be handled together with organizing AnimatorStateData later. The logic is changing from runtime to initialization.
22900
- if (needRevert) {
22901
- this._needRevertCurveOwners.push(owner);
22902
- }
22903
22895
  // Get layer owner
22904
22896
  var layerPropertyOwners = (_layerCurveOwnerPool = layerCurveOwnerPool)[_instanceId1 = instanceId] || (_layerCurveOwnerPool[_instanceId1] = Object.create(null));
22905
22897
  var layerOwner = (_layerPropertyOwners = layerPropertyOwners)[_property1 = property] || (_layerPropertyOwners[_property1] = curve._createCurveLayerOwner(owner));
@@ -23032,6 +23024,7 @@ exports.AnimatorLayerBlendingMode = void 0;
23032
23024
  if (!owner) continue;
23033
23025
  var curve = curveBindings[i].curve;
23034
23026
  if (curve.keys.length) {
23027
+ this._checkRevertOwner(owner, additive);
23035
23028
  var value = owner.evaluateValue(curve, clipTime, additive);
23036
23029
  aniUpdate && owner.applyValue(value, weight, additive);
23037
23030
  finished && layerOwner.saveFinalValue();
@@ -23077,6 +23070,7 @@ exports.AnimatorLayerBlendingMode = void 0;
23077
23070
  if (!owner) continue;
23078
23071
  var srcCurveIndex = layerOwner.crossSrcCurveIndex;
23079
23072
  var destCurveIndex = layerOwner.crossDestCurveIndex;
23073
+ this._checkRevertOwner(owner, additive);
23080
23074
  var value = owner.evaluateCrossFadeValue(srcCurveIndex >= 0 ? srcCurves[srcCurveIndex].curve : null, destCurveIndex >= 0 ? destCurves[destCurveIndex].curve : null, srcClipTime, destClipTime, crossWeight, additive);
23081
23075
  aniUpdate && owner.applyValue(value, weight, additive);
23082
23076
  finished && layerOwner.saveFinalValue();
@@ -23123,6 +23117,7 @@ exports.AnimatorLayerBlendingMode = void 0;
23123
23117
  var owner = layerOwner == null ? void 0 : layerOwner.curveOwner;
23124
23118
  if (!owner) continue;
23125
23119
  var curveIndex = layerOwner.crossDestCurveIndex;
23120
+ this._checkRevertOwner(owner, additive);
23126
23121
  var value = layerOwner.curveOwner.crossFadeFromPoseAndApplyValue(curveIndex >= 0 ? curveBindings[curveIndex].curve : null, destClipTime, crossWeight, additive);
23127
23122
  aniUpdate && owner.applyValue(value, weight, additive);
23128
23123
  finished && layerOwner.saveFinalValue();
@@ -23149,6 +23144,7 @@ exports.AnimatorLayerBlendingMode = void 0;
23149
23144
  var layerOwner = curveLayerOwner[i];
23150
23145
  var owner = layerOwner == null ? void 0 : layerOwner.curveOwner;
23151
23146
  if (!owner) continue;
23147
+ this._checkRevertOwner(owner, additive);
23152
23148
  owner.applyValue(layerOwner.finalValue, weight, additive);
23153
23149
  }
23154
23150
  };
@@ -23318,11 +23314,11 @@ exports.AnimatorLayerBlendingMode = void 0;
23318
23314
  }
23319
23315
  }
23320
23316
  };
23321
- _proto._revertCurveOwners = function _revertCurveOwners() {
23322
- var curveOwners = this._needRevertCurveOwners;
23323
- for(var i = 0, n = curveOwners.length; i < n; ++i){
23324
- curveOwners[i].revertDefaultValue();
23317
+ _proto._checkRevertOwner = function _checkRevertOwner(owner, additive) {
23318
+ if (additive && owner.updateMark !== this._updateMark) {
23319
+ owner.revertDefaultValue();
23325
23320
  }
23321
+ owner.updateMark = this._updateMark;
23326
23322
  };
23327
23323
  _create_class$2(Animator, [
23328
23324
  {
@@ -23352,13 +23348,13 @@ __decorate$1([
23352
23348
  ], Animator.prototype, "_controllerUpdateFlag", void 0);
23353
23349
  __decorate$1([
23354
23350
  ignoreClone
23355
- ], Animator.prototype, "_animatorLayersData", void 0);
23351
+ ], Animator.prototype, "_updateMark", void 0);
23356
23352
  __decorate$1([
23357
23353
  ignoreClone
23358
- ], Animator.prototype, "_curveOwnerPool", void 0);
23354
+ ], Animator.prototype, "_animatorLayersData", void 0);
23359
23355
  __decorate$1([
23360
23356
  ignoreClone
23361
- ], Animator.prototype, "_needRevertCurveOwners", void 0);
23357
+ ], Animator.prototype, "_curveOwnerPool", void 0);
23362
23358
  __decorate$1([
23363
23359
  ignoreClone
23364
23360
  ], Animator.prototype, "_animationEventHandlerPool", void 0);
@@ -36253,7 +36249,7 @@ function _interopNamespace(e) {
36253
36249
  }
36254
36250
  var CoreObjects__namespace = /*#__PURE__*/ _interopNamespace(CoreObjects);
36255
36251
  //@ts-ignore
36256
- var version = "0.9.18";
36252
+ var version = "0.9.19";
36257
36253
  console.log("Galacean engine version: " + version);
36258
36254
  for(var key in CoreObjects__namespace){
36259
36255
  CoreObjects.Loader.registerClass(key, CoreObjects__namespace[key]);