three-low-poly 0.9.27 → 0.9.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -14
- package/dist/index.cjs +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +311 -77
- package/dist/index.iife.js +8 -8
- package/dist/index.iife.js.map +1 -1
- package/dist/index.mjs +1085 -886
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as e from "three";
|
|
2
|
-
import { AdditiveBlending as t, AlwaysStencilFunc as n, BackSide as r, Box3 as i, BoxGeometry as a, BufferAttribute as o, BufferGeometry as s, CanvasTexture as c, CatmullRomCurve3 as l, CircleGeometry as u, Color as d, ConeGeometry as f, CylinderGeometry as p, DataTexture as m, DodecahedronGeometry as h, DoubleSide as g, DynamicDrawUsage as _, EqualStencilFunc as v, Euler as y, ExtrudeGeometry as b, Float32BufferAttribute as x, Group as S,
|
|
3
|
-
import { mergeGeometries as
|
|
2
|
+
import { AdditiveBlending as t, AlwaysStencilFunc as n, BackSide as r, Box3 as i, BoxGeometry as a, BufferAttribute as o, BufferGeometry as s, CanvasTexture as c, CatmullRomCurve3 as l, CircleGeometry as u, Color as d, ConeGeometry as f, CylinderGeometry as p, DataTexture as m, DodecahedronGeometry as h, DoubleSide as g, DynamicDrawUsage as _, EqualStencilFunc as v, Euler as y, ExtrudeGeometry as b, Float32BufferAttribute as x, Group as S, IcosahedronGeometry as C, InstancedMesh as w, KeepStencilOp as T, LatheGeometry as E, MathUtils as D, Matrix4 as O, Mesh as k, MeshBasicMaterial as A, MeshPhysicalMaterial as j, MeshStandardMaterial as M, NearestFilter as ee, Object3D as N, OctahedronGeometry as te, Path as ne, Plane as re, PlaneGeometry as P, PointLight as ie, Points as ae, PointsMaterial as oe, Quaternion as F, RGBAFormat as se, RepeatWrapping as ce, ReplaceStencilOp as le, SRGBColorSpace as ue, ShaderMaterial as de, Shape as I, ShapeGeometry as fe, SphereGeometry as L, TorusGeometry as pe, TubeGeometry as me, UnsignedByteType as he, Vector2 as R, Vector3 as z } from "three";
|
|
3
|
+
import { mergeGeometries as B, mergeVertices as ge } from "three/addons/utils/BufferGeometryUtils.js";
|
|
4
4
|
import { ParametricGeometry as _e } from "three/addons/geometries/ParametricGeometry.js";
|
|
5
5
|
//#region src/animators/cameraClip.ts
|
|
6
6
|
function ve(e, t) {
|
|
7
|
-
let n = t?.target.clone() ?? new
|
|
7
|
+
let n = t?.target.clone() ?? new z();
|
|
8
8
|
if (!t) {
|
|
9
|
-
let t = new
|
|
9
|
+
let t = new z();
|
|
10
10
|
e.getWorldDirection(t), n.copy(e.position).add(t);
|
|
11
11
|
}
|
|
12
12
|
return {
|
|
@@ -19,7 +19,7 @@ function ve(e, t) {
|
|
|
19
19
|
function ye(e, t, n) {
|
|
20
20
|
e.position.copy(n.position), e.quaternion.copy(n.quaternion), e.fov = n.fov, e.updateProjectionMatrix(), t && (t.target.copy(n.target), t.update());
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function V(e, t) {
|
|
23
23
|
return t(Math.min(1, e.elapsed / e.duration));
|
|
24
24
|
}
|
|
25
25
|
//#endregion
|
|
@@ -29,7 +29,7 @@ var be = class {
|
|
|
29
29
|
controls;
|
|
30
30
|
active = null;
|
|
31
31
|
elapsed = 0;
|
|
32
|
-
focus = new
|
|
32
|
+
focus = new z();
|
|
33
33
|
rest;
|
|
34
34
|
constructor(e, t) {
|
|
35
35
|
this.camera = e, this.controls = t;
|
|
@@ -77,7 +77,7 @@ var be = class {
|
|
|
77
77
|
focus: this.focus
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
|
-
},
|
|
80
|
+
}, H = {
|
|
81
81
|
sineIn: (e) => 1 - Math.cos(e * Math.PI / 2),
|
|
82
82
|
sineOut: (e) => Math.sin(e * Math.PI / 2),
|
|
83
83
|
sineInOut: (e) => -.5 * (Math.cos(Math.PI * e) - 1),
|
|
@@ -107,18 +107,18 @@ var be = class {
|
|
|
107
107
|
squareRoot: (e) => Math.sqrt(e),
|
|
108
108
|
inverse: (e) => 1 - e,
|
|
109
109
|
gaussian: (e) => Math.exp(-((e - .5) ** 2) / (2 * .5))
|
|
110
|
-
},
|
|
111
|
-
new
|
|
110
|
+
}, U = new z();
|
|
111
|
+
new z();
|
|
112
112
|
function xe(e) {
|
|
113
|
-
let { target: t, duration: n, ease: r =
|
|
113
|
+
let { target: t, duration: n, ease: r = H.smoothstep, revolutions: i = 1 } = e, a = { value: 0 }, o = { value: e.radius ?? 10 }, s = { value: e.elevation ?? .4 };
|
|
114
114
|
return {
|
|
115
115
|
label: "Orbit",
|
|
116
116
|
duration: n,
|
|
117
117
|
start(n) {
|
|
118
|
-
n.focus.copy(t),
|
|
118
|
+
n.focus.copy(t), U.subVectors(n.camera.position, t), o.value = e.radius ?? U.length(), s.value = e.elevation ?? Math.asin(D.clamp(U.y / o.value, -1, 1)), a.value = Math.atan2(U.z, U.x);
|
|
119
119
|
},
|
|
120
120
|
update(e) {
|
|
121
|
-
let n =
|
|
121
|
+
let n = V(e, r);
|
|
122
122
|
if (n >= 1) return "complete";
|
|
123
123
|
let c = a.value + n * Math.PI * 2 * i, l = o.value * Math.cos(s.value);
|
|
124
124
|
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";
|
|
@@ -126,15 +126,15 @@ function xe(e) {
|
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
128
|
function Se(e) {
|
|
129
|
-
let { target: t, duration: n, azimuthAmplitude: r = .14, oscillations: i = 2, ease: a =
|
|
129
|
+
let { target: t, duration: n, azimuthAmplitude: r = .14, oscillations: i = 2, ease: a = H.linear } = e, o = { value: 0 }, s = { value: e.distance ?? 8 }, c = { value: .35 };
|
|
130
130
|
return {
|
|
131
131
|
label: "Pendulum",
|
|
132
132
|
duration: n,
|
|
133
133
|
start(n) {
|
|
134
|
-
n.focus.copy(t),
|
|
134
|
+
n.focus.copy(t), U.subVectors(n.camera.position, t), s.value = e.distance ?? U.length(), c.value = Math.asin(D.clamp(U.y / s.value, -1, 1)), o.value = Math.atan2(U.z, U.x);
|
|
135
135
|
},
|
|
136
136
|
update(e) {
|
|
137
|
-
let n =
|
|
137
|
+
let n = V(e, a);
|
|
138
138
|
if (n >= 1) return "complete";
|
|
139
139
|
let l = Math.sin(n * Math.PI * 2 * i) * r, u = o.value + l, d = s.value * Math.cos(c.value);
|
|
140
140
|
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";
|
|
@@ -142,7 +142,7 @@ function Se(e) {
|
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
144
|
function Ce(e) {
|
|
145
|
-
let { waypoints: t, duration: n, ease: r =
|
|
145
|
+
let { waypoints: t, duration: n, ease: r = H.cubicInOut } = e;
|
|
146
146
|
if (t.length < 2) throw Error("Flythrough clip requires at least two waypoints");
|
|
147
147
|
let i = e.lookAt ?? t.slice(1).concat(t[t.length - 1]), a = t.length - 1;
|
|
148
148
|
return {
|
|
@@ -152,7 +152,7 @@ function Ce(e) {
|
|
|
152
152
|
e.focus.copy(i[0] ?? t[0]), e.camera.position.copy(t[0]), e.camera.lookAt(e.focus);
|
|
153
153
|
},
|
|
154
154
|
update(e) {
|
|
155
|
-
let n =
|
|
155
|
+
let n = V(e, H.linear);
|
|
156
156
|
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";
|
|
157
157
|
let o = n * a, s = Math.min(a - 1, Math.floor(o)), c = r(o - s);
|
|
158
158
|
e.camera.position.lerpVectors(t[s], t[s + 1], c);
|
|
@@ -162,7 +162,7 @@ function Ce(e) {
|
|
|
162
162
|
};
|
|
163
163
|
}
|
|
164
164
|
function we(e) {
|
|
165
|
-
let { distance: t, duration: n, ease: r =
|
|
165
|
+
let { distance: t, duration: n, ease: r = H.cubicInOut } = e, i = new z(), a = new z(), o = new z();
|
|
166
166
|
return {
|
|
167
167
|
label: "Dolly",
|
|
168
168
|
duration: n,
|
|
@@ -170,29 +170,29 @@ function we(e) {
|
|
|
170
170
|
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);
|
|
171
171
|
},
|
|
172
172
|
update(e) {
|
|
173
|
-
let t =
|
|
173
|
+
let t = V(e, r);
|
|
174
174
|
return t >= 1 ? (e.camera.position.copy(a), "complete") : (e.camera.position.lerpVectors(i, a, t), e.camera.lookAt(e.focus), "running");
|
|
175
175
|
}
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
178
|
function Te(e) {
|
|
179
|
-
let { target: t, radius: n, endRadius: r = n, height: i, revolutions: a, duration: o, ease: s =
|
|
179
|
+
let { target: t, radius: n, endRadius: r = n, height: i, revolutions: a, duration: o, ease: s = H.smoothstep } = e, c = { value: 0 }, l = { value: 0 };
|
|
180
180
|
return {
|
|
181
181
|
label: "Spiral",
|
|
182
182
|
duration: o,
|
|
183
183
|
start(e) {
|
|
184
|
-
e.focus.copy(t), c.value = e.camera.position.y,
|
|
184
|
+
e.focus.copy(t), c.value = e.camera.position.y, U.subVectors(e.camera.position, t), l.value = Math.atan2(U.z, U.x);
|
|
185
185
|
},
|
|
186
186
|
update(e) {
|
|
187
|
-
let o =
|
|
187
|
+
let o = V(e, s);
|
|
188
188
|
if (o >= 1) return "complete";
|
|
189
|
-
let u = l.value + o * Math.PI * 2 * a, d =
|
|
189
|
+
let u = l.value + o * Math.PI * 2 * a, d = D.lerp(n, r, o);
|
|
190
190
|
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";
|
|
191
191
|
}
|
|
192
192
|
};
|
|
193
193
|
}
|
|
194
194
|
function Ee(e) {
|
|
195
|
-
let { target: t, endFov: n, duration: r, ease: i =
|
|
195
|
+
let { target: t, endFov: n, duration: r, ease: i = H.cubicInOut } = e, a = { value: 75 };
|
|
196
196
|
return {
|
|
197
197
|
label: "Zoom",
|
|
198
198
|
duration: r,
|
|
@@ -200,8 +200,8 @@ function Ee(e) {
|
|
|
200
200
|
e.focus.copy(t), a.value = e.camera.fov;
|
|
201
201
|
},
|
|
202
202
|
update(e) {
|
|
203
|
-
let t =
|
|
204
|
-
return e.camera.fov =
|
|
203
|
+
let t = V(e, i);
|
|
204
|
+
return e.camera.fov = D.lerp(a.value, n, Math.min(1, t)), e.camera.updateProjectionMatrix(), e.camera.lookAt(e.focus), t >= 1 ? "complete" : "running";
|
|
205
205
|
},
|
|
206
206
|
cancel(e) {
|
|
207
207
|
e.camera.fov = a.value, e.camera.updateProjectionMatrix();
|
|
@@ -209,7 +209,7 @@ function Ee(e) {
|
|
|
209
209
|
};
|
|
210
210
|
}
|
|
211
211
|
function De(e) {
|
|
212
|
-
let { intensity: t, duration: n, ease: r =
|
|
212
|
+
let { intensity: t, duration: n, ease: r = H.linear } = e, i = new z(), a = { value: 0 };
|
|
213
213
|
return {
|
|
214
214
|
label: "Wobble",
|
|
215
215
|
duration: n,
|
|
@@ -217,7 +217,7 @@ function De(e) {
|
|
|
217
217
|
i.copy(e.camera.position), a.value = e.camera.position.x * 17.3 + e.camera.position.z * 9.1;
|
|
218
218
|
},
|
|
219
219
|
update(e) {
|
|
220
|
-
let n =
|
|
220
|
+
let n = V(e, r);
|
|
221
221
|
if (n >= 1) return e.camera.position.copy(i), "complete";
|
|
222
222
|
let o = 1 - n, s = e.elapsed * 28 + a.value;
|
|
223
223
|
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";
|
|
@@ -229,14 +229,14 @@ function De(e) {
|
|
|
229
229
|
}
|
|
230
230
|
//#endregion
|
|
231
231
|
//#region src/constants/Direction.ts
|
|
232
|
-
var
|
|
233
|
-
UP: new
|
|
234
|
-
DOWN: new
|
|
235
|
-
LEFT: new
|
|
236
|
-
RIGHT: new
|
|
237
|
-
FORWARD: new
|
|
238
|
-
BACKWARD: new
|
|
239
|
-
},
|
|
232
|
+
var W = {
|
|
233
|
+
UP: new z(0, 1, 0),
|
|
234
|
+
DOWN: new z(0, -1, 0),
|
|
235
|
+
LEFT: new z(-1, 0, 0),
|
|
236
|
+
RIGHT: new z(1, 0, 0),
|
|
237
|
+
FORWARD: new z(0, 0, 1),
|
|
238
|
+
BACKWARD: new z(0, 0, -1)
|
|
239
|
+
}, G = {
|
|
240
240
|
linear: (e, t) => 1 - e / t,
|
|
241
241
|
quadratic: (e, t) => (1 - e / t) ** 2,
|
|
242
242
|
squareRoot: (e, t) => (1 - e / t) ** .5,
|
|
@@ -250,10 +250,10 @@ var U = {
|
|
|
250
250
|
let n = Math.max(0, Math.min(1, 1 - e / t));
|
|
251
251
|
return n * n * (3 - 2 * n);
|
|
252
252
|
}
|
|
253
|
-
}, Oe = (e, t, n, r, i =
|
|
253
|
+
}, Oe = (e, t, n, r, i = W.UP, a = G.linear) => {
|
|
254
254
|
let o = e.attributes.position;
|
|
255
255
|
for (let e = 0; e < o.count; e++) {
|
|
256
|
-
let s = new
|
|
256
|
+
let s = new z();
|
|
257
257
|
s.fromBufferAttribute(o, e);
|
|
258
258
|
let c = s.distanceTo(t);
|
|
259
259
|
if (c < n) {
|
|
@@ -262,10 +262,10 @@ var U = {
|
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
o.needsUpdate = !0;
|
|
265
|
-
}, ke = (e, t, n, r, i, a =
|
|
265
|
+
}, ke = (e, t, n, r, i, a = W.UP, o = G.linear) => {
|
|
266
266
|
let s = e.attributes.position;
|
|
267
267
|
for (let e = 0; e < s.count; e++) {
|
|
268
|
-
let c = new
|
|
268
|
+
let c = new z();
|
|
269
269
|
c.fromBufferAttribute(s, e);
|
|
270
270
|
let l = c.distanceTo(t);
|
|
271
271
|
if (l < n) {
|
|
@@ -274,33 +274,33 @@ var U = {
|
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
s.needsUpdate = !0;
|
|
277
|
-
}, Ae = (e, t, n, r, i =
|
|
277
|
+
}, Ae = (e, t, n, r, i = W.UP, a = G.linear) => {
|
|
278
278
|
let o = e.attributes.position;
|
|
279
279
|
for (let e = 0; e < o.count; e++) {
|
|
280
|
-
let s = new
|
|
280
|
+
let s = new z();
|
|
281
281
|
s.fromBufferAttribute(o, e);
|
|
282
282
|
let c = s.distanceTo(t);
|
|
283
283
|
if (c < n) {
|
|
284
284
|
let t = r * a(c, n), l = i.clone().normalize();
|
|
285
|
-
s.x +=
|
|
285
|
+
s.x += D.randFloatSpread(t) * l.x, s.y += D.randFloatSpread(t) * l.y, s.z += D.randFloatSpread(t) * l.z, o.setXYZ(e, s.x, s.y, s.z);
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
o.needsUpdate = !0;
|
|
289
289
|
}, je = (e, t, n, r) => {
|
|
290
|
-
let i = e.attributes.position, a = new
|
|
290
|
+
let i = e.attributes.position, a = new z();
|
|
291
291
|
for (let e = 0; e < i.count; e++) {
|
|
292
|
-
let o = new
|
|
292
|
+
let o = new z();
|
|
293
293
|
if (o.fromBufferAttribute(i, e), o.distanceTo(t) < n) {
|
|
294
|
-
let t = new
|
|
294
|
+
let t = new z(), s = 0;
|
|
295
295
|
for (let e = 0; e < i.count; e++) a.fromBufferAttribute(i, e), a.distanceTo(o) < n && (t.add(a), s++);
|
|
296
296
|
s > 0 && (t.divideScalar(s), o.lerp(t, r), i.setXYZ(e, o.x, o.y, o.z));
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
i.needsUpdate = !0;
|
|
300
|
-
}, Me = (e, t, n, r, i = !1, a =
|
|
300
|
+
}, Me = (e, t, n, r, i = !1, a = G.linear) => {
|
|
301
301
|
let o = e.attributes.position;
|
|
302
302
|
for (let e = 0; e < o.count; e++) {
|
|
303
|
-
let s = new
|
|
303
|
+
let s = new z();
|
|
304
304
|
s.fromBufferAttribute(o, e);
|
|
305
305
|
let c = s.distanceTo(t);
|
|
306
306
|
if (c < n) {
|
|
@@ -309,10 +309,10 @@ var U = {
|
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
311
|
o.needsUpdate = !0;
|
|
312
|
-
}, Ne = (e, t, n, r, i =
|
|
313
|
-
let o = e.attributes.position, s = new
|
|
312
|
+
}, Ne = (e, t, n, r, i = W.UP, a = G.linear) => {
|
|
313
|
+
let o = e.attributes.position, s = new F();
|
|
314
314
|
for (let e = 0; e < o.count; e++) {
|
|
315
|
-
let c = new
|
|
315
|
+
let c = new z();
|
|
316
316
|
c.fromBufferAttribute(o, e);
|
|
317
317
|
let l = c.distanceTo(t);
|
|
318
318
|
if (l < n) {
|
|
@@ -322,14 +322,14 @@ var U = {
|
|
|
322
322
|
}
|
|
323
323
|
o.needsUpdate = !0;
|
|
324
324
|
}, Pe = {
|
|
325
|
-
X: new
|
|
326
|
-
Y: new
|
|
327
|
-
Z: new
|
|
328
|
-
XY: new
|
|
329
|
-
XZ: new
|
|
330
|
-
YZ: new
|
|
331
|
-
XYZ: new
|
|
332
|
-
},
|
|
325
|
+
X: new z(1, 0, 0),
|
|
326
|
+
Y: new z(0, 1, 0),
|
|
327
|
+
Z: new z(0, 0, 1),
|
|
328
|
+
XY: new z(1, 1, 0).normalize(),
|
|
329
|
+
XZ: new z(1, 0, 1).normalize(),
|
|
330
|
+
YZ: new z(0, 1, 1).normalize(),
|
|
331
|
+
XYZ: new z(1, 1, 1).normalize()
|
|
332
|
+
}, K = /* @__PURE__ */ function(e) {
|
|
333
333
|
return e.LEFT = "left", e.RIGHT = "right", e.TOP = "top", e.BOTTOM = "bottom", e.FRONT = "front", e.BACK = "back", e;
|
|
334
334
|
}({}), Fe = {
|
|
335
335
|
CADMIUM_RED: 15073318,
|
|
@@ -401,7 +401,7 @@ var U = {
|
|
|
401
401
|
PALE_GRAY: 15658734,
|
|
402
402
|
WHITE_SMOKE: 16119285,
|
|
403
403
|
TITANIUM_WHITE: 16777215
|
|
404
|
-
},
|
|
404
|
+
}, q = {
|
|
405
405
|
cubic: (e, t, n, r, i) => {
|
|
406
406
|
let a = Math.max(0, Math.min(1, e)), o = 1 - a;
|
|
407
407
|
return o * o * o * t + 3 * o * o * a * n + 3 * o * a * a * r + a * a * a * i;
|
|
@@ -468,7 +468,7 @@ function ze(e, t) {
|
|
|
468
468
|
}
|
|
469
469
|
};
|
|
470
470
|
}
|
|
471
|
-
function
|
|
471
|
+
function J(e) {
|
|
472
472
|
return e === void 0 ? ze(Math.random, !1) : ze(Ie(e >>> 0), !0);
|
|
473
473
|
}
|
|
474
474
|
function Be(e, t, n) {
|
|
@@ -479,14 +479,14 @@ function Ve(e, t) {
|
|
|
479
479
|
return t[Math.floor(e() * t.length)];
|
|
480
480
|
}
|
|
481
481
|
var He = {
|
|
482
|
-
create:
|
|
482
|
+
create: J,
|
|
483
483
|
mulberry32: Ie,
|
|
484
484
|
splitmix32: Le,
|
|
485
485
|
deriveSubSeed: Re,
|
|
486
486
|
range: Be,
|
|
487
487
|
pick: Ve
|
|
488
|
-
}, Ue =
|
|
489
|
-
function
|
|
488
|
+
}, Ue = J();
|
|
489
|
+
function Y(e = 0, t = 1, n = Ue) {
|
|
490
490
|
return n.float(e, t);
|
|
491
491
|
}
|
|
492
492
|
function We(e = 0, t = 1, n = Ue) {
|
|
@@ -499,8 +499,59 @@ function Ke(e = .5, t = 0, n = 1, r = Ue) {
|
|
|
499
499
|
return r.skewMin(e, t, n);
|
|
500
500
|
}
|
|
501
501
|
//#endregion
|
|
502
|
-
//#region src/effects/
|
|
503
|
-
var qe = class extends
|
|
502
|
+
//#region src/effects/DustMotesEffect.ts
|
|
503
|
+
var qe = class extends w {
|
|
504
|
+
width;
|
|
505
|
+
height;
|
|
506
|
+
depth;
|
|
507
|
+
floorY;
|
|
508
|
+
waft;
|
|
509
|
+
scaleMin;
|
|
510
|
+
scaleMax;
|
|
511
|
+
px;
|
|
512
|
+
py;
|
|
513
|
+
pz;
|
|
514
|
+
settle;
|
|
515
|
+
twinkle;
|
|
516
|
+
phase;
|
|
517
|
+
dummy = new N();
|
|
518
|
+
clock = 0;
|
|
519
|
+
constructor(e = {}) {
|
|
520
|
+
let { count: n = 150, width: r = 12, height: i = 8, depth: a = 12, floorY: o = 0, color: s = "#aebfe6", radius: c = .02, opacity: l = .9, material: u, settleMin: f = .1, settleMax: p = .35, waft: m = .08, scaleMin: h = .6, scaleMax: g = 1.2, twinkleMin: v = .7, twinkleMax: y = 1.6 } = e, b = u ?? new A({
|
|
521
|
+
color: new d(s),
|
|
522
|
+
transparent: !0,
|
|
523
|
+
opacity: l,
|
|
524
|
+
blending: t,
|
|
525
|
+
depthWrite: !1,
|
|
526
|
+
toneMapped: !1
|
|
527
|
+
});
|
|
528
|
+
super(new L(c, 5, 5), b, n), this.instanceMatrix.setUsage(_), this.frustumCulled = !1, this.width = r, this.height = i, this.depth = a, this.floorY = o, this.waft = m, this.scaleMin = h, this.scaleMax = g, 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);
|
|
529
|
+
for (let e = 0; e < n; e++) this.respawn(e, !0), this.settle[e] = Y(f, p), this.twinkle[e] = Y(v, y), this.phase[e] = Y(0, Math.PI * 2);
|
|
530
|
+
this.writeMatrices();
|
|
531
|
+
}
|
|
532
|
+
update(e) {
|
|
533
|
+
this.clock += e;
|
|
534
|
+
for (let t = 0; t < this.count; t++) this.py[t] -= this.settle[t] * e, this.px[t] += Math.sin(this.clock * .3 + this.phase[t]) * this.waft * e, this.pz[t] += Math.cos(this.clock * .24 + this.phase[t]) * this.waft * e, this.py[t] < this.floorY && this.respawn(t, !1);
|
|
535
|
+
this.writeMatrices();
|
|
536
|
+
}
|
|
537
|
+
dispose() {
|
|
538
|
+
this.geometry.dispose();
|
|
539
|
+
let e = Array.isArray(this.material) ? this.material : [this.material];
|
|
540
|
+
for (let t of e) t.dispose();
|
|
541
|
+
return this;
|
|
542
|
+
}
|
|
543
|
+
respawn(e, t) {
|
|
544
|
+
this.px[e] = Y(-this.width * .5, this.width * .5), this.pz[e] = Y(-this.depth * .5, this.depth * .5), this.py[e] = t ? this.floorY + Y(0, this.height) : this.floorY + this.height;
|
|
545
|
+
}
|
|
546
|
+
writeMatrices() {
|
|
547
|
+
let e = this.dummy;
|
|
548
|
+
for (let t = 0; t < this.count; t++) {
|
|
549
|
+
let n = Math.abs(Math.sin(this.clock * this.twinkle[t] + this.phase[t])), r = this.scaleMin + (this.scaleMax - this.scaleMin) * n;
|
|
550
|
+
e.position.set(this.px[t], this.py[t], this.pz[t]), e.scale.setScalar(r), e.updateMatrix(), this.setMatrixAt(t, e.matrix);
|
|
551
|
+
}
|
|
552
|
+
this.instanceMatrix.needsUpdate = !0;
|
|
553
|
+
}
|
|
554
|
+
}, Je = class extends w {
|
|
504
555
|
width;
|
|
505
556
|
height;
|
|
506
557
|
depth;
|
|
@@ -510,9 +561,9 @@ var qe = class extends C {
|
|
|
510
561
|
py;
|
|
511
562
|
pz;
|
|
512
563
|
speed;
|
|
513
|
-
dummy = new
|
|
564
|
+
dummy = new N();
|
|
514
565
|
constructor(e = {}) {
|
|
515
|
-
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
|
|
566
|
+
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 L(.08, 6, 6), material: p } = e, m = p ?? new M({
|
|
516
567
|
color: l,
|
|
517
568
|
emissive: l,
|
|
518
569
|
emissiveIntensity: d,
|
|
@@ -522,7 +573,7 @@ var qe = class extends C {
|
|
|
522
573
|
metalness: .1
|
|
523
574
|
});
|
|
524
575
|
super(f, m, t), this.instanceMatrix.setUsage(_), 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);
|
|
525
|
-
for (let e = 0; e < t; e++) this.respawn(e, !0), this.speed[e] =
|
|
576
|
+
for (let e = 0; e < t; e++) this.respawn(e, !0), this.speed[e] = Y(s, c);
|
|
526
577
|
this.writeMatrices();
|
|
527
578
|
}
|
|
528
579
|
update(e) {
|
|
@@ -538,14 +589,28 @@ var qe = class extends C {
|
|
|
538
589
|
}
|
|
539
590
|
respawn(e, t) {
|
|
540
591
|
let n = this.width * .5 * this.spread, r = this.depth * .5 * this.spread;
|
|
541
|
-
this.px[e] =
|
|
592
|
+
this.px[e] = Y(-n, n), this.pz[e] = Y(-r, r), this.py[e] = t ? this.baseY + Math.random() * this.height : this.baseY + Y(0, this.height * .15);
|
|
542
593
|
}
|
|
543
594
|
writeMatrices() {
|
|
544
595
|
let e = this.dummy;
|
|
545
596
|
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);
|
|
546
597
|
this.instanceMatrix.needsUpdate = !0;
|
|
547
598
|
}
|
|
548
|
-
},
|
|
599
|
+
}, Ye = class {
|
|
600
|
+
speed;
|
|
601
|
+
minIntensity;
|
|
602
|
+
maxIntensity;
|
|
603
|
+
material;
|
|
604
|
+
elapsed = 0;
|
|
605
|
+
constructor({ material: e, speed: t = 2, maxIntensity: n = .8, minIntensity: r = .2 }) {
|
|
606
|
+
this.material = e, this.speed = t, this.maxIntensity = n, this.minIntensity = r;
|
|
607
|
+
}
|
|
608
|
+
update(e) {
|
|
609
|
+
this.elapsed += e;
|
|
610
|
+
let t = Math.abs(Math.sin(this.elapsed * this.speed));
|
|
611
|
+
this.material.emissiveIntensity = this.minIntensity + t * (this.maxIntensity - this.minIntensity);
|
|
612
|
+
}
|
|
613
|
+
}, Xe = class e {
|
|
549
614
|
seed;
|
|
550
615
|
light;
|
|
551
616
|
lightIntensity;
|
|
@@ -571,7 +636,50 @@ var qe = class extends C {
|
|
|
571
636
|
faceCamera(e) {
|
|
572
637
|
this.halo?.faceCamera(e);
|
|
573
638
|
}
|
|
574
|
-
}
|
|
639
|
+
};
|
|
640
|
+
//#endregion
|
|
641
|
+
//#region src/effects/GlowHalo.ts
|
|
642
|
+
function Ze(e) {
|
|
643
|
+
let t = document.createElement("canvas");
|
|
644
|
+
t.width = t.height = 128;
|
|
645
|
+
let n = t.getContext("2d"), r = `#${e.getHexString()}`, i = n.createRadialGradient(64, 64, 2, 64, 64, 64);
|
|
646
|
+
i.addColorStop(0, `${r}ff`), i.addColorStop(.25, `${r}aa`), i.addColorStop(1, `${r}00`), n.fillStyle = i, n.fillRect(0, 0, 128, 128);
|
|
647
|
+
let a = new c(t);
|
|
648
|
+
return a.colorSpace = ue, a;
|
|
649
|
+
}
|
|
650
|
+
var Qe = class extends N {
|
|
651
|
+
mesh;
|
|
652
|
+
texture;
|
|
653
|
+
baseColor;
|
|
654
|
+
constructor({ color: e = 16755268, size: n = 1.2, opacity: r = .75 } = {}) {
|
|
655
|
+
super(), this.baseColor = new d(e), this.texture = Ze(this.baseColor);
|
|
656
|
+
let i = new A({
|
|
657
|
+
map: this.texture,
|
|
658
|
+
color: this.baseColor,
|
|
659
|
+
transparent: !0,
|
|
660
|
+
opacity: r,
|
|
661
|
+
blending: t,
|
|
662
|
+
depthWrite: !1,
|
|
663
|
+
toneMapped: !1
|
|
664
|
+
});
|
|
665
|
+
this.mesh = new k(new P(n, n), i), this.add(this.mesh);
|
|
666
|
+
}
|
|
667
|
+
faceCamera(e) {
|
|
668
|
+
this.mesh.lookAt(e);
|
|
669
|
+
}
|
|
670
|
+
setOpacity(e) {
|
|
671
|
+
this.mesh.material.opacity = e;
|
|
672
|
+
}
|
|
673
|
+
get opacity() {
|
|
674
|
+
return this.mesh.material.opacity;
|
|
675
|
+
}
|
|
676
|
+
setColor(e) {
|
|
677
|
+
this.baseColor.set(e), this.mesh.material.color.copy(this.baseColor), this.texture.dispose(), this.texture = Ze(this.baseColor), this.mesh.material.map = this.texture;
|
|
678
|
+
}
|
|
679
|
+
dispose() {
|
|
680
|
+
this.mesh.geometry.dispose(), this.mesh.material.dispose(), this.texture.dispose();
|
|
681
|
+
}
|
|
682
|
+
}, $e = class extends N {
|
|
575
683
|
patches = [];
|
|
576
684
|
area;
|
|
577
685
|
heightAt;
|
|
@@ -581,8 +689,8 @@ var qe = class extends C {
|
|
|
581
689
|
x: 1,
|
|
582
690
|
z: 1
|
|
583
691
|
}, color: o = "#9fb0c8", heightAt: s = () => 0 } = {}) {
|
|
584
|
-
super(), this.area = t, this.heightAt = s, this.texture =
|
|
585
|
-
let c =
|
|
692
|
+
super(), this.area = t, this.heightAt = s, this.texture = et(o);
|
|
693
|
+
let c = tt(a);
|
|
586
694
|
for (let t = 0; t < e; t++) this.patches.push(this.makeInteriorPatch());
|
|
587
695
|
for (let e = 0; e < n; e++) this.patches.push(this.makePerimeterPatch(r, i, c));
|
|
588
696
|
}
|
|
@@ -590,7 +698,7 @@ var qe = class extends C {
|
|
|
590
698
|
this.elapsed += e;
|
|
591
699
|
for (let t of this.patches) {
|
|
592
700
|
let n = t.mesh;
|
|
593
|
-
n.position.x += t.driftX * e, n.position.z += t.driftZ * e, n.rotation.z += t.spin * e, t.perimeter ? (
|
|
701
|
+
n.position.x += t.driftX * e, n.position.z += t.driftZ * e, n.rotation.z += t.spin * e, t.perimeter ? (it(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));
|
|
594
702
|
}
|
|
595
703
|
}
|
|
596
704
|
dispose() {
|
|
@@ -599,25 +707,25 @@ var qe = class extends C {
|
|
|
599
707
|
this.patches.length = 0, this.clear();
|
|
600
708
|
}
|
|
601
709
|
makeInteriorPatch() {
|
|
602
|
-
let e =
|
|
603
|
-
return i.position.set(n, this.heightAt(n, r) +
|
|
710
|
+
let e = Y(8, 16), t = Y(.05, .16), n = Y(-this.area, this.area), r = Y(-this.area, this.area), i = this.makeMesh(e, t);
|
|
711
|
+
return i.position.set(n, this.heightAt(n, r) + Y(.3, 1.2), r), this.add(i), {
|
|
604
712
|
mesh: i,
|
|
605
|
-
driftX:
|
|
606
|
-
driftZ:
|
|
607
|
-
spin:
|
|
713
|
+
driftX: Y(-.15, .15),
|
|
714
|
+
driftZ: Y(-.15, .15),
|
|
715
|
+
spin: Y(-.03, .03),
|
|
608
716
|
baseOpacity: t,
|
|
609
|
-
phase:
|
|
717
|
+
phase: Y(0, Math.PI * 2)
|
|
610
718
|
};
|
|
611
719
|
}
|
|
612
720
|
makePerimeterPatch(e, t, n) {
|
|
613
|
-
let r =
|
|
614
|
-
return u.position.set(i, this.heightAt(i, a) +
|
|
721
|
+
let r = nt(n), { x: i, z: a, driftX: o, driftZ: s } = rt(r, e, t), c = Y(18, 30), l = Y(.1, .26), u = this.makeMesh(c, l);
|
|
722
|
+
return u.position.set(i, this.heightAt(i, a) + Y(.15, .55), a), this.add(u), {
|
|
615
723
|
mesh: u,
|
|
616
724
|
driftX: o,
|
|
617
725
|
driftZ: s,
|
|
618
|
-
spin:
|
|
726
|
+
spin: Y(-.012, .012),
|
|
619
727
|
baseOpacity: l,
|
|
620
|
-
phase:
|
|
728
|
+
phase: Y(0, Math.PI * 2),
|
|
621
729
|
perimeter: {
|
|
622
730
|
edge: r,
|
|
623
731
|
plotHalf: e,
|
|
@@ -626,17 +734,17 @@ var qe = class extends C {
|
|
|
626
734
|
};
|
|
627
735
|
}
|
|
628
736
|
makeMesh(e, t) {
|
|
629
|
-
let n = new
|
|
737
|
+
let n = new k(new P(e, e), new A({
|
|
630
738
|
map: this.texture,
|
|
631
739
|
transparent: !0,
|
|
632
740
|
depthWrite: !1,
|
|
633
741
|
opacity: t,
|
|
634
742
|
toneMapped: !1
|
|
635
743
|
}));
|
|
636
|
-
return n.rotation.x = -Math.PI / 2, n.rotation.z =
|
|
744
|
+
return n.rotation.x = -Math.PI / 2, n.rotation.z = Y(0, Math.PI * 2), n;
|
|
637
745
|
}
|
|
638
746
|
};
|
|
639
|
-
function
|
|
747
|
+
function et(e) {
|
|
640
748
|
let t = `#${new d(e).getHexString()}`, n = document.createElement("canvas");
|
|
641
749
|
n.width = n.height = 256;
|
|
642
750
|
let r = n.getContext("2d"), i = r.createRadialGradient(128, 128, 8, 128, 128, 128);
|
|
@@ -644,17 +752,17 @@ function Xe(e) {
|
|
|
644
752
|
let a = new c(n);
|
|
645
753
|
return a.colorSpace = ue, a;
|
|
646
754
|
}
|
|
647
|
-
function
|
|
755
|
+
function tt(e) {
|
|
648
756
|
let t = [];
|
|
649
757
|
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"];
|
|
650
758
|
}
|
|
651
|
-
function
|
|
759
|
+
function nt(e) {
|
|
652
760
|
if (e.length === 1) return e[0];
|
|
653
761
|
let t = Math.random(), n = e.includes("n"), r = e.includes("w");
|
|
654
762
|
return n && r ? t < .58 ? "n" : "w" : e[Math.floor(Math.random() * e.length)];
|
|
655
763
|
}
|
|
656
|
-
function
|
|
657
|
-
let r =
|
|
764
|
+
function rt(e, t, n) {
|
|
765
|
+
let r = Y(.6, n - t - 1.5), i = Y(-n + 3, n - 3), a = Y(.03, .09) * (Math.random() < .5 ? -1 : 1), o = Y(.01, .04);
|
|
658
766
|
switch (e) {
|
|
659
767
|
case "n": return {
|
|
660
768
|
x: i,
|
|
@@ -682,83 +790,29 @@ function $e(e, t, n) {
|
|
|
682
790
|
};
|
|
683
791
|
}
|
|
684
792
|
}
|
|
685
|
-
function
|
|
793
|
+
function it(e, t, n, r) {
|
|
686
794
|
let i = r - 1, { x: a, z: o } = e.position;
|
|
687
795
|
switch (t) {
|
|
688
796
|
case "n":
|
|
689
|
-
e.position.z =
|
|
797
|
+
e.position.z = at(o, -i, -n + .8), a < -i + 3 && (e.position.x = i - 3), a > i - 3 && (e.position.x = -i + 3);
|
|
690
798
|
break;
|
|
691
799
|
case "s":
|
|
692
|
-
e.position.z =
|
|
800
|
+
e.position.z = at(o, n - .8, i), a < -i + 3 && (e.position.x = i - 3), a > i - 3 && (e.position.x = -i + 3);
|
|
693
801
|
break;
|
|
694
802
|
case "e":
|
|
695
|
-
e.position.x =
|
|
803
|
+
e.position.x = at(a, n - .8, i), o < -i + 3 && (e.position.z = i - 3), o > i - 3 && (e.position.z = -i + 3);
|
|
696
804
|
break;
|
|
697
805
|
case "w":
|
|
698
|
-
e.position.x =
|
|
806
|
+
e.position.x = at(a, -i, -n + .8), o < -i + 3 && (e.position.z = i - 3), o > i - 3 && (e.position.z = -i + 3);
|
|
699
807
|
break;
|
|
700
808
|
}
|
|
701
809
|
}
|
|
702
|
-
function
|
|
810
|
+
function at(e, t, n) {
|
|
703
811
|
return Math.max(t, Math.min(n, e));
|
|
704
812
|
}
|
|
705
813
|
//#endregion
|
|
706
|
-
//#region src/effects/
|
|
707
|
-
|
|
708
|
-
let t = document.createElement("canvas");
|
|
709
|
-
t.width = t.height = 128;
|
|
710
|
-
let n = t.getContext("2d"), r = `#${e.getHexString()}`, i = n.createRadialGradient(64, 64, 2, 64, 64, 64);
|
|
711
|
-
i.addColorStop(0, `${r}ff`), i.addColorStop(.25, `${r}aa`), i.addColorStop(1, `${r}00`), n.fillStyle = i, n.fillRect(0, 0, 128, 128);
|
|
712
|
-
let a = new c(t);
|
|
713
|
-
return a.colorSpace = ue, a;
|
|
714
|
-
}
|
|
715
|
-
var rt = class extends M {
|
|
716
|
-
mesh;
|
|
717
|
-
texture;
|
|
718
|
-
baseColor;
|
|
719
|
-
constructor({ color: e = 16755268, size: n = 1.2, opacity: r = .75 } = {}) {
|
|
720
|
-
super(), this.baseColor = new d(e), this.texture = nt(this.baseColor);
|
|
721
|
-
let i = new k({
|
|
722
|
-
map: this.texture,
|
|
723
|
-
color: this.baseColor,
|
|
724
|
-
transparent: !0,
|
|
725
|
-
opacity: r,
|
|
726
|
-
blending: t,
|
|
727
|
-
depthWrite: !1,
|
|
728
|
-
toneMapped: !1
|
|
729
|
-
});
|
|
730
|
-
this.mesh = new O(new N(n, n), i), this.add(this.mesh);
|
|
731
|
-
}
|
|
732
|
-
faceCamera(e) {
|
|
733
|
-
this.mesh.lookAt(e);
|
|
734
|
-
}
|
|
735
|
-
setOpacity(e) {
|
|
736
|
-
this.mesh.material.opacity = e;
|
|
737
|
-
}
|
|
738
|
-
get opacity() {
|
|
739
|
-
return this.mesh.material.opacity;
|
|
740
|
-
}
|
|
741
|
-
setColor(e) {
|
|
742
|
-
this.baseColor.set(e), this.mesh.material.color.copy(this.baseColor), this.texture.dispose(), this.texture = nt(this.baseColor), this.mesh.material.map = this.texture;
|
|
743
|
-
}
|
|
744
|
-
dispose() {
|
|
745
|
-
this.mesh.geometry.dispose(), this.mesh.material.dispose(), this.texture.dispose();
|
|
746
|
-
}
|
|
747
|
-
}, it = class {
|
|
748
|
-
speed;
|
|
749
|
-
minIntensity;
|
|
750
|
-
maxIntensity;
|
|
751
|
-
material;
|
|
752
|
-
elapsed = 0;
|
|
753
|
-
constructor({ material: e, speed: t = 2, maxIntensity: n = .8, minIntensity: r = .2 }) {
|
|
754
|
-
this.material = e, this.speed = t, this.maxIntensity = n, this.minIntensity = r;
|
|
755
|
-
}
|
|
756
|
-
update(e) {
|
|
757
|
-
this.elapsed += e;
|
|
758
|
-
let t = Math.abs(Math.sin(this.elapsed * this.speed));
|
|
759
|
-
this.material.emissiveIntensity = this.minIntensity + t * (this.maxIntensity - this.minIntensity);
|
|
760
|
-
}
|
|
761
|
-
}, at = class {
|
|
814
|
+
//#region src/effects/LightningEffect.ts
|
|
815
|
+
var ot = class {
|
|
762
816
|
level = 0;
|
|
763
817
|
light;
|
|
764
818
|
peak;
|
|
@@ -768,7 +822,7 @@ var rt = class extends M {
|
|
|
768
822
|
clock = 0;
|
|
769
823
|
nextStrike;
|
|
770
824
|
constructor({ light: e, peak: t = 12, minGap: n = 3, maxGap: r = 9 }) {
|
|
771
|
-
this.light = e, this.peak = t, this.minGap = n, this.maxGap = r, this.nextStrike =
|
|
825
|
+
this.light = e, this.peak = t, this.minGap = n, this.maxGap = r, this.nextStrike = Y(n * .3, r);
|
|
772
826
|
}
|
|
773
827
|
update(e) {
|
|
774
828
|
this.clock += e, this.clock >= this.nextStrike && this.strike();
|
|
@@ -787,12 +841,12 @@ var rt = class extends M {
|
|
|
787
841
|
strike() {
|
|
788
842
|
let e = Math.random() < .5 ? 2 : 3;
|
|
789
843
|
for (let t = 0; t < e; t++) this.spikes.push({
|
|
790
|
-
at: this.clock + t *
|
|
791
|
-
amp:
|
|
844
|
+
at: this.clock + t * Y(.04, .12),
|
|
845
|
+
amp: Y(.5, 1)
|
|
792
846
|
});
|
|
793
|
-
this.nextStrike = this.clock +
|
|
847
|
+
this.nextStrike = this.clock + Y(this.minGap, this.maxGap);
|
|
794
848
|
}
|
|
795
|
-
},
|
|
849
|
+
}, st = class extends s {
|
|
796
850
|
constructor(e = .1) {
|
|
797
851
|
super();
|
|
798
852
|
let t = [], n = [], r = [
|
|
@@ -814,7 +868,7 @@ var rt = class extends M {
|
|
|
814
868
|
let i = new x(t, 3);
|
|
815
869
|
this.setAttribute("position", i), this.setIndex(n), this.computeVertexNormals();
|
|
816
870
|
}
|
|
817
|
-
},
|
|
871
|
+
}, ct = class extends w {
|
|
818
872
|
width;
|
|
819
873
|
height;
|
|
820
874
|
depth;
|
|
@@ -830,14 +884,14 @@ var rt = class extends M {
|
|
|
830
884
|
rotY;
|
|
831
885
|
rotZ;
|
|
832
886
|
phase;
|
|
833
|
-
dummy = new
|
|
887
|
+
dummy = new N();
|
|
834
888
|
clock = 0;
|
|
835
889
|
constructor(e = {}) {
|
|
836
890
|
let { count: t = 120, width: n = 16, height: r = 8, depth: i = 16, floorY: a = 0, fallSpeedMin: o = .12, fallSpeedMax: s = .28, driftMin: c = .04, driftMax: l = .14, flutter: u = .35, color: f = [
|
|
837
891
|
16766704,
|
|
838
892
|
16774650,
|
|
839
893
|
15775952
|
|
840
|
-
], geometry: p = new
|
|
894
|
+
], geometry: p = new st(), material: m } = e, h = (Array.isArray(f) ? f : [f]).map((e) => new d(e)), v = m ?? new M({
|
|
841
895
|
color: h.length === 1 ? h[0].getHex() : 16777215,
|
|
842
896
|
metalness: .05,
|
|
843
897
|
roughness: .85,
|
|
@@ -846,9 +900,9 @@ var rt = class extends M {
|
|
|
846
900
|
});
|
|
847
901
|
super(p, v, t), this.instanceMatrix.setUsage(_), this.frustumCulled = !1, this.width = n, this.height = r, this.depth = i, this.floorY = a, this.flutter = u, 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);
|
|
848
902
|
for (let e = 0; e < t; e++) {
|
|
849
|
-
this.respawn(e, !0), this.fallSpeed[e] =
|
|
850
|
-
let t =
|
|
851
|
-
this.driftX[e] = Math.cos(n) * t, this.driftZ[e] = Math.sin(n) * t, this.phase[e] =
|
|
903
|
+
this.respawn(e, !0), this.fallSpeed[e] = Y(o, s);
|
|
904
|
+
let t = Y(c, l), n = Y(0, Math.PI * 2);
|
|
905
|
+
this.driftX[e] = Math.cos(n) * t, this.driftZ[e] = Math.sin(n) * t, this.phase[e] = Y(0, Math.PI * 2), h.length > 1 && this.setColorAt(e, h[Math.floor(Math.random() * h.length)]);
|
|
852
906
|
}
|
|
853
907
|
this.instanceColor && (this.instanceColor.needsUpdate = !0), this.writeMatrices();
|
|
854
908
|
}
|
|
@@ -867,7 +921,7 @@ var rt = class extends M {
|
|
|
867
921
|
return this;
|
|
868
922
|
}
|
|
869
923
|
respawn(e, t) {
|
|
870
|
-
this.px[e] =
|
|
924
|
+
this.px[e] = Y(-this.width * .5, this.width * .5), this.pz[e] = Y(-this.depth * .5, this.depth * .5), this.py[e] = t ? this.floorY + Y(0, this.height * 1.25) : this.floorY + this.height + Y(0, this.height * .25), this.rotX[e] = Y(-.6, .6), this.rotY[e] = Y(-Math.PI, Math.PI), this.rotZ[e] = Y(-.8, .8);
|
|
871
925
|
}
|
|
872
926
|
writeMatrices() {
|
|
873
927
|
let e = this.dummy;
|
|
@@ -880,7 +934,7 @@ var rt = class extends M {
|
|
|
880
934
|
};
|
|
881
935
|
//#endregion
|
|
882
936
|
//#region src/effects/RainEffect.ts
|
|
883
|
-
function
|
|
937
|
+
function lt() {
|
|
884
938
|
let e = document.createElement("canvas");
|
|
885
939
|
e.width = 8, e.height = 64;
|
|
886
940
|
let t = e.getContext("2d"), n = t.createLinearGradient(0, 0, 0, 64);
|
|
@@ -888,7 +942,7 @@ function ct() {
|
|
|
888
942
|
let r = new c(e);
|
|
889
943
|
return r.colorSpace = ue, r;
|
|
890
944
|
}
|
|
891
|
-
var
|
|
945
|
+
var ut = class extends w {
|
|
892
946
|
intensity;
|
|
893
947
|
maxCount;
|
|
894
948
|
area;
|
|
@@ -897,18 +951,18 @@ var lt = class extends C {
|
|
|
897
951
|
baseOpacity;
|
|
898
952
|
windDirection;
|
|
899
953
|
windStrength;
|
|
900
|
-
fallDirection = new
|
|
901
|
-
streakOrientation = new
|
|
954
|
+
fallDirection = new z(0, -1, 0);
|
|
955
|
+
streakOrientation = new F();
|
|
902
956
|
sx;
|
|
903
957
|
sz;
|
|
904
958
|
topY;
|
|
905
959
|
len;
|
|
906
960
|
speed;
|
|
907
961
|
streakTexture;
|
|
908
|
-
dummy = new
|
|
962
|
+
dummy = new N();
|
|
909
963
|
clock = 0;
|
|
910
964
|
constructor(e = {}) {
|
|
911
|
-
let { count: t = 1400, area: n = 26, height: r = 22, groundY: i = 0, width: a = .009, color: o = "#aebfd6", opacity: s = .16, lengthMin: c = .18, lengthMax: l = .42, speedMin: u = 11, speedMax: f = 19, windDirection: p = 0, windStrength: m = 0, intensity: h = .5, geometry: v = new
|
|
965
|
+
let { count: t = 1400, area: n = 26, height: r = 22, groundY: i = 0, width: a = .009, color: o = "#aebfd6", opacity: s = .16, lengthMin: c = .18, lengthMax: l = .42, speedMin: u = 11, speedMax: f = 19, windDirection: p = 0, windStrength: m = 0, intensity: h = .5, geometry: v = new P(a, 1), material: y } = e, b = y ? void 0 : lt(), x = y ?? new A({
|
|
912
966
|
color: new d(o),
|
|
913
967
|
map: b,
|
|
914
968
|
transparent: !0,
|
|
@@ -919,7 +973,7 @@ var lt = class extends C {
|
|
|
919
973
|
side: g
|
|
920
974
|
});
|
|
921
975
|
super(v, x, t), this.instanceMatrix.setUsage(_), this.frustumCulled = !1, this.maxCount = t, this.area = n, this.height = r, this.groundY = i, this.baseOpacity = s, this.windDirection = p, this.windStrength = Math.max(0, m), this.updateFallDirection(0), this.intensity = h, 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);
|
|
922
|
-
for (let e = 0; e < t; e++) this.sx[e] =
|
|
976
|
+
for (let e = 0; e < t; e++) this.sx[e] = Y(-n, n), this.sz[e] = Y(-n, n), this.topY[e] = Y(i, i + r), this.len[e] = Y(c, l), this.speed[e] = Y(u, f);
|
|
923
977
|
this.writeMatrices(), this.applyIntensity();
|
|
924
978
|
}
|
|
925
979
|
update(e) {
|
|
@@ -951,7 +1005,7 @@ var lt = class extends C {
|
|
|
951
1005
|
return;
|
|
952
1006
|
}
|
|
953
1007
|
let n = t, r = 1 / Math.hypot(n, 1);
|
|
954
|
-
this.fallDirection.set(Math.cos(this.windDirection) * n * r, -1 * r, Math.sin(this.windDirection) * n * r), this.streakOrientation.setFromUnitVectors(new
|
|
1008
|
+
this.fallDirection.set(Math.cos(this.windDirection) * n * r, -1 * r, Math.sin(this.windDirection) * n * r), this.streakOrientation.setFromUnitVectors(new z(0, 1, 0), this.fallDirection);
|
|
955
1009
|
}
|
|
956
1010
|
writeMatrices() {
|
|
957
1011
|
let e = this.dummy;
|
|
@@ -961,57 +1015,7 @@ var lt = class extends C {
|
|
|
961
1015
|
}
|
|
962
1016
|
this.instanceMatrix.needsUpdate = !0;
|
|
963
1017
|
}
|
|
964
|
-
},
|
|
965
|
-
wisps = [];
|
|
966
|
-
orbGeometry;
|
|
967
|
-
orbMaterial;
|
|
968
|
-
halfWidth;
|
|
969
|
-
depth;
|
|
970
|
-
heightMin;
|
|
971
|
-
heightMax;
|
|
972
|
-
driftX;
|
|
973
|
-
driftY;
|
|
974
|
-
driftZ;
|
|
975
|
-
speedMin;
|
|
976
|
-
speedMax;
|
|
977
|
-
castLight;
|
|
978
|
-
lightDistance;
|
|
979
|
-
lightDecay;
|
|
980
|
-
lightIntensity;
|
|
981
|
-
lightPulseAmplitude;
|
|
982
|
-
lightPulseSpeed;
|
|
983
|
-
elapsed = 0;
|
|
984
|
-
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: c = .3, driftZ: l = 1.6, speedMin: u = .3, speedMax: f = .7, castLight: p = !0, lightDistance: m = 6, lightDecay: h = 2, lightIntensity: g = 2.5, lightPulseAmplitude: _ = 1.2, lightPulseSpeed: v = 3 } = {}) {
|
|
985
|
-
super(), this.halfWidth = t / 2, this.depth = n, this.heightMin = r, this.heightMax = i, this.driftX = s, this.driftY = c, this.driftZ = l, this.speedMin = u, this.speedMax = f, this.castLight = p, this.lightDistance = m, this.lightDecay = h, this.lightIntensity = g, this.lightPulseAmplitude = _, this.lightPulseSpeed = v, this.orbGeometry = new I(o, 8, 8), this.orbMaterial = new k({
|
|
986
|
-
color: new d(a),
|
|
987
|
-
toneMapped: !1
|
|
988
|
-
});
|
|
989
|
-
for (let t = 0; t < e; t++) {
|
|
990
|
-
let e = new R(J(-this.halfWidth, this.halfWidth), J(this.heightMin, this.heightMax), J(0, this.depth)), t = new O(this.orbGeometry, this.orbMaterial);
|
|
991
|
-
t.position.copy(e), this.add(t);
|
|
992
|
-
let n;
|
|
993
|
-
p && (n = new ie(a, 3, this.lightDistance, this.lightDecay), t.add(n)), this.wisps.push({
|
|
994
|
-
orb: t,
|
|
995
|
-
home: e,
|
|
996
|
-
phase: J(0, Math.PI * 2),
|
|
997
|
-
speed: J(this.speedMin, this.speedMax),
|
|
998
|
-
light: n
|
|
999
|
-
});
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
update(e) {
|
|
1003
|
-
this.elapsed += e;
|
|
1004
|
-
for (let e of this.wisps) {
|
|
1005
|
-
let t = this.elapsed * e.speed + e.phase;
|
|
1006
|
-
e.orb.position.set(e.home.x + Math.sin(t) * this.driftX, e.home.y + Math.sin(t * 1.7) * this.driftY, e.home.z + Math.cos(t * .8) * this.driftZ), e.light && (e.light.intensity = this.lightIntensity + Math.sin(t * this.lightPulseSpeed) * this.lightPulseAmplitude);
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
dispose() {
|
|
1010
|
-
this.orbGeometry.dispose(), this.orbMaterial.dispose();
|
|
1011
|
-
for (let e of this.wisps) e.light?.dispose();
|
|
1012
|
-
this.clear(), this.wisps.length = 0;
|
|
1013
|
-
}
|
|
1014
|
-
}, dt = class extends F {
|
|
1018
|
+
}, dt = class extends I {
|
|
1015
1019
|
constructor(e = 5, t = .5, n = 1) {
|
|
1016
1020
|
super();
|
|
1017
1021
|
let r = Math.PI * 2 / e, i = r / 2, a = r / 4;
|
|
@@ -1029,7 +1033,7 @@ var lt = class extends C {
|
|
|
1029
1033
|
bevelEnabled: !1
|
|
1030
1034
|
});
|
|
1031
1035
|
}
|
|
1032
|
-
}, pt = new
|
|
1036
|
+
}, pt = new z(0, 0, 0);
|
|
1033
1037
|
function mt(e, t, n, r = 128) {
|
|
1034
1038
|
let i = document.createElement("canvas");
|
|
1035
1039
|
i.width = r, i.height = r;
|
|
@@ -1050,15 +1054,16 @@ function ht(e) {
|
|
|
1050
1054
|
function gt(e) {
|
|
1051
1055
|
return (Array.isArray(e) ? e : [e]).map((e) => new d(e));
|
|
1052
1056
|
}
|
|
1053
|
-
var _t = class extends
|
|
1057
|
+
var _t = class extends N {
|
|
1054
1058
|
style;
|
|
1055
1059
|
field;
|
|
1056
1060
|
twinkle;
|
|
1057
1061
|
baseSize;
|
|
1058
1062
|
baseScales;
|
|
1059
1063
|
twinklePhases;
|
|
1064
|
+
baseColors;
|
|
1060
1065
|
spriteTexture;
|
|
1061
|
-
dummy = new
|
|
1066
|
+
dummy = new N();
|
|
1062
1067
|
constructor(e = {}) {
|
|
1063
1068
|
super(), this.style = e.style ?? "points";
|
|
1064
1069
|
let { count: t = 1500, radius: n = 500, minRadius: r = n, maxRadius: i = n, sizeMin: a = .008, sizeMax: o = .025, color: s = [
|
|
@@ -1075,8 +1080,8 @@ var _t = class extends M {
|
|
|
1075
1080
|
outerRadius: u.outerRadius ?? 1.9,
|
|
1076
1081
|
depth: u.depth ?? .05
|
|
1077
1082
|
};
|
|
1078
|
-
if (this.style === "burst") {
|
|
1079
|
-
c && (this.baseScales = new Float32Array(t)
|
|
1083
|
+
if (c && (this.twinklePhases = new Float32Array(t)), this.style === "burst") {
|
|
1084
|
+
c && (this.baseScales = new Float32Array(t));
|
|
1080
1085
|
let e = d ?? new ft({
|
|
1081
1086
|
sides: m.sides,
|
|
1082
1087
|
innerRadius: m.innerRadius,
|
|
@@ -1123,11 +1128,18 @@ var _t = class extends M {
|
|
|
1123
1128
|
update(e = performance.now() * .001) {
|
|
1124
1129
|
if (!this.twinkle) return;
|
|
1125
1130
|
if (this.field instanceof ae) {
|
|
1126
|
-
this.
|
|
1131
|
+
if (this.twinklePhases && this.baseColors) {
|
|
1132
|
+
let t = this.field.geometry.getAttribute("color"), n = t.array, r = this.baseColors;
|
|
1133
|
+
for (let t = 0; t < this.twinklePhases.length; t++) {
|
|
1134
|
+
let i = .65 + .35 * Math.sin(e * 2.5 + this.twinklePhases[t]);
|
|
1135
|
+
n[t * 3] = r[t * 3] * i, n[t * 3 + 1] = r[t * 3 + 1] * i, n[t * 3 + 2] = r[t * 3 + 2] * i;
|
|
1136
|
+
}
|
|
1137
|
+
t.needsUpdate = !0;
|
|
1138
|
+
} else this.field.material.size = this.baseSize * (.8 + .2 * Math.sin(e * 2.5));
|
|
1127
1139
|
return;
|
|
1128
1140
|
}
|
|
1129
1141
|
if (!this.baseScales || !this.twinklePhases) return;
|
|
1130
|
-
let t = new
|
|
1142
|
+
let t = new O(), n = new z(), r = new F(), i = new z();
|
|
1131
1143
|
for (let a = 0; a < this.field.count; a++) {
|
|
1132
1144
|
this.field.getMatrixAt(a, t), t.decompose(n, r, i);
|
|
1133
1145
|
let o = .75 + .25 * Math.sin(e * 2.5 + this.twinklePhases[a]), s = this.baseScales[a] * o;
|
|
@@ -1136,19 +1148,24 @@ var _t = class extends M {
|
|
|
1136
1148
|
this.field.instanceMatrix.needsUpdate = !0;
|
|
1137
1149
|
}
|
|
1138
1150
|
createPointsField({ count: e, minRadius: t, maxRadius: n, sizeMin: r, sizeMax: i, color: a, material: c, burstShape: l }) {
|
|
1139
|
-
let u = gt(a), d = new
|
|
1151
|
+
let u = gt(a), d = new z(), f = Math.max(n - t, 0), p = (t + f * .5) * ((r + i) / 2), m = new Float32Array(e * 3), h = u.length > 1 || this.twinkle ? new Float32Array(e * 3) : null;
|
|
1140
1152
|
for (let n = 0; n < e; n++) {
|
|
1141
1153
|
let e = t + Math.random() * f;
|
|
1142
1154
|
if (ht(d).multiplyScalar(e), m[n * 3] = d.x, m[n * 3 + 1] = d.y, m[n * 3 + 2] = d.z, h) {
|
|
1143
1155
|
let e = u[Math.floor(Math.random() * u.length)];
|
|
1144
1156
|
h[n * 3] = e.r, h[n * 3 + 1] = e.g, h[n * 3 + 2] = e.b;
|
|
1145
1157
|
}
|
|
1158
|
+
this.twinklePhases && (this.twinklePhases[n] = Math.random() * Math.PI * 2);
|
|
1146
1159
|
}
|
|
1147
1160
|
let g = new s();
|
|
1148
|
-
g.setAttribute("position", new o(m, 3)), h
|
|
1149
|
-
|
|
1161
|
+
if (g.setAttribute("position", new o(m, 3)), h) {
|
|
1162
|
+
let e = new o(h, 3);
|
|
1163
|
+
this.twinkle && (this.baseColors = h.slice(), e.setUsage(_)), g.setAttribute("color", e);
|
|
1164
|
+
}
|
|
1165
|
+
this.spriteTexture = mt(l.sides, l.innerRadius, l.outerRadius);
|
|
1166
|
+
let v = new ae(g, c ?? new oe({
|
|
1150
1167
|
map: this.spriteTexture,
|
|
1151
|
-
color:
|
|
1168
|
+
color: h ? 16777215 : u[0].getHex(),
|
|
1152
1169
|
size: p,
|
|
1153
1170
|
sizeAttenuation: !0,
|
|
1154
1171
|
transparent: !0,
|
|
@@ -1157,12 +1174,12 @@ var _t = class extends M {
|
|
|
1157
1174
|
depthWrite: !1,
|
|
1158
1175
|
toneMapped: !1
|
|
1159
1176
|
}));
|
|
1160
|
-
return
|
|
1177
|
+
return v.frustumCulled = !1, v.renderOrder = 1, v;
|
|
1161
1178
|
}
|
|
1162
1179
|
createBurstField({ count: e, minRadius: t, maxRadius: n, sizeMin: r, sizeMax: i, color: a, material: o, geometry: s }) {
|
|
1163
|
-
let c = gt(a), l = new
|
|
1180
|
+
let c = gt(a), l = new z(), u = Math.max(n - t, 0), d = s.clone();
|
|
1164
1181
|
d.center(), d.computeBoundingSphere();
|
|
1165
|
-
let f = d.boundingSphere?.radius ?? 1, p = new
|
|
1182
|
+
let f = d.boundingSphere?.radius ?? 1, p = new w(d, o ?? new A({
|
|
1166
1183
|
color: c.length === 1 ? c[0].getHex() : 16777215,
|
|
1167
1184
|
side: g,
|
|
1168
1185
|
depthWrite: !1,
|
|
@@ -1177,7 +1194,57 @@ var _t = class extends M {
|
|
|
1177
1194
|
}
|
|
1178
1195
|
return p.instanceMatrix.needsUpdate = !0, p.instanceColor && (p.instanceColor.needsUpdate = !0), p;
|
|
1179
1196
|
}
|
|
1180
|
-
}, vt = class extends
|
|
1197
|
+
}, vt = class extends N {
|
|
1198
|
+
wisps = [];
|
|
1199
|
+
orbGeometry;
|
|
1200
|
+
orbMaterial;
|
|
1201
|
+
halfWidth;
|
|
1202
|
+
depth;
|
|
1203
|
+
heightMin;
|
|
1204
|
+
heightMax;
|
|
1205
|
+
driftX;
|
|
1206
|
+
driftY;
|
|
1207
|
+
driftZ;
|
|
1208
|
+
speedMin;
|
|
1209
|
+
speedMax;
|
|
1210
|
+
castLight;
|
|
1211
|
+
lightDistance;
|
|
1212
|
+
lightDecay;
|
|
1213
|
+
lightIntensity;
|
|
1214
|
+
lightPulseAmplitude;
|
|
1215
|
+
lightPulseSpeed;
|
|
1216
|
+
elapsed = 0;
|
|
1217
|
+
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: c = .3, driftZ: l = 1.6, speedMin: u = .3, speedMax: f = .7, castLight: p = !0, lightDistance: m = 6, lightDecay: h = 2, lightIntensity: g = 2.5, lightPulseAmplitude: _ = 1.2, lightPulseSpeed: v = 3 } = {}) {
|
|
1218
|
+
super(), this.halfWidth = t / 2, this.depth = n, this.heightMin = r, this.heightMax = i, this.driftX = s, this.driftY = c, this.driftZ = l, this.speedMin = u, this.speedMax = f, this.castLight = p, this.lightDistance = m, this.lightDecay = h, this.lightIntensity = g, this.lightPulseAmplitude = _, this.lightPulseSpeed = v, this.orbGeometry = new L(o, 8, 8), this.orbMaterial = new A({
|
|
1219
|
+
color: new d(a),
|
|
1220
|
+
toneMapped: !1
|
|
1221
|
+
});
|
|
1222
|
+
for (let t = 0; t < e; t++) {
|
|
1223
|
+
let e = new z(Y(-this.halfWidth, this.halfWidth), Y(this.heightMin, this.heightMax), Y(0, this.depth)), t = new k(this.orbGeometry, this.orbMaterial);
|
|
1224
|
+
t.position.copy(e), this.add(t);
|
|
1225
|
+
let n;
|
|
1226
|
+
p && (n = new ie(a, 3, this.lightDistance, this.lightDecay), t.add(n)), this.wisps.push({
|
|
1227
|
+
orb: t,
|
|
1228
|
+
home: e,
|
|
1229
|
+
phase: Y(0, Math.PI * 2),
|
|
1230
|
+
speed: Y(this.speedMin, this.speedMax),
|
|
1231
|
+
light: n
|
|
1232
|
+
});
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
update(e) {
|
|
1236
|
+
this.elapsed += e;
|
|
1237
|
+
for (let e of this.wisps) {
|
|
1238
|
+
let t = this.elapsed * e.speed + e.phase;
|
|
1239
|
+
e.orb.position.set(e.home.x + Math.sin(t) * this.driftX, e.home.y + Math.sin(t * 1.7) * this.driftY, e.home.z + Math.cos(t * .8) * this.driftZ), e.light && (e.light.intensity = this.lightIntensity + Math.sin(t * this.lightPulseSpeed) * this.lightPulseAmplitude);
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
dispose() {
|
|
1243
|
+
this.orbGeometry.dispose(), this.orbMaterial.dispose();
|
|
1244
|
+
for (let e of this.wisps) e.light?.dispose();
|
|
1245
|
+
this.clear(), this.wisps.length = 0;
|
|
1246
|
+
}
|
|
1247
|
+
}, yt = class extends s {
|
|
1181
1248
|
width;
|
|
1182
1249
|
height;
|
|
1183
1250
|
depth;
|
|
@@ -1724,26 +1791,26 @@ var _t = class extends M {
|
|
|
1724
1791
|
], y = new Float32Array(p), b = new Float32Array(m), x = new Float32Array(_), S = new Uint16Array(v), C = new s();
|
|
1725
1792
|
C.setAttribute("position", new o(y, 3)), C.setAttribute("normal", new o(b, 3)), C.setAttribute("uv", new o(x, 2)), C.setIndex(new o(S, 1));
|
|
1726
1793
|
let w = new a(e - d - f, l - f * 2, u - d * 2);
|
|
1727
|
-
w.translate((e - d - f) / 2 + d, l / 2, -u / 2), this.copy(
|
|
1794
|
+
w.translate((e - d - f) / 2 + d, l / 2, -u / 2), this.copy(B([C, w], !0));
|
|
1728
1795
|
}
|
|
1729
|
-
},
|
|
1730
|
-
function
|
|
1731
|
-
return new
|
|
1796
|
+
}, bt = .5, xt = Math.PI / 2;
|
|
1797
|
+
function St({ scaleXMin: e = .4, scaleXMax: t = .7, scaleYMin: n = .3, scaleYMax: r = .95, scaleZMin: i = .1, scaleZMax: a = .5, source: o }) {
|
|
1798
|
+
return new z(Y(e, t, o), Ge(.25, n, r, o), Ke(.8, i, a, o));
|
|
1732
1799
|
}
|
|
1733
|
-
function
|
|
1734
|
-
let i = new
|
|
1800
|
+
function Ct({ coverMaterial: e, pagesMaterial: t, scales: n, source: r }) {
|
|
1801
|
+
let i = new w(new yt(), [e, t], n.length), a = new O(), o = 0;
|
|
1735
1802
|
for (let e = 0; e < n.length; e++) {
|
|
1736
|
-
let t = n[e], s = new
|
|
1803
|
+
let t = n[e], s = new O();
|
|
1737
1804
|
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;
|
|
1738
1805
|
}
|
|
1739
1806
|
return i;
|
|
1740
1807
|
}
|
|
1741
|
-
function
|
|
1742
|
-
let u =
|
|
1743
|
-
return
|
|
1808
|
+
function wt({ 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 }) {
|
|
1809
|
+
let u = J(l);
|
|
1810
|
+
return Ct({
|
|
1744
1811
|
coverMaterial: e,
|
|
1745
1812
|
pagesMaterial: t,
|
|
1746
|
-
scales: Array.from({ length: n }, () =>
|
|
1813
|
+
scales: Array.from({ length: n }, () => St({
|
|
1747
1814
|
scaleXMin: r,
|
|
1748
1815
|
scaleXMax: i,
|
|
1749
1816
|
scaleYMin: a,
|
|
@@ -1755,10 +1822,10 @@ function Ct({ coverMaterial: e, pagesMaterial: t, count: n = 10, scaleXMin: r =
|
|
|
1755
1822
|
source: u
|
|
1756
1823
|
});
|
|
1757
1824
|
}
|
|
1758
|
-
function
|
|
1759
|
-
let u =
|
|
1825
|
+
function Tt({ 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 }) {
|
|
1826
|
+
let u = J(l), d = [], f = n;
|
|
1760
1827
|
for (; f > 0;) {
|
|
1761
|
-
let e =
|
|
1828
|
+
let e = St({
|
|
1762
1829
|
scaleXMin: r,
|
|
1763
1830
|
scaleXMax: i,
|
|
1764
1831
|
scaleYMin: a,
|
|
@@ -1769,17 +1836,17 @@ function wt({ coverMaterial: e, pagesMaterial: t, length: n = 10, scaleXMin: r =
|
|
|
1769
1836
|
});
|
|
1770
1837
|
e.z = Math.min(e.z, f), d.push(e), f -= e.z;
|
|
1771
1838
|
}
|
|
1772
|
-
return
|
|
1839
|
+
return Ct({
|
|
1773
1840
|
coverMaterial: e,
|
|
1774
1841
|
pagesMaterial: t,
|
|
1775
1842
|
scales: d,
|
|
1776
1843
|
source: u
|
|
1777
1844
|
});
|
|
1778
1845
|
}
|
|
1779
|
-
function
|
|
1780
|
-
let f =
|
|
1846
|
+
function Et({ 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 }) {
|
|
1847
|
+
let f = J(d), p = new yt(), m = new w(p, [e, t], n), h = new O(), g = new z(), _ = new F(), v = new F().setFromAxisAngle(new z(1, 0, 0), xt), y = new F(), b = new z(), x = new z(p.width * .5, p.height * .5, -p.depth * .5), S = new z(), C = new z(), T = 0;
|
|
1781
1848
|
for (let e = 0; e < n; e++) {
|
|
1782
|
-
let t =
|
|
1849
|
+
let t = St({
|
|
1783
1850
|
scaleXMin: r,
|
|
1784
1851
|
scaleXMax: i,
|
|
1785
1852
|
scaleYMin: a,
|
|
@@ -1789,14 +1856,93 @@ function Tt({ coverMaterial: e, pagesMaterial: t, count: n = 6, scaleXMin: r = .
|
|
|
1789
1856
|
source: f
|
|
1790
1857
|
});
|
|
1791
1858
|
b.copy(t);
|
|
1792
|
-
let n =
|
|
1793
|
-
y.setFromAxisAngle(new
|
|
1859
|
+
let n = bt * t.z;
|
|
1860
|
+
y.setFromAxisAngle(new z(0, 1, 0), f.float(-l, l)), _.copy(v).premultiply(y), S.copy(x).multiply(b), C.copy(S).applyQuaternion(_), g.set(f.float(-u, u), T + n * .5, f.float(-u, u)), g.sub(C), h.compose(g, _, b), m.setMatrixAt(e, h), T += n;
|
|
1794
1861
|
}
|
|
1795
1862
|
return m.instanceMatrix.needsUpdate = !0, m;
|
|
1796
1863
|
}
|
|
1797
1864
|
//#endregion
|
|
1865
|
+
//#region src/utils/CoherentNoise.ts
|
|
1866
|
+
function Dt(e, t, n) {
|
|
1867
|
+
let r = Math.imul(e | 0, 374761393) ^ Math.imul(t | 0, 668265263) ^ Math.imul(n | 0, 362437);
|
|
1868
|
+
return r = Math.imul(r ^ r >>> 13, 1274126177), r ^= r >>> 16, (r >>> 0) / 4294967296;
|
|
1869
|
+
}
|
|
1870
|
+
function X(e, t, n, r) {
|
|
1871
|
+
let i = Math.imul(e | 0, 374761393) ^ Math.imul(t | 0, 668265263) ^ Math.imul(n | 0, 1274126177) ^ Math.imul(r | 0, 362437);
|
|
1872
|
+
return i = Math.imul(i ^ i >>> 13, 1274126177), i ^= i >>> 16, (i >>> 0) / 4294967296;
|
|
1873
|
+
}
|
|
1874
|
+
var Ot = (e) => e * e * (3 - 2 * e);
|
|
1875
|
+
function kt(e, t, n) {
|
|
1876
|
+
let r = Math.floor(e), i = Math.floor(t), a = Ot(e - r), o = Ot(t - i), s = Dt(r, i, n), c = Dt(r + 1, i, n), l = Dt(r, i + 1, n), u = Dt(r + 1, i + 1, n), d = s + (c - s) * a;
|
|
1877
|
+
return d + (l + (u - l) * a - d) * o;
|
|
1878
|
+
}
|
|
1879
|
+
function At(e, t, n, r) {
|
|
1880
|
+
let i = Math.floor(e), a = Math.floor(t), o = Math.floor(n), s = Ot(e - i), c = Ot(t - a), l = Ot(n - o), u = X(i, a, o, r), d = X(i + 1, a, o, r), f = X(i, a + 1, o, r), p = X(i + 1, a + 1, o, r), m = X(i, a, o + 1, r), h = X(i + 1, a, o + 1, r), g = X(i, a + 1, o + 1, r), _ = X(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;
|
|
1881
|
+
return S + (b + (x - b) * c - S) * l;
|
|
1882
|
+
}
|
|
1883
|
+
function jt(e, t, n, r, i) {
|
|
1884
|
+
let a = 0, o = 1, s = 1, c = 0;
|
|
1885
|
+
for (let l = 0; l < r; l++) a += (kt(e * s, t * s, n + l * 101) * 2 - 1) * o, c += o, o *= i, s *= 2;
|
|
1886
|
+
return c > 0 ? a / c : 0;
|
|
1887
|
+
}
|
|
1888
|
+
function Mt(e, t, n, r, i, a) {
|
|
1889
|
+
let o = 0, s = 1, c = 1, l = 0;
|
|
1890
|
+
for (let u = 0; u < i; u++) o += (At(e * c, t * c, n * c, r + u * 101) * 2 - 1) * s, l += s, s *= a, c *= 2;
|
|
1891
|
+
return l > 0 ? o / l : 0;
|
|
1892
|
+
}
|
|
1893
|
+
//#endregion
|
|
1894
|
+
//#region src/geometry/rocks/BoulderGeometry.ts
|
|
1895
|
+
var Nt = class extends s {
|
|
1896
|
+
radius;
|
|
1897
|
+
constructor({ radius: e = 1, detail: t = 2, noiseHeight: n = .35, noiseScale: r = 1.6, octaves: i = 3, persistence: a = .5, seed: o = 1 } = {}) {
|
|
1898
|
+
super(), this.radius = e;
|
|
1899
|
+
let s = new C(e, t);
|
|
1900
|
+
s.deleteAttribute("uv"), s.deleteAttribute("normal");
|
|
1901
|
+
let c = ge(s);
|
|
1902
|
+
s.dispose();
|
|
1903
|
+
let l = c.getAttribute("position"), u = new z(), d = r / e;
|
|
1904
|
+
for (let e = 0; e < l.count; e++) {
|
|
1905
|
+
u.fromBufferAttribute(l, e);
|
|
1906
|
+
let t = Mt(u.x * d, u.y * d, u.z * d, o, i, a), r = u.length() || 1, s = (r + t * n) / r;
|
|
1907
|
+
l.setXYZ(e, u.x * s, u.y * s, u.z * s);
|
|
1908
|
+
}
|
|
1909
|
+
l.needsUpdate = !0, c.computeVertexNormals(), c.center(), this.copy(c), c.dispose();
|
|
1910
|
+
}
|
|
1911
|
+
};
|
|
1912
|
+
//#endregion
|
|
1913
|
+
//#region src/factory/BoulderFactory.ts
|
|
1914
|
+
function Pt({ 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: c = 2, noiseHeight: l = .35, noiseScale: u = 1.6, octaves: f = 3, persistence: p = .5, variants: m = 4, material: h, color: g = "#6f6f6f" } = {}) {
|
|
1915
|
+
let _ = J(o), v = Math.max(1, Math.min(Math.round(m), Math.max(1, e))), b = h ?? new M({
|
|
1916
|
+
color: new d(g),
|
|
1917
|
+
roughness: 1,
|
|
1918
|
+
metalness: 0,
|
|
1919
|
+
flatShading: !0
|
|
1920
|
+
}), x = [];
|
|
1921
|
+
for (let e = 0; e < v; e++) x.push(new Nt({
|
|
1922
|
+
radius: s,
|
|
1923
|
+
detail: c,
|
|
1924
|
+
noiseHeight: l,
|
|
1925
|
+
noiseScale: u,
|
|
1926
|
+
octaves: f,
|
|
1927
|
+
persistence: p,
|
|
1928
|
+
seed: _.int(0, 1e6)
|
|
1929
|
+
}));
|
|
1930
|
+
let C = Array(v).fill(0);
|
|
1931
|
+
for (let t = 0; t < e; t++) C[t % v]++;
|
|
1932
|
+
let T = x.map((e, t) => new w(e, b, C[t])), E = Array(v).fill(0), D = new O(), k = new z(), A = new F(), j = new z(), ee = new y();
|
|
1933
|
+
for (let o = 0; o < e; o++) {
|
|
1934
|
+
let e = _.float(i, a);
|
|
1935
|
+
j.set(e, e, e), ee.set(_.float(0, Math.PI * 2), _.float(0, Math.PI * 2), _.float(0, Math.PI * 2)), A.setFromEuler(ee), k.set(_.float(-t / 2, t / 2), _.float(0, r), _.float(-n / 2, n / 2)), D.compose(k, A, j);
|
|
1936
|
+
let s = o % v;
|
|
1937
|
+
T[s].setMatrixAt(E[s]++, D);
|
|
1938
|
+
}
|
|
1939
|
+
let N = new S();
|
|
1940
|
+
for (let e of T) e.instanceMatrix.needsUpdate = !0, e.castShadow = !0, e.receiveShadow = !0, N.add(e);
|
|
1941
|
+
return N;
|
|
1942
|
+
}
|
|
1943
|
+
//#endregion
|
|
1798
1944
|
//#region src/shapes/HexagonShape.ts
|
|
1799
|
-
var
|
|
1945
|
+
var Ft = class extends I {
|
|
1800
1946
|
constructor(e = 1) {
|
|
1801
1947
|
super();
|
|
1802
1948
|
for (let t = 0; t < 6; t++) {
|
|
@@ -1805,11 +1951,11 @@ var Et = class extends F {
|
|
|
1805
1951
|
}
|
|
1806
1952
|
this.closePath();
|
|
1807
1953
|
}
|
|
1808
|
-
},
|
|
1954
|
+
}, It = class extends b {
|
|
1809
1955
|
radius;
|
|
1810
1956
|
depth;
|
|
1811
1957
|
constructor({ radius: e = 1, depth: t = .01 } = {}) {
|
|
1812
|
-
super(new
|
|
1958
|
+
super(new Ft(e), {
|
|
1813
1959
|
depth: t,
|
|
1814
1960
|
bevelEnabled: !1
|
|
1815
1961
|
}), this.radius = e, this.depth = t;
|
|
@@ -1817,26 +1963,26 @@ var Et = class extends F {
|
|
|
1817
1963
|
};
|
|
1818
1964
|
//#endregion
|
|
1819
1965
|
//#region src/factory/HexagonalTileFactory.ts
|
|
1820
|
-
function
|
|
1821
|
-
let { width: t, depth: n, height: r, count: i, gap: a, material: o } = e, s = o || new
|
|
1966
|
+
function Lt(e) {
|
|
1967
|
+
let { width: t, depth: n, height: r, count: i, gap: a, material: o } = e, s = o || new M({ 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 It({
|
|
1822
1968
|
radius: l,
|
|
1823
1969
|
depth: r
|
|
1824
1970
|
});
|
|
1825
1971
|
p.rotateX(-Math.PI / 2);
|
|
1826
|
-
let m = new
|
|
1972
|
+
let m = new w(p, s, f), h = new N(), g = 0;
|
|
1827
1973
|
for (let e = 0; e < i; e++) for (let t = 0; t < d; t++) {
|
|
1828
1974
|
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;
|
|
1829
1975
|
h.position.set(a, 0, o), h.updateMatrix(), m.setMatrixAt(g++, h.matrix);
|
|
1830
1976
|
}
|
|
1831
1977
|
return m.instanceMatrix.needsUpdate = !0, m;
|
|
1832
1978
|
}
|
|
1833
|
-
function
|
|
1834
|
-
let { width: t, depth: n, height: r, radius: i, gap: a, material: o } = e, s = o || new
|
|
1979
|
+
function Rt(e) {
|
|
1980
|
+
let { width: t, depth: n, height: r, radius: i, gap: a, material: o } = e, s = o || new M({ 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 It({
|
|
1835
1981
|
radius: i,
|
|
1836
1982
|
depth: r
|
|
1837
1983
|
});
|
|
1838
1984
|
p.rotateX(-Math.PI / 2);
|
|
1839
|
-
let m = new
|
|
1985
|
+
let m = new w(p, s, f), h = new N(), g = 0;
|
|
1840
1986
|
for (let e = 0; e < u; e++) for (let t = 0; t < d; t++) {
|
|
1841
1987
|
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;
|
|
1842
1988
|
h.position.set(i, 0, a), h.updateMatrix(), m.setMatrixAt(g++, h.matrix);
|
|
@@ -1845,55 +1991,55 @@ function kt(e) {
|
|
|
1845
1991
|
}
|
|
1846
1992
|
//#endregion
|
|
1847
1993
|
//#region src/geometry/rocks/MossyRockGeometry.ts
|
|
1848
|
-
var
|
|
1994
|
+
var zt = class extends s {
|
|
1849
1995
|
radius;
|
|
1850
1996
|
detail;
|
|
1851
1997
|
constructor({ radius: e = 1, detail: t = 0, mossScaleXZ: n = .9, mossScaleY: r = .5, mossOffsetY: i = .3 } = {}) {
|
|
1852
1998
|
super(), this.radius = e, this.detail = t;
|
|
1853
1999
|
let a = new h(e, t), o = new h(e, t);
|
|
1854
|
-
o.scale(n, r, n), o.translate(0, i, 0), this.copy(
|
|
2000
|
+
o.scale(n, r, n), o.translate(0, i, 0), this.copy(B([a, o], !0)), this.computeVertexNormals();
|
|
1855
2001
|
}
|
|
1856
2002
|
};
|
|
1857
2003
|
//#endregion
|
|
1858
2004
|
//#region src/utils/VertexUtils.ts
|
|
1859
|
-
function
|
|
2005
|
+
function Bt(e, t = Pe.XYZ, n = .5, r = 2) {
|
|
1860
2006
|
e.deleteAttribute("uv"), e.deleteAttribute("normal"), e = ge(e), e.computeVertexNormals();
|
|
1861
2007
|
let i = e.getAttribute("position");
|
|
1862
2008
|
for (let e = 0; e < i.count; e++) {
|
|
1863
|
-
let a = new
|
|
2009
|
+
let a = new z().fromBufferAttribute(i, e), o = Math.random() * (r - n) + n, s = t.clone().multiplyScalar(o);
|
|
1864
2010
|
a.add(s), i.setXYZ(e, a.x, a.y, a.z);
|
|
1865
2011
|
}
|
|
1866
2012
|
return i.needsUpdate = !0, e.computeVertexNormals(), e;
|
|
1867
2013
|
}
|
|
1868
2014
|
//#endregion
|
|
1869
2015
|
//#region src/geometry/rocks/RockGeometry.ts
|
|
1870
|
-
var
|
|
2016
|
+
var Vt = class extends s {
|
|
1871
2017
|
radius;
|
|
1872
2018
|
widthSegments;
|
|
1873
2019
|
heightSegments;
|
|
1874
2020
|
constructor({ radius: e = 1, widthSegments: t = 4, heightSegments: n = 4 } = {}) {
|
|
1875
2021
|
super(), this.radius = e, this.widthSegments = t, this.heightSegments = n;
|
|
1876
|
-
let r = new
|
|
1877
|
-
this.copy(
|
|
2022
|
+
let r = new L(e, t, n);
|
|
2023
|
+
this.copy(Bt(r, Pe.XYZ, .5, 1)), this.computeVertexNormals(), this.center();
|
|
1878
2024
|
}
|
|
1879
2025
|
};
|
|
1880
2026
|
//#endregion
|
|
1881
2027
|
//#region src/factory/RockFactory.ts
|
|
1882
|
-
function
|
|
1883
|
-
let c =
|
|
2028
|
+
function Ht(e, { count: t = 5, width: n = 4, depth: r = 4, heightJitter: i = 0, scaleMin: a = .8, scaleMax: o = 1.2, seed: s }) {
|
|
2029
|
+
let c = J(s), l = new O(), u = new z(), d = new F(), f = new z(), p = new y();
|
|
1884
2030
|
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);
|
|
1885
2031
|
e.instanceMatrix.needsUpdate = !0;
|
|
1886
2032
|
}
|
|
1887
|
-
function
|
|
1888
|
-
let p = u ?? new
|
|
2033
|
+
function Ut({ 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: c = 4, heightSegments: l = 4, material: u, color: f = "#808080" } = {}) {
|
|
2034
|
+
let p = u ?? new M({
|
|
1889
2035
|
color: new d(f),
|
|
1890
2036
|
flatShading: !0
|
|
1891
|
-
}), m = new
|
|
2037
|
+
}), m = new w(new Vt({
|
|
1892
2038
|
radius: s,
|
|
1893
2039
|
widthSegments: c,
|
|
1894
2040
|
heightSegments: l
|
|
1895
2041
|
}), p, e);
|
|
1896
|
-
return
|
|
2042
|
+
return Ht(m, {
|
|
1897
2043
|
count: e,
|
|
1898
2044
|
width: t,
|
|
1899
2045
|
depth: n,
|
|
@@ -1903,23 +2049,23 @@ function Pt({ count: e = 5, width: t = 4, depth: n = 4, heightJitter: r = 0, sca
|
|
|
1903
2049
|
seed: o
|
|
1904
2050
|
}), m;
|
|
1905
2051
|
}
|
|
1906
|
-
function
|
|
1907
|
-
let v = [p ?? new
|
|
2052
|
+
function Wt({ 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: c = 0, mossScaleXZ: l = .9, mossScaleY: u = .5, mossOffsetY: f = .3, rockMaterial: p, mossMaterial: m, rockColor: h = "#808080", mossColor: g = "#4b8b3b", mossOpacity: _ = .8 } = {}) {
|
|
2053
|
+
let v = [p ?? new M({
|
|
1908
2054
|
color: new d(h),
|
|
1909
2055
|
flatShading: !0
|
|
1910
|
-
}), m ?? new
|
|
2056
|
+
}), m ?? new M({
|
|
1911
2057
|
color: new d(g),
|
|
1912
2058
|
flatShading: !0,
|
|
1913
2059
|
opacity: _,
|
|
1914
2060
|
transparent: _ < 1
|
|
1915
|
-
})], y = new
|
|
2061
|
+
})], y = new w(new zt({
|
|
1916
2062
|
radius: s,
|
|
1917
2063
|
detail: c,
|
|
1918
2064
|
mossScaleXZ: l,
|
|
1919
2065
|
mossScaleY: u,
|
|
1920
2066
|
mossOffsetY: f
|
|
1921
2067
|
}), v, e);
|
|
1922
|
-
return
|
|
2068
|
+
return Ht(y, {
|
|
1923
2069
|
count: e,
|
|
1924
2070
|
width: t,
|
|
1925
2071
|
depth: n,
|
|
@@ -1931,10 +2077,10 @@ function Ft({ count: e = 5, width: t = 4, depth: n = 4, heightJitter: r = 0, sca
|
|
|
1931
2077
|
}
|
|
1932
2078
|
//#endregion
|
|
1933
2079
|
//#region src/geometry/architecture/diamondLattice.ts
|
|
1934
|
-
function
|
|
2080
|
+
function Gt(e, t) {
|
|
1935
2081
|
return (e / 2 + t / 2) / Math.SQRT2;
|
|
1936
2082
|
}
|
|
1937
|
-
function
|
|
2083
|
+
function Kt(e, t, n, r) {
|
|
1938
2084
|
let i = Math.max(1, Math.round(n)), a = Math.max(1, Math.round(r)), o = e / (2 * i), s = t / (2 * a);
|
|
1939
2085
|
return {
|
|
1940
2086
|
a: o,
|
|
@@ -1943,30 +2089,30 @@ function Lt(e, t, n, r) {
|
|
|
1943
2089
|
spacing: 2 * o * s / Math.hypot(o, s)
|
|
1944
2090
|
};
|
|
1945
2091
|
}
|
|
1946
|
-
function
|
|
1947
|
-
let r =
|
|
2092
|
+
function qt(e, t, n) {
|
|
2093
|
+
let r = Gt(e, t);
|
|
1948
2094
|
return r / Math.max(2, Math.round(r / n));
|
|
1949
2095
|
}
|
|
1950
|
-
function
|
|
1951
|
-
return
|
|
2096
|
+
function Jt(e, t, n) {
|
|
2097
|
+
return Gt(e, t) / Math.max(2, n);
|
|
1952
2098
|
}
|
|
1953
|
-
function
|
|
2099
|
+
function Yt({ width: e, height: t, centerY: n = 0, grid: r, leadThickness: i, leadDepth: o }) {
|
|
1954
2100
|
let s = e / 2, c = t / 2, l = [
|
|
1955
2101
|
new a(e + i, i, o).translate(0, n - c, 0),
|
|
1956
2102
|
new a(e + i, i, o).translate(0, n + c, 0),
|
|
1957
2103
|
new a(i, t + i, o).translate(-s, n, 0),
|
|
1958
2104
|
new a(i, t + i, o).translate(s, n, 0)
|
|
1959
2105
|
];
|
|
1960
|
-
return
|
|
2106
|
+
return Zt(l, e, t, n, r.spacing, i, o, r.angle), Zt(l, e, t, n, r.spacing, i, o, -r.angle), l;
|
|
1961
2107
|
}
|
|
1962
|
-
function
|
|
2108
|
+
function Xt(e) {
|
|
1963
2109
|
let { width: t, height: n, centerY: r = 0, grid: i, leadThickness: a, leadDepth: o } = e, s = [];
|
|
1964
|
-
return
|
|
2110
|
+
return Zt(s, t, n, r, i.spacing, a, o, i.angle), Zt(s, t, n, r, i.spacing, a, o, -i.angle), s;
|
|
1965
2111
|
}
|
|
1966
|
-
function
|
|
2112
|
+
function Zt(e, t, n, r, i, o, s, c) {
|
|
1967
2113
|
let l = t / 2, u = n / 2, d = -l, f = l, p = r - u, m = r + u, h = Math.hypot(t, n) + o, g = -Math.sin(c), _ = Math.cos(c), v = Math.ceil(Math.hypot(t, n) / i) + 2;
|
|
1968
2114
|
for (let t = -v; t <= v; t++) {
|
|
1969
|
-
let n = g * t * i, l = r + _ * t * i, u = Math.cos(c) * h * .5, v = Math.sin(c) * h * .5, y =
|
|
2115
|
+
let n = g * t * i, l = r + _ * t * i, u = Math.cos(c) * h * .5, v = Math.sin(c) * h * .5, y = Qt(n - u, l - v, n + u, l + v, d, p, f, m);
|
|
1970
2116
|
if (!y) continue;
|
|
1971
2117
|
let [b, x, S, C] = y, w = Math.hypot(S - b, C - x);
|
|
1972
2118
|
if (w < 1e-6) continue;
|
|
@@ -1974,7 +2120,7 @@ function Ht(e, t, n, r, i, o, s, c) {
|
|
|
1974
2120
|
T.rotateZ(c), T.translate((b + S) / 2, (x + C) / 2, 0), e.push(T);
|
|
1975
2121
|
}
|
|
1976
2122
|
}
|
|
1977
|
-
function
|
|
2123
|
+
function Qt(e, t, n, r, i, a, o, s) {
|
|
1978
2124
|
let c = n - e, l = r - t, u = 0, d = 1, f = [[
|
|
1979
2125
|
e,
|
|
1980
2126
|
c,
|
|
@@ -1999,7 +2145,7 @@ function Ut(e, t, n, r, i, a, o, s) {
|
|
|
1999
2145
|
t + l * d
|
|
2000
2146
|
];
|
|
2001
2147
|
}
|
|
2002
|
-
function
|
|
2148
|
+
function Z({ width: e, rectHeight: t, archHeight: n = e / 2, centerY: r = 0 }) {
|
|
2003
2149
|
let i = Math.max(n, 1e-6), a = (e * e + 4 * i * i) / (8 * i), o = t + i, s = r - o / 2, c = s + t, l = c + i - a;
|
|
2004
2150
|
return {
|
|
2005
2151
|
hw: e / 2,
|
|
@@ -2013,7 +2159,7 @@ function Y({ width: e, rectHeight: t, archHeight: n = e / 2, centerY: r = 0 }) {
|
|
|
2013
2159
|
centerY: r
|
|
2014
2160
|
};
|
|
2015
2161
|
}
|
|
2016
|
-
function
|
|
2162
|
+
function $t(e, t, { hole: n = !1 } = {}) {
|
|
2017
2163
|
let { hw: r, ymin: i, rectTopY: a, archCy: o, archRadius: s } = t, c = Math.atan2(a - o, -r), l = Math.atan2(a - o, r);
|
|
2018
2164
|
if (!n) {
|
|
2019
2165
|
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();
|
|
@@ -2021,7 +2167,7 @@ function Wt(e, t, { hole: n = !1 } = {}) {
|
|
|
2021
2167
|
}
|
|
2022
2168
|
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();
|
|
2023
2169
|
}
|
|
2024
|
-
function
|
|
2170
|
+
function en(e, t) {
|
|
2025
2171
|
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;
|
|
2026
2172
|
return {
|
|
2027
2173
|
hw: n,
|
|
@@ -2035,30 +2181,30 @@ function Gt(e, t) {
|
|
|
2035
2181
|
centerY: (r + c) / 2
|
|
2036
2182
|
};
|
|
2037
2183
|
}
|
|
2038
|
-
var
|
|
2039
|
-
function
|
|
2040
|
-
let r = new
|
|
2041
|
-
|
|
2184
|
+
var tn = 48;
|
|
2185
|
+
function nn(e, t, n) {
|
|
2186
|
+
let r = new I();
|
|
2187
|
+
$t(r, e);
|
|
2042
2188
|
let i = new ne();
|
|
2043
|
-
|
|
2189
|
+
$t(i, en(e, t), { hole: !0 }), r.holes.push(i);
|
|
2044
2190
|
let a = new b(r, {
|
|
2045
2191
|
depth: n,
|
|
2046
2192
|
bevelEnabled: !1,
|
|
2047
|
-
curveSegments:
|
|
2193
|
+
curveSegments: tn
|
|
2048
2194
|
});
|
|
2049
2195
|
return a.translate(0, 0, -n / 2), a;
|
|
2050
2196
|
}
|
|
2051
|
-
function
|
|
2197
|
+
function rn(e, t, n) {
|
|
2052
2198
|
let r = 2 * n.b, i = t - e;
|
|
2053
2199
|
return Math.round(i / r) * r - i;
|
|
2054
2200
|
}
|
|
2055
|
-
function
|
|
2201
|
+
function an(e, t, { hw: n, ymin: r, ymax: i, rectTopY: a, archCy: o, archRadius: s }, c = 1e-6) {
|
|
2056
2202
|
if (t < r - c || t > i + c) return !1;
|
|
2057
2203
|
if (t <= a + c) return Math.abs(e) <= n + c;
|
|
2058
2204
|
let l = e, u = t - o;
|
|
2059
2205
|
return l * l + u * u <= s * s + c;
|
|
2060
2206
|
}
|
|
2061
|
-
function
|
|
2207
|
+
function on(e, t, n, r, i) {
|
|
2062
2208
|
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) => {
|
|
2063
2209
|
e > 1e-9 && e < .999999999 && a.add(e);
|
|
2064
2210
|
};
|
|
@@ -2070,11 +2216,11 @@ function Xt(e, t, n, r, i) {
|
|
|
2070
2216
|
}
|
|
2071
2217
|
return [...a].sort((e, t) => e - t);
|
|
2072
2218
|
}
|
|
2073
|
-
function
|
|
2074
|
-
let a =
|
|
2219
|
+
function sn(e, t, n, r, i) {
|
|
2220
|
+
let a = Z(i), o = on(e, t, n, r, a), s = n - e, c = r - t, l = [], u = null, d = 0;
|
|
2075
2221
|
for (let n = 0; n < o.length - 1; n++) {
|
|
2076
2222
|
let r = o[n], i = o[n + 1], f = (r + i) * .5;
|
|
2077
|
-
|
|
2223
|
+
an(e + s * f, t + c * f, a) ? (u === null && (u = r), d = i) : u !== null && (l.push([u, d]), u = null);
|
|
2078
2224
|
}
|
|
2079
2225
|
u !== null && l.push([u, d]);
|
|
2080
2226
|
let f = null, p = 0;
|
|
@@ -2091,7 +2237,7 @@ function Zt(e, t, n, r, i) {
|
|
|
2091
2237
|
t + c * h
|
|
2092
2238
|
];
|
|
2093
2239
|
}
|
|
2094
|
-
function
|
|
2240
|
+
function cn(e) {
|
|
2095
2241
|
return {
|
|
2096
2242
|
width: 2 * e.hw,
|
|
2097
2243
|
rectHeight: e.rectTopY - e.ymin,
|
|
@@ -2099,24 +2245,24 @@ function Qt(e) {
|
|
|
2099
2245
|
centerY: e.centerY
|
|
2100
2246
|
};
|
|
2101
2247
|
}
|
|
2102
|
-
function
|
|
2248
|
+
function ln(e, t, n, r) {
|
|
2103
2249
|
let { hw: i, rectTopY: o, archCy: s, archRadius: c } = t, l = Math.atan2(o - s, -i), u = Math.atan2(o - s, i) - l, d = Math.max(12, Math.ceil(Math.abs(u) * c / (n * 1.8)));
|
|
2104
2250
|
for (let t = 0; t < d; t++) {
|
|
2105
2251
|
let i = t / d, o = (t + 1) / d, f = l + u * i, p = l + u * o, m = (f + p) / 2, h = new a(2 * c * Math.sin((p - f) / 2), n, r);
|
|
2106
2252
|
h.rotateZ(m - Math.PI / 2), h.translate(c * Math.cos(m), s + c * Math.sin(m), 0), e.push(h);
|
|
2107
2253
|
}
|
|
2108
2254
|
}
|
|
2109
|
-
function
|
|
2255
|
+
function un({ width: e, rectHeight: t, archHeight: n, centerY: r = 0, grid: i, leadThickness: a, leadDepth: o, clipInset: s = 0 }) {
|
|
2110
2256
|
let c = {
|
|
2111
2257
|
width: e,
|
|
2112
2258
|
rectHeight: t,
|
|
2113
2259
|
archHeight: n,
|
|
2114
2260
|
centerY: r
|
|
2115
|
-
}, l =
|
|
2116
|
-
return
|
|
2261
|
+
}, l = Z(c), u = s > 0 ? cn(en(l, s)) : c, d = [], f = rn(l.ymin, l.rectTopY, i);
|
|
2262
|
+
return fn(d, u, l, i, f, a, o, i.angle), fn(d, u, l, i, f, a, o, -i.angle), d;
|
|
2117
2263
|
}
|
|
2118
|
-
function
|
|
2119
|
-
let { width: t, rectHeight: n, archHeight: r, centerY: i = 0, leadThickness: o, leadDepth: s } = e, c =
|
|
2264
|
+
function dn(e) {
|
|
2265
|
+
let { width: t, rectHeight: n, archHeight: r, centerY: i = 0, leadThickness: o, leadDepth: s } = e, c = Z({
|
|
2120
2266
|
width: t,
|
|
2121
2267
|
rectHeight: n,
|
|
2122
2268
|
archHeight: r,
|
|
@@ -2126,12 +2272,12 @@ function tn(e) {
|
|
|
2126
2272
|
new a(o, f + o, s).translate(-l, u + f / 2, 0),
|
|
2127
2273
|
new a(o, f + o, s).translate(l, u + f / 2, 0)
|
|
2128
2274
|
];
|
|
2129
|
-
return
|
|
2275
|
+
return ln(p, c, o, s), p.push(...un(e)), p;
|
|
2130
2276
|
}
|
|
2131
|
-
function
|
|
2277
|
+
function fn(e, t, n, r, i, o, s, c) {
|
|
2132
2278
|
let { totalHeight: l, centerY: u } = n, d = r.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 + i;
|
|
2133
2279
|
for (let n = -h; n <= h; n++) {
|
|
2134
|
-
let r = p * n * d, i = g + m * n * d, l = Math.cos(c) * f * .5, u = Math.sin(c) * f * .5, h =
|
|
2280
|
+
let r = p * n * d, i = g + m * n * d, l = Math.cos(c) * f * .5, u = Math.sin(c) * f * .5, h = sn(r - l, i - u, r + l, i + u, t);
|
|
2135
2281
|
if (!h) continue;
|
|
2136
2282
|
let [_, v, y, b] = h, x = Math.hypot(y - _, b - v);
|
|
2137
2283
|
if (x < 1e-6) continue;
|
|
@@ -2141,19 +2287,19 @@ function nn(e, t, n, r, i, o, s, c) {
|
|
|
2141
2287
|
}
|
|
2142
2288
|
//#endregion
|
|
2143
2289
|
//#region src/geometry/architecture/ArchedDiamondLatticeWindowGeometry.ts
|
|
2144
|
-
var
|
|
2290
|
+
var pn = class extends s {
|
|
2145
2291
|
cellsX;
|
|
2146
2292
|
cellsY;
|
|
2147
2293
|
fittedGrid;
|
|
2148
2294
|
opening;
|
|
2149
2295
|
constructor({ width: e = 4.5, rectHeight: t = 4, archHeight: n, leadThickness: r = .055, leadDepth: i = .11, cellsX: a = 10, cellsY: o = 12, centerY: s = 0 } = {}) {
|
|
2150
|
-
super(), this.cellsX = Math.max(1, Math.round(a)), this.cellsY = Math.max(1, Math.round(o)), this.opening =
|
|
2296
|
+
super(), this.cellsX = Math.max(1, Math.round(a)), this.cellsY = Math.max(1, Math.round(o)), this.opening = Z({
|
|
2151
2297
|
width: e,
|
|
2152
2298
|
rectHeight: t,
|
|
2153
2299
|
archHeight: n,
|
|
2154
2300
|
centerY: s
|
|
2155
|
-
}), this.fittedGrid =
|
|
2156
|
-
let c =
|
|
2301
|
+
}), this.fittedGrid = Kt(e, this.opening.totalHeight, this.cellsX, this.cellsY);
|
|
2302
|
+
let c = un({
|
|
2157
2303
|
width: e,
|
|
2158
2304
|
rectHeight: t,
|
|
2159
2305
|
archHeight: n,
|
|
@@ -2162,25 +2308,25 @@ var rn = class extends s {
|
|
|
2162
2308
|
leadThickness: r,
|
|
2163
2309
|
leadDepth: i,
|
|
2164
2310
|
clipInset: r * .5
|
|
2165
|
-
}), l =
|
|
2311
|
+
}), l = B(c);
|
|
2166
2312
|
if (!l) throw Error("ArchedDiamondLatticeWindowGeometry: merge failed");
|
|
2167
2313
|
this.copy(l), l.dispose();
|
|
2168
2314
|
for (let e of c) e.dispose();
|
|
2169
2315
|
}
|
|
2170
|
-
},
|
|
2316
|
+
}, mn = class extends s {
|
|
2171
2317
|
cellsX;
|
|
2172
2318
|
cellsY;
|
|
2173
2319
|
fittedGrid;
|
|
2174
2320
|
constructor({ width: e = 4.5, height: t = 5.5, leadThickness: n = .055, leadDepth: r = .11, cellsX: i = 10, cellsY: a = 10, centerY: o = 0 } = {}) {
|
|
2175
|
-
super(), this.cellsX = Math.max(1, Math.round(i)), this.cellsY = Math.max(1, Math.round(a)), this.fittedGrid =
|
|
2176
|
-
let s =
|
|
2321
|
+
super(), this.cellsX = Math.max(1, Math.round(i)), this.cellsY = Math.max(1, Math.round(a)), this.fittedGrid = Kt(e, t, this.cellsX, this.cellsY);
|
|
2322
|
+
let s = Yt({
|
|
2177
2323
|
width: e,
|
|
2178
2324
|
height: t,
|
|
2179
2325
|
centerY: o,
|
|
2180
2326
|
grid: this.fittedGrid,
|
|
2181
2327
|
leadThickness: n,
|
|
2182
2328
|
leadDepth: r
|
|
2183
|
-
}), c =
|
|
2329
|
+
}), c = B(s);
|
|
2184
2330
|
if (!c) throw Error("DiamondLatticeWindowGeometry: merge failed");
|
|
2185
2331
|
this.copy(c), c.dispose();
|
|
2186
2332
|
for (let e of s) e.dispose();
|
|
@@ -2188,20 +2334,20 @@ var rn = class extends s {
|
|
|
2188
2334
|
};
|
|
2189
2335
|
//#endregion
|
|
2190
2336
|
//#region src/geometry/architecture/gregorianLattice.ts
|
|
2191
|
-
function
|
|
2337
|
+
function hn(e, t, n, r) {
|
|
2192
2338
|
let i = Math.max(1, Math.round(n)), a = Math.max(1, Math.round(r));
|
|
2193
2339
|
return {
|
|
2194
2340
|
paneWidth: e / i,
|
|
2195
2341
|
paneHeight: t / a
|
|
2196
2342
|
};
|
|
2197
2343
|
}
|
|
2198
|
-
function
|
|
2344
|
+
function gn({ width: e, height: t, centerY: n = 0, cellsX: r, cellsY: i, mullionThickness: o, mullionDepth: s }) {
|
|
2199
2345
|
let c = e / 2, l = t / 2, u = [
|
|
2200
2346
|
new a(e + o, o, s).translate(0, n - l, 0),
|
|
2201
2347
|
new a(e + o, o, s).translate(0, n + l, 0),
|
|
2202
2348
|
new a(o, t + o, s).translate(-c, n, 0),
|
|
2203
2349
|
new a(o, t + o, s).translate(c, n, 0)
|
|
2204
|
-
], { paneWidth: d, paneHeight: f } =
|
|
2350
|
+
], { paneWidth: d, paneHeight: f } = hn(e, t, r, i);
|
|
2205
2351
|
for (let e = 1; e < r; e++) {
|
|
2206
2352
|
let r = -c + d * e;
|
|
2207
2353
|
u.push(new a(o, t + o, s).translate(r, n, 0));
|
|
@@ -2214,13 +2360,13 @@ function sn({ width: e, height: t, centerY: n = 0, cellsX: r, cellsY: i, mullion
|
|
|
2214
2360
|
}
|
|
2215
2361
|
//#endregion
|
|
2216
2362
|
//#region src/geometry/architecture/GregorianLatticeWindowGeometry.ts
|
|
2217
|
-
var
|
|
2363
|
+
var _n = class extends s {
|
|
2218
2364
|
cellsX;
|
|
2219
2365
|
cellsY;
|
|
2220
2366
|
fittedGrid;
|
|
2221
2367
|
constructor({ width: e = 4.5, height: t = 5.5, mullionThickness: n = .055, mullionDepth: r = .11, cellsX: i = 4, cellsY: a = 6, centerY: o = 0 } = {}) {
|
|
2222
|
-
super(), this.cellsX = Math.max(1, Math.round(i)), this.cellsY = Math.max(1, Math.round(a)), this.fittedGrid =
|
|
2223
|
-
let s =
|
|
2368
|
+
super(), this.cellsX = Math.max(1, Math.round(i)), this.cellsY = Math.max(1, Math.round(a)), this.fittedGrid = hn(e, t, this.cellsX, this.cellsY);
|
|
2369
|
+
let s = gn({
|
|
2224
2370
|
width: e,
|
|
2225
2371
|
height: t,
|
|
2226
2372
|
centerY: o,
|
|
@@ -2228,26 +2374,26 @@ var cn = class extends s {
|
|
|
2228
2374
|
cellsY: this.cellsY,
|
|
2229
2375
|
mullionThickness: n,
|
|
2230
2376
|
mullionDepth: r
|
|
2231
|
-
}), c =
|
|
2377
|
+
}), c = B(s);
|
|
2232
2378
|
if (!c) throw Error("GregorianLatticeWindowGeometry: merge failed");
|
|
2233
2379
|
this.copy(c), c.dispose();
|
|
2234
2380
|
for (let e of s) e.dispose();
|
|
2235
2381
|
}
|
|
2236
|
-
},
|
|
2237
|
-
function
|
|
2382
|
+
}, vn = .96;
|
|
2383
|
+
function yn(e, t, n = 0) {
|
|
2238
2384
|
let r = e / 2, i = t / 2;
|
|
2239
2385
|
return [
|
|
2240
|
-
new re(new
|
|
2241
|
-
new re(new
|
|
2242
|
-
new re(new
|
|
2243
|
-
new re(new
|
|
2386
|
+
new re(new z(1, 0, 0), r),
|
|
2387
|
+
new re(new z(-1, 0, 0), r),
|
|
2388
|
+
new re(new z(0, 1, 0), n + i),
|
|
2389
|
+
new re(new z(0, -1, 0), -n + i)
|
|
2244
2390
|
];
|
|
2245
2391
|
}
|
|
2246
|
-
function
|
|
2392
|
+
function bn(e, t, n, r) {
|
|
2247
2393
|
return n === void 0 ? r === void 0 ? .55 : e / Math.max(1, Math.round(r)) : n;
|
|
2248
2394
|
}
|
|
2249
|
-
function
|
|
2250
|
-
let i = r *
|
|
2395
|
+
function xn({ width: e, height: t, centerY: n = 0, cell: r }) {
|
|
2396
|
+
let i = r * vn, a = i * .6, o = t / 2, s = e / 2 + a, c = Math.ceil(2 * s / i) + 1, l = (c - 1) * i, u = Array.from({ length: c }, (e, t) => -l / 2 + t * i), d = [], f = n - o + i * .5 - a, p = n + o - i * .5 + a;
|
|
2251
2397
|
for (let e = f; e <= p + 1e-9; e += i) for (let t of u) d.push([t, e]);
|
|
2252
2398
|
return {
|
|
2253
2399
|
spots: d,
|
|
@@ -2259,8 +2405,8 @@ function fn({ width: e, height: t, centerY: n = 0, cell: r }) {
|
|
|
2259
2405
|
}
|
|
2260
2406
|
};
|
|
2261
2407
|
}
|
|
2262
|
-
function
|
|
2263
|
-
let r = Math.max(e - t, e * .5), i = new
|
|
2408
|
+
function Sn(e, t, n) {
|
|
2409
|
+
let r = Math.max(e - t, e * .5), i = new I();
|
|
2264
2410
|
i.moveTo(-e, -e), i.lineTo(e, -e), i.lineTo(e, e), i.lineTo(-e, e), i.closePath();
|
|
2265
2411
|
let a = new ne();
|
|
2266
2412
|
return a.moveTo(-r, -r), a.lineTo(-r, r), a.lineTo(r, r), a.lineTo(r, -r), a.closePath(), i.holes.push(a), new b(i, {
|
|
@@ -2268,7 +2414,7 @@ function pn(e, t, n) {
|
|
|
2268
2414
|
bevelEnabled: !1
|
|
2269
2415
|
});
|
|
2270
2416
|
}
|
|
2271
|
-
function
|
|
2417
|
+
function Cn({ width: e, height: t, centerY: n = 0, frameThickness: r, frameDepth: i }) {
|
|
2272
2418
|
let o = e / 2, s = t / 2;
|
|
2273
2419
|
return [
|
|
2274
2420
|
new a(e + r, r, i).translate(0, n - s, 0),
|
|
@@ -2279,20 +2425,20 @@ function mn({ width: e, height: t, centerY: n = 0, frameThickness: r, frameDepth
|
|
|
2279
2425
|
}
|
|
2280
2426
|
//#endregion
|
|
2281
2427
|
//#region src/geometry/architecture/staircaseQuad.ts
|
|
2282
|
-
function
|
|
2428
|
+
function Q(e, t, n, r, i, a, o) {
|
|
2283
2429
|
let s = e.length / 3;
|
|
2284
2430
|
for (let [n, r, o] of i) e.push(n, r, o), t.push(...a);
|
|
2285
2431
|
for (let [e, t] of o) n.push(e, t);
|
|
2286
2432
|
r.push(s, s + 1, s + 2, s, s + 2, s + 3);
|
|
2287
2433
|
}
|
|
2288
|
-
var
|
|
2434
|
+
var wn = [
|
|
2289
2435
|
[0, 0],
|
|
2290
2436
|
[0, 1],
|
|
2291
2437
|
[1, 1],
|
|
2292
2438
|
[1, 0]
|
|
2293
2439
|
];
|
|
2294
|
-
function
|
|
2295
|
-
|
|
2440
|
+
function Tn(e, t, n, r, i) {
|
|
2441
|
+
Q(e.positions, e.normals, e.uvs, e.indices, [
|
|
2296
2442
|
[
|
|
2297
2443
|
-t,
|
|
2298
2444
|
n,
|
|
@@ -2324,8 +2470,8 @@ function gn(e, t, n, r, i) {
|
|
|
2324
2470
|
[1, 0]
|
|
2325
2471
|
]);
|
|
2326
2472
|
}
|
|
2327
|
-
function
|
|
2328
|
-
|
|
2473
|
+
function En(e, t, n, r, i) {
|
|
2474
|
+
Q(e.positions, e.normals, e.uvs, e.indices, [
|
|
2329
2475
|
[
|
|
2330
2476
|
-t,
|
|
2331
2477
|
n,
|
|
@@ -2350,10 +2496,10 @@ function _n(e, t, n, r, i) {
|
|
|
2350
2496
|
0,
|
|
2351
2497
|
1,
|
|
2352
2498
|
0
|
|
2353
|
-
],
|
|
2499
|
+
], wn);
|
|
2354
2500
|
}
|
|
2355
|
-
function
|
|
2356
|
-
|
|
2501
|
+
function Dn(e, t, n, r, i, a) {
|
|
2502
|
+
Q(e.positions, e.normals, e.uvs, e.indices, [
|
|
2357
2503
|
[
|
|
2358
2504
|
r,
|
|
2359
2505
|
t,
|
|
@@ -2385,8 +2531,8 @@ function vn(e, t, n, r, i, a) {
|
|
|
2385
2531
|
[1, 0]
|
|
2386
2532
|
]);
|
|
2387
2533
|
}
|
|
2388
|
-
function
|
|
2389
|
-
|
|
2534
|
+
function On(e, t, n, r, i, a) {
|
|
2535
|
+
Q(e.positions, e.normals, e.uvs, e.indices, [
|
|
2390
2536
|
[
|
|
2391
2537
|
n,
|
|
2392
2538
|
t,
|
|
@@ -2411,21 +2557,21 @@ function yn(e, t, n, r, i, a) {
|
|
|
2411
2557
|
0,
|
|
2412
2558
|
1,
|
|
2413
2559
|
0
|
|
2414
|
-
],
|
|
2560
|
+
], wn);
|
|
2415
2561
|
}
|
|
2416
|
-
function
|
|
2562
|
+
function $(e, t) {
|
|
2417
2563
|
return [e * Math.cos(t), e * Math.sin(t)];
|
|
2418
2564
|
}
|
|
2419
|
-
function
|
|
2565
|
+
function kn(e) {
|
|
2420
2566
|
return [
|
|
2421
2567
|
-Math.sin(e),
|
|
2422
2568
|
0,
|
|
2423
2569
|
Math.cos(e)
|
|
2424
2570
|
];
|
|
2425
2571
|
}
|
|
2426
|
-
function
|
|
2427
|
-
let [o, s] =
|
|
2428
|
-
|
|
2572
|
+
function An(e, t, n, r, i, a) {
|
|
2573
|
+
let [o, s] = $(t, a), [c, l] = $(n, a), u = kn(a);
|
|
2574
|
+
Q(e.positions, e.normals, e.uvs, e.indices, [
|
|
2429
2575
|
[
|
|
2430
2576
|
o,
|
|
2431
2577
|
r,
|
|
@@ -2453,9 +2599,9 @@ function xn(e, t, n, r, i, a) {
|
|
|
2453
2599
|
[1, 0]
|
|
2454
2600
|
]);
|
|
2455
2601
|
}
|
|
2456
|
-
function
|
|
2457
|
-
let [o, s] =
|
|
2458
|
-
|
|
2602
|
+
function jn(e, t, n, r, i, a) {
|
|
2603
|
+
let [o, s] = $(t, i), [c, l] = $(t, a), [u, d] = $(n, a), [f, p] = $(n, i);
|
|
2604
|
+
Q(e.positions, e.normals, e.uvs, e.indices, [
|
|
2459
2605
|
[
|
|
2460
2606
|
o,
|
|
2461
2607
|
r,
|
|
@@ -2487,8 +2633,8 @@ function Sn(e, t, n, r, i, a) {
|
|
|
2487
2633
|
[0, 1]
|
|
2488
2634
|
]);
|
|
2489
2635
|
}
|
|
2490
|
-
function
|
|
2491
|
-
|
|
2636
|
+
function Mn(e, t, n, r, i) {
|
|
2637
|
+
Q(e.positions, e.normals, e.uvs, e.indices, [
|
|
2492
2638
|
[
|
|
2493
2639
|
-t,
|
|
2494
2640
|
n,
|
|
@@ -2513,11 +2659,11 @@ function Cn(e, t, n, r, i) {
|
|
|
2513
2659
|
0,
|
|
2514
2660
|
1,
|
|
2515
2661
|
0
|
|
2516
|
-
],
|
|
2662
|
+
], wn);
|
|
2517
2663
|
}
|
|
2518
2664
|
//#endregion
|
|
2519
2665
|
//#region src/geometry/architecture/LShapedStaircaseGeometry.ts
|
|
2520
|
-
var
|
|
2666
|
+
var Nn = class extends s {
|
|
2521
2667
|
width;
|
|
2522
2668
|
riserHeight;
|
|
2523
2669
|
treadDepth;
|
|
@@ -2535,18 +2681,18 @@ var wn = class extends s {
|
|
|
2535
2681
|
};
|
|
2536
2682
|
for (let e = 0; e < this.stepsPerFlight; e++) {
|
|
2537
2683
|
let t = e * this.riserHeight, n = t + this.riserHeight, r = e * this.treadDepth, a = r + this.treadDepth;
|
|
2538
|
-
|
|
2684
|
+
Tn(u, i, t, n, r), En(u, i, n, r, a);
|
|
2539
2685
|
}
|
|
2540
2686
|
let d = this.stepsPerFlight * this.riserHeight, f = (this.stepsPerFlight - 1) * this.treadDepth, p = f + this.landingSize;
|
|
2541
|
-
|
|
2687
|
+
Mn(u, i, d, f, p);
|
|
2542
2688
|
let m = -i;
|
|
2543
2689
|
for (let e = 0; e < this.stepsPerFlight; e++) {
|
|
2544
2690
|
let t = d + e * this.riserHeight, n = t + this.riserHeight, r = m - e * this.treadDepth, i = r - this.treadDepth;
|
|
2545
|
-
|
|
2691
|
+
Dn(u, t, n, r, f, p), On(u, n, r, i, f, p);
|
|
2546
2692
|
}
|
|
2547
2693
|
this.setIndex(l), this.setAttribute("position", new o(new Float32Array(a), 3)), this.setAttribute("normal", new o(new Float32Array(s), 3)), this.setAttribute("uv", new o(new Float32Array(c), 2)), this.computeBoundingSphere();
|
|
2548
2694
|
}
|
|
2549
|
-
},
|
|
2695
|
+
}, Pn = class extends s {
|
|
2550
2696
|
innerRadius;
|
|
2551
2697
|
width;
|
|
2552
2698
|
outerRadius;
|
|
@@ -2569,11 +2715,11 @@ var wn = class extends s {
|
|
|
2569
2715
|
};
|
|
2570
2716
|
for (let e = 0; e < this.stepCount; e++) {
|
|
2571
2717
|
let t = this.startAngle + e * this.stepAngle, n = t + this.stepAngle, r = e * this.riserHeight, i = r + this.riserHeight;
|
|
2572
|
-
|
|
2718
|
+
An(p, this.innerRadius, this.outerRadius, r, i, t), jn(p, this.innerRadius, this.outerRadius, i, t, n);
|
|
2573
2719
|
}
|
|
2574
2720
|
this.setIndex(f), this.setAttribute("position", new o(new Float32Array(l), 3)), this.setAttribute("normal", new o(new Float32Array(u), 3)), this.setAttribute("uv", new o(new Float32Array(d), 2)), this.computeBoundingSphere();
|
|
2575
2721
|
}
|
|
2576
|
-
},
|
|
2722
|
+
}, Fn = class extends s {
|
|
2577
2723
|
width;
|
|
2578
2724
|
riserHeight;
|
|
2579
2725
|
treadDepth;
|
|
@@ -2590,61 +2736,61 @@ var wn = class extends s {
|
|
|
2590
2736
|
};
|
|
2591
2737
|
for (let e = 0; e < this.stepCount; e++) {
|
|
2592
2738
|
let t = e * this.riserHeight, n = t + this.riserHeight, r = e * this.treadDepth, a = r + this.treadDepth;
|
|
2593
|
-
|
|
2739
|
+
Tn(u, i, t, n, r), En(u, i, n, r, a);
|
|
2594
2740
|
}
|
|
2595
2741
|
this.setIndex(l), this.setAttribute("position", new o(new Float32Array(a), 3)), this.setAttribute("normal", new o(new Float32Array(s), 3)), this.setAttribute("uv", new o(new Float32Array(c), 2)), this.computeBoundingSphere();
|
|
2596
2742
|
}
|
|
2597
|
-
},
|
|
2743
|
+
}, In = class extends s {
|
|
2598
2744
|
constructor() {
|
|
2599
2745
|
super();
|
|
2600
|
-
let e = new
|
|
2601
|
-
new
|
|
2602
|
-
new
|
|
2603
|
-
new
|
|
2604
|
-
new
|
|
2605
|
-
new
|
|
2606
|
-
new
|
|
2746
|
+
let e = new E([
|
|
2747
|
+
new R(0, 0),
|
|
2748
|
+
new R(1.2, 0),
|
|
2749
|
+
new R(1.5, 1.5),
|
|
2750
|
+
new R(1, 3),
|
|
2751
|
+
new R(.6, 3.5),
|
|
2752
|
+
new R(.5, 3.5)
|
|
2607
2753
|
], 10), t = new p(.6, .5, .3, 10);
|
|
2608
|
-
t.translate(0, 3.5, 0), this.copy(
|
|
2754
|
+
t.translate(0, 3.5, 0), this.copy(B([e, t], !0));
|
|
2609
2755
|
}
|
|
2610
2756
|
};
|
|
2611
2757
|
//#endregion
|
|
2612
2758
|
//#region src/utils/LineEquations.ts
|
|
2613
|
-
function
|
|
2759
|
+
function Ln(e, t, n, r, i) {
|
|
2614
2760
|
let a = (r - t) / (n - e);
|
|
2615
2761
|
return e + (i - t) / a;
|
|
2616
2762
|
}
|
|
2617
|
-
function
|
|
2763
|
+
function Rn(e, t, n, r, i) {
|
|
2618
2764
|
return t + (r - t) / (n - e) * (i - e);
|
|
2619
2765
|
}
|
|
2620
|
-
var
|
|
2621
|
-
calculateXFromSlopeIntercept:
|
|
2622
|
-
calculateYFromSlopeIntercept:
|
|
2623
|
-
},
|
|
2766
|
+
var zn = {
|
|
2767
|
+
calculateXFromSlopeIntercept: Ln,
|
|
2768
|
+
calculateYFromSlopeIntercept: Rn
|
|
2769
|
+
}, Bn = class extends s {
|
|
2624
2770
|
constructor() {
|
|
2625
2771
|
super();
|
|
2626
|
-
let e = new
|
|
2627
|
-
new
|
|
2628
|
-
new
|
|
2629
|
-
new
|
|
2630
|
-
new
|
|
2631
|
-
new
|
|
2632
|
-
new
|
|
2772
|
+
let e = new E([
|
|
2773
|
+
new R(0, 0),
|
|
2774
|
+
new R(.8, 0),
|
|
2775
|
+
new R(1, 1.5),
|
|
2776
|
+
new R(.5, 2.2),
|
|
2777
|
+
new R(.6, 2.5),
|
|
2778
|
+
new R(.5, 2.5)
|
|
2633
2779
|
], 10), t = new p(.55, .45, .2, 10);
|
|
2634
2780
|
t.translate(0, 2.5, 0);
|
|
2635
|
-
let n = new
|
|
2636
|
-
new
|
|
2637
|
-
new
|
|
2638
|
-
new
|
|
2639
|
-
new
|
|
2781
|
+
let n = new E([
|
|
2782
|
+
new R(0, 0),
|
|
2783
|
+
new R(.8, 0),
|
|
2784
|
+
new R(Ln(.8, 0, 1, 1.5, 1), 1),
|
|
2785
|
+
new R(0, 1)
|
|
2640
2786
|
], 10);
|
|
2641
|
-
n.translate(0, .1, 0), n.scale(.9, .9, .9), this.copy(
|
|
2787
|
+
n.translate(0, .1, 0), n.scale(.9, .9, .9), this.copy(B([
|
|
2642
2788
|
e,
|
|
2643
2789
|
t,
|
|
2644
2790
|
n
|
|
2645
2791
|
], !0));
|
|
2646
2792
|
}
|
|
2647
|
-
},
|
|
2793
|
+
}, Vn = class extends s {
|
|
2648
2794
|
radius;
|
|
2649
2795
|
height;
|
|
2650
2796
|
constructor({ radius: e = .5, neckRadius: t = .2, height: n = 3, neckHeight: r = 1, segments: i = 16 } = {}) {
|
|
@@ -2654,13 +2800,13 @@ var An = {
|
|
|
2654
2800
|
let s = .3, c = new p(t, e, s, i);
|
|
2655
2801
|
c.translate(0, a + s / 2, 0);
|
|
2656
2802
|
let l = new p(t, t, r, i);
|
|
2657
|
-
l.translate(0, a + s + r / 2, 0), this.copy(
|
|
2803
|
+
l.translate(0, a + s + r / 2, 0), this.copy(B([
|
|
2658
2804
|
o,
|
|
2659
2805
|
c,
|
|
2660
2806
|
l
|
|
2661
2807
|
], !1));
|
|
2662
2808
|
}
|
|
2663
|
-
},
|
|
2809
|
+
}, Hn = class extends s {
|
|
2664
2810
|
width;
|
|
2665
2811
|
height;
|
|
2666
2812
|
depth;
|
|
@@ -2669,9 +2815,9 @@ var An = {
|
|
|
2669
2815
|
let r = t * .6, i = new a(e / 2, r, n);
|
|
2670
2816
|
i.translate(0, r / 2, 0);
|
|
2671
2817
|
let o = new a(e * 1.5, e / 4, n);
|
|
2672
|
-
o.translate(0, r * .75, 0), this.copy(
|
|
2818
|
+
o.translate(0, r * .75, 0), this.copy(B([i, o], !1)), this.computeVertexNormals();
|
|
2673
2819
|
}
|
|
2674
|
-
},
|
|
2820
|
+
}, Un = class extends s {
|
|
2675
2821
|
constructor() {
|
|
2676
2822
|
super();
|
|
2677
2823
|
let e = new a(5, 1, 5);
|
|
@@ -2706,20 +2852,20 @@ var An = {
|
|
|
2706
2852
|
});
|
|
2707
2853
|
let i = new f(3.5, 2, 4);
|
|
2708
2854
|
i.rotateY(Math.PI / 4), i.translate(0, 5, 0);
|
|
2709
|
-
let o = new
|
|
2855
|
+
let o = new I();
|
|
2710
2856
|
o.moveTo(-1, 0), o.lineTo(-1, 2), o.absarc(0, 2, 1, Math.PI, 0, !0), o.lineTo(1, 0);
|
|
2711
2857
|
let s = new b(o, {
|
|
2712
2858
|
depth: .5,
|
|
2713
2859
|
bevelEnabled: !1
|
|
2714
2860
|
});
|
|
2715
|
-
s.translate(0, .5, 1.7), s.setIndex([...Array(s.attributes.position.count).keys()]), this.copy(
|
|
2861
|
+
s.translate(0, .5, 1.7), s.setIndex([...Array(s.attributes.position.count).keys()]), this.copy(B([
|
|
2716
2862
|
e,
|
|
2717
|
-
|
|
2863
|
+
B([t, ...r], !1),
|
|
2718
2864
|
i,
|
|
2719
2865
|
s
|
|
2720
2866
|
], !0)), this.computeVertexNormals();
|
|
2721
2867
|
}
|
|
2722
|
-
},
|
|
2868
|
+
}, Wn = class extends s {
|
|
2723
2869
|
totalHeight;
|
|
2724
2870
|
baseWidth;
|
|
2725
2871
|
constructor({ totalHeight: e = 1.75, baseWidth: t = .75 } = {}) {
|
|
@@ -2733,7 +2879,7 @@ var An = {
|
|
|
2733
2879
|
let d = new a(t * .4, o, t * .4);
|
|
2734
2880
|
d.translate(0, s + o / 2, 0), s += o;
|
|
2735
2881
|
let p = new f(t * .4 / Math.sqrt(2), .1, 4, 1, !1, Math.PI / 4);
|
|
2736
|
-
p.translate(0, s + .1 / 2, 0), this.copy(
|
|
2882
|
+
p.translate(0, s + .1 / 2, 0), this.copy(B([
|
|
2737
2883
|
c,
|
|
2738
2884
|
l,
|
|
2739
2885
|
u,
|
|
@@ -2741,21 +2887,21 @@ var An = {
|
|
|
2741
2887
|
p
|
|
2742
2888
|
], !1)), this.computeVertexNormals();
|
|
2743
2889
|
}
|
|
2744
|
-
},
|
|
2890
|
+
}, Gn = class extends s {
|
|
2745
2891
|
constructor(e = .6, t = 1, n = .2, r = .6) {
|
|
2746
2892
|
super();
|
|
2747
2893
|
let i = t - r / 2, o = new a(e, i, n);
|
|
2748
2894
|
o.translate(0, i / 2, 0);
|
|
2749
2895
|
let s = new p(r / 2, r / 2, n, 16, 1, !1, 0, Math.PI);
|
|
2750
|
-
s.rotateY(Math.PI / 2), s.rotateX(Math.PI / 2), s.translate(0, i, 0), this.copy(
|
|
2896
|
+
s.rotateY(Math.PI / 2), s.rotateX(Math.PI / 2), s.translate(0, i, 0), this.copy(B([o, s], !1)), this.computeVertexNormals();
|
|
2751
2897
|
}
|
|
2752
|
-
},
|
|
2898
|
+
}, Kn = class extends s {
|
|
2753
2899
|
constructor(e = .5, t = .8, n = .15) {
|
|
2754
2900
|
super();
|
|
2755
2901
|
let r = new a(e, t, n);
|
|
2756
2902
|
r.translate(0, t / 2, 0), this.copy(r);
|
|
2757
2903
|
}
|
|
2758
|
-
},
|
|
2904
|
+
}, qn = class extends s {
|
|
2759
2905
|
height;
|
|
2760
2906
|
constructor({ height: e = 2.25 } = {}) {
|
|
2761
2907
|
super(), this.height = e;
|
|
@@ -2764,27 +2910,27 @@ var An = {
|
|
|
2764
2910
|
let n = new a(1, e, 1);
|
|
2765
2911
|
n.translate(0, .5 + e / 2, 0);
|
|
2766
2912
|
let r = new a(1.4, .3, 1.4);
|
|
2767
|
-
r.translate(0, .5 + e + .15, 0), this.copy(
|
|
2913
|
+
r.translate(0, .5 + e + .15, 0), this.copy(B([
|
|
2768
2914
|
t,
|
|
2769
2915
|
n,
|
|
2770
2916
|
r
|
|
2771
2917
|
], !1));
|
|
2772
2918
|
}
|
|
2773
|
-
},
|
|
2919
|
+
}, Jn = class extends s {
|
|
2774
2920
|
barHeight;
|
|
2775
2921
|
constructor({ barHeight: e = 2, barRadius: t = .05, spikeHeight: n = .3, spikeRadius: r = .075, spikeScaleZ: i = 1, radialSegments: a = 8 } = {}) {
|
|
2776
2922
|
super(), this.barHeight = e;
|
|
2777
2923
|
let o = new p(t, t, e, a);
|
|
2778
2924
|
o.translate(0, e / 2, 0);
|
|
2779
2925
|
let s = new f(r, n, a);
|
|
2780
|
-
s.translate(0, e + n / 2, 0), s.scale(1, 1, i), this.copy(
|
|
2926
|
+
s.translate(0, e + n / 2, 0), s.scale(1, 1, i), this.copy(B([o, s], !1));
|
|
2781
2927
|
}
|
|
2782
|
-
},
|
|
2928
|
+
}, Yn = class extends s {
|
|
2783
2929
|
count;
|
|
2784
2930
|
spacing;
|
|
2785
2931
|
constructor({ count: e = 20, spacing: t = .4, barHeight: n = 2, barRadius: r = .05, spikeHeight: i = .3, spikeRadius: o = .075, spikeScaleZ: s = 1, railHeight: c = .1, railDepth: l = .05, railOffset: u = 0, radialSegments: d = 8 } = {}) {
|
|
2786
2932
|
super(), this.count = e, this.spacing = t;
|
|
2787
|
-
let f = [], p = new
|
|
2933
|
+
let f = [], p = new Jn({
|
|
2788
2934
|
barHeight: n,
|
|
2789
2935
|
barRadius: r,
|
|
2790
2936
|
spikeHeight: i,
|
|
@@ -2799,9 +2945,9 @@ var An = {
|
|
|
2799
2945
|
let h = m.clone();
|
|
2800
2946
|
h.translate(t * (e - 1) / 2, n - u - c / 2, 0), f.push(h);
|
|
2801
2947
|
let g = m.clone();
|
|
2802
|
-
g.translate(t * (e - 1) / 2, c / 2, 0), f.push(g), this.copy(
|
|
2948
|
+
g.translate(t * (e - 1) / 2, c / 2, 0), f.push(g), this.copy(B(f));
|
|
2803
2949
|
}
|
|
2804
|
-
},
|
|
2950
|
+
}, Xn = class extends s {
|
|
2805
2951
|
width;
|
|
2806
2952
|
height;
|
|
2807
2953
|
depth;
|
|
@@ -2823,7 +2969,7 @@ var An = {
|
|
|
2823
2969
|
let t = c.clone();
|
|
2824
2970
|
t.translate(0, i / 2 + e * h, 0), m.push(t);
|
|
2825
2971
|
}
|
|
2826
|
-
this.copy(
|
|
2972
|
+
this.copy(B([
|
|
2827
2973
|
l,
|
|
2828
2974
|
u,
|
|
2829
2975
|
d,
|
|
@@ -2832,17 +2978,17 @@ var An = {
|
|
|
2832
2978
|
...m
|
|
2833
2979
|
], !1));
|
|
2834
2980
|
}
|
|
2835
|
-
},
|
|
2981
|
+
}, Zn = class extends s {
|
|
2836
2982
|
constructor() {
|
|
2837
2983
|
super();
|
|
2838
2984
|
let e = new a(5, .3, 3);
|
|
2839
2985
|
e.translate(0, 3.15, 0);
|
|
2840
|
-
let t = new
|
|
2841
|
-
new
|
|
2842
|
-
new
|
|
2843
|
-
new
|
|
2844
|
-
new
|
|
2845
|
-
], 32), n =
|
|
2986
|
+
let t = new E([
|
|
2987
|
+
new R(.2, 0),
|
|
2988
|
+
new R(.25, .5),
|
|
2989
|
+
new R(.15, 1.5),
|
|
2990
|
+
new R(.3, 3)
|
|
2991
|
+
], 32), n = B([
|
|
2846
2992
|
[
|
|
2847
2993
|
2.1,
|
|
2848
2994
|
0,
|
|
@@ -2867,9 +3013,9 @@ var An = {
|
|
|
2867
3013
|
let n = t.clone();
|
|
2868
3014
|
return n.translate(e[0], e[1], e[2]), n;
|
|
2869
3015
|
}));
|
|
2870
|
-
this.copy(
|
|
3016
|
+
this.copy(B([e, n], !0));
|
|
2871
3017
|
}
|
|
2872
|
-
},
|
|
3018
|
+
}, Qn = class extends s {
|
|
2873
3019
|
size;
|
|
2874
3020
|
lift;
|
|
2875
3021
|
constructor({ size: e = .13, lift: t = .22 } = {}) {
|
|
@@ -2893,7 +3039,7 @@ var An = {
|
|
|
2893
3039
|
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]);
|
|
2894
3040
|
this.setAttribute("position", new x(r, 3)), this.setIndex(i), this.computeVertexNormals(), this.computeBoundingSphere();
|
|
2895
3041
|
}
|
|
2896
|
-
},
|
|
3042
|
+
}, $n = class extends _e {
|
|
2897
3043
|
height;
|
|
2898
3044
|
radius;
|
|
2899
3045
|
segmentsU;
|
|
@@ -2904,7 +3050,7 @@ var An = {
|
|
|
2904
3050
|
i.set(s, c, -l);
|
|
2905
3051
|
}, n, r), this.height = e, this.radius = t, this.segmentsU = n, this.segmentsV = r;
|
|
2906
3052
|
}
|
|
2907
|
-
},
|
|
3053
|
+
}, er = class extends s {
|
|
2908
3054
|
radiusTop;
|
|
2909
3055
|
radiusBottom;
|
|
2910
3056
|
height;
|
|
@@ -2915,15 +3061,15 @@ var An = {
|
|
|
2915
3061
|
super(), this.radiusTop = e, this.radiusBottom = t, this.height = n, this.flameHeight = r, this.flameRadius = i, this.segments = a;
|
|
2916
3062
|
let o = new p(e, t, n, a);
|
|
2917
3063
|
o.translate(0, n / 2, 0);
|
|
2918
|
-
let s = new
|
|
3064
|
+
let s = new $n({
|
|
2919
3065
|
segmentsU: a,
|
|
2920
3066
|
segmentsV: a,
|
|
2921
3067
|
height: r,
|
|
2922
3068
|
radius: i
|
|
2923
3069
|
});
|
|
2924
|
-
s.translate(0, n, 0), this.copy(
|
|
3070
|
+
s.translate(0, n, 0), this.copy(B([o, s], !0));
|
|
2925
3071
|
}
|
|
2926
|
-
},
|
|
3072
|
+
}, tr = class extends s {
|
|
2927
3073
|
baseWidth;
|
|
2928
3074
|
bodyHeight;
|
|
2929
3075
|
baseHeight;
|
|
@@ -2938,23 +3084,23 @@ var An = {
|
|
|
2938
3084
|
_.translate(0, g + r / 2, 0), m.push(_);
|
|
2939
3085
|
let v = g + r, y = new pe(s, c, u, u * 2);
|
|
2940
3086
|
y.translate(0, v + l, 0), m.push(y);
|
|
2941
|
-
let b = [
|
|
3087
|
+
let b = [B(m.map((e) => e.toNonIndexed()), !1)];
|
|
2942
3088
|
if (d) {
|
|
2943
3089
|
let n = new p(e * a * o, e * a * o, t * o, u);
|
|
2944
3090
|
n.translate(0, this.lampCenterY, 0), b.push(n.toNonIndexed());
|
|
2945
3091
|
}
|
|
2946
|
-
this.copy(
|
|
3092
|
+
this.copy(B(b, !0)), this.computeBoundingSphere();
|
|
2947
3093
|
}
|
|
2948
|
-
},
|
|
2949
|
-
function
|
|
3094
|
+
}, nr = new z(0, 1, 0);
|
|
3095
|
+
function rr(e, t, n) {
|
|
2950
3096
|
let r = t.clone().sub(e), i = new a(n, r.length(), n);
|
|
2951
|
-
i.applyQuaternion(new
|
|
3097
|
+
i.applyQuaternion(new F().setFromUnitVectors(nr, r.normalize()));
|
|
2952
3098
|
let o = e.clone().add(t).multiplyScalar(.5);
|
|
2953
3099
|
return i.translate(o.x, o.y, o.z), i;
|
|
2954
3100
|
}
|
|
2955
3101
|
//#endregion
|
|
2956
3102
|
//#region src/geometry/lighting/HangingLanternGeometry.ts
|
|
2957
|
-
var
|
|
3103
|
+
var ir = class extends s {
|
|
2958
3104
|
drop;
|
|
2959
3105
|
chainWidth;
|
|
2960
3106
|
capWidth;
|
|
@@ -2976,7 +3122,7 @@ var Yn = class extends s {
|
|
|
2976
3122
|
h.translate(0, -e / 2, 0), m.push(h);
|
|
2977
3123
|
let g = new a(n, r, i);
|
|
2978
3124
|
g.translate(0, -e + o, 0), m.push(g);
|
|
2979
|
-
let _ = this.cageCenterY, v = s, y = new
|
|
3125
|
+
let _ = this.cageCenterY, v = s, y = new z(0, _ + v * c, 0), b = new z(0, _ - v * c, 0), x = new z(v, _, 0), S = new z(-v, _, 0), C = new z(0, _, v), w = new z(0, _, -v), T = [
|
|
2980
3126
|
[y, x],
|
|
2981
3127
|
[y, S],
|
|
2982
3128
|
[y, C],
|
|
@@ -2989,14 +3135,14 @@ var Yn = class extends s {
|
|
|
2989
3135
|
[C, S],
|
|
2990
3136
|
[S, w],
|
|
2991
3137
|
[w, x]
|
|
2992
|
-
].map(([e, t]) =>
|
|
3138
|
+
].map(([e, t]) => rr(e, t, u)), E = [B(m.map((e) => e.toNonIndexed()), !1), B(T.map((e) => e.toNonIndexed()), !1)];
|
|
2993
3139
|
if (f) {
|
|
2994
3140
|
let e = new te(s * d, 0);
|
|
2995
3141
|
e.scale(1, c, 1), e.translate(0, _, 0), E.push(e.toNonIndexed());
|
|
2996
3142
|
}
|
|
2997
|
-
this.copy(
|
|
3143
|
+
this.copy(B(E, !0)), this.computeBoundingSphere();
|
|
2998
3144
|
}
|
|
2999
|
-
},
|
|
3145
|
+
}, ar = class extends s {
|
|
3000
3146
|
bodyOffsetX;
|
|
3001
3147
|
chimneyCenterY;
|
|
3002
3148
|
innerScale;
|
|
@@ -3014,14 +3160,14 @@ var Yn = class extends s {
|
|
|
3014
3160
|
A.translate(u, v, 0), k.push(A);
|
|
3015
3161
|
let j = new p(y, b, x, C);
|
|
3016
3162
|
j.translate(u, S, 0), k.push(j);
|
|
3017
|
-
let
|
|
3163
|
+
let M = [B(E.map((e) => e.toNonIndexed()), !1), B(k.map((e) => e.toNonIndexed()), !1)];
|
|
3018
3164
|
if (T) {
|
|
3019
3165
|
let e = new p(f * w, m * w, d * w, C);
|
|
3020
|
-
e.translate(u, h, 0),
|
|
3166
|
+
e.translate(u, h, 0), M.push(e.toNonIndexed());
|
|
3021
3167
|
}
|
|
3022
|
-
this.copy(
|
|
3168
|
+
this.copy(B(M, !0)), this.computeBoundingSphere();
|
|
3023
3169
|
}
|
|
3024
|
-
},
|
|
3170
|
+
}, or = class extends s {
|
|
3025
3171
|
constructor(e = 1, t = 2, n = .5, r = Math.PI / 4) {
|
|
3026
3172
|
super();
|
|
3027
3173
|
let i = t * Math.tan(r), a = e, s = t, c = n, l = [
|
|
@@ -3259,7 +3405,7 @@ var Yn = class extends s {
|
|
|
3259
3405
|
]), p = new Float32Array(l), m = new Float32Array(u), h = new Float32Array(f), g = new Uint16Array(d);
|
|
3260
3406
|
this.setAttribute("position", new o(p, 3)), this.setAttribute("normal", new o(m, 3)), this.setAttribute("uv", new o(h, 2)), this.setIndex(new o(g, 1)), this.center();
|
|
3261
3407
|
}
|
|
3262
|
-
},
|
|
3408
|
+
}, sr = class extends I {
|
|
3263
3409
|
constructor(e = 5, t = .5, n = 1, r = 5, i = .25) {
|
|
3264
3410
|
super();
|
|
3265
3411
|
let a = Math.PI * 2 / e, o = a / 4;
|
|
@@ -3272,25 +3418,25 @@ var Yn = class extends s {
|
|
|
3272
3418
|
e.lineTo(Math.cos(0) * i, -Math.sin(0) * i), this.holes.push(e);
|
|
3273
3419
|
}
|
|
3274
3420
|
}
|
|
3275
|
-
},
|
|
3421
|
+
}, cr = class extends b {
|
|
3276
3422
|
constructor({ sides: e = 5, innerRadius: t = .5, outerRadius: n = 1, holeSides: r = 5, holeRadius: i = .25, depth: a = .25 } = {}) {
|
|
3277
|
-
super(new
|
|
3423
|
+
super(new sr(e, t, n, r, i), {
|
|
3278
3424
|
depth: a,
|
|
3279
3425
|
bevelEnabled: !1
|
|
3280
3426
|
});
|
|
3281
3427
|
}
|
|
3282
|
-
},
|
|
3428
|
+
}, lr = class extends I {
|
|
3283
3429
|
constructor(e = 1, t = 2.1, n = 1.4, r = 1.6) {
|
|
3284
3430
|
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);
|
|
3285
3431
|
}
|
|
3286
|
-
},
|
|
3432
|
+
}, ur = class extends b {
|
|
3287
3433
|
constructor({ size: e = 1, width: t = 2.1, height: n = 1.4, tipDepth: r = 1.6, depth: i = .25 } = {}) {
|
|
3288
|
-
super(new
|
|
3434
|
+
super(new lr(e, t, n, r), {
|
|
3289
3435
|
depth: i,
|
|
3290
3436
|
bevelEnabled: !1
|
|
3291
3437
|
});
|
|
3292
3438
|
}
|
|
3293
|
-
},
|
|
3439
|
+
}, dr = class extends I {
|
|
3294
3440
|
constructor(e = 5, t = .5, n = 1) {
|
|
3295
3441
|
super();
|
|
3296
3442
|
let r = Math.PI * 2 / e, i = r / 2;
|
|
@@ -3298,20 +3444,20 @@ var Yn = class extends s {
|
|
|
3298
3444
|
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);
|
|
3299
3445
|
this.closePath();
|
|
3300
3446
|
}
|
|
3301
|
-
},
|
|
3447
|
+
}, fr = class extends b {
|
|
3302
3448
|
constructor({ points: e = 5, innerRadius: t = .5, outerRadius: n = 1, depth: r = .25 } = {}) {
|
|
3303
|
-
super(new
|
|
3449
|
+
super(new dr(e, t, n), {
|
|
3304
3450
|
depth: r,
|
|
3305
3451
|
bevelEnabled: !1
|
|
3306
3452
|
});
|
|
3307
3453
|
}
|
|
3308
|
-
},
|
|
3454
|
+
}, pr = class extends s {
|
|
3309
3455
|
constructor(e = .1, t = .1, n = .4, r = 8) {
|
|
3310
3456
|
super();
|
|
3311
3457
|
let i = new p(e * .6, t * .6, n, r);
|
|
3312
3458
|
i.translate(0, 0, 0);
|
|
3313
|
-
let a = new
|
|
3314
|
-
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(
|
|
3459
|
+
let a = new L(e, r, r), o = a.clone(), s = a.clone(), c = a.clone(), l = a.clone();
|
|
3460
|
+
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(B([
|
|
3315
3461
|
i,
|
|
3316
3462
|
o,
|
|
3317
3463
|
s,
|
|
@@ -3319,29 +3465,29 @@ var Yn = class extends s {
|
|
|
3319
3465
|
l
|
|
3320
3466
|
], !1));
|
|
3321
3467
|
}
|
|
3322
|
-
},
|
|
3468
|
+
}, mr = class extends s {
|
|
3323
3469
|
flaskRadius;
|
|
3324
3470
|
height;
|
|
3325
3471
|
constructor({ flaskRadius: e = 1, neckRadius: t = .3, height: n = 2.5, neckHeight: r = 1, radialSegments: i = 16 } = {}) {
|
|
3326
3472
|
super(), this.flaskRadius = e, this.height = n;
|
|
3327
|
-
let a = new
|
|
3328
|
-
new
|
|
3329
|
-
new
|
|
3330
|
-
new
|
|
3331
|
-
new
|
|
3332
|
-
new
|
|
3333
|
-
new
|
|
3473
|
+
let a = new E([
|
|
3474
|
+
new R(0, 0),
|
|
3475
|
+
new R(e * .875, 0),
|
|
3476
|
+
new R(e, .1),
|
|
3477
|
+
new R(t, n),
|
|
3478
|
+
new R(t, n + r),
|
|
3479
|
+
new R(t * 1.1, n + r + .3)
|
|
3334
3480
|
], i);
|
|
3335
|
-
this.copy(
|
|
3481
|
+
this.copy(B([a], !1));
|
|
3336
3482
|
}
|
|
3337
|
-
},
|
|
3483
|
+
}, hr = (e, t) => e / (1 - Math.cos(t)), gr = (e, t) => e / (2 * Math.sin(t)), _r = (e, t) => e * (1 - Math.cos(t)), vr = (e, t) => 2 * e * Math.sin(t), yr = (e, t) => {
|
|
3338
3484
|
let n = 2 * t;
|
|
3339
3485
|
return Math.asin(n / (2 * e));
|
|
3340
|
-
},
|
|
3486
|
+
}, br = (e, t, n) => ({
|
|
3341
3487
|
x: e * Math.sin(n) * Math.cos(t),
|
|
3342
3488
|
y: e * Math.sin(n) * Math.sin(t),
|
|
3343
3489
|
z: e * Math.cos(n)
|
|
3344
|
-
}),
|
|
3490
|
+
}), xr = (e, t, n) => {
|
|
3345
3491
|
let r = Math.sqrt(e * e + t * t + n * n);
|
|
3346
3492
|
return {
|
|
3347
3493
|
radius: r,
|
|
@@ -3351,35 +3497,35 @@ var Yn = class extends s {
|
|
|
3351
3497
|
};
|
|
3352
3498
|
//#endregion
|
|
3353
3499
|
//#region src/utils/SphericalCurve.ts
|
|
3354
|
-
function
|
|
3355
|
-
let o = r ?
|
|
3500
|
+
function Sr(e, t, n, r = 0, i = 0, a = 32) {
|
|
3501
|
+
let o = r ? yr(e, r) : 0, s = i ? Math.PI - yr(e, i) : Math.PI, c = [];
|
|
3356
3502
|
for (let r = 0; r <= a; r++) {
|
|
3357
3503
|
let i = s - (s - o) / a * r, l = e * Math.sin(i), u = t * Math.cos(i) + n;
|
|
3358
|
-
c.push(new
|
|
3504
|
+
c.push(new R(l, u));
|
|
3359
3505
|
}
|
|
3360
3506
|
return [...c];
|
|
3361
3507
|
}
|
|
3362
3508
|
//#endregion
|
|
3363
3509
|
//#region src/geometry/science/FlorenceFlaskGeometry.ts
|
|
3364
|
-
var
|
|
3510
|
+
var Cr = class extends s {
|
|
3365
3511
|
constructor() {
|
|
3366
3512
|
super();
|
|
3367
|
-
let e = new
|
|
3513
|
+
let e = new E([...Sr(1, 1, .5, .2, 0, 32), new R(.2, 3)], 32);
|
|
3368
3514
|
this.copy(e);
|
|
3369
3515
|
}
|
|
3370
|
-
},
|
|
3516
|
+
}, wr = class extends s {
|
|
3371
3517
|
constructor() {
|
|
3372
3518
|
super();
|
|
3373
|
-
let e = new
|
|
3374
|
-
new
|
|
3375
|
-
new
|
|
3376
|
-
new
|
|
3377
|
-
new
|
|
3378
|
-
new
|
|
3519
|
+
let e = new E([
|
|
3520
|
+
new R(1, 0),
|
|
3521
|
+
new R(1.2, .5),
|
|
3522
|
+
new R(1.4, 1.5),
|
|
3523
|
+
new R(1.3, 1.8),
|
|
3524
|
+
new R(.8, 1.8)
|
|
3379
3525
|
], 12), t = new u(1, 12);
|
|
3380
|
-
t.rotateX(-Math.PI / 2), t.translate(0, 0, 0), this.copy(
|
|
3526
|
+
t.rotateX(-Math.PI / 2), t.translate(0, 0, 0), this.copy(B([e, t], !1));
|
|
3381
3527
|
}
|
|
3382
|
-
},
|
|
3528
|
+
}, Tr = class extends s {
|
|
3383
3529
|
radius;
|
|
3384
3530
|
height;
|
|
3385
3531
|
count;
|
|
@@ -3392,39 +3538,77 @@ var mr = class extends s {
|
|
|
3392
3538
|
let i = r / n * Math.PI * 2, a = o.clone();
|
|
3393
3539
|
a.translate(Math.cos(i) * e, t / 2, Math.sin(i) * e), s.push(a);
|
|
3394
3540
|
}
|
|
3395
|
-
this.copy(
|
|
3541
|
+
this.copy(B([a, ...s], !1));
|
|
3396
3542
|
}
|
|
3397
|
-
},
|
|
3543
|
+
}, Er = class extends s {
|
|
3398
3544
|
constructor() {
|
|
3399
3545
|
super();
|
|
3400
3546
|
let e = new p(.5, .6, .3, 16);
|
|
3401
3547
|
e.translate(0, .15, 0);
|
|
3402
3548
|
let t = new p(.15, .15, 2, 12, 1, !0);
|
|
3403
3549
|
t.translate(0, 1.3, 0);
|
|
3404
|
-
let n = new
|
|
3405
|
-
n.translate(0, 2.4, 0), this.copy(
|
|
3550
|
+
let n = new L(.3, 16, 16);
|
|
3551
|
+
n.translate(0, 2.4, 0), this.copy(B([e, B([t, n])], !0));
|
|
3406
3552
|
}
|
|
3407
|
-
},
|
|
3553
|
+
}, Dr = class extends s {
|
|
3408
3554
|
constructor(e = .2, t = .2, n = 3, r = 32, i = !0) {
|
|
3409
3555
|
super();
|
|
3410
|
-
let a = new p(e, t, n, r, 1, i), o = new
|
|
3411
|
-
o.translate(0, -(n / 2), 0), this.copy(
|
|
3556
|
+
let a = new p(e, t, n, r, 1, i), o = new L(t, r, r / 2, 0, Math.PI * 2, Math.PI / 2, Math.PI / 2);
|
|
3557
|
+
o.translate(0, -(n / 2), 0), this.copy(B([a, o], !1));
|
|
3412
3558
|
}
|
|
3413
|
-
},
|
|
3559
|
+
}, Or = class extends s {
|
|
3414
3560
|
radius;
|
|
3415
3561
|
height;
|
|
3416
|
-
constructor({ radius: e =
|
|
3417
|
-
super(), this.radius = e, this.height = t
|
|
3562
|
+
constructor({ radius: e = 8, height: t = 1.2, radialSegments: n = 40, angularSegments: r = 64, noiseHeight: i = .5, noiseScale: a = .35, octaves: s = 4, persistence: c = .5, rim: l = .82, seed: u = 1 } = {}) {
|
|
3563
|
+
super(), this.radius = e, this.height = t;
|
|
3564
|
+
let d = Math.max(1, Math.round(n)), f = Math.max(3, Math.round(r)), p = (e) => .5 + .5 * Math.cos(Math.PI * e), m = (e) => {
|
|
3565
|
+
if (e <= l) return 1;
|
|
3566
|
+
let t = (e - l) / (1 - l);
|
|
3567
|
+
return 1 - t * t * (3 - 2 * t);
|
|
3568
|
+
}, h = (e, n, r) => p(e) * t + jt(n * a, r * a, u, s, c) * i * m(e), g = 1 + d * f, _ = new Float32Array(g * 3), v = new Float32Array(g * 2);
|
|
3569
|
+
_[1] = h(0, 0, 0), v[0] = .5, v[1] = .5;
|
|
3570
|
+
for (let t = 1; t <= d; t++) {
|
|
3571
|
+
let n = t / d, r = n * e;
|
|
3572
|
+
for (let i = 0; i < f; i++) {
|
|
3573
|
+
let a = i / f * Math.PI * 2, o = Math.cos(a) * r, s = Math.sin(a) * r, c = 1 + (t - 1) * f + i;
|
|
3574
|
+
_[c * 3] = o, _[c * 3 + 1] = h(n, o, s), _[c * 3 + 2] = s, v[c * 2] = o / (2 * e) + .5, v[c * 2 + 1] = s / (2 * e) + .5;
|
|
3575
|
+
}
|
|
3576
|
+
}
|
|
3577
|
+
let y = (e, t) => 1 + (e - 1) * f + t % f, b = [];
|
|
3578
|
+
for (let e = 0; e < f; e++) b.push(0, y(1, e + 1), y(1, e));
|
|
3579
|
+
for (let e = 1; e < d; e++) for (let t = 0; t < f; t++) {
|
|
3580
|
+
let n = y(e, t), r = y(e, t + 1), i = y(e + 1, t), a = y(e + 1, t + 1);
|
|
3581
|
+
b.push(n, a, i), b.push(n, r, a);
|
|
3582
|
+
}
|
|
3583
|
+
this.setAttribute("position", new o(_, 3)), this.setAttribute("uv", new o(v, 2)), this.setIndex(b), this.computeVertexNormals();
|
|
3418
3584
|
}
|
|
3419
|
-
},
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
constructor({
|
|
3423
|
-
super(), this.
|
|
3424
|
-
let
|
|
3425
|
-
|
|
3585
|
+
}, kr = class extends s {
|
|
3586
|
+
width;
|
|
3587
|
+
depth;
|
|
3588
|
+
constructor({ width: e = 16, depth: t = 16, widthSegments: n = 48, depthSegments: r = 48, noiseHeight: i = .8, noiseScale: a = .35, octaves: s = 4, persistence: c = .5, edgeFalloff: l = 0, seed: u = 1 } = {}) {
|
|
3589
|
+
super(), this.width = e, this.depth = t;
|
|
3590
|
+
let d = Math.max(1, Math.round(n)), f = Math.max(1, Math.round(r)), p = e / 2, m = t / 2, h = Math.min(Math.max(l, 0), 1), g = (e, t) => {
|
|
3591
|
+
if (h <= 0) return 1;
|
|
3592
|
+
let n = Math.min(e + p, p - e) / p, r = Math.min(t + m, m - t) / m, i = Math.min(n, r);
|
|
3593
|
+
if (i >= h) return 1;
|
|
3594
|
+
let a = i / h;
|
|
3595
|
+
return a * a * (3 - 2 * a);
|
|
3596
|
+
}, _ = (d + 1) * (f + 1), v = new Float32Array(_ * 3), y = new Float32Array(_ * 2);
|
|
3597
|
+
for (let n = 0; n <= f; n++) {
|
|
3598
|
+
let r = -m + n / f * t;
|
|
3599
|
+
for (let t = 0; t <= d; t++) {
|
|
3600
|
+
let o = -p + t / d * e, l = jt(o * a, r * a, u, s, c) * i * g(o, r), m = n * (d + 1) + t;
|
|
3601
|
+
v[m * 3] = o, v[m * 3 + 1] = l, v[m * 3 + 2] = r, y[m * 2] = t / d, y[m * 2 + 1] = n / f;
|
|
3602
|
+
}
|
|
3603
|
+
}
|
|
3604
|
+
let b = [], x = (e, t) => t * (d + 1) + e;
|
|
3605
|
+
for (let e = 0; e < f; e++) for (let t = 0; t < d; t++) {
|
|
3606
|
+
let n = x(t, e), r = x(t + 1, e), i = x(t, e + 1), a = x(t + 1, e + 1);
|
|
3607
|
+
b.push(n, i, r), b.push(r, i, a);
|
|
3608
|
+
}
|
|
3609
|
+
this.setAttribute("position", new o(v, 3)), this.setAttribute("uv", new o(y, 2)), this.setIndex(b), this.computeVertexNormals();
|
|
3426
3610
|
}
|
|
3427
|
-
},
|
|
3611
|
+
}, Ar = class extends s {
|
|
3428
3612
|
trunkRadiusTop;
|
|
3429
3613
|
trunkRadiusBottom;
|
|
3430
3614
|
trunkHeight;
|
|
@@ -3442,9 +3626,9 @@ var mr = class extends s {
|
|
|
3442
3626
|
let e = new h(i, o);
|
|
3443
3627
|
e.translate((Math.random() - .5) * s, (Math.random() - .5) * i + n, (Math.random() - .5) * s), l.push(e);
|
|
3444
3628
|
}
|
|
3445
|
-
this.copy(
|
|
3629
|
+
this.copy(B([c.toNonIndexed(), B(l, !1)], !0)), this.computeVertexNormals();
|
|
3446
3630
|
}
|
|
3447
|
-
},
|
|
3631
|
+
}, jr = class extends k {
|
|
3448
3632
|
width;
|
|
3449
3633
|
riserHeight;
|
|
3450
3634
|
treadDepth;
|
|
@@ -3453,15 +3637,15 @@ var mr = class extends s {
|
|
|
3453
3637
|
flightRun;
|
|
3454
3638
|
totalHeight;
|
|
3455
3639
|
constructor({ color: e = "#8b4513", ...t } = {}) {
|
|
3456
|
-
let n = new
|
|
3457
|
-
super(n, new
|
|
3640
|
+
let n = new Nn(t);
|
|
3641
|
+
super(n, new M({
|
|
3458
3642
|
color: new d(e),
|
|
3459
3643
|
roughness: .85,
|
|
3460
3644
|
metalness: .04,
|
|
3461
3645
|
side: g
|
|
3462
3646
|
})), 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;
|
|
3463
3647
|
}
|
|
3464
|
-
},
|
|
3648
|
+
}, Mr = class extends k {
|
|
3465
3649
|
innerRadius;
|
|
3466
3650
|
width;
|
|
3467
3651
|
outerRadius;
|
|
@@ -3472,15 +3656,15 @@ var mr = class extends s {
|
|
|
3472
3656
|
totalHeight;
|
|
3473
3657
|
totalTurn;
|
|
3474
3658
|
constructor({ color: e = "#8b4513", ...t } = {}) {
|
|
3475
|
-
let n = new
|
|
3476
|
-
super(n, new
|
|
3659
|
+
let n = new Pn(t);
|
|
3660
|
+
super(n, new M({
|
|
3477
3661
|
color: new d(e),
|
|
3478
3662
|
roughness: .85,
|
|
3479
3663
|
metalness: .04,
|
|
3480
3664
|
side: g
|
|
3481
3665
|
})), 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;
|
|
3482
3666
|
}
|
|
3483
|
-
},
|
|
3667
|
+
}, Nr = class extends k {
|
|
3484
3668
|
width;
|
|
3485
3669
|
riserHeight;
|
|
3486
3670
|
treadDepth;
|
|
@@ -3488,15 +3672,15 @@ var mr = class extends s {
|
|
|
3488
3672
|
totalHeight;
|
|
3489
3673
|
totalDepth;
|
|
3490
3674
|
constructor({ color: e = "#8b4513", ...t } = {}) {
|
|
3491
|
-
let n = new
|
|
3492
|
-
super(n, new
|
|
3675
|
+
let n = new Fn(t);
|
|
3676
|
+
super(n, new M({
|
|
3493
3677
|
color: new d(e),
|
|
3494
3678
|
roughness: .85,
|
|
3495
3679
|
metalness: .04,
|
|
3496
3680
|
side: g
|
|
3497
3681
|
})), this.width = n.width, this.riserHeight = n.riserHeight, this.treadDepth = n.treadDepth, this.stepCount = n.stepCount, this.totalHeight = n.totalHeight, this.totalDepth = n.totalDepth;
|
|
3498
3682
|
}
|
|
3499
|
-
},
|
|
3683
|
+
}, Pr = 48, Fr = class extends S {
|
|
3500
3684
|
lattice;
|
|
3501
3685
|
frame;
|
|
3502
3686
|
glass;
|
|
@@ -3505,13 +3689,13 @@ var mr = class extends s {
|
|
|
3505
3689
|
fittedGrid;
|
|
3506
3690
|
opening;
|
|
3507
3691
|
constructor({ leadColor: e = "#0c0f14", glass: t = !1, glassColor: n = "#6a7d8c", glassEmissive: r, glassEmissiveIntensity: i = 0, width: a = 4.5, rectHeight: o = 4, archHeight: s, centerY: c = 0, leadThickness: l = .055, leadDepth: u = .11, ...f } = {}) {
|
|
3508
|
-
super(), this.opening =
|
|
3692
|
+
super(), this.opening = Z({
|
|
3509
3693
|
width: a,
|
|
3510
3694
|
rectHeight: o,
|
|
3511
3695
|
archHeight: s,
|
|
3512
3696
|
centerY: c
|
|
3513
3697
|
});
|
|
3514
|
-
let p = new
|
|
3698
|
+
let p = new pn({
|
|
3515
3699
|
width: a,
|
|
3516
3700
|
rectHeight: o,
|
|
3517
3701
|
archHeight: s,
|
|
@@ -3523,9 +3707,9 @@ var mr = class extends s {
|
|
|
3523
3707
|
this.cellsX = p.cellsX, this.cellsY = p.cellsY, this.fittedGrid = p.fittedGrid;
|
|
3524
3708
|
let m = new d(e);
|
|
3525
3709
|
if (t) {
|
|
3526
|
-
let e = new
|
|
3527
|
-
|
|
3528
|
-
let t = new fe(e,
|
|
3710
|
+
let e = new I();
|
|
3711
|
+
$t(e, this.opening);
|
|
3712
|
+
let t = new fe(e, Pr), a = new j({
|
|
3529
3713
|
color: new d(n),
|
|
3530
3714
|
emissive: r ? new d(r) : new d(0),
|
|
3531
3715
|
emissiveIntensity: i,
|
|
@@ -3537,9 +3721,9 @@ var mr = class extends s {
|
|
|
3537
3721
|
thickness: u * .5,
|
|
3538
3722
|
side: g
|
|
3539
3723
|
});
|
|
3540
|
-
this.glass = new
|
|
3724
|
+
this.glass = new k(t, a), this.glass.renderOrder = 0, this.glass.castShadow = !1, this.glass.receiveShadow = !1, this.add(this.glass);
|
|
3541
3725
|
}
|
|
3542
|
-
let h = new
|
|
3726
|
+
let h = new M({
|
|
3543
3727
|
color: m,
|
|
3544
3728
|
roughness: .7,
|
|
3545
3729
|
metalness: .35,
|
|
@@ -3547,15 +3731,15 @@ var mr = class extends s {
|
|
|
3547
3731
|
polygonOffsetFactor: -1,
|
|
3548
3732
|
polygonOffsetUnits: -1
|
|
3549
3733
|
});
|
|
3550
|
-
this.lattice = new
|
|
3551
|
-
let _ =
|
|
3552
|
-
this.frame = new
|
|
3734
|
+
this.lattice = new k(p, h), this.lattice.castShadow = !0, this.lattice.renderOrder = 1, this.add(this.lattice);
|
|
3735
|
+
let _ = nn(this.opening, l, u);
|
|
3736
|
+
this.frame = new k(_, new M({
|
|
3553
3737
|
color: m,
|
|
3554
3738
|
roughness: .7,
|
|
3555
3739
|
metalness: .35
|
|
3556
3740
|
})), this.frame.castShadow = !0, this.frame.renderOrder = 2, this.add(this.frame);
|
|
3557
3741
|
}
|
|
3558
|
-
},
|
|
3742
|
+
}, Ir = class extends S {
|
|
3559
3743
|
lattice;
|
|
3560
3744
|
glass;
|
|
3561
3745
|
cellsX;
|
|
@@ -3563,13 +3747,13 @@ var mr = class extends s {
|
|
|
3563
3747
|
fittedGrid;
|
|
3564
3748
|
constructor({ leadColor: e = "#0c0f14", glass: t = !1, glassColor: n = "#6a7d8c", glassEmissive: r, glassEmissiveIntensity: i = 0, centerY: a = 0, leadDepth: o = .11, ...s } = {}) {
|
|
3565
3749
|
super();
|
|
3566
|
-
let c = new
|
|
3750
|
+
let c = new mn({
|
|
3567
3751
|
centerY: a,
|
|
3568
3752
|
leadDepth: o,
|
|
3569
3753
|
...s
|
|
3570
3754
|
});
|
|
3571
3755
|
this.cellsX = c.cellsX, this.cellsY = c.cellsY, this.fittedGrid = c.fittedGrid;
|
|
3572
|
-
let l = new
|
|
3756
|
+
let l = new M({
|
|
3573
3757
|
color: new d(e),
|
|
3574
3758
|
roughness: .7,
|
|
3575
3759
|
metalness: .35,
|
|
@@ -3577,8 +3761,8 @@ var mr = class extends s {
|
|
|
3577
3761
|
polygonOffsetFactor: -1,
|
|
3578
3762
|
polygonOffsetUnits: -1
|
|
3579
3763
|
});
|
|
3580
|
-
if (this.lattice = new
|
|
3581
|
-
let e = s.width ?? 4.5, t = s.height ?? 5.5, c = new
|
|
3764
|
+
if (this.lattice = new k(c, l), this.lattice.castShadow = !0, this.lattice.renderOrder = 1, this.add(this.lattice), t) {
|
|
3765
|
+
let e = s.width ?? 4.5, t = s.height ?? 5.5, c = new j({
|
|
3582
3766
|
color: new d(n),
|
|
3583
3767
|
emissive: r ? new d(r) : new d(0),
|
|
3584
3768
|
emissiveIntensity: i,
|
|
@@ -3590,10 +3774,10 @@ var mr = class extends s {
|
|
|
3590
3774
|
thickness: o * .5,
|
|
3591
3775
|
side: g
|
|
3592
3776
|
});
|
|
3593
|
-
this.glass = new
|
|
3777
|
+
this.glass = new k(new P(e, t), c), this.glass.position.y = a, this.glass.renderOrder = 0, this.glass.castShadow = !1, this.glass.receiveShadow = !1, this.add(this.glass);
|
|
3594
3778
|
}
|
|
3595
3779
|
}
|
|
3596
|
-
},
|
|
3780
|
+
}, Lr = class extends S {
|
|
3597
3781
|
mullions;
|
|
3598
3782
|
glass;
|
|
3599
3783
|
cellsX;
|
|
@@ -3601,15 +3785,15 @@ var mr = class extends s {
|
|
|
3601
3785
|
fittedGrid;
|
|
3602
3786
|
constructor({ mullionColor: e = "#5c4033", glass: t = !1, glassColor: n = "#6a7d8c", glassEmissive: r, glassEmissiveIntensity: i = 0, ...a } = {}) {
|
|
3603
3787
|
super();
|
|
3604
|
-
let o = new
|
|
3788
|
+
let o = new _n(a);
|
|
3605
3789
|
this.cellsX = o.cellsX, this.cellsY = o.cellsY, this.fittedGrid = o.fittedGrid;
|
|
3606
|
-
let s = new
|
|
3790
|
+
let s = new M({
|
|
3607
3791
|
color: new d(e),
|
|
3608
3792
|
roughness: .85,
|
|
3609
3793
|
metalness: .05
|
|
3610
3794
|
});
|
|
3611
|
-
if (this.mullions = new
|
|
3612
|
-
let e = a.width ?? 4.5, t = a.height ?? 5.5, o = new
|
|
3795
|
+
if (this.mullions = new k(o, s), this.mullions.castShadow = !0, this.mullions.renderOrder = 1, this.add(this.mullions), t) {
|
|
3796
|
+
let e = a.width ?? 4.5, t = a.height ?? 5.5, o = new j({
|
|
3613
3797
|
color: new d(n),
|
|
3614
3798
|
emissive: r ? new d(r) : new d(0),
|
|
3615
3799
|
emissiveIntensity: i,
|
|
@@ -3621,10 +3805,10 @@ var mr = class extends s {
|
|
|
3621
3805
|
thickness: .02,
|
|
3622
3806
|
side: g
|
|
3623
3807
|
});
|
|
3624
|
-
this.glass = new
|
|
3808
|
+
this.glass = new k(new P(e, t), o), this.glass.renderOrder = 0, this.glass.castShadow = !1, this.glass.receiveShadow = !1, this.add(this.glass);
|
|
3625
3809
|
}
|
|
3626
3810
|
}
|
|
3627
|
-
},
|
|
3811
|
+
}, Rr = 1, zr = class extends S {
|
|
3628
3812
|
lattice;
|
|
3629
3813
|
frame;
|
|
3630
3814
|
glass;
|
|
@@ -3633,15 +3817,15 @@ var mr = class extends s {
|
|
|
3633
3817
|
clipPlanesLocal;
|
|
3634
3818
|
clipPlanesWorld;
|
|
3635
3819
|
constructor({ width: e = 4.5, height: t = 5.5, cell: r, cellsX: i, centerY: a = 0, ringThickness: o = .05, ringDepth: s = .06, frameThickness: c = .055, frameDepth: l = .11, latticeColor: u = "#0c0f14", glass: f = !1, glassColor: p = "#6a7d8c", glassEmissive: m, glassEmissiveIntensity: h = 0 } = {}) {
|
|
3636
|
-
super(), this.cell =
|
|
3637
|
-
let { spots: _, grid: y } =
|
|
3820
|
+
super(), this.cell = bn(e, t, r, i);
|
|
3821
|
+
let { spots: _, grid: y } = xn({
|
|
3638
3822
|
width: e,
|
|
3639
3823
|
height: t,
|
|
3640
3824
|
centerY: a,
|
|
3641
3825
|
cell: this.cell
|
|
3642
3826
|
});
|
|
3643
|
-
if (this.fittedGrid = y, this.clipPlanesLocal =
|
|
3644
|
-
let n = new
|
|
3827
|
+
if (this.fittedGrid = y, this.clipPlanesLocal = yn(e, t, a), this.clipPlanesWorld = this.clipPlanesLocal.map((e) => e.clone()), f) {
|
|
3828
|
+
let n = new j({
|
|
3645
3829
|
color: new d(p),
|
|
3646
3830
|
emissive: m ? new d(m) : new d(0),
|
|
3647
3831
|
emissiveIntensity: h,
|
|
@@ -3653,21 +3837,21 @@ var mr = class extends s {
|
|
|
3653
3837
|
thickness: .02,
|
|
3654
3838
|
side: g
|
|
3655
3839
|
});
|
|
3656
|
-
this.glass = new
|
|
3840
|
+
this.glass = new k(new P(e, t), n), this.glass.position.y = a, this.glass.position.z = -s * .5, this.glass.renderOrder = 0, this.add(this.glass);
|
|
3657
3841
|
}
|
|
3658
|
-
let b = new
|
|
3842
|
+
let b = new k(new P(e, t), new A({
|
|
3659
3843
|
colorWrite: !1,
|
|
3660
3844
|
depthWrite: !1,
|
|
3661
3845
|
depthTest: !1,
|
|
3662
3846
|
stencilWrite: !0,
|
|
3663
|
-
stencilRef:
|
|
3847
|
+
stencilRef: Rr,
|
|
3664
3848
|
stencilFunc: n,
|
|
3665
|
-
stencilFail:
|
|
3849
|
+
stencilFail: T,
|
|
3666
3850
|
stencilZPass: le,
|
|
3667
|
-
stencilZFail:
|
|
3851
|
+
stencilZFail: T
|
|
3668
3852
|
}));
|
|
3669
3853
|
b.position.y = a, b.renderOrder = 1, this.add(b);
|
|
3670
|
-
let x =
|
|
3854
|
+
let x = Sn(y.ringOuter, o, s), S = new M({
|
|
3671
3855
|
color: new d(u),
|
|
3672
3856
|
roughness: .7,
|
|
3673
3857
|
metalness: .35,
|
|
@@ -3675,55 +3859,55 @@ var mr = class extends s {
|
|
|
3675
3859
|
clipShadows: !0,
|
|
3676
3860
|
stencilWrite: !0,
|
|
3677
3861
|
stencilWriteMask: 0,
|
|
3678
|
-
stencilRef:
|
|
3862
|
+
stencilRef: Rr,
|
|
3679
3863
|
stencilFunc: v,
|
|
3680
|
-
stencilFail:
|
|
3681
|
-
stencilZPass:
|
|
3682
|
-
stencilZFail:
|
|
3864
|
+
stencilFail: T,
|
|
3865
|
+
stencilZPass: T,
|
|
3866
|
+
stencilZFail: T
|
|
3683
3867
|
});
|
|
3684
|
-
this.lattice = new
|
|
3685
|
-
let
|
|
3686
|
-
for (let e = 0; e < _.length; e++)
|
|
3868
|
+
this.lattice = new w(x, S, _.length), this.lattice.castShadow = !0, this.lattice.renderOrder = 2;
|
|
3869
|
+
let C = new N();
|
|
3870
|
+
for (let e = 0; e < _.length; e++) C.position.set(_[e][0], _[e][1], 0), C.rotation.set(0, 0, Math.PI / 4), C.updateMatrix(), this.lattice.setMatrixAt(e, C.matrix);
|
|
3687
3871
|
this.lattice.instanceMatrix.needsUpdate = !0, this.lattice.onBeforeRender = () => {
|
|
3688
3872
|
this.updateWorldMatrix(!0, !1);
|
|
3689
3873
|
for (let e = 0; e < this.clipPlanesLocal.length; e++) this.clipPlanesWorld[e].copy(this.clipPlanesLocal[e]).applyMatrix4(this.matrixWorld);
|
|
3690
3874
|
}, this.add(this.lattice);
|
|
3691
|
-
let E =
|
|
3875
|
+
let E = Cn({
|
|
3692
3876
|
width: e,
|
|
3693
3877
|
height: t,
|
|
3694
3878
|
centerY: a,
|
|
3695
3879
|
frameThickness: c,
|
|
3696
3880
|
frameDepth: l
|
|
3697
|
-
}), D =
|
|
3881
|
+
}), D = B(E);
|
|
3698
3882
|
if (!D) throw Error("RingLatticeWindow: frame merge failed");
|
|
3699
3883
|
for (let e of E) e.dispose();
|
|
3700
|
-
this.frame = new
|
|
3884
|
+
this.frame = new k(D, new M({
|
|
3701
3885
|
color: new d(u),
|
|
3702
3886
|
roughness: .7,
|
|
3703
3887
|
metalness: .35
|
|
3704
3888
|
})), this.frame.castShadow = !0, this.frame.renderOrder = 3, this.add(this.frame);
|
|
3705
3889
|
}
|
|
3706
|
-
},
|
|
3890
|
+
}, Br = class extends k {
|
|
3707
3891
|
width;
|
|
3708
3892
|
height;
|
|
3709
3893
|
depth;
|
|
3710
3894
|
coverThickness;
|
|
3711
3895
|
pageIndent;
|
|
3712
3896
|
constructor({ coverColor: e = "#8b0000", pageColor: t = "#ffffff", ...n } = {}) {
|
|
3713
|
-
let r = new
|
|
3714
|
-
super(r, [new
|
|
3897
|
+
let r = new yt(n);
|
|
3898
|
+
super(r, [new M({
|
|
3715
3899
|
color: new d(e),
|
|
3716
3900
|
metalness: .1,
|
|
3717
3901
|
roughness: .7,
|
|
3718
3902
|
flatShading: !0
|
|
3719
|
-
}), new
|
|
3903
|
+
}), new M({
|
|
3720
3904
|
color: new d(t),
|
|
3721
3905
|
flatShading: !0
|
|
3722
3906
|
})]), this.width = r.width, this.height = r.height, this.depth = r.depth, this.coverThickness = r.coverThickness, this.pageIndent = r.pageIndent;
|
|
3723
3907
|
}
|
|
3724
|
-
},
|
|
3908
|
+
}, Vr = class extends k {
|
|
3725
3909
|
constructor() {
|
|
3726
|
-
super(new
|
|
3910
|
+
super(new In(), [new M({
|
|
3727
3911
|
color: 8965290,
|
|
3728
3912
|
transparent: !0,
|
|
3729
3913
|
depthWrite: !1,
|
|
@@ -3731,15 +3915,15 @@ var mr = class extends s {
|
|
|
3731
3915
|
roughness: .1,
|
|
3732
3916
|
metalness: .5,
|
|
3733
3917
|
side: g
|
|
3734
|
-
}), new
|
|
3918
|
+
}), new M({
|
|
3735
3919
|
color: 9127187,
|
|
3736
3920
|
roughness: 1
|
|
3737
3921
|
})]);
|
|
3738
3922
|
}
|
|
3739
|
-
},
|
|
3923
|
+
}, Hr = class extends k {
|
|
3740
3924
|
constructor() {
|
|
3741
|
-
super(new
|
|
3742
|
-
new
|
|
3925
|
+
super(new Bn(), [
|
|
3926
|
+
new M({
|
|
3743
3927
|
color: 8965375,
|
|
3744
3928
|
transparent: !0,
|
|
3745
3929
|
depthWrite: !1,
|
|
@@ -3747,11 +3931,11 @@ var mr = class extends s {
|
|
|
3747
3931
|
roughness: .1,
|
|
3748
3932
|
metalness: .3
|
|
3749
3933
|
}),
|
|
3750
|
-
new
|
|
3934
|
+
new M({
|
|
3751
3935
|
color: 9127187,
|
|
3752
3936
|
roughness: 1
|
|
3753
3937
|
}),
|
|
3754
|
-
new
|
|
3938
|
+
new M({
|
|
3755
3939
|
color: Fe.PINK_SHERBET,
|
|
3756
3940
|
transparent: !0,
|
|
3757
3941
|
depthWrite: !1,
|
|
@@ -3759,9 +3943,9 @@ var mr = class extends s {
|
|
|
3759
3943
|
})
|
|
3760
3944
|
]);
|
|
3761
3945
|
}
|
|
3762
|
-
},
|
|
3946
|
+
}, Ur = class extends k {
|
|
3763
3947
|
constructor({ color: e = "#556b2f", ...t } = {}) {
|
|
3764
|
-
super(new
|
|
3948
|
+
super(new Vn(t), new j({
|
|
3765
3949
|
color: new d(e),
|
|
3766
3950
|
roughness: .1,
|
|
3767
3951
|
transmission: .9,
|
|
@@ -3771,106 +3955,106 @@ var mr = class extends s {
|
|
|
3771
3955
|
clearcoatRoughness: .1
|
|
3772
3956
|
}));
|
|
3773
3957
|
}
|
|
3774
|
-
},
|
|
3958
|
+
}, Wr = class extends k {
|
|
3775
3959
|
width;
|
|
3776
3960
|
height;
|
|
3777
3961
|
constructor({ color: e = "#777777", roughness: t = .8, ...n } = {}) {
|
|
3778
|
-
let r = new
|
|
3779
|
-
super(r, new
|
|
3962
|
+
let r = new Hn(n);
|
|
3963
|
+
super(r, new M({
|
|
3780
3964
|
color: new d(e),
|
|
3781
3965
|
roughness: t
|
|
3782
3966
|
})), this.width = r.width, this.height = r.height;
|
|
3783
3967
|
}
|
|
3784
|
-
},
|
|
3968
|
+
}, Gr = class extends k {
|
|
3785
3969
|
constructor() {
|
|
3786
|
-
super(new
|
|
3787
|
-
new
|
|
3970
|
+
super(new Un(), [
|
|
3971
|
+
new M({
|
|
3788
3972
|
color: 8421504,
|
|
3789
3973
|
flatShading: !0
|
|
3790
3974
|
}),
|
|
3791
|
-
new
|
|
3975
|
+
new M({
|
|
3792
3976
|
color: 6908265,
|
|
3793
3977
|
flatShading: !0
|
|
3794
3978
|
}),
|
|
3795
|
-
new
|
|
3979
|
+
new M({
|
|
3796
3980
|
color: 5263440,
|
|
3797
3981
|
flatShading: !0
|
|
3798
3982
|
}),
|
|
3799
|
-
new
|
|
3983
|
+
new M({
|
|
3800
3984
|
color: 4210752,
|
|
3801
3985
|
flatShading: !0
|
|
3802
3986
|
})
|
|
3803
3987
|
]);
|
|
3804
3988
|
}
|
|
3805
|
-
},
|
|
3989
|
+
}, Kr = class extends k {
|
|
3806
3990
|
totalHeight;
|
|
3807
3991
|
constructor({ color: e = "#777777", roughness: t = .8, ...n } = {}) {
|
|
3808
|
-
let r = new
|
|
3809
|
-
super(r, new
|
|
3992
|
+
let r = new Wn(n);
|
|
3993
|
+
super(r, new M({
|
|
3810
3994
|
color: new d(e),
|
|
3811
3995
|
roughness: t
|
|
3812
3996
|
})), this.totalHeight = r.totalHeight;
|
|
3813
3997
|
}
|
|
3814
|
-
},
|
|
3998
|
+
}, qr = class extends k {
|
|
3815
3999
|
constructor(e = .6, t = 1, n = .2, r = .6) {
|
|
3816
|
-
super(new
|
|
4000
|
+
super(new Gn(e, t, n, r), new M({
|
|
3817
4001
|
color: 7829367,
|
|
3818
4002
|
roughness: .8
|
|
3819
4003
|
}));
|
|
3820
4004
|
}
|
|
3821
|
-
},
|
|
4005
|
+
}, Jr = class extends k {
|
|
3822
4006
|
constructor(e = .5, t = .8, n = .15) {
|
|
3823
|
-
super(new
|
|
4007
|
+
super(new Kn(e, t, n), new M({
|
|
3824
4008
|
color: 7829367,
|
|
3825
4009
|
roughness: .8
|
|
3826
4010
|
}));
|
|
3827
4011
|
}
|
|
3828
|
-
},
|
|
4012
|
+
}, Yr = class extends k {
|
|
3829
4013
|
height;
|
|
3830
4014
|
constructor({ color: e = "#8b7d7b", ...t } = {}) {
|
|
3831
|
-
let n = new
|
|
3832
|
-
super(n, new
|
|
4015
|
+
let n = new qn(t);
|
|
4016
|
+
super(n, new M({
|
|
3833
4017
|
color: new d(e),
|
|
3834
4018
|
flatShading: !0
|
|
3835
4019
|
})), this.height = n.height;
|
|
3836
4020
|
}
|
|
3837
|
-
},
|
|
4021
|
+
}, Xr = class extends k {
|
|
3838
4022
|
barHeight;
|
|
3839
4023
|
constructor({ color: e = "#333333", ...t } = {}) {
|
|
3840
|
-
let n = new
|
|
3841
|
-
super(n, new
|
|
4024
|
+
let n = new Jn(t);
|
|
4025
|
+
super(n, new M({
|
|
3842
4026
|
color: new d(e),
|
|
3843
4027
|
metalness: .8,
|
|
3844
4028
|
roughness: .4
|
|
3845
4029
|
})), this.barHeight = n.barHeight;
|
|
3846
4030
|
}
|
|
3847
|
-
},
|
|
4031
|
+
}, Zr = class extends k {
|
|
3848
4032
|
count;
|
|
3849
4033
|
constructor({ color: e = "#333333", ...t } = {}) {
|
|
3850
|
-
let n = new
|
|
3851
|
-
super(n, new
|
|
4034
|
+
let n = new Yn(t);
|
|
4035
|
+
super(n, new M({
|
|
3852
4036
|
color: new d(e),
|
|
3853
4037
|
metalness: .8,
|
|
3854
4038
|
roughness: .4
|
|
3855
4039
|
})), this.count = n.count;
|
|
3856
4040
|
}
|
|
3857
|
-
},
|
|
4041
|
+
}, Qr = class extends k {
|
|
3858
4042
|
width;
|
|
3859
4043
|
height;
|
|
3860
4044
|
constructor({ color: e = "#8b4513", ...t } = {}) {
|
|
3861
|
-
let n = new
|
|
3862
|
-
super(n, new
|
|
4045
|
+
let n = new Xn(t);
|
|
4046
|
+
super(n, new M({ color: new d(e) })), this.width = n.width, this.height = n.height;
|
|
3863
4047
|
}
|
|
3864
|
-
},
|
|
4048
|
+
}, $r = class extends k {
|
|
3865
4049
|
constructor() {
|
|
3866
|
-
super(new
|
|
4050
|
+
super(new Zn(), [new M({ color: 9132587 }), new M({ color: 4929057 })]);
|
|
3867
4051
|
}
|
|
3868
|
-
},
|
|
4052
|
+
}, ei = class extends k {
|
|
3869
4053
|
size;
|
|
3870
4054
|
lift;
|
|
3871
4055
|
constructor({ color: e = "#a8702c", ...t } = {}) {
|
|
3872
|
-
let n = new
|
|
3873
|
-
super(n, new
|
|
4056
|
+
let n = new Qn(t);
|
|
4057
|
+
super(n, new M({
|
|
3874
4058
|
color: new d(e),
|
|
3875
4059
|
roughness: .85,
|
|
3876
4060
|
metalness: .05,
|
|
@@ -3878,14 +4062,14 @@ var mr = class extends s {
|
|
|
3878
4062
|
side: g
|
|
3879
4063
|
})), this.size = n.size, this.lift = n.lift;
|
|
3880
4064
|
}
|
|
3881
|
-
},
|
|
4065
|
+
}, ti = class extends k {
|
|
3882
4066
|
height;
|
|
3883
4067
|
constructor({ stickColor: e = "#ffffff", flameColor: t = "#ffd700", flameEmissive: n = "#ffa500", flameEmissiveIntensity: r = .35, ...i } = {}) {
|
|
3884
|
-
let a = new
|
|
3885
|
-
super(a, [new
|
|
4068
|
+
let a = new er(i);
|
|
4069
|
+
super(a, [new M({
|
|
3886
4070
|
color: new d(e),
|
|
3887
4071
|
flatShading: !0
|
|
3888
|
-
}), new
|
|
4072
|
+
}), new M({
|
|
3889
4073
|
color: new d(t),
|
|
3890
4074
|
emissive: new d(n),
|
|
3891
4075
|
emissiveIntensity: r,
|
|
@@ -3893,14 +4077,14 @@ var mr = class extends s {
|
|
|
3893
4077
|
toneMapped: !1
|
|
3894
4078
|
})]), this.height = a.height;
|
|
3895
4079
|
}
|
|
3896
|
-
},
|
|
4080
|
+
}, ni = class extends k {
|
|
3897
4081
|
height;
|
|
3898
4082
|
radius;
|
|
3899
4083
|
segmentsU;
|
|
3900
4084
|
segmentsV;
|
|
3901
4085
|
constructor({ color: e = "#ffd700", emissive: t = "#ffa500", emissiveIntensity: n = .35, ...r } = {}) {
|
|
3902
|
-
let i = new
|
|
3903
|
-
super(i, new
|
|
4086
|
+
let i = new $n(r);
|
|
4087
|
+
super(i, new M({
|
|
3904
4088
|
color: new d(e),
|
|
3905
4089
|
emissive: new d(t),
|
|
3906
4090
|
emissiveIntensity: n,
|
|
@@ -3908,25 +4092,25 @@ var mr = class extends s {
|
|
|
3908
4092
|
toneMapped: !1
|
|
3909
4093
|
})), this.height = i.height, this.radius = i.radius, this.segmentsU = i.segmentsU, this.segmentsV = i.segmentsV;
|
|
3910
4094
|
}
|
|
3911
|
-
},
|
|
4095
|
+
}, ri = class extends k {
|
|
3912
4096
|
drop;
|
|
3913
4097
|
cageCenterY;
|
|
3914
4098
|
constructor({ color: e = "#171a1f", mountColor: t, cageColor: n, lampColor: r = "#ffb45a", lampEmissiveIntensity: i = 1.4, lampOpacity: a = .88, inner: o = !0, ...s } = {}) {
|
|
3915
|
-
let c = new
|
|
4099
|
+
let c = new ir({
|
|
3916
4100
|
inner: o,
|
|
3917
4101
|
...s
|
|
3918
|
-
}), l = new d(r), u = [new
|
|
4102
|
+
}), l = new d(r), u = [new M({
|
|
3919
4103
|
color: new d(t ?? e),
|
|
3920
4104
|
metalness: .7,
|
|
3921
4105
|
roughness: .5,
|
|
3922
4106
|
flatShading: !0
|
|
3923
|
-
}), new
|
|
4107
|
+
}), new M({
|
|
3924
4108
|
color: new d(n ?? e),
|
|
3925
4109
|
metalness: .7,
|
|
3926
4110
|
roughness: .5,
|
|
3927
4111
|
flatShading: !0
|
|
3928
4112
|
})];
|
|
3929
|
-
o && u.push(new
|
|
4113
|
+
o && u.push(new M({
|
|
3930
4114
|
color: l,
|
|
3931
4115
|
emissive: l,
|
|
3932
4116
|
emissiveIntensity: i,
|
|
@@ -3939,26 +4123,26 @@ var mr = class extends s {
|
|
|
3939
4123
|
toneMapped: !1
|
|
3940
4124
|
})), super(c, u), this.drop = c.drop, this.cageCenterY = c.cageCenterY;
|
|
3941
4125
|
}
|
|
3942
|
-
},
|
|
4126
|
+
}, ii = class extends k {
|
|
3943
4127
|
lightCenterX;
|
|
3944
4128
|
lightCenterY;
|
|
3945
4129
|
lightCenterZ;
|
|
3946
4130
|
constructor({ color: e = "#1c1e24", mountColor: t, frameColor: n, lampColor: r = "#e8a058", lampEmissiveIntensity: i = 1.4, lampOpacity: a = .88, inner: o = !0, ...s } = {}) {
|
|
3947
|
-
let c = new
|
|
4131
|
+
let c = new ar({
|
|
3948
4132
|
inner: o,
|
|
3949
4133
|
...s
|
|
3950
|
-
}), l = new d(r), u = [new
|
|
4134
|
+
}), l = new d(r), u = [new M({
|
|
3951
4135
|
color: new d(t ?? e),
|
|
3952
4136
|
metalness: .65,
|
|
3953
4137
|
roughness: .55,
|
|
3954
4138
|
flatShading: !0
|
|
3955
|
-
}), new
|
|
4139
|
+
}), new M({
|
|
3956
4140
|
color: new d(n ?? e),
|
|
3957
4141
|
metalness: .65,
|
|
3958
4142
|
roughness: .55,
|
|
3959
4143
|
flatShading: !0
|
|
3960
4144
|
})];
|
|
3961
|
-
o && u.push(new
|
|
4145
|
+
o && u.push(new M({
|
|
3962
4146
|
color: l,
|
|
3963
4147
|
emissive: l,
|
|
3964
4148
|
emissiveIntensity: i,
|
|
@@ -3971,19 +4155,19 @@ var mr = class extends s {
|
|
|
3971
4155
|
toneMapped: !1
|
|
3972
4156
|
})), super(c, u), this.lightCenterX = c.lightCenterX, this.lightCenterY = c.lightCenterY, this.lightCenterZ = c.lightCenterZ;
|
|
3973
4157
|
}
|
|
3974
|
-
},
|
|
4158
|
+
}, ai = class extends k {
|
|
3975
4159
|
lampCenterY;
|
|
3976
4160
|
constructor({ color: e = "#8b4513", lampColor: t = "#ffd700", lampEmissiveIntensity: n = 1.2, lampOpacity: r = .75, inner: i = !0, ...a } = {}) {
|
|
3977
|
-
let o = new
|
|
4161
|
+
let o = new tr({
|
|
3978
4162
|
inner: i,
|
|
3979
4163
|
...a
|
|
3980
|
-
}), s = new d(t), c = [new
|
|
4164
|
+
}), s = new d(t), c = [new M({
|
|
3981
4165
|
color: new d(e),
|
|
3982
4166
|
roughness: .85,
|
|
3983
4167
|
metalness: .04,
|
|
3984
4168
|
flatShading: !0
|
|
3985
4169
|
})];
|
|
3986
|
-
i && c.push(new
|
|
4170
|
+
i && c.push(new M({
|
|
3987
4171
|
color: s,
|
|
3988
4172
|
emissive: s,
|
|
3989
4173
|
emissiveIntensity: n,
|
|
@@ -3996,41 +4180,52 @@ var mr = class extends s {
|
|
|
3996
4180
|
toneMapped: !1
|
|
3997
4181
|
})), super(o, c), this.lampCenterY = o.lampCenterY;
|
|
3998
4182
|
}
|
|
3999
|
-
},
|
|
4183
|
+
}, oi = class extends k {
|
|
4184
|
+
radius;
|
|
4185
|
+
constructor({ color: e = "#6f6f6f", flatShading: t = !0, ...n } = {}) {
|
|
4186
|
+
let r = new Nt(n);
|
|
4187
|
+
super(r, new M({
|
|
4188
|
+
color: new d(e),
|
|
4189
|
+
roughness: 1,
|
|
4190
|
+
metalness: 0,
|
|
4191
|
+
flatShading: t
|
|
4192
|
+
})), this.radius = r.radius, this.castShadow = !0, this.receiveShadow = !0;
|
|
4193
|
+
}
|
|
4194
|
+
}, si = class extends k {
|
|
4000
4195
|
constructor({ rockColor: e = "#808080", mossColor: t = "#4b8b3b", mossOpacity: n = .8, ...r } = {}) {
|
|
4001
|
-
super(new
|
|
4196
|
+
super(new zt(r), [new M({
|
|
4002
4197
|
color: new d(e),
|
|
4003
4198
|
flatShading: !0
|
|
4004
|
-
}), new
|
|
4199
|
+
}), new M({
|
|
4005
4200
|
color: new d(t),
|
|
4006
4201
|
flatShading: !0,
|
|
4007
4202
|
opacity: n,
|
|
4008
4203
|
transparent: n < 1
|
|
4009
4204
|
})]);
|
|
4010
4205
|
}
|
|
4011
|
-
},
|
|
4206
|
+
}, ci = class extends k {
|
|
4012
4207
|
constructor({ color: e = "#808080", ...t } = {}) {
|
|
4013
|
-
super(new
|
|
4208
|
+
super(new Vt(t), new M({
|
|
4014
4209
|
color: new d(e),
|
|
4015
4210
|
flatShading: !0
|
|
4016
4211
|
}));
|
|
4017
4212
|
}
|
|
4018
|
-
},
|
|
4213
|
+
}, li = class extends S {
|
|
4019
4214
|
constructor() {
|
|
4020
4215
|
super();
|
|
4021
|
-
let e = new
|
|
4216
|
+
let e = new k(new p(.3, .4, .1, 16), new M({
|
|
4022
4217
|
color: 3355443,
|
|
4023
4218
|
roughness: .6,
|
|
4024
4219
|
metalness: .3
|
|
4025
4220
|
}));
|
|
4026
4221
|
e.position.y = .05;
|
|
4027
|
-
let t = new
|
|
4222
|
+
let t = new k(new p(.1, .1, .7, 16), new M({
|
|
4028
4223
|
color: 5592405,
|
|
4029
4224
|
roughness: .5,
|
|
4030
4225
|
metalness: .4
|
|
4031
4226
|
}));
|
|
4032
4227
|
t.position.y = .4;
|
|
4033
|
-
let n = new
|
|
4228
|
+
let n = new k(new f(.075, .2, 16), new M({
|
|
4034
4229
|
color: 16733440,
|
|
4035
4230
|
emissive: 16733440,
|
|
4036
4231
|
emissiveIntensity: .6,
|
|
@@ -4039,38 +4234,38 @@ var mr = class extends s {
|
|
|
4039
4234
|
}));
|
|
4040
4235
|
n.position.y = .8, this.add(e, t, n);
|
|
4041
4236
|
}
|
|
4042
|
-
},
|
|
4237
|
+
}, ui = class extends S {
|
|
4043
4238
|
constructor() {
|
|
4044
4239
|
super();
|
|
4045
|
-
let e = new a(3, 4, .1), t = new
|
|
4240
|
+
let e = new a(3, 4, .1), t = new M({
|
|
4046
4241
|
color: 3026478,
|
|
4047
4242
|
roughness: .8,
|
|
4048
4243
|
metalness: .6
|
|
4049
|
-
}), n = new a(.2, .5, .2), r = new
|
|
4244
|
+
}), n = new a(.2, .5, .2), r = new M({
|
|
4050
4245
|
color: 11184810,
|
|
4051
4246
|
roughness: .5,
|
|
4052
4247
|
metalness: .7
|
|
4053
|
-
}), i = new p(.3, .3, .1, 16), o = new
|
|
4248
|
+
}), i = new p(.3, .3, .1, 16), o = new M({
|
|
4054
4249
|
color: 5592405,
|
|
4055
4250
|
roughness: .7,
|
|
4056
4251
|
metalness: .5
|
|
4057
|
-
}), s = new
|
|
4252
|
+
}), s = new k(e, t);
|
|
4058
4253
|
for (let e = -1; e <= 1; e++) {
|
|
4059
|
-
let t = new
|
|
4254
|
+
let t = new k(n, r);
|
|
4060
4255
|
t.position.set(e, 1.5, .1), s.add(t);
|
|
4061
4256
|
}
|
|
4062
|
-
let c = new
|
|
4257
|
+
let c = new k(i, o);
|
|
4063
4258
|
c.rotation.x = Math.PI / 2, c.position.set(0, .5, .15), s.add(c);
|
|
4064
|
-
let l = new
|
|
4259
|
+
let l = new k(new L(.15, 8, 8), new M({
|
|
4065
4260
|
color: 16711680,
|
|
4066
4261
|
emissive: 16711680,
|
|
4067
4262
|
emissiveIntensity: .5
|
|
4068
4263
|
}));
|
|
4069
4264
|
l.position.set(0, -1, .1), s.add(l), this.add(s);
|
|
4070
4265
|
}
|
|
4071
|
-
},
|
|
4266
|
+
}, di = class extends k {
|
|
4072
4267
|
constructor({ color: e = "#88ccff", opacity: t = .4, ...n } = {}) {
|
|
4073
|
-
super(new
|
|
4268
|
+
super(new mr(n), new j({
|
|
4074
4269
|
color: new d(e),
|
|
4075
4270
|
transparent: !0,
|
|
4076
4271
|
opacity: t,
|
|
@@ -4081,9 +4276,9 @@ var mr = class extends s {
|
|
|
4081
4276
|
side: g
|
|
4082
4277
|
}));
|
|
4083
4278
|
}
|
|
4084
|
-
},
|
|
4279
|
+
}, fi = class extends k {
|
|
4085
4280
|
constructor() {
|
|
4086
|
-
super(new
|
|
4281
|
+
super(new Cr(), new j({
|
|
4087
4282
|
color: 8965375,
|
|
4088
4283
|
transparent: !0,
|
|
4089
4284
|
depthWrite: !1,
|
|
@@ -4095,96 +4290,96 @@ var mr = class extends s {
|
|
|
4095
4290
|
side: g
|
|
4096
4291
|
}));
|
|
4097
4292
|
}
|
|
4098
|
-
},
|
|
4293
|
+
}, pi = class extends S {
|
|
4099
4294
|
constructor() {
|
|
4100
4295
|
super();
|
|
4101
|
-
let e = new
|
|
4296
|
+
let e = new k(new a(2, 3, .1), new M({
|
|
4102
4297
|
color: 3355443,
|
|
4103
4298
|
roughness: .8,
|
|
4104
4299
|
metalness: .5
|
|
4105
|
-
})), t = new p(.1, .1, .2, 8), n = new p(.05, .05, 1, 8), r = new
|
|
4300
|
+
})), t = new p(.1, .1, .2, 8), n = new p(.05, .05, 1, 8), r = new M({
|
|
4106
4301
|
color: 11184810,
|
|
4107
4302
|
roughness: .5,
|
|
4108
4303
|
metalness: .7
|
|
4109
4304
|
}), i = [];
|
|
4110
4305
|
for (let e = -.5; e <= .5; e += .5) {
|
|
4111
|
-
let a = new
|
|
4306
|
+
let a = new k(t, r);
|
|
4112
4307
|
a.position.set(e, 1, .1);
|
|
4113
|
-
let o = new
|
|
4308
|
+
let o = new k(n, r);
|
|
4114
4309
|
o.position.y = .5, a.add(o), i.push(o), this.add(a);
|
|
4115
4310
|
}
|
|
4116
4311
|
this.add(e);
|
|
4117
4312
|
}
|
|
4118
|
-
},
|
|
4313
|
+
}, mi = class extends S {
|
|
4119
4314
|
constructor() {
|
|
4120
4315
|
super();
|
|
4121
|
-
let e = new a(1, .2, .5), t = new
|
|
4316
|
+
let e = new a(1, .2, .5), t = new M({
|
|
4122
4317
|
color: 4473924,
|
|
4123
4318
|
roughness: .6,
|
|
4124
4319
|
metalness: .3
|
|
4125
|
-
}), n = new
|
|
4320
|
+
}), n = new k(e, t);
|
|
4126
4321
|
n.position.y = .1;
|
|
4127
|
-
let r = new
|
|
4322
|
+
let r = new k(new a(.2, 1, .2), t);
|
|
4128
4323
|
r.position.set(0, .6, -.2);
|
|
4129
|
-
let i = new
|
|
4324
|
+
let i = new k(new p(.1, .1, .4, 8), new M({
|
|
4130
4325
|
color: 3355443,
|
|
4131
4326
|
roughness: .5,
|
|
4132
4327
|
metalness: .6
|
|
4133
4328
|
}));
|
|
4134
4329
|
i.position.set(0, 1.1, -.35), i.rotation.x = -Math.PI / 4;
|
|
4135
|
-
let o = new
|
|
4330
|
+
let o = new k(new a(.6, .1, .6), new M({
|
|
4136
4331
|
color: 5592405,
|
|
4137
4332
|
roughness: .8,
|
|
4138
4333
|
metalness: .2
|
|
4139
4334
|
}));
|
|
4140
4335
|
o.position.set(0, .6, 0), this.add(n, r, i, o);
|
|
4141
4336
|
}
|
|
4142
|
-
},
|
|
4337
|
+
}, hi = class extends S {
|
|
4143
4338
|
constructor() {
|
|
4144
4339
|
super();
|
|
4145
|
-
let e = new
|
|
4340
|
+
let e = new wr(), t = new p(.2, .3, 1.5, 8);
|
|
4146
4341
|
t.translate(0, .75, 0);
|
|
4147
|
-
let n = new
|
|
4342
|
+
let n = new M({
|
|
4148
4343
|
color: 6045747,
|
|
4149
4344
|
roughness: 1,
|
|
4150
4345
|
metalness: 0,
|
|
4151
4346
|
side: g
|
|
4152
|
-
}), r = new
|
|
4347
|
+
}), r = new M({
|
|
4153
4348
|
color: 9132587,
|
|
4154
4349
|
roughness: .8,
|
|
4155
4350
|
metalness: .1
|
|
4156
|
-
}), i = new
|
|
4351
|
+
}), i = new k(e, n);
|
|
4157
4352
|
i.castShadow = !0;
|
|
4158
|
-
let a = new
|
|
4353
|
+
let a = new k(t, r);
|
|
4159
4354
|
a.castShadow = !0, a.position.set(.3, 1.3, 0), a.rotation.z = Math.PI / 4, this.add(i, a);
|
|
4160
4355
|
}
|
|
4161
|
-
},
|
|
4356
|
+
}, gi = class extends k {
|
|
4162
4357
|
geometry;
|
|
4163
4358
|
material;
|
|
4164
4359
|
constructor({ width: e = 3, height: t = 4, depth: n = .1 } = {}) {
|
|
4165
|
-
super(), this.geometry = new a(e, t, n), this.material = new
|
|
4360
|
+
super(), this.geometry = new a(e, t, n), this.material = new M({
|
|
4166
4361
|
color: 3026478,
|
|
4167
4362
|
roughness: .8,
|
|
4168
4363
|
metalness: .6
|
|
4169
4364
|
});
|
|
4170
4365
|
}
|
|
4171
|
-
},
|
|
4366
|
+
}, _i = class extends k {
|
|
4172
4367
|
geometry;
|
|
4173
4368
|
material;
|
|
4174
4369
|
constructor({ radius: e = .15, color: t = 16762823, emissive: n = 16711680, emissiveIntensity: r = .5 } = {}) {
|
|
4175
|
-
super(), this.geometry = new
|
|
4370
|
+
super(), this.geometry = new L(e, 8, 8), this.material = new M({
|
|
4176
4371
|
color: t,
|
|
4177
4372
|
emissive: n,
|
|
4178
4373
|
emissiveIntensity: r
|
|
4179
4374
|
});
|
|
4180
4375
|
}
|
|
4181
|
-
},
|
|
4376
|
+
}, vi = class extends S {
|
|
4182
4377
|
constructor() {
|
|
4183
4378
|
super();
|
|
4184
|
-
let e = new
|
|
4379
|
+
let e = new k(new me(new l(Array.from({ length: 100 }, (e, t) => {
|
|
4185
4380
|
let n = t * .2;
|
|
4186
|
-
return new
|
|
4187
|
-
})), 200, .1, 8, !1), new
|
|
4381
|
+
return new z(Math.cos(n) * .4, t * .05, Math.sin(n) * .4);
|
|
4382
|
+
})), 200, .1, 8, !1), new M({
|
|
4188
4383
|
color: 8965375,
|
|
4189
4384
|
transparent: !0,
|
|
4190
4385
|
opacity: .3,
|
|
@@ -4195,30 +4390,30 @@ var mr = class extends s {
|
|
|
4195
4390
|
}));
|
|
4196
4391
|
this.add(e);
|
|
4197
4392
|
}
|
|
4198
|
-
},
|
|
4393
|
+
}, yi = class extends k {
|
|
4199
4394
|
constructor({ color: e = "#888888", ...t } = {}) {
|
|
4200
|
-
super(new
|
|
4395
|
+
super(new Tr(t), new M({
|
|
4201
4396
|
color: new d(e),
|
|
4202
4397
|
roughness: .7,
|
|
4203
4398
|
metalness: .3
|
|
4204
4399
|
}));
|
|
4205
4400
|
}
|
|
4206
|
-
},
|
|
4401
|
+
}, bi = class extends k {
|
|
4207
4402
|
constructor() {
|
|
4208
|
-
super(new
|
|
4403
|
+
super(new Er(), [new M({
|
|
4209
4404
|
color: 3355443,
|
|
4210
4405
|
roughness: .6,
|
|
4211
4406
|
metalness: .5
|
|
4212
|
-
}), new
|
|
4407
|
+
}), new M({
|
|
4213
4408
|
color: 16737792,
|
|
4214
4409
|
roughness: .5,
|
|
4215
4410
|
metalness: .8,
|
|
4216
4411
|
side: g
|
|
4217
4412
|
})]);
|
|
4218
4413
|
}
|
|
4219
|
-
},
|
|
4414
|
+
}, xi = class extends k {
|
|
4220
4415
|
constructor(e = .2, t = .2, n = 3, r = 32) {
|
|
4221
|
-
super(new
|
|
4416
|
+
super(new Dr(e, t, n, r), new j({
|
|
4222
4417
|
color: 8965375,
|
|
4223
4418
|
transparent: !0,
|
|
4224
4419
|
opacity: .4,
|
|
@@ -4230,7 +4425,7 @@ var mr = class extends s {
|
|
|
4230
4425
|
side: g
|
|
4231
4426
|
}));
|
|
4232
4427
|
}
|
|
4233
|
-
},
|
|
4428
|
+
}, Si = class extends S {
|
|
4234
4429
|
count;
|
|
4235
4430
|
constructor({ count: e = 3, colors: t = [
|
|
4236
4431
|
"#00ffaa",
|
|
@@ -4238,13 +4433,13 @@ var mr = class extends s {
|
|
|
4238
4433
|
"#aa00ff"
|
|
4239
4434
|
] } = {}) {
|
|
4240
4435
|
super(), this.count = e;
|
|
4241
|
-
let n = new
|
|
4436
|
+
let n = new k(new a(3, .2, 1), new M({
|
|
4242
4437
|
color: 9127187,
|
|
4243
4438
|
roughness: .7,
|
|
4244
4439
|
metalness: .3
|
|
4245
4440
|
}));
|
|
4246
4441
|
n.position.y = .5, n.castShadow = !0;
|
|
4247
|
-
let r = new
|
|
4442
|
+
let r = new Dr(.1, .1, 1, 16), i = new M({
|
|
4248
4443
|
color: 11184810,
|
|
4249
4444
|
transparent: !0,
|
|
4250
4445
|
opacity: .4,
|
|
@@ -4254,9 +4449,9 @@ var mr = class extends s {
|
|
|
4254
4449
|
side: g
|
|
4255
4450
|
});
|
|
4256
4451
|
for (let a = 0; a < e; a++) {
|
|
4257
|
-
let o = new
|
|
4452
|
+
let o = new k(r, i), s = (a - (e - 1) / 2) * .8;
|
|
4258
4453
|
o.position.set(s, 1, 0), o.castShadow = !0, o.renderOrder = 2;
|
|
4259
|
-
let c = new
|
|
4454
|
+
let c = new Dr(.099, .099, .5, 16, !1), l = t[a % t.length], u = new k(c, new M({
|
|
4260
4455
|
color: new d(l),
|
|
4261
4456
|
emissive: new d(l),
|
|
4262
4457
|
emissiveIntensity: .5,
|
|
@@ -4269,9 +4464,9 @@ var mr = class extends s {
|
|
|
4269
4464
|
}
|
|
4270
4465
|
this.add(n);
|
|
4271
4466
|
}
|
|
4272
|
-
},
|
|
4467
|
+
}, Ci = class extends k {
|
|
4273
4468
|
constructor({ color: e = "#ffff00", emissive: t = "#ffd700", emissiveIntensity: n = .25, ...r } = {}) {
|
|
4274
|
-
super(new ft(r), new
|
|
4469
|
+
super(new ft(r), new M({
|
|
4275
4470
|
color: new d(e),
|
|
4276
4471
|
emissive: new d(t),
|
|
4277
4472
|
emissiveIntensity: n,
|
|
@@ -4280,17 +4475,17 @@ var mr = class extends s {
|
|
|
4280
4475
|
flatShading: !0
|
|
4281
4476
|
}));
|
|
4282
4477
|
}
|
|
4283
|
-
},
|
|
4478
|
+
}, wi = class extends k {
|
|
4284
4479
|
constructor({ color: e = "#aaaaaa", ...t } = {}) {
|
|
4285
|
-
super(new
|
|
4480
|
+
super(new cr(t), new M({
|
|
4286
4481
|
color: new d(e),
|
|
4287
4482
|
metalness: .8,
|
|
4288
4483
|
roughness: .2
|
|
4289
4484
|
}));
|
|
4290
4485
|
}
|
|
4291
|
-
},
|
|
4486
|
+
}, Ti = class extends k {
|
|
4292
4487
|
constructor({ color: e = "#c62828", emissive: t = "#c61416", emissiveIntensity: n = .25, ...r } = {}) {
|
|
4293
|
-
super(new
|
|
4488
|
+
super(new ur(r), new M({
|
|
4294
4489
|
color: new d(e),
|
|
4295
4490
|
emissive: new d(t),
|
|
4296
4491
|
emissiveIntensity: n,
|
|
@@ -4299,9 +4494,9 @@ var mr = class extends s {
|
|
|
4299
4494
|
flatShading: !0
|
|
4300
4495
|
}));
|
|
4301
4496
|
}
|
|
4302
|
-
},
|
|
4497
|
+
}, Ei = class extends k {
|
|
4303
4498
|
constructor({ color: e = "#ffffff", emissive: t = "#ffffff", emissiveIntensity: n = .1, ...r } = {}) {
|
|
4304
|
-
super(new
|
|
4499
|
+
super(new It(r), new M({
|
|
4305
4500
|
color: new d(e),
|
|
4306
4501
|
emissive: new d(t),
|
|
4307
4502
|
emissiveIntensity: n,
|
|
@@ -4310,9 +4505,9 @@ var mr = class extends s {
|
|
|
4310
4505
|
flatShading: !0
|
|
4311
4506
|
}));
|
|
4312
4507
|
}
|
|
4313
|
-
},
|
|
4508
|
+
}, Di = class extends k {
|
|
4314
4509
|
constructor({ color: e = "#ffff00", emissive: t = "#ffd700", emissiveIntensity: n = .25, ...r } = {}) {
|
|
4315
|
-
super(new
|
|
4510
|
+
super(new fr(r), new M({
|
|
4316
4511
|
color: new d(e),
|
|
4317
4512
|
emissive: new d(t),
|
|
4318
4513
|
emissiveIntensity: n,
|
|
@@ -4321,52 +4516,56 @@ var mr = class extends s {
|
|
|
4321
4516
|
flatShading: !0
|
|
4322
4517
|
}));
|
|
4323
4518
|
}
|
|
4324
|
-
},
|
|
4519
|
+
}, Oi = class extends k {
|
|
4325
4520
|
constructor() {
|
|
4326
|
-
super(new
|
|
4521
|
+
super(new pr(), new M({ color: 16777215 }));
|
|
4327
4522
|
}
|
|
4328
|
-
},
|
|
4523
|
+
}, ki = class extends k {
|
|
4329
4524
|
trunkHeight;
|
|
4330
4525
|
constructor({ trunkColor: e = "#8b4513", leafColor: t = "#228b22", ...n } = {}) {
|
|
4331
|
-
let r = new
|
|
4332
|
-
super(r, [new
|
|
4526
|
+
let r = new Ar(n);
|
|
4527
|
+
super(r, [new M({
|
|
4333
4528
|
color: new d(e),
|
|
4334
4529
|
roughness: .9,
|
|
4335
4530
|
metalness: 0,
|
|
4336
4531
|
flatShading: !0
|
|
4337
|
-
}), new
|
|
4532
|
+
}), new M({
|
|
4338
4533
|
color: new d(t),
|
|
4339
4534
|
roughness: .8,
|
|
4340
4535
|
metalness: 0,
|
|
4341
4536
|
flatShading: !0
|
|
4342
4537
|
})]), this.trunkHeight = r.trunkHeight;
|
|
4343
4538
|
}
|
|
4344
|
-
},
|
|
4539
|
+
}, Ai = class extends k {
|
|
4345
4540
|
radius;
|
|
4346
4541
|
height;
|
|
4347
|
-
constructor({ color: e = "#
|
|
4348
|
-
let
|
|
4349
|
-
super(
|
|
4542
|
+
constructor({ color: e = "#3a5a3a", flatShading: t = !0, ...n } = {}) {
|
|
4543
|
+
let r = new Or(n);
|
|
4544
|
+
super(r, new M({
|
|
4350
4545
|
color: new d(e),
|
|
4351
|
-
|
|
4352
|
-
|
|
4546
|
+
roughness: 1,
|
|
4547
|
+
metalness: 0,
|
|
4548
|
+
flatShading: t,
|
|
4549
|
+
side: g
|
|
4550
|
+
})), this.radius = r.radius, this.height = r.height, this.castShadow = !0, this.receiveShadow = !0;
|
|
4353
4551
|
}
|
|
4354
|
-
},
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
});
|
|
4361
|
-
super(r, new j({
|
|
4552
|
+
}, ji = class extends k {
|
|
4553
|
+
width;
|
|
4554
|
+
depth;
|
|
4555
|
+
constructor({ color: e = "#3a5a3a", flatShading: t = !0, ...n } = {}) {
|
|
4556
|
+
let r = new kr(n);
|
|
4557
|
+
super(r, new M({
|
|
4362
4558
|
color: new d(e),
|
|
4363
|
-
|
|
4364
|
-
|
|
4559
|
+
roughness: 1,
|
|
4560
|
+
metalness: 0,
|
|
4561
|
+
flatShading: t,
|
|
4562
|
+
side: g
|
|
4563
|
+
})), this.width = r.width, this.depth = r.depth, this.castShadow = !0, this.receiveShadow = !0;
|
|
4365
4564
|
}
|
|
4366
4565
|
};
|
|
4367
4566
|
//#endregion
|
|
4368
4567
|
//#region src/shaders/addInstanceColor.ts
|
|
4369
|
-
function
|
|
4568
|
+
function Mi(e) {
|
|
4370
4569
|
if (!e) throw Error("A material must be provided to add instance color support.");
|
|
4371
4570
|
return e.onBeforeCompile = (e) => {
|
|
4372
4571
|
e.vertexShader = e.vertexShader.replace("void main() {", "attribute vec3 instanceColor;\nvarying vec3 vColor;\nvoid main() {"), e.vertexShader = e.vertexShader.replace("#include <begin_vertex>", "#include <begin_vertex>\nvColor = instanceColor;"), e.fragmentShader = e.fragmentShader.replace("void main() {", "varying vec3 vColor;\nvoid main() {"), e.fragmentShader = e.fragmentShader.replace("#include <dithering_fragment>", "#include <dithering_fragment>\ngl_FragColor.rgb = vColor * gl_FragColor.rgb;");
|
|
@@ -4374,38 +4573,38 @@ function Si(e) {
|
|
|
4374
4573
|
}
|
|
4375
4574
|
//#endregion
|
|
4376
4575
|
//#region src/shaders/addWaterDisplacement.ts
|
|
4377
|
-
function
|
|
4576
|
+
function Ni(e, { time: t = 0, waveFrequency: n = .2, waveAmplitude: r = .5 } = {}) {
|
|
4378
4577
|
e.onBeforeCompile = (i) => {
|
|
4379
4578
|
i.uniforms.time = { value: t }, i.uniforms.waveFrequency = { value: n }, i.uniforms.waveAmplitude = { value: r }, i.vertexShader = "\n uniform float time;\n uniform float waveFrequency;\n uniform float waveAmplitude;\n\n vec3 waterDisplacement(vec3 position, vec3 normal) {\n vec3 displaced = position;\n\n // Displace along the normal direction instead of local y-axis\n displaced += normal * (sin(position.x * waveFrequency + time) * waveAmplitude);\n displaced += normal * (cos(position.z * waveFrequency + time) * waveAmplitude);\n\n return displaced;\n }\n " + i.vertexShader, i.vertexShader = i.vertexShader.replace("#include <begin_vertex>", "\n vec3 transformed = waterDisplacement(position, normal);\n "), e.userData.shader = i;
|
|
4380
4579
|
};
|
|
4381
4580
|
}
|
|
4382
|
-
function
|
|
4581
|
+
function Pi(e, t) {
|
|
4383
4582
|
e.userData.shader && (e.userData.shader.uniforms.time.value += t);
|
|
4384
4583
|
}
|
|
4385
4584
|
//#endregion
|
|
4386
4585
|
//#region src/shaders/addNoiseDisplacement.ts
|
|
4387
|
-
function
|
|
4586
|
+
function Fi(e, { time: t = 0, intensity: n = 1, axis: r = Pe.XYZ, scale: i = 10 } = {}) {
|
|
4388
4587
|
e.onBeforeCompile = (a) => {
|
|
4389
4588
|
a.uniforms.time = { value: t }, a.uniforms.axis = { value: r }, a.uniforms.intensity = { value: n }, a.uniforms.scale = { value: i }, a.vertexShader = "\n uniform float time;\n uniform vec3 axis;\n uniform float intensity;\n uniform float scale;\n\n float mod289(float x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\n vec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\n vec4 perm(vec4 x) { return mod289(((x * 34.0) + 1.0) * x); }\n\n float noise(vec3 p) {\n vec3 a = floor(p);\n vec3 d = p - a;\n d = d * d * (3.0 - 2.0 * d);\n\n vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0);\n vec4 k1 = perm(b.xyxy);\n vec4 k2 = perm(k1.xyxy + b.zzww);\n\n vec4 c = k2 + a.zzzz;\n vec4 k3 = perm(c);\n vec4 k4 = perm(c + 1.0);\n\n vec4 o1 = fract(k3 * (1.0 / 41.0));\n vec4 o2 = fract(k4 * (1.0 / 41.0));\n\n vec4 o3 = o2 * d.z + o1 * (1.0 - d.z);\n vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x);\n\n return o4.y * d.y + o4.x * (1.0 - d.y);\n }\n " + a.vertexShader, a.vertexShader = a.vertexShader.replace("#include <begin_vertex>", "\n vec3 transformed = vec3(position);\n float n = noise(transformed * scale + time);\n transformed += normalize(axis) * n * intensity;\n vec3 transformedNormal = normal;\n "), e.userData.shader = a;
|
|
4390
4589
|
};
|
|
4391
4590
|
}
|
|
4392
|
-
function
|
|
4591
|
+
function Ii(e, t) {
|
|
4393
4592
|
e.userData.shader && (e.userData.shader.uniforms.time.value += t);
|
|
4394
4593
|
}
|
|
4395
4594
|
//#endregion
|
|
4396
4595
|
//#region src/shaders/atmosphericShader.ts
|
|
4397
|
-
var
|
|
4596
|
+
var Li = {
|
|
4398
4597
|
uniforms: {
|
|
4399
4598
|
turbidity: { value: 10 },
|
|
4400
4599
|
rayleigh: { value: 2 },
|
|
4401
4600
|
mieCoefficient: { value: .005 },
|
|
4402
4601
|
mieDirectionalG: { value: .8 },
|
|
4403
|
-
sunPosition: { value: new
|
|
4404
|
-
up: { value: new
|
|
4602
|
+
sunPosition: { value: new z().setFromSphericalCoords(1, D.degToRad(90), D.degToRad(180)) },
|
|
4603
|
+
up: { value: new z(0, 1, 0) }
|
|
4405
4604
|
},
|
|
4406
4605
|
vertexShader: "\n uniform vec3 sunPosition;\n uniform float rayleigh;\n uniform float turbidity;\n uniform float mieCoefficient;\n uniform vec3 up;\n\n varying vec3 vWorldPosition;\n varying vec3 vSunDirection;\n varying float vSunfade;\n varying vec3 vBetaR;\n varying vec3 vBetaM;\n varying float vSunE;\n\n // constants for atmospheric scattering\n const float e = 2.71828182845904523536028747135266249775724709369995957;\n const float pi = 3.141592653589793238462643383279502884197169;\n\n // wavelength of used primaries, according to preetham\n const vec3 lambda = vec3( 680E-9, 550E-9, 450E-9 );\n // this pre-calculation replaces older TotalRayleigh(vec3 lambda) function:\n // (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn))\n const vec3 totalRayleigh = vec3( 5.804542996261093E-6, 1.3562911419845635E-5, 3.0265902468824876E-5 );\n\n // mie stuff\n // K coefficient for the primaries\n const float v = 4.0;\n const vec3 K = vec3( 0.686, 0.678, 0.666 );\n // MieConst = pi * pow( ( 2.0 * pi ) / lambda, vec3( v - 2.0 ) ) * K\n const vec3 MieConst = vec3( 1.8399918514433978E14, 2.7798023919660528E14, 4.0790479543861094E14 );\n\n // earth shadow hack\n // cutoffAngle = pi / 1.95;\n const float cutoffAngle = 1.6110731556870734;\n const float steepness = 1.5;\n const float EE = 1000.0;\n\n float sunIntensity( float zenithAngleCos ) {\n zenithAngleCos = clamp( zenithAngleCos, -1.0, 1.0 );\n return EE * max( 0.0, 1.0 - pow( e, -( ( cutoffAngle - acos( zenithAngleCos ) ) / steepness ) ) );\n }\n\n vec3 totalMie( float T ) {\n float c = ( 0.2 * T ) * 10E-18;\n return 0.434 * c * MieConst;\n }\n\n void main() {\n vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n vWorldPosition = worldPosition.xyz;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n gl_Position.z = gl_Position.w; // set z to camera.far\n\n vSunDirection = normalize( sunPosition );\n\n vSunE = sunIntensity( dot( vSunDirection, up ) );\n\n vSunfade = 1.0 - clamp( 1.0 - exp( ( sunPosition.y / 450000.0 ) ), 0.0, 1.0 );\n\n float rayleighCoefficient = rayleigh - ( 1.0 * ( 1.0 - vSunfade ) );\n\n // extinction (absorption + out scattering)\n // rayleigh coefficients\n vBetaR = totalRayleigh * rayleighCoefficient;\n\n // mie coefficients\n vBetaM = totalMie( turbidity ) * mieCoefficient;\n }\n ",
|
|
4407
4606
|
fragmentShader: "\n varying vec3 vWorldPosition;\n varying vec3 vSunDirection;\n varying float vSunfade;\n varying vec3 vBetaR;\n varying vec3 vBetaM;\n varying float vSunE;\n\n uniform float mieDirectionalG;\n uniform vec3 up;\n\n // constants for atmospheric scattering\n const float pi = 3.141592653589793238462643383279502884197169;\n\n const float n = 1.0003; // refractive index of air\n const float N = 2.545E25; // number of molecules per unit volume for air at 288.15K and 1013mb (sea level -45 celsius)\n\n // optical length at zenith for molecules\n const float rayleighZenithLength = 8.4E3;\n const float mieZenithLength = 1.25E3;\n // 66 arc seconds -> degrees, and the cosine of that\n const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;\n\n // 3.0 / ( 16.0 * pi )\n const float THREE_OVER_SIXTEENPI = 0.05968310365946075;\n // 1.0 / ( 4.0 * pi )\n const float ONE_OVER_FOURPI = 0.07957747154594767;\n\n float rayleighPhase( float cosTheta ) {\n return THREE_OVER_SIXTEENPI * ( 1.0 + pow( cosTheta, 2.0 ) );\n }\n\n float hgPhase( float cosTheta, float g ) {\n float g2 = pow( g, 2.0 );\n float inverse = 1.0 / pow( 1.0 - 2.0 * g * cosTheta + g2, 1.5 );\n return ONE_OVER_FOURPI * ( ( 1.0 - g2 ) * inverse );\n }\n\n void main() {\n vec3 direction = normalize( vWorldPosition - cameraPosition );\n\n // optical length\n // cutoff angle at 90 to avoid singularity in next formula.\n float zenithAngle = acos( max( 0.0, dot( up, direction ) ) );\n float inverse = 1.0 / ( cos( zenithAngle ) + 0.15 * pow( 93.885 - ( ( zenithAngle * 180.0 ) / pi ), -1.253 ) );\n float sR = rayleighZenithLength * inverse;\n float sM = mieZenithLength * inverse;\n\n // combined extinction factor\n vec3 Fex = exp( -( vBetaR * sR + vBetaM * sM ) );\n\n // in scattering\n float cosTheta = dot( direction, vSunDirection );\n\n float rPhase = rayleighPhase( cosTheta * 0.5 + 0.5 );\n vec3 betaRTheta = vBetaR * rPhase;\n\n float mPhase = hgPhase( cosTheta, mieDirectionalG );\n vec3 betaMTheta = vBetaM * mPhase;\n\n vec3 Lin = pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * ( 1.0 - Fex ), vec3( 1.5 ) );\n Lin *= mix( vec3( 1.0 ), pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * Fex, vec3( 1.0 / 2.0 ) ), clamp( pow( 1.0 - dot( up, vSunDirection ), 5.0 ), 0.0, 1.0 ) );\n\n // night sky\n float theta = acos( direction.y ); // elevation --> y-axis, [-pi/2, pi/2]\n float phi = atan( direction.z, direction.x ); // azimuth --> x-axis [-pi/2, pi/2]\n vec2 uv = vec2( phi, theta ) / vec2( 2.0 * pi, pi ) + vec2( 0.5, 0.0 );\n vec3 L0 = vec3( 0.1 ) * Fex;\n\n // composition + solar disc\n float sundisk = smoothstep( sunAngularDiameterCos, sunAngularDiameterCos + 0.00002, cosTheta );\n L0 += ( vSunE * 19000.0 * Fex ) * sundisk;\n\n vec3 texColor = ( Lin + L0 ) * 0.04 + vec3( 0.0, 0.0003, 0.00075 );\n\n vec3 retColor = pow( texColor, vec3( 1.0 / ( 1.2 + ( 1.2 * vSunfade ) ) ) );\n\n gl_FragColor = vec4( retColor, 1.0 );\n\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n }\n "
|
|
4408
|
-
},
|
|
4607
|
+
}, Ri = {
|
|
4409
4608
|
uniforms: {
|
|
4410
4609
|
tDiffuse: { value: null },
|
|
4411
4610
|
kernelSize: { value: 0 },
|
|
@@ -4413,7 +4612,7 @@ var Di = {
|
|
|
4413
4612
|
},
|
|
4414
4613
|
vertexShader: "\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",
|
|
4415
4614
|
fragmentShader: "\n uniform sampler2D tDiffuse;\n uniform float kernelSize;\n uniform vec2 resolution;\n varying vec2 vUv;\n\n void main() {\n vec2 texelSize = 1.0 / resolution;\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n // Box blur with dynamic kernel size\n float radius = kernelSize;\n for (float x = -10.0; x <= 10.0; x += 1.0) {\n for (float y = -10.0; y <= 10.0; y += 1.0) {\n float weight = 1.0 - (abs(x) + abs(y)) / (radius * 2.0 + 1.0);\n if (weight > 0.0 && abs(x) <= radius && abs(y) <= radius) {\n vec2 offset = vec2(x, y) * texelSize * 2.0;\n color += texture2D(tDiffuse, vUv + offset) * weight;\n total += weight;\n }\n }\n }\n\n gl_FragColor = total > 0.0 ? color / total : texture2D(tDiffuse, vUv);\n }\n "
|
|
4416
|
-
},
|
|
4615
|
+
}, zi = {
|
|
4417
4616
|
uniforms: {
|
|
4418
4617
|
tDiffuseA: { value: null },
|
|
4419
4618
|
tDiffuseB: { value: null },
|
|
@@ -4421,14 +4620,14 @@ var Di = {
|
|
|
4421
4620
|
},
|
|
4422
4621
|
vertexShader: "\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",
|
|
4423
4622
|
fragmentShader: "\n uniform sampler2D tDiffuseA;\n uniform sampler2D tDiffuseB;\n uniform float mixRatio;\n varying vec2 vUv;\n\n vec3 linearTosRGB(vec3 color) {\n return mix(\n color * 12.92,\n 1.055 * pow(color, vec3(1.0 / 2.4)) - 0.055,\n step(0.0031308, color)\n );\n }\n\n void main() {\n vec4 texelA = texture2D(tDiffuseA, vUv);\n vec4 texelB = texture2D(tDiffuseB, vUv);\n vec3 blendedColor = mix(texelA.rgb, texelB.rgb, mixRatio);\n gl_FragColor = vec4(linearTosRGB(blendedColor), max(texelA.a, texelB.a));\n }\n "
|
|
4424
|
-
},
|
|
4623
|
+
}, Bi = {
|
|
4425
4624
|
uniforms: {
|
|
4426
4625
|
topColor: { value: new d(.5, .8, 1) },
|
|
4427
4626
|
bottomColor: { value: new d(1, 1, 1) }
|
|
4428
4627
|
},
|
|
4429
4628
|
vertexShader: "\n varying vec3 vPosition;\n void main() {\n vPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",
|
|
4430
4629
|
fragmentShader: "\n uniform vec3 topColor;\n uniform vec3 bottomColor;\n varying vec3 vPosition;\n void main() {\n float y = normalize(vPosition).y * 0.5 + 0.5; // Normalizing y to range 0 to 1\n gl_FragColor = vec4(mix(bottomColor, topColor, y), 1.0);\n }\n "
|
|
4431
|
-
},
|
|
4630
|
+
}, Vi = {
|
|
4432
4631
|
uniforms: {
|
|
4433
4632
|
tDiffuse: { value: null },
|
|
4434
4633
|
fadeAmount: { value: 0 },
|
|
@@ -4436,7 +4635,7 @@ var Di = {
|
|
|
4436
4635
|
},
|
|
4437
4636
|
vertexShader: "\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",
|
|
4438
4637
|
fragmentShader: "\n uniform sampler2D tDiffuse;\n uniform float fadeAmount;\n uniform vec3 fadeColor;\n varying vec2 vUv;\n\n vec3 linearTosRGB(vec3 color) {\n return mix(\n color * 12.92,\n 1.055 * pow(color, vec3(1.0 / 2.4)) - 0.055,\n step(0.0031308, color)\n );\n }\n\n void main() {\n vec4 texel = texture2D(tDiffuse, vUv);\n vec3 blendedColor = mix(texel.rgb, fadeColor, fadeAmount);\n gl_FragColor = vec4(linearTosRGB(blendedColor), 1.0);\n }\n "
|
|
4439
|
-
},
|
|
4638
|
+
}, Hi = {
|
|
4440
4639
|
uniforms: {
|
|
4441
4640
|
tDiffuseA: { value: null },
|
|
4442
4641
|
tDiffuseB: { value: null },
|
|
@@ -4445,7 +4644,7 @@ var Di = {
|
|
|
4445
4644
|
},
|
|
4446
4645
|
vertexShader: "\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",
|
|
4447
4646
|
fragmentShader: "\n uniform sampler2D tDiffuseA;\n uniform sampler2D tDiffuseB;\n uniform float mixRatio;\n uniform vec3 fadeColor;\n varying vec2 vUv;\n\n vec3 linearTosRGB(vec3 color) {\n return mix(\n color * 12.92,\n 1.055 * pow(color, vec3(1.0 / 2.4)) - 0.055,\n step(0.0031308, color)\n );\n }\n\n void main() {\n vec4 texelA = texture2D(tDiffuseA, vUv);\n vec4 texelB = texture2D(tDiffuseB, vUv);\n\n // Fade out to color, then fade in from color\n float fadeOut = smoothstep(0.0, 0.5, mixRatio) * 2.0;\n float fadeIn = smoothstep(0.5, 1.0, mixRatio) * 2.0 - 1.0;\n\n vec3 colorA = mix(texelA.rgb, fadeColor, clamp(fadeOut, 0.0, 1.0));\n vec3 colorB = mix(fadeColor, texelB.rgb, clamp(fadeIn, 0.0, 1.0));\n\n vec3 blendedColor = mix(colorA, colorB, step(0.5, mixRatio));\n gl_FragColor = vec4(linearTosRGB(blendedColor), 1.0);\n }\n "
|
|
4448
|
-
},
|
|
4647
|
+
}, Ui = {
|
|
4449
4648
|
uniforms: {
|
|
4450
4649
|
topColor: { value: new d(51) },
|
|
4451
4650
|
bottomColor: { value: new d(17) },
|
|
@@ -4454,47 +4653,47 @@ var Di = {
|
|
|
4454
4653
|
},
|
|
4455
4654
|
vertexShader: "\n varying vec3 vWorldPosition;\n void main() {\n vec4 worldPosition = modelMatrix * vec4(position, 1.0);\n vWorldPosition = worldPosition.xyz;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",
|
|
4456
4655
|
fragmentShader: "\n uniform vec3 topColor;\n uniform vec3 bottomColor;\n uniform float offset;\n uniform float exponent;\n varying vec3 vWorldPosition;\n void main() {\n float h = normalize(vWorldPosition + offset).y;\n gl_FragColor = vec4(mix(bottomColor, topColor, max(pow(max(h, 0.0), exponent), 0.0)), 1.0);\n }\n "
|
|
4457
|
-
},
|
|
4656
|
+
}, Wi = class extends k {
|
|
4458
4657
|
geometry;
|
|
4459
4658
|
material;
|
|
4460
4659
|
constructor() {
|
|
4461
4660
|
super(), this.geometry = new a(1, 1, 1), this.material = new de({
|
|
4462
|
-
uniforms:
|
|
4463
|
-
vertexShader:
|
|
4464
|
-
fragmentShader:
|
|
4661
|
+
uniforms: Li.uniforms,
|
|
4662
|
+
vertexShader: Li.vertexShader,
|
|
4663
|
+
fragmentShader: Li.fragmentShader,
|
|
4465
4664
|
depthWrite: !1,
|
|
4466
4665
|
side: r
|
|
4467
4666
|
}), this.scale.setScalar(45e4);
|
|
4468
|
-
let e =
|
|
4667
|
+
let e = D.degToRad(89), t = D.degToRad(180), n = new z().setFromSphericalCoords(1, e, t);
|
|
4469
4668
|
this.material.uniforms.sunPosition.value = n;
|
|
4470
4669
|
}
|
|
4471
4670
|
sunPosition(e, t) {
|
|
4472
|
-
let n = new
|
|
4671
|
+
let n = new z();
|
|
4473
4672
|
n.setFromSphericalCoords(1, e, t), this.material.uniforms.sunPosition.value = n;
|
|
4474
4673
|
}
|
|
4475
|
-
},
|
|
4674
|
+
}, Gi = class extends k {
|
|
4476
4675
|
geometry;
|
|
4477
4676
|
material;
|
|
4478
4677
|
constructor(e = 1e3) {
|
|
4479
4678
|
super(), this.geometry = new a(e, e, e), this.material = new de({
|
|
4480
|
-
uniforms:
|
|
4481
|
-
vertexShader:
|
|
4482
|
-
fragmentShader:
|
|
4679
|
+
uniforms: Bi.uniforms,
|
|
4680
|
+
vertexShader: Bi.vertexShader,
|
|
4681
|
+
fragmentShader: Bi.fragmentShader,
|
|
4483
4682
|
side: r
|
|
4484
4683
|
});
|
|
4485
4684
|
}
|
|
4486
|
-
},
|
|
4685
|
+
}, Ki = class extends k {
|
|
4487
4686
|
geometry;
|
|
4488
4687
|
material;
|
|
4489
4688
|
constructor(e = 1e3) {
|
|
4490
|
-
super(), this.geometry = new
|
|
4491
|
-
vertexShader:
|
|
4492
|
-
fragmentShader:
|
|
4493
|
-
uniforms:
|
|
4689
|
+
super(), this.geometry = new L(e, 32, 15), this.material = new de({
|
|
4690
|
+
vertexShader: Ui.vertexShader,
|
|
4691
|
+
fragmentShader: Ui.fragmentShader,
|
|
4692
|
+
uniforms: Ui.uniforms,
|
|
4494
4693
|
side: r
|
|
4495
4694
|
});
|
|
4496
4695
|
}
|
|
4497
|
-
},
|
|
4696
|
+
}, qi = (e) => {
|
|
4498
4697
|
let t = new Uint8Array(4 * e * e);
|
|
4499
4698
|
for (let n = 0; n < e * e; n++) {
|
|
4500
4699
|
let r = n * 4, i = (n % e ^ Math.floor(n / e)) & 1 ? 255 : 0;
|
|
@@ -4502,7 +4701,7 @@ var Di = {
|
|
|
4502
4701
|
}
|
|
4503
4702
|
let n = new m(t, e, e, se, he);
|
|
4504
4703
|
return n.wrapS = ce, n.wrapT = ce, n.minFilter = ee, n.needsUpdate = !0, n;
|
|
4505
|
-
},
|
|
4704
|
+
}, Ji = class {
|
|
4506
4705
|
perspectiveCamera;
|
|
4507
4706
|
orthographicCamera;
|
|
4508
4707
|
renderer;
|
|
@@ -4522,7 +4721,7 @@ var Di = {
|
|
|
4522
4721
|
onUpdateCallback;
|
|
4523
4722
|
onCompleteCallback;
|
|
4524
4723
|
constructor(t, n, r) {
|
|
4525
|
-
this.perspectiveCamera = t, this.orthographicCamera = n, this.renderer = r, this.currentCamera = t, this.easingFunction =
|
|
4724
|
+
this.perspectiveCamera = t, this.orthographicCamera = n, this.renderer = r, this.currentCamera = t, this.easingFunction = H.cubicInOut;
|
|
4526
4725
|
let i = r.getSize(new e.Vector2());
|
|
4527
4726
|
this.renderTargetA = new e.WebGLRenderTarget(i.x, i.y), this.renderTargetB = new e.WebGLRenderTarget(i.x, i.y), this.blendScene = new e.Scene(), this.blendCamera = new e.OrthographicCamera(-1, 1, 1, -1, 0, 1), this.blendMaterial = new e.ShaderMaterial({
|
|
4528
4727
|
uniforms: {
|
|
@@ -4530,14 +4729,14 @@ var Di = {
|
|
|
4530
4729
|
tDiffuseB: { value: this.renderTargetB.texture },
|
|
4531
4730
|
mixRatio: { value: 0 }
|
|
4532
4731
|
},
|
|
4533
|
-
vertexShader:
|
|
4534
|
-
fragmentShader:
|
|
4732
|
+
vertexShader: zi.vertexShader,
|
|
4733
|
+
fragmentShader: zi.fragmentShader
|
|
4535
4734
|
});
|
|
4536
4735
|
let a = new e.PlaneGeometry(2, 2), o = new e.Mesh(a, this.blendMaterial);
|
|
4537
4736
|
this.blendScene.add(o);
|
|
4538
4737
|
}
|
|
4539
4738
|
transitionTo(e, t = {}) {
|
|
4540
|
-
this.currentCamera !== e && (this.targetCamera = e, this.transitionDuration = t.duration ?? 1e3, this.transitionStartTime = performance.now(), this.transitionProgress = 0, this.isTransitioning = !0, this.onUpdateCallback = t.onUpdate, this.onCompleteCallback = t.onComplete, t.easing && (typeof t.easing == "string" ? this.easingFunction =
|
|
4739
|
+
this.currentCamera !== e && (this.targetCamera = e, this.transitionDuration = t.duration ?? 1e3, this.transitionStartTime = performance.now(), this.transitionProgress = 0, this.isTransitioning = !0, this.onUpdateCallback = t.onUpdate, this.onCompleteCallback = t.onComplete, t.easing && (typeof t.easing == "string" ? this.easingFunction = H[t.easing] : this.easingFunction = t.easing));
|
|
4541
4740
|
}
|
|
4542
4741
|
update(e) {
|
|
4543
4742
|
if (this.scene = e, !this.isTransitioning) return this.currentCamera;
|
|
@@ -4566,7 +4765,7 @@ var Di = {
|
|
|
4566
4765
|
dispose() {
|
|
4567
4766
|
this.renderTargetA.dispose(), this.renderTargetB.dispose(), this.blendMaterial.dispose();
|
|
4568
4767
|
}
|
|
4569
|
-
},
|
|
4768
|
+
}, Yi = class {
|
|
4570
4769
|
renderer;
|
|
4571
4770
|
currentScene = null;
|
|
4572
4771
|
targetScene = null;
|
|
@@ -4587,7 +4786,7 @@ var Di = {
|
|
|
4587
4786
|
onUpdateCallback;
|
|
4588
4787
|
onCompleteCallback;
|
|
4589
4788
|
constructor(t) {
|
|
4590
|
-
this.renderer = t, this.easingFunction =
|
|
4789
|
+
this.renderer = t, this.easingFunction = H.cubicInOut;
|
|
4591
4790
|
let n = t.getSize(new e.Vector2());
|
|
4592
4791
|
this.renderTargetA = new e.WebGLRenderTarget(n.x, n.y), this.renderTargetB = new e.WebGLRenderTarget(n.x, n.y), this.blendScene = new e.Scene(), this.blendCamera = new e.OrthographicCamera(-1, 1, 1, -1, 0, 1), this.fadeMaterial = new e.ShaderMaterial({
|
|
4593
4792
|
uniforms: {
|
|
@@ -4596,16 +4795,16 @@ var Di = {
|
|
|
4596
4795
|
mixRatio: { value: 0 },
|
|
4597
4796
|
fadeColor: { value: new e.Color(0) }
|
|
4598
4797
|
},
|
|
4599
|
-
vertexShader:
|
|
4600
|
-
fragmentShader:
|
|
4798
|
+
vertexShader: Hi.vertexShader,
|
|
4799
|
+
fragmentShader: Hi.fragmentShader
|
|
4601
4800
|
}), this.crossfadeMaterial = new e.ShaderMaterial({
|
|
4602
4801
|
uniforms: {
|
|
4603
4802
|
tDiffuseA: { value: this.renderTargetA.texture },
|
|
4604
4803
|
tDiffuseB: { value: this.renderTargetB.texture },
|
|
4605
4804
|
mixRatio: { value: 0 }
|
|
4606
4805
|
},
|
|
4607
|
-
vertexShader:
|
|
4608
|
-
fragmentShader:
|
|
4806
|
+
vertexShader: zi.vertexShader,
|
|
4807
|
+
fragmentShader: zi.fragmentShader
|
|
4609
4808
|
});
|
|
4610
4809
|
let r = new e.PlaneGeometry(2, 2), i = new e.Mesh(r, this.fadeMaterial);
|
|
4611
4810
|
this.blendScene.add(i);
|
|
@@ -4627,7 +4826,7 @@ var Di = {
|
|
|
4627
4826
|
});
|
|
4628
4827
|
}
|
|
4629
4828
|
startTransition(e, t, n, r, i) {
|
|
4630
|
-
this.currentScene = e, this.targetScene = t, this.camera = n, this.transitionType = r, this.transitionDuration = i.duration ?? 1e3, this.transitionStartTime = performance.now(), this.transitionProgress = 0, this.isTransitioning = !0, this.onUpdateCallback = i.onUpdate, this.onCompleteCallback = i.onComplete, i.easing && (typeof i.easing == "string" ? this.easingFunction =
|
|
4829
|
+
this.currentScene = e, this.targetScene = t, this.camera = n, this.transitionType = r, this.transitionDuration = i.duration ?? 1e3, this.transitionStartTime = performance.now(), this.transitionProgress = 0, this.isTransitioning = !0, this.onUpdateCallback = i.onUpdate, this.onCompleteCallback = i.onComplete, i.easing && (typeof i.easing == "string" ? this.easingFunction = H[i.easing] : this.easingFunction = i.easing);
|
|
4631
4830
|
}
|
|
4632
4831
|
update() {
|
|
4633
4832
|
if (!this.isTransitioning) return;
|
|
@@ -4659,7 +4858,7 @@ var Di = {
|
|
|
4659
4858
|
dispose() {
|
|
4660
4859
|
this.renderTargetA.dispose(), this.renderTargetB.dispose(), this.fadeMaterial.dispose(), this.crossfadeMaterial.dispose();
|
|
4661
4860
|
}
|
|
4662
|
-
},
|
|
4861
|
+
}, Xi = class {
|
|
4663
4862
|
renderer;
|
|
4664
4863
|
composer;
|
|
4665
4864
|
currentScene = null;
|
|
@@ -4683,7 +4882,7 @@ var Di = {
|
|
|
4683
4882
|
onUpdateCallback;
|
|
4684
4883
|
onCompleteCallback;
|
|
4685
4884
|
constructor(e, t, n) {
|
|
4686
|
-
this.renderer = e, this.composer = t, this.easingFunction =
|
|
4885
|
+
this.renderer = e, this.composer = t, this.easingFunction = H.cubicInOut, this.renderPass = t.passes.find((e) => e.constructor.name === "RenderPass"), n && this.createDefaultPasses(n);
|
|
4687
4886
|
}
|
|
4688
4887
|
createDefaultPasses(t) {
|
|
4689
4888
|
try {
|
|
@@ -4693,8 +4892,8 @@ var Di = {
|
|
|
4693
4892
|
kernelSize: { value: 0 },
|
|
4694
4893
|
resolution: { value: new e.Vector2(this.renderer.domElement.width, this.renderer.domElement.height) }
|
|
4695
4894
|
},
|
|
4696
|
-
vertexShader:
|
|
4697
|
-
fragmentShader:
|
|
4895
|
+
vertexShader: Ri.vertexShader,
|
|
4896
|
+
fragmentShader: Ri.fragmentShader
|
|
4698
4897
|
};
|
|
4699
4898
|
this.blurPass = new t(n), this.blurPass.enabled = !1, this.composer.addPass(this.blurPass);
|
|
4700
4899
|
let r = {
|
|
@@ -4703,8 +4902,8 @@ var Di = {
|
|
|
4703
4902
|
fadeAmount: { value: 0 },
|
|
4704
4903
|
fadeColor: { value: new e.Color(0) }
|
|
4705
4904
|
},
|
|
4706
|
-
vertexShader:
|
|
4707
|
-
fragmentShader:
|
|
4905
|
+
vertexShader: Vi.vertexShader,
|
|
4906
|
+
fragmentShader: Vi.fragmentShader
|
|
4708
4907
|
};
|
|
4709
4908
|
this.fadePass = new t(r), this.fadePass.enabled = !1, this.composer.addPass(this.fadePass);
|
|
4710
4909
|
} catch (e) {
|
|
@@ -4752,7 +4951,7 @@ var Di = {
|
|
|
4752
4951
|
this.maxGlitchIntensity = r.maxIntensity ?? 1, this.startTransition(e, t, n, "glitch", r), this.glitchPass.enabled = !0;
|
|
4753
4952
|
}
|
|
4754
4953
|
startTransition(e, t, n, r, i) {
|
|
4755
|
-
this.currentScene = e, this.targetScene = t, this.camera = n, this.transitionType = r, this.transitionDuration = i.duration ?? 1e3, this.transitionStartTime = performance.now(), this.transitionProgress = 0, this.isTransitioning = !0, this.onUpdateCallback = i.onUpdate, this.onCompleteCallback = i.onComplete, i.easing && (typeof i.easing == "string" ? this.easingFunction =
|
|
4954
|
+
this.currentScene = e, this.targetScene = t, this.camera = n, this.transitionType = r, this.transitionDuration = i.duration ?? 1e3, this.transitionStartTime = performance.now(), this.transitionProgress = 0, this.isTransitioning = !0, this.onUpdateCallback = i.onUpdate, this.onCompleteCallback = i.onComplete, i.easing && (typeof i.easing == "string" ? this.easingFunction = H[i.easing] : this.easingFunction = i.easing), this.renderPass && (this.renderPass.scene = e, this.renderPass.camera = n);
|
|
4756
4955
|
}
|
|
4757
4956
|
update() {
|
|
4758
4957
|
if (!this.isTransitioning) return;
|
|
@@ -4794,41 +4993,41 @@ var Di = {
|
|
|
4794
4993
|
};
|
|
4795
4994
|
//#endregion
|
|
4796
4995
|
//#region src/utils/AlignToEdge.ts
|
|
4797
|
-
function
|
|
4996
|
+
function Zi(e, t) {
|
|
4798
4997
|
if (e.length === 0) throw Error("No objects provided for alignment.");
|
|
4799
|
-
let n = new i(), r = new
|
|
4998
|
+
let n = new i(), r = new z(), a = e.map((e) => (n.setFromObject(e), e.getWorldPosition(r), {
|
|
4800
4999
|
object: e,
|
|
4801
5000
|
boundingBox: n.clone(),
|
|
4802
5001
|
worldPosition: r.clone()
|
|
4803
5002
|
})), o = a.reduce((e, { boundingBox: n }) => {
|
|
4804
5003
|
switch (t) {
|
|
4805
|
-
case
|
|
4806
|
-
case
|
|
4807
|
-
case
|
|
4808
|
-
case
|
|
4809
|
-
case
|
|
4810
|
-
case
|
|
5004
|
+
case K.LEFT: return Math.min(e, n.min.x);
|
|
5005
|
+
case K.RIGHT: return Math.max(e, n.max.x);
|
|
5006
|
+
case K.BOTTOM: return Math.min(e, n.min.y);
|
|
5007
|
+
case K.TOP: return Math.max(e, n.max.y);
|
|
5008
|
+
case K.BACK: return Math.min(e, n.min.z);
|
|
5009
|
+
case K.FRONT: return Math.max(e, n.max.z);
|
|
4811
5010
|
default: throw Error(`Unsupported side type: ${t}`);
|
|
4812
5011
|
}
|
|
4813
|
-
}, t ===
|
|
5012
|
+
}, t === K.RIGHT || t === K.TOP || t === K.FRONT ? -Infinity : Infinity);
|
|
4814
5013
|
a.forEach(({ object: e, boundingBox: n }) => {
|
|
4815
5014
|
switch (t) {
|
|
4816
|
-
case
|
|
5015
|
+
case K.LEFT:
|
|
4817
5016
|
e.position.x += o - n.min.x;
|
|
4818
5017
|
break;
|
|
4819
|
-
case
|
|
5018
|
+
case K.RIGHT:
|
|
4820
5019
|
e.position.x += o - n.max.x;
|
|
4821
5020
|
break;
|
|
4822
|
-
case
|
|
5021
|
+
case K.BOTTOM:
|
|
4823
5022
|
e.position.y += o - n.min.y;
|
|
4824
5023
|
break;
|
|
4825
|
-
case
|
|
5024
|
+
case K.TOP:
|
|
4826
5025
|
e.position.y += o - n.max.y;
|
|
4827
5026
|
break;
|
|
4828
|
-
case
|
|
5027
|
+
case K.BACK:
|
|
4829
5028
|
e.position.z += o - n.min.z;
|
|
4830
5029
|
break;
|
|
4831
|
-
case
|
|
5030
|
+
case K.FRONT:
|
|
4832
5031
|
e.position.z += o - n.max.z;
|
|
4833
5032
|
break;
|
|
4834
5033
|
}
|
|
@@ -4836,11 +5035,11 @@ function Bi(e, t) {
|
|
|
4836
5035
|
}
|
|
4837
5036
|
//#endregion
|
|
4838
5037
|
//#region src/utils/AlignToRow.ts
|
|
4839
|
-
function
|
|
4840
|
-
let r = t.clone().normalize(), a = new
|
|
5038
|
+
function Qi(e, t = W.RIGHT, n = 0) {
|
|
5039
|
+
let r = t.clone().normalize(), a = new z(), o = new i();
|
|
4841
5040
|
e.forEach((e) => {
|
|
4842
5041
|
o.setFromObject(e);
|
|
4843
|
-
let t = new
|
|
5042
|
+
let t = new z(o.max.x - o.min.x, o.max.y - o.min.y, o.max.z - o.min.z).dot(r), i = new z();
|
|
4844
5043
|
o.getCenter(i);
|
|
4845
5044
|
let s = r.clone().multiplyScalar(t / 2);
|
|
4846
5045
|
e.position.copy(a.clone().add(s).sub(i).add(e.position)), a.add(r.clone().multiplyScalar(t + n));
|
|
@@ -4848,17 +5047,17 @@ function Vi(e, t = U.RIGHT, n = 0) {
|
|
|
4848
5047
|
}
|
|
4849
5048
|
//#endregion
|
|
4850
5049
|
//#region src/utils/AlignToSurface.ts
|
|
4851
|
-
function
|
|
5050
|
+
function $i(e, t, n = new z(0, 0, 0)) {
|
|
4852
5051
|
let r = new i().setFromObject(e);
|
|
4853
5052
|
if (r.isEmpty()) console.warn("The object has no geometry or is not visible.");
|
|
4854
5053
|
else {
|
|
4855
|
-
let i = r.min, a = new
|
|
5054
|
+
let i = r.min, a = new z((i.x + r.max.x) / 2, i.y, (i.z + r.max.z) / 2);
|
|
4856
5055
|
e.localToWorld(a);
|
|
4857
5056
|
let o = t.clone().sub(a).add(n), s = e.worldToLocal(o.clone());
|
|
4858
5057
|
e.position.add(s);
|
|
4859
5058
|
}
|
|
4860
5059
|
}
|
|
4861
|
-
function
|
|
5060
|
+
function ea(e, t) {
|
|
4862
5061
|
let n = new i().setFromBufferAttribute(new x(e.attributes.position.array, 3));
|
|
4863
5062
|
if (n.isEmpty()) console.warn("The geometry is empty or invalid.");
|
|
4864
5063
|
else {
|
|
@@ -4866,50 +5065,50 @@ function Ui(e, t) {
|
|
|
4866
5065
|
e.translate(0, t - r, 0);
|
|
4867
5066
|
}
|
|
4868
5067
|
}
|
|
4869
|
-
function
|
|
5068
|
+
function ta(e, t, n = new z(0, 0, 0)) {
|
|
4870
5069
|
let r = new i().setFromObject(e);
|
|
4871
5070
|
if (r.isEmpty()) console.warn("The InstancedMesh has no geometry or is not visible.");
|
|
4872
5071
|
else {
|
|
4873
|
-
let i = r.min.y, a = new
|
|
5072
|
+
let i = r.min.y, a = new z(0, t.y - i, 0).add(n), o = e.worldToLocal(a.clone());
|
|
4874
5073
|
e.position.add(o);
|
|
4875
5074
|
}
|
|
4876
5075
|
}
|
|
4877
|
-
function
|
|
5076
|
+
function na(e, t, n, r = new z(0, 0, 0)) {
|
|
4878
5077
|
let a = new i().setFromObject(e);
|
|
4879
5078
|
if (a.isEmpty()) console.warn("The instanced mesh has invalid geometry.");
|
|
4880
5079
|
else {
|
|
4881
|
-
let i = a.min.y, o = new
|
|
5080
|
+
let i = a.min.y, o = new O();
|
|
4882
5081
|
e.getMatrixAt(n, o);
|
|
4883
|
-
let s = new
|
|
5082
|
+
let s = new z(), c = new F(), l = new z();
|
|
4884
5083
|
o.decompose(s, c, l), s.y = e.worldToLocal(t.clone()).y - i + r.y, o.compose(s, c, l), e.setMatrixAt(n, o), e.instanceMatrix.needsUpdate = !0;
|
|
4885
5084
|
}
|
|
4886
5085
|
}
|
|
4887
5086
|
//#endregion
|
|
4888
5087
|
//#region src/utils/Center.ts
|
|
4889
|
-
function
|
|
4890
|
-
let r = new i().setFromObject(e).getCenter(new
|
|
5088
|
+
function ra(e, t = new z(0, 0, 0), n = new z(0, 0, 0)) {
|
|
5089
|
+
let r = new i().setFromObject(e).getCenter(new z()), a = new z().addVectors(t, n), o = new z().subVectors(a, r);
|
|
4891
5090
|
e.position.add(o);
|
|
4892
5091
|
}
|
|
4893
|
-
function
|
|
4894
|
-
let r = new i().setFromObject(e).getCenter(new
|
|
5092
|
+
function ia(e, t = new z(0, 0, 0), n = new z(0, 0, 0)) {
|
|
5093
|
+
let r = new i().setFromObject(e).getCenter(new z()), a = new z().addVectors(t, n);
|
|
4895
5094
|
e.translateX(a.x - r.x), e.translateY(a.y - r.y), e.translateZ(a.z - r.z), e.updateMatrixWorld(!0);
|
|
4896
5095
|
}
|
|
4897
|
-
function
|
|
5096
|
+
function aa(e, t = new z(0, 0, 0), n = new z(0, 0, 0)) {
|
|
4898
5097
|
e.geometry.computeBoundingBox();
|
|
4899
5098
|
let r = e.geometry.boundingBox;
|
|
4900
5099
|
if (r) {
|
|
4901
|
-
let i = r.getCenter(new
|
|
5100
|
+
let i = r.getCenter(new z()), a = new z().addVectors(t, n), o = new z().subVectors(a, i);
|
|
4902
5101
|
e.geometry.translate(o.x, o.y, o.z);
|
|
4903
5102
|
}
|
|
4904
5103
|
}
|
|
4905
|
-
var
|
|
4906
|
-
object:
|
|
4907
|
-
objectGeometry:
|
|
4908
|
-
meshGeometry:
|
|
5104
|
+
var oa = {
|
|
5105
|
+
object: ra,
|
|
5106
|
+
objectGeometry: ia,
|
|
5107
|
+
meshGeometry: aa
|
|
4909
5108
|
};
|
|
4910
5109
|
//#endregion
|
|
4911
5110
|
//#region src/utils/ColorUtils.ts
|
|
4912
|
-
function
|
|
5111
|
+
function sa(e) {
|
|
4913
5112
|
let t = parseInt(e.slice(1), 16);
|
|
4914
5113
|
return [
|
|
4915
5114
|
t >> 16 & 255,
|
|
@@ -4917,18 +5116,18 @@ function Xi(e) {
|
|
|
4917
5116
|
t & 255
|
|
4918
5117
|
];
|
|
4919
5118
|
}
|
|
4920
|
-
function
|
|
4921
|
-
let [t, n, r] =
|
|
4922
|
-
return
|
|
5119
|
+
function ca(e) {
|
|
5120
|
+
let [t, n, r] = la(e);
|
|
5121
|
+
return ma(t, n, r);
|
|
4923
5122
|
}
|
|
4924
|
-
function
|
|
5123
|
+
function la(e) {
|
|
4925
5124
|
return [
|
|
4926
5125
|
e >> 16 & 255,
|
|
4927
5126
|
e >> 8 & 255,
|
|
4928
5127
|
e & 255
|
|
4929
5128
|
];
|
|
4930
5129
|
}
|
|
4931
|
-
function
|
|
5130
|
+
function ua(e, t, n) {
|
|
4932
5131
|
t /= 100, n /= 100;
|
|
4933
5132
|
function r(e, t, n) {
|
|
4934
5133
|
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;
|
|
@@ -4946,7 +5145,7 @@ function Qi(e, t, n) {
|
|
|
4946
5145
|
s(o)
|
|
4947
5146
|
];
|
|
4948
5147
|
}
|
|
4949
|
-
function
|
|
5148
|
+
function da(e, t, n) {
|
|
4950
5149
|
t /= 100, n /= 100;
|
|
4951
5150
|
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)));
|
|
4952
5151
|
return [
|
|
@@ -4955,17 +5154,17 @@ function $i(e, t, n) {
|
|
|
4955
5154
|
a(4) * 255
|
|
4956
5155
|
];
|
|
4957
5156
|
}
|
|
4958
|
-
function
|
|
5157
|
+
function fa(e, t, n) {
|
|
4959
5158
|
return [
|
|
4960
5159
|
e / 255,
|
|
4961
5160
|
t / 255,
|
|
4962
5161
|
n / 255
|
|
4963
5162
|
];
|
|
4964
5163
|
}
|
|
4965
|
-
function
|
|
5164
|
+
function pa(e, t, n) {
|
|
4966
5165
|
return e = Math.round(e), t = Math.round(t), n = Math.round(n), (e << 16) + (t << 8) + n;
|
|
4967
5166
|
}
|
|
4968
|
-
function
|
|
5167
|
+
function ma(e, t, n) {
|
|
4969
5168
|
e /= 255, t /= 255, n /= 255;
|
|
4970
5169
|
let r = Math.max(e, t, n), i = Math.min(e, t, n), a = r - i, o = 0, s = 0, c = (r + i) / 2;
|
|
4971
5170
|
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);
|
|
@@ -4976,36 +5175,36 @@ function na(e, t, n) {
|
|
|
4976
5175
|
l
|
|
4977
5176
|
];
|
|
4978
5177
|
}
|
|
4979
|
-
function
|
|
5178
|
+
function ha(e, t) {
|
|
4980
5179
|
return Math.sqrt((e[0] - t[0]) ** 2 + (e[1] - t[1]) ** 2 + (e[2] - t[2]) ** 2);
|
|
4981
5180
|
}
|
|
4982
|
-
function
|
|
5181
|
+
function ga(e, t) {
|
|
4983
5182
|
return Math.abs(e[0] - t[0]) + Math.abs(e[1] - t[1]) + Math.abs(e[2] - t[2]);
|
|
4984
5183
|
}
|
|
4985
|
-
function
|
|
4986
|
-
let n =
|
|
5184
|
+
function _a(e, t) {
|
|
5185
|
+
let n = la(e), r = null, i = Infinity;
|
|
4987
5186
|
for (let e of t) {
|
|
4988
|
-
let t =
|
|
5187
|
+
let t = ha(n, la(e));
|
|
4989
5188
|
t < i && (i = t, r = e);
|
|
4990
5189
|
}
|
|
4991
5190
|
return r;
|
|
4992
5191
|
}
|
|
4993
|
-
function
|
|
4994
|
-
let n =
|
|
5192
|
+
function va(e, t) {
|
|
5193
|
+
let n = la(e), r = null, i = Infinity;
|
|
4995
5194
|
for (let e of t) {
|
|
4996
|
-
let t =
|
|
5195
|
+
let t = ga(n, la(e));
|
|
4997
5196
|
t < i && (i = t, r = e);
|
|
4998
5197
|
}
|
|
4999
5198
|
return r;
|
|
5000
5199
|
}
|
|
5001
|
-
function
|
|
5002
|
-
return
|
|
5200
|
+
function ya(e) {
|
|
5201
|
+
return da((e + Math.floor(-30 + Math.random() * 61)) % 360, Math.floor(60 + Math.random() * 21), Math.floor(50 + Math.random() * 21));
|
|
5003
5202
|
}
|
|
5004
5203
|
//#endregion
|
|
5005
5204
|
//#region src/utils/FindClosestPoint.ts
|
|
5006
|
-
function
|
|
5205
|
+
function ba(e, t) {
|
|
5007
5206
|
if (!t.geometry.isBufferGeometry) throw Error("Mesh must have a BufferGeometry.");
|
|
5008
|
-
let n = t.geometry.getAttribute("position"), r = new
|
|
5207
|
+
let n = t.geometry.getAttribute("position"), r = new z(), i = new z(), a = Infinity;
|
|
5009
5208
|
for (let t = 0; t < n.count; t++) {
|
|
5010
5209
|
i.fromBufferAttribute(n, t);
|
|
5011
5210
|
let o = i.distanceTo(e);
|
|
@@ -5015,81 +5214,81 @@ function ca(e, t) {
|
|
|
5015
5214
|
}
|
|
5016
5215
|
//#endregion
|
|
5017
5216
|
//#region src/utils/InterpolateCurve.ts
|
|
5018
|
-
function
|
|
5217
|
+
function xa(e, t, n) {
|
|
5019
5218
|
return Math.max(0, Math.min(1, (e - t) / (n - t)));
|
|
5020
5219
|
}
|
|
5021
|
-
function
|
|
5220
|
+
function Sa(e, t, n, r, i, a = 20, o = 0, s = 1) {
|
|
5022
5221
|
let c = [];
|
|
5023
5222
|
for (let l = 0; l <= a; l++) {
|
|
5024
|
-
let u = l / a, d = t + e(
|
|
5025
|
-
c.push(new
|
|
5223
|
+
let u = l / a, d = t + e(xa(u, o, s)) * (n - t), f = r + u * (i - r);
|
|
5224
|
+
c.push(new R(d, f));
|
|
5026
5225
|
}
|
|
5027
5226
|
return c;
|
|
5028
5227
|
}
|
|
5029
5228
|
//#endregion
|
|
5030
5229
|
//#region src/utils/ParametricCurveUtils.ts
|
|
5031
|
-
var
|
|
5230
|
+
var Ca = (e, t, n, r, i = 24) => {
|
|
5032
5231
|
let a = [];
|
|
5033
5232
|
for (let o = 0; o <= i; o++) {
|
|
5034
|
-
let s = o / i, c =
|
|
5035
|
-
a.push(new
|
|
5233
|
+
let s = o / i, c = q.cubic(s, e.x, t.x, n.x, r.x), l = q.cubic(s, e.y, t.y, n.y, r.y);
|
|
5234
|
+
a.push(new R(c, l));
|
|
5036
5235
|
}
|
|
5037
5236
|
return a;
|
|
5038
|
-
},
|
|
5237
|
+
}, wa = (e, t, n, r = 24) => {
|
|
5039
5238
|
let i = [];
|
|
5040
5239
|
for (let a = 0; a <= r; a++) {
|
|
5041
|
-
let o = a / r, s =
|
|
5042
|
-
i.push(new
|
|
5240
|
+
let o = a / r, s = q.damped(o, n) * (t.x - e.x) + e.x, c = e.y + o * (t.y - e.y);
|
|
5241
|
+
i.push(new R(s, c));
|
|
5043
5242
|
}
|
|
5044
5243
|
return i;
|
|
5045
|
-
},
|
|
5244
|
+
}, Ta = (e, t, n, r, i = 24) => {
|
|
5046
5245
|
let a = [];
|
|
5047
5246
|
for (let o = 0; o <= i; o++) {
|
|
5048
|
-
let s = o / i, c =
|
|
5049
|
-
a.push(new
|
|
5247
|
+
let s = o / i, c = q.exponential(s, n, r) * (t.x - e.x) + e.x, l = e.y + s * (t.y - e.y);
|
|
5248
|
+
a.push(new R(c, l));
|
|
5050
5249
|
}
|
|
5051
5250
|
return a;
|
|
5052
|
-
},
|
|
5251
|
+
}, Ea = (e, t, n, r, i = 24) => {
|
|
5053
5252
|
let a = [];
|
|
5054
5253
|
for (let o = 0; o <= i; o++) {
|
|
5055
|
-
let s = o / i, c =
|
|
5056
|
-
a.push(new
|
|
5254
|
+
let s = o / i, c = q.logarithmic(s, n, r) * (t.x - e.x) + e.x, l = e.y + s * (t.y - e.y);
|
|
5255
|
+
a.push(new R(c, l));
|
|
5057
5256
|
}
|
|
5058
5257
|
return a;
|
|
5059
|
-
},
|
|
5258
|
+
}, Da = (e, t, n, r, i, a = 24) => {
|
|
5060
5259
|
let o = [];
|
|
5061
5260
|
for (let s = 0; s <= a; s++) {
|
|
5062
5261
|
let c = s / a, l = n * c * c + r * c + i + e.x, u = e.y + c * (t.y - e.y);
|
|
5063
|
-
o.push(new
|
|
5262
|
+
o.push(new R(l, u));
|
|
5064
5263
|
}
|
|
5065
5264
|
return o;
|
|
5066
|
-
},
|
|
5265
|
+
}, Oa = (e, t, n, r = 24) => {
|
|
5067
5266
|
let i = [];
|
|
5068
5267
|
for (let a = 0; a <= r; a++) {
|
|
5069
|
-
let o = a / r, s =
|
|
5070
|
-
i.push(new
|
|
5268
|
+
let o = a / r, s = q.quadratic(o, e.x, t.x, n.x), c = q.quadratic(o, e.y, t.y, n.y);
|
|
5269
|
+
i.push(new R(s, c));
|
|
5071
5270
|
}
|
|
5072
5271
|
return i;
|
|
5073
|
-
},
|
|
5272
|
+
}, ka = (e, t, n, r = 24) => {
|
|
5074
5273
|
let i = [];
|
|
5075
5274
|
for (let a = 0; a <= r; a++) {
|
|
5076
|
-
let o = a / r, s =
|
|
5077
|
-
i.push(new
|
|
5275
|
+
let o = a / r, s = q.sigmoid(o, n) * (t.x - e.x) + e.x, c = e.y + o * (t.y - e.y);
|
|
5276
|
+
i.push(new R(s, c));
|
|
5078
5277
|
}
|
|
5079
5278
|
return i;
|
|
5080
|
-
},
|
|
5081
|
-
createCubicCurvePoints:
|
|
5082
|
-
createDampedCurvePoints:
|
|
5083
|
-
createExponentialCurvePoints:
|
|
5084
|
-
createLogarithmicCurvePoints:
|
|
5085
|
-
createParabolicCurvePoints:
|
|
5086
|
-
createQuadraticCurvePoints:
|
|
5087
|
-
createSigmoidCurvePoints:
|
|
5279
|
+
}, Aa = {
|
|
5280
|
+
createCubicCurvePoints: Ca,
|
|
5281
|
+
createDampedCurvePoints: wa,
|
|
5282
|
+
createExponentialCurvePoints: Ta,
|
|
5283
|
+
createLogarithmicCurvePoints: Ea,
|
|
5284
|
+
createParabolicCurvePoints: Da,
|
|
5285
|
+
createQuadraticCurvePoints: Oa,
|
|
5286
|
+
createSigmoidCurvePoints: ka
|
|
5088
5287
|
};
|
|
5089
5288
|
//#endregion
|
|
5090
5289
|
//#region src/utils/QuadUtils.ts
|
|
5091
|
-
function
|
|
5092
|
-
let l = i ||
|
|
5290
|
+
function ja(e, t, n, r, i, a = [0, 0], o = [1, 0], s = [0, 1], c = [1, 1]) {
|
|
5291
|
+
let l = i || Ma(e, t, n);
|
|
5093
5292
|
return [
|
|
5094
5293
|
{
|
|
5095
5294
|
pos: e,
|
|
@@ -5123,7 +5322,7 @@ function ya(e, t, n, r, i, a = [0, 0], o = [1, 0], s = [0, 1], c = [1, 1]) {
|
|
|
5123
5322
|
}
|
|
5124
5323
|
];
|
|
5125
5324
|
}
|
|
5126
|
-
function
|
|
5325
|
+
function Ma(e, t, n) {
|
|
5127
5326
|
let r = [
|
|
5128
5327
|
t[0] - e[0],
|
|
5129
5328
|
t[1] - e[1],
|
|
@@ -5141,11 +5340,11 @@ function ba(e, t, n) {
|
|
|
5141
5340
|
}
|
|
5142
5341
|
//#endregion
|
|
5143
5342
|
//#region src/utils/RandomTimer.ts
|
|
5144
|
-
function
|
|
5343
|
+
function Na(e, t, n) {
|
|
5145
5344
|
let r = t + Math.random() * (n - t);
|
|
5146
5345
|
return setTimeout(e, r);
|
|
5147
5346
|
}
|
|
5148
|
-
function
|
|
5347
|
+
function Pa(e, t, n) {
|
|
5149
5348
|
let r;
|
|
5150
5349
|
function i() {
|
|
5151
5350
|
let a = t + Math.random() * (n - t);
|
|
@@ -5157,7 +5356,7 @@ function Sa(e, t, n) {
|
|
|
5157
5356
|
}
|
|
5158
5357
|
//#endregion
|
|
5159
5358
|
//#region src/utils/UVUtils.ts
|
|
5160
|
-
function
|
|
5359
|
+
function Fa(e, t) {
|
|
5161
5360
|
return e.map(([e, n, r]) => {
|
|
5162
5361
|
switch (t) {
|
|
5163
5362
|
case "x": return [n, r];
|
|
@@ -5167,36 +5366,36 @@ function Ca(e, t) {
|
|
|
5167
5366
|
}
|
|
5168
5367
|
});
|
|
5169
5368
|
}
|
|
5170
|
-
function
|
|
5369
|
+
function Ia(e) {
|
|
5171
5370
|
let [t, n, r] = e, i = Math.abs(t), a = Math.abs(n), o = Math.abs(r);
|
|
5172
5371
|
return i >= a && i >= o ? [r > 0 ? r : -r, n] : a >= i && a >= o ? [t, r > 0 ? r : -r] : [t, n];
|
|
5173
5372
|
}
|
|
5174
|
-
function
|
|
5175
|
-
return e.map((e) =>
|
|
5373
|
+
function La(e) {
|
|
5374
|
+
return e.map((e) => Ia(e));
|
|
5176
5375
|
}
|
|
5177
|
-
function
|
|
5376
|
+
function Ra(e) {
|
|
5178
5377
|
return e.map(([e, t, n]) => {
|
|
5179
5378
|
let r = Math.atan2(n, e), i = Math.acos(t / Math.sqrt(e ** 2 + t ** 2 + n ** 2));
|
|
5180
5379
|
return [r / (2 * Math.PI) + .5, 1 - i / Math.PI];
|
|
5181
5380
|
});
|
|
5182
5381
|
}
|
|
5183
|
-
function
|
|
5382
|
+
function za(e) {
|
|
5184
5383
|
return e.map(([e, t, n]) => [Math.atan2(n, e) / (2 * Math.PI) + .5, t]);
|
|
5185
5384
|
}
|
|
5186
|
-
function
|
|
5385
|
+
function Ba(e) {
|
|
5187
5386
|
return e.map(([e, t, n]) => {
|
|
5188
5387
|
let r = Math.sqrt(e ** 2 + n ** 2);
|
|
5189
5388
|
return [Math.atan2(n, e) / (2 * Math.PI) + .5, r];
|
|
5190
5389
|
});
|
|
5191
5390
|
}
|
|
5192
|
-
function
|
|
5391
|
+
function Va(e, t, n, r, i) {
|
|
5193
5392
|
return [(e[0] - t) / (n - t), (e[1] - r) / (i - r)];
|
|
5194
5393
|
}
|
|
5195
|
-
function
|
|
5394
|
+
function Ha(e, t, n) {
|
|
5196
5395
|
let [r, i] = t, [a, o] = n;
|
|
5197
|
-
return e.map((e) =>
|
|
5396
|
+
return e.map((e) => Va(e, r, a, i, o));
|
|
5198
5397
|
}
|
|
5199
|
-
function
|
|
5398
|
+
function Ua(e) {
|
|
5200
5399
|
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]));
|
|
5201
5400
|
return {
|
|
5202
5401
|
minBounds: [t, r],
|
|
@@ -5204,6 +5403,6 @@ function ja(e) {
|
|
|
5204
5403
|
};
|
|
5205
5404
|
}
|
|
5206
5405
|
//#endregion
|
|
5207
|
-
export {
|
|
5406
|
+
export { Fr as ArchedDiamondLatticeWindow, pn as ArchedDiamondLatticeWindowGeometry, Wi as AtmosphericSkybox, Pe as Axis, Oi as Bone, pr as BoneGeometry, Br as Book, yt as BookGeometry, Qr as Bookshelf, Xn as BookshelfGeometry, oi as Boulder, Nt as BoulderGeometry, K as BoxSide, li as BunsenBurner, Ci as Burst, ft as BurstGeometry, dt as BurstShape, be as CameraPlayback, Ji as CameraTransition, ti as Candle, er as CandleGeometry, oa as Center, Fe as ColorPalette, Wr as CrossHeadstone, Hn as CrossHeadstoneGeometry, Gi as DaySkybox, $r as Desk, Zn as DeskGeometry, Ir as DiamondLatticeWindow, mn as DiamondLatticeWindowGeometry, W as Direction, qe as DustMotesEffect, H as Easing, Je as EffervescenceEffect, ui as ElectricPanel, st as EllipticLeafGeometry, Ye as EmissivePulseEffect, di as ErlenmeyerFlask, mr as ErlenmeyerFlaskGeometry, G as Falloff, ni as Flame, Xe as FlameFlickerEffect, $n as FlameGeometry, fi as FlorenceFlask, Cr as FlorenceFlaskGeometry, wi as Gear, cr as GearGeometry, sr as GearShape, Qe as GlowHalo, Lr as GregorianLatticeWindow, _n as GregorianLatticeWindowGeometry, $e as GroundFogEffect, ri as HangingLantern, ir as HangingLanternGeometry, Ti as Heart, ur as HeartGeometry, lr as HeartShape, Ei as Hexagon, It as HexagonGeometry, Ft as HexagonShape, Vr as Jar, In as JarGeometry, jr as LShapedStaircase, Nn as LShapedStaircaseGeometry, ai as Lantern, tr as LanternGeometry, ei as Leaf, Qn as LeafGeometry, pi as LeverPanel, ot as LightningEffect, zn as LineEquations, Gr as Mausoleum, Un as MausoleumGeometry, mi as Microscope, hi as MortarAndPestle, wr as MortarGeometry, si as MossyRock, zt as MossyRockGeometry, Ki as NightSkybox, Kr as ObeliskHeadstone, Wn as ObeliskHeadstoneGeometry, gi as Panel, _i as PanelLight, or as ParallelogramBoxGeometry, q as ParametricCurve, Aa as ParametricCurveUtils, ct as PetalDriftEffect, Hr as PotionBottle, Bn as PotionBottleGeometry, vn as RING_LATTICE_SPACING_FACTOR, ut as RainEffect, He as Random, zr as RingLatticeWindow, ci as Rock, Vt as RockGeometry, qr as RoundedHeadstone, Gn as RoundedHeadstoneGeometry, Yi as SceneTransition, Xi as SceneTransitionFX, Mr as SpiralStaircase, Pn as SpiralStaircaseGeometry, vi as SpiralTube, Jr as SquareHeadstone, Kn as SquareHeadstoneGeometry, Nr as Staircase, Fn as StaircaseGeometry, yi as Stand, Tr as StandGeometry, Di as Star, _t as StarFieldEffect, fr as StarGeometry, dr as StarShape, Yr as StoneFencePost, qn as StoneFencePostGeometry, Ai as TerrainMound, Or as TerrainMoundGeometry, ji as TerrainPlane, kr as TerrainPlaneGeometry, bi as TeslaCoil, Er as TeslaCoilGeometry, xi as TestTube, Dr as TestTubeGeometry, Si as TestTubeRack, ki as Tree, Ar as TreeGeometry, ii as WallSconce, ar as WallSconceGeometry, Ur as WineBottle, Vn as WineBottleGeometry, vt as WispEffect, Xr as WroughtIronBar, Jn as WroughtIronBarGeometry, Zr as WroughtIronFence, Yn as WroughtIronFenceGeometry, Mi as addInstanceColor, Fi as addNoiseDisplacement, Ni as addWaterDisplacement, ea as alignBufferGeometryToSurface, na as alignInstancedMeshIndexToSurface, ta as alignInstancedMeshToSurface, $i as alignObjectToSurface, Zi as alignToEdge, Qi as alignToRow, Sr as appendSphericalCurve, ye as applySnapshot, Z as archedOpeningMetrics, Li as atmosphericShader, Ri as blurTransitionShader, un as buildArchedDiamondLatticeCameParts, nn as buildArchedDiamondLatticeFrameGeometry, dn as buildArchedDiamondLatticeParts, Xt as buildDiamondLatticeCameParts, Yt as buildDiamondLatticeParts, gn as buildGregorianLatticeParts, Cn as buildRingLatticeFrameParts, ga as calculateChannelDifference, ha as calculateDistance, Ma as calculateNormal, Ua as calculateUVBounds, Ln as calculateXFromSlopeIntercept, Rn as calculateYFromSlopeIntercept, _r as capHeightFromRadius, vr as capWidthFromRadius, ve as captureSnapshot, xr as cartesianToSpherical, aa as centerMeshGeometry, ra as centerObject, ia as centerObjectGeometry, qi as checkerboardTexture, Qt as clipSegmentToAabb, sn as clipSegmentToArchedOpening, Ca as createCubicCurvePoints, wa as createDampedCurvePoints, we as createDollyClip, Ta as createExponentialCurvePoints, Ce as createFlythroughClip, Lt as createHexagonalTilesByCount, Rt as createHexagonalTilesByRadius, Ea as createLogarithmicCurvePoints, yn as createOpeningClippingPlanes, xe as createOrbitClip, Da as createParabolicCurvePoints, Se as createPendulumClip, ja as createQuad, Oa as createQuadraticCurvePoints, J as createRandom, Sn as createRingLatticeGeometry, ka as createSigmoidCurvePoints, Te as createSpiralClip, De as createWobbleClip, Ee as createZoomClip, zi as crossfadeShader, Ia as cubicUVMapping, La as cubicUVMappingBatch, za as cylindricalUVMapping, Bi as daySkyShader, Re as deriveSubSeed, Jt as diamondLatticeCellFromCount, Gt as diamondLatticeCornerSpan, Kt as diamondLatticeGridFromCells, rn as diamondLatticeSpringPhaseShift, Oe as displacementBrush, Vi as fadeShader, Hi as fadeTransitionSceneShader, _a as findClosestColor, va as findClosestColorChannelWise, ba as findClosestPoint, qt as fitDiamondLatticeCell, ke as flattenBrush, ya as getAnalogousColors, hn as gregorianLatticeGridFromCells, ca as hexToHsl, la as hexToRgb, ua as hslToHex, da as hslToRgb, en as insetArchedOpeningMetrics, Sa as interpolateCurve, Ge as logarithmicRandomMax, Ke as logarithmicRandomMin, Ie as mulberry32, Ui as nightSkyShader, Ae as noiseBrush, fa as normalizeRgb, Va as normalizeUV, Ha as normalizeUVBatch, sa as parseHexCode, Fa as planarUVMapping, Ba as polarUVMapping, hr as radiusFromCapHeight, gr as radiusFromCapWidth, Y as randomFloat, We as randomInteger, Ve as randomPick, Be as randomRange, Bt as randomTransformVertices, bn as resolveRingLatticeCell, pa as rgbToHex, ma as rgbToHsl, xn as ringLatticeSpots, wt as rowOfBooksByCount, Tt as rowOfBooksByLength, Ct as rowOfBooksByScales, Pt as scatterBoulders, Wt as scatterMossyRocks, Ut as scatterRocks, Pa as setRandomInterval, Na as setRandomTimeout, je as smoothBrush, br as sphericalToCartesian, Ra as sphericalUVMapping, Me as spikeBrush, Le as splitmix32, Et as stackOfBooks, yr as thetaLengthForRadius, $t as traceArchedOpeningOutline, Ne as twistBrush, Ii as updateNoiseDisplacementTime, Pi as updateWaterDisplacementTime };
|
|
5208
5407
|
|
|
5209
5408
|
//# sourceMappingURL=index.mjs.map
|