@galacean/engine-core 2.0.0-alpha.17 → 2.0.0-alpha.18
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 +97 -96
- package/dist/main.js.map +1 -1
- package/dist/module.js +97 -96
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/particle/modules/LimitVelocityOverLifetimeModule.d.ts +33 -32
package/dist/module.js
CHANGED
|
@@ -4912,7 +4912,7 @@ var texture_sheet_animation_module = "#if defined(RENDERER_TSA_FRAME_CURVE) || d
|
|
|
4912
4912
|
|
|
4913
4913
|
var force_over_lifetime_module = "#if defined(RENDERER_FOL_CONSTANT_MODE) || defined(RENDERER_FOL_CURVE_MODE)\n #define _FOL_MODULE_ENABLED\n#endif\n\n#ifdef _FOL_MODULE_ENABLED\n uniform int renderer_FOLSpace;\n\n #ifdef RENDERER_FOL_CONSTANT_MODE\n uniform vec3 renderer_FOLMaxConst;\n\n #ifdef RENDERER_FOL_IS_RANDOM_TWO\n uniform vec3 renderer_FOLMinConst;\n #endif\n\n #endif\n\n #ifdef RENDERER_FOL_CURVE_MODE\n uniform vec2 renderer_FOLMaxGradientX[4];\n uniform vec2 renderer_FOLMaxGradientY[4];\n uniform vec2 renderer_FOLMaxGradientZ[4];\n\n #ifdef RENDERER_FOL_IS_RANDOM_TWO\n uniform vec2 renderer_FOLMinGradientX[4];\n uniform vec2 renderer_FOLMinGradientY[4];\n uniform vec2 renderer_FOLMinGradientZ[4];\n #endif\n #endif\n\n // (tHat - t1) * (tHat - t1) * (tHat - t1) * (a2 - a1) / ((t2 - t1) * 6.0) + a1 * (tHat - t1) * (tHat - t1) * 0.5 + v1 * (tHat - t1);\n // to = tHat - t1; tr = t2 - t1\n float computeDisplacementIntegral(in float to, in float tr, in float a1, in float a2, in float v1) {\n return to * to * to * (a2 - a1) / (tr * 6.0) + a1 * to * to * 0.5 + v1 * to;\n }\n\n float evaluateForceParticleCurveCumulative(in vec2 keys[4], in float normalizedAge, out float velocityCumulative) {\n float cumulativeValue = 0.0;\n velocityCumulative = 0.0;\n\n for (int i = 1; i < 4; i++){\n vec2 key = keys[i];\n vec2 lastKey = keys[i - 1];\n float timeRange = (key.x - lastKey.x) * a_ShapePositionStartLifeTime.w;\n\n if (key.x >= normalizedAge){\n float timeOffset = (normalizedAge - lastKey.x) * a_ShapePositionStartLifeTime.w;\n cumulativeValue += computeDisplacementIntegral(timeOffset, timeRange, lastKey.y, key.y, velocityCumulative);\n\n float finalAcceleration = mix(lastKey.y, key.y, timeOffset / timeRange);\n velocityCumulative += 0.5 * timeOffset * (finalAcceleration + lastKey.y);\n break;\n } else { \n cumulativeValue += computeDisplacementIntegral(timeRange, timeRange, lastKey.y, key.y, velocityCumulative);\n velocityCumulative += 0.5 * timeRange * (lastKey.y + key.y);\n }\n }\n return cumulativeValue;\n }\n\n vec3 computeForcePositionOffset(in float normalizedAge, in float age, out vec3 velocityOffset) {\n vec3 forcePosition;\n\n #if defined(RENDERER_FOL_CONSTANT_MODE)\n vec3 forceAcceleration = renderer_FOLMaxConst;\n\n #ifdef RENDERER_FOL_IS_RANDOM_TWO\n forceAcceleration = mix(renderer_FOLMinConst, forceAcceleration, vec3(a_Random2.x, a_Random2.y, a_Random2.z));\n #endif\n\n velocityOffset = forceAcceleration * age;\n\n forcePosition = 0.5 * forceAcceleration * age * age;\n #elif defined(RENDERER_FOL_CURVE_MODE)\n forcePosition = vec3(\n evaluateForceParticleCurveCumulative(renderer_FOLMaxGradientX, normalizedAge, velocityOffset.x),\n evaluateForceParticleCurveCumulative(renderer_FOLMaxGradientY, normalizedAge, velocityOffset.y),\n evaluateForceParticleCurveCumulative(renderer_FOLMaxGradientZ, normalizedAge, velocityOffset.z)\n );\n #ifdef RENDERER_FOL_IS_RANDOM_TWO\n vec3 minVelocityOffset;\n\n forcePosition = vec3(\n mix(evaluateForceParticleCurveCumulative(renderer_FOLMinGradientX, normalizedAge, minVelocityOffset.x), forcePosition.x, a_Random2.x),\n mix(evaluateForceParticleCurveCumulative(renderer_FOLMinGradientY, normalizedAge, minVelocityOffset.y), forcePosition.y, a_Random2.y),\n mix(evaluateForceParticleCurveCumulative(renderer_FOLMinGradientZ, normalizedAge, minVelocityOffset.z), forcePosition.z, a_Random2.z)\n );\n\n velocityOffset = mix(minVelocityOffset, velocityOffset, vec3(a_Random2.x, a_Random2.y, a_Random2.z));\n #endif\n #endif\n return forcePosition;\n }\n#endif"; // eslint-disable-line
|
|
4914
4914
|
|
|
4915
|
-
var limit_velocity_over_lifetime_module = "#ifdef RENDERER_LVL_MODULE_ENABLED\n uniform int renderer_LVLSpace;\n uniform float renderer_LVLDampen;\n\n // Scalar limit\n #ifndef RENDERER_LVL_SEPARATE_AXES\n #ifdef
|
|
4915
|
+
var limit_velocity_over_lifetime_module = "#ifdef RENDERER_LVL_MODULE_ENABLED\n uniform int renderer_LVLSpace;\n uniform float renderer_LVLDampen;\n\n // Scalar limit\n #ifndef RENDERER_LVL_SEPARATE_AXES\n #ifdef RENDERER_LVL_SPEED_CONSTANT_MODE\n uniform float renderer_LVLSpeedMaxConst;\n #ifdef RENDERER_LVL_SPEED_IS_RANDOM_TWO\n uniform float renderer_LVLSpeedMinConst;\n #endif\n #endif\n #ifdef RENDERER_LVL_SPEED_CURVE_MODE\n uniform vec2 renderer_LVLSpeedMaxCurve[4];\n #ifdef RENDERER_LVL_SPEED_IS_RANDOM_TWO\n uniform vec2 renderer_LVLSpeedMinCurve[4];\n #endif\n #endif\n #endif\n\n // Per-axis limit\n #ifdef RENDERER_LVL_SEPARATE_AXES\n #ifdef RENDERER_LVL_SPEED_CONSTANT_MODE\n uniform vec3 renderer_LVLSpeedMaxConstVector;\n #ifdef RENDERER_LVL_SPEED_IS_RANDOM_TWO\n uniform vec3 renderer_LVLSpeedMinConstVector;\n #endif\n #endif\n #ifdef RENDERER_LVL_SPEED_CURVE_MODE\n uniform vec2 renderer_LVLSpeedXMaxCurve[4];\n uniform vec2 renderer_LVLSpeedYMaxCurve[4];\n uniform vec2 renderer_LVLSpeedZMaxCurve[4];\n #ifdef RENDERER_LVL_SPEED_IS_RANDOM_TWO\n uniform vec2 renderer_LVLSpeedXMinCurve[4];\n uniform vec2 renderer_LVLSpeedYMinCurve[4];\n uniform vec2 renderer_LVLSpeedZMinCurve[4];\n #endif\n #endif\n #endif\n\n // Drag curve\n #ifdef RENDERER_LVL_DRAG_CURVE_MODE\n uniform vec2 renderer_LVLDragMaxCurve[4];\n #ifdef RENDERER_LVL_DRAG_IS_RANDOM_TWO\n uniform vec2 renderer_LVLDragMinCurve[4];\n #endif\n #endif\n\n float evaluateLVLDrag(float normalizedAge, float dragRand) {\n #ifdef RENDERER_LVL_DRAG_CURVE_MODE\n float dragMax = evaluateParticleCurve(renderer_LVLDragMaxCurve, normalizedAge);\n #ifdef RENDERER_LVL_DRAG_IS_RANDOM_TWO\n float dragMin = evaluateParticleCurve(renderer_LVLDragMinCurve, normalizedAge);\n return mix(dragMin, dragMax, dragRand);\n #else\n return dragMax;\n #endif\n #else\n return mix(renderer_LVLDragConstant.x, renderer_LVLDragConstant.y, dragRand);\n #endif\n }\n\n vec3 applyLVLSpeedLimitTF(vec3 velocity, float normalizedAge, float limitRand, float effectiveDampen) {\n #ifdef RENDERER_LVL_SEPARATE_AXES\n vec3 limitSpeed;\n #ifdef RENDERER_LVL_SPEED_CONSTANT_MODE\n limitSpeed = renderer_LVLSpeedMaxConstVector;\n #ifdef RENDERER_LVL_SPEED_IS_RANDOM_TWO\n limitSpeed = mix(renderer_LVLSpeedMinConstVector, limitSpeed, limitRand);\n #endif\n #endif\n #ifdef RENDERER_LVL_SPEED_CURVE_MODE\n limitSpeed = vec3(\n evaluateParticleCurve(renderer_LVLSpeedXMaxCurve, normalizedAge),\n evaluateParticleCurve(renderer_LVLSpeedYMaxCurve, normalizedAge),\n evaluateParticleCurve(renderer_LVLSpeedZMaxCurve, normalizedAge)\n );\n #ifdef RENDERER_LVL_SPEED_IS_RANDOM_TWO\n vec3 minLimitSpeed = vec3(\n evaluateParticleCurve(renderer_LVLSpeedXMinCurve, normalizedAge),\n evaluateParticleCurve(renderer_LVLSpeedYMinCurve, normalizedAge),\n evaluateParticleCurve(renderer_LVLSpeedZMinCurve, normalizedAge)\n );\n limitSpeed = mix(minLimitSpeed, limitSpeed, limitRand);\n #endif\n #endif\n\n vec3 absVel = abs(velocity);\n vec3 excess = max(absVel - limitSpeed, vec3(0.0));\n velocity = sign(velocity) * (absVel - excess * effectiveDampen);\n #else\n float limitSpeed;\n #ifdef RENDERER_LVL_SPEED_CONSTANT_MODE\n limitSpeed = renderer_LVLSpeedMaxConst;\n #ifdef RENDERER_LVL_SPEED_IS_RANDOM_TWO\n limitSpeed = mix(renderer_LVLSpeedMinConst, limitSpeed, limitRand);\n #endif\n #endif\n #ifdef RENDERER_LVL_SPEED_CURVE_MODE\n limitSpeed = evaluateParticleCurve(renderer_LVLSpeedMaxCurve, normalizedAge);\n #ifdef RENDERER_LVL_SPEED_IS_RANDOM_TWO\n float minLimitSpeed = evaluateParticleCurve(renderer_LVLSpeedMinCurve, normalizedAge);\n limitSpeed = mix(minLimitSpeed, limitSpeed, limitRand);\n #endif\n #endif\n\n float speed = length(velocity);\n if (speed > limitSpeed && speed > 0.0) {\n float excess = speed - limitSpeed;\n velocity = velocity * ((speed - excess * effectiveDampen) / speed);\n }\n #endif\n return velocity;\n }\n\n#endif\n"; // eslint-disable-line
|
|
4916
4916
|
|
|
4917
4917
|
var particle_feedback_simulation = "// Transform Feedback update shader for particle simulation.\n// Update order: VOL/FOL → Dampen → Drag → Position.\n// Runs once per particle per frame (no rasterization).\n\n// Previous frame TF data\nattribute vec3 a_FeedbackPosition;\nattribute vec3 a_FeedbackVelocity;\n\n// Per-particle instance data\nattribute vec4 a_ShapePositionStartLifeTime;\nattribute vec4 a_DirectionTime;\nattribute vec3 a_StartSize;\nattribute float a_StartSpeed;\nattribute vec4 a_Random0;\nattribute vec4 a_Random1;\nattribute vec3 a_SimulationWorldPosition;\nattribute vec4 a_SimulationWorldRotation;\nattribute vec4 a_Random2;\n\n// Uniforms\nuniform float renderer_CurrentTime;\nuniform float renderer_DeltaTime;\nuniform vec3 renderer_Gravity;\nuniform vec2 renderer_LVLDragConstant;\nuniform vec3 renderer_WorldPosition;\nuniform vec4 renderer_WorldRotation;\nuniform int renderer_SimulationSpace;\n\n// TF outputs\nvarying vec3 v_FeedbackPosition;\nvarying vec3 v_FeedbackVelocity;\n\n#include <particle_common>\n#include <velocity_over_lifetime_module>\n#include <force_over_lifetime_module>\n#include <limit_velocity_over_lifetime_module>\n\n// Get VOL instantaneous velocity at normalizedAge\nvec3 getVOLVelocity(float normalizedAge) {\n vec3 vel = vec3(0.0);\n #ifdef _VOL_MODULE_ENABLED\n #ifdef RENDERER_VOL_CONSTANT_MODE\n vel = renderer_VOLMaxConst;\n #ifdef RENDERER_VOL_IS_RANDOM_TWO\n vel = mix(renderer_VOLMinConst, vel, a_Random1.yzw);\n #endif\n #endif\n #ifdef RENDERER_VOL_CURVE_MODE\n vel = vec3(\n evaluateParticleCurve(renderer_VOLMaxGradientX, normalizedAge),\n evaluateParticleCurve(renderer_VOLMaxGradientY, normalizedAge),\n evaluateParticleCurve(renderer_VOLMaxGradientZ, normalizedAge)\n );\n #ifdef RENDERER_VOL_IS_RANDOM_TWO\n vec3 minVel = vec3(\n evaluateParticleCurve(renderer_VOLMinGradientX, normalizedAge),\n evaluateParticleCurve(renderer_VOLMinGradientY, normalizedAge),\n evaluateParticleCurve(renderer_VOLMinGradientZ, normalizedAge)\n );\n vel = mix(minVel, vel, a_Random1.yzw);\n #endif\n #endif\n #endif\n return vel;\n}\n\n// Get FOL instantaneous acceleration at normalizedAge\nvec3 getFOLAcceleration(float normalizedAge) {\n vec3 acc = vec3(0.0);\n #ifdef _FOL_MODULE_ENABLED\n #ifdef RENDERER_FOL_CONSTANT_MODE\n acc = renderer_FOLMaxConst;\n #ifdef RENDERER_FOL_IS_RANDOM_TWO\n acc = mix(renderer_FOLMinConst, acc, vec3(a_Random2.x, a_Random2.y, a_Random2.z));\n #endif\n #endif\n #ifdef RENDERER_FOL_CURVE_MODE\n acc = vec3(\n evaluateParticleCurve(renderer_FOLMaxGradientX, normalizedAge),\n evaluateParticleCurve(renderer_FOLMaxGradientY, normalizedAge),\n evaluateParticleCurve(renderer_FOLMaxGradientZ, normalizedAge)\n );\n #ifdef RENDERER_FOL_IS_RANDOM_TWO\n vec3 minAcc = vec3(\n evaluateParticleCurve(renderer_FOLMinGradientX, normalizedAge),\n evaluateParticleCurve(renderer_FOLMinGradientY, normalizedAge),\n evaluateParticleCurve(renderer_FOLMinGradientZ, normalizedAge)\n );\n acc = mix(minAcc, acc, vec3(a_Random2.x, a_Random2.y, a_Random2.z));\n #endif\n #endif\n #endif\n return acc;\n}\n\nvoid main() {\n float age = renderer_CurrentTime - a_DirectionTime.w;\n float lifetime = a_ShapePositionStartLifeTime.w;\n float normalizedAge = age / lifetime;\n // Clamp to age on the first TF pass: particles emitted mid-frame have age < dt,\n // so using the full dt would over-integrate. Subsequent passes are unaffected (age >= dt).\n float dt = min(renderer_DeltaTime, age);\n\n // normalizedAge < 0.0: stale TF slot whose startTime is from a previous playback (e.g. after StopEmittingAndClear).\n if (normalizedAge >= 1.0 || normalizedAge < 0.0) {\n v_FeedbackPosition = a_FeedbackPosition;\n v_FeedbackVelocity = a_FeedbackVelocity;\n gl_Position = vec4(0.0);\n return;\n }\n\n vec4 worldRotation;\n if (renderer_SimulationSpace == 0) {\n worldRotation = renderer_WorldRotation;\n } else {\n worldRotation = a_SimulationWorldRotation;\n }\n vec4 invWorldRotation = quaternionConjugate(worldRotation);\n\n // Read previous frame state (initialized by CPU on particle birth)\n vec3 localVelocity = a_FeedbackVelocity;\n\n // =====================================================\n // Step 1: Apply velocity module deltas (VOL + FOL + Gravity)\n // =====================================================\n\n // Gravity (world space)\n vec3 gravityDelta = renderer_Gravity * a_Random0.x * dt;\n\n // VOL instantaneous velocity (animated velocity, not persisted)\n vec3 volLocal = vec3(0.0);\n vec3 volWorld = vec3(0.0);\n #ifdef _VOL_MODULE_ENABLED\n vec3 vol = getVOLVelocity(normalizedAge);\n if (renderer_VOLSpace == 0) {\n volLocal = vol;\n } else {\n volWorld = vol;\n }\n #endif\n\n // FOL acceleration → velocity delta (always persisted, like gravity)\n vec3 folDeltaLocal = vec3(0.0);\n #ifdef _FOL_MODULE_ENABLED\n vec3 folAcc = getFOLAcceleration(normalizedAge);\n vec3 folVelDelta = folAcc * dt;\n if (renderer_FOLSpace == 0) {\n folDeltaLocal = folVelDelta;\n } else {\n // World FOL: convert to local and persist, same as gravity\n folDeltaLocal = rotationByQuaternions(folVelDelta, invWorldRotation);\n }\n #endif\n\n // Gravity and FOL contribute to base velocity (persisted, subject to dampen/drag).\n vec3 gravityLocal = rotationByQuaternions(gravityDelta, invWorldRotation);\n localVelocity += folDeltaLocal + gravityLocal;\n\n // =====================================================\n // Step 2 & 3: Dampen (Limit Velocity) + Drag\n // VOL must be projected into the LVL target space so that\n // limit/drag see the full velocity regardless of VOL.space vs LVL.space.\n // =====================================================\n #ifdef RENDERER_LVL_MODULE_ENABLED\n // Precompute VOL in both spaces\n vec3 volAsLocal = volLocal + rotationByQuaternions(volWorld, invWorldRotation);\n vec3 volAsWorld = rotationByQuaternions(volLocal, worldRotation) + volWorld;\n\n float limitRand = a_Random2.w;\n float dampen = renderer_LVLDampen;\n // Frame-rate independent dampen (30fps as reference)\n float effectiveDampen = 1.0 - pow(1.0 - dampen, dt * 30.0);\n\n if (renderer_LVLSpace == 0) {\n // Local space: total = base + all VOL projected to local\n vec3 totalLocal = localVelocity + volAsLocal;\n vec3 dampenedTotal = applyLVLSpeedLimitTF(totalLocal, normalizedAge, limitRand, effectiveDampen);\n localVelocity = dampenedTotal - volAsLocal;\n } else {\n // World space: total = rotated base + all VOL projected to world\n vec3 totalWorld = rotationByQuaternions(localVelocity, worldRotation) + volAsWorld;\n vec3 dampenedTotal = applyLVLSpeedLimitTF(totalWorld, normalizedAge, limitRand, effectiveDampen);\n localVelocity = rotationByQuaternions(dampenedTotal - volAsWorld, invWorldRotation);\n }\n\n // Drag: same space as dampen\n {\n float dragCoeff = evaluateLVLDrag(normalizedAge, a_Random2.w);\n if (dragCoeff > 0.0) {\n vec3 totalVel;\n if (renderer_LVLSpace == 0) {\n totalVel = localVelocity + volAsLocal;\n } else {\n totalVel = rotationByQuaternions(localVelocity, worldRotation) + volAsWorld;\n }\n float velMagSqr = dot(totalVel, totalVel);\n float velMag = sqrt(velMagSqr);\n\n float drag = dragCoeff;\n\n #ifdef RENDERER_LVL_DRAG_MULTIPLY_SIZE\n float maxDim = max(a_StartSize.x, max(a_StartSize.y, a_StartSize.z));\n float radius = maxDim * 0.5;\n drag *= 3.14159265 * radius * radius;\n #endif\n\n #ifdef RENDERER_LVL_DRAG_MULTIPLY_VELOCITY\n drag *= velMagSqr;\n #endif\n\n if (velMag > 0.0) {\n float newVelMag = max(0.0, velMag - drag * dt);\n vec3 draggedTotal = totalVel * (newVelMag / velMag);\n if (renderer_LVLSpace == 0) {\n localVelocity = draggedTotal - volAsLocal;\n } else {\n localVelocity = rotationByQuaternions(draggedTotal - volAsWorld, invWorldRotation);\n }\n }\n }\n }\n #endif\n\n // =====================================================\n // Step 4: Integrate position in simulation space\n // Local mode: position in local space, velocity rotated to local\n // World mode: position in world space, velocity rotated to world\n // =====================================================\n // FOL is now fully in localVelocity (both local and world-space FOL).\n // Only VOL overlay needs to be added here.\n vec3 totalVelocity;\n if (renderer_SimulationSpace == 0) {\n // Local: integrate in local space\n totalVelocity = localVelocity + volLocal\n + rotationByQuaternions(volWorld, invWorldRotation);\n } else {\n // World: integrate in world space\n totalVelocity = rotationByQuaternions(localVelocity + volLocal, worldRotation) + volWorld;\n }\n vec3 position = a_FeedbackPosition + totalVelocity * dt;\n\n v_FeedbackPosition = position;\n v_FeedbackVelocity = localVelocity;\n gl_Position = vec4(0.0);\n}\n"; // eslint-disable-line
|
|
4918
4918
|
|
|
@@ -34966,10 +34966,10 @@ __decorate([
|
|
|
34966
34966
|
_inherits(LimitVelocityOverLifetimeModule, ParticleGeneratorModule);
|
|
34967
34967
|
function LimitVelocityOverLifetimeModule(generator) {
|
|
34968
34968
|
var _this;
|
|
34969
|
-
_this = ParticleGeneratorModule.call(this, generator) || this, /** @internal */ _this.
|
|
34970
|
-
_this.
|
|
34971
|
-
_this.
|
|
34972
|
-
_this.
|
|
34969
|
+
_this = ParticleGeneratorModule.call(this, generator) || this, /** @internal */ _this._speedRand = new Rand(0, ParticleRandomSubSeeds.LimitVelocityOverLifetime), _this._speedMinConstantVec = new Vector3(), _this._speedMaxConstantVec = new Vector3(), _this._dragConstantVec = new Vector2(), _this._separateAxes = false, _this._dampen = 0, _this._multiplyDragByParticleSize = false, _this._multiplyDragByParticleVelocity = false, _this._space = ParticleSimulationSpace.Local;
|
|
34970
|
+
_this.speedX = new ParticleCompositeCurve(1);
|
|
34971
|
+
_this.speedY = new ParticleCompositeCurve(1);
|
|
34972
|
+
_this.speedZ = new ParticleCompositeCurve(1);
|
|
34973
34973
|
_this.drag = new ParticleCompositeCurve(0);
|
|
34974
34974
|
return _this;
|
|
34975
34975
|
}
|
|
@@ -34981,19 +34981,19 @@ __decorate([
|
|
|
34981
34981
|
};
|
|
34982
34982
|
/**
|
|
34983
34983
|
* @internal
|
|
34984
|
-
*/ _proto.
|
|
34984
|
+
*/ _proto._isSpeedRandomMode = function _isSpeedRandomMode() {
|
|
34985
34985
|
if (this._separateAxes) {
|
|
34986
|
-
return (this.
|
|
34986
|
+
return (this._speedX.mode === ParticleCurveMode.TwoConstants || this._speedX.mode === ParticleCurveMode.TwoCurves) && (this._speedY.mode === ParticleCurveMode.TwoConstants || this._speedY.mode === ParticleCurveMode.TwoCurves) && (this._speedZ.mode === ParticleCurveMode.TwoConstants || this._speedZ.mode === ParticleCurveMode.TwoCurves);
|
|
34987
34987
|
}
|
|
34988
|
-
return this.
|
|
34988
|
+
return this._speedX.mode === ParticleCurveMode.TwoConstants || this._speedX.mode === ParticleCurveMode.TwoCurves;
|
|
34989
34989
|
};
|
|
34990
34990
|
/**
|
|
34991
34991
|
* @internal
|
|
34992
34992
|
*/ _proto._updateShaderData = function _updateShaderData(shaderData) {
|
|
34993
34993
|
var enabledModuleMacro = null;
|
|
34994
34994
|
var separateAxesMacro = null;
|
|
34995
|
-
var
|
|
34996
|
-
var
|
|
34995
|
+
var speedModeMacro = null;
|
|
34996
|
+
var speedRandomMacro = null;
|
|
34997
34997
|
var dragCurveMacro = null;
|
|
34998
34998
|
var dragRandomMacro = null;
|
|
34999
34999
|
var dragSizeMacro = null;
|
|
@@ -35004,16 +35004,16 @@ __decorate([
|
|
|
35004
35004
|
shaderData.setFloat(LimitVelocityOverLifetimeModule._dampenProperty, this._dampen);
|
|
35005
35005
|
// Space
|
|
35006
35006
|
shaderData.setInt(LimitVelocityOverLifetimeModule._spaceProperty, this._space);
|
|
35007
|
-
// Limit
|
|
35007
|
+
// Limit speed
|
|
35008
35008
|
if (this._separateAxes) {
|
|
35009
35009
|
separateAxesMacro = LimitVelocityOverLifetimeModule._separateAxesMacro;
|
|
35010
|
-
var result = this.
|
|
35011
|
-
|
|
35012
|
-
|
|
35010
|
+
var result = this._uploadSeparateAxisSpeeds(shaderData);
|
|
35011
|
+
speedModeMacro = result.modeMacro;
|
|
35012
|
+
speedRandomMacro = result.randomMacro;
|
|
35013
35013
|
} else {
|
|
35014
|
-
var result1 = this.
|
|
35015
|
-
|
|
35016
|
-
|
|
35014
|
+
var result1 = this._uploadScalarSpeed(shaderData);
|
|
35015
|
+
speedModeMacro = result1.modeMacro;
|
|
35016
|
+
speedRandomMacro = result1.randomMacro;
|
|
35017
35017
|
}
|
|
35018
35018
|
// Drag
|
|
35019
35019
|
var dragResult = this._uploadDrag(shaderData);
|
|
@@ -35029,8 +35029,8 @@ __decorate([
|
|
|
35029
35029
|
}
|
|
35030
35030
|
this._enabledModuleMacro = this._enableMacro(shaderData, this._enabledModuleMacro, enabledModuleMacro);
|
|
35031
35031
|
this._separateAxesCachedMacro = this._enableMacro(shaderData, this._separateAxesCachedMacro, separateAxesMacro);
|
|
35032
|
-
this.
|
|
35033
|
-
this.
|
|
35032
|
+
this._speedModeMacro = this._enableMacro(shaderData, this._speedModeMacro, speedModeMacro);
|
|
35033
|
+
this._speedRandomMacro = this._enableMacro(shaderData, this._speedRandomMacro, speedRandomMacro);
|
|
35034
35034
|
this._dragCurveCachedMacro = this._enableMacro(shaderData, this._dragCurveCachedMacro, dragCurveMacro);
|
|
35035
35035
|
this._dragRandomCachedMacro = this._enableMacro(shaderData, this._dragRandomCachedMacro, dragRandomMacro);
|
|
35036
35036
|
this._dragSizeMacro = this._enableMacro(shaderData, this._dragSizeMacro, dragSizeMacro);
|
|
@@ -35039,26 +35039,26 @@ __decorate([
|
|
|
35039
35039
|
/**
|
|
35040
35040
|
* @internal
|
|
35041
35041
|
*/ _proto._resetRandomSeed = function _resetRandomSeed(seed) {
|
|
35042
|
-
this.
|
|
35042
|
+
this._speedRand.reset(seed, ParticleRandomSubSeeds.LimitVelocityOverLifetime);
|
|
35043
35043
|
};
|
|
35044
|
-
_proto.
|
|
35045
|
-
var
|
|
35044
|
+
_proto._uploadScalarSpeed = function _uploadScalarSpeed(shaderData) {
|
|
35045
|
+
var speedX = this._speedX;
|
|
35046
35046
|
var modeMacro = null;
|
|
35047
35047
|
var randomMacro = null;
|
|
35048
|
-
var isRandomCurveMode =
|
|
35049
|
-
if (isRandomCurveMode ||
|
|
35050
|
-
shaderData.setFloatArray(LimitVelocityOverLifetimeModule.
|
|
35051
|
-
modeMacro = LimitVelocityOverLifetimeModule.
|
|
35048
|
+
var isRandomCurveMode = speedX.mode === ParticleCurveMode.TwoCurves;
|
|
35049
|
+
if (isRandomCurveMode || speedX.mode === ParticleCurveMode.Curve) {
|
|
35050
|
+
shaderData.setFloatArray(LimitVelocityOverLifetimeModule._speedMaxCurveProperty, speedX.curveMax._getTypeArray());
|
|
35051
|
+
modeMacro = LimitVelocityOverLifetimeModule._speedCurveModeMacro;
|
|
35052
35052
|
if (isRandomCurveMode) {
|
|
35053
|
-
shaderData.setFloatArray(LimitVelocityOverLifetimeModule.
|
|
35054
|
-
randomMacro = LimitVelocityOverLifetimeModule.
|
|
35053
|
+
shaderData.setFloatArray(LimitVelocityOverLifetimeModule._speedMinCurveProperty, speedX.curveMin._getTypeArray());
|
|
35054
|
+
randomMacro = LimitVelocityOverLifetimeModule._speedIsRandomMacro;
|
|
35055
35055
|
}
|
|
35056
35056
|
} else {
|
|
35057
|
-
shaderData.setFloat(LimitVelocityOverLifetimeModule.
|
|
35058
|
-
modeMacro = LimitVelocityOverLifetimeModule.
|
|
35059
|
-
if (
|
|
35060
|
-
shaderData.setFloat(LimitVelocityOverLifetimeModule.
|
|
35061
|
-
randomMacro = LimitVelocityOverLifetimeModule.
|
|
35057
|
+
shaderData.setFloat(LimitVelocityOverLifetimeModule._speedMaxConstProperty, speedX.constantMax);
|
|
35058
|
+
modeMacro = LimitVelocityOverLifetimeModule._speedConstantModeMacro;
|
|
35059
|
+
if (speedX.mode === ParticleCurveMode.TwoConstants) {
|
|
35060
|
+
shaderData.setFloat(LimitVelocityOverLifetimeModule._speedMinConstProperty, speedX.constantMin);
|
|
35061
|
+
randomMacro = LimitVelocityOverLifetimeModule._speedIsRandomMacro;
|
|
35062
35062
|
}
|
|
35063
35063
|
}
|
|
35064
35064
|
return {
|
|
@@ -35066,34 +35066,34 @@ __decorate([
|
|
|
35066
35066
|
randomMacro: randomMacro
|
|
35067
35067
|
};
|
|
35068
35068
|
};
|
|
35069
|
-
_proto.
|
|
35070
|
-
var
|
|
35071
|
-
var
|
|
35072
|
-
var
|
|
35069
|
+
_proto._uploadSeparateAxisSpeeds = function _uploadSeparateAxisSpeeds(shaderData) {
|
|
35070
|
+
var speedX = this._speedX;
|
|
35071
|
+
var speedY = this._speedY;
|
|
35072
|
+
var speedZ = this._speedZ;
|
|
35073
35073
|
var modeMacro = null;
|
|
35074
35074
|
var randomMacro = null;
|
|
35075
|
-
var isRandomCurveMode =
|
|
35076
|
-
if (isRandomCurveMode ||
|
|
35077
|
-
shaderData.setFloatArray(LimitVelocityOverLifetimeModule.
|
|
35078
|
-
shaderData.setFloatArray(LimitVelocityOverLifetimeModule.
|
|
35079
|
-
shaderData.setFloatArray(LimitVelocityOverLifetimeModule.
|
|
35080
|
-
modeMacro = LimitVelocityOverLifetimeModule.
|
|
35075
|
+
var isRandomCurveMode = speedX.mode === ParticleCurveMode.TwoCurves && speedY.mode === ParticleCurveMode.TwoCurves && speedZ.mode === ParticleCurveMode.TwoCurves;
|
|
35076
|
+
if (isRandomCurveMode || speedX.mode === ParticleCurveMode.Curve && speedY.mode === ParticleCurveMode.Curve && speedZ.mode === ParticleCurveMode.Curve) {
|
|
35077
|
+
shaderData.setFloatArray(LimitVelocityOverLifetimeModule._speedXMaxCurveProperty, speedX.curveMax._getTypeArray());
|
|
35078
|
+
shaderData.setFloatArray(LimitVelocityOverLifetimeModule._speedYMaxCurveProperty, speedY.curveMax._getTypeArray());
|
|
35079
|
+
shaderData.setFloatArray(LimitVelocityOverLifetimeModule._speedZMaxCurveProperty, speedZ.curveMax._getTypeArray());
|
|
35080
|
+
modeMacro = LimitVelocityOverLifetimeModule._speedCurveModeMacro;
|
|
35081
35081
|
if (isRandomCurveMode) {
|
|
35082
|
-
shaderData.setFloatArray(LimitVelocityOverLifetimeModule.
|
|
35083
|
-
shaderData.setFloatArray(LimitVelocityOverLifetimeModule.
|
|
35084
|
-
shaderData.setFloatArray(LimitVelocityOverLifetimeModule.
|
|
35085
|
-
randomMacro = LimitVelocityOverLifetimeModule.
|
|
35082
|
+
shaderData.setFloatArray(LimitVelocityOverLifetimeModule._speedXMinCurveProperty, speedX.curveMin._getTypeArray());
|
|
35083
|
+
shaderData.setFloatArray(LimitVelocityOverLifetimeModule._speedYMinCurveProperty, speedY.curveMin._getTypeArray());
|
|
35084
|
+
shaderData.setFloatArray(LimitVelocityOverLifetimeModule._speedZMinCurveProperty, speedZ.curveMin._getTypeArray());
|
|
35085
|
+
randomMacro = LimitVelocityOverLifetimeModule._speedIsRandomMacro;
|
|
35086
35086
|
}
|
|
35087
35087
|
} else {
|
|
35088
|
-
var constantMax = this.
|
|
35089
|
-
constantMax.set(
|
|
35090
|
-
shaderData.setVector3(LimitVelocityOverLifetimeModule.
|
|
35091
|
-
modeMacro = LimitVelocityOverLifetimeModule.
|
|
35092
|
-
if (
|
|
35093
|
-
var constantMin = this.
|
|
35094
|
-
constantMin.set(
|
|
35095
|
-
shaderData.setVector3(LimitVelocityOverLifetimeModule.
|
|
35096
|
-
randomMacro = LimitVelocityOverLifetimeModule.
|
|
35088
|
+
var constantMax = this._speedMaxConstantVec;
|
|
35089
|
+
constantMax.set(speedX.constantMax, speedY.constantMax, speedZ.constantMax);
|
|
35090
|
+
shaderData.setVector3(LimitVelocityOverLifetimeModule._speedMaxConstVecProperty, constantMax);
|
|
35091
|
+
modeMacro = LimitVelocityOverLifetimeModule._speedConstantModeMacro;
|
|
35092
|
+
if (speedX.mode === ParticleCurveMode.TwoConstants && speedY.mode === ParticleCurveMode.TwoConstants && speedZ.mode === ParticleCurveMode.TwoConstants) {
|
|
35093
|
+
var constantMin = this._speedMinConstantVec;
|
|
35094
|
+
constantMin.set(speedX.constantMin, speedY.constantMin, speedZ.constantMin);
|
|
35095
|
+
shaderData.setVector3(LimitVelocityOverLifetimeModule._speedMinConstVecProperty, constantMin);
|
|
35096
|
+
randomMacro = LimitVelocityOverLifetimeModule._speedIsRandomMacro;
|
|
35097
35097
|
}
|
|
35098
35098
|
}
|
|
35099
35099
|
return {
|
|
@@ -35143,57 +35143,57 @@ __decorate([
|
|
|
35143
35143
|
}
|
|
35144
35144
|
},
|
|
35145
35145
|
{
|
|
35146
|
-
key: "
|
|
35146
|
+
key: "speed",
|
|
35147
35147
|
get: /**
|
|
35148
35148
|
* Speed limit when separateAxes is false.
|
|
35149
35149
|
*/ function get() {
|
|
35150
|
-
return this.
|
|
35150
|
+
return this._speedX;
|
|
35151
35151
|
},
|
|
35152
35152
|
set: function set(value) {
|
|
35153
|
-
this.
|
|
35153
|
+
this.speedX = value;
|
|
35154
35154
|
}
|
|
35155
35155
|
},
|
|
35156
35156
|
{
|
|
35157
|
-
key: "
|
|
35157
|
+
key: "speedX",
|
|
35158
35158
|
get: /**
|
|
35159
35159
|
* Speed limit for the x-axis (or overall limit when separateAxes is false).
|
|
35160
35160
|
*/ function get() {
|
|
35161
|
-
return this.
|
|
35161
|
+
return this._speedX;
|
|
35162
35162
|
},
|
|
35163
35163
|
set: function set(value) {
|
|
35164
|
-
var lastValue = this.
|
|
35164
|
+
var lastValue = this._speedX;
|
|
35165
35165
|
if (value !== lastValue) {
|
|
35166
|
-
this.
|
|
35166
|
+
this._speedX = value;
|
|
35167
35167
|
this._onCompositeCurveChange(lastValue, value);
|
|
35168
35168
|
}
|
|
35169
35169
|
}
|
|
35170
35170
|
},
|
|
35171
35171
|
{
|
|
35172
|
-
key: "
|
|
35172
|
+
key: "speedY",
|
|
35173
35173
|
get: /**
|
|
35174
35174
|
* Speed limit for the y-axis.
|
|
35175
35175
|
*/ function get() {
|
|
35176
|
-
return this.
|
|
35176
|
+
return this._speedY;
|
|
35177
35177
|
},
|
|
35178
35178
|
set: function set(value) {
|
|
35179
|
-
var lastValue = this.
|
|
35179
|
+
var lastValue = this._speedY;
|
|
35180
35180
|
if (value !== lastValue) {
|
|
35181
|
-
this.
|
|
35181
|
+
this._speedY = value;
|
|
35182
35182
|
this._onCompositeCurveChange(lastValue, value);
|
|
35183
35183
|
}
|
|
35184
35184
|
}
|
|
35185
35185
|
},
|
|
35186
35186
|
{
|
|
35187
|
-
key: "
|
|
35187
|
+
key: "speedZ",
|
|
35188
35188
|
get: /**
|
|
35189
35189
|
* Speed limit for the z-axis.
|
|
35190
35190
|
*/ function get() {
|
|
35191
|
-
return this.
|
|
35191
|
+
return this._speedZ;
|
|
35192
35192
|
},
|
|
35193
35193
|
set: function set(value) {
|
|
35194
|
-
var lastValue = this.
|
|
35194
|
+
var lastValue = this._speedZ;
|
|
35195
35195
|
if (value !== lastValue) {
|
|
35196
|
-
this.
|
|
35196
|
+
this._speedZ = value;
|
|
35197
35197
|
this._onCompositeCurveChange(lastValue, value);
|
|
35198
35198
|
}
|
|
35199
35199
|
}
|
|
@@ -35261,6 +35261,7 @@ __decorate([
|
|
|
35261
35261
|
key: "space",
|
|
35262
35262
|
get: /**
|
|
35263
35263
|
* Specifies if the velocity limits are in local space or world space.
|
|
35264
|
+
* @remarks Only takes effect when 'separateAxes' is enabled.
|
|
35264
35265
|
*/ function get() {
|
|
35265
35266
|
return this._space;
|
|
35266
35267
|
},
|
|
@@ -35295,25 +35296,25 @@ __decorate([
|
|
|
35295
35296
|
}(ParticleGeneratorModule);
|
|
35296
35297
|
LimitVelocityOverLifetimeModule._enabledMacro = ShaderMacro.getByName("RENDERER_LVL_MODULE_ENABLED");
|
|
35297
35298
|
LimitVelocityOverLifetimeModule._separateAxesMacro = ShaderMacro.getByName("RENDERER_LVL_SEPARATE_AXES");
|
|
35298
|
-
LimitVelocityOverLifetimeModule.
|
|
35299
|
-
LimitVelocityOverLifetimeModule.
|
|
35300
|
-
LimitVelocityOverLifetimeModule.
|
|
35299
|
+
LimitVelocityOverLifetimeModule._speedConstantModeMacro = ShaderMacro.getByName("RENDERER_LVL_SPEED_CONSTANT_MODE");
|
|
35300
|
+
LimitVelocityOverLifetimeModule._speedCurveModeMacro = ShaderMacro.getByName("RENDERER_LVL_SPEED_CURVE_MODE");
|
|
35301
|
+
LimitVelocityOverLifetimeModule._speedIsRandomMacro = ShaderMacro.getByName("RENDERER_LVL_SPEED_IS_RANDOM_TWO");
|
|
35301
35302
|
LimitVelocityOverLifetimeModule._dragCurveModeMacro = ShaderMacro.getByName("RENDERER_LVL_DRAG_CURVE_MODE");
|
|
35302
35303
|
LimitVelocityOverLifetimeModule._dragIsRandomMacro = ShaderMacro.getByName("RENDERER_LVL_DRAG_IS_RANDOM_TWO");
|
|
35303
35304
|
LimitVelocityOverLifetimeModule._multiplyDragBySizeMacro = ShaderMacro.getByName("RENDERER_LVL_DRAG_MULTIPLY_SIZE");
|
|
35304
35305
|
LimitVelocityOverLifetimeModule._multiplyDragByVelocityMacro = ShaderMacro.getByName("RENDERER_LVL_DRAG_MULTIPLY_VELOCITY");
|
|
35305
|
-
LimitVelocityOverLifetimeModule.
|
|
35306
|
-
LimitVelocityOverLifetimeModule.
|
|
35307
|
-
LimitVelocityOverLifetimeModule.
|
|
35308
|
-
LimitVelocityOverLifetimeModule.
|
|
35309
|
-
LimitVelocityOverLifetimeModule.
|
|
35310
|
-
LimitVelocityOverLifetimeModule.
|
|
35311
|
-
LimitVelocityOverLifetimeModule.
|
|
35312
|
-
LimitVelocityOverLifetimeModule.
|
|
35313
|
-
LimitVelocityOverLifetimeModule.
|
|
35314
|
-
LimitVelocityOverLifetimeModule.
|
|
35315
|
-
LimitVelocityOverLifetimeModule.
|
|
35316
|
-
LimitVelocityOverLifetimeModule.
|
|
35306
|
+
LimitVelocityOverLifetimeModule._speedMaxConstProperty = ShaderProperty.getByName("renderer_LVLSpeedMaxConst");
|
|
35307
|
+
LimitVelocityOverLifetimeModule._speedMinConstProperty = ShaderProperty.getByName("renderer_LVLSpeedMinConst");
|
|
35308
|
+
LimitVelocityOverLifetimeModule._speedMaxCurveProperty = ShaderProperty.getByName("renderer_LVLSpeedMaxCurve");
|
|
35309
|
+
LimitVelocityOverLifetimeModule._speedMinCurveProperty = ShaderProperty.getByName("renderer_LVLSpeedMinCurve");
|
|
35310
|
+
LimitVelocityOverLifetimeModule._speedMaxConstVecProperty = ShaderProperty.getByName("renderer_LVLSpeedMaxConstVector");
|
|
35311
|
+
LimitVelocityOverLifetimeModule._speedMinConstVecProperty = ShaderProperty.getByName("renderer_LVLSpeedMinConstVector");
|
|
35312
|
+
LimitVelocityOverLifetimeModule._speedXMaxCurveProperty = ShaderProperty.getByName("renderer_LVLSpeedXMaxCurve");
|
|
35313
|
+
LimitVelocityOverLifetimeModule._speedXMinCurveProperty = ShaderProperty.getByName("renderer_LVLSpeedXMinCurve");
|
|
35314
|
+
LimitVelocityOverLifetimeModule._speedYMaxCurveProperty = ShaderProperty.getByName("renderer_LVLSpeedYMaxCurve");
|
|
35315
|
+
LimitVelocityOverLifetimeModule._speedYMinCurveProperty = ShaderProperty.getByName("renderer_LVLSpeedYMinCurve");
|
|
35316
|
+
LimitVelocityOverLifetimeModule._speedZMaxCurveProperty = ShaderProperty.getByName("renderer_LVLSpeedZMaxCurve");
|
|
35317
|
+
LimitVelocityOverLifetimeModule._speedZMinCurveProperty = ShaderProperty.getByName("renderer_LVLSpeedZMinCurve");
|
|
35317
35318
|
LimitVelocityOverLifetimeModule._dampenProperty = ShaderProperty.getByName("renderer_LVLDampen");
|
|
35318
35319
|
LimitVelocityOverLifetimeModule._dragConstantProperty = ShaderProperty.getByName("renderer_LVLDragConstant");
|
|
35319
35320
|
LimitVelocityOverLifetimeModule._dragMaxCurveProperty = ShaderProperty.getByName("renderer_LVLDragMaxCurve");
|
|
@@ -35321,13 +35322,13 @@ LimitVelocityOverLifetimeModule._dragMinCurveProperty = ShaderProperty.getByName
|
|
|
35321
35322
|
LimitVelocityOverLifetimeModule._spaceProperty = ShaderProperty.getByName("renderer_LVLSpace");
|
|
35322
35323
|
__decorate([
|
|
35323
35324
|
ignoreClone
|
|
35324
|
-
], LimitVelocityOverLifetimeModule.prototype, "
|
|
35325
|
+
], LimitVelocityOverLifetimeModule.prototype, "_speedRand", void 0);
|
|
35325
35326
|
__decorate([
|
|
35326
35327
|
ignoreClone
|
|
35327
|
-
], LimitVelocityOverLifetimeModule.prototype, "
|
|
35328
|
+
], LimitVelocityOverLifetimeModule.prototype, "_speedMinConstantVec", void 0);
|
|
35328
35329
|
__decorate([
|
|
35329
35330
|
ignoreClone
|
|
35330
|
-
], LimitVelocityOverLifetimeModule.prototype, "
|
|
35331
|
+
], LimitVelocityOverLifetimeModule.prototype, "_speedMaxConstantVec", void 0);
|
|
35331
35332
|
__decorate([
|
|
35332
35333
|
ignoreClone
|
|
35333
35334
|
], LimitVelocityOverLifetimeModule.prototype, "_dragConstantVec", void 0);
|
|
@@ -35339,10 +35340,10 @@ __decorate([
|
|
|
35339
35340
|
], LimitVelocityOverLifetimeModule.prototype, "_separateAxesCachedMacro", void 0);
|
|
35340
35341
|
__decorate([
|
|
35341
35342
|
ignoreClone
|
|
35342
|
-
], LimitVelocityOverLifetimeModule.prototype, "
|
|
35343
|
+
], LimitVelocityOverLifetimeModule.prototype, "_speedModeMacro", void 0);
|
|
35343
35344
|
__decorate([
|
|
35344
35345
|
ignoreClone
|
|
35345
|
-
], LimitVelocityOverLifetimeModule.prototype, "
|
|
35346
|
+
], LimitVelocityOverLifetimeModule.prototype, "_speedRandomMacro", void 0);
|
|
35346
35347
|
__decorate([
|
|
35347
35348
|
ignoreClone
|
|
35348
35349
|
], LimitVelocityOverLifetimeModule.prototype, "_dragCurveCachedMacro", void 0);
|
|
@@ -35357,13 +35358,13 @@ __decorate([
|
|
|
35357
35358
|
], LimitVelocityOverLifetimeModule.prototype, "_dragVelocityMacro", void 0);
|
|
35358
35359
|
__decorate([
|
|
35359
35360
|
deepClone
|
|
35360
|
-
], LimitVelocityOverLifetimeModule.prototype, "
|
|
35361
|
+
], LimitVelocityOverLifetimeModule.prototype, "_speedX", void 0);
|
|
35361
35362
|
__decorate([
|
|
35362
35363
|
deepClone
|
|
35363
|
-
], LimitVelocityOverLifetimeModule.prototype, "
|
|
35364
|
+
], LimitVelocityOverLifetimeModule.prototype, "_speedY", void 0);
|
|
35364
35365
|
__decorate([
|
|
35365
35366
|
deepClone
|
|
35366
|
-
], LimitVelocityOverLifetimeModule.prototype, "
|
|
35367
|
+
], LimitVelocityOverLifetimeModule.prototype, "_speedZ", void 0);
|
|
35367
35368
|
__decorate([
|
|
35368
35369
|
deepClone
|
|
35369
35370
|
], LimitVelocityOverLifetimeModule.prototype, "_drag", void 0);
|
|
@@ -37060,8 +37061,8 @@ __decorate([
|
|
|
37060
37061
|
instanceVertices[offset + 40] = rand1.random();
|
|
37061
37062
|
}
|
|
37062
37063
|
var limitVelocityOverLifetime = this.limitVelocityOverLifetime;
|
|
37063
|
-
if (limitVelocityOverLifetime.enabled && (limitVelocityOverLifetime.
|
|
37064
|
-
instanceVertices[offset + 41] = limitVelocityOverLifetime.
|
|
37064
|
+
if (limitVelocityOverLifetime.enabled && (limitVelocityOverLifetime._isSpeedRandomMode() || limitVelocityOverLifetime._isDragRandomMode())) {
|
|
37065
|
+
instanceVertices[offset + 41] = limitVelocityOverLifetime._speedRand.random();
|
|
37065
37066
|
}
|
|
37066
37067
|
// Initialize feedback buffer for this particle
|
|
37067
37068
|
if (this._useTransformFeedback) {
|