@galacean/effects-threejs 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/index.js +292 -244
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/dist/index.mjs +292 -244
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Description: Galacean Effects runtime threejs plugin 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
|
import * as THREE from 'three';
|
|
@@ -4253,6 +4253,9 @@ var MaterialBlending;
|
|
|
4253
4253
|
/**
|
|
4254
4254
|
* 自发光
|
|
4255
4255
|
*/ RenderMode3D["emissive"] = "emissive";
|
|
4256
|
+
/**
|
|
4257
|
+
* 漫反射
|
|
4258
|
+
*/ RenderMode3D["diffuse"] = "diffuse";
|
|
4256
4259
|
})(RenderMode3D || (RenderMode3D = {}));
|
|
4257
4260
|
|
|
4258
4261
|
var TextOverflow;
|
|
@@ -10305,10 +10308,11 @@ var BezierCurve = /*#__PURE__*/ function(ValueGetter) {
|
|
|
10305
10308
|
timeEnd: Number(e.x)
|
|
10306
10309
|
};
|
|
10307
10310
|
}
|
|
10311
|
+
this.keyTimeData = Object.keys(this.curveMap);
|
|
10308
10312
|
};
|
|
10309
10313
|
_proto.getValue = function getValue(time) {
|
|
10310
10314
|
var result = 0;
|
|
10311
|
-
var keyTimeData =
|
|
10315
|
+
var keyTimeData = this.keyTimeData;
|
|
10312
10316
|
var keyTimeStart = this.curveMap[keyTimeData[0]].timeStart;
|
|
10313
10317
|
var keyTimeEnd = this.curveMap[keyTimeData[keyTimeData.length - 1]].timeEnd;
|
|
10314
10318
|
// const keyTimeStart = Number(keyTimeData[0].split('&')[0]);
|
|
@@ -13603,25 +13607,25 @@ function _assert_this_initialized(self) {
|
|
|
13603
13607
|
}
|
|
13604
13608
|
var _proto = PlayableGraph.prototype;
|
|
13605
13609
|
_proto.evaluate = function evaluate(dt) {
|
|
13606
|
-
// 初始化节点状态
|
|
13607
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(this.playables), _step; !(_step = _iterator()).done;){
|
|
13608
|
-
var playable = _step.value;
|
|
13609
|
-
this.updatePlayableTime(playable, dt);
|
|
13610
|
-
}
|
|
13611
13610
|
// 初始化输出节点状态
|
|
13612
|
-
for(var
|
|
13613
|
-
var playableOutput =
|
|
13611
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(this.playableOutputs), _step; !(_step = _iterator()).done;){
|
|
13612
|
+
var playableOutput = _step.value;
|
|
13614
13613
|
playableOutput.context.deltaTime = dt;
|
|
13615
13614
|
}
|
|
13616
13615
|
// 执行生命周期函数
|
|
13617
|
-
for(var
|
|
13618
|
-
var playableOutput1 =
|
|
13616
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(this.playableOutputs), _step1; !(_step1 = _iterator1()).done;){
|
|
13617
|
+
var playableOutput1 = _step1.value;
|
|
13619
13618
|
this.prepareFrameWithRoot(playableOutput1);
|
|
13620
13619
|
}
|
|
13621
|
-
for(var
|
|
13622
|
-
var playableOutput2 =
|
|
13620
|
+
for(var _iterator2 = _create_for_of_iterator_helper_loose(this.playableOutputs), _step2; !(_step2 = _iterator2()).done;){
|
|
13621
|
+
var playableOutput2 = _step2.value;
|
|
13623
13622
|
this.processFrameWithRoot(playableOutput2);
|
|
13624
13623
|
}
|
|
13624
|
+
// 更新节点时间
|
|
13625
|
+
for(var _iterator3 = _create_for_of_iterator_helper_loose(this.playables), _step3; !(_step3 = _iterator3()).done;){
|
|
13626
|
+
var playable = _step3.value;
|
|
13627
|
+
this.updatePlayableTime(playable, dt);
|
|
13628
|
+
}
|
|
13625
13629
|
};
|
|
13626
13630
|
_proto.connect = function connect(source, sourceOutputPort, destination, destinationInputPort) {
|
|
13627
13631
|
destination.connectInput(destinationInputPort, source, sourceOutputPort);
|
|
@@ -13644,11 +13648,7 @@ function _assert_this_initialized(self) {
|
|
|
13644
13648
|
if (playable.getPlayState() !== 0) {
|
|
13645
13649
|
return;
|
|
13646
13650
|
}
|
|
13647
|
-
|
|
13648
|
-
playable.overrideTimeNextEvaluation = false;
|
|
13649
|
-
} else {
|
|
13650
|
-
playable.setTime(playable.getTime() + deltaTime);
|
|
13651
|
-
}
|
|
13651
|
+
playable.setTime(playable.getTime() + deltaTime);
|
|
13652
13652
|
};
|
|
13653
13653
|
return PlayableGraph;
|
|
13654
13654
|
}();
|
|
@@ -13660,7 +13660,6 @@ function _assert_this_initialized(self) {
|
|
|
13660
13660
|
if (inputCount === void 0) inputCount = 0;
|
|
13661
13661
|
this.onPlayablePlayFlag = true;
|
|
13662
13662
|
this.onPlayablePauseFlag = false;
|
|
13663
|
-
this.overrideTimeNextEvaluation = false;
|
|
13664
13663
|
this.destroyed = false;
|
|
13665
13664
|
this.inputs = [];
|
|
13666
13665
|
this.inputOuputPorts = [];
|
|
@@ -13749,7 +13748,6 @@ function _assert_this_initialized(self) {
|
|
|
13749
13748
|
};
|
|
13750
13749
|
_proto.setTime = function setTime(time) {
|
|
13751
13750
|
this.time = time;
|
|
13752
|
-
this.overrideTimeNextEvaluation = true;
|
|
13753
13751
|
};
|
|
13754
13752
|
_proto.getTime = function getTime() {
|
|
13755
13753
|
return this.time;
|
|
@@ -16552,8 +16550,9 @@ function getTrailMeshShader(trails, particleMaxCount, name, gpuCapability, env)
|
|
|
16552
16550
|
};
|
|
16553
16551
|
_proto.onUpdate = function onUpdate(dt) {
|
|
16554
16552
|
var time = this.particleMesh.time;
|
|
16555
|
-
|
|
16556
|
-
this.particleMesh.
|
|
16553
|
+
var _this_particleMesh_mesh_material_getVector4;
|
|
16554
|
+
var uParams = (_this_particleMesh_mesh_material_getVector4 = this.particleMesh.mesh.material.getVector4("uParams")) != null ? _this_particleMesh_mesh_material_getVector4 : new Vector4();
|
|
16555
|
+
this.particleMesh.mesh.material.setVector4("uParams", uParams.set(time, this.item.duration, 0, 0));
|
|
16557
16556
|
};
|
|
16558
16557
|
_proto.render = function render(renderer) {
|
|
16559
16558
|
for(var _iterator = _create_for_of_iterator_helper_loose(this.meshes), _step; !(_step = _iterator()).done;){
|
|
@@ -16568,7 +16567,7 @@ function getTrailMeshShader(trails, particleMaxCount, name, gpuCapability, env)
|
|
|
16568
16567
|
};
|
|
16569
16568
|
_proto.updateTime = function updateTime(now, delta) {
|
|
16570
16569
|
this.particleMesh.time = now;
|
|
16571
|
-
|
|
16570
|
+
this.particleMesh.onUpdate(delta);
|
|
16572
16571
|
if (this.trailMesh) {
|
|
16573
16572
|
this.trailMesh.time = now;
|
|
16574
16573
|
this.trailMesh.onUpdate(delta);
|
|
@@ -16862,7 +16861,7 @@ var ParticleSystem = /*#__PURE__*/ function(Component) {
|
|
|
16862
16861
|
break;
|
|
16863
16862
|
}
|
|
16864
16863
|
var burst = bursts[j];
|
|
16865
|
-
var opts = burst.getGeneratorOptions(timePassed, lifetime);
|
|
16864
|
+
var opts = !burst.disabled && burst.getGeneratorOptions(timePassed, lifetime);
|
|
16866
16865
|
if (opts) {
|
|
16867
16866
|
var originVec = [
|
|
16868
16867
|
0,
|
|
@@ -16871,6 +16870,9 @@ var ParticleSystem = /*#__PURE__*/ function(Component) {
|
|
|
16871
16870
|
];
|
|
16872
16871
|
var offsets = emission.burstOffsets[j];
|
|
16873
16872
|
var burstOffset = offsets && offsets[opts.cycleIndex] || originVec;
|
|
16873
|
+
if (burst.once) {
|
|
16874
|
+
this.removeBurst(j);
|
|
16875
|
+
}
|
|
16874
16876
|
for(var i1 = 0; i1 < opts.count && cursor < maxCount; i1++){
|
|
16875
16877
|
var _p_transform;
|
|
16876
16878
|
if (shouldSkipGenerate()) {
|
|
@@ -17675,12 +17677,10 @@ var particleUniformTypeMap = {
|
|
|
17675
17677
|
var ParticleMesh = /*#__PURE__*/ function() {
|
|
17676
17678
|
function ParticleMesh(engine, props) {
|
|
17677
17679
|
this.particleCount = 0;
|
|
17678
|
-
this.cachedVelocity = new Vector3();
|
|
17679
17680
|
this.cachedRotationVector3 = new Vector3();
|
|
17680
17681
|
this.cachedRotationMatrix = new Matrix3();
|
|
17681
17682
|
this.cachedLinearMove = new Vector3();
|
|
17682
17683
|
this.tempMatrix3 = new Matrix3();
|
|
17683
|
-
this.tempVector3 = new Vector3();
|
|
17684
17684
|
this.VERT_MAX_KEY_FRAME_COUNT = 0;
|
|
17685
17685
|
var _engine_renderer;
|
|
17686
17686
|
var env = ((_engine_renderer = engine.renderer) != null ? _engine_renderer : {}).env;
|
|
@@ -18076,72 +18076,10 @@ var ParticleMesh = /*#__PURE__*/ function() {
|
|
|
18076
18076
|
};
|
|
18077
18077
|
_proto.onUpdate = function onUpdate(dt) {
|
|
18078
18078
|
var aPosArray = this.geometry.getAttributeData("aPos"); // vector3
|
|
18079
|
-
var
|
|
18080
|
-
|
|
18081
|
-
|
|
18082
|
-
|
|
18083
|
-
// const uParams = this.mesh.material.getVector4('uParams');
|
|
18084
|
-
// if (!uParams) {
|
|
18085
|
-
// return;
|
|
18086
|
-
// }
|
|
18087
|
-
var localTime = this.time;
|
|
18088
|
-
var particleCount = Math.ceil(aPosArray.length / 12);
|
|
18089
|
-
// calculate particle translation
|
|
18090
|
-
var aTranslationArray = this.geometry.getAttributeData("aTranslation");
|
|
18091
|
-
if (aTranslationArray.length < particleCount * 3) {
|
|
18092
|
-
aTranslationArray = this.expandArray(aTranslationArray, particleCount * 3);
|
|
18093
|
-
}
|
|
18094
|
-
var velocity = this.cachedVelocity;
|
|
18095
|
-
for(var i = 0; i < particleCount; i++){
|
|
18096
|
-
var velOffset = i * 12 + 3;
|
|
18097
|
-
velocity.set(aVelArray[velOffset], aVelArray[velOffset + 1], aVelArray[velOffset + 2]);
|
|
18098
|
-
this.calculateTranslation(velocity, aOffsetArray[i * 4 + 2], localTime, aOffsetArray[i * 4 + 3]);
|
|
18099
|
-
var aTranslationOffset = i * 3;
|
|
18100
|
-
if (aOffsetArray[i * 4 + 2] < localTime) {
|
|
18101
|
-
var translation = velocity.multiply(dt / 1000);
|
|
18102
|
-
aTranslationArray[aTranslationOffset] += translation.x;
|
|
18103
|
-
aTranslationArray[aTranslationOffset + 1] += translation.y;
|
|
18104
|
-
aTranslationArray[aTranslationOffset + 2] += translation.z;
|
|
18105
|
-
}
|
|
18106
|
-
}
|
|
18107
|
-
this.geometry.setAttributeData("aTranslation", aTranslationArray);
|
|
18108
|
-
// calculate particle rotation
|
|
18109
|
-
var aRotationArray = this.geometry.getAttributeData("aRotation0");
|
|
18110
|
-
if (aRotationArray.length < particleCount * 9) {
|
|
18111
|
-
aRotationArray = this.expandArray(aRotationArray, particleCount * 9);
|
|
18112
|
-
}
|
|
18113
|
-
for(var i1 = 0; i1 < particleCount; i1++){
|
|
18114
|
-
var time = localTime - aOffsetArray[i1 * 4 + 2];
|
|
18115
|
-
var duration = aOffsetArray[i1 * 4 + 3];
|
|
18116
|
-
var life = clamp$1(time / duration, 0.0, 1.0);
|
|
18117
|
-
var aRotOffset = i1 * 8;
|
|
18118
|
-
var aRot = this.cachedRotationVector3.set(aRotArray[aRotOffset], aRotArray[aRotOffset + 1], aRotArray[aRotOffset + 2]);
|
|
18119
|
-
var aSeed = aSeedArray[i1 * 8 + 3];
|
|
18120
|
-
var aRotation = this.transformFromRotation(aRot, life, duration, aSeed, this.cachedRotationMatrix);
|
|
18121
|
-
var aRotationOffset = i1 * 9;
|
|
18122
|
-
var matrixArray = aRotation.toArray();
|
|
18123
|
-
aRotationArray.set(matrixArray, aRotationOffset);
|
|
18124
|
-
}
|
|
18125
|
-
this.geometry.setAttributeData("aRotation0", aRotationArray);
|
|
18126
|
-
// calculate linear movement
|
|
18127
|
-
var aLinearMoveArray = this.geometry.getAttributeData("aLinearMove");
|
|
18128
|
-
if (aLinearMoveArray.length < particleCount * 3) {
|
|
18129
|
-
aLinearMoveArray = this.expandArray(aLinearMoveArray, particleCount * 3);
|
|
18130
|
-
}
|
|
18131
|
-
var linearMove = this.cachedLinearMove;
|
|
18132
|
-
for(var i2 = 0; i2 < particleCount; i2++){
|
|
18133
|
-
var time1 = localTime - aOffsetArray[i2 * 4 + 2];
|
|
18134
|
-
var duration1 = aOffsetArray[i2 * 4 + 3];
|
|
18135
|
-
// const life = math.clamp(time / duration, 0.0, 1.0);
|
|
18136
|
-
var aSeed1 = aSeedArray[i2 * 8 + 3];
|
|
18137
|
-
linearMove.setZero();
|
|
18138
|
-
this.calLinearMov(time1, duration1, aSeed1, linearMove);
|
|
18139
|
-
var aLinearMoveOffset = i2 * 3;
|
|
18140
|
-
aLinearMoveArray[aLinearMoveOffset] = linearMove.x;
|
|
18141
|
-
aLinearMoveArray[aLinearMoveOffset + 1] = linearMove.y;
|
|
18142
|
-
aLinearMoveArray[aLinearMoveOffset + 2] = linearMove.z;
|
|
18143
|
-
}
|
|
18144
|
-
this.geometry.setAttributeData("aLinearMove", aLinearMoveArray);
|
|
18079
|
+
var vertexCount = Math.ceil(aPosArray.length / 12);
|
|
18080
|
+
this.applyTranslation(vertexCount, dt);
|
|
18081
|
+
this.applyRotation(vertexCount, dt);
|
|
18082
|
+
this.applyLinearMove(vertexCount, dt);
|
|
18145
18083
|
};
|
|
18146
18084
|
_proto.minusTime = function minusTime(time) {
|
|
18147
18085
|
var aOffset = this.geometry.getAttributeData("aOffset");
|
|
@@ -18151,153 +18089,6 @@ var ParticleMesh = /*#__PURE__*/ function() {
|
|
|
18151
18089
|
this.geometry.setAttributeData("aOffset", aOffset);
|
|
18152
18090
|
this.time -= time;
|
|
18153
18091
|
};
|
|
18154
|
-
_proto.calculateTranslation = function calculateTranslation(velocity, t0, t1, duration) {
|
|
18155
|
-
var uAcceleration = this.mesh.material.getVector4("uAcceleration");
|
|
18156
|
-
var uGravityModifierValue = this.mesh.material.getVector4("uGravityModifierValue");
|
|
18157
|
-
if (!uAcceleration || !uGravityModifierValue) {
|
|
18158
|
-
return velocity;
|
|
18159
|
-
}
|
|
18160
|
-
var dt = t1 - t0; // 相对delay的时间
|
|
18161
|
-
var d = this.gravityModifier.getIntegrateValue(0, dt, duration);
|
|
18162
|
-
var acc = this.tempVector3.set(uAcceleration.x * d, uAcceleration.y * d, uAcceleration.z * d);
|
|
18163
|
-
// speedIntegrate = speedOverLifetime.getIntegrateValue(0, time, duration);
|
|
18164
|
-
if (this.speedOverLifetime) {
|
|
18165
|
-
// dt / dur 归一化
|
|
18166
|
-
var speed = this.speedOverLifetime.getValue(dt / duration);
|
|
18167
|
-
return velocity.multiply(speed).add(acc);
|
|
18168
|
-
}
|
|
18169
|
-
return velocity.add(acc);
|
|
18170
|
-
};
|
|
18171
|
-
_proto.transformFromRotation = function transformFromRotation(rot, life, dur, aSeed, result) {
|
|
18172
|
-
var rotation = rot;
|
|
18173
|
-
if (!this.rotationOverLifetime) {
|
|
18174
|
-
return result.setZero();
|
|
18175
|
-
}
|
|
18176
|
-
if (this.rotationOverLifetime.asRotation) {
|
|
18177
|
-
// Adjust rotation based on the specified lifetime components
|
|
18178
|
-
if (this.rotationOverLifetime.x) {
|
|
18179
|
-
if (_instanceof1(this.rotationOverLifetime.x, RandomValue)) {
|
|
18180
|
-
rotation.x += this.rotationOverLifetime.x.getValue(life, aSeed);
|
|
18181
|
-
} else {
|
|
18182
|
-
rotation.x += this.rotationOverLifetime.x.getValue(life);
|
|
18183
|
-
}
|
|
18184
|
-
}
|
|
18185
|
-
if (this.rotationOverLifetime.y) {
|
|
18186
|
-
if (_instanceof1(this.rotationOverLifetime.y, RandomValue)) {
|
|
18187
|
-
rotation.y += this.rotationOverLifetime.y.getValue(life, aSeed);
|
|
18188
|
-
} else {
|
|
18189
|
-
rotation.y += this.rotationOverLifetime.y.getValue(life);
|
|
18190
|
-
}
|
|
18191
|
-
}
|
|
18192
|
-
if (this.rotationOverLifetime.z) {
|
|
18193
|
-
if (_instanceof1(this.rotationOverLifetime.z, RandomValue)) {
|
|
18194
|
-
rotation.z += this.rotationOverLifetime.z.getValue(life, aSeed);
|
|
18195
|
-
} else {
|
|
18196
|
-
rotation.z += this.rotationOverLifetime.z.getValue(life);
|
|
18197
|
-
}
|
|
18198
|
-
}
|
|
18199
|
-
} else {
|
|
18200
|
-
// Adjust rotation based on the specified lifetime components
|
|
18201
|
-
if (this.rotationOverLifetime.x) {
|
|
18202
|
-
if (_instanceof1(this.rotationOverLifetime.x, RandomValue)) {
|
|
18203
|
-
rotation.x += this.rotationOverLifetime.x.getIntegrateValue(0.0, life, aSeed) * dur;
|
|
18204
|
-
} else {
|
|
18205
|
-
rotation.x += this.rotationOverLifetime.x.getIntegrateValue(0.0, life, dur) * dur;
|
|
18206
|
-
}
|
|
18207
|
-
}
|
|
18208
|
-
if (this.rotationOverLifetime.y) {
|
|
18209
|
-
if (_instanceof1(this.rotationOverLifetime.y, RandomValue)) {
|
|
18210
|
-
rotation.y += this.rotationOverLifetime.y.getIntegrateValue(0.0, life, aSeed) * dur;
|
|
18211
|
-
} else {
|
|
18212
|
-
rotation.y += this.rotationOverLifetime.y.getIntegrateValue(0.0, life, dur) * dur;
|
|
18213
|
-
}
|
|
18214
|
-
}
|
|
18215
|
-
if (this.rotationOverLifetime.z) {
|
|
18216
|
-
if (_instanceof1(this.rotationOverLifetime.z, RandomValue)) {
|
|
18217
|
-
rotation.z += this.rotationOverLifetime.z.getIntegrateValue(0.0, life, aSeed) * dur;
|
|
18218
|
-
} else {
|
|
18219
|
-
rotation.z += this.rotationOverLifetime.z.getIntegrateValue(0.0, life, dur) * dur;
|
|
18220
|
-
}
|
|
18221
|
-
}
|
|
18222
|
-
}
|
|
18223
|
-
// If the rotation vector is zero, return the identity matrix
|
|
18224
|
-
if (rotation.dot(rotation) === 0.0) {
|
|
18225
|
-
return result.identity();
|
|
18226
|
-
}
|
|
18227
|
-
// Return the rotation matrix derived from the rotation vector
|
|
18228
|
-
return this.mat3FromRotation(rotation, result);
|
|
18229
|
-
};
|
|
18230
|
-
_proto.mat3FromRotation = function mat3FromRotation(rotation, result) {
|
|
18231
|
-
var d2r = Math.PI / 180;
|
|
18232
|
-
var rotationXD2r = rotation.x * d2r;
|
|
18233
|
-
var rotationYD2r = rotation.y * d2r;
|
|
18234
|
-
var rotationZD2r = rotation.z * d2r;
|
|
18235
|
-
var sinRX = Math.sin(rotationXD2r);
|
|
18236
|
-
var sinRY = Math.sin(rotationYD2r);
|
|
18237
|
-
var sinRZ = Math.sin(rotationZD2r);
|
|
18238
|
-
var cosRX = Math.cos(rotationXD2r);
|
|
18239
|
-
var cosRY = Math.cos(rotationYD2r);
|
|
18240
|
-
var cosRZ = Math.cos(rotationZD2r);
|
|
18241
|
-
// rotZ * rotY * rotX
|
|
18242
|
-
result.set(cosRZ, -sinRZ, 0., sinRZ, cosRZ, 0., 0., 0., 1.); //rotZ
|
|
18243
|
-
result.multiply(this.tempMatrix3.set(cosRY, 0., sinRY, 0., 1., 0., -sinRY, 0, cosRY)); //rotY
|
|
18244
|
-
result.multiply(this.tempMatrix3.set(1., 0., 0., 0, cosRX, -sinRX, 0., sinRX, cosRX)); //rotX
|
|
18245
|
-
return result;
|
|
18246
|
-
};
|
|
18247
|
-
_proto.calLinearMov = function calLinearMov(time, duration, aSeed, result) {
|
|
18248
|
-
var mov = result;
|
|
18249
|
-
var lifetime = time / duration;
|
|
18250
|
-
if (!this.linearVelOverLifetime || !this.linearVelOverLifetime.enabled) {
|
|
18251
|
-
return mov;
|
|
18252
|
-
}
|
|
18253
|
-
if (this.linearVelOverLifetime.asMovement) {
|
|
18254
|
-
if (this.linearVelOverLifetime.x) {
|
|
18255
|
-
if (_instanceof1(this.linearVelOverLifetime.x, RandomValue)) {
|
|
18256
|
-
mov.x = this.linearVelOverLifetime.x.getValue(lifetime, aSeed);
|
|
18257
|
-
} else {
|
|
18258
|
-
mov.x = this.linearVelOverLifetime.x.getValue(lifetime);
|
|
18259
|
-
}
|
|
18260
|
-
}
|
|
18261
|
-
if (this.linearVelOverLifetime.y) {
|
|
18262
|
-
if (_instanceof1(this.linearVelOverLifetime.y, RandomValue)) {
|
|
18263
|
-
mov.y = this.linearVelOverLifetime.y.getValue(lifetime, aSeed);
|
|
18264
|
-
} else {
|
|
18265
|
-
mov.y = this.linearVelOverLifetime.y.getValue(lifetime);
|
|
18266
|
-
}
|
|
18267
|
-
}
|
|
18268
|
-
if (this.linearVelOverLifetime.z) {
|
|
18269
|
-
if (_instanceof1(this.linearVelOverLifetime.z, RandomValue)) {
|
|
18270
|
-
mov.z = this.linearVelOverLifetime.z.getValue(lifetime, aSeed);
|
|
18271
|
-
} else {
|
|
18272
|
-
mov.z = this.linearVelOverLifetime.z.getValue(lifetime);
|
|
18273
|
-
}
|
|
18274
|
-
}
|
|
18275
|
-
} else {
|
|
18276
|
-
// Adjust rotation based on the specified lifetime components
|
|
18277
|
-
if (this.linearVelOverLifetime.x) {
|
|
18278
|
-
if (_instanceof1(this.linearVelOverLifetime.x, RandomValue)) {
|
|
18279
|
-
mov.x = this.linearVelOverLifetime.x.getIntegrateValue(0.0, time, aSeed);
|
|
18280
|
-
} else {
|
|
18281
|
-
mov.x = this.linearVelOverLifetime.x.getIntegrateValue(0.0, time, duration);
|
|
18282
|
-
}
|
|
18283
|
-
}
|
|
18284
|
-
if (this.linearVelOverLifetime.y) {
|
|
18285
|
-
if (_instanceof1(this.linearVelOverLifetime.y, RandomValue)) {
|
|
18286
|
-
mov.y = this.linearVelOverLifetime.y.getIntegrateValue(0.0, time, aSeed);
|
|
18287
|
-
} else {
|
|
18288
|
-
mov.y = this.linearVelOverLifetime.y.getIntegrateValue(0.0, time, duration);
|
|
18289
|
-
}
|
|
18290
|
-
}
|
|
18291
|
-
if (this.linearVelOverLifetime.z) {
|
|
18292
|
-
if (_instanceof1(this.linearVelOverLifetime.z, RandomValue)) {
|
|
18293
|
-
mov.z = this.linearVelOverLifetime.z.getIntegrateValue(0.0, time, aSeed);
|
|
18294
|
-
} else {
|
|
18295
|
-
mov.z = this.linearVelOverLifetime.z.getIntegrateValue(0.0, time, duration);
|
|
18296
|
-
}
|
|
18297
|
-
}
|
|
18298
|
-
}
|
|
18299
|
-
return mov;
|
|
18300
|
-
};
|
|
18301
18092
|
_proto.removePoint = function removePoint(index) {
|
|
18302
18093
|
if (index < this.particleCount) {
|
|
18303
18094
|
this.geometry.setAttributeSubData("aOffset", index * 16, new Float32Array(16));
|
|
@@ -18431,6 +18222,247 @@ var ParticleMesh = /*#__PURE__*/ function() {
|
|
|
18431
18222
|
geometry.setDrawCount(this.particleCount * 6);
|
|
18432
18223
|
}
|
|
18433
18224
|
};
|
|
18225
|
+
_proto.applyTranslation = function applyTranslation(vertexCount, deltaTime) {
|
|
18226
|
+
var localTime = this.time;
|
|
18227
|
+
var aTranslationArray = this.geometry.getAttributeData("aTranslation");
|
|
18228
|
+
var aVelArray = this.geometry.getAttributeData("aVel"); // vector3
|
|
18229
|
+
var aOffsetArray = this.geometry.getAttributeData("aOffset");
|
|
18230
|
+
if (aTranslationArray.length < vertexCount * 3) {
|
|
18231
|
+
aTranslationArray = this.expandArray(aTranslationArray, vertexCount * 3);
|
|
18232
|
+
}
|
|
18233
|
+
// const velocity = this.cachedVelocity;
|
|
18234
|
+
var velocityX = 0;
|
|
18235
|
+
var velocityY = 0;
|
|
18236
|
+
var velocityZ = 0;
|
|
18237
|
+
var uAcceleration = this.mesh.material.getVector4("uAcceleration");
|
|
18238
|
+
var uGravityModifierValue = this.mesh.material.getVector4("uGravityModifierValue");
|
|
18239
|
+
for(var i = 0; i < vertexCount; i += 4){
|
|
18240
|
+
var velOffset = i * 12 + 3;
|
|
18241
|
+
velocityX = aVelArray[velOffset];
|
|
18242
|
+
velocityY = aVelArray[velOffset + 1];
|
|
18243
|
+
velocityZ = aVelArray[velOffset + 2];
|
|
18244
|
+
// velocity.set(aVelArray[velOffset], aVelArray[velOffset + 1], aVelArray[velOffset + 2]);
|
|
18245
|
+
var dt = localTime - aOffsetArray[i * 4 + 2]; // 相对delay的时间
|
|
18246
|
+
var duration = aOffsetArray[i * 4 + 3];
|
|
18247
|
+
if (uAcceleration && uGravityModifierValue) {
|
|
18248
|
+
var d = this.gravityModifier.getIntegrateValue(0, dt, duration);
|
|
18249
|
+
// const acc = this.tempVector3.set(uAcceleration.x * d, uAcceleration.y * d, uAcceleration.z * d);
|
|
18250
|
+
var accX = uAcceleration.x * d;
|
|
18251
|
+
var accY = uAcceleration.y * d;
|
|
18252
|
+
var accZ = uAcceleration.z * d;
|
|
18253
|
+
// speedIntegrate = speedOverLifetime.getIntegrateValue(0, time, duration);
|
|
18254
|
+
if (this.speedOverLifetime) {
|
|
18255
|
+
// dt / dur 归一化
|
|
18256
|
+
var speed = this.speedOverLifetime.getValue(dt / duration);
|
|
18257
|
+
velocityX = velocityX * speed + accX;
|
|
18258
|
+
velocityY = velocityY * speed + accY;
|
|
18259
|
+
velocityZ = velocityZ * speed + accZ;
|
|
18260
|
+
// velocity.multiply(speed).add(acc);
|
|
18261
|
+
} else {
|
|
18262
|
+
velocityX = velocityX + accX;
|
|
18263
|
+
velocityY = velocityY + accY;
|
|
18264
|
+
velocityZ = velocityZ + accZ;
|
|
18265
|
+
// velocity.add(acc);
|
|
18266
|
+
}
|
|
18267
|
+
}
|
|
18268
|
+
var aTranslationOffset = i * 3;
|
|
18269
|
+
if (aOffsetArray[i * 4 + 2] < localTime) {
|
|
18270
|
+
// const translation = velocity.multiply(deltaTime / 1000);
|
|
18271
|
+
var aTranslationX = velocityX * (deltaTime / 1000);
|
|
18272
|
+
var aTranslationY = velocityY * (deltaTime / 1000);
|
|
18273
|
+
var aTranslationZ = velocityZ * (deltaTime / 1000);
|
|
18274
|
+
aTranslationArray[aTranslationOffset] += aTranslationX;
|
|
18275
|
+
aTranslationArray[aTranslationOffset + 1] += aTranslationY;
|
|
18276
|
+
aTranslationArray[aTranslationOffset + 2] += aTranslationZ;
|
|
18277
|
+
aTranslationArray[aTranslationOffset + 3] += aTranslationX;
|
|
18278
|
+
aTranslationArray[aTranslationOffset + 4] += aTranslationY;
|
|
18279
|
+
aTranslationArray[aTranslationOffset + 5] += aTranslationZ;
|
|
18280
|
+
aTranslationArray[aTranslationOffset + 6] += aTranslationX;
|
|
18281
|
+
aTranslationArray[aTranslationOffset + 7] += aTranslationY;
|
|
18282
|
+
aTranslationArray[aTranslationOffset + 8] += aTranslationZ;
|
|
18283
|
+
aTranslationArray[aTranslationOffset + 9] += aTranslationX;
|
|
18284
|
+
aTranslationArray[aTranslationOffset + 10] += aTranslationY;
|
|
18285
|
+
aTranslationArray[aTranslationOffset + 11] += aTranslationZ;
|
|
18286
|
+
}
|
|
18287
|
+
}
|
|
18288
|
+
this.geometry.setAttributeData("aTranslation", aTranslationArray);
|
|
18289
|
+
};
|
|
18290
|
+
_proto.applyRotation = function applyRotation(vertexCount, deltaTime) {
|
|
18291
|
+
var aRotationArray = this.geometry.getAttributeData("aRotation0");
|
|
18292
|
+
var aOffsetArray = this.geometry.getAttributeData("aOffset");
|
|
18293
|
+
var aRotArray = this.geometry.getAttributeData("aRot"); // vector3
|
|
18294
|
+
var aSeedArray = this.geometry.getAttributeData("aSeed"); // float
|
|
18295
|
+
var localTime = this.time;
|
|
18296
|
+
var aRotationMatrix = this.cachedRotationMatrix;
|
|
18297
|
+
if (aRotationArray.length < vertexCount * 9) {
|
|
18298
|
+
aRotationArray = this.expandArray(aRotationArray, vertexCount * 9);
|
|
18299
|
+
}
|
|
18300
|
+
for(var i = 0; i < vertexCount; i += 4){
|
|
18301
|
+
var time = localTime - aOffsetArray[i * 4 + 2];
|
|
18302
|
+
var duration = aOffsetArray[i * 4 + 3];
|
|
18303
|
+
var life = clamp$1(time / duration, 0.0, 1.0);
|
|
18304
|
+
var aRotOffset = i * 8;
|
|
18305
|
+
var aRot = this.cachedRotationVector3.set(aRotArray[aRotOffset], aRotArray[aRotOffset + 1], aRotArray[aRotOffset + 2]);
|
|
18306
|
+
var aSeed = aSeedArray[i * 8 + 3];
|
|
18307
|
+
var rotation = aRot;
|
|
18308
|
+
if (!this.rotationOverLifetime) {
|
|
18309
|
+
aRotationMatrix.setZero();
|
|
18310
|
+
} else if (this.rotationOverLifetime.asRotation) {
|
|
18311
|
+
// Adjust rotation based on the specified lifetime components
|
|
18312
|
+
if (this.rotationOverLifetime.x) {
|
|
18313
|
+
if (_instanceof1(this.rotationOverLifetime.x, RandomValue)) {
|
|
18314
|
+
rotation.x += this.rotationOverLifetime.x.getValue(life, aSeed);
|
|
18315
|
+
} else {
|
|
18316
|
+
rotation.x += this.rotationOverLifetime.x.getValue(life);
|
|
18317
|
+
}
|
|
18318
|
+
}
|
|
18319
|
+
if (this.rotationOverLifetime.y) {
|
|
18320
|
+
if (_instanceof1(this.rotationOverLifetime.y, RandomValue)) {
|
|
18321
|
+
rotation.y += this.rotationOverLifetime.y.getValue(life, aSeed);
|
|
18322
|
+
} else {
|
|
18323
|
+
rotation.y += this.rotationOverLifetime.y.getValue(life);
|
|
18324
|
+
}
|
|
18325
|
+
}
|
|
18326
|
+
if (this.rotationOverLifetime.z) {
|
|
18327
|
+
if (_instanceof1(this.rotationOverLifetime.z, RandomValue)) {
|
|
18328
|
+
rotation.z += this.rotationOverLifetime.z.getValue(life, aSeed);
|
|
18329
|
+
} else {
|
|
18330
|
+
rotation.z += this.rotationOverLifetime.z.getValue(life);
|
|
18331
|
+
}
|
|
18332
|
+
}
|
|
18333
|
+
} else {
|
|
18334
|
+
// Adjust rotation based on the specified lifetime components
|
|
18335
|
+
if (this.rotationOverLifetime.x) {
|
|
18336
|
+
if (_instanceof1(this.rotationOverLifetime.x, RandomValue)) {
|
|
18337
|
+
rotation.x += this.rotationOverLifetime.x.getIntegrateValue(0.0, life, aSeed) * duration;
|
|
18338
|
+
} else {
|
|
18339
|
+
rotation.x += this.rotationOverLifetime.x.getIntegrateValue(0.0, life, duration) * duration;
|
|
18340
|
+
}
|
|
18341
|
+
}
|
|
18342
|
+
if (this.rotationOverLifetime.y) {
|
|
18343
|
+
if (_instanceof1(this.rotationOverLifetime.y, RandomValue)) {
|
|
18344
|
+
rotation.y += this.rotationOverLifetime.y.getIntegrateValue(0.0, life, aSeed) * duration;
|
|
18345
|
+
} else {
|
|
18346
|
+
rotation.y += this.rotationOverLifetime.y.getIntegrateValue(0.0, life, duration) * duration;
|
|
18347
|
+
}
|
|
18348
|
+
}
|
|
18349
|
+
if (this.rotationOverLifetime.z) {
|
|
18350
|
+
if (_instanceof1(this.rotationOverLifetime.z, RandomValue)) {
|
|
18351
|
+
rotation.z += this.rotationOverLifetime.z.getIntegrateValue(0.0, life, aSeed) * duration;
|
|
18352
|
+
} else {
|
|
18353
|
+
rotation.z += this.rotationOverLifetime.z.getIntegrateValue(0.0, life, duration) * duration;
|
|
18354
|
+
}
|
|
18355
|
+
}
|
|
18356
|
+
}
|
|
18357
|
+
// If the rotation vector is zero, return the identity matrix
|
|
18358
|
+
if (rotation.dot(rotation) === 0.0) {
|
|
18359
|
+
aRotationMatrix.identity();
|
|
18360
|
+
}
|
|
18361
|
+
var d2r = Math.PI / 180;
|
|
18362
|
+
var rotationXD2r = rotation.x * d2r;
|
|
18363
|
+
var rotationYD2r = rotation.y * d2r;
|
|
18364
|
+
var rotationZD2r = rotation.z * d2r;
|
|
18365
|
+
var sinRX = Math.sin(rotationXD2r);
|
|
18366
|
+
var sinRY = Math.sin(rotationYD2r);
|
|
18367
|
+
var sinRZ = Math.sin(rotationZD2r);
|
|
18368
|
+
var cosRX = Math.cos(rotationXD2r);
|
|
18369
|
+
var cosRY = Math.cos(rotationYD2r);
|
|
18370
|
+
var cosRZ = Math.cos(rotationZD2r);
|
|
18371
|
+
// rotZ * rotY * rotX
|
|
18372
|
+
aRotationMatrix.set(cosRZ, -sinRZ, 0., sinRZ, cosRZ, 0., 0., 0., 1.); //rotZ
|
|
18373
|
+
aRotationMatrix.multiply(this.tempMatrix3.set(cosRY, 0., sinRY, 0., 1., 0., -sinRY, 0, cosRY)); //rotY
|
|
18374
|
+
aRotationMatrix.multiply(this.tempMatrix3.set(1., 0., 0., 0, cosRX, -sinRX, 0., sinRX, cosRX)); //rotX
|
|
18375
|
+
var aRotationOffset = i * 9;
|
|
18376
|
+
var matrixArray = aRotationMatrix.elements;
|
|
18377
|
+
aRotationArray.set(matrixArray, aRotationOffset);
|
|
18378
|
+
if (i + 4 <= vertexCount) {
|
|
18379
|
+
aRotationArray.set(matrixArray, aRotationOffset + 9);
|
|
18380
|
+
aRotationArray.set(matrixArray, aRotationOffset + 18);
|
|
18381
|
+
aRotationArray.set(matrixArray, aRotationOffset + 27);
|
|
18382
|
+
}
|
|
18383
|
+
}
|
|
18384
|
+
this.geometry.setAttributeData("aRotation0", aRotationArray);
|
|
18385
|
+
};
|
|
18386
|
+
_proto.applyLinearMove = function applyLinearMove(vertexCount, deltaTime) {
|
|
18387
|
+
var aLinearMoveArray = this.geometry.getAttributeData("aLinearMove");
|
|
18388
|
+
var aOffsetArray = this.geometry.getAttributeData("aOffset");
|
|
18389
|
+
var aSeedArray = this.geometry.getAttributeData("aSeed"); // float
|
|
18390
|
+
var localTime = this.time;
|
|
18391
|
+
if (aLinearMoveArray.length < vertexCount * 3) {
|
|
18392
|
+
aLinearMoveArray = this.expandArray(aLinearMoveArray, vertexCount * 3);
|
|
18393
|
+
}
|
|
18394
|
+
var linearMove = this.cachedLinearMove;
|
|
18395
|
+
if (this.linearVelOverLifetime && this.linearVelOverLifetime.enabled) {
|
|
18396
|
+
for(var i = 0; i < vertexCount; i += 4){
|
|
18397
|
+
var time = localTime - aOffsetArray[i * 4 + 2];
|
|
18398
|
+
var duration = aOffsetArray[i * 4 + 3];
|
|
18399
|
+
// const life = math.clamp(time / duration, 0.0, 1.0);
|
|
18400
|
+
var lifetime = time / duration;
|
|
18401
|
+
var aSeed = aSeedArray[i * 8 + 3];
|
|
18402
|
+
linearMove.setZero();
|
|
18403
|
+
if (this.linearVelOverLifetime.asMovement) {
|
|
18404
|
+
if (this.linearVelOverLifetime.x) {
|
|
18405
|
+
if (_instanceof1(this.linearVelOverLifetime.x, RandomValue)) {
|
|
18406
|
+
linearMove.x = this.linearVelOverLifetime.x.getValue(lifetime, aSeed);
|
|
18407
|
+
} else {
|
|
18408
|
+
linearMove.x = this.linearVelOverLifetime.x.getValue(lifetime);
|
|
18409
|
+
}
|
|
18410
|
+
}
|
|
18411
|
+
if (this.linearVelOverLifetime.y) {
|
|
18412
|
+
if (_instanceof1(this.linearVelOverLifetime.y, RandomValue)) {
|
|
18413
|
+
linearMove.y = this.linearVelOverLifetime.y.getValue(lifetime, aSeed);
|
|
18414
|
+
} else {
|
|
18415
|
+
linearMove.y = this.linearVelOverLifetime.y.getValue(lifetime);
|
|
18416
|
+
}
|
|
18417
|
+
}
|
|
18418
|
+
if (this.linearVelOverLifetime.z) {
|
|
18419
|
+
if (_instanceof1(this.linearVelOverLifetime.z, RandomValue)) {
|
|
18420
|
+
linearMove.z = this.linearVelOverLifetime.z.getValue(lifetime, aSeed);
|
|
18421
|
+
} else {
|
|
18422
|
+
linearMove.z = this.linearVelOverLifetime.z.getValue(lifetime);
|
|
18423
|
+
}
|
|
18424
|
+
}
|
|
18425
|
+
} else {
|
|
18426
|
+
// Adjust rotation based on the specified lifetime components
|
|
18427
|
+
if (this.linearVelOverLifetime.x) {
|
|
18428
|
+
if (_instanceof1(this.linearVelOverLifetime.x, RandomValue)) {
|
|
18429
|
+
linearMove.x = this.linearVelOverLifetime.x.getIntegrateValue(0.0, time, aSeed);
|
|
18430
|
+
} else {
|
|
18431
|
+
linearMove.x = this.linearVelOverLifetime.x.getIntegrateValue(0.0, time, duration);
|
|
18432
|
+
}
|
|
18433
|
+
}
|
|
18434
|
+
if (this.linearVelOverLifetime.y) {
|
|
18435
|
+
if (_instanceof1(this.linearVelOverLifetime.y, RandomValue)) {
|
|
18436
|
+
linearMove.y = this.linearVelOverLifetime.y.getIntegrateValue(0.0, time, aSeed);
|
|
18437
|
+
} else {
|
|
18438
|
+
linearMove.y = this.linearVelOverLifetime.y.getIntegrateValue(0.0, time, duration);
|
|
18439
|
+
}
|
|
18440
|
+
}
|
|
18441
|
+
if (this.linearVelOverLifetime.z) {
|
|
18442
|
+
if (_instanceof1(this.linearVelOverLifetime.z, RandomValue)) {
|
|
18443
|
+
linearMove.z = this.linearVelOverLifetime.z.getIntegrateValue(0.0, time, aSeed);
|
|
18444
|
+
} else {
|
|
18445
|
+
linearMove.z = this.linearVelOverLifetime.z.getIntegrateValue(0.0, time, duration);
|
|
18446
|
+
}
|
|
18447
|
+
}
|
|
18448
|
+
}
|
|
18449
|
+
var aLinearMoveOffset = i * 3;
|
|
18450
|
+
aLinearMoveArray[aLinearMoveOffset] = linearMove.x;
|
|
18451
|
+
aLinearMoveArray[aLinearMoveOffset + 1] = linearMove.y;
|
|
18452
|
+
aLinearMoveArray[aLinearMoveOffset + 2] = linearMove.z;
|
|
18453
|
+
aLinearMoveArray[aLinearMoveOffset + 3] = linearMove.x;
|
|
18454
|
+
aLinearMoveArray[aLinearMoveOffset + 4] = linearMove.y;
|
|
18455
|
+
aLinearMoveArray[aLinearMoveOffset + 5] = linearMove.z;
|
|
18456
|
+
aLinearMoveArray[aLinearMoveOffset + 6] = linearMove.x;
|
|
18457
|
+
aLinearMoveArray[aLinearMoveOffset + 7] = linearMove.y;
|
|
18458
|
+
aLinearMoveArray[aLinearMoveOffset + 8] = linearMove.z;
|
|
18459
|
+
aLinearMoveArray[aLinearMoveOffset + 9] = linearMove.x;
|
|
18460
|
+
aLinearMoveArray[aLinearMoveOffset + 10] = linearMove.y;
|
|
18461
|
+
aLinearMoveArray[aLinearMoveOffset + 11] = linearMove.z;
|
|
18462
|
+
}
|
|
18463
|
+
}
|
|
18464
|
+
this.geometry.setAttributeData("aLinearMove", aLinearMoveArray);
|
|
18465
|
+
};
|
|
18434
18466
|
_proto.expandArray = function expandArray(array, newSize) {
|
|
18435
18467
|
var newArr = new Float32Array(newSize);
|
|
18436
18468
|
newArr.set(array);
|
|
@@ -19067,7 +19099,13 @@ TransformPlayableAsset = __decorate([
|
|
|
19067
19099
|
return Playable.apply(this, arguments);
|
|
19068
19100
|
}
|
|
19069
19101
|
var _proto = ActivationPlayable.prototype;
|
|
19070
|
-
_proto.processFrame = function processFrame(context) {
|
|
19102
|
+
_proto.processFrame = function processFrame(context) {
|
|
19103
|
+
var vfxItem = context.output.getUserData();
|
|
19104
|
+
if (!_instanceof1(vfxItem, VFXItem)) {
|
|
19105
|
+
return;
|
|
19106
|
+
}
|
|
19107
|
+
vfxItem.time = this.time;
|
|
19108
|
+
};
|
|
19071
19109
|
return ActivationPlayable;
|
|
19072
19110
|
}(Playable);
|
|
19073
19111
|
var ActivationPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
@@ -19220,7 +19258,7 @@ var AnimationClipPlayable = /*#__PURE__*/ function(Playable) {
|
|
|
19220
19258
|
_proto.toLocalTime = function toLocalTime(time) {
|
|
19221
19259
|
var localTime = time - this.start;
|
|
19222
19260
|
var duration = this.duration;
|
|
19223
|
-
if (localTime - duration > 0
|
|
19261
|
+
if (localTime - duration > 0) {
|
|
19224
19262
|
if (this.endBehavior === EndBehavior.restart) {
|
|
19225
19263
|
localTime = localTime % duration;
|
|
19226
19264
|
} else if (this.endBehavior === EndBehavior.freeze) {
|
|
@@ -19349,7 +19387,7 @@ var RuntimeClip = /*#__PURE__*/ function() {
|
|
|
19349
19387
|
var ended = false;
|
|
19350
19388
|
var started = false;
|
|
19351
19389
|
var boundObject = this.track.binding;
|
|
19352
|
-
if (localTime
|
|
19390
|
+
if (localTime >= clip.start + clip.duration && clip.endBehavior === EndBehavior.destroy) {
|
|
19353
19391
|
if (_instanceof1(boundObject, VFXItem) && VFXItem.isParticle(boundObject) && this.particleSystem && !this.particleSystem.destroyed) {
|
|
19354
19392
|
weight = 1.0;
|
|
19355
19393
|
} else {
|
|
@@ -20579,6 +20617,12 @@ var EffectComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
20579
20617
|
_proto.onStart = function onStart() {
|
|
20580
20618
|
this.item.getHitTestParams = this.getHitTestParams;
|
|
20581
20619
|
};
|
|
20620
|
+
_proto.onUpdate = function onUpdate(dt) {
|
|
20621
|
+
var time = this.item.time;
|
|
20622
|
+
var _this_material_getVector4;
|
|
20623
|
+
var _Time = (_this_material_getVector4 = this.material.getVector4("_Time")) != null ? _this_material_getVector4 : new Vector4();
|
|
20624
|
+
this.material.setVector4("_Time", _Time.set(time / 20, time, time * 2, time * 3));
|
|
20625
|
+
};
|
|
20582
20626
|
_proto.render = function render(renderer) {
|
|
20583
20627
|
if (renderer.renderingData.currentFrame.globalUniforms) {
|
|
20584
20628
|
renderer.setGlobalMatrix("effects_ObjectToWorld", this.transform.getWorldMatrix());
|
|
@@ -20832,6 +20876,9 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
20832
20876
|
* 元素的变换包含位置、旋转、缩放。
|
|
20833
20877
|
*/ _this.transform = new Transform();
|
|
20834
20878
|
/**
|
|
20879
|
+
* 元素动画的当前时间
|
|
20880
|
+
*/ _this.time = 0;
|
|
20881
|
+
/**
|
|
20835
20882
|
* 元素动画的持续时间
|
|
20836
20883
|
*/ _this.duration = 0;
|
|
20837
20884
|
/**
|
|
@@ -21164,6 +21211,7 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
21164
21211
|
var component = _step.value;
|
|
21165
21212
|
if (component.enabled && !component.isStartCalled) {
|
|
21166
21213
|
component.onStart();
|
|
21214
|
+
component.isStartCalled = true;
|
|
21167
21215
|
}
|
|
21168
21216
|
}
|
|
21169
21217
|
for(var _iterator1 = _create_for_of_iterator_helper_loose(this.components), _step1; !(_step1 = _iterator1()).done;){
|
|
@@ -28086,7 +28134,7 @@ registerPlugin("sprite", SpriteLoader, VFXItem, true);
|
|
|
28086
28134
|
registerPlugin("particle", ParticleLoader, VFXItem, true);
|
|
28087
28135
|
registerPlugin("cal", CalculateLoader, VFXItem, true);
|
|
28088
28136
|
registerPlugin("interact", InteractLoader, VFXItem, true);
|
|
28089
|
-
var version$1 = "2.1.0-alpha.
|
|
28137
|
+
var version$1 = "2.1.0-alpha.4";
|
|
28090
28138
|
logger.info("Core version: " + version$1 + ".");
|
|
28091
28139
|
|
|
28092
28140
|
var _obj;
|
|
@@ -29767,7 +29815,7 @@ setMaxSpriteMeshItemCount(8);
|
|
|
29767
29815
|
*/ Mesh.create = function(engine, props) {
|
|
29768
29816
|
return new ThreeMesh(engine, props);
|
|
29769
29817
|
};
|
|
29770
|
-
var version = "2.1.0-alpha.
|
|
29818
|
+
var version = "2.1.0-alpha.4";
|
|
29771
29819
|
logger.info("THREEJS plugin version: " + version + ".");
|
|
29772
29820
|
|
|
29773
29821
|
export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, AssetLoader, AssetManager, BYTES_TYPE_MAP, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, COMPRESSED_TEXTURE, CONSTANT_MAP_BLEND, CONSTANT_MAP_DEPTH, CONSTANT_MAP_STENCIL_FUNC, CONSTANT_MAP_STENCIL_OP, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, Component, Composition, CompositionComponent, CompositionSourceManager, DEFAULT_FONTS, DEFAULT_FPS, Database, DestroyOptions, Downloader, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, EffectComponent, EffectsObject, EffectsPackage, Engine, EventEmitter, EventSystem, FilterMode, Float16ArrayWrapper, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, HELP_LINK, HitTestType, InteractComponent, InteractLoader, InteractMesh, Item, KTXTexture, LineSegments, LinearValue, Material, MaterialDataBlock, MaterialRenderType, Mesh, ObjectBindingTrack, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, PassTextureCache, PathSegments, PluginSystem, PostProcessVolume, RENDER_PASS_NAME_PREFIX, RENDER_PREFER_LOOKUP_TEXTURE, RUNTIME_ENV, RandomSetValue, RandomValue, RandomVectorValue, RenderFrame, RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, RenderTargetHandle, RenderTextureFormat, Renderbuffer, Renderer, RendererComponent, RuntimeClip, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0, SEMANTIC_PRE_COLOR_ATTACHMENT_0, SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0, SPRITE_VERTEX_STRIDE, SemanticMap, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderFactory, ShaderType, ShaderVariant, SpriteColorPlayable, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteLoader, StaticValue, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TEXTURE_UNIFORM_MAP, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, ThreeComposition, ThreeDisplayObject, ThreeEngine, ThreeMaterial, ThreeSpriteComponent, ThreeTextComponent, ThreeTexture, Ticker, TimelineAsset, TimelineClip, TimelinePlayable, TrackAsset, TrackSortWrapper, TrackType, Transform, TransformAnimationPlayable, TransformPlayableAsset, TransformTrack, VFXItem, ValueGetter, addByOrder, addItem, addItemWithOrder, applyMixins, assertExist, asserts, base64ToFile, blend, calculateTranslation, canvasPool, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, createCopyShader, createGLContext, createKeyFrameMeta, createShape, createValueGetter, decimalEqual, defaultGlobalVolume, defaultPlugins, deserializeMipmapTexture, earcut, effectsClass, effectsClassStore, enlargeBuffer, ensureFixedNumber, ensureVec3, findPreviousRenderPass, gaussianDown_frag as gaussianDownFrag, gaussianDownHFrag, gaussianDownVFrag, gaussianUpFrag, generateEmptyTypedArray, generateGUID, generateHalfFloatTexture, generateTransparentTexture, generateWhiteTexture, getBackgroundImage, getColorFromGradientStops, getConfig, getDefaultTextureFactory, getGeometryByShape, getGeometryTriangles, getImageItemRenderInfo, getKTXTextureOptions, getKeyFrameMetaByRawValue, getMergedStore, getParticleMeshShader, getPixelRatio, getPreMultiAlpha, getStandardComposition, getStandardImage, getStandardItem, getStandardJSON, getTextureSize, glContext, glType2VertexFormatType, gpuTimer, imageDataFromColor, imageDataFromGradient, initErrors, initGLContext, integrate, interpolateColor, isAlipayMiniApp, isAndroid, isArray, isCanvas, isFunction, isIOS, isIOSByUA, isMiniProgram, isObject, isSceneJSON, isSceneURL, isSceneWithOptions, isSimulatorCellPhone, isString, isUniformStruct, isUniformStructArray, isValidFontFamily, isWebGL2, isWechatMiniApp, itemFrag, itemFrameFrag, itemVert, loadAVIFOptional, loadBinary, loadBlob, loadImage, loadMedia, loadVideo, loadWebPOptional, logger, index as math, maxSpriteMeshItemCount, modifyMaxKeyframeShader, nearestPowerOfTwo, noop, normalizeColor, numberToFix, parsePercent$1 as parsePercent, particleFrag, particleOriginTranslateMap$1 as particleOriginTranslateMap, particleUniformTypeMap, particleVert, pluginLoaderMap, randomInRange, registerPlugin, removeItem, rotateVec2, screenMeshVert, serialize, setBlendMode, setConfig, setDefaultTextureFactory, setMaskMode, setMaxSpriteMeshItemCount, setRayFromCamera, setSideMode, setSpriteMeshMaxItemCountByGPU, setUniformValue, sortByOrder, index$1 as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecFill, vecMulCombine, version, vertexFormatType2GLType };
|