@newkrok/three-particles 2.8.0 → 2.9.0
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.d.ts +2 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/three-particles.min.js +1 -1
- package/dist/three-particles.min.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1492,6 +1492,7 @@ declare const enum CurveFunctionId {
|
|
|
1492
1492
|
/** Bounce easing - bounces at both start and end */
|
|
1493
1493
|
BOUNCE_IN_OUT = "BOUNCE_IN_OUT"
|
|
1494
1494
|
}
|
|
1495
|
+
declare const curveFunctionIdMap: Partial<Record<CurveFunctionId, CurveFunction>>;
|
|
1495
1496
|
/**
|
|
1496
1497
|
* Resolves a curve function from an identifier or returns the function itself.
|
|
1497
1498
|
*
|
|
@@ -1851,4 +1852,4 @@ declare const getDefaultParticleSystemConfig: () => any;
|
|
|
1851
1852
|
declare const createParticleSystem: (config?: ParticleSystemConfig, externalNow?: number) => ParticleSystem;
|
|
1852
1853
|
declare const updateParticleSystems: (cycleData: CycleData) => void;
|
|
1853
1854
|
|
|
1854
|
-
export { type BezierCurve, type BezierPoint, type Box, type Burst, type BurstState, type Circle, type Cone, type Constant, type CurveBase, type CurveFunction, CurveFunctionId, type CycleData, type EasingCurve, type Emission, EmitFrom, type GeneralData, LifeTimeCurve, type LifetimeCurve, type MinMaxColor, type Noise, type NoiseConfig, type NormalizedParticleSystemConfig, type ParticleSystem, type ParticleSystemConfig, type ParticleSystemInstance, type Point3D, type RandomBetweenTwoConstants, type Rectangle, type Renderer, type Rgb, Shape, type ShapeConfig, SimulationSpace, type Sphere, type SubEmitterConfig, SubEmitterTrigger, type TextureSheetAnimation, TimeMode, type Transform, type VelocityOverLifetime, applyModifiers, blendingMap, calculateRandomPositionAndVelocityOnBox, calculateRandomPositionAndVelocityOnCircle, calculateRandomPositionAndVelocityOnCone, calculateRandomPositionAndVelocityOnRectangle, calculateRandomPositionAndVelocityOnSphere, calculateValue, createBezierCurveFunction, createDefaultParticleTexture, createParticleSystem, getBezierCacheSize, getCurveFunction, getCurveFunctionFromConfig, getDefaultParticleSystemConfig, isLifeTimeCurve, removeBezierCurveFunction, updateParticleSystems };
|
|
1855
|
+
export { type BezierCurve, type BezierPoint, type Box, type Burst, type BurstState, type Circle, type Cone, type Constant, type CurveBase, type CurveFunction, CurveFunctionId, type CycleData, type EasingCurve, type Emission, EmitFrom, type GeneralData, LifeTimeCurve, type LifetimeCurve, type MinMaxColor, type Noise, type NoiseConfig, type NormalizedParticleSystemConfig, type ParticleSystem, type ParticleSystemConfig, type ParticleSystemInstance, type Point3D, type RandomBetweenTwoConstants, type Rectangle, type Renderer, type Rgb, Shape, type ShapeConfig, SimulationSpace, type Sphere, type SubEmitterConfig, SubEmitterTrigger, type TextureSheetAnimation, TimeMode, type Transform, type VelocityOverLifetime, applyModifiers, blendingMap, calculateRandomPositionAndVelocityOnBox, calculateRandomPositionAndVelocityOnCircle, calculateRandomPositionAndVelocityOnCone, calculateRandomPositionAndVelocityOnRectangle, calculateRandomPositionAndVelocityOnSphere, calculateValue, createBezierCurveFunction, createDefaultParticleTexture, createParticleSystem, curveFunctionIdMap, getBezierCacheSize, getCurveFunction, getCurveFunctionFromConfig, getDefaultParticleSystemConfig, isLifeTimeCurve, removeBezierCurveFunction, updateParticleSystems };
|
package/dist/index.js
CHANGED
|
@@ -95,7 +95,7 @@ var CurveFunctionId = /* @__PURE__ */ ((CurveFunctionId2) => {
|
|
|
95
95
|
CurveFunctionId2["BOUNCE_IN_OUT"] = "BOUNCE_IN_OUT";
|
|
96
96
|
return CurveFunctionId2;
|
|
97
97
|
})(CurveFunctionId || {});
|
|
98
|
-
var
|
|
98
|
+
var curveFunctionIdMap = {
|
|
99
99
|
["LINEAR" /* LINEAR */]: Easing.Linear.None,
|
|
100
100
|
["QUADRATIC_IN" /* QUADRATIC_IN */]: Easing.Quadratic.In,
|
|
101
101
|
["QUADRATIC_OUT" /* QUADRATIC_OUT */]: Easing.Quadratic.Out,
|
|
@@ -128,7 +128,7 @@ var CurveFunctionIdMap = {
|
|
|
128
128
|
["BOUNCE_OUT" /* BOUNCE_OUT */]: Easing.Bounce.Out,
|
|
129
129
|
["BOUNCE_IN_OUT" /* BOUNCE_IN_OUT */]: Easing.Bounce.InOut
|
|
130
130
|
};
|
|
131
|
-
var getCurveFunction = (curveFunctionId) => typeof curveFunctionId === "function" ? curveFunctionId :
|
|
131
|
+
var getCurveFunction = (curveFunctionId) => typeof curveFunctionId === "function" ? curveFunctionId : curveFunctionIdMap[curveFunctionId];
|
|
132
132
|
|
|
133
133
|
// src/js/effects/three-particles/three-particles-enums.ts
|
|
134
134
|
var SimulationSpace = /* @__PURE__ */ ((SimulationSpace2) => {
|
|
@@ -849,6 +849,7 @@ var destroyParticleSystem = (particleSystem) => {
|
|
|
849
849
|
else savedParticleSystem.material.dispose();
|
|
850
850
|
if (savedParticleSystem.parent)
|
|
851
851
|
savedParticleSystem.parent.remove(savedParticleSystem);
|
|
852
|
+
if (wrapper?.parent) wrapper.parent.remove(wrapper);
|
|
852
853
|
return false;
|
|
853
854
|
}
|
|
854
855
|
);
|
|
@@ -1332,8 +1333,8 @@ var createParticleSystem = (config = DEFAULT_PARTICLE_SYSTEM_CONFIG, externalNow
|
|
|
1332
1333
|
const cleanupCompletedInstances = (instances) => {
|
|
1333
1334
|
for (let i = instances.length - 1; i >= 0; i--) {
|
|
1334
1335
|
const sub = instances[i];
|
|
1335
|
-
const points = sub.instance;
|
|
1336
|
-
const isActiveArr = points
|
|
1336
|
+
const points = sub.instance instanceof THREE3.Points ? sub.instance : sub.instance.children[0];
|
|
1337
|
+
const isActiveArr = points?.geometry?.attributes?.isActive?.array;
|
|
1337
1338
|
if (!isActiveArr) {
|
|
1338
1339
|
sub.dispose();
|
|
1339
1340
|
instances.splice(i, 1);
|
|
@@ -1696,6 +1697,6 @@ var updateParticleSystems = (cycleData) => {
|
|
|
1696
1697
|
);
|
|
1697
1698
|
};
|
|
1698
1699
|
|
|
1699
|
-
export { CurveFunctionId, EmitFrom, LifeTimeCurve, Shape, SimulationSpace, SubEmitterTrigger, TimeMode, applyModifiers, blendingMap, calculateRandomPositionAndVelocityOnBox, calculateRandomPositionAndVelocityOnCircle, calculateRandomPositionAndVelocityOnCone, calculateRandomPositionAndVelocityOnRectangle, calculateRandomPositionAndVelocityOnSphere, calculateValue, createBezierCurveFunction, createDefaultParticleTexture, createParticleSystem, getBezierCacheSize, getCurveFunction, getCurveFunctionFromConfig, getDefaultParticleSystemConfig, isLifeTimeCurve, removeBezierCurveFunction, updateParticleSystems };
|
|
1700
|
+
export { CurveFunctionId, EmitFrom, LifeTimeCurve, Shape, SimulationSpace, SubEmitterTrigger, TimeMode, applyModifiers, blendingMap, calculateRandomPositionAndVelocityOnBox, calculateRandomPositionAndVelocityOnCircle, calculateRandomPositionAndVelocityOnCone, calculateRandomPositionAndVelocityOnRectangle, calculateRandomPositionAndVelocityOnSphere, calculateValue, createBezierCurveFunction, createDefaultParticleTexture, createParticleSystem, curveFunctionIdMap, getBezierCacheSize, getCurveFunction, getCurveFunctionFromConfig, getDefaultParticleSystemConfig, isLifeTimeCurve, removeBezierCurveFunction, updateParticleSystems };
|
|
1700
1701
|
//# sourceMappingURL=index.js.map
|
|
1701
1702
|
//# sourceMappingURL=index.js.map
|