@galacean/engine-core 0.9.12 → 0.9.14
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 +479 -212
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +479 -212
- package/dist/module.js +479 -212
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/Camera.d.ts +5 -2
- package/types/RenderPipeline/ClassPool.d.ts +3 -1
- package/types/RenderPipeline/IPoolElement.d.ts +3 -0
- package/types/RenderPipeline/MeshRenderElement.d.ts +3 -1
- package/types/RenderPipeline/SpriteElement.d.ts +3 -1
- package/types/RenderPipeline/SpriteMaskElement.d.ts +3 -1
- package/types/RenderPipeline/TextRenderElement.d.ts +3 -1
- package/types/Renderer.d.ts +5 -2
- package/types/Scene.d.ts +10 -4
- package/types/animation/Animator.d.ts +5 -4
- package/types/animation/enums/LayerState.d.ts +3 -1
- package/types/animation/internal/AnimationCurveLayerOwner.d.ts +1 -0
- package/types/graphic/SubMesh.d.ts +3 -1
- package/types/material/Material.d.ts +5 -2
package/dist/miniprogram.js
CHANGED
|
@@ -2243,6 +2243,28 @@ var /** @internal */ PromiseState;
|
|
|
2243
2243
|
* @remarks The release principle is that it is not referenced by the components, including direct and indirect reference.
|
|
2244
2244
|
*/ _proto.gc = function gc() {
|
|
2245
2245
|
this._gc(false);
|
|
2246
|
+
var engine = this.engine;
|
|
2247
|
+
engine._renderElementPool.garbageCollection();
|
|
2248
|
+
engine._spriteElementPool.garbageCollection();
|
|
2249
|
+
engine._spriteMaskElementPool.garbageCollection();
|
|
2250
|
+
engine._textElementPool.garbageCollection();
|
|
2251
|
+
var _componentsManager = engine._componentsManager, _lightManager = engine._lightManager;
|
|
2252
|
+
_componentsManager._renderers.garbageCollection();
|
|
2253
|
+
// @ts-ignore
|
|
2254
|
+
_componentsManager._onStartScripts.garbageCollection();
|
|
2255
|
+
// @ts-ignore
|
|
2256
|
+
_componentsManager._onUpdateScripts.garbageCollection();
|
|
2257
|
+
// @ts-ignore
|
|
2258
|
+
_componentsManager._onLateUpdateScripts.garbageCollection();
|
|
2259
|
+
// @ts-ignore
|
|
2260
|
+
_componentsManager._onPhysicsUpdateScripts.garbageCollection();
|
|
2261
|
+
// @ts-ignore
|
|
2262
|
+
_componentsManager._onUpdateAnimations.garbageCollection();
|
|
2263
|
+
// @ts-ignore
|
|
2264
|
+
_componentsManager._onUpdateRenderers.garbageCollection();
|
|
2265
|
+
_lightManager._spotLights.garbageCollection();
|
|
2266
|
+
_lightManager._pointLights.garbageCollection();
|
|
2267
|
+
_lightManager._directLights.garbageCollection();
|
|
2246
2268
|
};
|
|
2247
2269
|
/**
|
|
2248
2270
|
* @internal
|
|
@@ -4085,6 +4107,11 @@ var TransformModifyFlags;
|
|
|
4085
4107
|
* @returns Cloned entity
|
|
4086
4108
|
*/ _proto.clone = function clone() {
|
|
4087
4109
|
var cloneEntity = new Entity(this._engine, this.name);
|
|
4110
|
+
var _this = this, hookResource = _this._hookResource;
|
|
4111
|
+
if (hookResource) {
|
|
4112
|
+
cloneEntity._hookResource = hookResource;
|
|
4113
|
+
hookResource._addRefCount(1);
|
|
4114
|
+
}
|
|
4088
4115
|
cloneEntity._isActive = this._isActive;
|
|
4089
4116
|
cloneEntity.transform.localMatrix = this.transform.localMatrix;
|
|
4090
4117
|
var children = this._children;
|
|
@@ -4109,6 +4136,10 @@ var TransformModifyFlags;
|
|
|
4109
4136
|
return;
|
|
4110
4137
|
}
|
|
4111
4138
|
EngineObject.prototype.destroy.call(this);
|
|
4139
|
+
if (this._hookResource) {
|
|
4140
|
+
this._hookResource._addRefCount(-1);
|
|
4141
|
+
this._hookResource = null;
|
|
4142
|
+
}
|
|
4112
4143
|
var components = this._components;
|
|
4113
4144
|
for(var i = components.length - 1; i >= 0; i--){
|
|
4114
4145
|
components[i].destroy();
|
|
@@ -9785,9 +9816,9 @@ __decorate([
|
|
|
9785
9816
|
function Material(engine, shader) {
|
|
9786
9817
|
var _this;
|
|
9787
9818
|
_this = RefObject.call(this, engine) || this;
|
|
9788
|
-
/** Shader data. */ _this.shaderData = new ShaderData(ShaderDataGroup.Material);
|
|
9789
9819
|
/** @internal */ _this._renderStates = [] // todo: later will as a part of shaderData when shader effect frame is OK, that is more powerful and flexible.
|
|
9790
9820
|
;
|
|
9821
|
+
_this._shaderData = new ShaderData(ShaderDataGroup.Material);
|
|
9791
9822
|
_this.shader = shader;
|
|
9792
9823
|
return _this;
|
|
9793
9824
|
}
|
|
@@ -9819,8 +9850,21 @@ __decorate([
|
|
|
9819
9850
|
*/ _proto._preRender = function _preRender(renderElement) {};
|
|
9820
9851
|
/**
|
|
9821
9852
|
* @override
|
|
9822
|
-
*/ _proto._onDestroy = function _onDestroy() {
|
|
9853
|
+
*/ _proto._onDestroy = function _onDestroy() {
|
|
9854
|
+
this._shader = null;
|
|
9855
|
+
this._shaderData = null;
|
|
9856
|
+
this._renderStates.length = 0;
|
|
9857
|
+
this._renderStates = null;
|
|
9858
|
+
};
|
|
9823
9859
|
_create_class(Material, [
|
|
9860
|
+
{
|
|
9861
|
+
key: "shaderData",
|
|
9862
|
+
get: /**
|
|
9863
|
+
* Shader data.
|
|
9864
|
+
*/ function get() {
|
|
9865
|
+
return this._shaderData;
|
|
9866
|
+
}
|
|
9867
|
+
},
|
|
9824
9868
|
{
|
|
9825
9869
|
key: "shader",
|
|
9826
9870
|
get: /**
|
|
@@ -9889,6 +9933,12 @@ __decorate([
|
|
|
9889
9933
|
*/ _proto.resetPool = function resetPool() {
|
|
9890
9934
|
this._elementPoolIndex = 0;
|
|
9891
9935
|
};
|
|
9936
|
+
_proto.garbageCollection = function garbageCollection() {
|
|
9937
|
+
var _this = this, pool = _this._elementPool;
|
|
9938
|
+
for(var i = pool.length - 1; i >= 0; i--){
|
|
9939
|
+
pool[i].dispose && pool[i].dispose();
|
|
9940
|
+
}
|
|
9941
|
+
};
|
|
9892
9942
|
return ClassPool;
|
|
9893
9943
|
}();
|
|
9894
9944
|
|
|
@@ -9911,6 +9961,9 @@ var RenderElement = function RenderElement() {
|
|
|
9911
9961
|
this.renderState = renderState;
|
|
9912
9962
|
this.shaderPass = shaderPass;
|
|
9913
9963
|
};
|
|
9964
|
+
_proto.dispose = function dispose() {
|
|
9965
|
+
this.component = this.mesh = this.subMesh = this.material = this.renderState = this.shaderPass = null;
|
|
9966
|
+
};
|
|
9914
9967
|
return MeshRenderElement;
|
|
9915
9968
|
}(RenderElement);
|
|
9916
9969
|
|
|
@@ -9956,6 +10009,9 @@ var SpriteElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
9956
10009
|
this.renderState = renderState;
|
|
9957
10010
|
this.shaderPass = shaderPass;
|
|
9958
10011
|
};
|
|
10012
|
+
_proto.dispose = function dispose() {
|
|
10013
|
+
this.component = this.renderData = this.material = this.texture = this.renderState = this.shaderPass = null;
|
|
10014
|
+
};
|
|
9959
10015
|
return SpriteElement;
|
|
9960
10016
|
}(RenderElement);
|
|
9961
10017
|
|
|
@@ -9974,6 +10030,9 @@ var SpriteMaskElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
9974
10030
|
this.renderData = renderData;
|
|
9975
10031
|
this.material = material;
|
|
9976
10032
|
};
|
|
10033
|
+
_proto.dispose = function dispose() {
|
|
10034
|
+
this.component = this.renderData = this.material = null;
|
|
10035
|
+
};
|
|
9977
10036
|
return SpriteMaskElement;
|
|
9978
10037
|
}(RenderElement);
|
|
9979
10038
|
|
|
@@ -9992,7 +10051,6 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
|
|
|
9992
10051
|
function Renderer1(entity) {
|
|
9993
10052
|
var _this;
|
|
9994
10053
|
_this = Component.call(this, entity) || this;
|
|
9995
|
-
/** ShaderData related to renderer. */ _this.shaderData = new ShaderData(ShaderDataGroup.Renderer);
|
|
9996
10054
|
/** @internal */ _this._onUpdateIndex = -1;
|
|
9997
10055
|
/** @internal */ _this._rendererIndex = -1;
|
|
9998
10056
|
/** @internal */ _this._globalShaderMacro = new ShaderMacroCollection();
|
|
@@ -10000,6 +10058,7 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
|
|
|
10000
10058
|
_this._overrideUpdate = false;
|
|
10001
10059
|
_this._materials = [];
|
|
10002
10060
|
_this._dirtyUpdateFlag = 0;
|
|
10061
|
+
_this._shaderData = new ShaderData(ShaderDataGroup.Renderer);
|
|
10003
10062
|
_this._mvMatrix = new miniprogram.Matrix();
|
|
10004
10063
|
_this._mvpMatrix = new miniprogram.Matrix();
|
|
10005
10064
|
_this._mvInvMatrix = new miniprogram.Matrix();
|
|
@@ -10146,6 +10205,17 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
|
|
|
10146
10205
|
var _materials_i;
|
|
10147
10206
|
(_materials_i = materials[i]) == null ? void 0 : _materials_i._addRefCount(-1);
|
|
10148
10207
|
}
|
|
10208
|
+
this._entity = null;
|
|
10209
|
+
this._globalShaderMacro = null;
|
|
10210
|
+
this._bounds = null;
|
|
10211
|
+
this._materials = null;
|
|
10212
|
+
this._shaderData = null;
|
|
10213
|
+
this._mvMatrix = null;
|
|
10214
|
+
this._mvpMatrix = null;
|
|
10215
|
+
this._mvInvMatrix = null;
|
|
10216
|
+
this._normalMatrix = null;
|
|
10217
|
+
this._materialsInstanced = null;
|
|
10218
|
+
this._rendererLayer = null;
|
|
10149
10219
|
};
|
|
10150
10220
|
_proto._updateShaderData = function _updateShaderData(context) {
|
|
10151
10221
|
var entity = this.entity;
|
|
@@ -10207,6 +10277,14 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
|
|
|
10207
10277
|
this._dirtyUpdateFlag |= 0x1;
|
|
10208
10278
|
};
|
|
10209
10279
|
_create_class(Renderer1, [
|
|
10280
|
+
{
|
|
10281
|
+
key: "shaderData",
|
|
10282
|
+
get: /**
|
|
10283
|
+
* ShaderData related to renderer.
|
|
10284
|
+
*/ function get() {
|
|
10285
|
+
return this._shaderData;
|
|
10286
|
+
}
|
|
10287
|
+
},
|
|
10210
10288
|
{
|
|
10211
10289
|
key: "isCulled",
|
|
10212
10290
|
get: /**
|
|
@@ -10291,9 +10369,6 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
|
|
|
10291
10369
|
}(), function() {
|
|
10292
10370
|
_Renderer._rendererLayerProperty = Shader.getPropertyByName("oasis_RendererLayer");
|
|
10293
10371
|
}(), _Renderer);
|
|
10294
|
-
__decorate([
|
|
10295
|
-
deepClone
|
|
10296
|
-
], exports.Renderer.prototype, "shaderData", void 0);
|
|
10297
10372
|
__decorate([
|
|
10298
10373
|
ignoreClone
|
|
10299
10374
|
], exports.Renderer.prototype, "_distanceForSort", void 0);
|
|
@@ -10321,6 +10396,9 @@ __decorate([
|
|
|
10321
10396
|
__decorate([
|
|
10322
10397
|
ignoreClone
|
|
10323
10398
|
], exports.Renderer.prototype, "_dirtyUpdateFlag", void 0);
|
|
10399
|
+
__decorate([
|
|
10400
|
+
deepClone
|
|
10401
|
+
], exports.Renderer.prototype, "_shaderData", void 0);
|
|
10324
10402
|
__decorate([
|
|
10325
10403
|
ignoreClone
|
|
10326
10404
|
], exports.Renderer.prototype, "_mvMatrix", void 0);
|
|
@@ -10575,6 +10653,7 @@ SimpleSpriteAssembler = __decorate([
|
|
|
10575
10653
|
sprite._addRefCount(-1);
|
|
10576
10654
|
sprite._updateFlagManager.removeListener(this._onSpriteChange);
|
|
10577
10655
|
}
|
|
10656
|
+
this._entity = null;
|
|
10578
10657
|
this._sprite = null;
|
|
10579
10658
|
this._renderData = null;
|
|
10580
10659
|
};
|
|
@@ -11180,14 +11259,19 @@ var BufferUtil = /*#__PURE__*/ function() {
|
|
|
11180
11259
|
|
|
11181
11260
|
/**
|
|
11182
11261
|
* Sub-mesh, mainly contains drawing information.
|
|
11183
|
-
*/ var SubMesh = function
|
|
11184
|
-
|
|
11185
|
-
|
|
11186
|
-
|
|
11187
|
-
|
|
11188
|
-
|
|
11189
|
-
|
|
11190
|
-
|
|
11262
|
+
*/ var SubMesh = /*#__PURE__*/ function() {
|
|
11263
|
+
function SubMesh(start, count, topology) {
|
|
11264
|
+
if (start === void 0) start = 0;
|
|
11265
|
+
if (count === void 0) count = 0;
|
|
11266
|
+
if (topology === void 0) topology = exports.MeshTopology.Triangles;
|
|
11267
|
+
this.start = start;
|
|
11268
|
+
this.count = count;
|
|
11269
|
+
this.topology = topology;
|
|
11270
|
+
}
|
|
11271
|
+
var _proto = SubMesh.prototype;
|
|
11272
|
+
_proto.dispose = function dispose() {};
|
|
11273
|
+
return SubMesh;
|
|
11274
|
+
}();
|
|
11191
11275
|
|
|
11192
11276
|
/**
|
|
11193
11277
|
* Mesh.
|
|
@@ -11303,6 +11387,7 @@ var BufferUtil = /*#__PURE__*/ function() {
|
|
|
11303
11387
|
this._indexBufferBinding = null;
|
|
11304
11388
|
this._vertexElements = null;
|
|
11305
11389
|
this._vertexElementMap = null;
|
|
11390
|
+
this._updateFlagManager = null;
|
|
11306
11391
|
this._platformPrimitive.destroy();
|
|
11307
11392
|
};
|
|
11308
11393
|
_proto._setVertexElements = function _setVertexElements(elements) {
|
|
@@ -12988,8 +13073,8 @@ var VertexChangedFlags;
|
|
|
12988
13073
|
*/ _proto._onDestroy = function _onDestroy() {
|
|
12989
13074
|
Renderer.prototype._onDestroy.call(this);
|
|
12990
13075
|
var mesh = this._mesh;
|
|
12991
|
-
if (mesh
|
|
12992
|
-
mesh._addRefCount(-1);
|
|
13076
|
+
if (mesh) {
|
|
13077
|
+
mesh.destroyed || mesh._addRefCount(-1);
|
|
12993
13078
|
mesh._updateFlagManager.removeListener(this._onMeshChanged);
|
|
12994
13079
|
this._mesh = null;
|
|
12995
13080
|
}
|
|
@@ -13326,10 +13411,21 @@ var rePropName = RegExp(// Match anything that isn't a dot or bracket.
|
|
|
13326
13411
|
* @internal
|
|
13327
13412
|
* @override
|
|
13328
13413
|
*/ _proto._onDestroy = function _onDestroy() {
|
|
13329
|
-
var
|
|
13414
|
+
var _this__rootBone, _this__jointTexture;
|
|
13330
13415
|
MeshRenderer.prototype._onDestroy.call(this);
|
|
13331
|
-
(
|
|
13416
|
+
(_this__rootBone = this._rootBone) == null ? void 0 : _this__rootBone.transform._updateFlagManager.removeListener(this._onTransformChanged);
|
|
13417
|
+
this._rootBone = null;
|
|
13418
|
+
this._jointDataCreateCache = null;
|
|
13419
|
+
this._skin = null;
|
|
13420
|
+
this._blendShapeWeights = null;
|
|
13421
|
+
this._localBounds = null;
|
|
13422
|
+
this._jointMatrices = null;
|
|
13332
13423
|
(_this__jointTexture = this._jointTexture) == null ? void 0 : _this__jointTexture.destroy();
|
|
13424
|
+
this._jointTexture = null;
|
|
13425
|
+
if (this._jointEntities) {
|
|
13426
|
+
this._jointEntities.length = 0;
|
|
13427
|
+
this._jointEntities = null;
|
|
13428
|
+
}
|
|
13333
13429
|
};
|
|
13334
13430
|
/**
|
|
13335
13431
|
* @internal
|
|
@@ -14717,6 +14813,11 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
14717
14813
|
_this.multiRenderData = true;
|
|
14718
14814
|
return _this;
|
|
14719
14815
|
}
|
|
14816
|
+
var _proto = TextRenderElement.prototype;
|
|
14817
|
+
_proto.dispose = function dispose() {
|
|
14818
|
+
this.component = this.material = this.renderState = this.shaderPass = null;
|
|
14819
|
+
this.charElements.length = 0;
|
|
14820
|
+
};
|
|
14720
14821
|
return TextRenderElement;
|
|
14721
14822
|
}(RenderElement);
|
|
14722
14823
|
|
|
@@ -14864,7 +14965,6 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
14864
14965
|
this.texture = null;
|
|
14865
14966
|
this.solidColor = null;
|
|
14866
14967
|
this.sky.destroy();
|
|
14867
|
-
this._engine = null;
|
|
14868
14968
|
};
|
|
14869
14969
|
/**
|
|
14870
14970
|
* @internal
|
|
@@ -15249,8 +15349,6 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
15249
15349
|
function Scene(engine, name) {
|
|
15250
15350
|
var _this;
|
|
15251
15351
|
_this = EngineObject.call(this, engine) || this;
|
|
15252
|
-
/** The background of the scene. */ _this.background = new Background(_this._engine);
|
|
15253
|
-
/** Scene-related shader data. */ _this.shaderData = new ShaderData(ShaderDataGroup.Scene);
|
|
15254
15352
|
/** If cast shadows. */ _this.castShadows = true;
|
|
15255
15353
|
/** The resolution of the shadow maps. */ _this.shadowResolution = exports.ShadowResolution.Medium;
|
|
15256
15354
|
/** The splits of two cascade distribution. */ _this.shadowTwoCascadeSplits = 1.0 / 3.0;
|
|
@@ -15260,6 +15358,8 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
15260
15358
|
/** @internal */ _this._isActiveInEngine = false;
|
|
15261
15359
|
/** @internal */ _this._globalShaderMacro = new ShaderMacroCollection();
|
|
15262
15360
|
/** @internal */ _this._rootEntities = [];
|
|
15361
|
+
_this._background = new Background(_this._engine);
|
|
15362
|
+
_this._shaderData = new ShaderData(ShaderDataGroup.Scene);
|
|
15263
15363
|
_this._shadowCascades = exports.ShadowCascadesMode.NoCascades;
|
|
15264
15364
|
_this._fogMode = exports.FogMode.None;
|
|
15265
15365
|
_this._fogColor = new miniprogram.Color(0.5, 0.5, 0.5, 1.0);
|
|
@@ -15421,6 +15521,8 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
15421
15521
|
var sunLightIndex = lightManager._getSunLightIndex();
|
|
15422
15522
|
if (sunLightIndex !== -1) {
|
|
15423
15523
|
this._sunLight = lightManager._directLights.get(sunLightIndex);
|
|
15524
|
+
} else {
|
|
15525
|
+
this._sunLight = null;
|
|
15424
15526
|
}
|
|
15425
15527
|
if (this.castShadows && this._sunLight && this._sunLight.shadowType !== exports.ShadowType.None) {
|
|
15426
15528
|
shaderData.enableMacro("SHADOW_TYPE", this._sunLight.shadowType.toString());
|
|
@@ -15480,6 +15582,22 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
15480
15582
|
this._fogParams.w = density / Math.sqrt(Math.LN2);
|
|
15481
15583
|
};
|
|
15482
15584
|
_create_class(Scene, [
|
|
15585
|
+
{
|
|
15586
|
+
key: "shaderData",
|
|
15587
|
+
get: /**
|
|
15588
|
+
* Scene-related shader data.
|
|
15589
|
+
*/ function get() {
|
|
15590
|
+
return this._shaderData;
|
|
15591
|
+
}
|
|
15592
|
+
},
|
|
15593
|
+
{
|
|
15594
|
+
key: "background",
|
|
15595
|
+
get: /**
|
|
15596
|
+
* The background of the scene.
|
|
15597
|
+
*/ function get() {
|
|
15598
|
+
return this._background;
|
|
15599
|
+
}
|
|
15600
|
+
},
|
|
15483
15601
|
{
|
|
15484
15602
|
key: "shadowCascades",
|
|
15485
15603
|
get: /**
|
|
@@ -17771,7 +17889,6 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component) {
|
|
|
17771
17889
|
function Camera1(entity) {
|
|
17772
17890
|
var _this;
|
|
17773
17891
|
_this = Component.call(this, entity) || this;
|
|
17774
|
-
/** Shader data. */ _this.shaderData = new ShaderData(ShaderDataGroup.Camera);
|
|
17775
17892
|
/** Rendering priority - A Camera with higher priority will be rendered on top of a camera with lower priority. */ _this.priority = 0;
|
|
17776
17893
|
/** Whether to enable frustum culling, it is enabled by default. */ _this.enableFrustumCulling = true;
|
|
17777
17894
|
/**
|
|
@@ -17785,6 +17902,7 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component) {
|
|
|
17785
17902
|
/** @internal */ _this._globalShaderMacro = new ShaderMacroCollection();
|
|
17786
17903
|
/** @internal */ _this._frustum = new miniprogram.BoundingFrustum();
|
|
17787
17904
|
/** @internal */ _this._virtualCamera = new VirtualCamera();
|
|
17905
|
+
_this._shaderData = new ShaderData(ShaderDataGroup.Camera);
|
|
17788
17906
|
_this._isProjMatSetting = false;
|
|
17789
17907
|
_this._nearClipPlane = 0.1;
|
|
17790
17908
|
_this._farClipPlane = 100;
|
|
@@ -17983,6 +18101,20 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component) {
|
|
|
17983
18101
|
this._isInvViewProjDirty.destroy();
|
|
17984
18102
|
this._isViewMatrixDirty.destroy();
|
|
17985
18103
|
this.shaderData._addRefCount(-1);
|
|
18104
|
+
this._entity = null;
|
|
18105
|
+
this._globalShaderMacro = null;
|
|
18106
|
+
this._frustum = null;
|
|
18107
|
+
this._renderPipeline = null;
|
|
18108
|
+
this._virtualCamera = null;
|
|
18109
|
+
this._shaderData = null;
|
|
18110
|
+
this._frustumViewChangeFlag = null;
|
|
18111
|
+
this._transform = null;
|
|
18112
|
+
this._isViewMatrixDirty = null;
|
|
18113
|
+
this._isInvViewProjDirty = null;
|
|
18114
|
+
this._viewport = null;
|
|
18115
|
+
this._inverseProjectionMatrix = null;
|
|
18116
|
+
this._lastAspectSize = null;
|
|
18117
|
+
this._invViewProjMat = null;
|
|
17986
18118
|
};
|
|
17987
18119
|
_proto._projMatChange = function _projMatChange() {
|
|
17988
18120
|
this._isFrustumProjectDirty = true;
|
|
@@ -18022,6 +18154,14 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component) {
|
|
|
18022
18154
|
return this._inverseProjectionMatrix;
|
|
18023
18155
|
};
|
|
18024
18156
|
_create_class(Camera1, [
|
|
18157
|
+
{
|
|
18158
|
+
key: "shaderData",
|
|
18159
|
+
get: /**
|
|
18160
|
+
* Shader data.
|
|
18161
|
+
*/ function get() {
|
|
18162
|
+
return this._shaderData;
|
|
18163
|
+
}
|
|
18164
|
+
},
|
|
18025
18165
|
{
|
|
18026
18166
|
key: "nearClipPlane",
|
|
18027
18167
|
get: /**
|
|
@@ -20090,6 +20230,7 @@ SlicedSpriteAssembler = __decorate([
|
|
|
20090
20230
|
sprite._addRefCount(-1);
|
|
20091
20231
|
sprite._updateFlagManager.removeListener(this._onSpriteChange);
|
|
20092
20232
|
}
|
|
20233
|
+
this._entity = null;
|
|
20093
20234
|
this._color = null;
|
|
20094
20235
|
this._sprite = null;
|
|
20095
20236
|
this._assembler = null;
|
|
@@ -21329,8 +21470,6 @@ var DirtyFlag;
|
|
|
21329
21470
|
* @internal
|
|
21330
21471
|
*/ var AnimationCurveOwner = /*#__PURE__*/ function() {
|
|
21331
21472
|
function AnimationCurveOwner(target, type, property, cureType) {
|
|
21332
|
-
this.crossCurveMark = 0;
|
|
21333
|
-
this.hasSavedDefaultValue = false;
|
|
21334
21473
|
this.baseEvaluateData = {
|
|
21335
21474
|
curKeyframeIndex: 0,
|
|
21336
21475
|
value: null
|
|
@@ -21343,7 +21482,7 @@ var DirtyFlag;
|
|
|
21343
21482
|
this.type = type;
|
|
21344
21483
|
this.property = property;
|
|
21345
21484
|
this.component = target.getComponent(type);
|
|
21346
|
-
this.
|
|
21485
|
+
this.cureType = cureType;
|
|
21347
21486
|
var assemblerType = AnimationCurveOwner.getAssemblerType(type, property);
|
|
21348
21487
|
this._assembler = new assemblerType();
|
|
21349
21488
|
this._assembler.initialize(this);
|
|
@@ -21352,89 +21491,80 @@ var DirtyFlag;
|
|
|
21352
21491
|
}
|
|
21353
21492
|
}
|
|
21354
21493
|
var _proto = AnimationCurveOwner.prototype;
|
|
21355
|
-
_proto.
|
|
21356
|
-
|
|
21357
|
-
if (additive) {
|
|
21358
|
-
var value = curve._evaluateAdditive(time, this.baseEvaluateData);
|
|
21359
|
-
var cureType = this._cureType;
|
|
21360
|
-
if (cureType._isReferenceType) {
|
|
21361
|
-
cureType._additiveValue(value, layerWeight, this.referenceTargetValue);
|
|
21362
|
-
} else {
|
|
21363
|
-
var assembler = this._assembler;
|
|
21364
|
-
var originValue = assembler.getTargetValue();
|
|
21365
|
-
var additiveValue = cureType._additiveValue(value, layerWeight, originValue);
|
|
21366
|
-
assembler.setTargetValue(additiveValue);
|
|
21367
|
-
}
|
|
21368
|
-
} else {
|
|
21369
|
-
var value1 = curve._evaluate(time, this.baseEvaluateData);
|
|
21370
|
-
this._applyValue(value1, layerWeight);
|
|
21371
|
-
}
|
|
21372
|
-
}
|
|
21494
|
+
_proto.evaluateValue = function evaluateValue(curve, time, additive) {
|
|
21495
|
+
return additive ? curve._evaluateAdditive(time, this.baseEvaluateData) : curve._evaluate(time, this.baseEvaluateData);
|
|
21373
21496
|
};
|
|
21374
|
-
_proto.
|
|
21375
|
-
var srcValue = srcCurve && srcCurve.keys.length ? additive ? srcCurve._evaluateAdditive(srcTime, this.baseEvaluateData) : srcCurve._evaluate(srcTime, this.baseEvaluateData) : additive ? this.
|
|
21376
|
-
var destValue = destCurve && destCurve.keys.length ? additive ? destCurve._evaluateAdditive(destTime, this.crossEvaluateData) : destCurve._evaluate(destTime, this.crossEvaluateData) : additive ? this.
|
|
21377
|
-
this.
|
|
21497
|
+
_proto.evaluateCrossFadeValue = function evaluateCrossFadeValue(srcCurve, destCurve, srcTime, destTime, crossWeight, additive) {
|
|
21498
|
+
var srcValue = srcCurve && srcCurve.keys.length ? additive ? srcCurve._evaluateAdditive(srcTime, this.baseEvaluateData) : srcCurve._evaluate(srcTime, this.baseEvaluateData) : additive ? this.cureType._getZeroValue(this.baseEvaluateData.value) : this.defaultValue;
|
|
21499
|
+
var destValue = destCurve && destCurve.keys.length ? additive ? destCurve._evaluateAdditive(destTime, this.crossEvaluateData) : destCurve._evaluate(destTime, this.crossEvaluateData) : additive ? this.cureType._getZeroValue(this.crossEvaluateData.value) : this.defaultValue;
|
|
21500
|
+
return this._lerpValue(srcValue, destValue, crossWeight);
|
|
21378
21501
|
};
|
|
21379
|
-
_proto.crossFadeFromPoseAndApplyValue = function crossFadeFromPoseAndApplyValue(destCurve, destTime, crossWeight,
|
|
21380
|
-
var srcValue = additive ? this.
|
|
21381
|
-
var destValue = destCurve && destCurve.keys.length ? additive ? destCurve._evaluateAdditive(destTime, this.crossEvaluateData) : destCurve._evaluate(destTime, this.crossEvaluateData) : additive ? this.
|
|
21382
|
-
this.
|
|
21502
|
+
_proto.crossFadeFromPoseAndApplyValue = function crossFadeFromPoseAndApplyValue(destCurve, destTime, crossWeight, additive) {
|
|
21503
|
+
var srcValue = additive ? this.cureType._subtractValue(this.fixedPoseValue, this.defaultValue, this.baseEvaluateData.value) : this.fixedPoseValue;
|
|
21504
|
+
var destValue = destCurve && destCurve.keys.length ? additive ? destCurve._evaluateAdditive(destTime, this.crossEvaluateData) : destCurve._evaluate(destTime, this.crossEvaluateData) : additive ? this.cureType._getZeroValue(this.crossEvaluateData.value) : this.defaultValue;
|
|
21505
|
+
return this._lerpValue(srcValue, destValue, crossWeight);
|
|
21383
21506
|
};
|
|
21384
21507
|
_proto.revertDefaultValue = function revertDefaultValue() {
|
|
21385
21508
|
this._assembler.setTargetValue(this.defaultValue);
|
|
21386
21509
|
};
|
|
21510
|
+
_proto.getEvaluateValue = function getEvaluateValue(out) {
|
|
21511
|
+
if (this.cureType._isReferenceType) {
|
|
21512
|
+
this.cureType._copyValue(this.baseEvaluateData.value, out);
|
|
21513
|
+
return out;
|
|
21514
|
+
} else {
|
|
21515
|
+
return this.baseEvaluateData.value;
|
|
21516
|
+
}
|
|
21517
|
+
};
|
|
21387
21518
|
_proto.saveDefaultValue = function saveDefaultValue() {
|
|
21388
|
-
if (this.
|
|
21389
|
-
this.
|
|
21519
|
+
if (this.cureType._isReferenceType) {
|
|
21520
|
+
this.cureType._copyValue(this.referenceTargetValue, this.defaultValue);
|
|
21390
21521
|
} else {
|
|
21391
21522
|
this.defaultValue = this._assembler.getTargetValue();
|
|
21392
21523
|
}
|
|
21393
|
-
this.hasSavedDefaultValue = true;
|
|
21394
21524
|
};
|
|
21395
21525
|
_proto.saveFixedPoseValue = function saveFixedPoseValue() {
|
|
21396
|
-
if (this.
|
|
21397
|
-
this.
|
|
21526
|
+
if (this.cureType._isReferenceType) {
|
|
21527
|
+
this.cureType._copyValue(this.referenceTargetValue, this.fixedPoseValue);
|
|
21398
21528
|
} else {
|
|
21399
21529
|
this.fixedPoseValue = this._assembler.getTargetValue();
|
|
21400
21530
|
}
|
|
21401
21531
|
};
|
|
21402
|
-
_proto.
|
|
21403
|
-
|
|
21404
|
-
|
|
21405
|
-
|
|
21532
|
+
_proto.applyValue = function applyValue(value, weight, additive) {
|
|
21533
|
+
var cureType = this.cureType;
|
|
21534
|
+
if (additive) {
|
|
21535
|
+
if (cureType._isReferenceType) {
|
|
21536
|
+
cureType._additiveValue(value, weight, this.referenceTargetValue);
|
|
21406
21537
|
} else {
|
|
21407
|
-
this._assembler
|
|
21538
|
+
var assembler = this._assembler;
|
|
21539
|
+
var originValue = assembler.getTargetValue();
|
|
21540
|
+
var additiveValue = cureType._additiveValue(value, weight, originValue);
|
|
21541
|
+
assembler.setTargetValue(additiveValue);
|
|
21408
21542
|
}
|
|
21409
21543
|
} else {
|
|
21410
|
-
if (
|
|
21411
|
-
|
|
21412
|
-
|
|
21544
|
+
if (weight === 1.0) {
|
|
21545
|
+
if (cureType._isReferenceType) {
|
|
21546
|
+
cureType._copyValue(value, this.referenceTargetValue);
|
|
21547
|
+
} else {
|
|
21548
|
+
this._assembler.setTargetValue(value);
|
|
21549
|
+
}
|
|
21413
21550
|
} else {
|
|
21414
|
-
|
|
21415
|
-
|
|
21416
|
-
|
|
21551
|
+
if (cureType._isReferenceType) {
|
|
21552
|
+
var targetValue = this.referenceTargetValue;
|
|
21553
|
+
cureType._lerpValue(targetValue, value, weight, targetValue);
|
|
21554
|
+
} else {
|
|
21555
|
+
var originValue1 = this._assembler.getTargetValue();
|
|
21556
|
+
var lerpValue = cureType._lerpValue(originValue1, value, weight);
|
|
21557
|
+
this._assembler.setTargetValue(lerpValue);
|
|
21558
|
+
}
|
|
21417
21559
|
}
|
|
21418
21560
|
}
|
|
21419
21561
|
};
|
|
21420
|
-
_proto.
|
|
21421
|
-
|
|
21422
|
-
|
|
21423
|
-
out = this.baseEvaluateData.value;
|
|
21424
|
-
this._cureType._lerpValue(srcValue, destValue, crossWeight, out);
|
|
21425
|
-
} else {
|
|
21426
|
-
out = this._cureType._lerpValue(srcValue, destValue, crossWeight);
|
|
21427
|
-
}
|
|
21428
|
-
if (additive) {
|
|
21429
|
-
if (this._cureType._isReferenceType) {
|
|
21430
|
-
this._cureType._additiveValue(out, layerWeight, this.referenceTargetValue);
|
|
21431
|
-
} else {
|
|
21432
|
-
var originValue = this._assembler.getTargetValue();
|
|
21433
|
-
var lerpValue = this._cureType._additiveValue(out, layerWeight, originValue);
|
|
21434
|
-
this._assembler.setTargetValue(lerpValue);
|
|
21435
|
-
}
|
|
21562
|
+
_proto._lerpValue = function _lerpValue(srcValue, destValue, crossWeight) {
|
|
21563
|
+
if (this.cureType._isReferenceType) {
|
|
21564
|
+
return this.cureType._lerpValue(srcValue, destValue, crossWeight, this.baseEvaluateData.value);
|
|
21436
21565
|
} else {
|
|
21437
|
-
this.
|
|
21566
|
+
this.baseEvaluateData.value = this.cureType._lerpValue(srcValue, destValue, crossWeight);
|
|
21567
|
+
return this.baseEvaluateData.value;
|
|
21438
21568
|
}
|
|
21439
21569
|
};
|
|
21440
21570
|
AnimationCurveOwner.registerAssembler = function registerAssembler(componentType, property, assemblerType) {
|
|
@@ -21528,6 +21658,27 @@ AnimationCurveOwner.registerAssembler(Transform, "scale", ScaleAnimationCurveOwn
|
|
|
21528
21658
|
}();
|
|
21529
21659
|
AnimationCurveOwner.registerAssembler(SkinnedMeshRenderer, "blendShapeWeights", BlendShapeWeightsAnimationCurveOwnerAssembler);
|
|
21530
21660
|
|
|
21661
|
+
/**
|
|
21662
|
+
* @internal
|
|
21663
|
+
*/ var AnimationCurveLayerOwner = /*#__PURE__*/ function() {
|
|
21664
|
+
function AnimationCurveLayerOwner() {
|
|
21665
|
+
this.crossCurveMark = 0;
|
|
21666
|
+
}
|
|
21667
|
+
var _proto = AnimationCurveLayerOwner.prototype;
|
|
21668
|
+
_proto.initFinalValue = function initFinalValue() {
|
|
21669
|
+
var _this_curveOwner = this.curveOwner, cureType = _this_curveOwner.cureType, defaultValue = _this_curveOwner.defaultValue;
|
|
21670
|
+
if (cureType._isReferenceType) {
|
|
21671
|
+
cureType._copyValue(defaultValue, this.finalValue);
|
|
21672
|
+
} else {
|
|
21673
|
+
this.finalValue = defaultValue;
|
|
21674
|
+
}
|
|
21675
|
+
};
|
|
21676
|
+
_proto.saveFinalValue = function saveFinalValue() {
|
|
21677
|
+
this.finalValue = this.curveOwner.getEvaluateValue(this.finalValue);
|
|
21678
|
+
};
|
|
21679
|
+
return AnimationCurveLayerOwner;
|
|
21680
|
+
}();
|
|
21681
|
+
|
|
21531
21682
|
/**
|
|
21532
21683
|
* Associate AnimationCurve and the Entity
|
|
21533
21684
|
*/ var AnimationClipCurveBinding = /*#__PURE__*/ function() {
|
|
@@ -21541,10 +21692,22 @@ AnimationCurveOwner.registerAssembler(SkinnedMeshRenderer, "blendShapeWeights",
|
|
|
21541
21692
|
var curveType = this.curve.constructor;
|
|
21542
21693
|
var owner = new AnimationCurveOwner(entity, this.type, this.property, curveType);
|
|
21543
21694
|
curveType._initializeOwner(owner);
|
|
21695
|
+
owner.saveDefaultValue();
|
|
21544
21696
|
return owner;
|
|
21545
21697
|
};
|
|
21546
21698
|
/**
|
|
21547
21699
|
* @internal
|
|
21700
|
+
*/ _proto._createCurveLayerOwner = function _createCurveLayerOwner(owner) {
|
|
21701
|
+
var curveType = this.curve.constructor;
|
|
21702
|
+
var layerOwner = new AnimationCurveLayerOwner();
|
|
21703
|
+
curveType._initializeLayerOwner(layerOwner);
|
|
21704
|
+
layerOwner.curveOwner = owner;
|
|
21705
|
+
// If curve.keys.length is 0, updateFinishedState will assign 0 to the target, causing an error, so initialize by assigning defaultValue to finalValue.
|
|
21706
|
+
layerOwner.initFinalValue();
|
|
21707
|
+
return layerOwner;
|
|
21708
|
+
};
|
|
21709
|
+
/**
|
|
21710
|
+
* @internal
|
|
21548
21711
|
*/ _proto._getTempCurveOwner = function _getTempCurveOwner(entity) {
|
|
21549
21712
|
var instanceId = entity.instanceId;
|
|
21550
21713
|
if (!this._tempCurveOwner[instanceId]) {
|
|
@@ -21624,7 +21787,8 @@ AnimationCurveOwner.registerAssembler(SkinnedMeshRenderer, "blendShapeWeights",
|
|
|
21624
21787
|
var targetEntity = entity.findByPath(curveData.relativePath);
|
|
21625
21788
|
if (targetEntity) {
|
|
21626
21789
|
var curveOwner = curveData._getTempCurveOwner(targetEntity);
|
|
21627
|
-
curveOwner.
|
|
21790
|
+
var value = curveOwner.evaluateValue(curveData.curve, time, false);
|
|
21791
|
+
curveOwner.applyValue(value, 1, false);
|
|
21628
21792
|
}
|
|
21629
21793
|
}
|
|
21630
21794
|
};
|
|
@@ -21768,6 +21932,7 @@ AnimationCurveOwner.registerAssembler(SkinnedMeshRenderer, "blendShapeWeights",
|
|
|
21768
21932
|
break;
|
|
21769
21933
|
}
|
|
21770
21934
|
}
|
|
21935
|
+
evaluateData.value = value;
|
|
21771
21936
|
return value;
|
|
21772
21937
|
};
|
|
21773
21938
|
/**
|
|
@@ -21824,6 +21989,11 @@ exports.AnimationArrayCurve = (_AnimationArrayCurve = /*#__PURE__*/ function(Ani
|
|
|
21824
21989
|
};
|
|
21825
21990
|
/**
|
|
21826
21991
|
* @internal
|
|
21992
|
+
*/ AnimationArrayCurve._initializeLayerOwner = function _initializeLayerOwner(owner) {
|
|
21993
|
+
owner.finalValue = [];
|
|
21994
|
+
};
|
|
21995
|
+
/**
|
|
21996
|
+
* @internal
|
|
21827
21997
|
*/ AnimationArrayCurve._lerpValue = function _lerpValue(srcValue, destValue, weight, out) {
|
|
21828
21998
|
for(var i = 0, n = out.length; i < n; ++i){
|
|
21829
21999
|
var src = srcValue[i];
|
|
@@ -21914,6 +22084,11 @@ exports.AnimationBoolCurve = (_AnimationBoolCurve = /*#__PURE__*/ function(Anima
|
|
|
21914
22084
|
};
|
|
21915
22085
|
/**
|
|
21916
22086
|
* @internal
|
|
22087
|
+
*/ AnimationBoolCurve._initializeLayerOwner = function _initializeLayerOwner(owner) {
|
|
22088
|
+
owner.finalValue = false;
|
|
22089
|
+
};
|
|
22090
|
+
/**
|
|
22091
|
+
* @internal
|
|
21917
22092
|
*/ AnimationBoolCurve._lerpValue = function _lerpValue(srcValue, destValue) {
|
|
21918
22093
|
return destValue;
|
|
21919
22094
|
};
|
|
@@ -21971,6 +22146,11 @@ exports.AnimationColorCurve = (_AnimationColorCurve = /*#__PURE__*/ function(Ani
|
|
|
21971
22146
|
};
|
|
21972
22147
|
/**
|
|
21973
22148
|
* @internal
|
|
22149
|
+
*/ AnimationColorCurve._initializeLayerOwner = function _initializeLayerOwner(owner) {
|
|
22150
|
+
owner.finalValue = new miniprogram.Color();
|
|
22151
|
+
};
|
|
22152
|
+
/**
|
|
22153
|
+
* @internal
|
|
21974
22154
|
*/ AnimationColorCurve._lerpValue = function _lerpValue(srcValue, destValue, weight, out) {
|
|
21975
22155
|
miniprogram.Color.lerp(srcValue, destValue, weight, out);
|
|
21976
22156
|
return out;
|
|
@@ -22078,6 +22258,12 @@ exports.AnimationFloatArrayCurve = (_AnimationFloatArrayCurve = /*#__PURE__*/ fu
|
|
|
22078
22258
|
};
|
|
22079
22259
|
/**
|
|
22080
22260
|
* @internal
|
|
22261
|
+
*/ AnimationFloatArrayCurve._initializeLayerOwner = function _initializeLayerOwner(owner) {
|
|
22262
|
+
var size = owner.curveOwner.referenceTargetValue.length;
|
|
22263
|
+
owner.finalValue = new Float32Array(size);
|
|
22264
|
+
};
|
|
22265
|
+
/**
|
|
22266
|
+
* @internal
|
|
22081
22267
|
*/ AnimationFloatArrayCurve._lerpValue = function _lerpValue(srcValue, destValue, weight, out) {
|
|
22082
22268
|
for(var i = 0, n = out.length; i < n; ++i){
|
|
22083
22269
|
var src = srcValue[i];
|
|
@@ -22168,6 +22354,11 @@ exports.AnimationFloatCurve = (_AnimationFloatCurve = /*#__PURE__*/ function(Ani
|
|
|
22168
22354
|
};
|
|
22169
22355
|
/**
|
|
22170
22356
|
* @internal
|
|
22357
|
+
*/ AnimationFloatCurve._initializeLayerOwner = function _initializeLayerOwner(owner) {
|
|
22358
|
+
owner.finalValue = 0;
|
|
22359
|
+
};
|
|
22360
|
+
/**
|
|
22361
|
+
* @internal
|
|
22171
22362
|
*/ AnimationFloatCurve._lerpValue = function _lerpValue(srcValue, destValue, crossWeight) {
|
|
22172
22363
|
return srcValue + (destValue - srcValue) * crossWeight;
|
|
22173
22364
|
};
|
|
@@ -22237,6 +22428,11 @@ exports.AnimationQuaternionCurve = (_AnimationQuaternionCurve = /*#__PURE__*/ fu
|
|
|
22237
22428
|
};
|
|
22238
22429
|
/**
|
|
22239
22430
|
* @internal
|
|
22431
|
+
*/ AnimationQuaternionCurve1._initializeLayerOwner = function _initializeLayerOwner(owner) {
|
|
22432
|
+
owner.finalValue = new miniprogram.Quaternion();
|
|
22433
|
+
};
|
|
22434
|
+
/**
|
|
22435
|
+
* @internal
|
|
22240
22436
|
*/ AnimationQuaternionCurve1._lerpValue = function _lerpValue(src, dest, weight, out) {
|
|
22241
22437
|
miniprogram.Quaternion.slerp(src, dest, weight, out);
|
|
22242
22438
|
return out;
|
|
@@ -22341,6 +22537,11 @@ exports.AnimationVector2Curve = (_AnimationVector2Curve = /*#__PURE__*/ function
|
|
|
22341
22537
|
};
|
|
22342
22538
|
/**
|
|
22343
22539
|
* @internal
|
|
22540
|
+
*/ AnimationVector2Curve._initializeLayerOwner = function _initializeLayerOwner(owner) {
|
|
22541
|
+
owner.finalValue = new miniprogram.Vector2();
|
|
22542
|
+
};
|
|
22543
|
+
/**
|
|
22544
|
+
* @internal
|
|
22344
22545
|
*/ AnimationVector2Curve._lerpValue = function _lerpValue(srcValue, destValue, weight, out) {
|
|
22345
22546
|
miniprogram.Vector2.lerp(srcValue, destValue, weight, out);
|
|
22346
22547
|
return out;
|
|
@@ -22426,6 +22627,11 @@ exports.AnimationVector3Curve = (_AnimationVector3Curve = /*#__PURE__*/ function
|
|
|
22426
22627
|
};
|
|
22427
22628
|
/**
|
|
22428
22629
|
* @internal
|
|
22630
|
+
*/ AnimationVector3Curve._initializeLayerOwner = function _initializeLayerOwner(owner) {
|
|
22631
|
+
owner.finalValue = new miniprogram.Vector3();
|
|
22632
|
+
};
|
|
22633
|
+
/**
|
|
22634
|
+
* @internal
|
|
22429
22635
|
*/ AnimationVector3Curve._lerpValue = function _lerpValue(srcValue, destValue, weight, out) {
|
|
22430
22636
|
miniprogram.Vector3.lerp(srcValue, destValue, weight, out);
|
|
22431
22637
|
return out;
|
|
@@ -22523,6 +22729,11 @@ exports.AnimationVector4Curve = (_AnimationVector4Curve = /*#__PURE__*/ function
|
|
|
22523
22729
|
};
|
|
22524
22730
|
/**
|
|
22525
22731
|
* @internal
|
|
22732
|
+
*/ AnimationVector4Curve._initializeLayerOwner = function _initializeLayerOwner(owner) {
|
|
22733
|
+
owner.finalValue = new miniprogram.Vector4();
|
|
22734
|
+
};
|
|
22735
|
+
/**
|
|
22736
|
+
* @internal
|
|
22526
22737
|
*/ AnimationVector4Curve._lerpValue = function _lerpValue(srcValue, destValue, weight, out) {
|
|
22527
22738
|
miniprogram.Vector4.lerp(srcValue, destValue, weight, out);
|
|
22528
22739
|
return out;
|
|
@@ -22632,13 +22843,21 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
22632
22843
|
LayerState[LayerState[/** Playing state. */ "Playing"] = 1] = "Playing";
|
|
22633
22844
|
LayerState[LayerState[/** CrossFading state. */ "CrossFading"] = 2] = "CrossFading";
|
|
22634
22845
|
LayerState[LayerState[/** FixedCrossFading state. */ "FixedCrossFading"] = 3] = "FixedCrossFading";
|
|
22846
|
+
LayerState[LayerState[/** Finished state. */ "Finished"] = 4] = "Finished";
|
|
22635
22847
|
})(LayerState || (LayerState = {}));
|
|
22636
22848
|
|
|
22637
22849
|
/**
|
|
22638
22850
|
* @internal
|
|
22639
|
-
*/ var AnimationEventHandler = function
|
|
22640
|
-
|
|
22641
|
-
|
|
22851
|
+
*/ var AnimationEventHandler = /*#__PURE__*/ function() {
|
|
22852
|
+
function AnimationEventHandler() {
|
|
22853
|
+
this.handlers = [];
|
|
22854
|
+
}
|
|
22855
|
+
var _proto = AnimationEventHandler.prototype;
|
|
22856
|
+
_proto.dispose = function dispose() {
|
|
22857
|
+
this.handlers.length = 0;
|
|
22858
|
+
};
|
|
22859
|
+
return AnimationEventHandler;
|
|
22860
|
+
}();
|
|
22642
22861
|
|
|
22643
22862
|
/**
|
|
22644
22863
|
* Transitions define when and how the state machine switch from on state to another. AnimatorTransition always originate from a StateMachine or a StateMachine entry.
|
|
@@ -22696,12 +22915,14 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
22696
22915
|
* @internal
|
|
22697
22916
|
*/ var AnimatorLayerData = /*#__PURE__*/ function() {
|
|
22698
22917
|
function AnimatorLayerData() {
|
|
22918
|
+
this.curveOwnerPool = Object.create(null);
|
|
22699
22919
|
this.animatorStateDataMap = {};
|
|
22700
22920
|
this.srcPlayData = new AnimatorStatePlayData();
|
|
22701
22921
|
this.destPlayData = new AnimatorStatePlayData();
|
|
22702
22922
|
this.layerState = LayerState.Standby;
|
|
22703
22923
|
this.crossCurveMark = 0;
|
|
22704
22924
|
this.manuallyTransition = new AnimatorStateTransition();
|
|
22925
|
+
this.crossLayerOwnerCollection = [];
|
|
22705
22926
|
}
|
|
22706
22927
|
var _proto = AnimatorLayerData.prototype;
|
|
22707
22928
|
_proto.switchPlayData = function switchPlayData() {
|
|
@@ -22716,7 +22937,7 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
22716
22937
|
/**
|
|
22717
22938
|
* @internal
|
|
22718
22939
|
*/ var AnimatorStateData = function AnimatorStateData() {
|
|
22719
|
-
this.
|
|
22940
|
+
this.curveLayerOwner = [];
|
|
22720
22941
|
this.eventHandlers = [];
|
|
22721
22942
|
};
|
|
22722
22943
|
|
|
@@ -22730,8 +22951,8 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
22730
22951
|
/** Culling mode of this Animator. */ _this.cullingMode = exports.AnimatorCullingMode.None;
|
|
22731
22952
|
/** The playback speed of the Animator, 1.0 is normal playback speed. */ _this.speed = 1.0;
|
|
22732
22953
|
_this._animatorLayersData = [];
|
|
22733
|
-
_this.
|
|
22734
|
-
_this.
|
|
22954
|
+
_this._curveOwnerPool = Object.create(null);
|
|
22955
|
+
_this._needRevertCurveOwners = [];
|
|
22735
22956
|
_this._animationEventHandlerPool = new ClassPool(AnimationEventHandler);
|
|
22736
22957
|
_this._tempAnimatorStateInfo = {
|
|
22737
22958
|
layerIndex: -1,
|
|
@@ -22754,7 +22975,7 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
22754
22975
|
this._reset();
|
|
22755
22976
|
}
|
|
22756
22977
|
var stateInfo = this._getAnimatorStateInfo(stateName, layerIndex);
|
|
22757
|
-
var state = stateInfo.state;
|
|
22978
|
+
var state = stateInfo.state, playLayerIndex = stateInfo.layerIndex;
|
|
22758
22979
|
if (!state) {
|
|
22759
22980
|
return;
|
|
22760
22981
|
}
|
|
@@ -22763,9 +22984,8 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
22763
22984
|
return;
|
|
22764
22985
|
}
|
|
22765
22986
|
var animatorLayerData = this._getAnimatorLayerData(stateInfo.layerIndex);
|
|
22766
|
-
|
|
22767
|
-
|
|
22768
|
-
this._preparePlay(animatorLayerData, state, animatorStateData);
|
|
22987
|
+
var animatorStateData = this._getAnimatorStateData(stateName, state, animatorLayerData, playLayerIndex);
|
|
22988
|
+
this._preparePlay(animatorLayerData, state);
|
|
22769
22989
|
animatorLayerData.layerState = LayerState.Playing;
|
|
22770
22990
|
animatorLayerData.srcPlayData.reset(state, animatorStateData, state._getDuration() * normalizedTimeOffset);
|
|
22771
22991
|
};
|
|
@@ -22816,6 +23036,7 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
22816
23036
|
return;
|
|
22817
23037
|
}
|
|
22818
23038
|
deltaTime *= this.speed;
|
|
23039
|
+
this._revertCurveOwners();
|
|
22819
23040
|
for(var i1 = 0, n1 = animatorController.layers.length; i1 < n1; i1++){
|
|
22820
23041
|
var animatorLayerData = this._getAnimatorLayerData(i1);
|
|
22821
23042
|
if (animatorLayerData.layerState === LayerState.Standby) {
|
|
@@ -22856,17 +23077,17 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
22856
23077
|
/**
|
|
22857
23078
|
* @internal
|
|
22858
23079
|
*/ _proto._reset = function _reset() {
|
|
22859
|
-
var _this = this, animationCurveOwners = _this.
|
|
23080
|
+
var _this = this, animationCurveOwners = _this._curveOwnerPool;
|
|
22860
23081
|
for(var instanceId in animationCurveOwners){
|
|
22861
23082
|
var propertyOwners = animationCurveOwners[instanceId];
|
|
22862
23083
|
for(var property in propertyOwners){
|
|
22863
23084
|
var owner = propertyOwners[property];
|
|
22864
|
-
owner.
|
|
23085
|
+
owner.revertDefaultValue();
|
|
22865
23086
|
}
|
|
22866
23087
|
}
|
|
22867
23088
|
this._animatorLayersData.length = 0;
|
|
22868
|
-
this.
|
|
22869
|
-
this.
|
|
23089
|
+
this._needRevertCurveOwners.length = 0;
|
|
23090
|
+
this._curveOwnerPool = {};
|
|
22870
23091
|
this._animationEventHandlerPool.resetPool();
|
|
22871
23092
|
if (this._controllerUpdateFlag) {
|
|
22872
23093
|
this._controllerUpdateFlag.flag = false;
|
|
@@ -22893,38 +23114,51 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
22893
23114
|
stateInfo.state = state;
|
|
22894
23115
|
return stateInfo;
|
|
22895
23116
|
};
|
|
22896
|
-
_proto.
|
|
22897
|
-
var curveOwners = stateData.curveOwners;
|
|
22898
|
-
for(var i = curveOwners.length - 1; i >= 0; i--){
|
|
22899
|
-
var _curveOwners_i;
|
|
22900
|
-
(_curveOwners_i = curveOwners[i]) == null ? void 0 : _curveOwners_i.saveDefaultValue();
|
|
22901
|
-
}
|
|
22902
|
-
};
|
|
22903
|
-
_proto._getAnimatorStateData = function _getAnimatorStateData(stateName, animatorState, animatorLayerData) {
|
|
23117
|
+
_proto._getAnimatorStateData = function _getAnimatorStateData(stateName, animatorState, animatorLayerData, layerIndex) {
|
|
22904
23118
|
var animatorStateDataMap = animatorLayerData.animatorStateDataMap;
|
|
22905
23119
|
var animatorStateData = animatorStateDataMap[stateName];
|
|
22906
23120
|
if (!animatorStateData) {
|
|
22907
23121
|
animatorStateData = new AnimatorStateData();
|
|
22908
23122
|
animatorStateDataMap[stateName] = animatorStateData;
|
|
22909
|
-
this._saveAnimatorStateData(animatorState, animatorStateData);
|
|
23123
|
+
this._saveAnimatorStateData(animatorState, animatorStateData, animatorLayerData, layerIndex);
|
|
22910
23124
|
this._saveAnimatorEventHandlers(animatorState, animatorStateData);
|
|
22911
23125
|
}
|
|
22912
23126
|
return animatorStateData;
|
|
22913
23127
|
};
|
|
22914
|
-
_proto._saveAnimatorStateData = function _saveAnimatorStateData(animatorState, animatorStateData) {
|
|
22915
|
-
var _this = this, entity = _this.entity,
|
|
22916
|
-
var
|
|
23128
|
+
_proto._saveAnimatorStateData = function _saveAnimatorStateData(animatorState, animatorStateData, animatorLayerData, layerIndex) {
|
|
23129
|
+
var _this = this, entity = _this.entity, curveOwnerPool = _this._curveOwnerPool;
|
|
23130
|
+
var curveLayerOwner = animatorStateData.curveLayerOwner;
|
|
23131
|
+
var layerCurveOwnerPool = animatorLayerData.curveOwnerPool;
|
|
22917
23132
|
var _animatorState_clip = animatorState.clip, curves = _animatorState_clip._curveBindings;
|
|
22918
23133
|
for(var i = curves.length - 1; i >= 0; i--){
|
|
22919
23134
|
var curve = curves[i];
|
|
22920
23135
|
var targetEntity = curve.relativePath === "" ? entity : entity.findByPath(curve.relativePath);
|
|
22921
23136
|
if (targetEntity) {
|
|
23137
|
+
var _curveOwnerPool, _instanceId, _propertyOwners, _property, _layerCurveOwnerPool, _instanceId1, _layerPropertyOwners, _property1;
|
|
22922
23138
|
var property = curve.property;
|
|
22923
23139
|
var instanceId = targetEntity.instanceId;
|
|
22924
|
-
var
|
|
22925
|
-
|
|
23140
|
+
var needRevert = false;
|
|
23141
|
+
var baseAnimatorLayerData = this._animatorLayersData[0];
|
|
23142
|
+
var baseLayerCurveOwnerPool = baseAnimatorLayerData.curveOwnerPool;
|
|
23143
|
+
if (this.animatorController.layers[layerIndex].blendingMode === exports.AnimatorLayerBlendingMode.Additive && layerIndex > 0 && !(baseLayerCurveOwnerPool[instanceId] && baseLayerCurveOwnerPool[instanceId][property])) {
|
|
23144
|
+
needRevert = true;
|
|
23145
|
+
}
|
|
23146
|
+
// Get owner
|
|
23147
|
+
var propertyOwners = (_curveOwnerPool = curveOwnerPool)[_instanceId = instanceId] || (_curveOwnerPool[_instanceId] = Object.create(null));
|
|
23148
|
+
var owner = (_propertyOwners = propertyOwners)[_property = property] || (_propertyOwners[_property] = curve._createCurveOwner(targetEntity));
|
|
23149
|
+
//@todo: There is performance waste here, which will be handled together with organizing AnimatorStateData later. The logic is changing from runtime to initialization.
|
|
23150
|
+
if (needRevert) {
|
|
23151
|
+
this._needRevertCurveOwners.push(owner);
|
|
23152
|
+
} else {
|
|
23153
|
+
var index = this._needRevertCurveOwners.indexOf(owner);
|
|
23154
|
+
index > -1 && this._needRevertCurveOwners.splice(index, 1);
|
|
23155
|
+
}
|
|
23156
|
+
// Get layer owner
|
|
23157
|
+
var layerPropertyOwners = (_layerCurveOwnerPool = layerCurveOwnerPool)[_instanceId1 = instanceId] || (_layerCurveOwnerPool[_instanceId1] = Object.create(null));
|
|
23158
|
+
var layerOwner = (_layerPropertyOwners = layerPropertyOwners)[_property1 = property] || (_layerPropertyOwners[_property1] = curve._createCurveLayerOwner(owner));
|
|
23159
|
+
curveLayerOwner[i] = layerOwner;
|
|
22926
23160
|
} else {
|
|
22927
|
-
|
|
23161
|
+
curveLayerOwner[i] = null;
|
|
22928
23162
|
console.warn("The entity don't have the child entity which path is " + curve.relativePath + ".");
|
|
22929
23163
|
}
|
|
22930
23164
|
}
|
|
@@ -22952,65 +23186,60 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
22952
23186
|
};
|
|
22953
23187
|
_proto._clearCrossData = function _clearCrossData(animatorLayerData) {
|
|
22954
23188
|
animatorLayerData.crossCurveMark++;
|
|
22955
|
-
|
|
23189
|
+
animatorLayerData.crossLayerOwnerCollection.length = 0;
|
|
22956
23190
|
};
|
|
22957
|
-
_proto.
|
|
22958
|
-
|
|
22959
|
-
|
|
22960
|
-
|
|
23191
|
+
_proto._addCrossOwner = function _addCrossOwner(animatorLayerData, layerOwner, curCurveIndex, nextCurveIndex) {
|
|
23192
|
+
layerOwner.crossSrcCurveIndex = curCurveIndex;
|
|
23193
|
+
layerOwner.crossDestCurveIndex = nextCurveIndex;
|
|
23194
|
+
animatorLayerData.crossLayerOwnerCollection.push(layerOwner);
|
|
22961
23195
|
};
|
|
22962
23196
|
_proto._prepareCrossFading = function _prepareCrossFading(animatorLayerData) {
|
|
22963
|
-
var crossCurveData = this._crossOwnerCollection;
|
|
22964
|
-
var crossCurveMark = animatorLayerData.crossCurveMark;
|
|
22965
23197
|
// Add src cross curve data.
|
|
22966
|
-
this._prepareSrcCrossData(
|
|
23198
|
+
this._prepareSrcCrossData(animatorLayerData, false);
|
|
22967
23199
|
// Add dest cross curve data.
|
|
22968
|
-
this._prepareDestCrossData(
|
|
23200
|
+
this._prepareDestCrossData(animatorLayerData, false);
|
|
22969
23201
|
};
|
|
22970
23202
|
_proto._prepareStandbyCrossFading = function _prepareStandbyCrossFading(animatorLayerData) {
|
|
22971
|
-
var crossOwnerCollection = this._crossOwnerCollection;
|
|
22972
|
-
var srcPlayData = animatorLayerData.srcPlayData, crossCurveMark = animatorLayerData.crossCurveMark;
|
|
22973
23203
|
// Standby have two sub state, one is never play, one is finished, never play srcPlayData.state is null.
|
|
22974
|
-
srcPlayData.state && this._prepareSrcCrossData(
|
|
23204
|
+
animatorLayerData.srcPlayData.state && this._prepareSrcCrossData(animatorLayerData, true);
|
|
22975
23205
|
// Add dest cross curve data.
|
|
22976
|
-
this._prepareDestCrossData(
|
|
23206
|
+
this._prepareDestCrossData(animatorLayerData, true);
|
|
22977
23207
|
};
|
|
22978
23208
|
_proto._prepareFixedPoseCrossFading = function _prepareFixedPoseCrossFading(animatorLayerData) {
|
|
22979
|
-
var
|
|
23209
|
+
var crossLayerOwnerCollection = animatorLayerData.crossLayerOwnerCollection;
|
|
22980
23210
|
// Save current cross curve data owner fixed pose.
|
|
22981
|
-
for(var i =
|
|
22982
|
-
var
|
|
22983
|
-
|
|
23211
|
+
for(var i = crossLayerOwnerCollection.length - 1; i >= 0; i--){
|
|
23212
|
+
var layerOwner = crossLayerOwnerCollection[i];
|
|
23213
|
+
if (!layerOwner) continue;
|
|
23214
|
+
layerOwner.curveOwner.saveFixedPoseValue();
|
|
22984
23215
|
// Reset destCurveIndex When fixed pose crossFading again.
|
|
22985
|
-
|
|
23216
|
+
layerOwner.crossDestCurveIndex = -1;
|
|
22986
23217
|
}
|
|
22987
23218
|
// prepare dest AnimatorState cross data.
|
|
22988
|
-
this._prepareDestCrossData(
|
|
22989
|
-
};
|
|
22990
|
-
_proto._prepareSrcCrossData = function _prepareSrcCrossData(
|
|
22991
|
-
var
|
|
22992
|
-
for(var i =
|
|
22993
|
-
var
|
|
22994
|
-
if (!
|
|
22995
|
-
|
|
22996
|
-
|
|
22997
|
-
|
|
22998
|
-
|
|
22999
|
-
|
|
23000
|
-
|
|
23001
|
-
|
|
23002
|
-
var
|
|
23003
|
-
|
|
23004
|
-
|
|
23005
|
-
if (
|
|
23006
|
-
|
|
23007
|
-
crossCurveData[owner.crossCurveDataIndex].crossDestCurveIndex = i;
|
|
23219
|
+
this._prepareDestCrossData(animatorLayerData, true);
|
|
23220
|
+
};
|
|
23221
|
+
_proto._prepareSrcCrossData = function _prepareSrcCrossData(animatorLayerData, saveFixed) {
|
|
23222
|
+
var curveLayerOwner = animatorLayerData.srcPlayData.stateData.curveLayerOwner;
|
|
23223
|
+
for(var i = curveLayerOwner.length - 1; i >= 0; i--){
|
|
23224
|
+
var layerOwner = curveLayerOwner[i];
|
|
23225
|
+
if (!layerOwner) continue;
|
|
23226
|
+
layerOwner.crossCurveMark = animatorLayerData.crossCurveMark;
|
|
23227
|
+
saveFixed && layerOwner.curveOwner.saveFixedPoseValue();
|
|
23228
|
+
this._addCrossOwner(animatorLayerData, layerOwner, i, -1);
|
|
23229
|
+
}
|
|
23230
|
+
};
|
|
23231
|
+
_proto._prepareDestCrossData = function _prepareDestCrossData(animatorLayerData, saveFixed) {
|
|
23232
|
+
var curveLayerOwner = animatorLayerData.destPlayData.stateData.curveLayerOwner;
|
|
23233
|
+
for(var i = curveLayerOwner.length - 1; i >= 0; i--){
|
|
23234
|
+
var layerOwner = curveLayerOwner[i];
|
|
23235
|
+
if (!layerOwner) continue;
|
|
23236
|
+
if (layerOwner.crossCurveMark === animatorLayerData.crossCurveMark) {
|
|
23237
|
+
layerOwner.crossDestCurveIndex = i;
|
|
23008
23238
|
} else {
|
|
23009
|
-
owner.
|
|
23239
|
+
var owner = layerOwner.curveOwner;
|
|
23010
23240
|
saveFixed && owner.saveFixedPoseValue();
|
|
23011
|
-
|
|
23012
|
-
|
|
23013
|
-
this._addCrossCurveData(crossCurveData, owner, -1, i);
|
|
23241
|
+
layerOwner.crossCurveMark = animatorLayerData.crossCurveMark;
|
|
23242
|
+
this._addCrossOwner(animatorLayerData, layerOwner, -1, i);
|
|
23014
23243
|
}
|
|
23015
23244
|
}
|
|
23016
23245
|
};
|
|
@@ -23025,7 +23254,7 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
23025
23254
|
var srcPlayData = layerData.srcPlayData, destPlayData = layerData.destPlayData, crossFadeTransitionInfo = layerData.crossFadeTransition;
|
|
23026
23255
|
var additive = blendingMode === exports.AnimatorLayerBlendingMode.Additive;
|
|
23027
23256
|
firstLayer && (weight = 1.0);
|
|
23028
|
-
|
|
23257
|
+
//@todo: All situations should be checked, optimizations will follow later.
|
|
23029
23258
|
layerData.layerState !== LayerState.FixedCrossFading && this._checkTransition(srcPlayData, crossFadeTransitionInfo, layerIndex);
|
|
23030
23259
|
switch(layerData.layerState){
|
|
23031
23260
|
case LayerState.Playing:
|
|
@@ -23037,26 +23266,36 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
23037
23266
|
case LayerState.CrossFading:
|
|
23038
23267
|
this._updateCrossFade(srcPlayData, destPlayData, layerData, layerIndex, weight, deltaTime, additive, aniUpdate);
|
|
23039
23268
|
break;
|
|
23269
|
+
case LayerState.Finished:
|
|
23270
|
+
this._updateFinishedState(srcPlayData, weight, additive, aniUpdate);
|
|
23271
|
+
break;
|
|
23040
23272
|
}
|
|
23041
23273
|
};
|
|
23042
23274
|
_proto._updatePlayingState = function _updatePlayingState(playData, layerData, layerIndex, weight, delta, additive, aniUpdate) {
|
|
23043
|
-
var _playData_stateData = playData.stateData,
|
|
23275
|
+
var _playData_stateData = playData.stateData, curveLayerOwner = _playData_stateData.curveLayerOwner, eventHandlers = _playData_stateData.eventHandlers;
|
|
23044
23276
|
var state = playData.state, lastPlayState = playData.playState, lastClipTime = playData.clipTime;
|
|
23045
23277
|
var _state_clip = state.clip, curveBindings = _state_clip._curveBindings;
|
|
23046
23278
|
playData.update(this.speed < 0);
|
|
23047
|
-
if (!aniUpdate) {
|
|
23048
|
-
return;
|
|
23049
|
-
}
|
|
23050
23279
|
var clipTime = playData.clipTime, playState = playData.playState;
|
|
23051
|
-
|
|
23052
|
-
|
|
23053
|
-
var
|
|
23054
|
-
|
|
23280
|
+
var finished = playState === AnimatorStatePlayState.Finished;
|
|
23281
|
+
if (aniUpdate || finished) {
|
|
23282
|
+
for(var i = curveBindings.length - 1; i >= 0; i--){
|
|
23283
|
+
var layerOwner = curveLayerOwner[i];
|
|
23284
|
+
var owner = layerOwner == null ? void 0 : layerOwner.curveOwner;
|
|
23285
|
+
if (!owner) continue;
|
|
23286
|
+
var curve = curveBindings[i].curve;
|
|
23287
|
+
if (curve.keys.length) {
|
|
23288
|
+
var value = owner.evaluateValue(curve, clipTime, additive);
|
|
23289
|
+
aniUpdate && owner.applyValue(value, weight, additive);
|
|
23290
|
+
finished && layerOwner.saveFinalValue();
|
|
23291
|
+
}
|
|
23292
|
+
}
|
|
23055
23293
|
}
|
|
23056
23294
|
playData.frameTime += state.speed * delta;
|
|
23057
23295
|
if (playState === AnimatorStatePlayState.Finished) {
|
|
23058
|
-
layerData.layerState = LayerState.
|
|
23296
|
+
layerData.layerState = LayerState.Finished;
|
|
23059
23297
|
}
|
|
23298
|
+
eventHandlers.length && this._fireAnimationEvents(playData, eventHandlers, lastClipTime, clipTime);
|
|
23060
23299
|
if (lastPlayState === AnimatorStatePlayState.UnStarted) {
|
|
23061
23300
|
this._callAnimatorScriptOnEnter(state, layerIndex);
|
|
23062
23301
|
}
|
|
@@ -23067,7 +23306,7 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
23067
23306
|
}
|
|
23068
23307
|
};
|
|
23069
23308
|
_proto._updateCrossFade = function _updateCrossFade(srcPlayData, destPlayData, layerData, layerIndex, weight, delta, additive, aniUpdate) {
|
|
23070
|
-
var
|
|
23309
|
+
var crossLayerOwnerCollection = layerData.crossLayerOwnerCollection;
|
|
23071
23310
|
var _srcPlayData_state_clip = srcPlayData.state.clip, srcCurves = _srcPlayData_state_clip._curveBindings;
|
|
23072
23311
|
var srcState = srcPlayData.state, srcStateData = srcPlayData.stateData, lastSrcPlayState = srcPlayData.playState;
|
|
23073
23312
|
var srcEventHandlers = srcStateData.eventHandlers;
|
|
@@ -23076,18 +23315,27 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
23076
23315
|
var _destState_clip = destState.clip, destCurves = _destState_clip._curveBindings;
|
|
23077
23316
|
var lastSrcClipTime = srcPlayData.clipTime;
|
|
23078
23317
|
var lastDestClipTime = destPlayData.clipTime;
|
|
23079
|
-
var
|
|
23080
|
-
crossWeight
|
|
23318
|
+
var duration = destState._getDuration() * layerData.crossFadeTransition.duration;
|
|
23319
|
+
var crossWeight = Math.abs(destPlayData.frameTime) / duration;
|
|
23320
|
+
(crossWeight >= 1.0 || duration === 0) && (crossWeight = 1.0);
|
|
23081
23321
|
srcPlayData.update(this.speed < 0);
|
|
23082
23322
|
destPlayData.update(this.speed < 0);
|
|
23083
|
-
var srcPlayState = srcPlayData.playState;
|
|
23084
|
-
var destPlayState = destPlayData.playState;
|
|
23085
|
-
|
|
23086
|
-
if (
|
|
23087
|
-
|
|
23323
|
+
var srcClipTime = srcPlayData.clipTime, srcPlayState = srcPlayData.playState;
|
|
23324
|
+
var destClipTime = destPlayData.clipTime, destPlayState = destPlayData.playState;
|
|
23325
|
+
var finished = destPlayData.playState === AnimatorStatePlayState.Finished;
|
|
23326
|
+
if (aniUpdate || finished) {
|
|
23327
|
+
for(var i = crossLayerOwnerCollection.length - 1; i >= 0; i--){
|
|
23328
|
+
var layerOwner = crossLayerOwnerCollection[i];
|
|
23329
|
+
var owner = layerOwner == null ? void 0 : layerOwner.curveOwner;
|
|
23330
|
+
if (!owner) continue;
|
|
23331
|
+
var srcCurveIndex = layerOwner.crossSrcCurveIndex;
|
|
23332
|
+
var destCurveIndex = layerOwner.crossDestCurveIndex;
|
|
23333
|
+
var value = owner.evaluateCrossFadeValue(srcCurveIndex >= 0 ? srcCurves[srcCurveIndex].curve : null, destCurveIndex >= 0 ? destCurves[destCurveIndex].curve : null, srcClipTime, destClipTime, crossWeight, additive);
|
|
23334
|
+
aniUpdate && owner.applyValue(value, weight, additive);
|
|
23335
|
+
finished && layerOwner.saveFinalValue();
|
|
23336
|
+
}
|
|
23088
23337
|
}
|
|
23089
|
-
|
|
23090
|
-
var destClipTime = destPlayData.clipTime;
|
|
23338
|
+
this._updateCrossFadeData(layerData, crossWeight, delta, false);
|
|
23091
23339
|
srcEventHandlers.length && this._fireAnimationEvents(srcPlayData, srcEventHandlers, lastSrcClipTime, srcClipTime);
|
|
23092
23340
|
destEventHandlers.length && this._fireAnimationEvents(destPlayData, destEventHandlers, lastDestClipTime, destClipTime);
|
|
23093
23341
|
if (lastSrcPlayState === AnimatorStatePlayState.UnStarted) {
|
|
@@ -23106,28 +23354,34 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
23106
23354
|
} else {
|
|
23107
23355
|
this._callAnimatorScriptOnUpdate(destState, layerIndex);
|
|
23108
23356
|
}
|
|
23109
|
-
for(var i = crossCurveDataCollection.length - 1; i >= 0; i--){
|
|
23110
|
-
var crossCurveData = crossCurveDataCollection[i];
|
|
23111
|
-
var crossSrcCurveIndex = crossCurveData.crossSrcCurveIndex, crossDestCurveIndex = crossCurveData.crossDestCurveIndex;
|
|
23112
|
-
crossCurveData.crossFadeAndApplyValue(crossSrcCurveIndex >= 0 ? srcCurves[crossSrcCurveIndex].curve : null, crossDestCurveIndex >= 0 ? destCurves[crossDestCurveIndex].curve : null, srcClipTime, destClipTime, crossWeight, weight, additive);
|
|
23113
|
-
}
|
|
23114
23357
|
};
|
|
23115
|
-
_proto._updateCrossFadeFromPose = function _updateCrossFadeFromPose(destPlayData, layerData, layerIndex,
|
|
23116
|
-
var
|
|
23358
|
+
_proto._updateCrossFadeFromPose = function _updateCrossFadeFromPose(destPlayData, layerData, layerIndex, weight, delta, additive, aniUpdate) {
|
|
23359
|
+
var crossLayerOwnerCollection = layerData.crossLayerOwnerCollection;
|
|
23117
23360
|
var state = destPlayData.state, stateData = destPlayData.stateData, lastPlayState = destPlayData.playState;
|
|
23118
23361
|
var eventHandlers = stateData.eventHandlers;
|
|
23119
23362
|
var _state_clip = state.clip, curveBindings = _state_clip._curveBindings;
|
|
23120
23363
|
var lastDestClipTime = destPlayData.clipTime;
|
|
23121
|
-
var
|
|
23122
|
-
crossWeight
|
|
23364
|
+
var duration = state._getDuration() * layerData.crossFadeTransition.duration;
|
|
23365
|
+
var crossWeight = Math.abs(destPlayData.frameTime) / duration;
|
|
23366
|
+
(crossWeight >= 1.0 || duration === 0) && (crossWeight = 1.0);
|
|
23123
23367
|
destPlayData.update(this.speed < 0);
|
|
23124
23368
|
var playState = destPlayData.playState;
|
|
23125
23369
|
this._updateCrossFadeData(layerData, crossWeight, delta, true);
|
|
23126
|
-
if (!aniUpdate) {
|
|
23127
|
-
return;
|
|
23128
|
-
}
|
|
23129
23370
|
var destClipTime = destPlayData.clipTime;
|
|
23130
|
-
|
|
23371
|
+
var finished = playState === AnimatorStatePlayState.Finished;
|
|
23372
|
+
// When the animator is culled (aniUpdate=false), if the play state has finished, the final value needs to be calculated and saved to be applied directly.
|
|
23373
|
+
if (aniUpdate || finished) {
|
|
23374
|
+
for(var i = crossLayerOwnerCollection.length - 1; i >= 0; i--){
|
|
23375
|
+
var layerOwner = crossLayerOwnerCollection[i];
|
|
23376
|
+
var owner = layerOwner == null ? void 0 : layerOwner.curveOwner;
|
|
23377
|
+
if (!owner) continue;
|
|
23378
|
+
var curveIndex = layerOwner.crossDestCurveIndex;
|
|
23379
|
+
var value = layerOwner.curveOwner.crossFadeFromPoseAndApplyValue(curveIndex >= 0 ? curveBindings[curveIndex].curve : null, destClipTime, crossWeight, additive);
|
|
23380
|
+
aniUpdate && owner.applyValue(value, weight, additive);
|
|
23381
|
+
finished && layerOwner.saveFinalValue();
|
|
23382
|
+
}
|
|
23383
|
+
}
|
|
23384
|
+
//@todo: srcState is missing the judgment of the most recent period."
|
|
23131
23385
|
eventHandlers.length && this._fireAnimationEvents(destPlayData, eventHandlers, lastDestClipTime, destClipTime);
|
|
23132
23386
|
if (lastPlayState === AnimatorStatePlayState.UnStarted) {
|
|
23133
23387
|
this._callAnimatorScriptOnEnter(state, layerIndex);
|
|
@@ -23137,10 +23391,18 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
23137
23391
|
} else {
|
|
23138
23392
|
this._callAnimatorScriptOnUpdate(state, layerIndex);
|
|
23139
23393
|
}
|
|
23140
|
-
|
|
23141
|
-
|
|
23142
|
-
|
|
23143
|
-
|
|
23394
|
+
};
|
|
23395
|
+
_proto._updateFinishedState = function _updateFinishedState(playData, weight, additive, aniUpdate) {
|
|
23396
|
+
if (!aniUpdate) {
|
|
23397
|
+
return;
|
|
23398
|
+
}
|
|
23399
|
+
var curveLayerOwner = playData.stateData.curveLayerOwner;
|
|
23400
|
+
var _playData_state_clip = playData.state.clip, curveBindings = _playData_state_clip._curveBindings;
|
|
23401
|
+
for(var i = curveBindings.length - 1; i >= 0; i--){
|
|
23402
|
+
var layerOwner = curveLayerOwner[i];
|
|
23403
|
+
var owner = layerOwner == null ? void 0 : layerOwner.curveOwner;
|
|
23404
|
+
if (!owner) continue;
|
|
23405
|
+
owner.applyValue(layerOwner.finalValue, weight, additive);
|
|
23144
23406
|
}
|
|
23145
23407
|
};
|
|
23146
23408
|
_proto._updateCrossFadeData = function _updateCrossFadeData(layerData, crossWeight, delta, fixed) {
|
|
@@ -23148,7 +23410,7 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
23148
23410
|
destPlayData.frameTime += destPlayData.state.speed * delta;
|
|
23149
23411
|
if (crossWeight === 1.0) {
|
|
23150
23412
|
if (destPlayData.playState === AnimatorStatePlayState.Finished) {
|
|
23151
|
-
layerData.layerState = LayerState.
|
|
23413
|
+
layerData.layerState = LayerState.Finished;
|
|
23152
23414
|
} else {
|
|
23153
23415
|
layerData.layerState = LayerState.Playing;
|
|
23154
23416
|
}
|
|
@@ -23158,25 +23420,24 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
23158
23420
|
fixed || (layerData.srcPlayData.frameTime += layerData.srcPlayData.state.speed * delta);
|
|
23159
23421
|
}
|
|
23160
23422
|
};
|
|
23161
|
-
_proto._preparePlay = function _preparePlay(layerData, playState
|
|
23423
|
+
_proto._preparePlay = function _preparePlay(layerData, playState) {
|
|
23162
23424
|
if (layerData.layerState === LayerState.Playing) {
|
|
23163
23425
|
var srcPlayData = layerData.srcPlayData;
|
|
23164
23426
|
if (srcPlayData.state !== playState) {
|
|
23165
|
-
var
|
|
23166
|
-
for(var i =
|
|
23167
|
-
var
|
|
23168
|
-
|
|
23427
|
+
var curveLayerOwner = srcPlayData.stateData.curveLayerOwner;
|
|
23428
|
+
for(var i = curveLayerOwner.length - 1; i >= 0; i--){
|
|
23429
|
+
var _curveLayerOwner_i;
|
|
23430
|
+
var owner = (_curveLayerOwner_i = curveLayerOwner[i]) == null ? void 0 : _curveLayerOwner_i.curveOwner;
|
|
23431
|
+
owner.revertDefaultValue();
|
|
23169
23432
|
}
|
|
23170
|
-
this._saveDefaultValues(playStateData);
|
|
23171
23433
|
}
|
|
23172
23434
|
} else {
|
|
23173
|
-
// layerState is CrossFading, FixedCrossFading, Standby
|
|
23174
|
-
var
|
|
23175
|
-
for(var i1 =
|
|
23176
|
-
var owner1 =
|
|
23177
|
-
owner1.
|
|
23435
|
+
// layerState is CrossFading, FixedCrossFading, Standby, Finished
|
|
23436
|
+
var crossLayerOwnerCollection = layerData.crossLayerOwnerCollection;
|
|
23437
|
+
for(var i1 = crossLayerOwnerCollection.length - 1; i1 >= 0; i1--){
|
|
23438
|
+
var owner1 = crossLayerOwnerCollection[i1].curveOwner;
|
|
23439
|
+
owner1.revertDefaultValue();
|
|
23178
23440
|
}
|
|
23179
|
-
this._saveDefaultValues(playStateData);
|
|
23180
23441
|
}
|
|
23181
23442
|
};
|
|
23182
23443
|
_proto._checkTransition = function _checkTransition(stateData, crossFadeTransition, layerIndex) {
|
|
@@ -23193,7 +23454,7 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
23193
23454
|
_proto._crossFadeByTransition = function _crossFadeByTransition(transition, layerIndex) {
|
|
23194
23455
|
var name = transition.destinationState.name;
|
|
23195
23456
|
var stateInfo = this._getAnimatorStateInfo(name, layerIndex);
|
|
23196
|
-
var crossState = stateInfo.state;
|
|
23457
|
+
var crossState = stateInfo.state, playLayerIndex = stateInfo.layerIndex;
|
|
23197
23458
|
if (!crossState) {
|
|
23198
23459
|
return;
|
|
23199
23460
|
}
|
|
@@ -23201,21 +23462,21 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
23201
23462
|
console.warn("The state named " + name + " has no AnimationClip data.");
|
|
23202
23463
|
return;
|
|
23203
23464
|
}
|
|
23204
|
-
var animatorLayerData = this._getAnimatorLayerData(
|
|
23465
|
+
var animatorLayerData = this._getAnimatorLayerData(playLayerIndex);
|
|
23205
23466
|
var layerState = animatorLayerData.layerState;
|
|
23206
23467
|
var destPlayData = animatorLayerData.destPlayData;
|
|
23207
|
-
var animatorStateData = this._getAnimatorStateData(name, crossState, animatorLayerData);
|
|
23468
|
+
var animatorStateData = this._getAnimatorStateData(name, crossState, animatorLayerData, playLayerIndex);
|
|
23208
23469
|
var duration = crossState._getDuration();
|
|
23209
23470
|
var offset = duration * transition.offset;
|
|
23210
23471
|
destPlayData.reset(crossState, animatorStateData, offset);
|
|
23211
23472
|
switch(layerState){
|
|
23212
|
-
// Maybe not play, maybe end.
|
|
23213
23473
|
case LayerState.Standby:
|
|
23214
23474
|
animatorLayerData.layerState = LayerState.FixedCrossFading;
|
|
23215
23475
|
this._clearCrossData(animatorLayerData);
|
|
23216
23476
|
this._prepareStandbyCrossFading(animatorLayerData);
|
|
23217
23477
|
break;
|
|
23218
23478
|
case LayerState.Playing:
|
|
23479
|
+
case LayerState.Finished:
|
|
23219
23480
|
animatorLayerData.layerState = LayerState.CrossFading;
|
|
23220
23481
|
this._clearCrossData(animatorLayerData);
|
|
23221
23482
|
this._prepareCrossFading(animatorLayerData);
|
|
@@ -23312,6 +23573,12 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
23312
23573
|
}
|
|
23313
23574
|
}
|
|
23314
23575
|
};
|
|
23576
|
+
_proto._revertCurveOwners = function _revertCurveOwners() {
|
|
23577
|
+
var curveOwners = this._needRevertCurveOwners;
|
|
23578
|
+
for(var i = 0, n = curveOwners.length; i < n; ++i){
|
|
23579
|
+
curveOwners[i].revertDefaultValue();
|
|
23580
|
+
}
|
|
23581
|
+
};
|
|
23315
23582
|
_create_class(Animator, [
|
|
23316
23583
|
{
|
|
23317
23584
|
key: "animatorController",
|
|
@@ -23343,10 +23610,10 @@ __decorate([
|
|
|
23343
23610
|
], Animator.prototype, "_animatorLayersData", void 0);
|
|
23344
23611
|
__decorate([
|
|
23345
23612
|
ignoreClone
|
|
23346
|
-
], Animator.prototype, "
|
|
23613
|
+
], Animator.prototype, "_curveOwnerPool", void 0);
|
|
23347
23614
|
__decorate([
|
|
23348
23615
|
ignoreClone
|
|
23349
|
-
], Animator.prototype, "
|
|
23616
|
+
], Animator.prototype, "_needRevertCurveOwners", void 0);
|
|
23350
23617
|
__decorate([
|
|
23351
23618
|
ignoreClone
|
|
23352
23619
|
], Animator.prototype, "_animationEventHandlerPool", void 0);
|