sparcoon 0.0.6 → 0.0.7

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.
@@ -1,5 +1,5 @@
1
1
  import { assertValidNumber } from '../miscellaneous/asserts.js';
2
- import { resolveFXVector2Config, BUILTIN_OFFSET_VELOCITY_X, BUILTIN_OFFSET_VELOCITY_Y } from '../miscellaneous/miscellaneous.js';
2
+ import { resolveFXVector3Config, BUILTIN_OFFSET_VELOCITY_X, BUILTIN_OFFSET_VELOCITY_Y, BUILTIN_OFFSET_VELOCITY_Z } from '../miscellaneous/miscellaneous.js';
3
3
  import { FXBehaviorModule } from './FXBehaviorModule.js';
4
4
 
5
5
  /**
@@ -15,9 +15,10 @@ class FXBehaviorDirectionalGravity extends FXBehaviorModule {
15
15
  super();
16
16
  /** @internal */
17
17
  this.requiredProperties = { builtin: "Matrix4" };
18
- this._private_directionInternal = resolveFXVector2Config(direction);
18
+ this._private_directionInternal = resolveFXVector3Config(direction);
19
19
  assertValidNumber(this._private_directionInternal.x, "FXBehaviorDirectionalGravity.constructor.direction.x");
20
20
  assertValidNumber(this._private_directionInternal.y, "FXBehaviorDirectionalGravity.constructor.direction.y");
21
+ assertValidNumber(this._private_directionInternal.z, "FXBehaviorDirectionalGravity.constructor.direction.z");
21
22
  }
22
23
  /** Acceleration vector in units/second² */
23
24
  get direction() {
@@ -25,9 +26,10 @@ class FXBehaviorDirectionalGravity extends FXBehaviorModule {
25
26
  }
26
27
  /** Acceleration vector in units/second² */
27
28
  set direction(value) {
28
- this._private_directionInternal = resolveFXVector2Config(value);
29
+ this._private_directionInternal = resolveFXVector3Config(value);
29
30
  assertValidNumber(this._private_directionInternal.x, "FXBehaviorDirectionalGravity.direction.x");
30
31
  assertValidNumber(this._private_directionInternal.y, "FXBehaviorDirectionalGravity.direction.y");
32
+ assertValidNumber(this._private_directionInternal.z, "FXBehaviorDirectionalGravity.direction.z");
31
33
  }
32
34
  /** @internal */
33
35
  update(properties, instanceCount, deltaTime) {
@@ -35,10 +37,12 @@ class FXBehaviorDirectionalGravity extends FXBehaviorModule {
35
37
  const { array, itemSize } = builtin;
36
38
  const offsetX = this._private_directionInternal.x * deltaTime;
37
39
  const offsetY = this._private_directionInternal.y * deltaTime;
40
+ const offsetZ = this._private_directionInternal.z * deltaTime;
38
41
  for (let i = 0; i < instanceCount; i++) {
39
42
  const itemOffset = i * itemSize;
40
43
  array[itemOffset + BUILTIN_OFFSET_VELOCITY_X] += offsetX;
41
44
  array[itemOffset + BUILTIN_OFFSET_VELOCITY_Y] += offsetY;
45
+ array[itemOffset + BUILTIN_OFFSET_VELOCITY_Z] += offsetZ;
42
46
  }
43
47
  builtin.needsUpdate = true;
44
48
  }
@@ -1,6 +1,6 @@
1
1
  import { MathUtils } from 'three';
2
2
  import { assertValidNumber } from '../miscellaneous/asserts.js';
3
- import { resolveFXVector2Config, resolveFXRangeConfig, BUILTIN_OFFSET_POSITION_X, BUILTIN_OFFSET_POSITION_Y, BUILTIN_OFFSET_RANDOM_A, BUILTIN_OFFSET_RANDOM_B, BUILTIN_OFFSET_RANDOM_C, BUILTIN_OFFSET_VELOCITY_X, BUILTIN_OFFSET_VELOCITY_Y } from '../miscellaneous/miscellaneous.js';
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
4
  import { FXBehaviorModule } from './FXBehaviorModule.js';
5
5
 
6
6
  /**
@@ -19,9 +19,10 @@ class FXBehaviorPointGravity extends FXBehaviorModule {
19
19
  super();
20
20
  /** @internal */
21
21
  this.requiredProperties = { builtin: "Matrix4" };
22
- this._private_centerInternal = resolveFXVector2Config(center);
22
+ this._private_centerInternal = resolveFXVector3Config(center);
23
23
  assertValidNumber(this._private_centerInternal.x, "FXBehaviorPointGravity.constructor.center.x");
24
24
  assertValidNumber(this._private_centerInternal.y, "FXBehaviorPointGravity.constructor.center.y");
25
+ assertValidNumber(this._private_centerInternal.z, "FXBehaviorPointGravity.constructor.center.z");
25
26
  this._private_strengthInternal = resolveFXRangeConfig(strength);
26
27
  assertValidNumber(this._private_strengthInternal.min, "FXBehaviorPointGravity.constructor.strength.min");
27
28
  assertValidNumber(this._private_strengthInternal.max, "FXBehaviorPointGravity.constructor.strength.max");
@@ -50,9 +51,10 @@ class FXBehaviorPointGravity extends FXBehaviorModule {
50
51
  }
51
52
  /** Gravity center position */
52
53
  set center(value) {
53
- this._private_centerInternal = resolveFXVector2Config(value);
54
+ this._private_centerInternal = resolveFXVector3Config(value);
54
55
  assertValidNumber(this._private_centerInternal.x, "FXBehaviorPointGravity.center.x");
55
56
  assertValidNumber(this._private_centerInternal.y, "FXBehaviorPointGravity.center.y");
57
+ assertValidNumber(this._private_centerInternal.z, "FXBehaviorPointGravity.center.z");
56
58
  }
57
59
  /** Force multiplier range */
58
60
  set strength(value) {
@@ -80,11 +82,12 @@ class FXBehaviorPointGravity extends FXBehaviorModule {
80
82
  const itemOffset = i * itemSize;
81
83
  const dx = this._private_centerInternal.x - array[itemOffset + BUILTIN_OFFSET_POSITION_X];
82
84
  const dy = this._private_centerInternal.y - array[itemOffset + BUILTIN_OFFSET_POSITION_Y];
85
+ const dz = this._private_centerInternal.z - array[itemOffset + BUILTIN_OFFSET_POSITION_Z];
83
86
  // Constant over the life of a particle but different for each particle
84
87
  const thresholdT = array[itemOffset + BUILTIN_OFFSET_RANDOM_A];
85
88
  const threshold = MathUtils.lerp(this.threshold.min, this.threshold.max, thresholdT);
86
89
  const thresholdSquared = threshold * threshold;
87
- const distanceSquared = dx * dx + dy * dy;
90
+ const distanceSquared = dx * dx + dy * dy + dz * dz;
88
91
  if (distanceSquared < thresholdSquared) {
89
92
  continue;
90
93
  }
@@ -98,10 +101,13 @@ class FXBehaviorPointGravity extends FXBehaviorModule {
98
101
  const forceMagnitude = strength / Math.pow(distance, exponent);
99
102
  const directionX = dx / distance;
100
103
  const directionY = dy / distance;
104
+ const directionZ = dz / distance;
101
105
  const accelerationX = directionX * forceMagnitude;
102
106
  const accelerationY = directionY * forceMagnitude;
107
+ const accelerationZ = directionZ * forceMagnitude;
103
108
  array[itemOffset + BUILTIN_OFFSET_VELOCITY_X] += accelerationX * deltaTime;
104
109
  array[itemOffset + BUILTIN_OFFSET_VELOCITY_Y] += accelerationY * deltaTime;
110
+ array[itemOffset + BUILTIN_OFFSET_VELOCITY_Z] += accelerationZ * deltaTime;
105
111
  }
106
112
  builtin.needsUpdate = true;
107
113
  }
@@ -1,6 +1,6 @@
1
1
  import { MathUtils } from 'three';
2
2
  import { assertValidNonNegativeNumber } from '../miscellaneous/asserts.js';
3
- import { resolveFXRangeConfig, BUILTIN_OFFSET_RANDOM_B, BUILTIN_OFFSET_VELOCITY_X, BUILTIN_OFFSET_VELOCITY_Y } from '../miscellaneous/miscellaneous.js';
3
+ import { resolveFXRangeConfig, BUILTIN_OFFSET_RANDOM_B, BUILTIN_OFFSET_VELOCITY_X, BUILTIN_OFFSET_VELOCITY_Y, BUILTIN_OFFSET_VELOCITY_Z } from '../miscellaneous/miscellaneous.js';
4
4
  import { FXBehaviorModule } from './FXBehaviorModule.js';
5
5
 
6
6
  /**
@@ -41,6 +41,7 @@ class FXBehaviorVelocityDamping extends FXBehaviorModule {
41
41
  const dampingFactor = Math.pow(1 - MathUtils.lerp(this._private_dampingInternal.min, this._private_dampingInternal.max, dampingT), deltaTime);
42
42
  array[itemOffset + BUILTIN_OFFSET_VELOCITY_X] *= dampingFactor;
43
43
  array[itemOffset + BUILTIN_OFFSET_VELOCITY_Y] *= dampingFactor;
44
+ array[itemOffset + BUILTIN_OFFSET_VELOCITY_Z] *= dampingFactor;
44
45
  }
45
46
  builtin.needsUpdate = true;
46
47
  }
@@ -2,7 +2,7 @@ import { Object3D, NormalBlending } from 'three';
2
2
  import { FXInstancedParticle } from '../instancedParticle/FXInstancedParticle.js';
3
3
  import { collectProperties, collectUniforms } from '../instancedParticle/FXInstancedParticle.Internal.js';
4
4
  import { resolveGLSLTypeInfo } from '../instancedParticle/shared.js';
5
- import { BUILTIN_OFFSET_AGE, BUILTIN_OFFSET_POSITION_X, BUILTIN_OFFSET_VELOCITY_X, BUILTIN_OFFSET_POSITION_Y, BUILTIN_OFFSET_VELOCITY_Y, BUILTIN_OFFSET_ROTATION, BUILTIN_OFFSET_TORQUE, BUILTIN_OFFSET_RANDOM_A, BUILTIN_OFFSET_RANDOM_B, BUILTIN_OFFSET_RANDOM_C } from '../miscellaneous/miscellaneous.js';
5
+ 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
6
  import { EMITTER_DEFAULT_EXPECTED_CAPACITY, EMITTER_DEFAULT_CAPACITY_STEP, EMITTER_DEFAULT_AUTOMATICALLY_DESTROY_MODULES } from './FXEmitter.Internal.js';
7
7
 
8
8
  const INSTANCES = new Array();
@@ -58,6 +58,8 @@ class FXEmitter extends Object3D {
58
58
  array[itemOffset + BUILTIN_OFFSET_VELOCITY_X] * deltaTime;
59
59
  array[itemOffset + BUILTIN_OFFSET_POSITION_Y] +=
60
60
  array[itemOffset + BUILTIN_OFFSET_VELOCITY_Y] * deltaTime;
61
+ array[itemOffset + BUILTIN_OFFSET_POSITION_Z] +=
62
+ array[itemOffset + BUILTIN_OFFSET_VELOCITY_Z] * deltaTime;
61
63
  }
62
64
  builtin.needsUpdate = true;
63
65
  }
@@ -73,11 +75,11 @@ class FXEmitter extends Object3D {
73
75
  const collectedProperties = {
74
76
  builtin: resolveGLSLTypeInfo("Matrix4"),
75
77
  };
76
- collectProperties(collectedProperties, _private_spawnSequence, "UIEmitter.constructor.spawnSequence:");
77
- collectProperties(collectedProperties, _private_behaviorSequence, "UIEmitter.constructor.behaviorSequence");
78
- collectProperties(collectedProperties, _private_renderingSequence, "UIEmitter.constructor.renderingSequence");
78
+ collectProperties(collectedProperties, _private_spawnSequence, "FXEmitter.constructor.spawnSequence:");
79
+ collectProperties(collectedProperties, _private_behaviorSequence, "FXEmitter.constructor.behaviorSequence");
80
+ collectProperties(collectedProperties, _private_renderingSequence, "FXEmitter.constructor.renderingSequence");
79
81
  const collectedUniforms = {};
80
- collectUniforms(collectedUniforms, _private_renderingSequence, "UIEmitter.constructor.renderingSequence");
82
+ collectUniforms(collectedUniforms, _private_renderingSequence, "FXEmitter.constructor.renderingSequence");
81
83
  this._private_mesh = new FXInstancedParticle(this._private_renderingSequence.map((module) => module.source), collectedUniforms, collectedProperties, options.expectedCapacity ?? EMITTER_DEFAULT_EXPECTED_CAPACITY, options.capacityStep ?? EMITTER_DEFAULT_CAPACITY_STEP, options.blending ?? NormalBlending, options.useAlphaHashing ?? false);
82
84
  this.automaticallyDestroyModules =
83
85
  options.automaticallyDestroyModules ?? EMITTER_DEFAULT_AUTOMATICALLY_DESTROY_MODULES;
@@ -2,7 +2,7 @@ import type { IUniform, ShaderMaterial } from "three";
2
2
  import { Matrix3, Matrix4, Texture, Vector2, Vector3, Vector4 } from "three";
3
3
  import { FXColor } from "../color/FXColor";
4
4
  export type FXProperty = Texture | FXColor | Vector2 | Vector3 | Vector4 | Matrix3 | Matrix4 | number;
5
- export type FXPropertyName = "Texture" | "UIColor" | "Vector2" | "Vector3" | "Vector4" | "Matrix3" | "Matrix4" | "number";
5
+ export type FXPropertyName = "Texture" | "FXColor" | "Vector2" | "Vector3" | "Vector4" | "Matrix3" | "Matrix4" | "number";
6
6
  export type FXPropertyConstructor = typeof Texture | typeof FXColor | typeof Vector2 | typeof Vector3 | typeof Vector4 | typeof Matrix3 | typeof Matrix4 | NumberConstructor;
7
7
  export type FXPropertyCopyTo = FXColor | Vector2 | Vector3 | Vector4 | Matrix3 | Matrix4;
8
8
  export type FXPropertyCopyFrom = FXColor & Vector2 & Vector3 & Vector4 & Matrix3 & Matrix4;
@@ -15,11 +15,5 @@ export interface GLProperty {
15
15
  value: FXProperty;
16
16
  glslTypeInfo: GLTypeInfo;
17
17
  }
18
- export interface PlaneData {
19
- source: string;
20
- properties: Record<string, GLProperty>;
21
- transform: Matrix4;
22
- visibility: boolean;
23
- }
24
18
  export declare function resolveGLSLTypeInfo(value: FXProperty | FXPropertyName | FXPropertyConstructor): GLTypeInfo;
25
19
  export declare function resolvePropertyUniform(name: string, material: ShaderMaterial): IUniform<FXProperty>;
@@ -43,7 +43,7 @@ function resolveGLSLTypeInfo(value) {
43
43
  return GLSL_TYPE_INFO_FLOAT;
44
44
  case "Texture":
45
45
  return GLSL_TYPE_INFO_SAMPLER2D;
46
- case "UIColor":
46
+ case "FXColor":
47
47
  return GLSL_TYPE_INFO_VEC4;
48
48
  case "Vector2":
49
49
  return GLSL_TYPE_INFO_VEC2;
@@ -11,7 +11,7 @@ export type FXRangeConfig = FXRange | [number, number, number] | number;
11
11
  export type FXVector3Config = Vector3Like | Vector3Tuple | number;
12
12
  export type FXAspectConfig = number | FXTextureConfig;
13
13
  export declare function resolveFXRangeConfig(config: FXRangeConfig): FXRange;
14
- export declare function resolveFXVector2Config(config: FXVector3Config): Vector3Like;
14
+ export declare function resolveFXVector3Config(config: FXVector3Config): Vector3Like;
15
15
  export declare function resolveAspect(config: number | FXTextureConfig): number;
16
16
  export declare function generateNoise3D(x: number, y: number, z: number): number;
17
17
  export declare function buildGradientTexture(colors: FXColor[]): DataTexture;
@@ -9,7 +9,7 @@ function resolveFXRangeConfig(config) {
9
9
  }
10
10
  return config;
11
11
  }
12
- function resolveFXVector2Config(config) {
12
+ function resolveFXVector3Config(config) {
13
13
  if (typeof config === "number") {
14
14
  return { x: config, y: config, z: config };
15
15
  }
@@ -63,4 +63,4 @@ const BUILTIN_OFFSET_RANDOM_A = 13;
63
63
  const BUILTIN_OFFSET_RANDOM_B = 14;
64
64
  const BUILTIN_OFFSET_RANDOM_C = 15;
65
65
 
66
- export { BUILTIN_OFFSET_AGE, BUILTIN_OFFSET_LIFETIME, 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_ROTATION, BUILTIN_OFFSET_SCALE_X, BUILTIN_OFFSET_SCALE_Y, BUILTIN_OFFSET_TORQUE, BUILTIN_OFFSET_VELOCITY_X, BUILTIN_OFFSET_VELOCITY_Y, BUILTIN_OFFSET_VELOCITY_Z, buildGradientTexture, generateNoise3D, resolveAspect, resolveFXRangeConfig, resolveFXVector2Config };
66
+ export { BUILTIN_OFFSET_AGE, BUILTIN_OFFSET_LIFETIME, 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_ROTATION, BUILTIN_OFFSET_SCALE_X, BUILTIN_OFFSET_SCALE_Y, BUILTIN_OFFSET_TORQUE, BUILTIN_OFFSET_VELOCITY_X, BUILTIN_OFFSET_VELOCITY_Y, BUILTIN_OFFSET_VELOCITY_Z, buildGradientTexture, generateNoise3D, resolveAspect, resolveFXRangeConfig, resolveFXVector3Config };
@@ -20,7 +20,7 @@ class FXRenderingColorOverLife extends FXRenderingModule {
20
20
  /** @internal */
21
21
  this.source = source;
22
22
  if (colors.length === 0) {
23
- throw new Error("UIRenderingColorOverLife: colors array cannot be empty");
23
+ throw new Error("FXRenderingColorOverLife: colors array cannot be empty");
24
24
  }
25
25
  this.requiredUniforms = { colorOverLifeTexture: buildGradientTexture(colors) };
26
26
  }
@@ -21,10 +21,10 @@ class FXRenderingColorOverVelocity extends FXRenderingModule {
21
21
  /** @internal */
22
22
  this.source = source;
23
23
  if (colors.length === 0) {
24
- throw new Error("UIRenderingColorOverVelocity: colors array cannot be empty");
24
+ throw new Error("FXRenderingColorOverVelocity: colors array cannot be empty");
25
25
  }
26
26
  if (maxVelocity <= 0) {
27
- throw new Error("UIRenderingColorOverVelocity: maxVelocity must be greater than 0");
27
+ throw new Error("FXRenderingColorOverVelocity: maxVelocity must be greater than 0");
28
28
  }
29
29
  this.source = source.replace("COLOR_OVER_VELOCITY_MAX", `COLOR_OVER_VELOCITY_MAX ${maxVelocity.toFixed(2)}`);
30
30
  this.requiredUniforms = { colorOverVelocityTexture: buildGradientTexture(colors) };
@@ -1,3 +1,3 @@
1
- var source = "#define COLOR_OVER_VELOCITY_MAX vec4 draw(){float t=clamp(length(vec2(PARTICLE_VELOCITY_X,PARTICLE_VELOCITY_Y))/COLOR_OVER_VELOCITY_MAX,0.0,1.0);return srgbTexture2D(p_colorOverVelocityTexture,vec2(t,0.5));}";
1
+ var source = "#define COLOR_OVER_VELOCITY_MAX vec4 draw(){float t=clamp(length(vec3(PARTICLE_VELOCITY_X,PARTICLE_VELOCITY_Y,PARTICLE_VELOCITY_Z))/COLOR_OVER_VELOCITY_MAX,0.0,1.0);return srgbTexture2D(p_colorOverVelocityTexture,vec2(t,0.5));}";
2
2
 
3
3
  export { source as default };
@@ -2,7 +2,7 @@ import type { Vector3Like } from "../miscellaneous/math";
2
2
  import { type FXVector3Config } from "../miscellaneous/miscellaneous";
3
3
  import { FXSpawnModule } from "./FXSpawnModule";
4
4
  /**
5
- * Spawns particles at random positions within a rectangle.
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
  */
@@ -12,16 +12,16 @@ export declare class FXSpawnBox extends FXSpawnModule<{
12
12
  private minInternal;
13
13
  private maxInternal;
14
14
  /**
15
- * @param min - Bottom-left corner of spawn area
16
- * @param max - Top-right corner of spawn area
15
+ * @param min - Minimum corner of the spawn box
16
+ * @param max - Maximum corner of the spawn box
17
17
  */
18
18
  constructor(min?: FXVector3Config, max?: FXVector3Config);
19
- /** Bottom-left corner of spawn area */
19
+ /** Minimum corner of the spawn box */
20
20
  get min(): Vector3Like;
21
- /** Top-right corner of spawn area */
21
+ /** Maximum corner of the spawn box */
22
22
  get max(): Vector3Like;
23
- /** Bottom-left corner of spawn area */
23
+ /** Minimum corner of the spawn box */
24
24
  set min(value: FXVector3Config);
25
- /** Top-right corner of spawn area */
25
+ /** Maximum corner of the spawn box */
26
26
  set max(value: FXVector3Config);
27
27
  }
@@ -1,52 +1,52 @@
1
1
  import { MathUtils } from 'three';
2
2
  import { assertValidNumber } from '../miscellaneous/asserts.js';
3
- import { resolveFXVector2Config, BUILTIN_OFFSET_POSITION_X, BUILTIN_OFFSET_POSITION_Y, BUILTIN_OFFSET_POSITION_Z } from '../miscellaneous/miscellaneous.js';
3
+ import { resolveFXVector3Config, BUILTIN_OFFSET_POSITION_X, BUILTIN_OFFSET_POSITION_Y, BUILTIN_OFFSET_POSITION_Z } from '../miscellaneous/miscellaneous.js';
4
4
  import { FXSpawnModule } from './FXSpawnModule.js';
5
5
 
6
6
  /**
7
- * Spawns particles at random positions within a rectangle.
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
11
  class FXSpawnBox extends FXSpawnModule {
12
12
  /**
13
- * @param min - Bottom-left corner of spawn area
14
- * @param max - Top-right corner of spawn area
13
+ * @param min - Minimum corner of the spawn box
14
+ * @param max - Maximum corner of the spawn box
15
15
  */
16
16
  constructor(min = { x: -1, y: -1, z: -1 }, max = { x: 1, y: 1, z: 1 }) {
17
17
  super();
18
18
  /** @internal */
19
19
  this.requiredProperties = { builtin: "Matrix4" };
20
- this._private_minInternal = resolveFXVector2Config(min);
21
- this._private_maxInternal = resolveFXVector2Config(max);
22
- assertValidNumber(this._private_minInternal.x, "FXSpawnRectangle.constructor.min.x");
23
- assertValidNumber(this._private_minInternal.y, "FXSpawnRectangle.constructor.min.y");
24
- assertValidNumber(this._private_minInternal.z, "FXSpawnRectangle.constructor.min.z");
25
- assertValidNumber(this._private_maxInternal.x, "FXSpawnRectangle.constructor.max.x");
26
- assertValidNumber(this._private_maxInternal.y, "FXSpawnRectangle.constructor.max.y");
27
- assertValidNumber(this._private_maxInternal.z, "FXSpawnRectangle.constructor.max.z");
20
+ this._private_minInternal = resolveFXVector3Config(min);
21
+ this._private_maxInternal = resolveFXVector3Config(max);
22
+ assertValidNumber(this._private_minInternal.x, "FXSpawnBox.constructor.min.x");
23
+ assertValidNumber(this._private_minInternal.y, "FXSpawnBox.constructor.min.y");
24
+ assertValidNumber(this._private_minInternal.z, "FXSpawnBox.constructor.min.z");
25
+ assertValidNumber(this._private_maxInternal.x, "FXSpawnBox.constructor.max.x");
26
+ assertValidNumber(this._private_maxInternal.y, "FXSpawnBox.constructor.max.y");
27
+ assertValidNumber(this._private_maxInternal.z, "FXSpawnBox.constructor.max.z");
28
28
  }
29
- /** Bottom-left corner of spawn area */
29
+ /** Minimum corner of the spawn box */
30
30
  get min() {
31
31
  return this._private_minInternal;
32
32
  }
33
- /** Top-right corner of spawn area */
33
+ /** Maximum corner of the spawn box */
34
34
  get max() {
35
35
  return this._private_maxInternal;
36
36
  }
37
- /** Bottom-left corner of spawn area */
37
+ /** Minimum corner of the spawn box */
38
38
  set min(value) {
39
- this._private_minInternal = resolveFXVector2Config(value);
40
- assertValidNumber(this._private_minInternal.x, "FXSpawnRectangle.min.x");
41
- assertValidNumber(this._private_minInternal.y, "FXSpawnRectangle.min.y");
42
- assertValidNumber(this._private_minInternal.z, "FXSpawnRectangle.min.z");
39
+ this._private_minInternal = resolveFXVector3Config(value);
40
+ assertValidNumber(this._private_minInternal.x, "FXSpawnBox.min.x");
41
+ assertValidNumber(this._private_minInternal.y, "FXSpawnBox.min.y");
42
+ assertValidNumber(this._private_minInternal.z, "FXSpawnBox.min.z");
43
43
  }
44
- /** Top-right corner of spawn area */
44
+ /** Maximum corner of the spawn box */
45
45
  set max(value) {
46
- this._private_maxInternal = resolveFXVector2Config(value);
47
- assertValidNumber(this._private_maxInternal.x, "FXSpawnRectangle.max.x");
48
- assertValidNumber(this._private_maxInternal.y, "FXSpawnRectangle.max.y");
49
- assertValidNumber(this._private_maxInternal.z, "FXSpawnRectangle.max.z");
46
+ this._private_maxInternal = resolveFXVector3Config(value);
47
+ assertValidNumber(this._private_maxInternal.x, "FXSpawnBox.max.x");
48
+ assertValidNumber(this._private_maxInternal.y, "FXSpawnBox.max.y");
49
+ assertValidNumber(this._private_maxInternal.z, "FXSpawnBox.max.z");
50
50
  }
51
51
  /** @internal */
52
52
  spawn(properties, instanceBegin, instanceEnd) {
@@ -1,5 +1,5 @@
1
1
  import { assertValidNumber } from '../miscellaneous/asserts.js';
2
- import { resolveFXVector2Config, BUILTIN_OFFSET_POSITION_X, BUILTIN_OFFSET_POSITION_Y, BUILTIN_OFFSET_POSITION_Z } from '../miscellaneous/miscellaneous.js';
2
+ import { resolveFXVector3Config, BUILTIN_OFFSET_POSITION_X, BUILTIN_OFFSET_POSITION_Y, BUILTIN_OFFSET_POSITION_Z } from '../miscellaneous/miscellaneous.js';
3
3
  import { FXSpawnModule } from './FXSpawnModule.js';
4
4
 
5
5
  /**
@@ -15,7 +15,7 @@ class FXSpawnOffset extends FXSpawnModule {
15
15
  super();
16
16
  /** @internal */
17
17
  this.requiredProperties = { builtin: "Matrix4" };
18
- this._private_offsetInternal = resolveFXVector2Config(offset);
18
+ this._private_offsetInternal = resolveFXVector3Config(offset);
19
19
  assertValidNumber(this._private_offsetInternal.x, "FXSpawnOffset.constructor.offset.x");
20
20
  assertValidNumber(this._private_offsetInternal.y, "FXSpawnOffset.constructor.offset.y");
21
21
  assertValidNumber(this._private_offsetInternal.z, "FXSpawnOffset.constructor.offset.z");
@@ -26,7 +26,7 @@ class FXSpawnOffset extends FXSpawnModule {
26
26
  }
27
27
  /** Particle position offset */
28
28
  set offset(value) {
29
- this._private_offsetInternal = resolveFXVector2Config(value);
29
+ this._private_offsetInternal = resolveFXVector3Config(value);
30
30
  assertValidNumber(this._private_offsetInternal.x, "FXSpawnOffset.offset.x");
31
31
  assertValidNumber(this._private_offsetInternal.y, "FXSpawnOffset.offset.y");
32
32
  assertValidNumber(this._private_offsetInternal.z, "FXSpawnOffset.offset.z");
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "sparcoon",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "particles",
7
+ "particle-system",
7
8
  "three.js",
8
- "mobile",
9
- "ads",
9
+ "3d",
10
+ "webgl",
11
+ "instanced",
12
+ "billboard",
10
13
  "typescript"
11
14
  ],
12
15
  "author": "jango",