@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 +47 -34
- package/dist/main.js.map +1 -1
- package/dist/module.js +47 -34
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/Transform.d.ts +5 -3
package/dist/module.js
CHANGED
|
@@ -7644,7 +7644,7 @@ function dependentComponents(componentOrComponents, dependentMode) {
|
|
|
7644
7644
|
_inherits(Transform, Component);
|
|
7645
7645
|
function Transform(entity) {
|
|
7646
7646
|
var _this;
|
|
7647
|
-
_this = Component.call(this, entity) || this, _this._position = new Vector3(), _this._rotation = new Vector3(), _this._rotationQuaternion = new Quaternion(), _this._scale = new Vector3(1, 1, 1), _this._localUniformScaling = true, _this._worldPosition = new Vector3(), _this._worldRotation = new Vector3(), _this._worldRotationQuaternion = new Quaternion(), _this._worldUniformScaling = true, _this._lossyWorldScale = new Vector3(1, 1, 1), _this._localMatrix = new Matrix(), _this._worldMatrix = new Matrix(), _this._worldForward = null, _this._worldRight = null, _this._worldUp = null, _this._isParentDirty = true, _this._parentTransformCache = null, _this._dirtyFlag =
|
|
7647
|
+
_this = Component.call(this, entity) || this, _this._position = new Vector3(), _this._rotation = new Vector3(), _this._rotationQuaternion = new Quaternion(), _this._scale = new Vector3(1, 1, 1), _this._localUniformScaling = true, _this._worldPosition = new Vector3(), _this._worldRotation = new Vector3(), _this._worldRotationQuaternion = new Quaternion(), _this._worldUniformScaling = true, _this._lossyWorldScale = new Vector3(1, 1, 1), _this._localMatrix = new Matrix(), _this._worldMatrix = new Matrix(), _this._worldForward = null, _this._worldRight = null, _this._worldUp = null, _this._isParentDirty = true, _this._parentTransformCache = null, _this._dirtyFlag = 510;
|
|
7648
7648
|
_this._onPositionChanged = _this._onPositionChanged.bind(_this);
|
|
7649
7649
|
_this._onWorldPositionChanged = _this._onWorldPositionChanged.bind(_this);
|
|
7650
7650
|
_this._onRotationChanged = _this._onRotationChanged.bind(_this);
|
|
@@ -7809,11 +7809,23 @@ function dependentComponents(componentOrComponents, dependentMode) {
|
|
|
7809
7809
|
/**
|
|
7810
7810
|
* @internal
|
|
7811
7811
|
*/ _proto._cloneTo = function _cloneTo(target, srcRoot, targetRoot) {
|
|
7812
|
-
target._position.
|
|
7813
|
-
|
|
7814
|
-
|
|
7812
|
+
var position = target._position, rotation = target._rotation, scale = target._scale;
|
|
7813
|
+
// @ts-ignore
|
|
7814
|
+
position._onValueChanged = rotation._onValueChanged = scale._onValueChanged = null;
|
|
7815
|
+
position.copyFrom(this.position);
|
|
7816
|
+
rotation.copyFrom(this.rotation);
|
|
7817
|
+
scale.copyFrom(this.scale);
|
|
7818
|
+
// @ts-ignore
|
|
7819
|
+
position._onValueChanged = target._onPositionChanged;
|
|
7820
|
+
// @ts-ignore
|
|
7821
|
+
rotation._onValueChanged = target._onRotationChanged;
|
|
7822
|
+
// @ts-ignore
|
|
7823
|
+
scale._onValueChanged = target._onScaleChanged;
|
|
7824
|
+
};
|
|
7825
|
+
_proto._onLocalMatrixChanging = function _onLocalMatrixChanging() {
|
|
7826
|
+
this._setDirtyFlagFalse(64);
|
|
7815
7827
|
};
|
|
7816
|
-
_proto.
|
|
7828
|
+
_proto._onWorldMatrixChanging = function _onWorldMatrixChanging() {
|
|
7817
7829
|
this._setDirtyFlagFalse(128);
|
|
7818
7830
|
};
|
|
7819
7831
|
_proto._isContainDirtyFlags = function _isContainDirtyFlags(targetDirtyFlags) {
|
|
@@ -8263,9 +8275,9 @@ function dependentComponents(componentOrComponents, dependentMode) {
|
|
|
8263
8275
|
// @ts-ignore
|
|
8264
8276
|
position._onValueChanged = rotationQuaternion._onValueChanged = scale._onValueChanged = null;
|
|
8265
8277
|
value.decompose(position, rotationQuaternion, scale);
|
|
8266
|
-
this._onLocalMatrixChanging
|
|
8278
|
+
this._onLocalMatrixChanging();
|
|
8267
8279
|
this._setDirtyFlagTrue(1);
|
|
8268
|
-
this._setDirtyFlagFalse(
|
|
8280
|
+
this._setDirtyFlagFalse(2);
|
|
8269
8281
|
// @ts-ignore
|
|
8270
8282
|
position._onValueChanged = this._onPositionChanged;
|
|
8271
8283
|
// @ts-ignore
|
|
@@ -8310,7 +8322,7 @@ function dependentComponents(componentOrComponents, dependentMode) {
|
|
|
8310
8322
|
this._localMatrix.copyFrom(value);
|
|
8311
8323
|
}
|
|
8312
8324
|
this.localMatrix = this._localMatrix;
|
|
8313
|
-
this.
|
|
8325
|
+
this._onWorldMatrixChanging();
|
|
8314
8326
|
}
|
|
8315
8327
|
},
|
|
8316
8328
|
{
|
|
@@ -8359,40 +8371,40 @@ Transform._tempMat32 = new Matrix3x3();
|
|
|
8359
8371
|
Transform._tempMat41 = new Matrix();
|
|
8360
8372
|
Transform._tempMat42 = new Matrix();
|
|
8361
8373
|
__decorate([
|
|
8362
|
-
|
|
8374
|
+
ignoreClone
|
|
8363
8375
|
], Transform.prototype, "_position", void 0);
|
|
8364
8376
|
__decorate([
|
|
8365
|
-
|
|
8377
|
+
ignoreClone
|
|
8366
8378
|
], Transform.prototype, "_rotation", void 0);
|
|
8367
8379
|
__decorate([
|
|
8368
|
-
|
|
8380
|
+
ignoreClone
|
|
8369
8381
|
], Transform.prototype, "_rotationQuaternion", void 0);
|
|
8370
8382
|
__decorate([
|
|
8371
|
-
|
|
8383
|
+
ignoreClone
|
|
8372
8384
|
], Transform.prototype, "_scale", void 0);
|
|
8373
8385
|
__decorate([
|
|
8374
8386
|
assignmentClone
|
|
8375
8387
|
], Transform.prototype, "_localUniformScaling", void 0);
|
|
8376
8388
|
__decorate([
|
|
8377
|
-
|
|
8389
|
+
ignoreClone
|
|
8378
8390
|
], Transform.prototype, "_worldPosition", void 0);
|
|
8379
8391
|
__decorate([
|
|
8380
|
-
|
|
8392
|
+
ignoreClone
|
|
8381
8393
|
], Transform.prototype, "_worldRotation", void 0);
|
|
8382
8394
|
__decorate([
|
|
8383
|
-
|
|
8395
|
+
ignoreClone
|
|
8384
8396
|
], Transform.prototype, "_worldRotationQuaternion", void 0);
|
|
8385
8397
|
__decorate([
|
|
8386
|
-
|
|
8398
|
+
ignoreClone
|
|
8387
8399
|
], Transform.prototype, "_worldUniformScaling", void 0);
|
|
8388
8400
|
__decorate([
|
|
8389
|
-
|
|
8401
|
+
ignoreClone
|
|
8390
8402
|
], Transform.prototype, "_lossyWorldScale", void 0);
|
|
8391
8403
|
__decorate([
|
|
8392
|
-
|
|
8404
|
+
ignoreClone
|
|
8393
8405
|
], Transform.prototype, "_localMatrix", void 0);
|
|
8394
8406
|
__decorate([
|
|
8395
|
-
|
|
8407
|
+
ignoreClone
|
|
8396
8408
|
], Transform.prototype, "_worldMatrix", void 0);
|
|
8397
8409
|
__decorate([
|
|
8398
8410
|
ignoreClone
|
|
@@ -8409,6 +8421,9 @@ __decorate([
|
|
|
8409
8421
|
__decorate([
|
|
8410
8422
|
ignoreClone
|
|
8411
8423
|
], Transform.prototype, "_parentTransformCache", void 0);
|
|
8424
|
+
__decorate([
|
|
8425
|
+
ignoreClone
|
|
8426
|
+
], Transform.prototype, "_dirtyFlag", void 0);
|
|
8412
8427
|
__decorate([
|
|
8413
8428
|
ignoreClone
|
|
8414
8429
|
], Transform.prototype, "_onPositionChanged", null);
|
|
@@ -8453,6 +8468,7 @@ __decorate([
|
|
|
8453
8468
|
/** WorldMatrix | WorldPosition | WorldScale */ TransformModifyFlags[TransformModifyFlags["WmWpWs"] = 164] = "WmWpWs";
|
|
8454
8469
|
/** WorldMatrix | WorldPosition | WorldEuler | WorldQuat | WorldScale */ TransformModifyFlags[TransformModifyFlags["WmWpWeWqWs"] = 188] = "WmWpWeWqWs";
|
|
8455
8470
|
/** WorldMatrix | WorldPosition | WorldEuler | WorldQuat | WorldScale | WorldUniformScaling */ TransformModifyFlags[TransformModifyFlags["WmWpWeWqWsWus"] = 444] = "WmWpWeWqWsWus";
|
|
8471
|
+
/** LocalQuat | LocalMatrix | WorldMatrix | WorldPosition | WorldEuler | WorldQuat | WorldScale | WorldUniformScaling */ TransformModifyFlags[TransformModifyFlags["LqLmWmWpWeWqWsWus"] = 510] = "LqLmWmWpWeWqWsWus";
|
|
8456
8472
|
return TransformModifyFlags;
|
|
8457
8473
|
}({});
|
|
8458
8474
|
|
|
@@ -10931,9 +10947,9 @@ var scalableAmbientOcclusionFS = "// Ambient Occlusion, largely inspired from:\n
|
|
|
10931
10947
|
// projection[0][0] is at index 0 (X scaling)
|
|
10932
10948
|
// projection[1][1] is at index 5 (Y scaling)
|
|
10933
10949
|
// The inverse values we need are:
|
|
10934
|
-
var
|
|
10950
|
+
var invProjectionScaleX = 1.0 / projectionScaleX;
|
|
10935
10951
|
var invProjectionScaleY = 1.0 / projectionScaleY;
|
|
10936
|
-
var invProjScaleXY = this._invProjScaleXY.set(
|
|
10952
|
+
var invProjScaleXY = this._invProjScaleXY.set(invProjectionScaleX * 2.0, invProjectionScaleY * 2.0);
|
|
10937
10953
|
shaderData.setVector2(ScalableAmbientObscurancePass._invProjScaleXYProp, invProjScaleXY);
|
|
10938
10954
|
var quality = ambientOcclusion.quality, radius = ambientOcclusion.radius;
|
|
10939
10955
|
this._updateBlurKernel(shaderData, quality);
|
|
@@ -10979,9 +10995,6 @@ var scalableAmbientOcclusionFS = "// Ambient Occlusion, largely inspired from:\n
|
|
|
10979
10995
|
this._blurRenderTarget = null;
|
|
10980
10996
|
}
|
|
10981
10997
|
this._depthRenderTarget = null;
|
|
10982
|
-
var material = this._material;
|
|
10983
|
-
material._addReferCount(-1);
|
|
10984
|
-
material.destroy();
|
|
10985
10998
|
};
|
|
10986
10999
|
_proto._updateBlurKernel = function _updateBlurKernel(blurShaderData, quality) {
|
|
10987
11000
|
if (quality === this._quality) {
|
|
@@ -19095,7 +19108,7 @@ var BlendShapeFrameDirty = /*#__PURE__*/ function(BlendShapeFrameDirty) {
|
|
|
19095
19108
|
continue;
|
|
19096
19109
|
}
|
|
19097
19110
|
if (material.destroyed || material.shader.destroyed) {
|
|
19098
|
-
material = this.engine.
|
|
19111
|
+
material = this.engine._basicResources.meshMagentaMaterial;
|
|
19099
19112
|
}
|
|
19100
19113
|
var subRenderElement = subRenderElementPool.get();
|
|
19101
19114
|
subRenderElement.set(this, material, mesh._primitive, subMeshes[i1]);
|
|
@@ -23085,6 +23098,8 @@ __decorate([
|
|
|
23085
23098
|
this.spriteDefaultMaterial = this._create2DMaterial(engine, Shader.find("Sprite"));
|
|
23086
23099
|
this.textDefaultMaterial = this._create2DMaterial(engine, Shader.find("Text"));
|
|
23087
23100
|
this.spriteMaskDefaultMaterial = this._createSpriteMaskMaterial(engine);
|
|
23101
|
+
this.meshMagentaMaterial = this._createMagentaMaterial(engine, "unlit");
|
|
23102
|
+
this.particleMagentaMaterial = this._createMagentaMaterial(engine, "particle-shader");
|
|
23088
23103
|
}
|
|
23089
23104
|
var _proto = BasicResources.prototype;
|
|
23090
23105
|
/**
|
|
@@ -23190,6 +23205,12 @@ __decorate([
|
|
|
23190
23205
|
material.isGCIgnored = true;
|
|
23191
23206
|
return material;
|
|
23192
23207
|
};
|
|
23208
|
+
_proto._createMagentaMaterial = function _createMagentaMaterial(engine, shaderName) {
|
|
23209
|
+
var material = new Material(engine, Shader.find(shaderName));
|
|
23210
|
+
material.isGCIgnored = true;
|
|
23211
|
+
material.shaderData.setColor("material_BaseColor", new Color(1.0, 0.0, 1.01, 1.0));
|
|
23212
|
+
return material;
|
|
23213
|
+
};
|
|
23193
23214
|
_proto._createSpriteMaskMaterial = function _createSpriteMaskMaterial(engine) {
|
|
23194
23215
|
var material = new Material(engine, Shader.find("SpriteMask"));
|
|
23195
23216
|
material.isGCIgnored = true;
|
|
@@ -26098,14 +26119,6 @@ ShaderPool.init();
|
|
|
26098
26119
|
if (!hardwareRenderer.canIUse(GLCapabilityType.sRGB)) {
|
|
26099
26120
|
_this._macroCollection.enable(Engine._noSRGBSupportMacro);
|
|
26100
26121
|
}
|
|
26101
|
-
var meshMagentaMaterial = new Material(_this, Shader.find("unlit"));
|
|
26102
|
-
meshMagentaMaterial.isGCIgnored = true;
|
|
26103
|
-
meshMagentaMaterial.shaderData.setColor("material_BaseColor", new Color(1.0, 0.0, 1.01, 1.0));
|
|
26104
|
-
_this._meshMagentaMaterial = meshMagentaMaterial;
|
|
26105
|
-
var particleMagentaMaterial = new Material(_this, Shader.find("particle-shader"));
|
|
26106
|
-
particleMagentaMaterial.isGCIgnored = true;
|
|
26107
|
-
particleMagentaMaterial.shaderData.setColor("material_BaseColor", new Color(1.0, 0.0, 1.01, 1.0));
|
|
26108
|
-
_this._particleMagentaMaterial = particleMagentaMaterial;
|
|
26109
26122
|
_this._basicResources = new BasicResources(_this);
|
|
26110
26123
|
_this._particleBufferUtils = new ParticleBufferUtils(_this);
|
|
26111
26124
|
var uberPass = new PostProcessUberPass(_this);
|
|
@@ -32451,7 +32464,7 @@ var ParticleStopMode = /*#__PURE__*/ function(ParticleStopMode) {
|
|
|
32451
32464
|
return;
|
|
32452
32465
|
}
|
|
32453
32466
|
if (material.destroyed || material.shader.destroyed) {
|
|
32454
|
-
material = this.engine.
|
|
32467
|
+
material = this.engine._basicResources.particleMagentaMaterial;
|
|
32455
32468
|
}
|
|
32456
32469
|
var engine = this._engine;
|
|
32457
32470
|
var renderElement = engine._renderElementPool.get();
|