@galacean/effects-core 2.1.0-alpha.2 → 2.1.0-alpha.4
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/components/effect-component.d.ts +1 -0
- package/dist/index.js +291 -243
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +291 -243
- package/dist/index.mjs.map +1 -1
- package/dist/math/value-getter.d.ts +1 -0
- package/dist/plugins/cal/playable-graph.d.ts +0 -1
- package/dist/plugins/cal/timeline-asset.d.ts +2 -5
- package/dist/plugins/particle/burst.d.ts +2 -0
- package/dist/plugins/particle/particle-mesh.d.ts +3 -7
- package/dist/plugins/particle/particle-system.d.ts +2 -2
- package/dist/vfx-item.d.ts +4 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Description: Galacean Effects runtime core for the web
|
|
4
4
|
* Author: Ant Group CO., Ltd.
|
|
5
5
|
* Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
|
|
6
|
-
* Version: v2.1.0-alpha.
|
|
6
|
+
* Version: v2.1.0-alpha.4
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
@@ -4255,6 +4255,9 @@ var MaterialBlending;
|
|
|
4255
4255
|
/**
|
|
4256
4256
|
* 自发光
|
|
4257
4257
|
*/ RenderMode3D["emissive"] = "emissive";
|
|
4258
|
+
/**
|
|
4259
|
+
* 漫反射
|
|
4260
|
+
*/ RenderMode3D["diffuse"] = "diffuse";
|
|
4258
4261
|
})(RenderMode3D || (RenderMode3D = {}));
|
|
4259
4262
|
|
|
4260
4263
|
var TextOverflow;
|
|
@@ -10307,10 +10310,11 @@ var BezierCurve = /*#__PURE__*/ function(ValueGetter) {
|
|
|
10307
10310
|
timeEnd: Number(e.x)
|
|
10308
10311
|
};
|
|
10309
10312
|
}
|
|
10313
|
+
this.keyTimeData = Object.keys(this.curveMap);
|
|
10310
10314
|
};
|
|
10311
10315
|
_proto.getValue = function getValue(time) {
|
|
10312
10316
|
var result = 0;
|
|
10313
|
-
var keyTimeData =
|
|
10317
|
+
var keyTimeData = this.keyTimeData;
|
|
10314
10318
|
var keyTimeStart = this.curveMap[keyTimeData[0]].timeStart;
|
|
10315
10319
|
var keyTimeEnd = this.curveMap[keyTimeData[keyTimeData.length - 1]].timeEnd;
|
|
10316
10320
|
// const keyTimeStart = Number(keyTimeData[0].split('&')[0]);
|
|
@@ -13605,25 +13609,25 @@ function _assert_this_initialized(self) {
|
|
|
13605
13609
|
}
|
|
13606
13610
|
var _proto = PlayableGraph.prototype;
|
|
13607
13611
|
_proto.evaluate = function evaluate(dt) {
|
|
13608
|
-
// 初始化节点状态
|
|
13609
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(this.playables), _step; !(_step = _iterator()).done;){
|
|
13610
|
-
var playable = _step.value;
|
|
13611
|
-
this.updatePlayableTime(playable, dt);
|
|
13612
|
-
}
|
|
13613
13612
|
// 初始化输出节点状态
|
|
13614
|
-
for(var
|
|
13615
|
-
var playableOutput =
|
|
13613
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(this.playableOutputs), _step; !(_step = _iterator()).done;){
|
|
13614
|
+
var playableOutput = _step.value;
|
|
13616
13615
|
playableOutput.context.deltaTime = dt;
|
|
13617
13616
|
}
|
|
13618
13617
|
// 执行生命周期函数
|
|
13619
|
-
for(var
|
|
13620
|
-
var playableOutput1 =
|
|
13618
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(this.playableOutputs), _step1; !(_step1 = _iterator1()).done;){
|
|
13619
|
+
var playableOutput1 = _step1.value;
|
|
13621
13620
|
this.prepareFrameWithRoot(playableOutput1);
|
|
13622
13621
|
}
|
|
13623
|
-
for(var
|
|
13624
|
-
var playableOutput2 =
|
|
13622
|
+
for(var _iterator2 = _create_for_of_iterator_helper_loose(this.playableOutputs), _step2; !(_step2 = _iterator2()).done;){
|
|
13623
|
+
var playableOutput2 = _step2.value;
|
|
13625
13624
|
this.processFrameWithRoot(playableOutput2);
|
|
13626
13625
|
}
|
|
13626
|
+
// 更新节点时间
|
|
13627
|
+
for(var _iterator3 = _create_for_of_iterator_helper_loose(this.playables), _step3; !(_step3 = _iterator3()).done;){
|
|
13628
|
+
var playable = _step3.value;
|
|
13629
|
+
this.updatePlayableTime(playable, dt);
|
|
13630
|
+
}
|
|
13627
13631
|
};
|
|
13628
13632
|
_proto.connect = function connect(source, sourceOutputPort, destination, destinationInputPort) {
|
|
13629
13633
|
destination.connectInput(destinationInputPort, source, sourceOutputPort);
|
|
@@ -13646,11 +13650,7 @@ function _assert_this_initialized(self) {
|
|
|
13646
13650
|
if (playable.getPlayState() !== 0) {
|
|
13647
13651
|
return;
|
|
13648
13652
|
}
|
|
13649
|
-
|
|
13650
|
-
playable.overrideTimeNextEvaluation = false;
|
|
13651
|
-
} else {
|
|
13652
|
-
playable.setTime(playable.getTime() + deltaTime);
|
|
13653
|
-
}
|
|
13653
|
+
playable.setTime(playable.getTime() + deltaTime);
|
|
13654
13654
|
};
|
|
13655
13655
|
return PlayableGraph;
|
|
13656
13656
|
}();
|
|
@@ -13662,7 +13662,6 @@ function _assert_this_initialized(self) {
|
|
|
13662
13662
|
if (inputCount === void 0) inputCount = 0;
|
|
13663
13663
|
this.onPlayablePlayFlag = true;
|
|
13664
13664
|
this.onPlayablePauseFlag = false;
|
|
13665
|
-
this.overrideTimeNextEvaluation = false;
|
|
13666
13665
|
this.destroyed = false;
|
|
13667
13666
|
this.inputs = [];
|
|
13668
13667
|
this.inputOuputPorts = [];
|
|
@@ -13751,7 +13750,6 @@ function _assert_this_initialized(self) {
|
|
|
13751
13750
|
};
|
|
13752
13751
|
_proto.setTime = function setTime(time) {
|
|
13753
13752
|
this.time = time;
|
|
13754
|
-
this.overrideTimeNextEvaluation = true;
|
|
13755
13753
|
};
|
|
13756
13754
|
_proto.getTime = function getTime() {
|
|
13757
13755
|
return this.time;
|
|
@@ -16554,8 +16552,9 @@ function getTrailMeshShader(trails, particleMaxCount, name, gpuCapability, env)
|
|
|
16554
16552
|
};
|
|
16555
16553
|
_proto.onUpdate = function onUpdate(dt) {
|
|
16556
16554
|
var time = this.particleMesh.time;
|
|
16557
|
-
|
|
16558
|
-
this.particleMesh.
|
|
16555
|
+
var _this_particleMesh_mesh_material_getVector4;
|
|
16556
|
+
var uParams = (_this_particleMesh_mesh_material_getVector4 = this.particleMesh.mesh.material.getVector4("uParams")) != null ? _this_particleMesh_mesh_material_getVector4 : new Vector4();
|
|
16557
|
+
this.particleMesh.mesh.material.setVector4("uParams", uParams.set(time, this.item.duration, 0, 0));
|
|
16559
16558
|
};
|
|
16560
16559
|
_proto.render = function render(renderer) {
|
|
16561
16560
|
for(var _iterator = _create_for_of_iterator_helper_loose(this.meshes), _step; !(_step = _iterator()).done;){
|
|
@@ -16570,7 +16569,7 @@ function getTrailMeshShader(trails, particleMaxCount, name, gpuCapability, env)
|
|
|
16570
16569
|
};
|
|
16571
16570
|
_proto.updateTime = function updateTime(now, delta) {
|
|
16572
16571
|
this.particleMesh.time = now;
|
|
16573
|
-
|
|
16572
|
+
this.particleMesh.onUpdate(delta);
|
|
16574
16573
|
if (this.trailMesh) {
|
|
16575
16574
|
this.trailMesh.time = now;
|
|
16576
16575
|
this.trailMesh.onUpdate(delta);
|
|
@@ -16864,7 +16863,7 @@ exports.ParticleSystem = /*#__PURE__*/ function(Component) {
|
|
|
16864
16863
|
break;
|
|
16865
16864
|
}
|
|
16866
16865
|
var burst = bursts[j];
|
|
16867
|
-
var opts = burst.getGeneratorOptions(timePassed, lifetime);
|
|
16866
|
+
var opts = !burst.disabled && burst.getGeneratorOptions(timePassed, lifetime);
|
|
16868
16867
|
if (opts) {
|
|
16869
16868
|
var originVec = [
|
|
16870
16869
|
0,
|
|
@@ -16873,6 +16872,9 @@ exports.ParticleSystem = /*#__PURE__*/ function(Component) {
|
|
|
16873
16872
|
];
|
|
16874
16873
|
var offsets = emission.burstOffsets[j];
|
|
16875
16874
|
var burstOffset = offsets && offsets[opts.cycleIndex] || originVec;
|
|
16875
|
+
if (burst.once) {
|
|
16876
|
+
this.removeBurst(j);
|
|
16877
|
+
}
|
|
16876
16878
|
for(var i1 = 0; i1 < opts.count && cursor < maxCount; i1++){
|
|
16877
16879
|
var _p_transform;
|
|
16878
16880
|
if (shouldSkipGenerate()) {
|
|
@@ -17677,12 +17679,10 @@ var particleUniformTypeMap = {
|
|
|
17677
17679
|
var ParticleMesh = /*#__PURE__*/ function() {
|
|
17678
17680
|
function ParticleMesh(engine, props) {
|
|
17679
17681
|
this.particleCount = 0;
|
|
17680
|
-
this.cachedVelocity = new Vector3();
|
|
17681
17682
|
this.cachedRotationVector3 = new Vector3();
|
|
17682
17683
|
this.cachedRotationMatrix = new Matrix3();
|
|
17683
17684
|
this.cachedLinearMove = new Vector3();
|
|
17684
17685
|
this.tempMatrix3 = new Matrix3();
|
|
17685
|
-
this.tempVector3 = new Vector3();
|
|
17686
17686
|
this.VERT_MAX_KEY_FRAME_COUNT = 0;
|
|
17687
17687
|
var _engine_renderer;
|
|
17688
17688
|
var env = ((_engine_renderer = engine.renderer) != null ? _engine_renderer : {}).env;
|
|
@@ -18078,72 +18078,10 @@ var ParticleMesh = /*#__PURE__*/ function() {
|
|
|
18078
18078
|
};
|
|
18079
18079
|
_proto.onUpdate = function onUpdate(dt) {
|
|
18080
18080
|
var aPosArray = this.geometry.getAttributeData("aPos"); // vector3
|
|
18081
|
-
var
|
|
18082
|
-
|
|
18083
|
-
|
|
18084
|
-
|
|
18085
|
-
// const uParams = this.mesh.material.getVector4('uParams');
|
|
18086
|
-
// if (!uParams) {
|
|
18087
|
-
// return;
|
|
18088
|
-
// }
|
|
18089
|
-
var localTime = this.time;
|
|
18090
|
-
var particleCount = Math.ceil(aPosArray.length / 12);
|
|
18091
|
-
// calculate particle translation
|
|
18092
|
-
var aTranslationArray = this.geometry.getAttributeData("aTranslation");
|
|
18093
|
-
if (aTranslationArray.length < particleCount * 3) {
|
|
18094
|
-
aTranslationArray = this.expandArray(aTranslationArray, particleCount * 3);
|
|
18095
|
-
}
|
|
18096
|
-
var velocity = this.cachedVelocity;
|
|
18097
|
-
for(var i = 0; i < particleCount; i++){
|
|
18098
|
-
var velOffset = i * 12 + 3;
|
|
18099
|
-
velocity.set(aVelArray[velOffset], aVelArray[velOffset + 1], aVelArray[velOffset + 2]);
|
|
18100
|
-
this.calculateTranslation(velocity, aOffsetArray[i * 4 + 2], localTime, aOffsetArray[i * 4 + 3]);
|
|
18101
|
-
var aTranslationOffset = i * 3;
|
|
18102
|
-
if (aOffsetArray[i * 4 + 2] < localTime) {
|
|
18103
|
-
var translation = velocity.multiply(dt / 1000);
|
|
18104
|
-
aTranslationArray[aTranslationOffset] += translation.x;
|
|
18105
|
-
aTranslationArray[aTranslationOffset + 1] += translation.y;
|
|
18106
|
-
aTranslationArray[aTranslationOffset + 2] += translation.z;
|
|
18107
|
-
}
|
|
18108
|
-
}
|
|
18109
|
-
this.geometry.setAttributeData("aTranslation", aTranslationArray);
|
|
18110
|
-
// calculate particle rotation
|
|
18111
|
-
var aRotationArray = this.geometry.getAttributeData("aRotation0");
|
|
18112
|
-
if (aRotationArray.length < particleCount * 9) {
|
|
18113
|
-
aRotationArray = this.expandArray(aRotationArray, particleCount * 9);
|
|
18114
|
-
}
|
|
18115
|
-
for(var i1 = 0; i1 < particleCount; i1++){
|
|
18116
|
-
var time = localTime - aOffsetArray[i1 * 4 + 2];
|
|
18117
|
-
var duration = aOffsetArray[i1 * 4 + 3];
|
|
18118
|
-
var life = clamp$1(time / duration, 0.0, 1.0);
|
|
18119
|
-
var aRotOffset = i1 * 8;
|
|
18120
|
-
var aRot = this.cachedRotationVector3.set(aRotArray[aRotOffset], aRotArray[aRotOffset + 1], aRotArray[aRotOffset + 2]);
|
|
18121
|
-
var aSeed = aSeedArray[i1 * 8 + 3];
|
|
18122
|
-
var aRotation = this.transformFromRotation(aRot, life, duration, aSeed, this.cachedRotationMatrix);
|
|
18123
|
-
var aRotationOffset = i1 * 9;
|
|
18124
|
-
var matrixArray = aRotation.toArray();
|
|
18125
|
-
aRotationArray.set(matrixArray, aRotationOffset);
|
|
18126
|
-
}
|
|
18127
|
-
this.geometry.setAttributeData("aRotation0", aRotationArray);
|
|
18128
|
-
// calculate linear movement
|
|
18129
|
-
var aLinearMoveArray = this.geometry.getAttributeData("aLinearMove");
|
|
18130
|
-
if (aLinearMoveArray.length < particleCount * 3) {
|
|
18131
|
-
aLinearMoveArray = this.expandArray(aLinearMoveArray, particleCount * 3);
|
|
18132
|
-
}
|
|
18133
|
-
var linearMove = this.cachedLinearMove;
|
|
18134
|
-
for(var i2 = 0; i2 < particleCount; i2++){
|
|
18135
|
-
var time1 = localTime - aOffsetArray[i2 * 4 + 2];
|
|
18136
|
-
var duration1 = aOffsetArray[i2 * 4 + 3];
|
|
18137
|
-
// const life = math.clamp(time / duration, 0.0, 1.0);
|
|
18138
|
-
var aSeed1 = aSeedArray[i2 * 8 + 3];
|
|
18139
|
-
linearMove.setZero();
|
|
18140
|
-
this.calLinearMov(time1, duration1, aSeed1, linearMove);
|
|
18141
|
-
var aLinearMoveOffset = i2 * 3;
|
|
18142
|
-
aLinearMoveArray[aLinearMoveOffset] = linearMove.x;
|
|
18143
|
-
aLinearMoveArray[aLinearMoveOffset + 1] = linearMove.y;
|
|
18144
|
-
aLinearMoveArray[aLinearMoveOffset + 2] = linearMove.z;
|
|
18145
|
-
}
|
|
18146
|
-
this.geometry.setAttributeData("aLinearMove", aLinearMoveArray);
|
|
18081
|
+
var vertexCount = Math.ceil(aPosArray.length / 12);
|
|
18082
|
+
this.applyTranslation(vertexCount, dt);
|
|
18083
|
+
this.applyRotation(vertexCount, dt);
|
|
18084
|
+
this.applyLinearMove(vertexCount, dt);
|
|
18147
18085
|
};
|
|
18148
18086
|
_proto.minusTime = function minusTime(time) {
|
|
18149
18087
|
var aOffset = this.geometry.getAttributeData("aOffset");
|
|
@@ -18153,153 +18091,6 @@ var ParticleMesh = /*#__PURE__*/ function() {
|
|
|
18153
18091
|
this.geometry.setAttributeData("aOffset", aOffset);
|
|
18154
18092
|
this.time -= time;
|
|
18155
18093
|
};
|
|
18156
|
-
_proto.calculateTranslation = function calculateTranslation(velocity, t0, t1, duration) {
|
|
18157
|
-
var uAcceleration = this.mesh.material.getVector4("uAcceleration");
|
|
18158
|
-
var uGravityModifierValue = this.mesh.material.getVector4("uGravityModifierValue");
|
|
18159
|
-
if (!uAcceleration || !uGravityModifierValue) {
|
|
18160
|
-
return velocity;
|
|
18161
|
-
}
|
|
18162
|
-
var dt = t1 - t0; // 相对delay的时间
|
|
18163
|
-
var d = this.gravityModifier.getIntegrateValue(0, dt, duration);
|
|
18164
|
-
var acc = this.tempVector3.set(uAcceleration.x * d, uAcceleration.y * d, uAcceleration.z * d);
|
|
18165
|
-
// speedIntegrate = speedOverLifetime.getIntegrateValue(0, time, duration);
|
|
18166
|
-
if (this.speedOverLifetime) {
|
|
18167
|
-
// dt / dur 归一化
|
|
18168
|
-
var speed = this.speedOverLifetime.getValue(dt / duration);
|
|
18169
|
-
return velocity.multiply(speed).add(acc);
|
|
18170
|
-
}
|
|
18171
|
-
return velocity.add(acc);
|
|
18172
|
-
};
|
|
18173
|
-
_proto.transformFromRotation = function transformFromRotation(rot, life, dur, aSeed, result) {
|
|
18174
|
-
var rotation = rot;
|
|
18175
|
-
if (!this.rotationOverLifetime) {
|
|
18176
|
-
return result.setZero();
|
|
18177
|
-
}
|
|
18178
|
-
if (this.rotationOverLifetime.asRotation) {
|
|
18179
|
-
// Adjust rotation based on the specified lifetime components
|
|
18180
|
-
if (this.rotationOverLifetime.x) {
|
|
18181
|
-
if (_instanceof1(this.rotationOverLifetime.x, RandomValue)) {
|
|
18182
|
-
rotation.x += this.rotationOverLifetime.x.getValue(life, aSeed);
|
|
18183
|
-
} else {
|
|
18184
|
-
rotation.x += this.rotationOverLifetime.x.getValue(life);
|
|
18185
|
-
}
|
|
18186
|
-
}
|
|
18187
|
-
if (this.rotationOverLifetime.y) {
|
|
18188
|
-
if (_instanceof1(this.rotationOverLifetime.y, RandomValue)) {
|
|
18189
|
-
rotation.y += this.rotationOverLifetime.y.getValue(life, aSeed);
|
|
18190
|
-
} else {
|
|
18191
|
-
rotation.y += this.rotationOverLifetime.y.getValue(life);
|
|
18192
|
-
}
|
|
18193
|
-
}
|
|
18194
|
-
if (this.rotationOverLifetime.z) {
|
|
18195
|
-
if (_instanceof1(this.rotationOverLifetime.z, RandomValue)) {
|
|
18196
|
-
rotation.z += this.rotationOverLifetime.z.getValue(life, aSeed);
|
|
18197
|
-
} else {
|
|
18198
|
-
rotation.z += this.rotationOverLifetime.z.getValue(life);
|
|
18199
|
-
}
|
|
18200
|
-
}
|
|
18201
|
-
} else {
|
|
18202
|
-
// Adjust rotation based on the specified lifetime components
|
|
18203
|
-
if (this.rotationOverLifetime.x) {
|
|
18204
|
-
if (_instanceof1(this.rotationOverLifetime.x, RandomValue)) {
|
|
18205
|
-
rotation.x += this.rotationOverLifetime.x.getIntegrateValue(0.0, life, aSeed) * dur;
|
|
18206
|
-
} else {
|
|
18207
|
-
rotation.x += this.rotationOverLifetime.x.getIntegrateValue(0.0, life, dur) * dur;
|
|
18208
|
-
}
|
|
18209
|
-
}
|
|
18210
|
-
if (this.rotationOverLifetime.y) {
|
|
18211
|
-
if (_instanceof1(this.rotationOverLifetime.y, RandomValue)) {
|
|
18212
|
-
rotation.y += this.rotationOverLifetime.y.getIntegrateValue(0.0, life, aSeed) * dur;
|
|
18213
|
-
} else {
|
|
18214
|
-
rotation.y += this.rotationOverLifetime.y.getIntegrateValue(0.0, life, dur) * dur;
|
|
18215
|
-
}
|
|
18216
|
-
}
|
|
18217
|
-
if (this.rotationOverLifetime.z) {
|
|
18218
|
-
if (_instanceof1(this.rotationOverLifetime.z, RandomValue)) {
|
|
18219
|
-
rotation.z += this.rotationOverLifetime.z.getIntegrateValue(0.0, life, aSeed) * dur;
|
|
18220
|
-
} else {
|
|
18221
|
-
rotation.z += this.rotationOverLifetime.z.getIntegrateValue(0.0, life, dur) * dur;
|
|
18222
|
-
}
|
|
18223
|
-
}
|
|
18224
|
-
}
|
|
18225
|
-
// If the rotation vector is zero, return the identity matrix
|
|
18226
|
-
if (rotation.dot(rotation) === 0.0) {
|
|
18227
|
-
return result.identity();
|
|
18228
|
-
}
|
|
18229
|
-
// Return the rotation matrix derived from the rotation vector
|
|
18230
|
-
return this.mat3FromRotation(rotation, result);
|
|
18231
|
-
};
|
|
18232
|
-
_proto.mat3FromRotation = function mat3FromRotation(rotation, result) {
|
|
18233
|
-
var d2r = Math.PI / 180;
|
|
18234
|
-
var rotationXD2r = rotation.x * d2r;
|
|
18235
|
-
var rotationYD2r = rotation.y * d2r;
|
|
18236
|
-
var rotationZD2r = rotation.z * d2r;
|
|
18237
|
-
var sinRX = Math.sin(rotationXD2r);
|
|
18238
|
-
var sinRY = Math.sin(rotationYD2r);
|
|
18239
|
-
var sinRZ = Math.sin(rotationZD2r);
|
|
18240
|
-
var cosRX = Math.cos(rotationXD2r);
|
|
18241
|
-
var cosRY = Math.cos(rotationYD2r);
|
|
18242
|
-
var cosRZ = Math.cos(rotationZD2r);
|
|
18243
|
-
// rotZ * rotY * rotX
|
|
18244
|
-
result.set(cosRZ, -sinRZ, 0., sinRZ, cosRZ, 0., 0., 0., 1.); //rotZ
|
|
18245
|
-
result.multiply(this.tempMatrix3.set(cosRY, 0., sinRY, 0., 1., 0., -sinRY, 0, cosRY)); //rotY
|
|
18246
|
-
result.multiply(this.tempMatrix3.set(1., 0., 0., 0, cosRX, -sinRX, 0., sinRX, cosRX)); //rotX
|
|
18247
|
-
return result;
|
|
18248
|
-
};
|
|
18249
|
-
_proto.calLinearMov = function calLinearMov(time, duration, aSeed, result) {
|
|
18250
|
-
var mov = result;
|
|
18251
|
-
var lifetime = time / duration;
|
|
18252
|
-
if (!this.linearVelOverLifetime || !this.linearVelOverLifetime.enabled) {
|
|
18253
|
-
return mov;
|
|
18254
|
-
}
|
|
18255
|
-
if (this.linearVelOverLifetime.asMovement) {
|
|
18256
|
-
if (this.linearVelOverLifetime.x) {
|
|
18257
|
-
if (_instanceof1(this.linearVelOverLifetime.x, RandomValue)) {
|
|
18258
|
-
mov.x = this.linearVelOverLifetime.x.getValue(lifetime, aSeed);
|
|
18259
|
-
} else {
|
|
18260
|
-
mov.x = this.linearVelOverLifetime.x.getValue(lifetime);
|
|
18261
|
-
}
|
|
18262
|
-
}
|
|
18263
|
-
if (this.linearVelOverLifetime.y) {
|
|
18264
|
-
if (_instanceof1(this.linearVelOverLifetime.y, RandomValue)) {
|
|
18265
|
-
mov.y = this.linearVelOverLifetime.y.getValue(lifetime, aSeed);
|
|
18266
|
-
} else {
|
|
18267
|
-
mov.y = this.linearVelOverLifetime.y.getValue(lifetime);
|
|
18268
|
-
}
|
|
18269
|
-
}
|
|
18270
|
-
if (this.linearVelOverLifetime.z) {
|
|
18271
|
-
if (_instanceof1(this.linearVelOverLifetime.z, RandomValue)) {
|
|
18272
|
-
mov.z = this.linearVelOverLifetime.z.getValue(lifetime, aSeed);
|
|
18273
|
-
} else {
|
|
18274
|
-
mov.z = this.linearVelOverLifetime.z.getValue(lifetime);
|
|
18275
|
-
}
|
|
18276
|
-
}
|
|
18277
|
-
} else {
|
|
18278
|
-
// Adjust rotation based on the specified lifetime components
|
|
18279
|
-
if (this.linearVelOverLifetime.x) {
|
|
18280
|
-
if (_instanceof1(this.linearVelOverLifetime.x, RandomValue)) {
|
|
18281
|
-
mov.x = this.linearVelOverLifetime.x.getIntegrateValue(0.0, time, aSeed);
|
|
18282
|
-
} else {
|
|
18283
|
-
mov.x = this.linearVelOverLifetime.x.getIntegrateValue(0.0, time, duration);
|
|
18284
|
-
}
|
|
18285
|
-
}
|
|
18286
|
-
if (this.linearVelOverLifetime.y) {
|
|
18287
|
-
if (_instanceof1(this.linearVelOverLifetime.y, RandomValue)) {
|
|
18288
|
-
mov.y = this.linearVelOverLifetime.y.getIntegrateValue(0.0, time, aSeed);
|
|
18289
|
-
} else {
|
|
18290
|
-
mov.y = this.linearVelOverLifetime.y.getIntegrateValue(0.0, time, duration);
|
|
18291
|
-
}
|
|
18292
|
-
}
|
|
18293
|
-
if (this.linearVelOverLifetime.z) {
|
|
18294
|
-
if (_instanceof1(this.linearVelOverLifetime.z, RandomValue)) {
|
|
18295
|
-
mov.z = this.linearVelOverLifetime.z.getIntegrateValue(0.0, time, aSeed);
|
|
18296
|
-
} else {
|
|
18297
|
-
mov.z = this.linearVelOverLifetime.z.getIntegrateValue(0.0, time, duration);
|
|
18298
|
-
}
|
|
18299
|
-
}
|
|
18300
|
-
}
|
|
18301
|
-
return mov;
|
|
18302
|
-
};
|
|
18303
18094
|
_proto.removePoint = function removePoint(index) {
|
|
18304
18095
|
if (index < this.particleCount) {
|
|
18305
18096
|
this.geometry.setAttributeSubData("aOffset", index * 16, new Float32Array(16));
|
|
@@ -18433,6 +18224,247 @@ var ParticleMesh = /*#__PURE__*/ function() {
|
|
|
18433
18224
|
geometry.setDrawCount(this.particleCount * 6);
|
|
18434
18225
|
}
|
|
18435
18226
|
};
|
|
18227
|
+
_proto.applyTranslation = function applyTranslation(vertexCount, deltaTime) {
|
|
18228
|
+
var localTime = this.time;
|
|
18229
|
+
var aTranslationArray = this.geometry.getAttributeData("aTranslation");
|
|
18230
|
+
var aVelArray = this.geometry.getAttributeData("aVel"); // vector3
|
|
18231
|
+
var aOffsetArray = this.geometry.getAttributeData("aOffset");
|
|
18232
|
+
if (aTranslationArray.length < vertexCount * 3) {
|
|
18233
|
+
aTranslationArray = this.expandArray(aTranslationArray, vertexCount * 3);
|
|
18234
|
+
}
|
|
18235
|
+
// const velocity = this.cachedVelocity;
|
|
18236
|
+
var velocityX = 0;
|
|
18237
|
+
var velocityY = 0;
|
|
18238
|
+
var velocityZ = 0;
|
|
18239
|
+
var uAcceleration = this.mesh.material.getVector4("uAcceleration");
|
|
18240
|
+
var uGravityModifierValue = this.mesh.material.getVector4("uGravityModifierValue");
|
|
18241
|
+
for(var i = 0; i < vertexCount; i += 4){
|
|
18242
|
+
var velOffset = i * 12 + 3;
|
|
18243
|
+
velocityX = aVelArray[velOffset];
|
|
18244
|
+
velocityY = aVelArray[velOffset + 1];
|
|
18245
|
+
velocityZ = aVelArray[velOffset + 2];
|
|
18246
|
+
// velocity.set(aVelArray[velOffset], aVelArray[velOffset + 1], aVelArray[velOffset + 2]);
|
|
18247
|
+
var dt = localTime - aOffsetArray[i * 4 + 2]; // 相对delay的时间
|
|
18248
|
+
var duration = aOffsetArray[i * 4 + 3];
|
|
18249
|
+
if (uAcceleration && uGravityModifierValue) {
|
|
18250
|
+
var d = this.gravityModifier.getIntegrateValue(0, dt, duration);
|
|
18251
|
+
// const acc = this.tempVector3.set(uAcceleration.x * d, uAcceleration.y * d, uAcceleration.z * d);
|
|
18252
|
+
var accX = uAcceleration.x * d;
|
|
18253
|
+
var accY = uAcceleration.y * d;
|
|
18254
|
+
var accZ = uAcceleration.z * d;
|
|
18255
|
+
// speedIntegrate = speedOverLifetime.getIntegrateValue(0, time, duration);
|
|
18256
|
+
if (this.speedOverLifetime) {
|
|
18257
|
+
// dt / dur 归一化
|
|
18258
|
+
var speed = this.speedOverLifetime.getValue(dt / duration);
|
|
18259
|
+
velocityX = velocityX * speed + accX;
|
|
18260
|
+
velocityY = velocityY * speed + accY;
|
|
18261
|
+
velocityZ = velocityZ * speed + accZ;
|
|
18262
|
+
// velocity.multiply(speed).add(acc);
|
|
18263
|
+
} else {
|
|
18264
|
+
velocityX = velocityX + accX;
|
|
18265
|
+
velocityY = velocityY + accY;
|
|
18266
|
+
velocityZ = velocityZ + accZ;
|
|
18267
|
+
// velocity.add(acc);
|
|
18268
|
+
}
|
|
18269
|
+
}
|
|
18270
|
+
var aTranslationOffset = i * 3;
|
|
18271
|
+
if (aOffsetArray[i * 4 + 2] < localTime) {
|
|
18272
|
+
// const translation = velocity.multiply(deltaTime / 1000);
|
|
18273
|
+
var aTranslationX = velocityX * (deltaTime / 1000);
|
|
18274
|
+
var aTranslationY = velocityY * (deltaTime / 1000);
|
|
18275
|
+
var aTranslationZ = velocityZ * (deltaTime / 1000);
|
|
18276
|
+
aTranslationArray[aTranslationOffset] += aTranslationX;
|
|
18277
|
+
aTranslationArray[aTranslationOffset + 1] += aTranslationY;
|
|
18278
|
+
aTranslationArray[aTranslationOffset + 2] += aTranslationZ;
|
|
18279
|
+
aTranslationArray[aTranslationOffset + 3] += aTranslationX;
|
|
18280
|
+
aTranslationArray[aTranslationOffset + 4] += aTranslationY;
|
|
18281
|
+
aTranslationArray[aTranslationOffset + 5] += aTranslationZ;
|
|
18282
|
+
aTranslationArray[aTranslationOffset + 6] += aTranslationX;
|
|
18283
|
+
aTranslationArray[aTranslationOffset + 7] += aTranslationY;
|
|
18284
|
+
aTranslationArray[aTranslationOffset + 8] += aTranslationZ;
|
|
18285
|
+
aTranslationArray[aTranslationOffset + 9] += aTranslationX;
|
|
18286
|
+
aTranslationArray[aTranslationOffset + 10] += aTranslationY;
|
|
18287
|
+
aTranslationArray[aTranslationOffset + 11] += aTranslationZ;
|
|
18288
|
+
}
|
|
18289
|
+
}
|
|
18290
|
+
this.geometry.setAttributeData("aTranslation", aTranslationArray);
|
|
18291
|
+
};
|
|
18292
|
+
_proto.applyRotation = function applyRotation(vertexCount, deltaTime) {
|
|
18293
|
+
var aRotationArray = this.geometry.getAttributeData("aRotation0");
|
|
18294
|
+
var aOffsetArray = this.geometry.getAttributeData("aOffset");
|
|
18295
|
+
var aRotArray = this.geometry.getAttributeData("aRot"); // vector3
|
|
18296
|
+
var aSeedArray = this.geometry.getAttributeData("aSeed"); // float
|
|
18297
|
+
var localTime = this.time;
|
|
18298
|
+
var aRotationMatrix = this.cachedRotationMatrix;
|
|
18299
|
+
if (aRotationArray.length < vertexCount * 9) {
|
|
18300
|
+
aRotationArray = this.expandArray(aRotationArray, vertexCount * 9);
|
|
18301
|
+
}
|
|
18302
|
+
for(var i = 0; i < vertexCount; i += 4){
|
|
18303
|
+
var time = localTime - aOffsetArray[i * 4 + 2];
|
|
18304
|
+
var duration = aOffsetArray[i * 4 + 3];
|
|
18305
|
+
var life = clamp$1(time / duration, 0.0, 1.0);
|
|
18306
|
+
var aRotOffset = i * 8;
|
|
18307
|
+
var aRot = this.cachedRotationVector3.set(aRotArray[aRotOffset], aRotArray[aRotOffset + 1], aRotArray[aRotOffset + 2]);
|
|
18308
|
+
var aSeed = aSeedArray[i * 8 + 3];
|
|
18309
|
+
var rotation = aRot;
|
|
18310
|
+
if (!this.rotationOverLifetime) {
|
|
18311
|
+
aRotationMatrix.setZero();
|
|
18312
|
+
} else if (this.rotationOverLifetime.asRotation) {
|
|
18313
|
+
// Adjust rotation based on the specified lifetime components
|
|
18314
|
+
if (this.rotationOverLifetime.x) {
|
|
18315
|
+
if (_instanceof1(this.rotationOverLifetime.x, RandomValue)) {
|
|
18316
|
+
rotation.x += this.rotationOverLifetime.x.getValue(life, aSeed);
|
|
18317
|
+
} else {
|
|
18318
|
+
rotation.x += this.rotationOverLifetime.x.getValue(life);
|
|
18319
|
+
}
|
|
18320
|
+
}
|
|
18321
|
+
if (this.rotationOverLifetime.y) {
|
|
18322
|
+
if (_instanceof1(this.rotationOverLifetime.y, RandomValue)) {
|
|
18323
|
+
rotation.y += this.rotationOverLifetime.y.getValue(life, aSeed);
|
|
18324
|
+
} else {
|
|
18325
|
+
rotation.y += this.rotationOverLifetime.y.getValue(life);
|
|
18326
|
+
}
|
|
18327
|
+
}
|
|
18328
|
+
if (this.rotationOverLifetime.z) {
|
|
18329
|
+
if (_instanceof1(this.rotationOverLifetime.z, RandomValue)) {
|
|
18330
|
+
rotation.z += this.rotationOverLifetime.z.getValue(life, aSeed);
|
|
18331
|
+
} else {
|
|
18332
|
+
rotation.z += this.rotationOverLifetime.z.getValue(life);
|
|
18333
|
+
}
|
|
18334
|
+
}
|
|
18335
|
+
} else {
|
|
18336
|
+
// Adjust rotation based on the specified lifetime components
|
|
18337
|
+
if (this.rotationOverLifetime.x) {
|
|
18338
|
+
if (_instanceof1(this.rotationOverLifetime.x, RandomValue)) {
|
|
18339
|
+
rotation.x += this.rotationOverLifetime.x.getIntegrateValue(0.0, life, aSeed) * duration;
|
|
18340
|
+
} else {
|
|
18341
|
+
rotation.x += this.rotationOverLifetime.x.getIntegrateValue(0.0, life, duration) * duration;
|
|
18342
|
+
}
|
|
18343
|
+
}
|
|
18344
|
+
if (this.rotationOverLifetime.y) {
|
|
18345
|
+
if (_instanceof1(this.rotationOverLifetime.y, RandomValue)) {
|
|
18346
|
+
rotation.y += this.rotationOverLifetime.y.getIntegrateValue(0.0, life, aSeed) * duration;
|
|
18347
|
+
} else {
|
|
18348
|
+
rotation.y += this.rotationOverLifetime.y.getIntegrateValue(0.0, life, duration) * duration;
|
|
18349
|
+
}
|
|
18350
|
+
}
|
|
18351
|
+
if (this.rotationOverLifetime.z) {
|
|
18352
|
+
if (_instanceof1(this.rotationOverLifetime.z, RandomValue)) {
|
|
18353
|
+
rotation.z += this.rotationOverLifetime.z.getIntegrateValue(0.0, life, aSeed) * duration;
|
|
18354
|
+
} else {
|
|
18355
|
+
rotation.z += this.rotationOverLifetime.z.getIntegrateValue(0.0, life, duration) * duration;
|
|
18356
|
+
}
|
|
18357
|
+
}
|
|
18358
|
+
}
|
|
18359
|
+
// If the rotation vector is zero, return the identity matrix
|
|
18360
|
+
if (rotation.dot(rotation) === 0.0) {
|
|
18361
|
+
aRotationMatrix.identity();
|
|
18362
|
+
}
|
|
18363
|
+
var d2r = Math.PI / 180;
|
|
18364
|
+
var rotationXD2r = rotation.x * d2r;
|
|
18365
|
+
var rotationYD2r = rotation.y * d2r;
|
|
18366
|
+
var rotationZD2r = rotation.z * d2r;
|
|
18367
|
+
var sinRX = Math.sin(rotationXD2r);
|
|
18368
|
+
var sinRY = Math.sin(rotationYD2r);
|
|
18369
|
+
var sinRZ = Math.sin(rotationZD2r);
|
|
18370
|
+
var cosRX = Math.cos(rotationXD2r);
|
|
18371
|
+
var cosRY = Math.cos(rotationYD2r);
|
|
18372
|
+
var cosRZ = Math.cos(rotationZD2r);
|
|
18373
|
+
// rotZ * rotY * rotX
|
|
18374
|
+
aRotationMatrix.set(cosRZ, -sinRZ, 0., sinRZ, cosRZ, 0., 0., 0., 1.); //rotZ
|
|
18375
|
+
aRotationMatrix.multiply(this.tempMatrix3.set(cosRY, 0., sinRY, 0., 1., 0., -sinRY, 0, cosRY)); //rotY
|
|
18376
|
+
aRotationMatrix.multiply(this.tempMatrix3.set(1., 0., 0., 0, cosRX, -sinRX, 0., sinRX, cosRX)); //rotX
|
|
18377
|
+
var aRotationOffset = i * 9;
|
|
18378
|
+
var matrixArray = aRotationMatrix.elements;
|
|
18379
|
+
aRotationArray.set(matrixArray, aRotationOffset);
|
|
18380
|
+
if (i + 4 <= vertexCount) {
|
|
18381
|
+
aRotationArray.set(matrixArray, aRotationOffset + 9);
|
|
18382
|
+
aRotationArray.set(matrixArray, aRotationOffset + 18);
|
|
18383
|
+
aRotationArray.set(matrixArray, aRotationOffset + 27);
|
|
18384
|
+
}
|
|
18385
|
+
}
|
|
18386
|
+
this.geometry.setAttributeData("aRotation0", aRotationArray);
|
|
18387
|
+
};
|
|
18388
|
+
_proto.applyLinearMove = function applyLinearMove(vertexCount, deltaTime) {
|
|
18389
|
+
var aLinearMoveArray = this.geometry.getAttributeData("aLinearMove");
|
|
18390
|
+
var aOffsetArray = this.geometry.getAttributeData("aOffset");
|
|
18391
|
+
var aSeedArray = this.geometry.getAttributeData("aSeed"); // float
|
|
18392
|
+
var localTime = this.time;
|
|
18393
|
+
if (aLinearMoveArray.length < vertexCount * 3) {
|
|
18394
|
+
aLinearMoveArray = this.expandArray(aLinearMoveArray, vertexCount * 3);
|
|
18395
|
+
}
|
|
18396
|
+
var linearMove = this.cachedLinearMove;
|
|
18397
|
+
if (this.linearVelOverLifetime && this.linearVelOverLifetime.enabled) {
|
|
18398
|
+
for(var i = 0; i < vertexCount; i += 4){
|
|
18399
|
+
var time = localTime - aOffsetArray[i * 4 + 2];
|
|
18400
|
+
var duration = aOffsetArray[i * 4 + 3];
|
|
18401
|
+
// const life = math.clamp(time / duration, 0.0, 1.0);
|
|
18402
|
+
var lifetime = time / duration;
|
|
18403
|
+
var aSeed = aSeedArray[i * 8 + 3];
|
|
18404
|
+
linearMove.setZero();
|
|
18405
|
+
if (this.linearVelOverLifetime.asMovement) {
|
|
18406
|
+
if (this.linearVelOverLifetime.x) {
|
|
18407
|
+
if (_instanceof1(this.linearVelOverLifetime.x, RandomValue)) {
|
|
18408
|
+
linearMove.x = this.linearVelOverLifetime.x.getValue(lifetime, aSeed);
|
|
18409
|
+
} else {
|
|
18410
|
+
linearMove.x = this.linearVelOverLifetime.x.getValue(lifetime);
|
|
18411
|
+
}
|
|
18412
|
+
}
|
|
18413
|
+
if (this.linearVelOverLifetime.y) {
|
|
18414
|
+
if (_instanceof1(this.linearVelOverLifetime.y, RandomValue)) {
|
|
18415
|
+
linearMove.y = this.linearVelOverLifetime.y.getValue(lifetime, aSeed);
|
|
18416
|
+
} else {
|
|
18417
|
+
linearMove.y = this.linearVelOverLifetime.y.getValue(lifetime);
|
|
18418
|
+
}
|
|
18419
|
+
}
|
|
18420
|
+
if (this.linearVelOverLifetime.z) {
|
|
18421
|
+
if (_instanceof1(this.linearVelOverLifetime.z, RandomValue)) {
|
|
18422
|
+
linearMove.z = this.linearVelOverLifetime.z.getValue(lifetime, aSeed);
|
|
18423
|
+
} else {
|
|
18424
|
+
linearMove.z = this.linearVelOverLifetime.z.getValue(lifetime);
|
|
18425
|
+
}
|
|
18426
|
+
}
|
|
18427
|
+
} else {
|
|
18428
|
+
// Adjust rotation based on the specified lifetime components
|
|
18429
|
+
if (this.linearVelOverLifetime.x) {
|
|
18430
|
+
if (_instanceof1(this.linearVelOverLifetime.x, RandomValue)) {
|
|
18431
|
+
linearMove.x = this.linearVelOverLifetime.x.getIntegrateValue(0.0, time, aSeed);
|
|
18432
|
+
} else {
|
|
18433
|
+
linearMove.x = this.linearVelOverLifetime.x.getIntegrateValue(0.0, time, duration);
|
|
18434
|
+
}
|
|
18435
|
+
}
|
|
18436
|
+
if (this.linearVelOverLifetime.y) {
|
|
18437
|
+
if (_instanceof1(this.linearVelOverLifetime.y, RandomValue)) {
|
|
18438
|
+
linearMove.y = this.linearVelOverLifetime.y.getIntegrateValue(0.0, time, aSeed);
|
|
18439
|
+
} else {
|
|
18440
|
+
linearMove.y = this.linearVelOverLifetime.y.getIntegrateValue(0.0, time, duration);
|
|
18441
|
+
}
|
|
18442
|
+
}
|
|
18443
|
+
if (this.linearVelOverLifetime.z) {
|
|
18444
|
+
if (_instanceof1(this.linearVelOverLifetime.z, RandomValue)) {
|
|
18445
|
+
linearMove.z = this.linearVelOverLifetime.z.getIntegrateValue(0.0, time, aSeed);
|
|
18446
|
+
} else {
|
|
18447
|
+
linearMove.z = this.linearVelOverLifetime.z.getIntegrateValue(0.0, time, duration);
|
|
18448
|
+
}
|
|
18449
|
+
}
|
|
18450
|
+
}
|
|
18451
|
+
var aLinearMoveOffset = i * 3;
|
|
18452
|
+
aLinearMoveArray[aLinearMoveOffset] = linearMove.x;
|
|
18453
|
+
aLinearMoveArray[aLinearMoveOffset + 1] = linearMove.y;
|
|
18454
|
+
aLinearMoveArray[aLinearMoveOffset + 2] = linearMove.z;
|
|
18455
|
+
aLinearMoveArray[aLinearMoveOffset + 3] = linearMove.x;
|
|
18456
|
+
aLinearMoveArray[aLinearMoveOffset + 4] = linearMove.y;
|
|
18457
|
+
aLinearMoveArray[aLinearMoveOffset + 5] = linearMove.z;
|
|
18458
|
+
aLinearMoveArray[aLinearMoveOffset + 6] = linearMove.x;
|
|
18459
|
+
aLinearMoveArray[aLinearMoveOffset + 7] = linearMove.y;
|
|
18460
|
+
aLinearMoveArray[aLinearMoveOffset + 8] = linearMove.z;
|
|
18461
|
+
aLinearMoveArray[aLinearMoveOffset + 9] = linearMove.x;
|
|
18462
|
+
aLinearMoveArray[aLinearMoveOffset + 10] = linearMove.y;
|
|
18463
|
+
aLinearMoveArray[aLinearMoveOffset + 11] = linearMove.z;
|
|
18464
|
+
}
|
|
18465
|
+
}
|
|
18466
|
+
this.geometry.setAttributeData("aLinearMove", aLinearMoveArray);
|
|
18467
|
+
};
|
|
18436
18468
|
_proto.expandArray = function expandArray(array, newSize) {
|
|
18437
18469
|
var newArr = new Float32Array(newSize);
|
|
18438
18470
|
newArr.set(array);
|
|
@@ -19069,7 +19101,13 @@ exports.TransformPlayableAsset = __decorate([
|
|
|
19069
19101
|
return Playable.apply(this, arguments);
|
|
19070
19102
|
}
|
|
19071
19103
|
var _proto = ActivationPlayable.prototype;
|
|
19072
|
-
_proto.processFrame = function processFrame(context) {
|
|
19104
|
+
_proto.processFrame = function processFrame(context) {
|
|
19105
|
+
var vfxItem = context.output.getUserData();
|
|
19106
|
+
if (!_instanceof1(vfxItem, exports.VFXItem)) {
|
|
19107
|
+
return;
|
|
19108
|
+
}
|
|
19109
|
+
vfxItem.time = this.time;
|
|
19110
|
+
};
|
|
19073
19111
|
return ActivationPlayable;
|
|
19074
19112
|
}(Playable);
|
|
19075
19113
|
exports.ActivationPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
@@ -19222,7 +19260,7 @@ var AnimationClipPlayable = /*#__PURE__*/ function(Playable) {
|
|
|
19222
19260
|
_proto.toLocalTime = function toLocalTime(time) {
|
|
19223
19261
|
var localTime = time - this.start;
|
|
19224
19262
|
var duration = this.duration;
|
|
19225
|
-
if (localTime - duration > 0
|
|
19263
|
+
if (localTime - duration > 0) {
|
|
19226
19264
|
if (this.endBehavior === EndBehavior.restart) {
|
|
19227
19265
|
localTime = localTime % duration;
|
|
19228
19266
|
} else if (this.endBehavior === EndBehavior.freeze) {
|
|
@@ -19351,7 +19389,7 @@ var RuntimeClip = /*#__PURE__*/ function() {
|
|
|
19351
19389
|
var ended = false;
|
|
19352
19390
|
var started = false;
|
|
19353
19391
|
var boundObject = this.track.binding;
|
|
19354
|
-
if (localTime
|
|
19392
|
+
if (localTime >= clip.start + clip.duration && clip.endBehavior === EndBehavior.destroy) {
|
|
19355
19393
|
if (_instanceof1(boundObject, exports.VFXItem) && exports.VFXItem.isParticle(boundObject) && this.particleSystem && !this.particleSystem.destroyed) {
|
|
19356
19394
|
weight = 1.0;
|
|
19357
19395
|
} else {
|
|
@@ -20581,6 +20619,12 @@ exports.EffectComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
20581
20619
|
_proto.onStart = function onStart() {
|
|
20582
20620
|
this.item.getHitTestParams = this.getHitTestParams;
|
|
20583
20621
|
};
|
|
20622
|
+
_proto.onUpdate = function onUpdate(dt) {
|
|
20623
|
+
var time = this.item.time;
|
|
20624
|
+
var _this_material_getVector4;
|
|
20625
|
+
var _Time = (_this_material_getVector4 = this.material.getVector4("_Time")) != null ? _this_material_getVector4 : new Vector4();
|
|
20626
|
+
this.material.setVector4("_Time", _Time.set(time / 20, time, time * 2, time * 3));
|
|
20627
|
+
};
|
|
20584
20628
|
_proto.render = function render(renderer) {
|
|
20585
20629
|
if (renderer.renderingData.currentFrame.globalUniforms) {
|
|
20586
20630
|
renderer.setGlobalMatrix("effects_ObjectToWorld", this.transform.getWorldMatrix());
|
|
@@ -20834,6 +20878,9 @@ exports.VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
20834
20878
|
* 元素的变换包含位置、旋转、缩放。
|
|
20835
20879
|
*/ _this.transform = new Transform();
|
|
20836
20880
|
/**
|
|
20881
|
+
* 元素动画的当前时间
|
|
20882
|
+
*/ _this.time = 0;
|
|
20883
|
+
/**
|
|
20837
20884
|
* 元素动画的持续时间
|
|
20838
20885
|
*/ _this.duration = 0;
|
|
20839
20886
|
/**
|
|
@@ -21166,6 +21213,7 @@ exports.VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
21166
21213
|
var component = _step.value;
|
|
21167
21214
|
if (component.enabled && !component.isStartCalled) {
|
|
21168
21215
|
component.onStart();
|
|
21216
|
+
component.isStartCalled = true;
|
|
21169
21217
|
}
|
|
21170
21218
|
}
|
|
21171
21219
|
for(var _iterator1 = _create_for_of_iterator_helper_loose(this.components), _step1; !(_step1 = _iterator1()).done;){
|
|
@@ -28088,7 +28136,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem, true);
|
|
|
28088
28136
|
registerPlugin("particle", ParticleLoader, exports.VFXItem, true);
|
|
28089
28137
|
registerPlugin("cal", CalculateLoader, exports.VFXItem, true);
|
|
28090
28138
|
registerPlugin("interact", InteractLoader, exports.VFXItem, true);
|
|
28091
|
-
var version = "2.1.0-alpha.
|
|
28139
|
+
var version = "2.1.0-alpha.4";
|
|
28092
28140
|
logger.info("Core version: " + version + ".");
|
|
28093
28141
|
|
|
28094
28142
|
exports.AbstractPlugin = AbstractPlugin;
|