three-low-poly 0.9.4 → 0.9.6
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/README.md +4 -4
- package/dist/index.cjs.js +70 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +1103 -661
- package/dist/index.es.js.map +1 -1
- package/dist/index.iife.js +70 -3
- package/dist/index.iife.js.map +1 -1
- package/dist/index.umd.js +70 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -1,244 +1,364 @@
|
|
|
1
|
-
import { Group as
|
|
2
|
-
import { mergeGeometries as
|
|
3
|
-
|
|
1
|
+
import { Vector3 as x, MathUtils as X, Quaternion as re, Group as S, SphereGeometry as A, MeshStandardMaterial as p, Mesh as h, BufferGeometry as b, Float32BufferAttribute as C, BoxGeometry as v, ConeGeometry as N, CylinderGeometry as g, Vector2 as G, LatheGeometry as V, CircleGeometry as ce, DodecahedronGeometry as Q, ShaderMaterial as R, Shape as U, ExtrudeGeometry as z, MeshBasicMaterial as ie, PointLight as ee, TorusGeometry as te, MeshPhysicalMaterial as H, DoubleSide as F, CatmullRomCurve3 as le, TubeGeometry as me, LineBasicMaterial as ue, Line as fe, Path as he, Color as K, BackSide as oe, DataTexture as de, RGBAFormat as pe, UnsignedByteType as we, RepeatWrapping as J, NearestFilter as ye } from "three";
|
|
2
|
+
import { mergeGeometries as T, mergeVertices as Me } from "three/addons/utils/BufferGeometryUtils.js";
|
|
3
|
+
import { Sky as xe } from "three/addons/objects/Sky.js";
|
|
4
|
+
import { EffectComposer as ve } from "three/addons/postprocessing/EffectComposer.js";
|
|
5
|
+
import { RenderPass as $ } from "three/addons/postprocessing/RenderPass.js";
|
|
6
|
+
import { ShaderPass as ge } from "three/addons/postprocessing/ShaderPass.js";
|
|
7
|
+
const E = {
|
|
8
|
+
UP: new x(0, 1, 0),
|
|
9
|
+
DOWN: new x(0, -1, 0),
|
|
10
|
+
LEFT: new x(-1, 0, 0),
|
|
11
|
+
RIGHT: new x(1, 0, 0),
|
|
12
|
+
FORWARD: new x(0, 0, 1),
|
|
13
|
+
BACKWARD: new x(0, 0, -1),
|
|
14
|
+
X: new x(1, 0, 0),
|
|
15
|
+
Y: new x(0, 1, 0),
|
|
16
|
+
Z: new x(0, 0, 1),
|
|
17
|
+
XY: new x(1, 1, 0).normalize(),
|
|
18
|
+
XZ: new x(1, 0, 1).normalize(),
|
|
19
|
+
YZ: new x(0, 1, 1).normalize(),
|
|
20
|
+
XYZ: new x(1, 1, 1).normalize()
|
|
21
|
+
}, L = {
|
|
22
|
+
LINEAR: (i, e) => 1 - i / e,
|
|
23
|
+
QUADRATIC: (i, e) => Math.pow(1 - i / e, 2),
|
|
24
|
+
SQUARE_ROOT: (i, e) => Math.pow(1 - i / e, 0.5),
|
|
25
|
+
LOGARITHMIC: (i, e) => Math.log(1 + (e - i)) / Math.log(1 + e),
|
|
26
|
+
SINE: (i, e) => Math.cos(i / e * Math.PI / 2),
|
|
27
|
+
EXPONENTIAL: (i, e) => Math.exp(-i / e),
|
|
28
|
+
CUBIC: (i, e) => Math.pow(1 - i / e, 3),
|
|
29
|
+
GAUSSIAN: (i, e) => Math.exp(-Math.pow(i, 2) / (2 * Math.pow(e / 3, 2))),
|
|
30
|
+
INVERSE: (i, e) => e / (e + i),
|
|
31
|
+
SMOOTHSTEP: (i, e) => {
|
|
32
|
+
const t = Math.max(0, Math.min(1, 1 - i / e));
|
|
33
|
+
return t * t * (3 - 2 * t);
|
|
34
|
+
}
|
|
35
|
+
}, qe = (i, e, t, o, n = E.UP, r = L.LINEAR) => {
|
|
36
|
+
const s = i.attributes.position;
|
|
37
|
+
for (let a = 0; a < s.count; a++) {
|
|
38
|
+
const c = new x();
|
|
39
|
+
c.fromBufferAttribute(s, a);
|
|
40
|
+
const l = c.distanceTo(e);
|
|
41
|
+
if (l < t) {
|
|
42
|
+
const u = r(l, t) * o;
|
|
43
|
+
c.add(n.clone().multiplyScalar(u)), s.setXYZ(a, c.x, c.y, c.z);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
s.needsUpdate = !0;
|
|
47
|
+
}, Oe = (i, e, t, o, n, r = E.UP, s = L.LINEAR) => {
|
|
48
|
+
const a = i.attributes.position;
|
|
49
|
+
for (let c = 0; c < a.count; c++) {
|
|
50
|
+
const l = new x();
|
|
51
|
+
l.fromBufferAttribute(a, c);
|
|
52
|
+
const m = l.distanceTo(e);
|
|
53
|
+
if (m < t) {
|
|
54
|
+
const f = s(m, t) * n, w = l.dot(r.normalize()), d = o - w;
|
|
55
|
+
l.add(r.clone().multiplyScalar(d * f)), a.setXYZ(c, l.x, l.y, l.z);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
a.needsUpdate = !0;
|
|
59
|
+
}, Ve = (i, e, t, o, n = E.UP, r = L.LINEAR) => {
|
|
60
|
+
const s = i.attributes.position;
|
|
61
|
+
for (let a = 0; a < s.count; a++) {
|
|
62
|
+
const c = new x();
|
|
63
|
+
c.fromBufferAttribute(s, a);
|
|
64
|
+
const l = c.distanceTo(e);
|
|
65
|
+
if (l < t) {
|
|
66
|
+
const m = r(l, t), u = o * m, f = n.clone().normalize();
|
|
67
|
+
f.x !== 0 && (c.x += X.randFloatSpread(u) * f.x), f.y !== 0 && (c.y += X.randFloatSpread(u) * f.y), f.z !== 0 && (c.z += X.randFloatSpread(u) * f.z), s.setXYZ(a, c.x, c.y, c.z);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
s.needsUpdate = !0;
|
|
71
|
+
}, Xe = (i, e, t, o) => {
|
|
72
|
+
const n = i.attributes.position, r = new x();
|
|
73
|
+
for (let s = 0; s < n.count; s++) {
|
|
74
|
+
const a = new x();
|
|
75
|
+
if (a.fromBufferAttribute(n, s), a.distanceTo(e) < t) {
|
|
76
|
+
let l = new x(), m = 0;
|
|
77
|
+
for (let u = 0; u < n.count; u++)
|
|
78
|
+
r.fromBufferAttribute(n, u), r.distanceTo(a) < t && (l.add(r), m++);
|
|
79
|
+
m > 0 && (l.divideScalar(m), a.lerp(l, o), n.setXYZ(s, a.x, a.y, a.z));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
n.needsUpdate = !0;
|
|
83
|
+
}, Ye = (i, e, t, o, n = !1, r = L.LINEAR) => {
|
|
84
|
+
const s = i.attributes.position;
|
|
85
|
+
for (let a = 0; a < s.count; a++) {
|
|
86
|
+
const c = new x();
|
|
87
|
+
c.fromBufferAttribute(s, a);
|
|
88
|
+
const l = c.distanceTo(e);
|
|
89
|
+
if (l < t) {
|
|
90
|
+
const u = r(l, t) * o * (n ? -1 : 1), f = c.clone().sub(e).normalize();
|
|
91
|
+
c.add(f.multiplyScalar(u)), s.setXYZ(a, c.x, c.y, c.z);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
s.needsUpdate = !0;
|
|
95
|
+
}, Ze = (i, e, t, o, n = E.UP, r = L.LINEAR) => {
|
|
96
|
+
const s = i.attributes.position, a = new re();
|
|
97
|
+
for (let c = 0; c < s.count; c++) {
|
|
98
|
+
const l = new x();
|
|
99
|
+
l.fromBufferAttribute(s, c);
|
|
100
|
+
const m = l.distanceTo(e);
|
|
101
|
+
if (m < t) {
|
|
102
|
+
const f = r(m, t) * o;
|
|
103
|
+
a.setFromAxisAngle(n, f), l.sub(e).applyQuaternion(a).add(e), s.setXYZ(c, l.x, l.y, l.z);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
s.needsUpdate = !0;
|
|
107
|
+
}, Qe = {
|
|
108
|
+
LINEAR: (i) => i,
|
|
109
|
+
QUADRATIC_EASE_IN: (i) => i * i,
|
|
110
|
+
QUADRATIC_EASE_OUT: (i) => 1 - Math.pow(1 - i, 2),
|
|
111
|
+
SQUARE_ROOT_EASING: (i) => Math.sqrt(i),
|
|
112
|
+
LOGARITHMIC_EASING: (i) => Math.log(1 + i) / Math.log(2),
|
|
113
|
+
SINE_EASE_IN: (i) => 1 - Math.cos(i * Math.PI / 2),
|
|
114
|
+
SINE_EASE_OUT: (i) => Math.sin(i * Math.PI / 2),
|
|
115
|
+
EXPONENTIAL_EASE_IN: (i) => Math.pow(2, 10 * (i - 1)),
|
|
116
|
+
EXPONENTIAL_EASE_OUT: (i) => 1 - Math.pow(2, -10 * i),
|
|
117
|
+
CUBIC_EASE_IN: (i) => i * i * i,
|
|
118
|
+
CUBIC_EASE_OUT: (i) => 1 - Math.pow(1 - i, 3),
|
|
119
|
+
GAUSSIAN_EASING: (i) => Math.exp(-Math.pow(i - 0.5, 2) / (2 * 0.1)),
|
|
120
|
+
INVERSE_EASING: (i) => 1 / (1 + i),
|
|
121
|
+
SMOOTHSTEP_EASING: (i) => i * i * (3 - 2 * i)
|
|
122
|
+
};
|
|
123
|
+
class Re extends S {
|
|
4
124
|
constructor() {
|
|
5
125
|
super();
|
|
6
|
-
const e = [],
|
|
126
|
+
const e = [], t = 20, o = new A(0.1, 6, 6), n = new p({
|
|
7
127
|
color: 16777215,
|
|
8
128
|
transparent: !0,
|
|
9
129
|
opacity: 0.6,
|
|
10
130
|
roughness: 0.3,
|
|
11
131
|
metalness: 0.3
|
|
12
132
|
});
|
|
13
|
-
for (let a = 0; a <
|
|
14
|
-
const
|
|
15
|
-
|
|
133
|
+
for (let a = 0; a < t; a++) {
|
|
134
|
+
const c = new h(o, n);
|
|
135
|
+
c.position.set(
|
|
16
136
|
(Math.random() - 0.5) * 1.5,
|
|
17
137
|
// Random x position within flask
|
|
18
138
|
Math.random() * 3,
|
|
19
139
|
// Random y position within flask height
|
|
20
140
|
(Math.random() - 0.5) * 1.5
|
|
21
141
|
// Random z position within flask
|
|
22
|
-
), e.push(
|
|
142
|
+
), e.push(c), this.add(c);
|
|
23
143
|
}
|
|
24
144
|
function r() {
|
|
25
145
|
e.forEach((a) => {
|
|
26
146
|
a.position.y += 0.02, a.position.y > 3 && (a.position.y = 0, a.position.x = (Math.random() - 0.5) * 1.5, a.position.z = (Math.random() - 0.5) * 1.5);
|
|
27
147
|
});
|
|
28
148
|
}
|
|
29
|
-
function
|
|
30
|
-
requestAnimationFrame(
|
|
149
|
+
function s() {
|
|
150
|
+
requestAnimationFrame(s), r();
|
|
31
151
|
}
|
|
32
|
-
|
|
152
|
+
s();
|
|
33
153
|
}
|
|
34
154
|
}
|
|
35
|
-
class
|
|
36
|
-
constructor(e = 2,
|
|
155
|
+
class He extends b {
|
|
156
|
+
constructor(e = 2, t = 0.3, o = 0.6, n = 5, r = 5, s = Math.PI / 4) {
|
|
37
157
|
super();
|
|
38
|
-
const a = [],
|
|
39
|
-
for (let
|
|
40
|
-
const
|
|
158
|
+
const a = [], c = [];
|
|
159
|
+
for (let w = 0; w < n; w++) {
|
|
160
|
+
const d = w * t, M = d + t, y = w * o, P = y + o;
|
|
41
161
|
a.push(
|
|
42
162
|
// Vertical riser
|
|
43
163
|
-e / 2,
|
|
44
|
-
|
|
164
|
+
d,
|
|
45
165
|
y,
|
|
46
166
|
// Bottom-left
|
|
47
167
|
e / 2,
|
|
48
|
-
|
|
168
|
+
d,
|
|
49
169
|
y,
|
|
50
170
|
// Bottom-right
|
|
51
171
|
e / 2,
|
|
52
|
-
|
|
172
|
+
M,
|
|
53
173
|
y,
|
|
54
174
|
// Top-right
|
|
55
175
|
-e / 2,
|
|
56
|
-
|
|
176
|
+
M,
|
|
57
177
|
y,
|
|
58
178
|
// Top-left
|
|
59
179
|
// Horizontal tread
|
|
60
180
|
-e / 2,
|
|
61
|
-
|
|
181
|
+
M,
|
|
62
182
|
y,
|
|
63
183
|
// Top-left
|
|
64
184
|
e / 2,
|
|
65
|
-
|
|
185
|
+
M,
|
|
66
186
|
y,
|
|
67
187
|
// Top-right
|
|
68
188
|
e / 2,
|
|
69
|
-
|
|
70
|
-
|
|
189
|
+
M,
|
|
190
|
+
P,
|
|
71
191
|
// Back-right
|
|
72
192
|
-e / 2,
|
|
73
|
-
|
|
74
|
-
|
|
193
|
+
M,
|
|
194
|
+
P
|
|
75
195
|
// Back-left
|
|
76
196
|
);
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
),
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
197
|
+
const I = w * 8;
|
|
198
|
+
c.push(
|
|
199
|
+
I,
|
|
200
|
+
I + 1,
|
|
201
|
+
I + 2,
|
|
202
|
+
I,
|
|
203
|
+
I + 2,
|
|
204
|
+
I + 3
|
|
205
|
+
), c.push(
|
|
206
|
+
I + 4,
|
|
207
|
+
I + 5,
|
|
208
|
+
I + 6,
|
|
209
|
+
I + 4,
|
|
210
|
+
I + 6,
|
|
211
|
+
I + 7
|
|
92
212
|
);
|
|
93
213
|
}
|
|
94
|
-
const
|
|
214
|
+
const l = n * t, m = n * o, u = e * 2;
|
|
95
215
|
a.push(
|
|
96
216
|
// Landing platform (4 vertices)
|
|
97
|
-
-
|
|
98
|
-
c,
|
|
217
|
+
-u / 2,
|
|
99
218
|
l,
|
|
219
|
+
m,
|
|
100
220
|
// Bottom-left
|
|
101
|
-
|
|
102
|
-
c,
|
|
221
|
+
u / 2,
|
|
103
222
|
l,
|
|
223
|
+
m,
|
|
104
224
|
// Bottom-right
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
225
|
+
u / 2,
|
|
226
|
+
l,
|
|
227
|
+
m + o,
|
|
108
228
|
// Top-right
|
|
109
|
-
-
|
|
110
|
-
|
|
111
|
-
|
|
229
|
+
-u / 2,
|
|
230
|
+
l,
|
|
231
|
+
m + o
|
|
112
232
|
// Top-left
|
|
113
233
|
);
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
234
|
+
const f = n * 8;
|
|
235
|
+
c.push(
|
|
236
|
+
f,
|
|
237
|
+
f + 1,
|
|
238
|
+
f + 2,
|
|
119
239
|
// First triangle for landing
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
240
|
+
f,
|
|
241
|
+
f + 2,
|
|
242
|
+
f + 3
|
|
123
243
|
// Second triangle for landing
|
|
124
244
|
);
|
|
125
|
-
for (let
|
|
126
|
-
const
|
|
127
|
-
for (let
|
|
128
|
-
const y =
|
|
245
|
+
for (let w = 0; w < 2; w++) {
|
|
246
|
+
const d = w === 0 ? 1 : -1;
|
|
247
|
+
for (let M = 0; M < r; M++) {
|
|
248
|
+
const y = l + M * t, P = y + t, I = d * (u / 4), _ = m + o, j = M * o * Math.cos(s), se = M * o * Math.sin(s), q = I + d * j - e / 2 * Math.cos(s), O = I + d * j + e / 2 * Math.cos(s), B = _ + se, ne = q + d * o * Math.cos(s), ae = O + d * o * Math.cos(s), D = B + o * Math.sin(s);
|
|
129
249
|
a.push(
|
|
130
250
|
// Vertical riser
|
|
131
|
-
|
|
251
|
+
q,
|
|
132
252
|
y,
|
|
133
253
|
B,
|
|
134
254
|
// Bottom-left
|
|
135
|
-
|
|
255
|
+
O,
|
|
136
256
|
y,
|
|
137
257
|
B,
|
|
138
258
|
// Bottom-right
|
|
139
|
-
|
|
140
|
-
|
|
259
|
+
O,
|
|
260
|
+
P,
|
|
141
261
|
B,
|
|
142
262
|
// Top-right
|
|
143
|
-
|
|
144
|
-
|
|
263
|
+
q,
|
|
264
|
+
P,
|
|
145
265
|
B,
|
|
146
266
|
// Top-left
|
|
147
267
|
// Horizontal tread
|
|
148
|
-
|
|
149
|
-
|
|
268
|
+
q,
|
|
269
|
+
P,
|
|
150
270
|
B,
|
|
151
271
|
// Top-left
|
|
152
|
-
|
|
153
|
-
|
|
272
|
+
O,
|
|
273
|
+
P,
|
|
154
274
|
B,
|
|
155
275
|
// Top-right
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
276
|
+
ae,
|
|
277
|
+
P,
|
|
278
|
+
D,
|
|
159
279
|
// Back-right
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
280
|
+
ne,
|
|
281
|
+
P,
|
|
282
|
+
D
|
|
163
283
|
// Back-left
|
|
164
284
|
);
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
),
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
285
|
+
const k = f + 4 + w * r * 8 + M * 8;
|
|
286
|
+
c.push(
|
|
287
|
+
k,
|
|
288
|
+
k + 1,
|
|
289
|
+
k + 2,
|
|
290
|
+
k,
|
|
291
|
+
k + 2,
|
|
292
|
+
k + 3
|
|
293
|
+
), c.push(
|
|
294
|
+
k + 4,
|
|
295
|
+
k + 5,
|
|
296
|
+
k + 6,
|
|
297
|
+
k + 4,
|
|
298
|
+
k + 6,
|
|
299
|
+
k + 7
|
|
180
300
|
);
|
|
181
301
|
}
|
|
182
302
|
}
|
|
183
|
-
this.setIndex(
|
|
303
|
+
this.setIndex(c), this.setAttribute("position", new C(a, 3)), this.computeVertexNormals();
|
|
184
304
|
}
|
|
185
305
|
}
|
|
186
|
-
class
|
|
187
|
-
constructor(e = 5,
|
|
306
|
+
class je extends b {
|
|
307
|
+
constructor(e = 5, t = 3, o = 5, n = 0.2) {
|
|
188
308
|
super();
|
|
189
309
|
const r = [
|
|
190
310
|
// Floor vertices
|
|
191
311
|
-e / 2,
|
|
192
312
|
0,
|
|
193
|
-
-
|
|
313
|
+
-o / 2,
|
|
194
314
|
// 0
|
|
195
315
|
e / 2,
|
|
196
316
|
0,
|
|
197
|
-
-
|
|
317
|
+
-o / 2,
|
|
198
318
|
// 1
|
|
199
319
|
e / 2,
|
|
200
320
|
0,
|
|
201
|
-
|
|
321
|
+
o / 2,
|
|
202
322
|
// 2
|
|
203
323
|
-e / 2,
|
|
204
324
|
0,
|
|
205
|
-
|
|
325
|
+
o / 2,
|
|
206
326
|
// 3
|
|
207
327
|
// Back wall vertices
|
|
208
328
|
-e / 2,
|
|
209
329
|
0,
|
|
210
|
-
-
|
|
330
|
+
-o / 2,
|
|
211
331
|
// 4
|
|
212
332
|
e / 2,
|
|
213
333
|
0,
|
|
214
|
-
-
|
|
334
|
+
-o / 2,
|
|
215
335
|
// 5
|
|
216
336
|
e / 2,
|
|
217
|
-
|
|
218
|
-
-
|
|
337
|
+
t,
|
|
338
|
+
-o / 2,
|
|
219
339
|
// 6
|
|
220
340
|
-e / 2,
|
|
221
|
-
|
|
222
|
-
-
|
|
341
|
+
t,
|
|
342
|
+
-o / 2,
|
|
223
343
|
// 7
|
|
224
344
|
// Left wall vertices
|
|
225
345
|
-e / 2,
|
|
226
346
|
0,
|
|
227
|
-
-
|
|
347
|
+
-o / 2,
|
|
228
348
|
// 8
|
|
229
349
|
-e / 2,
|
|
230
350
|
0,
|
|
231
|
-
|
|
351
|
+
o / 2,
|
|
232
352
|
// 9
|
|
233
353
|
-e / 2,
|
|
234
|
-
|
|
235
|
-
|
|
354
|
+
t,
|
|
355
|
+
o / 2,
|
|
236
356
|
// 10
|
|
237
357
|
-e / 2,
|
|
238
|
-
|
|
239
|
-
-
|
|
358
|
+
t,
|
|
359
|
+
-o / 2
|
|
240
360
|
// 11
|
|
241
|
-
],
|
|
361
|
+
], s = [
|
|
242
362
|
// Floor
|
|
243
363
|
0,
|
|
244
364
|
1,
|
|
@@ -261,52 +381,52 @@ class de extends g {
|
|
|
261
381
|
10,
|
|
262
382
|
11
|
|
263
383
|
];
|
|
264
|
-
this.setIndex(
|
|
384
|
+
this.setIndex(s), this.setAttribute("position", new C(r, 3)), this.computeVertexNormals();
|
|
265
385
|
}
|
|
266
386
|
}
|
|
267
|
-
class
|
|
268
|
-
constructor(e = 2,
|
|
387
|
+
class De extends b {
|
|
388
|
+
constructor(e = 2, t = 0.3, o = 0.5, n = 5, r = 2) {
|
|
269
389
|
super();
|
|
270
|
-
const
|
|
271
|
-
for (let
|
|
272
|
-
const
|
|
273
|
-
|
|
390
|
+
const s = [], a = [];
|
|
391
|
+
for (let u = 0; u < n; u++) {
|
|
392
|
+
const f = u * t, w = f + t, d = u * o, M = d + o;
|
|
393
|
+
s.push(
|
|
274
394
|
// Vertical riser
|
|
275
395
|
-e / 2,
|
|
276
|
-
w,
|
|
277
396
|
f,
|
|
397
|
+
d,
|
|
278
398
|
// Bottom-left
|
|
279
399
|
e / 2,
|
|
280
|
-
w,
|
|
281
400
|
f,
|
|
401
|
+
d,
|
|
282
402
|
// Bottom-right
|
|
283
403
|
e / 2,
|
|
284
|
-
|
|
285
|
-
|
|
404
|
+
w,
|
|
405
|
+
d,
|
|
286
406
|
// Top-right
|
|
287
407
|
-e / 2,
|
|
288
|
-
|
|
289
|
-
|
|
408
|
+
w,
|
|
409
|
+
d,
|
|
290
410
|
// Top-left
|
|
291
411
|
// Horizontal tread
|
|
292
412
|
-e / 2,
|
|
293
|
-
|
|
294
|
-
|
|
413
|
+
w,
|
|
414
|
+
d,
|
|
295
415
|
// Top-left
|
|
296
416
|
e / 2,
|
|
297
|
-
|
|
298
|
-
|
|
417
|
+
w,
|
|
418
|
+
d,
|
|
299
419
|
// Top-right
|
|
300
420
|
e / 2,
|
|
301
|
-
|
|
302
|
-
|
|
421
|
+
w,
|
|
422
|
+
M,
|
|
303
423
|
// Back-right
|
|
304
424
|
-e / 2,
|
|
305
|
-
|
|
306
|
-
|
|
425
|
+
w,
|
|
426
|
+
M
|
|
307
427
|
// Back-left
|
|
308
428
|
);
|
|
309
|
-
const y =
|
|
429
|
+
const y = u * 8;
|
|
310
430
|
a.push(
|
|
311
431
|
y,
|
|
312
432
|
y + 1,
|
|
@@ -323,76 +443,76 @@ class Ge extends g {
|
|
|
323
443
|
y + 7
|
|
324
444
|
);
|
|
325
445
|
}
|
|
326
|
-
const
|
|
327
|
-
|
|
446
|
+
const c = n * t, l = n * o;
|
|
447
|
+
s.push(
|
|
328
448
|
// Landing platform (4 vertices)
|
|
329
449
|
-e / 2,
|
|
330
|
-
i,
|
|
331
450
|
c,
|
|
451
|
+
l,
|
|
332
452
|
// Bottom-left
|
|
333
453
|
e / 2,
|
|
334
|
-
i,
|
|
335
454
|
c,
|
|
455
|
+
l,
|
|
336
456
|
// Bottom-right
|
|
337
457
|
e / 2,
|
|
338
|
-
|
|
339
|
-
|
|
458
|
+
c,
|
|
459
|
+
l + r,
|
|
340
460
|
// Top-right
|
|
341
461
|
-e / 2,
|
|
342
|
-
|
|
343
|
-
|
|
462
|
+
c,
|
|
463
|
+
l + r
|
|
344
464
|
// Top-left
|
|
345
465
|
);
|
|
346
|
-
const
|
|
466
|
+
const m = n * 8;
|
|
347
467
|
a.push(
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
468
|
+
m,
|
|
469
|
+
m + 1,
|
|
470
|
+
m + 2,
|
|
351
471
|
// First triangle for landing
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
472
|
+
m,
|
|
473
|
+
m + 2,
|
|
474
|
+
m + 3
|
|
355
475
|
// Second triangle for landing
|
|
356
476
|
);
|
|
357
|
-
for (let
|
|
358
|
-
const
|
|
359
|
-
|
|
477
|
+
for (let u = 0; u < n; u++) {
|
|
478
|
+
const f = c + u * t, w = f + t, d = -e / 2 - u * o, M = d - o;
|
|
479
|
+
s.push(
|
|
360
480
|
// Vertical riser
|
|
481
|
+
d,
|
|
361
482
|
f,
|
|
362
|
-
|
|
363
|
-
c + r,
|
|
483
|
+
l + r,
|
|
364
484
|
// Bottom-left
|
|
485
|
+
d,
|
|
365
486
|
f,
|
|
366
|
-
|
|
367
|
-
c + r - e,
|
|
487
|
+
l + r - e,
|
|
368
488
|
// Bottom-right
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
489
|
+
d,
|
|
490
|
+
w,
|
|
491
|
+
l + r - e,
|
|
372
492
|
// Top-right
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
493
|
+
d,
|
|
494
|
+
w,
|
|
495
|
+
l + r,
|
|
376
496
|
// Top-left
|
|
377
497
|
// Horizontal tread
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
498
|
+
d,
|
|
499
|
+
w,
|
|
500
|
+
l + r,
|
|
381
501
|
// Top-left
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
502
|
+
d,
|
|
503
|
+
w,
|
|
504
|
+
l + r - e,
|
|
385
505
|
// Top-right
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
506
|
+
M,
|
|
507
|
+
w,
|
|
508
|
+
l + r - e,
|
|
389
509
|
// Back-right
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
510
|
+
M,
|
|
511
|
+
w,
|
|
512
|
+
l + r
|
|
393
513
|
// Back-left
|
|
394
514
|
);
|
|
395
|
-
const y =
|
|
515
|
+
const y = m + 4 + u * 8;
|
|
396
516
|
a.push(
|
|
397
517
|
y,
|
|
398
518
|
y + 1,
|
|
@@ -409,211 +529,211 @@ class Ge extends g {
|
|
|
409
529
|
y + 7
|
|
410
530
|
);
|
|
411
531
|
}
|
|
412
|
-
this.setIndex(a), this.setAttribute("position", new
|
|
532
|
+
this.setIndex(a), this.setAttribute("position", new C(s, 3)), this.computeVertexNormals();
|
|
413
533
|
}
|
|
414
534
|
}
|
|
415
|
-
class
|
|
416
|
-
constructor(e = 1,
|
|
535
|
+
class Ke extends b {
|
|
536
|
+
constructor(e = 1, t = 0.4, o = 0.2, n = 20, r = 2, s = Math.PI / 8) {
|
|
417
537
|
super();
|
|
418
|
-
const a = [],
|
|
419
|
-
let
|
|
420
|
-
for (let
|
|
421
|
-
const
|
|
538
|
+
const a = [], c = [];
|
|
539
|
+
let l = 0;
|
|
540
|
+
for (let m = 0; m < n; m++) {
|
|
541
|
+
const u = r * Math.cos(l), f = r * Math.sin(l), w = m * o, d = w + o;
|
|
422
542
|
a.push(
|
|
423
543
|
// Front face (vertical riser)
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
544
|
+
u - e / 2 * Math.cos(l),
|
|
545
|
+
w,
|
|
546
|
+
f - e / 2 * Math.sin(l),
|
|
427
547
|
// Bottom-left
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
548
|
+
u + e / 2 * Math.cos(l),
|
|
549
|
+
w,
|
|
550
|
+
f + e / 2 * Math.sin(l),
|
|
431
551
|
// Bottom-right
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
552
|
+
u + e / 2 * Math.cos(l),
|
|
553
|
+
d,
|
|
554
|
+
f + e / 2 * Math.sin(l),
|
|
435
555
|
// Top-right
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
556
|
+
u - e / 2 * Math.cos(l),
|
|
557
|
+
d,
|
|
558
|
+
f - e / 2 * Math.sin(l)
|
|
439
559
|
// Top-left
|
|
440
560
|
), a.push(
|
|
441
561
|
// Top face (horizontal tread)
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
562
|
+
u - e / 2 * Math.cos(l),
|
|
563
|
+
d,
|
|
564
|
+
f - e / 2 * Math.sin(l),
|
|
445
565
|
// Top-left-front
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
566
|
+
u + e / 2 * Math.cos(l),
|
|
567
|
+
d,
|
|
568
|
+
f + e / 2 * Math.sin(l),
|
|
449
569
|
// Top-right-front
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
570
|
+
u + e / 2 * Math.cos(l) - t * Math.sin(l),
|
|
571
|
+
d,
|
|
572
|
+
f + e / 2 * Math.sin(l) + t * Math.cos(l),
|
|
453
573
|
// Back-right
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
574
|
+
u - e / 2 * Math.cos(l) - t * Math.sin(l),
|
|
575
|
+
d,
|
|
576
|
+
f - e / 2 * Math.sin(l) + t * Math.cos(l)
|
|
457
577
|
// Back-left
|
|
458
578
|
);
|
|
459
|
-
const
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
579
|
+
const M = m * 8;
|
|
580
|
+
c.push(
|
|
581
|
+
M,
|
|
582
|
+
M + 1,
|
|
583
|
+
M + 2,
|
|
464
584
|
// First triangle for riser
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
585
|
+
M,
|
|
586
|
+
M + 2,
|
|
587
|
+
M + 3
|
|
468
588
|
// Second triangle for riser
|
|
469
|
-
),
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
589
|
+
), c.push(
|
|
590
|
+
M + 4,
|
|
591
|
+
M + 5,
|
|
592
|
+
M + 6,
|
|
473
593
|
// First triangle for tread
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
594
|
+
M + 4,
|
|
595
|
+
M + 6,
|
|
596
|
+
M + 7
|
|
477
597
|
// Second triangle for tread
|
|
478
|
-
),
|
|
598
|
+
), l += s;
|
|
479
599
|
}
|
|
480
|
-
this.setIndex(
|
|
600
|
+
this.setIndex(c), this.setAttribute("position", new C(a, 3)), this.computeVertexNormals();
|
|
481
601
|
}
|
|
482
602
|
}
|
|
483
|
-
class
|
|
484
|
-
constructor(e = 2,
|
|
603
|
+
class Je extends b {
|
|
604
|
+
constructor(e = 2, t = 0.3, o = 0.5, n = 10) {
|
|
485
605
|
super();
|
|
486
|
-
const r = [],
|
|
487
|
-
for (let a = 0; a <
|
|
488
|
-
const
|
|
606
|
+
const r = [], s = [];
|
|
607
|
+
for (let a = 0; a < n; a++) {
|
|
608
|
+
const c = a * t, l = c + t, m = a * o, u = m + o;
|
|
489
609
|
r.push(
|
|
490
610
|
// Bottom face of riser (front face)
|
|
491
611
|
-e / 2,
|
|
492
|
-
|
|
493
|
-
|
|
612
|
+
c,
|
|
613
|
+
m,
|
|
494
614
|
// 0: Bottom-left-front
|
|
495
615
|
e / 2,
|
|
496
|
-
|
|
497
|
-
|
|
616
|
+
c,
|
|
617
|
+
m,
|
|
498
618
|
// 1: Bottom-right-front
|
|
499
619
|
e / 2,
|
|
500
|
-
c,
|
|
501
620
|
l,
|
|
621
|
+
m,
|
|
502
622
|
// 2: Top-right-front
|
|
503
623
|
-e / 2,
|
|
504
|
-
c,
|
|
505
624
|
l,
|
|
625
|
+
m,
|
|
506
626
|
// 3: Top-left-front
|
|
507
627
|
// Top face of tread (horizontal step)
|
|
508
628
|
-e / 2,
|
|
509
|
-
c,
|
|
510
629
|
l,
|
|
630
|
+
m,
|
|
511
631
|
// 4: Top-left-front (repeated)
|
|
512
632
|
e / 2,
|
|
513
|
-
c,
|
|
514
633
|
l,
|
|
634
|
+
m,
|
|
515
635
|
// 5: Top-right-front (repeated)
|
|
516
636
|
e / 2,
|
|
517
|
-
|
|
518
|
-
|
|
637
|
+
l,
|
|
638
|
+
u,
|
|
519
639
|
// 6: Top-right-back
|
|
520
640
|
-e / 2,
|
|
521
|
-
|
|
522
|
-
|
|
641
|
+
l,
|
|
642
|
+
u
|
|
523
643
|
// 7: Top-left-back
|
|
524
644
|
);
|
|
525
|
-
const
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
645
|
+
const f = a * 8;
|
|
646
|
+
s.push(
|
|
647
|
+
f,
|
|
648
|
+
f + 1,
|
|
649
|
+
f + 2,
|
|
530
650
|
// First triangle for riser
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
651
|
+
f,
|
|
652
|
+
f + 2,
|
|
653
|
+
f + 3
|
|
534
654
|
// Second triangle for riser
|
|
535
|
-
),
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
655
|
+
), s.push(
|
|
656
|
+
f + 4,
|
|
657
|
+
f + 6,
|
|
658
|
+
f + 5,
|
|
539
659
|
// First triangle for tread
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
660
|
+
f + 4,
|
|
661
|
+
f + 7,
|
|
662
|
+
f + 6
|
|
543
663
|
// Second triangle for tread
|
|
544
664
|
);
|
|
545
665
|
}
|
|
546
|
-
this.setIndex(
|
|
666
|
+
this.setIndex(s), this.setAttribute("position", new C(r, 3)), this.computeVertexNormals();
|
|
547
667
|
}
|
|
548
668
|
}
|
|
549
|
-
class
|
|
550
|
-
constructor(e = 0.4,
|
|
669
|
+
class $e extends b {
|
|
670
|
+
constructor(e = 0.4, t = 1.2, o = 0.2) {
|
|
551
671
|
super();
|
|
552
|
-
const
|
|
553
|
-
r.translate(0,
|
|
554
|
-
const
|
|
555
|
-
a.translate(0,
|
|
672
|
+
const n = t * 0.6, r = new v(e / 2, n, o);
|
|
673
|
+
r.translate(0, n / 2, 0);
|
|
674
|
+
const s = e * 1.5, a = new v(s, e / 4, o);
|
|
675
|
+
a.translate(0, n * 0.75, 0), this.copy(T([r, a], !1));
|
|
556
676
|
}
|
|
557
677
|
}
|
|
558
|
-
class
|
|
559
|
-
constructor(e = 1.75,
|
|
678
|
+
class We extends b {
|
|
679
|
+
constructor(e = 1.75, t = 0.75) {
|
|
560
680
|
super();
|
|
561
|
-
const
|
|
681
|
+
const o = e * 0.05, n = e * 0.15, r = e * 0.15, s = e * 0.75;
|
|
562
682
|
let a = 0;
|
|
563
|
-
const
|
|
564
|
-
|
|
565
|
-
const
|
|
566
|
-
|
|
567
|
-
const
|
|
568
|
-
|
|
569
|
-
const
|
|
570
|
-
|
|
571
|
-
const
|
|
572
|
-
|
|
573
|
-
|
|
683
|
+
const c = new v(t, o, t);
|
|
684
|
+
c.translate(0, a + o / 2, 0), a += o;
|
|
685
|
+
const l = new v(t * 0.8, n, t * 0.8);
|
|
686
|
+
l.translate(0, a + n / 2, 0), a += n;
|
|
687
|
+
const m = new v(t * 0.6, r, t * 0.6);
|
|
688
|
+
m.translate(0, a + r / 2, 0), a += r;
|
|
689
|
+
const u = new v(t * 0.4, s, t * 0.4);
|
|
690
|
+
u.translate(0, a + s / 2, 0), a += s;
|
|
691
|
+
const f = new N(t * 0.4 / Math.sqrt(2), 0.1, 4, 1, !1, Math.PI / 4);
|
|
692
|
+
f.translate(0, a + 0.1 / 2, 0), this.copy(
|
|
693
|
+
T([c, l, m, u, f], !1)
|
|
574
694
|
);
|
|
575
695
|
}
|
|
576
696
|
}
|
|
577
|
-
class
|
|
578
|
-
constructor(e = 0.6,
|
|
697
|
+
class et extends b {
|
|
698
|
+
constructor(e = 0.6, t = 1, o = 0.2) {
|
|
579
699
|
super();
|
|
580
|
-
const
|
|
581
|
-
r.translate(0,
|
|
582
|
-
const
|
|
583
|
-
a.rotateY(Math.PI / 2), a.rotateX(Math.PI / 2), a.translate(0,
|
|
700
|
+
const n = t * 0.7, r = new v(e, n, o);
|
|
701
|
+
r.translate(0, n / 2, 0);
|
|
702
|
+
const s = t - n, a = new g(e / 2, e / 2, o, 16, 1, !1, 0, Math.PI);
|
|
703
|
+
a.rotateY(Math.PI / 2), a.rotateX(Math.PI / 2), a.translate(0, n + s / 2 - o / 2 - 0.05, 0), this.copy(T([r, a], !1));
|
|
584
704
|
}
|
|
585
705
|
}
|
|
586
|
-
class
|
|
587
|
-
constructor(e = 0.5,
|
|
706
|
+
class tt extends b {
|
|
707
|
+
constructor(e = 0.5, t = 0.8, o = 0.15) {
|
|
588
708
|
super();
|
|
589
|
-
const
|
|
590
|
-
|
|
709
|
+
const n = new v(e, t, o);
|
|
710
|
+
n.translate(0, t / 2, 0), this.copy(n);
|
|
591
711
|
}
|
|
592
712
|
}
|
|
593
|
-
class
|
|
713
|
+
class ot extends b {
|
|
594
714
|
constructor(e = 2.25) {
|
|
595
715
|
super();
|
|
596
|
-
const
|
|
597
|
-
|
|
598
|
-
const
|
|
599
|
-
|
|
600
|
-
const
|
|
601
|
-
|
|
716
|
+
const t = new v(1.2, 0.5, 1.2);
|
|
717
|
+
t.translate(0, 0.25, 0);
|
|
718
|
+
const o = new v(1, e, 1);
|
|
719
|
+
o.translate(0, 0.5 + e / 2, 0);
|
|
720
|
+
const n = new v(1.4, 0.3, 1.4);
|
|
721
|
+
n.translate(0, 0.5 + e + 0.15, 0), this.copy(T([t, o, n], !1));
|
|
602
722
|
}
|
|
603
723
|
}
|
|
604
|
-
class
|
|
605
|
-
constructor(e = 2,
|
|
724
|
+
class st extends b {
|
|
725
|
+
constructor(e = 2, t = 0.05, o = 0.3) {
|
|
606
726
|
super();
|
|
607
|
-
const
|
|
608
|
-
|
|
609
|
-
const r = new
|
|
610
|
-
r.translate(0, e +
|
|
727
|
+
const n = new g(t, t, e, 8);
|
|
728
|
+
n.translate(0, e / 2, 0);
|
|
729
|
+
const r = new N(t * 1.5, o, 8);
|
|
730
|
+
r.translate(0, e + o / 2, 0), this.copy(T([n, r], !1));
|
|
611
731
|
}
|
|
612
732
|
}
|
|
613
|
-
class
|
|
733
|
+
class nt extends b {
|
|
614
734
|
constructor(e = 0.1) {
|
|
615
735
|
super();
|
|
616
|
-
const
|
|
736
|
+
const t = [], o = [], n = [
|
|
617
737
|
[0, 1],
|
|
618
738
|
// Top point
|
|
619
739
|
[0.5, 0.75],
|
|
@@ -631,73 +751,115 @@ class Be extends g {
|
|
|
631
751
|
[-0.5, 0.75]
|
|
632
752
|
// Left upper middle
|
|
633
753
|
];
|
|
634
|
-
for (let
|
|
635
|
-
const [a,
|
|
636
|
-
|
|
754
|
+
for (let s = 0; s < n.length; s++) {
|
|
755
|
+
const [a, c] = n[s];
|
|
756
|
+
t.push(a * e, c * e, 0);
|
|
637
757
|
}
|
|
638
|
-
for (let
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
const r = new
|
|
642
|
-
this.setAttribute("position", r), this.setIndex(
|
|
758
|
+
for (let s = 1; s < n.length - 1; s++)
|
|
759
|
+
o.push(0, s, s + 1);
|
|
760
|
+
o.push(0, n.length - 1, 1);
|
|
761
|
+
const r = new C(t, 3);
|
|
762
|
+
this.setAttribute("position", r), this.setIndex(o), this.computeVertexNormals();
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
function Se(i, e = E.XYZ, t = 0.5, o = 2) {
|
|
766
|
+
i.deleteAttribute("uv"), i.deleteAttribute("normal"), i = Me(i), i.computeVertexNormals();
|
|
767
|
+
const n = i.getAttribute("position");
|
|
768
|
+
for (let r = 0; r < n.count; r++) {
|
|
769
|
+
const s = new x().fromBufferAttribute(n, r), a = Math.random() * (o - t) + t, c = e.clone().multiplyScalar(a);
|
|
770
|
+
s.add(c), n.setXYZ(r, s.x, s.y, s.z);
|
|
771
|
+
}
|
|
772
|
+
return n.needsUpdate = !0, i.computeVertexNormals(), i;
|
|
773
|
+
}
|
|
774
|
+
class be extends b {
|
|
775
|
+
constructor(e = 1, t = 4, o = 4) {
|
|
776
|
+
super();
|
|
777
|
+
const n = new A(e, t, o);
|
|
778
|
+
this.copy(Se(n, E.XYZ, 0.5, 1)), this.computeVertexNormals(), this.center();
|
|
643
779
|
}
|
|
644
780
|
}
|
|
645
|
-
class
|
|
646
|
-
constructor(e = 0.1,
|
|
781
|
+
class at extends b {
|
|
782
|
+
constructor(e = 0.1, t = 0.1, o = 0.4, n = 8) {
|
|
647
783
|
super();
|
|
648
|
-
const r = new
|
|
784
|
+
const r = new g(e * 0.6, t * 0.6, o, n);
|
|
649
785
|
r.translate(0, 0, 0);
|
|
650
|
-
const
|
|
651
|
-
a.translate(0,
|
|
786
|
+
const s = new A(e, n, n), a = s.clone(), c = s.clone(), l = s.clone(), m = s.clone();
|
|
787
|
+
a.translate(0, o / 2 + e * 0.6, -e * 0.6), c.translate(0, o / 2 + e * 0.6, e * 0.6), l.translate(0, -o / 2 - t * 0.6, -t * 0.6), m.translate(0, -o / 2 - t * 0.6, t * 0.6), this.copy(T([r, a, c, l, m], !1));
|
|
652
788
|
}
|
|
653
789
|
}
|
|
654
|
-
class
|
|
790
|
+
class Ge extends b {
|
|
655
791
|
constructor() {
|
|
656
792
|
super();
|
|
657
|
-
const e = new
|
|
658
|
-
|
|
793
|
+
const e = new A(1, 16, 16), t = new g(0.2, 0.2, 2, 16, 1, !0);
|
|
794
|
+
t.translate(0, 1.5, 0), t.rotateX(Math.PI / 2), this.copy(T([e, t], !1));
|
|
659
795
|
}
|
|
660
796
|
}
|
|
661
|
-
class
|
|
797
|
+
class Ie extends b {
|
|
662
798
|
constructor() {
|
|
663
799
|
super();
|
|
664
800
|
const e = [
|
|
665
|
-
new
|
|
801
|
+
new G(1, 0),
|
|
666
802
|
// Bottom of the bowl
|
|
667
|
-
new
|
|
803
|
+
new G(1.2, 0.5),
|
|
668
804
|
// Slight flare at the base
|
|
669
|
-
new
|
|
805
|
+
new G(1.4, 1.5),
|
|
670
806
|
// Outer wall
|
|
671
|
-
new
|
|
807
|
+
new G(1.3, 1.8),
|
|
672
808
|
// Flared edge
|
|
673
|
-
new
|
|
809
|
+
new G(0.8, 1.8)
|
|
674
810
|
// Lip of the bowl
|
|
675
|
-
],
|
|
676
|
-
|
|
811
|
+
], t = new V(e, 12), o = new ce(1, 12);
|
|
812
|
+
o.rotateX(-Math.PI / 2), o.translate(0, 0, 0), this.copy(T([t, o], !1));
|
|
677
813
|
}
|
|
678
814
|
}
|
|
679
|
-
class
|
|
680
|
-
constructor(e = 0.2,
|
|
815
|
+
class Z extends b {
|
|
816
|
+
constructor(e = 0.2, t = 0.2, o = 3, n = 32, r = !0) {
|
|
681
817
|
super();
|
|
682
|
-
const
|
|
683
|
-
a.translate(0, -(
|
|
818
|
+
const s = new g(e, t, o, n, 1, r), a = new A(t, n, n / 2, 0, Math.PI * 2, Math.PI / 2, Math.PI / 2);
|
|
819
|
+
a.translate(0, -(o / 2), 0), this.copy(T([s, a], !1));
|
|
684
820
|
}
|
|
685
821
|
}
|
|
686
|
-
class
|
|
687
|
-
constructor({ radius: e = 0.5, neckRadius:
|
|
822
|
+
class Pe extends b {
|
|
823
|
+
constructor({ radius: e = 0.5, neckRadius: t = 0.2, height: o = 3, neckHeight: n = 1, segments: r = 16 } = {}) {
|
|
688
824
|
super();
|
|
689
|
-
const
|
|
690
|
-
a.translate(0,
|
|
691
|
-
const
|
|
692
|
-
|
|
693
|
-
const
|
|
694
|
-
|
|
825
|
+
const s = o - n, a = new g(e, e, s, r);
|
|
826
|
+
a.translate(0, s / 2, 0);
|
|
827
|
+
const c = 0.3, l = new g(t, e, c, r);
|
|
828
|
+
l.translate(0, s + c / 2, 0);
|
|
829
|
+
const m = new g(t, t, n, r);
|
|
830
|
+
m.translate(0, s + c + n / 2, 0), this.copy(T([a, l, m], !1));
|
|
695
831
|
}
|
|
696
832
|
}
|
|
697
|
-
class
|
|
833
|
+
class ke extends b {
|
|
834
|
+
constructor({
|
|
835
|
+
trunkRadiusTop: e = 0.25,
|
|
836
|
+
trunkRadiusBottom: t = 0.4,
|
|
837
|
+
trunkHeight: o = 2.5,
|
|
838
|
+
trunkSegments: n = 14,
|
|
839
|
+
leafSize: r = 0.8,
|
|
840
|
+
leafCount: s = 6,
|
|
841
|
+
leafDetail: a = 0,
|
|
842
|
+
leafSpreadRadius: c = 1.5
|
|
843
|
+
} = {}) {
|
|
844
|
+
super();
|
|
845
|
+
const l = new g(e, t, o, n);
|
|
846
|
+
l.translate(0, o / 2, 0);
|
|
847
|
+
const m = [];
|
|
848
|
+
for (let u = 0; u < s; u++) {
|
|
849
|
+
const f = new Q(r, a);
|
|
850
|
+
f.translate(
|
|
851
|
+
(Math.random() - 0.5) * c,
|
|
852
|
+
(Math.random() - 0.5) * r + o,
|
|
853
|
+
(Math.random() - 0.5) * c
|
|
854
|
+
), m.push(f);
|
|
855
|
+
}
|
|
856
|
+
this.copy(T([l.toNonIndexed(), T(m, !1)], !0)), this.computeVertexNormals();
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
class rt extends S {
|
|
698
860
|
constructor() {
|
|
699
861
|
super();
|
|
700
|
-
const e = new
|
|
862
|
+
const e = new A(5, 32, 32), t = new R({
|
|
701
863
|
uniforms: {
|
|
702
864
|
time: { value: 0 }
|
|
703
865
|
},
|
|
@@ -740,67 +902,67 @@ class qe extends v {
|
|
|
740
902
|
gl_FragColor = vec4(color, 1.0);
|
|
741
903
|
}
|
|
742
904
|
`
|
|
743
|
-
}),
|
|
744
|
-
this.add(
|
|
905
|
+
}), o = new h(e, t);
|
|
906
|
+
this.add(o);
|
|
745
907
|
}
|
|
746
908
|
}
|
|
747
|
-
class
|
|
909
|
+
class ct extends S {
|
|
748
910
|
constructor() {
|
|
749
911
|
super();
|
|
750
|
-
const e = new
|
|
751
|
-
|
|
752
|
-
const
|
|
753
|
-
|
|
754
|
-
const a = new
|
|
755
|
-
|
|
756
|
-
const
|
|
912
|
+
const e = new v(5, 1, 5), t = new p({ color: 8421504, flatShading: !0 }), o = new h(e, t);
|
|
913
|
+
o.position.set(0, 0.5, 0), this.add(o);
|
|
914
|
+
const n = new v(4, 3, 4), r = new p({ color: 6908265, flatShading: !0 }), s = new h(n, r);
|
|
915
|
+
s.position.set(0, 2.5, 0), this.add(s);
|
|
916
|
+
const a = new N(3.5, 2, 4), c = new p({ color: 5263440, flatShading: !0 }), l = new h(a, c);
|
|
917
|
+
l.rotation.y = Math.PI / 4, l.position.set(0, 5, 0), this.add(l);
|
|
918
|
+
const m = new g(0.2, 0.2, 3.5, 16), u = new p({ color: 6908265, flatShading: !0 });
|
|
757
919
|
[
|
|
758
920
|
[-1.8, 2.3, -2.2],
|
|
759
921
|
[1.8, 2.3, -2.2],
|
|
760
922
|
[-1.8, 2.3, 2.2],
|
|
761
923
|
[1.8, 2.3, 2.2]
|
|
762
|
-
].forEach((
|
|
763
|
-
const
|
|
764
|
-
|
|
924
|
+
].forEach((I) => {
|
|
925
|
+
const _ = new h(m, u);
|
|
926
|
+
_.position.set(...I), this.add(_);
|
|
765
927
|
});
|
|
766
|
-
const
|
|
767
|
-
|
|
768
|
-
const
|
|
928
|
+
const w = new U();
|
|
929
|
+
w.moveTo(-1, 0), w.lineTo(-1, 2), w.absarc(0, 2, 1, Math.PI, 0, !0), w.lineTo(1, 0);
|
|
930
|
+
const d = {
|
|
769
931
|
depth: 0.5,
|
|
770
932
|
bevelEnabled: !1
|
|
771
|
-
},
|
|
772
|
-
|
|
933
|
+
}, M = new z(w, d), y = new p({ color: 4210752, flatShading: !0 }), P = new h(M, y);
|
|
934
|
+
P.position.set(0, 0.5, 1.7), this.add(P);
|
|
773
935
|
}
|
|
774
936
|
}
|
|
775
|
-
class
|
|
937
|
+
class it extends S {
|
|
776
938
|
constructor() {
|
|
777
939
|
super();
|
|
778
|
-
const e = new
|
|
779
|
-
|
|
780
|
-
const
|
|
781
|
-
|
|
782
|
-
const r = new
|
|
940
|
+
const e = new v(5, 0.3, 3), t = new p({ color: 9132587 }), o = new h(e, t);
|
|
941
|
+
o.position.set(0, 3.15, 0);
|
|
942
|
+
const n = [];
|
|
943
|
+
n.push(new G(0.2, 0)), n.push(new G(0.25, 0.5)), n.push(new G(0.15, 1.5)), n.push(new G(0.3, 3));
|
|
944
|
+
const r = new V(n, 32), s = new p({ color: 4929057 });
|
|
783
945
|
[
|
|
784
946
|
[2.2, 0, 1.2],
|
|
785
947
|
// Adjust Y to 0 so legs start at ground level
|
|
786
948
|
[-2.2, 0, 1.2],
|
|
787
949
|
[2.2, 0, -1.2],
|
|
788
950
|
[-2.2, 0, -1.2]
|
|
789
|
-
].forEach((
|
|
790
|
-
const
|
|
791
|
-
|
|
792
|
-
}), this.add(
|
|
951
|
+
].forEach((c) => {
|
|
952
|
+
const l = new h(r, s);
|
|
953
|
+
l.position.set(...c), this.add(l);
|
|
954
|
+
}), this.add(o);
|
|
793
955
|
}
|
|
794
956
|
}
|
|
795
|
-
class
|
|
796
|
-
constructor(e = 1,
|
|
797
|
-
super(), this.height = e, this.radius =
|
|
957
|
+
class lt extends S {
|
|
958
|
+
constructor(e = 1, t = 0.2) {
|
|
959
|
+
super(), this.height = e, this.radius = t, this.createCandle(), this.animateFlicker();
|
|
798
960
|
}
|
|
799
961
|
createCandle() {
|
|
800
|
-
const e = new
|
|
801
|
-
this.candle = new
|
|
802
|
-
const
|
|
803
|
-
this.flame = new
|
|
962
|
+
const e = new g(this.radius, this.radius, this.height, 32), t = new p({ color: 16777215 });
|
|
963
|
+
this.candle = new h(e, t), this.candle.position.set(0, this.height / 2, 0), this.add(this.candle);
|
|
964
|
+
const o = new A(0.05, 16, 16), n = new ie({ color: 16753920 });
|
|
965
|
+
this.flame = new h(o, n), this.flame.position.set(0, this.height + 0.05, 0), this.add(this.flame), this.candleLight = new ee(16753920, 1, 5), this.candleLight.position.set(0, this.height + 0.05, 0), this.candleLight.castShadow = !0, this.add(this.candleLight);
|
|
804
966
|
}
|
|
805
967
|
animateFlicker() {
|
|
806
968
|
const e = () => {
|
|
@@ -809,47 +971,52 @@ class ze extends v {
|
|
|
809
971
|
e();
|
|
810
972
|
}
|
|
811
973
|
}
|
|
812
|
-
class
|
|
813
|
-
constructor(e = 1.3,
|
|
974
|
+
class mt extends S {
|
|
975
|
+
constructor(e = 1.3, t = 0.5) {
|
|
814
976
|
super();
|
|
815
|
-
const
|
|
977
|
+
const o = new g(t, t, 0.2, 16), n = new p({ color: 9127187, flatShading: !0 }), r = new h(o, n);
|
|
816
978
|
r.position.set(0, 0, 0), this.add(r);
|
|
817
|
-
const
|
|
818
|
-
|
|
819
|
-
const
|
|
820
|
-
|
|
821
|
-
const
|
|
822
|
-
|
|
823
|
-
const
|
|
824
|
-
|
|
979
|
+
const s = new g(t * 0.9, t * 0.9, e), a = new p({ color: 16766720, flatShading: !0, transparent: !0, opacity: 0.6 }), c = new h(s, a);
|
|
980
|
+
c.position.set(0, e / 2 + 0.1, 0), this.add(c);
|
|
981
|
+
const l = new N(t * 1.1, 0.5, 8), m = new p({ color: 9127187, flatShading: !0 }), u = new h(l, m);
|
|
982
|
+
u.position.set(0, e + 0.35, 0), this.add(u);
|
|
983
|
+
const f = new te(t * 0.8, 0.05, 8, 16), w = new p({ color: 9127187, flatShading: !0 }), d = new h(f, w);
|
|
984
|
+
d.position.set(0, e + 0.85, 0), this.add(d);
|
|
985
|
+
const M = new ee(16755200, 1.5, 15);
|
|
986
|
+
M.position.set(0, e / 2 + 0.1, 0), M.castShadow = !0, this.add(M);
|
|
825
987
|
}
|
|
826
988
|
}
|
|
827
|
-
class
|
|
989
|
+
class ut extends S {
|
|
828
990
|
constructor() {
|
|
829
991
|
super();
|
|
830
|
-
const e = new
|
|
831
|
-
for (let
|
|
832
|
-
const r = new
|
|
992
|
+
const e = new Q(1, 0), t = new p({ color: 8421504, flatShading: !0 }), o = new p({ color: 4950843, flatShading: !0, opacity: 0.8, transparent: !0 });
|
|
993
|
+
for (let n = 0; n < 5; n++) {
|
|
994
|
+
const r = new h(e, t);
|
|
833
995
|
r.scale.set(0.8 + Math.random() * 0.4, 0.8 + Math.random() * 0.4, 0.8 + Math.random() * 0.4), r.rotation.set(Math.random() * Math.PI, Math.random() * Math.PI, Math.random() * Math.PI), r.position.set((Math.random() - 0.5) * 4, 0, (Math.random() - 0.5) * 4), this.add(r);
|
|
834
|
-
const
|
|
835
|
-
|
|
996
|
+
const s = new h(e, o);
|
|
997
|
+
s.scale.set(r.scale.x * 0.9, r.scale.y * 0.5, r.scale.z * 0.9), s.rotation.copy(r.rotation), s.position.copy(r.position), s.position.y += 0.3, this.add(s);
|
|
836
998
|
}
|
|
837
999
|
}
|
|
838
1000
|
}
|
|
839
|
-
class
|
|
1001
|
+
class ft extends h {
|
|
1002
|
+
constructor(e = 1, t = 4, o = 4) {
|
|
1003
|
+
super(), this.geometry = new be(e, t, o), this.material = new p({ color: 8421504, flatShading: !0 });
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
class ht extends S {
|
|
840
1007
|
constructor() {
|
|
841
1008
|
super();
|
|
842
|
-
const e = new
|
|
843
|
-
for (let
|
|
844
|
-
const
|
|
845
|
-
|
|
1009
|
+
const e = new Q(1, 0), t = new p({ color: 8421504, flatShading: !0 });
|
|
1010
|
+
for (let o = 0; o < 5; o++) {
|
|
1011
|
+
const n = new h(e, t);
|
|
1012
|
+
n.scale.set(0.8 + Math.random() * 0.4, 0.8 + Math.random() * 0.4, 0.8 + Math.random() * 0.4), n.rotation.set(Math.random() * Math.PI, Math.random() * Math.PI, Math.random() * Math.PI), n.position.set((Math.random() - 0.5) * 4, 0, (Math.random() - 0.5) * 4), this.add(n);
|
|
846
1013
|
}
|
|
847
1014
|
}
|
|
848
1015
|
}
|
|
849
|
-
class
|
|
1016
|
+
class dt extends S {
|
|
850
1017
|
constructor() {
|
|
851
1018
|
super();
|
|
852
|
-
const e = new
|
|
1019
|
+
const e = new Ge(), t = new H({
|
|
853
1020
|
color: 8965375,
|
|
854
1021
|
transparent: !0,
|
|
855
1022
|
opacity: 0.4,
|
|
@@ -857,309 +1024,309 @@ class Ve extends v {
|
|
|
857
1024
|
metalness: 0.1,
|
|
858
1025
|
reflectivity: 0.8,
|
|
859
1026
|
transmission: 0.9,
|
|
860
|
-
side:
|
|
861
|
-
}),
|
|
862
|
-
|
|
1027
|
+
side: F
|
|
1028
|
+
}), o = new h(e, t);
|
|
1029
|
+
o.rotation.x = -Math.PI / 2, this.add(o);
|
|
863
1030
|
}
|
|
864
1031
|
}
|
|
865
|
-
class
|
|
1032
|
+
class pt extends S {
|
|
866
1033
|
constructor() {
|
|
867
1034
|
super();
|
|
868
|
-
const e = new
|
|
869
|
-
|
|
870
|
-
const r = new
|
|
1035
|
+
const e = new v(1.6, 0.05, 2.1), t = new p({ color: 9109504 }), o = new h(e, t), n = new h(e, t);
|
|
1036
|
+
o.position.set(0, 0.125, 0), n.position.set(0, -0.125, 0);
|
|
1037
|
+
const r = new v(1.55, 0.2, 2), s = new p({ color: 16777215 }), a = new h(r, s);
|
|
871
1038
|
a.position.set(-0.025, 0, 0);
|
|
872
|
-
const
|
|
873
|
-
|
|
1039
|
+
const c = new v(0.05, 0.25, 2.1), l = new p({ color: 4915200 }), m = new h(c, l);
|
|
1040
|
+
m.position.set(-0.8, 0, 0), this.add(o), this.add(n), this.add(a), this.add(m);
|
|
874
1041
|
}
|
|
875
1042
|
}
|
|
876
|
-
class
|
|
1043
|
+
class wt extends S {
|
|
877
1044
|
constructor() {
|
|
878
1045
|
super();
|
|
879
1046
|
const e = [
|
|
880
|
-
new
|
|
1047
|
+
new G(0, 0),
|
|
881
1048
|
// Bottom
|
|
882
|
-
new
|
|
1049
|
+
new G(0.8, 0),
|
|
883
1050
|
// Base
|
|
884
|
-
new
|
|
1051
|
+
new G(1, 1.5),
|
|
885
1052
|
// Rounded body
|
|
886
|
-
new
|
|
1053
|
+
new G(0.5, 2.2),
|
|
887
1054
|
// Neck
|
|
888
|
-
new
|
|
1055
|
+
new G(0.6, 2.5)
|
|
889
1056
|
// Mouth
|
|
890
|
-
],
|
|
1057
|
+
], t = new V(e, 10), o = new g(0.3, 0.4, 0.2, 8), n = new p({
|
|
891
1058
|
color: 8965375,
|
|
892
1059
|
transparent: !0,
|
|
893
1060
|
opacity: 0.5,
|
|
894
1061
|
roughness: 0.1,
|
|
895
1062
|
metalness: 0.3
|
|
896
|
-
}), r = new
|
|
1063
|
+
}), r = new p({
|
|
897
1064
|
color: 16724838,
|
|
898
1065
|
// Vibrant potion color
|
|
899
1066
|
transparent: !0,
|
|
900
1067
|
opacity: 0.6
|
|
901
|
-
}),
|
|
1068
|
+
}), s = new p({
|
|
902
1069
|
color: 9127187,
|
|
903
1070
|
roughness: 1
|
|
904
|
-
}), a = new
|
|
905
|
-
|
|
906
|
-
const
|
|
907
|
-
|
|
1071
|
+
}), a = new h(t, n), c = new h(t, r), l = new h(o, s);
|
|
1072
|
+
c.scale.set(0.8, 0.8, 0.8), c.position.y = 0.1, l.position.y = 2.5;
|
|
1073
|
+
const m = new S();
|
|
1074
|
+
m.add(a, c, l), this.add(m);
|
|
908
1075
|
}
|
|
909
1076
|
}
|
|
910
|
-
class
|
|
1077
|
+
class yt extends S {
|
|
911
1078
|
constructor() {
|
|
912
1079
|
super();
|
|
913
|
-
const e = new
|
|
1080
|
+
const e = new g(0.3, 0.4, 0.1, 16), t = new p({
|
|
914
1081
|
color: 3355443,
|
|
915
1082
|
roughness: 0.6,
|
|
916
1083
|
metalness: 0.3
|
|
917
|
-
}),
|
|
918
|
-
|
|
919
|
-
const
|
|
1084
|
+
}), o = new h(e, t);
|
|
1085
|
+
o.position.y = 0.05;
|
|
1086
|
+
const n = new g(0.1, 0.1, 0.7, 16), r = new p({
|
|
920
1087
|
color: 5592405,
|
|
921
1088
|
roughness: 0.5,
|
|
922
1089
|
metalness: 0.4
|
|
923
|
-
}),
|
|
924
|
-
|
|
925
|
-
const a = new
|
|
1090
|
+
}), s = new h(n, r);
|
|
1091
|
+
s.position.y = 0.4;
|
|
1092
|
+
const a = new N(0.075, 0.2, 16), c = new p({
|
|
926
1093
|
color: 16733440,
|
|
927
1094
|
emissive: 16733440,
|
|
928
1095
|
emissiveIntensity: 0.6,
|
|
929
1096
|
transparent: !0,
|
|
930
1097
|
opacity: 0.8
|
|
931
|
-
}),
|
|
932
|
-
|
|
1098
|
+
}), l = new h(a, c);
|
|
1099
|
+
l.position.y = 0.8, this.add(o, s, l);
|
|
933
1100
|
}
|
|
934
1101
|
}
|
|
935
|
-
class
|
|
1102
|
+
class Mt extends S {
|
|
936
1103
|
constructor() {
|
|
937
1104
|
super();
|
|
938
|
-
const e = new
|
|
1105
|
+
const e = new v(3, 4, 0.1), t = new p({
|
|
939
1106
|
color: 3026478,
|
|
940
1107
|
roughness: 0.8,
|
|
941
1108
|
metalness: 0.6
|
|
942
|
-
}),
|
|
1109
|
+
}), o = new v(0.2, 0.5, 0.2), n = new p({
|
|
943
1110
|
color: 11184810,
|
|
944
1111
|
roughness: 0.5,
|
|
945
1112
|
metalness: 0.7
|
|
946
|
-
}), r = new
|
|
1113
|
+
}), r = new g(0.3, 0.3, 0.1, 16), s = new p({
|
|
947
1114
|
color: 5592405,
|
|
948
1115
|
roughness: 0.7,
|
|
949
1116
|
metalness: 0.5
|
|
950
|
-
}), a = new
|
|
1117
|
+
}), a = new h(e, t);
|
|
951
1118
|
for (let y = -1; y <= 1; y++) {
|
|
952
|
-
const
|
|
953
|
-
|
|
1119
|
+
const P = new h(o, n);
|
|
1120
|
+
P.position.set(y, 1.5, 0.1), a.add(P);
|
|
954
1121
|
}
|
|
955
|
-
const
|
|
956
|
-
|
|
957
|
-
const
|
|
1122
|
+
const c = new h(r, s);
|
|
1123
|
+
c.rotation.x = Math.PI / 2, c.position.set(0, 0.5, 0.15), a.add(c);
|
|
1124
|
+
const l = new A(0.15, 8, 8), m = new p({
|
|
958
1125
|
color: 16711680,
|
|
959
1126
|
emissive: 16711680,
|
|
960
1127
|
emissiveIntensity: 0.5
|
|
961
|
-
}),
|
|
962
|
-
|
|
963
|
-
let
|
|
964
|
-
function
|
|
965
|
-
requestAnimationFrame(
|
|
966
|
-
const y =
|
|
967
|
-
|
|
1128
|
+
}), u = new h(l, m);
|
|
1129
|
+
u.position.set(0, -1, 0.1), a.add(u), this.add(a);
|
|
1130
|
+
let f = 0.015, w = 0.8, d = 0.2;
|
|
1131
|
+
function M() {
|
|
1132
|
+
requestAnimationFrame(M);
|
|
1133
|
+
const y = d + Math.abs(Math.sin(Date.now() * f)) * (w - d);
|
|
1134
|
+
u.material.emissiveIntensity = y;
|
|
968
1135
|
}
|
|
969
|
-
|
|
1136
|
+
M();
|
|
970
1137
|
}
|
|
971
1138
|
}
|
|
972
|
-
class
|
|
1139
|
+
class xt extends S {
|
|
973
1140
|
constructor() {
|
|
974
1141
|
super();
|
|
975
1142
|
const e = [
|
|
976
|
-
new
|
|
1143
|
+
new G(0, 0),
|
|
977
1144
|
// Bottom of the flask
|
|
978
|
-
new
|
|
1145
|
+
new G(1.2, 0),
|
|
979
1146
|
// Base
|
|
980
|
-
new
|
|
1147
|
+
new G(1.5, 1.5),
|
|
981
1148
|
// Mid-body
|
|
982
|
-
new
|
|
1149
|
+
new G(1, 3),
|
|
983
1150
|
// Narrow neck
|
|
984
|
-
new
|
|
1151
|
+
new G(0.6, 3.5)
|
|
985
1152
|
// Mouth of the flask
|
|
986
|
-
],
|
|
1153
|
+
], t = new V(e, 12), o = new g(0.6, 0.7, 0.3, 8), n = new p({
|
|
987
1154
|
color: 8965290,
|
|
988
1155
|
transparent: !0,
|
|
989
1156
|
opacity: 0.4,
|
|
990
1157
|
roughness: 0.1,
|
|
991
1158
|
metalness: 0.5
|
|
992
|
-
}), r = new
|
|
1159
|
+
}), r = new p({
|
|
993
1160
|
color: 9127187,
|
|
994
1161
|
roughness: 1
|
|
995
|
-
}),
|
|
996
|
-
a.position.y = 3.5, this.add(
|
|
1162
|
+
}), s = new h(t, n), a = new h(o, r);
|
|
1163
|
+
a.position.y = 3.5, this.add(s, a);
|
|
997
1164
|
}
|
|
998
1165
|
}
|
|
999
|
-
class
|
|
1166
|
+
class vt extends S {
|
|
1000
1167
|
constructor() {
|
|
1001
1168
|
super();
|
|
1002
|
-
const e = new
|
|
1169
|
+
const e = new v(2, 3, 0.1), t = new p({
|
|
1003
1170
|
color: 3355443,
|
|
1004
1171
|
roughness: 0.8,
|
|
1005
1172
|
metalness: 0.5
|
|
1006
|
-
}),
|
|
1173
|
+
}), o = new h(e, t), n = new g(0.1, 0.1, 0.2, 8), r = new g(0.05, 0.05, 1, 8), s = new p({
|
|
1007
1174
|
color: 11184810,
|
|
1008
1175
|
roughness: 0.5,
|
|
1009
1176
|
metalness: 0.7
|
|
1010
1177
|
});
|
|
1011
1178
|
for (let a = -0.5; a <= 0.5; a += 0.5) {
|
|
1012
|
-
const
|
|
1013
|
-
|
|
1014
|
-
const
|
|
1015
|
-
|
|
1179
|
+
const c = new h(n, s);
|
|
1180
|
+
c.position.set(a, 1, 0.1);
|
|
1181
|
+
const l = new h(r, s);
|
|
1182
|
+
l.position.y = 0.5, c.add(l), this.add(c);
|
|
1016
1183
|
}
|
|
1017
|
-
this.add(
|
|
1184
|
+
this.add(o);
|
|
1018
1185
|
}
|
|
1019
1186
|
}
|
|
1020
|
-
class
|
|
1187
|
+
class gt extends S {
|
|
1021
1188
|
constructor() {
|
|
1022
1189
|
super();
|
|
1023
|
-
const e = new
|
|
1190
|
+
const e = new v(1, 0.2, 0.5), t = new p({
|
|
1024
1191
|
color: 4473924,
|
|
1025
1192
|
roughness: 0.6,
|
|
1026
1193
|
metalness: 0.3
|
|
1027
|
-
}),
|
|
1028
|
-
|
|
1029
|
-
const
|
|
1194
|
+
}), o = new h(e, t);
|
|
1195
|
+
o.position.y = 0.1;
|
|
1196
|
+
const n = new v(0.2, 1, 0.2), r = new h(n, t);
|
|
1030
1197
|
r.position.set(0, 0.6, -0.2);
|
|
1031
|
-
const
|
|
1198
|
+
const s = new g(0.1, 0.1, 0.4, 8), a = new p({
|
|
1032
1199
|
color: 3355443,
|
|
1033
1200
|
roughness: 0.5,
|
|
1034
1201
|
metalness: 0.6
|
|
1035
|
-
}),
|
|
1036
|
-
|
|
1037
|
-
const
|
|
1202
|
+
}), c = new h(s, a);
|
|
1203
|
+
c.position.set(0, 1.1, -0.35), c.rotation.x = -Math.PI / 4;
|
|
1204
|
+
const l = new v(0.6, 0.1, 0.6), m = new p({
|
|
1038
1205
|
color: 5592405,
|
|
1039
1206
|
roughness: 0.8,
|
|
1040
1207
|
metalness: 0.2
|
|
1041
|
-
}),
|
|
1042
|
-
|
|
1208
|
+
}), u = new h(l, m);
|
|
1209
|
+
u.position.set(0, 0.6, 0), this.add(o, r, c, u);
|
|
1043
1210
|
}
|
|
1044
1211
|
}
|
|
1045
|
-
class
|
|
1212
|
+
class St extends S {
|
|
1046
1213
|
constructor() {
|
|
1047
1214
|
super();
|
|
1048
|
-
const e = new
|
|
1049
|
-
|
|
1050
|
-
const
|
|
1215
|
+
const e = new Ie(), t = new g(0.2, 0.3, 1.5, 8);
|
|
1216
|
+
t.translate(0, 0.75, 0);
|
|
1217
|
+
const o = new p({
|
|
1051
1218
|
color: 6045747,
|
|
1052
1219
|
// Dark earthy tone
|
|
1053
1220
|
roughness: 1,
|
|
1054
1221
|
metalness: 0,
|
|
1055
|
-
side:
|
|
1222
|
+
side: F
|
|
1056
1223
|
// Render inside and outside
|
|
1057
|
-
}),
|
|
1224
|
+
}), n = new p({
|
|
1058
1225
|
color: 9132587,
|
|
1059
1226
|
// Slightly lighter earthy color
|
|
1060
1227
|
roughness: 0.8,
|
|
1061
1228
|
metalness: 0.1
|
|
1062
|
-
}), r = new
|
|
1063
|
-
|
|
1229
|
+
}), r = new h(e, o), s = new h(t, n);
|
|
1230
|
+
s.position.set(0.3, 1.3, 0), s.rotation.z = Math.PI / 4, this.add(r, s);
|
|
1064
1231
|
}
|
|
1065
1232
|
}
|
|
1066
|
-
class
|
|
1233
|
+
class bt extends S {
|
|
1067
1234
|
constructor() {
|
|
1068
1235
|
super();
|
|
1069
|
-
const e = 100,
|
|
1070
|
-
Array.from({ length: e }, (
|
|
1071
|
-
const
|
|
1072
|
-
return new
|
|
1073
|
-
Math.cos(
|
|
1074
|
-
|
|
1236
|
+
const e = 100, t = 0.05, o = new le(
|
|
1237
|
+
Array.from({ length: e }, (l, m) => {
|
|
1238
|
+
const u = m * 0.2;
|
|
1239
|
+
return new x(
|
|
1240
|
+
Math.cos(u) * 0.4,
|
|
1241
|
+
m * t,
|
|
1075
1242
|
// Gradual height increase
|
|
1076
|
-
Math.sin(
|
|
1243
|
+
Math.sin(u) * 0.4
|
|
1077
1244
|
);
|
|
1078
1245
|
})
|
|
1079
|
-
),
|
|
1246
|
+
), n = new me(o, 200, 0.1, 8, !1), r = new p({
|
|
1080
1247
|
color: 8965375,
|
|
1081
1248
|
transparent: !0,
|
|
1082
1249
|
opacity: 0.3,
|
|
1083
1250
|
roughness: 0.1,
|
|
1084
1251
|
metalness: 0.2,
|
|
1085
1252
|
emissive: 8965375
|
|
1086
|
-
}),
|
|
1087
|
-
this.add(
|
|
1253
|
+
}), s = new h(n, r);
|
|
1254
|
+
this.add(s);
|
|
1088
1255
|
function a() {
|
|
1089
1256
|
r.emissiveIntensity = 0.2 + Math.sin(Date.now() * 5e-3) * 0.1;
|
|
1090
1257
|
}
|
|
1091
|
-
function
|
|
1092
|
-
requestAnimationFrame(
|
|
1258
|
+
function c() {
|
|
1259
|
+
requestAnimationFrame(c), a();
|
|
1093
1260
|
}
|
|
1094
|
-
|
|
1261
|
+
c();
|
|
1095
1262
|
}
|
|
1096
1263
|
}
|
|
1097
|
-
class
|
|
1264
|
+
class Gt extends S {
|
|
1098
1265
|
constructor() {
|
|
1099
1266
|
super();
|
|
1100
|
-
const e = new
|
|
1267
|
+
const e = new te(0.3, 0.03, 8, 16), t = new p({
|
|
1101
1268
|
color: 8947848,
|
|
1102
1269
|
roughness: 0.7,
|
|
1103
1270
|
metalness: 0.3
|
|
1104
|
-
}),
|
|
1105
|
-
|
|
1106
|
-
const
|
|
1271
|
+
}), o = new h(e, t);
|
|
1272
|
+
o.rotation.x = Math.PI / 2, o.position.y = 0.4;
|
|
1273
|
+
const n = new g(0.02, 0.02, 0.4, 8), r = new p({
|
|
1107
1274
|
color: 6710886,
|
|
1108
1275
|
roughness: 0.8,
|
|
1109
1276
|
metalness: 0.3
|
|
1110
|
-
}),
|
|
1277
|
+
}), s = [];
|
|
1111
1278
|
for (let a = 0; a < 3; a++) {
|
|
1112
|
-
const
|
|
1113
|
-
|
|
1279
|
+
const c = a / 3 * Math.PI * 2, l = new h(n, r);
|
|
1280
|
+
l.position.set(Math.cos(c) * 0.25, 0.2, Math.sin(c) * 0.25), s.push(l);
|
|
1114
1281
|
}
|
|
1115
|
-
this.add(
|
|
1282
|
+
this.add(o, ...s);
|
|
1116
1283
|
}
|
|
1117
1284
|
}
|
|
1118
|
-
class
|
|
1285
|
+
class It extends S {
|
|
1119
1286
|
constructor() {
|
|
1120
1287
|
super();
|
|
1121
|
-
const e = new
|
|
1288
|
+
const e = new g(0.5, 0.6, 0.3, 16), t = new p({
|
|
1122
1289
|
color: 3355443,
|
|
1123
1290
|
roughness: 0.6,
|
|
1124
1291
|
metalness: 0.5
|
|
1125
|
-
}),
|
|
1126
|
-
|
|
1127
|
-
const
|
|
1292
|
+
}), o = new h(e, t);
|
|
1293
|
+
o.position.y = 0.15;
|
|
1294
|
+
const n = new g(0.15, 0.15, 2, 12, 1, !0), r = new p({
|
|
1128
1295
|
color: 16737792,
|
|
1129
1296
|
roughness: 0.5,
|
|
1130
1297
|
metalness: 0.8,
|
|
1131
|
-
side:
|
|
1132
|
-
}),
|
|
1133
|
-
|
|
1134
|
-
const a = new
|
|
1135
|
-
|
|
1136
|
-
const
|
|
1137
|
-
for (let
|
|
1138
|
-
const
|
|
1139
|
-
new
|
|
1140
|
-
new
|
|
1141
|
-
],
|
|
1142
|
-
this.add(y),
|
|
1298
|
+
side: F
|
|
1299
|
+
}), s = new h(n, r);
|
|
1300
|
+
s.position.y = 1.3;
|
|
1301
|
+
const a = new A(0.3, 16, 16), c = new h(a, r);
|
|
1302
|
+
c.position.y = 2.4, this.add(o, s, c);
|
|
1303
|
+
const l = [];
|
|
1304
|
+
for (let f = 0; f < 5; f++) {
|
|
1305
|
+
const w = new ue({ color: 10079487 }), d = [
|
|
1306
|
+
new x(0, 2.4, 0),
|
|
1307
|
+
new x((Math.random() - 0.5) * 1.5, Math.random() * 2.4, (Math.random() - 0.5) * 1.5)
|
|
1308
|
+
], M = new b().setFromPoints(d), y = new fe(M, w);
|
|
1309
|
+
this.add(y), l.push(y);
|
|
1143
1310
|
}
|
|
1144
|
-
function
|
|
1145
|
-
|
|
1146
|
-
const
|
|
1147
|
-
new
|
|
1148
|
-
new
|
|
1311
|
+
function m() {
|
|
1312
|
+
l.forEach((f) => {
|
|
1313
|
+
const w = [
|
|
1314
|
+
new x(0, 2.4, 0),
|
|
1315
|
+
new x((Math.random() - 0.5) * 1.5, Math.random() * 2.4, (Math.random() - 0.5) * 1.5)
|
|
1149
1316
|
];
|
|
1150
|
-
|
|
1317
|
+
f.geometry.setFromPoints(w);
|
|
1151
1318
|
});
|
|
1152
1319
|
}
|
|
1153
|
-
function
|
|
1154
|
-
requestAnimationFrame(
|
|
1320
|
+
function u() {
|
|
1321
|
+
requestAnimationFrame(u), m();
|
|
1155
1322
|
}
|
|
1156
|
-
|
|
1323
|
+
u();
|
|
1157
1324
|
}
|
|
1158
1325
|
}
|
|
1159
|
-
class
|
|
1160
|
-
constructor(e = 0.2,
|
|
1326
|
+
class Pt extends S {
|
|
1327
|
+
constructor(e = 0.2, t = 0.2, o = 3, n = 32) {
|
|
1161
1328
|
super();
|
|
1162
|
-
const r = new
|
|
1329
|
+
const r = new Z(e, t, o, n), s = new H({
|
|
1163
1330
|
color: 8965375,
|
|
1164
1331
|
transparent: !0,
|
|
1165
1332
|
opacity: 0.4,
|
|
@@ -1168,48 +1335,48 @@ class He extends v {
|
|
|
1168
1335
|
reflectivity: 0.8,
|
|
1169
1336
|
transmission: 0.9,
|
|
1170
1337
|
// For glass effect
|
|
1171
|
-
side:
|
|
1172
|
-
}), a = new
|
|
1338
|
+
side: F
|
|
1339
|
+
}), a = new h(r, s);
|
|
1173
1340
|
this.add(a);
|
|
1174
1341
|
}
|
|
1175
1342
|
}
|
|
1176
|
-
class
|
|
1177
|
-
constructor(e = 3,
|
|
1343
|
+
class kt extends S {
|
|
1344
|
+
constructor(e = 3, t = [65450, 16711850, 11141375]) {
|
|
1178
1345
|
super();
|
|
1179
|
-
const
|
|
1346
|
+
const o = new v(3, 0.2, 1), n = new p({
|
|
1180
1347
|
color: 9127187,
|
|
1181
1348
|
// Wooden color or change to metallic tone
|
|
1182
1349
|
roughness: 0.7,
|
|
1183
1350
|
metalness: 0.3
|
|
1184
|
-
}), r = new
|
|
1351
|
+
}), r = new h(o, n);
|
|
1185
1352
|
r.position.y = 0.5;
|
|
1186
|
-
const
|
|
1353
|
+
const s = new Z(0.1, 0.1, 1, 16), a = new p({
|
|
1187
1354
|
color: 11184810,
|
|
1188
1355
|
transparent: !0,
|
|
1189
1356
|
opacity: 0.4,
|
|
1190
1357
|
roughness: 0.1,
|
|
1191
1358
|
metalness: 0.5,
|
|
1192
|
-
side:
|
|
1359
|
+
side: F
|
|
1193
1360
|
});
|
|
1194
|
-
for (let
|
|
1195
|
-
const
|
|
1196
|
-
|
|
1197
|
-
const
|
|
1198
|
-
color:
|
|
1199
|
-
emissive:
|
|
1361
|
+
for (let c = 0; c < e; c++) {
|
|
1362
|
+
const l = new h(s, a), m = (c - (e - 1) / 2) * 0.8;
|
|
1363
|
+
l.position.set(m, 1, 0);
|
|
1364
|
+
const u = new Z(0.099, 0.099, 0.5, 16, !1), f = t[c % t.length], w = new p({
|
|
1365
|
+
color: f,
|
|
1366
|
+
emissive: f,
|
|
1200
1367
|
emissiveIntensity: 0.5,
|
|
1201
1368
|
transparent: !0,
|
|
1202
1369
|
opacity: 0.6
|
|
1203
|
-
}),
|
|
1204
|
-
|
|
1370
|
+
}), d = new h(u, w);
|
|
1371
|
+
d.position.set(0, -0.25, 0), l.add(d), r.add(l);
|
|
1205
1372
|
}
|
|
1206
1373
|
this.add(r);
|
|
1207
1374
|
}
|
|
1208
1375
|
}
|
|
1209
|
-
class
|
|
1376
|
+
class Tt extends h {
|
|
1210
1377
|
constructor() {
|
|
1211
1378
|
super();
|
|
1212
|
-
const e = new
|
|
1379
|
+
const e = new Pe(), t = new H({
|
|
1213
1380
|
color: 5597999,
|
|
1214
1381
|
roughness: 0.1,
|
|
1215
1382
|
transmission: 0.9,
|
|
@@ -1219,84 +1386,204 @@ class Re extends m {
|
|
|
1219
1386
|
clearcoat: 1,
|
|
1220
1387
|
clearcoatRoughness: 0.1
|
|
1221
1388
|
});
|
|
1222
|
-
this.geometry = e, this.material =
|
|
1389
|
+
this.geometry = e, this.material = t;
|
|
1223
1390
|
}
|
|
1224
1391
|
}
|
|
1225
|
-
class
|
|
1226
|
-
constructor(e = 5,
|
|
1392
|
+
class Te extends U {
|
|
1393
|
+
constructor(e = 5, t = 0.5, o = 1) {
|
|
1227
1394
|
super();
|
|
1228
|
-
const
|
|
1229
|
-
this.moveTo(Math.cos(0) *
|
|
1395
|
+
const n = Math.PI * 2 / e, r = n / 2, s = n / 4;
|
|
1396
|
+
this.moveTo(Math.cos(0) * o, -Math.sin(0) * o);
|
|
1230
1397
|
for (let a = 1; a <= e; ++a) {
|
|
1231
|
-
let
|
|
1232
|
-
this.quadraticCurveTo(
|
|
1398
|
+
let c = Math.cos(n * a - s * 3) * (t / Math.cos(s)), l = -Math.sin(n * a - s * 3) * (t / Math.cos(s)), m = Math.cos(n * a - r) * t, u = -Math.sin(n * a - r) * t;
|
|
1399
|
+
this.quadraticCurveTo(c, l, m, u), c = Math.cos(n * a - s) * (t / Math.cos(s)), l = -Math.sin(n * a - s) * (t / Math.cos(s)), m = Math.cos(n * a) * o, u = -Math.sin(n * a) * o, this.quadraticCurveTo(c, l, m, u);
|
|
1233
1400
|
}
|
|
1234
1401
|
this.closePath();
|
|
1235
1402
|
}
|
|
1236
1403
|
}
|
|
1237
|
-
class
|
|
1238
|
-
constructor(e = 5,
|
|
1404
|
+
class At extends h {
|
|
1405
|
+
constructor(e = 5, t = 0.5, o = 1, n = 0.25) {
|
|
1239
1406
|
super();
|
|
1240
|
-
const r = new
|
|
1241
|
-
depth:
|
|
1242
|
-
bevelEnabled:
|
|
1407
|
+
const r = new Te(e, t, o), s = new z(r, {
|
|
1408
|
+
depth: n,
|
|
1409
|
+
bevelEnabled: n > 0,
|
|
1243
1410
|
bevelThickness: 0,
|
|
1244
1411
|
bevelSize: 0
|
|
1245
|
-
}), a = new
|
|
1246
|
-
|
|
1412
|
+
}), a = new p({
|
|
1413
|
+
color: 16776960,
|
|
1414
|
+
emissive: 16766720,
|
|
1415
|
+
emissiveIntensity: 0.25,
|
|
1416
|
+
metalness: 0.1,
|
|
1417
|
+
roughness: 0.3,
|
|
1418
|
+
flatShading: !0
|
|
1419
|
+
});
|
|
1420
|
+
s.center(), this.geometry = s, this.material = a;
|
|
1247
1421
|
}
|
|
1248
1422
|
}
|
|
1249
|
-
class
|
|
1250
|
-
constructor(e = 5,
|
|
1423
|
+
class Ae extends U {
|
|
1424
|
+
constructor(e = 5, t = 0.5, o = 1, n = 5, r = 0.25) {
|
|
1251
1425
|
super();
|
|
1252
|
-
const
|
|
1253
|
-
this.moveTo(Math.cos(0) *
|
|
1254
|
-
for (let
|
|
1255
|
-
this.lineTo(Math.cos(
|
|
1256
|
-
if (this.closePath(), r > 0 &&
|
|
1257
|
-
const
|
|
1258
|
-
|
|
1259
|
-
for (let
|
|
1260
|
-
|
|
1261
|
-
|
|
1426
|
+
const s = Math.PI * 2 / e, a = s / 4;
|
|
1427
|
+
this.moveTo(Math.cos(0) * o, -Math.sin(0) * o);
|
|
1428
|
+
for (let c = 1; c <= e; ++c)
|
|
1429
|
+
this.lineTo(Math.cos(s * c - a * 3) * t, -Math.sin(s * c - a * 3) * t), this.lineTo(Math.cos(s * c - a * 2) * t, -Math.sin(s * c - a * 2) * t), this.lineTo(Math.cos(s * c - a) * o, -Math.sin(s * c - a) * o), this.lineTo(Math.cos(s * c) * o, -Math.sin(s * c) * o);
|
|
1430
|
+
if (this.closePath(), r > 0 && n > 2) {
|
|
1431
|
+
const c = new he(), l = Math.PI * 2 / n;
|
|
1432
|
+
c.moveTo(Math.cos(0) * r, -Math.sin(0) * r);
|
|
1433
|
+
for (let m = 1; m < n; ++m)
|
|
1434
|
+
c.lineTo(Math.cos(l * m) * r, -Math.sin(l * m) * r);
|
|
1435
|
+
c.lineTo(Math.cos(0) * r, -Math.sin(0) * r), this.holes.push(c);
|
|
1262
1436
|
}
|
|
1263
1437
|
}
|
|
1264
1438
|
}
|
|
1265
|
-
class
|
|
1266
|
-
constructor(e = 5,
|
|
1439
|
+
class Bt extends h {
|
|
1440
|
+
constructor(e = 5, t = 0.5, o = 1, n = 5, r = 0.25, s = 0.25) {
|
|
1267
1441
|
super();
|
|
1268
|
-
const a = new
|
|
1269
|
-
depth:
|
|
1270
|
-
bevelEnabled:
|
|
1442
|
+
const a = new Ae(e, t, o, n, r), c = new z(a, {
|
|
1443
|
+
depth: s,
|
|
1444
|
+
bevelEnabled: s > 0,
|
|
1271
1445
|
bevelThickness: 0,
|
|
1272
1446
|
bevelSize: 0
|
|
1273
|
-
}),
|
|
1274
|
-
|
|
1447
|
+
}), l = new p({
|
|
1448
|
+
color: 11184810,
|
|
1449
|
+
metalness: 0.8,
|
|
1450
|
+
roughness: 0.2,
|
|
1451
|
+
reflectivity: 0.5
|
|
1452
|
+
});
|
|
1453
|
+
c.center(), this.geometry = c, this.material = l;
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
class Be extends U {
|
|
1457
|
+
constructor(e = 1, t = 2.1, o = 1.4, n = 1.6) {
|
|
1458
|
+
super(), this.moveTo(0, o * e / 3), this.bezierCurveTo(
|
|
1459
|
+
-t * 0.375 * e,
|
|
1460
|
+
o * e,
|
|
1461
|
+
// Control point 1 for the left lobe
|
|
1462
|
+
-t * e,
|
|
1463
|
+
o * e / 3,
|
|
1464
|
+
// Control point 2 for the left side of the heart
|
|
1465
|
+
0,
|
|
1466
|
+
-n * e
|
|
1467
|
+
// Bottom tip of the heart, controlled by `tipDepth`
|
|
1468
|
+
), this.bezierCurveTo(
|
|
1469
|
+
t * e,
|
|
1470
|
+
o * e / 3,
|
|
1471
|
+
// Control point 3 for the right side of the heart
|
|
1472
|
+
t * 0.375 * e,
|
|
1473
|
+
o * e,
|
|
1474
|
+
// Control point 4 for the right lobe
|
|
1475
|
+
0,
|
|
1476
|
+
o * e / 3
|
|
1477
|
+
// Close shape at the top middle
|
|
1478
|
+
);
|
|
1275
1479
|
}
|
|
1276
1480
|
}
|
|
1277
|
-
class
|
|
1278
|
-
constructor(e =
|
|
1481
|
+
class Et extends h {
|
|
1482
|
+
constructor(e = 1, t = 1, o = 1, n = 10, r = 0.25) {
|
|
1279
1483
|
super();
|
|
1280
|
-
const s =
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1484
|
+
const s = new Be(e, t, o, n), a = new z(s, {
|
|
1485
|
+
depth: r,
|
|
1486
|
+
bevelEnabled: r > 0,
|
|
1487
|
+
bevelThickness: 0,
|
|
1488
|
+
bevelSize: 0
|
|
1489
|
+
}), c = new p({
|
|
1490
|
+
color: 12986408,
|
|
1491
|
+
emissive: 12981270,
|
|
1492
|
+
emissiveIntensity: 0.25,
|
|
1493
|
+
metalness: 0.1,
|
|
1494
|
+
roughness: 0.3,
|
|
1495
|
+
flatShading: !0
|
|
1496
|
+
});
|
|
1497
|
+
a.center(), this.geometry = a, this.material = c;
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1500
|
+
class Ee extends U {
|
|
1501
|
+
constructor(e = 5, t = 0.5, o = 1) {
|
|
1502
|
+
super();
|
|
1503
|
+
const n = Math.PI * 2 / e, r = n / 2;
|
|
1504
|
+
this.moveTo(Math.cos(0) * o, Math.sin(0) * o);
|
|
1505
|
+
for (let s = 1; s <= e; ++s)
|
|
1506
|
+
this.lineTo(Math.cos(n * s - r) * t, Math.sin(n * s - r) * t), this.lineTo(Math.cos(n * s) * o, Math.sin(n * s) * o);
|
|
1284
1507
|
this.closePath();
|
|
1285
1508
|
}
|
|
1286
1509
|
}
|
|
1287
|
-
class
|
|
1288
|
-
constructor(e = 5,
|
|
1510
|
+
class Ct extends h {
|
|
1511
|
+
constructor(e = 5, t = 0.5, o = 1, n = 0.25) {
|
|
1289
1512
|
super();
|
|
1290
|
-
const r = new
|
|
1291
|
-
depth:
|
|
1292
|
-
bevelEnabled:
|
|
1513
|
+
const r = new Ee(e, t, o), s = new z(r, {
|
|
1514
|
+
depth: n,
|
|
1515
|
+
bevelEnabled: n > 0,
|
|
1293
1516
|
bevelThickness: 0,
|
|
1294
1517
|
bevelSize: 0
|
|
1295
|
-
}), a = new
|
|
1296
|
-
|
|
1518
|
+
}), a = new p({
|
|
1519
|
+
color: 16776960,
|
|
1520
|
+
emissive: 16766720,
|
|
1521
|
+
emissiveIntensity: 0.25,
|
|
1522
|
+
metalness: 0.1,
|
|
1523
|
+
roughness: 0.3,
|
|
1524
|
+
flatShading: !0
|
|
1525
|
+
});
|
|
1526
|
+
s.center(), this.geometry = s, this.material = a;
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
class Nt extends h {
|
|
1530
|
+
constructor({
|
|
1531
|
+
trunkRadiusTop: e = 0.25,
|
|
1532
|
+
trunkRadiusBottom: t = 0.4,
|
|
1533
|
+
trunkHeight: o = 2.5,
|
|
1534
|
+
trunkSegments: n = 14,
|
|
1535
|
+
trunkColor: r = 9127187,
|
|
1536
|
+
leafSize: s = 0.8,
|
|
1537
|
+
leafCount: a = 6,
|
|
1538
|
+
leafDetail: c = 0,
|
|
1539
|
+
leafSpreadRadius: l = 1.5,
|
|
1540
|
+
leafColor: m = 2263842
|
|
1541
|
+
} = {}) {
|
|
1542
|
+
super();
|
|
1543
|
+
const u = new ke({
|
|
1544
|
+
trunkRadiusTop: e,
|
|
1545
|
+
trunkRadiusBottom: t,
|
|
1546
|
+
trunkHeight: o,
|
|
1547
|
+
trunkSegments: n,
|
|
1548
|
+
trunkColor: r,
|
|
1549
|
+
leafSize: s,
|
|
1550
|
+
leafCount: a,
|
|
1551
|
+
leafDetail: c,
|
|
1552
|
+
leafSpreadRadius: l,
|
|
1553
|
+
leafColor: m
|
|
1554
|
+
}), f = new p({
|
|
1555
|
+
color: r,
|
|
1556
|
+
roughness: 0.9,
|
|
1557
|
+
metalness: 0,
|
|
1558
|
+
flatShading: !0
|
|
1559
|
+
}), w = new p({
|
|
1560
|
+
color: m,
|
|
1561
|
+
roughness: 0.8,
|
|
1562
|
+
metalness: 0,
|
|
1563
|
+
flatShading: !0
|
|
1564
|
+
});
|
|
1565
|
+
this.geometry = u, this.material = [f, w];
|
|
1297
1566
|
}
|
|
1298
1567
|
}
|
|
1299
|
-
const
|
|
1568
|
+
const W = {
|
|
1569
|
+
uniforms: {},
|
|
1570
|
+
vertexShader: `
|
|
1571
|
+
varying vec3 vPosition;
|
|
1572
|
+
void main() {
|
|
1573
|
+
vPosition = position;
|
|
1574
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
1575
|
+
}
|
|
1576
|
+
`,
|
|
1577
|
+
fragmentShader: `
|
|
1578
|
+
varying vec3 vPosition;
|
|
1579
|
+
void main() {
|
|
1580
|
+
float y = normalize(vPosition).y * 0.5 + 0.5; // Normalizing y to range 0 to 1
|
|
1581
|
+
vec3 topColor = vec3(0.5, 0.8, 1.0); // Light blue
|
|
1582
|
+
vec3 bottomColor = vec3(1.0, 1.0, 1.0); // Light white/gray for the horizon
|
|
1583
|
+
gl_FragColor = vec4(mix(bottomColor, topColor, y), 1.0);
|
|
1584
|
+
}
|
|
1585
|
+
`
|
|
1586
|
+
}, Ce = {
|
|
1300
1587
|
uniforms: {
|
|
1301
1588
|
tDiffuse: { value: null },
|
|
1302
1589
|
opacity: { value: 1 }
|
|
@@ -1317,63 +1604,218 @@ const ot = {
|
|
|
1317
1604
|
gl_FragColor = opacity * texel;
|
|
1318
1605
|
}
|
|
1319
1606
|
`
|
|
1320
|
-
},
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1607
|
+
}, Y = {
|
|
1608
|
+
uniforms: {
|
|
1609
|
+
topColor: { value: new K(51) },
|
|
1610
|
+
bottomColor: { value: new K(17) },
|
|
1611
|
+
offset: { value: 33 },
|
|
1612
|
+
exponent: { value: 0.6 }
|
|
1613
|
+
},
|
|
1614
|
+
vertexShader: `
|
|
1615
|
+
varying vec3 vWorldPosition;
|
|
1616
|
+
void main() {
|
|
1617
|
+
vec4 worldPosition = modelMatrix * vec4(position, 1.0);
|
|
1618
|
+
vWorldPosition = worldPosition.xyz;
|
|
1619
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
1620
|
+
}
|
|
1621
|
+
`,
|
|
1622
|
+
fragmentShader: `
|
|
1623
|
+
uniform vec3 topColor;
|
|
1624
|
+
uniform vec3 bottomColor;
|
|
1625
|
+
uniform float offset;
|
|
1626
|
+
uniform float exponent;
|
|
1627
|
+
varying vec3 vWorldPosition;
|
|
1628
|
+
void main() {
|
|
1629
|
+
float h = normalize(vWorldPosition + offset).y;
|
|
1630
|
+
gl_FragColor = vec4(mix(bottomColor, topColor, max(pow(max(h, 0.0), exponent), 0.0)), 1.0);
|
|
1631
|
+
}
|
|
1632
|
+
`
|
|
1633
|
+
};
|
|
1634
|
+
function Ut(i, { time: e = 0, intensity: t = 1, direction: o = E.XYZ, scale: n = 10 } = {}) {
|
|
1635
|
+
i.onBeforeCompile = (r) => {
|
|
1636
|
+
r.uniforms.time = { value: e }, r.uniforms.direction = { value: o }, r.uniforms.intensity = { value: t }, r.uniforms.scale = { value: n }, r.vertexShader = `
|
|
1637
|
+
uniform float time;
|
|
1638
|
+
uniform vec3 direction;
|
|
1639
|
+
uniform float intensity;
|
|
1640
|
+
uniform float scale;
|
|
1641
|
+
|
|
1642
|
+
float mod289(float x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }
|
|
1643
|
+
vec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }
|
|
1644
|
+
vec4 perm(vec4 x) { return mod289(((x * 34.0) + 1.0) * x); }
|
|
1645
|
+
|
|
1646
|
+
float noise(vec3 p) {
|
|
1647
|
+
vec3 a = floor(p);
|
|
1648
|
+
vec3 d = p - a;
|
|
1649
|
+
d = d * d * (3.0 - 2.0 * d);
|
|
1650
|
+
|
|
1651
|
+
vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0);
|
|
1652
|
+
vec4 k1 = perm(b.xyxy);
|
|
1653
|
+
vec4 k2 = perm(k1.xyxy + b.zzww);
|
|
1654
|
+
|
|
1655
|
+
vec4 c = k2 + a.zzzz;
|
|
1656
|
+
vec4 k3 = perm(c);
|
|
1657
|
+
vec4 k4 = perm(c + 1.0);
|
|
1658
|
+
|
|
1659
|
+
vec4 o1 = fract(k3 * (1.0 / 41.0));
|
|
1660
|
+
vec4 o2 = fract(k4 * (1.0 / 41.0));
|
|
1661
|
+
|
|
1662
|
+
vec4 o3 = o2 * d.z + o1 * (1.0 - d.z);
|
|
1663
|
+
vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x);
|
|
1664
|
+
|
|
1665
|
+
return o4.y * d.y + o4.x * (1.0 - d.y);
|
|
1666
|
+
}
|
|
1667
|
+
` + r.vertexShader, r.vertexShader = r.vertexShader.replace(
|
|
1668
|
+
"#include <begin_vertex>",
|
|
1669
|
+
`
|
|
1670
|
+
vec3 transformed = vec3(position);
|
|
1671
|
+
float n = noise(transformed * scale + time);
|
|
1672
|
+
transformed += normalize(direction) * n * intensity;
|
|
1673
|
+
vec3 transformedNormal = normal;
|
|
1674
|
+
`
|
|
1675
|
+
), i.userData.shader = r;
|
|
1676
|
+
};
|
|
1677
|
+
}
|
|
1678
|
+
function zt(i, e) {
|
|
1679
|
+
i.userData.shader && (i.userData.shader.uniforms.time.value += e);
|
|
1680
|
+
}
|
|
1681
|
+
class Ft extends h {
|
|
1682
|
+
constructor(e = 1e3) {
|
|
1683
|
+
super(), this.geometry = new v(e, e, e), this.material = new R({
|
|
1684
|
+
vertexShader: W.vertexShader,
|
|
1685
|
+
fragmentShader: W.fragmentShader,
|
|
1686
|
+
side: oe
|
|
1687
|
+
});
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
class Lt extends h {
|
|
1691
|
+
constructor(e = 1e3) {
|
|
1692
|
+
super(), this.geometry = new A(e, 32, 15), this.material = new R({
|
|
1693
|
+
vertexShader: Y.vertexShader,
|
|
1694
|
+
fragmentShader: Y.fragmentShader,
|
|
1695
|
+
uniforms: Y.uniforms,
|
|
1696
|
+
side: oe
|
|
1697
|
+
});
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
class _t extends h {
|
|
1701
|
+
constructor(e = Math.PI * 0.49, t = 2 * Math.PI * 0.25, o = 10, n = 2, r = 5e-3, s = 0.8) {
|
|
1702
|
+
super();
|
|
1703
|
+
const a = new xe();
|
|
1704
|
+
a.scale.setScalar(45e4), this.add(a);
|
|
1705
|
+
const c = a.material.uniforms;
|
|
1706
|
+
c.turbidity.value = o, c.rayleigh.value = n, c.mieCoefficient.value = r, c.mieDirectionalG.value = s, this.skyUniforms = c, this.sunPosition(e, t);
|
|
1707
|
+
}
|
|
1708
|
+
sunPosition(e, t) {
|
|
1709
|
+
const o = new x(), n = this.skyUniforms;
|
|
1710
|
+
o.setFromSphericalCoords(1, e, t), n.sunPosition.value.copy(o);
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
const qt = (i) => {
|
|
1714
|
+
const e = new Uint8Array(4 * i * i);
|
|
1715
|
+
for (let o = 0; o < i * i; o++) {
|
|
1716
|
+
const n = o * 4, r = (o % i ^ Math.floor(o / i)) & 1 ? 255 : 0;
|
|
1717
|
+
e[n] = r, e[n + 1] = r, e[n + 2] = r, e[n + 3] = 255;
|
|
1718
|
+
}
|
|
1719
|
+
const t = new de(e, i, i, pe, we);
|
|
1720
|
+
return t.wrapS = J, t.wrapT = J, t.minFilter = ye, t.needsUpdate = !0, t;
|
|
1328
1721
|
};
|
|
1722
|
+
class Ot {
|
|
1723
|
+
static dispose(e) {
|
|
1724
|
+
e == null || e.traverse((t) => {
|
|
1725
|
+
t.geometry && t.geometry.dispose(), t.material && (Array.isArray(t.material) ? t.material.forEach((o) => o.dispose()) : t.material.dispose());
|
|
1726
|
+
});
|
|
1727
|
+
}
|
|
1728
|
+
static fadeBetween(e, t, o, n, r = 1) {
|
|
1729
|
+
const s = new ve(e), a = new $(o, t);
|
|
1730
|
+
s.addPass(a);
|
|
1731
|
+
const c = new ge(Ce);
|
|
1732
|
+
c.uniforms.opacity.value = 1, s.addPass(c);
|
|
1733
|
+
let l = null;
|
|
1734
|
+
function m(f) {
|
|
1735
|
+
l || (l = f);
|
|
1736
|
+
const d = (f - l) / 1e3 / r;
|
|
1737
|
+
c.uniforms.opacity.value = Math.max(1 - d, 0), d < 1 ? (s.render(), requestAnimationFrame(m)) : (s.passes[0] = new $(n, t), l = null, requestAnimationFrame(u));
|
|
1738
|
+
}
|
|
1739
|
+
function u(f) {
|
|
1740
|
+
l || (l = f);
|
|
1741
|
+
const d = (f - l) / 1e3 / r;
|
|
1742
|
+
c.uniforms.opacity.value = Math.min(d, 1), d < 1 && (s.render(), requestAnimationFrame(u));
|
|
1743
|
+
}
|
|
1744
|
+
requestAnimationFrame(m);
|
|
1745
|
+
}
|
|
1746
|
+
}
|
|
1329
1747
|
export {
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1748
|
+
dt as Beaker,
|
|
1749
|
+
Ge as BeakerGeometry,
|
|
1750
|
+
He as BifurcatedStaircaseGeometry,
|
|
1751
|
+
at as BoneGeometry,
|
|
1752
|
+
pt as Book,
|
|
1753
|
+
wt as Bottle,
|
|
1754
|
+
Re as Bubbling,
|
|
1755
|
+
yt as BunsenBurner,
|
|
1756
|
+
At as Burst,
|
|
1757
|
+
Te as BurstShape,
|
|
1758
|
+
lt as Candle,
|
|
1759
|
+
$e as CrossHeadstoneGeometry,
|
|
1760
|
+
Ft as DaySkybox,
|
|
1761
|
+
it as Desk,
|
|
1762
|
+
je as DioramaGeometry,
|
|
1763
|
+
E as Direction,
|
|
1764
|
+
Qe as Easing,
|
|
1765
|
+
Mt as ElectricPanel,
|
|
1766
|
+
L as Falloff,
|
|
1767
|
+
ot as FenceColumn,
|
|
1768
|
+
xt as Flask,
|
|
1769
|
+
Bt as Gear,
|
|
1770
|
+
Ae as GearShape,
|
|
1771
|
+
Et as Heart,
|
|
1772
|
+
Be as HeartShape,
|
|
1773
|
+
De as LShapedStaircaseGeometry,
|
|
1774
|
+
mt as Lantern,
|
|
1775
|
+
vt as LeverPanel,
|
|
1776
|
+
ct as Mausoleum,
|
|
1777
|
+
gt as Microscope,
|
|
1778
|
+
rt as Moon,
|
|
1779
|
+
St as MortarAndPestle,
|
|
1780
|
+
Ie as MortarGeometry,
|
|
1781
|
+
ut as MossyRocks,
|
|
1782
|
+
Lt as NightSkybox,
|
|
1783
|
+
We as ObeliskHeadstoneGeometry,
|
|
1784
|
+
ft as Rock,
|
|
1785
|
+
be as RockGeometry,
|
|
1786
|
+
ht as Rocks,
|
|
1787
|
+
et as RoundedHeadstoneGeometry,
|
|
1788
|
+
Ot as SceneUtils,
|
|
1789
|
+
nt as SimpleLeafGeometry,
|
|
1790
|
+
Ke as SpiralStaircaseGeometry,
|
|
1791
|
+
bt as SpiralTube,
|
|
1792
|
+
tt as SquareHeadstoneGeometry,
|
|
1793
|
+
Je as StaircaseGeometry,
|
|
1794
|
+
Gt as Stand,
|
|
1795
|
+
Ct as Star,
|
|
1796
|
+
Ee as StarShape,
|
|
1797
|
+
It as TeslaCoil,
|
|
1798
|
+
Pt as TestTube,
|
|
1799
|
+
Z as TestTubeGeometry,
|
|
1800
|
+
kt as TestTubeRack,
|
|
1801
|
+
Nt as Tree,
|
|
1802
|
+
ke as TreeGeometry,
|
|
1803
|
+
_t as TwilightSkybox,
|
|
1804
|
+
Tt as WineBottle,
|
|
1805
|
+
Pe as WineBottleGeometry,
|
|
1806
|
+
st as WroughtIronBarGeometry,
|
|
1807
|
+
Ut as addNoiseDisplacement,
|
|
1808
|
+
qt as checkerboardTexture,
|
|
1809
|
+
W as daySkyShader,
|
|
1810
|
+
qe as displacementBrush,
|
|
1811
|
+
Ce as fadeShader,
|
|
1812
|
+
Oe as flattenBrush,
|
|
1813
|
+
Y as nightSkyShader,
|
|
1814
|
+
Ve as noiseBrush,
|
|
1815
|
+
Se as randomTransformVertices,
|
|
1816
|
+
Xe as smoothBrush,
|
|
1817
|
+
Ye as spikeBrush,
|
|
1818
|
+
Ze as twistBrush,
|
|
1819
|
+
zt as updateMaterialTime
|
|
1378
1820
|
};
|
|
1379
1821
|
//# sourceMappingURL=index.es.js.map
|