sparcoon 0.6.1 → 0.7.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/emitter/FXEmitter.d.ts +4 -0
- package/dist/emitter/FXEmitter.js +8 -0
- package/dist/emitter/behavior/FXBehaviorDirectionalForce.d.ts +0 -2
- package/dist/emitter/behavior/FXBehaviorDirectionalForce.js +0 -2
- package/dist/emitter/behavior/FXBehaviorPointForce.d.ts +0 -4
- package/dist/emitter/behavior/FXBehaviorPointForce.js +0 -4
- package/dist/emitter/behavior/FXBehaviorScaleOverLife.d.ts +4 -3
- package/dist/emitter/behavior/FXBehaviorScaleOverLife.js +9 -3
- package/dist/emitter/behavior/FXBehaviorTorqueDamping.d.ts +0 -1
- package/dist/emitter/behavior/FXBehaviorTorqueDamping.js +0 -1
- package/dist/emitter/behavior/FXBehaviorTorqueNoise.d.ts +0 -2
- package/dist/emitter/behavior/FXBehaviorTorqueNoise.js +0 -2
- package/dist/emitter/behavior/FXBehaviorTorqueOverLife.d.ts +4 -2
- package/dist/emitter/behavior/FXBehaviorTorqueOverLife.js +9 -2
- package/dist/emitter/behavior/FXBehaviorVelocityDamping.d.ts +0 -1
- package/dist/emitter/behavior/FXBehaviorVelocityDamping.js +0 -1
- package/dist/emitter/behavior/FXBehaviorVelocityNoise.d.ts +0 -2
- package/dist/emitter/behavior/FXBehaviorVelocityNoise.js +0 -2
- package/dist/emitter/behavior/FXBehaviorVelocityOverLife.d.ts +4 -2
- package/dist/emitter/behavior/FXBehaviorVelocityOverLife.js +9 -2
- package/dist/emitter/spawn/FXSpawnBox.d.ts +0 -1
- package/dist/emitter/spawn/FXSpawnBox.js +0 -1
- package/dist/emitter/spawn/FXSpawnLifetime.d.ts +0 -1
- package/dist/emitter/spawn/FXSpawnLifetime.js +0 -1
- package/dist/emitter/spawn/FXSpawnOffset.d.ts +0 -1
- package/dist/emitter/spawn/FXSpawnOffset.js +0 -1
- package/dist/emitter/spawn/FXSpawnPoint.d.ts +0 -1
- package/dist/emitter/spawn/FXSpawnPoint.js +0 -1
- package/dist/emitter/spawn/FXSpawnRotation.d.ts +0 -1
- package/dist/emitter/spawn/FXSpawnRotation.js +0 -1
- package/dist/emitter/spawn/FXSpawnScale.d.ts +0 -2
- package/dist/emitter/spawn/FXSpawnScale.js +0 -2
- package/dist/emitter/spawn/FXSpawnSphere.d.ts +3 -10
- package/dist/emitter/spawn/FXSpawnSphere.js +8 -15
- package/dist/emitter/spawn/FXSpawnTorque.d.ts +0 -1
- package/dist/emitter/spawn/FXSpawnTorque.js +0 -1
- package/dist/emitter/spawn/FXSpawnVelocity.d.ts +3 -6
- package/dist/emitter/spawn/FXSpawnVelocity.js +6 -9
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/instancedParticle/FXInstancedParticle.d.ts +1 -0
- package/dist/instancedParticle/FXInstancedParticle.js +4 -1
- package/dist/materials/FXDiffuseMaterial/FXDiffuseMaterial.Internal.d.ts +4 -3
- package/dist/materials/FXDiffuseMaterial/FXDiffuseMaterial.Internal.js +42 -56
- package/dist/materials/FXDiffuseMaterial/FXDiffuseMaterial.js +1 -1
- package/dist/materials/FXMaterial/FXBlending.Internal.d.ts +24 -0
- package/dist/materials/FXMaterial/FXBlending.Internal.js +64 -0
- package/dist/materials/FXMaterial/FXDepthMaterial.Internal.js +8 -3
- package/dist/materials/FXMaterial/FXDistanceMaterial.Internal.js +7 -3
- package/dist/materials/FXMaterial/FXMaterial.d.ts +18 -15
- package/dist/materials/FXMaterial/FXMaterial.js +22 -7
- package/dist/materials/FXUnlitMaterial/FXUnlitMaterial.Internal.d.ts +3 -2
- package/dist/materials/FXUnlitMaterial/FXUnlitMaterial.Internal.js +16 -14
- package/dist/materials/FXUnlitMaterial/FXUnlitMaterial.js +1 -1
- package/dist/nodes/FXNode.d.ts +5 -0
- package/dist/nodes/FXNode.js +10 -0
- package/dist/nodes/blending/FXNodeBlending.d.ts +6 -0
- package/dist/nodes/blending/FXNodeBlending.js +9 -0
- package/dist/nodes/blending/FXNodeLightnessBlendingMask.d.ts +16 -0
- package/dist/nodes/blending/FXNodeLightnessBlendingMask.js +49 -0
- package/dist/nodes/color/FXNodeColor.d.ts +2 -3
- package/dist/nodes/color/FXNodeColor.js +3 -5
- package/dist/nodes/color/FXNodeColorOverLife.d.ts +0 -5
- package/dist/nodes/color/FXNodeColorOverLife.js +6 -8
- package/dist/nodes/color/FXNodeSphericalClip.js +6 -3
- package/dist/nodes/normal/FXNodeFlatNormal.d.ts +0 -1
- package/dist/nodes/normal/FXNodeFlatNormal.js +5 -5
- package/dist/nodes/normal/FXNodeNormal.d.ts +2 -3
- package/dist/nodes/normal/FXNodeNormal.js +3 -1
- package/dist/nodes/normal/FXNodeSphericalNormal.d.ts +0 -1
- package/dist/nodes/normal/FXNodeSphericalNormal.js +11 -9
- package/dist/nodes/texture/FXNodeAnimatedTexture.d.ts +3 -3
- package/dist/nodes/texture/FXNodeAnimatedTexture.js +19 -17
- package/dist/nodes/texture/FXNodeStaticTexture.d.ts +3 -3
- package/dist/nodes/texture/FXNodeStaticTexture.js +21 -18
- package/dist/nodes/texture/FXNodeTexture.d.ts +2 -3
- package/dist/nodes/texture/FXNodeTexture.js +3 -5
- package/package.json +1 -1
|
@@ -32,6 +32,10 @@ export declare class FXEmitter extends Object3D {
|
|
|
32
32
|
* @param options - Emitter configuration
|
|
33
33
|
*/
|
|
34
34
|
constructor(spawnSequence: FXSpawn[], behaviorSequence: readonly FXBehavior[], material: FXMaterial, options?: Partial<FXEmitterOptions>);
|
|
35
|
+
/** Number of currently alive particles */
|
|
36
|
+
get particleCount(): number;
|
|
37
|
+
/** Maximum number of particles that fit in the currently allocated buffers */
|
|
38
|
+
get particleCapacity(): number;
|
|
35
39
|
/**
|
|
36
40
|
* Ticks all active emitters; call once per frame before rendering
|
|
37
41
|
*
|
|
@@ -69,6 +69,14 @@ class FXEmitter extends Object3D {
|
|
|
69
69
|
this.add(this._private_mesh);
|
|
70
70
|
EMITTERS.push(this);
|
|
71
71
|
}
|
|
72
|
+
/** Number of currently alive particles */
|
|
73
|
+
get particleCount() {
|
|
74
|
+
return this._private_mesh.instanceCount;
|
|
75
|
+
}
|
|
76
|
+
/** Maximum number of particles that fit in the currently allocated buffers */
|
|
77
|
+
get particleCapacity() {
|
|
78
|
+
return this._private_mesh.instanceCapacity;
|
|
79
|
+
}
|
|
72
80
|
/** Unregisters the emitter, removes it from the scene, and disposes modules and material */
|
|
73
81
|
destroy() {
|
|
74
82
|
const index = EMITTERS.indexOf(this);
|
|
@@ -18,8 +18,6 @@ export declare class FXBehaviorDirectionalForce extends FXBehavior<{
|
|
|
18
18
|
get direction(): Vector3Like;
|
|
19
19
|
/** Acceleration magnitude in units/second² */
|
|
20
20
|
get magnitude(): number;
|
|
21
|
-
/** Direction vector (normalized) */
|
|
22
21
|
set direction(value: FXVector3Config);
|
|
23
|
-
/** Acceleration magnitude in units/second² */
|
|
24
22
|
set magnitude(value: number);
|
|
25
23
|
}
|
|
@@ -36,7 +36,6 @@ class FXBehaviorDirectionalForce extends FXBehavior {
|
|
|
36
36
|
get magnitude() {
|
|
37
37
|
return this._private_magnitudeInternal;
|
|
38
38
|
}
|
|
39
|
-
/** Direction vector (normalized) */
|
|
40
39
|
set direction(value) {
|
|
41
40
|
const resolved = resolveFXVector3Config(value);
|
|
42
41
|
assertValidNumber(resolved.x, "FXBehaviorDirectionalForce.direction.x");
|
|
@@ -48,7 +47,6 @@ class FXBehaviorDirectionalForce extends FXBehavior {
|
|
|
48
47
|
}
|
|
49
48
|
this._private_directionInternal.normalize();
|
|
50
49
|
}
|
|
51
|
-
/** Acceleration magnitude in units/second² */
|
|
52
50
|
set magnitude(value) {
|
|
53
51
|
assertValidNumber(value, "FXBehaviorDirectionalForce.magnitude");
|
|
54
52
|
this._private_magnitudeInternal = value;
|
|
@@ -29,12 +29,8 @@ export declare class FXBehaviorPointForce extends FXBehavior<{
|
|
|
29
29
|
get exponent(): number;
|
|
30
30
|
/** Minimum distance */
|
|
31
31
|
get threshold(): number;
|
|
32
|
-
/** Force center position */
|
|
33
32
|
set center(value: FXVector3Config);
|
|
34
|
-
/** Force multiplier */
|
|
35
33
|
set strength(value: number);
|
|
36
|
-
/** Distance power exponent */
|
|
37
34
|
set exponent(value: number);
|
|
38
|
-
/** Minimum distance */
|
|
39
35
|
set threshold(value: number);
|
|
40
36
|
}
|
|
@@ -46,24 +46,20 @@ class FXBehaviorPointForce extends FXBehavior {
|
|
|
46
46
|
get threshold() {
|
|
47
47
|
return this._private_thresholdInternal;
|
|
48
48
|
}
|
|
49
|
-
/** Force center position */
|
|
50
49
|
set center(value) {
|
|
51
50
|
this._private_centerInternal = resolveFXVector3Config(value);
|
|
52
51
|
assertValidNumber(this._private_centerInternal.x, "FXBehaviorPointForce.center.x");
|
|
53
52
|
assertValidNumber(this._private_centerInternal.y, "FXBehaviorPointForce.center.y");
|
|
54
53
|
assertValidNumber(this._private_centerInternal.z, "FXBehaviorPointForce.center.z");
|
|
55
54
|
}
|
|
56
|
-
/** Force multiplier */
|
|
57
55
|
set strength(value) {
|
|
58
56
|
assertValidNumber(value, "FXBehaviorPointForce.strength");
|
|
59
57
|
this._private_strengthInternal = value;
|
|
60
58
|
}
|
|
61
|
-
/** Distance power exponent */
|
|
62
59
|
set exponent(value) {
|
|
63
60
|
assertValidNumber(value, "FXBehaviorPointForce.exponent");
|
|
64
61
|
this._private_exponentInternal = value;
|
|
65
62
|
}
|
|
66
|
-
/** Minimum distance */
|
|
67
63
|
set threshold(value) {
|
|
68
64
|
assertValidNumber(value, "FXBehaviorPointForce.threshold");
|
|
69
65
|
this._private_thresholdInternal = value;
|
|
@@ -8,16 +8,17 @@ import { FXBehavior } from "./FXBehavior";
|
|
|
8
8
|
export declare class FXBehaviorScaleOverLife extends FXBehavior<{
|
|
9
9
|
builtin: "Matrix4";
|
|
10
10
|
}> {
|
|
11
|
-
|
|
12
|
-
curve: FXCurve1D<FXRange>;
|
|
11
|
+
private curveInternal;
|
|
13
12
|
private aspectInternal;
|
|
14
13
|
/**
|
|
15
14
|
* @param curve - Scale curve; accepts a {@link FXCurve1D} instance or a `FXRange[]` shorthand
|
|
16
15
|
* @param aspect - Width/height ratio; must be positive. Defaults to `1`
|
|
17
16
|
*/
|
|
18
17
|
constructor(curve: FXCurve1DConfig<FXRange>, aspect?: FXAspectConfig);
|
|
18
|
+
/** Active scale curve */
|
|
19
|
+
get curve(): FXCurve1D<FXRange>;
|
|
19
20
|
/** Width/height aspect ratio */
|
|
20
21
|
get aspect(): number;
|
|
21
|
-
|
|
22
|
+
set curve(value: FXCurve1DConfig<FXRange>);
|
|
22
23
|
set aspect(value: FXAspectConfig);
|
|
23
24
|
}
|
|
@@ -16,15 +16,21 @@ class FXBehaviorScaleOverLife extends FXBehavior {
|
|
|
16
16
|
super();
|
|
17
17
|
/** @internal */
|
|
18
18
|
this.requiredProperties = { builtin: "Matrix4" };
|
|
19
|
-
this.
|
|
19
|
+
this._private_curveInternal = new FXCurve1D(curve);
|
|
20
20
|
this._private_aspectInternal = resolveAspect(aspect);
|
|
21
21
|
assertValidPositiveNumber(this._private_aspectInternal, "FXBehaviorScaleOverLife.constructor.aspect");
|
|
22
22
|
}
|
|
23
|
+
/** Active scale curve */
|
|
24
|
+
get curve() {
|
|
25
|
+
return this._private_curveInternal;
|
|
26
|
+
}
|
|
23
27
|
/** Width/height aspect ratio */
|
|
24
28
|
get aspect() {
|
|
25
29
|
return this._private_aspectInternal;
|
|
26
30
|
}
|
|
27
|
-
|
|
31
|
+
set curve(value) {
|
|
32
|
+
this._private_curveInternal = new FXCurve1D(value);
|
|
33
|
+
}
|
|
28
34
|
set aspect(value) {
|
|
29
35
|
this._private_aspectInternal = resolveAspect(value);
|
|
30
36
|
assertValidPositiveNumber(this._private_aspectInternal, "FXBehaviorScaleOverLife.aspect");
|
|
@@ -37,7 +43,7 @@ class FXBehaviorScaleOverLife extends FXBehavior {
|
|
|
37
43
|
const itemOffset = i * itemSize;
|
|
38
44
|
const lifeT = Math.min(array[itemOffset + BUILTIN_OFFSET_AGE] / array[itemOffset + BUILTIN_OFFSET_LIFETIME], 1);
|
|
39
45
|
const scaleT = array[itemOffset + BUILTIN_OFFSET_RANDOM_A];
|
|
40
|
-
const { a, b, t: localT } = this.
|
|
46
|
+
const { a, b, t: localT } = this._private_curveInternal.sample(lifeT);
|
|
41
47
|
const scale = MathUtils.lerp(MathUtils.lerp(a.min, a.max, scaleT), MathUtils.lerp(b.min, b.max, scaleT), localT);
|
|
42
48
|
array[itemOffset + BUILTIN_OFFSET_SCALE_X] = scale * this._private_aspectInternal;
|
|
43
49
|
array[itemOffset + BUILTIN_OFFSET_SCALE_Y] = scale;
|
|
@@ -25,7 +25,6 @@ class FXBehaviorTorqueDamping extends FXBehavior {
|
|
|
25
25
|
get damping() {
|
|
26
26
|
return this._private_dampingInternal;
|
|
27
27
|
}
|
|
28
|
-
/** Damping coefficient range (0-1) */
|
|
29
28
|
set damping(value) {
|
|
30
29
|
this._private_dampingInternal = resolveFXRangeConfig(value);
|
|
31
30
|
assertValidNonNegativeNumber(this._private_dampingInternal.min, `FXBehaviorTorqueDamping.damping.min`);
|
|
@@ -20,8 +20,6 @@ export declare class FXBehaviorTorqueNoise extends FXBehavior<{
|
|
|
20
20
|
get scale(): FXRange;
|
|
21
21
|
/** Force multiplier range */
|
|
22
22
|
get strength(): FXRange;
|
|
23
|
-
/** Noise frequency range */
|
|
24
23
|
set scale(value: FXRangeConfig);
|
|
25
|
-
/** Force multiplier range */
|
|
26
24
|
set strength(value: FXRangeConfig);
|
|
27
25
|
}
|
|
@@ -35,13 +35,11 @@ class FXBehaviorTorqueNoise extends FXBehavior {
|
|
|
35
35
|
get strength() {
|
|
36
36
|
return this._private_strengthInternal;
|
|
37
37
|
}
|
|
38
|
-
/** Noise frequency range */
|
|
39
38
|
set scale(value) {
|
|
40
39
|
this._private_scaleInternal = resolveFXRangeConfig(value);
|
|
41
40
|
assertValidPositiveNumber(this._private_scaleInternal.min, `FXBehaviorTorqueNoise.scale.min`);
|
|
42
41
|
assertValidPositiveNumber(this._private_scaleInternal.max, `FXBehaviorTorqueNoise.scale.max`);
|
|
43
42
|
}
|
|
44
|
-
/** Force multiplier range */
|
|
45
43
|
set strength(value) {
|
|
46
44
|
this._private_strengthInternal = resolveFXRangeConfig(value);
|
|
47
45
|
assertValidNonNegativeNumber(this._private_strengthInternal.min, `FXBehaviorTorqueNoise.strength.min`);
|
|
@@ -8,10 +8,12 @@ import { FXBehavior } from "./FXBehavior";
|
|
|
8
8
|
export declare class FXBehaviorTorqueOverLife extends FXBehavior<{
|
|
9
9
|
builtin: "Matrix4";
|
|
10
10
|
}> {
|
|
11
|
-
|
|
12
|
-
curve: FXCurve1D<FXRange>;
|
|
11
|
+
private curveInternal;
|
|
13
12
|
/**
|
|
14
13
|
* @param curve - Torque curve; accepts a {@link FXCurve1D} instance or a `FXRange[]` shorthand
|
|
15
14
|
*/
|
|
16
15
|
constructor(curve: FXCurve1DConfig<FXRange>);
|
|
16
|
+
/** Active torque curve */
|
|
17
|
+
get curve(): FXCurve1D<FXRange>;
|
|
18
|
+
set curve(value: FXCurve1DConfig<FXRange>);
|
|
17
19
|
}
|
|
@@ -14,7 +14,14 @@ class FXBehaviorTorqueOverLife extends FXBehavior {
|
|
|
14
14
|
super();
|
|
15
15
|
/** @internal */
|
|
16
16
|
this.requiredProperties = { builtin: "Matrix4" };
|
|
17
|
-
this.
|
|
17
|
+
this._private_curveInternal = new FXCurve1D(curve);
|
|
18
|
+
}
|
|
19
|
+
/** Active torque curve */
|
|
20
|
+
get curve() {
|
|
21
|
+
return this._private_curveInternal;
|
|
22
|
+
}
|
|
23
|
+
set curve(value) {
|
|
24
|
+
this._private_curveInternal = new FXCurve1D(value);
|
|
18
25
|
}
|
|
19
26
|
/** @internal */
|
|
20
27
|
update(properties, instanceCount) {
|
|
@@ -24,7 +31,7 @@ class FXBehaviorTorqueOverLife extends FXBehavior {
|
|
|
24
31
|
const itemOffset = i * itemSize;
|
|
25
32
|
const lifeT = Math.min(array[itemOffset + BUILTIN_OFFSET_AGE] / array[itemOffset + BUILTIN_OFFSET_LIFETIME], 1);
|
|
26
33
|
const torqueT = array[itemOffset + BUILTIN_OFFSET_RANDOM_B];
|
|
27
|
-
const { a, b, t: localT } = this.
|
|
34
|
+
const { a, b, t: localT } = this._private_curveInternal.sample(lifeT);
|
|
28
35
|
array[itemOffset + BUILTIN_OFFSET_TORQUE] = MathUtils.lerp(MathUtils.lerp(a.min, a.max, torqueT), MathUtils.lerp(b.min, b.max, torqueT), localT);
|
|
29
36
|
}
|
|
30
37
|
builtin.needsUpdate = true;
|
|
@@ -25,7 +25,6 @@ class FXBehaviorVelocityDamping extends FXBehavior {
|
|
|
25
25
|
get damping() {
|
|
26
26
|
return this._private_dampingInternal;
|
|
27
27
|
}
|
|
28
|
-
/** Damping coefficient range (0-1) */
|
|
29
28
|
set damping(value) {
|
|
30
29
|
this._private_dampingInternal = resolveFXRangeConfig(value);
|
|
31
30
|
assertValidNonNegativeNumber(this._private_dampingInternal.min, `FXBehaviorVelocityDamping.damping.min`);
|
|
@@ -20,8 +20,6 @@ export declare class FXBehaviorVelocityNoise extends FXBehavior<{
|
|
|
20
20
|
get scale(): FXRange;
|
|
21
21
|
/** Force multiplier range */
|
|
22
22
|
get strength(): FXRange;
|
|
23
|
-
/** Noise frequency range */
|
|
24
23
|
set scale(value: FXRangeConfig);
|
|
25
|
-
/** Force multiplier range */
|
|
26
24
|
set strength(value: FXRangeConfig);
|
|
27
25
|
}
|
|
@@ -37,13 +37,11 @@ class FXBehaviorVelocityNoise extends FXBehavior {
|
|
|
37
37
|
get strength() {
|
|
38
38
|
return this._private_strengthInternal;
|
|
39
39
|
}
|
|
40
|
-
/** Noise frequency range */
|
|
41
40
|
set scale(value) {
|
|
42
41
|
this._private_scaleInternal = resolveFXRangeConfig(value);
|
|
43
42
|
assertValidPositiveNumber(this._private_scaleInternal.min, `FXBehaviorVelocityNoise.scale.min`);
|
|
44
43
|
assertValidPositiveNumber(this._private_scaleInternal.max, `FXBehaviorVelocityNoise.scale.max`);
|
|
45
44
|
}
|
|
46
|
-
/** Force multiplier range */
|
|
47
45
|
set strength(value) {
|
|
48
46
|
this._private_strengthInternal = resolveFXRangeConfig(value);
|
|
49
47
|
assertValidNonNegativeNumber(this._private_strengthInternal.min, `FXBehaviorVelocityNoise.strength.min`);
|
|
@@ -11,10 +11,12 @@ import { FXBehavior } from "./FXBehavior";
|
|
|
11
11
|
export declare class FXBehaviorVelocityOverLife extends FXBehavior<{
|
|
12
12
|
builtin: "Matrix4";
|
|
13
13
|
}> {
|
|
14
|
-
|
|
15
|
-
curve: FXCurve1D<FXRange>;
|
|
14
|
+
private curveInternal;
|
|
16
15
|
/**
|
|
17
16
|
* @param curve - Speed curve; accepts a {@link FXCurve1D} instance or a `FXRange[]` shorthand
|
|
18
17
|
*/
|
|
19
18
|
constructor(curve: FXCurve1DConfig<FXRange>);
|
|
19
|
+
/** Active speed curve */
|
|
20
|
+
get curve(): FXCurve1D<FXRange>;
|
|
21
|
+
set curve(value: FXCurve1DConfig<FXRange>);
|
|
20
22
|
}
|
|
@@ -17,7 +17,14 @@ class FXBehaviorVelocityOverLife extends FXBehavior {
|
|
|
17
17
|
super();
|
|
18
18
|
/** @internal */
|
|
19
19
|
this.requiredProperties = { builtin: "Matrix4" };
|
|
20
|
-
this.
|
|
20
|
+
this._private_curveInternal = new FXCurve1D(curve);
|
|
21
|
+
}
|
|
22
|
+
/** Active speed curve */
|
|
23
|
+
get curve() {
|
|
24
|
+
return this._private_curveInternal;
|
|
25
|
+
}
|
|
26
|
+
set curve(value) {
|
|
27
|
+
this._private_curveInternal = new FXCurve1D(value);
|
|
21
28
|
}
|
|
22
29
|
/** @internal */
|
|
23
30
|
update(properties, instanceCount) {
|
|
@@ -34,7 +41,7 @@ class FXBehaviorVelocityOverLife extends FXBehavior {
|
|
|
34
41
|
continue;
|
|
35
42
|
}
|
|
36
43
|
const velocityT = array[itemOffset + BUILTIN_OFFSET_RANDOM_A];
|
|
37
|
-
const { a, b, t: localT } = this.
|
|
44
|
+
const { a, b, t: localT } = this._private_curveInternal.sample(lifeT);
|
|
38
45
|
const targetSpeed = MathUtils.lerp(MathUtils.lerp(a.min, a.max, velocityT), MathUtils.lerp(b.min, b.max, velocityT), localT);
|
|
39
46
|
const scaleFactor = targetSpeed / currentSpeed;
|
|
40
47
|
array[itemOffset + BUILTIN_OFFSET_VELOCITY_X] = velocityX * scaleFactor;
|
|
@@ -23,7 +23,6 @@ class FXSpawnBox extends FXSpawn {
|
|
|
23
23
|
get size() {
|
|
24
24
|
return this._private_sizeInternal;
|
|
25
25
|
}
|
|
26
|
-
/** Size of the spawn box */
|
|
27
26
|
set size(value) {
|
|
28
27
|
this._private_sizeInternal = resolveFXVector3Config(value);
|
|
29
28
|
assertValidNumber(this._private_sizeInternal.x, "FXSpawnBox.size.x");
|
|
@@ -22,7 +22,6 @@ class FXSpawnLifetime extends FXSpawn {
|
|
|
22
22
|
get lifetime() {
|
|
23
23
|
return this._private_lifetimeInternal;
|
|
24
24
|
}
|
|
25
|
-
/** Lifetime range in seconds */
|
|
26
25
|
set lifetime(value) {
|
|
27
26
|
this._private_lifetimeInternal = resolveFXRangeConfig(value);
|
|
28
27
|
assertValidPositiveNumber(this._private_lifetimeInternal.min, "FXSpawnLifetime.lifetime.min");
|
|
@@ -25,7 +25,6 @@ class FXSpawnOffset extends FXSpawn {
|
|
|
25
25
|
get offset() {
|
|
26
26
|
return this._private_offsetInternal;
|
|
27
27
|
}
|
|
28
|
-
/** Particle position offset */
|
|
29
28
|
set offset(value) {
|
|
30
29
|
this._private_offsetInternal = resolveFXVector3Config(value);
|
|
31
30
|
assertValidNumber(this._private_offsetInternal.x, "FXSpawnOffset.offset.x");
|
|
@@ -22,7 +22,6 @@ class FXSpawnPoint extends FXSpawn {
|
|
|
22
22
|
get position() {
|
|
23
23
|
return this._private_positionInternal;
|
|
24
24
|
}
|
|
25
|
-
/** Spawn position */
|
|
26
25
|
set position(value) {
|
|
27
26
|
this._private_positionInternal = resolveFXVector3Config(value);
|
|
28
27
|
assertValidNumber(this._private_positionInternal.x, "FXSpawnPoint.position.x");
|
|
@@ -22,7 +22,6 @@ class FXSpawnRotation extends FXSpawn {
|
|
|
22
22
|
get rotation() {
|
|
23
23
|
return this._private_rotationInternal;
|
|
24
24
|
}
|
|
25
|
-
/** Rotation range in radians */
|
|
26
25
|
set rotation(value) {
|
|
27
26
|
this._private_rotationInternal = resolveFXRangeConfig(value);
|
|
28
27
|
assertValidNumber(this._private_rotationInternal.min, "FXSpawnRotation.rotation.min");
|
|
@@ -17,8 +17,6 @@ export declare class FXSpawnScale extends FXSpawn<{
|
|
|
17
17
|
get scale(): FXRange;
|
|
18
18
|
/** Width/height aspect ratio */
|
|
19
19
|
get aspect(): number;
|
|
20
|
-
/** Base scale range */
|
|
21
20
|
set scale(value: FXRangeConfig);
|
|
22
|
-
/** Width/height aspect ratio */
|
|
23
21
|
set aspect(value: FXAspectConfig);
|
|
24
22
|
}
|
|
@@ -29,13 +29,11 @@ class FXSpawnScale extends FXSpawn {
|
|
|
29
29
|
get aspect() {
|
|
30
30
|
return this._private_aspectInternal;
|
|
31
31
|
}
|
|
32
|
-
/** Base scale range */
|
|
33
32
|
set scale(value) {
|
|
34
33
|
this._private_scaleInternal = resolveFXRangeConfig(value);
|
|
35
34
|
assertValidPositiveNumber(this._private_scaleInternal.min, "FXSpawnScale.scale.min");
|
|
36
35
|
assertValidPositiveNumber(this._private_scaleInternal.max, "FXSpawnScale.scale.max");
|
|
37
36
|
}
|
|
38
|
-
/** Width/height aspect ratio */
|
|
39
37
|
set aspect(value) {
|
|
40
38
|
this._private_aspectInternal = resolveAspect(value);
|
|
41
39
|
assertValidPositiveNumber(this._private_aspectInternal, "FXSpawnScale.aspect");
|
|
@@ -20,24 +20,17 @@ export declare class FXSpawnSphere extends FXSpawn<{
|
|
|
20
20
|
* @param angle - Polar half-angle from equatorial plane in radians. Defaults to `Math.PI / 2`
|
|
21
21
|
*/
|
|
22
22
|
constructor(innerRadius?: number, outerRadius?: number, angle?: number);
|
|
23
|
-
/**
|
|
24
|
-
* Polar half-angle from the equatorial plane.
|
|
25
|
-
* - `0` - flat disk
|
|
26
|
-
* - `Math.PI / 2` - full sphere
|
|
27
|
-
*/
|
|
28
|
-
get angle(): number;
|
|
29
23
|
/** Minimum spawn radius */
|
|
30
24
|
get innerRadius(): number;
|
|
31
25
|
/** Maximum spawn radius */
|
|
32
26
|
get outerRadius(): number;
|
|
33
|
-
/** Minimum spawn radius */
|
|
34
|
-
set innerRadius(value: number);
|
|
35
|
-
/** Maximum spawn radius */
|
|
36
|
-
set outerRadius(value: number);
|
|
37
27
|
/**
|
|
38
28
|
* Polar half-angle from the equatorial plane.
|
|
39
29
|
* - `0` - flat disk
|
|
40
30
|
* - `Math.PI / 2` - full sphere
|
|
41
31
|
*/
|
|
32
|
+
get angle(): number;
|
|
33
|
+
set innerRadius(value: number);
|
|
34
|
+
set outerRadius(value: number);
|
|
42
35
|
set angle(value: number);
|
|
43
36
|
}
|
|
@@ -29,14 +29,6 @@ class FXSpawnSphere extends FXSpawn {
|
|
|
29
29
|
assertValidNonNegativeNumber(outerRadius, "FXSpawnSphere.constructor.outerRadius");
|
|
30
30
|
assertValidNumber(angle, "FXSpawnSphere.constructor.angle");
|
|
31
31
|
}
|
|
32
|
-
/**
|
|
33
|
-
* Polar half-angle from the equatorial plane.
|
|
34
|
-
* - `0` - flat disk
|
|
35
|
-
* - `Math.PI / 2` - full sphere
|
|
36
|
-
*/
|
|
37
|
-
get angle() {
|
|
38
|
-
return this._private_angleInternal;
|
|
39
|
-
}
|
|
40
32
|
/** Minimum spawn radius */
|
|
41
33
|
get innerRadius() {
|
|
42
34
|
return this._private_innerRadiusInternal;
|
|
@@ -45,21 +37,22 @@ class FXSpawnSphere extends FXSpawn {
|
|
|
45
37
|
get outerRadius() {
|
|
46
38
|
return this._private_outerRadiusInternal;
|
|
47
39
|
}
|
|
48
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* Polar half-angle from the equatorial plane.
|
|
42
|
+
* - `0` - flat disk
|
|
43
|
+
* - `Math.PI / 2` - full sphere
|
|
44
|
+
*/
|
|
45
|
+
get angle() {
|
|
46
|
+
return this._private_angleInternal;
|
|
47
|
+
}
|
|
49
48
|
set innerRadius(value) {
|
|
50
49
|
assertValidNonNegativeNumber(value, "FXSpawnSphere.innerRadius");
|
|
51
50
|
this._private_innerRadiusInternal = value;
|
|
52
51
|
}
|
|
53
|
-
/** Maximum spawn radius */
|
|
54
52
|
set outerRadius(value) {
|
|
55
53
|
assertValidNonNegativeNumber(value, "FXSpawnSphere.outerRadius");
|
|
56
54
|
this._private_outerRadiusInternal = value;
|
|
57
55
|
}
|
|
58
|
-
/**
|
|
59
|
-
* Polar half-angle from the equatorial plane.
|
|
60
|
-
* - `0` - flat disk
|
|
61
|
-
* - `Math.PI / 2` - full sphere
|
|
62
|
-
*/
|
|
63
56
|
set angle(value) {
|
|
64
57
|
assertValidNumber(value, "FXSpawnSphere.angle");
|
|
65
58
|
this._private_angleInternal = value;
|
|
@@ -22,7 +22,6 @@ class FXSpawnTorque extends FXSpawn {
|
|
|
22
22
|
get torque() {
|
|
23
23
|
return this._private_torqueInternal;
|
|
24
24
|
}
|
|
25
|
-
/** Angular velocity range in radians/second */
|
|
26
25
|
set torque(value) {
|
|
27
26
|
this._private_torqueInternal = resolveFXRangeConfig(value);
|
|
28
27
|
assertValidNumber(this._private_torqueInternal.min, "FXSpawnTorque.torque.min");
|
|
@@ -17,16 +17,13 @@ export declare class FXSpawnVelocity extends FXSpawn<{
|
|
|
17
17
|
* @param magnitude - Speed range in units/second. Defaults to `{ min: -1, max: 1 }`
|
|
18
18
|
*/
|
|
19
19
|
constructor(direction?: Vector3, angle?: FXRangeConfig, magnitude?: FXRangeConfig);
|
|
20
|
+
/** Cone axis (always normalized) */
|
|
21
|
+
get direction(): Vector3;
|
|
20
22
|
/** Cone half-angle range in radians */
|
|
21
23
|
get angle(): FXRange;
|
|
22
24
|
/** Speed range in units/second */
|
|
23
25
|
get magnitude(): FXRange;
|
|
24
|
-
|
|
25
|
-
get direction(): Vector3;
|
|
26
|
-
/** Cone half-angle range in radians */
|
|
26
|
+
set direction(value: Vector3);
|
|
27
27
|
set angle(value: FXRangeConfig);
|
|
28
|
-
/** Speed range in units/second */
|
|
29
28
|
set magnitude(value: FXRangeConfig);
|
|
30
|
-
/** Cone axis - normalized on assignment */
|
|
31
|
-
set direction(value: Vector3);
|
|
32
29
|
}
|
|
@@ -28,6 +28,10 @@ class FXSpawnVelocity extends FXSpawn {
|
|
|
28
28
|
assertValidNumber(this._private_magnitudeInternal.min, "FXSpawnVelocity.constructor.magnitude.min");
|
|
29
29
|
assertValidNumber(this._private_magnitudeInternal.max, "FXSpawnVelocity.constructor.magnitude.max");
|
|
30
30
|
}
|
|
31
|
+
/** Cone axis (always normalized) */
|
|
32
|
+
get direction() {
|
|
33
|
+
return this._private_directionInternal;
|
|
34
|
+
}
|
|
31
35
|
/** Cone half-angle range in radians */
|
|
32
36
|
get angle() {
|
|
33
37
|
return this._private_angleInternal;
|
|
@@ -36,26 +40,19 @@ class FXSpawnVelocity extends FXSpawn {
|
|
|
36
40
|
get magnitude() {
|
|
37
41
|
return this._private_magnitudeInternal;
|
|
38
42
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return this._private_directionInternal;
|
|
43
|
+
set direction(value) {
|
|
44
|
+
this._private_directionInternal.copy(value).normalize();
|
|
42
45
|
}
|
|
43
|
-
/** Cone half-angle range in radians */
|
|
44
46
|
set angle(value) {
|
|
45
47
|
this._private_angleInternal = resolveFXRangeConfig(value);
|
|
46
48
|
assertValidNumber(this._private_angleInternal.min, "FXSpawnVelocity.angle.min");
|
|
47
49
|
assertValidNumber(this._private_angleInternal.max, "FXSpawnVelocity.angle.max");
|
|
48
50
|
}
|
|
49
|
-
/** Speed range in units/second */
|
|
50
51
|
set magnitude(value) {
|
|
51
52
|
this._private_magnitudeInternal = resolveFXRangeConfig(value);
|
|
52
53
|
assertValidNumber(this._private_magnitudeInternal.min, "FXSpawnVelocity.magnitude.min");
|
|
53
54
|
assertValidNumber(this._private_magnitudeInternal.max, "FXSpawnVelocity.magnitude.max");
|
|
54
55
|
}
|
|
55
|
-
/** Cone axis - normalized on assignment */
|
|
56
|
-
set direction(value) {
|
|
57
|
-
this._private_directionInternal.copy(value).normalize();
|
|
58
|
-
}
|
|
59
56
|
/** @internal */
|
|
60
57
|
spawn(properties, instanceBegin, instanceEnd) {
|
|
61
58
|
const { builtin } = properties;
|
package/dist/index.d.ts
CHANGED
|
@@ -18,13 +18,15 @@ export { FXSpawnSphere } from "./emitter/spawn/FXSpawnSphere";
|
|
|
18
18
|
export { FXSpawnTorque } from "./emitter/spawn/FXSpawnTorque";
|
|
19
19
|
export { FXSpawnVelocity } from "./emitter/spawn/FXSpawnVelocity";
|
|
20
20
|
export { FXDiffuseMaterial } from "./materials/FXDiffuseMaterial/FXDiffuseMaterial";
|
|
21
|
-
export { FXMaterial } from "./materials/FXMaterial/FXMaterial";
|
|
21
|
+
export { FXBlending, FXMaterial } from "./materials/FXMaterial/FXMaterial";
|
|
22
22
|
export { FXUnlitMaterial } from "./materials/FXUnlitMaterial/FXUnlitMaterial";
|
|
23
23
|
export { FXColor } from "./miscellaneous/color/FXColor";
|
|
24
24
|
export { FXCurve1D } from "./miscellaneous/curve/FXCurve1D";
|
|
25
25
|
export type { FXCurve1DAnchor, FXCurve1DConfig, FXCurve1DPoint, } from "./miscellaneous/curve/FXCurve1D";
|
|
26
26
|
export { FXTextureView } from "./miscellaneous/texture/FXTextureView";
|
|
27
27
|
export type { FXTextureAtlasConfig, FXTextureConfig, FXTextureRect, FXTextureSize, FXTextureTrim, } from "./miscellaneous/texture/FXTextureView.Internal";
|
|
28
|
+
export { FXNodeBlending } from "./nodes/blending/FXNodeBlending";
|
|
29
|
+
export { FXNodeLightnessBlendingMask } from "./nodes/blending/FXNodeLightnessBlendingMask";
|
|
28
30
|
export { FXNodeColor } from "./nodes/color/FXNodeColor";
|
|
29
31
|
export { FXNodeColorOverLife } from "./nodes/color/FXNodeColorOverLife";
|
|
30
32
|
export { FXNodeSphericalClip } from "./nodes/color/FXNodeSphericalClip";
|
package/dist/index.js
CHANGED
|
@@ -18,11 +18,13 @@ export { FXSpawnSphere } from './emitter/spawn/FXSpawnSphere.js';
|
|
|
18
18
|
export { FXSpawnTorque } from './emitter/spawn/FXSpawnTorque.js';
|
|
19
19
|
export { FXSpawnVelocity } from './emitter/spawn/FXSpawnVelocity.js';
|
|
20
20
|
export { FXDiffuseMaterial } from './materials/FXDiffuseMaterial/FXDiffuseMaterial.js';
|
|
21
|
-
export { FXMaterial } from './materials/FXMaterial/FXMaterial.js';
|
|
21
|
+
export { FXBlending, FXMaterial } from './materials/FXMaterial/FXMaterial.js';
|
|
22
22
|
export { FXUnlitMaterial } from './materials/FXUnlitMaterial/FXUnlitMaterial.js';
|
|
23
23
|
export { FXColor } from './miscellaneous/color/FXColor.js';
|
|
24
24
|
export { FXCurve1D } from './miscellaneous/curve/FXCurve1D.js';
|
|
25
25
|
export { FXTextureView } from './miscellaneous/texture/FXTextureView.js';
|
|
26
|
+
export { FXNodeBlending } from './nodes/blending/FXNodeBlending.js';
|
|
27
|
+
export { FXNodeLightnessBlendingMask } from './nodes/blending/FXNodeLightnessBlendingMask.js';
|
|
26
28
|
export { FXNodeColor } from './nodes/color/FXNodeColor.js';
|
|
27
29
|
export { FXNodeColorOverLife } from './nodes/color/FXNodeColorOverLife.js';
|
|
28
30
|
export { FXNodeSphericalClip } from './nodes/color/FXNodeSphericalClip.js';
|
|
@@ -12,6 +12,7 @@ export declare class FXInstancedParticle extends Mesh {
|
|
|
12
12
|
private sortingTemporaryBuffer;
|
|
13
13
|
constructor(varyings: Record<string, GLTypeInfo>, expectedCapacity: number, capacityStep: number, material: Material);
|
|
14
14
|
get instanceCount(): number;
|
|
15
|
+
get instanceCapacity(): number;
|
|
15
16
|
createInstances(count: number): void;
|
|
16
17
|
removeDeadParticles(): void;
|
|
17
18
|
sortByDistance(cameraWorldPosition: Vector3): void;
|