three-low-poly 1.0.0 → 1.0.1
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.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +61 -35
- package/dist/index.mjs +830 -859
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
- package/dist/index.iife.js +0 -2
- package/dist/index.iife.js.map +0 -1
- package/dist/uv-grid.jpg +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { AdditiveBlending as e, Box3 as t, BoxGeometry as n, BufferAttribute as r, BufferGeometry as i, CanvasTexture as a, CatmullRomCurve3 as o, CircleGeometry as s, Color as c, ConeGeometry as l, CylinderGeometry as u, DataTexture as d, DodecahedronGeometry as f, DoubleSide as p, DynamicDrawUsage as m, Euler as h, ExtrudeGeometry as g, Float32BufferAttribute as _, Group as v, IcosahedronGeometry as y,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { AdditiveBlending as e, Box3 as t, BoxGeometry as n, BufferAttribute as r, BufferGeometry as i, CanvasTexture as a, CatmullRomCurve3 as o, CircleGeometry as s, Color as c, ConeGeometry as l, CylinderGeometry as u, DataTexture as d, DodecahedronGeometry as f, DoubleSide as p, DynamicDrawUsage as m, Euler as h, ExtrudeGeometry as g, Float32BufferAttribute as _, Group as v, IcosahedronGeometry as y, InstancedBufferAttribute as b, InstancedMesh as x, LatheGeometry as S, MathUtils as C, Matrix4 as w, Mesh as T, MeshBasicMaterial as E, MeshPhysicalMaterial as D, MeshStandardMaterial as O, NearestFilter as k, Object3D as A, OctahedronGeometry as ee, Path as j, PlaneGeometry as M, PointLight as te, Quaternion as N, RGBAFormat as ne, RepeatWrapping as re, SRGBColorSpace as ie, Shape as P, ShapeGeometry as ae, SphereGeometry as F, TorusGeometry as oe, TubeGeometry as se, UnsignedByteType as ce, Vector2 as I, Vector3 as L } from "three";
|
|
2
|
+
import { instancedBufferAttribute as le, instancedDynamicBufferAttribute as ue } from "three/tsl";
|
|
3
|
+
import { SpriteNodeMaterial as de } from "three/webgpu";
|
|
4
|
+
import { mergeGeometries as R, mergeVertices as fe } from "three/addons/utils/BufferGeometryUtils.js";
|
|
5
|
+
import { ParametricGeometry as pe } from "three/addons/geometries/ParametricGeometry.js";
|
|
4
6
|
//#region src/animators/cameraClip.ts
|
|
5
|
-
function
|
|
6
|
-
let n = t?.target.clone() ?? new
|
|
7
|
+
function me(e, t) {
|
|
8
|
+
let n = t?.target.clone() ?? new L();
|
|
7
9
|
if (!t) {
|
|
8
|
-
let t = new
|
|
10
|
+
let t = new L();
|
|
9
11
|
e.getWorldDirection(t), n.copy(e.position).add(t);
|
|
10
12
|
}
|
|
11
13
|
return {
|
|
@@ -15,31 +17,31 @@ function pe(e, t) {
|
|
|
15
17
|
target: n
|
|
16
18
|
};
|
|
17
19
|
}
|
|
18
|
-
function
|
|
20
|
+
function he(e, t, n) {
|
|
19
21
|
e.position.copy(n.position), e.quaternion.copy(n.quaternion), e.fov = n.fov, e.updateProjectionMatrix(), t && (t.target.copy(n.target), t.update());
|
|
20
22
|
}
|
|
21
|
-
function
|
|
23
|
+
function z(e, t) {
|
|
22
24
|
return t(Math.min(1, e.elapsed / e.duration));
|
|
23
25
|
}
|
|
24
26
|
//#endregion
|
|
25
27
|
//#region src/animators/CameraPlayback.ts
|
|
26
|
-
var
|
|
28
|
+
var ge = class {
|
|
27
29
|
camera;
|
|
28
30
|
controls;
|
|
29
31
|
active = null;
|
|
30
32
|
elapsed = 0;
|
|
31
|
-
focus = new
|
|
33
|
+
focus = new L();
|
|
32
34
|
rest;
|
|
33
35
|
constructor(e, t) {
|
|
34
36
|
this.camera = e, this.controls = t;
|
|
35
|
-
let n =
|
|
37
|
+
let n = me(e, t);
|
|
36
38
|
this.focus.copy(n.target), this.rest = n;
|
|
37
39
|
}
|
|
38
40
|
get isPlaying() {
|
|
39
41
|
return this.active !== null;
|
|
40
42
|
}
|
|
41
43
|
setRest() {
|
|
42
|
-
this.rest =
|
|
44
|
+
this.rest = me(this.camera, this.controls);
|
|
43
45
|
}
|
|
44
46
|
setRestSnapshot(e) {
|
|
45
47
|
this.rest = {
|
|
@@ -50,10 +52,10 @@ var he = class {
|
|
|
50
52
|
};
|
|
51
53
|
}
|
|
52
54
|
play(e) {
|
|
53
|
-
this.cancelActive(),
|
|
55
|
+
this.cancelActive(), he(this.camera, this.controls, this.rest), this.active = e, this.elapsed = 0, this.controls && (this.controls.enabled = !1), e.start(this.runtime());
|
|
54
56
|
}
|
|
55
57
|
stop() {
|
|
56
|
-
this.cancelActive(),
|
|
58
|
+
this.cancelActive(), he(this.camera, this.controls, this.rest), this.controls && (this.controls.enabled = !0, this.controls.update());
|
|
57
59
|
}
|
|
58
60
|
reset() {
|
|
59
61
|
this.stop();
|
|
@@ -76,7 +78,7 @@ var he = class {
|
|
|
76
78
|
focus: this.focus
|
|
77
79
|
};
|
|
78
80
|
}
|
|
79
|
-
},
|
|
81
|
+
}, B = {
|
|
80
82
|
sineIn: (e) => 1 - Math.cos(e * Math.PI / 2),
|
|
81
83
|
sineOut: (e) => Math.sin(e * Math.PI / 2),
|
|
82
84
|
sineInOut: (e) => -.5 * (Math.cos(Math.PI * e) - 1),
|
|
@@ -106,42 +108,42 @@ var he = class {
|
|
|
106
108
|
squareRoot: (e) => Math.sqrt(e),
|
|
107
109
|
inverse: (e) => 1 - e,
|
|
108
110
|
gaussian: (e) => Math.exp(-((e - .5) ** 2) / (2 * .5))
|
|
109
|
-
},
|
|
110
|
-
new
|
|
111
|
-
function
|
|
112
|
-
let { target: t, duration: n, ease: r =
|
|
111
|
+
}, V = new L();
|
|
112
|
+
new L();
|
|
113
|
+
function _e(e) {
|
|
114
|
+
let { target: t, duration: n, ease: r = B.smoothstep, revolutions: i = 1 } = e, a = { value: 0 }, o = { value: e.radius ?? 10 }, s = { value: e.elevation ?? .4 };
|
|
113
115
|
return {
|
|
114
116
|
label: "Orbit",
|
|
115
117
|
duration: n,
|
|
116
118
|
start(n) {
|
|
117
|
-
n.focus.copy(t),
|
|
119
|
+
n.focus.copy(t), V.subVectors(n.camera.position, t), o.value = e.radius ?? V.length(), s.value = e.elevation ?? Math.asin(C.clamp(V.y / o.value, -1, 1)), a.value = Math.atan2(V.z, V.x);
|
|
118
120
|
},
|
|
119
121
|
update(e) {
|
|
120
|
-
let n =
|
|
122
|
+
let n = z(e, r);
|
|
121
123
|
if (n >= 1) return "complete";
|
|
122
124
|
let c = a.value + n * Math.PI * 2 * i, l = o.value * Math.cos(s.value);
|
|
123
125
|
return e.camera.position.set(t.x + l * Math.cos(c), t.y + o.value * Math.sin(s.value), t.z + l * Math.sin(c)), e.camera.lookAt(e.focus), "running";
|
|
124
126
|
}
|
|
125
127
|
};
|
|
126
128
|
}
|
|
127
|
-
function
|
|
128
|
-
let { target: t, duration: n, azimuthAmplitude: r = .14, oscillations: i = 2, ease: a =
|
|
129
|
+
function ve(e) {
|
|
130
|
+
let { target: t, duration: n, azimuthAmplitude: r = .14, oscillations: i = 2, ease: a = B.linear } = e, o = { value: 0 }, s = { value: e.distance ?? 8 }, c = { value: .35 };
|
|
129
131
|
return {
|
|
130
132
|
label: "Pendulum",
|
|
131
133
|
duration: n,
|
|
132
134
|
start(n) {
|
|
133
|
-
n.focus.copy(t),
|
|
135
|
+
n.focus.copy(t), V.subVectors(n.camera.position, t), s.value = e.distance ?? V.length(), c.value = Math.asin(C.clamp(V.y / s.value, -1, 1)), o.value = Math.atan2(V.z, V.x);
|
|
134
136
|
},
|
|
135
137
|
update(e) {
|
|
136
|
-
let n =
|
|
138
|
+
let n = z(e, a);
|
|
137
139
|
if (n >= 1) return "complete";
|
|
138
140
|
let l = Math.sin(n * Math.PI * 2 * i) * r, u = o.value + l, d = s.value * Math.cos(c.value);
|
|
139
141
|
return e.camera.position.set(t.x + d * Math.cos(u), t.y + s.value * Math.sin(c.value), t.z + d * Math.sin(u)), e.camera.lookAt(e.focus), "running";
|
|
140
142
|
}
|
|
141
143
|
};
|
|
142
144
|
}
|
|
143
|
-
function
|
|
144
|
-
let { waypoints: t, duration: n, ease: r =
|
|
145
|
+
function ye(e) {
|
|
146
|
+
let { waypoints: t, duration: n, ease: r = B.cubicInOut } = e;
|
|
145
147
|
if (t.length < 2) throw Error("Flythrough clip requires at least two waypoints");
|
|
146
148
|
let i = e.lookAt ?? t.slice(1).concat(t[t.length - 1]), a = t.length - 1;
|
|
147
149
|
return {
|
|
@@ -151,7 +153,7 @@ function ve(e) {
|
|
|
151
153
|
e.focus.copy(i[0] ?? t[0]), e.camera.position.copy(t[0]), e.camera.lookAt(e.focus);
|
|
152
154
|
},
|
|
153
155
|
update(e) {
|
|
154
|
-
let n =
|
|
156
|
+
let n = z(e, B.linear);
|
|
155
157
|
if (n >= 1) return e.camera.position.copy(t[t.length - 1]), e.focus.copy(i[i.length - 1] ?? t[t.length - 1]), e.camera.lookAt(e.focus), "complete";
|
|
156
158
|
let o = n * a, s = Math.min(a - 1, Math.floor(o)), c = r(o - s);
|
|
157
159
|
e.camera.position.lerpVectors(t[s], t[s + 1], c);
|
|
@@ -160,8 +162,8 @@ function ve(e) {
|
|
|
160
162
|
}
|
|
161
163
|
};
|
|
162
164
|
}
|
|
163
|
-
function
|
|
164
|
-
let { distance: t, duration: n, ease: r =
|
|
165
|
+
function be(e) {
|
|
166
|
+
let { distance: t, duration: n, ease: r = B.cubicInOut } = e, i = new L(), a = new L(), o = new L();
|
|
165
167
|
return {
|
|
166
168
|
label: "Dolly",
|
|
167
169
|
duration: n,
|
|
@@ -169,29 +171,29 @@ function ye(e) {
|
|
|
169
171
|
i.copy(e.camera.position), e.camera.getWorldDirection(o), a.copy(i).addScaledVector(o, t), e.focus.copy(e.controls?.target ?? i).addScaledVector(o, 10);
|
|
170
172
|
},
|
|
171
173
|
update(e) {
|
|
172
|
-
let t =
|
|
174
|
+
let t = z(e, r);
|
|
173
175
|
return t >= 1 ? (e.camera.position.copy(a), "complete") : (e.camera.position.lerpVectors(i, a, t), e.camera.lookAt(e.focus), "running");
|
|
174
176
|
}
|
|
175
177
|
};
|
|
176
178
|
}
|
|
177
|
-
function
|
|
178
|
-
let { target: t, radius: n, endRadius: r = n, height: i, revolutions: a, duration: o, ease: s =
|
|
179
|
+
function xe(e) {
|
|
180
|
+
let { target: t, radius: n, endRadius: r = n, height: i, revolutions: a, duration: o, ease: s = B.smoothstep } = e, c = { value: 0 }, l = { value: 0 };
|
|
179
181
|
return {
|
|
180
182
|
label: "Spiral",
|
|
181
183
|
duration: o,
|
|
182
184
|
start(e) {
|
|
183
|
-
e.focus.copy(t), c.value = e.camera.position.y,
|
|
185
|
+
e.focus.copy(t), c.value = e.camera.position.y, V.subVectors(e.camera.position, t), l.value = Math.atan2(V.z, V.x);
|
|
184
186
|
},
|
|
185
187
|
update(e) {
|
|
186
|
-
let o =
|
|
188
|
+
let o = z(e, s);
|
|
187
189
|
if (o >= 1) return "complete";
|
|
188
|
-
let u = l.value + o * Math.PI * 2 * a, d =
|
|
190
|
+
let u = l.value + o * Math.PI * 2 * a, d = C.lerp(n, r, o);
|
|
189
191
|
return e.camera.position.set(t.x + d * Math.cos(u), c.value + i * o, t.z + d * Math.sin(u)), e.camera.lookAt(e.focus), "running";
|
|
190
192
|
}
|
|
191
193
|
};
|
|
192
194
|
}
|
|
193
|
-
function
|
|
194
|
-
let { target: t, endFov: n, duration: r, ease: i =
|
|
195
|
+
function Se(e) {
|
|
196
|
+
let { target: t, endFov: n, duration: r, ease: i = B.cubicInOut } = e, a = { value: 75 };
|
|
195
197
|
return {
|
|
196
198
|
label: "Zoom",
|
|
197
199
|
duration: r,
|
|
@@ -199,16 +201,16 @@ function xe(e) {
|
|
|
199
201
|
e.focus.copy(t), a.value = e.camera.fov;
|
|
200
202
|
},
|
|
201
203
|
update(e) {
|
|
202
|
-
let t =
|
|
203
|
-
return e.camera.fov =
|
|
204
|
+
let t = z(e, i);
|
|
205
|
+
return e.camera.fov = C.lerp(a.value, n, Math.min(1, t)), e.camera.updateProjectionMatrix(), e.camera.lookAt(e.focus), t >= 1 ? "complete" : "running";
|
|
204
206
|
},
|
|
205
207
|
cancel(e) {
|
|
206
208
|
e.camera.fov = a.value, e.camera.updateProjectionMatrix();
|
|
207
209
|
}
|
|
208
210
|
};
|
|
209
211
|
}
|
|
210
|
-
function
|
|
211
|
-
let { intensity: t, duration: n, ease: r =
|
|
212
|
+
function Ce(e) {
|
|
213
|
+
let { intensity: t, duration: n, ease: r = B.linear } = e, i = new L(), a = { value: 0 };
|
|
212
214
|
return {
|
|
213
215
|
label: "Wobble",
|
|
214
216
|
duration: n,
|
|
@@ -216,7 +218,7 @@ function Se(e) {
|
|
|
216
218
|
i.copy(e.camera.position), a.value = e.camera.position.x * 17.3 + e.camera.position.z * 9.1;
|
|
217
219
|
},
|
|
218
220
|
update(e) {
|
|
219
|
-
let n =
|
|
221
|
+
let n = z(e, r);
|
|
220
222
|
if (n >= 1) return e.camera.position.copy(i), "complete";
|
|
221
223
|
let o = 1 - n, s = e.elapsed * 28 + a.value;
|
|
222
224
|
return e.camera.position.set(i.x + Math.sin(s * 1.7) * t * o, i.y + Math.sin(s * 2.3) * t * .6 * o, i.z + Math.cos(s * 1.9) * t * o), "running";
|
|
@@ -228,14 +230,14 @@ function Se(e) {
|
|
|
228
230
|
}
|
|
229
231
|
//#endregion
|
|
230
232
|
//#region src/constants/Direction.ts
|
|
231
|
-
var
|
|
232
|
-
UP: new
|
|
233
|
-
DOWN: new
|
|
234
|
-
LEFT: new
|
|
235
|
-
RIGHT: new
|
|
236
|
-
FORWARD: new
|
|
237
|
-
BACKWARD: new
|
|
238
|
-
},
|
|
233
|
+
var H = {
|
|
234
|
+
UP: new L(0, 1, 0),
|
|
235
|
+
DOWN: new L(0, -1, 0),
|
|
236
|
+
LEFT: new L(-1, 0, 0),
|
|
237
|
+
RIGHT: new L(1, 0, 0),
|
|
238
|
+
FORWARD: new L(0, 0, 1),
|
|
239
|
+
BACKWARD: new L(0, 0, -1)
|
|
240
|
+
}, U = {
|
|
239
241
|
linear: (e, t) => 1 - e / t,
|
|
240
242
|
quadratic: (e, t) => (1 - e / t) ** 2,
|
|
241
243
|
squareRoot: (e, t) => (1 - e / t) ** .5,
|
|
@@ -249,10 +251,10 @@ var V = {
|
|
|
249
251
|
let n = Math.max(0, Math.min(1, 1 - e / t));
|
|
250
252
|
return n * n * (3 - 2 * n);
|
|
251
253
|
}
|
|
252
|
-
},
|
|
254
|
+
}, we = (e, t, n, r, i = H.UP, a = U.linear) => {
|
|
253
255
|
let o = e.attributes.position;
|
|
254
256
|
for (let e = 0; e < o.count; e++) {
|
|
255
|
-
let s = new
|
|
257
|
+
let s = new L();
|
|
256
258
|
s.fromBufferAttribute(o, e);
|
|
257
259
|
let c = s.distanceTo(t);
|
|
258
260
|
if (c < n) {
|
|
@@ -261,10 +263,10 @@ var V = {
|
|
|
261
263
|
}
|
|
262
264
|
}
|
|
263
265
|
o.needsUpdate = !0;
|
|
264
|
-
},
|
|
266
|
+
}, Te = (e, t, n, r, i, a = H.UP, o = U.linear) => {
|
|
265
267
|
let s = e.attributes.position;
|
|
266
268
|
for (let e = 0; e < s.count; e++) {
|
|
267
|
-
let c = new
|
|
269
|
+
let c = new L();
|
|
268
270
|
c.fromBufferAttribute(s, e);
|
|
269
271
|
let l = c.distanceTo(t);
|
|
270
272
|
if (l < n) {
|
|
@@ -273,33 +275,33 @@ var V = {
|
|
|
273
275
|
}
|
|
274
276
|
}
|
|
275
277
|
s.needsUpdate = !0;
|
|
276
|
-
},
|
|
278
|
+
}, Ee = (e, t, n, r, i = H.UP, a = U.linear) => {
|
|
277
279
|
let o = e.attributes.position;
|
|
278
280
|
for (let e = 0; e < o.count; e++) {
|
|
279
|
-
let s = new
|
|
281
|
+
let s = new L();
|
|
280
282
|
s.fromBufferAttribute(o, e);
|
|
281
283
|
let c = s.distanceTo(t);
|
|
282
284
|
if (c < n) {
|
|
283
285
|
let t = r * a(c, n), l = i.clone().normalize();
|
|
284
|
-
s.x +=
|
|
286
|
+
s.x += C.randFloatSpread(t) * l.x, s.y += C.randFloatSpread(t) * l.y, s.z += C.randFloatSpread(t) * l.z, o.setXYZ(e, s.x, s.y, s.z);
|
|
285
287
|
}
|
|
286
288
|
}
|
|
287
289
|
o.needsUpdate = !0;
|
|
288
|
-
},
|
|
289
|
-
let i = e.attributes.position, a = new
|
|
290
|
+
}, De = (e, t, n, r) => {
|
|
291
|
+
let i = e.attributes.position, a = new L();
|
|
290
292
|
for (let e = 0; e < i.count; e++) {
|
|
291
|
-
let o = new
|
|
293
|
+
let o = new L();
|
|
292
294
|
if (o.fromBufferAttribute(i, e), o.distanceTo(t) < n) {
|
|
293
|
-
let t = new
|
|
295
|
+
let t = new L(), s = 0;
|
|
294
296
|
for (let e = 0; e < i.count; e++) a.fromBufferAttribute(i, e), a.distanceTo(o) < n && (t.add(a), s++);
|
|
295
297
|
s > 0 && (t.divideScalar(s), o.lerp(t, r), i.setXYZ(e, o.x, o.y, o.z));
|
|
296
298
|
}
|
|
297
299
|
}
|
|
298
300
|
i.needsUpdate = !0;
|
|
299
|
-
},
|
|
301
|
+
}, Oe = (e, t, n, r, i = !1, a = U.linear) => {
|
|
300
302
|
let o = e.attributes.position;
|
|
301
303
|
for (let e = 0; e < o.count; e++) {
|
|
302
|
-
let s = new
|
|
304
|
+
let s = new L();
|
|
303
305
|
s.fromBufferAttribute(o, e);
|
|
304
306
|
let c = s.distanceTo(t);
|
|
305
307
|
if (c < n) {
|
|
@@ -308,10 +310,10 @@ var V = {
|
|
|
308
310
|
}
|
|
309
311
|
}
|
|
310
312
|
o.needsUpdate = !0;
|
|
311
|
-
},
|
|
312
|
-
let o = e.attributes.position, s = new
|
|
313
|
+
}, ke = (e, t, n, r, i = H.UP, a = U.linear) => {
|
|
314
|
+
let o = e.attributes.position, s = new N();
|
|
313
315
|
for (let e = 0; e < o.count; e++) {
|
|
314
|
-
let c = new
|
|
316
|
+
let c = new L();
|
|
315
317
|
c.fromBufferAttribute(o, e);
|
|
316
318
|
let l = c.distanceTo(t);
|
|
317
319
|
if (l < n) {
|
|
@@ -320,17 +322,17 @@ var V = {
|
|
|
320
322
|
}
|
|
321
323
|
}
|
|
322
324
|
o.needsUpdate = !0;
|
|
323
|
-
},
|
|
324
|
-
X: new
|
|
325
|
-
Y: new
|
|
326
|
-
Z: new
|
|
327
|
-
XY: new
|
|
328
|
-
XZ: new
|
|
329
|
-
YZ: new
|
|
330
|
-
XYZ: new
|
|
331
|
-
},
|
|
325
|
+
}, Ae = {
|
|
326
|
+
X: new L(1, 0, 0),
|
|
327
|
+
Y: new L(0, 1, 0),
|
|
328
|
+
Z: new L(0, 0, 1),
|
|
329
|
+
XY: new L(1, 1, 0).normalize(),
|
|
330
|
+
XZ: new L(1, 0, 1).normalize(),
|
|
331
|
+
YZ: new L(0, 1, 1).normalize(),
|
|
332
|
+
XYZ: new L(1, 1, 1).normalize()
|
|
333
|
+
}, W = /* @__PURE__ */ function(e) {
|
|
332
334
|
return e.LEFT = "left", e.RIGHT = "right", e.TOP = "top", e.BOTTOM = "bottom", e.FRONT = "front", e.BACK = "back", e;
|
|
333
|
-
}({}),
|
|
335
|
+
}({}), je = {
|
|
334
336
|
CADMIUM_RED: 15073318,
|
|
335
337
|
CARDINAL_RED: 12981270,
|
|
336
338
|
CHERRY_RED: 14165028,
|
|
@@ -400,7 +402,7 @@ var V = {
|
|
|
400
402
|
PALE_GRAY: 15658734,
|
|
401
403
|
WHITE_SMOKE: 16119285,
|
|
402
404
|
TITANIUM_WHITE: 16777215
|
|
403
|
-
},
|
|
405
|
+
}, G = {
|
|
404
406
|
cubic: (e, t, n, r, i) => {
|
|
405
407
|
let a = Math.max(0, Math.min(1, e)), o = 1 - a;
|
|
406
408
|
return o * o * o * t + 3 * o * o * a * n + 3 * o * a * a * r + a * a * a * i;
|
|
@@ -427,7 +429,7 @@ var V = {
|
|
|
427
429
|
};
|
|
428
430
|
//#endregion
|
|
429
431
|
//#region src/utils/Random.ts
|
|
430
|
-
function
|
|
432
|
+
function Me(e) {
|
|
431
433
|
let t = e >>> 0;
|
|
432
434
|
return () => {
|
|
433
435
|
t |= 0, t = t + 1831565813 | 0;
|
|
@@ -435,14 +437,14 @@ function je(e) {
|
|
|
435
437
|
return e = e + Math.imul(e ^ e >>> 7, 61 | e) ^ e, ((e ^ e >>> 14) >>> 0) / 4294967296;
|
|
436
438
|
};
|
|
437
439
|
}
|
|
438
|
-
function
|
|
440
|
+
function Ne(e) {
|
|
439
441
|
let t = (e >>> 0) + 2654435769;
|
|
440
442
|
return t = Math.imul(t ^ t >>> 16, 2246822507), t ^= t >>> 13, t = Math.imul(t ^ t >>> 16, 3266489909), (t ^ t >>> 16) >>> 0;
|
|
441
443
|
}
|
|
442
|
-
function Ne(e, t) {
|
|
443
|
-
return Me(e >>> 0 ^ t >>> 0);
|
|
444
|
-
}
|
|
445
444
|
function Pe(e, t) {
|
|
445
|
+
return Ne(e >>> 0 ^ t >>> 0);
|
|
446
|
+
}
|
|
447
|
+
function Fe(e, t) {
|
|
446
448
|
return {
|
|
447
449
|
seeded: t,
|
|
448
450
|
next: e,
|
|
@@ -467,39 +469,39 @@ function Pe(e, t) {
|
|
|
467
469
|
}
|
|
468
470
|
};
|
|
469
471
|
}
|
|
470
|
-
function
|
|
471
|
-
return e === void 0 ?
|
|
472
|
+
function K(e) {
|
|
473
|
+
return e === void 0 ? Fe(Math.random, !1) : Fe(Me(e >>> 0), !0);
|
|
472
474
|
}
|
|
473
|
-
function
|
|
475
|
+
function Ie(e, t, n) {
|
|
474
476
|
return t + (n - t) * e();
|
|
475
477
|
}
|
|
476
|
-
function
|
|
478
|
+
function Le(e, t) {
|
|
477
479
|
if (!t.length) throw Error("randomPick() requires a non-empty array");
|
|
478
480
|
return t[Math.floor(e() * t.length)];
|
|
479
481
|
}
|
|
480
|
-
var
|
|
481
|
-
create:
|
|
482
|
-
mulberry32:
|
|
483
|
-
splitmix32:
|
|
484
|
-
deriveSubSeed:
|
|
485
|
-
range:
|
|
486
|
-
pick:
|
|
487
|
-
},
|
|
488
|
-
function
|
|
482
|
+
var Re = {
|
|
483
|
+
create: K,
|
|
484
|
+
mulberry32: Me,
|
|
485
|
+
splitmix32: Ne,
|
|
486
|
+
deriveSubSeed: Pe,
|
|
487
|
+
range: Ie,
|
|
488
|
+
pick: Le
|
|
489
|
+
}, ze = K();
|
|
490
|
+
function q(e = 0, t = 1, n = ze) {
|
|
489
491
|
return n.float(e, t);
|
|
490
492
|
}
|
|
491
|
-
function
|
|
493
|
+
function Be(e = 0, t = 1, n = ze) {
|
|
492
494
|
return n.int(e, t);
|
|
493
495
|
}
|
|
494
|
-
function
|
|
496
|
+
function Ve(e = .5, t = 0, n = 1, r = ze) {
|
|
495
497
|
return r.skewMax(e, t, n);
|
|
496
498
|
}
|
|
497
|
-
function
|
|
499
|
+
function He(e = .5, t = 0, n = 1, r = ze) {
|
|
498
500
|
return r.skewMin(e, t, n);
|
|
499
501
|
}
|
|
500
502
|
//#endregion
|
|
501
503
|
//#region src/effects/DustMotesEffect.ts
|
|
502
|
-
var
|
|
504
|
+
var Ue = class extends x {
|
|
503
505
|
width;
|
|
504
506
|
height;
|
|
505
507
|
depth;
|
|
@@ -513,10 +515,10 @@ var He = class extends b {
|
|
|
513
515
|
settle;
|
|
514
516
|
twinkle;
|
|
515
517
|
phase;
|
|
516
|
-
dummy = new
|
|
518
|
+
dummy = new A();
|
|
517
519
|
clock = 0;
|
|
518
520
|
constructor(t = {}) {
|
|
519
|
-
let { count: n = 150, width: r = 12, height: i = 8, depth: a = 12, floorY: o = 0, color: s = "#aebfe6", radius: l = .02, opacity: u = .9, material: d, settleMin: f = .1, settleMax: p = .35, waft: h = .08, scaleMin: g = .6, scaleMax: _ = 1.2, twinkleMin: v = .7, twinkleMax: y = 1.6 } = t, b = d ?? new
|
|
521
|
+
let { count: n = 150, width: r = 12, height: i = 8, depth: a = 12, floorY: o = 0, color: s = "#aebfe6", radius: l = .02, opacity: u = .9, material: d, settleMin: f = .1, settleMax: p = .35, waft: h = .08, scaleMin: g = .6, scaleMax: _ = 1.2, twinkleMin: v = .7, twinkleMax: y = 1.6 } = t, b = d ?? new E({
|
|
520
522
|
color: new c(s),
|
|
521
523
|
transparent: !0,
|
|
522
524
|
opacity: u,
|
|
@@ -524,8 +526,8 @@ var He = class extends b {
|
|
|
524
526
|
depthWrite: !1,
|
|
525
527
|
toneMapped: !1
|
|
526
528
|
});
|
|
527
|
-
super(new
|
|
528
|
-
for (let e = 0; e < n; e++) this.respawn(e, !0), this.settle[e] =
|
|
529
|
+
super(new F(l, 5, 5), b, n), this.instanceMatrix.setUsage(m), this.frustumCulled = !1, this.width = r, this.height = i, this.depth = a, this.floorY = o, this.waft = h, this.scaleMin = g, this.scaleMax = _, this.px = new Float32Array(n), this.py = new Float32Array(n), this.pz = new Float32Array(n), this.settle = new Float32Array(n), this.twinkle = new Float32Array(n), this.phase = new Float32Array(n);
|
|
530
|
+
for (let e = 0; e < n; e++) this.respawn(e, !0), this.settle[e] = q(f, p), this.twinkle[e] = q(v, y), this.phase[e] = q(0, Math.PI * 2);
|
|
529
531
|
this.writeMatrices();
|
|
530
532
|
}
|
|
531
533
|
update(e) {
|
|
@@ -540,7 +542,7 @@ var He = class extends b {
|
|
|
540
542
|
return this;
|
|
541
543
|
}
|
|
542
544
|
respawn(e, t) {
|
|
543
|
-
this.px[e] =
|
|
545
|
+
this.px[e] = q(-this.width * .5, this.width * .5), this.pz[e] = q(-this.depth * .5, this.depth * .5), this.py[e] = t ? this.floorY + q(0, this.height) : this.floorY + this.height;
|
|
544
546
|
}
|
|
545
547
|
writeMatrices() {
|
|
546
548
|
let e = this.dummy;
|
|
@@ -550,7 +552,7 @@ var He = class extends b {
|
|
|
550
552
|
}
|
|
551
553
|
this.instanceMatrix.needsUpdate = !0;
|
|
552
554
|
}
|
|
553
|
-
},
|
|
555
|
+
}, We = class extends x {
|
|
554
556
|
width;
|
|
555
557
|
height;
|
|
556
558
|
depth;
|
|
@@ -560,9 +562,9 @@ var He = class extends b {
|
|
|
560
562
|
py;
|
|
561
563
|
pz;
|
|
562
564
|
speed;
|
|
563
|
-
dummy = new
|
|
565
|
+
dummy = new A();
|
|
564
566
|
constructor(e = {}) {
|
|
565
|
-
let { count: t = 24, width: n = 1.5, height: r = 3, depth: i = 1.5, spread: a = .88, baseY: o = 0, speedMin: s = .35, speedMax: c = .85, color: l = 16777215, opacity: u = .6, emissiveIntensity: d = 0, geometry: f = new
|
|
567
|
+
let { count: t = 24, width: n = 1.5, height: r = 3, depth: i = 1.5, spread: a = .88, baseY: o = 0, speedMin: s = .35, speedMax: c = .85, color: l = 16777215, opacity: u = .6, emissiveIntensity: d = 0, geometry: f = new F(.08, 6, 6), material: p } = e, h = p ?? new O({
|
|
566
568
|
color: l,
|
|
567
569
|
emissive: l,
|
|
568
570
|
emissiveIntensity: d,
|
|
@@ -572,7 +574,7 @@ var He = class extends b {
|
|
|
572
574
|
metalness: .1
|
|
573
575
|
});
|
|
574
576
|
super(f, h, t), this.instanceMatrix.setUsage(m), this.frustumCulled = !1, this.width = n, this.height = r, this.depth = i, this.baseY = o, this.spread = Math.min(1, Math.max(0, a)), this.px = new Float32Array(t), this.py = new Float32Array(t), this.pz = new Float32Array(t), this.speed = new Float32Array(t);
|
|
575
|
-
for (let e = 0; e < t; e++) this.respawn(e, !0), this.speed[e] =
|
|
577
|
+
for (let e = 0; e < t; e++) this.respawn(e, !0), this.speed[e] = q(s, c);
|
|
576
578
|
this.writeMatrices();
|
|
577
579
|
}
|
|
578
580
|
update(e) {
|
|
@@ -588,14 +590,14 @@ var He = class extends b {
|
|
|
588
590
|
}
|
|
589
591
|
respawn(e, t) {
|
|
590
592
|
let n = this.width * .5 * this.spread, r = this.depth * .5 * this.spread;
|
|
591
|
-
this.px[e] =
|
|
593
|
+
this.px[e] = q(-n, n), this.pz[e] = q(-r, r), this.py[e] = t ? this.baseY + Math.random() * this.height : this.baseY + q(0, this.height * .15);
|
|
592
594
|
}
|
|
593
595
|
writeMatrices() {
|
|
594
596
|
let e = this.dummy;
|
|
595
597
|
for (let t = 0; t < this.count; t++) e.position.set(this.px[t], this.py[t], this.pz[t]), e.updateMatrix(), this.setMatrixAt(t, e.matrix);
|
|
596
598
|
this.instanceMatrix.needsUpdate = !0;
|
|
597
599
|
}
|
|
598
|
-
},
|
|
600
|
+
}, Ge = class {
|
|
599
601
|
speed;
|
|
600
602
|
minIntensity;
|
|
601
603
|
maxIntensity;
|
|
@@ -609,7 +611,7 @@ var He = class extends b {
|
|
|
609
611
|
let t = Math.abs(Math.sin(this.elapsed * this.speed));
|
|
610
612
|
this.material.emissiveIntensity = this.minIntensity + t * (this.maxIntensity - this.minIntensity);
|
|
611
613
|
}
|
|
612
|
-
},
|
|
614
|
+
}, Ke = class e {
|
|
613
615
|
seed;
|
|
614
616
|
light;
|
|
615
617
|
lightIntensity;
|
|
@@ -638,21 +640,21 @@ var He = class extends b {
|
|
|
638
640
|
};
|
|
639
641
|
//#endregion
|
|
640
642
|
//#region src/effects/GlowHalo.ts
|
|
641
|
-
function
|
|
643
|
+
function qe(e) {
|
|
642
644
|
let t = document.createElement("canvas");
|
|
643
645
|
t.width = t.height = 128;
|
|
644
646
|
let n = t.getContext("2d"), r = `#${e.getHexString()}`, i = n.createRadialGradient(64, 64, 2, 64, 64, 64);
|
|
645
647
|
i.addColorStop(0, `${r}ff`), i.addColorStop(.25, `${r}aa`), i.addColorStop(1, `${r}00`), n.fillStyle = i, n.fillRect(0, 0, 128, 128);
|
|
646
648
|
let o = new a(t);
|
|
647
|
-
return o.colorSpace =
|
|
649
|
+
return o.colorSpace = ie, o;
|
|
648
650
|
}
|
|
649
|
-
var
|
|
651
|
+
var Je = class extends A {
|
|
650
652
|
mesh;
|
|
651
653
|
texture;
|
|
652
654
|
baseColor;
|
|
653
655
|
constructor({ color: t = 16755268, size: n = 1.2, opacity: r = .75 } = {}) {
|
|
654
|
-
super(), this.baseColor = new c(t), this.texture =
|
|
655
|
-
let i = new
|
|
656
|
+
super(), this.baseColor = new c(t), this.texture = qe(this.baseColor);
|
|
657
|
+
let i = new E({
|
|
656
658
|
map: this.texture,
|
|
657
659
|
color: this.baseColor,
|
|
658
660
|
transparent: !0,
|
|
@@ -661,7 +663,7 @@ var qe = class extends O {
|
|
|
661
663
|
depthWrite: !1,
|
|
662
664
|
toneMapped: !1
|
|
663
665
|
});
|
|
664
|
-
this.mesh = new
|
|
666
|
+
this.mesh = new T(new M(n, n), i), this.add(this.mesh);
|
|
665
667
|
}
|
|
666
668
|
faceCamera(e) {
|
|
667
669
|
this.mesh.lookAt(e);
|
|
@@ -673,12 +675,12 @@ var qe = class extends O {
|
|
|
673
675
|
return this.mesh.material.opacity;
|
|
674
676
|
}
|
|
675
677
|
setColor(e) {
|
|
676
|
-
this.baseColor.set(e), this.mesh.material.color.copy(this.baseColor), this.texture.dispose(), this.texture =
|
|
678
|
+
this.baseColor.set(e), this.mesh.material.color.copy(this.baseColor), this.texture.dispose(), this.texture = qe(this.baseColor), this.mesh.material.map = this.texture;
|
|
677
679
|
}
|
|
678
680
|
dispose() {
|
|
679
681
|
this.mesh.geometry.dispose(), this.mesh.material.dispose(), this.texture.dispose();
|
|
680
682
|
}
|
|
681
|
-
},
|
|
683
|
+
}, Ye = class extends A {
|
|
682
684
|
patches = [];
|
|
683
685
|
area;
|
|
684
686
|
heightAt;
|
|
@@ -688,8 +690,8 @@ var qe = class extends O {
|
|
|
688
690
|
x: 1,
|
|
689
691
|
z: 1
|
|
690
692
|
}, color: o = "#9fb0c8", heightAt: s = () => 0 } = {}) {
|
|
691
|
-
super(), this.area = t, this.heightAt = s, this.texture =
|
|
692
|
-
let c =
|
|
693
|
+
super(), this.area = t, this.heightAt = s, this.texture = Xe(o);
|
|
694
|
+
let c = Ze(a);
|
|
693
695
|
for (let t = 0; t < e; t++) this.patches.push(this.makeInteriorPatch());
|
|
694
696
|
for (let e = 0; e < n; e++) this.patches.push(this.makePerimeterPatch(r, i, c));
|
|
695
697
|
}
|
|
@@ -697,7 +699,7 @@ var qe = class extends O {
|
|
|
697
699
|
this.elapsed += e;
|
|
698
700
|
for (let t of this.patches) {
|
|
699
701
|
let n = t.mesh;
|
|
700
|
-
n.position.x += t.driftX * e, n.position.z += t.driftZ * e, n.rotation.z += t.spin * e, t.perimeter ? (
|
|
702
|
+
n.position.x += t.driftX * e, n.position.z += t.driftZ * e, n.rotation.z += t.spin * e, t.perimeter ? (et(n, t.perimeter.edge, t.perimeter.plotHalf, t.perimeter.terrainHalf), n.position.y = this.heightAt(n.position.x, n.position.z) + .15 + .35 * (.5 + .5 * Math.sin(this.elapsed * .22 + t.phase))) : (n.position.x > this.area && (n.position.x -= this.area * 2), n.position.x < -this.area && (n.position.x += this.area * 2), n.position.z > this.area && (n.position.z -= this.area * 2), n.position.z < -this.area && (n.position.z += this.area * 2)), n.material.opacity = t.baseOpacity * (.6 + .4 * Math.sin(this.elapsed * .3 + t.phase));
|
|
701
703
|
}
|
|
702
704
|
}
|
|
703
705
|
dispose() {
|
|
@@ -706,25 +708,25 @@ var qe = class extends O {
|
|
|
706
708
|
this.patches.length = 0, this.clear();
|
|
707
709
|
}
|
|
708
710
|
makeInteriorPatch() {
|
|
709
|
-
let e =
|
|
710
|
-
return i.position.set(n, this.heightAt(n, r) +
|
|
711
|
+
let e = q(8, 16), t = q(.05, .16), n = q(-this.area, this.area), r = q(-this.area, this.area), i = this.makeMesh(e, t);
|
|
712
|
+
return i.position.set(n, this.heightAt(n, r) + q(.3, 1.2), r), this.add(i), {
|
|
711
713
|
mesh: i,
|
|
712
|
-
driftX:
|
|
713
|
-
driftZ:
|
|
714
|
-
spin:
|
|
714
|
+
driftX: q(-.15, .15),
|
|
715
|
+
driftZ: q(-.15, .15),
|
|
716
|
+
spin: q(-.03, .03),
|
|
715
717
|
baseOpacity: t,
|
|
716
|
-
phase:
|
|
718
|
+
phase: q(0, Math.PI * 2)
|
|
717
719
|
};
|
|
718
720
|
}
|
|
719
721
|
makePerimeterPatch(e, t, n) {
|
|
720
|
-
let r =
|
|
721
|
-
return u.position.set(i, this.heightAt(i, a) +
|
|
722
|
+
let r = Qe(n), { x: i, z: a, driftX: o, driftZ: s } = $e(r, e, t), c = q(18, 30), l = q(.1, .26), u = this.makeMesh(c, l);
|
|
723
|
+
return u.position.set(i, this.heightAt(i, a) + q(.15, .55), a), this.add(u), {
|
|
722
724
|
mesh: u,
|
|
723
725
|
driftX: o,
|
|
724
726
|
driftZ: s,
|
|
725
|
-
spin:
|
|
727
|
+
spin: q(-.012, .012),
|
|
726
728
|
baseOpacity: l,
|
|
727
|
-
phase:
|
|
729
|
+
phase: q(0, Math.PI * 2),
|
|
728
730
|
perimeter: {
|
|
729
731
|
edge: r,
|
|
730
732
|
plotHalf: e,
|
|
@@ -733,35 +735,35 @@ var qe = class extends O {
|
|
|
733
735
|
};
|
|
734
736
|
}
|
|
735
737
|
makeMesh(e, t) {
|
|
736
|
-
let n = new
|
|
738
|
+
let n = new T(new M(e, e), new E({
|
|
737
739
|
map: this.texture,
|
|
738
740
|
transparent: !0,
|
|
739
741
|
depthWrite: !1,
|
|
740
742
|
opacity: t,
|
|
741
743
|
toneMapped: !1
|
|
742
744
|
}));
|
|
743
|
-
return n.rotation.x = -Math.PI / 2, n.rotation.z =
|
|
745
|
+
return n.rotation.x = -Math.PI / 2, n.rotation.z = q(0, Math.PI * 2), n;
|
|
744
746
|
}
|
|
745
747
|
};
|
|
746
|
-
function
|
|
748
|
+
function Xe(e) {
|
|
747
749
|
let t = `#${new c(e).getHexString()}`, n = document.createElement("canvas");
|
|
748
750
|
n.width = n.height = 256;
|
|
749
751
|
let r = n.getContext("2d"), i = r.createRadialGradient(128, 128, 8, 128, 128, 128);
|
|
750
752
|
i.addColorStop(0, `${t}dd`), i.addColorStop(.45, `${t}66`), i.addColorStop(1, `${t}00`), r.fillStyle = i, r.fillRect(0, 0, 256, 256);
|
|
751
753
|
let o = new a(n);
|
|
752
|
-
return o.colorSpace =
|
|
754
|
+
return o.colorSpace = ie, o;
|
|
753
755
|
}
|
|
754
|
-
function
|
|
756
|
+
function Ze(e) {
|
|
755
757
|
let t = [];
|
|
756
758
|
return e.z > 0 && t.push("n"), e.z < 0 && t.push("s"), e.x > 0 && t.push("w"), e.x < 0 && t.push("e"), t.length ? t : ["n", "w"];
|
|
757
759
|
}
|
|
758
|
-
function
|
|
760
|
+
function Qe(e) {
|
|
759
761
|
if (e.length === 1) return e[0];
|
|
760
762
|
let t = Math.random(), n = e.includes("n"), r = e.includes("w");
|
|
761
763
|
return n && r ? t < .58 ? "n" : "w" : e[Math.floor(Math.random() * e.length)];
|
|
762
764
|
}
|
|
763
|
-
function
|
|
764
|
-
let r =
|
|
765
|
+
function $e(e, t, n) {
|
|
766
|
+
let r = q(.6, n - t - 1.5), i = q(-n + 3, n - 3), a = q(.03, .09) * (Math.random() < .5 ? -1 : 1), o = q(.01, .04);
|
|
765
767
|
switch (e) {
|
|
766
768
|
case "n": return {
|
|
767
769
|
x: i,
|
|
@@ -789,29 +791,29 @@ function Qe(e, t, n) {
|
|
|
789
791
|
};
|
|
790
792
|
}
|
|
791
793
|
}
|
|
792
|
-
function
|
|
794
|
+
function et(e, t, n, r) {
|
|
793
795
|
let i = r - 1, { x: a, z: o } = e.position;
|
|
794
796
|
switch (t) {
|
|
795
797
|
case "n":
|
|
796
|
-
e.position.z =
|
|
798
|
+
e.position.z = tt(o, -i, -n + .8), a < -i + 3 && (e.position.x = i - 3), a > i - 3 && (e.position.x = -i + 3);
|
|
797
799
|
break;
|
|
798
800
|
case "s":
|
|
799
|
-
e.position.z =
|
|
801
|
+
e.position.z = tt(o, n - .8, i), a < -i + 3 && (e.position.x = i - 3), a > i - 3 && (e.position.x = -i + 3);
|
|
800
802
|
break;
|
|
801
803
|
case "e":
|
|
802
|
-
e.position.x =
|
|
804
|
+
e.position.x = tt(a, n - .8, i), o < -i + 3 && (e.position.z = i - 3), o > i - 3 && (e.position.z = -i + 3);
|
|
803
805
|
break;
|
|
804
806
|
case "w":
|
|
805
|
-
e.position.x =
|
|
807
|
+
e.position.x = tt(a, -i, -n + .8), o < -i + 3 && (e.position.z = i - 3), o > i - 3 && (e.position.z = -i + 3);
|
|
806
808
|
break;
|
|
807
809
|
}
|
|
808
810
|
}
|
|
809
|
-
function
|
|
811
|
+
function tt(e, t, n) {
|
|
810
812
|
return Math.max(t, Math.min(n, e));
|
|
811
813
|
}
|
|
812
814
|
//#endregion
|
|
813
815
|
//#region src/effects/LightningEffect.ts
|
|
814
|
-
var
|
|
816
|
+
var nt = class {
|
|
815
817
|
level = 0;
|
|
816
818
|
light;
|
|
817
819
|
peak;
|
|
@@ -821,7 +823,7 @@ var tt = class {
|
|
|
821
823
|
clock = 0;
|
|
822
824
|
nextStrike;
|
|
823
825
|
constructor({ light: e, peak: t = 12, minGap: n = 3, maxGap: r = 9 }) {
|
|
824
|
-
this.light = e, this.peak = t, this.minGap = n, this.maxGap = r, this.nextStrike =
|
|
826
|
+
this.light = e, this.peak = t, this.minGap = n, this.maxGap = r, this.nextStrike = q(n * .3, r);
|
|
825
827
|
}
|
|
826
828
|
update(e) {
|
|
827
829
|
this.clock += e, this.clock >= this.nextStrike && this.strike();
|
|
@@ -840,12 +842,12 @@ var tt = class {
|
|
|
840
842
|
strike() {
|
|
841
843
|
let e = Math.random() < .5 ? 2 : 3;
|
|
842
844
|
for (let t = 0; t < e; t++) this.spikes.push({
|
|
843
|
-
at: this.clock + t *
|
|
844
|
-
amp:
|
|
845
|
+
at: this.clock + t * q(.04, .12),
|
|
846
|
+
amp: q(.5, 1)
|
|
845
847
|
});
|
|
846
|
-
this.nextStrike = this.clock +
|
|
848
|
+
this.nextStrike = this.clock + q(this.minGap, this.maxGap);
|
|
847
849
|
}
|
|
848
|
-
},
|
|
850
|
+
}, rt = class extends i {
|
|
849
851
|
constructor(e = .1) {
|
|
850
852
|
super();
|
|
851
853
|
let t = [], n = [], r = [
|
|
@@ -867,7 +869,7 @@ var tt = class {
|
|
|
867
869
|
let i = new _(t, 3);
|
|
868
870
|
this.setAttribute("position", i), this.setIndex(n), this.computeVertexNormals();
|
|
869
871
|
}
|
|
870
|
-
},
|
|
872
|
+
}, it = class extends x {
|
|
871
873
|
width;
|
|
872
874
|
height;
|
|
873
875
|
depth;
|
|
@@ -883,14 +885,14 @@ var tt = class {
|
|
|
883
885
|
rotY;
|
|
884
886
|
rotZ;
|
|
885
887
|
phase;
|
|
886
|
-
dummy = new
|
|
888
|
+
dummy = new A();
|
|
887
889
|
clock = 0;
|
|
888
890
|
constructor(e = {}) {
|
|
889
891
|
let { count: t = 120, width: n = 16, height: r = 8, depth: i = 16, floorY: a = 0, fallSpeedMin: o = .12, fallSpeedMax: s = .28, driftMin: l = .04, driftMax: u = .14, flutter: d = .35, color: f = [
|
|
890
892
|
16766704,
|
|
891
893
|
16774650,
|
|
892
894
|
15775952
|
|
893
|
-
], geometry: h = new
|
|
895
|
+
], geometry: h = new rt(), material: g } = e, _ = (Array.isArray(f) ? f : [f]).map((e) => new c(e)), v = g ?? new O({
|
|
894
896
|
color: _.length === 1 ? _[0].getHex() : 16777215,
|
|
895
897
|
metalness: .05,
|
|
896
898
|
roughness: .85,
|
|
@@ -899,9 +901,9 @@ var tt = class {
|
|
|
899
901
|
});
|
|
900
902
|
super(h, v, t), this.instanceMatrix.setUsage(m), this.frustumCulled = !1, this.width = n, this.height = r, this.depth = i, this.floorY = a, this.flutter = d, this.px = new Float32Array(t), this.py = new Float32Array(t), this.pz = new Float32Array(t), this.fallSpeed = new Float32Array(t), this.driftX = new Float32Array(t), this.driftZ = new Float32Array(t), this.rotX = new Float32Array(t), this.rotY = new Float32Array(t), this.rotZ = new Float32Array(t), this.phase = new Float32Array(t);
|
|
901
903
|
for (let e = 0; e < t; e++) {
|
|
902
|
-
this.respawn(e, !0), this.fallSpeed[e] =
|
|
903
|
-
let t =
|
|
904
|
-
this.driftX[e] = Math.cos(n) * t, this.driftZ[e] = Math.sin(n) * t, this.phase[e] =
|
|
904
|
+
this.respawn(e, !0), this.fallSpeed[e] = q(o, s);
|
|
905
|
+
let t = q(l, u), n = q(0, Math.PI * 2);
|
|
906
|
+
this.driftX[e] = Math.cos(n) * t, this.driftZ[e] = Math.sin(n) * t, this.phase[e] = q(0, Math.PI * 2), _.length > 1 && this.setColorAt(e, _[Math.floor(Math.random() * _.length)]);
|
|
905
907
|
}
|
|
906
908
|
this.instanceColor && (this.instanceColor.needsUpdate = !0), this.writeMatrices();
|
|
907
909
|
}
|
|
@@ -920,7 +922,7 @@ var tt = class {
|
|
|
920
922
|
return this;
|
|
921
923
|
}
|
|
922
924
|
respawn(e, t) {
|
|
923
|
-
this.px[e] =
|
|
925
|
+
this.px[e] = q(-this.width * .5, this.width * .5), this.pz[e] = q(-this.depth * .5, this.depth * .5), this.py[e] = t ? this.floorY + q(0, this.height * 1.25) : this.floorY + this.height + q(0, this.height * .25), this.rotX[e] = q(-.6, .6), this.rotY[e] = q(-Math.PI, Math.PI), this.rotZ[e] = q(-.8, .8);
|
|
924
926
|
}
|
|
925
927
|
writeMatrices() {
|
|
926
928
|
let e = this.dummy;
|
|
@@ -933,15 +935,15 @@ var tt = class {
|
|
|
933
935
|
};
|
|
934
936
|
//#endregion
|
|
935
937
|
//#region src/effects/RainEffect.ts
|
|
936
|
-
function
|
|
938
|
+
function at() {
|
|
937
939
|
let e = document.createElement("canvas");
|
|
938
940
|
e.width = 8, e.height = 64;
|
|
939
941
|
let t = e.getContext("2d"), n = t.createLinearGradient(0, 0, 0, 64);
|
|
940
942
|
n.addColorStop(0, "rgba(255,255,255,0)"), n.addColorStop(.42, "rgba(255,255,255,0.55)"), n.addColorStop(.58, "rgba(255,255,255,0.55)"), n.addColorStop(1, "rgba(255,255,255,0)"), t.fillStyle = n, t.fillRect(0, 0, 8, 64);
|
|
941
943
|
let r = new a(e);
|
|
942
|
-
return r.colorSpace =
|
|
944
|
+
return r.colorSpace = ie, r;
|
|
943
945
|
}
|
|
944
|
-
var
|
|
946
|
+
var ot = class extends x {
|
|
945
947
|
intensity;
|
|
946
948
|
maxCount;
|
|
947
949
|
area;
|
|
@@ -950,18 +952,18 @@ var at = class extends b {
|
|
|
950
952
|
baseOpacity;
|
|
951
953
|
windDirection;
|
|
952
954
|
windStrength;
|
|
953
|
-
fallDirection = new
|
|
954
|
-
streakOrientation = new
|
|
955
|
+
fallDirection = new L(0, -1, 0);
|
|
956
|
+
streakOrientation = new N();
|
|
955
957
|
sx;
|
|
956
958
|
sz;
|
|
957
959
|
topY;
|
|
958
960
|
len;
|
|
959
961
|
speed;
|
|
960
962
|
streakTexture;
|
|
961
|
-
dummy = new
|
|
963
|
+
dummy = new A();
|
|
962
964
|
clock = 0;
|
|
963
965
|
constructor(e = {}) {
|
|
964
|
-
let { count: t = 1400, area: n = 26, height: r = 22, groundY: i = 0, width: a = .009, color: o = "#aebfd6", opacity: s = .16, lengthMin: l = .18, lengthMax: u = .42, speedMin: d = 11, speedMax: f = 19, windDirection: h = 0, windStrength: g = 0, intensity: _ = .5, geometry: v = new
|
|
966
|
+
let { count: t = 1400, area: n = 26, height: r = 22, groundY: i = 0, width: a = .009, color: o = "#aebfd6", opacity: s = .16, lengthMin: l = .18, lengthMax: u = .42, speedMin: d = 11, speedMax: f = 19, windDirection: h = 0, windStrength: g = 0, intensity: _ = .5, geometry: v = new M(a, 1), material: y } = e, b = y ? void 0 : at(), x = y ?? new E({
|
|
965
967
|
color: new c(o),
|
|
966
968
|
map: b,
|
|
967
969
|
transparent: !0,
|
|
@@ -972,7 +974,7 @@ var at = class extends b {
|
|
|
972
974
|
side: p
|
|
973
975
|
});
|
|
974
976
|
super(v, x, t), this.instanceMatrix.setUsage(m), this.frustumCulled = !1, this.maxCount = t, this.area = n, this.height = r, this.groundY = i, this.baseOpacity = s, this.windDirection = h, this.windStrength = Math.max(0, g), this.updateFallDirection(0), this.intensity = _, this.streakTexture = b, this.sx = new Float32Array(t), this.sz = new Float32Array(t), this.topY = new Float32Array(t), this.len = new Float32Array(t), this.speed = new Float32Array(t);
|
|
975
|
-
for (let e = 0; e < t; e++) this.sx[e] =
|
|
977
|
+
for (let e = 0; e < t; e++) this.sx[e] = q(-n, n), this.sz[e] = q(-n, n), this.topY[e] = q(i, i + r), this.len[e] = q(l, u), this.speed[e] = q(d, f);
|
|
976
978
|
this.writeMatrices(), this.applyIntensity();
|
|
977
979
|
}
|
|
978
980
|
update(e) {
|
|
@@ -1004,7 +1006,7 @@ var at = class extends b {
|
|
|
1004
1006
|
return;
|
|
1005
1007
|
}
|
|
1006
1008
|
let n = t, r = 1 / Math.hypot(n, 1);
|
|
1007
|
-
this.fallDirection.set(Math.cos(this.windDirection) * n * r, -1 * r, Math.sin(this.windDirection) * n * r), this.streakOrientation.setFromUnitVectors(new
|
|
1009
|
+
this.fallDirection.set(Math.cos(this.windDirection) * n * r, -1 * r, Math.sin(this.windDirection) * n * r), this.streakOrientation.setFromUnitVectors(new L(0, 1, 0), this.fallDirection);
|
|
1008
1010
|
}
|
|
1009
1011
|
writeMatrices() {
|
|
1010
1012
|
let e = this.dummy;
|
|
@@ -1014,7 +1016,7 @@ var at = class extends b {
|
|
|
1014
1016
|
}
|
|
1015
1017
|
this.instanceMatrix.needsUpdate = !0;
|
|
1016
1018
|
}
|
|
1017
|
-
},
|
|
1019
|
+
}, st = class extends P {
|
|
1018
1020
|
constructor(e = 5, t = .5, n = 1) {
|
|
1019
1021
|
super();
|
|
1020
1022
|
let r = Math.PI * 2 / e, i = r / 2, a = r / 4;
|
|
@@ -1025,27 +1027,14 @@ var at = class extends b {
|
|
|
1025
1027
|
}
|
|
1026
1028
|
this.closePath();
|
|
1027
1029
|
}
|
|
1028
|
-
},
|
|
1030
|
+
}, ct = class extends g {
|
|
1029
1031
|
constructor({ sides: e = 5, innerRadius: t = .5, outerRadius: n = 1, depth: r = .25 } = {}) {
|
|
1030
|
-
super(new
|
|
1032
|
+
super(new st(e, t, n), {
|
|
1031
1033
|
depth: r,
|
|
1032
1034
|
bevelEnabled: !1
|
|
1033
1035
|
});
|
|
1034
1036
|
}
|
|
1035
|
-
},
|
|
1036
|
-
function lt(e, t, n, r = 128) {
|
|
1037
|
-
let i = document.createElement("canvas");
|
|
1038
|
-
i.width = r, i.height = r;
|
|
1039
|
-
let o = i.getContext("2d"), s = r * .46, c = t / n * s;
|
|
1040
|
-
o.translate(r / 2, r / 2), o.fillStyle = "#ffffff", o.beginPath();
|
|
1041
|
-
for (let t = 0; t < e * 2; t++) {
|
|
1042
|
-
let n = t % 2 == 0 ? s : c, r = t / (e * 2) * Math.PI * 2 - Math.PI / 2, i = Math.cos(r) * n, a = Math.sin(r) * n;
|
|
1043
|
-
t === 0 ? o.moveTo(i, a) : o.lineTo(i, a);
|
|
1044
|
-
}
|
|
1045
|
-
o.closePath(), o.fill();
|
|
1046
|
-
let l = new a(i);
|
|
1047
|
-
return l.needsUpdate = !0, l;
|
|
1048
|
-
}
|
|
1037
|
+
}, lt = new L(0, 0, 0);
|
|
1049
1038
|
function ut(e) {
|
|
1050
1039
|
let t = Math.random(), n = Math.random(), r = Math.PI * 2 * t, i = Math.acos(2 * n - 1), a = Math.sin(i);
|
|
1051
1040
|
return e.set(a * Math.cos(r), Math.cos(i), a * Math.sin(r));
|
|
@@ -1053,63 +1042,50 @@ function ut(e) {
|
|
|
1053
1042
|
function dt(e) {
|
|
1054
1043
|
return (Array.isArray(e) ? e : [e]).map((e) => new c(e));
|
|
1055
1044
|
}
|
|
1056
|
-
|
|
1057
|
-
|
|
1045
|
+
function ft(e) {
|
|
1046
|
+
let t = e.getAttribute("position"), n = 0;
|
|
1047
|
+
for (let e = 0; e < t.count; e++) {
|
|
1048
|
+
let r = t.getX(e), i = t.getY(e), a = r * r + i * i;
|
|
1049
|
+
a > n && (n = a);
|
|
1050
|
+
}
|
|
1051
|
+
return Math.sqrt(n) || 1;
|
|
1052
|
+
}
|
|
1053
|
+
var pt = class extends A {
|
|
1054
|
+
orientation;
|
|
1058
1055
|
field;
|
|
1059
1056
|
twinkle;
|
|
1060
|
-
baseSize;
|
|
1061
1057
|
baseScales;
|
|
1062
1058
|
twinklePhases;
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
dummy = new O();
|
|
1059
|
+
scaleAttribute;
|
|
1060
|
+
dummy = new A();
|
|
1066
1061
|
constructor(e = {}) {
|
|
1067
|
-
super()
|
|
1068
|
-
let {
|
|
1062
|
+
super();
|
|
1063
|
+
let { orientation: t = "billboard", count: n = 1500, radius: r = 500, minRadius: i = r, maxRadius: a = r, sizeMin: o = .008, sizeMax: s = .025, color: c = [
|
|
1069
1064
|
16777215,
|
|
1070
1065
|
13293567,
|
|
1071
1066
|
16774368
|
|
1072
|
-
], twinkle:
|
|
1073
|
-
this.frustumCulled = !1, this.twinkle =
|
|
1074
|
-
let
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1067
|
+
], twinkle: l = !1, rotation: u = 0, rotationJitter: d = Math.PI * 2, material: f, burst: p = {}, geometry: m } = e;
|
|
1068
|
+
this.orientation = t, this.frustumCulled = !1, this.twinkle = l, l && (this.twinklePhases = new Float32Array(n), this.baseScales = new Float32Array(n));
|
|
1069
|
+
let h = {
|
|
1070
|
+
count: n,
|
|
1071
|
+
minRadius: i,
|
|
1072
|
+
maxRadius: a,
|
|
1073
|
+
sizeMin: o,
|
|
1074
|
+
sizeMax: s,
|
|
1075
|
+
color: c,
|
|
1076
|
+
material: f,
|
|
1077
|
+
geometry: m ?? new ct({
|
|
1078
|
+
sides: p.sides ?? 4,
|
|
1079
|
+
innerRadius: p.innerRadius ?? .6,
|
|
1080
|
+
outerRadius: p.outerRadius ?? 1.9,
|
|
1081
|
+
depth: p.depth ?? .05
|
|
1082
|
+
}),
|
|
1083
|
+
rotation: u,
|
|
1084
|
+
rotationJitter: d
|
|
1081
1085
|
};
|
|
1082
|
-
|
|
1083
|
-
c && (this.baseScales = new Float32Array(t));
|
|
1084
|
-
let e = d ?? new st({
|
|
1085
|
-
sides: m.sides,
|
|
1086
|
-
innerRadius: m.innerRadius,
|
|
1087
|
-
outerRadius: m.outerRadius,
|
|
1088
|
-
depth: m.depth
|
|
1089
|
-
});
|
|
1090
|
-
this.field = this.createBurstField({
|
|
1091
|
-
count: t,
|
|
1092
|
-
minRadius: r,
|
|
1093
|
-
maxRadius: i,
|
|
1094
|
-
sizeMin: a,
|
|
1095
|
-
sizeMax: o,
|
|
1096
|
-
color: s,
|
|
1097
|
-
material: l,
|
|
1098
|
-
geometry: e
|
|
1099
|
-
});
|
|
1100
|
-
} else this.field = this.createPointsField({
|
|
1101
|
-
count: t,
|
|
1102
|
-
minRadius: r,
|
|
1103
|
-
maxRadius: i,
|
|
1104
|
-
sizeMin: a,
|
|
1105
|
-
sizeMax: o,
|
|
1106
|
-
color: s,
|
|
1107
|
-
material: l,
|
|
1108
|
-
burstShape: m
|
|
1109
|
-
});
|
|
1110
|
-
this.add(this.field);
|
|
1086
|
+
this.field = t === "billboard" ? this.createBillboardField(h) : this.createRadialField(h), this.add(this.field);
|
|
1111
1087
|
}
|
|
1112
|
-
get
|
|
1088
|
+
get mesh() {
|
|
1113
1089
|
return this.field;
|
|
1114
1090
|
}
|
|
1115
1091
|
get geometry() {
|
|
@@ -1122,23 +1098,21 @@ var ft = class extends O {
|
|
|
1122
1098
|
this.geometry.dispose();
|
|
1123
1099
|
let e = Array.isArray(this.material) ? this.material : [this.material];
|
|
1124
1100
|
for (let t of e) t.dispose();
|
|
1125
|
-
this.spriteTexture?.dispose();
|
|
1126
1101
|
}
|
|
1127
1102
|
update(e = performance.now() * .001) {
|
|
1128
|
-
if (!this.twinkle) return;
|
|
1129
|
-
if (this.
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1103
|
+
if (!this.twinkle || !this.baseScales || !this.twinklePhases) return;
|
|
1104
|
+
if (this.orientation === "billboard") {
|
|
1105
|
+
let t = this.scaleAttribute;
|
|
1106
|
+
if (!t) return;
|
|
1107
|
+
let n = t.array;
|
|
1108
|
+
for (let t = 0; t < this.baseScales.length; t++) {
|
|
1109
|
+
let r = .75 + .25 * Math.sin(e * 2.5 + this.twinklePhases[t]);
|
|
1110
|
+
n[t] = this.baseScales[t] * r;
|
|
1111
|
+
}
|
|
1112
|
+
t.needsUpdate = !0;
|
|
1138
1113
|
return;
|
|
1139
1114
|
}
|
|
1140
|
-
|
|
1141
|
-
let t = new C(), n = new I(), r = new M(), i = new I();
|
|
1115
|
+
let t = new w(), n = new L(), r = new N(), i = new L();
|
|
1142
1116
|
for (let a = 0; a < this.field.count; a++) {
|
|
1143
1117
|
this.field.getMatrixAt(a, t), t.decompose(n, r, i);
|
|
1144
1118
|
let o = .75 + .25 * Math.sin(e * 2.5 + this.twinklePhases[a]), s = this.baseScales[a] * o;
|
|
@@ -1146,54 +1120,51 @@ var ft = class extends O {
|
|
|
1146
1120
|
}
|
|
1147
1121
|
this.field.instanceMatrix.needsUpdate = !0;
|
|
1148
1122
|
}
|
|
1149
|
-
|
|
1150
|
-
let u = dt(
|
|
1123
|
+
createBillboardField({ count: e, minRadius: t, maxRadius: n, sizeMin: r, sizeMax: i, color: a, material: o, geometry: s, rotation: c, rotationJitter: l }) {
|
|
1124
|
+
let u = dt(a), d = new L(), f = Math.max(n - t, 0), h = s.clone();
|
|
1125
|
+
h.center();
|
|
1126
|
+
let g = ft(h), _ = new Float32Array(e * 3), v = new Float32Array(e), y = new Float32Array(e), S = u.length > 1, C = S ? new Float32Array(e * 3) : null;
|
|
1151
1127
|
for (let n = 0; n < e; n++) {
|
|
1152
1128
|
let e = t + Math.random() * f;
|
|
1153
|
-
if (ut(d).multiplyScalar(e),
|
|
1129
|
+
if (ut(d).multiplyScalar(e), _[n * 3] = d.x, _[n * 3 + 1] = d.y, _[n * 3 + 2] = d.z, v[n] = e * (r + Math.random() * (i - r)) / g, y[n] = c + Math.random() * l, this.baseScales && (this.baseScales[n] = v[n]), this.twinklePhases && (this.twinklePhases[n] = Math.random() * Math.PI * 2), C) {
|
|
1154
1130
|
let e = u[Math.floor(Math.random() * u.length)];
|
|
1155
|
-
|
|
1131
|
+
C[n * 3] = e.r, C[n * 3 + 1] = e.g, C[n * 3 + 2] = e.b;
|
|
1156
1132
|
}
|
|
1157
|
-
this.twinklePhases && (this.twinklePhases[n] = Math.random() * Math.PI * 2);
|
|
1158
|
-
}
|
|
1159
|
-
let _ = new i();
|
|
1160
|
-
if (_.setAttribute("position", new r(h, 3)), g) {
|
|
1161
|
-
let e = new r(g, 3);
|
|
1162
|
-
this.twinkle && (this.baseColors = g.slice(), e.setUsage(m)), _.setAttribute("color", e);
|
|
1163
1133
|
}
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
color:
|
|
1168
|
-
|
|
1169
|
-
sizeAttenuation: !0,
|
|
1170
|
-
transparent: !0,
|
|
1171
|
-
alphaTest: .05,
|
|
1172
|
-
vertexColors: g !== null,
|
|
1134
|
+
let T = new b(_, 3), E = new b(v, 1), D = new b(y, 1);
|
|
1135
|
+
this.scaleAttribute = E;
|
|
1136
|
+
let O = o ?? new de({
|
|
1137
|
+
color: S ? 16777215 : u[0].getHex(),
|
|
1138
|
+
side: p,
|
|
1173
1139
|
depthWrite: !1,
|
|
1174
1140
|
toneMapped: !1
|
|
1175
|
-
})
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
let
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1141
|
+
});
|
|
1142
|
+
O.positionNode = le(T, "vec3"), O.rotationNode = le(D, "float"), this.twinkle ? (E.setUsage(m), O.scaleNode = ue(E, "float")) : O.scaleNode = le(E, "float"), C && (O.colorNode = le(new b(C, 3), "vec3"));
|
|
1143
|
+
let k = new x(h, O, e);
|
|
1144
|
+
k.frustumCulled = !1, k.renderOrder = 1;
|
|
1145
|
+
let A = new w();
|
|
1146
|
+
for (let t = 0; t < e; t++) k.setMatrixAt(t, A);
|
|
1147
|
+
return k.instanceMatrix.needsUpdate = !0, k;
|
|
1148
|
+
}
|
|
1149
|
+
createRadialField({ count: e, minRadius: t, maxRadius: n, sizeMin: r, sizeMax: i, color: a, material: o, geometry: s, rotation: c, rotationJitter: l }) {
|
|
1150
|
+
let u = dt(a), d = new L(), f = Math.max(n - t, 0), m = s.clone();
|
|
1151
|
+
m.center(), m.computeBoundingSphere();
|
|
1152
|
+
let h = m.boundingSphere?.radius ?? 1, g = new x(m, o ?? new E({
|
|
1153
|
+
color: u.length === 1 ? u[0].getHex() : 16777215,
|
|
1183
1154
|
side: p,
|
|
1184
1155
|
depthWrite: !1,
|
|
1185
1156
|
toneMapped: !1
|
|
1186
1157
|
}), e);
|
|
1187
|
-
|
|
1158
|
+
g.frustumCulled = !1, g.renderOrder = 1;
|
|
1188
1159
|
for (let n = 0; n < e; n++) {
|
|
1189
|
-
let e = t + Math.random() *
|
|
1190
|
-
ut(
|
|
1191
|
-
let a = e * (r + Math.random() * (i - r)) /
|
|
1192
|
-
this.baseScales && (this.baseScales[n] = a), this.twinklePhases && (this.twinklePhases[n] = Math.random() * Math.PI * 2), this.dummy.position.copy(
|
|
1160
|
+
let e = t + Math.random() * f;
|
|
1161
|
+
ut(d).multiplyScalar(e);
|
|
1162
|
+
let a = e * (r + Math.random() * (i - r)) / h;
|
|
1163
|
+
this.baseScales && (this.baseScales[n] = a), this.twinklePhases && (this.twinklePhases[n] = Math.random() * Math.PI * 2), this.dummy.position.copy(d), this.dummy.lookAt(lt), this.dummy.rotateZ(c + Math.random() * l), this.dummy.scale.setScalar(a), this.dummy.updateMatrix(), g.setMatrixAt(n, this.dummy.matrix), u.length > 1 && g.setColorAt(n, u[Math.floor(Math.random() * u.length)]);
|
|
1193
1164
|
}
|
|
1194
|
-
return
|
|
1165
|
+
return g.instanceMatrix.needsUpdate = !0, g.instanceColor && (g.instanceColor.needsUpdate = !0), g;
|
|
1195
1166
|
}
|
|
1196
|
-
},
|
|
1167
|
+
}, mt = class extends A {
|
|
1197
1168
|
wisps = [];
|
|
1198
1169
|
orbGeometry;
|
|
1199
1170
|
orbMaterial;
|
|
@@ -1214,19 +1185,19 @@ var ft = class extends O {
|
|
|
1214
1185
|
lightPulseSpeed;
|
|
1215
1186
|
elapsed = 0;
|
|
1216
1187
|
constructor({ count: e = 3, width: t = 16, depth: n = 8, heightMin: r = 1, heightMax: i = 2, color: a = 7208880, orbRadius: o = .08, driftX: s = 1.6, driftY: l = .3, driftZ: u = 1.6, speedMin: d = .3, speedMax: f = .7, castLight: p = !0, lightDistance: m = 6, lightDecay: h = 2, lightIntensity: g = 2.5, lightPulseAmplitude: _ = 1.2, lightPulseSpeed: v = 3 } = {}) {
|
|
1217
|
-
super(), this.halfWidth = t / 2, this.depth = n, this.heightMin = r, this.heightMax = i, this.driftX = s, this.driftY = l, this.driftZ = u, this.speedMin = d, this.speedMax = f, this.castLight = p, this.lightDistance = m, this.lightDecay = h, this.lightIntensity = g, this.lightPulseAmplitude = _, this.lightPulseSpeed = v, this.orbGeometry = new
|
|
1188
|
+
super(), this.halfWidth = t / 2, this.depth = n, this.heightMin = r, this.heightMax = i, this.driftX = s, this.driftY = l, this.driftZ = u, this.speedMin = d, this.speedMax = f, this.castLight = p, this.lightDistance = m, this.lightDecay = h, this.lightIntensity = g, this.lightPulseAmplitude = _, this.lightPulseSpeed = v, this.orbGeometry = new F(o, 8, 8), this.orbMaterial = new E({
|
|
1218
1189
|
color: new c(a),
|
|
1219
1190
|
toneMapped: !1
|
|
1220
1191
|
});
|
|
1221
1192
|
for (let t = 0; t < e; t++) {
|
|
1222
|
-
let e = new
|
|
1193
|
+
let e = new L(q(-this.halfWidth, this.halfWidth), q(this.heightMin, this.heightMax), q(0, this.depth)), t = new T(this.orbGeometry, this.orbMaterial);
|
|
1223
1194
|
t.position.copy(e), this.add(t);
|
|
1224
1195
|
let n;
|
|
1225
1196
|
p && (n = new te(a, 3, this.lightDistance, this.lightDecay), t.add(n)), this.wisps.push({
|
|
1226
1197
|
orb: t,
|
|
1227
1198
|
home: e,
|
|
1228
|
-
phase:
|
|
1229
|
-
speed:
|
|
1199
|
+
phase: q(0, Math.PI * 2),
|
|
1200
|
+
speed: q(this.speedMin, this.speedMax),
|
|
1230
1201
|
light: n
|
|
1231
1202
|
});
|
|
1232
1203
|
}
|
|
@@ -1243,7 +1214,7 @@ var ft = class extends O {
|
|
|
1243
1214
|
for (let e of this.wisps) e.light?.dispose();
|
|
1244
1215
|
this.clear(), this.wisps.length = 0;
|
|
1245
1216
|
}
|
|
1246
|
-
},
|
|
1217
|
+
}, ht = class extends i {
|
|
1247
1218
|
width;
|
|
1248
1219
|
height;
|
|
1249
1220
|
depth;
|
|
@@ -1790,26 +1761,26 @@ var ft = class extends O {
|
|
|
1790
1761
|
], y = new Float32Array(p), b = new Float32Array(m), x = new Float32Array(_), S = new Uint16Array(v), C = new i();
|
|
1791
1762
|
C.setAttribute("position", new r(y, 3)), C.setAttribute("normal", new r(b, 3)), C.setAttribute("uv", new r(x, 2)), C.setIndex(new r(S, 1));
|
|
1792
1763
|
let w = new n(e - d - f, l - f * 2, u - d * 2);
|
|
1793
|
-
w.translate((e - d - f) / 2 + d, l / 2, -u / 2), this.copy(
|
|
1764
|
+
w.translate((e - d - f) / 2 + d, l / 2, -u / 2), this.copy(R([C, w], !0));
|
|
1794
1765
|
}
|
|
1795
|
-
},
|
|
1796
|
-
function
|
|
1797
|
-
return new
|
|
1766
|
+
}, gt = .5, _t = Math.PI / 2;
|
|
1767
|
+
function vt({ scaleXMin: e = .4, scaleXMax: t = .7, scaleYMin: n = .3, scaleYMax: r = .95, scaleZMin: i = .1, scaleZMax: a = .5, source: o }) {
|
|
1768
|
+
return new L(q(e, t, o), Ve(.25, n, r, o), He(.8, i, a, o));
|
|
1798
1769
|
}
|
|
1799
|
-
function
|
|
1800
|
-
let i = new
|
|
1770
|
+
function yt({ coverMaterial: e, pagesMaterial: t, scales: n, source: r }) {
|
|
1771
|
+
let i = new x(new ht(), [e, t], n.length), a = new w(), o = 0;
|
|
1801
1772
|
for (let e = 0; e < n.length; e++) {
|
|
1802
|
-
let t = n[e], s = new
|
|
1773
|
+
let t = n[e], s = new w();
|
|
1803
1774
|
s.makeScale(t.x, t.y, t.z), a.identity(), a.multiply(s), a.setPosition(.01 + r.float(0, .1), 0, o + t.z * .5), i.setMatrixAt(e, a), o += t.z * .5;
|
|
1804
1775
|
}
|
|
1805
1776
|
return i;
|
|
1806
1777
|
}
|
|
1807
|
-
function
|
|
1808
|
-
let u =
|
|
1809
|
-
return
|
|
1778
|
+
function bt({ coverMaterial: e, pagesMaterial: t, count: n = 10, scaleXMin: r = .4, scaleXMax: i = .7, scaleYMin: a = .3, scaleYMax: o = .95, scaleZMin: s = .1, scaleZMax: c = .5, seed: l }) {
|
|
1779
|
+
let u = K(l);
|
|
1780
|
+
return yt({
|
|
1810
1781
|
coverMaterial: e,
|
|
1811
1782
|
pagesMaterial: t,
|
|
1812
|
-
scales: Array.from({ length: n }, () =>
|
|
1783
|
+
scales: Array.from({ length: n }, () => vt({
|
|
1813
1784
|
scaleXMin: r,
|
|
1814
1785
|
scaleXMax: i,
|
|
1815
1786
|
scaleYMin: a,
|
|
@@ -1821,10 +1792,10 @@ function yt({ coverMaterial: e, pagesMaterial: t, count: n = 10, scaleXMin: r =
|
|
|
1821
1792
|
source: u
|
|
1822
1793
|
});
|
|
1823
1794
|
}
|
|
1824
|
-
function
|
|
1825
|
-
let u =
|
|
1795
|
+
function xt({ coverMaterial: e, pagesMaterial: t, length: n = 10, scaleXMin: r = .4, scaleXMax: i = .7, scaleYMin: a = .3, scaleYMax: o = .95, scaleZMin: s = .1, scaleZMax: c = .5, seed: l }) {
|
|
1796
|
+
let u = K(l), d = [], f = n;
|
|
1826
1797
|
for (; f > 0;) {
|
|
1827
|
-
let e =
|
|
1798
|
+
let e = vt({
|
|
1828
1799
|
scaleXMin: r,
|
|
1829
1800
|
scaleXMax: i,
|
|
1830
1801
|
scaleYMin: a,
|
|
@@ -1835,17 +1806,17 @@ function bt({ coverMaterial: e, pagesMaterial: t, length: n = 10, scaleXMin: r =
|
|
|
1835
1806
|
});
|
|
1836
1807
|
e.z = Math.min(e.z, f), d.push(e), f -= e.z;
|
|
1837
1808
|
}
|
|
1838
|
-
return
|
|
1809
|
+
return yt({
|
|
1839
1810
|
coverMaterial: e,
|
|
1840
1811
|
pagesMaterial: t,
|
|
1841
1812
|
scales: d,
|
|
1842
1813
|
source: u
|
|
1843
1814
|
});
|
|
1844
1815
|
}
|
|
1845
|
-
function
|
|
1846
|
-
let f =
|
|
1816
|
+
function St({ coverMaterial: e, pagesMaterial: t, count: n = 6, scaleXMin: r = .4, scaleXMax: i = .7, scaleYMin: a = .3, scaleYMax: o = .95, scaleZMin: s = .1, scaleZMax: c = .5, yawMax: l = .55, offsetMax: u = .06, seed: d }) {
|
|
1817
|
+
let f = K(d), p = new ht(), m = new x(p, [e, t], n), h = new w(), g = new L(), _ = new N(), v = new N().setFromAxisAngle(new L(1, 0, 0), _t), y = new N(), b = new L(), S = new L(p.width * .5, p.height * .5, -p.depth * .5), C = new L(), T = new L(), E = 0;
|
|
1847
1818
|
for (let e = 0; e < n; e++) {
|
|
1848
|
-
let t =
|
|
1819
|
+
let t = vt({
|
|
1849
1820
|
scaleXMin: r,
|
|
1850
1821
|
scaleXMax: i,
|
|
1851
1822
|
scaleYMin: a,
|
|
@@ -1854,15 +1825,15 @@ function xt({ coverMaterial: e, pagesMaterial: t, count: n = 6, scaleXMin: r = .
|
|
|
1854
1825
|
scaleZMax: c,
|
|
1855
1826
|
source: f
|
|
1856
1827
|
});
|
|
1857
|
-
|
|
1858
|
-
let n =
|
|
1859
|
-
y.setFromAxisAngle(new
|
|
1828
|
+
b.copy(t);
|
|
1829
|
+
let n = gt * t.z;
|
|
1830
|
+
y.setFromAxisAngle(new L(0, 1, 0), f.float(-l, l)), _.copy(v).premultiply(y), C.copy(S).multiply(b), T.copy(C).applyQuaternion(_), g.set(f.float(-u, u), E + n * .5, f.float(-u, u)), g.sub(T), h.compose(g, _, b), m.setMatrixAt(e, h), E += n;
|
|
1860
1831
|
}
|
|
1861
1832
|
return m.instanceMatrix.needsUpdate = !0, m;
|
|
1862
1833
|
}
|
|
1863
1834
|
//#endregion
|
|
1864
1835
|
//#region src/utils/CoherentNoise.ts
|
|
1865
|
-
function
|
|
1836
|
+
function Ct(e, t, n) {
|
|
1866
1837
|
let r = Math.imul(e | 0, 374761393) ^ Math.imul(t | 0, 668265263) ^ Math.imul(n | 0, 362437);
|
|
1867
1838
|
return r = Math.imul(r ^ r >>> 13, 1274126177), r ^= r >>> 16, (r >>> 0) / 4294967296;
|
|
1868
1839
|
}
|
|
@@ -1871,38 +1842,38 @@ function J(e, t, n, r) {
|
|
|
1871
1842
|
return i = Math.imul(i ^ i >>> 13, 1274126177), i ^= i >>> 16, (i >>> 0) / 4294967296;
|
|
1872
1843
|
}
|
|
1873
1844
|
var Y = (e) => e * e * (3 - 2 * e);
|
|
1874
|
-
function
|
|
1875
|
-
let r = Math.floor(e), i = Math.floor(t), a = Y(e - r), o = Y(t - i), s =
|
|
1845
|
+
function wt(e, t, n) {
|
|
1846
|
+
let r = Math.floor(e), i = Math.floor(t), a = Y(e - r), o = Y(t - i), s = Ct(r, i, n), c = Ct(r + 1, i, n), l = Ct(r, i + 1, n), u = Ct(r + 1, i + 1, n), d = s + (c - s) * a;
|
|
1876
1847
|
return d + (l + (u - l) * a - d) * o;
|
|
1877
1848
|
}
|
|
1878
|
-
function
|
|
1849
|
+
function Tt(e, t, n, r) {
|
|
1879
1850
|
let i = Math.floor(e), a = Math.floor(t), o = Math.floor(n), s = Y(e - i), c = Y(t - a), l = Y(n - o), u = J(i, a, o, r), d = J(i + 1, a, o, r), f = J(i, a + 1, o, r), p = J(i + 1, a + 1, o, r), m = J(i, a, o + 1, r), h = J(i + 1, a, o + 1, r), g = J(i, a + 1, o + 1, r), _ = J(i + 1, a + 1, o + 1, r), v = u + (d - u) * s, y = f + (p - f) * s, b = m + (h - m) * s, x = g + (_ - g) * s, S = v + (y - v) * c;
|
|
1880
1851
|
return S + (b + (x - b) * c - S) * l;
|
|
1881
1852
|
}
|
|
1882
|
-
function
|
|
1853
|
+
function Et(e, t, n, r, i) {
|
|
1883
1854
|
let a = 0, o = 1, s = 1, c = 0;
|
|
1884
|
-
for (let l = 0; l < r; l++) a += (
|
|
1855
|
+
for (let l = 0; l < r; l++) a += (wt(e * s, t * s, n + l * 101) * 2 - 1) * o, c += o, o *= i, s *= 2;
|
|
1885
1856
|
return c > 0 ? a / c : 0;
|
|
1886
1857
|
}
|
|
1887
|
-
function
|
|
1858
|
+
function Dt(e, t, n, r, i, a) {
|
|
1888
1859
|
let o = 0, s = 1, c = 1, l = 0;
|
|
1889
|
-
for (let u = 0; u < i; u++) o += (
|
|
1860
|
+
for (let u = 0; u < i; u++) o += (Tt(e * c, t * c, n * c, r + u * 101) * 2 - 1) * s, l += s, s *= a, c *= 2;
|
|
1890
1861
|
return l > 0 ? o / l : 0;
|
|
1891
1862
|
}
|
|
1892
1863
|
//#endregion
|
|
1893
1864
|
//#region src/geometry/rocks/BoulderGeometry.ts
|
|
1894
|
-
var
|
|
1865
|
+
var Ot = class extends i {
|
|
1895
1866
|
radius;
|
|
1896
1867
|
constructor({ radius: e = 1, detail: t = 2, noiseHeight: n = .35, noiseScale: r = 1.6, octaves: i = 3, persistence: a = .5, seed: o = 1 } = {}) {
|
|
1897
1868
|
super(), this.radius = e;
|
|
1898
1869
|
let s = new y(e, t);
|
|
1899
1870
|
s.deleteAttribute("uv"), s.deleteAttribute("normal");
|
|
1900
|
-
let c =
|
|
1871
|
+
let c = fe(s);
|
|
1901
1872
|
s.dispose();
|
|
1902
|
-
let l = c.getAttribute("position"), u = new
|
|
1873
|
+
let l = c.getAttribute("position"), u = new L(), d = r / e;
|
|
1903
1874
|
for (let e = 0; e < l.count; e++) {
|
|
1904
1875
|
u.fromBufferAttribute(l, e);
|
|
1905
|
-
let t =
|
|
1876
|
+
let t = Dt(u.x * d, u.y * d, u.z * d, o, i, a), r = u.length() || 1, s = (r + t * n) / r;
|
|
1906
1877
|
l.setXYZ(e, u.x * s, u.y * s, u.z * s);
|
|
1907
1878
|
}
|
|
1908
1879
|
l.needsUpdate = !0, c.computeVertexNormals(), c.center(), this.copy(c), c.dispose();
|
|
@@ -1910,14 +1881,14 @@ var Et = class extends i {
|
|
|
1910
1881
|
};
|
|
1911
1882
|
//#endregion
|
|
1912
1883
|
//#region src/factory/BoulderFactory.ts
|
|
1913
|
-
function
|
|
1914
|
-
let y =
|
|
1884
|
+
function kt({ count: e = 8, width: t = 6, depth: n = 6, heightJitter: r = 0, scaleMin: i = .8, scaleMax: a = 1.2, seed: o, radius: s = 1, detail: l = 2, noiseHeight: u = .35, noiseScale: d = 1.6, octaves: f = 3, persistence: p = .5, variants: m = 4, material: g, color: _ = "#6f6f6f" } = {}) {
|
|
1885
|
+
let y = K(o), b = Math.max(1, Math.min(Math.round(m), Math.max(1, e))), S = g ?? new O({
|
|
1915
1886
|
color: new c(_),
|
|
1916
1887
|
roughness: 1,
|
|
1917
1888
|
metalness: 0,
|
|
1918
1889
|
flatShading: !0
|
|
1919
|
-
}),
|
|
1920
|
-
for (let e = 0; e <
|
|
1890
|
+
}), C = [];
|
|
1891
|
+
for (let e = 0; e < b; e++) C.push(new Ot({
|
|
1921
1892
|
radius: s,
|
|
1922
1893
|
detail: l,
|
|
1923
1894
|
noiseHeight: u,
|
|
@@ -1926,22 +1897,22 @@ function Dt({ count: e = 8, width: t = 6, depth: n = 6, heightJitter: r = 0, sca
|
|
|
1926
1897
|
persistence: p,
|
|
1927
1898
|
seed: y.int(0, 1e6)
|
|
1928
1899
|
}));
|
|
1929
|
-
let T = Array(
|
|
1930
|
-
for (let t = 0; t < e; t++) T[t %
|
|
1931
|
-
let E =
|
|
1900
|
+
let T = Array(b).fill(0);
|
|
1901
|
+
for (let t = 0; t < e; t++) T[t % b]++;
|
|
1902
|
+
let E = C.map((e, t) => new x(e, S, T[t])), D = Array(b).fill(0), k = new w(), A = new L(), ee = new N(), j = new L(), M = new h();
|
|
1932
1903
|
for (let o = 0; o < e; o++) {
|
|
1933
1904
|
let e = y.float(i, a);
|
|
1934
|
-
j.set(e, e, e),
|
|
1935
|
-
let s = o %
|
|
1936
|
-
E[s].setMatrixAt(
|
|
1905
|
+
j.set(e, e, e), M.set(y.float(0, Math.PI * 2), y.float(0, Math.PI * 2), y.float(0, Math.PI * 2)), ee.setFromEuler(M), A.set(y.float(-t / 2, t / 2), y.float(0, r), y.float(-n / 2, n / 2)), k.compose(A, ee, j);
|
|
1906
|
+
let s = o % b;
|
|
1907
|
+
E[s].setMatrixAt(D[s]++, k);
|
|
1937
1908
|
}
|
|
1938
|
-
let
|
|
1939
|
-
for (let e of E) e.instanceMatrix.needsUpdate = !0, e.castShadow = !0, e.receiveShadow = !0,
|
|
1940
|
-
return
|
|
1909
|
+
let te = new v();
|
|
1910
|
+
for (let e of E) e.instanceMatrix.needsUpdate = !0, e.castShadow = !0, e.receiveShadow = !0, te.add(e);
|
|
1911
|
+
return te;
|
|
1941
1912
|
}
|
|
1942
1913
|
//#endregion
|
|
1943
1914
|
//#region src/shapes/HexagonShape.ts
|
|
1944
|
-
var
|
|
1915
|
+
var At = class extends P {
|
|
1945
1916
|
constructor(e = 1) {
|
|
1946
1917
|
super();
|
|
1947
1918
|
for (let t = 0; t < 6; t++) {
|
|
@@ -1950,11 +1921,11 @@ var Ot = class extends N {
|
|
|
1950
1921
|
}
|
|
1951
1922
|
this.closePath();
|
|
1952
1923
|
}
|
|
1953
|
-
},
|
|
1924
|
+
}, jt = class extends g {
|
|
1954
1925
|
radius;
|
|
1955
1926
|
depth;
|
|
1956
1927
|
constructor({ radius: e = 1, depth: t = .01 } = {}) {
|
|
1957
|
-
super(new
|
|
1928
|
+
super(new At(e), {
|
|
1958
1929
|
depth: t,
|
|
1959
1930
|
bevelEnabled: !1
|
|
1960
1931
|
}), this.radius = e, this.depth = t;
|
|
@@ -1962,26 +1933,26 @@ var Ot = class extends N {
|
|
|
1962
1933
|
};
|
|
1963
1934
|
//#endregion
|
|
1964
1935
|
//#region src/factory/HexagonalTileFactory.ts
|
|
1965
|
-
function
|
|
1966
|
-
let { width: t, depth: n, height: r, count: i, gap: a, material: o } = e, s = o || new
|
|
1936
|
+
function Mt(e) {
|
|
1937
|
+
let { width: t, depth: n, height: r, count: i, gap: a, material: o } = e, s = o || new O({ color: 16777215 }), c = t / i, l = (c - a) * 2 / 3, u = Math.sqrt(3) * l + a, d = Math.floor(n / u), f = i * d, p = new jt({
|
|
1967
1938
|
radius: l,
|
|
1968
1939
|
depth: r
|
|
1969
1940
|
});
|
|
1970
1941
|
p.rotateX(-Math.PI / 2);
|
|
1971
|
-
let m = new
|
|
1942
|
+
let m = new x(p, s, f), h = new A(), g = 0;
|
|
1972
1943
|
for (let e = 0; e < i; e++) for (let t = 0; t < d; t++) {
|
|
1973
1944
|
let n = e * c, r = t * u + e % 2 * (u / 2), a = n - i * c / 2 + c / 2, o = r - d * u / 2 + u / 2;
|
|
1974
1945
|
h.position.set(a, 0, o), h.updateMatrix(), m.setMatrixAt(g++, h.matrix);
|
|
1975
1946
|
}
|
|
1976
1947
|
return m.instanceMatrix.needsUpdate = !0, m;
|
|
1977
1948
|
}
|
|
1978
|
-
function
|
|
1979
|
-
let { width: t, depth: n, height: r, radius: i, gap: a, material: o } = e, s = o || new
|
|
1949
|
+
function Nt(e) {
|
|
1950
|
+
let { width: t, depth: n, height: r, radius: i, gap: a, material: o } = e, s = o || new O({ color: 16777215 }), c = i * 3 / 2 + a, l = Math.sqrt(3) * i + a, u = Math.floor(t / c), d = Math.floor(n / l), f = u * d, p = new jt({
|
|
1980
1951
|
radius: i,
|
|
1981
1952
|
depth: r
|
|
1982
1953
|
});
|
|
1983
1954
|
p.rotateX(-Math.PI / 2);
|
|
1984
|
-
let m = new
|
|
1955
|
+
let m = new x(p, s, f), h = new A(), g = 0;
|
|
1985
1956
|
for (let e = 0; e < u; e++) for (let t = 0; t < d; t++) {
|
|
1986
1957
|
let n = e * c, r = t * l + e % 2 * (l / 2), i = n - u * c / 2 + c / 2, a = r - d * l / 2 + l / 2;
|
|
1987
1958
|
h.position.set(i, 0, a), h.updateMatrix(), m.setMatrixAt(g++, h.matrix);
|
|
@@ -1990,55 +1961,55 @@ function jt(e) {
|
|
|
1990
1961
|
}
|
|
1991
1962
|
//#endregion
|
|
1992
1963
|
//#region src/geometry/rocks/MossyRockGeometry.ts
|
|
1993
|
-
var
|
|
1964
|
+
var Pt = class extends i {
|
|
1994
1965
|
radius;
|
|
1995
1966
|
detail;
|
|
1996
1967
|
constructor({ radius: e = 1, detail: t = 0, mossScaleXZ: n = .9, mossScaleY: r = .5, mossOffsetY: i = .3 } = {}) {
|
|
1997
1968
|
super(), this.radius = e, this.detail = t;
|
|
1998
1969
|
let a = new f(e, t), o = new f(e, t);
|
|
1999
|
-
o.scale(n, r, n), o.translate(0, i, 0), this.copy(
|
|
1970
|
+
o.scale(n, r, n), o.translate(0, i, 0), this.copy(R([a, o], !0)), this.computeVertexNormals();
|
|
2000
1971
|
}
|
|
2001
1972
|
};
|
|
2002
1973
|
//#endregion
|
|
2003
1974
|
//#region src/utils/VertexUtils.ts
|
|
2004
|
-
function
|
|
2005
|
-
e.deleteAttribute("uv"), e.deleteAttribute("normal"), e =
|
|
1975
|
+
function Ft(e, t = Ae.XYZ, n = .5, r = 2) {
|
|
1976
|
+
e.deleteAttribute("uv"), e.deleteAttribute("normal"), e = fe(e), e.computeVertexNormals();
|
|
2006
1977
|
let i = e.getAttribute("position");
|
|
2007
1978
|
for (let e = 0; e < i.count; e++) {
|
|
2008
|
-
let a = new
|
|
1979
|
+
let a = new L().fromBufferAttribute(i, e), o = Math.random() * (r - n) + n, s = t.clone().multiplyScalar(o);
|
|
2009
1980
|
a.add(s), i.setXYZ(e, a.x, a.y, a.z);
|
|
2010
1981
|
}
|
|
2011
1982
|
return i.needsUpdate = !0, e.computeVertexNormals(), e;
|
|
2012
1983
|
}
|
|
2013
1984
|
//#endregion
|
|
2014
1985
|
//#region src/geometry/rocks/RockGeometry.ts
|
|
2015
|
-
var
|
|
1986
|
+
var It = class extends i {
|
|
2016
1987
|
radius;
|
|
2017
1988
|
widthSegments;
|
|
2018
1989
|
heightSegments;
|
|
2019
1990
|
constructor({ radius: e = 1, widthSegments: t = 4, heightSegments: n = 4 } = {}) {
|
|
2020
1991
|
super(), this.radius = e, this.widthSegments = t, this.heightSegments = n;
|
|
2021
|
-
let r = new
|
|
2022
|
-
this.copy(
|
|
1992
|
+
let r = new F(e, t, n);
|
|
1993
|
+
this.copy(Ft(r, Ae.XYZ, .5, 1)), this.computeVertexNormals(), this.center();
|
|
2023
1994
|
}
|
|
2024
1995
|
};
|
|
2025
1996
|
//#endregion
|
|
2026
1997
|
//#region src/factory/RockFactory.ts
|
|
2027
|
-
function
|
|
2028
|
-
let c =
|
|
1998
|
+
function Lt(e, { count: t = 5, width: n = 4, depth: r = 4, heightJitter: i = 0, scaleMin: a = .8, scaleMax: o = 1.2, seed: s }) {
|
|
1999
|
+
let c = K(s), l = new w(), u = new L(), d = new N(), f = new L(), p = new h();
|
|
2029
2000
|
for (let s = 0; s < t; s++) f.set(c.float(a, o), c.float(a, o), c.float(a, o)), p.set(c.float(0, Math.PI), c.float(0, Math.PI), c.float(0, Math.PI)), d.setFromEuler(p), u.set(c.float(-n / 2, n / 2), c.float(0, i), c.float(-r / 2, r / 2)), l.compose(u, d, f), e.setMatrixAt(s, l);
|
|
2030
2001
|
e.instanceMatrix.needsUpdate = !0;
|
|
2031
2002
|
}
|
|
2032
|
-
function
|
|
2033
|
-
let p = d ?? new
|
|
2003
|
+
function Rt({ count: e = 5, width: t = 4, depth: n = 4, heightJitter: r = 0, scaleMin: i = .8, scaleMax: a = 1.2, seed: o, radius: s = 1, widthSegments: l = 4, heightSegments: u = 4, material: d, color: f = "#808080" } = {}) {
|
|
2004
|
+
let p = d ?? new O({
|
|
2034
2005
|
color: new c(f),
|
|
2035
2006
|
flatShading: !0
|
|
2036
|
-
}), m = new
|
|
2007
|
+
}), m = new x(new It({
|
|
2037
2008
|
radius: s,
|
|
2038
2009
|
widthSegments: l,
|
|
2039
2010
|
heightSegments: u
|
|
2040
2011
|
}), p, e);
|
|
2041
|
-
return
|
|
2012
|
+
return Lt(m, {
|
|
2042
2013
|
count: e,
|
|
2043
2014
|
width: t,
|
|
2044
2015
|
depth: n,
|
|
@@ -2048,23 +2019,23 @@ function It({ count: e = 5, width: t = 4, depth: n = 4, heightJitter: r = 0, sca
|
|
|
2048
2019
|
seed: o
|
|
2049
2020
|
}), m;
|
|
2050
2021
|
}
|
|
2051
|
-
function
|
|
2052
|
-
let v = [p ?? new
|
|
2022
|
+
function zt({ count: e = 5, width: t = 4, depth: n = 4, heightJitter: r = 0, scaleMin: i = .8, scaleMax: a = 1.2, seed: o, radius: s = 1, detail: l = 0, mossScaleXZ: u = .9, mossScaleY: d = .5, mossOffsetY: f = .3, rockMaterial: p, mossMaterial: m, rockColor: h = "#808080", mossColor: g = "#4b8b3b", mossOpacity: _ = .8 } = {}) {
|
|
2023
|
+
let v = [p ?? new O({
|
|
2053
2024
|
color: new c(h),
|
|
2054
2025
|
flatShading: !0
|
|
2055
|
-
}), m ?? new
|
|
2026
|
+
}), m ?? new O({
|
|
2056
2027
|
color: new c(g),
|
|
2057
2028
|
flatShading: !0,
|
|
2058
2029
|
opacity: _,
|
|
2059
2030
|
transparent: _ < 1
|
|
2060
|
-
})], y = new
|
|
2031
|
+
})], y = new x(new Pt({
|
|
2061
2032
|
radius: s,
|
|
2062
2033
|
detail: l,
|
|
2063
2034
|
mossScaleXZ: u,
|
|
2064
2035
|
mossScaleY: d,
|
|
2065
2036
|
mossOffsetY: f
|
|
2066
2037
|
}), v, e);
|
|
2067
|
-
return
|
|
2038
|
+
return Lt(y, {
|
|
2068
2039
|
count: e,
|
|
2069
2040
|
width: t,
|
|
2070
2041
|
depth: n,
|
|
@@ -2076,10 +2047,10 @@ function Lt({ count: e = 5, width: t = 4, depth: n = 4, heightJitter: r = 0, sca
|
|
|
2076
2047
|
}
|
|
2077
2048
|
//#endregion
|
|
2078
2049
|
//#region src/geometry/architecture/diamondLattice.ts
|
|
2079
|
-
function
|
|
2050
|
+
function Bt(e, t) {
|
|
2080
2051
|
return (e / 2 + t / 2) / Math.SQRT2;
|
|
2081
2052
|
}
|
|
2082
|
-
function
|
|
2053
|
+
function Vt(e, t, n, r) {
|
|
2083
2054
|
let i = Math.max(1, Math.round(n)), a = Math.max(1, Math.round(r)), o = e / (2 * i), s = t / (2 * a);
|
|
2084
2055
|
return {
|
|
2085
2056
|
a: o,
|
|
@@ -2088,30 +2059,30 @@ function zt(e, t, n, r) {
|
|
|
2088
2059
|
spacing: 2 * o * s / Math.hypot(o, s)
|
|
2089
2060
|
};
|
|
2090
2061
|
}
|
|
2091
|
-
function
|
|
2092
|
-
let r =
|
|
2062
|
+
function Ht(e, t, n) {
|
|
2063
|
+
let r = Bt(e, t);
|
|
2093
2064
|
return r / Math.max(2, Math.round(r / n));
|
|
2094
2065
|
}
|
|
2095
|
-
function
|
|
2096
|
-
return
|
|
2066
|
+
function Ut(e, t, n) {
|
|
2067
|
+
return Bt(e, t) / Math.max(2, n);
|
|
2097
2068
|
}
|
|
2098
|
-
function
|
|
2069
|
+
function Wt({ width: e, height: t, centerY: r = 0, grid: i, leadThickness: a, leadDepth: o }) {
|
|
2099
2070
|
let s = e / 2, c = t / 2, l = [
|
|
2100
2071
|
new n(e + a, a, o).translate(0, r - c, 0),
|
|
2101
2072
|
new n(e + a, a, o).translate(0, r + c, 0),
|
|
2102
2073
|
new n(a, t + a, o).translate(-s, r, 0),
|
|
2103
2074
|
new n(a, t + a, o).translate(s, r, 0)
|
|
2104
2075
|
];
|
|
2105
|
-
return
|
|
2076
|
+
return Kt(l, e, t, r, i.spacing, a, o, i.angle), Kt(l, e, t, r, i.spacing, a, o, -i.angle), l;
|
|
2106
2077
|
}
|
|
2107
|
-
function
|
|
2078
|
+
function Gt(e) {
|
|
2108
2079
|
let { width: t, height: n, centerY: r = 0, grid: i, leadThickness: a, leadDepth: o } = e, s = [];
|
|
2109
|
-
return
|
|
2080
|
+
return Kt(s, t, n, r, i.spacing, a, o, i.angle), Kt(s, t, n, r, i.spacing, a, o, -i.angle), s;
|
|
2110
2081
|
}
|
|
2111
|
-
function
|
|
2082
|
+
function Kt(e, t, r, i, a, o, s, c) {
|
|
2112
2083
|
let l = t / 2, u = r / 2, d = -l, f = l, p = i - u, m = i + u, h = Math.hypot(t, r) + o, g = -Math.sin(c), _ = Math.cos(c), v = Math.ceil(Math.hypot(t, r) / a) + 2;
|
|
2113
2084
|
for (let t = -v; t <= v; t++) {
|
|
2114
|
-
let r = g * t * a, l = i + _ * t * a, u = Math.cos(c) * h * .5, v = Math.sin(c) * h * .5, y =
|
|
2085
|
+
let r = g * t * a, l = i + _ * t * a, u = Math.cos(c) * h * .5, v = Math.sin(c) * h * .5, y = qt(r - u, l - v, r + u, l + v, d, p, f, m);
|
|
2115
2086
|
if (!y) continue;
|
|
2116
2087
|
let [b, x, S, C] = y, w = Math.hypot(S - b, C - x);
|
|
2117
2088
|
if (w < 1e-6) continue;
|
|
@@ -2119,7 +2090,7 @@ function Wt(e, t, r, i, a, o, s, c) {
|
|
|
2119
2090
|
T.rotateZ(c), T.translate((b + S) / 2, (x + C) / 2, 0), e.push(T);
|
|
2120
2091
|
}
|
|
2121
2092
|
}
|
|
2122
|
-
function
|
|
2093
|
+
function qt(e, t, n, r, i, a, o, s) {
|
|
2123
2094
|
let c = n - e, l = r - t, u = 0, d = 1, f = [[
|
|
2124
2095
|
e,
|
|
2125
2096
|
c,
|
|
@@ -2158,7 +2129,7 @@ function X({ width: e, rectHeight: t, archHeight: n = e / 2, centerY: r = 0 }) {
|
|
|
2158
2129
|
centerY: r
|
|
2159
2130
|
};
|
|
2160
2131
|
}
|
|
2161
|
-
function
|
|
2132
|
+
function Jt(e, t, { hole: n = !1 } = {}) {
|
|
2162
2133
|
let { hw: r, ymin: i, rectTopY: a, archCy: o, archRadius: s } = t, c = Math.atan2(a - o, -r), l = Math.atan2(a - o, r);
|
|
2163
2134
|
if (!n) {
|
|
2164
2135
|
e.moveTo(-r, i), e.lineTo(r, i), e.lineTo(r, a), e.absarc(0, o, s, l, c, !1), e.lineTo(-r, a), e.closePath();
|
|
@@ -2166,7 +2137,7 @@ function Kt(e, t, { hole: n = !1 } = {}) {
|
|
|
2166
2137
|
}
|
|
2167
2138
|
e.moveTo(-r, i), e.lineTo(-r, a), e.absarc(0, o, s, c, l, !0), e.lineTo(r, a), e.lineTo(r, i), e.closePath();
|
|
2168
2139
|
}
|
|
2169
|
-
function
|
|
2140
|
+
function Yt(e, t) {
|
|
2170
2141
|
let n = Math.max(e.hw - t, t), r = e.ymin + t, i = e.rectTopY - t, a = Math.max(e.archHeight - t, t), o = (n * n + a * a) / (2 * a), s = i + a - o, c = i + a;
|
|
2171
2142
|
return {
|
|
2172
2143
|
hw: n,
|
|
@@ -2180,30 +2151,30 @@ function qt(e, t) {
|
|
|
2180
2151
|
centerY: (r + c) / 2
|
|
2181
2152
|
};
|
|
2182
2153
|
}
|
|
2183
|
-
var
|
|
2184
|
-
function
|
|
2185
|
-
let r = new
|
|
2186
|
-
|
|
2187
|
-
let i = new
|
|
2188
|
-
|
|
2154
|
+
var Xt = 48;
|
|
2155
|
+
function Zt(e, t, n) {
|
|
2156
|
+
let r = new P();
|
|
2157
|
+
Jt(r, e);
|
|
2158
|
+
let i = new j();
|
|
2159
|
+
Jt(i, Yt(e, t), { hole: !0 }), r.holes.push(i);
|
|
2189
2160
|
let a = new g(r, {
|
|
2190
2161
|
depth: n,
|
|
2191
2162
|
bevelEnabled: !1,
|
|
2192
|
-
curveSegments:
|
|
2163
|
+
curveSegments: Xt
|
|
2193
2164
|
});
|
|
2194
2165
|
return a.translate(0, 0, -n / 2), a;
|
|
2195
2166
|
}
|
|
2196
|
-
function
|
|
2167
|
+
function Qt(e, t, n) {
|
|
2197
2168
|
let r = 2 * n.b, i = t - e;
|
|
2198
2169
|
return Math.round(i / r) * r - i;
|
|
2199
2170
|
}
|
|
2200
|
-
function
|
|
2171
|
+
function $t(e, t, { hw: n, ymin: r, ymax: i, rectTopY: a, archCy: o, archRadius: s }, c = 1e-6) {
|
|
2201
2172
|
if (t < r - c || t > i + c) return !1;
|
|
2202
2173
|
if (t <= a + c) return Math.abs(e) <= n + c;
|
|
2203
2174
|
let l = e, u = t - o;
|
|
2204
2175
|
return l * l + u * u <= s * s + c;
|
|
2205
2176
|
}
|
|
2206
|
-
function
|
|
2177
|
+
function en(e, t, n, r, i) {
|
|
2207
2178
|
let a = /* @__PURE__ */ new Set([0, 1]), o = n - e, s = r - t, { hw: c, ymin: l, ymax: u, rectTopY: d, archCy: f, archRadius: p } = i, m = (e) => {
|
|
2208
2179
|
e > 1e-9 && e < .999999999 && a.add(e);
|
|
2209
2180
|
};
|
|
@@ -2215,11 +2186,11 @@ function Qt(e, t, n, r, i) {
|
|
|
2215
2186
|
}
|
|
2216
2187
|
return [...a].sort((e, t) => e - t);
|
|
2217
2188
|
}
|
|
2218
|
-
function
|
|
2219
|
-
let a = X(i), o =
|
|
2189
|
+
function tn(e, t, n, r, i) {
|
|
2190
|
+
let a = X(i), o = en(e, t, n, r, a), s = n - e, c = r - t, l = [], u = null, d = 0;
|
|
2220
2191
|
for (let n = 0; n < o.length - 1; n++) {
|
|
2221
2192
|
let r = o[n], i = o[n + 1], f = (r + i) * .5;
|
|
2222
|
-
|
|
2193
|
+
$t(e + s * f, t + c * f, a) ? (u === null && (u = r), d = i) : u !== null && (l.push([u, d]), u = null);
|
|
2223
2194
|
}
|
|
2224
2195
|
u !== null && l.push([u, d]);
|
|
2225
2196
|
let f = null, p = 0;
|
|
@@ -2236,7 +2207,7 @@ function $t(e, t, n, r, i) {
|
|
|
2236
2207
|
t + c * h
|
|
2237
2208
|
];
|
|
2238
2209
|
}
|
|
2239
|
-
function
|
|
2210
|
+
function nn(e) {
|
|
2240
2211
|
return {
|
|
2241
2212
|
width: 2 * e.hw,
|
|
2242
2213
|
rectHeight: e.rectTopY - e.ymin,
|
|
@@ -2244,23 +2215,23 @@ function en(e) {
|
|
|
2244
2215
|
centerY: e.centerY
|
|
2245
2216
|
};
|
|
2246
2217
|
}
|
|
2247
|
-
function
|
|
2218
|
+
function rn(e, t, r, i) {
|
|
2248
2219
|
let { hw: a, rectTopY: o, archCy: s, archRadius: c } = t, l = Math.atan2(o - s, -a), u = Math.atan2(o - s, a) - l, d = Math.max(12, Math.ceil(Math.abs(u) * c / (r * 1.8)));
|
|
2249
2220
|
for (let t = 0; t < d; t++) {
|
|
2250
2221
|
let a = t / d, o = (t + 1) / d, f = l + u * a, p = l + u * o, m = (f + p) / 2, h = new n(2 * c * Math.sin((p - f) / 2), r, i);
|
|
2251
2222
|
h.rotateZ(m - Math.PI / 2), h.translate(c * Math.cos(m), s + c * Math.sin(m), 0), e.push(h);
|
|
2252
2223
|
}
|
|
2253
2224
|
}
|
|
2254
|
-
function
|
|
2225
|
+
function an({ width: e, rectHeight: t, archHeight: n, centerY: r = 0, grid: i, leadThickness: a, leadDepth: o, clipInset: s = 0 }) {
|
|
2255
2226
|
let c = {
|
|
2256
2227
|
width: e,
|
|
2257
2228
|
rectHeight: t,
|
|
2258
2229
|
archHeight: n,
|
|
2259
2230
|
centerY: r
|
|
2260
|
-
}, l = X(c), u = s > 0 ?
|
|
2261
|
-
return
|
|
2231
|
+
}, l = X(c), u = s > 0 ? nn(Yt(l, s)) : c, d = [], f = Qt(l.ymin, l.rectTopY, i);
|
|
2232
|
+
return sn(d, u, l, i, f, a, o, i.angle), sn(d, u, l, i, f, a, o, -i.angle), d;
|
|
2262
2233
|
}
|
|
2263
|
-
function
|
|
2234
|
+
function on(e) {
|
|
2264
2235
|
let { width: t, rectHeight: r, archHeight: i, centerY: a = 0, leadThickness: o, leadDepth: s } = e, c = X({
|
|
2265
2236
|
width: t,
|
|
2266
2237
|
rectHeight: r,
|
|
@@ -2271,12 +2242,12 @@ function rn(e) {
|
|
|
2271
2242
|
new n(o, f + o, s).translate(-l, u + f / 2, 0),
|
|
2272
2243
|
new n(o, f + o, s).translate(l, u + f / 2, 0)
|
|
2273
2244
|
];
|
|
2274
|
-
return
|
|
2245
|
+
return rn(p, c, o, s), p.push(...an(e)), p;
|
|
2275
2246
|
}
|
|
2276
|
-
function
|
|
2247
|
+
function sn(e, t, r, i, a, o, s, c) {
|
|
2277
2248
|
let { totalHeight: l, centerY: u } = r, d = i.spacing, f = Math.hypot(t.width, l) + o, p = -Math.sin(c), m = Math.cos(c), h = Math.ceil(Math.hypot(t.width, l) / d) + 2, g = u + a;
|
|
2278
2249
|
for (let r = -h; r <= h; r++) {
|
|
2279
|
-
let i = p * r * d, a = g + m * r * d, l = Math.cos(c) * f * .5, u = Math.sin(c) * f * .5, h =
|
|
2250
|
+
let i = p * r * d, a = g + m * r * d, l = Math.cos(c) * f * .5, u = Math.sin(c) * f * .5, h = tn(i - l, a - u, i + l, a + u, t);
|
|
2280
2251
|
if (!h) continue;
|
|
2281
2252
|
let [_, v, y, b] = h, x = Math.hypot(y - _, b - v);
|
|
2282
2253
|
if (x < 1e-6) continue;
|
|
@@ -2286,7 +2257,7 @@ function an(e, t, r, i, a, o, s, c) {
|
|
|
2286
2257
|
}
|
|
2287
2258
|
//#endregion
|
|
2288
2259
|
//#region src/geometry/architecture/ArchedDiamondLatticeWindowGeometry.ts
|
|
2289
|
-
var
|
|
2260
|
+
var cn = class extends i {
|
|
2290
2261
|
cellsX;
|
|
2291
2262
|
cellsY;
|
|
2292
2263
|
fittedGrid;
|
|
@@ -2297,8 +2268,8 @@ var on = class extends i {
|
|
|
2297
2268
|
rectHeight: t,
|
|
2298
2269
|
archHeight: n,
|
|
2299
2270
|
centerY: s
|
|
2300
|
-
}), this.fittedGrid =
|
|
2301
|
-
let c =
|
|
2271
|
+
}), this.fittedGrid = Vt(e, this.opening.totalHeight, this.cellsX, this.cellsY);
|
|
2272
|
+
let c = an({
|
|
2302
2273
|
width: e,
|
|
2303
2274
|
rectHeight: t,
|
|
2304
2275
|
archHeight: n,
|
|
@@ -2307,25 +2278,25 @@ var on = class extends i {
|
|
|
2307
2278
|
leadThickness: r,
|
|
2308
2279
|
leadDepth: i,
|
|
2309
2280
|
clipInset: r * .5
|
|
2310
|
-
}), l =
|
|
2281
|
+
}), l = R(c);
|
|
2311
2282
|
if (!l) throw Error("ArchedDiamondLatticeWindowGeometry: merge failed");
|
|
2312
2283
|
this.copy(l), l.dispose();
|
|
2313
2284
|
for (let e of c) e.dispose();
|
|
2314
2285
|
}
|
|
2315
|
-
},
|
|
2286
|
+
}, ln = class extends i {
|
|
2316
2287
|
cellsX;
|
|
2317
2288
|
cellsY;
|
|
2318
2289
|
fittedGrid;
|
|
2319
2290
|
constructor({ width: e = 4.5, height: t = 5.5, leadThickness: n = .055, leadDepth: r = .11, cellsX: i = 10, cellsY: a = 10, centerY: o = 0 } = {}) {
|
|
2320
|
-
super(), this.cellsX = Math.max(1, Math.round(i)), this.cellsY = Math.max(1, Math.round(a)), this.fittedGrid =
|
|
2321
|
-
let s =
|
|
2291
|
+
super(), this.cellsX = Math.max(1, Math.round(i)), this.cellsY = Math.max(1, Math.round(a)), this.fittedGrid = Vt(e, t, this.cellsX, this.cellsY);
|
|
2292
|
+
let s = Wt({
|
|
2322
2293
|
width: e,
|
|
2323
2294
|
height: t,
|
|
2324
2295
|
centerY: o,
|
|
2325
2296
|
grid: this.fittedGrid,
|
|
2326
2297
|
leadThickness: n,
|
|
2327
2298
|
leadDepth: r
|
|
2328
|
-
}), c =
|
|
2299
|
+
}), c = R(s);
|
|
2329
2300
|
if (!c) throw Error("DiamondLatticeWindowGeometry: merge failed");
|
|
2330
2301
|
this.copy(c), c.dispose();
|
|
2331
2302
|
for (let e of s) e.dispose();
|
|
@@ -2333,20 +2304,20 @@ var on = class extends i {
|
|
|
2333
2304
|
};
|
|
2334
2305
|
//#endregion
|
|
2335
2306
|
//#region src/geometry/architecture/gregorianLattice.ts
|
|
2336
|
-
function
|
|
2307
|
+
function un(e, t, n, r) {
|
|
2337
2308
|
let i = Math.max(1, Math.round(n)), a = Math.max(1, Math.round(r));
|
|
2338
2309
|
return {
|
|
2339
2310
|
paneWidth: e / i,
|
|
2340
2311
|
paneHeight: t / a
|
|
2341
2312
|
};
|
|
2342
2313
|
}
|
|
2343
|
-
function
|
|
2314
|
+
function dn({ width: e, height: t, centerY: r = 0, cellsX: i, cellsY: a, mullionThickness: o, mullionDepth: s }) {
|
|
2344
2315
|
let c = e / 2, l = t / 2, u = [
|
|
2345
2316
|
new n(e + o, o, s).translate(0, r - l, 0),
|
|
2346
2317
|
new n(e + o, o, s).translate(0, r + l, 0),
|
|
2347
2318
|
new n(o, t + o, s).translate(-c, r, 0),
|
|
2348
2319
|
new n(o, t + o, s).translate(c, r, 0)
|
|
2349
|
-
], { paneWidth: d, paneHeight: f } =
|
|
2320
|
+
], { paneWidth: d, paneHeight: f } = un(e, t, i, a);
|
|
2350
2321
|
for (let e = 1; e < i; e++) {
|
|
2351
2322
|
let i = -c + d * e;
|
|
2352
2323
|
u.push(new n(o, t + o, s).translate(i, r, 0));
|
|
@@ -2359,13 +2330,13 @@ function ln({ width: e, height: t, centerY: r = 0, cellsX: i, cellsY: a, mullion
|
|
|
2359
2330
|
}
|
|
2360
2331
|
//#endregion
|
|
2361
2332
|
//#region src/geometry/architecture/GregorianLatticeWindowGeometry.ts
|
|
2362
|
-
var
|
|
2333
|
+
var fn = class extends i {
|
|
2363
2334
|
cellsX;
|
|
2364
2335
|
cellsY;
|
|
2365
2336
|
fittedGrid;
|
|
2366
2337
|
constructor({ width: e = 4.5, height: t = 5.5, mullionThickness: n = .055, mullionDepth: r = .11, cellsX: i = 4, cellsY: a = 6, centerY: o = 0 } = {}) {
|
|
2367
|
-
super(), this.cellsX = Math.max(1, Math.round(i)), this.cellsY = Math.max(1, Math.round(a)), this.fittedGrid =
|
|
2368
|
-
let s =
|
|
2338
|
+
super(), this.cellsX = Math.max(1, Math.round(i)), this.cellsY = Math.max(1, Math.round(a)), this.fittedGrid = un(e, t, this.cellsX, this.cellsY);
|
|
2339
|
+
let s = dn({
|
|
2369
2340
|
width: e,
|
|
2370
2341
|
height: t,
|
|
2371
2342
|
centerY: o,
|
|
@@ -2373,7 +2344,7 @@ var un = class extends i {
|
|
|
2373
2344
|
cellsY: this.cellsY,
|
|
2374
2345
|
mullionThickness: n,
|
|
2375
2346
|
mullionDepth: r
|
|
2376
|
-
}), c =
|
|
2347
|
+
}), c = R(s);
|
|
2377
2348
|
if (!c) throw Error("GregorianLatticeWindowGeometry: merge failed");
|
|
2378
2349
|
this.copy(c), c.dispose();
|
|
2379
2350
|
for (let e of s) e.dispose();
|
|
@@ -2387,13 +2358,13 @@ function Z(e, t, n, r, i, a, o) {
|
|
|
2387
2358
|
for (let [e, t] of o) n.push(e, t);
|
|
2388
2359
|
r.push(s, s + 1, s + 2, s, s + 2, s + 3);
|
|
2389
2360
|
}
|
|
2390
|
-
var
|
|
2361
|
+
var pn = [
|
|
2391
2362
|
[0, 0],
|
|
2392
2363
|
[0, 1],
|
|
2393
2364
|
[1, 1],
|
|
2394
2365
|
[1, 0]
|
|
2395
2366
|
];
|
|
2396
|
-
function
|
|
2367
|
+
function mn(e, t, n, r, i) {
|
|
2397
2368
|
Z(e.positions, e.normals, e.uvs, e.indices, [
|
|
2398
2369
|
[
|
|
2399
2370
|
-t,
|
|
@@ -2426,7 +2397,7 @@ function fn(e, t, n, r, i) {
|
|
|
2426
2397
|
[1, 0]
|
|
2427
2398
|
]);
|
|
2428
2399
|
}
|
|
2429
|
-
function
|
|
2400
|
+
function hn(e, t, n, r, i) {
|
|
2430
2401
|
Z(e.positions, e.normals, e.uvs, e.indices, [
|
|
2431
2402
|
[
|
|
2432
2403
|
-t,
|
|
@@ -2452,9 +2423,9 @@ function pn(e, t, n, r, i) {
|
|
|
2452
2423
|
0,
|
|
2453
2424
|
1,
|
|
2454
2425
|
0
|
|
2455
|
-
],
|
|
2426
|
+
], pn);
|
|
2456
2427
|
}
|
|
2457
|
-
function
|
|
2428
|
+
function gn(e, t, n, r, i, a) {
|
|
2458
2429
|
Z(e.positions, e.normals, e.uvs, e.indices, [
|
|
2459
2430
|
[
|
|
2460
2431
|
r,
|
|
@@ -2487,7 +2458,7 @@ function mn(e, t, n, r, i, a) {
|
|
|
2487
2458
|
[1, 0]
|
|
2488
2459
|
]);
|
|
2489
2460
|
}
|
|
2490
|
-
function
|
|
2461
|
+
function _n(e, t, n, r, i, a) {
|
|
2491
2462
|
Z(e.positions, e.normals, e.uvs, e.indices, [
|
|
2492
2463
|
[
|
|
2493
2464
|
n,
|
|
@@ -2513,20 +2484,20 @@ function hn(e, t, n, r, i, a) {
|
|
|
2513
2484
|
0,
|
|
2514
2485
|
1,
|
|
2515
2486
|
0
|
|
2516
|
-
],
|
|
2487
|
+
], pn);
|
|
2517
2488
|
}
|
|
2518
2489
|
function Q(e, t) {
|
|
2519
2490
|
return [e * Math.cos(t), e * Math.sin(t)];
|
|
2520
2491
|
}
|
|
2521
|
-
function
|
|
2492
|
+
function vn(e) {
|
|
2522
2493
|
return [
|
|
2523
2494
|
-Math.sin(e),
|
|
2524
2495
|
0,
|
|
2525
2496
|
Math.cos(e)
|
|
2526
2497
|
];
|
|
2527
2498
|
}
|
|
2528
|
-
function
|
|
2529
|
-
let [o, s] = Q(t, a), [c, l] = Q(n, a), u =
|
|
2499
|
+
function yn(e, t, n, r, i, a) {
|
|
2500
|
+
let [o, s] = Q(t, a), [c, l] = Q(n, a), u = vn(a);
|
|
2530
2501
|
Z(e.positions, e.normals, e.uvs, e.indices, [
|
|
2531
2502
|
[
|
|
2532
2503
|
o,
|
|
@@ -2555,7 +2526,7 @@ function _n(e, t, n, r, i, a) {
|
|
|
2555
2526
|
[1, 0]
|
|
2556
2527
|
]);
|
|
2557
2528
|
}
|
|
2558
|
-
function
|
|
2529
|
+
function bn(e, t, n, r, i, a) {
|
|
2559
2530
|
let [o, s] = Q(t, i), [c, l] = Q(t, a), [u, d] = Q(n, a), [f, p] = Q(n, i);
|
|
2560
2531
|
Z(e.positions, e.normals, e.uvs, e.indices, [
|
|
2561
2532
|
[
|
|
@@ -2589,7 +2560,7 @@ function vn(e, t, n, r, i, a) {
|
|
|
2589
2560
|
[0, 1]
|
|
2590
2561
|
]);
|
|
2591
2562
|
}
|
|
2592
|
-
function
|
|
2563
|
+
function xn(e, t, n, r, i) {
|
|
2593
2564
|
Z(e.positions, e.normals, e.uvs, e.indices, [
|
|
2594
2565
|
[
|
|
2595
2566
|
-t,
|
|
@@ -2615,11 +2586,11 @@ function yn(e, t, n, r, i) {
|
|
|
2615
2586
|
0,
|
|
2616
2587
|
1,
|
|
2617
2588
|
0
|
|
2618
|
-
],
|
|
2589
|
+
], pn);
|
|
2619
2590
|
}
|
|
2620
2591
|
//#endregion
|
|
2621
2592
|
//#region src/geometry/architecture/LShapedStaircaseGeometry.ts
|
|
2622
|
-
var
|
|
2593
|
+
var Sn = class extends i {
|
|
2623
2594
|
width;
|
|
2624
2595
|
riserHeight;
|
|
2625
2596
|
treadDepth;
|
|
@@ -2637,18 +2608,18 @@ var bn = class extends i {
|
|
|
2637
2608
|
};
|
|
2638
2609
|
for (let e = 0; e < this.stepsPerFlight; e++) {
|
|
2639
2610
|
let t = e * this.riserHeight, n = t + this.riserHeight, r = e * this.treadDepth, i = r + this.treadDepth;
|
|
2640
|
-
|
|
2611
|
+
mn(u, a, t, n, r), hn(u, a, n, r, i);
|
|
2641
2612
|
}
|
|
2642
2613
|
let d = this.stepsPerFlight * this.riserHeight, f = (this.stepsPerFlight - 1) * this.treadDepth, p = f + this.landingSize;
|
|
2643
|
-
|
|
2614
|
+
xn(u, a, d, f, p);
|
|
2644
2615
|
let m = -a;
|
|
2645
2616
|
for (let e = 0; e < this.stepsPerFlight; e++) {
|
|
2646
2617
|
let t = d + e * this.riserHeight, n = t + this.riserHeight, r = m - e * this.treadDepth, i = r - this.treadDepth;
|
|
2647
|
-
|
|
2618
|
+
gn(u, t, n, r, f, p), _n(u, n, r, i, f, p);
|
|
2648
2619
|
}
|
|
2649
2620
|
this.setIndex(l), this.setAttribute("position", new r(new Float32Array(o), 3)), this.setAttribute("normal", new r(new Float32Array(s), 3)), this.setAttribute("uv", new r(new Float32Array(c), 2)), this.computeBoundingSphere();
|
|
2650
2621
|
}
|
|
2651
|
-
},
|
|
2622
|
+
}, Cn = class extends i {
|
|
2652
2623
|
innerRadius;
|
|
2653
2624
|
width;
|
|
2654
2625
|
outerRadius;
|
|
@@ -2671,11 +2642,11 @@ var bn = class extends i {
|
|
|
2671
2642
|
};
|
|
2672
2643
|
for (let e = 0; e < this.stepCount; e++) {
|
|
2673
2644
|
let t = this.startAngle + e * this.stepAngle, n = t + this.stepAngle, r = e * this.riserHeight, i = r + this.riserHeight;
|
|
2674
|
-
|
|
2645
|
+
yn(p, this.innerRadius, this.outerRadius, r, i, t), bn(p, this.innerRadius, this.outerRadius, i, t, n);
|
|
2675
2646
|
}
|
|
2676
2647
|
this.setIndex(f), this.setAttribute("position", new r(new Float32Array(l), 3)), this.setAttribute("normal", new r(new Float32Array(u), 3)), this.setAttribute("uv", new r(new Float32Array(d), 2)), this.computeBoundingSphere();
|
|
2677
2648
|
}
|
|
2678
|
-
},
|
|
2649
|
+
}, wn = class extends i {
|
|
2679
2650
|
width;
|
|
2680
2651
|
riserHeight;
|
|
2681
2652
|
treadDepth;
|
|
@@ -2692,61 +2663,61 @@ var bn = class extends i {
|
|
|
2692
2663
|
};
|
|
2693
2664
|
for (let e = 0; e < this.stepCount; e++) {
|
|
2694
2665
|
let t = e * this.riserHeight, n = t + this.riserHeight, r = e * this.treadDepth, i = r + this.treadDepth;
|
|
2695
|
-
|
|
2666
|
+
mn(u, a, t, n, r), hn(u, a, n, r, i);
|
|
2696
2667
|
}
|
|
2697
2668
|
this.setIndex(l), this.setAttribute("position", new r(new Float32Array(o), 3)), this.setAttribute("normal", new r(new Float32Array(s), 3)), this.setAttribute("uv", new r(new Float32Array(c), 2)), this.computeBoundingSphere();
|
|
2698
2669
|
}
|
|
2699
|
-
},
|
|
2670
|
+
}, Tn = class extends i {
|
|
2700
2671
|
constructor() {
|
|
2701
2672
|
super();
|
|
2702
|
-
let e = new
|
|
2703
|
-
new
|
|
2704
|
-
new
|
|
2705
|
-
new
|
|
2706
|
-
new
|
|
2707
|
-
new
|
|
2708
|
-
new
|
|
2673
|
+
let e = new S([
|
|
2674
|
+
new I(0, 0),
|
|
2675
|
+
new I(1.2, 0),
|
|
2676
|
+
new I(1.5, 1.5),
|
|
2677
|
+
new I(1, 3),
|
|
2678
|
+
new I(.6, 3.5),
|
|
2679
|
+
new I(.5, 3.5)
|
|
2709
2680
|
], 10), t = new u(.6, .5, .3, 10);
|
|
2710
|
-
t.translate(0, 3.5, 0), this.copy(
|
|
2681
|
+
t.translate(0, 3.5, 0), this.copy(R([e, t], !0));
|
|
2711
2682
|
}
|
|
2712
2683
|
};
|
|
2713
2684
|
//#endregion
|
|
2714
2685
|
//#region src/utils/LineEquations.ts
|
|
2715
|
-
function
|
|
2686
|
+
function En(e, t, n, r, i) {
|
|
2716
2687
|
let a = (r - t) / (n - e);
|
|
2717
2688
|
return e + (i - t) / a;
|
|
2718
2689
|
}
|
|
2719
|
-
function
|
|
2690
|
+
function Dn(e, t, n, r, i) {
|
|
2720
2691
|
return t + (r - t) / (n - e) * (i - e);
|
|
2721
2692
|
}
|
|
2722
|
-
var
|
|
2723
|
-
calculateXFromSlopeIntercept:
|
|
2724
|
-
calculateYFromSlopeIntercept:
|
|
2725
|
-
},
|
|
2693
|
+
var On = {
|
|
2694
|
+
calculateXFromSlopeIntercept: En,
|
|
2695
|
+
calculateYFromSlopeIntercept: Dn
|
|
2696
|
+
}, kn = class extends i {
|
|
2726
2697
|
constructor() {
|
|
2727
2698
|
super();
|
|
2728
|
-
let e = new
|
|
2729
|
-
new
|
|
2730
|
-
new
|
|
2731
|
-
new
|
|
2732
|
-
new
|
|
2733
|
-
new
|
|
2734
|
-
new
|
|
2699
|
+
let e = new S([
|
|
2700
|
+
new I(0, 0),
|
|
2701
|
+
new I(.8, 0),
|
|
2702
|
+
new I(1, 1.5),
|
|
2703
|
+
new I(.5, 2.2),
|
|
2704
|
+
new I(.6, 2.5),
|
|
2705
|
+
new I(.5, 2.5)
|
|
2735
2706
|
], 10), t = new u(.55, .45, .2, 10);
|
|
2736
2707
|
t.translate(0, 2.5, 0);
|
|
2737
|
-
let n = new
|
|
2738
|
-
new
|
|
2739
|
-
new
|
|
2740
|
-
new
|
|
2741
|
-
new
|
|
2708
|
+
let n = new S([
|
|
2709
|
+
new I(0, 0),
|
|
2710
|
+
new I(.8, 0),
|
|
2711
|
+
new I(En(.8, 0, 1, 1.5, 1), 1),
|
|
2712
|
+
new I(0, 1)
|
|
2742
2713
|
], 10);
|
|
2743
|
-
n.translate(0, .1, 0), n.scale(.9, .9, .9), this.copy(
|
|
2714
|
+
n.translate(0, .1, 0), n.scale(.9, .9, .9), this.copy(R([
|
|
2744
2715
|
e,
|
|
2745
2716
|
t,
|
|
2746
2717
|
n
|
|
2747
2718
|
], !0));
|
|
2748
2719
|
}
|
|
2749
|
-
},
|
|
2720
|
+
}, An = class extends i {
|
|
2750
2721
|
radius;
|
|
2751
2722
|
height;
|
|
2752
2723
|
constructor({ radius: e = .5, neckRadius: t = .2, height: n = 3, neckHeight: r = 1, segments: i = 16 } = {}) {
|
|
@@ -2756,13 +2727,13 @@ var En = {
|
|
|
2756
2727
|
let s = .3, c = new u(t, e, s, i);
|
|
2757
2728
|
c.translate(0, a + s / 2, 0);
|
|
2758
2729
|
let l = new u(t, t, r, i);
|
|
2759
|
-
l.translate(0, a + s + r / 2, 0), this.copy(
|
|
2730
|
+
l.translate(0, a + s + r / 2, 0), this.copy(R([
|
|
2760
2731
|
o,
|
|
2761
2732
|
c,
|
|
2762
2733
|
l
|
|
2763
2734
|
], !1));
|
|
2764
2735
|
}
|
|
2765
|
-
},
|
|
2736
|
+
}, jn = class extends i {
|
|
2766
2737
|
width;
|
|
2767
2738
|
height;
|
|
2768
2739
|
depth;
|
|
@@ -2771,9 +2742,9 @@ var En = {
|
|
|
2771
2742
|
let i = t * .6, a = new n(e / 2, i, r);
|
|
2772
2743
|
a.translate(0, i / 2, 0);
|
|
2773
2744
|
let o = new n(e * 1.5, e / 4, r);
|
|
2774
|
-
o.translate(0, i * .75, 0), this.copy(
|
|
2745
|
+
o.translate(0, i * .75, 0), this.copy(R([a, o], !1)), this.computeVertexNormals();
|
|
2775
2746
|
}
|
|
2776
|
-
},
|
|
2747
|
+
}, Mn = class extends i {
|
|
2777
2748
|
constructor() {
|
|
2778
2749
|
super();
|
|
2779
2750
|
let e = new n(5, 1, 5);
|
|
@@ -2808,20 +2779,20 @@ var En = {
|
|
|
2808
2779
|
});
|
|
2809
2780
|
let a = new l(3.5, 2, 4);
|
|
2810
2781
|
a.rotateY(Math.PI / 4), a.translate(0, 5, 0);
|
|
2811
|
-
let o = new
|
|
2782
|
+
let o = new P();
|
|
2812
2783
|
o.moveTo(-1, 0), o.lineTo(-1, 2), o.absarc(0, 2, 1, Math.PI, 0, !0), o.lineTo(1, 0);
|
|
2813
2784
|
let s = new g(o, {
|
|
2814
2785
|
depth: .5,
|
|
2815
2786
|
bevelEnabled: !1
|
|
2816
2787
|
});
|
|
2817
|
-
s.translate(0, .5, 1.7), s.setIndex([...Array(s.attributes.position.count).keys()]), this.copy(
|
|
2788
|
+
s.translate(0, .5, 1.7), s.setIndex([...Array(s.attributes.position.count).keys()]), this.copy(R([
|
|
2818
2789
|
e,
|
|
2819
|
-
|
|
2790
|
+
R([t, ...i], !1),
|
|
2820
2791
|
a,
|
|
2821
2792
|
s
|
|
2822
2793
|
], !0)), this.computeVertexNormals();
|
|
2823
2794
|
}
|
|
2824
|
-
},
|
|
2795
|
+
}, Nn = class extends i {
|
|
2825
2796
|
totalHeight;
|
|
2826
2797
|
baseWidth;
|
|
2827
2798
|
constructor({ totalHeight: e = 1.75, baseWidth: t = .75 } = {}) {
|
|
@@ -2835,7 +2806,7 @@ var En = {
|
|
|
2835
2806
|
let f = new n(t * .4, o, t * .4);
|
|
2836
2807
|
f.translate(0, s + o / 2, 0), s += o;
|
|
2837
2808
|
let p = new l(t * .4 / Math.sqrt(2), .1, 4, 1, !1, Math.PI / 4);
|
|
2838
|
-
p.translate(0, s + .1 / 2, 0), this.copy(
|
|
2809
|
+
p.translate(0, s + .1 / 2, 0), this.copy(R([
|
|
2839
2810
|
c,
|
|
2840
2811
|
u,
|
|
2841
2812
|
d,
|
|
@@ -2843,21 +2814,21 @@ var En = {
|
|
|
2843
2814
|
p
|
|
2844
2815
|
], !1)), this.computeVertexNormals();
|
|
2845
2816
|
}
|
|
2846
|
-
},
|
|
2817
|
+
}, Pn = class extends i {
|
|
2847
2818
|
constructor(e = .6, t = 1, r = .2, i = .6) {
|
|
2848
2819
|
super();
|
|
2849
2820
|
let a = t - i / 2, o = new n(e, a, r);
|
|
2850
2821
|
o.translate(0, a / 2, 0);
|
|
2851
2822
|
let s = new u(i / 2, i / 2, r, 16, 1, !1, 0, Math.PI);
|
|
2852
|
-
s.rotateY(Math.PI / 2), s.rotateX(Math.PI / 2), s.translate(0, a, 0), this.copy(
|
|
2823
|
+
s.rotateY(Math.PI / 2), s.rotateX(Math.PI / 2), s.translate(0, a, 0), this.copy(R([o, s], !1)), this.computeVertexNormals();
|
|
2853
2824
|
}
|
|
2854
|
-
},
|
|
2825
|
+
}, Fn = class extends i {
|
|
2855
2826
|
constructor(e = .5, t = .8, r = .15) {
|
|
2856
2827
|
super();
|
|
2857
2828
|
let i = new n(e, t, r);
|
|
2858
2829
|
i.translate(0, t / 2, 0), this.copy(i);
|
|
2859
2830
|
}
|
|
2860
|
-
},
|
|
2831
|
+
}, In = class extends i {
|
|
2861
2832
|
height;
|
|
2862
2833
|
constructor({ height: e = 2.25 } = {}) {
|
|
2863
2834
|
super(), this.height = e;
|
|
@@ -2866,27 +2837,27 @@ var En = {
|
|
|
2866
2837
|
let r = new n(1, e, 1);
|
|
2867
2838
|
r.translate(0, .5 + e / 2, 0);
|
|
2868
2839
|
let i = new n(1.4, .3, 1.4);
|
|
2869
|
-
i.translate(0, .5 + e + .15, 0), this.copy(
|
|
2840
|
+
i.translate(0, .5 + e + .15, 0), this.copy(R([
|
|
2870
2841
|
t,
|
|
2871
2842
|
r,
|
|
2872
2843
|
i
|
|
2873
2844
|
], !1));
|
|
2874
2845
|
}
|
|
2875
|
-
},
|
|
2846
|
+
}, Ln = class extends i {
|
|
2876
2847
|
barHeight;
|
|
2877
2848
|
constructor({ barHeight: e = 2, barRadius: t = .05, spikeHeight: n = .3, spikeRadius: r = .075, spikeScaleZ: i = 1, radialSegments: a = 8 } = {}) {
|
|
2878
2849
|
super(), this.barHeight = e;
|
|
2879
2850
|
let o = new u(t, t, e, a);
|
|
2880
2851
|
o.translate(0, e / 2, 0);
|
|
2881
2852
|
let s = new l(r, n, a);
|
|
2882
|
-
s.translate(0, e + n / 2, 0), s.scale(1, 1, i), this.copy(
|
|
2853
|
+
s.translate(0, e + n / 2, 0), s.scale(1, 1, i), this.copy(R([o, s], !1));
|
|
2883
2854
|
}
|
|
2884
|
-
},
|
|
2855
|
+
}, Rn = class extends i {
|
|
2885
2856
|
count;
|
|
2886
2857
|
spacing;
|
|
2887
2858
|
constructor({ count: e = 20, spacing: t = .4, barHeight: r = 2, barRadius: i = .05, spikeHeight: a = .3, spikeRadius: o = .075, spikeScaleZ: s = 1, railHeight: c = .1, railDepth: l = .05, railOffset: u = 0, radialSegments: d = 8 } = {}) {
|
|
2888
2859
|
super(), this.count = e, this.spacing = t;
|
|
2889
|
-
let f = [], p = new
|
|
2860
|
+
let f = [], p = new Ln({
|
|
2890
2861
|
barHeight: r,
|
|
2891
2862
|
barRadius: i,
|
|
2892
2863
|
spikeHeight: a,
|
|
@@ -2901,9 +2872,9 @@ var En = {
|
|
|
2901
2872
|
let h = m.clone();
|
|
2902
2873
|
h.translate(t * (e - 1) / 2, r - u - c / 2, 0), f.push(h);
|
|
2903
2874
|
let g = m.clone();
|
|
2904
|
-
g.translate(t * (e - 1) / 2, c / 2, 0), f.push(g), this.copy(
|
|
2875
|
+
g.translate(t * (e - 1) / 2, c / 2, 0), f.push(g), this.copy(R(f));
|
|
2905
2876
|
}
|
|
2906
|
-
},
|
|
2877
|
+
}, zn = class extends i {
|
|
2907
2878
|
width;
|
|
2908
2879
|
height;
|
|
2909
2880
|
depth;
|
|
@@ -2925,7 +2896,7 @@ var En = {
|
|
|
2925
2896
|
let t = c.clone();
|
|
2926
2897
|
t.translate(0, a / 2 + e * h, 0), m.push(t);
|
|
2927
2898
|
}
|
|
2928
|
-
this.copy(
|
|
2899
|
+
this.copy(R([
|
|
2929
2900
|
l,
|
|
2930
2901
|
u,
|
|
2931
2902
|
d,
|
|
@@ -2934,17 +2905,17 @@ var En = {
|
|
|
2934
2905
|
...m
|
|
2935
2906
|
], !1));
|
|
2936
2907
|
}
|
|
2937
|
-
},
|
|
2908
|
+
}, Bn = class extends i {
|
|
2938
2909
|
constructor() {
|
|
2939
2910
|
super();
|
|
2940
2911
|
let e = new n(5, .3, 3);
|
|
2941
2912
|
e.translate(0, 3.15, 0);
|
|
2942
|
-
let t = new
|
|
2943
|
-
new
|
|
2944
|
-
new
|
|
2945
|
-
new
|
|
2946
|
-
new
|
|
2947
|
-
], 32), r =
|
|
2913
|
+
let t = new S([
|
|
2914
|
+
new I(.2, 0),
|
|
2915
|
+
new I(.25, .5),
|
|
2916
|
+
new I(.15, 1.5),
|
|
2917
|
+
new I(.3, 3)
|
|
2918
|
+
], 32), r = R([
|
|
2948
2919
|
[
|
|
2949
2920
|
2.1,
|
|
2950
2921
|
0,
|
|
@@ -2969,9 +2940,9 @@ var En = {
|
|
|
2969
2940
|
let n = t.clone();
|
|
2970
2941
|
return n.translate(e[0], e[1], e[2]), n;
|
|
2971
2942
|
}));
|
|
2972
|
-
this.copy(
|
|
2943
|
+
this.copy(R([e, r], !0));
|
|
2973
2944
|
}
|
|
2974
|
-
},
|
|
2945
|
+
}, Vn = class extends i {
|
|
2975
2946
|
size;
|
|
2976
2947
|
lift;
|
|
2977
2948
|
constructor({ size: e = .13, lift: t = .22 } = {}) {
|
|
@@ -2995,7 +2966,7 @@ var En = {
|
|
|
2995
2966
|
for (let e = 0; e < n.length - 1; e++) i.push(a[e], s[e], s[e + 1], a[e], s[e + 1], a[e + 1]), i.push(a[e], a[e + 1], o[e + 1], a[e], o[e + 1], o[e]);
|
|
2996
2967
|
this.setAttribute("position", new _(r, 3)), this.setIndex(i), this.computeVertexNormals(), this.computeBoundingSphere();
|
|
2997
2968
|
}
|
|
2998
|
-
},
|
|
2969
|
+
}, Hn = class extends pe {
|
|
2999
2970
|
height;
|
|
3000
2971
|
radius;
|
|
3001
2972
|
segmentsU;
|
|
@@ -3006,7 +2977,7 @@ var En = {
|
|
|
3006
2977
|
i.set(s, c, -l);
|
|
3007
2978
|
}, n, r), this.height = e, this.radius = t, this.segmentsU = n, this.segmentsV = r;
|
|
3008
2979
|
}
|
|
3009
|
-
},
|
|
2980
|
+
}, Un = class extends i {
|
|
3010
2981
|
radiusTop;
|
|
3011
2982
|
radiusBottom;
|
|
3012
2983
|
height;
|
|
@@ -3017,15 +2988,15 @@ var En = {
|
|
|
3017
2988
|
super(), this.radiusTop = e, this.radiusBottom = t, this.height = n, this.flameHeight = r, this.flameRadius = i, this.segments = a;
|
|
3018
2989
|
let o = new u(e, t, n, a);
|
|
3019
2990
|
o.translate(0, n / 2, 0);
|
|
3020
|
-
let s = new
|
|
2991
|
+
let s = new Hn({
|
|
3021
2992
|
segmentsU: a,
|
|
3022
2993
|
segmentsV: a,
|
|
3023
2994
|
height: r,
|
|
3024
2995
|
radius: i
|
|
3025
2996
|
});
|
|
3026
|
-
s.translate(0, n, 0), this.copy(
|
|
2997
|
+
s.translate(0, n, 0), this.copy(R([o, s], !0));
|
|
3027
2998
|
}
|
|
3028
|
-
},
|
|
2999
|
+
}, Wn = class extends i {
|
|
3029
3000
|
baseWidth;
|
|
3030
3001
|
bodyHeight;
|
|
3031
3002
|
baseHeight;
|
|
@@ -3038,25 +3009,25 @@ var En = {
|
|
|
3038
3009
|
h.translate(0, n / 2, 0), m.push(h);
|
|
3039
3010
|
let g = n + t, _ = new l(i, r, f);
|
|
3040
3011
|
_.translate(0, g + r / 2, 0), m.push(_);
|
|
3041
|
-
let v = g + r, y = new
|
|
3012
|
+
let v = g + r, y = new oe(s, c, f, f * 2);
|
|
3042
3013
|
y.translate(0, v + d, 0), m.push(y);
|
|
3043
|
-
let b = [
|
|
3014
|
+
let b = [R(m.map((e) => e.toNonIndexed()), !1)];
|
|
3044
3015
|
if (p) {
|
|
3045
3016
|
let n = new u(e * a * o, e * a * o, t * o, f);
|
|
3046
3017
|
n.translate(0, this.lampCenterY, 0), b.push(n.toNonIndexed());
|
|
3047
3018
|
}
|
|
3048
|
-
this.copy(
|
|
3019
|
+
this.copy(R(b, !0)), this.computeBoundingSphere();
|
|
3049
3020
|
}
|
|
3050
|
-
},
|
|
3051
|
-
function
|
|
3021
|
+
}, Gn = new L(0, 1, 0);
|
|
3022
|
+
function Kn(e, t, r) {
|
|
3052
3023
|
let i = t.clone().sub(e), a = new n(r, i.length(), r);
|
|
3053
|
-
a.applyQuaternion(new
|
|
3024
|
+
a.applyQuaternion(new N().setFromUnitVectors(Gn, i.normalize()));
|
|
3054
3025
|
let o = e.clone().add(t).multiplyScalar(.5);
|
|
3055
3026
|
return a.translate(o.x, o.y, o.z), a;
|
|
3056
3027
|
}
|
|
3057
3028
|
//#endregion
|
|
3058
3029
|
//#region src/geometry/lighting/HangingLanternGeometry.ts
|
|
3059
|
-
var
|
|
3030
|
+
var qn = class extends i {
|
|
3060
3031
|
drop;
|
|
3061
3032
|
chainWidth;
|
|
3062
3033
|
capWidth;
|
|
@@ -3078,7 +3049,7 @@ var Gn = class extends i {
|
|
|
3078
3049
|
h.translate(0, -e / 2, 0), m.push(h);
|
|
3079
3050
|
let g = new n(r, i, a);
|
|
3080
3051
|
g.translate(0, -e + o, 0), m.push(g);
|
|
3081
|
-
let _ = this.cageCenterY, v = s, y = new
|
|
3052
|
+
let _ = this.cageCenterY, v = s, y = new L(0, _ + v * c, 0), b = new L(0, _ - v * c, 0), x = new L(v, _, 0), S = new L(-v, _, 0), C = new L(0, _, v), w = new L(0, _, -v), T = [
|
|
3082
3053
|
[y, x],
|
|
3083
3054
|
[y, S],
|
|
3084
3055
|
[y, C],
|
|
@@ -3091,14 +3062,14 @@ var Gn = class extends i {
|
|
|
3091
3062
|
[C, S],
|
|
3092
3063
|
[S, w],
|
|
3093
3064
|
[w, x]
|
|
3094
|
-
].map(([e, t]) =>
|
|
3065
|
+
].map(([e, t]) => Kn(e, t, u)), E = [R(m.map((e) => e.toNonIndexed()), !1), R(T.map((e) => e.toNonIndexed()), !1)];
|
|
3095
3066
|
if (f) {
|
|
3096
|
-
let e = new
|
|
3067
|
+
let e = new ee(s * d, 0);
|
|
3097
3068
|
e.scale(1, c, 1), e.translate(0, _, 0), E.push(e.toNonIndexed());
|
|
3098
3069
|
}
|
|
3099
|
-
this.copy(
|
|
3070
|
+
this.copy(R(E, !0)), this.computeBoundingSphere();
|
|
3100
3071
|
}
|
|
3101
|
-
},
|
|
3072
|
+
}, Jn = class extends i {
|
|
3102
3073
|
bodyOffsetX;
|
|
3103
3074
|
chimneyCenterY;
|
|
3104
3075
|
innerScale;
|
|
@@ -3110,20 +3081,20 @@ var Gn = class extends i {
|
|
|
3110
3081
|
super(), this.bodyOffsetX = d, this.chimneyCenterY = h, this.innerScale = w, this.inner = T, this.lightCenterX = d, this.lightCenterY = h, this.lightCenterZ = 0;
|
|
3111
3082
|
let E = [], D = new n(e, t, r);
|
|
3112
3083
|
D.translate(i, 0, 0), E.push(D);
|
|
3113
|
-
let
|
|
3114
|
-
|
|
3115
|
-
let
|
|
3116
|
-
|
|
3117
|
-
let
|
|
3118
|
-
|
|
3119
|
-
let j = [
|
|
3084
|
+
let O = new n(a, o, s);
|
|
3085
|
+
O.translate(c, l, 0), E.push(O);
|
|
3086
|
+
let k = [], A = new u(g, g, _, C);
|
|
3087
|
+
A.translate(d, v, 0), k.push(A);
|
|
3088
|
+
let ee = new u(y, b, x, C);
|
|
3089
|
+
ee.translate(d, S, 0), k.push(ee);
|
|
3090
|
+
let j = [R(E.map((e) => e.toNonIndexed()), !1), R(k.map((e) => e.toNonIndexed()), !1)];
|
|
3120
3091
|
if (T) {
|
|
3121
3092
|
let e = new u(p * w, m * w, f * w, C);
|
|
3122
3093
|
e.translate(d, h, 0), j.push(e.toNonIndexed());
|
|
3123
3094
|
}
|
|
3124
|
-
this.copy(
|
|
3095
|
+
this.copy(R(j, !0)), this.computeBoundingSphere();
|
|
3125
3096
|
}
|
|
3126
|
-
},
|
|
3097
|
+
}, Yn = class extends i {
|
|
3127
3098
|
constructor(e = 1, t = 2, n = .5, i = Math.PI / 4) {
|
|
3128
3099
|
super();
|
|
3129
3100
|
let a = t * Math.tan(i), o = e, s = t, c = n, l = [
|
|
@@ -3361,38 +3332,38 @@ var Gn = class extends i {
|
|
|
3361
3332
|
]), p = new Float32Array(l), m = new Float32Array(u), h = new Float32Array(f), g = new Uint16Array(d);
|
|
3362
3333
|
this.setAttribute("position", new r(p, 3)), this.setAttribute("normal", new r(m, 3)), this.setAttribute("uv", new r(h, 2)), this.setIndex(new r(g, 1)), this.center();
|
|
3363
3334
|
}
|
|
3364
|
-
},
|
|
3335
|
+
}, Xn = class extends P {
|
|
3365
3336
|
constructor(e = 5, t = .5, n = 1, r = 5, i = .25) {
|
|
3366
3337
|
super();
|
|
3367
3338
|
let a = Math.PI * 2 / e, o = a / 4;
|
|
3368
3339
|
this.moveTo(Math.cos(0) * n, -Math.sin(0) * n);
|
|
3369
3340
|
for (let r = 1; r <= e; ++r) this.lineTo(Math.cos(a * r - o * 3) * t, -Math.sin(a * r - o * 3) * t), this.lineTo(Math.cos(a * r - o * 2) * t, -Math.sin(a * r - o * 2) * t), this.lineTo(Math.cos(a * r - o) * n, -Math.sin(a * r - o) * n), this.lineTo(Math.cos(a * r) * n, -Math.sin(a * r) * n);
|
|
3370
3341
|
if (this.closePath(), i > 0 && r > 2) {
|
|
3371
|
-
let e = new
|
|
3342
|
+
let e = new j(), t = Math.PI * 2 / r;
|
|
3372
3343
|
e.moveTo(Math.cos(0) * i, -Math.sin(0) * i);
|
|
3373
3344
|
for (let n = 1; n < r; ++n) e.lineTo(Math.cos(t * n) * i, -Math.sin(t * n) * i);
|
|
3374
3345
|
e.lineTo(Math.cos(0) * i, -Math.sin(0) * i), this.holes.push(e);
|
|
3375
3346
|
}
|
|
3376
3347
|
}
|
|
3377
|
-
},
|
|
3348
|
+
}, Zn = class extends g {
|
|
3378
3349
|
constructor({ sides: e = 5, innerRadius: t = .5, outerRadius: n = 1, holeSides: r = 5, holeRadius: i = .25, depth: a = .25 } = {}) {
|
|
3379
|
-
super(new
|
|
3350
|
+
super(new Xn(e, t, n, r, i), {
|
|
3380
3351
|
depth: a,
|
|
3381
3352
|
bevelEnabled: !1
|
|
3382
3353
|
});
|
|
3383
3354
|
}
|
|
3384
|
-
},
|
|
3355
|
+
}, Qn = class extends P {
|
|
3385
3356
|
constructor(e = 1, t = 2.1, n = 1.4, r = 1.6) {
|
|
3386
3357
|
super(), this.moveTo(0, n * e / 3), this.bezierCurveTo(-t * .375 * e, n * e, -t * e, n * e / 3, 0, -r * e), this.bezierCurveTo(t * e, n * e / 3, t * .375 * e, n * e, 0, n * e / 3);
|
|
3387
3358
|
}
|
|
3388
|
-
},
|
|
3359
|
+
}, $n = class extends g {
|
|
3389
3360
|
constructor({ size: e = 1, width: t = 2.1, height: n = 1.4, tipDepth: r = 1.6, depth: i = .25 } = {}) {
|
|
3390
|
-
super(new
|
|
3361
|
+
super(new Qn(e, t, n, r), {
|
|
3391
3362
|
depth: i,
|
|
3392
3363
|
bevelEnabled: !1
|
|
3393
3364
|
});
|
|
3394
3365
|
}
|
|
3395
|
-
},
|
|
3366
|
+
}, er = class extends P {
|
|
3396
3367
|
constructor(e = 5, t = .5, n = 1) {
|
|
3397
3368
|
super();
|
|
3398
3369
|
let r = Math.PI * 2 / e, i = r / 2;
|
|
@@ -3400,20 +3371,20 @@ var Gn = class extends i {
|
|
|
3400
3371
|
for (let a = 1; a <= e; ++a) this.lineTo(Math.cos(r * a - i) * t, Math.sin(r * a - i) * t), this.lineTo(Math.cos(r * a) * n, Math.sin(r * a) * n);
|
|
3401
3372
|
this.closePath();
|
|
3402
3373
|
}
|
|
3403
|
-
},
|
|
3374
|
+
}, tr = class extends g {
|
|
3404
3375
|
constructor({ points: e = 5, innerRadius: t = .5, outerRadius: n = 1, depth: r = .25 } = {}) {
|
|
3405
|
-
super(new
|
|
3376
|
+
super(new er(e, t, n), {
|
|
3406
3377
|
depth: r,
|
|
3407
3378
|
bevelEnabled: !1
|
|
3408
3379
|
});
|
|
3409
3380
|
}
|
|
3410
|
-
},
|
|
3381
|
+
}, nr = class extends i {
|
|
3411
3382
|
constructor(e = .1, t = .1, n = .4, r = 8) {
|
|
3412
3383
|
super();
|
|
3413
3384
|
let i = new u(e * .6, t * .6, n, r);
|
|
3414
3385
|
i.translate(0, 0, 0);
|
|
3415
|
-
let a = new
|
|
3416
|
-
o.translate(0, n / 2 + e * .6, -e * .6), s.translate(0, n / 2 + e * .6, e * .6), c.translate(0, -n / 2 - t * .6, -t * .6), l.translate(0, -n / 2 - t * .6, t * .6), this.copy(
|
|
3386
|
+
let a = new F(e, r, r), o = a.clone(), s = a.clone(), c = a.clone(), l = a.clone();
|
|
3387
|
+
o.translate(0, n / 2 + e * .6, -e * .6), s.translate(0, n / 2 + e * .6, e * .6), c.translate(0, -n / 2 - t * .6, -t * .6), l.translate(0, -n / 2 - t * .6, t * .6), this.copy(R([
|
|
3417
3388
|
i,
|
|
3418
3389
|
o,
|
|
3419
3390
|
s,
|
|
@@ -3421,29 +3392,29 @@ var Gn = class extends i {
|
|
|
3421
3392
|
l
|
|
3422
3393
|
], !1));
|
|
3423
3394
|
}
|
|
3424
|
-
},
|
|
3395
|
+
}, rr = class extends i {
|
|
3425
3396
|
flaskRadius;
|
|
3426
3397
|
height;
|
|
3427
3398
|
constructor({ flaskRadius: e = 1, neckRadius: t = .3, height: n = 2.5, neckHeight: r = 1, radialSegments: i = 16 } = {}) {
|
|
3428
3399
|
super(), this.flaskRadius = e, this.height = n;
|
|
3429
|
-
let a = new
|
|
3430
|
-
new
|
|
3431
|
-
new
|
|
3432
|
-
new
|
|
3433
|
-
new
|
|
3434
|
-
new
|
|
3435
|
-
new
|
|
3400
|
+
let a = new S([
|
|
3401
|
+
new I(0, 0),
|
|
3402
|
+
new I(e * .875, 0),
|
|
3403
|
+
new I(e, .1),
|
|
3404
|
+
new I(t, n),
|
|
3405
|
+
new I(t, n + r),
|
|
3406
|
+
new I(t * 1.1, n + r + .3)
|
|
3436
3407
|
], i);
|
|
3437
|
-
this.copy(
|
|
3408
|
+
this.copy(R([a], !1));
|
|
3438
3409
|
}
|
|
3439
|
-
},
|
|
3410
|
+
}, ir = (e, t) => e / (1 - Math.cos(t)), ar = (e, t) => e / (2 * Math.sin(t)), or = (e, t) => e * (1 - Math.cos(t)), sr = (e, t) => 2 * e * Math.sin(t), cr = (e, t) => {
|
|
3440
3411
|
let n = 2 * t;
|
|
3441
3412
|
return Math.asin(n / (2 * e));
|
|
3442
|
-
},
|
|
3413
|
+
}, lr = (e, t, n) => ({
|
|
3443
3414
|
x: e * Math.sin(n) * Math.cos(t),
|
|
3444
3415
|
y: e * Math.sin(n) * Math.sin(t),
|
|
3445
3416
|
z: e * Math.cos(n)
|
|
3446
|
-
}),
|
|
3417
|
+
}), ur = (e, t, n) => {
|
|
3447
3418
|
let r = Math.sqrt(e * e + t * t + n * n);
|
|
3448
3419
|
return {
|
|
3449
3420
|
radius: r,
|
|
@@ -3453,66 +3424,66 @@ var Gn = class extends i {
|
|
|
3453
3424
|
};
|
|
3454
3425
|
//#endregion
|
|
3455
3426
|
//#region src/utils/SphericalCurve.ts
|
|
3456
|
-
function
|
|
3457
|
-
let o = r ?
|
|
3427
|
+
function dr(e, t, n, r = 0, i = 0, a = 32) {
|
|
3428
|
+
let o = r ? cr(e, r) : 0, s = i ? Math.PI - cr(e, i) : Math.PI, c = [];
|
|
3458
3429
|
for (let r = 0; r <= a; r++) {
|
|
3459
3430
|
let i = s - (s - o) / a * r, l = e * Math.sin(i), u = t * Math.cos(i) + n;
|
|
3460
|
-
c.push(new
|
|
3431
|
+
c.push(new I(l, u));
|
|
3461
3432
|
}
|
|
3462
3433
|
return [...c];
|
|
3463
3434
|
}
|
|
3464
3435
|
//#endregion
|
|
3465
3436
|
//#region src/geometry/science/FlorenceFlaskGeometry.ts
|
|
3466
|
-
var
|
|
3437
|
+
var fr = class extends i {
|
|
3467
3438
|
constructor() {
|
|
3468
3439
|
super();
|
|
3469
|
-
let e = new
|
|
3440
|
+
let e = new S([...dr(1, 1, .5, .2, 0, 32), new I(.2, 3)], 32);
|
|
3470
3441
|
this.copy(e);
|
|
3471
3442
|
}
|
|
3472
|
-
},
|
|
3443
|
+
}, pr = class extends i {
|
|
3473
3444
|
constructor() {
|
|
3474
3445
|
super();
|
|
3475
|
-
let e = new
|
|
3476
|
-
new
|
|
3477
|
-
new
|
|
3478
|
-
new
|
|
3479
|
-
new
|
|
3480
|
-
new
|
|
3446
|
+
let e = new S([
|
|
3447
|
+
new I(1, 0),
|
|
3448
|
+
new I(1.2, .5),
|
|
3449
|
+
new I(1.4, 1.5),
|
|
3450
|
+
new I(1.3, 1.8),
|
|
3451
|
+
new I(.8, 1.8)
|
|
3481
3452
|
], 12), t = new s(1, 12);
|
|
3482
|
-
t.rotateX(-Math.PI / 2), t.translate(0, 0, 0), this.copy(
|
|
3453
|
+
t.rotateX(-Math.PI / 2), t.translate(0, 0, 0), this.copy(R([e, t], !1));
|
|
3483
3454
|
}
|
|
3484
|
-
},
|
|
3455
|
+
}, mr = class extends i {
|
|
3485
3456
|
radius;
|
|
3486
3457
|
height;
|
|
3487
3458
|
count;
|
|
3488
3459
|
constructor({ radius: e = .3, height: t = .4, count: n = 3, thickness: r = .03, radialSegments: i = 16 } = {}) {
|
|
3489
3460
|
super(), this.radius = e, this.height = t, this.count = n;
|
|
3490
|
-
let a = new
|
|
3461
|
+
let a = new oe(e, r, 8, i);
|
|
3491
3462
|
a.rotateX(Math.PI / 2), a.translate(0, t, 0);
|
|
3492
3463
|
let o = new u(r * .6, r * .6, t, i), s = [];
|
|
3493
3464
|
for (let r = 0; r < n; r++) {
|
|
3494
3465
|
let i = r / n * Math.PI * 2, a = o.clone();
|
|
3495
3466
|
a.translate(Math.cos(i) * e, t / 2, Math.sin(i) * e), s.push(a);
|
|
3496
3467
|
}
|
|
3497
|
-
this.copy(
|
|
3468
|
+
this.copy(R([a, ...s], !1));
|
|
3498
3469
|
}
|
|
3499
|
-
},
|
|
3470
|
+
}, hr = class extends i {
|
|
3500
3471
|
constructor() {
|
|
3501
3472
|
super();
|
|
3502
3473
|
let e = new u(.5, .6, .3, 16);
|
|
3503
3474
|
e.translate(0, .15, 0);
|
|
3504
3475
|
let t = new u(.15, .15, 2, 12, 1, !0);
|
|
3505
3476
|
t.translate(0, 1.3, 0);
|
|
3506
|
-
let n = new
|
|
3507
|
-
n.translate(0, 2.4, 0), this.copy(
|
|
3477
|
+
let n = new F(.3, 16, 16);
|
|
3478
|
+
n.translate(0, 2.4, 0), this.copy(R([e, R([t, n])], !0));
|
|
3508
3479
|
}
|
|
3509
|
-
},
|
|
3480
|
+
}, gr = class extends i {
|
|
3510
3481
|
constructor(e = .2, t = .2, n = 3, r = 32, i = !0) {
|
|
3511
3482
|
super();
|
|
3512
|
-
let a = new u(e, t, n, r, 1, i), o = new
|
|
3513
|
-
o.translate(0, -(n / 2), 0), this.copy(
|
|
3483
|
+
let a = new u(e, t, n, r, 1, i), o = new F(t, r, r / 2, 0, Math.PI * 2, Math.PI / 2, Math.PI / 2);
|
|
3484
|
+
o.translate(0, -(n / 2), 0), this.copy(R([a, o], !1));
|
|
3514
3485
|
}
|
|
3515
|
-
},
|
|
3486
|
+
}, _r = class extends i {
|
|
3516
3487
|
radius;
|
|
3517
3488
|
height;
|
|
3518
3489
|
constructor({ radius: e = 8, height: t = 1.2, radialSegments: n = 40, angularSegments: i = 64, noiseHeight: a = .5, noiseScale: o = .35, octaves: s = 4, persistence: c = .5, rim: l = .82, seed: u = 1 } = {}) {
|
|
@@ -3521,7 +3492,7 @@ var ur = class extends i {
|
|
|
3521
3492
|
if (e <= l) return 1;
|
|
3522
3493
|
let t = (e - l) / (1 - l);
|
|
3523
3494
|
return 1 - t * t * (3 - 2 * t);
|
|
3524
|
-
}, h = (e, n, r) => p(e) * t +
|
|
3495
|
+
}, h = (e, n, r) => p(e) * t + Et(n * o, r * o, u, s, c) * a * m(e), g = 1 + d * f, _ = new Float32Array(g * 3), v = new Float32Array(g * 2);
|
|
3525
3496
|
_[1] = h(0, 0, 0), v[0] = .5, v[1] = .5;
|
|
3526
3497
|
for (let t = 1; t <= d; t++) {
|
|
3527
3498
|
let n = t / d, r = n * e;
|
|
@@ -3538,7 +3509,7 @@ var ur = class extends i {
|
|
|
3538
3509
|
}
|
|
3539
3510
|
this.setAttribute("position", new r(_, 3)), this.setAttribute("uv", new r(v, 2)), this.setIndex(b), this.computeVertexNormals();
|
|
3540
3511
|
}
|
|
3541
|
-
},
|
|
3512
|
+
}, vr = class extends i {
|
|
3542
3513
|
width;
|
|
3543
3514
|
depth;
|
|
3544
3515
|
constructor({ width: e = 16, depth: t = 16, widthSegments: n = 48, depthSegments: i = 48, noiseHeight: a = .8, noiseScale: o = .35, octaves: s = 4, persistence: c = .5, edgeFalloff: l = 0, seed: u = 1 } = {}) {
|
|
@@ -3553,7 +3524,7 @@ var ur = class extends i {
|
|
|
3553
3524
|
for (let n = 0; n <= f; n++) {
|
|
3554
3525
|
let r = -m + n / f * t;
|
|
3555
3526
|
for (let t = 0; t <= d; t++) {
|
|
3556
|
-
let i = -p + t / d * e, l =
|
|
3527
|
+
let i = -p + t / d * e, l = Et(i * o, r * o, u, s, c) * a * g(i, r), m = n * (d + 1) + t;
|
|
3557
3528
|
v[m * 3] = i, v[m * 3 + 1] = l, v[m * 3 + 2] = r, y[m * 2] = t / d, y[m * 2 + 1] = n / f;
|
|
3558
3529
|
}
|
|
3559
3530
|
}
|
|
@@ -3564,7 +3535,7 @@ var ur = class extends i {
|
|
|
3564
3535
|
}
|
|
3565
3536
|
this.setAttribute("position", new r(v, 3)), this.setAttribute("uv", new r(y, 2)), this.setIndex(b), this.computeVertexNormals();
|
|
3566
3537
|
}
|
|
3567
|
-
},
|
|
3538
|
+
}, yr = class extends i {
|
|
3568
3539
|
trunkRadiusTop;
|
|
3569
3540
|
trunkRadiusBottom;
|
|
3570
3541
|
trunkHeight;
|
|
@@ -3582,9 +3553,9 @@ var ur = class extends i {
|
|
|
3582
3553
|
let e = new f(i, o);
|
|
3583
3554
|
e.translate((Math.random() - .5) * s, (Math.random() - .5) * i + n, (Math.random() - .5) * s), l.push(e);
|
|
3584
3555
|
}
|
|
3585
|
-
this.copy(
|
|
3556
|
+
this.copy(R([c.toNonIndexed(), R(l, !1)], !0)), this.computeVertexNormals();
|
|
3586
3557
|
}
|
|
3587
|
-
},
|
|
3558
|
+
}, br = class extends T {
|
|
3588
3559
|
width;
|
|
3589
3560
|
riserHeight;
|
|
3590
3561
|
treadDepth;
|
|
@@ -3593,15 +3564,15 @@ var ur = class extends i {
|
|
|
3593
3564
|
flightRun;
|
|
3594
3565
|
totalHeight;
|
|
3595
3566
|
constructor({ color: e = "#8b4513", ...t } = {}) {
|
|
3596
|
-
let n = new
|
|
3597
|
-
super(n, new
|
|
3567
|
+
let n = new Sn(t);
|
|
3568
|
+
super(n, new O({
|
|
3598
3569
|
color: new c(e),
|
|
3599
3570
|
roughness: .85,
|
|
3600
3571
|
metalness: .04,
|
|
3601
3572
|
side: p
|
|
3602
3573
|
})), this.width = n.width, this.riserHeight = n.riserHeight, this.treadDepth = n.treadDepth, this.stepsPerFlight = n.stepsPerFlight, this.landingSize = n.landingSize, this.flightRun = n.flightRun, this.totalHeight = n.totalHeight;
|
|
3603
3574
|
}
|
|
3604
|
-
},
|
|
3575
|
+
}, xr = class extends T {
|
|
3605
3576
|
innerRadius;
|
|
3606
3577
|
width;
|
|
3607
3578
|
outerRadius;
|
|
@@ -3612,15 +3583,15 @@ var ur = class extends i {
|
|
|
3612
3583
|
totalHeight;
|
|
3613
3584
|
totalTurn;
|
|
3614
3585
|
constructor({ color: e = "#8b4513", ...t } = {}) {
|
|
3615
|
-
let n = new
|
|
3616
|
-
super(n, new
|
|
3586
|
+
let n = new Cn(t);
|
|
3587
|
+
super(n, new O({
|
|
3617
3588
|
color: new c(e),
|
|
3618
3589
|
roughness: .85,
|
|
3619
3590
|
metalness: .04,
|
|
3620
3591
|
side: p
|
|
3621
3592
|
})), this.innerRadius = n.innerRadius, this.width = n.width, this.outerRadius = n.outerRadius, this.treadDepth = n.treadDepth, this.riserHeight = n.riserHeight, this.stepCount = n.stepCount, this.stepAngle = n.stepAngle, this.totalHeight = n.totalHeight, this.totalTurn = n.totalTurn;
|
|
3622
3593
|
}
|
|
3623
|
-
},
|
|
3594
|
+
}, Sr = class extends T {
|
|
3624
3595
|
width;
|
|
3625
3596
|
riserHeight;
|
|
3626
3597
|
treadDepth;
|
|
@@ -3628,15 +3599,15 @@ var ur = class extends i {
|
|
|
3628
3599
|
totalHeight;
|
|
3629
3600
|
totalDepth;
|
|
3630
3601
|
constructor({ color: e = "#8b4513", ...t } = {}) {
|
|
3631
|
-
let n = new
|
|
3632
|
-
super(n, new
|
|
3602
|
+
let n = new wn(t);
|
|
3603
|
+
super(n, new O({
|
|
3633
3604
|
color: new c(e),
|
|
3634
3605
|
roughness: .85,
|
|
3635
3606
|
metalness: .04,
|
|
3636
3607
|
side: p
|
|
3637
3608
|
})), this.width = n.width, this.riserHeight = n.riserHeight, this.treadDepth = n.treadDepth, this.stepCount = n.stepCount, this.totalHeight = n.totalHeight, this.totalDepth = n.totalDepth;
|
|
3638
3609
|
}
|
|
3639
|
-
},
|
|
3610
|
+
}, Cr = 48, wr = class extends v {
|
|
3640
3611
|
lattice;
|
|
3641
3612
|
frame;
|
|
3642
3613
|
glass;
|
|
@@ -3651,7 +3622,7 @@ var ur = class extends i {
|
|
|
3651
3622
|
archHeight: s,
|
|
3652
3623
|
centerY: l
|
|
3653
3624
|
});
|
|
3654
|
-
let m = new
|
|
3625
|
+
let m = new cn({
|
|
3655
3626
|
width: a,
|
|
3656
3627
|
rectHeight: o,
|
|
3657
3628
|
archHeight: s,
|
|
@@ -3663,9 +3634,9 @@ var ur = class extends i {
|
|
|
3663
3634
|
this.cellsX = m.cellsX, this.cellsY = m.cellsY, this.fittedGrid = m.fittedGrid;
|
|
3664
3635
|
let h = new c(e);
|
|
3665
3636
|
if (t) {
|
|
3666
|
-
let e = new
|
|
3667
|
-
|
|
3668
|
-
let t = new
|
|
3637
|
+
let e = new P();
|
|
3638
|
+
Jt(e, this.opening);
|
|
3639
|
+
let t = new ae(e, Cr), a = new D({
|
|
3669
3640
|
color: new c(n),
|
|
3670
3641
|
emissive: r ? new c(r) : new c(0),
|
|
3671
3642
|
emissiveIntensity: i,
|
|
@@ -3677,9 +3648,9 @@ var ur = class extends i {
|
|
|
3677
3648
|
thickness: d * .5,
|
|
3678
3649
|
side: p
|
|
3679
3650
|
});
|
|
3680
|
-
this.glass = new
|
|
3651
|
+
this.glass = new T(t, a), this.glass.renderOrder = 0, this.glass.castShadow = !1, this.glass.receiveShadow = !1, this.add(this.glass);
|
|
3681
3652
|
}
|
|
3682
|
-
let g = new
|
|
3653
|
+
let g = new O({
|
|
3683
3654
|
color: h,
|
|
3684
3655
|
roughness: .7,
|
|
3685
3656
|
metalness: .35,
|
|
@@ -3687,15 +3658,15 @@ var ur = class extends i {
|
|
|
3687
3658
|
polygonOffsetFactor: -1,
|
|
3688
3659
|
polygonOffsetUnits: -1
|
|
3689
3660
|
});
|
|
3690
|
-
this.lattice = new
|
|
3691
|
-
let _ =
|
|
3692
|
-
this.frame = new
|
|
3661
|
+
this.lattice = new T(m, g), this.lattice.castShadow = !0, this.lattice.renderOrder = 1, this.add(this.lattice);
|
|
3662
|
+
let _ = Zt(this.opening, u, d);
|
|
3663
|
+
this.frame = new T(_, new O({
|
|
3693
3664
|
color: h,
|
|
3694
3665
|
roughness: .7,
|
|
3695
3666
|
metalness: .35
|
|
3696
3667
|
})), this.frame.castShadow = !0, this.frame.renderOrder = 2, this.add(this.frame);
|
|
3697
3668
|
}
|
|
3698
|
-
},
|
|
3669
|
+
}, Tr = class extends v {
|
|
3699
3670
|
lattice;
|
|
3700
3671
|
glass;
|
|
3701
3672
|
cellsX;
|
|
@@ -3703,13 +3674,13 @@ var ur = class extends i {
|
|
|
3703
3674
|
fittedGrid;
|
|
3704
3675
|
constructor({ leadColor: e = "#0c0f14", glass: t = !1, glassColor: n = "#6a7d8c", glassEmissive: r, glassEmissiveIntensity: i = 0, centerY: a = 0, leadDepth: o = .11, ...s } = {}) {
|
|
3705
3676
|
super();
|
|
3706
|
-
let l = new
|
|
3677
|
+
let l = new ln({
|
|
3707
3678
|
centerY: a,
|
|
3708
3679
|
leadDepth: o,
|
|
3709
3680
|
...s
|
|
3710
3681
|
});
|
|
3711
3682
|
this.cellsX = l.cellsX, this.cellsY = l.cellsY, this.fittedGrid = l.fittedGrid;
|
|
3712
|
-
let u = new
|
|
3683
|
+
let u = new O({
|
|
3713
3684
|
color: new c(e),
|
|
3714
3685
|
roughness: .7,
|
|
3715
3686
|
metalness: .35,
|
|
@@ -3717,8 +3688,8 @@ var ur = class extends i {
|
|
|
3717
3688
|
polygonOffsetFactor: -1,
|
|
3718
3689
|
polygonOffsetUnits: -1
|
|
3719
3690
|
});
|
|
3720
|
-
if (this.lattice = new
|
|
3721
|
-
let e = s.width ?? 4.5, t = s.height ?? 5.5, l = new
|
|
3691
|
+
if (this.lattice = new T(l, u), this.lattice.castShadow = !0, this.lattice.renderOrder = 1, this.add(this.lattice), t) {
|
|
3692
|
+
let e = s.width ?? 4.5, t = s.height ?? 5.5, l = new D({
|
|
3722
3693
|
color: new c(n),
|
|
3723
3694
|
emissive: r ? new c(r) : new c(0),
|
|
3724
3695
|
emissiveIntensity: i,
|
|
@@ -3730,10 +3701,10 @@ var ur = class extends i {
|
|
|
3730
3701
|
thickness: o * .5,
|
|
3731
3702
|
side: p
|
|
3732
3703
|
});
|
|
3733
|
-
this.glass = new
|
|
3704
|
+
this.glass = new T(new M(e, t), l), this.glass.position.y = a, this.glass.renderOrder = 0, this.glass.castShadow = !1, this.glass.receiveShadow = !1, this.add(this.glass);
|
|
3734
3705
|
}
|
|
3735
3706
|
}
|
|
3736
|
-
},
|
|
3707
|
+
}, Er = class extends v {
|
|
3737
3708
|
mullions;
|
|
3738
3709
|
glass;
|
|
3739
3710
|
cellsX;
|
|
@@ -3741,15 +3712,15 @@ var ur = class extends i {
|
|
|
3741
3712
|
fittedGrid;
|
|
3742
3713
|
constructor({ mullionColor: e = "#5c4033", glass: t = !1, glassColor: n = "#6a7d8c", glassEmissive: r, glassEmissiveIntensity: i = 0, ...a } = {}) {
|
|
3743
3714
|
super();
|
|
3744
|
-
let o = new
|
|
3715
|
+
let o = new fn(a);
|
|
3745
3716
|
this.cellsX = o.cellsX, this.cellsY = o.cellsY, this.fittedGrid = o.fittedGrid;
|
|
3746
|
-
let s = new
|
|
3717
|
+
let s = new O({
|
|
3747
3718
|
color: new c(e),
|
|
3748
3719
|
roughness: .85,
|
|
3749
3720
|
metalness: .05
|
|
3750
3721
|
});
|
|
3751
|
-
if (this.mullions = new
|
|
3752
|
-
let e = a.width ?? 4.5, t = a.height ?? 5.5, o = new
|
|
3722
|
+
if (this.mullions = new T(o, s), this.mullions.castShadow = !0, this.mullions.renderOrder = 1, this.add(this.mullions), t) {
|
|
3723
|
+
let e = a.width ?? 4.5, t = a.height ?? 5.5, o = new D({
|
|
3753
3724
|
color: new c(n),
|
|
3754
3725
|
emissive: r ? new c(r) : new c(0),
|
|
3755
3726
|
emissiveIntensity: i,
|
|
@@ -3761,30 +3732,30 @@ var ur = class extends i {
|
|
|
3761
3732
|
thickness: .02,
|
|
3762
3733
|
side: p
|
|
3763
3734
|
});
|
|
3764
|
-
this.glass = new
|
|
3735
|
+
this.glass = new T(new M(e, t), o), this.glass.renderOrder = 0, this.glass.castShadow = !1, this.glass.receiveShadow = !1, this.add(this.glass);
|
|
3765
3736
|
}
|
|
3766
3737
|
}
|
|
3767
|
-
},
|
|
3738
|
+
}, Dr = class extends T {
|
|
3768
3739
|
width;
|
|
3769
3740
|
height;
|
|
3770
3741
|
depth;
|
|
3771
3742
|
coverThickness;
|
|
3772
3743
|
pageIndent;
|
|
3773
3744
|
constructor({ coverColor: e = "#8b0000", pageColor: t = "#ffffff", ...n } = {}) {
|
|
3774
|
-
let r = new
|
|
3775
|
-
super(r, [new
|
|
3745
|
+
let r = new ht(n);
|
|
3746
|
+
super(r, [new O({
|
|
3776
3747
|
color: new c(e),
|
|
3777
3748
|
metalness: .1,
|
|
3778
3749
|
roughness: .7,
|
|
3779
3750
|
flatShading: !0
|
|
3780
|
-
}), new
|
|
3751
|
+
}), new O({
|
|
3781
3752
|
color: new c(t),
|
|
3782
3753
|
flatShading: !0
|
|
3783
3754
|
})]), this.width = r.width, this.height = r.height, this.depth = r.depth, this.coverThickness = r.coverThickness, this.pageIndent = r.pageIndent;
|
|
3784
3755
|
}
|
|
3785
|
-
},
|
|
3756
|
+
}, Or = class extends T {
|
|
3786
3757
|
constructor() {
|
|
3787
|
-
super(new
|
|
3758
|
+
super(new Tn(), [new O({
|
|
3788
3759
|
color: 8965290,
|
|
3789
3760
|
transparent: !0,
|
|
3790
3761
|
depthWrite: !1,
|
|
@@ -3792,15 +3763,15 @@ var ur = class extends i {
|
|
|
3792
3763
|
roughness: .1,
|
|
3793
3764
|
metalness: .5,
|
|
3794
3765
|
side: p
|
|
3795
|
-
}), new
|
|
3766
|
+
}), new O({
|
|
3796
3767
|
color: 9127187,
|
|
3797
3768
|
roughness: 1
|
|
3798
3769
|
})]);
|
|
3799
3770
|
}
|
|
3800
|
-
},
|
|
3771
|
+
}, kr = class extends T {
|
|
3801
3772
|
constructor() {
|
|
3802
|
-
super(new
|
|
3803
|
-
new
|
|
3773
|
+
super(new kn(), [
|
|
3774
|
+
new O({
|
|
3804
3775
|
color: 8965375,
|
|
3805
3776
|
transparent: !0,
|
|
3806
3777
|
depthWrite: !1,
|
|
@@ -3808,21 +3779,21 @@ var ur = class extends i {
|
|
|
3808
3779
|
roughness: .1,
|
|
3809
3780
|
metalness: .3
|
|
3810
3781
|
}),
|
|
3811
|
-
new
|
|
3782
|
+
new O({
|
|
3812
3783
|
color: 9127187,
|
|
3813
3784
|
roughness: 1
|
|
3814
3785
|
}),
|
|
3815
|
-
new
|
|
3816
|
-
color:
|
|
3786
|
+
new O({
|
|
3787
|
+
color: je.PINK_SHERBET,
|
|
3817
3788
|
transparent: !0,
|
|
3818
3789
|
depthWrite: !1,
|
|
3819
3790
|
opacity: .5
|
|
3820
3791
|
})
|
|
3821
3792
|
]);
|
|
3822
3793
|
}
|
|
3823
|
-
},
|
|
3794
|
+
}, Ar = class extends T {
|
|
3824
3795
|
constructor({ color: e = "#556b2f", ...t } = {}) {
|
|
3825
|
-
super(new
|
|
3796
|
+
super(new An(t), new D({
|
|
3826
3797
|
color: new c(e),
|
|
3827
3798
|
roughness: .1,
|
|
3828
3799
|
transmission: .9,
|
|
@@ -3832,106 +3803,106 @@ var ur = class extends i {
|
|
|
3832
3803
|
clearcoatRoughness: .1
|
|
3833
3804
|
}));
|
|
3834
3805
|
}
|
|
3835
|
-
},
|
|
3806
|
+
}, jr = class extends T {
|
|
3836
3807
|
width;
|
|
3837
3808
|
height;
|
|
3838
3809
|
constructor({ color: e = "#777777", roughness: t = .8, ...n } = {}) {
|
|
3839
|
-
let r = new
|
|
3840
|
-
super(r, new
|
|
3810
|
+
let r = new jn(n);
|
|
3811
|
+
super(r, new O({
|
|
3841
3812
|
color: new c(e),
|
|
3842
3813
|
roughness: t
|
|
3843
3814
|
})), this.width = r.width, this.height = r.height;
|
|
3844
3815
|
}
|
|
3845
|
-
},
|
|
3816
|
+
}, Mr = class extends T {
|
|
3846
3817
|
constructor() {
|
|
3847
|
-
super(new
|
|
3848
|
-
new
|
|
3818
|
+
super(new Mn(), [
|
|
3819
|
+
new O({
|
|
3849
3820
|
color: 8421504,
|
|
3850
3821
|
flatShading: !0
|
|
3851
3822
|
}),
|
|
3852
|
-
new
|
|
3823
|
+
new O({
|
|
3853
3824
|
color: 6908265,
|
|
3854
3825
|
flatShading: !0
|
|
3855
3826
|
}),
|
|
3856
|
-
new
|
|
3827
|
+
new O({
|
|
3857
3828
|
color: 5263440,
|
|
3858
3829
|
flatShading: !0
|
|
3859
3830
|
}),
|
|
3860
|
-
new
|
|
3831
|
+
new O({
|
|
3861
3832
|
color: 4210752,
|
|
3862
3833
|
flatShading: !0
|
|
3863
3834
|
})
|
|
3864
3835
|
]);
|
|
3865
3836
|
}
|
|
3866
|
-
},
|
|
3837
|
+
}, Nr = class extends T {
|
|
3867
3838
|
totalHeight;
|
|
3868
3839
|
constructor({ color: e = "#777777", roughness: t = .8, ...n } = {}) {
|
|
3869
|
-
let r = new
|
|
3870
|
-
super(r, new
|
|
3840
|
+
let r = new Nn(n);
|
|
3841
|
+
super(r, new O({
|
|
3871
3842
|
color: new c(e),
|
|
3872
3843
|
roughness: t
|
|
3873
3844
|
})), this.totalHeight = r.totalHeight;
|
|
3874
3845
|
}
|
|
3875
|
-
},
|
|
3846
|
+
}, Pr = class extends T {
|
|
3876
3847
|
constructor(e = .6, t = 1, n = .2, r = .6) {
|
|
3877
|
-
super(new
|
|
3848
|
+
super(new Pn(e, t, n, r), new O({
|
|
3878
3849
|
color: 7829367,
|
|
3879
3850
|
roughness: .8
|
|
3880
3851
|
}));
|
|
3881
3852
|
}
|
|
3882
|
-
},
|
|
3853
|
+
}, Fr = class extends T {
|
|
3883
3854
|
constructor(e = .5, t = .8, n = .15) {
|
|
3884
|
-
super(new
|
|
3855
|
+
super(new Fn(e, t, n), new O({
|
|
3885
3856
|
color: 7829367,
|
|
3886
3857
|
roughness: .8
|
|
3887
3858
|
}));
|
|
3888
3859
|
}
|
|
3889
|
-
},
|
|
3860
|
+
}, Ir = class extends T {
|
|
3890
3861
|
height;
|
|
3891
3862
|
constructor({ color: e = "#8b7d7b", ...t } = {}) {
|
|
3892
|
-
let n = new
|
|
3893
|
-
super(n, new
|
|
3863
|
+
let n = new In(t);
|
|
3864
|
+
super(n, new O({
|
|
3894
3865
|
color: new c(e),
|
|
3895
3866
|
flatShading: !0
|
|
3896
3867
|
})), this.height = n.height;
|
|
3897
3868
|
}
|
|
3898
|
-
},
|
|
3869
|
+
}, Lr = class extends T {
|
|
3899
3870
|
barHeight;
|
|
3900
3871
|
constructor({ color: e = "#333333", ...t } = {}) {
|
|
3901
|
-
let n = new
|
|
3902
|
-
super(n, new
|
|
3872
|
+
let n = new Ln(t);
|
|
3873
|
+
super(n, new O({
|
|
3903
3874
|
color: new c(e),
|
|
3904
3875
|
metalness: .8,
|
|
3905
3876
|
roughness: .4
|
|
3906
3877
|
})), this.barHeight = n.barHeight;
|
|
3907
3878
|
}
|
|
3908
|
-
},
|
|
3879
|
+
}, Rr = class extends T {
|
|
3909
3880
|
count;
|
|
3910
3881
|
constructor({ color: e = "#333333", ...t } = {}) {
|
|
3911
|
-
let n = new
|
|
3912
|
-
super(n, new
|
|
3882
|
+
let n = new Rn(t);
|
|
3883
|
+
super(n, new O({
|
|
3913
3884
|
color: new c(e),
|
|
3914
3885
|
metalness: .8,
|
|
3915
3886
|
roughness: .4
|
|
3916
3887
|
})), this.count = n.count;
|
|
3917
3888
|
}
|
|
3918
|
-
},
|
|
3889
|
+
}, zr = class extends T {
|
|
3919
3890
|
width;
|
|
3920
3891
|
height;
|
|
3921
3892
|
constructor({ color: e = "#8b4513", ...t } = {}) {
|
|
3922
|
-
let n = new
|
|
3923
|
-
super(n, new
|
|
3893
|
+
let n = new zn(t);
|
|
3894
|
+
super(n, new O({ color: new c(e) })), this.width = n.width, this.height = n.height;
|
|
3924
3895
|
}
|
|
3925
|
-
},
|
|
3896
|
+
}, Br = class extends T {
|
|
3926
3897
|
constructor() {
|
|
3927
|
-
super(new
|
|
3898
|
+
super(new Bn(), [new O({ color: 9132587 }), new O({ color: 4929057 })]);
|
|
3928
3899
|
}
|
|
3929
|
-
},
|
|
3900
|
+
}, Vr = class extends T {
|
|
3930
3901
|
size;
|
|
3931
3902
|
lift;
|
|
3932
3903
|
constructor({ color: e = "#a8702c", ...t } = {}) {
|
|
3933
|
-
let n = new
|
|
3934
|
-
super(n, new
|
|
3904
|
+
let n = new Vn(t);
|
|
3905
|
+
super(n, new O({
|
|
3935
3906
|
color: new c(e),
|
|
3936
3907
|
roughness: .85,
|
|
3937
3908
|
metalness: .05,
|
|
@@ -3939,14 +3910,14 @@ var ur = class extends i {
|
|
|
3939
3910
|
side: p
|
|
3940
3911
|
})), this.size = n.size, this.lift = n.lift;
|
|
3941
3912
|
}
|
|
3942
|
-
},
|
|
3913
|
+
}, Hr = class extends T {
|
|
3943
3914
|
height;
|
|
3944
3915
|
constructor({ stickColor: e = "#ffffff", flameColor: t = "#ffd700", flameEmissive: n = "#ffa500", flameEmissiveIntensity: r = .35, ...i } = {}) {
|
|
3945
|
-
let a = new
|
|
3946
|
-
super(a, [new
|
|
3916
|
+
let a = new Un(i);
|
|
3917
|
+
super(a, [new O({
|
|
3947
3918
|
color: new c(e),
|
|
3948
3919
|
flatShading: !0
|
|
3949
|
-
}), new
|
|
3920
|
+
}), new O({
|
|
3950
3921
|
color: new c(t),
|
|
3951
3922
|
emissive: new c(n),
|
|
3952
3923
|
emissiveIntensity: r,
|
|
@@ -3954,14 +3925,14 @@ var ur = class extends i {
|
|
|
3954
3925
|
toneMapped: !1
|
|
3955
3926
|
})]), this.height = a.height;
|
|
3956
3927
|
}
|
|
3957
|
-
},
|
|
3928
|
+
}, Ur = class extends T {
|
|
3958
3929
|
height;
|
|
3959
3930
|
radius;
|
|
3960
3931
|
segmentsU;
|
|
3961
3932
|
segmentsV;
|
|
3962
3933
|
constructor({ color: e = "#ffd700", emissive: t = "#ffa500", emissiveIntensity: n = .35, ...r } = {}) {
|
|
3963
|
-
let i = new
|
|
3964
|
-
super(i, new
|
|
3934
|
+
let i = new Hn(r);
|
|
3935
|
+
super(i, new O({
|
|
3965
3936
|
color: new c(e),
|
|
3966
3937
|
emissive: new c(t),
|
|
3967
3938
|
emissiveIntensity: n,
|
|
@@ -3969,25 +3940,25 @@ var ur = class extends i {
|
|
|
3969
3940
|
toneMapped: !1
|
|
3970
3941
|
})), this.height = i.height, this.radius = i.radius, this.segmentsU = i.segmentsU, this.segmentsV = i.segmentsV;
|
|
3971
3942
|
}
|
|
3972
|
-
},
|
|
3943
|
+
}, Wr = class extends T {
|
|
3973
3944
|
drop;
|
|
3974
3945
|
cageCenterY;
|
|
3975
3946
|
constructor({ color: e = "#171a1f", mountColor: t, cageColor: n, lampColor: r = "#ffb45a", lampEmissiveIntensity: i = 1.4, lampOpacity: a = .88, inner: o = !0, ...s } = {}) {
|
|
3976
|
-
let l = new
|
|
3947
|
+
let l = new qn({
|
|
3977
3948
|
inner: o,
|
|
3978
3949
|
...s
|
|
3979
|
-
}), u = new c(r), d = [new
|
|
3950
|
+
}), u = new c(r), d = [new O({
|
|
3980
3951
|
color: new c(t ?? e),
|
|
3981
3952
|
metalness: .7,
|
|
3982
3953
|
roughness: .5,
|
|
3983
3954
|
flatShading: !0
|
|
3984
|
-
}), new
|
|
3955
|
+
}), new O({
|
|
3985
3956
|
color: new c(n ?? e),
|
|
3986
3957
|
metalness: .7,
|
|
3987
3958
|
roughness: .5,
|
|
3988
3959
|
flatShading: !0
|
|
3989
3960
|
})];
|
|
3990
|
-
o && d.push(new
|
|
3961
|
+
o && d.push(new O({
|
|
3991
3962
|
color: u,
|
|
3992
3963
|
emissive: u,
|
|
3993
3964
|
emissiveIntensity: i,
|
|
@@ -4000,26 +3971,26 @@ var ur = class extends i {
|
|
|
4000
3971
|
toneMapped: !1
|
|
4001
3972
|
})), super(l, d), this.drop = l.drop, this.cageCenterY = l.cageCenterY;
|
|
4002
3973
|
}
|
|
4003
|
-
},
|
|
3974
|
+
}, Gr = class extends T {
|
|
4004
3975
|
lightCenterX;
|
|
4005
3976
|
lightCenterY;
|
|
4006
3977
|
lightCenterZ;
|
|
4007
3978
|
constructor({ color: e = "#1c1e24", mountColor: t, frameColor: n, lampColor: r = "#e8a058", lampEmissiveIntensity: i = 1.4, lampOpacity: a = .88, inner: o = !0, ...s } = {}) {
|
|
4008
|
-
let l = new
|
|
3979
|
+
let l = new Jn({
|
|
4009
3980
|
inner: o,
|
|
4010
3981
|
...s
|
|
4011
|
-
}), u = new c(r), d = [new
|
|
3982
|
+
}), u = new c(r), d = [new O({
|
|
4012
3983
|
color: new c(t ?? e),
|
|
4013
3984
|
metalness: .65,
|
|
4014
3985
|
roughness: .55,
|
|
4015
3986
|
flatShading: !0
|
|
4016
|
-
}), new
|
|
3987
|
+
}), new O({
|
|
4017
3988
|
color: new c(n ?? e),
|
|
4018
3989
|
metalness: .65,
|
|
4019
3990
|
roughness: .55,
|
|
4020
3991
|
flatShading: !0
|
|
4021
3992
|
})];
|
|
4022
|
-
o && d.push(new
|
|
3993
|
+
o && d.push(new O({
|
|
4023
3994
|
color: u,
|
|
4024
3995
|
emissive: u,
|
|
4025
3996
|
emissiveIntensity: i,
|
|
@@ -4032,19 +4003,19 @@ var ur = class extends i {
|
|
|
4032
4003
|
toneMapped: !1
|
|
4033
4004
|
})), super(l, d), this.lightCenterX = l.lightCenterX, this.lightCenterY = l.lightCenterY, this.lightCenterZ = l.lightCenterZ;
|
|
4034
4005
|
}
|
|
4035
|
-
},
|
|
4006
|
+
}, Kr = class extends T {
|
|
4036
4007
|
lampCenterY;
|
|
4037
4008
|
constructor({ color: e = "#8b4513", lampColor: t = "#ffd700", lampEmissiveIntensity: n = 1.2, lampOpacity: r = .75, inner: i = !0, ...a } = {}) {
|
|
4038
|
-
let o = new
|
|
4009
|
+
let o = new Wn({
|
|
4039
4010
|
inner: i,
|
|
4040
4011
|
...a
|
|
4041
|
-
}), s = new c(t), l = [new
|
|
4012
|
+
}), s = new c(t), l = [new O({
|
|
4042
4013
|
color: new c(e),
|
|
4043
4014
|
roughness: .85,
|
|
4044
4015
|
metalness: .04,
|
|
4045
4016
|
flatShading: !0
|
|
4046
4017
|
})];
|
|
4047
|
-
i && l.push(new
|
|
4018
|
+
i && l.push(new O({
|
|
4048
4019
|
color: s,
|
|
4049
4020
|
emissive: s,
|
|
4050
4021
|
emissiveIntensity: n,
|
|
@@ -4057,52 +4028,52 @@ var ur = class extends i {
|
|
|
4057
4028
|
toneMapped: !1
|
|
4058
4029
|
})), super(o, l), this.lampCenterY = o.lampCenterY;
|
|
4059
4030
|
}
|
|
4060
|
-
},
|
|
4031
|
+
}, qr = class extends T {
|
|
4061
4032
|
radius;
|
|
4062
4033
|
constructor({ color: e = "#6f6f6f", flatShading: t = !0, ...n } = {}) {
|
|
4063
|
-
let r = new
|
|
4064
|
-
super(r, new
|
|
4034
|
+
let r = new Ot(n);
|
|
4035
|
+
super(r, new O({
|
|
4065
4036
|
color: new c(e),
|
|
4066
4037
|
roughness: 1,
|
|
4067
4038
|
metalness: 0,
|
|
4068
4039
|
flatShading: t
|
|
4069
4040
|
})), this.radius = r.radius, this.castShadow = !0, this.receiveShadow = !0;
|
|
4070
4041
|
}
|
|
4071
|
-
},
|
|
4042
|
+
}, Jr = class extends T {
|
|
4072
4043
|
constructor({ rockColor: e = "#808080", mossColor: t = "#4b8b3b", mossOpacity: n = .8, ...r } = {}) {
|
|
4073
|
-
super(new
|
|
4044
|
+
super(new Pt(r), [new O({
|
|
4074
4045
|
color: new c(e),
|
|
4075
4046
|
flatShading: !0
|
|
4076
|
-
}), new
|
|
4047
|
+
}), new O({
|
|
4077
4048
|
color: new c(t),
|
|
4078
4049
|
flatShading: !0,
|
|
4079
4050
|
opacity: n,
|
|
4080
4051
|
transparent: n < 1
|
|
4081
4052
|
})]);
|
|
4082
4053
|
}
|
|
4083
|
-
},
|
|
4054
|
+
}, Yr = class extends T {
|
|
4084
4055
|
constructor({ color: e = "#808080", ...t } = {}) {
|
|
4085
|
-
super(new
|
|
4056
|
+
super(new It(t), new O({
|
|
4086
4057
|
color: new c(e),
|
|
4087
4058
|
flatShading: !0
|
|
4088
4059
|
}));
|
|
4089
4060
|
}
|
|
4090
|
-
},
|
|
4061
|
+
}, Xr = class extends v {
|
|
4091
4062
|
constructor() {
|
|
4092
4063
|
super();
|
|
4093
|
-
let e = new
|
|
4064
|
+
let e = new T(new u(.3, .4, .1, 16), new O({
|
|
4094
4065
|
color: 3355443,
|
|
4095
4066
|
roughness: .6,
|
|
4096
4067
|
metalness: .3
|
|
4097
4068
|
}));
|
|
4098
4069
|
e.position.y = .05;
|
|
4099
|
-
let t = new
|
|
4070
|
+
let t = new T(new u(.1, .1, .7, 16), new O({
|
|
4100
4071
|
color: 5592405,
|
|
4101
4072
|
roughness: .5,
|
|
4102
4073
|
metalness: .4
|
|
4103
4074
|
}));
|
|
4104
4075
|
t.position.y = .4;
|
|
4105
|
-
let n = new
|
|
4076
|
+
let n = new T(new l(.075, .2, 16), new O({
|
|
4106
4077
|
color: 16733440,
|
|
4107
4078
|
emissive: 16733440,
|
|
4108
4079
|
emissiveIntensity: .6,
|
|
@@ -4111,38 +4082,38 @@ var ur = class extends i {
|
|
|
4111
4082
|
}));
|
|
4112
4083
|
n.position.y = .8, this.add(e, t, n);
|
|
4113
4084
|
}
|
|
4114
|
-
},
|
|
4085
|
+
}, Zr = class extends v {
|
|
4115
4086
|
constructor() {
|
|
4116
4087
|
super();
|
|
4117
|
-
let e = new n(3, 4, .1), t = new
|
|
4088
|
+
let e = new n(3, 4, .1), t = new O({
|
|
4118
4089
|
color: 3026478,
|
|
4119
4090
|
roughness: .8,
|
|
4120
4091
|
metalness: .6
|
|
4121
|
-
}), r = new n(.2, .5, .2), i = new
|
|
4092
|
+
}), r = new n(.2, .5, .2), i = new O({
|
|
4122
4093
|
color: 11184810,
|
|
4123
4094
|
roughness: .5,
|
|
4124
4095
|
metalness: .7
|
|
4125
|
-
}), a = new u(.3, .3, .1, 16), o = new
|
|
4096
|
+
}), a = new u(.3, .3, .1, 16), o = new O({
|
|
4126
4097
|
color: 5592405,
|
|
4127
4098
|
roughness: .7,
|
|
4128
4099
|
metalness: .5
|
|
4129
|
-
}), s = new
|
|
4100
|
+
}), s = new T(e, t);
|
|
4130
4101
|
for (let e = -1; e <= 1; e++) {
|
|
4131
|
-
let t = new
|
|
4102
|
+
let t = new T(r, i);
|
|
4132
4103
|
t.position.set(e, 1.5, .1), s.add(t);
|
|
4133
4104
|
}
|
|
4134
|
-
let c = new
|
|
4105
|
+
let c = new T(a, o);
|
|
4135
4106
|
c.rotation.x = Math.PI / 2, c.position.set(0, .5, .15), s.add(c);
|
|
4136
|
-
let l = new
|
|
4107
|
+
let l = new T(new F(.15, 8, 8), new O({
|
|
4137
4108
|
color: 16711680,
|
|
4138
4109
|
emissive: 16711680,
|
|
4139
4110
|
emissiveIntensity: .5
|
|
4140
4111
|
}));
|
|
4141
4112
|
l.position.set(0, -1, .1), s.add(l), this.add(s);
|
|
4142
4113
|
}
|
|
4143
|
-
},
|
|
4114
|
+
}, Qr = class extends T {
|
|
4144
4115
|
constructor({ color: e = "#88ccff", opacity: t = .4, ...n } = {}) {
|
|
4145
|
-
super(new
|
|
4116
|
+
super(new rr(n), new D({
|
|
4146
4117
|
color: new c(e),
|
|
4147
4118
|
transparent: !0,
|
|
4148
4119
|
opacity: t,
|
|
@@ -4153,9 +4124,9 @@ var ur = class extends i {
|
|
|
4153
4124
|
side: p
|
|
4154
4125
|
}));
|
|
4155
4126
|
}
|
|
4156
|
-
},
|
|
4127
|
+
}, $r = class extends T {
|
|
4157
4128
|
constructor() {
|
|
4158
|
-
super(new
|
|
4129
|
+
super(new fr(), new D({
|
|
4159
4130
|
color: 8965375,
|
|
4160
4131
|
transparent: !0,
|
|
4161
4132
|
depthWrite: !1,
|
|
@@ -4167,96 +4138,96 @@ var ur = class extends i {
|
|
|
4167
4138
|
side: p
|
|
4168
4139
|
}));
|
|
4169
4140
|
}
|
|
4170
|
-
},
|
|
4141
|
+
}, ei = class extends v {
|
|
4171
4142
|
constructor() {
|
|
4172
4143
|
super();
|
|
4173
|
-
let e = new
|
|
4144
|
+
let e = new T(new n(2, 3, .1), new O({
|
|
4174
4145
|
color: 3355443,
|
|
4175
4146
|
roughness: .8,
|
|
4176
4147
|
metalness: .5
|
|
4177
|
-
})), t = new u(.1, .1, .2, 8), r = new u(.05, .05, 1, 8), i = new
|
|
4148
|
+
})), t = new u(.1, .1, .2, 8), r = new u(.05, .05, 1, 8), i = new O({
|
|
4178
4149
|
color: 11184810,
|
|
4179
4150
|
roughness: .5,
|
|
4180
4151
|
metalness: .7
|
|
4181
4152
|
}), a = [];
|
|
4182
4153
|
for (let e = -.5; e <= .5; e += .5) {
|
|
4183
|
-
let n = new
|
|
4154
|
+
let n = new T(t, i);
|
|
4184
4155
|
n.position.set(e, 1, .1);
|
|
4185
|
-
let o = new
|
|
4156
|
+
let o = new T(r, i);
|
|
4186
4157
|
o.position.y = .5, n.add(o), a.push(o), this.add(n);
|
|
4187
4158
|
}
|
|
4188
4159
|
this.add(e);
|
|
4189
4160
|
}
|
|
4190
|
-
},
|
|
4161
|
+
}, ti = class extends v {
|
|
4191
4162
|
constructor() {
|
|
4192
4163
|
super();
|
|
4193
|
-
let e = new n(1, .2, .5), t = new
|
|
4164
|
+
let e = new n(1, .2, .5), t = new O({
|
|
4194
4165
|
color: 4473924,
|
|
4195
4166
|
roughness: .6,
|
|
4196
4167
|
metalness: .3
|
|
4197
|
-
}), r = new
|
|
4168
|
+
}), r = new T(e, t);
|
|
4198
4169
|
r.position.y = .1;
|
|
4199
|
-
let i = new
|
|
4170
|
+
let i = new T(new n(.2, 1, .2), t);
|
|
4200
4171
|
i.position.set(0, .6, -.2);
|
|
4201
|
-
let a = new
|
|
4172
|
+
let a = new T(new u(.1, .1, .4, 8), new O({
|
|
4202
4173
|
color: 3355443,
|
|
4203
4174
|
roughness: .5,
|
|
4204
4175
|
metalness: .6
|
|
4205
4176
|
}));
|
|
4206
4177
|
a.position.set(0, 1.1, -.35), a.rotation.x = -Math.PI / 4;
|
|
4207
|
-
let o = new
|
|
4178
|
+
let o = new T(new n(.6, .1, .6), new O({
|
|
4208
4179
|
color: 5592405,
|
|
4209
4180
|
roughness: .8,
|
|
4210
4181
|
metalness: .2
|
|
4211
4182
|
}));
|
|
4212
4183
|
o.position.set(0, .6, 0), this.add(r, i, a, o);
|
|
4213
4184
|
}
|
|
4214
|
-
},
|
|
4185
|
+
}, ni = class extends v {
|
|
4215
4186
|
constructor() {
|
|
4216
4187
|
super();
|
|
4217
|
-
let e = new
|
|
4188
|
+
let e = new pr(), t = new u(.2, .3, 1.5, 8);
|
|
4218
4189
|
t.translate(0, .75, 0);
|
|
4219
|
-
let n = new
|
|
4190
|
+
let n = new O({
|
|
4220
4191
|
color: 6045747,
|
|
4221
4192
|
roughness: 1,
|
|
4222
4193
|
metalness: 0,
|
|
4223
4194
|
side: p
|
|
4224
|
-
}), r = new
|
|
4195
|
+
}), r = new O({
|
|
4225
4196
|
color: 9132587,
|
|
4226
4197
|
roughness: .8,
|
|
4227
4198
|
metalness: .1
|
|
4228
|
-
}), i = new
|
|
4199
|
+
}), i = new T(e, n);
|
|
4229
4200
|
i.castShadow = !0;
|
|
4230
|
-
let a = new
|
|
4201
|
+
let a = new T(t, r);
|
|
4231
4202
|
a.castShadow = !0, a.position.set(.3, 1.3, 0), a.rotation.z = Math.PI / 4, this.add(i, a);
|
|
4232
4203
|
}
|
|
4233
|
-
},
|
|
4204
|
+
}, ri = class extends T {
|
|
4234
4205
|
geometry;
|
|
4235
4206
|
material;
|
|
4236
4207
|
constructor({ width: e = 3, height: t = 4, depth: r = .1 } = {}) {
|
|
4237
|
-
super(), this.geometry = new n(e, t, r), this.material = new
|
|
4208
|
+
super(), this.geometry = new n(e, t, r), this.material = new O({
|
|
4238
4209
|
color: 3026478,
|
|
4239
4210
|
roughness: .8,
|
|
4240
4211
|
metalness: .6
|
|
4241
4212
|
});
|
|
4242
4213
|
}
|
|
4243
|
-
},
|
|
4214
|
+
}, ii = class extends T {
|
|
4244
4215
|
geometry;
|
|
4245
4216
|
material;
|
|
4246
4217
|
constructor({ radius: e = .15, color: t = 16762823, emissive: n = 16711680, emissiveIntensity: r = .5 } = {}) {
|
|
4247
|
-
super(), this.geometry = new
|
|
4218
|
+
super(), this.geometry = new F(e, 8, 8), this.material = new O({
|
|
4248
4219
|
color: t,
|
|
4249
4220
|
emissive: n,
|
|
4250
4221
|
emissiveIntensity: r
|
|
4251
4222
|
});
|
|
4252
4223
|
}
|
|
4253
|
-
},
|
|
4224
|
+
}, ai = class extends v {
|
|
4254
4225
|
constructor() {
|
|
4255
4226
|
super();
|
|
4256
|
-
let e = new
|
|
4227
|
+
let e = new T(new se(new o(Array.from({ length: 100 }, (e, t) => {
|
|
4257
4228
|
let n = t * .2;
|
|
4258
|
-
return new
|
|
4259
|
-
})), 200, .1, 8, !1), new
|
|
4229
|
+
return new L(Math.cos(n) * .4, t * .05, Math.sin(n) * .4);
|
|
4230
|
+
})), 200, .1, 8, !1), new O({
|
|
4260
4231
|
color: 8965375,
|
|
4261
4232
|
transparent: !0,
|
|
4262
4233
|
opacity: .3,
|
|
@@ -4267,30 +4238,30 @@ var ur = class extends i {
|
|
|
4267
4238
|
}));
|
|
4268
4239
|
this.add(e);
|
|
4269
4240
|
}
|
|
4270
|
-
},
|
|
4241
|
+
}, oi = class extends T {
|
|
4271
4242
|
constructor({ color: e = "#888888", ...t } = {}) {
|
|
4272
|
-
super(new
|
|
4243
|
+
super(new mr(t), new O({
|
|
4273
4244
|
color: new c(e),
|
|
4274
4245
|
roughness: .7,
|
|
4275
4246
|
metalness: .3
|
|
4276
4247
|
}));
|
|
4277
4248
|
}
|
|
4278
|
-
},
|
|
4249
|
+
}, si = class extends T {
|
|
4279
4250
|
constructor() {
|
|
4280
|
-
super(new
|
|
4251
|
+
super(new hr(), [new O({
|
|
4281
4252
|
color: 3355443,
|
|
4282
4253
|
roughness: .6,
|
|
4283
4254
|
metalness: .5
|
|
4284
|
-
}), new
|
|
4255
|
+
}), new O({
|
|
4285
4256
|
color: 16737792,
|
|
4286
4257
|
roughness: .5,
|
|
4287
4258
|
metalness: .8,
|
|
4288
4259
|
side: p
|
|
4289
4260
|
})]);
|
|
4290
4261
|
}
|
|
4291
|
-
},
|
|
4262
|
+
}, ci = class extends T {
|
|
4292
4263
|
constructor(e = .2, t = .2, n = 3, r = 32) {
|
|
4293
|
-
super(new
|
|
4264
|
+
super(new gr(e, t, n, r), new D({
|
|
4294
4265
|
color: 8965375,
|
|
4295
4266
|
transparent: !0,
|
|
4296
4267
|
opacity: .4,
|
|
@@ -4302,7 +4273,7 @@ var ur = class extends i {
|
|
|
4302
4273
|
side: p
|
|
4303
4274
|
}));
|
|
4304
4275
|
}
|
|
4305
|
-
},
|
|
4276
|
+
}, li = class extends v {
|
|
4306
4277
|
count;
|
|
4307
4278
|
constructor({ count: e = 3, colors: t = [
|
|
4308
4279
|
"#00ffaa",
|
|
@@ -4310,13 +4281,13 @@ var ur = class extends i {
|
|
|
4310
4281
|
"#aa00ff"
|
|
4311
4282
|
] } = {}) {
|
|
4312
4283
|
super(), this.count = e;
|
|
4313
|
-
let r = new
|
|
4284
|
+
let r = new T(new n(3, .2, 1), new O({
|
|
4314
4285
|
color: 9127187,
|
|
4315
4286
|
roughness: .7,
|
|
4316
4287
|
metalness: .3
|
|
4317
4288
|
}));
|
|
4318
4289
|
r.position.y = .5, r.castShadow = !0;
|
|
4319
|
-
let i = new
|
|
4290
|
+
let i = new gr(.1, .1, 1, 16), a = new O({
|
|
4320
4291
|
color: 11184810,
|
|
4321
4292
|
transparent: !0,
|
|
4322
4293
|
opacity: .4,
|
|
@@ -4326,9 +4297,9 @@ var ur = class extends i {
|
|
|
4326
4297
|
side: p
|
|
4327
4298
|
});
|
|
4328
4299
|
for (let n = 0; n < e; n++) {
|
|
4329
|
-
let o = new
|
|
4300
|
+
let o = new T(i, a), s = (n - (e - 1) / 2) * .8;
|
|
4330
4301
|
o.position.set(s, 1, 0), o.castShadow = !0, o.renderOrder = 2;
|
|
4331
|
-
let l = new
|
|
4302
|
+
let l = new gr(.099, .099, .5, 16, !1), u = t[n % t.length], d = new T(l, new O({
|
|
4332
4303
|
color: new c(u),
|
|
4333
4304
|
emissive: new c(u),
|
|
4334
4305
|
emissiveIntensity: .5,
|
|
@@ -4341,9 +4312,9 @@ var ur = class extends i {
|
|
|
4341
4312
|
}
|
|
4342
4313
|
this.add(r);
|
|
4343
4314
|
}
|
|
4344
|
-
},
|
|
4315
|
+
}, ui = class extends T {
|
|
4345
4316
|
constructor({ color: e = "#ffff00", emissive: t = "#ffd700", emissiveIntensity: n = .25, ...r } = {}) {
|
|
4346
|
-
super(new
|
|
4317
|
+
super(new ct(r), new O({
|
|
4347
4318
|
color: new c(e),
|
|
4348
4319
|
emissive: new c(t),
|
|
4349
4320
|
emissiveIntensity: n,
|
|
@@ -4352,17 +4323,17 @@ var ur = class extends i {
|
|
|
4352
4323
|
flatShading: !0
|
|
4353
4324
|
}));
|
|
4354
4325
|
}
|
|
4355
|
-
},
|
|
4326
|
+
}, di = class extends T {
|
|
4356
4327
|
constructor({ color: e = "#aaaaaa", ...t } = {}) {
|
|
4357
|
-
super(new
|
|
4328
|
+
super(new Zn(t), new O({
|
|
4358
4329
|
color: new c(e),
|
|
4359
4330
|
metalness: .8,
|
|
4360
4331
|
roughness: .2
|
|
4361
4332
|
}));
|
|
4362
4333
|
}
|
|
4363
|
-
},
|
|
4334
|
+
}, fi = class extends T {
|
|
4364
4335
|
constructor({ color: e = "#c62828", emissive: t = "#c61416", emissiveIntensity: n = .25, ...r } = {}) {
|
|
4365
|
-
super(new
|
|
4336
|
+
super(new $n(r), new O({
|
|
4366
4337
|
color: new c(e),
|
|
4367
4338
|
emissive: new c(t),
|
|
4368
4339
|
emissiveIntensity: n,
|
|
@@ -4371,9 +4342,9 @@ var ur = class extends i {
|
|
|
4371
4342
|
flatShading: !0
|
|
4372
4343
|
}));
|
|
4373
4344
|
}
|
|
4374
|
-
},
|
|
4345
|
+
}, pi = class extends T {
|
|
4375
4346
|
constructor({ color: e = "#ffffff", emissive: t = "#ffffff", emissiveIntensity: n = .1, ...r } = {}) {
|
|
4376
|
-
super(new
|
|
4347
|
+
super(new jt(r), new O({
|
|
4377
4348
|
color: new c(e),
|
|
4378
4349
|
emissive: new c(t),
|
|
4379
4350
|
emissiveIntensity: n,
|
|
@@ -4382,9 +4353,9 @@ var ur = class extends i {
|
|
|
4382
4353
|
flatShading: !0
|
|
4383
4354
|
}));
|
|
4384
4355
|
}
|
|
4385
|
-
},
|
|
4356
|
+
}, mi = class extends T {
|
|
4386
4357
|
constructor({ color: e = "#ffff00", emissive: t = "#ffd700", emissiveIntensity: n = .25, ...r } = {}) {
|
|
4387
|
-
super(new
|
|
4358
|
+
super(new tr(r), new O({
|
|
4388
4359
|
color: new c(e),
|
|
4389
4360
|
emissive: new c(t),
|
|
4390
4361
|
emissiveIntensity: n,
|
|
@@ -4393,32 +4364,32 @@ var ur = class extends i {
|
|
|
4393
4364
|
flatShading: !0
|
|
4394
4365
|
}));
|
|
4395
4366
|
}
|
|
4396
|
-
},
|
|
4367
|
+
}, hi = class extends T {
|
|
4397
4368
|
constructor() {
|
|
4398
|
-
super(new
|
|
4369
|
+
super(new nr(), new O({ color: 16777215 }));
|
|
4399
4370
|
}
|
|
4400
|
-
},
|
|
4371
|
+
}, gi = class extends T {
|
|
4401
4372
|
trunkHeight;
|
|
4402
4373
|
constructor({ trunkColor: e = "#8b4513", leafColor: t = "#228b22", ...n } = {}) {
|
|
4403
|
-
let r = new
|
|
4404
|
-
super(r, [new
|
|
4374
|
+
let r = new yr(n);
|
|
4375
|
+
super(r, [new O({
|
|
4405
4376
|
color: new c(e),
|
|
4406
4377
|
roughness: .9,
|
|
4407
4378
|
metalness: 0,
|
|
4408
4379
|
flatShading: !0
|
|
4409
|
-
}), new
|
|
4380
|
+
}), new O({
|
|
4410
4381
|
color: new c(t),
|
|
4411
4382
|
roughness: .8,
|
|
4412
4383
|
metalness: 0,
|
|
4413
4384
|
flatShading: !0
|
|
4414
4385
|
})]), this.trunkHeight = r.trunkHeight;
|
|
4415
4386
|
}
|
|
4416
|
-
},
|
|
4387
|
+
}, _i = class extends T {
|
|
4417
4388
|
radius;
|
|
4418
4389
|
height;
|
|
4419
4390
|
constructor({ color: e = "#3a5a3a", flatShading: t = !0, ...n } = {}) {
|
|
4420
|
-
let r = new
|
|
4421
|
-
super(r, new
|
|
4391
|
+
let r = new _r(n);
|
|
4392
|
+
super(r, new O({
|
|
4422
4393
|
color: new c(e),
|
|
4423
4394
|
roughness: 1,
|
|
4424
4395
|
metalness: 0,
|
|
@@ -4426,12 +4397,12 @@ var ur = class extends i {
|
|
|
4426
4397
|
side: p
|
|
4427
4398
|
})), this.radius = r.radius, this.height = r.height, this.castShadow = !0, this.receiveShadow = !0;
|
|
4428
4399
|
}
|
|
4429
|
-
},
|
|
4400
|
+
}, vi = class extends T {
|
|
4430
4401
|
width;
|
|
4431
4402
|
depth;
|
|
4432
4403
|
constructor({ color: e = "#3a5a3a", flatShading: t = !0, ...n } = {}) {
|
|
4433
|
-
let r = new
|
|
4434
|
-
super(r, new
|
|
4404
|
+
let r = new vr(n);
|
|
4405
|
+
super(r, new O({
|
|
4435
4406
|
color: new c(e),
|
|
4436
4407
|
roughness: 1,
|
|
4437
4408
|
metalness: 0,
|
|
@@ -4439,52 +4410,52 @@ var ur = class extends i {
|
|
|
4439
4410
|
side: p
|
|
4440
4411
|
})), this.width = r.width, this.depth = r.depth, this.castShadow = !0, this.receiveShadow = !0;
|
|
4441
4412
|
}
|
|
4442
|
-
},
|
|
4413
|
+
}, yi = (e) => {
|
|
4443
4414
|
let t = new Uint8Array(4 * e * e);
|
|
4444
4415
|
for (let n = 0; n < e * e; n++) {
|
|
4445
4416
|
let r = n * 4, i = (n % e ^ Math.floor(n / e)) & 1 ? 255 : 0;
|
|
4446
4417
|
t[r] = i, t[r + 1] = i, t[r + 2] = i, t[r + 3] = 255;
|
|
4447
4418
|
}
|
|
4448
|
-
let n = new d(t, e, e,
|
|
4449
|
-
return n.wrapS =
|
|
4419
|
+
let n = new d(t, e, e, ne, ce);
|
|
4420
|
+
return n.wrapS = re, n.wrapT = re, n.minFilter = k, n.needsUpdate = !0, n;
|
|
4450
4421
|
};
|
|
4451
4422
|
//#endregion
|
|
4452
4423
|
//#region src/utils/AlignToEdge.ts
|
|
4453
|
-
function
|
|
4424
|
+
function bi(e, n) {
|
|
4454
4425
|
if (e.length === 0) throw Error("No objects provided for alignment.");
|
|
4455
|
-
let r = new t(), i = new
|
|
4426
|
+
let r = new t(), i = new L(), a = e.map((e) => (r.setFromObject(e), e.getWorldPosition(i), {
|
|
4456
4427
|
object: e,
|
|
4457
4428
|
boundingBox: r.clone(),
|
|
4458
4429
|
worldPosition: i.clone()
|
|
4459
4430
|
})), o = a.reduce((e, { boundingBox: t }) => {
|
|
4460
4431
|
switch (n) {
|
|
4461
|
-
case
|
|
4462
|
-
case
|
|
4463
|
-
case
|
|
4464
|
-
case
|
|
4465
|
-
case
|
|
4466
|
-
case
|
|
4432
|
+
case W.LEFT: return Math.min(e, t.min.x);
|
|
4433
|
+
case W.RIGHT: return Math.max(e, t.max.x);
|
|
4434
|
+
case W.BOTTOM: return Math.min(e, t.min.y);
|
|
4435
|
+
case W.TOP: return Math.max(e, t.max.y);
|
|
4436
|
+
case W.BACK: return Math.min(e, t.min.z);
|
|
4437
|
+
case W.FRONT: return Math.max(e, t.max.z);
|
|
4467
4438
|
default: throw Error(`Unsupported side type: ${n}`);
|
|
4468
4439
|
}
|
|
4469
|
-
}, n ===
|
|
4440
|
+
}, n === W.RIGHT || n === W.TOP || n === W.FRONT ? -Infinity : Infinity);
|
|
4470
4441
|
a.forEach(({ object: e, boundingBox: t }) => {
|
|
4471
4442
|
switch (n) {
|
|
4472
|
-
case
|
|
4443
|
+
case W.LEFT:
|
|
4473
4444
|
e.position.x += o - t.min.x;
|
|
4474
4445
|
break;
|
|
4475
|
-
case
|
|
4446
|
+
case W.RIGHT:
|
|
4476
4447
|
e.position.x += o - t.max.x;
|
|
4477
4448
|
break;
|
|
4478
|
-
case
|
|
4449
|
+
case W.BOTTOM:
|
|
4479
4450
|
e.position.y += o - t.min.y;
|
|
4480
4451
|
break;
|
|
4481
|
-
case
|
|
4452
|
+
case W.TOP:
|
|
4482
4453
|
e.position.y += o - t.max.y;
|
|
4483
4454
|
break;
|
|
4484
|
-
case
|
|
4455
|
+
case W.BACK:
|
|
4485
4456
|
e.position.z += o - t.min.z;
|
|
4486
4457
|
break;
|
|
4487
|
-
case
|
|
4458
|
+
case W.FRONT:
|
|
4488
4459
|
e.position.z += o - t.max.z;
|
|
4489
4460
|
break;
|
|
4490
4461
|
}
|
|
@@ -4492,11 +4463,11 @@ function vi(e, n) {
|
|
|
4492
4463
|
}
|
|
4493
4464
|
//#endregion
|
|
4494
4465
|
//#region src/utils/AlignToRow.ts
|
|
4495
|
-
function
|
|
4496
|
-
let i = n.clone().normalize(), a = new
|
|
4466
|
+
function xi(e, n = H.RIGHT, r = 0) {
|
|
4467
|
+
let i = n.clone().normalize(), a = new L(), o = new t();
|
|
4497
4468
|
e.forEach((e) => {
|
|
4498
4469
|
o.setFromObject(e);
|
|
4499
|
-
let t = new
|
|
4470
|
+
let t = new L(o.max.x - o.min.x, o.max.y - o.min.y, o.max.z - o.min.z).dot(i), n = new L();
|
|
4500
4471
|
o.getCenter(n);
|
|
4501
4472
|
let s = i.clone().multiplyScalar(t / 2);
|
|
4502
4473
|
e.position.copy(a.clone().add(s).sub(n).add(e.position)), a.add(i.clone().multiplyScalar(t + r));
|
|
@@ -4504,17 +4475,17 @@ function yi(e, n = V.RIGHT, r = 0) {
|
|
|
4504
4475
|
}
|
|
4505
4476
|
//#endregion
|
|
4506
4477
|
//#region src/utils/AlignToSurface.ts
|
|
4507
|
-
function
|
|
4478
|
+
function Si(e, n, r = new L(0, 0, 0)) {
|
|
4508
4479
|
let i = new t().setFromObject(e);
|
|
4509
4480
|
if (i.isEmpty()) console.warn("The object has no geometry or is not visible.");
|
|
4510
4481
|
else {
|
|
4511
|
-
let t = i.min, a = new
|
|
4482
|
+
let t = i.min, a = new L((t.x + i.max.x) / 2, t.y, (t.z + i.max.z) / 2);
|
|
4512
4483
|
e.localToWorld(a);
|
|
4513
4484
|
let o = n.clone().sub(a).add(r), s = e.worldToLocal(o.clone());
|
|
4514
4485
|
e.position.add(s);
|
|
4515
4486
|
}
|
|
4516
4487
|
}
|
|
4517
|
-
function
|
|
4488
|
+
function Ci(e, n) {
|
|
4518
4489
|
let r = new t().setFromBufferAttribute(new _(e.attributes.position.array, 3));
|
|
4519
4490
|
if (r.isEmpty()) console.warn("The geometry is empty or invalid.");
|
|
4520
4491
|
else {
|
|
@@ -4522,50 +4493,50 @@ function xi(e, n) {
|
|
|
4522
4493
|
e.translate(0, n - t, 0);
|
|
4523
4494
|
}
|
|
4524
4495
|
}
|
|
4525
|
-
function
|
|
4496
|
+
function wi(e, n, r = new L(0, 0, 0)) {
|
|
4526
4497
|
let i = new t().setFromObject(e);
|
|
4527
4498
|
if (i.isEmpty()) console.warn("The InstancedMesh has no geometry or is not visible.");
|
|
4528
4499
|
else {
|
|
4529
|
-
let t = i.min.y, a = new
|
|
4500
|
+
let t = i.min.y, a = new L(0, n.y - t, 0).add(r), o = e.worldToLocal(a.clone());
|
|
4530
4501
|
e.position.add(o);
|
|
4531
4502
|
}
|
|
4532
4503
|
}
|
|
4533
|
-
function
|
|
4504
|
+
function Ti(e, n, r, i = new L(0, 0, 0)) {
|
|
4534
4505
|
let a = new t().setFromObject(e);
|
|
4535
4506
|
if (a.isEmpty()) console.warn("The instanced mesh has invalid geometry.");
|
|
4536
4507
|
else {
|
|
4537
|
-
let t = a.min.y, o = new
|
|
4508
|
+
let t = a.min.y, o = new w();
|
|
4538
4509
|
e.getMatrixAt(r, o);
|
|
4539
|
-
let s = new
|
|
4510
|
+
let s = new L(), c = new N(), l = new L();
|
|
4540
4511
|
o.decompose(s, c, l), s.y = e.worldToLocal(n.clone()).y - t + i.y, o.compose(s, c, l), e.setMatrixAt(r, o), e.instanceMatrix.needsUpdate = !0;
|
|
4541
4512
|
}
|
|
4542
4513
|
}
|
|
4543
4514
|
//#endregion
|
|
4544
4515
|
//#region src/utils/Center.ts
|
|
4545
|
-
function
|
|
4546
|
-
let i = new t().setFromObject(e).getCenter(new
|
|
4516
|
+
function Ei(e, n = new L(0, 0, 0), r = new L(0, 0, 0)) {
|
|
4517
|
+
let i = new t().setFromObject(e).getCenter(new L()), a = new L().addVectors(n, r), o = new L().subVectors(a, i);
|
|
4547
4518
|
e.position.add(o);
|
|
4548
4519
|
}
|
|
4549
|
-
function
|
|
4550
|
-
let i = new t().setFromObject(e).getCenter(new
|
|
4520
|
+
function Di(e, n = new L(0, 0, 0), r = new L(0, 0, 0)) {
|
|
4521
|
+
let i = new t().setFromObject(e).getCenter(new L()), a = new L().addVectors(n, r);
|
|
4551
4522
|
e.translateX(a.x - i.x), e.translateY(a.y - i.y), e.translateZ(a.z - i.z), e.updateMatrixWorld(!0);
|
|
4552
4523
|
}
|
|
4553
|
-
function
|
|
4524
|
+
function Oi(e, t = new L(0, 0, 0), n = new L(0, 0, 0)) {
|
|
4554
4525
|
e.geometry.computeBoundingBox();
|
|
4555
4526
|
let r = e.geometry.boundingBox;
|
|
4556
4527
|
if (r) {
|
|
4557
|
-
let i = r.getCenter(new
|
|
4528
|
+
let i = r.getCenter(new L()), a = new L().addVectors(t, n), o = new L().subVectors(a, i);
|
|
4558
4529
|
e.geometry.translate(o.x, o.y, o.z);
|
|
4559
4530
|
}
|
|
4560
4531
|
}
|
|
4561
|
-
var
|
|
4562
|
-
object:
|
|
4563
|
-
objectGeometry:
|
|
4564
|
-
meshGeometry:
|
|
4532
|
+
var ki = {
|
|
4533
|
+
object: Ei,
|
|
4534
|
+
objectGeometry: Di,
|
|
4535
|
+
meshGeometry: Oi
|
|
4565
4536
|
};
|
|
4566
4537
|
//#endregion
|
|
4567
4538
|
//#region src/utils/ColorUtils.ts
|
|
4568
|
-
function
|
|
4539
|
+
function Ai(e) {
|
|
4569
4540
|
let t = parseInt(e.slice(1), 16);
|
|
4570
4541
|
return [
|
|
4571
4542
|
t >> 16 & 255,
|
|
@@ -4573,9 +4544,9 @@ function Oi(e) {
|
|
|
4573
4544
|
t & 255
|
|
4574
4545
|
];
|
|
4575
4546
|
}
|
|
4576
|
-
function
|
|
4547
|
+
function ji(e) {
|
|
4577
4548
|
let [t, n, r] = $(e);
|
|
4578
|
-
return
|
|
4549
|
+
return Ii(t, n, r);
|
|
4579
4550
|
}
|
|
4580
4551
|
function $(e) {
|
|
4581
4552
|
return [
|
|
@@ -4584,7 +4555,7 @@ function $(e) {
|
|
|
4584
4555
|
e & 255
|
|
4585
4556
|
];
|
|
4586
4557
|
}
|
|
4587
|
-
function
|
|
4558
|
+
function Mi(e, t, n) {
|
|
4588
4559
|
t /= 100, n /= 100;
|
|
4589
4560
|
function r(e, t, n) {
|
|
4590
4561
|
return n < 0 && (n += 1), n > 1 && --n, n < 1 / 6 ? e + (t - e) * 6 * n : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
|
|
@@ -4602,7 +4573,7 @@ function Ai(e, t, n) {
|
|
|
4602
4573
|
s(o)
|
|
4603
4574
|
];
|
|
4604
4575
|
}
|
|
4605
|
-
function
|
|
4576
|
+
function Ni(e, t, n) {
|
|
4606
4577
|
t /= 100, n /= 100;
|
|
4607
4578
|
let r = (t) => (t + e / 30) % 12, i = t * Math.min(n, 1 - n), a = (e) => n - i * Math.max(-1, Math.min(r(e) - 3, Math.min(9 - r(e), 1)));
|
|
4608
4579
|
return [
|
|
@@ -4611,17 +4582,17 @@ function ji(e, t, n) {
|
|
|
4611
4582
|
a(4) * 255
|
|
4612
4583
|
];
|
|
4613
4584
|
}
|
|
4614
|
-
function
|
|
4585
|
+
function Pi(e, t, n) {
|
|
4615
4586
|
return [
|
|
4616
4587
|
e / 255,
|
|
4617
4588
|
t / 255,
|
|
4618
4589
|
n / 255
|
|
4619
4590
|
];
|
|
4620
4591
|
}
|
|
4621
|
-
function
|
|
4592
|
+
function Fi(e, t, n) {
|
|
4622
4593
|
return e = Math.round(e), t = Math.round(t), n = Math.round(n), (e << 16) + (t << 8) + n;
|
|
4623
4594
|
}
|
|
4624
|
-
function
|
|
4595
|
+
function Ii(e, t, n) {
|
|
4625
4596
|
e /= 255, t /= 255, n /= 255;
|
|
4626
4597
|
let r = Math.max(e, t, n), i = Math.min(e, t, n), a = r - i, o = 0, s = 0, c = (r + i) / 2;
|
|
4627
4598
|
a !== 0 && (r === e ? o = ((t - n) / a + (t < n ? 6 : 0)) * 60 : r === t ? o = ((n - e) / a + 2) * 60 : r === n && (o = ((e - t) / a + 4) * 60)), a !== 0 && (s = a / (1 - Math.abs(2 * c - 1))), o = Math.round(o), s = Math.round(s * 100);
|
|
@@ -4632,36 +4603,36 @@ function Pi(e, t, n) {
|
|
|
4632
4603
|
l
|
|
4633
4604
|
];
|
|
4634
4605
|
}
|
|
4635
|
-
function
|
|
4606
|
+
function Li(e, t) {
|
|
4636
4607
|
return Math.sqrt((e[0] - t[0]) ** 2 + (e[1] - t[1]) ** 2 + (e[2] - t[2]) ** 2);
|
|
4637
4608
|
}
|
|
4638
|
-
function
|
|
4609
|
+
function Ri(e, t) {
|
|
4639
4610
|
return Math.abs(e[0] - t[0]) + Math.abs(e[1] - t[1]) + Math.abs(e[2] - t[2]);
|
|
4640
4611
|
}
|
|
4641
|
-
function
|
|
4612
|
+
function zi(e, t) {
|
|
4642
4613
|
let n = $(e), r = null, i = Infinity;
|
|
4643
4614
|
for (let e of t) {
|
|
4644
|
-
let t =
|
|
4615
|
+
let t = Li(n, $(e));
|
|
4645
4616
|
t < i && (i = t, r = e);
|
|
4646
4617
|
}
|
|
4647
4618
|
return r;
|
|
4648
4619
|
}
|
|
4649
|
-
function
|
|
4620
|
+
function Bi(e, t) {
|
|
4650
4621
|
let n = $(e), r = null, i = Infinity;
|
|
4651
4622
|
for (let e of t) {
|
|
4652
|
-
let t =
|
|
4623
|
+
let t = Ri(n, $(e));
|
|
4653
4624
|
t < i && (i = t, r = e);
|
|
4654
4625
|
}
|
|
4655
4626
|
return r;
|
|
4656
4627
|
}
|
|
4657
|
-
function
|
|
4658
|
-
return
|
|
4628
|
+
function Vi(e) {
|
|
4629
|
+
return Ni((e + Math.floor(-30 + Math.random() * 61)) % 360, Math.floor(60 + Math.random() * 21), Math.floor(50 + Math.random() * 21));
|
|
4659
4630
|
}
|
|
4660
4631
|
//#endregion
|
|
4661
4632
|
//#region src/utils/FindClosestPoint.ts
|
|
4662
|
-
function
|
|
4633
|
+
function Hi(e, t) {
|
|
4663
4634
|
if (!t.geometry.isBufferGeometry) throw Error("Mesh must have a BufferGeometry.");
|
|
4664
|
-
let n = t.geometry.getAttribute("position"), r = new
|
|
4635
|
+
let n = t.geometry.getAttribute("position"), r = new L(), i = new L(), a = Infinity;
|
|
4665
4636
|
for (let t = 0; t < n.count; t++) {
|
|
4666
4637
|
i.fromBufferAttribute(n, t);
|
|
4667
4638
|
let o = i.distanceTo(e);
|
|
@@ -4671,81 +4642,81 @@ function Bi(e, t) {
|
|
|
4671
4642
|
}
|
|
4672
4643
|
//#endregion
|
|
4673
4644
|
//#region src/utils/InterpolateCurve.ts
|
|
4674
|
-
function
|
|
4645
|
+
function Ui(e, t, n) {
|
|
4675
4646
|
return Math.max(0, Math.min(1, (e - t) / (n - t)));
|
|
4676
4647
|
}
|
|
4677
|
-
function
|
|
4648
|
+
function Wi(e, t, n, r, i, a = 20, o = 0, s = 1) {
|
|
4678
4649
|
let c = [];
|
|
4679
4650
|
for (let l = 0; l <= a; l++) {
|
|
4680
|
-
let u = l / a, d = t + e(
|
|
4681
|
-
c.push(new
|
|
4651
|
+
let u = l / a, d = t + e(Ui(u, o, s)) * (n - t), f = r + u * (i - r);
|
|
4652
|
+
c.push(new I(d, f));
|
|
4682
4653
|
}
|
|
4683
4654
|
return c;
|
|
4684
4655
|
}
|
|
4685
4656
|
//#endregion
|
|
4686
4657
|
//#region src/utils/ParametricCurveUtils.ts
|
|
4687
|
-
var
|
|
4658
|
+
var Gi = (e, t, n, r, i = 24) => {
|
|
4688
4659
|
let a = [];
|
|
4689
4660
|
for (let o = 0; o <= i; o++) {
|
|
4690
|
-
let s = o / i, c =
|
|
4691
|
-
a.push(new
|
|
4661
|
+
let s = o / i, c = G.cubic(s, e.x, t.x, n.x, r.x), l = G.cubic(s, e.y, t.y, n.y, r.y);
|
|
4662
|
+
a.push(new I(c, l));
|
|
4692
4663
|
}
|
|
4693
4664
|
return a;
|
|
4694
|
-
},
|
|
4665
|
+
}, Ki = (e, t, n, r = 24) => {
|
|
4695
4666
|
let i = [];
|
|
4696
4667
|
for (let a = 0; a <= r; a++) {
|
|
4697
|
-
let o = a / r, s =
|
|
4698
|
-
i.push(new
|
|
4668
|
+
let o = a / r, s = G.damped(o, n) * (t.x - e.x) + e.x, c = e.y + o * (t.y - e.y);
|
|
4669
|
+
i.push(new I(s, c));
|
|
4699
4670
|
}
|
|
4700
4671
|
return i;
|
|
4701
|
-
},
|
|
4672
|
+
}, qi = (e, t, n, r, i = 24) => {
|
|
4702
4673
|
let a = [];
|
|
4703
4674
|
for (let o = 0; o <= i; o++) {
|
|
4704
|
-
let s = o / i, c =
|
|
4705
|
-
a.push(new
|
|
4675
|
+
let s = o / i, c = G.exponential(s, n, r) * (t.x - e.x) + e.x, l = e.y + s * (t.y - e.y);
|
|
4676
|
+
a.push(new I(c, l));
|
|
4706
4677
|
}
|
|
4707
4678
|
return a;
|
|
4708
|
-
},
|
|
4679
|
+
}, Ji = (e, t, n, r, i = 24) => {
|
|
4709
4680
|
let a = [];
|
|
4710
4681
|
for (let o = 0; o <= i; o++) {
|
|
4711
|
-
let s = o / i, c =
|
|
4712
|
-
a.push(new
|
|
4682
|
+
let s = o / i, c = G.logarithmic(s, n, r) * (t.x - e.x) + e.x, l = e.y + s * (t.y - e.y);
|
|
4683
|
+
a.push(new I(c, l));
|
|
4713
4684
|
}
|
|
4714
4685
|
return a;
|
|
4715
|
-
},
|
|
4686
|
+
}, Yi = (e, t, n, r, i, a = 24) => {
|
|
4716
4687
|
let o = [];
|
|
4717
4688
|
for (let s = 0; s <= a; s++) {
|
|
4718
4689
|
let c = s / a, l = n * c * c + r * c + i + e.x, u = e.y + c * (t.y - e.y);
|
|
4719
|
-
o.push(new
|
|
4690
|
+
o.push(new I(l, u));
|
|
4720
4691
|
}
|
|
4721
4692
|
return o;
|
|
4722
|
-
},
|
|
4693
|
+
}, Xi = (e, t, n, r = 24) => {
|
|
4723
4694
|
let i = [];
|
|
4724
4695
|
for (let a = 0; a <= r; a++) {
|
|
4725
|
-
let o = a / r, s =
|
|
4726
|
-
i.push(new
|
|
4696
|
+
let o = a / r, s = G.quadratic(o, e.x, t.x, n.x), c = G.quadratic(o, e.y, t.y, n.y);
|
|
4697
|
+
i.push(new I(s, c));
|
|
4727
4698
|
}
|
|
4728
4699
|
return i;
|
|
4729
|
-
},
|
|
4700
|
+
}, Zi = (e, t, n, r = 24) => {
|
|
4730
4701
|
let i = [];
|
|
4731
4702
|
for (let a = 0; a <= r; a++) {
|
|
4732
|
-
let o = a / r, s =
|
|
4733
|
-
i.push(new
|
|
4703
|
+
let o = a / r, s = G.sigmoid(o, n) * (t.x - e.x) + e.x, c = e.y + o * (t.y - e.y);
|
|
4704
|
+
i.push(new I(s, c));
|
|
4734
4705
|
}
|
|
4735
4706
|
return i;
|
|
4736
|
-
},
|
|
4737
|
-
createCubicCurvePoints:
|
|
4738
|
-
createDampedCurvePoints:
|
|
4739
|
-
createExponentialCurvePoints:
|
|
4740
|
-
createLogarithmicCurvePoints:
|
|
4741
|
-
createParabolicCurvePoints:
|
|
4742
|
-
createQuadraticCurvePoints:
|
|
4743
|
-
createSigmoidCurvePoints:
|
|
4707
|
+
}, Qi = {
|
|
4708
|
+
createCubicCurvePoints: Gi,
|
|
4709
|
+
createDampedCurvePoints: Ki,
|
|
4710
|
+
createExponentialCurvePoints: qi,
|
|
4711
|
+
createLogarithmicCurvePoints: Ji,
|
|
4712
|
+
createParabolicCurvePoints: Yi,
|
|
4713
|
+
createQuadraticCurvePoints: Xi,
|
|
4714
|
+
createSigmoidCurvePoints: Zi
|
|
4744
4715
|
};
|
|
4745
4716
|
//#endregion
|
|
4746
4717
|
//#region src/utils/QuadUtils.ts
|
|
4747
|
-
function
|
|
4748
|
-
let l = i ||
|
|
4718
|
+
function $i(e, t, n, r, i, a = [0, 0], o = [1, 0], s = [0, 1], c = [1, 1]) {
|
|
4719
|
+
let l = i || ea(e, t, n);
|
|
4749
4720
|
return [
|
|
4750
4721
|
{
|
|
4751
4722
|
pos: e,
|
|
@@ -4779,7 +4750,7 @@ function Zi(e, t, n, r, i, a = [0, 0], o = [1, 0], s = [0, 1], c = [1, 1]) {
|
|
|
4779
4750
|
}
|
|
4780
4751
|
];
|
|
4781
4752
|
}
|
|
4782
|
-
function
|
|
4753
|
+
function ea(e, t, n) {
|
|
4783
4754
|
let r = [
|
|
4784
4755
|
t[0] - e[0],
|
|
4785
4756
|
t[1] - e[1],
|
|
@@ -4797,11 +4768,11 @@ function Qi(e, t, n) {
|
|
|
4797
4768
|
}
|
|
4798
4769
|
//#endregion
|
|
4799
4770
|
//#region src/utils/RandomTimer.ts
|
|
4800
|
-
function
|
|
4771
|
+
function ta(e, t, n) {
|
|
4801
4772
|
let r = t + Math.random() * (n - t);
|
|
4802
4773
|
return setTimeout(e, r);
|
|
4803
4774
|
}
|
|
4804
|
-
function
|
|
4775
|
+
function na(e, t, n) {
|
|
4805
4776
|
let r;
|
|
4806
4777
|
function i() {
|
|
4807
4778
|
let a = t + Math.random() * (n - t);
|
|
@@ -4813,7 +4784,7 @@ function ea(e, t, n) {
|
|
|
4813
4784
|
}
|
|
4814
4785
|
//#endregion
|
|
4815
4786
|
//#region src/utils/UVUtils.ts
|
|
4816
|
-
function
|
|
4787
|
+
function ra(e, t) {
|
|
4817
4788
|
return e.map(([e, n, r]) => {
|
|
4818
4789
|
switch (t) {
|
|
4819
4790
|
case "x": return [n, r];
|
|
@@ -4823,36 +4794,36 @@ function ta(e, t) {
|
|
|
4823
4794
|
}
|
|
4824
4795
|
});
|
|
4825
4796
|
}
|
|
4826
|
-
function
|
|
4797
|
+
function ia(e) {
|
|
4827
4798
|
let [t, n, r] = e, i = Math.abs(t), a = Math.abs(n), o = Math.abs(r);
|
|
4828
4799
|
return i >= a && i >= o ? [r > 0 ? r : -r, n] : a >= i && a >= o ? [t, r > 0 ? r : -r] : [t, n];
|
|
4829
4800
|
}
|
|
4830
|
-
function
|
|
4831
|
-
return e.map((e) =>
|
|
4801
|
+
function aa(e) {
|
|
4802
|
+
return e.map((e) => ia(e));
|
|
4832
4803
|
}
|
|
4833
|
-
function
|
|
4804
|
+
function oa(e) {
|
|
4834
4805
|
return e.map(([e, t, n]) => {
|
|
4835
4806
|
let r = Math.atan2(n, e), i = Math.acos(t / Math.sqrt(e ** 2 + t ** 2 + n ** 2));
|
|
4836
4807
|
return [r / (2 * Math.PI) + .5, 1 - i / Math.PI];
|
|
4837
4808
|
});
|
|
4838
4809
|
}
|
|
4839
|
-
function
|
|
4810
|
+
function sa(e) {
|
|
4840
4811
|
return e.map(([e, t, n]) => [Math.atan2(n, e) / (2 * Math.PI) + .5, t]);
|
|
4841
4812
|
}
|
|
4842
|
-
function
|
|
4813
|
+
function ca(e) {
|
|
4843
4814
|
return e.map(([e, t, n]) => {
|
|
4844
4815
|
let r = Math.sqrt(e ** 2 + n ** 2);
|
|
4845
4816
|
return [Math.atan2(n, e) / (2 * Math.PI) + .5, r];
|
|
4846
4817
|
});
|
|
4847
4818
|
}
|
|
4848
|
-
function
|
|
4819
|
+
function la(e, t, n, r, i) {
|
|
4849
4820
|
return [(e[0] - t) / (n - t), (e[1] - r) / (i - r)];
|
|
4850
4821
|
}
|
|
4851
|
-
function
|
|
4822
|
+
function ua(e, t, n) {
|
|
4852
4823
|
let [r, i] = t, [a, o] = n;
|
|
4853
|
-
return e.map((e) =>
|
|
4824
|
+
return e.map((e) => la(e, r, a, i, o));
|
|
4854
4825
|
}
|
|
4855
|
-
function
|
|
4826
|
+
function da(e) {
|
|
4856
4827
|
let t = Math.min(...e.map((e) => e[0])), n = Math.max(...e.map((e) => e[0])), r = Math.min(...e.map((e) => e[1])), i = Math.max(...e.map((e) => e[1]));
|
|
4857
4828
|
return {
|
|
4858
4829
|
minBounds: [t, r],
|
|
@@ -4860,6 +4831,6 @@ function la(e) {
|
|
|
4860
4831
|
};
|
|
4861
4832
|
}
|
|
4862
4833
|
//#endregion
|
|
4863
|
-
export {
|
|
4834
|
+
export { wr as ArchedDiamondLatticeWindow, cn as ArchedDiamondLatticeWindowGeometry, Ae as Axis, hi as Bone, nr as BoneGeometry, Dr as Book, ht as BookGeometry, zr as Bookshelf, zn as BookshelfGeometry, qr as Boulder, Ot as BoulderGeometry, W as BoxSide, Xr as BunsenBurner, ui as Burst, ct as BurstGeometry, st as BurstShape, ge as CameraPlayback, Hr as Candle, Un as CandleGeometry, ki as Center, je as ColorPalette, jr as CrossHeadstone, jn as CrossHeadstoneGeometry, Br as Desk, Bn as DeskGeometry, Tr as DiamondLatticeWindow, ln as DiamondLatticeWindowGeometry, H as Direction, Ue as DustMotesEffect, B as Easing, We as EffervescenceEffect, Zr as ElectricPanel, rt as EllipticLeafGeometry, Ge as EmissivePulseEffect, Qr as ErlenmeyerFlask, rr as ErlenmeyerFlaskGeometry, U as Falloff, Ur as Flame, Ke as FlameFlickerEffect, Hn as FlameGeometry, $r as FlorenceFlask, fr as FlorenceFlaskGeometry, di as Gear, Zn as GearGeometry, Xn as GearShape, Je as GlowHalo, Er as GregorianLatticeWindow, fn as GregorianLatticeWindowGeometry, Ye as GroundFogEffect, Wr as HangingLantern, qn as HangingLanternGeometry, fi as Heart, $n as HeartGeometry, Qn as HeartShape, pi as Hexagon, jt as HexagonGeometry, At as HexagonShape, Or as Jar, Tn as JarGeometry, br as LShapedStaircase, Sn as LShapedStaircaseGeometry, Kr as Lantern, Wn as LanternGeometry, Vr as Leaf, Vn as LeafGeometry, ei as LeverPanel, nt as LightningEffect, On as LineEquations, Mr as Mausoleum, Mn as MausoleumGeometry, ti as Microscope, ni as MortarAndPestle, pr as MortarGeometry, Jr as MossyRock, Pt as MossyRockGeometry, Nr as ObeliskHeadstone, Nn as ObeliskHeadstoneGeometry, ri as Panel, ii as PanelLight, Yn as ParallelogramBoxGeometry, G as ParametricCurve, Qi as ParametricCurveUtils, it as PetalDriftEffect, kr as PotionBottle, kn as PotionBottleGeometry, ot as RainEffect, Re as Random, Yr as Rock, It as RockGeometry, Pr as RoundedHeadstone, Pn as RoundedHeadstoneGeometry, xr as SpiralStaircase, Cn as SpiralStaircaseGeometry, ai as SpiralTube, Fr as SquareHeadstone, Fn as SquareHeadstoneGeometry, Sr as Staircase, wn as StaircaseGeometry, oi as Stand, mr as StandGeometry, mi as Star, pt as StarFieldEffect, tr as StarGeometry, er as StarShape, Ir as StoneFencePost, In as StoneFencePostGeometry, _i as TerrainMound, _r as TerrainMoundGeometry, vi as TerrainPlane, vr as TerrainPlaneGeometry, si as TeslaCoil, hr as TeslaCoilGeometry, ci as TestTube, gr as TestTubeGeometry, li as TestTubeRack, gi as Tree, yr as TreeGeometry, Gr as WallSconce, Jn as WallSconceGeometry, Ar as WineBottle, An as WineBottleGeometry, mt as WispEffect, Lr as WroughtIronBar, Ln as WroughtIronBarGeometry, Rr as WroughtIronFence, Rn as WroughtIronFenceGeometry, Ci as alignBufferGeometryToSurface, Ti as alignInstancedMeshIndexToSurface, wi as alignInstancedMeshToSurface, Si as alignObjectToSurface, bi as alignToEdge, xi as alignToRow, dr as appendSphericalCurve, he as applySnapshot, X as archedOpeningMetrics, an as buildArchedDiamondLatticeCameParts, Zt as buildArchedDiamondLatticeFrameGeometry, on as buildArchedDiamondLatticeParts, Gt as buildDiamondLatticeCameParts, Wt as buildDiamondLatticeParts, dn as buildGregorianLatticeParts, Ri as calculateChannelDifference, Li as calculateDistance, ea as calculateNormal, da as calculateUVBounds, En as calculateXFromSlopeIntercept, Dn as calculateYFromSlopeIntercept, or as capHeightFromRadius, sr as capWidthFromRadius, me as captureSnapshot, ur as cartesianToSpherical, Oi as centerMeshGeometry, Ei as centerObject, Di as centerObjectGeometry, yi as checkerboardTexture, qt as clipSegmentToAabb, tn as clipSegmentToArchedOpening, Gi as createCubicCurvePoints, Ki as createDampedCurvePoints, be as createDollyClip, qi as createExponentialCurvePoints, ye as createFlythroughClip, Mt as createHexagonalTilesByCount, Nt as createHexagonalTilesByRadius, Ji as createLogarithmicCurvePoints, _e as createOrbitClip, Yi as createParabolicCurvePoints, ve as createPendulumClip, $i as createQuad, Xi as createQuadraticCurvePoints, K as createRandom, Zi as createSigmoidCurvePoints, xe as createSpiralClip, Ce as createWobbleClip, Se as createZoomClip, ia as cubicUVMapping, aa as cubicUVMappingBatch, sa as cylindricalUVMapping, Pe as deriveSubSeed, Ut as diamondLatticeCellFromCount, Bt as diamondLatticeCornerSpan, Vt as diamondLatticeGridFromCells, Qt as diamondLatticeSpringPhaseShift, we as displacementBrush, zi as findClosestColor, Bi as findClosestColorChannelWise, Hi as findClosestPoint, Ht as fitDiamondLatticeCell, Te as flattenBrush, Vi as getAnalogousColors, un as gregorianLatticeGridFromCells, ji as hexToHsl, $ as hexToRgb, Mi as hslToHex, Ni as hslToRgb, Yt as insetArchedOpeningMetrics, Wi as interpolateCurve, Ve as logarithmicRandomMax, He as logarithmicRandomMin, Me as mulberry32, Ee as noiseBrush, Pi as normalizeRgb, la as normalizeUV, ua as normalizeUVBatch, Ai as parseHexCode, ra as planarUVMapping, ca as polarUVMapping, ir as radiusFromCapHeight, ar as radiusFromCapWidth, q as randomFloat, Be as randomInteger, Le as randomPick, Ie as randomRange, Ft as randomTransformVertices, Fi as rgbToHex, Ii as rgbToHsl, bt as rowOfBooksByCount, xt as rowOfBooksByLength, yt as rowOfBooksByScales, kt as scatterBoulders, zt as scatterMossyRocks, Rt as scatterRocks, na as setRandomInterval, ta as setRandomTimeout, De as smoothBrush, lr as sphericalToCartesian, oa as sphericalUVMapping, Oe as spikeBrush, Ne as splitmix32, St as stackOfBooks, cr as thetaLengthForRadius, Jt as traceArchedOpeningOutline, ke as twistBrush };
|
|
4864
4835
|
|
|
4865
4836
|
//# sourceMappingURL=index.mjs.map
|