sparcoon 0.2.0 → 0.3.1

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.
Files changed (81) hide show
  1. package/dist/emitter/FXEmitter.Internal.d.ts +4 -0
  2. package/dist/emitter/FXEmitter.Internal.js +20 -1
  3. package/dist/emitter/FXEmitter.d.ts +4 -4
  4. package/dist/emitter/FXEmitter.js +1 -2
  5. package/dist/emitter/behavior/{FXBehaviorModule.d.ts → FXBehavior.d.ts} +1 -1
  6. package/dist/emitter/behavior/{FXBehaviorModule.js → FXBehavior.js} +2 -2
  7. package/dist/emitter/behavior/FXBehaviorDirectionalGravity.d.ts +3 -3
  8. package/dist/emitter/behavior/FXBehaviorDirectionalGravity.js +2 -2
  9. package/dist/emitter/behavior/FXBehaviorPointGravity.d.ts +2 -2
  10. package/dist/emitter/behavior/FXBehaviorPointGravity.js +2 -2
  11. package/dist/emitter/behavior/FXBehaviorScaleOverLife.d.ts +3 -3
  12. package/dist/emitter/behavior/FXBehaviorScaleOverLife.js +2 -2
  13. package/dist/emitter/behavior/FXBehaviorTorqueDamping.d.ts +3 -3
  14. package/dist/emitter/behavior/FXBehaviorTorqueDamping.js +2 -2
  15. package/dist/emitter/behavior/FXBehaviorTorqueNoise.d.ts +2 -2
  16. package/dist/emitter/behavior/FXBehaviorTorqueNoise.js +2 -2
  17. package/dist/emitter/behavior/FXBehaviorVelocityDamping.d.ts +3 -3
  18. package/dist/emitter/behavior/FXBehaviorVelocityDamping.js +2 -2
  19. package/dist/emitter/behavior/FXBehaviorVelocityNoise.d.ts +2 -2
  20. package/dist/emitter/behavior/FXBehaviorVelocityNoise.js +2 -2
  21. package/dist/emitter/spawn/{FXSpawnModule.d.ts → FXSpawn.d.ts} +1 -1
  22. package/dist/emitter/spawn/{FXSpawnModule.js → FXSpawn.js} +2 -2
  23. package/dist/emitter/spawn/FXSpawnBox.d.ts +3 -3
  24. package/dist/emitter/spawn/FXSpawnBox.js +2 -2
  25. package/dist/emitter/spawn/{FXSpawnOffset.d.ts → FXSpawnPoint.d.ts} +3 -3
  26. package/dist/emitter/spawn/{FXSpawnOffset.js → FXSpawnPoint.js} +3 -3
  27. package/dist/emitter/spawn/FXSpawnRandomLifetime.d.ts +3 -3
  28. package/dist/emitter/spawn/FXSpawnRandomLifetime.js +2 -2
  29. package/dist/emitter/spawn/FXSpawnRandomRotation.d.ts +3 -3
  30. package/dist/emitter/spawn/FXSpawnRandomRotation.js +2 -2
  31. package/dist/emitter/spawn/FXSpawnRandomScale.d.ts +3 -3
  32. package/dist/emitter/spawn/FXSpawnRandomScale.js +2 -2
  33. package/dist/emitter/spawn/FXSpawnRandomTorque.d.ts +3 -3
  34. package/dist/emitter/spawn/FXSpawnRandomTorque.js +2 -2
  35. package/dist/emitter/spawn/FXSpawnRandomVelocity.d.ts +3 -3
  36. package/dist/emitter/spawn/FXSpawnRandomVelocity.js +2 -2
  37. package/dist/emitter/spawn/FXSpawnSphere.d.ts +2 -2
  38. package/dist/emitter/spawn/FXSpawnSphere.js +2 -2
  39. package/dist/index.d.ts +11 -7
  40. package/dist/index.js +10 -7
  41. package/dist/instancedParticle/FXInstancedParticle.Internal.d.ts +0 -4
  42. package/dist/instancedParticle/FXInstancedParticle.Internal.js +1 -19
  43. package/dist/materials/FXDiffuseMaterial/FXDiffuseMaterial.Internal.d.ts +6 -8
  44. package/dist/materials/FXDiffuseMaterial/FXDiffuseMaterial.Internal.js +84 -40
  45. package/dist/materials/FXDiffuseMaterial/FXDiffuseMaterial.d.ts +11 -11
  46. package/dist/materials/FXDiffuseMaterial/FXDiffuseMaterial.js +16 -8
  47. package/dist/materials/{FXMaterial.Internal.d.ts → FXMaterial/FXMaterial.Internal.d.ts} +3 -2
  48. package/dist/materials/{FXMaterial.Internal.js → FXMaterial/FXMaterial.Internal.js} +3 -3
  49. package/dist/materials/{FXMaterial.d.ts → FXMaterial/FXMaterial.d.ts} +7 -2
  50. package/dist/materials/FXMaterial/FXMaterial.js +25 -0
  51. package/dist/materials/FXUnlitMaterial/FXUnlitMaterial.Internal.d.ts +5 -3
  52. package/dist/materials/FXUnlitMaterial/FXUnlitMaterial.Internal.js +35 -20
  53. package/dist/materials/FXUnlitMaterial/FXUnlitMaterial.d.ts +4 -9
  54. package/dist/materials/FXUnlitMaterial/FXUnlitMaterial.js +2 -5
  55. package/dist/miscellaneous/miscellaneous.d.ts +1 -0
  56. package/dist/miscellaneous/miscellaneous.js +24 -1
  57. package/dist/{materials/color-nodes → nodes/color}/FXColorOverLifeNode.d.ts +0 -1
  58. package/dist/nodes/color/FXColorOverLifeNode.js +44 -0
  59. package/dist/nodes/normal/FXFlatNormalNode.d.ts +4 -0
  60. package/dist/nodes/normal/FXFlatNormalNode.js +14 -0
  61. package/dist/nodes/normal/FXNormalNode.d.ts +3 -0
  62. package/dist/nodes/normal/FXNormalNode.js +4 -0
  63. package/dist/nodes/normal/FXSphericalNormalNode.d.ts +4 -0
  64. package/dist/nodes/normal/FXSphericalNormalNode.js +19 -0
  65. package/dist/nodes/texture/FXAnimatedTextureNode.d.ts +12 -0
  66. package/dist/nodes/texture/FXAnimatedTextureNode.js +88 -0
  67. package/dist/nodes/texture/FXStaticTextureNode.d.ts +6 -0
  68. package/dist/nodes/texture/FXStaticTextureNode.js +34 -0
  69. package/dist/nodes/texture/FXTextureNode.d.ts +3 -0
  70. package/dist/nodes/texture/FXTextureNode.js +8 -0
  71. package/package.json +1 -1
  72. package/dist/materials/FXMaterial.js +0 -21
  73. package/dist/materials/color-nodes/FXAnimatedTextureNode.d.ts +0 -10
  74. package/dist/materials/color-nodes/FXAnimatedTextureNode.js +0 -41
  75. package/dist/materials/color-nodes/FXColorOverLifeNode.js +0 -38
  76. package/dist/materials/color-nodes/FXStaticTextureNode.d.ts +0 -5
  77. package/dist/materials/color-nodes/FXStaticTextureNode.js +0 -23
  78. package/dist/materials/miscellaneous.d.ts +0 -1
  79. package/dist/materials/miscellaneous.js +0 -25
  80. /package/dist/{materials/color-nodes → nodes/color}/FXColorNode.d.ts +0 -0
  81. /package/dist/{materials/color-nodes → nodes/color}/FXColorNode.js +0 -0
@@ -1,3 +1,4 @@
1
+ import type { FXPropertyName, GLTypeInfo } from "../instancedParticle/shared";
1
2
  export interface FXEmitterPlayOptions {
2
3
  duration: number;
3
4
  }
@@ -6,3 +7,6 @@ export declare const EMITTER_DEFAULT_CAPACITY_STEP = 32;
6
7
  export declare const EMITTER_DEFAULT_AUTOMATICALLY_DESTROY_MODULES = true;
7
8
  export declare const EMITTER_DEFAULT_CAST_SHADOW = false;
8
9
  export declare const EMITTER_DEFAULT_RECEIVE_SHADOW = false;
10
+ export declare function collectProperties(keeper: Record<string, GLTypeInfo>, modules: readonly {
11
+ requiredProperties?: Record<string, FXPropertyName>;
12
+ }[], debugContext: string): void;
@@ -1,7 +1,26 @@
1
+ import { resolveGLSLTypeInfo } from '../instancedParticle/shared.js';
2
+
1
3
  const EMITTER_DEFAULT_EXPECTED_CAPACITY = 32;
2
4
  const EMITTER_DEFAULT_CAPACITY_STEP = 32;
3
5
  const EMITTER_DEFAULT_AUTOMATICALLY_DESTROY_MODULES = true;
4
6
  const EMITTER_DEFAULT_CAST_SHADOW = false;
5
7
  const EMITTER_DEFAULT_RECEIVE_SHADOW = false;
8
+ function collectProperties(keeper, modules, debugContext) {
9
+ for (const module of modules) {
10
+ if (module.requiredProperties === undefined) {
11
+ continue;
12
+ }
13
+ for (const key in module.requiredProperties) {
14
+ const existingTypeInfo = keeper[key];
15
+ const newTypeInfo = resolveGLSLTypeInfo(module.requiredProperties[key]);
16
+ if (existingTypeInfo === undefined) {
17
+ keeper[key] = newTypeInfo;
18
+ }
19
+ else if (existingTypeInfo.glslTypeName !== newTypeInfo.glslTypeName) {
20
+ throw new Error(`${debugContext}: property conflict for "${key}"`);
21
+ }
22
+ }
23
+ }
24
+ }
6
25
 
7
- export { EMITTER_DEFAULT_AUTOMATICALLY_DESTROY_MODULES, EMITTER_DEFAULT_CAPACITY_STEP, EMITTER_DEFAULT_CAST_SHADOW, EMITTER_DEFAULT_EXPECTED_CAPACITY, EMITTER_DEFAULT_RECEIVE_SHADOW };
26
+ export { EMITTER_DEFAULT_AUTOMATICALLY_DESTROY_MODULES, EMITTER_DEFAULT_CAPACITY_STEP, EMITTER_DEFAULT_CAST_SHADOW, EMITTER_DEFAULT_EXPECTED_CAPACITY, EMITTER_DEFAULT_RECEIVE_SHADOW, collectProperties };
@@ -1,8 +1,8 @@
1
1
  import { Object3D } from "three";
2
- import type { FXMaterial } from "../materials/FXMaterial";
3
- import type { FXBehaviorModule } from "./behavior/FXBehaviorModule";
2
+ import type { FXMaterial } from "../materials/FXMaterial/FXMaterial";
3
+ import type { FXBehavior } from "./behavior/FXBehavior";
4
4
  import type { FXEmitterPlayOptions } from "./FXEmitter.Internal";
5
- import type { FXSpawnModule } from "./spawn/FXSpawnModule";
5
+ import type { FXSpawn } from "./spawn/FXSpawn";
6
6
  export interface FXEmitterOptions {
7
7
  expectedCapacity: number;
8
8
  capacityStep: number;
@@ -20,7 +20,7 @@ export declare class FXEmitter extends Object3D {
20
20
  private emissionAccumulator;
21
21
  private emissionDuration;
22
22
  private emissionElapsed;
23
- constructor(spawnSequence: FXSpawnModule[], behaviorSequence: readonly FXBehaviorModule[], material: FXMaterial, options?: Partial<FXEmitterOptions>);
23
+ constructor(spawnSequence: FXSpawn[], behaviorSequence: readonly FXBehavior[], material: FXMaterial, options?: Partial<FXEmitterOptions>);
24
24
  static onWillRender: (deltaTime: number) => void;
25
25
  destroy(): void;
26
26
  burst(count: number): void;
@@ -1,9 +1,8 @@
1
1
  import { Object3D } from 'three';
2
2
  import { FXInstancedParticle } from '../instancedParticle/FXInstancedParticle.js';
3
- import { collectProperties } from '../instancedParticle/FXInstancedParticle.Internal.js';
4
3
  import { resolveGLSLTypeInfo } from '../instancedParticle/shared.js';
5
4
  import { BUILTIN_OFFSET_AGE, BUILTIN_OFFSET_POSITION_X, BUILTIN_OFFSET_VELOCITY_X, BUILTIN_OFFSET_POSITION_Y, BUILTIN_OFFSET_VELOCITY_Y, BUILTIN_OFFSET_POSITION_Z, BUILTIN_OFFSET_VELOCITY_Z, BUILTIN_OFFSET_ROTATION, BUILTIN_OFFSET_TORQUE, BUILTIN_OFFSET_RANDOM_A, BUILTIN_OFFSET_RANDOM_B, BUILTIN_OFFSET_RANDOM_C } from '../miscellaneous/miscellaneous.js';
6
- import { EMITTER_DEFAULT_EXPECTED_CAPACITY, EMITTER_DEFAULT_CAPACITY_STEP, EMITTER_DEFAULT_CAST_SHADOW, EMITTER_DEFAULT_RECEIVE_SHADOW, EMITTER_DEFAULT_AUTOMATICALLY_DESTROY_MODULES } from './FXEmitter.Internal.js';
5
+ import { collectProperties, EMITTER_DEFAULT_EXPECTED_CAPACITY, EMITTER_DEFAULT_CAPACITY_STEP, EMITTER_DEFAULT_CAST_SHADOW, EMITTER_DEFAULT_RECEIVE_SHADOW, EMITTER_DEFAULT_AUTOMATICALLY_DESTROY_MODULES } from './FXEmitter.Internal.js';
7
6
 
8
7
  const EMITTERS = new Array();
9
8
  class FXEmitter extends Object3D {
@@ -5,7 +5,7 @@ import type { FXPropertyName } from "../../instancedParticle/shared";
5
5
  *
6
6
  * Behavior modules update particle properties each frame.
7
7
  */
8
- export declare abstract class FXBehaviorModule<T extends Record<string, FXPropertyName> = Record<string, FXPropertyName>> {
8
+ export declare abstract class FXBehavior<T extends Record<string, FXPropertyName> = Record<string, FXPropertyName>> {
9
9
  abstract readonly requiredProperties: T;
10
10
  abstract update(properties: {
11
11
  [K in keyof T]: InstancedBufferAttribute;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Behavior modules update particle properties each frame.
5
5
  */
6
- class FXBehaviorModule {
6
+ class FXBehavior {
7
7
  }
8
8
 
9
- export { FXBehaviorModule };
9
+ export { FXBehavior };
@@ -1,12 +1,12 @@
1
1
  import type { Vector3Like } from "../../miscellaneous/math";
2
- import { type FXVector3Config } from "../../miscellaneous/miscellaneous";
3
- import { FXBehaviorModule } from "./FXBehaviorModule";
2
+ import type { FXVector3Config } from "../../miscellaneous/miscellaneous";
3
+ import { FXBehavior } from "./FXBehavior";
4
4
  /**
5
5
  * Applies constant acceleration to all particles.
6
6
  *
7
7
  * Adds the direction vector to particle velocity each frame.
8
8
  */
9
- export declare class FXBehaviorDirectionalGravity extends FXBehaviorModule<{
9
+ export declare class FXBehaviorDirectionalGravity extends FXBehavior<{
10
10
  builtin: "Matrix4";
11
11
  }> {
12
12
  private directionInternal;
@@ -1,13 +1,13 @@
1
1
  import { assertValidNumber } from '../../miscellaneous/asserts.js';
2
2
  import { resolveFXVector3Config, BUILTIN_OFFSET_VELOCITY_X, BUILTIN_OFFSET_VELOCITY_Y, BUILTIN_OFFSET_VELOCITY_Z } from '../../miscellaneous/miscellaneous.js';
3
- import { FXBehaviorModule } from './FXBehaviorModule.js';
3
+ import { FXBehavior } from './FXBehavior.js';
4
4
 
5
5
  /**
6
6
  * Applies constant acceleration to all particles.
7
7
  *
8
8
  * Adds the direction vector to particle velocity each frame.
9
9
  */
10
- class FXBehaviorDirectionalGravity extends FXBehaviorModule {
10
+ class FXBehaviorDirectionalGravity extends FXBehavior {
11
11
  /**
12
12
  * @param direction - Acceleration vector in units/second²
13
13
  */
@@ -1,12 +1,12 @@
1
1
  import type { Vector3Like } from "../../miscellaneous/math";
2
2
  import { type FXRange, type FXRangeConfig, type FXVector3Config } from "../../miscellaneous/miscellaneous";
3
- import { FXBehaviorModule } from "./FXBehaviorModule";
3
+ import { FXBehavior } from "./FXBehavior";
4
4
  /**
5
5
  * Applies gravity attraction toward a point.
6
6
  *
7
7
  * Force follows inverse power law: strength / distance^exponent. Particles closer than threshold are unaffected.
8
8
  */
9
- export declare class FXBehaviorPointGravity extends FXBehaviorModule<{
9
+ export declare class FXBehaviorPointGravity extends FXBehavior<{
10
10
  builtin: "Matrix4";
11
11
  }> {
12
12
  private centerInternal;
@@ -1,14 +1,14 @@
1
1
  import { MathUtils } from 'three';
2
2
  import { assertValidNumber } from '../../miscellaneous/asserts.js';
3
3
  import { resolveFXVector3Config, resolveFXRangeConfig, BUILTIN_OFFSET_POSITION_X, BUILTIN_OFFSET_POSITION_Y, BUILTIN_OFFSET_POSITION_Z, BUILTIN_OFFSET_RANDOM_A, BUILTIN_OFFSET_RANDOM_B, BUILTIN_OFFSET_RANDOM_C, BUILTIN_OFFSET_VELOCITY_X, BUILTIN_OFFSET_VELOCITY_Y, BUILTIN_OFFSET_VELOCITY_Z } from '../../miscellaneous/miscellaneous.js';
4
- import { FXBehaviorModule } from './FXBehaviorModule.js';
4
+ import { FXBehavior } from './FXBehavior.js';
5
5
 
6
6
  /**
7
7
  * Applies gravity attraction toward a point.
8
8
  *
9
9
  * Force follows inverse power law: strength / distance^exponent. Particles closer than threshold are unaffected.
10
10
  */
11
- class FXBehaviorPointGravity extends FXBehaviorModule {
11
+ class FXBehaviorPointGravity extends FXBehavior {
12
12
  /**
13
13
  * @param center - Gravity center position
14
14
  * @param strength - Force multiplier range. Accepts number, tuple, or range object
@@ -1,11 +1,11 @@
1
- import { type FXAspectConfig, type FXRangeConfig } from "../../miscellaneous/miscellaneous";
2
- import { FXBehaviorModule } from "./FXBehaviorModule";
1
+ import type { FXAspectConfig, FXRangeConfig } from "../../miscellaneous/miscellaneous";
2
+ import { FXBehavior } from "./FXBehavior";
3
3
  /**
4
4
  * Animates particle scale over lifetime.
5
5
  *
6
6
  * Interpolates between scale anchors based on particle age. Requires at least 2 anchors.
7
7
  */
8
- export declare class FXBehaviorScaleOverLife extends FXBehaviorModule<{
8
+ export declare class FXBehaviorScaleOverLife extends FXBehavior<{
9
9
  builtin: "Matrix4";
10
10
  }> {
11
11
  private readonly scales;
@@ -1,14 +1,14 @@
1
1
  import { MathUtils } from 'three';
2
2
  import { assertValidNonNegativeNumber, assertValidPositiveNumber } from '../../miscellaneous/asserts.js';
3
3
  import { resolveFXRangeConfig, resolveAspect, BUILTIN_OFFSET_AGE, BUILTIN_OFFSET_LIFETIME, BUILTIN_OFFSET_RANDOM_A, BUILTIN_OFFSET_SCALE_X, BUILTIN_OFFSET_SCALE_Y } from '../../miscellaneous/miscellaneous.js';
4
- import { FXBehaviorModule } from './FXBehaviorModule.js';
4
+ import { FXBehavior } from './FXBehavior.js';
5
5
 
6
6
  /**
7
7
  * Animates particle scale over lifetime.
8
8
  *
9
9
  * Interpolates between scale anchors based on particle age. Requires at least 2 anchors.
10
10
  */
11
- class FXBehaviorScaleOverLife extends FXBehaviorModule {
11
+ class FXBehaviorScaleOverLife extends FXBehavior {
12
12
  /**
13
13
  * @param scales - Scale anchor points. Each accepts number, tuple, or range object
14
14
  * @param aspect - Width/height ratio. Accepts number or texture
@@ -1,11 +1,11 @@
1
- import { type FXRange, type FXRangeConfig } from "../../miscellaneous/miscellaneous";
2
- import { FXBehaviorModule } from "./FXBehaviorModule";
1
+ import type { FXRange, FXRangeConfig } from "../../miscellaneous/miscellaneous";
2
+ import { FXBehavior } from "./FXBehavior";
3
3
  /**
4
4
  * Reduces particle angular velocity over time.
5
5
  *
6
6
  * Applies exponential decay to torque. Damping of 0 means no effect, 1 means instant stop.
7
7
  */
8
- export declare class FXBehaviorTorqueDamping extends FXBehaviorModule<{
8
+ export declare class FXBehaviorTorqueDamping extends FXBehavior<{
9
9
  builtin: "Matrix4";
10
10
  }> {
11
11
  private dampingInternal;
@@ -1,14 +1,14 @@
1
1
  import { MathUtils } from 'three';
2
2
  import { assertValidNonNegativeNumber } from '../../miscellaneous/asserts.js';
3
3
  import { resolveFXRangeConfig, BUILTIN_OFFSET_RANDOM_B, BUILTIN_OFFSET_TORQUE } from '../../miscellaneous/miscellaneous.js';
4
- import { FXBehaviorModule } from './FXBehaviorModule.js';
4
+ import { FXBehavior } from './FXBehavior.js';
5
5
 
6
6
  /**
7
7
  * Reduces particle angular velocity over time.
8
8
  *
9
9
  * Applies exponential decay to torque. Damping of 0 means no effect, 1 means instant stop.
10
10
  */
11
- class FXBehaviorTorqueDamping extends FXBehaviorModule {
11
+ class FXBehaviorTorqueDamping extends FXBehavior {
12
12
  /**
13
13
  * @param damping - Damping coefficient range (0-1). Accepts number, tuple, or range object
14
14
  */
@@ -1,11 +1,11 @@
1
1
  import type { FXRange, FXRangeConfig } from "../../miscellaneous/miscellaneous";
2
- import { FXBehaviorModule } from "./FXBehaviorModule";
2
+ import { FXBehavior } from "./FXBehavior";
3
3
  /**
4
4
  * Applies noise-based angular acceleration to particles.
5
5
  *
6
6
  * Uses 2D noise based on particle position. Higher scale means finer noise detail.
7
7
  */
8
- export declare class FXBehaviorTorqueNoise extends FXBehaviorModule<{
8
+ export declare class FXBehaviorTorqueNoise extends FXBehavior<{
9
9
  builtin: "Matrix4";
10
10
  }> {
11
11
  private scaleInternal;
@@ -2,7 +2,7 @@ import { m as modExports } from '../../_virtual/mod.js';
2
2
  import { MathUtils } from 'three';
3
3
  import { assertValidPositiveNumber, assertValidNonNegativeNumber } from '../../miscellaneous/asserts.js';
4
4
  import { resolveFXRangeConfig, BUILTIN_OFFSET_RANDOM_C, BUILTIN_OFFSET_POSITION_X, BUILTIN_OFFSET_POSITION_Y, BUILTIN_OFFSET_POSITION_Z, BUILTIN_OFFSET_RANDOM_A, BUILTIN_OFFSET_TORQUE } from '../../miscellaneous/miscellaneous.js';
5
- import { FXBehaviorModule } from './FXBehaviorModule.js';
5
+ import { FXBehavior } from './FXBehavior.js';
6
6
 
7
7
  const generateNoise3D = modExports.makeNoise3D();
8
8
  /**
@@ -10,7 +10,7 @@ const generateNoise3D = modExports.makeNoise3D();
10
10
  *
11
11
  * Uses 2D noise based on particle position. Higher scale means finer noise detail.
12
12
  */
13
- class FXBehaviorTorqueNoise extends FXBehaviorModule {
13
+ class FXBehaviorTorqueNoise extends FXBehavior {
14
14
  /**
15
15
  * @param scale - Noise frequency range. Accepts number, tuple, or range object
16
16
  * @param strength - Force multiplier range. Accepts number, tuple, or range object
@@ -1,11 +1,11 @@
1
- import { type FXRange, type FXRangeConfig } from "../../miscellaneous/miscellaneous";
2
- import { FXBehaviorModule } from "./FXBehaviorModule";
1
+ import type { FXRange, FXRangeConfig } from "../../miscellaneous/miscellaneous";
2
+ import { FXBehavior } from "./FXBehavior";
3
3
  /**
4
4
  * Reduces particle velocity over time.
5
5
  *
6
6
  * Applies exponential decay to velocity. Damping of 0 means no effect, 1 means instant stop.
7
7
  */
8
- export declare class FXBehaviorVelocityDamping extends FXBehaviorModule<{
8
+ export declare class FXBehaviorVelocityDamping extends FXBehavior<{
9
9
  builtin: "Matrix4";
10
10
  }> {
11
11
  private dampingInternal;
@@ -1,14 +1,14 @@
1
1
  import { MathUtils } from 'three';
2
2
  import { assertValidNonNegativeNumber } from '../../miscellaneous/asserts.js';
3
3
  import { resolveFXRangeConfig, BUILTIN_OFFSET_RANDOM_B, BUILTIN_OFFSET_VELOCITY_X, BUILTIN_OFFSET_VELOCITY_Y, BUILTIN_OFFSET_VELOCITY_Z } from '../../miscellaneous/miscellaneous.js';
4
- import { FXBehaviorModule } from './FXBehaviorModule.js';
4
+ import { FXBehavior } from './FXBehavior.js';
5
5
 
6
6
  /**
7
7
  * Reduces particle velocity over time.
8
8
  *
9
9
  * Applies exponential decay to velocity. Damping of 0 means no effect, 1 means instant stop.
10
10
  */
11
- class FXBehaviorVelocityDamping extends FXBehaviorModule {
11
+ class FXBehaviorVelocityDamping extends FXBehavior {
12
12
  /**
13
13
  * @param damping - Damping coefficient range (0-1). Accepts number, tuple, or range object
14
14
  */
@@ -1,11 +1,11 @@
1
1
  import type { FXRange, FXRangeConfig } from "../../miscellaneous/miscellaneous";
2
- import { FXBehaviorModule } from "./FXBehaviorModule";
2
+ import { FXBehavior } from "./FXBehavior";
3
3
  /**
4
4
  * Applies noise-based acceleration to particles.
5
5
  *
6
6
  * Uses 2D noise based on particle position. Higher scale means finer noise detail.
7
7
  */
8
- export declare class FXBehaviorVelocityNoise extends FXBehaviorModule<{
8
+ export declare class FXBehaviorVelocityNoise extends FXBehavior<{
9
9
  builtin: "Matrix4";
10
10
  }> {
11
11
  private scaleInternal;
@@ -2,7 +2,7 @@ import { m as modExports } from '../../_virtual/mod.js';
2
2
  import { MathUtils } from 'three';
3
3
  import { assertValidPositiveNumber, assertValidNonNegativeNumber } from '../../miscellaneous/asserts.js';
4
4
  import { resolveFXRangeConfig, BUILTIN_OFFSET_POSITION_X, BUILTIN_OFFSET_POSITION_Y, BUILTIN_OFFSET_POSITION_Z, BUILTIN_OFFSET_RANDOM_C, BUILTIN_OFFSET_RANDOM_A, BUILTIN_OFFSET_VELOCITY_X, BUILTIN_OFFSET_VELOCITY_Y, BUILTIN_OFFSET_VELOCITY_Z } from '../../miscellaneous/miscellaneous.js';
5
- import { FXBehaviorModule } from './FXBehaviorModule.js';
5
+ import { FXBehavior } from './FXBehavior.js';
6
6
 
7
7
  const generateNoise3D0 = modExports.makeNoise3D();
8
8
  const generateNoise3D1 = modExports.makeNoise3D();
@@ -12,7 +12,7 @@ const generateNoise3D2 = modExports.makeNoise3D();
12
12
  *
13
13
  * Uses 2D noise based on particle position. Higher scale means finer noise detail.
14
14
  */
15
- class FXBehaviorVelocityNoise extends FXBehaviorModule {
15
+ class FXBehaviorVelocityNoise extends FXBehavior {
16
16
  /**
17
17
  * @param scale - Noise frequency range. Accepts number, tuple, or range object
18
18
  * @param strength - Force multiplier range. Accepts number, tuple, or range object
@@ -4,6 +4,6 @@ import type { FXPropertyName } from "../../instancedParticle/shared";
4
4
  *
5
5
  * Spawn modules initialize particle properties when particles are created.
6
6
  */
7
- export declare abstract class FXSpawnModule<T extends Record<string, FXPropertyName> = Record<string, FXPropertyName>> {
7
+ export declare abstract class FXSpawn<T extends Record<string, FXPropertyName> = Record<string, FXPropertyName>> {
8
8
  destroy?(): void;
9
9
  }
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Spawn modules initialize particle properties when particles are created.
5
5
  */
6
- class FXSpawnModule {
6
+ class FXSpawn {
7
7
  }
8
8
 
9
- export { FXSpawnModule };
9
+ export { FXSpawn };
@@ -1,12 +1,12 @@
1
1
  import type { Vector3Like } from "../../miscellaneous/math";
2
- import { type FXVector3Config } from "../../miscellaneous/miscellaneous";
3
- import { FXSpawnModule } from "./FXSpawnModule";
2
+ import type { FXVector3Config } from "../../miscellaneous/miscellaneous";
3
+ import { FXSpawn } from "./FXSpawn";
4
4
  /**
5
5
  * Spawns particles at random positions within an axis-aligned bounding box.
6
6
  *
7
7
  * Position is chosen uniformly within the bounds defined by min and max.
8
8
  */
9
- export declare class FXSpawnBox extends FXSpawnModule<{
9
+ export declare class FXSpawnBox extends FXSpawn<{
10
10
  builtin: "Matrix4";
11
11
  }> {
12
12
  private minInternal;
@@ -1,14 +1,14 @@
1
1
  import { MathUtils } from 'three';
2
2
  import { assertValidNumber } from '../../miscellaneous/asserts.js';
3
3
  import { resolveFXVector3Config, BUILTIN_OFFSET_POSITION_X, BUILTIN_OFFSET_POSITION_Y, BUILTIN_OFFSET_POSITION_Z } from '../../miscellaneous/miscellaneous.js';
4
- import { FXSpawnModule } from './FXSpawnModule.js';
4
+ import { FXSpawn } from './FXSpawn.js';
5
5
 
6
6
  /**
7
7
  * Spawns particles at random positions within an axis-aligned bounding box.
8
8
  *
9
9
  * Position is chosen uniformly within the bounds defined by min and max.
10
10
  */
11
- class FXSpawnBox extends FXSpawnModule {
11
+ class FXSpawnBox extends FXSpawn {
12
12
  /**
13
13
  * @param min - Minimum corner of the spawn box
14
14
  * @param max - Maximum corner of the spawn box
@@ -1,12 +1,12 @@
1
1
  import type { Vector3Like } from "../../miscellaneous/math";
2
- import { type FXVector3Config } from "../../miscellaneous/miscellaneous";
3
- import { FXSpawnModule } from "./FXSpawnModule";
2
+ import type { FXVector3Config } from "../../miscellaneous/miscellaneous";
3
+ import { FXSpawn } from "./FXSpawn";
4
4
  /**
5
5
  * Sets particle spawn position offset.
6
6
  *
7
7
  * All particles spawned with this module start at the specified position.
8
8
  */
9
- export declare class FXSpawnOffset extends FXSpawnModule<{
9
+ export declare class FXSpawnPoint extends FXSpawn<{
10
10
  builtin: "Matrix4";
11
11
  }> {
12
12
  private offsetInternal;
@@ -1,13 +1,13 @@
1
1
  import { assertValidNumber } from '../../miscellaneous/asserts.js';
2
2
  import { resolveFXVector3Config, BUILTIN_OFFSET_POSITION_X, BUILTIN_OFFSET_POSITION_Y, BUILTIN_OFFSET_POSITION_Z } from '../../miscellaneous/miscellaneous.js';
3
- import { FXSpawnModule } from './FXSpawnModule.js';
3
+ import { FXSpawn } from './FXSpawn.js';
4
4
 
5
5
  /**
6
6
  * Sets particle spawn position offset.
7
7
  *
8
8
  * All particles spawned with this module start at the specified position.
9
9
  */
10
- class FXSpawnOffset extends FXSpawnModule {
10
+ class FXSpawnPoint extends FXSpawn {
11
11
  /**
12
12
  * @param offset - Initial particle position offset
13
13
  */
@@ -46,4 +46,4 @@ class FXSpawnOffset extends FXSpawnModule {
46
46
  }
47
47
  }
48
48
 
49
- export { FXSpawnOffset };
49
+ export { FXSpawnPoint };
@@ -1,11 +1,11 @@
1
- import { type FXRange, type FXRangeConfig } from "../../miscellaneous/miscellaneous";
2
- import { FXSpawnModule } from "./FXSpawnModule";
1
+ import type { FXRange, FXRangeConfig } from "../../miscellaneous/miscellaneous";
2
+ import { FXSpawn } from "./FXSpawn";
3
3
  /**
4
4
  * Assigns random lifetime to particles.
5
5
  *
6
6
  * Lifetime is chosen uniformly from the specified range. Age is set to 0.
7
7
  */
8
- export declare class FXSpawnRandomLifetime extends FXSpawnModule<{
8
+ export declare class FXSpawnRandomLifetime extends FXSpawn<{
9
9
  builtin: "Matrix4";
10
10
  }> {
11
11
  private lifetimeInternal;
@@ -1,14 +1,14 @@
1
1
  import { MathUtils } from 'three';
2
2
  import { assertValidPositiveNumber } from '../../miscellaneous/asserts.js';
3
3
  import { resolveFXRangeConfig, BUILTIN_OFFSET_LIFETIME, BUILTIN_OFFSET_AGE } from '../../miscellaneous/miscellaneous.js';
4
- import { FXSpawnModule } from './FXSpawnModule.js';
4
+ import { FXSpawn } from './FXSpawn.js';
5
5
 
6
6
  /**
7
7
  * Assigns random lifetime to particles.
8
8
  *
9
9
  * Lifetime is chosen uniformly from the specified range. Age is set to 0.
10
10
  */
11
- class FXSpawnRandomLifetime extends FXSpawnModule {
11
+ class FXSpawnRandomLifetime extends FXSpawn {
12
12
  /**
13
13
  * @param lifetime - Lifetime range in seconds. Accepts number, tuple, or range object
14
14
  */
@@ -1,11 +1,11 @@
1
- import { type FXRange, type FXRangeConfig } from "../../miscellaneous/miscellaneous";
2
- import { FXSpawnModule } from "./FXSpawnModule";
1
+ import type { FXRange, FXRangeConfig } from "../../miscellaneous/miscellaneous";
2
+ import { FXSpawn } from "./FXSpawn";
3
3
  /**
4
4
  * Assigns random rotation to particles.
5
5
  *
6
6
  * Initial rotation is chosen uniformly from the specified range.
7
7
  */
8
- export declare class FXSpawnRandomRotation extends FXSpawnModule<{
8
+ export declare class FXSpawnRandomRotation extends FXSpawn<{
9
9
  builtin: "Matrix4";
10
10
  }> {
11
11
  private rotationInternal;
@@ -1,14 +1,14 @@
1
1
  import { MathUtils } from 'three';
2
2
  import { assertValidNumber } from '../../miscellaneous/asserts.js';
3
3
  import { resolveFXRangeConfig, BUILTIN_OFFSET_ROTATION } from '../../miscellaneous/miscellaneous.js';
4
- import { FXSpawnModule } from './FXSpawnModule.js';
4
+ import { FXSpawn } from './FXSpawn.js';
5
5
 
6
6
  /**
7
7
  * Assigns random rotation to particles.
8
8
  *
9
9
  * Initial rotation is chosen uniformly from the specified range.
10
10
  */
11
- class FXSpawnRandomRotation extends FXSpawnModule {
11
+ class FXSpawnRandomRotation extends FXSpawn {
12
12
  /**
13
13
  * @param rotation - Rotation range in radians. Accepts number, tuple, or range object
14
14
  */
@@ -1,11 +1,11 @@
1
- import { type FXAspectConfig, type FXRange, type FXRangeConfig } from "../../miscellaneous/miscellaneous";
2
- import { FXSpawnModule } from "./FXSpawnModule";
1
+ import type { FXAspectConfig, FXRange, FXRangeConfig } from "../../miscellaneous/miscellaneous";
2
+ import { FXSpawn } from "./FXSpawn";
3
3
  /**
4
4
  * Assigns random scale to particles.
5
5
  *
6
6
  * Base scale is chosen uniformly from the range. Aspect ratio is applied to X scale.
7
7
  */
8
- export declare class FXSpawnRandomScale extends FXSpawnModule<{
8
+ export declare class FXSpawnRandomScale extends FXSpawn<{
9
9
  builtin: "Matrix4";
10
10
  }> {
11
11
  private scaleInternal;
@@ -1,14 +1,14 @@
1
1
  import { MathUtils } from 'three';
2
2
  import { assertValidPositiveNumber } from '../../miscellaneous/asserts.js';
3
3
  import { resolveFXRangeConfig, resolveAspect, BUILTIN_OFFSET_SCALE_X, BUILTIN_OFFSET_SCALE_Y } from '../../miscellaneous/miscellaneous.js';
4
- import { FXSpawnModule } from './FXSpawnModule.js';
4
+ import { FXSpawn } from './FXSpawn.js';
5
5
 
6
6
  /**
7
7
  * Assigns random scale to particles.
8
8
  *
9
9
  * Base scale is chosen uniformly from the range. Aspect ratio is applied to X scale.
10
10
  */
11
- class FXSpawnRandomScale extends FXSpawnModule {
11
+ class FXSpawnRandomScale extends FXSpawn {
12
12
  /**
13
13
  * @param scale - Base scale range. Accepts number, tuple, or range object
14
14
  * @param aspect - Width/height ratio. Accepts number or texture
@@ -1,11 +1,11 @@
1
- import { type FXRange, type FXRangeConfig } from "../../miscellaneous/miscellaneous";
2
- import { FXSpawnModule } from "./FXSpawnModule";
1
+ import type { FXRange, FXRangeConfig } from "../../miscellaneous/miscellaneous";
2
+ import { FXSpawn } from "./FXSpawn";
3
3
  /**
4
4
  * Assigns random angular velocity to particles.
5
5
  *
6
6
  * Torque (rotation speed) is chosen uniformly from the specified range.
7
7
  */
8
- export declare class FXSpawnRandomTorque extends FXSpawnModule<{
8
+ export declare class FXSpawnRandomTorque extends FXSpawn<{
9
9
  builtin: "Matrix4";
10
10
  }> {
11
11
  private torqueInternal;
@@ -1,14 +1,14 @@
1
1
  import { MathUtils } from 'three';
2
2
  import { assertValidNumber } from '../../miscellaneous/asserts.js';
3
3
  import { resolveFXRangeConfig, BUILTIN_OFFSET_TORQUE } from '../../miscellaneous/miscellaneous.js';
4
- import { FXSpawnModule } from './FXSpawnModule.js';
4
+ import { FXSpawn } from './FXSpawn.js';
5
5
 
6
6
  /**
7
7
  * Assigns random angular velocity to particles.
8
8
  *
9
9
  * Torque (rotation speed) is chosen uniformly from the specified range.
10
10
  */
11
- class FXSpawnRandomTorque extends FXSpawnModule {
11
+ class FXSpawnRandomTorque extends FXSpawn {
12
12
  /**
13
13
  * @param torque - Angular velocity range in radians/second. Accepts number, tuple, or range object
14
14
  */
@@ -1,7 +1,7 @@
1
1
  import { Vector3 } from "three";
2
- import { type FXRange, type FXRangeConfig } from "../../miscellaneous/miscellaneous";
3
- import { FXSpawnModule } from "./FXSpawnModule";
4
- export declare class FXSpawnRandomVelocity extends FXSpawnModule<{
2
+ import type { FXRange, FXRangeConfig } from "../../miscellaneous/miscellaneous";
3
+ import { FXSpawn } from "./FXSpawn";
4
+ export declare class FXSpawnRandomVelocity extends FXSpawn<{
5
5
  builtin: "Matrix4";
6
6
  }> {
7
7
  private angleInternal;
@@ -1,12 +1,12 @@
1
1
  import { Vector3, MathUtils } from 'three';
2
2
  import { assertValidNumber } from '../../miscellaneous/asserts.js';
3
3
  import { resolveFXRangeConfig, BUILTIN_OFFSET_VELOCITY_X, BUILTIN_OFFSET_VELOCITY_Y, BUILTIN_OFFSET_VELOCITY_Z } from '../../miscellaneous/miscellaneous.js';
4
- import { FXSpawnModule } from './FXSpawnModule.js';
4
+ import { FXSpawn } from './FXSpawn.js';
5
5
 
6
6
  const TEMP_TANGENT = new Vector3();
7
7
  const TEMP_BITANGENT = new Vector3();
8
8
  const TEMP_VELOCITY = new Vector3();
9
- class FXSpawnRandomVelocity extends FXSpawnModule {
9
+ class FXSpawnRandomVelocity extends FXSpawn {
10
10
  constructor(direction = new Vector3(0, 1, 0), angle = { min: 0, max: Math.PI }, magnitude = { min: -50, max: 50 }) {
11
11
  super();
12
12
  /** @internal */
@@ -1,4 +1,4 @@
1
- import { FXSpawnModule } from "./FXSpawnModule";
1
+ import { FXSpawn } from "./FXSpawn";
2
2
  /**
3
3
  * Spawns particles at random positions within a spherical shell.
4
4
  *
@@ -7,7 +7,7 @@ import { FXSpawnModule } from "./FXSpawnModule";
7
7
  * - `Math.PI / 2` - full sphere
8
8
  * - Values in between produce a spherical band/zone
9
9
  */
10
- export declare class FXSpawnSphere extends FXSpawnModule<{
10
+ export declare class FXSpawnSphere extends FXSpawn<{
11
11
  builtin: "Matrix4";
12
12
  }> {
13
13
  private innerRadiusInternal;