three-low-poly 0.9.21 → 0.9.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js DELETED
@@ -1,5147 +0,0 @@
1
- var St = Object.defineProperty;
2
- var Pt = (e, t, o) => t in e ? St(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
3
- var I = (e, t, o) => Pt(e, typeof t != "symbol" ? t + "" : t, o);
4
- import { Vector3 as M, MathUtils as L, Quaternion as wt, InstancedMesh as nt, SphereGeometry as z, MeshStandardMaterial as w, Matrix4 as X, BufferGeometry as E, Float32BufferAttribute as F, DoubleSide as Y, Euler as Gt, BufferAttribute as _, BoxGeometry as b, Shape as Z, ExtrudeGeometry as j, Object3D as Ct, Vector2 as A, LatheGeometry as q, CylinderGeometry as G, ConeGeometry as J, DodecahedronGeometry as et, CircleGeometry as Rt, TorusGeometry as Mt, Mesh as x, ShaderMaterial as st, MeshPhysicalMaterial as rt, Group as k, PointLight as Bt, CatmullRomCurve3 as Nt, TubeGeometry as Ot, Path as _t, Color as ot, BackSide as mt, DataTexture as Ut, RGBAFormat as zt, UnsignedByteType as Ft, RepeatWrapping as pt, NearestFilter as Lt, Box3 as V } from "three";
5
- function Ro(e, t, o, s) {
6
- const a = e.position.clone(), n = a.clone().add(e.getWorldDirection(new M()).multiplyScalar(-t));
7
- let r = null;
8
- function i(c) {
9
- r === null && (r = c);
10
- const u = (c - r) / o;
11
- if (u >= 1) {
12
- e.position.copy(n), s && s();
13
- return;
14
- }
15
- e.position.lerpVectors(a, n, u), requestAnimationFrame(i);
16
- }
17
- requestAnimationFrame(i);
18
- }
19
- function Bo(e, t, o, s) {
20
- const a = t.length - 1;
21
- let n = null;
22
- function r(i) {
23
- n === null && (n = i);
24
- const l = (i - n) / o;
25
- if (l >= 1) {
26
- e.position.copy(t[t.length - 1]), s && s();
27
- return;
28
- }
29
- const u = l * a, m = Math.floor(u), h = u - m, f = t[m], p = t[m + 1];
30
- e.position.lerpVectors(f, p, h), e.lookAt(p), requestAnimationFrame(r);
31
- }
32
- requestAnimationFrame(r);
33
- }
34
- function No(e, t, o, s, a) {
35
- let n = null;
36
- function r(i) {
37
- n || (n = i);
38
- const l = (i - n) / s;
39
- if (l >= 1) {
40
- a && a();
41
- return;
42
- }
43
- const u = l * Math.PI * 2, m = t.x + o * Math.cos(u), h = t.z + o * Math.sin(u);
44
- e.position.set(m, e.position.y, h), e.lookAt(t), requestAnimationFrame(r);
45
- }
46
- requestAnimationFrame(r);
47
- }
48
- function Oo(e, t, o, s, a, n) {
49
- let r = null, i = 0;
50
- function c(l) {
51
- r === null && (r = l);
52
- const u = l - r, m = s / a, h = u % m / m, f = Math.sin(h * Math.PI * 2) * Math.PI / 6, p = t.x + o * Math.sin(f), d = t.z + o * Math.cos(f);
53
- if (e.position.set(p, e.position.y, d), e.lookAt(t), u >= (i + 1) * m && i++, i >= a) {
54
- n && n();
55
- return;
56
- }
57
- requestAnimationFrame(c);
58
- }
59
- requestAnimationFrame(c);
60
- }
61
- function _o(e, t, o, s, a, n, r) {
62
- let i = null;
63
- function c(l) {
64
- i === null && (i = l);
65
- const m = (l - i) / n;
66
- if (m >= 1) {
67
- r && r();
68
- return;
69
- }
70
- const h = m * Math.PI * 2 * a, f = t.x + o * Math.cos(h), p = t.z + o * Math.sin(h), d = t.y + s * m;
71
- e.position.set(f, d, p), e.lookAt(t), requestAnimationFrame(c);
72
- }
73
- requestAnimationFrame(c);
74
- }
75
- function Uo(e, t, o, s) {
76
- const a = e.position.clone();
77
- let n = null;
78
- function r(i) {
79
- if (n === null && (n = i), (i - n) / o >= 1) {
80
- e.position.copy(a), s && s();
81
- return;
82
- }
83
- const u = new M(
84
- (Math.random() - 0.5) * t,
85
- (Math.random() - 0.5) * t,
86
- (Math.random() - 0.5) * t
87
- );
88
- e.position.copy(a).add(u), requestAnimationFrame(r);
89
- }
90
- requestAnimationFrame(r);
91
- }
92
- function zo(e, t, o, s, a, n) {
93
- const r = e.fov;
94
- e.fov = o, e.updateProjectionMatrix();
95
- let i = null;
96
- function c(l) {
97
- i === null && (i = l);
98
- const m = (l - i) / a;
99
- if (m >= 1) {
100
- e.fov = s, e.updateProjectionMatrix(), e.lookAt(t), e.fov = r, e.updateProjectionMatrix(), n && n();
101
- return;
102
- }
103
- e.fov = L.lerp(o, s, m), e.updateProjectionMatrix(), e.lookAt(t), requestAnimationFrame(c);
104
- }
105
- requestAnimationFrame(c);
106
- }
107
- class Fo {
108
- constructor(t) {
109
- I(this, "speed");
110
- I(this, "maxIntensity");
111
- I(this, "minIntensity");
112
- I(this, "material");
113
- const {
114
- speed: o = 2,
115
- //
116
- maxIntensity: s = 0.8,
117
- minIntensity: a = 0.2
118
- } = t;
119
- this.speed = o, this.maxIntensity = s, this.minIntensity = a, this.material = t.material;
120
- }
121
- /**
122
- * Update the emissive intensity of the material.
123
- *
124
- * Use Three.Clock getElapsedTime()
125
- *
126
- * Example:
127
- * ```
128
- * const clock = new THREE.Clock();
129
- * effect.update(clock.getElapsedTime());
130
- * ```
131
- */
132
- update(t = 0) {
133
- this.material.emissiveIntensity = this.minIntensity + Math.abs(Math.sin(t * this.speed)) * (this.maxIntensity - this.minIntensity);
134
- }
135
- }
136
- function ht(e = 0, t = 1) {
137
- return Math.random() * (t - e) + e;
138
- }
139
- function Lo(e = 0, t = 1) {
140
- return Math.floor(Math.random() * (t - e + 1)) + e;
141
- }
142
- function Dt(e = 0.5, t = 0, o = 1) {
143
- return t + (o - t) * Math.pow(Math.random(), e);
144
- }
145
- function kt(e = 0.5, t = 0, o = 1) {
146
- return t + (o - t) * Math.pow(1 - Math.random(), e);
147
- }
148
- class Do {
149
- constructor({
150
- light: t,
151
- minIntensity: o = 0.8,
152
- maxIntensity: s = 1.2,
153
- x: a = 0,
154
- y: n = 0,
155
- z: r = 0,
156
- jitterX: i = 0.02,
157
- jitterY: c = 0,
158
- jitterZ: l = 0.02
159
- } = {}) {
160
- I(this, "light");
161
- I(this, "minIntensity");
162
- I(this, "maxIntensity");
163
- I(this, "x");
164
- I(this, "y");
165
- I(this, "z");
166
- I(this, "jitterX");
167
- I(this, "jitterY");
168
- I(this, "jitterZ");
169
- this.light = t, this.minIntensity = o, this.maxIntensity = s, this.x = a, this.y = n, this.z = r, this.jitterX = i, this.jitterY = c, this.jitterZ = l;
170
- }
171
- update() {
172
- this.light && (this.light.intensity = ht(this.minIntensity, this.maxIntensity), this.light.position.x = Math.random() * this.jitterX - this.jitterX / 2 + this.x, this.light.position.y = Math.random() * this.jitterY - this.jitterY / 2 + this.y, this.light.position.z = Math.random() * this.jitterZ - this.jitterZ / 2 + this.z);
173
- }
174
- }
175
- function Vt(e, t, o) {
176
- const s = t + Math.random() * (o - t);
177
- return setTimeout(e, s);
178
- }
179
- function ko(e, t, o) {
180
- let s;
181
- function a() {
182
- const n = t + Math.random() * (o - t);
183
- s = setTimeout(() => {
184
- e(), a();
185
- }, n);
186
- }
187
- return a(), () => clearTimeout(s);
188
- }
189
- class Vo {
190
- constructor({
191
- light: t,
192
- //
193
- minIntensity: o = 15,
194
- maxIntensity: s = 20,
195
- minDuration: a = 50,
196
- maxDuration: n = 250
197
- } = {}) {
198
- I(this, "light");
199
- I(this, "minIntensity");
200
- I(this, "maxIntensity");
201
- I(this, "minDuration");
202
- I(this, "maxDuration");
203
- this.light = t, this.minIntensity = o, this.maxIntensity = s, this.minDuration = a, this.maxDuration = n;
204
- }
205
- triggerLightning() {
206
- this.light && (this.light.intensity = ht(this.minIntensity, this.maxIntensity)), Vt(
207
- () => {
208
- this.light && (this.light.intensity = 0);
209
- },
210
- this.minDuration,
211
- this.maxDuration
212
- );
213
- }
214
- update() {
215
- Math.random() > 0.98 && this.triggerLightning();
216
- }
217
- }
218
- const W = {
219
- UP: new M(0, 1, 0),
220
- DOWN: new M(0, -1, 0),
221
- LEFT: new M(-1, 0, 0),
222
- RIGHT: new M(1, 0, 0),
223
- FORWARD: new M(0, 0, 1),
224
- BACKWARD: new M(0, 0, -1)
225
- }, tt = {
226
- LINEAR: (e, t) => 1 - e / t,
227
- QUADRATIC: (e, t) => Math.pow(1 - e / t, 2),
228
- SQUARE_ROOT: (e, t) => Math.pow(1 - e / t, 0.5),
229
- LOGARITHMIC: (e, t) => Math.log(1 + (t - e)) / Math.log(1 + t),
230
- SINE: (e, t) => Math.cos(e / t * Math.PI / 2),
231
- EXPONENTIAL: (e, t) => Math.exp(-e / t),
232
- CUBIC: (e, t) => Math.pow(1 - e / t, 3),
233
- GAUSSIAN: (e, t) => Math.exp(-Math.pow(e, 2) / (2 * Math.pow(t / 3, 2))),
234
- INVERSE: (e, t) => t / (t + e),
235
- SMOOTHSTEP: (e, t) => {
236
- const o = Math.max(0, Math.min(1, 1 - e / t));
237
- return o * o * (3 - 2 * o);
238
- }
239
- }, qo = (e, t, o, s, a = W.UP, n = tt.LINEAR) => {
240
- const r = e.attributes.position;
241
- for (let i = 0; i < r.count; i++) {
242
- const c = new M();
243
- c.fromBufferAttribute(r, i);
244
- const l = c.distanceTo(t);
245
- if (l < o) {
246
- const m = n(l, o) * s;
247
- c.add(a.clone().multiplyScalar(m)), r.setXYZ(i, c.x, c.y, c.z);
248
- }
249
- }
250
- r.needsUpdate = !0;
251
- }, Yo = (e, t, o, s, a, n = W.UP, r = tt.LINEAR) => {
252
- const i = e.attributes.position;
253
- for (let c = 0; c < i.count; c++) {
254
- const l = new M();
255
- l.fromBufferAttribute(i, c);
256
- const u = l.distanceTo(t);
257
- if (u < o) {
258
- const h = r(u, o) * a, f = l.dot(n.normalize()), p = s - f;
259
- l.add(n.clone().multiplyScalar(p * h)), i.setXYZ(c, l.x, l.y, l.z);
260
- }
261
- }
262
- i.needsUpdate = !0;
263
- }, Ho = (e, t, o, s, a = W.UP, n = tt.LINEAR) => {
264
- const r = e.attributes.position;
265
- for (let i = 0; i < r.count; i++) {
266
- const c = new M();
267
- c.fromBufferAttribute(r, i);
268
- const l = c.distanceTo(t);
269
- if (l < o) {
270
- const u = n(l, o), m = s * u, h = a.clone().normalize();
271
- c.x += L.randFloatSpread(m) * h.x, c.y += L.randFloatSpread(m) * h.y, c.z += L.randFloatSpread(m) * h.z, r.setXYZ(i, c.x, c.y, c.z);
272
- }
273
- }
274
- r.needsUpdate = !0;
275
- }, Xo = (e, t, o, s) => {
276
- const a = e.attributes.position, n = new M();
277
- for (let r = 0; r < a.count; r++) {
278
- const i = new M();
279
- if (i.fromBufferAttribute(a, r), i.distanceTo(t) < o) {
280
- let l = new M(), u = 0;
281
- for (let m = 0; m < a.count; m++)
282
- n.fromBufferAttribute(a, m), n.distanceTo(i) < o && (l.add(n), u++);
283
- u > 0 && (l.divideScalar(u), i.lerp(l, s), a.setXYZ(r, i.x, i.y, i.z));
284
- }
285
- }
286
- a.needsUpdate = !0;
287
- }, Zo = (e, t, o, s, a = !1, n = tt.LINEAR) => {
288
- const r = e.attributes.position;
289
- for (let i = 0; i < r.count; i++) {
290
- const c = new M();
291
- c.fromBufferAttribute(r, i);
292
- const l = c.distanceTo(t);
293
- if (l < o) {
294
- const m = n(l, o) * s * (a ? -1 : 1), h = c.clone().sub(t).normalize();
295
- c.add(h.multiplyScalar(m)), r.setXYZ(i, c.x, c.y, c.z);
296
- }
297
- }
298
- r.needsUpdate = !0;
299
- }, jo = (e, t, o, s, a = W.UP, n = tt.LINEAR) => {
300
- const r = e.attributes.position, i = new wt();
301
- for (let c = 0; c < r.count; c++) {
302
- const l = new M();
303
- l.fromBufferAttribute(r, c);
304
- const u = l.distanceTo(t);
305
- if (u < o) {
306
- const h = n(u, o) * s;
307
- i.setFromAxisAngle(a, h), l.sub(t).applyQuaternion(i).add(t), r.setXYZ(c, l.x, l.y, l.z);
308
- }
309
- }
310
- r.needsUpdate = !0;
311
- }, ft = {
312
- X: new M(1, 0, 0),
313
- Y: new M(0, 1, 0),
314
- Z: new M(0, 0, 1),
315
- XY: new M(1, 1, 0).normalize(),
316
- XZ: new M(1, 0, 1).normalize(),
317
- YZ: new M(0, 1, 1).normalize(),
318
- XYZ: new M(1, 1, 1).normalize()
319
- };
320
- var N = /* @__PURE__ */ ((e) => (e.LEFT = "left", e.RIGHT = "right", e.TOP = "top", e.BOTTOM = "bottom", e.FRONT = "front", e.BACK = "back", e))(N || {});
321
- const H = {
322
- // Red
323
- CADMIUM_RED: 15073318,
324
- // Cadmium Red or Bright Red. Vivid, bold red shade with warm undertones.
325
- CARDINAL_RED: 12981270,
326
- // Bright Crimson or Cardinal Red. It’s a vivid, bold red shade with warm undertones.
327
- CHERRY_RED: 14165028,
328
- // Bold red with slightly warm undertones.
329
- CRIMSON: 12986408,
330
- // Crimson Red or Firebrick Red. It’s a bold, deep red with a slightly cool undertone.
331
- ALIZARIN_CRIMSON: 11674146,
332
- // Deep, rich red with cool undertones.
333
- DARK_RED: 9109504,
334
- // Dark Red. It’s a deep, rich red shade resembling the color of garnets or dried blood.
335
- RUST: 12731693,
336
- // Red clay or Brick Red. It’s a warm, earthy red-orange shade, often associated with weathered metal, autumn leaves, or natural clay tones.
337
- // Orange
338
- CORAL_ORANGE: 16734003,
339
- // Bold red-orange hue.
340
- TANGERINE: 16733440,
341
- // Tangerine or Bright Orange-Red. It’s a vibrant, warm shade of orange with red undertones with a tropical feel.
342
- ORANGE_PEEL: 16737792,
343
- // Orange Peel or Bright Orange. It’s a vivid, energetic orange.
344
- CADMIUM_ORANGE: 16744228,
345
- // warm orange with strong red undertones, giving it a slightly richer and darker appearance.
346
- ORANGE: 16753920,
347
- // Bright, vibrant hue associated with sunsets, citrus fruits, and autumn tones.
348
- // Yellow
349
- AMBER: 16755200,
350
- // Bright Orange. It’s a warm, vibrant shade of orange with golden-yellow undertones, associated with autumn hues.
351
- CADMIUM_YELLOW: 16766720,
352
- // Bright golden yellow with warm undertones.
353
- GOLD: 16766720,
354
- // Rich, vibrant yellow with warm undertones, resembling the color of metallic gold.
355
- YELLOW: 16776960,
356
- // Bright, pure yellow shade.
357
- // Green
358
- LIME_GREEN: 10798080,
359
- // Lime Green or Bright Chartreuse. It’s a vivid, energetic yellow-green shade
360
- SPRING_GREEN: 8965205,
361
- // Fresh, vibrant appearance, resembling new leaves or spring foliage
362
- MOSS_GREEN: 8956467,
363
- // Medium-light shade of green with yellow undertones, often seen in natural foliage.
364
- FERN_GREEN: 4950843,
365
- // It's a natural, medium-dark green with slightly muted tones, resembling the lush greenery of ferns or foliage.
366
- FOREST_GREEN: 2263842,
367
- // Rich, deep green shade, often associated with dense woodland and nature.
368
- SAP_GREEN: 5274922,
369
- // Natural green with a muted tone.
370
- OLIVE_DRAB: 5597999,
371
- // Muted earthy green with brownish undertones.
372
- VIRIDIAN_GREEN: 43115,
373
- // Vibrant cool green.
374
- MINT_GREEN: 8965290,
375
- // Mint Green or Light Jade. It’s a soft, pastel green with subtle blue undertones.
376
- AQUAMARINE: 65450,
377
- // Aquamarine or Mint Green. It’s a bright, vibrant turquoise shade that blends green and blue.
378
- // Blue
379
- PHTHALO_BLUE: 3977,
380
- // Phthalo Blue or Bright Navy. Intense, rich blue with a slightly greenish cool undertone.
381
- AETHER_BLUE: 3447003,
382
- // Bright and vivid shade of blue, sitting between the airy Sky Blue and rich Cerulean.
383
- SKY_BLUE: 8965375,
384
- // Sky Blue or Baby Blue. It’s a light, cheerful shade of blue with a slightly soft and pastel tone.
385
- CERULEAN_BLUE: 6139362,
386
- // Cerulean Blue or Sky Blue. It’s a bright, vivid shade of blue with a slightly cool undertone.
387
- AZURE: 30719,
388
- // Azure Blue or Bright Blue. It’s a vibrant, rich shade of blue with a cool undertone.
389
- OCEAN_BLUE: 30654,
390
- // Ocean Blue or Azure Blue. It’s a vibrant medium blue shade with a slight teal undertone.
391
- ROYAL_BLUE: 5592575,
392
- // Royal Blue or Bright Indigo. It’s a vibrant medium blue shade with a slightly cool and saturated tone.
393
- MIDNIGHT_BLUE: 51,
394
- // A very deep, dark blue shade that evokes the feeling of a starless night sky or deep ocean depths, with subtle blue undertones.
395
- ULTRAMARINE_BLUE: 4149685,
396
- // Deep, rich blue with a slightly cool undertone.
397
- // Purple
398
- COBALT_VIOLET: 6950317,
399
- // Soft, purple tone.
400
- DEEP_VIOLET: 11141375,
401
- // Electric Purple or Deep Violet. It’s a bright, vibrant shade of purple with a strong blue undertone.
402
- CORAL_PINK: 16724838,
403
- // Bright Rose or Coral Pink. It’s a vivid, bold pinkish-red shade with warm undertones.
404
- VIVID_MAGENTA: 16720639,
405
- // It's an intense, electric shade of pink with equal parts red and blue.
406
- MAGENTA: 16711935,
407
- // Bright, vivid hue that is a mix of equal parts red and blue, sometimes called Fuchsia.
408
- HOT_PINK: 16711850,
409
- // Hot Pink or Fuchsia Rose. It’s a vivid and bold pink with a magenta undertone.
410
- PINK_SHERBET: 16751052,
411
- // Pink Sherbet or Light Pink. It’s a soft, playful pink shade with a hint of warmth.
412
- SOFT_PINK: 16762823,
413
- // Blush Pink or Soft Pink. It’s a pale, delicate pink with warm undertones.
414
- // Brown
415
- BURNT_SIENNA: 15299665,
416
- // warm, earthy brown with reddish undertones.
417
- BURNT_UMBER: 9057060,
418
- // Dark brown with red undertones.
419
- SIENNA: 9132587,
420
- // Dark Goldenrod Brown. It’s a warm, earthy brown with reddish and golden undertones, often associated with natural clay or autumn leaves.
421
- SADDLE_BROWN: 9127187,
422
- // Rich, earthy brown with reddish undertones, often associated with leather, wood, or other natural materials.
423
- COFFEE_BROWN: 6045747,
424
- // Rich, earthy tone with hints of red and gray, resembling the color of natural wood or dark leather.
425
- DARK_UMBER: 4929057,
426
- // Coffee Brown or Dark Umber. It’s a deep, rich brown with warm, earthy undertones, often resembling dark wood or roasted coffee beans.
427
- RAW_UMBER: 8545860,
428
- // Cool, muted brown.
429
- YELLOW_OCHRE: 12951919,
430
- // Warm, muted yellow-brown
431
- RAW_SIENNA: 13808780,
432
- // Light, golden brown.
433
- TAUPE: 9141627,
434
- // Rosy Brown or Taupe Gray. It’s a muted, earthy tone with a mix of brown and gray.
435
- // Gray
436
- ONYX: 197379,
437
- // Extremely deep, almost black shade with a neutral tone.
438
- CARBON: 3026478,
439
- // Deep, neutral gray.
440
- CHARCOAL: 3355443,
441
- // Rich, neutral gray.
442
- SLATE_GRAY: 4210752,
443
- // Medium-dark shade of gray
444
- ASH_GRAY: 4473924,
445
- // Ash Gray or Dark Slate Gray.
446
- GRAPHITE: 5263440,
447
- // Medium-dark, neutral Graphite Gray or Smoky Gray shadowy muted depth.
448
- STEEL_GRAY: 5592405,
449
- // Medium Gray or Steel Gray.
450
- DIM_GRAY: 6908265,
451
- // Medium-dark neutral gray with a muted, balanced tone
452
- IRON: 7829367,
453
- // It’s a medium gray neutral.
454
- GRAY: 8421504,
455
- // It is a neutral, medium-gray tone that sits exactly halfway between black and white.
456
- STONE: 8947848,
457
- // It’s a medium-light neutral.
458
- SILVER: 11184810,
459
- // Light Gray. It’s a soft, pale gray shade with a slightly metallic undertone.
460
- LIGHT_GRAY: 13421772,
461
- // Light, neutral Gray, sits between medium grays and white.
462
- PALE_GRAY: 15658734,
463
- // Very Light Gray or Soft Gray. It’s a pale, almost white shade of gray.
464
- WHITE_SMOKE: 16119285,
465
- // White Smoke or Light Gray. It’s a soft, pale gray shade with a hint of warmth.
466
- TITANIUM_WHITE: 16777215
467
- // Pure white, the brightest color possible.
468
- }, qt = (e) => 1 - Math.cos(e * Math.PI / 2), Yt = (e) => Math.sin(e * Math.PI / 2), Ht = (e) => -0.5 * (Math.cos(Math.PI * e) - 1), Xt = (e) => e * e, Zt = (e) => 1 - Math.pow(1 - e, 2), jt = (e) => e < 0.5 ? 2 * e * e : 1 - Math.pow(-2 * e + 2, 2) / 2, Qt = (e) => e * e * e, Kt = (e) => 1 - Math.pow(1 - e, 3), $t = (e) => e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2, Jt = (e) => e * e * e * e, Wt = (e) => 1 - Math.pow(1 - e, 4), te = (e) => e < 0.5 ? 8 * e * e * e * e : 1 - Math.pow(-2 * e + 2, 4) / 2, ee = (e) => e * e * e * e * e, oe = (e) => 1 - Math.pow(1 - e, 5), ne = (e) => e < 0.5 ? 16 * e * e * e * e * e : 1 - Math.pow(-2 * e + 2, 5) / 2, se = (e) => e === 0 ? 0 : Math.pow(2, 10 * e - 10), re = (e) => e === 1 ? 1 : 1 - Math.pow(2, -10 * e), ae = (e) => e === 0 ? 0 : e === 1 ? 1 : e < 0.5 ? Math.pow(2, 20 * e - 10) / 2 : (2 - Math.pow(2, -20 * e + 10)) / 2, ie = (e) => 1 - Math.sqrt(1 - Math.pow(e, 2)), ce = (e) => Math.sqrt(1 - Math.pow(e - 1, 2)), le = (e) => e < 0.5 ? (1 - Math.sqrt(1 - Math.pow(2 * e, 2))) / 2 : (Math.sqrt(1 - Math.pow(-2 * e + 2, 2)) + 1) / 2, ue = (e) => e, me = (e) => e * e * (3 - 2 * e), he = (e) => 1 - Math.pow(1 - e, 0.3), fe = (e) => Math.pow(e, 0.3), pe = (e) => Math.log(Math.max(0.01, e)) / Math.log(2), de = (e) => Math.sqrt(e), ye = (e) => 1 - e, we = (e) => Math.exp(-Math.pow(e - 0.5, 2) / (2 * 0.5)), Qo = {
469
- SINE_EASE_IN: qt,
470
- SINE_EASE_OUT: Yt,
471
- SINE_EASE_IN_OUT: Ht,
472
- QUADRATIC_EASE_IN: Xt,
473
- QUADRATIC_EASE_OUT: Zt,
474
- QUADRATIC_EASE_IN_OUT: jt,
475
- CUBIC_EASE_IN: Qt,
476
- CUBIC_EASE_OUT: Kt,
477
- CUBIC_EASE_IN_OUT: $t,
478
- QUARTIC_EASE_IN: Jt,
479
- QUARTIC_EASE_OUT: Wt,
480
- QUARTIC_EASE_IN_OUT: te,
481
- QUINTIC_EASE_IN: ee,
482
- QUINTIC_EASE_OUT: oe,
483
- QUINTIC_EASE_IN_OUT: ne,
484
- EXPONENTIAL_EASE_IN: se,
485
- EXPONENTIAL_EASE_OUT: re,
486
- EXPONENTIAL_EASE_IN_OUT: ae,
487
- CIRCULAR_EASE_IN: ie,
488
- CIRCULAR_EASE_OUT: ce,
489
- CIRCULAR_EASE_IN_OUT: le,
490
- LINEAR: ue,
491
- SMOOTHSTEP: me,
492
- CONCAVE: he,
493
- CONVEX: fe,
494
- LOGARITHMIC: pe,
495
- SQUARE_ROOT: de,
496
- INVERSE: ye,
497
- GAUSSIAN: we
498
- }, Me = (e, t, o, s, a) => {
499
- const n = Math.max(0, Math.min(1, e)), r = 1 - n;
500
- return r * r * r * t + 3 * r * r * n * o + 3 * r * n * n * s + n * n * n * a;
501
- }, xe = (e, t = 1) => {
502
- const o = Math.max(1e-3, t);
503
- return (1 - Math.exp(-o * e)) / (1 - Math.exp(-o));
504
- }, ve = (e, t = 1, o = 1) => {
505
- const s = Math.max(0, Math.min(1, e));
506
- return t * Math.pow(s, o);
507
- }, ge = (e, t = 1, o = 1) => {
508
- const s = Math.max(1e-3, Math.min(1, e));
509
- return t * Math.log(o * s + 1);
510
- }, Ae = (e, t = 1, o = 0, s = 0) => {
511
- const a = Math.max(0, Math.min(1, e));
512
- return t * a * a + o * a + s;
513
- }, Ie = (e, t, o, s) => {
514
- const a = Math.max(0, Math.min(1, e)), n = 1 - a;
515
- return n * n * t + 2 * n * a * o + a * a * s;
516
- }, Ee = (e, t = 10) => {
517
- const o = Math.max(0, Math.min(1, e));
518
- return 1 / (1 + Math.exp(-t * (o - 0.5)));
519
- }, be = (e) => Math.sin(e * Math.PI * 0.5), D = {
520
- CUBIC: Me,
521
- DAMPED: xe,
522
- EXPONENTIAL: ve,
523
- LOGARITHMIC: ge,
524
- PARABOLIC: Ae,
525
- QUADRATIC: Ie,
526
- SIGMOID: Ee,
527
- SINUSOIDAL: be
528
- };
529
- class Ko extends nt {
530
- constructor(o = {}) {
531
- const {
532
- count: s = 20,
533
- width: a = 1.5,
534
- height: n = 3,
535
- depth: r = 1.5,
536
- geometry: i = new z(0.1, 6, 6),
537
- // Small spheres
538
- material: c = new w({
539
- color: 16777215,
540
- transparent: !0,
541
- opacity: 0.6,
542
- roughness: 0.3,
543
- metalness: 0.3
544
- })
545
- } = o;
546
- super(i, c, s);
547
- I(this, "bubblePositions", []);
548
- I(this, "velocities", []);
549
- I(this, "width");
550
- I(this, "height");
551
- I(this, "depth");
552
- this.height = n, this.width = a, this.depth = r;
553
- for (let l = 0; l < this.count; l++) {
554
- const u = new M(
555
- (Math.random() - 0.5) * a,
556
- Math.random() * (n - 1) + 0.5,
557
- (Math.random() - 0.5) * r
558
- );
559
- this.bubblePositions.push(u), this.velocities.push(0.01 + Math.random() * 0.02), this.updateInstanceMatrix(l);
560
- }
561
- }
562
- /**
563
- * Updates the position of a specific bubble instance in the InstancedMesh.
564
- */
565
- updateInstanceMatrix(o) {
566
- const s = this.bubblePositions[o], a = new X().setPosition(s);
567
- this.setMatrixAt(o, a), this.instanceMatrix.needsUpdate = !0;
568
- }
569
- /**
570
- * Updates bubble positions, moving them upward and resetting them
571
- * to the bottom if they reach the top.
572
- */
573
- update() {
574
- for (let o = 0; o < this.count; o++) {
575
- const s = this.bubblePositions[o];
576
- s.y += this.velocities[o], s.y > this.height && (s.x = (Math.random() - 0.5) * this.width, s.y = 0, s.z = (Math.random() - 0.5) * this.depth), this.updateInstanceMatrix(o);
577
- }
578
- }
579
- }
580
- class Te extends E {
581
- constructor(t = 0.1) {
582
- super();
583
- const o = [], s = [], a = [
584
- [0, 1],
585
- // Top point
586
- [0.5, 0.75],
587
- // Right upper middle
588
- [0.75, 0.25],
589
- // Right lower middle
590
- [0.5, -0.5],
591
- // Right bottom middle
592
- [0, -1],
593
- // Bottom point
594
- [-0.5, -0.5],
595
- // Left bottom middle
596
- [-0.75, 0.25],
597
- // Left lower middle
598
- [-0.5, 0.75]
599
- // Left upper middle
600
- ];
601
- for (let r = 0; r < a.length; r++) {
602
- const [i, c] = a[r];
603
- o.push(i * t, c * t, 0);
604
- }
605
- for (let r = 1; r < a.length - 1; r++)
606
- s.push(0, r, r + 1);
607
- s.push(0, a.length - 1, 1);
608
- const n = new F(o, 3);
609
- this.setAttribute("position", n), this.setIndex(s), this.computeVertexNormals();
610
- }
611
- }
612
- class $o extends nt {
613
- constructor(o = {}) {
614
- const {
615
- count: s = 200,
616
- width: a = 20,
617
- height: n = 10,
618
- depth: r = 20,
619
- geometry: i = new Te(),
620
- material: c = new w({
621
- color: 8956467,
622
- metalness: 0.1,
623
- roughness: 0.8,
624
- flatShading: !0,
625
- side: Y
626
- })
627
- } = o;
628
- super(i, c, s);
629
- I(this, "dummyMatrix");
630
- I(this, "velocities");
631
- I(this, "width");
632
- I(this, "height");
633
- I(this, "depth");
634
- this.dummyMatrix = new X(), this.velocities = [], this.width = a, this.height = n, this.depth = r;
635
- for (let l = 0; l < s; l++) {
636
- const u = (Math.random() - 0.5) * a, m = Math.random() * (n - 1) + 0.5, h = (Math.random() - 0.5) * r, f = (Math.random() - 0.5) * Math.PI, p = (Math.random() - 0.5) * Math.PI, d = (Math.random() - 0.5) * Math.PI;
637
- this.dummyMatrix.makeRotationFromEuler(new Gt(f, p, d)), this.dummyMatrix.setPosition(u, m, h), this.setMatrixAt(l, this.dummyMatrix);
638
- const y = new M((Math.random() - 0.5) * 0.01, -5e-3, (Math.random() - 0.5) * 0.01);
639
- this.velocities.push(y);
640
- }
641
- this.instanceMatrix.needsUpdate = !0;
642
- }
643
- update() {
644
- for (let o = 0; o < this.count; o++) {
645
- const s = new X();
646
- this.getMatrixAt(o, s);
647
- const a = new M();
648
- a.setFromMatrixPosition(s);
649
- const n = this.velocities[o];
650
- a.add(n), a.y < 0 && (a.set(
651
- (Math.random() - 0.5) * this.width,
652
- Math.random() * (this.height - 1) + 0.5,
653
- (Math.random() - 0.5) * this.depth
654
- ), n.set((Math.random() - 0.5) * 0.01, -5e-3, (Math.random() - 0.5) * 0.01)), s.setPosition(a), this.setMatrixAt(o, s);
655
- }
656
- this.instanceMatrix.needsUpdate = !0;
657
- }
658
- }
659
- const T = (e, t) => {
660
- const o = e[0].index !== null, s = new Set(Object.keys(e[0].attributes)), a = new Set(Object.keys(e[0].morphAttributes)), n = {}, r = {}, i = e[0].morphTargetsRelative, c = new E();
661
- let l = 0;
662
- if (e.forEach((u, m) => {
663
- let h = 0;
664
- if (o !== (u.index !== null))
665
- return console.error(
666
- "THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index " + m + ". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."
667
- ), null;
668
- for (let f in u.attributes) {
669
- if (!s.has(f))
670
- return console.error(
671
- "THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index " + m + '. All geometries must have compatible attributes; make sure "' + f + '" attribute exists among all geometries, or in none of them.'
672
- ), null;
673
- n[f] === void 0 && (n[f] = []), n[f].push(u.attributes[f]), h++;
674
- }
675
- if (h !== s.size)
676
- return console.error(
677
- "THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index " + m + ". Make sure all geometries have the same number of attributes."
678
- ), null;
679
- if (i !== u.morphTargetsRelative)
680
- return console.error(
681
- "THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index " + m + ". .morphTargetsRelative must be consistent throughout all geometries."
682
- ), null;
683
- for (let f in u.morphAttributes) {
684
- if (!a.has(f))
685
- return console.error(
686
- "THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index " + m + ". .morphAttributes must be consistent throughout all geometries."
687
- ), null;
688
- r[f] === void 0 && (r[f] = []), r[f].push(u.morphAttributes[f]);
689
- }
690
- if (c.userData.mergedUserData = c.userData.mergedUserData || [], c.userData.mergedUserData.push(u.userData), t) {
691
- let f;
692
- if (u.index)
693
- f = u.index.count;
694
- else if (u.attributes.position !== void 0)
695
- f = u.attributes.position.count;
696
- else
697
- return console.error(
698
- "THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index " + m + ". The geometry must have either an index or a position attribute"
699
- ), null;
700
- c.addGroup(l, f, m), l += f;
701
- }
702
- }), o) {
703
- let u = 0;
704
- const m = [];
705
- e.forEach((h) => {
706
- const f = h.index;
707
- for (let p = 0; p < f.count; ++p)
708
- m.push(f.getX(p) + u);
709
- u += h.attributes.position.count;
710
- }), c.setIndex(m);
711
- }
712
- for (let u in n) {
713
- const m = dt(n[u]);
714
- if (!m)
715
- return console.error(
716
- "THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the " + u + " attribute."
717
- ), null;
718
- c.setAttribute(u, m);
719
- }
720
- for (let u in r) {
721
- const m = r[u][0].length;
722
- if (m === 0)
723
- break;
724
- c.morphAttributes = c.morphAttributes || {}, c.morphAttributes[u] = [];
725
- for (let h = 0; h < m; ++h) {
726
- const f = [];
727
- for (let d = 0; d < r[u].length; ++d)
728
- f.push(r[u][d][h]);
729
- const p = dt(f);
730
- if (!p)
731
- return console.error(
732
- "THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the " + u + " morphAttribute."
733
- ), null;
734
- c.morphAttributes[u].push(p);
735
- }
736
- }
737
- return c;
738
- }, dt = (e) => {
739
- let t, o, s, a = 0;
740
- if (e.forEach((n) => {
741
- if (t === void 0 && (t = n.array.constructor), t !== n.array.constructor)
742
- return console.error(
743
- "THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."
744
- ), null;
745
- if (o === void 0 && (o = n.itemSize), o !== n.itemSize)
746
- return console.error(
747
- "THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."
748
- ), null;
749
- if (s === void 0 && (s = n.normalized), s !== n.normalized)
750
- return console.error(
751
- "THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."
752
- ), null;
753
- a += n.array.length;
754
- }), t && o) {
755
- const n = new t(a);
756
- let r = 0;
757
- return e.forEach((i) => {
758
- n.set(i.array, r), r += i.array.length;
759
- }), new _(n, o, s);
760
- }
761
- };
762
- function Se(e, t = 1e-4) {
763
- t = Math.max(t, Number.EPSILON);
764
- const o = {}, s = e.getIndex(), a = e.getAttribute("position"), n = s ? s.count : a.count;
765
- let r = 0;
766
- const i = Object.keys(e.attributes), c = {}, l = {}, u = [], m = ["getX", "getY", "getZ", "getW"];
767
- for (let d = 0, y = i.length; d < y; d++) {
768
- const g = i[d];
769
- c[g] = [];
770
- const v = e.morphAttributes[g];
771
- v && (l[g] = new Array(v.length).fill(0).map(() => []));
772
- }
773
- const h = Math.log10(1 / t), f = Math.pow(10, h);
774
- for (let d = 0; d < n; d++) {
775
- const y = s ? s.getX(d) : d;
776
- let g = "";
777
- for (let v = 0, C = i.length; v < C; v++) {
778
- const S = i[v], P = e.getAttribute(S), R = P.itemSize;
779
- for (let O = 0; O < R; O++)
780
- g += `${~~(P[m[O]](y) * f)},`;
781
- }
782
- if (g in o)
783
- u.push(o[g]);
784
- else {
785
- for (let v = 0, C = i.length; v < C; v++) {
786
- const S = i[v], P = e.getAttribute(S), R = e.morphAttributes[S], O = P.itemSize, U = c[S], at = l[S];
787
- for (let Q = 0; Q < O; Q++) {
788
- const K = m[Q];
789
- if (U.push(P[K](y)), R)
790
- for (let B = 0, Tt = R.length; B < Tt; B++)
791
- at[B].push(R[B][K](y));
792
- }
793
- }
794
- o[g] = r, u.push(r), r++;
795
- }
796
- }
797
- const p = e.clone();
798
- for (let d = 0, y = i.length; d < y; d++) {
799
- const g = i[d], v = e.getAttribute(g), C = new v.array.constructor(c[g]), S = new _(C, v.itemSize, v.normalized);
800
- if (p.setAttribute(g, S), g in l)
801
- for (let P = 0; P < l[g].length; P++) {
802
- const R = e.morphAttributes[g][P], O = new R.array.constructor(l[g][P]), U = new _(O, R.itemSize, R.normalized);
803
- p.morphAttributes[g][P] = U;
804
- }
805
- }
806
- return p.setIndex(u), p;
807
- }
808
- class Pe extends E {
809
- constructor(t = (a, n, r) => r.set(a, n, Math.cos(a) * Math.sin(n)), o = 8, s = 8) {
810
- super(), this.type = "ParametricGeometry", this.parameters = {
811
- func: t,
812
- slices: o,
813
- stacks: s
814
- };
815
- const a = [], n = [], r = [], i = [], c = 1e-5, l = new M(), u = new M(), m = new M(), h = new M(), f = new M(), p = o + 1;
816
- for (let d = 0; d <= s; d++) {
817
- const y = d / s;
818
- for (let g = 0; g <= o; g++) {
819
- const v = g / o;
820
- t(v, y, u), n.push(u.x, u.y, u.z), v - c >= 0 ? (t(v - c, y, m), h.subVectors(u, m)) : (t(v + c, y, m), h.subVectors(m, u)), y - c >= 0 ? (t(v, y - c, m), f.subVectors(u, m)) : (t(v, y + c, m), f.subVectors(m, u)), l.crossVectors(h, f).normalize(), r.push(l.x, l.y, l.z), i.push(v, y);
821
- }
822
- }
823
- for (let d = 0; d < s; d++)
824
- for (let y = 0; y < o; y++) {
825
- const g = d * p + y, v = d * p + y + 1, C = (d + 1) * p + y + 1, S = (d + 1) * p + y;
826
- a.push(g, v, S), a.push(v, C, S);
827
- }
828
- this.setIndex(a), this.setAttribute("position", new F(n, 3)), this.setAttribute("normal", new F(r, 3)), this.setAttribute("uv", new F(i, 2));
829
- }
830
- }
831
- class xt extends E {
832
- constructor(t = 1, o = 1.5, s = 0.5, a = 0.05, n = 0.05) {
833
- super();
834
- const r = t, i = o, c = s, l = a, u = n, m = [
835
- // Front cover
836
- 0,
837
- 0,
838
- 0,
839
- r,
840
- 0,
841
- 0,
842
- r,
843
- i,
844
- 0,
845
- 0,
846
- i,
847
- 0,
848
- // Back cover
849
- r,
850
- 0,
851
- -c,
852
- 0,
853
- 0,
854
- -c,
855
- 0,
856
- i,
857
- -c,
858
- r,
859
- i,
860
- -c,
861
- // Spine
862
- 0,
863
- 0,
864
- -c,
865
- 0,
866
- 0,
867
- 0,
868
- 0,
869
- i,
870
- 0,
871
- 0,
872
- i,
873
- -c,
874
- // Inside front cover
875
- r,
876
- 0,
877
- -l,
878
- l,
879
- 0,
880
- -l,
881
- l,
882
- i,
883
- -l,
884
- r,
885
- i,
886
- -l,
887
- // Inside back cover
888
- l,
889
- 0,
890
- -c + l,
891
- r,
892
- 0,
893
- -c + l,
894
- r,
895
- i,
896
- -c + l,
897
- l,
898
- i,
899
- -c + l,
900
- // Inside spine
901
- l,
902
- 0,
903
- -l,
904
- l,
905
- 0,
906
- -c + l,
907
- l,
908
- i,
909
- -c + l,
910
- l,
911
- i,
912
- -l,
913
- // Front cover top
914
- 0,
915
- i,
916
- 0,
917
- r,
918
- i,
919
- 0,
920
- r,
921
- i,
922
- -l,
923
- l,
924
- i,
925
- -l,
926
- // Back cover top
927
- 0,
928
- i,
929
- -c,
930
- l,
931
- i,
932
- -c + l,
933
- r,
934
- i,
935
- -c + l,
936
- r,
937
- i,
938
- -c,
939
- // Spine cover top
940
- 0,
941
- i,
942
- 0,
943
- l,
944
- i,
945
- -l,
946
- l,
947
- i,
948
- -c + l,
949
- 0,
950
- i,
951
- -c,
952
- // Front cover bottom
953
- 0,
954
- 0,
955
- 0,
956
- l,
957
- 0,
958
- -l,
959
- r,
960
- 0,
961
- -l,
962
- r,
963
- 0,
964
- 0,
965
- // Back cover bottom
966
- 0,
967
- 0,
968
- -c,
969
- r,
970
- 0,
971
- -c,
972
- r,
973
- 0,
974
- -c + l,
975
- l,
976
- 0,
977
- -c + l,
978
- // Spine cover bottom
979
- 0,
980
- 0,
981
- 0,
982
- 0,
983
- 0,
984
- -c,
985
- l,
986
- 0,
987
- -c + l,
988
- l,
989
- 0,
990
- -l,
991
- // Front cover edge
992
- r,
993
- 0,
994
- 0,
995
- r,
996
- 0,
997
- -l,
998
- r,
999
- i,
1000
- -l,
1001
- r,
1002
- i,
1003
- 0,
1004
- // Back cover edge
1005
- r,
1006
- 0,
1007
- -c,
1008
- r,
1009
- i,
1010
- -c,
1011
- r,
1012
- i,
1013
- -c + l,
1014
- r,
1015
- 0,
1016
- -c + l
1017
- ], h = [
1018
- 0,
1019
- 0,
1020
- 1,
1021
- 0,
1022
- 0,
1023
- 1,
1024
- 0,
1025
- 0,
1026
- 1,
1027
- 0,
1028
- 0,
1029
- 1,
1030
- // Front cover
1031
- 0,
1032
- 0,
1033
- -1,
1034
- 0,
1035
- 0,
1036
- -1,
1037
- 0,
1038
- 0,
1039
- -1,
1040
- 0,
1041
- 0,
1042
- -1,
1043
- // Back cover
1044
- -1,
1045
- 0,
1046
- 0,
1047
- -1,
1048
- 0,
1049
- 0,
1050
- -1,
1051
- 0,
1052
- 0,
1053
- -1,
1054
- 0,
1055
- 0,
1056
- // Spine
1057
- 0,
1058
- 0,
1059
- -1,
1060
- 0,
1061
- 0,
1062
- -1,
1063
- 0,
1064
- 0,
1065
- -1,
1066
- 0,
1067
- 0,
1068
- -1,
1069
- // Inside front cover
1070
- 0,
1071
- 0,
1072
- 1,
1073
- 0,
1074
- 0,
1075
- 1,
1076
- 0,
1077
- 0,
1078
- 1,
1079
- 0,
1080
- 0,
1081
- 1,
1082
- // Inside back cover
1083
- 1,
1084
- 0,
1085
- 0,
1086
- 1,
1087
- 0,
1088
- 0,
1089
- 1,
1090
- 0,
1091
- 0,
1092
- 1,
1093
- 0,
1094
- 0,
1095
- // Inside spine
1096
- 0,
1097
- 1,
1098
- 0,
1099
- 0,
1100
- 1,
1101
- 0,
1102
- 0,
1103
- 1,
1104
- 0,
1105
- 0,
1106
- 1,
1107
- 0,
1108
- // Front cover top
1109
- 0,
1110
- 1,
1111
- 0,
1112
- 0,
1113
- 1,
1114
- 0,
1115
- 0,
1116
- 1,
1117
- 0,
1118
- 0,
1119
- 1,
1120
- 0,
1121
- // Back cover top
1122
- 0,
1123
- 1,
1124
- 0,
1125
- 0,
1126
- 1,
1127
- 0,
1128
- 0,
1129
- 1,
1130
- 0,
1131
- 0,
1132
- 1,
1133
- 0,
1134
- // Spine cover top
1135
- 0,
1136
- -1,
1137
- 0,
1138
- 0,
1139
- -1,
1140
- 0,
1141
- 0,
1142
- -1,
1143
- 0,
1144
- 0,
1145
- -1,
1146
- 0,
1147
- // Front cover bottom
1148
- 0,
1149
- -1,
1150
- 0,
1151
- 0,
1152
- -1,
1153
- 0,
1154
- 0,
1155
- -1,
1156
- 0,
1157
- 0,
1158
- -1,
1159
- 0,
1160
- // Back cover bottom
1161
- 0,
1162
- -1,
1163
- 0,
1164
- 0,
1165
- -1,
1166
- 0,
1167
- 0,
1168
- -1,
1169
- 0,
1170
- 0,
1171
- -1,
1172
- 0,
1173
- // Spine cover bottom
1174
- 1,
1175
- 0,
1176
- 0,
1177
- 1,
1178
- 0,
1179
- 0,
1180
- 1,
1181
- 0,
1182
- 0,
1183
- 1,
1184
- 0,
1185
- 0,
1186
- // Front cover edge
1187
- 1,
1188
- 0,
1189
- 0,
1190
- 1,
1191
- 0,
1192
- 0,
1193
- 1,
1194
- 0,
1195
- 0,
1196
- 1,
1197
- 0,
1198
- 0
1199
- // Back cover edge
1200
- ], f = t / (t * 2 + s), p = (t + s) / (t * 2 + s), d = [
1201
- p,
1202
- 0,
1203
- 1,
1204
- 0,
1205
- 1,
1206
- 1,
1207
- p,
1208
- 1,
1209
- // Front cover
1210
- 0,
1211
- 0,
1212
- f,
1213
- 0,
1214
- f,
1215
- 1,
1216
- 0,
1217
- 1,
1218
- // Back cover
1219
- f,
1220
- 0,
1221
- p,
1222
- 0,
1223
- p,
1224
- 1,
1225
- f,
1226
- 1,
1227
- // Spine
1228
- 1,
1229
- 0,
1230
- p,
1231
- 0,
1232
- p,
1233
- 1,
1234
- 1,
1235
- 1,
1236
- // Inside front cover
1237
- f,
1238
- 0,
1239
- 0,
1240
- 0,
1241
- 0,
1242
- 1,
1243
- f,
1244
- 1,
1245
- // Inside back cover
1246
- p,
1247
- 0,
1248
- f,
1249
- 0,
1250
- f,
1251
- 1,
1252
- p,
1253
- 1,
1254
- // Inside spine
1255
- p,
1256
- 0,
1257
- 1,
1258
- 0,
1259
- 1,
1260
- 1,
1261
- p,
1262
- 1,
1263
- // Front cover top
1264
- 0,
1265
- 0,
1266
- 1,
1267
- 0,
1268
- 1,
1269
- 1,
1270
- 0,
1271
- 1,
1272
- // Back cover top
1273
- 0,
1274
- 0,
1275
- 1,
1276
- 0,
1277
- 1,
1278
- 1,
1279
- 0,
1280
- 1,
1281
- // Spine cover top
1282
- 0,
1283
- 0,
1284
- 1,
1285
- 0,
1286
- 1,
1287
- 1,
1288
- 0,
1289
- 1,
1290
- // Front cover bottom
1291
- 0,
1292
- 0,
1293
- 1,
1294
- 0,
1295
- 1,
1296
- 1,
1297
- 0,
1298
- 1,
1299
- // Back cover bottom
1300
- 0,
1301
- 0,
1302
- 1,
1303
- 0,
1304
- 1,
1305
- 1,
1306
- 0,
1307
- 1,
1308
- // Spine cover bottom
1309
- 0,
1310
- 0,
1311
- 1,
1312
- 0,
1313
- 1,
1314
- 1,
1315
- 0,
1316
- 1,
1317
- // Front cover edge
1318
- 0,
1319
- 0,
1320
- 1,
1321
- 0,
1322
- 1,
1323
- 1,
1324
- 0,
1325
- 1
1326
- // Back cover edge
1327
- ], y = [
1328
- 0,
1329
- 1,
1330
- 2,
1331
- 0,
1332
- 2,
1333
- 3,
1334
- // Front cover face
1335
- 4,
1336
- 5,
1337
- 6,
1338
- 4,
1339
- 6,
1340
- 7,
1341
- // Back cover face
1342
- 8,
1343
- 9,
1344
- 10,
1345
- 8,
1346
- 10,
1347
- 11,
1348
- // Spine face
1349
- 12,
1350
- 13,
1351
- 14,
1352
- 12,
1353
- 14,
1354
- 15,
1355
- // Inside front cover
1356
- 16,
1357
- 17,
1358
- 18,
1359
- 16,
1360
- 18,
1361
- 19,
1362
- // Inside back cover
1363
- 20,
1364
- 21,
1365
- 22,
1366
- 20,
1367
- 22,
1368
- 23,
1369
- // Inside spine
1370
- 24,
1371
- 25,
1372
- 26,
1373
- 24,
1374
- 26,
1375
- 27,
1376
- // Front cover top
1377
- 28,
1378
- 29,
1379
- 30,
1380
- 28,
1381
- 30,
1382
- 31,
1383
- // Back cover top
1384
- 32,
1385
- 33,
1386
- 34,
1387
- 32,
1388
- 34,
1389
- 35,
1390
- // Spine cover top
1391
- 36,
1392
- 37,
1393
- 38,
1394
- 36,
1395
- 38,
1396
- 39,
1397
- // Front cover bottom
1398
- 40,
1399
- 41,
1400
- 42,
1401
- 40,
1402
- 42,
1403
- 43,
1404
- // Back cover bottom
1405
- 44,
1406
- 45,
1407
- 46,
1408
- 44,
1409
- 46,
1410
- 47,
1411
- // Spine cover bottom
1412
- 48,
1413
- 49,
1414
- 50,
1415
- 48,
1416
- 50,
1417
- 51,
1418
- // Front cover edge
1419
- 52,
1420
- 53,
1421
- 54,
1422
- 52,
1423
- 54,
1424
- 55
1425
- // Back cover edge
1426
- ], g = new Float32Array(m), v = new Float32Array(h), C = new Float32Array(d), S = new Uint16Array(y), P = new E();
1427
- P.setAttribute("position", new _(g, 3)), P.setAttribute("normal", new _(v, 3)), P.setAttribute("uv", new _(C, 2)), P.setIndex(new _(S, 1));
1428
- const R = new b(t - l - u, i - u * 2, c - l * 2);
1429
- R.translate((t - l - u) / 2 + l, i / 2, -c / 2), this.copy(T([P, R], !0));
1430
- }
1431
- }
1432
- function vt({
1433
- scaleXMin: e = 0.4,
1434
- scaleXMax: t = 0.7,
1435
- scaleYMin: o = 0.3,
1436
- scaleYMax: s = 0.95,
1437
- scaleZMin: a = 0.1,
1438
- scaleZMax: n = 0.5
1439
- } = {}) {
1440
- return new M(
1441
- ht(e, t),
1442
- Dt(0.25, o, s),
1443
- kt(0.8, a, n)
1444
- );
1445
- }
1446
- function gt({
1447
- coverMaterial: e,
1448
- pagesMaterial: t,
1449
- scales: o
1450
- }) {
1451
- const s = new xt(), a = new nt(s, [e, t], o.length), n = new X();
1452
- let r = 0;
1453
- for (let i = 0; i < o.length; i++) {
1454
- const c = o[i], l = new X();
1455
- l.makeScale(c.x, c.y, c.z), n.identity(), n.multiply(l), n.setPosition(0.01 + Math.random() * 0.1, 0, r + c.z * 0.5), a.setMatrixAt(i, n), r += c.z * 0.5;
1456
- }
1457
- return a;
1458
- }
1459
- function Jo({
1460
- coverMaterial: e,
1461
- pagesMaterial: t,
1462
- count: o = 10,
1463
- scaleXMin: s = 0.4,
1464
- scaleXMax: a = 0.7,
1465
- scaleYMin: n = 0.3,
1466
- scaleYMax: r = 0.95,
1467
- scaleZMin: i = 0.1,
1468
- scaleZMax: c = 0.5
1469
- }) {
1470
- const l = Array.from(
1471
- { length: o },
1472
- () => vt({ scaleXMin: s, scaleXMax: a, scaleYMin: n, scaleYMax: r, scaleZMin: i, scaleZMax: c })
1473
- );
1474
- return gt({ coverMaterial: e, pagesMaterial: t, scales: l });
1475
- }
1476
- function Wo({
1477
- coverMaterial: e,
1478
- pagesMaterial: t,
1479
- length: o = 10,
1480
- scaleXMin: s = 0.4,
1481
- scaleXMax: a = 0.7,
1482
- scaleYMin: n = 0.3,
1483
- scaleYMax: r = 0.95,
1484
- scaleZMin: i = 0.1,
1485
- scaleZMax: c = 0.5
1486
- }) {
1487
- const l = [];
1488
- let u = o;
1489
- for (; u > 0; ) {
1490
- const m = vt({ scaleXMin: s, scaleXMax: a, scaleYMin: n, scaleYMax: r, scaleZMin: i, scaleZMax: c });
1491
- m.z = Math.min(m.z, u), l.push(m), u -= m.z;
1492
- }
1493
- return gt({ coverMaterial: e, pagesMaterial: t, scales: l });
1494
- }
1495
- function tn(e) {
1496
- const { width: t, depth: o, height: s, radius: a, gap: n, material: r } = e, i = r || new w({ color: 9127187 }), c = a * 3 / 2 + n, l = Math.sqrt(3) * a + n, u = Math.floor(t / c), m = Math.floor(o / l), h = u * m, f = new Z();
1497
- for (let v = 0; v < 6; v++) {
1498
- const C = Math.PI / 3 * v, S = Math.cos(C) * a, P = Math.sin(C) * a;
1499
- v === 0 ? f.moveTo(S, P) : f.lineTo(S, P);
1500
- }
1501
- f.closePath();
1502
- const p = new j(f, { depth: s, bevelEnabled: !1 });
1503
- p.rotateX(-Math.PI / 2);
1504
- const d = new nt(p, i, h), y = new Ct();
1505
- let g = 0;
1506
- for (let v = 0; v < u; v++)
1507
- for (let C = 0; C < m; C++) {
1508
- const S = v * c, P = C * l + v % 2 * (l / 2), R = S - u * c / 2 + c / 2, O = P - m * l / 2 + l / 2;
1509
- y.position.set(R, 0, O), y.updateMatrix(), d.setMatrixAt(g++, y.matrix);
1510
- }
1511
- return d.instanceMatrix.needsUpdate = !0, d;
1512
- }
1513
- class en extends E {
1514
- constructor(t = 2, o = 0.3, s = 0.6, a = 5, n = 5, r = Math.PI / 4) {
1515
- super();
1516
- const i = [], c = [];
1517
- for (let f = 0; f < a; f++) {
1518
- const p = f * o, d = p + o, y = f * s, g = y + s;
1519
- i.push(
1520
- // Vertical riser
1521
- -t / 2,
1522
- p,
1523
- y,
1524
- // Bottom-left
1525
- t / 2,
1526
- p,
1527
- y,
1528
- // Bottom-right
1529
- t / 2,
1530
- d,
1531
- y,
1532
- // Top-right
1533
- -t / 2,
1534
- d,
1535
- y,
1536
- // Top-left
1537
- // Horizontal tread
1538
- -t / 2,
1539
- d,
1540
- y,
1541
- // Top-left
1542
- t / 2,
1543
- d,
1544
- y,
1545
- // Top-right
1546
- t / 2,
1547
- d,
1548
- g,
1549
- // Back-right
1550
- -t / 2,
1551
- d,
1552
- g
1553
- // Back-left
1554
- );
1555
- const v = f * 8;
1556
- c.push(
1557
- v,
1558
- v + 1,
1559
- v + 2,
1560
- v,
1561
- v + 2,
1562
- v + 3
1563
- ), c.push(
1564
- v + 4,
1565
- v + 5,
1566
- v + 6,
1567
- v + 4,
1568
- v + 6,
1569
- v + 7
1570
- );
1571
- }
1572
- const l = a * o, u = a * s, m = t * 2;
1573
- i.push(
1574
- // Landing platform (4 vertices)
1575
- -m / 2,
1576
- l,
1577
- u,
1578
- // Bottom-left
1579
- m / 2,
1580
- l,
1581
- u,
1582
- // Bottom-right
1583
- m / 2,
1584
- l,
1585
- u + s,
1586
- // Top-right
1587
- -m / 2,
1588
- l,
1589
- u + s
1590
- // Top-left
1591
- );
1592
- const h = a * 8;
1593
- c.push(
1594
- h,
1595
- h + 1,
1596
- h + 2,
1597
- // First triangle for landing
1598
- h,
1599
- h + 2,
1600
- h + 3
1601
- // Second triangle for landing
1602
- );
1603
- for (let f = 0; f < 2; f++) {
1604
- const p = f === 0 ? 1 : -1;
1605
- for (let d = 0; d < n; d++) {
1606
- const y = l + d * o, g = y + o, v = p * (m / 4), C = u + s, S = d * s * Math.cos(r), P = d * s * Math.sin(r), R = v + p * S - t / 2 * Math.cos(r), O = v + p * S + t / 2 * Math.cos(r), U = C + P, at = R + p * s * Math.cos(r), Q = O + p * s * Math.cos(r), K = U + s * Math.sin(r);
1607
- i.push(
1608
- // Vertical riser
1609
- R,
1610
- y,
1611
- U,
1612
- // Bottom-left
1613
- O,
1614
- y,
1615
- U,
1616
- // Bottom-right
1617
- O,
1618
- g,
1619
- U,
1620
- // Top-right
1621
- R,
1622
- g,
1623
- U,
1624
- // Top-left
1625
- // Horizontal tread
1626
- R,
1627
- g,
1628
- U,
1629
- // Top-left
1630
- O,
1631
- g,
1632
- U,
1633
- // Top-right
1634
- Q,
1635
- g,
1636
- K,
1637
- // Back-right
1638
- at,
1639
- g,
1640
- K
1641
- // Back-left
1642
- );
1643
- const B = h + 4 + f * n * 8 + d * 8;
1644
- c.push(
1645
- B,
1646
- B + 1,
1647
- B + 2,
1648
- B,
1649
- B + 2,
1650
- B + 3
1651
- ), c.push(
1652
- B + 4,
1653
- B + 5,
1654
- B + 6,
1655
- B + 4,
1656
- B + 6,
1657
- B + 7
1658
- );
1659
- }
1660
- }
1661
- this.setIndex(c), this.setAttribute("position", new F(i, 3)), this.computeVertexNormals();
1662
- }
1663
- }
1664
- class Ge extends E {
1665
- constructor({ width: t = 5, height: o = 3, depth: s = 5, wallThickness: a = 0.05 } = {}) {
1666
- super();
1667
- const n = t, r = o, i = s, c = a, l = [
1668
- 0,
1669
- 0,
1670
- 0,
1671
- n,
1672
- 0,
1673
- 0,
1674
- n,
1675
- r,
1676
- 0,
1677
- 0,
1678
- r,
1679
- 0,
1680
- // Back wall
1681
- 0,
1682
- 0,
1683
- i,
1684
- 0,
1685
- 0,
1686
- 0,
1687
- 0,
1688
- r,
1689
- 0,
1690
- 0,
1691
- r,
1692
- i,
1693
- // Left wall
1694
- 0,
1695
- 0,
1696
- i,
1697
- n,
1698
- 0,
1699
- i,
1700
- n,
1701
- 0,
1702
- 0,
1703
- 0,
1704
- 0,
1705
- 0,
1706
- // Floor
1707
- -c,
1708
- -c,
1709
- i,
1710
- n,
1711
- -c,
1712
- i,
1713
- n,
1714
- 0,
1715
- i,
1716
- 0,
1717
- 0,
1718
- i,
1719
- // Floor front
1720
- n,
1721
- -c,
1722
- i,
1723
- n,
1724
- -c,
1725
- -c,
1726
- n,
1727
- 0,
1728
- 0,
1729
- n,
1730
- 0,
1731
- i,
1732
- // Floor side
1733
- -c,
1734
- -c,
1735
- i,
1736
- 0,
1737
- 0,
1738
- i,
1739
- 0,
1740
- r,
1741
- i,
1742
- -c,
1743
- r,
1744
- i,
1745
- // Left wall side
1746
- n,
1747
- 0,
1748
- 0,
1749
- n,
1750
- -c,
1751
- -c,
1752
- n,
1753
- r,
1754
- -c,
1755
- n,
1756
- r,
1757
- 0,
1758
- // Back wall side
1759
- -c,
1760
- r,
1761
- i,
1762
- 0,
1763
- r,
1764
- i,
1765
- 0,
1766
- r,
1767
- 0,
1768
- -c,
1769
- r,
1770
- -c,
1771
- // Ceiling left
1772
- 0,
1773
- r,
1774
- 0,
1775
- n,
1776
- r,
1777
- 0,
1778
- n,
1779
- r,
1780
- -c,
1781
- -c,
1782
- r,
1783
- -c,
1784
- // Ceiling right
1785
- -c,
1786
- -c,
1787
- -c,
1788
- n,
1789
- -c,
1790
- -c,
1791
- n,
1792
- -c,
1793
- i,
1794
- -c,
1795
- -c,
1796
- i,
1797
- // Floor backside
1798
- -c,
1799
- -c,
1800
- -c,
1801
- -c,
1802
- -c,
1803
- i,
1804
- -c,
1805
- r,
1806
- i,
1807
- -c,
1808
- r,
1809
- -c,
1810
- // Left wall backside
1811
- n,
1812
- -c,
1813
- -c,
1814
- -c,
1815
- -c,
1816
- -c,
1817
- -c,
1818
- r,
1819
- -c,
1820
- n,
1821
- r,
1822
- -c
1823
- // back wall backside
1824
- ], u = [
1825
- 0,
1826
- 1,
1827
- 3,
1828
- 1,
1829
- 2,
1830
- 3,
1831
- // Back wall
1832
- 4,
1833
- 5,
1834
- 7,
1835
- 5,
1836
- 6,
1837
- 7,
1838
- // Left wall
1839
- 8,
1840
- 9,
1841
- 11,
1842
- 9,
1843
- 10,
1844
- 11,
1845
- // Floor
1846
- 12,
1847
- 13,
1848
- 15,
1849
- 13,
1850
- 14,
1851
- 15,
1852
- // Floor (side: front)
1853
- 16,
1854
- 17,
1855
- 19,
1856
- 17,
1857
- 18,
1858
- 19,
1859
- // Floor (side: right)
1860
- 20,
1861
- 21,
1862
- 23,
1863
- 21,
1864
- 22,
1865
- 23,
1866
- // Left wall (side: front)
1867
- 24,
1868
- 25,
1869
- 27,
1870
- 25,
1871
- 26,
1872
- 27,
1873
- // Back wall (side: right)
1874
- 28,
1875
- 29,
1876
- 31,
1877
- 29,
1878
- 30,
1879
- 31,
1880
- // Left wall (side: top)
1881
- 32,
1882
- 33,
1883
- 35,
1884
- 33,
1885
- 34,
1886
- 35,
1887
- // Back wall (side: top)
1888
- 36,
1889
- 37,
1890
- 39,
1891
- 37,
1892
- 38,
1893
- 39,
1894
- // Floor backside
1895
- 40,
1896
- 41,
1897
- 43,
1898
- 41,
1899
- 42,
1900
- 43,
1901
- // Left wall backside
1902
- 44,
1903
- 45,
1904
- 47,
1905
- 45,
1906
- 46,
1907
- 47
1908
- // Back wall backside
1909
- ], m = [
1910
- 0,
1911
- 0,
1912
- 1,
1913
- 0,
1914
- 0,
1915
- 1,
1916
- 0,
1917
- 0,
1918
- 1,
1919
- 0,
1920
- 0,
1921
- 1,
1922
- // Back wall
1923
- 1,
1924
- 0,
1925
- 0,
1926
- 1,
1927
- 0,
1928
- 0,
1929
- 1,
1930
- 0,
1931
- 0,
1932
- 1,
1933
- 0,
1934
- 0,
1935
- // Left wall
1936
- 0,
1937
- 1,
1938
- 0,
1939
- 0,
1940
- 1,
1941
- 0,
1942
- 0,
1943
- 1,
1944
- 0,
1945
- 0,
1946
- 1,
1947
- 0,
1948
- // Floor
1949
- 0,
1950
- 0,
1951
- 1,
1952
- 0,
1953
- 0,
1954
- 1,
1955
- 0,
1956
- 0,
1957
- 1,
1958
- 0,
1959
- 0,
1960
- 1,
1961
- // Floor (side: front)
1962
- 1,
1963
- 0,
1964
- 0,
1965
- 1,
1966
- 0,
1967
- 0,
1968
- 1,
1969
- 0,
1970
- 0,
1971
- 1,
1972
- 0,
1973
- 0,
1974
- // Floor (side: right)
1975
- 0,
1976
- 0,
1977
- 1,
1978
- 0,
1979
- 0,
1980
- 1,
1981
- 0,
1982
- 0,
1983
- 1,
1984
- 0,
1985
- 0,
1986
- 1,
1987
- // Left wall (side: front)
1988
- 1,
1989
- 0,
1990
- 0,
1991
- 1,
1992
- 0,
1993
- 0,
1994
- 1,
1995
- 0,
1996
- 0,
1997
- 1,
1998
- 0,
1999
- 0,
2000
- // Back wall (side: right)
2001
- 0,
2002
- 1,
2003
- 0,
2004
- 0,
2005
- 1,
2006
- 0,
2007
- 0,
2008
- 1,
2009
- 0,
2010
- 0,
2011
- 1,
2012
- 0,
2013
- // Left wall (side: top)
2014
- 0,
2015
- 1,
2016
- 0,
2017
- 0,
2018
- 1,
2019
- 0,
2020
- 0,
2021
- 1,
2022
- 0,
2023
- 0,
2024
- 1,
2025
- 0,
2026
- // Back wall (side: top)
2027
- 0,
2028
- -1,
2029
- 0,
2030
- 0,
2031
- -1,
2032
- 0,
2033
- 0,
2034
- -1,
2035
- 0,
2036
- 0,
2037
- -1,
2038
- 0,
2039
- // Floor backside
2040
- -1,
2041
- 0,
2042
- 0,
2043
- -1,
2044
- 0,
2045
- 0,
2046
- -1,
2047
- 0,
2048
- 0,
2049
- -1,
2050
- 0,
2051
- 0,
2052
- // Left wall backside
2053
- 0,
2054
- 0,
2055
- -1,
2056
- 0,
2057
- 0,
2058
- -1,
2059
- 0,
2060
- 0,
2061
- -1,
2062
- 0,
2063
- 0,
2064
- -1
2065
- // Back wall backside
2066
- ], h = [
2067
- 0.5,
2068
- 0,
2069
- 1,
2070
- 0,
2071
- 1,
2072
- 1,
2073
- 0.5,
2074
- 1,
2075
- // Back wall
2076
- 0,
2077
- 0,
2078
- 0.5,
2079
- 0,
2080
- 0.5,
2081
- 1,
2082
- 0,
2083
- 1,
2084
- // Left wall
2085
- 0,
2086
- 0,
2087
- 1,
2088
- 0,
2089
- 1,
2090
- 1,
2091
- 0,
2092
- 1,
2093
- // Floor
2094
- 0,
2095
- 0,
2096
- 1,
2097
- 0,
2098
- 1,
2099
- c / n,
2100
- 0,
2101
- c / n,
2102
- // Floor (side: front)
2103
- 0,
2104
- 0,
2105
- 1,
2106
- 0,
2107
- 1,
2108
- c / n,
2109
- 0,
2110
- c / n,
2111
- // Floor (side: right)
2112
- 0,
2113
- 0,
2114
- c / n,
2115
- 0,
2116
- c / n,
2117
- 1,
2118
- 0,
2119
- 1,
2120
- // Left wall (side: front)
2121
- 1 - c / n,
2122
- 0,
2123
- 1,
2124
- 0,
2125
- 1,
2126
- 1,
2127
- 1 - c / n,
2128
- 1,
2129
- // Back wall (side: right)
2130
- 0,
2131
- 0,
2132
- c / n,
2133
- 0,
2134
- c / n,
2135
- 1,
2136
- 0,
2137
- 1,
2138
- // Left wall (side: top)
2139
- 0,
2140
- 1 - c / n,
2141
- 1,
2142
- 1 - c / n,
2143
- 1,
2144
- 1,
2145
- 0,
2146
- 1,
2147
- // Back wall (side: top)
2148
- 0,
2149
- 0,
2150
- 1,
2151
- 0,
2152
- 1,
2153
- 1,
2154
- 0,
2155
- 1,
2156
- // Floor backside
2157
- 0,
2158
- 0,
2159
- 1,
2160
- 0,
2161
- 1,
2162
- 1,
2163
- 0,
2164
- 1,
2165
- // Left wall backside
2166
- 0,
2167
- 0,
2168
- 1,
2169
- 0,
2170
- 1,
2171
- 1,
2172
- 0,
2173
- 1
2174
- // Back wall backside
2175
- ], f = new Float32Array(l), p = new Float32Array(m), d = new Float32Array(h);
2176
- this.setAttribute("position", new _(f, 3)), this.setAttribute("normal", new _(p, 3)), this.setAttribute("uv", new _(d, 2)), this.setIndex(u), this.addGroup(0, 12, 0), this.addGroup(12, 6, 1), this.addGroup(18, 54, 2);
2177
- }
2178
- }
2179
- class on extends E {
2180
- constructor(t = 2, o = 0.3, s = 0.5, a = 5, n = 2) {
2181
- super();
2182
- const r = [], i = [];
2183
- for (let m = 0; m < a; m++) {
2184
- const h = m * o, f = h + o, p = m * s, d = p + s;
2185
- r.push(
2186
- // Vertical riser
2187
- -t / 2,
2188
- h,
2189
- p,
2190
- // Bottom-left
2191
- t / 2,
2192
- h,
2193
- p,
2194
- // Bottom-right
2195
- t / 2,
2196
- f,
2197
- p,
2198
- // Top-right
2199
- -t / 2,
2200
- f,
2201
- p,
2202
- // Top-left
2203
- // Horizontal tread
2204
- -t / 2,
2205
- f,
2206
- p,
2207
- // Top-left
2208
- t / 2,
2209
- f,
2210
- p,
2211
- // Top-right
2212
- t / 2,
2213
- f,
2214
- d,
2215
- // Back-right
2216
- -t / 2,
2217
- f,
2218
- d
2219
- // Back-left
2220
- );
2221
- const y = m * 8;
2222
- i.push(
2223
- y,
2224
- y + 1,
2225
- y + 2,
2226
- y,
2227
- y + 2,
2228
- y + 3
2229
- ), i.push(
2230
- y + 4,
2231
- y + 5,
2232
- y + 6,
2233
- y + 4,
2234
- y + 6,
2235
- y + 7
2236
- );
2237
- }
2238
- const c = a * o, l = a * s;
2239
- r.push(
2240
- // Landing platform (4 vertices)
2241
- -t / 2,
2242
- c,
2243
- l,
2244
- // Bottom-left
2245
- t / 2,
2246
- c,
2247
- l,
2248
- // Bottom-right
2249
- t / 2,
2250
- c,
2251
- l + n,
2252
- // Top-right
2253
- -t / 2,
2254
- c,
2255
- l + n
2256
- // Top-left
2257
- );
2258
- const u = a * 8;
2259
- i.push(
2260
- u,
2261
- u + 1,
2262
- u + 2,
2263
- // First triangle for landing
2264
- u,
2265
- u + 2,
2266
- u + 3
2267
- // Second triangle for landing
2268
- );
2269
- for (let m = 0; m < a; m++) {
2270
- const h = c + m * o, f = h + o, p = -t / 2 - m * s, d = p - s;
2271
- r.push(
2272
- // Vertical riser
2273
- p,
2274
- h,
2275
- l + n,
2276
- // Bottom-left
2277
- p,
2278
- h,
2279
- l + n - t,
2280
- // Bottom-right
2281
- p,
2282
- f,
2283
- l + n - t,
2284
- // Top-right
2285
- p,
2286
- f,
2287
- l + n,
2288
- // Top-left
2289
- // Horizontal tread
2290
- p,
2291
- f,
2292
- l + n,
2293
- // Top-left
2294
- p,
2295
- f,
2296
- l + n - t,
2297
- // Top-right
2298
- d,
2299
- f,
2300
- l + n - t,
2301
- // Back-right
2302
- d,
2303
- f,
2304
- l + n
2305
- // Back-left
2306
- );
2307
- const y = u + 4 + m * 8;
2308
- i.push(
2309
- y,
2310
- y + 1,
2311
- y + 2,
2312
- y,
2313
- y + 2,
2314
- y + 3
2315
- ), i.push(
2316
- y + 4,
2317
- y + 5,
2318
- y + 6,
2319
- y + 4,
2320
- y + 6,
2321
- y + 7
2322
- );
2323
- }
2324
- this.setIndex(i), this.setAttribute("position", new F(r, 3)), this.computeVertexNormals();
2325
- }
2326
- }
2327
- class nn extends E {
2328
- constructor(t = 1, o = 0.4, s = 0.2, a = 20, n = 2, r = Math.PI / 8) {
2329
- super();
2330
- const i = [], c = [];
2331
- let l = 0;
2332
- for (let u = 0; u < a; u++) {
2333
- const m = n * Math.cos(l), h = n * Math.sin(l), f = u * s, p = f + s;
2334
- i.push(
2335
- // Front face (vertical riser)
2336
- m - t / 2 * Math.cos(l),
2337
- f,
2338
- h - t / 2 * Math.sin(l),
2339
- // Bottom-left
2340
- m + t / 2 * Math.cos(l),
2341
- f,
2342
- h + t / 2 * Math.sin(l),
2343
- // Bottom-right
2344
- m + t / 2 * Math.cos(l),
2345
- p,
2346
- h + t / 2 * Math.sin(l),
2347
- // Top-right
2348
- m - t / 2 * Math.cos(l),
2349
- p,
2350
- h - t / 2 * Math.sin(l)
2351
- // Top-left
2352
- ), i.push(
2353
- // Top face (horizontal tread)
2354
- m - t / 2 * Math.cos(l),
2355
- p,
2356
- h - t / 2 * Math.sin(l),
2357
- // Top-left-front
2358
- m + t / 2 * Math.cos(l),
2359
- p,
2360
- h + t / 2 * Math.sin(l),
2361
- // Top-right-front
2362
- m + t / 2 * Math.cos(l) - o * Math.sin(l),
2363
- p,
2364
- h + t / 2 * Math.sin(l) + o * Math.cos(l),
2365
- // Back-right
2366
- m - t / 2 * Math.cos(l) - o * Math.sin(l),
2367
- p,
2368
- h - t / 2 * Math.sin(l) + o * Math.cos(l)
2369
- // Back-left
2370
- );
2371
- const d = u * 8;
2372
- c.push(
2373
- d,
2374
- d + 1,
2375
- d + 2,
2376
- // First triangle for riser
2377
- d,
2378
- d + 2,
2379
- d + 3
2380
- // Second triangle for riser
2381
- ), c.push(
2382
- d + 4,
2383
- d + 5,
2384
- d + 6,
2385
- // First triangle for tread
2386
- d + 4,
2387
- d + 6,
2388
- d + 7
2389
- // Second triangle for tread
2390
- ), l += r;
2391
- }
2392
- this.setIndex(c), this.setAttribute("position", new F(i, 3)), this.computeVertexNormals();
2393
- }
2394
- }
2395
- class sn extends E {
2396
- constructor(t = 2, o = 0.3, s = 0.5, a = 10) {
2397
- super();
2398
- const n = [], r = [];
2399
- for (let i = 0; i < a; i++) {
2400
- const c = i * o, l = c + o, u = i * s, m = u + s;
2401
- n.push(
2402
- // Bottom face of riser (front face)
2403
- -t / 2,
2404
- c,
2405
- u,
2406
- // 0: Bottom-left-front
2407
- t / 2,
2408
- c,
2409
- u,
2410
- // 1: Bottom-right-front
2411
- t / 2,
2412
- l,
2413
- u,
2414
- // 2: Top-right-front
2415
- -t / 2,
2416
- l,
2417
- u,
2418
- // 3: Top-left-front
2419
- // Top face of tread (horizontal step)
2420
- -t / 2,
2421
- l,
2422
- u,
2423
- // 4: Top-left-front (repeated)
2424
- t / 2,
2425
- l,
2426
- u,
2427
- // 5: Top-right-front (repeated)
2428
- t / 2,
2429
- l,
2430
- m,
2431
- // 6: Top-right-back
2432
- -t / 2,
2433
- l,
2434
- m
2435
- // 7: Top-left-back
2436
- );
2437
- const h = i * 8;
2438
- r.push(
2439
- h,
2440
- h + 1,
2441
- h + 2,
2442
- // First triangle for riser
2443
- h,
2444
- h + 2,
2445
- h + 3
2446
- // Second triangle for riser
2447
- ), r.push(
2448
- h + 4,
2449
- h + 6,
2450
- h + 5,
2451
- // First triangle for tread
2452
- h + 4,
2453
- h + 7,
2454
- h + 6
2455
- // Second triangle for tread
2456
- );
2457
- }
2458
- this.setIndex(r), this.setAttribute("position", new F(n, 3)), this.computeVertexNormals();
2459
- }
2460
- }
2461
- class Ce extends E {
2462
- constructor() {
2463
- super();
2464
- const t = [
2465
- new A(0, 0),
2466
- // Bottom of the jar
2467
- new A(1.2, 0),
2468
- // Base
2469
- new A(1.5, 1.5),
2470
- // Mid-body
2471
- new A(1, 3),
2472
- // Narrow neck
2473
- new A(0.6, 3.5),
2474
- // Mouth of the jar
2475
- new A(0.5, 3.5)
2476
- // Cork
2477
- ], o = new q(t, 10), s = new G(0.6, 0.5, 0.3, 10);
2478
- s.translate(0, 3.5, 0), this.copy(T([o, s], !0));
2479
- }
2480
- }
2481
- function At(e, t, o, s, a) {
2482
- const n = (s - t) / (o - e);
2483
- return e + (a - t) / n;
2484
- }
2485
- function Re(e, t, o, s, a) {
2486
- const n = (s - t) / (o - e);
2487
- return t + n * (a - e);
2488
- }
2489
- const rn = {
2490
- calculateXFromSlopeIntercept: At,
2491
- calculateYFromSlopeIntercept: Re
2492
- };
2493
- class Be extends E {
2494
- constructor() {
2495
- super();
2496
- const t = [
2497
- new A(0, 0),
2498
- // Origin
2499
- new A(0.8, 0),
2500
- // Base
2501
- new A(1, 1.5),
2502
- // Rounded body
2503
- new A(0.5, 2.2),
2504
- // Neck
2505
- new A(0.6, 2.5),
2506
- // Mouth
2507
- new A(0.5, 2.5)
2508
- // Cork
2509
- ], o = new q(t, 10), s = new G(0.55, 0.45, 0.2, 10);
2510
- s.translate(0, 2.5, 0);
2511
- const a = [
2512
- new A(0, 0),
2513
- new A(0.8, 0),
2514
- new A(At(0.8, 0, 1, 1.5, 1), 1),
2515
- new A(0, 1)
2516
- ], n = new q(a, 10);
2517
- n.translate(0, 0.1, 0), n.scale(0.9, 0.9, 0.9), this.copy(T([o, s, n], !0));
2518
- }
2519
- }
2520
- class Ne extends E {
2521
- constructor({ radius: t = 0.5, neckRadius: o = 0.2, height: s = 3, neckHeight: a = 1, segments: n = 16 } = {}) {
2522
- super();
2523
- const r = s - a, i = new G(t, t, r, n);
2524
- i.translate(0, r / 2, 0);
2525
- const c = 0.3, l = new G(o, t, c, n);
2526
- l.translate(0, r + c / 2, 0);
2527
- const u = new G(o, o, a, n);
2528
- u.translate(0, r + c + a / 2, 0), this.copy(T([i, l, u], !1));
2529
- }
2530
- }
2531
- class Oe extends E {
2532
- constructor(t = 0.4, o = 1.2, s = 0.2) {
2533
- super();
2534
- const a = o * 0.6, n = new b(t / 2, a, s);
2535
- n.translate(0, a / 2, 0);
2536
- const r = t * 1.5, i = new b(r, t / 4, s);
2537
- i.translate(0, a * 0.75, 0), this.copy(T([n, i], !1)), this.computeVertexNormals();
2538
- }
2539
- }
2540
- class _e extends E {
2541
- constructor() {
2542
- super();
2543
- const t = new b(5, 1, 5);
2544
- t.translate(0, 0.5, 0);
2545
- const o = new b(4, 3, 4);
2546
- o.translate(0, 2.5, 0);
2547
- const s = [
2548
- [-1.8, 2.3, -2.2],
2549
- [1.8, 2.3, -2.2],
2550
- [-1.8, 2.3, 2.2],
2551
- [1.8, 2.3, 2.2]
2552
- ], a = [];
2553
- s.forEach((l) => {
2554
- const u = new G(0.2, 0.2, 3.5, 16);
2555
- u.translate(l[0], l[1], l[2]), a.push(u);
2556
- });
2557
- const n = new J(3.5, 2, 4);
2558
- n.rotateY(Math.PI / 4), n.translate(0, 5, 0);
2559
- const r = new Z();
2560
- r.moveTo(-1, 0), r.lineTo(-1, 2), r.absarc(0, 2, 1, Math.PI, 0, !0), r.lineTo(1, 0);
2561
- const i = {
2562
- depth: 0.5,
2563
- bevelEnabled: !1
2564
- }, c = new j(r, i);
2565
- c.translate(0, 0.5, 1.7), c.setIndex([...Array(c.attributes.position.count).keys()]), this.copy(
2566
- T(
2567
- [
2568
- t,
2569
- T([o, ...a], !1),
2570
- n,
2571
- c
2572
- ],
2573
- !0
2574
- )
2575
- ), this.computeVertexNormals();
2576
- }
2577
- }
2578
- class Ue extends E {
2579
- constructor(t = 1.75, o = 0.75) {
2580
- super();
2581
- const s = t * 0.05, a = t * 0.15, n = t * 0.15, r = t * 0.75;
2582
- let i = 0;
2583
- const c = new b(o, s, o);
2584
- c.translate(0, i + s / 2, 0), i += s;
2585
- const l = new b(o * 0.8, a, o * 0.8);
2586
- l.translate(0, i + a / 2, 0), i += a;
2587
- const u = new b(o * 0.6, n, o * 0.6);
2588
- u.translate(0, i + n / 2, 0), i += n;
2589
- const m = new b(o * 0.4, r, o * 0.4);
2590
- m.translate(0, i + r / 2, 0), i += r;
2591
- const h = new J(o * 0.4 / Math.sqrt(2), 0.1, 4, 1, !1, Math.PI / 4);
2592
- h.translate(0, i + 0.1 / 2, 0), this.copy(T([c, l, u, m, h], !1)), this.computeVertexNormals();
2593
- }
2594
- }
2595
- class ze extends E {
2596
- constructor(t = 0.6, o = 1, s = 0.2, a = 0.6) {
2597
- super();
2598
- const n = o - a / 2, r = new b(t, n, s);
2599
- r.translate(0, n / 2, 0);
2600
- const i = new G(a / 2, a / 2, s, 16, 1, !1, 0, Math.PI);
2601
- i.rotateY(Math.PI / 2), i.rotateX(Math.PI / 2), i.translate(0, n, 0), this.copy(T([r, i], !1)), this.computeVertexNormals();
2602
- }
2603
- }
2604
- class Fe extends E {
2605
- constructor(t = 0.5, o = 0.8, s = 0.15) {
2606
- super();
2607
- const a = new b(t, o, s);
2608
- a.translate(0, o / 2, 0), this.copy(a);
2609
- }
2610
- }
2611
- class Le extends E {
2612
- constructor({ height: t = 2.25 } = {}) {
2613
- super();
2614
- const o = new b(1.2, 0.5, 1.2);
2615
- o.translate(0, 0.25, 0);
2616
- const s = new b(1, t, 1);
2617
- s.translate(0, 0.5 + t / 2, 0);
2618
- const a = new b(1.4, 0.3, 1.4);
2619
- a.translate(0, 0.5 + t + 0.15, 0), this.copy(T([o, s, a], !1));
2620
- }
2621
- }
2622
- class It extends E {
2623
- constructor({
2624
- barHeight: t = 2,
2625
- //
2626
- barRadius: o = 0.05,
2627
- spikeHeight: s = 0.3,
2628
- spikeRadius: a = 0.075,
2629
- spikeScaleZ: n = 1,
2630
- radialSegments: r = 8
2631
- } = {}) {
2632
- super();
2633
- const i = new G(o, o, t, r);
2634
- i.translate(0, t / 2, 0);
2635
- const c = new J(a, s, r);
2636
- c.translate(0, t + s / 2, 0), c.scale(1, 1, n), this.copy(T([i, c], !1));
2637
- }
2638
- }
2639
- class De extends E {
2640
- constructor({
2641
- count: t = 20,
2642
- //
2643
- spacing: o = 0.4,
2644
- barHeight: s = 2,
2645
- barRadius: a = 0.05,
2646
- spikeHeight: n = 0.3,
2647
- spikeRadius: r = 0.075,
2648
- spikeScaleZ: i = 1,
2649
- railHeight: c = 0.1,
2650
- railDepth: l = 0.05,
2651
- railOffset: u = 0,
2652
- radialSegments: m = 8
2653
- } = {}) {
2654
- super();
2655
- const h = [], f = new It({ barHeight: s, barRadius: a, spikeHeight: n, spikeRadius: r, spikeScaleZ: i, radialSegments: m }), p = new b(t * o, c, l);
2656
- for (let g = 0; g < t; g++) {
2657
- const v = f.clone();
2658
- v.translate(g * o, 0, 0), h.push(v);
2659
- }
2660
- const d = p.clone();
2661
- d.translate(o * (t - 1) / 2, s - u - c / 2, 0), h.push(d);
2662
- const y = p.clone();
2663
- y.translate(o * (t - 1) / 2, c / 2, 0), h.push(y), this.copy(T(h));
2664
- }
2665
- }
2666
- class ke extends E {
2667
- constructor({
2668
- width: t = 5,
2669
- //
2670
- height: o = 8,
2671
- depth: s = 1,
2672
- shelves: a = 4,
2673
- frameThickness: n = 0.1,
2674
- open: r = !1
2675
- } = {}) {
2676
- super();
2677
- const i = o, c = t, l = s, u = new b(n, i, l), m = new b(c - 2 * n, n, l), h = u.clone();
2678
- h.translate(-c / 2 + n / 2, i / 2, 0);
2679
- const f = u.clone();
2680
- f.translate(c / 2 - n / 2, i / 2, 0);
2681
- const p = m.clone();
2682
- p.translate(0, i - n / 2, 0);
2683
- const d = m.clone();
2684
- d.translate(0, n / 2, 0);
2685
- const y = new b(c, i, n);
2686
- y.translate(0, i / 2, -l / 2 + n / 2);
2687
- const g = [], v = (i - n) / (a + 1);
2688
- for (let C = 1; C <= a; C++) {
2689
- const S = m.clone();
2690
- S.translate(0, n / 2 + C * v, 0), g.push(S);
2691
- }
2692
- this.copy(T([
2693
- h,
2694
- //
2695
- f,
2696
- p,
2697
- d,
2698
- ...r ? [] : [y],
2699
- ...g
2700
- ], !1));
2701
- }
2702
- }
2703
- class Ve extends E {
2704
- constructor() {
2705
- super();
2706
- const t = new b(5, 0.3, 3);
2707
- t.translate(0, 3.15, 0);
2708
- const o = [
2709
- new A(0.2, 0),
2710
- //
2711
- new A(0.25, 0.5),
2712
- new A(0.15, 1.5),
2713
- new A(0.3, 3)
2714
- ], s = new q(o, 32), n = T(
2715
- [
2716
- [2.1, 0, 1.1],
2717
- [-2.1, 0, 1.1],
2718
- [2.1, 0, -1.1],
2719
- [-2.1, 0, -1.1]
2720
- ].map((r) => {
2721
- const i = s.clone();
2722
- return i.translate(r[0], r[1], r[2]), i;
2723
- })
2724
- );
2725
- this.copy(T([t, n], !0));
2726
- }
2727
- }
2728
- class Et extends Pe {
2729
- constructor({ height: t = 0.25, radius: o = 0.05, segmentsU: s = 16, segmentsV: a = 16 } = {}) {
2730
- super(
2731
- (n, r, i) => {
2732
- const c = n * Math.PI * 2, l = Math.sin(r * Math.PI), u = o * l * Math.cos(c), m = r * t, h = o * l * Math.sin(c);
2733
- i.set(u, m, -h);
2734
- },
2735
- s,
2736
- a
2737
- );
2738
- }
2739
- }
2740
- class qe extends E {
2741
- constructor({
2742
- radiusTop: t = 0.2,
2743
- //
2744
- radiusBottom: o = 0.2,
2745
- height: s = 1,
2746
- flameHeight: a = 0.25,
2747
- flameRadius: n = 0.05,
2748
- segments: r = 16
2749
- } = {}) {
2750
- super();
2751
- const i = new G(t, o, s, r);
2752
- i.translate(0, s / 2, 0);
2753
- const c = new Et({
2754
- segmentsU: r,
2755
- segmentsV: r,
2756
- height: a,
2757
- radius: n
2758
- });
2759
- c.translate(0, s, 0), this.copy(T([i, c], !0));
2760
- }
2761
- }
2762
- class an extends E {
2763
- constructor(t = 1, o = 2, s = 0.5, a = Math.PI / 4) {
2764
- super();
2765
- const n = o * Math.tan(a), r = t, i = o, c = s, l = [
2766
- 0,
2767
- 0,
2768
- 0,
2769
- // Front face, bottom left
2770
- r,
2771
- 0,
2772
- 0,
2773
- // Front face, bottom right
2774
- r + n,
2775
- i,
2776
- 0,
2777
- // Front face, top right
2778
- n,
2779
- i,
2780
- 0,
2781
- // Front face, top left
2782
- r,
2783
- 0,
2784
- -c,
2785
- // Back face
2786
- 0,
2787
- 0,
2788
- -c,
2789
- n,
2790
- i,
2791
- -c,
2792
- r + n,
2793
- i,
2794
- -c,
2795
- 0,
2796
- 0,
2797
- -c,
2798
- // Left face
2799
- 0,
2800
- 0,
2801
- 0,
2802
- n,
2803
- i,
2804
- 0,
2805
- n,
2806
- i,
2807
- -c,
2808
- r,
2809
- 0,
2810
- 0,
2811
- // Right face
2812
- r,
2813
- 0,
2814
- -c,
2815
- r + n,
2816
- i,
2817
- -c,
2818
- r + n,
2819
- i,
2820
- 0,
2821
- n,
2822
- i,
2823
- 0,
2824
- // Top face
2825
- r + n,
2826
- i,
2827
- 0,
2828
- r + n,
2829
- i,
2830
- -c,
2831
- n,
2832
- i,
2833
- -c,
2834
- 0,
2835
- 0,
2836
- -c,
2837
- // Bottom
2838
- r,
2839
- 0,
2840
- -c,
2841
- r,
2842
- 0,
2843
- 0,
2844
- 0,
2845
- 0,
2846
- 0
2847
- ], u = [
2848
- 0,
2849
- 0,
2850
- 1,
2851
- 0,
2852
- 0,
2853
- 1,
2854
- 0,
2855
- 0,
2856
- 1,
2857
- 0,
2858
- 0,
2859
- 1,
2860
- // Front face
2861
- 0,
2862
- 0,
2863
- -1,
2864
- 0,
2865
- 0,
2866
- -1,
2867
- 0,
2868
- 0,
2869
- -1,
2870
- 0,
2871
- 0,
2872
- -1,
2873
- // Back face
2874
- -1,
2875
- 0,
2876
- 0,
2877
- -1,
2878
- 0,
2879
- 0,
2880
- -1,
2881
- 0,
2882
- 0,
2883
- -1,
2884
- 0,
2885
- 0,
2886
- // Left face
2887
- 1,
2888
- 0,
2889
- 0,
2890
- 1,
2891
- 0,
2892
- 0,
2893
- 1,
2894
- 0,
2895
- 0,
2896
- 1,
2897
- 0,
2898
- 0,
2899
- // Right face
2900
- 0,
2901
- 1,
2902
- 0,
2903
- 0,
2904
- 1,
2905
- 0,
2906
- 0,
2907
- 1,
2908
- 0,
2909
- 0,
2910
- 1,
2911
- 0,
2912
- // Top face
2913
- 0,
2914
- -1,
2915
- 0,
2916
- 0,
2917
- -1,
2918
- 0,
2919
- 0,
2920
- -1,
2921
- 0,
2922
- 0,
2923
- -1,
2924
- 0
2925
- // Bottom face
2926
- ], m = [
2927
- 0,
2928
- 1,
2929
- 2,
2930
- 2,
2931
- 3,
2932
- 0,
2933
- // Front face
2934
- 4,
2935
- 5,
2936
- 6,
2937
- 6,
2938
- 7,
2939
- 4,
2940
- // Back face
2941
- 8,
2942
- 9,
2943
- 10,
2944
- 10,
2945
- 11,
2946
- 8,
2947
- // Left face
2948
- 12,
2949
- 13,
2950
- 14,
2951
- 14,
2952
- 15,
2953
- 12,
2954
- // Right face
2955
- 16,
2956
- 17,
2957
- 18,
2958
- 18,
2959
- 19,
2960
- 16,
2961
- // Top face
2962
- 20,
2963
- 21,
2964
- 22,
2965
- 22,
2966
- 23,
2967
- 20
2968
- // Bottom face
2969
- ], h = new Float32Array([
2970
- 0,
2971
- 0,
2972
- 1,
2973
- 0,
2974
- 1,
2975
- 1,
2976
- 0,
2977
- 1,
2978
- // Front face
2979
- 0,
2980
- 0,
2981
- 1,
2982
- 0,
2983
- 1,
2984
- 1,
2985
- 0,
2986
- 1,
2987
- // Back face
2988
- 0,
2989
- 0,
2990
- 1,
2991
- 0,
2992
- 1,
2993
- 1,
2994
- 0,
2995
- 1,
2996
- // Left face
2997
- 0,
2998
- 0,
2999
- 1,
3000
- 0,
3001
- 1,
3002
- 1,
3003
- 0,
3004
- 1,
3005
- // Right face
3006
- 0,
3007
- 0,
3008
- 1,
3009
- 0,
3010
- 1,
3011
- 1,
3012
- 0,
3013
- 1,
3014
- // Top face
3015
- 0,
3016
- 0,
3017
- 1,
3018
- 0,
3019
- 1,
3020
- 1,
3021
- 0,
3022
- 1
3023
- // Bottom face
3024
- ]), f = new Float32Array(l), p = new Float32Array(u), d = new Float32Array(h), y = new Uint16Array(m);
3025
- this.setAttribute("position", new _(f, 3)), this.setAttribute("normal", new _(p, 3)), this.setAttribute("uv", new _(d, 2)), this.setIndex(new _(y, 1)), this.center();
3026
- }
3027
- }
3028
- class Ye extends E {
3029
- constructor() {
3030
- super();
3031
- const t = [], o = [];
3032
- for (let s = 0; s < 5; s++) {
3033
- const a = 0.8 + Math.random() * 0.4, n = 0.8 + Math.random() * 0.4, r = 0.8 + Math.random() * 0.4, i = Math.random() * Math.PI, c = Math.random() * Math.PI, l = Math.random() * Math.PI, u = (Math.random() - 0.5) * 4, m = 0, h = (Math.random() - 0.5) * 4, f = new et(1, 0);
3034
- f.scale(a, n, r), f.rotateX(i), f.rotateY(c), f.rotateZ(l), f.translate(u, m, h), t.push(f);
3035
- const p = new et(1, 0);
3036
- p.scale(a * 0.9, n * 0.5, r * 0.9), p.rotateX(i), p.rotateY(c), p.rotateZ(l), p.translate(u, m + 0.3, h), o.push(p);
3037
- }
3038
- this.copy(
3039
- T([
3040
- T(t),
3041
- T(o)
3042
- ], !0)
3043
- );
3044
- }
3045
- }
3046
- function He(e, t = ft.XYZ, o = 0.5, s = 2) {
3047
- e.deleteAttribute("uv"), e.deleteAttribute("normal"), e = Se(e), e.computeVertexNormals();
3048
- const a = e.getAttribute("position");
3049
- for (let n = 0; n < a.count; n++) {
3050
- const r = new M().fromBufferAttribute(a, n), i = Math.random() * (s - o) + o, c = t.clone().multiplyScalar(i);
3051
- r.add(c), a.setXYZ(n, r.x, r.y, r.z);
3052
- }
3053
- return a.needsUpdate = !0, e.computeVertexNormals(), e;
3054
- }
3055
- class Xe extends E {
3056
- constructor(t = 1, o = 4, s = 4) {
3057
- super();
3058
- const a = new z(t, o, s);
3059
- this.copy(He(a, ft.XYZ, 0.5, 1)), this.computeVertexNormals(), this.center();
3060
- }
3061
- }
3062
- class Ze extends E {
3063
- constructor() {
3064
- super();
3065
- const t = [];
3066
- for (let o = 0; o < 5; o++) {
3067
- const s = new et(1, 0);
3068
- s.scale(0.8 + Math.random() * 0.4, 0.8 + Math.random() * 0.4, 0.8 + Math.random() * 0.4), s.rotateX(Math.random() * Math.PI), s.rotateY(Math.random() * Math.PI), s.rotateZ(Math.random() * Math.PI), s.translate((Math.random() - 0.5) * 4, 0, (Math.random() - 0.5) * 4), t.push(s);
3069
- }
3070
- this.copy(T(t));
3071
- }
3072
- }
3073
- class je extends E {
3074
- constructor(t = 0.1, o = 0.1, s = 0.4, a = 8) {
3075
- super();
3076
- const n = new G(t * 0.6, o * 0.6, s, a);
3077
- n.translate(0, 0, 0);
3078
- const r = new z(t, a, a), i = r.clone(), c = r.clone(), l = r.clone(), u = r.clone();
3079
- i.translate(0, s / 2 + t * 0.6, -t * 0.6), c.translate(0, s / 2 + t * 0.6, t * 0.6), l.translate(0, -s / 2 - o * 0.6, -o * 0.6), u.translate(0, -s / 2 - o * 0.6, o * 0.6), this.copy(T([n, i, c, l, u], !1));
3080
- }
3081
- }
3082
- class Qe extends E {
3083
- constructor({
3084
- flaskRadius: t = 1,
3085
- //
3086
- neckRadius: o = 0.3,
3087
- height: s = 2.5,
3088
- neckHeight: a = 1,
3089
- radialSegments: n = 16
3090
- } = {}) {
3091
- super();
3092
- const r = [
3093
- new A(0, 0),
3094
- // Bottom of the flask
3095
- new A(t * 0.875, 0),
3096
- // Flat base with minimum width
3097
- new A(t, 0.1),
3098
- // End of the rounded base
3099
- new A(o, s),
3100
- // Start of the straight neck
3101
- new A(o, s + a),
3102
- // End of the straight neck
3103
- new A(o * 1.1, s + a + 0.3)
3104
- // Slight outward lip at the top
3105
- ], i = new q(r, n);
3106
- this.copy(T([i], !1));
3107
- }
3108
- }
3109
- const cn = (e, t) => e / (1 - Math.cos(t)), bt = (e, t) => e / (2 * Math.sin(t)), Ke = (e, t) => e * (1 - Math.cos(t)), ln = (e, t) => 2 * e * Math.sin(t), yt = (e, t) => {
3110
- const o = 2 * t;
3111
- return Math.asin(o / (2 * e));
3112
- }, un = (e, t, o) => ({
3113
- x: e * Math.sin(o) * Math.cos(t),
3114
- y: e * Math.sin(o) * Math.sin(t),
3115
- z: e * Math.cos(o)
3116
- }), mn = (e, t, o) => {
3117
- const s = Math.sqrt(e * e + t * t + o * o), a = Math.atan2(t, e), n = Math.acos(o / s);
3118
- return { radius: s, theta: a, phi: n };
3119
- };
3120
- function $e(e, t, o, s = 0, a = 0, n = 32) {
3121
- const r = s ? yt(e, s) : 0, i = a ? Math.PI - yt(e, a) : Math.PI, c = [];
3122
- for (let l = 0; l <= n; l++) {
3123
- const u = i - (i - r) / n * l, m = e * Math.sin(u), h = t * Math.cos(u) + o;
3124
- c.push(new A(m, h));
3125
- }
3126
- return [...c];
3127
- }
3128
- class Je extends E {
3129
- constructor() {
3130
- super();
3131
- const t = [
3132
- ...$e(1, 1, 0.5, 0.2, 0, 32),
3133
- new A(0.2, 3)
3134
- ], o = new q(t, 32);
3135
- this.copy(o);
3136
- }
3137
- }
3138
- class We extends E {
3139
- constructor() {
3140
- super();
3141
- const t = [
3142
- new A(1, 0),
3143
- // Bottom of the bowl
3144
- new A(1.2, 0.5),
3145
- // Slight flare at the base
3146
- new A(1.4, 1.5),
3147
- // Outer wall
3148
- new A(1.3, 1.8),
3149
- // Flared edge
3150
- new A(0.8, 1.8)
3151
- // Lip of the bowl
3152
- ], o = new q(t, 12), s = new Rt(1, 12);
3153
- s.rotateX(-Math.PI / 2), s.translate(0, 0, 0), this.copy(T([o, s], !1));
3154
- }
3155
- }
3156
- class to extends E {
3157
- constructor({
3158
- radius: t = 0.3,
3159
- //
3160
- height: o = 0.4,
3161
- count: s = 3,
3162
- thickness: a = 0.03,
3163
- radialSegments: n = 16
3164
- } = {}) {
3165
- super();
3166
- const r = new Mt(t, a, 8, n);
3167
- r.rotateX(Math.PI / 2), r.translate(0, o, 0);
3168
- const i = new G(a * 0.6, a * 0.6, o, n), c = [];
3169
- for (let l = 0; l < s; l++) {
3170
- const u = l / s * Math.PI * 2, m = i.clone();
3171
- m.translate(Math.cos(u) * t, o / 2, Math.sin(u) * t), c.push(m);
3172
- }
3173
- this.copy(T([r, ...c], !1));
3174
- }
3175
- }
3176
- class eo extends E {
3177
- constructor() {
3178
- super();
3179
- const t = new G(0.5, 0.6, 0.3, 16);
3180
- t.translate(0, 0.15, 0);
3181
- const o = new G(0.15, 0.15, 2, 12, 1, !0);
3182
- o.translate(0, 1.3, 0);
3183
- const s = new z(0.3, 16, 16);
3184
- s.translate(0, 2.4, 0), this.copy(
3185
- T(
3186
- [t, T([o, s])],
3187
- !0
3188
- )
3189
- );
3190
- }
3191
- }
3192
- class ut extends E {
3193
- constructor(t = 0.2, o = 0.2, s = 3, a = 32, n = !0) {
3194
- super();
3195
- const r = new G(t, o, s, a, 1, n), i = new z(o, a, a / 2, 0, Math.PI * 2, Math.PI / 2, Math.PI / 2);
3196
- i.translate(0, -(s / 2), 0), this.copy(T([r, i], !1));
3197
- }
3198
- }
3199
- class oo extends E {
3200
- constructor({
3201
- radius: t = 3,
3202
- //
3203
- height: o = 0.6,
3204
- widthSegments: s = 64,
3205
- heightSegments: a = 16,
3206
- phiStart: n = 0,
3207
- phiLength: r = Math.PI * 2
3208
- } = {}) {
3209
- super(), this.copy(new z(t, s, a, n, r, 0, Math.PI / 2)), this.scale(1, o / t, 1);
3210
- }
3211
- }
3212
- class no extends E {
3213
- constructor({
3214
- radius: t = bt(5, Math.PI / 10),
3215
- //
3216
- widthSegments: o = 64,
3217
- heightSegments: s = 32,
3218
- phiStart: a = 0,
3219
- phiLength: n = Math.PI * 2,
3220
- thetaLength: r = Math.PI / 10
3221
- } = {}) {
3222
- super(), this.copy(new z(t, o, s, a, n, 0, r));
3223
- const i = Ke(t, r);
3224
- this.translate(0, -t + i, 0);
3225
- }
3226
- }
3227
- class so extends E {
3228
- constructor({
3229
- trunkRadiusTop: t = 0.25,
3230
- trunkRadiusBottom: o = 0.4,
3231
- trunkHeight: s = 2.5,
3232
- trunkSegments: a = 14,
3233
- leafSize: n = 0.8,
3234
- leafCount: r = 6,
3235
- leafDetail: i = 0,
3236
- leafSpreadRadius: c = 1.5
3237
- } = {}) {
3238
- super();
3239
- const l = new G(t, o, s, a);
3240
- l.translate(0, s / 2, 0);
3241
- const u = [];
3242
- for (let m = 0; m < r; m++) {
3243
- const h = new et(n, i);
3244
- h.translate(
3245
- (Math.random() - 0.5) * c,
3246
- (Math.random() - 0.5) * n + s,
3247
- (Math.random() - 0.5) * c
3248
- ), u.push(h);
3249
- }
3250
- this.copy(T([l.toNonIndexed(), T(u, !1)], !0)), this.computeVertexNormals();
3251
- }
3252
- }
3253
- class hn extends x {
3254
- constructor({
3255
- width: t = 5,
3256
- height: o = 3,
3257
- depth: s = 5,
3258
- wallThickness: a = 0.05,
3259
- interiorColor: n = H.WHITE_SMOKE,
3260
- floorColor: r = H.RAW_SIENNA,
3261
- exteriorColor: i = H.GRAY
3262
- } = {}) {
3263
- super(
3264
- new Ge({ width: t, height: o, depth: s, wallThickness: a }),
3265
- [
3266
- new w({ color: n }),
3267
- new w({ color: r }),
3268
- new w({ color: i })
3269
- ]
3270
- );
3271
- }
3272
- }
3273
- const ro = {
3274
- uniforms: {
3275
- time: { value: 0 }
3276
- },
3277
- vertexShader: `
3278
- varying vec3 vNormal;
3279
- varying vec3 vPosition;
3280
- void main() {
3281
- vNormal = normalize(normal);
3282
- vPosition = position;
3283
- gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
3284
- }
3285
- `,
3286
- fragmentShader: `
3287
- varying vec3 vNormal;
3288
- varying vec3 vPosition;
3289
-
3290
- // Simple 3D noise function
3291
- float hash(vec3 p) {
3292
- p = fract(p * 0.3183099 + vec3(0.71, 0.113, 0.419));
3293
- p *= 17.0;
3294
- return fract(p.x * p.y * p.z * (p.x + p.y + p.z));
3295
- }
3296
-
3297
- float noise(vec3 p) {
3298
- vec3 ip = floor(p);
3299
- vec3 fp = fract(p);
3300
- fp = fp * fp * (3.0 - 2.0 * fp); // Smoothstep
3301
- return mix(
3302
- mix(mix(hash(ip), hash(ip + vec3(1.0, 0.0, 0.0)), fp.x),
3303
- mix(hash(ip + vec3(0.0, 1.0, 0.0)), hash(ip + vec3(1.0, 1.0, 0.0)), fp.x), fp.y),
3304
- mix(mix(hash(ip + vec3(0.0, 0.0, 1.0)), hash(ip + vec3(1.0, 0.0, 1.0)), fp.x),
3305
- mix(hash(ip + vec3(0.0, 1.0, 1.0)), hash(ip + vec3(1.0, 1.0, 1.0)), fp.x), fp.y),
3306
- fp.z);
3307
- }
3308
-
3309
- void main() {
3310
- vec3 color = vec3(0.8, 0.8, 0.7); // Base moon color
3311
- float n = noise(vPosition * 0.5); // Apply noise with frequency
3312
- color *= 0.8 + 0.2 * n; // Modulate color by noise
3313
- gl_FragColor = vec4(color, 1.0);
3314
- }
3315
- `
3316
- };
3317
- class fn extends x {
3318
- constructor() {
3319
- super(
3320
- new z(5, 32, 32),
3321
- new st(ro)
3322
- );
3323
- }
3324
- }
3325
- class pn extends x {
3326
- constructor({
3327
- width: t = 1,
3328
- height: o = 1.5,
3329
- depth: s = 0.5,
3330
- coverThickness: a = 0.05,
3331
- pageIndent: n = 0.05,
3332
- coverColor: r = H.DARK_RED,
3333
- pageColor: i = H.TITANIUM_WHITE
3334
- } = {}) {
3335
- super(
3336
- new xt(t, o, s, a, n),
3337
- [
3338
- new w({ color: r, metalness: 0.1, roughness: 0.7, flatShading: !0 }),
3339
- new w({ color: i, flatShading: !0 })
3340
- ]
3341
- );
3342
- }
3343
- }
3344
- class dn extends x {
3345
- constructor() {
3346
- super(new Ce(), [
3347
- new w({
3348
- color: 8965290,
3349
- transparent: !0,
3350
- depthWrite: !1,
3351
- opacity: 0.4,
3352
- roughness: 0.1,
3353
- metalness: 0.5
3354
- }),
3355
- new w({
3356
- color: 9127187,
3357
- roughness: 1
3358
- })
3359
- ]);
3360
- }
3361
- }
3362
- class yn extends x {
3363
- constructor() {
3364
- super(new Be(), [
3365
- new w({
3366
- color: 8965375,
3367
- transparent: !0,
3368
- depthWrite: !1,
3369
- opacity: 0.5,
3370
- roughness: 0.1,
3371
- metalness: 0.3
3372
- }),
3373
- new w({
3374
- color: 9127187,
3375
- roughness: 1
3376
- }),
3377
- new w({
3378
- color: H.PINK_SHERBET,
3379
- transparent: !0,
3380
- depthWrite: !1,
3381
- opacity: 0.5
3382
- })
3383
- ]);
3384
- }
3385
- }
3386
- class wn extends x {
3387
- constructor() {
3388
- super(
3389
- new Ne(),
3390
- new rt({
3391
- color: 5597999,
3392
- roughness: 0.1,
3393
- transmission: 0.9,
3394
- thickness: 0.2,
3395
- metalness: 0,
3396
- clearcoat: 1,
3397
- clearcoatRoughness: 0.1
3398
- })
3399
- );
3400
- }
3401
- }
3402
- class Mn extends x {
3403
- constructor({
3404
- width: t = 0.4,
3405
- height: o = 1.2,
3406
- depth: s = 0.2
3407
- } = {}) {
3408
- super(
3409
- new Oe(t, o, s),
3410
- new w({ color: 7829367, roughness: 0.8 })
3411
- );
3412
- }
3413
- }
3414
- class xn extends x {
3415
- constructor() {
3416
- super(
3417
- new _e(),
3418
- [
3419
- new w({ color: 8421504, flatShading: !0 }),
3420
- // Base
3421
- new w({ color: 6908265, flatShading: !0 }),
3422
- // Building
3423
- new w({ color: 5263440, flatShading: !0 }),
3424
- // Roof
3425
- new w({ color: 4210752, flatShading: !0 })
3426
- // Arched entrance
3427
- ]
3428
- );
3429
- }
3430
- }
3431
- class vn extends x {
3432
- constructor({ totalHeight: t = 1.75, baseWidth: o = 0.75 } = {}) {
3433
- super(
3434
- new Ue(t, o),
3435
- new w({ color: 7829367, roughness: 0.8 })
3436
- );
3437
- }
3438
- }
3439
- class gn extends x {
3440
- constructor(t = 0.6, o = 1, s = 0.2, a = 0.6) {
3441
- super(
3442
- new ze(t, o, s, a),
3443
- new w({ color: 7829367, roughness: 0.8 })
3444
- );
3445
- }
3446
- }
3447
- class An extends x {
3448
- constructor(t = 0.5, o = 0.8, s = 0.15) {
3449
- super(
3450
- new Fe(t, o, s),
3451
- new w({ color: 7829367, roughness: 0.8 })
3452
- );
3453
- }
3454
- }
3455
- class In extends x {
3456
- constructor({ height: t = 2.25 } = {}) {
3457
- super(
3458
- new Le({ height: t }),
3459
- new w({ color: 9141627, flatShading: !0 })
3460
- );
3461
- }
3462
- }
3463
- class En extends x {
3464
- constructor({
3465
- barHeight: t = 2,
3466
- //
3467
- barRadius: o = 0.05,
3468
- spikeHeight: s = 0.3,
3469
- spikeRadius: a = 0.075,
3470
- spikeScaleZ: n = 1,
3471
- radialSegments: r = 8
3472
- } = {}) {
3473
- super(
3474
- new It({
3475
- barHeight: t,
3476
- barRadius: o,
3477
- spikeHeight: s,
3478
- spikeRadius: a,
3479
- spikeScaleZ: n,
3480
- radialSegments: r
3481
- }),
3482
- new w({ color: 3355443, metalness: 0.8, roughness: 0.4 })
3483
- );
3484
- }
3485
- }
3486
- class bn extends x {
3487
- constructor({
3488
- count: t = 20,
3489
- //
3490
- spacing: o = 0.4,
3491
- barHeight: s = 2,
3492
- barRadius: a = 0.05,
3493
- spikeHeight: n = 0.3,
3494
- spikeRadius: r = 0.075,
3495
- spikeScaleZ: i = 1,
3496
- railHeight: c = 0.1,
3497
- railDepth: l = 0.05,
3498
- railOffset: u = 0,
3499
- radialSegments: m = 8
3500
- } = {}) {
3501
- super(
3502
- new De({
3503
- count: t,
3504
- spacing: o,
3505
- barHeight: s,
3506
- barRadius: a,
3507
- spikeHeight: n,
3508
- spikeRadius: r,
3509
- spikeScaleZ: i,
3510
- railHeight: c,
3511
- railDepth: l,
3512
- railOffset: u,
3513
- radialSegments: m
3514
- }),
3515
- new w({ color: 3355443, metalness: 0.8, roughness: 0.4 })
3516
- );
3517
- }
3518
- }
3519
- class Tn extends x {
3520
- constructor({
3521
- width: t = 5,
3522
- //
3523
- height: o = 8,
3524
- depth: s = 1,
3525
- shelves: a = 4,
3526
- frameThickness: n = 0.1,
3527
- open: r = !1
3528
- } = {}) {
3529
- super(
3530
- new ke({ width: t, height: o, depth: s, shelves: a, frameThickness: n, open: r }),
3531
- new w({ color: 9127187 })
3532
- );
3533
- }
3534
- }
3535
- class Sn extends x {
3536
- constructor() {
3537
- super(new Ve(), [
3538
- new w({ color: 9132587 }),
3539
- // Desk surface
3540
- new w({ color: 4929057 })
3541
- // Desk legs
3542
- ]);
3543
- }
3544
- }
3545
- class Pn extends x {
3546
- constructor({
3547
- radiusTop: t = 0.2,
3548
- //
3549
- radiusBottom: o = 0.2,
3550
- height: s = 1,
3551
- flameHeight: a = 0.25,
3552
- flameRadius: n = 0.05,
3553
- segments: r = 16
3554
- } = {}) {
3555
- super(
3556
- new qe({
3557
- radiusTop: t,
3558
- radiusBottom: o,
3559
- height: s,
3560
- flameHeight: a,
3561
- flameRadius: n,
3562
- segments: r
3563
- }),
3564
- [
3565
- new w({ color: 16777215 }),
3566
- new w({ color: 16766720, emissive: 16753920, emissiveIntensity: 0.35 })
3567
- ]
3568
- );
3569
- }
3570
- }
3571
- class Gn extends x {
3572
- constructor({ height: t = 0.25, radius: o = 0.05, segmentsU: s = 16, segmentsV: a = 16 } = {}) {
3573
- super(
3574
- new Et({ segmentsU: s, segmentsV: a, height: t, radius: o }),
3575
- new w({ color: 16766720, emissive: 16753920, emissiveIntensity: 0.35 })
3576
- );
3577
- }
3578
- }
3579
- class Cn extends k {
3580
- constructor(t = 1.3, o = 0.5) {
3581
- super();
3582
- const s = new G(o, o, 0.2, 16), a = new w({ color: 9127187, flatShading: !0 }), n = new x(s, a);
3583
- n.position.set(0, 0, 0), this.add(n);
3584
- const r = new G(o * 0.9, o * 0.9, t), i = new w({ color: 16766720, flatShading: !0, transparent: !0, opacity: 0.6 }), c = new x(r, i);
3585
- c.position.set(0, t / 2 + 0.1, 0), this.add(c);
3586
- const l = new J(o * 1.1, 0.5, 8), u = new w({ color: 9127187, flatShading: !0 }), m = new x(l, u);
3587
- m.position.set(0, t + 0.35, 0), this.add(m);
3588
- const h = new Mt(o * 0.8, 0.05, 8, 16), f = new w({ color: 9127187, flatShading: !0 }), p = new x(h, f);
3589
- p.position.set(0, t + 0.85, 0), this.add(p);
3590
- const d = new Bt(16755200, 1.5, 15);
3591
- d.position.set(0, t / 2 + 0.1, 0), d.castShadow = !0, this.add(d);
3592
- }
3593
- }
3594
- class Rn extends x {
3595
- constructor() {
3596
- super(new Ye(), [
3597
- new w({ color: 8421504, flatShading: !0 }),
3598
- new w({ color: 4950843, flatShading: !0, opacity: 0.8, transparent: !0 })
3599
- ]);
3600
- }
3601
- }
3602
- class Bn extends x {
3603
- constructor(t = 1, o = 4, s = 4) {
3604
- super(
3605
- new Xe(t, o, s),
3606
- new w({ color: 8421504, flatShading: !0 })
3607
- );
3608
- }
3609
- }
3610
- class Nn extends x {
3611
- constructor() {
3612
- super(new Ze(), new w({ color: 8421504, flatShading: !0 }));
3613
- }
3614
- }
3615
- class On extends k {
3616
- constructor() {
3617
- super();
3618
- const t = new G(0.3, 0.4, 0.1, 16), o = new w({
3619
- color: 3355443,
3620
- roughness: 0.6,
3621
- metalness: 0.3
3622
- }), s = new x(t, o);
3623
- s.position.y = 0.05;
3624
- const a = new G(0.1, 0.1, 0.7, 16), n = new w({
3625
- color: 5592405,
3626
- roughness: 0.5,
3627
- metalness: 0.4
3628
- }), r = new x(a, n);
3629
- r.position.y = 0.4;
3630
- const i = new J(0.075, 0.2, 16), c = new w({
3631
- color: 16733440,
3632
- emissive: 16733440,
3633
- emissiveIntensity: 0.6,
3634
- transparent: !0,
3635
- opacity: 0.8
3636
- }), l = new x(i, c);
3637
- l.position.y = 0.8, this.add(s, r, l);
3638
- }
3639
- }
3640
- class _n extends k {
3641
- constructor() {
3642
- super();
3643
- const t = new b(3, 4, 0.1), o = new w({
3644
- color: 3026478,
3645
- roughness: 0.8,
3646
- metalness: 0.6
3647
- }), s = new b(0.2, 0.5, 0.2), a = new w({
3648
- color: 11184810,
3649
- roughness: 0.5,
3650
- metalness: 0.7
3651
- }), n = new G(0.3, 0.3, 0.1, 16), r = new w({
3652
- color: 5592405,
3653
- roughness: 0.7,
3654
- metalness: 0.5
3655
- }), i = new x(t, o);
3656
- for (let y = -1; y <= 1; y++) {
3657
- const g = new x(s, a);
3658
- g.position.set(y, 1.5, 0.1), i.add(g);
3659
- }
3660
- const c = new x(n, r);
3661
- c.rotation.x = Math.PI / 2, c.position.set(0, 0.5, 0.15), i.add(c);
3662
- const l = new z(0.15, 8, 8), u = new w({
3663
- color: 16711680,
3664
- emissive: 16711680,
3665
- emissiveIntensity: 0.5
3666
- }), m = new x(l, u);
3667
- m.position.set(0, -1, 0.1), i.add(m), this.add(i);
3668
- let h = 0.015, f = 0.8, p = 0.2;
3669
- function d() {
3670
- requestAnimationFrame(d);
3671
- const y = p + Math.abs(Math.sin(Date.now() * h)) * (f - p);
3672
- m.material.emissiveIntensity = y;
3673
- }
3674
- d();
3675
- }
3676
- }
3677
- class Un extends x {
3678
- constructor({
3679
- flaskRadius: t = 1,
3680
- //
3681
- neckRadius: o = 0.3,
3682
- height: s = 2.5,
3683
- neckHeight: a = 1,
3684
- radialSegments: n = 16
3685
- } = {}) {
3686
- super(
3687
- new Qe({ flaskRadius: t, neckRadius: o, height: s, neckHeight: a, radialSegments: n }),
3688
- new rt({
3689
- color: 8965375,
3690
- transparent: !0,
3691
- opacity: 0.4,
3692
- roughness: 0.1,
3693
- metalness: 0.1,
3694
- reflectivity: 0.8,
3695
- transmission: 0.9,
3696
- side: Y
3697
- })
3698
- );
3699
- }
3700
- }
3701
- class zn extends x {
3702
- constructor() {
3703
- super(
3704
- new Je(),
3705
- new rt({
3706
- color: 8965375,
3707
- transparent: !0,
3708
- depthWrite: !1,
3709
- opacity: 0.4,
3710
- roughness: 0.1,
3711
- metalness: 0.1,
3712
- reflectivity: 0.8,
3713
- transmission: 0.9,
3714
- side: Y
3715
- })
3716
- );
3717
- }
3718
- }
3719
- class Fn extends k {
3720
- constructor() {
3721
- super();
3722
- const t = new b(2, 3, 0.1), o = new w({
3723
- color: 3355443,
3724
- roughness: 0.8,
3725
- metalness: 0.5
3726
- }), s = new x(t, o), a = new G(0.1, 0.1, 0.2, 8), n = new G(0.05, 0.05, 1, 8), r = new w({
3727
- color: 11184810,
3728
- roughness: 0.5,
3729
- metalness: 0.7
3730
- });
3731
- for (let i = -0.5; i <= 0.5; i += 0.5) {
3732
- const c = new x(a, r);
3733
- c.position.set(i, 1, 0.1);
3734
- const l = new x(n, r);
3735
- l.position.y = 0.5, c.add(l), this.add(c);
3736
- }
3737
- this.add(s);
3738
- }
3739
- }
3740
- class Ln extends k {
3741
- constructor() {
3742
- super();
3743
- const t = new b(1, 0.2, 0.5), o = new w({
3744
- color: 4473924,
3745
- roughness: 0.6,
3746
- metalness: 0.3
3747
- }), s = new x(t, o);
3748
- s.position.y = 0.1;
3749
- const a = new b(0.2, 1, 0.2), n = new x(a, o);
3750
- n.position.set(0, 0.6, -0.2);
3751
- const r = new G(0.1, 0.1, 0.4, 8), i = new w({
3752
- color: 3355443,
3753
- roughness: 0.5,
3754
- metalness: 0.6
3755
- }), c = new x(r, i);
3756
- c.position.set(0, 1.1, -0.35), c.rotation.x = -Math.PI / 4;
3757
- const l = new b(0.6, 0.1, 0.6), u = new w({
3758
- color: 5592405,
3759
- roughness: 0.8,
3760
- metalness: 0.2
3761
- }), m = new x(l, u);
3762
- m.position.set(0, 0.6, 0), this.add(s, n, c, m);
3763
- }
3764
- }
3765
- class Dn extends k {
3766
- constructor() {
3767
- super();
3768
- const t = new We(), o = new G(0.2, 0.3, 1.5, 8);
3769
- o.translate(0, 0.75, 0);
3770
- const s = new w({
3771
- color: 6045747,
3772
- // Dark earthy tone
3773
- roughness: 1,
3774
- metalness: 0,
3775
- side: Y
3776
- // Render inside and outside
3777
- }), a = new w({
3778
- color: 9132587,
3779
- // Slightly lighter earthy color
3780
- roughness: 0.8,
3781
- metalness: 0.1
3782
- }), n = new x(t, s);
3783
- n.castShadow = !0;
3784
- const r = new x(o, a);
3785
- r.castShadow = !0, r.position.set(0.3, 1.3, 0), r.rotation.z = Math.PI / 4, this.add(n, r);
3786
- }
3787
- }
3788
- class kn extends x {
3789
- constructor({ width: o = 3, height: s = 4, depth: a = 0.1 } = {}) {
3790
- super();
3791
- I(this, "geometry");
3792
- I(this, "material");
3793
- this.geometry = new b(o, s, a), this.material = new w({
3794
- color: 3026478,
3795
- roughness: 0.8,
3796
- metalness: 0.6
3797
- });
3798
- }
3799
- }
3800
- class Vn extends x {
3801
- constructor({
3802
- radius: o = 0.15,
3803
- //
3804
- color: s = 16762823,
3805
- emissive: a = 16711680,
3806
- emissiveIntensity: n = 0.5
3807
- } = {}) {
3808
- super();
3809
- I(this, "geometry");
3810
- I(this, "material");
3811
- this.geometry = new z(o, 8, 8), this.material = new w({
3812
- color: s,
3813
- emissive: a,
3814
- emissiveIntensity: n
3815
- });
3816
- }
3817
- }
3818
- class qn extends k {
3819
- constructor() {
3820
- super();
3821
- const t = 100, o = 0.05, s = new Nt(
3822
- Array.from({ length: t }, (l, u) => {
3823
- const m = u * 0.2;
3824
- return new M(
3825
- Math.cos(m) * 0.4,
3826
- u * o,
3827
- // Gradual height increase
3828
- Math.sin(m) * 0.4
3829
- );
3830
- })
3831
- ), a = new Ot(s, 200, 0.1, 8, !1), n = new w({
3832
- color: 8965375,
3833
- transparent: !0,
3834
- opacity: 0.3,
3835
- roughness: 0.1,
3836
- metalness: 0.2,
3837
- emissive: 8965375
3838
- }), r = new x(a, n);
3839
- this.add(r);
3840
- function i() {
3841
- n.emissiveIntensity = 0.2 + Math.sin(Date.now() * 5e-3) * 0.1;
3842
- }
3843
- function c() {
3844
- requestAnimationFrame(c), i();
3845
- }
3846
- c();
3847
- }
3848
- }
3849
- class Yn extends x {
3850
- constructor({
3851
- radius: t = 0.3,
3852
- //
3853
- height: o = 0.4,
3854
- count: s = 3,
3855
- thickness: a = 0.03,
3856
- radialSegments: n = 16
3857
- } = {}) {
3858
- super(
3859
- new to({ radius: t, height: o, count: s, thickness: a, radialSegments: n }),
3860
- new w({
3861
- color: 8947848,
3862
- roughness: 0.7,
3863
- metalness: 0.3
3864
- })
3865
- );
3866
- }
3867
- }
3868
- class Hn extends x {
3869
- constructor() {
3870
- super(new eo(), [
3871
- new w({
3872
- color: 3355443,
3873
- roughness: 0.6,
3874
- metalness: 0.5
3875
- }),
3876
- new w({
3877
- color: 16737792,
3878
- roughness: 0.5,
3879
- metalness: 0.8,
3880
- side: Y
3881
- })
3882
- ]);
3883
- }
3884
- }
3885
- class Xn extends x {
3886
- constructor(t = 0.2, o = 0.2, s = 3, a = 32) {
3887
- super(
3888
- new ut(t, o, s, a),
3889
- new rt({
3890
- color: 8965375,
3891
- transparent: !0,
3892
- opacity: 0.4,
3893
- roughness: 0.1,
3894
- metalness: 0.1,
3895
- reflectivity: 0.8,
3896
- transmission: 0.9,
3897
- depthWrite: !1,
3898
- side: Y
3899
- })
3900
- );
3901
- }
3902
- }
3903
- class Zn extends k {
3904
- constructor(t = 3, o = [65450, 16711850, 11141375]) {
3905
- super();
3906
- const s = new b(3, 0.2, 1), a = new w({
3907
- color: 9127187,
3908
- // Wooden color or change to metallic tone
3909
- roughness: 0.7,
3910
- metalness: 0.3
3911
- }), n = new x(s, a);
3912
- n.position.y = 0.5, n.castShadow = !0;
3913
- const r = new ut(0.1, 0.1, 1, 16), i = new w({
3914
- color: 11184810,
3915
- transparent: !0,
3916
- opacity: 0.4,
3917
- roughness: 0.1,
3918
- metalness: 0.5,
3919
- depthWrite: !1,
3920
- side: Y
3921
- });
3922
- for (let c = 0; c < t; c++) {
3923
- const l = new x(r, i), u = (c - (t - 1) / 2) * 0.8;
3924
- l.position.set(u, 1, 0), l.castShadow = !0;
3925
- const m = new ut(0.099, 0.099, 0.5, 16, !1), h = o[c % o.length], f = new w({
3926
- color: h,
3927
- emissive: h,
3928
- emissiveIntensity: 0.5,
3929
- transparent: !0,
3930
- opacity: 0.6
3931
- }), p = new x(m, f);
3932
- p.position.set(0, -0.25, 0), l.add(p), n.add(l);
3933
- }
3934
- this.add(n);
3935
- }
3936
- }
3937
- class ao extends Z {
3938
- constructor(t = 5, o = 0.5, s = 1) {
3939
- super();
3940
- const a = Math.PI * 2 / t, n = a / 2, r = a / 4;
3941
- this.moveTo(Math.cos(0) * s, -Math.sin(0) * s);
3942
- for (let i = 1; i <= t; ++i) {
3943
- let c = Math.cos(a * i - r * 3) * (o / Math.cos(r)), l = -Math.sin(a * i - r * 3) * (o / Math.cos(r)), u = Math.cos(a * i - n) * o, m = -Math.sin(a * i - n) * o;
3944
- this.quadraticCurveTo(c, l, u, m), c = Math.cos(a * i - r) * (o / Math.cos(r)), l = -Math.sin(a * i - r) * (o / Math.cos(r)), u = Math.cos(a * i) * s, m = -Math.sin(a * i) * s, this.quadraticCurveTo(c, l, u, m);
3945
- }
3946
- this.closePath();
3947
- }
3948
- }
3949
- class jn extends x {
3950
- constructor(t = 5, o = 0.5, s = 1, a = 0.25) {
3951
- super();
3952
- const n = new ao(t, o, s), r = new j(n, {
3953
- depth: a,
3954
- bevelEnabled: a > 0,
3955
- bevelThickness: 0,
3956
- bevelSize: 0
3957
- }), i = new w({
3958
- color: 16776960,
3959
- emissive: 16766720,
3960
- emissiveIntensity: 0.25,
3961
- metalness: 0.1,
3962
- roughness: 0.3,
3963
- flatShading: !0
3964
- });
3965
- r.center(), this.geometry = r, this.material = i;
3966
- }
3967
- }
3968
- class io extends Z {
3969
- constructor(t = 5, o = 0.5, s = 1, a = 5, n = 0.25) {
3970
- super();
3971
- const r = Math.PI * 2 / t, i = r / 4;
3972
- this.moveTo(Math.cos(0) * s, -Math.sin(0) * s);
3973
- for (let c = 1; c <= t; ++c)
3974
- this.lineTo(Math.cos(r * c - i * 3) * o, -Math.sin(r * c - i * 3) * o), this.lineTo(Math.cos(r * c - i * 2) * o, -Math.sin(r * c - i * 2) * o), this.lineTo(Math.cos(r * c - i) * s, -Math.sin(r * c - i) * s), this.lineTo(Math.cos(r * c) * s, -Math.sin(r * c) * s);
3975
- if (this.closePath(), n > 0 && a > 2) {
3976
- const c = new _t(), l = Math.PI * 2 / a;
3977
- c.moveTo(Math.cos(0) * n, -Math.sin(0) * n);
3978
- for (let u = 1; u < a; ++u)
3979
- c.lineTo(Math.cos(l * u) * n, -Math.sin(l * u) * n);
3980
- c.lineTo(Math.cos(0) * n, -Math.sin(0) * n), this.holes.push(c);
3981
- }
3982
- }
3983
- }
3984
- class Qn extends x {
3985
- constructor(t = 5, o = 0.5, s = 1, a = 5, n = 0.25, r = 0.25) {
3986
- super();
3987
- const i = new io(t, o, s, a, n), c = new j(i, {
3988
- depth: r,
3989
- bevelEnabled: r > 0,
3990
- bevelThickness: 0,
3991
- bevelSize: 0
3992
- }), l = new w({
3993
- color: 11184810,
3994
- metalness: 0.8,
3995
- roughness: 0.2
3996
- });
3997
- c.center(), this.geometry = c, this.material = l;
3998
- }
3999
- }
4000
- class co extends Z {
4001
- constructor(t = 1, o = 2.1, s = 1.4, a = 1.6) {
4002
- super(), this.moveTo(0, s * t / 3), this.bezierCurveTo(
4003
- -o * 0.375 * t,
4004
- s * t,
4005
- // Control point 1 for the left lobe
4006
- -o * t,
4007
- s * t / 3,
4008
- // Control point 2 for the left side of the heart
4009
- 0,
4010
- -a * t
4011
- // Bottom tip of the heart, controlled by `tipDepth`
4012
- ), this.bezierCurveTo(
4013
- o * t,
4014
- s * t / 3,
4015
- // Control point 3 for the right side of the heart
4016
- o * 0.375 * t,
4017
- s * t,
4018
- // Control point 4 for the right lobe
4019
- 0,
4020
- s * t / 3
4021
- // Close shape at the top middle
4022
- );
4023
- }
4024
- }
4025
- class Kn extends x {
4026
- constructor(t = 1, o = 1, s = 1, a = 10, n = 0.25) {
4027
- super();
4028
- const r = new co(t, o, s, a), i = new j(r, {
4029
- depth: n,
4030
- bevelEnabled: n > 0,
4031
- bevelThickness: 0,
4032
- bevelSize: 0
4033
- }), c = new w({
4034
- color: 12986408,
4035
- emissive: 12981270,
4036
- emissiveIntensity: 0.25,
4037
- metalness: 0.1,
4038
- roughness: 0.3,
4039
- flatShading: !0
4040
- });
4041
- i.center(), this.geometry = i, this.material = c;
4042
- }
4043
- }
4044
- class lo extends Z {
4045
- constructor(t = 5, o = 0.5, s = 1) {
4046
- super();
4047
- const a = Math.PI * 2 / t, n = a / 2;
4048
- this.moveTo(Math.cos(0) * s, Math.sin(0) * s);
4049
- for (let r = 1; r <= t; ++r)
4050
- this.lineTo(Math.cos(a * r - n) * o, Math.sin(a * r - n) * o), this.lineTo(Math.cos(a * r) * s, Math.sin(a * r) * s);
4051
- this.closePath();
4052
- }
4053
- }
4054
- class $n extends x {
4055
- constructor(t = 5, o = 0.5, s = 1, a = 0.25) {
4056
- super();
4057
- const n = new lo(t, o, s), r = new j(n, {
4058
- depth: a,
4059
- bevelEnabled: a > 0,
4060
- bevelThickness: 0,
4061
- bevelSize: 0
4062
- }), i = new w({
4063
- color: 16776960,
4064
- emissive: 16766720,
4065
- emissiveIntensity: 0.25,
4066
- metalness: 0.1,
4067
- roughness: 0.3,
4068
- flatShading: !0
4069
- });
4070
- r.center(), this.geometry = r, this.material = i;
4071
- }
4072
- }
4073
- class Jn extends x {
4074
- constructor() {
4075
- super(new je(), new w({ color: 16777215 }));
4076
- }
4077
- }
4078
- class Wn extends x {
4079
- constructor({
4080
- trunkRadiusTop: t = 0.25,
4081
- trunkRadiusBottom: o = 0.4,
4082
- trunkHeight: s = 2.5,
4083
- trunkSegments: a = 14,
4084
- trunkColor: n = 9127187,
4085
- leafSize: r = 0.8,
4086
- leafCount: i = 6,
4087
- leafDetail: c = 0,
4088
- leafSpreadRadius: l = 1.5,
4089
- leafColor: u = 2263842
4090
- } = {}) {
4091
- super(
4092
- new so({
4093
- trunkRadiusTop: t,
4094
- trunkRadiusBottom: o,
4095
- trunkHeight: s,
4096
- trunkSegments: a,
4097
- leafSize: r,
4098
- leafCount: i,
4099
- leafDetail: c,
4100
- leafSpreadRadius: l
4101
- }),
4102
- [
4103
- new w({
4104
- color: n,
4105
- roughness: 0.9,
4106
- metalness: 0,
4107
- flatShading: !0
4108
- }),
4109
- new w({
4110
- color: u,
4111
- roughness: 0.8,
4112
- metalness: 0,
4113
- flatShading: !0
4114
- })
4115
- ]
4116
- );
4117
- }
4118
- }
4119
- class ts extends x {
4120
- constructor({
4121
- radius: t = 3,
4122
- //
4123
- height: o = 0.6,
4124
- widthSegments: s = 64,
4125
- heightSegments: a = 16,
4126
- phiStart: n = 0,
4127
- phiLength: r = Math.PI * 2
4128
- } = {}) {
4129
- super(
4130
- new oo({
4131
- radius: t,
4132
- height: o,
4133
- widthSegments: s,
4134
- heightSegments: a,
4135
- phiStart: n,
4136
- phiLength: r
4137
- }),
4138
- new w({ color: 65280, flatShading: !0 })
4139
- );
4140
- }
4141
- }
4142
- class es extends x {
4143
- constructor({
4144
- radius: t = bt(5, Math.PI / 10),
4145
- //
4146
- widthSegments: o = 64,
4147
- heightSegments: s = 32,
4148
- phiStart: a = 0,
4149
- phiLength: n = Math.PI * 2,
4150
- thetaLength: r = Math.PI / 10
4151
- } = {}) {
4152
- super(
4153
- new no({
4154
- radius: t,
4155
- widthSegments: o,
4156
- heightSegments: s,
4157
- phiStart: a,
4158
- phiLength: n,
4159
- thetaLength: r
4160
- }),
4161
- new w({ color: 65280, flatShading: !0 })
4162
- );
4163
- }
4164
- }
4165
- function os(e, { time: t = 0, waveFrequency: o = 0.2, waveAmplitude: s = 0.5 } = {}) {
4166
- e.onBeforeCompile = (a) => {
4167
- a.uniforms.time = { value: t }, a.uniforms.waveFrequency = { value: o }, a.uniforms.waveAmplitude = { value: s }, a.vertexShader = `
4168
- uniform float time;
4169
- uniform float waveFrequency;
4170
- uniform float waveAmplitude;
4171
-
4172
- vec3 waterDisplacement(vec3 position, vec3 normal) {
4173
- vec3 displaced = position;
4174
-
4175
- // Displace along the normal direction instead of local y-axis
4176
- displaced += normal * (sin(position.x * waveFrequency + time) * waveAmplitude);
4177
- displaced += normal * (cos(position.z * waveFrequency + time) * waveAmplitude);
4178
-
4179
- return displaced;
4180
- }
4181
- ` + a.vertexShader, a.vertexShader = a.vertexShader.replace(
4182
- "#include <begin_vertex>",
4183
- `
4184
- vec3 transformed = waterDisplacement(position, normal);
4185
- `
4186
- ), e.userData.shader = a;
4187
- };
4188
- }
4189
- function ns(e, t) {
4190
- e.userData.shader && (e.userData.shader.uniforms.time.value += t);
4191
- }
4192
- function ss(e, { time: t = 0, intensity: o = 1, axis: s = ft.XYZ, scale: a = 10 } = {}) {
4193
- e.onBeforeCompile = (n) => {
4194
- n.uniforms.time = { value: t }, n.uniforms.axis = { value: s }, n.uniforms.intensity = { value: o }, n.uniforms.scale = { value: a }, n.vertexShader = `
4195
- uniform float time;
4196
- uniform vec3 axis;
4197
- uniform float intensity;
4198
- uniform float scale;
4199
-
4200
- float mod289(float x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }
4201
- vec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }
4202
- vec4 perm(vec4 x) { return mod289(((x * 34.0) + 1.0) * x); }
4203
-
4204
- float noise(vec3 p) {
4205
- vec3 a = floor(p);
4206
- vec3 d = p - a;
4207
- d = d * d * (3.0 - 2.0 * d);
4208
-
4209
- vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0);
4210
- vec4 k1 = perm(b.xyxy);
4211
- vec4 k2 = perm(k1.xyxy + b.zzww);
4212
-
4213
- vec4 c = k2 + a.zzzz;
4214
- vec4 k3 = perm(c);
4215
- vec4 k4 = perm(c + 1.0);
4216
-
4217
- vec4 o1 = fract(k3 * (1.0 / 41.0));
4218
- vec4 o2 = fract(k4 * (1.0 / 41.0));
4219
-
4220
- vec4 o3 = o2 * d.z + o1 * (1.0 - d.z);
4221
- vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x);
4222
-
4223
- return o4.y * d.y + o4.x * (1.0 - d.y);
4224
- }
4225
- ` + n.vertexShader, n.vertexShader = n.vertexShader.replace(
4226
- "#include <begin_vertex>",
4227
- `
4228
- vec3 transformed = vec3(position);
4229
- float n = noise(transformed * scale + time);
4230
- transformed += normalize(axis) * n * intensity;
4231
- vec3 transformedNormal = normal;
4232
- `
4233
- ), e.userData.shader = n;
4234
- };
4235
- }
4236
- function rs(e, t) {
4237
- e.userData.shader && (e.userData.shader.uniforms.time.value += t);
4238
- }
4239
- const it = {
4240
- uniforms: {
4241
- turbidity: { value: 10 },
4242
- rayleigh: { value: 2 },
4243
- mieCoefficient: { value: 5e-3 },
4244
- mieDirectionalG: { value: 0.8 },
4245
- sunPosition: { value: new M().setFromSphericalCoords(1, L.degToRad(90), L.degToRad(180)) },
4246
- up: { value: new M(0, 1, 0) }
4247
- },
4248
- vertexShader: `
4249
- uniform vec3 sunPosition;
4250
- uniform float rayleigh;
4251
- uniform float turbidity;
4252
- uniform float mieCoefficient;
4253
- uniform vec3 up;
4254
-
4255
- varying vec3 vWorldPosition;
4256
- varying vec3 vSunDirection;
4257
- varying float vSunfade;
4258
- varying vec3 vBetaR;
4259
- varying vec3 vBetaM;
4260
- varying float vSunE;
4261
-
4262
- // constants for atmospheric scattering
4263
- const float e = 2.71828182845904523536028747135266249775724709369995957;
4264
- const float pi = 3.141592653589793238462643383279502884197169;
4265
-
4266
- // wavelength of used primaries, according to preetham
4267
- const vec3 lambda = vec3( 680E-9, 550E-9, 450E-9 );
4268
- // this pre-calculation replaces older TotalRayleigh(vec3 lambda) function:
4269
- // (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn))
4270
- const vec3 totalRayleigh = vec3( 5.804542996261093E-6, 1.3562911419845635E-5, 3.0265902468824876E-5 );
4271
-
4272
- // mie stuff
4273
- // K coefficient for the primaries
4274
- const float v = 4.0;
4275
- const vec3 K = vec3( 0.686, 0.678, 0.666 );
4276
- // MieConst = pi * pow( ( 2.0 * pi ) / lambda, vec3( v - 2.0 ) ) * K
4277
- const vec3 MieConst = vec3( 1.8399918514433978E14, 2.7798023919660528E14, 4.0790479543861094E14 );
4278
-
4279
- // earth shadow hack
4280
- // cutoffAngle = pi / 1.95;
4281
- const float cutoffAngle = 1.6110731556870734;
4282
- const float steepness = 1.5;
4283
- const float EE = 1000.0;
4284
-
4285
- float sunIntensity( float zenithAngleCos ) {
4286
- zenithAngleCos = clamp( zenithAngleCos, -1.0, 1.0 );
4287
- return EE * max( 0.0, 1.0 - pow( e, -( ( cutoffAngle - acos( zenithAngleCos ) ) / steepness ) ) );
4288
- }
4289
-
4290
- vec3 totalMie( float T ) {
4291
- float c = ( 0.2 * T ) * 10E-18;
4292
- return 0.434 * c * MieConst;
4293
- }
4294
-
4295
- void main() {
4296
- vec4 worldPosition = modelMatrix * vec4( position, 1.0 );
4297
- vWorldPosition = worldPosition.xyz;
4298
-
4299
- gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
4300
- gl_Position.z = gl_Position.w; // set z to camera.far
4301
-
4302
- vSunDirection = normalize( sunPosition );
4303
-
4304
- vSunE = sunIntensity( dot( vSunDirection, up ) );
4305
-
4306
- vSunfade = 1.0 - clamp( 1.0 - exp( ( sunPosition.y / 450000.0 ) ), 0.0, 1.0 );
4307
-
4308
- float rayleighCoefficient = rayleigh - ( 1.0 * ( 1.0 - vSunfade ) );
4309
-
4310
- // extinction (absorption + out scattering)
4311
- // rayleigh coefficients
4312
- vBetaR = totalRayleigh * rayleighCoefficient;
4313
-
4314
- // mie coefficients
4315
- vBetaM = totalMie( turbidity ) * mieCoefficient;
4316
- }
4317
- `,
4318
- fragmentShader: `
4319
- varying vec3 vWorldPosition;
4320
- varying vec3 vSunDirection;
4321
- varying float vSunfade;
4322
- varying vec3 vBetaR;
4323
- varying vec3 vBetaM;
4324
- varying float vSunE;
4325
-
4326
- uniform float mieDirectionalG;
4327
- uniform vec3 up;
4328
-
4329
- // constants for atmospheric scattering
4330
- const float pi = 3.141592653589793238462643383279502884197169;
4331
-
4332
- const float n = 1.0003; // refractive index of air
4333
- const float N = 2.545E25; // number of molecules per unit volume for air at 288.15K and 1013mb (sea level -45 celsius)
4334
-
4335
- // optical length at zenith for molecules
4336
- const float rayleighZenithLength = 8.4E3;
4337
- const float mieZenithLength = 1.25E3;
4338
- // 66 arc seconds -> degrees, and the cosine of that
4339
- const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;
4340
-
4341
- // 3.0 / ( 16.0 * pi )
4342
- const float THREE_OVER_SIXTEENPI = 0.05968310365946075;
4343
- // 1.0 / ( 4.0 * pi )
4344
- const float ONE_OVER_FOURPI = 0.07957747154594767;
4345
-
4346
- float rayleighPhase( float cosTheta ) {
4347
- return THREE_OVER_SIXTEENPI * ( 1.0 + pow( cosTheta, 2.0 ) );
4348
- }
4349
-
4350
- float hgPhase( float cosTheta, float g ) {
4351
- float g2 = pow( g, 2.0 );
4352
- float inverse = 1.0 / pow( 1.0 - 2.0 * g * cosTheta + g2, 1.5 );
4353
- return ONE_OVER_FOURPI * ( ( 1.0 - g2 ) * inverse );
4354
- }
4355
-
4356
- void main() {
4357
- vec3 direction = normalize( vWorldPosition - cameraPosition );
4358
-
4359
- // optical length
4360
- // cutoff angle at 90 to avoid singularity in next formula.
4361
- float zenithAngle = acos( max( 0.0, dot( up, direction ) ) );
4362
- float inverse = 1.0 / ( cos( zenithAngle ) + 0.15 * pow( 93.885 - ( ( zenithAngle * 180.0 ) / pi ), -1.253 ) );
4363
- float sR = rayleighZenithLength * inverse;
4364
- float sM = mieZenithLength * inverse;
4365
-
4366
- // combined extinction factor
4367
- vec3 Fex = exp( -( vBetaR * sR + vBetaM * sM ) );
4368
-
4369
- // in scattering
4370
- float cosTheta = dot( direction, vSunDirection );
4371
-
4372
- float rPhase = rayleighPhase( cosTheta * 0.5 + 0.5 );
4373
- vec3 betaRTheta = vBetaR * rPhase;
4374
-
4375
- float mPhase = hgPhase( cosTheta, mieDirectionalG );
4376
- vec3 betaMTheta = vBetaM * mPhase;
4377
-
4378
- vec3 Lin = pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * ( 1.0 - Fex ), vec3( 1.5 ) );
4379
- Lin *= mix( vec3( 1.0 ), pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * Fex, vec3( 1.0 / 2.0 ) ), clamp( pow( 1.0 - dot( up, vSunDirection ), 5.0 ), 0.0, 1.0 ) );
4380
-
4381
- // night sky
4382
- float theta = acos( direction.y ); // elevation --> y-axis, [-pi/2, pi/2]
4383
- float phi = atan( direction.z, direction.x ); // azimuth --> x-axis [-pi/2, pi/2]
4384
- vec2 uv = vec2( phi, theta ) / vec2( 2.0 * pi, pi ) + vec2( 0.5, 0.0 );
4385
- vec3 L0 = vec3( 0.1 ) * Fex;
4386
-
4387
- // composition + solar disc
4388
- float sundisk = smoothstep( sunAngularDiameterCos, sunAngularDiameterCos + 0.00002, cosTheta );
4389
- L0 += ( vSunE * 19000.0 * Fex ) * sundisk;
4390
-
4391
- vec3 texColor = ( Lin + L0 ) * 0.04 + vec3( 0.0, 0.0003, 0.00075 );
4392
-
4393
- vec3 retColor = pow( texColor, vec3( 1.0 / ( 1.2 + ( 1.2 * vSunfade ) ) ) );
4394
-
4395
- gl_FragColor = vec4( retColor, 1.0 );
4396
-
4397
- #include <tonemapping_fragment>
4398
- #include <colorspace_fragment>
4399
- }
4400
- `
4401
- }, ct = {
4402
- uniforms: {
4403
- topColor: { value: new ot(0.5, 0.8, 1) },
4404
- bottomColor: { value: new ot(1, 1, 1) }
4405
- },
4406
- vertexShader: `
4407
- varying vec3 vPosition;
4408
- void main() {
4409
- vPosition = position;
4410
- gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
4411
- }
4412
- `,
4413
- fragmentShader: `
4414
- uniform vec3 topColor;
4415
- uniform vec3 bottomColor;
4416
- varying vec3 vPosition;
4417
- void main() {
4418
- float y = normalize(vPosition).y * 0.5 + 0.5; // Normalizing y to range 0 to 1
4419
- gl_FragColor = vec4(mix(bottomColor, topColor, y), 1.0);
4420
- }
4421
- `
4422
- }, as = {
4423
- uniforms: {
4424
- tDiffuse: { value: null },
4425
- opacity: { value: 1 }
4426
- },
4427
- vertexShader: `
4428
- varying vec2 vUv;
4429
- void main() {
4430
- vUv = uv;
4431
- gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
4432
- }
4433
- `,
4434
- fragmentShader: `
4435
- uniform float opacity;
4436
- uniform sampler2D tDiffuse;
4437
- varying vec2 vUv;
4438
- void main() {
4439
- vec4 texel = texture2D(tDiffuse, vUv);
4440
- gl_FragColor = opacity * texel;
4441
- }
4442
- `
4443
- }, lt = {
4444
- uniforms: {
4445
- topColor: { value: new ot(51) },
4446
- bottomColor: { value: new ot(17) },
4447
- offset: { value: 33 },
4448
- exponent: { value: 0.6 }
4449
- },
4450
- vertexShader: `
4451
- varying vec3 vWorldPosition;
4452
- void main() {
4453
- vec4 worldPosition = modelMatrix * vec4(position, 1.0);
4454
- vWorldPosition = worldPosition.xyz;
4455
- gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
4456
- }
4457
- `,
4458
- fragmentShader: `
4459
- uniform vec3 topColor;
4460
- uniform vec3 bottomColor;
4461
- uniform float offset;
4462
- uniform float exponent;
4463
- varying vec3 vWorldPosition;
4464
- void main() {
4465
- float h = normalize(vWorldPosition + offset).y;
4466
- gl_FragColor = vec4(mix(bottomColor, topColor, max(pow(max(h, 0.0), exponent), 0.0)), 1.0);
4467
- }
4468
- `
4469
- };
4470
- class is extends x {
4471
- constructor() {
4472
- super();
4473
- I(this, "geometry");
4474
- I(this, "material");
4475
- this.geometry = new b(1, 1, 1), this.material = new st({
4476
- uniforms: it.uniforms,
4477
- vertexShader: it.vertexShader,
4478
- fragmentShader: it.fragmentShader,
4479
- depthWrite: !1,
4480
- side: mt
4481
- }), this.scale.setScalar(45e4);
4482
- const o = L.degToRad(89), s = L.degToRad(180), a = new M().setFromSphericalCoords(1, o, s);
4483
- this.material.uniforms.sunPosition.value = a;
4484
- }
4485
- /**
4486
- * Set the sun position.
4487
- *
4488
- * Elevation (theta, θ)
4489
- * - Angle measured above or below the horizon (from the xy-plane towards the zenith or nadir).
4490
- * - Ranges from 0 to π/2 radians (or 0 to 90 degrees).
4491
- * - This is the vertical angle in the xy-plane.
4492
- *
4493
- * Azimuth (phi, φ)
4494
- * - Angle measured around the horizon from a reference direction (e.g., north, east).
4495
- * - Ranges from 0 to 2π radians (or 0 to 360 degrees).
4496
- * - This is the horizontal angle in the xy-plane.
4497
- */
4498
- sunPosition(o, s) {
4499
- const a = new M();
4500
- a.setFromSphericalCoords(1, o, s), this.material.uniforms.sunPosition.value = a;
4501
- }
4502
- }
4503
- class cs extends x {
4504
- constructor(o = 1e3) {
4505
- super();
4506
- I(this, "geometry");
4507
- I(this, "material");
4508
- this.geometry = new b(o, o, o), this.material = new st({
4509
- uniforms: ct.uniforms,
4510
- vertexShader: ct.vertexShader,
4511
- fragmentShader: ct.fragmentShader,
4512
- side: mt
4513
- });
4514
- }
4515
- }
4516
- class ls extends x {
4517
- constructor(o = 1e3) {
4518
- super();
4519
- I(this, "geometry");
4520
- I(this, "material");
4521
- this.geometry = new z(o, 32, 15), this.material = new st({
4522
- vertexShader: lt.vertexShader,
4523
- fragmentShader: lt.fragmentShader,
4524
- uniforms: lt.uniforms,
4525
- side: mt
4526
- });
4527
- }
4528
- }
4529
- const us = (e) => {
4530
- const t = new Uint8Array(4 * e * e);
4531
- for (let s = 0; s < e * e; s++) {
4532
- const a = s * 4, n = (s % e ^ Math.floor(s / e)) & 1 ? 255 : 0;
4533
- t[a] = n, t[a + 1] = n, t[a + 2] = n, t[a + 3] = 255;
4534
- }
4535
- const o = new Ut(t, e, e, zt, Ft);
4536
- return o.wrapS = pt, o.wrapT = pt, o.minFilter = Lt, o.needsUpdate = !0, o;
4537
- };
4538
- function ms(e, t) {
4539
- if (e.length === 0)
4540
- throw new Error("No objects provided for alignment.");
4541
- const o = new V(), s = new M(), a = e.map((r) => (o.setFromObject(r), r.getWorldPosition(s), {
4542
- object: r,
4543
- boundingBox: o.clone(),
4544
- // Clone to avoid overwriting
4545
- worldPosition: s.clone()
4546
- })), n = a.reduce(
4547
- (r, { boundingBox: i }) => {
4548
- switch (t) {
4549
- case N.LEFT:
4550
- return Math.min(r, i.min.x);
4551
- case N.RIGHT:
4552
- return Math.max(r, i.max.x);
4553
- case N.BOTTOM:
4554
- return Math.min(r, i.min.y);
4555
- case N.TOP:
4556
- return Math.max(r, i.max.y);
4557
- case N.BACK:
4558
- return Math.min(r, i.min.z);
4559
- case N.FRONT:
4560
- return Math.max(r, i.max.z);
4561
- default:
4562
- throw new Error(`Unsupported side type: ${t}`);
4563
- }
4564
- },
4565
- t === N.RIGHT || t === N.TOP || t === N.FRONT ? -1 / 0 : 1 / 0
4566
- );
4567
- a.forEach(({ object: r, boundingBox: i }) => {
4568
- switch (t) {
4569
- case N.LEFT:
4570
- r.position.x += n - i.min.x;
4571
- break;
4572
- case N.RIGHT:
4573
- r.position.x += n - i.max.x;
4574
- break;
4575
- case N.BOTTOM:
4576
- r.position.y += n - i.min.y;
4577
- break;
4578
- case N.TOP:
4579
- r.position.y += n - i.max.y;
4580
- break;
4581
- case N.BACK:
4582
- r.position.z += n - i.min.z;
4583
- break;
4584
- case N.FRONT:
4585
- r.position.z += n - i.max.z;
4586
- break;
4587
- }
4588
- });
4589
- }
4590
- function hs(e, t = W.RIGHT, o = 0) {
4591
- const s = t.clone().normalize();
4592
- let a = new M();
4593
- const n = new V();
4594
- e.forEach((r) => {
4595
- n.setFromObject(r);
4596
- const c = new M(
4597
- n.max.x - n.min.x,
4598
- n.max.y - n.min.y,
4599
- n.max.z - n.min.z
4600
- ).dot(s), l = new M();
4601
- n.getCenter(l);
4602
- const u = s.clone().multiplyScalar(c / 2);
4603
- r.position.copy(a.clone().add(u).sub(l).add(r.position)), a.add(s.clone().multiplyScalar(c + o));
4604
- });
4605
- }
4606
- function fs(e, t, o = new M(0, 0, 0)) {
4607
- const s = new V().setFromObject(e);
4608
- if (s.isEmpty())
4609
- console.warn("The object has no geometry or is not visible.");
4610
- else {
4611
- const a = s.min, n = new M((a.x + s.max.x) / 2, a.y, (a.z + s.max.z) / 2);
4612
- e.localToWorld(n);
4613
- const r = t.clone().sub(n).add(o), i = e.worldToLocal(r.clone());
4614
- e.position.add(i);
4615
- }
4616
- }
4617
- function ps(e, t) {
4618
- const o = new V().setFromBufferAttribute(new F(e.attributes.position.array, 3));
4619
- if (o.isEmpty())
4620
- console.warn("The geometry is empty or invalid.");
4621
- else {
4622
- const s = o.min.y;
4623
- e.translate(0, t - s, 0);
4624
- }
4625
- }
4626
- function ds(e, t, o = new M(0, 0, 0)) {
4627
- const s = new V().setFromObject(e);
4628
- if (s.isEmpty())
4629
- console.warn("The InstancedMesh has no geometry or is not visible.");
4630
- else {
4631
- const a = s.min.y, n = new M(0, t.y - a, 0).add(o), r = e.worldToLocal(n.clone());
4632
- e.position.add(r);
4633
- }
4634
- }
4635
- function ys(e, t, o, s = new M(0, 0, 0)) {
4636
- const a = new V().setFromObject(e);
4637
- if (a.isEmpty())
4638
- console.warn("The instanced mesh has invalid geometry.");
4639
- else {
4640
- const n = a.min.y, r = new X();
4641
- e.getMatrixAt(o, r);
4642
- const i = new M(), c = new wt(), l = new M();
4643
- r.decompose(i, c, l);
4644
- const u = e.worldToLocal(t.clone());
4645
- i.y = u.y - n + s.y, r.compose(i, c, l), e.setMatrixAt(o, r), e.instanceMatrix.needsUpdate = !0;
4646
- }
4647
- }
4648
- function uo(e, t = new M(0, 0, 0), o = new M(0, 0, 0)) {
4649
- const a = new V().setFromObject(e).getCenter(new M()), n = new M().addVectors(t, o), r = new M().subVectors(n, a);
4650
- e.position.add(r);
4651
- }
4652
- function mo(e, t = new M(0, 0, 0), o = new M(0, 0, 0)) {
4653
- const a = new V().setFromObject(e).getCenter(new M()), n = new M().addVectors(t, o);
4654
- e.translateX(n.x - a.x), e.translateY(n.y - a.y), e.translateZ(n.z - a.z), e.updateMatrixWorld(!0);
4655
- }
4656
- function ho(e, t = new M(0, 0, 0), o = new M(0, 0, 0)) {
4657
- e.geometry.computeBoundingBox();
4658
- const s = e.geometry.boundingBox;
4659
- if (s) {
4660
- const a = s.getCenter(new M()), n = new M().addVectors(t, o), r = new M().subVectors(n, a);
4661
- e.geometry.translate(r.x, r.y, r.z);
4662
- }
4663
- }
4664
- const ws = {
4665
- object: uo,
4666
- objectGeometry: mo,
4667
- meshGeometry: ho
4668
- };
4669
- function Ms(e) {
4670
- const t = parseInt(e.slice(1), 16);
4671
- return [
4672
- t >> 16 & 255,
4673
- // r
4674
- t >> 8 & 255,
4675
- // g
4676
- t & 255
4677
- // b
4678
- ];
4679
- }
4680
- function xs(e) {
4681
- const [t, o, s] = $(e);
4682
- return po(t, o, s);
4683
- }
4684
- function $(e) {
4685
- const t = e >> 16 & 255, o = e >> 8 & 255, s = e & 255;
4686
- return [t, o, s];
4687
- }
4688
- function vs(e, t, o) {
4689
- t /= 100, o /= 100;
4690
- function s(c, l, u) {
4691
- return u < 0 && (u += 1), u > 1 && (u -= 1), u < 1 / 6 ? c + (l - c) * 6 * u : u < 1 / 2 ? l : u < 2 / 3 ? c + (l - c) * (2 / 3 - u) * 6 : c;
4692
- }
4693
- let a, n, r;
4694
- if (t === 0)
4695
- a = n = r = o;
4696
- else {
4697
- const c = o < 0.5 ? o * (1 + t) : o + t - o * t, l = 2 * o - c;
4698
- a = s(l, c, e / 360 + 1 / 3), n = s(l, c, e / 360), r = s(l, c, e / 360 - 1 / 3);
4699
- }
4700
- const i = (c) => Math.round(c * 255);
4701
- return [
4702
- i(a),
4703
- i(n),
4704
- i(r)
4705
- ];
4706
- }
4707
- function fo(e, t, o) {
4708
- t /= 100, o /= 100;
4709
- const s = (r) => (r + e / 30) % 12, a = t * Math.min(o, 1 - o), n = (r) => o - a * Math.max(-1, Math.min(s(r) - 3, Math.min(9 - s(r), 1)));
4710
- return [n(0) * 255, n(8) * 255, n(4) * 255];
4711
- }
4712
- function gs(e, t, o) {
4713
- return [e / 255, t / 255, o / 255];
4714
- }
4715
- function As(e, t, o) {
4716
- return e = Math.round(e), t = Math.round(t), o = Math.round(o), (e << 16) + (t << 8) + o;
4717
- }
4718
- function po(e, t, o) {
4719
- e /= 255, t /= 255, o /= 255;
4720
- const s = Math.max(e, t, o), a = Math.min(e, t, o), n = s - a;
4721
- let r = 0, i = 0;
4722
- const c = (s + a) / 2;
4723
- n !== 0 && (s === e ? r = ((t - o) / n + (t < o ? 6 : 0)) * 60 : s === t ? r = ((o - e) / n + 2) * 60 : s === o && (r = ((e - t) / n + 4) * 60)), n !== 0 && (i = n / (1 - Math.abs(2 * c - 1))), r = Math.round(r), i = Math.round(i * 100);
4724
- const l = Math.round(c * 100);
4725
- return [r, i, l];
4726
- }
4727
- function yo(e, t) {
4728
- return Math.sqrt(
4729
- Math.pow(e[0] - t[0], 2) + Math.pow(e[1] - t[1], 2) + Math.pow(e[2] - t[2], 2)
4730
- );
4731
- }
4732
- function wo(e, t) {
4733
- return Math.abs(e[0] - t[0]) + //
4734
- Math.abs(e[1] - t[1]) + Math.abs(e[2] - t[2]);
4735
- }
4736
- function Is(e, t) {
4737
- const o = $(e);
4738
- let s = null, a = 1 / 0;
4739
- for (const n of t) {
4740
- const r = $(n), i = yo(o, r);
4741
- i < a && (a = i, s = n);
4742
- }
4743
- return s;
4744
- }
4745
- function Es(e, t) {
4746
- const o = $(e);
4747
- let s = null, a = 1 / 0;
4748
- for (const n of t) {
4749
- const r = $(n), i = wo(o, r);
4750
- i < a && (a = i, s = n);
4751
- }
4752
- return s;
4753
- }
4754
- function bs(e) {
4755
- const t = (e + Math.floor(-30 + Math.random() * 61)) % 360, o = Math.floor(60 + Math.random() * 21), s = Math.floor(50 + Math.random() * 21);
4756
- return fo(t, o, s);
4757
- }
4758
- function Ts(e, t) {
4759
- if (!t.geometry.isBufferGeometry)
4760
- throw new Error("Mesh must have a BufferGeometry.");
4761
- const s = t.geometry.getAttribute("position"), a = new M(), n = new M();
4762
- let r = 1 / 0;
4763
- for (let i = 0; i < s.count; i++) {
4764
- n.fromBufferAttribute(s, i);
4765
- const c = n.distanceTo(e);
4766
- c < r && (r = c, a.copy(n));
4767
- }
4768
- return t.localToWorld(a), a;
4769
- }
4770
- function Mo(e, t, o) {
4771
- return Math.max(0, Math.min(1, (e - t) / (o - t)));
4772
- }
4773
- function Ss(e, t, o, s, a, n = 20, r = 0, i = 1) {
4774
- const c = [];
4775
- for (let l = 0; l <= n; l++) {
4776
- const u = l / n, m = e(Mo(u, r, i)), h = t + m * (o - t), f = s + u * (a - s);
4777
- c.push(new A(h, f));
4778
- }
4779
- return c;
4780
- }
4781
- const xo = (e, t, o, s, a = 24) => {
4782
- let n = [];
4783
- for (let r = 0; r <= a; r++) {
4784
- const i = r / a, c = D.CUBIC(i, e.x, t.x, o.x, s.x), l = D.CUBIC(i, e.y, t.y, o.y, s.y);
4785
- n.push(new A(c, l));
4786
- }
4787
- return n;
4788
- }, vo = (e, t, o, s = 24) => {
4789
- let a = [];
4790
- for (let n = 0; n <= s; n++) {
4791
- const r = n / s, i = D.DAMPED(r, o) * (t.x - e.x) + e.x, c = e.y + r * (t.y - e.y);
4792
- a.push(new A(i, c));
4793
- }
4794
- return a;
4795
- }, go = (e, t, o, s, a = 24) => {
4796
- let n = [];
4797
- for (let r = 0; r <= a; r++) {
4798
- const i = r / a, c = D.EXPONENTIAL(i, o, s) * (t.x - e.x) + e.x, l = e.y + i * (t.y - e.y);
4799
- n.push(new A(c, l));
4800
- }
4801
- return n;
4802
- }, Ao = (e, t, o, s, a = 24) => {
4803
- let n = [];
4804
- for (let r = 0; r <= a; r++) {
4805
- const i = r / a, c = D.LOGARITHMIC(i, o, s) * (t.x - e.x) + e.x, l = e.y + i * (t.y - e.y);
4806
- n.push(new A(c, l));
4807
- }
4808
- return n;
4809
- }, Io = (e, t, o, s, a, n = 24) => {
4810
- let r = [];
4811
- for (let i = 0; i <= n; i++) {
4812
- const c = i / n, l = o * c * c + s * c + a + e.x, u = e.y + c * (t.y - e.y);
4813
- r.push(new A(l, u));
4814
- }
4815
- return r;
4816
- }, Eo = (e, t, o, s = 24) => {
4817
- let a = [];
4818
- for (let n = 0; n <= s; n++) {
4819
- const r = n / s, i = D.QUADRATIC(r, e.x, t.x, o.x), c = D.QUADRATIC(r, e.y, t.y, o.y);
4820
- a.push(new A(i, c));
4821
- }
4822
- return a;
4823
- }, bo = (e, t, o, s = 24) => {
4824
- let a = [];
4825
- for (let n = 0; n <= s; n++) {
4826
- const r = n / s, i = D.SIGMOID(r, o) * (t.x - e.x) + e.x, c = e.y + r * (t.y - e.y);
4827
- a.push(new A(i, c));
4828
- }
4829
- return a;
4830
- }, Ps = {
4831
- createCubicCurvePoints: xo,
4832
- createDampedCurvePoints: vo,
4833
- createExponentialCurvePoints: go,
4834
- createLogarithmicCurvePoints: Ao,
4835
- createParabolicCurvePoints: Io,
4836
- createQuadraticCurvePoints: Eo,
4837
- createSigmoidCurvePoints: bo
4838
- };
4839
- function Gs(e, t, o, s, a, n = [0, 0], r = [1, 0], i = [0, 1], c = [1, 1]) {
4840
- const l = a || To(e, t, o);
4841
- return [
4842
- // Triangle 1
4843
- { pos: e, norm: l, uv: n },
4844
- { pos: t, norm: l, uv: r },
4845
- { pos: s, norm: l, uv: c },
4846
- // Triangle 2
4847
- { pos: e, norm: l, uv: n },
4848
- { pos: s, norm: l, uv: c },
4849
- { pos: o, norm: l, uv: i }
4850
- ];
4851
- }
4852
- function To(e, t, o) {
4853
- const s = [
4854
- t[0] - e[0],
4855
- t[1] - e[1],
4856
- t[2] - e[2]
4857
- ], a = [
4858
- o[0] - e[0],
4859
- o[1] - e[1],
4860
- o[2] - e[2]
4861
- ], n = [
4862
- s[1] * a[2] - s[2] * a[1],
4863
- s[2] * a[0] - s[0] * a[2],
4864
- s[0] * a[1] - s[1] * a[0]
4865
- ], r = Math.sqrt(n[0] ** 2 + n[1] ** 2 + n[2] ** 2);
4866
- return n.map((i) => i / r);
4867
- }
4868
- function Cs(e, t) {
4869
- return e.map(([o, s, a]) => {
4870
- switch (t) {
4871
- case "x":
4872
- return [s, a];
4873
- case "y":
4874
- return [o, a];
4875
- case "z":
4876
- return [o, s];
4877
- default:
4878
- throw new Error(`Invalid axis: ${t}`);
4879
- }
4880
- });
4881
- }
4882
- function So(e) {
4883
- const [t, o, s] = e, a = Math.abs(t), n = Math.abs(o), r = Math.abs(s);
4884
- return a >= n && a >= r ? [s > 0 ? s : -s, o] : n >= a && n >= r ? [t, s > 0 ? s : -s] : [t, o];
4885
- }
4886
- function Rs(e) {
4887
- return e.map((t) => So(t));
4888
- }
4889
- function Bs(e) {
4890
- return e.map(([t, o, s]) => {
4891
- const a = Math.atan2(s, t), n = Math.acos(o / Math.sqrt(t ** 2 + o ** 2 + s ** 2)), r = a / (2 * Math.PI) + 0.5, i = 1 - n / Math.PI;
4892
- return [r, i];
4893
- });
4894
- }
4895
- function Ns(e) {
4896
- return e.map(([t, o, s]) => [Math.atan2(s, t) / (2 * Math.PI) + 0.5, o]);
4897
- }
4898
- function Os(e) {
4899
- return e.map(([t, o, s]) => {
4900
- const a = Math.sqrt(t ** 2 + s ** 2);
4901
- return [Math.atan2(s, t) / (2 * Math.PI) + 0.5, a];
4902
- });
4903
- }
4904
- function Po(e, t, o, s, a) {
4905
- return [
4906
- (e[0] - t) / (o - t),
4907
- (e[1] - s) / (a - s)
4908
- ];
4909
- }
4910
- function _s(e, t, o) {
4911
- const [s, a] = t, [n, r] = o;
4912
- return e.map((i) => Po(i, s, n, a, r));
4913
- }
4914
- function Us(e) {
4915
- const t = Math.min(...e.map((n) => n[0])), o = Math.max(...e.map((n) => n[0])), s = Math.min(...e.map((n) => n[1])), a = Math.max(...e.map((n) => n[1]));
4916
- return {
4917
- minBounds: [t, s],
4918
- maxBounds: [o, a]
4919
- };
4920
- }
4921
- export {
4922
- is as AtmosphericSkybox,
4923
- ft as Axis,
4924
- en as BifurcatedStaircaseGeometry,
4925
- Jn as Bone,
4926
- je as BoneGeometry,
4927
- pn as Book,
4928
- xt as BookGeometry,
4929
- Tn as Bookshelf,
4930
- ke as BookshelfGeometry,
4931
- N as BoxSide,
4932
- Ko as BubblingEffect,
4933
- On as BunsenBurner,
4934
- jn as Burst,
4935
- ao as BurstShape,
4936
- Pn as Candle,
4937
- qe as CandleGeometry,
4938
- ws as Center,
4939
- H as ColorPalette,
4940
- Mn as CrossHeadstone,
4941
- Oe as CrossHeadstoneGeometry,
4942
- cs as DaySkybox,
4943
- Sn as Desk,
4944
- Ve as DeskGeometry,
4945
- hn as Diorama,
4946
- Ge as DioramaGeometry,
4947
- W as Direction,
4948
- Qo as Easing,
4949
- _n as ElectricPanel,
4950
- Te as EllipticLeafGeometry,
4951
- Fo as EmissivePulseAnimation,
4952
- Un as ErlenmeyerFlask,
4953
- Qe as ErlenmeyerFlaskGeometry,
4954
- tt as Falloff,
4955
- Gn as Flame,
4956
- Et as FlameGeometry,
4957
- zn as FlorenceFlask,
4958
- Je as FlorenceFlaskGeometry,
4959
- Qn as Gear,
4960
- io as GearShape,
4961
- Kn as Heart,
4962
- co as HeartShape,
4963
- ts as Hill,
4964
- oo as HillGeometry,
4965
- dn as Jar,
4966
- Ce as JarGeometry,
4967
- on as LShapedStaircaseGeometry,
4968
- Cn as Lantern,
4969
- $o as LeafEffect,
4970
- Fn as LeverPanel,
4971
- Do as LightFlickerAnimation,
4972
- Vo as LightningAnimation,
4973
- rn as LineEquations,
4974
- xn as Mausoleum,
4975
- _e as MausoleumGeometry,
4976
- Ln as Microscope,
4977
- fn as Moon,
4978
- Dn as MortarAndPestle,
4979
- We as MortarGeometry,
4980
- Rn as MossyRocks,
4981
- Ye as MossyRocksGeometry,
4982
- es as Mound,
4983
- no as MoundGeometry,
4984
- ls as NightSkybox,
4985
- vn as ObeliskHeadstone,
4986
- Ue as ObeliskHeadstoneGeometry,
4987
- kn as Panel,
4988
- Vn as PanelLight,
4989
- an as ParallelogramBoxGeometry,
4990
- D as ParametricCurve,
4991
- Ps as ParametricCurveUtils,
4992
- yn as PotionBottle,
4993
- Be as PotionBottleGeometry,
4994
- Bn as Rock,
4995
- Xe as RockGeometry,
4996
- Nn as Rocks,
4997
- Ze as RocksGeometry,
4998
- gn as RoundedHeadstone,
4999
- ze as RoundedHeadstoneGeometry,
5000
- nn as SpiralStaircaseGeometry,
5001
- qn as SpiralTube,
5002
- An as SquareHeadstone,
5003
- Fe as SquareHeadstoneGeometry,
5004
- sn as StaircaseGeometry,
5005
- Yn as Stand,
5006
- to as StandGeometry,
5007
- $n as Star,
5008
- lo as StarShape,
5009
- In as StoneFencePost,
5010
- Le as StoneFencePostGeometry,
5011
- Hn as TeslaCoil,
5012
- eo as TeslaCoilGeometry,
5013
- Xn as TestTube,
5014
- ut as TestTubeGeometry,
5015
- Zn as TestTubeRack,
5016
- Wn as Tree,
5017
- so as TreeGeometry,
5018
- wn as WineBottle,
5019
- Ne as WineBottleGeometry,
5020
- En as WroughtIronBar,
5021
- It as WroughtIronBarGeometry,
5022
- bn as WroughtIronFence,
5023
- De as WroughtIronFenceGeometry,
5024
- ss as addNoiseDisplacement,
5025
- os as addWaterDisplacement,
5026
- ps as alignBufferGeometryToSurface,
5027
- ys as alignInstancedMeshIndexToSurface,
5028
- ds as alignInstancedMeshToSurface,
5029
- fs as alignObjectToSurface,
5030
- ms as alignToEdge,
5031
- hs as alignToRow,
5032
- $e as appendSphericalCurve,
5033
- it as atmosphericShader,
5034
- wo as calculateChannelDifference,
5035
- yo as calculateDistance,
5036
- To as calculateNormal,
5037
- Us as calculateUVBounds,
5038
- At as calculateXFromSlopeIntercept,
5039
- Re as calculateYFromSlopeIntercept,
5040
- Ro as cameraDollyAnimation,
5041
- Bo as cameraFlythroughAnimation,
5042
- No as cameraOrbitAnimation,
5043
- Oo as cameraPendulumAnimation,
5044
- _o as cameraSpiralAscensionAnimation,
5045
- Uo as cameraWobbleAnimation,
5046
- zo as cameraZoomInAnimation,
5047
- Ke as capHeightFromRadius,
5048
- ln as capWidthFromRadius,
5049
- mn as cartesianToSpherical,
5050
- ho as centerMeshGeometry,
5051
- uo as centerObject,
5052
- mo as centerObjectGeometry,
5053
- us as checkerboardTexture,
5054
- ie as circularEaseIn,
5055
- le as circularEaseInOut,
5056
- ce as circularEaseOut,
5057
- he as concave,
5058
- fe as convex,
5059
- xo as createCubicCurvePoints,
5060
- vo as createDampedCurvePoints,
5061
- go as createExponentialCurvePoints,
5062
- tn as createHexagonalTile,
5063
- Ao as createLogarithmicCurvePoints,
5064
- Io as createParabolicCurvePoints,
5065
- Gs as createQuad,
5066
- Eo as createQuadraticCurvePoints,
5067
- bo as createSigmoidCurvePoints,
5068
- Me as cubicCurve,
5069
- Qt as cubicEaseIn,
5070
- $t as cubicEaseInOut,
5071
- Kt as cubicEaseOut,
5072
- So as cubicUVMapping,
5073
- Rs as cubicUVMappingBatch,
5074
- Ns as cylindricalUVMapping,
5075
- xe as dampedCurve,
5076
- ct as daySkyShader,
5077
- qo as displacementBrush,
5078
- ve as exponentialCurve,
5079
- se as exponentialEaseIn,
5080
- ae as exponentialEaseInOut,
5081
- re as exponentialEaseOut,
5082
- as as fadeShader,
5083
- Is as findClosestColor,
5084
- Es as findClosestColorChannelWise,
5085
- Ts as findClosestPoint,
5086
- Yo as flattenBrush,
5087
- we as gaussian,
5088
- bs as getAnalogousColors,
5089
- xs as hexToHsl,
5090
- $ as hexToRgb,
5091
- vs as hslToHex,
5092
- fo as hslToRgb,
5093
- Ss as interpolateCurve,
5094
- ye as inverse,
5095
- ue as linear,
5096
- pe as logarithmic,
5097
- ge as logarithmicCurve,
5098
- Dt as logarithmicRandomMax,
5099
- kt as logarithmicRandomMin,
5100
- ro as moonShader,
5101
- lt as nightSkyShader,
5102
- Ho as noiseBrush,
5103
- gs as normalizeRgb,
5104
- Po as normalizeUV,
5105
- _s as normalizeUVBatch,
5106
- Ae as parabolicCurve,
5107
- Ms as parseHexCode,
5108
- Cs as planarUVMapping,
5109
- Os as polarUVMapping,
5110
- Ie as quadraticCurve,
5111
- Xt as quadraticEaseIn,
5112
- jt as quadraticEaseInOut,
5113
- Zt as quadraticEaseOut,
5114
- Jt as quarticEaseIn,
5115
- te as quarticEaseInOut,
5116
- Wt as quarticEaseOut,
5117
- ee as quinticEaseIn,
5118
- ne as quinticEaseInOut,
5119
- oe as quinticEaseOut,
5120
- cn as radiusFromCapHeight,
5121
- bt as radiusFromCapWidth,
5122
- ht as randomFloat,
5123
- Lo as randomInteger,
5124
- He as randomTransformVertices,
5125
- As as rgbToHex,
5126
- po as rgbToHsl,
5127
- Jo as rowOfBooksByCount,
5128
- Wo as rowOfBooksByLength,
5129
- gt as rowOfBooksByScales,
5130
- ko as setRandomInterval,
5131
- Vt as setRandomTimeout,
5132
- Ee as sigmoidCurve,
5133
- qt as sineEaseIn,
5134
- Ht as sineEaseInOut,
5135
- Yt as sineEaseOut,
5136
- Xo as smoothBrush,
5137
- me as smoothstep,
5138
- un as sphericalToCartesian,
5139
- Bs as sphericalUVMapping,
5140
- Zo as spikeBrush,
5141
- de as squareRoot,
5142
- yt as thetaLengthForRadius,
5143
- jo as twistBrush,
5144
- rs as updateNoiseDisplacementTime,
5145
- ns as updateWaterDisplacementTime
5146
- };
5147
- //# sourceMappingURL=index.es.js.map