hz-particles 1.0.13 → 1.0.15
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-lib/hz-particles-r3f.cjs +3 -3
- package/dist-lib/hz-particles-r3f.mjs +386 -318
- package/dist-lib/hz-particles.cjs +24 -10
- package/dist-lib/hz-particles.d.ts +43 -7
- package/dist-lib/hz-particles.mjs +1107 -715
- package/package.json +1 -1
|
@@ -1,300 +1,368 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useThree as
|
|
4
|
-
import * as
|
|
5
|
-
import { fetchPreset as
|
|
6
|
-
import { fetchPreset as
|
|
7
|
-
function
|
|
8
|
-
return Math.abs(Math.sin(
|
|
1
|
+
import { jsxs as Ut, Fragment as qt, jsx as Je } from "react/jsx-runtime";
|
|
2
|
+
import { useState as Bt, useEffect as _e, useRef as j, useMemo as T } from "react";
|
|
3
|
+
import { useThree as wt, useFrame as bt } from "@react-three/fiber";
|
|
4
|
+
import * as a from "three";
|
|
5
|
+
import { fetchPreset as Ht, ParticleSystemManager as Lt } from "hz-particles";
|
|
6
|
+
import { fetchPreset as tn } from "hz-particles";
|
|
7
|
+
function At(l) {
|
|
8
|
+
return Math.abs(Math.sin(l * 12.9898) * 43758.5453) % 1;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
const
|
|
12
|
-
return
|
|
10
|
+
function Ot(l) {
|
|
11
|
+
const r = Math.sin(l * 54321.67) * 43758.5453 % 1;
|
|
12
|
+
return r < 0 ? r + 1 : r;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
if (
|
|
16
|
-
const
|
|
17
|
-
let
|
|
18
|
-
if (
|
|
19
|
-
const
|
|
20
|
-
|
|
14
|
+
function Wt(l, r, U, e) {
|
|
15
|
+
if (U <= 0) return 0;
|
|
16
|
+
const g = r / U;
|
|
17
|
+
let N = l.particleSize ?? 0.5;
|
|
18
|
+
if (l.randomSize) {
|
|
19
|
+
const X = l.minSize ?? 0.1, Q = l.maxSize ?? 0.5;
|
|
20
|
+
N = X + (Q - X) * Ot(U);
|
|
21
21
|
}
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
24
|
-
const
|
|
25
|
-
|
|
22
|
+
const K = Math.max(0.01, Math.min(10, l.sizeLifetimeSpeed ?? 1));
|
|
23
|
+
if (l.fadeSizeEnabled && (N *= 1 - Math.pow(g, 1 / K)), l.increaseSizeEnabled && (N *= 1 + Math.pow(g, 1 / K)), l.pulseEnabled) {
|
|
24
|
+
const X = l.pulseAmplitude ?? 0.5, Q = l.pulseFrequency ?? 1, ce = (l.pulsePhaseRandom ?? 0) * At(e) * Math.PI * 2;
|
|
25
|
+
N *= 1 + X * Math.sin(r * Q * Math.PI * 2 + ce);
|
|
26
26
|
}
|
|
27
|
-
return Math.max(0,
|
|
27
|
+
return Math.max(0, N);
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
if (
|
|
31
|
-
let
|
|
32
|
-
const
|
|
33
|
-
if (
|
|
34
|
-
const
|
|
35
|
-
|
|
29
|
+
function _t(l, r, U, e) {
|
|
30
|
+
if (U <= 0) return 0;
|
|
31
|
+
let g = l.opacity ?? 1;
|
|
32
|
+
const N = r / U;
|
|
33
|
+
if (l.fadeEnabled && (g *= Math.max(0, 1 - N)), l.pulseEnabled && l.pulseOpacity) {
|
|
34
|
+
const K = l.pulseAmplitude ?? 0.5, X = l.pulseFrequency ?? 1, re = (l.pulsePhaseRandom ?? 0) * At(e) * Math.PI * 2;
|
|
35
|
+
g *= Math.max(0, 1 + K * Math.sin(r * X * Math.PI * 2 + re));
|
|
36
36
|
}
|
|
37
|
-
return Math.max(0, Math.min(1,
|
|
37
|
+
return Math.max(0, Math.min(1, g));
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
39
|
+
function Gt(l, r) {
|
|
40
|
+
if (r === 1) return l;
|
|
41
|
+
const U = (e, g) => e != null ? e * r : g * r;
|
|
42
|
+
return {
|
|
43
|
+
...l,
|
|
44
|
+
systems: l.systems.map((e) => ({
|
|
45
|
+
...e,
|
|
46
|
+
// Particle visual size
|
|
47
|
+
particleSize: U(e.particleSize, 0.5),
|
|
48
|
+
minSize: e.minSize != null ? e.minSize * r : void 0,
|
|
49
|
+
maxSize: e.maxSize != null ? e.maxSize * r : void 0,
|
|
50
|
+
// Speed
|
|
51
|
+
particleSpeed: (e.particleSpeed ?? 1) * r,
|
|
52
|
+
minSpeed: e.minSpeed != null ? e.minSpeed * r : void 0,
|
|
53
|
+
maxSpeed: e.maxSpeed != null ? e.maxSpeed * r : void 0,
|
|
54
|
+
// Emission shape dimensions
|
|
55
|
+
cubeLength: e.cubeLength != null ? e.cubeLength * r : void 0,
|
|
56
|
+
outerLength: e.outerLength != null ? e.outerLength * r : void 0,
|
|
57
|
+
innerLength: e.innerLength != null ? e.innerLength * r : void 0,
|
|
58
|
+
outerRadius: e.outerRadius != null ? e.outerRadius * r : void 0,
|
|
59
|
+
innerRadius: e.innerRadius != null ? e.innerRadius * r : void 0,
|
|
60
|
+
squareSize: e.squareSize != null ? e.squareSize * r : void 0,
|
|
61
|
+
squareInnerSize: e.squareInnerSize != null ? e.squareInnerSize * r : void 0,
|
|
62
|
+
circleInnerRadius: e.circleInnerRadius != null ? e.circleInnerRadius * r : void 0,
|
|
63
|
+
circleOuterRadius: e.circleOuterRadius != null ? e.circleOuterRadius * r : void 0,
|
|
64
|
+
cylinderInnerRadius: e.cylinderInnerRadius != null ? e.cylinderInnerRadius * r : void 0,
|
|
65
|
+
cylinderOuterRadius: e.cylinderOuterRadius != null ? e.cylinderOuterRadius * r : void 0,
|
|
66
|
+
cylinderHeight: e.cylinderHeight != null ? e.cylinderHeight * r : void 0,
|
|
67
|
+
// Trail
|
|
68
|
+
emissionTrailWidth: (e.emissionTrailWidth ?? 0.3) * r,
|
|
69
|
+
emissionTrailDuration: (e.emissionTrailDuration ?? 1) * r,
|
|
70
|
+
emissionTrailMinDistance: e.emissionTrailMinDistance != null ? e.emissionTrailMinDistance * r : void 0,
|
|
71
|
+
emissionTrailShapeAmplitude: e.emissionTrailShapeAmplitude != null ? e.emissionTrailShapeAmplitude * r : void 0
|
|
51
72
|
}))
|
|
52
73
|
};
|
|
53
74
|
}
|
|
54
|
-
function
|
|
55
|
-
let
|
|
56
|
-
for (const
|
|
57
|
-
|
|
58
|
-
return
|
|
75
|
+
function Xt(l) {
|
|
76
|
+
let r = 0;
|
|
77
|
+
for (const U of l.systems)
|
|
78
|
+
r += U.maxParticles ?? 1e4;
|
|
79
|
+
return r;
|
|
59
80
|
}
|
|
60
|
-
function
|
|
61
|
-
preset:
|
|
62
|
-
position:
|
|
63
|
-
positionRef:
|
|
64
|
-
autoPlay:
|
|
65
|
-
visible:
|
|
66
|
-
scale:
|
|
67
|
-
resetKey:
|
|
68
|
-
onComplete:
|
|
81
|
+
function Jt({
|
|
82
|
+
preset: l,
|
|
83
|
+
position: r,
|
|
84
|
+
positionRef: U,
|
|
85
|
+
autoPlay: e = !0,
|
|
86
|
+
visible: g = !0,
|
|
87
|
+
scale: N = 1,
|
|
88
|
+
resetKey: K = 0,
|
|
89
|
+
onComplete: X
|
|
69
90
|
}) {
|
|
70
|
-
var
|
|
71
|
-
const [
|
|
72
|
-
typeof
|
|
91
|
+
var Le;
|
|
92
|
+
const [Q, re] = Bt(
|
|
93
|
+
typeof l == "string" ? null : l
|
|
73
94
|
);
|
|
74
|
-
|
|
75
|
-
typeof
|
|
76
|
-
console.error("[HZParticlesFX] Failed to fetch preset:",
|
|
77
|
-
})) :
|
|
78
|
-
}, [
|
|
79
|
-
const { camera:
|
|
80
|
-
if (!
|
|
81
|
-
const
|
|
82
|
-
|
|
95
|
+
_e(() => {
|
|
96
|
+
typeof l == "string" ? (re(null), Ht(l).then(re).catch((u) => {
|
|
97
|
+
console.error("[HZParticlesFX] Failed to fetch preset:", u);
|
|
98
|
+
})) : re(l);
|
|
99
|
+
}, [l]);
|
|
100
|
+
const { camera: ce, gl: Ye } = wt(), pe = j(null);
|
|
101
|
+
if (!pe.current) {
|
|
102
|
+
const u = (Le = Ye.backend) == null ? void 0 : Le.device;
|
|
103
|
+
u && (pe.current = u);
|
|
83
104
|
}
|
|
84
|
-
const
|
|
85
|
-
() =>
|
|
86
|
-
[
|
|
87
|
-
),
|
|
88
|
-
() => (
|
|
89
|
-
[
|
|
90
|
-
),
|
|
91
|
-
() =>
|
|
92
|
-
[
|
|
93
|
-
),
|
|
94
|
-
() => (
|
|
95
|
-
[
|
|
96
|
-
),
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
const
|
|
105
|
+
const De = pe.current, Pe = j(null), ge = j(null), Ve = j(!1), H = j(!1), f = T(
|
|
106
|
+
() => Q ? Gt(Q, N) : null,
|
|
107
|
+
[Q, N]
|
|
108
|
+
), Be = T(
|
|
109
|
+
() => (f == null ? void 0 : f.systems.every((u) => u.emissionTrailEnabled)) ?? !1,
|
|
110
|
+
[f]
|
|
111
|
+
), je = T(
|
|
112
|
+
() => f ? f.systems.every((u) => u.emissionTrailEnabled) ? 1 : Xt(f) : 0,
|
|
113
|
+
[f]
|
|
114
|
+
), Ge = T(() => r ? r instanceof a.Vector3 ? r.clone() : new a.Vector3(...r) : new a.Vector3(0, 0, 0), [r]), ye = T(
|
|
115
|
+
() => (f == null ? void 0 : f.systems.some((u) => u.emissionTrailEnabled)) ?? !1,
|
|
116
|
+
[f]
|
|
117
|
+
), He = T(() => new a.PlaneGeometry(1, 1), []), n = T(() => {
|
|
118
|
+
const u = document.createElement("canvas");
|
|
119
|
+
u.width = 64, u.height = 64;
|
|
120
|
+
const R = u.getContext("2d");
|
|
121
|
+
R.clearRect(0, 0, 64, 64);
|
|
122
|
+
const w = R.createRadialGradient(32, 32, 0, 32, 32, 32);
|
|
123
|
+
w.addColorStop(0, "rgba(255,255,255,1)"), w.addColorStop(0.7, "rgba(255,255,255,1)"), w.addColorStop(1, "rgba(255,255,255,0)"), R.fillStyle = w, R.beginPath(), R.arc(32, 32, 32, 0, Math.PI * 2), R.fill();
|
|
124
|
+
const b = new a.CanvasTexture(u);
|
|
125
|
+
b.flipY = !1;
|
|
126
|
+
const _ = new a.MeshBasicMaterial({
|
|
106
127
|
color: 16777215,
|
|
107
128
|
transparent: !0,
|
|
108
129
|
depthWrite: !1,
|
|
109
130
|
alphaTest: 0.01,
|
|
110
|
-
map:
|
|
131
|
+
map: b,
|
|
111
132
|
vertexColors: !0,
|
|
112
|
-
side:
|
|
113
|
-
blending:
|
|
133
|
+
side: a.DoubleSide,
|
|
134
|
+
blending: a.NormalBlending
|
|
114
135
|
});
|
|
115
|
-
return
|
|
116
|
-
}, []),
|
|
117
|
-
|
|
118
|
-
|
|
136
|
+
return _.needsUpdate = !0, _;
|
|
137
|
+
}, []), D = j(null);
|
|
138
|
+
_e(() => {
|
|
139
|
+
if (!f) return;
|
|
140
|
+
const u = f.systems.find(
|
|
141
|
+
(w) => !w.emissionTrailEnabled && w.textureEnabled && w.textureImageData
|
|
142
|
+
);
|
|
143
|
+
if (!u) {
|
|
144
|
+
D.current && n.map !== D.current && (n.map = D.current, n.needsUpdate = !0);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
D.current || (D.current = n.map);
|
|
148
|
+
const R = new Image();
|
|
149
|
+
return R.onload = () => {
|
|
150
|
+
const w = new a.Texture(R);
|
|
151
|
+
w.needsUpdate = !0, n.map = w, n.needsUpdate = !0;
|
|
152
|
+
}, R.src = u.textureImageData, () => {
|
|
153
|
+
n.map && n.map !== D.current && n.map.dispose();
|
|
154
|
+
};
|
|
155
|
+
}, [f, n]);
|
|
156
|
+
const Se = 64, Z = j(null), k = j(0), y = 512, se = j({
|
|
157
|
+
buf: new Float32Array(y * 6),
|
|
158
|
+
// x, y, z, time, d1, d2
|
|
119
159
|
head: 0,
|
|
120
160
|
count: 0,
|
|
121
161
|
elapsed: 0
|
|
122
|
-
}), { trailGeo:
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
const
|
|
126
|
-
return
|
|
127
|
-
}, []),
|
|
162
|
+
}), { trailGeo: ie, trailPosAttr: z, trailColAttr: L } = T(() => {
|
|
163
|
+
const R = 8 * Se * 6, w = new Float32Array(R * 3), b = new Float32Array(R * 3), _ = new a.BufferGeometry(), he = new a.BufferAttribute(w, 3);
|
|
164
|
+
he.setUsage(a.DynamicDrawUsage), _.setAttribute("position", he);
|
|
165
|
+
const ve = new a.BufferAttribute(b, 3);
|
|
166
|
+
return ve.setUsage(a.DynamicDrawUsage), _.setAttribute("color", ve), _.setDrawRange(0, 0), { trailGeo: _, trailPosAttr: he, trailColAttr: ve };
|
|
167
|
+
}, []), Fe = T(() => new a.MeshBasicMaterial({
|
|
128
168
|
color: 16777215,
|
|
129
169
|
vertexColors: !0,
|
|
130
170
|
transparent: !0,
|
|
131
171
|
depthWrite: !1,
|
|
132
|
-
side:
|
|
133
|
-
blending:
|
|
172
|
+
side: a.DoubleSide,
|
|
173
|
+
blending: a.NormalBlending
|
|
134
174
|
}), []);
|
|
135
|
-
|
|
136
|
-
if (!
|
|
175
|
+
_e(() => {
|
|
176
|
+
if (!De || !f)
|
|
137
177
|
return;
|
|
138
|
-
const
|
|
139
|
-
return
|
|
140
|
-
|
|
141
|
-
}).catch((
|
|
142
|
-
console.error("[HZParticlesFX] replaceSystems FAILED:",
|
|
178
|
+
const u = new Lt(De);
|
|
179
|
+
return ge.current = u, H.current = !1, u.replaceSystems(f).then(() => {
|
|
180
|
+
e && g && (u.respawnAllSystems(), H.current = !0);
|
|
181
|
+
}).catch((R) => {
|
|
182
|
+
console.error("[HZParticlesFX] replaceSystems FAILED:", R);
|
|
143
183
|
}), () => {
|
|
144
|
-
typeof
|
|
184
|
+
typeof u.destroy == "function" && u.destroy(), ge.current = null;
|
|
145
185
|
};
|
|
146
|
-
}, [
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
}, [
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
if (
|
|
153
|
-
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
}, [
|
|
159
|
-
const
|
|
160
|
-
return
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
186
|
+
}, [De, f]), _e(() => {
|
|
187
|
+
const u = ge.current;
|
|
188
|
+
u && e && g && !H.current && (u.respawnAllSystems(), H.current = !0, Ve.current = !1);
|
|
189
|
+
}, [e, g]);
|
|
190
|
+
const me = j(null), xe = j(K);
|
|
191
|
+
_e(() => {
|
|
192
|
+
if (K === xe.current) return;
|
|
193
|
+
xe.current = K;
|
|
194
|
+
const u = se.current;
|
|
195
|
+
u.head = 0, u.count = 0, u.elapsed = 0, ie.setDrawRange(0, 0), me.current = null;
|
|
196
|
+
const R = ge.current;
|
|
197
|
+
R && (R.respawnAllSystems(), H.current = !0, Ve.current = !1);
|
|
198
|
+
}, [K]);
|
|
199
|
+
const Ne = T(() => new a.Matrix4(), []), fe = T(() => new a.Vector3(), []), ee = T(() => new a.Vector3(), []), oe = T(() => new a.Quaternion(), []), Me = T(() => new a.Vector3(), []), V = T(() => new a.Vector3(0, 0, 1), []), Ee = T(() => new a.Color(), []);
|
|
200
|
+
return bt((u, R) => {
|
|
201
|
+
var Ke;
|
|
202
|
+
if (!g || !Pe.current || !ge.current) return;
|
|
203
|
+
const w = ge.current, b = (U == null ? void 0 : U.current) ?? Ge, _ = R > 1 ? R / 1e3 : R, he = me.current, ve = he && _ > 0, Tt = ve ? (b.x - he.x) / _ : 0, Rt = ve ? (b.y - he.y) / _ : 0, It = ve ? (b.z - he.z) / _ : 0;
|
|
204
|
+
me.current = { x: b.x, y: b.y, z: b.z };
|
|
205
|
+
for (const { system: s, config: c } of w.particleSystems)
|
|
206
|
+
c.emissionTrailEnabled ? (s.setSimulationTransform({
|
|
207
|
+
position: [b.x, b.y, b.z],
|
|
208
|
+
velocity: [Tt, Rt, It]
|
|
209
|
+
}), c.emissionTranslationX = 0, c.emissionTranslationY = 0, c.emissionTranslationZ = 0) : (c.emissionTranslationX = b.x, c.emissionTranslationY = b.y, c.emissionTranslationZ = b.z);
|
|
210
|
+
w.updateAllSystems(_);
|
|
211
|
+
for (const { system: s } of w.particleSystems)
|
|
212
|
+
s.readbackAndProcessParticles();
|
|
213
|
+
if (ye) {
|
|
214
|
+
const s = se.current;
|
|
215
|
+
s.elapsed += _;
|
|
216
|
+
let c = 0, P = 0;
|
|
217
|
+
const q = (Ke = w.particleSystems.find(({ config: O }) => O.emissionTrailEnabled)) == null ? void 0 : Ke.config;
|
|
218
|
+
if (q) {
|
|
219
|
+
const O = q.emissionTrailShape ?? "straight";
|
|
220
|
+
if (O !== "straight") {
|
|
221
|
+
const B = q.emissionTrailShapeAmplitude ?? 0.1, le = q.emissionTrailShapeFrequency ?? 4, ne = 2 * Math.PI * le * s.elapsed;
|
|
222
|
+
O === "zigzag" ? c = B * Math.sign(Math.sin(ne)) : O === "sine" ? c = B * Math.sin(ne) : O === "spiral" && (c = B * Math.sin(ne), P = B * Math.cos(ne));
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
const te = s.head * 6;
|
|
226
|
+
s.buf[te] = b.x, s.buf[te + 1] = b.y, s.buf[te + 2] = b.z, s.buf[te + 3] = s.elapsed, s.buf[te + 4] = c, s.buf[te + 5] = P, s.head = (s.head + 1) % y, s.count < y && s.count++;
|
|
177
227
|
}
|
|
178
|
-
const
|
|
179
|
-
let
|
|
180
|
-
for (let
|
|
181
|
-
const { system:
|
|
182
|
-
if (
|
|
183
|
-
const
|
|
184
|
-
if (!(!
|
|
185
|
-
for (let
|
|
186
|
-
const
|
|
187
|
-
let
|
|
188
|
-
const
|
|
189
|
-
if (
|
|
190
|
-
const
|
|
191
|
-
if (
|
|
192
|
-
const F =
|
|
193
|
-
|
|
228
|
+
const ze = Pe.current;
|
|
229
|
+
let we = 0;
|
|
230
|
+
for (let s = 0; s < w.particleSystems.length; s++) {
|
|
231
|
+
const { system: c, config: P } = w.particleSystems[s];
|
|
232
|
+
if (P.emissionTrailEnabled) continue;
|
|
233
|
+
const q = c.particleData, te = c.activeParticles;
|
|
234
|
+
if (!(!q || te <= 0))
|
|
235
|
+
for (let O = 0; O < te; O++) {
|
|
236
|
+
const B = O * 8, le = q[B + 0], ne = q[B + 1], C = q[B + 2];
|
|
237
|
+
let be = q[B + 3], Ae = q[B + 4], J = q[B + 5];
|
|
238
|
+
const Te = q[B + 6], ae = q[B + 7];
|
|
239
|
+
if (Te >= ae || ae <= 0) continue;
|
|
240
|
+
const x = Te / ae;
|
|
241
|
+
if (P.colorTransitionEnabled) {
|
|
242
|
+
const F = P.startColor ?? [1, 0, 0], ue = P.endColor ?? [0, 0, 1];
|
|
243
|
+
be = F[0] + (ue[0] - F[0]) * x, Ae = F[1] + (ue[1] - F[1]) * x, J = F[2] + (ue[2] - F[2]) * x;
|
|
194
244
|
}
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
-
const
|
|
198
|
-
|
|
199
|
-
const
|
|
200
|
-
if (!(
|
|
201
|
-
if (
|
|
202
|
-
const F =
|
|
203
|
-
if (
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
const
|
|
207
|
-
|
|
245
|
+
const Re = P.bloomIntensity ?? 1;
|
|
246
|
+
be = Math.min(1, be * Re), Ae = Math.min(1, Ae * Re), J = Math.min(1, J * Re);
|
|
247
|
+
const Ie = _t(P, Te, ae, O);
|
|
248
|
+
be *= Ie, Ae *= Ie, J *= Ie;
|
|
249
|
+
const $ = Wt(P, Te, ae, O);
|
|
250
|
+
if (!($ <= 0)) {
|
|
251
|
+
if (fe.set(le, ne, C), ee.subVectors(ce.position, fe).normalize(), oe.setFromUnitVectors(V, ee), P.velocityStretchEnabled && c.particleVelocities) {
|
|
252
|
+
const F = O * 4, ue = c.particleVelocities[F], Ue = c.particleVelocities[F + 1], E = c.particleVelocities[F + 2], de = Math.sqrt(ue * ue + Ue * Ue + E * E);
|
|
253
|
+
if (de > 1e-3) {
|
|
254
|
+
const Qe = P.velocityStretchFactor ?? 1, G = $ * (1 + de * Qe);
|
|
255
|
+
Me.set($, G, 1), ee.set(ue, Ue, E).normalize(), oe.setFromUnitVectors(V, ee);
|
|
256
|
+
const i = (G - $) * 0.5;
|
|
257
|
+
fe.addScaledVector(ee, i);
|
|
208
258
|
} else
|
|
209
|
-
|
|
259
|
+
Me.set($, $, 1);
|
|
210
260
|
} else
|
|
211
|
-
|
|
212
|
-
|
|
261
|
+
Me.set($, $, 1);
|
|
262
|
+
Ne.compose(fe, oe, Me), ze.setMatrixAt(we, Ne), Ee.setRGB(be, Ae, J), ze.setColorAt(we, Ee), we++;
|
|
213
263
|
}
|
|
214
264
|
}
|
|
215
265
|
}
|
|
216
|
-
|
|
217
|
-
const
|
|
218
|
-
if (
|
|
219
|
-
const
|
|
220
|
-
let
|
|
221
|
-
const
|
|
222
|
-
for (let
|
|
223
|
-
const { system:
|
|
224
|
-
if (!
|
|
225
|
-
const
|
|
226
|
-
if (
|
|
227
|
-
const F = ((
|
|
228
|
-
if (
|
|
229
|
-
const
|
|
230
|
-
const
|
|
231
|
-
for (let
|
|
232
|
-
const
|
|
233
|
-
if (
|
|
234
|
-
const
|
|
235
|
-
|
|
266
|
+
ze.count = we, ze.visible = we > 0, we > 0 && (ze.instanceMatrix.needsUpdate = !0, ze.instanceColor && (ze.instanceColor.needsUpdate = !0));
|
|
267
|
+
const $e = we > 0 || w.particleSystems.some(({ system: s }) => s.emitting || s.activeParticles > 0);
|
|
268
|
+
if (Ve.current && !$e && (H.current = !1, X == null || X()), Ve.current = $e, ye && Z.current) {
|
|
269
|
+
const s = z.array, c = L.array;
|
|
270
|
+
let P = 0;
|
|
271
|
+
const q = ce.position.x, te = ce.position.y, O = ce.position.z;
|
|
272
|
+
for (let le = 0; le < w.particleSystems.length; le++) {
|
|
273
|
+
const { system: ne, config: C } = w.particleSystems[le];
|
|
274
|
+
if (!C.emissionTrailEnabled || !ne.emitting && ne.activeParticles <= 0) continue;
|
|
275
|
+
const be = C.emissionTrailDuration ?? 1, Ae = C.emissionTrailWidth ?? 0.3, J = C.bloomIntensity ?? 1, Te = Ae * 0.5, ae = se.current, x = ae.buf, Re = ae.count, Ie = ae.head, $ = ae.elapsed;
|
|
276
|
+
if (Re < 2) continue;
|
|
277
|
+
const F = ((Ie - Re) % y + y) % y, ue = $ - x[F * 6 + 3], Ue = Math.min(be, ue);
|
|
278
|
+
if (Ue < 1e-3) continue;
|
|
279
|
+
const E = C.colorTransitionEnabled ? C.startColor ?? [1, 1, 1] : C.particleColor ?? [1, 1, 1], de = C.colorTransitionEnabled ? C.endColor ?? [1, 1, 1] : E, Qe = (t, o) => {
|
|
280
|
+
const h = $ - t;
|
|
281
|
+
for (let d = 0; d < Re - 1; d++) {
|
|
282
|
+
const M = ((Ie - 1 - d) % y + y) % y, I = ((Ie - 2 - d) % y + y) % y, W = x[M * 6 + 3], A = x[I * 6 + 3];
|
|
283
|
+
if (h >= A && h <= W) {
|
|
284
|
+
const m = W !== A ? (h - A) / (W - A) : 0;
|
|
285
|
+
o[0] = x[I * 6] + (x[M * 6] - x[I * 6]) * m, o[1] = x[I * 6 + 1] + (x[M * 6 + 1] - x[I * 6 + 1]) * m, o[2] = x[I * 6 + 2] + (x[M * 6 + 2] - x[I * 6 + 2]) * m, o[3] = x[I * 6 + 4] + (x[M * 6 + 4] - x[I * 6 + 4]) * m, o[4] = x[I * 6 + 5] + (x[M * 6 + 5] - x[I * 6 + 5]) * m;
|
|
236
286
|
return;
|
|
237
287
|
}
|
|
238
288
|
}
|
|
239
|
-
|
|
240
|
-
},
|
|
241
|
-
|
|
242
|
-
const
|
|
243
|
-
|
|
289
|
+
o[0] = x[F * 6], o[1] = x[F * 6 + 1], o[2] = x[F * 6 + 2], o[3] = x[F * 6 + 4], o[4] = x[F * 6 + 5];
|
|
290
|
+
}, G = Math.max(1, Math.min(Se, C.emissionTrailSegments ?? 8)), i = [b.x, b.y, b.z], Oe = C.emissionTrailShape ?? "straight", Xe = [];
|
|
291
|
+
{
|
|
292
|
+
const t = C.emissionTrailShapeAmplitude ?? 0.1, o = C.emissionTrailShapeFrequency ?? 4, h = 2 * Math.PI * o * $;
|
|
293
|
+
let d = 0, M = 0;
|
|
294
|
+
Oe === "zigzag" ? d = t * Math.sign(Math.sin(h)) : Oe === "sine" ? d = t * Math.sin(h) : Oe === "spiral" && (d = t * Math.sin(h), M = t * Math.cos(h)), Xe.push(d, M);
|
|
295
|
+
}
|
|
296
|
+
const qe = [0, 0, 0, 0, 0];
|
|
297
|
+
for (let t = 1; t <= G; t++) {
|
|
298
|
+
const o = t / G * Ue;
|
|
299
|
+
Qe(o, qe), i.push(qe[0], qe[1], qe[2]), Xe.push(qe[3], qe[4]);
|
|
244
300
|
}
|
|
245
|
-
const
|
|
246
|
-
if (
|
|
247
|
-
let
|
|
248
|
-
const
|
|
249
|
-
for (let t = 0; t <=
|
|
250
|
-
let
|
|
251
|
-
t === 0 ? (
|
|
252
|
-
let
|
|
253
|
-
|
|
254
|
-
const
|
|
255
|
-
let
|
|
256
|
-
|
|
301
|
+
const et = i[0] - i[G * 3], tt = i[1] - i[G * 3 + 1], nt = i[2] - i[G * 3 + 2];
|
|
302
|
+
if (et * et + tt * tt + nt * nt < 1e-6) continue;
|
|
303
|
+
let rt = 0, st = 0, it = 0;
|
|
304
|
+
const Ce = [], Ze = [];
|
|
305
|
+
for (let t = 0; t <= G; t++) {
|
|
306
|
+
let o, h, d;
|
|
307
|
+
t === 0 ? (o = i[3] - i[0], h = i[4] - i[1], d = i[5] - i[2]) : t === G ? (o = i[t * 3] - i[(t - 1) * 3], h = i[t * 3 + 1] - i[(t - 1) * 3 + 1], d = i[t * 3 + 2] - i[(t - 1) * 3 + 2]) : (o = i[(t + 1) * 3] - i[(t - 1) * 3], h = i[(t + 1) * 3 + 1] - i[(t - 1) * 3 + 1], d = i[(t + 1) * 3 + 2] - i[(t - 1) * 3 + 2]);
|
|
308
|
+
let M = Math.sqrt(o * o + h * h + d * d);
|
|
309
|
+
M < 1e-8 && (o = 0, h = 0, d = 1, M = 1), o /= M, h /= M, d /= M, Ze.push(o, h, d);
|
|
310
|
+
const I = q - i[t * 3], W = te - i[t * 3 + 1], A = O - i[t * 3 + 2];
|
|
311
|
+
let m = h * A - d * W, S = d * I - o * A, v = o * W - h * I, Y = Math.sqrt(m * m + S * S + v * v);
|
|
312
|
+
Y < 1e-8 && (m = -d, S = 0, v = o, Y = Math.sqrt(m * m + S * S + v * v)), Y < 1e-8 && (m = 0, S = 1, v = 0, Y = 1), m /= Y, S /= Y, v /= Y, t > 0 && m * rt + S * st + v * it < 0 && (m = -m, S = -S, v = -v), rt = m, st = S, it = v, Ce.push(m, S, v);
|
|
257
313
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
314
|
+
if (Oe !== "straight")
|
|
315
|
+
for (let t = 1; t <= G; t++) {
|
|
316
|
+
const o = Xe[t * 2], h = Xe[t * 2 + 1];
|
|
317
|
+
if (Math.abs(o) < 1e-8 && Math.abs(h) < 1e-8) continue;
|
|
318
|
+
const d = t * 3, M = Ze[d], I = Ze[d + 1], W = Ze[d + 2];
|
|
319
|
+
let A = -W, m = 0, S = M, v = Math.sqrt(A * A + S * S);
|
|
320
|
+
if (v < 1e-6 && (A = 0, m = W, S = -I, v = Math.sqrt(A * A + m * m + S * S), v < 1e-6 && (A = 1, m = 0, S = 0, v = 1)), A /= v, m /= v, S /= v, Oe === "spiral") {
|
|
321
|
+
const Y = I * S - W * m, We = W * A - M * S, ke = M * m - I * A;
|
|
322
|
+
i[d] += A * o + Y * h, i[d + 1] += m * o + We * h, i[d + 2] += S * o + ke * h;
|
|
323
|
+
} else
|
|
324
|
+
i[d] += A * o, i[d + 1] += m * o, i[d + 2] += S * o;
|
|
325
|
+
}
|
|
326
|
+
for (let t = 0; t < G; t++) {
|
|
327
|
+
const o = t / G, h = (t + 1) / G, d = Te * (1 - o), M = Te * (1 - h), I = (1 - o) * (1 - o), W = (1 - h) * (1 - h), A = Math.min(1, (E[0] + (de[0] - E[0]) * o) * J) * I, m = Math.min(1, (E[1] + (de[1] - E[1]) * o) * J) * I, S = Math.min(1, (E[2] + (de[2] - E[2]) * o) * J) * I, v = Math.min(1, (E[0] + (de[0] - E[0]) * h) * J) * W, Y = Math.min(1, (E[1] + (de[1] - E[1]) * h) * J) * W, We = Math.min(1, (E[2] + (de[2] - E[2]) * h) * J) * W, ke = i[t * 3], ot = i[t * 3 + 1], at = i[t * 3 + 2], ct = i[(t + 1) * 3], lt = i[(t + 1) * 3 + 1], ut = i[(t + 1) * 3 + 2], dt = Ce[t * 3], pt = Ce[t * 3 + 1], mt = Ce[t * 3 + 2], ft = Ce[(t + 1) * 3], ht = Ce[(t + 1) * 3 + 1], gt = Ce[(t + 1) * 3 + 2], Ct = ke + dt * d, Dt = ot + pt * d, Pt = at + mt * d, yt = ke - dt * d, St = ot - pt * d, xt = at - mt * d, Mt = ct + ft * M, vt = lt + ht * M, zt = ut + gt * M, Vt = ct - ft * M, Ft = lt - ht * M, Et = ut - gt * M, p = P * 3;
|
|
328
|
+
s[p] = Ct, s[p + 1] = Dt, s[p + 2] = Pt, c[p] = A, c[p + 1] = m, c[p + 2] = S, s[p + 3] = yt, s[p + 4] = St, s[p + 5] = xt, c[p + 3] = A, c[p + 4] = m, c[p + 5] = S, s[p + 6] = Mt, s[p + 7] = vt, s[p + 8] = zt, c[p + 6] = v, c[p + 7] = Y, c[p + 8] = We, s[p + 9] = yt, s[p + 10] = St, s[p + 11] = xt, c[p + 9] = A, c[p + 10] = m, c[p + 11] = S, s[p + 12] = Vt, s[p + 13] = Ft, s[p + 14] = Et, c[p + 12] = v, c[p + 13] = Y, c[p + 14] = We, s[p + 15] = Mt, s[p + 16] = vt, s[p + 17] = zt, c[p + 15] = v, c[p + 16] = Y, c[p + 17] = We, P += 6;
|
|
261
329
|
}
|
|
262
330
|
}
|
|
263
|
-
const
|
|
264
|
-
if (
|
|
265
|
-
const
|
|
266
|
-
for (let
|
|
267
|
-
|
|
331
|
+
const B = k.current;
|
|
332
|
+
if (P < B) {
|
|
333
|
+
const le = P * 3, ne = B * 3;
|
|
334
|
+
for (let C = le; C < ne; C++)
|
|
335
|
+
s[C] = 0, c[C] = 0;
|
|
268
336
|
}
|
|
269
|
-
|
|
337
|
+
k.current = P, ie.setDrawRange(0, P), z.needsUpdate = !0, L.needsUpdate = !0;
|
|
270
338
|
}
|
|
271
|
-
}),
|
|
272
|
-
/* @__PURE__ */
|
|
339
|
+
}), Q ? /* @__PURE__ */ Ut(qt, { children: [
|
|
340
|
+
/* @__PURE__ */ Je(
|
|
273
341
|
"instancedMesh",
|
|
274
342
|
{
|
|
275
|
-
ref: (
|
|
276
|
-
|
|
343
|
+
ref: (u) => {
|
|
344
|
+
Pe.current = u, u && (u.count = 0, u.visible = !Be);
|
|
277
345
|
},
|
|
278
|
-
args: [
|
|
346
|
+
args: [He, n, je],
|
|
279
347
|
frustumCulled: !1,
|
|
280
348
|
renderOrder: 100,
|
|
281
|
-
visible:
|
|
349
|
+
visible: g && !Be
|
|
282
350
|
}
|
|
283
351
|
),
|
|
284
|
-
|
|
352
|
+
ye && /* @__PURE__ */ Je(
|
|
285
353
|
"mesh",
|
|
286
354
|
{
|
|
287
|
-
ref:
|
|
288
|
-
geometry:
|
|
289
|
-
material:
|
|
355
|
+
ref: Z,
|
|
356
|
+
geometry: ie,
|
|
357
|
+
material: Fe,
|
|
290
358
|
frustumCulled: !1,
|
|
291
359
|
renderOrder: 99,
|
|
292
|
-
visible:
|
|
360
|
+
visible: g
|
|
293
361
|
}
|
|
294
362
|
)
|
|
295
363
|
] }) : null;
|
|
296
364
|
}
|
|
297
|
-
const
|
|
365
|
+
const Zt = (
|
|
298
366
|
/* glsl */
|
|
299
367
|
`
|
|
300
368
|
attribute vec4 aColor;
|
|
@@ -304,7 +372,7 @@ void main() {
|
|
|
304
372
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
305
373
|
}
|
|
306
374
|
`
|
|
307
|
-
),
|
|
375
|
+
), kt = (
|
|
308
376
|
/* glsl */
|
|
309
377
|
`
|
|
310
378
|
varying vec4 vColor;
|
|
@@ -313,113 +381,113 @@ void main() {
|
|
|
313
381
|
}
|
|
314
382
|
`
|
|
315
383
|
);
|
|
316
|
-
function
|
|
317
|
-
positionRef:
|
|
318
|
-
duration:
|
|
319
|
-
width:
|
|
320
|
-
color:
|
|
321
|
-
maxPoints:
|
|
322
|
-
minDistance:
|
|
323
|
-
opacity:
|
|
324
|
-
blending:
|
|
325
|
-
visible:
|
|
384
|
+
function $t({
|
|
385
|
+
positionRef: l,
|
|
386
|
+
duration: r = 1,
|
|
387
|
+
width: U = 0.3,
|
|
388
|
+
color: e = [1, 1, 1],
|
|
389
|
+
maxPoints: g = 256,
|
|
390
|
+
minDistance: N = 0.05,
|
|
391
|
+
opacity: K = 1,
|
|
392
|
+
blending: X = a.AdditiveBlending,
|
|
393
|
+
visible: Q = !0
|
|
326
394
|
}) {
|
|
327
|
-
const { camera:
|
|
328
|
-
positions: new Float32Array(
|
|
329
|
-
times: new Float32Array(
|
|
395
|
+
const { camera: re } = wt(), ce = j(null), Ye = j({
|
|
396
|
+
positions: new Float32Array(g * 3),
|
|
397
|
+
times: new Float32Array(g),
|
|
330
398
|
head: 0,
|
|
331
399
|
count: 0,
|
|
332
|
-
lastPos: new
|
|
400
|
+
lastPos: new a.Vector3(1 / 0, 1 / 0, 1 / 0),
|
|
333
401
|
elapsed: 0
|
|
334
|
-
}), { geometry:
|
|
335
|
-
const
|
|
336
|
-
|
|
337
|
-
const
|
|
338
|
-
|
|
339
|
-
const
|
|
340
|
-
for (let
|
|
341
|
-
const
|
|
342
|
-
|
|
402
|
+
}), { geometry: pe, posAttr: De, colorAttr: Pe, indexBuf: ge } = T(() => {
|
|
403
|
+
const ye = g * 2, He = new Float32Array(ye * 3), n = new Float32Array(ye * 4), D = new a.BufferGeometry(), Se = new a.BufferAttribute(He, 3);
|
|
404
|
+
Se.setUsage(a.DynamicDrawUsage), D.setAttribute("position", Se);
|
|
405
|
+
const Z = new a.BufferAttribute(n, 4);
|
|
406
|
+
Z.setUsage(a.DynamicDrawUsage), D.setAttribute("aColor", Z);
|
|
407
|
+
const k = (g - 1) * 6, y = new Uint32Array(k);
|
|
408
|
+
for (let ie = 0; ie < g - 1; ie++) {
|
|
409
|
+
const z = ie * 2, L = ie * 6;
|
|
410
|
+
y[L] = z, y[L + 1] = z + 1, y[L + 2] = z + 2, y[L + 3] = z + 1, y[L + 4] = z + 3, y[L + 5] = z + 2;
|
|
343
411
|
}
|
|
344
|
-
const
|
|
345
|
-
return
|
|
346
|
-
}, [
|
|
347
|
-
vertexShader:
|
|
348
|
-
fragmentShader:
|
|
412
|
+
const se = new a.BufferAttribute(y, 1);
|
|
413
|
+
return D.setIndex(se), D.setDrawRange(0, 0), { geometry: D, posAttr: Se, colorAttr: Z, indexBuf: se };
|
|
414
|
+
}, [g]), Ve = T(() => new a.ShaderMaterial({
|
|
415
|
+
vertexShader: Zt,
|
|
416
|
+
fragmentShader: kt,
|
|
349
417
|
transparent: !0,
|
|
350
418
|
depthWrite: !1,
|
|
351
|
-
side:
|
|
352
|
-
blending:
|
|
353
|
-
}), [
|
|
354
|
-
return
|
|
355
|
-
if (!
|
|
356
|
-
const n =
|
|
357
|
-
if (n.elapsed +=
|
|
358
|
-
n.count = 0, n.head = 0, n.lastPos.set(1 / 0, 1 / 0, 1 / 0),
|
|
419
|
+
side: a.DoubleSide,
|
|
420
|
+
blending: X
|
|
421
|
+
}), [X]), H = T(() => new a.Vector3(), []), f = T(() => new a.Vector3(), []), Be = T(() => new a.Vector3(), []), je = T(() => new a.Vector3(0, 1, 0), []), Ge = T(() => new a.Vector3(), []);
|
|
422
|
+
return bt((ye, He) => {
|
|
423
|
+
if (!ce.current) return;
|
|
424
|
+
const n = Ye.current;
|
|
425
|
+
if (n.elapsed += He, !Q) {
|
|
426
|
+
n.count = 0, n.head = 0, n.lastPos.set(1 / 0, 1 / 0, 1 / 0), pe.setDrawRange(0, 0);
|
|
359
427
|
return;
|
|
360
428
|
}
|
|
361
|
-
const
|
|
362
|
-
if (!
|
|
363
|
-
if (n.lastPos.distanceTo(
|
|
364
|
-
const
|
|
365
|
-
n.positions[
|
|
429
|
+
const D = l.current;
|
|
430
|
+
if (!D) return;
|
|
431
|
+
if (n.lastPos.distanceTo(D) >= N) {
|
|
432
|
+
const z = (n.head + n.count) % g;
|
|
433
|
+
n.positions[z * 3] = D.x, n.positions[z * 3 + 1] = D.y, n.positions[z * 3 + 2] = D.z, n.times[z] = n.elapsed, n.count < g ? n.count++ : n.head = (n.head + 1) % g, n.lastPos.copy(D);
|
|
366
434
|
}
|
|
367
435
|
for (; n.count > 0; ) {
|
|
368
|
-
const
|
|
369
|
-
if (n.elapsed - n.times[
|
|
370
|
-
n.head = (n.head + 1) %
|
|
436
|
+
const z = n.head;
|
|
437
|
+
if (n.elapsed - n.times[z] > r)
|
|
438
|
+
n.head = (n.head + 1) % g, n.count--;
|
|
371
439
|
else
|
|
372
440
|
break;
|
|
373
441
|
}
|
|
374
442
|
if (n.count < 2) {
|
|
375
|
-
|
|
443
|
+
pe.setDrawRange(0, 0);
|
|
376
444
|
return;
|
|
377
445
|
}
|
|
378
|
-
const
|
|
379
|
-
let
|
|
380
|
-
const
|
|
381
|
-
for (let
|
|
382
|
-
const
|
|
383
|
-
if (
|
|
384
|
-
const
|
|
385
|
-
|
|
386
|
-
n.positions[
|
|
387
|
-
n.positions[
|
|
388
|
-
n.positions[
|
|
446
|
+
const Z = De.array, k = Pe.array;
|
|
447
|
+
let y = null;
|
|
448
|
+
const se = n.count;
|
|
449
|
+
for (let z = 0; z < se; z++) {
|
|
450
|
+
const L = (n.head + z) % g, Fe = n.positions[L * 3], me = n.positions[L * 3 + 1], xe = n.positions[L * 3 + 2], fe = 1 - (n.elapsed - n.times[L]) / r;
|
|
451
|
+
if (z < se - 1) {
|
|
452
|
+
const Ee = (n.head + z + 1) % g;
|
|
453
|
+
H.set(
|
|
454
|
+
n.positions[Ee * 3] - Fe,
|
|
455
|
+
n.positions[Ee * 3 + 1] - me,
|
|
456
|
+
n.positions[Ee * 3 + 2] - xe
|
|
389
457
|
);
|
|
390
|
-
const
|
|
391
|
-
|
|
392
|
-
} else
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
),
|
|
398
|
-
let
|
|
399
|
-
|
|
400
|
-
const
|
|
401
|
-
|
|
458
|
+
const Le = H.length();
|
|
459
|
+
Le > 1e-6 ? H.divideScalar(Le) : y && H.copy(y);
|
|
460
|
+
} else y && H.copy(y);
|
|
461
|
+
Be.set(
|
|
462
|
+
re.position.x - Fe,
|
|
463
|
+
re.position.y - me,
|
|
464
|
+
re.position.z - xe
|
|
465
|
+
), f.crossVectors(H, Be);
|
|
466
|
+
let ee = f.length();
|
|
467
|
+
ee < 1e-6 && (Ge.crossVectors(H, je), f.copy(Ge), ee = f.length(), ee < 1e-6 && (f.set(1, 0, 0), ee = 1)), f.divideScalar(ee);
|
|
468
|
+
const oe = U * fe, Me = K * fe * fe, V = z * 2;
|
|
469
|
+
Z[V * 3] = Fe + f.x * oe, Z[V * 3 + 1] = me + f.y * oe, Z[V * 3 + 2] = xe + f.z * oe, Z[(V + 1) * 3] = Fe - f.x * oe, Z[(V + 1) * 3 + 1] = me - f.y * oe, Z[(V + 1) * 3 + 2] = xe - f.z * oe, k[V * 4] = e[0], k[V * 4 + 1] = e[1], k[V * 4 + 2] = e[2], k[V * 4 + 3] = Me, k[(V + 1) * 4] = e[0], k[(V + 1) * 4 + 1] = e[1], k[(V + 1) * 4 + 2] = e[2], k[(V + 1) * 4 + 3] = Me, y = y || new a.Vector3(), y.copy(H);
|
|
402
470
|
}
|
|
403
|
-
const
|
|
404
|
-
|
|
405
|
-
}), /* @__PURE__ */
|
|
471
|
+
const ie = (se - 1) * 6;
|
|
472
|
+
pe.setDrawRange(0, ie), De.needsUpdate = !0, Pe.needsUpdate = !0;
|
|
473
|
+
}), /* @__PURE__ */ Je(
|
|
406
474
|
"mesh",
|
|
407
475
|
{
|
|
408
|
-
ref:
|
|
409
|
-
geometry:
|
|
410
|
-
material:
|
|
476
|
+
ref: ce,
|
|
477
|
+
geometry: pe,
|
|
478
|
+
material: Ve,
|
|
411
479
|
frustumCulled: !1,
|
|
412
480
|
renderOrder: 101,
|
|
413
|
-
visible:
|
|
481
|
+
visible: Q
|
|
414
482
|
}
|
|
415
483
|
);
|
|
416
484
|
}
|
|
417
485
|
export {
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
486
|
+
Jt as HZParticlesFX,
|
|
487
|
+
$t as HZTrailRibbon,
|
|
488
|
+
_t as computeParticleOpacity,
|
|
489
|
+
Wt as computeParticleSize,
|
|
490
|
+
tn as fetchPreset,
|
|
491
|
+
At as particleHash,
|
|
492
|
+
Gt as scalePreset
|
|
425
493
|
};
|