@galacean/engine-core 1.6.0-alpha.1 → 1.6.0-alpha.2

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
@@ -7648,7 +7648,7 @@ function dependentComponents(componentOrComponents, dependentMode) {
7648
7648
  _inherits(Transform, Component);
7649
7649
  function Transform(entity) {
7650
7650
  var _this;
7651
- _this = Component.call(this, entity) || this, _this._position = new engineMath.Vector3(), _this._rotation = new engineMath.Vector3(), _this._rotationQuaternion = new engineMath.Quaternion(), _this._scale = new engineMath.Vector3(1, 1, 1), _this._localUniformScaling = true, _this._worldPosition = new engineMath.Vector3(), _this._worldRotation = new engineMath.Vector3(), _this._worldRotationQuaternion = new engineMath.Quaternion(), _this._worldUniformScaling = true, _this._lossyWorldScale = new engineMath.Vector3(1, 1, 1), _this._localMatrix = new engineMath.Matrix(), _this._worldMatrix = new engineMath.Matrix(), _this._worldForward = null, _this._worldRight = null, _this._worldUp = null, _this._isParentDirty = true, _this._parentTransformCache = null, _this._dirtyFlag = 188;
7651
+ _this = Component.call(this, entity) || this, _this._position = new engineMath.Vector3(), _this._rotation = new engineMath.Vector3(), _this._rotationQuaternion = new engineMath.Quaternion(), _this._scale = new engineMath.Vector3(1, 1, 1), _this._localUniformScaling = true, _this._worldPosition = new engineMath.Vector3(), _this._worldRotation = new engineMath.Vector3(), _this._worldRotationQuaternion = new engineMath.Quaternion(), _this._worldUniformScaling = true, _this._lossyWorldScale = new engineMath.Vector3(1, 1, 1), _this._localMatrix = new engineMath.Matrix(), _this._worldMatrix = new engineMath.Matrix(), _this._worldForward = null, _this._worldRight = null, _this._worldUp = null, _this._isParentDirty = true, _this._parentTransformCache = null, _this._dirtyFlag = 510;
7652
7652
  _this._onPositionChanged = _this._onPositionChanged.bind(_this);
7653
7653
  _this._onWorldPositionChanged = _this._onWorldPositionChanged.bind(_this);
7654
7654
  _this._onRotationChanged = _this._onRotationChanged.bind(_this);
@@ -7813,11 +7813,23 @@ function dependentComponents(componentOrComponents, dependentMode) {
7813
7813
  /**
7814
7814
  * @internal
7815
7815
  */ _proto._cloneTo = function _cloneTo(target, srcRoot, targetRoot) {
7816
- target._position.copyFrom(this.position);
7817
- target._rotation.copyFrom(this.rotation);
7818
- target._scale.copyFrom(this.scale);
7816
+ var position = target._position, rotation = target._rotation, scale = target._scale;
7817
+ // @ts-ignore
7818
+ position._onValueChanged = rotation._onValueChanged = scale._onValueChanged = null;
7819
+ position.copyFrom(this.position);
7820
+ rotation.copyFrom(this.rotation);
7821
+ scale.copyFrom(this.scale);
7822
+ // @ts-ignore
7823
+ position._onValueChanged = target._onPositionChanged;
7824
+ // @ts-ignore
7825
+ rotation._onValueChanged = target._onRotationChanged;
7826
+ // @ts-ignore
7827
+ scale._onValueChanged = target._onScaleChanged;
7828
+ };
7829
+ _proto._onLocalMatrixChanging = function _onLocalMatrixChanging() {
7830
+ this._setDirtyFlagFalse(64);
7819
7831
  };
7820
- _proto._onWorldMatrixChange = function _onWorldMatrixChange() {
7832
+ _proto._onWorldMatrixChanging = function _onWorldMatrixChanging() {
7821
7833
  this._setDirtyFlagFalse(128);
7822
7834
  };
7823
7835
  _proto._isContainDirtyFlags = function _isContainDirtyFlags(targetDirtyFlags) {
@@ -8267,9 +8279,9 @@ function dependentComponents(componentOrComponents, dependentMode) {
8267
8279
  // @ts-ignore
8268
8280
  position._onValueChanged = rotationQuaternion._onValueChanged = scale._onValueChanged = null;
8269
8281
  value.decompose(position, rotationQuaternion, scale);
8270
- this._onLocalMatrixChanging == null ? void 0 : this._onLocalMatrixChanging.call(this);
8282
+ this._onLocalMatrixChanging();
8271
8283
  this._setDirtyFlagTrue(1);
8272
- this._setDirtyFlagFalse(64 | 2);
8284
+ this._setDirtyFlagFalse(2);
8273
8285
  // @ts-ignore
8274
8286
  position._onValueChanged = this._onPositionChanged;
8275
8287
  // @ts-ignore
@@ -8314,7 +8326,7 @@ function dependentComponents(componentOrComponents, dependentMode) {
8314
8326
  this._localMatrix.copyFrom(value);
8315
8327
  }
8316
8328
  this.localMatrix = this._localMatrix;
8317
- this._onWorldMatrixChange();
8329
+ this._onWorldMatrixChanging();
8318
8330
  }
8319
8331
  },
8320
8332
  {
@@ -8363,40 +8375,40 @@ Transform._tempMat32 = new engineMath.Matrix3x3();
8363
8375
  Transform._tempMat41 = new engineMath.Matrix();
8364
8376
  Transform._tempMat42 = new engineMath.Matrix();
8365
8377
  __decorate([
8366
- deepClone
8378
+ ignoreClone
8367
8379
  ], Transform.prototype, "_position", void 0);
8368
8380
  __decorate([
8369
- deepClone
8381
+ ignoreClone
8370
8382
  ], Transform.prototype, "_rotation", void 0);
8371
8383
  __decorate([
8372
- deepClone
8384
+ ignoreClone
8373
8385
  ], Transform.prototype, "_rotationQuaternion", void 0);
8374
8386
  __decorate([
8375
- deepClone
8387
+ ignoreClone
8376
8388
  ], Transform.prototype, "_scale", void 0);
8377
8389
  __decorate([
8378
8390
  assignmentClone
8379
8391
  ], Transform.prototype, "_localUniformScaling", void 0);
8380
8392
  __decorate([
8381
- deepClone
8393
+ ignoreClone
8382
8394
  ], Transform.prototype, "_worldPosition", void 0);
8383
8395
  __decorate([
8384
- deepClone
8396
+ ignoreClone
8385
8397
  ], Transform.prototype, "_worldRotation", void 0);
8386
8398
  __decorate([
8387
- deepClone
8399
+ ignoreClone
8388
8400
  ], Transform.prototype, "_worldRotationQuaternion", void 0);
8389
8401
  __decorate([
8390
- assignmentClone
8402
+ ignoreClone
8391
8403
  ], Transform.prototype, "_worldUniformScaling", void 0);
8392
8404
  __decorate([
8393
- deepClone
8405
+ ignoreClone
8394
8406
  ], Transform.prototype, "_lossyWorldScale", void 0);
8395
8407
  __decorate([
8396
- deepClone
8408
+ ignoreClone
8397
8409
  ], Transform.prototype, "_localMatrix", void 0);
8398
8410
  __decorate([
8399
- deepClone
8411
+ ignoreClone
8400
8412
  ], Transform.prototype, "_worldMatrix", void 0);
8401
8413
  __decorate([
8402
8414
  ignoreClone
@@ -8413,6 +8425,9 @@ __decorate([
8413
8425
  __decorate([
8414
8426
  ignoreClone
8415
8427
  ], Transform.prototype, "_parentTransformCache", void 0);
8428
+ __decorate([
8429
+ ignoreClone
8430
+ ], Transform.prototype, "_dirtyFlag", void 0);
8416
8431
  __decorate([
8417
8432
  ignoreClone
8418
8433
  ], Transform.prototype, "_onPositionChanged", null);
@@ -8457,6 +8472,7 @@ __decorate([
8457
8472
  /** WorldMatrix | WorldPosition | WorldScale */ TransformModifyFlags[TransformModifyFlags["WmWpWs"] = 164] = "WmWpWs";
8458
8473
  /** WorldMatrix | WorldPosition | WorldEuler | WorldQuat | WorldScale */ TransformModifyFlags[TransformModifyFlags["WmWpWeWqWs"] = 188] = "WmWpWeWqWs";
8459
8474
  /** WorldMatrix | WorldPosition | WorldEuler | WorldQuat | WorldScale | WorldUniformScaling */ TransformModifyFlags[TransformModifyFlags["WmWpWeWqWsWus"] = 444] = "WmWpWeWqWsWus";
8475
+ /** LocalQuat | LocalMatrix | WorldMatrix | WorldPosition | WorldEuler | WorldQuat | WorldScale | WorldUniformScaling */ TransformModifyFlags[TransformModifyFlags["LqLmWmWpWeWqWsWus"] = 510] = "LqLmWmWpWeWqWsWus";
8460
8476
  return TransformModifyFlags;
8461
8477
  }({});
8462
8478
 
@@ -10935,9 +10951,9 @@ var scalableAmbientOcclusionFS = "// Ambient Occlusion, largely inspired from:\n
10935
10951
  // projection[0][0] is at index 0 (X scaling)
10936
10952
  // projection[1][1] is at index 5 (Y scaling)
10937
10953
  // The inverse values we need are:
10938
- var invProjectionSacleX = 1.0 / projectionScaleX;
10954
+ var invProjectionScaleX = 1.0 / projectionScaleX;
10939
10955
  var invProjectionScaleY = 1.0 / projectionScaleY;
10940
- var invProjScaleXY = this._invProjScaleXY.set(invProjectionSacleX * 2.0, invProjectionScaleY * 2.0);
10956
+ var invProjScaleXY = this._invProjScaleXY.set(invProjectionScaleX * 2.0, invProjectionScaleY * 2.0);
10941
10957
  shaderData.setVector2(ScalableAmbientObscurancePass._invProjScaleXYProp, invProjScaleXY);
10942
10958
  var quality = ambientOcclusion.quality, radius = ambientOcclusion.radius;
10943
10959
  this._updateBlurKernel(shaderData, quality);
@@ -10983,9 +10999,6 @@ var scalableAmbientOcclusionFS = "// Ambient Occlusion, largely inspired from:\n
10983
10999
  this._blurRenderTarget = null;
10984
11000
  }
10985
11001
  this._depthRenderTarget = null;
10986
- var material = this._material;
10987
- material._addReferCount(-1);
10988
- material.destroy();
10989
11002
  };
10990
11003
  _proto._updateBlurKernel = function _updateBlurKernel(blurShaderData, quality) {
10991
11004
  if (quality === this._quality) {
@@ -19099,7 +19112,7 @@ var BlendShapeFrameDirty = /*#__PURE__*/ function(BlendShapeFrameDirty) {
19099
19112
  continue;
19100
19113
  }
19101
19114
  if (material.destroyed || material.shader.destroyed) {
19102
- material = this.engine._meshMagentaMaterial;
19115
+ material = this.engine._basicResources.meshMagentaMaterial;
19103
19116
  }
19104
19117
  var subRenderElement = subRenderElementPool.get();
19105
19118
  subRenderElement.set(this, material, mesh._primitive, subMeshes[i1]);
@@ -23089,6 +23102,8 @@ __decorate([
23089
23102
  this.spriteDefaultMaterial = this._create2DMaterial(engine, Shader.find("Sprite"));
23090
23103
  this.textDefaultMaterial = this._create2DMaterial(engine, Shader.find("Text"));
23091
23104
  this.spriteMaskDefaultMaterial = this._createSpriteMaskMaterial(engine);
23105
+ this.meshMagentaMaterial = this._createMagentaMaterial(engine, "unlit");
23106
+ this.particleMagentaMaterial = this._createMagentaMaterial(engine, "particle-shader");
23092
23107
  }
23093
23108
  var _proto = BasicResources.prototype;
23094
23109
  /**
@@ -23194,6 +23209,12 @@ __decorate([
23194
23209
  material.isGCIgnored = true;
23195
23210
  return material;
23196
23211
  };
23212
+ _proto._createMagentaMaterial = function _createMagentaMaterial(engine, shaderName) {
23213
+ var material = new Material(engine, Shader.find(shaderName));
23214
+ material.isGCIgnored = true;
23215
+ material.shaderData.setColor("material_BaseColor", new engineMath.Color(1.0, 0.0, 1.01, 1.0));
23216
+ return material;
23217
+ };
23197
23218
  _proto._createSpriteMaskMaterial = function _createSpriteMaskMaterial(engine) {
23198
23219
  var material = new Material(engine, Shader.find("SpriteMask"));
23199
23220
  material.isGCIgnored = true;
@@ -26102,14 +26123,6 @@ ShaderPool.init();
26102
26123
  if (!hardwareRenderer.canIUse(GLCapabilityType.sRGB)) {
26103
26124
  _this._macroCollection.enable(Engine._noSRGBSupportMacro);
26104
26125
  }
26105
- var meshMagentaMaterial = new Material(_this, Shader.find("unlit"));
26106
- meshMagentaMaterial.isGCIgnored = true;
26107
- meshMagentaMaterial.shaderData.setColor("material_BaseColor", new engineMath.Color(1.0, 0.0, 1.01, 1.0));
26108
- _this._meshMagentaMaterial = meshMagentaMaterial;
26109
- var particleMagentaMaterial = new Material(_this, Shader.find("particle-shader"));
26110
- particleMagentaMaterial.isGCIgnored = true;
26111
- particleMagentaMaterial.shaderData.setColor("material_BaseColor", new engineMath.Color(1.0, 0.0, 1.01, 1.0));
26112
- _this._particleMagentaMaterial = particleMagentaMaterial;
26113
26126
  _this._basicResources = new BasicResources(_this);
26114
26127
  _this._particleBufferUtils = new ParticleBufferUtils(_this);
26115
26128
  var uberPass = new PostProcessUberPass(_this);
@@ -32455,7 +32468,7 @@ var ParticleStopMode = /*#__PURE__*/ function(ParticleStopMode) {
32455
32468
  return;
32456
32469
  }
32457
32470
  if (material.destroyed || material.shader.destroyed) {
32458
- material = this.engine._particleMagentaMaterial;
32471
+ material = this.engine._basicResources.particleMagentaMaterial;
32459
32472
  }
32460
32473
  var engine = this._engine;
32461
32474
  var renderElement = engine._renderElementPool.get();