three-low-poly 0.9.12 → 0.9.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +162 -11
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1360 -0
- package/dist/index.es.js +1332 -1009
- package/dist/index.es.js.map +1 -1
- package/dist/index.iife.js +162 -11
- package/dist/index.iife.js.map +1 -1
- package/dist/index.umd.js +162 -11
- package/dist/index.umd.js.map +1 -1
- package/package.json +15 -9
package/dist/index.es.js
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
XYZ: new M(1, 1, 1).normalize()
|
|
21
|
-
}, V = {
|
|
1
|
+
var ve = Object.defineProperty;
|
|
2
|
+
var Me = (t, e, o) => e in t ? ve(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
|
|
3
|
+
var N = (t, e, o) => Me(t, typeof e != "symbol" ? e + "" : e, o);
|
|
4
|
+
import { Vector3 as g, MathUtils as F, Quaternion as xe, Group as A, SphereGeometry as z, MeshStandardMaterial as w, Mesh as d, BufferGeometry as I, BufferAttribute as R, BoxGeometry as S, InstancedMesh as ge, Matrix4 as ce, Float32BufferAttribute as D, ConeGeometry as Z, CylinderGeometry as E, Vector2 as b, LatheGeometry as H, CircleGeometry as be, TorusGeometry as ue, DodecahedronGeometry as se, ShaderMaterial as $, Shape as Y, ExtrudeGeometry as j, MeshBasicMaterial as Se, PointLight as me, MeshPhysicalMaterial as J, DoubleSide as q, CatmullRomCurve3 as Ie, TubeGeometry as Ee, Path as Ae, Color as K, BackSide as re, DataTexture as Ge, RGBAFormat as Pe, UnsignedByteType as Te, RepeatWrapping as ie, NearestFilter as Ce, Box3 as ae } from "three";
|
|
5
|
+
const L = {
|
|
6
|
+
UP: new g(0, 1, 0),
|
|
7
|
+
DOWN: new g(0, -1, 0),
|
|
8
|
+
LEFT: new g(-1, 0, 0),
|
|
9
|
+
RIGHT: new g(1, 0, 0),
|
|
10
|
+
FORWARD: new g(0, 0, 1),
|
|
11
|
+
BACKWARD: new g(0, 0, -1),
|
|
12
|
+
X: new g(1, 0, 0),
|
|
13
|
+
Y: new g(0, 1, 0),
|
|
14
|
+
Z: new g(0, 0, 1),
|
|
15
|
+
XY: new g(1, 1, 0).normalize(),
|
|
16
|
+
XZ: new g(1, 0, 1).normalize(),
|
|
17
|
+
YZ: new g(0, 1, 1).normalize(),
|
|
18
|
+
XYZ: new g(1, 1, 1).normalize()
|
|
19
|
+
}, Q = {
|
|
22
20
|
LINEAR: (t, e) => 1 - t / e,
|
|
23
21
|
QUADRATIC: (t, e) => Math.pow(1 - t / e, 2),
|
|
24
22
|
SQUARE_ROOT: (t, e) => Math.pow(1 - t / e, 0.5),
|
|
@@ -32,174 +30,336 @@ const _ = {
|
|
|
32
30
|
const o = Math.max(0, Math.min(1, 1 - t / e));
|
|
33
31
|
return o * o * (3 - 2 * o);
|
|
34
32
|
}
|
|
35
|
-
},
|
|
33
|
+
}, $t = (t, e, o, n, a = L.UP, r = Q.LINEAR) => {
|
|
36
34
|
const s = t.attributes.position;
|
|
37
35
|
for (let c = 0; c < s.count; c++) {
|
|
38
|
-
const i = new
|
|
36
|
+
const i = new g();
|
|
39
37
|
i.fromBufferAttribute(s, c);
|
|
40
38
|
const l = i.distanceTo(e);
|
|
41
39
|
if (l < o) {
|
|
42
|
-
const m =
|
|
43
|
-
i.add(
|
|
40
|
+
const m = r(l, o) * n;
|
|
41
|
+
i.add(a.clone().multiplyScalar(m)), s.setXYZ(c, i.x, i.y, i.z);
|
|
44
42
|
}
|
|
45
43
|
}
|
|
46
44
|
s.needsUpdate = !0;
|
|
47
|
-
},
|
|
45
|
+
}, Jt = (t, e, o, n, a, r = L.UP, s = Q.LINEAR) => {
|
|
48
46
|
const c = t.attributes.position;
|
|
49
47
|
for (let i = 0; i < c.count; i++) {
|
|
50
|
-
const l = new
|
|
48
|
+
const l = new g();
|
|
51
49
|
l.fromBufferAttribute(c, i);
|
|
52
50
|
const u = l.distanceTo(e);
|
|
53
51
|
if (u < o) {
|
|
54
|
-
const h = s(u, o) *
|
|
55
|
-
l.add(
|
|
52
|
+
const h = s(u, o) * a, f = l.dot(r.normalize()), p = n - f;
|
|
53
|
+
l.add(r.clone().multiplyScalar(p * h)), c.setXYZ(i, l.x, l.y, l.z);
|
|
56
54
|
}
|
|
57
55
|
}
|
|
58
56
|
c.needsUpdate = !0;
|
|
59
|
-
},
|
|
57
|
+
}, Wt = (t, e, o, n, a = L.UP, r = Q.LINEAR) => {
|
|
60
58
|
const s = t.attributes.position;
|
|
61
59
|
for (let c = 0; c < s.count; c++) {
|
|
62
|
-
const i = new
|
|
60
|
+
const i = new g();
|
|
63
61
|
i.fromBufferAttribute(s, c);
|
|
64
62
|
const l = i.distanceTo(e);
|
|
65
63
|
if (l < o) {
|
|
66
|
-
const u =
|
|
67
|
-
i.x +=
|
|
64
|
+
const u = r(l, o), m = n * u, h = a.clone().normalize();
|
|
65
|
+
i.x += F.randFloatSpread(m) * h.x, i.y += F.randFloatSpread(m) * h.y, i.z += F.randFloatSpread(m) * h.z, s.setXYZ(c, i.x, i.y, i.z);
|
|
68
66
|
}
|
|
69
67
|
}
|
|
70
68
|
s.needsUpdate = !0;
|
|
71
|
-
},
|
|
72
|
-
const
|
|
73
|
-
for (let s = 0; s <
|
|
74
|
-
const c = new
|
|
75
|
-
if (c.fromBufferAttribute(
|
|
76
|
-
let l = new
|
|
77
|
-
for (let m = 0; m <
|
|
78
|
-
|
|
79
|
-
u > 0 && (l.divideScalar(u), c.lerp(l, n),
|
|
69
|
+
}, eo = (t, e, o, n) => {
|
|
70
|
+
const a = t.attributes.position, r = new g();
|
|
71
|
+
for (let s = 0; s < a.count; s++) {
|
|
72
|
+
const c = new g();
|
|
73
|
+
if (c.fromBufferAttribute(a, s), c.distanceTo(e) < o) {
|
|
74
|
+
let l = new g(), u = 0;
|
|
75
|
+
for (let m = 0; m < a.count; m++)
|
|
76
|
+
r.fromBufferAttribute(a, m), r.distanceTo(c) < o && (l.add(r), u++);
|
|
77
|
+
u > 0 && (l.divideScalar(u), c.lerp(l, n), a.setXYZ(s, c.x, c.y, c.z));
|
|
80
78
|
}
|
|
81
79
|
}
|
|
82
|
-
|
|
83
|
-
},
|
|
80
|
+
a.needsUpdate = !0;
|
|
81
|
+
}, to = (t, e, o, n, a = !1, r = Q.LINEAR) => {
|
|
84
82
|
const s = t.attributes.position;
|
|
85
83
|
for (let c = 0; c < s.count; c++) {
|
|
86
|
-
const i = new
|
|
84
|
+
const i = new g();
|
|
87
85
|
i.fromBufferAttribute(s, c);
|
|
88
86
|
const l = i.distanceTo(e);
|
|
89
87
|
if (l < o) {
|
|
90
|
-
const m =
|
|
88
|
+
const m = r(l, o) * n * (a ? -1 : 1), h = i.clone().sub(e).normalize();
|
|
91
89
|
i.add(h.multiplyScalar(m)), s.setXYZ(c, i.x, i.y, i.z);
|
|
92
90
|
}
|
|
93
91
|
}
|
|
94
92
|
s.needsUpdate = !0;
|
|
95
|
-
},
|
|
96
|
-
const s = t.attributes.position, c = new
|
|
93
|
+
}, oo = (t, e, o, n, a = L.UP, r = Q.LINEAR) => {
|
|
94
|
+
const s = t.attributes.position, c = new xe();
|
|
97
95
|
for (let i = 0; i < s.count; i++) {
|
|
98
|
-
const l = new
|
|
96
|
+
const l = new g();
|
|
99
97
|
l.fromBufferAttribute(s, i);
|
|
100
98
|
const u = l.distanceTo(e);
|
|
101
99
|
if (u < o) {
|
|
102
|
-
const h =
|
|
103
|
-
c.setFromAxisAngle(
|
|
100
|
+
const h = r(u, o) * n;
|
|
101
|
+
c.setFromAxisAngle(a, h), l.sub(e).applyQuaternion(c).add(e), s.setXYZ(i, l.x, l.y, l.z);
|
|
104
102
|
}
|
|
105
103
|
}
|
|
106
104
|
s.needsUpdate = !0;
|
|
107
|
-
},
|
|
108
|
-
SINE_EASE_IN:
|
|
109
|
-
SINE_EASE_OUT:
|
|
110
|
-
SINE_EASE_IN_OUT:
|
|
105
|
+
}, Be = (t) => 1 - Math.cos(t * Math.PI / 2), Ue = (t) => Math.sin(t * Math.PI / 2), Ne = (t) => -0.5 * (Math.cos(Math.PI * t) - 1), Oe = (t) => t * t, ze = (t) => 1 - Math.pow(1 - t, 2), _e = (t) => t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2, ke = (t) => t * t * t, Re = (t) => 1 - Math.pow(1 - t, 3), Fe = (t) => t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2, Le = (t) => t * t * t * t, De = (t) => 1 - Math.pow(1 - t, 4), qe = (t) => t < 0.5 ? 8 * t * t * t * t : 1 - Math.pow(-2 * t + 2, 4) / 2, Xe = (t) => t * t * t * t * t, Ve = (t) => 1 - Math.pow(1 - t, 5), Ze = (t) => t < 0.5 ? 16 * t * t * t * t * t : 1 - Math.pow(-2 * t + 2, 5) / 2, He = (t) => t === 0 ? 0 : Math.pow(2, 10 * t - 10), Ye = (t) => t === 1 ? 1 : 1 - Math.pow(2, -10 * t), je = (t) => t === 0 ? 0 : t === 1 ? 1 : t < 0.5 ? Math.pow(2, 20 * t - 10) / 2 : (2 - Math.pow(2, -20 * t + 10)) / 2, Qe = (t) => 1 - Math.sqrt(1 - Math.pow(t, 2)), Ke = (t) => Math.sqrt(1 - Math.pow(t - 1, 2)), $e = (t) => t < 0.5 ? (1 - Math.sqrt(1 - Math.pow(2 * t, 2))) / 2 : (Math.sqrt(1 - Math.pow(-2 * t + 2, 2)) + 1) / 2, Je = (t) => t, We = (t) => t * t * (3 - 2 * t), et = (t) => 1 - Math.pow(1 - t, 0.3), tt = (t) => Math.pow(t, 0.3), ot = (t) => Math.log(Math.max(0.01, t)) / Math.log(2), nt = (t) => Math.sqrt(t), st = (t) => 1 - t, rt = (t) => Math.exp(-Math.pow(t - 0.5, 2) / (2 * 0.5)), no = {
|
|
106
|
+
SINE_EASE_IN: Be,
|
|
107
|
+
SINE_EASE_OUT: Ue,
|
|
108
|
+
SINE_EASE_IN_OUT: Ne,
|
|
111
109
|
QUADRATIC_EASE_IN: Oe,
|
|
112
|
-
QUADRATIC_EASE_OUT:
|
|
113
|
-
QUADRATIC_EASE_IN_OUT:
|
|
114
|
-
CUBIC_EASE_IN:
|
|
115
|
-
CUBIC_EASE_OUT:
|
|
116
|
-
CUBIC_EASE_IN_OUT:
|
|
117
|
-
QUARTIC_EASE_IN:
|
|
118
|
-
QUARTIC_EASE_OUT:
|
|
119
|
-
QUARTIC_EASE_IN_OUT:
|
|
120
|
-
QUINTIC_EASE_IN:
|
|
121
|
-
QUINTIC_EASE_OUT:
|
|
122
|
-
QUINTIC_EASE_IN_OUT:
|
|
123
|
-
EXPONENTIAL_EASE_IN:
|
|
124
|
-
EXPONENTIAL_EASE_OUT:
|
|
110
|
+
QUADRATIC_EASE_OUT: ze,
|
|
111
|
+
QUADRATIC_EASE_IN_OUT: _e,
|
|
112
|
+
CUBIC_EASE_IN: ke,
|
|
113
|
+
CUBIC_EASE_OUT: Re,
|
|
114
|
+
CUBIC_EASE_IN_OUT: Fe,
|
|
115
|
+
QUARTIC_EASE_IN: Le,
|
|
116
|
+
QUARTIC_EASE_OUT: De,
|
|
117
|
+
QUARTIC_EASE_IN_OUT: qe,
|
|
118
|
+
QUINTIC_EASE_IN: Xe,
|
|
119
|
+
QUINTIC_EASE_OUT: Ve,
|
|
120
|
+
QUINTIC_EASE_IN_OUT: Ze,
|
|
121
|
+
EXPONENTIAL_EASE_IN: He,
|
|
122
|
+
EXPONENTIAL_EASE_OUT: Ye,
|
|
125
123
|
EXPONENTIAL_EASE_IN_OUT: je,
|
|
126
|
-
CIRCULAR_EASE_IN:
|
|
127
|
-
CIRCULAR_EASE_OUT:
|
|
124
|
+
CIRCULAR_EASE_IN: Qe,
|
|
125
|
+
CIRCULAR_EASE_OUT: Ke,
|
|
128
126
|
CIRCULAR_EASE_IN_OUT: $e,
|
|
129
|
-
LINEAR:
|
|
130
|
-
SMOOTHSTEP:
|
|
131
|
-
CONCAVE:
|
|
132
|
-
CONVEX:
|
|
133
|
-
LOGARITHMIC:
|
|
134
|
-
SQUARE_ROOT:
|
|
135
|
-
INVERSE:
|
|
136
|
-
GAUSSIAN:
|
|
137
|
-
},
|
|
138
|
-
const r = Math.max(0, Math.min(1, t));
|
|
139
|
-
return e *
|
|
140
|
-
},
|
|
127
|
+
LINEAR: Je,
|
|
128
|
+
SMOOTHSTEP: We,
|
|
129
|
+
CONCAVE: et,
|
|
130
|
+
CONVEX: tt,
|
|
131
|
+
LOGARITHMIC: ot,
|
|
132
|
+
SQUARE_ROOT: nt,
|
|
133
|
+
INVERSE: st,
|
|
134
|
+
GAUSSIAN: rt
|
|
135
|
+
}, at = (t, e, o, n, a) => {
|
|
136
|
+
const r = Math.max(0, Math.min(1, t)), s = 1 - r;
|
|
137
|
+
return s * s * s * e + 3 * s * s * r * o + 3 * s * r * r * n + r * r * r * a;
|
|
138
|
+
}, ct = (t, e = 1) => {
|
|
141
139
|
const o = Math.max(1e-3, e);
|
|
142
140
|
return (1 - Math.exp(-o * t)) / (1 - Math.exp(-o));
|
|
143
|
-
},
|
|
144
|
-
const r = Math.max(0, Math.min(1, t)), a = 1 - r;
|
|
145
|
-
return a * a * e + 2 * a * r * o + r * r * n;
|
|
146
|
-
}, ut = (t, e, o, n, r) => {
|
|
147
|
-
const a = Math.max(0, Math.min(1, t)), s = 1 - a;
|
|
148
|
-
return s * s * s * e + 3 * s * s * a * o + 3 * s * a * a * n + a * a * a * r;
|
|
149
|
-
}, mt = (t, e = 1, o = 1) => {
|
|
141
|
+
}, it = (t, e = 1, o = 1) => {
|
|
150
142
|
const n = Math.max(0, Math.min(1, t));
|
|
151
143
|
return e * Math.pow(n, o);
|
|
152
|
-
},
|
|
144
|
+
}, lt = (t, e = 1, o = 1) => {
|
|
153
145
|
const n = Math.max(1e-3, Math.min(1, t));
|
|
154
146
|
return e * Math.log(o * n + 1);
|
|
155
|
-
},
|
|
147
|
+
}, ut = (t, e = 1, o = 0, n = 0) => {
|
|
148
|
+
const a = Math.max(0, Math.min(1, t));
|
|
149
|
+
return e * a * a + o * a + n;
|
|
150
|
+
}, mt = (t, e, o, n) => {
|
|
151
|
+
const a = Math.max(0, Math.min(1, t)), r = 1 - a;
|
|
152
|
+
return r * r * e + 2 * r * a * o + a * a * n;
|
|
153
|
+
}, ht = (t, e = 10) => {
|
|
156
154
|
const o = Math.max(0, Math.min(1, t));
|
|
157
155
|
return 1 / (1 + Math.exp(-e * (o - 0.5)));
|
|
158
|
-
},
|
|
159
|
-
|
|
160
|
-
DAMPED:
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
SIGMOID:
|
|
156
|
+
}, ft = (t) => Math.sin(t * Math.PI * 0.5), k = {
|
|
157
|
+
CUBIC: at,
|
|
158
|
+
DAMPED: ct,
|
|
159
|
+
EXPONENTIAL: it,
|
|
160
|
+
LOGARITHMIC: lt,
|
|
161
|
+
PARABOLIC: ut,
|
|
162
|
+
QUADRATIC: mt,
|
|
163
|
+
SIGMOID: ht,
|
|
164
|
+
SINUSOIDAL: ft
|
|
166
165
|
};
|
|
167
|
-
class
|
|
166
|
+
class so extends A {
|
|
168
167
|
constructor() {
|
|
169
168
|
super();
|
|
170
|
-
|
|
169
|
+
N(this, "bubbles", []);
|
|
170
|
+
N(this, "bubbleCount", 20);
|
|
171
|
+
const o = new z(0.1, 6, 6), n = new w({
|
|
171
172
|
color: 16777215,
|
|
172
173
|
transparent: !0,
|
|
173
174
|
opacity: 0.6,
|
|
174
175
|
roughness: 0.3,
|
|
175
176
|
metalness: 0.3
|
|
176
177
|
});
|
|
177
|
-
for (let
|
|
178
|
-
const
|
|
179
|
-
|
|
178
|
+
for (let a = 0; a < this.bubbleCount; a++) {
|
|
179
|
+
const r = new d(o, n);
|
|
180
|
+
r.position.set(
|
|
180
181
|
(Math.random() - 0.5) * 1.5,
|
|
181
182
|
// Random x position within flask
|
|
182
183
|
Math.random() * 3,
|
|
183
184
|
// Random y position within flask height
|
|
184
185
|
(Math.random() - 0.5) * 1.5
|
|
185
186
|
// Random z position within flask
|
|
186
|
-
),
|
|
187
|
+
), this.bubbles.push(r), this.add(r);
|
|
187
188
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
189
|
+
this.animateBubbles();
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Updates bubble positions, moving them upward and resetting them
|
|
193
|
+
* to the bottom if they reach the top.
|
|
194
|
+
*/
|
|
195
|
+
updateBubbles() {
|
|
196
|
+
this.bubbles.forEach((o) => {
|
|
197
|
+
o.position.y += 0.02, o.position.y > 3 && (o.position.y = 0, o.position.x = (Math.random() - 0.5) * 1.5, o.position.z = (Math.random() - 0.5) * 1.5);
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Animates the bubbles by updating their positions in a loop.
|
|
202
|
+
*/
|
|
203
|
+
animateBubbles() {
|
|
204
|
+
const o = () => {
|
|
205
|
+
requestAnimationFrame(o), this.updateBubbles();
|
|
206
|
+
};
|
|
207
|
+
o();
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
const C = (t, e) => {
|
|
211
|
+
const o = t[0].index !== null, n = new Set(Object.keys(t[0].attributes)), a = new Set(Object.keys(t[0].morphAttributes)), r = {}, s = {}, c = t[0].morphTargetsRelative, i = new I();
|
|
212
|
+
let l = 0;
|
|
213
|
+
if (t.forEach((u, m) => {
|
|
214
|
+
let h = 0;
|
|
215
|
+
if (o !== (u.index !== null))
|
|
216
|
+
return console.error(
|
|
217
|
+
"THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index " + m + ". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."
|
|
218
|
+
), null;
|
|
219
|
+
for (let f in u.attributes) {
|
|
220
|
+
if (!n.has(f))
|
|
221
|
+
return console.error(
|
|
222
|
+
"THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index " + m + '. All geometries must have compatible attributes; make sure "' + f + '" attribute exists among all geometries, or in none of them.'
|
|
223
|
+
), null;
|
|
224
|
+
r[f] === void 0 && (r[f] = []), r[f].push(u.attributes[f]), h++;
|
|
225
|
+
}
|
|
226
|
+
if (h !== n.size)
|
|
227
|
+
return console.error(
|
|
228
|
+
"THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index " + m + ". Make sure all geometries have the same number of attributes."
|
|
229
|
+
), null;
|
|
230
|
+
if (c !== u.morphTargetsRelative)
|
|
231
|
+
return console.error(
|
|
232
|
+
"THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index " + m + ". .morphTargetsRelative must be consistent throughout all geometries."
|
|
233
|
+
), null;
|
|
234
|
+
for (let f in u.morphAttributes) {
|
|
235
|
+
if (!a.has(f))
|
|
236
|
+
return console.error(
|
|
237
|
+
"THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index " + m + ". .morphAttributes must be consistent throughout all geometries."
|
|
238
|
+
), null;
|
|
239
|
+
s[f] === void 0 && (s[f] = []), s[f].push(u.morphAttributes[f]);
|
|
192
240
|
}
|
|
193
|
-
|
|
194
|
-
|
|
241
|
+
if (i.userData.mergedUserData = i.userData.mergedUserData || [], i.userData.mergedUserData.push(u.userData), e) {
|
|
242
|
+
let f;
|
|
243
|
+
if (u.index)
|
|
244
|
+
f = u.index.count;
|
|
245
|
+
else if (u.attributes.position !== void 0)
|
|
246
|
+
f = u.attributes.position.count;
|
|
247
|
+
else
|
|
248
|
+
return console.error(
|
|
249
|
+
"THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index " + m + ". The geometry must have either an index or a position attribute"
|
|
250
|
+
), null;
|
|
251
|
+
i.addGroup(l, f, m), l += f;
|
|
252
|
+
}
|
|
253
|
+
}), o) {
|
|
254
|
+
let u = 0;
|
|
255
|
+
const m = [];
|
|
256
|
+
t.forEach((h) => {
|
|
257
|
+
const f = h.index;
|
|
258
|
+
for (let p = 0; p < f.count; ++p)
|
|
259
|
+
m.push(f.getX(p) + u);
|
|
260
|
+
u += h.attributes.position.count;
|
|
261
|
+
}), i.setIndex(m);
|
|
262
|
+
}
|
|
263
|
+
for (let u in r) {
|
|
264
|
+
const m = le(r[u]);
|
|
265
|
+
if (!m)
|
|
266
|
+
return console.error(
|
|
267
|
+
"THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the " + u + " attribute."
|
|
268
|
+
), null;
|
|
269
|
+
i.setAttribute(u, m);
|
|
270
|
+
}
|
|
271
|
+
for (let u in s) {
|
|
272
|
+
const m = s[u][0].length;
|
|
273
|
+
if (m === 0)
|
|
274
|
+
break;
|
|
275
|
+
i.morphAttributes = i.morphAttributes || {}, i.morphAttributes[u] = [];
|
|
276
|
+
for (let h = 0; h < m; ++h) {
|
|
277
|
+
const f = [];
|
|
278
|
+
for (let y = 0; y < s[u].length; ++y)
|
|
279
|
+
f.push(s[u][y][h]);
|
|
280
|
+
const p = le(f);
|
|
281
|
+
if (!p)
|
|
282
|
+
return console.error(
|
|
283
|
+
"THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the " + u + " morphAttribute."
|
|
284
|
+
), null;
|
|
285
|
+
i.morphAttributes[u].push(p);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
return i;
|
|
289
|
+
}, le = (t) => {
|
|
290
|
+
let e, o, n, a = 0;
|
|
291
|
+
if (t.forEach((r) => {
|
|
292
|
+
if (e === void 0 && (e = r.array.constructor), e !== r.array.constructor)
|
|
293
|
+
return console.error(
|
|
294
|
+
"THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."
|
|
295
|
+
), null;
|
|
296
|
+
if (o === void 0 && (o = r.itemSize), o !== r.itemSize)
|
|
297
|
+
return console.error(
|
|
298
|
+
"THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."
|
|
299
|
+
), null;
|
|
300
|
+
if (n === void 0 && (n = r.normalized), n !== r.normalized)
|
|
301
|
+
return console.error(
|
|
302
|
+
"THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."
|
|
303
|
+
), null;
|
|
304
|
+
a += r.array.length;
|
|
305
|
+
}), e && o) {
|
|
306
|
+
const r = new e(a);
|
|
307
|
+
let s = 0;
|
|
308
|
+
return t.forEach((c) => {
|
|
309
|
+
r.set(c.array, s), s += c.array.length;
|
|
310
|
+
}), new R(r, o, n);
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
function pt(t, e = 1e-4) {
|
|
314
|
+
e = Math.max(e, Number.EPSILON);
|
|
315
|
+
const o = {}, n = t.getIndex(), a = t.getAttribute("position"), r = n ? n.count : a.count;
|
|
316
|
+
let s = 0;
|
|
317
|
+
const c = Object.keys(t.attributes), i = {}, l = {}, u = [], m = ["getX", "getY", "getZ", "getW"];
|
|
318
|
+
for (let y = 0, v = c.length; y < v; y++) {
|
|
319
|
+
const M = c[y];
|
|
320
|
+
i[M] = [];
|
|
321
|
+
const x = t.morphAttributes[M];
|
|
322
|
+
x && (l[M] = new Array(x.length).fill(0).map(() => []));
|
|
323
|
+
}
|
|
324
|
+
const h = Math.log10(1 / e), f = Math.pow(10, h);
|
|
325
|
+
for (let y = 0; y < r; y++) {
|
|
326
|
+
const v = n ? n.getX(y) : y;
|
|
327
|
+
let M = "";
|
|
328
|
+
for (let x = 0, B = c.length; x < B; x++) {
|
|
329
|
+
const U = c[x], G = t.getAttribute(U), P = G.itemSize;
|
|
330
|
+
for (let O = 0; O < P; O++)
|
|
331
|
+
M += `${~~(G[m[O]](v) * f)},`;
|
|
332
|
+
}
|
|
333
|
+
if (M in o)
|
|
334
|
+
u.push(o[M]);
|
|
335
|
+
else {
|
|
336
|
+
for (let x = 0, B = c.length; x < B; x++) {
|
|
337
|
+
const U = c[x], G = t.getAttribute(U), P = t.morphAttributes[U], O = G.itemSize, _ = i[U], W = l[U];
|
|
338
|
+
for (let X = 0; X < O; X++) {
|
|
339
|
+
const V = m[X];
|
|
340
|
+
if (_.push(G[V](v)), P)
|
|
341
|
+
for (let T = 0, we = P.length; T < we; T++)
|
|
342
|
+
W[T].push(P[T][V](v));
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
o[M] = s, u.push(s), s++;
|
|
195
346
|
}
|
|
196
|
-
s();
|
|
197
347
|
}
|
|
348
|
+
const p = t.clone();
|
|
349
|
+
for (let y = 0, v = c.length; y < v; y++) {
|
|
350
|
+
const M = c[y], x = t.getAttribute(M), B = new x.array.constructor(i[M]), U = new R(B, x.itemSize, x.normalized);
|
|
351
|
+
if (p.setAttribute(M, U), M in l)
|
|
352
|
+
for (let G = 0; G < l[M].length; G++) {
|
|
353
|
+
const P = t.morphAttributes[M][G], O = new P.array.constructor(l[M][G]), _ = new R(O, P.itemSize, P.normalized);
|
|
354
|
+
p.morphAttributes[M][G] = _;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
return p.setIndex(u), p;
|
|
198
358
|
}
|
|
199
|
-
class
|
|
200
|
-
constructor(e = 1, o = 1.5, n = 0.5,
|
|
359
|
+
class he extends I {
|
|
360
|
+
constructor(e = 1, o = 1.5, n = 0.5, a = 0.05, r = 0.05) {
|
|
201
361
|
super();
|
|
202
|
-
const s = e, c = o, i = n, l =
|
|
362
|
+
const s = e, c = o, i = n, l = a, u = r, m = [
|
|
203
363
|
// Front cover
|
|
204
364
|
0,
|
|
205
365
|
0,
|
|
@@ -565,7 +725,7 @@ class ie extends g {
|
|
|
565
725
|
0,
|
|
566
726
|
0
|
|
567
727
|
// Back cover edge
|
|
568
|
-
],
|
|
728
|
+
], f = e / (e * 2 + n), p = (e + n) / (e * 2 + n), y = [
|
|
569
729
|
p,
|
|
570
730
|
0,
|
|
571
731
|
1,
|
|
@@ -577,20 +737,20 @@ class ie extends g {
|
|
|
577
737
|
// Front cover
|
|
578
738
|
0,
|
|
579
739
|
0,
|
|
580
|
-
|
|
740
|
+
f,
|
|
581
741
|
0,
|
|
582
|
-
|
|
742
|
+
f,
|
|
583
743
|
1,
|
|
584
744
|
0,
|
|
585
745
|
1,
|
|
586
746
|
// Back cover
|
|
587
|
-
|
|
747
|
+
f,
|
|
588
748
|
0,
|
|
589
749
|
p,
|
|
590
750
|
0,
|
|
591
751
|
p,
|
|
592
752
|
1,
|
|
593
|
-
|
|
753
|
+
f,
|
|
594
754
|
1,
|
|
595
755
|
// Spine
|
|
596
756
|
1,
|
|
@@ -602,20 +762,20 @@ class ie extends g {
|
|
|
602
762
|
1,
|
|
603
763
|
1,
|
|
604
764
|
// Inside front cover
|
|
605
|
-
|
|
765
|
+
f,
|
|
606
766
|
0,
|
|
607
767
|
0,
|
|
608
768
|
0,
|
|
609
769
|
0,
|
|
610
770
|
1,
|
|
611
|
-
|
|
771
|
+
f,
|
|
612
772
|
1,
|
|
613
773
|
// Inside back cover
|
|
614
774
|
p,
|
|
615
775
|
0,
|
|
616
|
-
|
|
776
|
+
f,
|
|
617
777
|
0,
|
|
618
|
-
|
|
778
|
+
f,
|
|
619
779
|
1,
|
|
620
780
|
p,
|
|
621
781
|
1,
|
|
@@ -692,7 +852,7 @@ class ie extends g {
|
|
|
692
852
|
0,
|
|
693
853
|
1
|
|
694
854
|
// Back cover edge
|
|
695
|
-
],
|
|
855
|
+
], v = [
|
|
696
856
|
0,
|
|
697
857
|
1,
|
|
698
858
|
2,
|
|
@@ -791,143 +951,147 @@ class ie extends g {
|
|
|
791
951
|
54,
|
|
792
952
|
55
|
|
793
953
|
// Back cover edge
|
|
794
|
-
],
|
|
795
|
-
|
|
796
|
-
const
|
|
797
|
-
|
|
954
|
+
], M = new Float32Array(m), x = new Float32Array(h), B = new Float32Array(y), U = new Uint16Array(v), G = new I();
|
|
955
|
+
G.setAttribute("position", new R(M, 3)), G.setAttribute("normal", new R(x, 3)), G.setAttribute("uv", new R(B, 2)), G.setIndex(new R(U, 1));
|
|
956
|
+
const P = new S(e - l - u, c - u * 2, i - l * 2);
|
|
957
|
+
P.translate((e - l - u) / 2 + l, c / 2, -i / 2), this.copy(C([G, P], !0));
|
|
798
958
|
}
|
|
799
959
|
}
|
|
800
|
-
function
|
|
960
|
+
function dt(t = 0, e = 1) {
|
|
801
961
|
return Math.random() * (e - t) + t;
|
|
802
962
|
}
|
|
803
|
-
function
|
|
963
|
+
function ro(t = 0, e = 1) {
|
|
804
964
|
return Math.floor(Math.random() * (e - t + 1)) + t;
|
|
805
965
|
}
|
|
806
|
-
function
|
|
966
|
+
function yt(t = 0.5, e = 0, o = 1) {
|
|
807
967
|
return e + (o - e) * Math.pow(Math.random(), t);
|
|
808
968
|
}
|
|
809
969
|
function wt(t = 0.5, e = 0, o = 1) {
|
|
810
970
|
return e + (o - e) * Math.pow(1 - Math.random(), t);
|
|
811
971
|
}
|
|
812
|
-
function
|
|
972
|
+
function fe({
|
|
813
973
|
scaleXMin: t = 0.4,
|
|
814
974
|
scaleXMax: e = 0.7,
|
|
815
975
|
scaleYMin: o = 0.3,
|
|
816
976
|
scaleYMax: n = 0.95,
|
|
817
|
-
scaleZMin:
|
|
818
|
-
scaleZMax:
|
|
977
|
+
scaleZMin: a = 0.1,
|
|
978
|
+
scaleZMax: r = 0.5
|
|
819
979
|
} = {}) {
|
|
820
|
-
return new
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
wt(0.8,
|
|
980
|
+
return new g(
|
|
981
|
+
dt(t, e),
|
|
982
|
+
yt(0.25, o, n),
|
|
983
|
+
wt(0.8, a, r)
|
|
824
984
|
);
|
|
825
985
|
}
|
|
826
|
-
function
|
|
827
|
-
|
|
986
|
+
function pe({
|
|
987
|
+
coverMaterial: t,
|
|
988
|
+
pagesMaterial: e,
|
|
989
|
+
scales: o
|
|
990
|
+
}) {
|
|
991
|
+
const n = new he(), a = new ge(n, [t, e], o.length), r = new ce();
|
|
828
992
|
let s = 0;
|
|
829
993
|
for (let c = 0; c < o.length; c++) {
|
|
830
|
-
const i = o[c], l = new
|
|
831
|
-
l.makeScale(i.x, i.y, i.z),
|
|
994
|
+
const i = o[c], l = new ce();
|
|
995
|
+
l.makeScale(i.x, i.y, i.z), r.identity(), r.multiply(l), r.setPosition(0.01 + Math.random() * 0.1, 0, s + i.z * 0.5), a.setMatrixAt(c, r), s += i.z * 0.5;
|
|
832
996
|
}
|
|
833
|
-
return
|
|
997
|
+
return a;
|
|
834
998
|
}
|
|
835
|
-
function
|
|
999
|
+
function ao({
|
|
836
1000
|
coverMaterial: t,
|
|
837
1001
|
pagesMaterial: e,
|
|
838
1002
|
count: o = 10,
|
|
839
1003
|
scaleXMin: n = 0.4,
|
|
840
|
-
scaleXMax:
|
|
841
|
-
scaleYMin:
|
|
1004
|
+
scaleXMax: a = 0.7,
|
|
1005
|
+
scaleYMin: r = 0.3,
|
|
842
1006
|
scaleYMax: s = 0.95,
|
|
843
1007
|
scaleZMin: c = 0.1,
|
|
844
1008
|
scaleZMax: i = 0.5
|
|
845
|
-
}
|
|
1009
|
+
}) {
|
|
846
1010
|
const l = Array.from(
|
|
847
1011
|
{ length: o },
|
|
848
|
-
() =>
|
|
1012
|
+
() => fe({ scaleXMin: n, scaleXMax: a, scaleYMin: r, scaleYMax: s, scaleZMin: c, scaleZMax: i })
|
|
849
1013
|
);
|
|
850
|
-
return
|
|
1014
|
+
return pe({ coverMaterial: t, pagesMaterial: e, scales: l });
|
|
851
1015
|
}
|
|
852
|
-
function
|
|
1016
|
+
function co({
|
|
853
1017
|
coverMaterial: t,
|
|
854
1018
|
pagesMaterial: e,
|
|
855
1019
|
length: o = 10,
|
|
856
1020
|
scaleXMin: n = 0.4,
|
|
857
|
-
scaleXMax:
|
|
858
|
-
scaleYMin:
|
|
1021
|
+
scaleXMax: a = 0.7,
|
|
1022
|
+
scaleYMin: r = 0.3,
|
|
859
1023
|
scaleYMax: s = 0.95,
|
|
860
1024
|
scaleZMin: c = 0.1,
|
|
861
1025
|
scaleZMax: i = 0.5
|
|
862
|
-
}
|
|
1026
|
+
}) {
|
|
863
1027
|
const l = [];
|
|
864
1028
|
let u = o;
|
|
865
1029
|
for (; u > 0; ) {
|
|
866
|
-
const m =
|
|
1030
|
+
const m = fe({ scaleXMin: n, scaleXMax: a, scaleYMin: r, scaleYMax: s, scaleZMin: c, scaleZMax: i });
|
|
867
1031
|
m.z = Math.min(m.z, u), l.push(m), u -= m.z;
|
|
868
1032
|
}
|
|
869
|
-
return
|
|
1033
|
+
return pe({ coverMaterial: t, pagesMaterial: e, scales: l });
|
|
870
1034
|
}
|
|
871
|
-
class
|
|
872
|
-
constructor(e = 2, o = 0.3, n = 0.6,
|
|
1035
|
+
class io extends I {
|
|
1036
|
+
constructor(e = 2, o = 0.3, n = 0.6, a = 5, r = 5, s = Math.PI / 4) {
|
|
873
1037
|
super();
|
|
874
1038
|
const c = [], i = [];
|
|
875
|
-
for (let
|
|
876
|
-
const p =
|
|
1039
|
+
for (let f = 0; f < a; f++) {
|
|
1040
|
+
const p = f * o, y = p + o, v = f * n, M = v + n;
|
|
877
1041
|
c.push(
|
|
878
1042
|
// Vertical riser
|
|
879
1043
|
-e / 2,
|
|
880
1044
|
p,
|
|
881
|
-
|
|
1045
|
+
v,
|
|
882
1046
|
// Bottom-left
|
|
883
1047
|
e / 2,
|
|
884
1048
|
p,
|
|
885
|
-
|
|
1049
|
+
v,
|
|
886
1050
|
// Bottom-right
|
|
887
1051
|
e / 2,
|
|
888
1052
|
y,
|
|
889
|
-
|
|
1053
|
+
v,
|
|
890
1054
|
// Top-right
|
|
891
1055
|
-e / 2,
|
|
892
1056
|
y,
|
|
893
|
-
|
|
1057
|
+
v,
|
|
894
1058
|
// Top-left
|
|
895
1059
|
// Horizontal tread
|
|
896
1060
|
-e / 2,
|
|
897
1061
|
y,
|
|
898
|
-
|
|
1062
|
+
v,
|
|
899
1063
|
// Top-left
|
|
900
1064
|
e / 2,
|
|
901
1065
|
y,
|
|
902
|
-
|
|
1066
|
+
v,
|
|
903
1067
|
// Top-right
|
|
904
1068
|
e / 2,
|
|
905
1069
|
y,
|
|
906
|
-
|
|
1070
|
+
M,
|
|
907
1071
|
// Back-right
|
|
908
1072
|
-e / 2,
|
|
909
1073
|
y,
|
|
910
|
-
|
|
1074
|
+
M
|
|
911
1075
|
// Back-left
|
|
912
1076
|
);
|
|
913
|
-
const
|
|
1077
|
+
const x = f * 8;
|
|
914
1078
|
i.push(
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
1079
|
+
x,
|
|
1080
|
+
x + 1,
|
|
1081
|
+
x + 2,
|
|
1082
|
+
x,
|
|
1083
|
+
x + 2,
|
|
1084
|
+
x + 3
|
|
921
1085
|
), i.push(
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
1086
|
+
x + 4,
|
|
1087
|
+
x + 5,
|
|
1088
|
+
x + 6,
|
|
1089
|
+
x + 4,
|
|
1090
|
+
x + 6,
|
|
1091
|
+
x + 7
|
|
928
1092
|
);
|
|
929
1093
|
}
|
|
930
|
-
const l =
|
|
1094
|
+
const l = a * o, u = a * n, m = e * 2;
|
|
931
1095
|
c.push(
|
|
932
1096
|
// Landing platform (4 vertices)
|
|
933
1097
|
-m / 2,
|
|
@@ -947,7 +1111,7 @@ class ho extends g {
|
|
|
947
1111
|
u + n
|
|
948
1112
|
// Top-left
|
|
949
1113
|
);
|
|
950
|
-
const h =
|
|
1114
|
+
const h = a * 8;
|
|
951
1115
|
i.push(
|
|
952
1116
|
h,
|
|
953
1117
|
h + 1,
|
|
@@ -958,71 +1122,71 @@ class ho extends g {
|
|
|
958
1122
|
h + 3
|
|
959
1123
|
// Second triangle for landing
|
|
960
1124
|
);
|
|
961
|
-
for (let
|
|
962
|
-
const p =
|
|
963
|
-
for (let y = 0; y <
|
|
964
|
-
const
|
|
1125
|
+
for (let f = 0; f < 2; f++) {
|
|
1126
|
+
const p = f === 0 ? 1 : -1;
|
|
1127
|
+
for (let y = 0; y < r; y++) {
|
|
1128
|
+
const v = l + y * o, M = v + o, x = p * (m / 4), B = u + n, U = y * n * Math.cos(s), G = y * n * Math.sin(s), P = x + p * U - e / 2 * Math.cos(s), O = x + p * U + e / 2 * Math.cos(s), _ = B + G, W = P + p * n * Math.cos(s), X = O + p * n * Math.cos(s), V = _ + n * Math.sin(s);
|
|
965
1129
|
c.push(
|
|
966
1130
|
// Vertical riser
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
1131
|
+
P,
|
|
1132
|
+
v,
|
|
1133
|
+
_,
|
|
970
1134
|
// Bottom-left
|
|
971
|
-
D,
|
|
972
|
-
x,
|
|
973
1135
|
O,
|
|
1136
|
+
v,
|
|
1137
|
+
_,
|
|
974
1138
|
// Bottom-right
|
|
975
|
-
D,
|
|
976
|
-
S,
|
|
977
1139
|
O,
|
|
1140
|
+
M,
|
|
1141
|
+
_,
|
|
978
1142
|
// Top-right
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
1143
|
+
P,
|
|
1144
|
+
M,
|
|
1145
|
+
_,
|
|
982
1146
|
// Top-left
|
|
983
1147
|
// Horizontal tread
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
1148
|
+
P,
|
|
1149
|
+
M,
|
|
1150
|
+
_,
|
|
987
1151
|
// Top-left
|
|
988
|
-
D,
|
|
989
|
-
S,
|
|
990
1152
|
O,
|
|
1153
|
+
M,
|
|
1154
|
+
_,
|
|
991
1155
|
// Top-right
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
1156
|
+
X,
|
|
1157
|
+
M,
|
|
1158
|
+
V,
|
|
995
1159
|
// Back-right
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
1160
|
+
W,
|
|
1161
|
+
M,
|
|
1162
|
+
V
|
|
999
1163
|
// Back-left
|
|
1000
1164
|
);
|
|
1001
|
-
const
|
|
1165
|
+
const T = h + 4 + f * r * 8 + y * 8;
|
|
1002
1166
|
i.push(
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1167
|
+
T,
|
|
1168
|
+
T + 1,
|
|
1169
|
+
T + 2,
|
|
1170
|
+
T,
|
|
1171
|
+
T + 2,
|
|
1172
|
+
T + 3
|
|
1009
1173
|
), i.push(
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1174
|
+
T + 4,
|
|
1175
|
+
T + 5,
|
|
1176
|
+
T + 6,
|
|
1177
|
+
T + 4,
|
|
1178
|
+
T + 6,
|
|
1179
|
+
T + 7
|
|
1016
1180
|
);
|
|
1017
1181
|
}
|
|
1018
1182
|
}
|
|
1019
|
-
this.setIndex(i), this.setAttribute("position", new
|
|
1183
|
+
this.setIndex(i), this.setAttribute("position", new D(c, 3)), this.computeVertexNormals();
|
|
1020
1184
|
}
|
|
1021
1185
|
}
|
|
1022
|
-
class
|
|
1023
|
-
constructor(e = 5, o = 3, n = 5,
|
|
1186
|
+
class lo extends I {
|
|
1187
|
+
constructor(e = 5, o = 3, n = 5, a = 0.2) {
|
|
1024
1188
|
super();
|
|
1025
|
-
const
|
|
1189
|
+
const r = [
|
|
1026
1190
|
// Floor vertices
|
|
1027
1191
|
-e / 2,
|
|
1028
1192
|
0,
|
|
@@ -1097,15 +1261,15 @@ class fo extends g {
|
|
|
1097
1261
|
10,
|
|
1098
1262
|
11
|
|
1099
1263
|
];
|
|
1100
|
-
this.setIndex(s), this.setAttribute("position", new
|
|
1264
|
+
this.setIndex(s), this.setAttribute("position", new D(r, 3)), this.computeVertexNormals();
|
|
1101
1265
|
}
|
|
1102
1266
|
}
|
|
1103
|
-
class
|
|
1104
|
-
constructor(e = 2, o = 0.3, n = 0.5,
|
|
1267
|
+
class uo extends I {
|
|
1268
|
+
constructor(e = 2, o = 0.3, n = 0.5, a = 5, r = 2) {
|
|
1105
1269
|
super();
|
|
1106
1270
|
const s = [], c = [];
|
|
1107
|
-
for (let m = 0; m <
|
|
1108
|
-
const h = m * o,
|
|
1271
|
+
for (let m = 0; m < a; m++) {
|
|
1272
|
+
const h = m * o, f = h + o, p = m * n, y = p + n;
|
|
1109
1273
|
s.push(
|
|
1110
1274
|
// Vertical riser
|
|
1111
1275
|
-e / 2,
|
|
@@ -1117,49 +1281,49 @@ class po extends g {
|
|
|
1117
1281
|
p,
|
|
1118
1282
|
// Bottom-right
|
|
1119
1283
|
e / 2,
|
|
1120
|
-
|
|
1284
|
+
f,
|
|
1121
1285
|
p,
|
|
1122
1286
|
// Top-right
|
|
1123
1287
|
-e / 2,
|
|
1124
|
-
|
|
1288
|
+
f,
|
|
1125
1289
|
p,
|
|
1126
1290
|
// Top-left
|
|
1127
1291
|
// Horizontal tread
|
|
1128
1292
|
-e / 2,
|
|
1129
|
-
|
|
1293
|
+
f,
|
|
1130
1294
|
p,
|
|
1131
1295
|
// Top-left
|
|
1132
1296
|
e / 2,
|
|
1133
|
-
|
|
1297
|
+
f,
|
|
1134
1298
|
p,
|
|
1135
1299
|
// Top-right
|
|
1136
1300
|
e / 2,
|
|
1137
|
-
|
|
1301
|
+
f,
|
|
1138
1302
|
y,
|
|
1139
1303
|
// Back-right
|
|
1140
1304
|
-e / 2,
|
|
1141
|
-
|
|
1305
|
+
f,
|
|
1142
1306
|
y
|
|
1143
1307
|
// Back-left
|
|
1144
1308
|
);
|
|
1145
|
-
const
|
|
1309
|
+
const v = m * 8;
|
|
1146
1310
|
c.push(
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1311
|
+
v,
|
|
1312
|
+
v + 1,
|
|
1313
|
+
v + 2,
|
|
1314
|
+
v,
|
|
1315
|
+
v + 2,
|
|
1316
|
+
v + 3
|
|
1153
1317
|
), c.push(
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1318
|
+
v + 4,
|
|
1319
|
+
v + 5,
|
|
1320
|
+
v + 6,
|
|
1321
|
+
v + 4,
|
|
1322
|
+
v + 6,
|
|
1323
|
+
v + 7
|
|
1160
1324
|
);
|
|
1161
1325
|
}
|
|
1162
|
-
const i =
|
|
1326
|
+
const i = a * o, l = a * n;
|
|
1163
1327
|
s.push(
|
|
1164
1328
|
// Landing platform (4 vertices)
|
|
1165
1329
|
-e / 2,
|
|
@@ -1172,14 +1336,14 @@ class po extends g {
|
|
|
1172
1336
|
// Bottom-right
|
|
1173
1337
|
e / 2,
|
|
1174
1338
|
i,
|
|
1175
|
-
l +
|
|
1339
|
+
l + r,
|
|
1176
1340
|
// Top-right
|
|
1177
1341
|
-e / 2,
|
|
1178
1342
|
i,
|
|
1179
|
-
l +
|
|
1343
|
+
l + r
|
|
1180
1344
|
// Top-left
|
|
1181
1345
|
);
|
|
1182
|
-
const u =
|
|
1346
|
+
const u = a * 8;
|
|
1183
1347
|
c.push(
|
|
1184
1348
|
u,
|
|
1185
1349
|
u + 1,
|
|
@@ -1190,79 +1354,79 @@ class po extends g {
|
|
|
1190
1354
|
u + 3
|
|
1191
1355
|
// Second triangle for landing
|
|
1192
1356
|
);
|
|
1193
|
-
for (let m = 0; m <
|
|
1194
|
-
const h = i + m * o,
|
|
1357
|
+
for (let m = 0; m < a; m++) {
|
|
1358
|
+
const h = i + m * o, f = h + o, p = -e / 2 - m * n, y = p - n;
|
|
1195
1359
|
s.push(
|
|
1196
1360
|
// Vertical riser
|
|
1197
1361
|
p,
|
|
1198
1362
|
h,
|
|
1199
|
-
l +
|
|
1363
|
+
l + r,
|
|
1200
1364
|
// Bottom-left
|
|
1201
1365
|
p,
|
|
1202
1366
|
h,
|
|
1203
|
-
l +
|
|
1367
|
+
l + r - e,
|
|
1204
1368
|
// Bottom-right
|
|
1205
1369
|
p,
|
|
1206
|
-
|
|
1207
|
-
l +
|
|
1370
|
+
f,
|
|
1371
|
+
l + r - e,
|
|
1208
1372
|
// Top-right
|
|
1209
1373
|
p,
|
|
1210
|
-
|
|
1211
|
-
l +
|
|
1374
|
+
f,
|
|
1375
|
+
l + r,
|
|
1212
1376
|
// Top-left
|
|
1213
1377
|
// Horizontal tread
|
|
1214
1378
|
p,
|
|
1215
|
-
|
|
1216
|
-
l +
|
|
1379
|
+
f,
|
|
1380
|
+
l + r,
|
|
1217
1381
|
// Top-left
|
|
1218
1382
|
p,
|
|
1219
|
-
|
|
1220
|
-
l +
|
|
1383
|
+
f,
|
|
1384
|
+
l + r - e,
|
|
1221
1385
|
// Top-right
|
|
1222
1386
|
y,
|
|
1223
|
-
|
|
1224
|
-
l +
|
|
1387
|
+
f,
|
|
1388
|
+
l + r - e,
|
|
1225
1389
|
// Back-right
|
|
1226
1390
|
y,
|
|
1227
|
-
|
|
1228
|
-
l +
|
|
1391
|
+
f,
|
|
1392
|
+
l + r
|
|
1229
1393
|
// Back-left
|
|
1230
1394
|
);
|
|
1231
|
-
const
|
|
1395
|
+
const v = u + 4 + m * 8;
|
|
1232
1396
|
c.push(
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1397
|
+
v,
|
|
1398
|
+
v + 1,
|
|
1399
|
+
v + 2,
|
|
1400
|
+
v,
|
|
1401
|
+
v + 2,
|
|
1402
|
+
v + 3
|
|
1239
1403
|
), c.push(
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1404
|
+
v + 4,
|
|
1405
|
+
v + 5,
|
|
1406
|
+
v + 6,
|
|
1407
|
+
v + 4,
|
|
1408
|
+
v + 6,
|
|
1409
|
+
v + 7
|
|
1246
1410
|
);
|
|
1247
1411
|
}
|
|
1248
|
-
this.setIndex(c), this.setAttribute("position", new
|
|
1412
|
+
this.setIndex(c), this.setAttribute("position", new D(s, 3)), this.computeVertexNormals();
|
|
1249
1413
|
}
|
|
1250
1414
|
}
|
|
1251
|
-
class
|
|
1252
|
-
constructor(e = 1, o = 0.4, n = 0.2,
|
|
1415
|
+
class mo extends I {
|
|
1416
|
+
constructor(e = 1, o = 0.4, n = 0.2, a = 20, r = 2, s = Math.PI / 8) {
|
|
1253
1417
|
super();
|
|
1254
1418
|
const c = [], i = [];
|
|
1255
1419
|
let l = 0;
|
|
1256
|
-
for (let u = 0; u <
|
|
1257
|
-
const m =
|
|
1420
|
+
for (let u = 0; u < a; u++) {
|
|
1421
|
+
const m = r * Math.cos(l), h = r * Math.sin(l), f = u * n, p = f + n;
|
|
1258
1422
|
c.push(
|
|
1259
1423
|
// Front face (vertical riser)
|
|
1260
1424
|
m - e / 2 * Math.cos(l),
|
|
1261
|
-
|
|
1425
|
+
f,
|
|
1262
1426
|
h - e / 2 * Math.sin(l),
|
|
1263
1427
|
// Bottom-left
|
|
1264
1428
|
m + e / 2 * Math.cos(l),
|
|
1265
|
-
|
|
1429
|
+
f,
|
|
1266
1430
|
h + e / 2 * Math.sin(l),
|
|
1267
1431
|
// Bottom-right
|
|
1268
1432
|
m + e / 2 * Math.cos(l),
|
|
@@ -1313,16 +1477,16 @@ class wo extends g {
|
|
|
1313
1477
|
// Second triangle for tread
|
|
1314
1478
|
), l += s;
|
|
1315
1479
|
}
|
|
1316
|
-
this.setIndex(i), this.setAttribute("position", new
|
|
1480
|
+
this.setIndex(i), this.setAttribute("position", new D(c, 3)), this.computeVertexNormals();
|
|
1317
1481
|
}
|
|
1318
1482
|
}
|
|
1319
|
-
class
|
|
1320
|
-
constructor(e = 2, o = 0.3, n = 0.5,
|
|
1483
|
+
class ho extends I {
|
|
1484
|
+
constructor(e = 2, o = 0.3, n = 0.5, a = 10) {
|
|
1321
1485
|
super();
|
|
1322
|
-
const
|
|
1323
|
-
for (let c = 0; c <
|
|
1486
|
+
const r = [], s = [];
|
|
1487
|
+
for (let c = 0; c < a; c++) {
|
|
1324
1488
|
const i = c * o, l = i + o, u = c * n, m = u + n;
|
|
1325
|
-
|
|
1489
|
+
r.push(
|
|
1326
1490
|
// Bottom face of riser (front face)
|
|
1327
1491
|
-e / 2,
|
|
1328
1492
|
i,
|
|
@@ -1379,87 +1543,87 @@ class xo extends g {
|
|
|
1379
1543
|
// Second triangle for tread
|
|
1380
1544
|
);
|
|
1381
1545
|
}
|
|
1382
|
-
this.setIndex(s), this.setAttribute("position", new
|
|
1546
|
+
this.setIndex(s), this.setAttribute("position", new D(r, 3)), this.computeVertexNormals();
|
|
1383
1547
|
}
|
|
1384
1548
|
}
|
|
1385
|
-
class
|
|
1549
|
+
class vt extends I {
|
|
1386
1550
|
constructor(e = 0.4, o = 1.2, n = 0.2) {
|
|
1387
1551
|
super();
|
|
1388
|
-
const
|
|
1389
|
-
|
|
1390
|
-
const s = e * 1.5, c = new
|
|
1391
|
-
c.translate(0,
|
|
1552
|
+
const a = o * 0.6, r = new S(e / 2, a, n);
|
|
1553
|
+
r.translate(0, a / 2, 0);
|
|
1554
|
+
const s = e * 1.5, c = new S(s, e / 4, n);
|
|
1555
|
+
c.translate(0, a * 0.75, 0), this.copy(C([r, c], !1)), this.computeVertexNormals();
|
|
1392
1556
|
}
|
|
1393
1557
|
}
|
|
1394
|
-
class
|
|
1558
|
+
class Mt extends I {
|
|
1395
1559
|
constructor(e = 1.75, o = 0.75) {
|
|
1396
1560
|
super();
|
|
1397
|
-
const n = e * 0.05,
|
|
1561
|
+
const n = e * 0.05, a = e * 0.15, r = e * 0.15, s = e * 0.75;
|
|
1398
1562
|
let c = 0;
|
|
1399
|
-
const i = new
|
|
1563
|
+
const i = new S(o, n, o);
|
|
1400
1564
|
i.translate(0, c + n / 2, 0), c += n;
|
|
1401
|
-
const l = new
|
|
1402
|
-
l.translate(0, c +
|
|
1403
|
-
const u = new
|
|
1404
|
-
u.translate(0, c +
|
|
1405
|
-
const m = new
|
|
1565
|
+
const l = new S(o * 0.8, a, o * 0.8);
|
|
1566
|
+
l.translate(0, c + a / 2, 0), c += a;
|
|
1567
|
+
const u = new S(o * 0.6, r, o * 0.6);
|
|
1568
|
+
u.translate(0, c + r / 2, 0), c += r;
|
|
1569
|
+
const m = new S(o * 0.4, s, o * 0.4);
|
|
1406
1570
|
m.translate(0, c + s / 2, 0), c += s;
|
|
1407
|
-
const h = new
|
|
1408
|
-
h.translate(0, c + 0.1 / 2, 0), this.copy(
|
|
1571
|
+
const h = new Z(o * 0.4 / Math.sqrt(2), 0.1, 4, 1, !1, Math.PI / 4);
|
|
1572
|
+
h.translate(0, c + 0.1 / 2, 0), this.copy(C([i, l, u, m, h], !1)), this.computeVertexNormals();
|
|
1409
1573
|
}
|
|
1410
1574
|
}
|
|
1411
|
-
class
|
|
1412
|
-
constructor(e = 0.6, o = 1, n = 0.2,
|
|
1575
|
+
class xt extends I {
|
|
1576
|
+
constructor(e = 0.6, o = 1, n = 0.2, a = 0.6) {
|
|
1413
1577
|
super();
|
|
1414
|
-
const
|
|
1415
|
-
s.translate(0,
|
|
1416
|
-
const c = new
|
|
1417
|
-
c.rotateY(Math.PI / 2), c.rotateX(Math.PI / 2), c.translate(0,
|
|
1578
|
+
const r = o - a / 2, s = new S(e, r, n);
|
|
1579
|
+
s.translate(0, r / 2, 0);
|
|
1580
|
+
const c = new E(a / 2, a / 2, n, 16, 1, !1, 0, Math.PI);
|
|
1581
|
+
c.rotateY(Math.PI / 2), c.rotateX(Math.PI / 2), c.translate(0, r, 0), this.copy(C([s, c], !1)), this.computeVertexNormals();
|
|
1418
1582
|
}
|
|
1419
1583
|
}
|
|
1420
|
-
class
|
|
1584
|
+
class gt extends I {
|
|
1421
1585
|
constructor(e = 0.5, o = 0.8, n = 0.15) {
|
|
1422
1586
|
super();
|
|
1423
|
-
const
|
|
1424
|
-
|
|
1587
|
+
const a = new S(e, o, n);
|
|
1588
|
+
a.translate(0, o / 2, 0), this.copy(a);
|
|
1425
1589
|
}
|
|
1426
1590
|
}
|
|
1427
|
-
class
|
|
1591
|
+
class bt extends I {
|
|
1428
1592
|
constructor({ height: e = 2.25 } = {}) {
|
|
1429
1593
|
super();
|
|
1430
|
-
const o = new
|
|
1594
|
+
const o = new S(1.2, 0.5, 1.2);
|
|
1431
1595
|
o.translate(0, 0.25, 0);
|
|
1432
|
-
const n = new
|
|
1596
|
+
const n = new S(1, e, 1);
|
|
1433
1597
|
n.translate(0, 0.5 + e / 2, 0);
|
|
1434
|
-
const
|
|
1435
|
-
|
|
1598
|
+
const a = new S(1.4, 0.3, 1.4);
|
|
1599
|
+
a.translate(0, 0.5 + e + 0.15, 0), this.copy(C([o, n, a], !1));
|
|
1436
1600
|
}
|
|
1437
1601
|
}
|
|
1438
|
-
class
|
|
1602
|
+
class de extends I {
|
|
1439
1603
|
constructor({
|
|
1440
1604
|
barHeight: e = 2,
|
|
1441
1605
|
//
|
|
1442
1606
|
barRadius: o = 0.05,
|
|
1443
1607
|
spikeHeight: n = 0.3,
|
|
1444
|
-
spikeRadius:
|
|
1445
|
-
spikeScaleZ:
|
|
1608
|
+
spikeRadius: a = 0.075,
|
|
1609
|
+
spikeScaleZ: r = 1,
|
|
1446
1610
|
radialSegments: s = 8
|
|
1447
1611
|
} = {}) {
|
|
1448
1612
|
super();
|
|
1449
|
-
const c = new
|
|
1613
|
+
const c = new E(o, o, e, s);
|
|
1450
1614
|
c.translate(0, e / 2, 0);
|
|
1451
|
-
const i = new
|
|
1452
|
-
i.translate(0, e + n / 2, 0), i.scale(1, 1,
|
|
1615
|
+
const i = new Z(a, n, s);
|
|
1616
|
+
i.translate(0, e + n / 2, 0), i.scale(1, 1, r), this.copy(C([c, i], !1));
|
|
1453
1617
|
}
|
|
1454
1618
|
}
|
|
1455
|
-
class
|
|
1619
|
+
class St extends I {
|
|
1456
1620
|
constructor({
|
|
1457
1621
|
count: e = 20,
|
|
1458
1622
|
//
|
|
1459
1623
|
spacing: o = 0.4,
|
|
1460
1624
|
barHeight: n = 2,
|
|
1461
|
-
barRadius:
|
|
1462
|
-
spikeHeight:
|
|
1625
|
+
barRadius: a = 0.05,
|
|
1626
|
+
spikeHeight: r = 0.3,
|
|
1463
1627
|
spikeRadius: s = 0.075,
|
|
1464
1628
|
spikeScaleZ: c = 1,
|
|
1465
1629
|
railHeight: i = 0.1,
|
|
@@ -1468,58 +1632,58 @@ class It extends g {
|
|
|
1468
1632
|
radialSegments: m = 8
|
|
1469
1633
|
} = {}) {
|
|
1470
1634
|
super();
|
|
1471
|
-
const h = [],
|
|
1472
|
-
for (let
|
|
1473
|
-
const
|
|
1474
|
-
|
|
1635
|
+
const h = [], f = new de({ barHeight: n, barRadius: a, spikeHeight: r, spikeRadius: s, spikeScaleZ: c, radialSegments: m }), p = new S(e * o, i, l);
|
|
1636
|
+
for (let M = 0; M < e; M++) {
|
|
1637
|
+
const x = f.clone();
|
|
1638
|
+
x.translate(M * o, 0, 0), h.push(x);
|
|
1475
1639
|
}
|
|
1476
1640
|
const y = p.clone();
|
|
1477
1641
|
y.translate(o * (e - 1) / 2, n - u - i / 2, 0), h.push(y);
|
|
1478
|
-
const
|
|
1479
|
-
|
|
1642
|
+
const v = p.clone();
|
|
1643
|
+
v.translate(o * (e - 1) / 2, i / 2, 0), h.push(v), this.copy(C(h));
|
|
1480
1644
|
}
|
|
1481
1645
|
}
|
|
1482
|
-
class
|
|
1646
|
+
class It extends I {
|
|
1483
1647
|
constructor({
|
|
1484
1648
|
width: e = 5,
|
|
1485
1649
|
//
|
|
1486
1650
|
height: o = 8,
|
|
1487
1651
|
depth: n = 1,
|
|
1488
|
-
shelves:
|
|
1489
|
-
frameThickness:
|
|
1652
|
+
shelves: a = 4,
|
|
1653
|
+
frameThickness: r = 0.1,
|
|
1490
1654
|
open: s = !1
|
|
1491
1655
|
} = {}) {
|
|
1492
1656
|
super();
|
|
1493
|
-
const c = o, i = e, l = n, u = new
|
|
1494
|
-
h.translate(-i / 2 +
|
|
1495
|
-
const
|
|
1496
|
-
|
|
1657
|
+
const c = o, i = e, l = n, u = new S(r, c, l), m = new S(i - 2 * r, r, l), h = u.clone();
|
|
1658
|
+
h.translate(-i / 2 + r / 2, c / 2, 0);
|
|
1659
|
+
const f = u.clone();
|
|
1660
|
+
f.translate(i / 2 - r / 2, c / 2, 0);
|
|
1497
1661
|
const p = m.clone();
|
|
1498
|
-
p.translate(0, c -
|
|
1662
|
+
p.translate(0, c - r / 2, 0);
|
|
1499
1663
|
const y = m.clone();
|
|
1500
|
-
y.translate(0,
|
|
1501
|
-
const
|
|
1502
|
-
|
|
1503
|
-
const
|
|
1504
|
-
for (let
|
|
1505
|
-
const
|
|
1506
|
-
|
|
1664
|
+
y.translate(0, r / 2, 0);
|
|
1665
|
+
const v = new S(i, c, r);
|
|
1666
|
+
v.translate(0, c / 2, -l / 2 + r / 2);
|
|
1667
|
+
const M = [], x = (c - r) / (a + 1);
|
|
1668
|
+
for (let B = 1; B <= a; B++) {
|
|
1669
|
+
const U = m.clone();
|
|
1670
|
+
U.translate(0, r / 2 + B * x, 0), M.push(U);
|
|
1507
1671
|
}
|
|
1508
|
-
this.copy(
|
|
1672
|
+
this.copy(C([
|
|
1509
1673
|
h,
|
|
1510
1674
|
//
|
|
1511
|
-
|
|
1675
|
+
f,
|
|
1512
1676
|
p,
|
|
1513
1677
|
y,
|
|
1514
|
-
...s ? [] : [
|
|
1515
|
-
...
|
|
1678
|
+
...s ? [] : [v],
|
|
1679
|
+
...M
|
|
1516
1680
|
], !1));
|
|
1517
1681
|
}
|
|
1518
1682
|
}
|
|
1519
|
-
class
|
|
1683
|
+
class fo extends I {
|
|
1520
1684
|
constructor(e = 0.1) {
|
|
1521
1685
|
super();
|
|
1522
|
-
const o = [], n = [],
|
|
1686
|
+
const o = [], n = [], a = [
|
|
1523
1687
|
[0, 1],
|
|
1524
1688
|
// Top point
|
|
1525
1689
|
[0.5, 0.75],
|
|
@@ -1537,198 +1701,198 @@ class yo extends g {
|
|
|
1537
1701
|
[-0.5, 0.75]
|
|
1538
1702
|
// Left upper middle
|
|
1539
1703
|
];
|
|
1540
|
-
for (let s = 0; s <
|
|
1541
|
-
const [c, i] =
|
|
1704
|
+
for (let s = 0; s < a.length; s++) {
|
|
1705
|
+
const [c, i] = a[s];
|
|
1542
1706
|
o.push(c * e, i * e, 0);
|
|
1543
1707
|
}
|
|
1544
|
-
for (let s = 1; s <
|
|
1708
|
+
for (let s = 1; s < a.length - 1; s++)
|
|
1545
1709
|
n.push(0, s, s + 1);
|
|
1546
|
-
n.push(0,
|
|
1547
|
-
const
|
|
1548
|
-
this.setAttribute("position",
|
|
1710
|
+
n.push(0, a.length - 1, 1);
|
|
1711
|
+
const r = new D(o, 3);
|
|
1712
|
+
this.setAttribute("position", r), this.setIndex(n), this.computeVertexNormals();
|
|
1549
1713
|
}
|
|
1550
1714
|
}
|
|
1551
|
-
function
|
|
1552
|
-
t.deleteAttribute("uv"), t.deleteAttribute("normal"), t =
|
|
1553
|
-
const
|
|
1554
|
-
for (let
|
|
1555
|
-
const s = new
|
|
1556
|
-
s.add(i),
|
|
1715
|
+
function Et(t, e = L.XYZ, o = 0.5, n = 2) {
|
|
1716
|
+
t.deleteAttribute("uv"), t.deleteAttribute("normal"), t = pt(t), t.computeVertexNormals();
|
|
1717
|
+
const a = t.getAttribute("position");
|
|
1718
|
+
for (let r = 0; r < a.count; r++) {
|
|
1719
|
+
const s = new g().fromBufferAttribute(a, r), c = Math.random() * (n - o) + o, i = e.clone().multiplyScalar(c);
|
|
1720
|
+
s.add(i), a.setXYZ(r, s.x, s.y, s.z);
|
|
1557
1721
|
}
|
|
1558
|
-
return
|
|
1722
|
+
return a.needsUpdate = !0, t.computeVertexNormals(), t;
|
|
1559
1723
|
}
|
|
1560
|
-
class
|
|
1724
|
+
class At extends I {
|
|
1561
1725
|
constructor(e = 1, o = 4, n = 4) {
|
|
1562
1726
|
super();
|
|
1563
|
-
const
|
|
1564
|
-
this.copy(
|
|
1727
|
+
const a = new z(e, o, n);
|
|
1728
|
+
this.copy(Et(a, L.XYZ, 0.5, 1)), this.computeVertexNormals(), this.center();
|
|
1565
1729
|
}
|
|
1566
1730
|
}
|
|
1567
|
-
class
|
|
1568
|
-
constructor(e = 0.1, o = 0.1, n = 0.4,
|
|
1731
|
+
class Gt extends I {
|
|
1732
|
+
constructor(e = 0.1, o = 0.1, n = 0.4, a = 8) {
|
|
1569
1733
|
super();
|
|
1570
|
-
const
|
|
1571
|
-
|
|
1572
|
-
const s = new
|
|
1573
|
-
c.translate(0, n / 2 + e * 0.6, -e * 0.6), i.translate(0, n / 2 + e * 0.6, e * 0.6), l.translate(0, -n / 2 - o * 0.6, -o * 0.6), u.translate(0, -n / 2 - o * 0.6, o * 0.6), this.copy(
|
|
1734
|
+
const r = new E(e * 0.6, o * 0.6, n, a);
|
|
1735
|
+
r.translate(0, 0, 0);
|
|
1736
|
+
const s = new z(e, a, a), c = s.clone(), i = s.clone(), l = s.clone(), u = s.clone();
|
|
1737
|
+
c.translate(0, n / 2 + e * 0.6, -e * 0.6), i.translate(0, n / 2 + e * 0.6, e * 0.6), l.translate(0, -n / 2 - o * 0.6, -o * 0.6), u.translate(0, -n / 2 - o * 0.6, o * 0.6), this.copy(C([r, c, i, l, u], !1));
|
|
1574
1738
|
}
|
|
1575
1739
|
}
|
|
1576
|
-
class
|
|
1740
|
+
class Pt extends I {
|
|
1577
1741
|
constructor() {
|
|
1578
1742
|
super();
|
|
1579
|
-
const e = new
|
|
1580
|
-
o.translate(0, 1.5, 0), o.rotateX(Math.PI / 2), this.copy(
|
|
1743
|
+
const e = new z(1, 16, 16), o = new E(0.2, 0.2, 2, 16, 1, !0);
|
|
1744
|
+
o.translate(0, 1.5, 0), o.rotateX(Math.PI / 2), this.copy(C([e, o], !1));
|
|
1581
1745
|
}
|
|
1582
1746
|
}
|
|
1583
|
-
class
|
|
1747
|
+
class Tt extends I {
|
|
1584
1748
|
constructor({
|
|
1585
1749
|
flaskRadius: e = 1,
|
|
1586
1750
|
//
|
|
1587
1751
|
neckRadius: o = 0.3,
|
|
1588
1752
|
height: n = 2.5,
|
|
1589
|
-
neckHeight:
|
|
1590
|
-
radialSegments:
|
|
1753
|
+
neckHeight: a = 1,
|
|
1754
|
+
radialSegments: r = 16
|
|
1591
1755
|
} = {}) {
|
|
1592
1756
|
super();
|
|
1593
1757
|
const s = [
|
|
1594
|
-
new
|
|
1758
|
+
new b(0, 0),
|
|
1595
1759
|
// Bottom of the flask
|
|
1596
|
-
new
|
|
1760
|
+
new b(e * 0.875, 0),
|
|
1597
1761
|
// Flat base with minimum width
|
|
1598
|
-
new
|
|
1762
|
+
new b(e, 0.1),
|
|
1599
1763
|
// End of the rounded base
|
|
1600
|
-
new
|
|
1764
|
+
new b(o, n),
|
|
1601
1765
|
// Start of the straight neck
|
|
1602
|
-
new
|
|
1766
|
+
new b(o, n + a),
|
|
1603
1767
|
// End of the straight neck
|
|
1604
|
-
new
|
|
1768
|
+
new b(o * 1.1, n + a + 0.3)
|
|
1605
1769
|
// Slight outward lip at the top
|
|
1606
|
-
], c = new
|
|
1607
|
-
this.copy(
|
|
1770
|
+
], c = new H(s, r);
|
|
1771
|
+
this.copy(C([c], !1));
|
|
1608
1772
|
}
|
|
1609
1773
|
}
|
|
1610
|
-
class Ct extends
|
|
1774
|
+
class Ct extends I {
|
|
1611
1775
|
constructor() {
|
|
1612
1776
|
super();
|
|
1613
1777
|
const e = [
|
|
1614
|
-
new
|
|
1778
|
+
new b(1, 0),
|
|
1615
1779
|
// Bottom of the bowl
|
|
1616
|
-
new
|
|
1780
|
+
new b(1.2, 0.5),
|
|
1617
1781
|
// Slight flare at the base
|
|
1618
|
-
new
|
|
1782
|
+
new b(1.4, 1.5),
|
|
1619
1783
|
// Outer wall
|
|
1620
|
-
new
|
|
1784
|
+
new b(1.3, 1.8),
|
|
1621
1785
|
// Flared edge
|
|
1622
|
-
new
|
|
1786
|
+
new b(0.8, 1.8)
|
|
1623
1787
|
// Lip of the bowl
|
|
1624
|
-
], o = new
|
|
1625
|
-
n.rotateX(-Math.PI / 2), n.translate(0, 0, 0), this.copy(
|
|
1788
|
+
], o = new H(e, 12), n = new be(1, 12);
|
|
1789
|
+
n.rotateX(-Math.PI / 2), n.translate(0, 0, 0), this.copy(C([o, n], !1));
|
|
1626
1790
|
}
|
|
1627
1791
|
}
|
|
1628
|
-
class
|
|
1792
|
+
class Bt extends I {
|
|
1629
1793
|
constructor({
|
|
1630
1794
|
radius: e = 0.3,
|
|
1631
1795
|
//
|
|
1632
1796
|
height: o = 0.4,
|
|
1633
1797
|
count: n = 3,
|
|
1634
|
-
thickness:
|
|
1635
|
-
radialSegments:
|
|
1798
|
+
thickness: a = 0.03,
|
|
1799
|
+
radialSegments: r = 16
|
|
1636
1800
|
} = {}) {
|
|
1637
1801
|
super();
|
|
1638
|
-
const s = new
|
|
1802
|
+
const s = new ue(e, a, 8, r);
|
|
1639
1803
|
s.rotateX(Math.PI / 2), s.translate(0, o, 0);
|
|
1640
|
-
const c = new
|
|
1804
|
+
const c = new E(a * 0.6, a * 0.6, o, r), i = [];
|
|
1641
1805
|
for (let l = 0; l < n; l++) {
|
|
1642
1806
|
const u = l / n * Math.PI * 2, m = c.clone();
|
|
1643
1807
|
m.translate(Math.cos(u) * e, o / 2, Math.sin(u) * e), i.push(m);
|
|
1644
1808
|
}
|
|
1645
|
-
this.copy(
|
|
1809
|
+
this.copy(C([s, ...i], !1));
|
|
1646
1810
|
}
|
|
1647
1811
|
}
|
|
1648
|
-
class
|
|
1649
|
-
constructor(e = 0.2, o = 0.2, n = 3,
|
|
1812
|
+
class ne extends I {
|
|
1813
|
+
constructor(e = 0.2, o = 0.2, n = 3, a = 32, r = !0) {
|
|
1650
1814
|
super();
|
|
1651
|
-
const s = new
|
|
1652
|
-
c.translate(0, -(n / 2), 0), this.copy(
|
|
1815
|
+
const s = new E(e, o, n, a, 1, r), c = new z(o, a, a / 2, 0, Math.PI * 2, Math.PI / 2, Math.PI / 2);
|
|
1816
|
+
c.translate(0, -(n / 2), 0), this.copy(C([s, c], !1));
|
|
1653
1817
|
}
|
|
1654
1818
|
}
|
|
1655
|
-
class
|
|
1656
|
-
constructor({ radius: e = 0.5, neckRadius: o = 0.2, height: n = 3, neckHeight:
|
|
1819
|
+
class Ut extends I {
|
|
1820
|
+
constructor({ radius: e = 0.5, neckRadius: o = 0.2, height: n = 3, neckHeight: a = 1, segments: r = 16 } = {}) {
|
|
1657
1821
|
super();
|
|
1658
|
-
const s = n -
|
|
1822
|
+
const s = n - a, c = new E(e, e, s, r);
|
|
1659
1823
|
c.translate(0, s / 2, 0);
|
|
1660
|
-
const i = 0.3, l = new
|
|
1824
|
+
const i = 0.3, l = new E(o, e, i, r);
|
|
1661
1825
|
l.translate(0, s + i / 2, 0);
|
|
1662
|
-
const u = new
|
|
1663
|
-
u.translate(0, s + i +
|
|
1826
|
+
const u = new E(o, o, a, r);
|
|
1827
|
+
u.translate(0, s + i + a / 2, 0), this.copy(C([c, l, u], !1));
|
|
1664
1828
|
}
|
|
1665
1829
|
}
|
|
1666
|
-
class
|
|
1830
|
+
class Nt extends I {
|
|
1667
1831
|
constructor({
|
|
1668
1832
|
radius: e = 3,
|
|
1669
1833
|
//
|
|
1670
1834
|
height: o = 0.6,
|
|
1671
1835
|
widthSegments: n = 64,
|
|
1672
|
-
heightSegments:
|
|
1673
|
-
phiStart:
|
|
1836
|
+
heightSegments: a = 16,
|
|
1837
|
+
phiStart: r = 0,
|
|
1674
1838
|
phiLength: s = Math.PI * 2
|
|
1675
1839
|
} = {}) {
|
|
1676
|
-
super(), this.copy(new
|
|
1840
|
+
super(), this.copy(new z(e, n, a, r, s, 0, Math.PI / 2)), this.scale(1, o / e, 1);
|
|
1677
1841
|
}
|
|
1678
1842
|
}
|
|
1679
|
-
const
|
|
1843
|
+
const po = (t, e) => t / (1 - Math.cos(e)), ye = (t, e) => t / (2 * Math.sin(e)), Ot = (t, e) => t * (1 - Math.cos(e)), yo = (t, e) => 2 * t * Math.sin(e), wo = (t, e, o) => ({
|
|
1680
1844
|
x: t * Math.sin(o) * Math.cos(e),
|
|
1681
1845
|
y: t * Math.sin(o) * Math.sin(e),
|
|
1682
1846
|
z: t * Math.cos(o)
|
|
1683
|
-
}),
|
|
1684
|
-
const n = Math.sqrt(t * t + e * e + o * o),
|
|
1685
|
-
return { radius: n, theta:
|
|
1847
|
+
}), vo = (t, e, o) => {
|
|
1848
|
+
const n = Math.sqrt(t * t + e * e + o * o), a = Math.atan2(e, t), r = Math.acos(o / n);
|
|
1849
|
+
return { radius: n, theta: a, phi: r };
|
|
1686
1850
|
};
|
|
1687
|
-
class
|
|
1851
|
+
class zt extends I {
|
|
1688
1852
|
constructor({
|
|
1689
|
-
radius: e =
|
|
1853
|
+
radius: e = ye(5, Math.PI / 10),
|
|
1690
1854
|
//
|
|
1691
1855
|
widthSegments: o = 64,
|
|
1692
1856
|
heightSegments: n = 32,
|
|
1693
|
-
phiStart:
|
|
1694
|
-
phiLength:
|
|
1857
|
+
phiStart: a = 0,
|
|
1858
|
+
phiLength: r = Math.PI * 2,
|
|
1695
1859
|
thetaLength: s = Math.PI / 10
|
|
1696
1860
|
} = {}) {
|
|
1697
|
-
super(), this.copy(new
|
|
1698
|
-
const c =
|
|
1861
|
+
super(), this.copy(new z(e, o, n, a, r, 0, s));
|
|
1862
|
+
const c = Ot(e, s);
|
|
1699
1863
|
this.translate(0, -e + c, 0);
|
|
1700
1864
|
}
|
|
1701
1865
|
}
|
|
1702
|
-
class
|
|
1866
|
+
class _t extends I {
|
|
1703
1867
|
constructor({
|
|
1704
1868
|
trunkRadiusTop: e = 0.25,
|
|
1705
1869
|
trunkRadiusBottom: o = 0.4,
|
|
1706
1870
|
trunkHeight: n = 2.5,
|
|
1707
|
-
trunkSegments:
|
|
1708
|
-
leafSize:
|
|
1871
|
+
trunkSegments: a = 14,
|
|
1872
|
+
leafSize: r = 0.8,
|
|
1709
1873
|
leafCount: s = 6,
|
|
1710
1874
|
leafDetail: c = 0,
|
|
1711
1875
|
leafSpreadRadius: i = 1.5
|
|
1712
1876
|
} = {}) {
|
|
1713
1877
|
super();
|
|
1714
|
-
const l = new
|
|
1878
|
+
const l = new E(e, o, n, a);
|
|
1715
1879
|
l.translate(0, n / 2, 0);
|
|
1716
1880
|
const u = [];
|
|
1717
1881
|
for (let m = 0; m < s; m++) {
|
|
1718
|
-
const h = new
|
|
1882
|
+
const h = new se(r, c);
|
|
1719
1883
|
h.translate(
|
|
1720
1884
|
(Math.random() - 0.5) * i,
|
|
1721
|
-
(Math.random() - 0.5) *
|
|
1885
|
+
(Math.random() - 0.5) * r + n,
|
|
1722
1886
|
(Math.random() - 0.5) * i
|
|
1723
1887
|
), u.push(h);
|
|
1724
1888
|
}
|
|
1725
|
-
this.copy(
|
|
1889
|
+
this.copy(C([l.toNonIndexed(), C(u, !1)], !0)), this.computeVertexNormals();
|
|
1726
1890
|
}
|
|
1727
1891
|
}
|
|
1728
|
-
class
|
|
1892
|
+
class Mo extends A {
|
|
1729
1893
|
constructor() {
|
|
1730
1894
|
super();
|
|
1731
|
-
const e = new
|
|
1895
|
+
const e = new z(5, 32, 32), o = new $({
|
|
1732
1896
|
uniforms: {
|
|
1733
1897
|
time: { value: 0 }
|
|
1734
1898
|
},
|
|
@@ -1771,107 +1935,113 @@ class bo extends P {
|
|
|
1771
1935
|
gl_FragColor = vec4(color, 1.0);
|
|
1772
1936
|
}
|
|
1773
1937
|
`
|
|
1774
|
-
}), n = new
|
|
1938
|
+
}), n = new d(e, o);
|
|
1775
1939
|
this.add(n);
|
|
1776
1940
|
}
|
|
1777
1941
|
}
|
|
1778
|
-
class
|
|
1942
|
+
class xo extends d {
|
|
1779
1943
|
constructor({
|
|
1780
1944
|
width: e = 1,
|
|
1781
1945
|
height: o = 1.5,
|
|
1782
1946
|
depth: n = 0.5,
|
|
1783
|
-
coverThickness:
|
|
1784
|
-
pageIndent:
|
|
1947
|
+
coverThickness: a = 0.05,
|
|
1948
|
+
pageIndent: r = 0.05,
|
|
1785
1949
|
coverColor: s = 9109504,
|
|
1786
1950
|
pageColor: c = 16777215
|
|
1787
1951
|
} = {}) {
|
|
1788
|
-
super(), this.geometry = new
|
|
1952
|
+
super(), this.geometry = new he(e, o, n, a, r), this.material = [
|
|
1789
1953
|
new w({ color: s, metalness: 0.1, roughness: 0.7, flatShading: !0 }),
|
|
1790
1954
|
new w({ color: c, flatShading: !0 })
|
|
1791
1955
|
];
|
|
1792
1956
|
}
|
|
1793
1957
|
}
|
|
1794
|
-
class
|
|
1795
|
-
constructor(
|
|
1796
|
-
|
|
1958
|
+
class go extends d {
|
|
1959
|
+
constructor({
|
|
1960
|
+
width: e = 0.4,
|
|
1961
|
+
height: o = 1.2,
|
|
1962
|
+
depth: n = 0.2,
|
|
1963
|
+
material: a = new w({ color: 7829367, roughness: 0.8 })
|
|
1964
|
+
} = {}) {
|
|
1965
|
+
const r = new vt(e, o, n);
|
|
1966
|
+
super(r, a);
|
|
1797
1967
|
}
|
|
1798
1968
|
}
|
|
1799
|
-
class
|
|
1969
|
+
class bo extends A {
|
|
1800
1970
|
constructor() {
|
|
1801
1971
|
super();
|
|
1802
|
-
const e = new
|
|
1972
|
+
const e = new S(5, 1, 5), o = new w({ color: 8421504, flatShading: !0 }), n = new d(e, o);
|
|
1803
1973
|
n.position.set(0, 0.5, 0), this.add(n);
|
|
1804
|
-
const
|
|
1974
|
+
const a = new S(4, 3, 4), r = new w({ color: 6908265, flatShading: !0 }), s = new d(a, r);
|
|
1805
1975
|
s.position.set(0, 2.5, 0), this.add(s);
|
|
1806
|
-
const c = new
|
|
1976
|
+
const c = new Z(3.5, 2, 4), i = new w({ color: 5263440, flatShading: !0 }), l = new d(c, i);
|
|
1807
1977
|
l.rotation.y = Math.PI / 4, l.position.set(0, 5, 0), this.add(l);
|
|
1808
|
-
const u = new
|
|
1978
|
+
const u = new E(0.2, 0.2, 3.5, 16), m = new w({ color: 6908265, flatShading: !0 });
|
|
1809
1979
|
[
|
|
1810
1980
|
[-1.8, 2.3, -2.2],
|
|
1811
1981
|
[1.8, 2.3, -2.2],
|
|
1812
1982
|
[-1.8, 2.3, 2.2],
|
|
1813
1983
|
[1.8, 2.3, 2.2]
|
|
1814
|
-
].forEach((
|
|
1815
|
-
const
|
|
1816
|
-
|
|
1984
|
+
].forEach((x) => {
|
|
1985
|
+
const B = new d(u, m);
|
|
1986
|
+
B.position.set(x[0], x[1], x[2]), this.add(B);
|
|
1817
1987
|
});
|
|
1818
|
-
const
|
|
1819
|
-
|
|
1988
|
+
const f = new Y();
|
|
1989
|
+
f.moveTo(-1, 0), f.lineTo(-1, 2), f.absarc(0, 2, 1, Math.PI, 0, !0), f.lineTo(1, 0);
|
|
1820
1990
|
const p = {
|
|
1821
1991
|
depth: 0.5,
|
|
1822
1992
|
bevelEnabled: !1
|
|
1823
|
-
}, y = new
|
|
1824
|
-
|
|
1993
|
+
}, y = new j(f, p), v = new w({ color: 4210752, flatShading: !0 }), M = new d(y, v);
|
|
1994
|
+
M.position.set(0, 0.5, 1.7), this.add(M);
|
|
1825
1995
|
}
|
|
1826
1996
|
}
|
|
1827
|
-
class
|
|
1828
|
-
constructor(e = 1.75, o = 0.75) {
|
|
1829
|
-
super(), this.geometry = new
|
|
1997
|
+
class So extends d {
|
|
1998
|
+
constructor({ totalHeight: e = 1.75, baseWidth: o = 0.75 } = {}) {
|
|
1999
|
+
super(), this.geometry = new Mt(e, o), this.material = new w({ color: 7829367, roughness: 0.8 });
|
|
1830
2000
|
}
|
|
1831
2001
|
}
|
|
1832
|
-
class
|
|
1833
|
-
constructor(e = 0.6, o = 1, n = 0.2,
|
|
1834
|
-
super(), this.geometry = new
|
|
2002
|
+
class Io extends d {
|
|
2003
|
+
constructor(e = 0.6, o = 1, n = 0.2, a = 0.6) {
|
|
2004
|
+
super(), this.geometry = new xt(e, o, n, a), this.material = new w({ color: 7829367, roughness: 0.8 });
|
|
1835
2005
|
}
|
|
1836
2006
|
}
|
|
1837
|
-
class
|
|
2007
|
+
class Eo extends d {
|
|
1838
2008
|
constructor(e = 0.5, o = 0.8, n = 0.15) {
|
|
1839
|
-
super(), this.geometry = new
|
|
2009
|
+
super(), this.geometry = new gt(e, o, n), this.material = new w({ color: 7829367, roughness: 0.8 });
|
|
1840
2010
|
}
|
|
1841
2011
|
}
|
|
1842
|
-
class
|
|
2012
|
+
class Ao extends d {
|
|
1843
2013
|
constructor({ height: e = 2.25 } = {}) {
|
|
1844
|
-
super(), this.geometry = new
|
|
2014
|
+
super(), this.geometry = new bt({ height: e }), this.material = new w({ color: 9141627, flatShading: !0 });
|
|
1845
2015
|
}
|
|
1846
2016
|
}
|
|
1847
|
-
class
|
|
2017
|
+
class Go extends d {
|
|
1848
2018
|
constructor({
|
|
1849
2019
|
barHeight: e = 2,
|
|
1850
2020
|
//
|
|
1851
2021
|
barRadius: o = 0.05,
|
|
1852
2022
|
spikeHeight: n = 0.3,
|
|
1853
|
-
spikeRadius:
|
|
1854
|
-
spikeScaleZ:
|
|
2023
|
+
spikeRadius: a = 0.075,
|
|
2024
|
+
spikeScaleZ: r = 1,
|
|
1855
2025
|
radialSegments: s = 8
|
|
1856
2026
|
} = {}) {
|
|
1857
|
-
super(), this.geometry = new
|
|
2027
|
+
super(), this.geometry = new de({
|
|
1858
2028
|
barHeight: e,
|
|
1859
2029
|
barRadius: o,
|
|
1860
2030
|
spikeHeight: n,
|
|
1861
|
-
spikeRadius:
|
|
1862
|
-
spikeScaleZ:
|
|
2031
|
+
spikeRadius: a,
|
|
2032
|
+
spikeScaleZ: r,
|
|
1863
2033
|
radialSegments: s
|
|
1864
2034
|
}), this.material = new w({ color: 3355443, metalness: 0.8, roughness: 0.4 });
|
|
1865
2035
|
}
|
|
1866
2036
|
}
|
|
1867
|
-
class
|
|
2037
|
+
class Po extends d {
|
|
1868
2038
|
constructor({
|
|
1869
2039
|
count: e = 20,
|
|
1870
2040
|
//
|
|
1871
2041
|
spacing: o = 0.4,
|
|
1872
2042
|
barHeight: n = 2,
|
|
1873
|
-
barRadius:
|
|
1874
|
-
spikeHeight:
|
|
2043
|
+
barRadius: a = 0.05,
|
|
2044
|
+
spikeHeight: r = 0.3,
|
|
1875
2045
|
spikeRadius: s = 0.075,
|
|
1876
2046
|
spikeScaleZ: c = 1,
|
|
1877
2047
|
railHeight: i = 0.1,
|
|
@@ -1879,12 +2049,12 @@ class ko extends f {
|
|
|
1879
2049
|
railOffset: u = 0,
|
|
1880
2050
|
radialSegments: m = 8
|
|
1881
2051
|
} = {}) {
|
|
1882
|
-
super(), this.geometry = new
|
|
2052
|
+
super(), this.geometry = new St({
|
|
1883
2053
|
count: e,
|
|
1884
2054
|
spacing: o,
|
|
1885
2055
|
barHeight: n,
|
|
1886
|
-
barRadius:
|
|
1887
|
-
spikeHeight:
|
|
2056
|
+
barRadius: a,
|
|
2057
|
+
spikeHeight: r,
|
|
1888
2058
|
spikeRadius: s,
|
|
1889
2059
|
spikeScaleZ: c,
|
|
1890
2060
|
railHeight: i,
|
|
@@ -1894,27 +2064,27 @@ class ko extends f {
|
|
|
1894
2064
|
}), this.material = new w({ color: 3355443, metalness: 0.8, roughness: 0.4 });
|
|
1895
2065
|
}
|
|
1896
2066
|
}
|
|
1897
|
-
class
|
|
2067
|
+
class To extends d {
|
|
1898
2068
|
constructor({
|
|
1899
2069
|
width: e = 5,
|
|
1900
2070
|
//
|
|
1901
2071
|
height: o = 8,
|
|
1902
2072
|
depth: n = 1,
|
|
1903
|
-
shelves:
|
|
1904
|
-
frameThickness:
|
|
2073
|
+
shelves: a = 4,
|
|
2074
|
+
frameThickness: r = 0.1,
|
|
1905
2075
|
open: s = !1
|
|
1906
2076
|
} = {}) {
|
|
1907
|
-
super(), this.geometry = new
|
|
2077
|
+
super(), this.geometry = new It({ width: e, height: o, depth: n, shelves: a, frameThickness: r, open: s }), this.material = new w({ color: 9127187 });
|
|
1908
2078
|
}
|
|
1909
2079
|
}
|
|
1910
|
-
class
|
|
2080
|
+
class Co extends A {
|
|
1911
2081
|
constructor() {
|
|
1912
2082
|
super();
|
|
1913
|
-
const e = new
|
|
2083
|
+
const e = new S(5, 0.3, 3), o = new w({ color: 9132587 }), n = new d(e, o);
|
|
1914
2084
|
n.position.set(0, 3.15, 0);
|
|
1915
|
-
const
|
|
1916
|
-
|
|
1917
|
-
const
|
|
2085
|
+
const a = [];
|
|
2086
|
+
a.push(new b(0.2, 0)), a.push(new b(0.25, 0.5)), a.push(new b(0.15, 1.5)), a.push(new b(0.3, 3));
|
|
2087
|
+
const r = new H(a, 32), s = new w({ color: 4929057 });
|
|
1918
2088
|
[
|
|
1919
2089
|
[2.2, 0, 1.2],
|
|
1920
2090
|
// Adjust Y to 0 so legs start at ground level
|
|
@@ -1922,74 +2092,78 @@ class Uo extends P {
|
|
|
1922
2092
|
[2.2, 0, -1.2],
|
|
1923
2093
|
[-2.2, 0, -1.2]
|
|
1924
2094
|
].forEach((i) => {
|
|
1925
|
-
const l = new
|
|
1926
|
-
l.position.set(
|
|
2095
|
+
const l = new d(r, s);
|
|
2096
|
+
l.position.set(i[0], i[1], i[2]), this.add(l);
|
|
1927
2097
|
}), this.add(n);
|
|
1928
2098
|
}
|
|
1929
2099
|
}
|
|
1930
|
-
class
|
|
1931
|
-
constructor(
|
|
1932
|
-
super()
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
this.
|
|
2100
|
+
class Bo extends A {
|
|
2101
|
+
constructor(o = 1, n = 0.2) {
|
|
2102
|
+
super();
|
|
2103
|
+
N(this, "candle");
|
|
2104
|
+
N(this, "flame");
|
|
2105
|
+
N(this, "candleLight");
|
|
2106
|
+
N(this, "height");
|
|
2107
|
+
N(this, "radius");
|
|
2108
|
+
this.height = o, this.radius = n;
|
|
2109
|
+
const a = new E(this.radius, this.radius, this.height, 32), r = new w({ color: 16777215 });
|
|
2110
|
+
this.candle = new d(a, r), this.candle.position.set(0, this.height / 2, 0), this.add(this.candle);
|
|
2111
|
+
const s = new z(0.05, 16, 16), c = new Se({ color: 16753920 });
|
|
2112
|
+
this.flame = new d(s, c), this.flame.position.set(0, this.height + 0.05, 0), this.add(this.flame), this.candleLight = new me(16753920, 1, 5), this.candleLight.position.set(0, this.height + 0.05, 0), this.candleLight.castShadow = !0, this.add(this.candleLight), this.animateFlicker();
|
|
1939
2113
|
}
|
|
1940
2114
|
animateFlicker() {
|
|
1941
|
-
const
|
|
1942
|
-
this.candleLight.intensity = 1 + (Math.random() * 0.4 - 0.2), this.candleLight.position.x = Math.random() * 0.02 - 0.01, this.candleLight.position.z = Math.random() * 0.02 - 0.01, requestAnimationFrame(
|
|
2115
|
+
const o = () => {
|
|
2116
|
+
this.candleLight.intensity = 1 + (Math.random() * 0.4 - 0.2), this.candleLight.position.x = Math.random() * 0.02 - 0.01, this.candleLight.position.z = Math.random() * 0.02 - 0.01, requestAnimationFrame(o);
|
|
1943
2117
|
};
|
|
1944
|
-
|
|
2118
|
+
o();
|
|
1945
2119
|
}
|
|
1946
2120
|
}
|
|
1947
|
-
class
|
|
2121
|
+
class Uo extends A {
|
|
1948
2122
|
constructor(e = 1.3, o = 0.5) {
|
|
1949
2123
|
super();
|
|
1950
|
-
const n = new
|
|
1951
|
-
|
|
1952
|
-
const s = new
|
|
2124
|
+
const n = new E(o, o, 0.2, 16), a = new w({ color: 9127187, flatShading: !0 }), r = new d(n, a);
|
|
2125
|
+
r.position.set(0, 0, 0), this.add(r);
|
|
2126
|
+
const s = new E(o * 0.9, o * 0.9, e), c = new w({ color: 16766720, flatShading: !0, transparent: !0, opacity: 0.6 }), i = new d(s, c);
|
|
1953
2127
|
i.position.set(0, e / 2 + 0.1, 0), this.add(i);
|
|
1954
|
-
const l = new
|
|
2128
|
+
const l = new Z(o * 1.1, 0.5, 8), u = new w({ color: 9127187, flatShading: !0 }), m = new d(l, u);
|
|
1955
2129
|
m.position.set(0, e + 0.35, 0), this.add(m);
|
|
1956
|
-
const h = new
|
|
2130
|
+
const h = new ue(o * 0.8, 0.05, 8, 16), f = new w({ color: 9127187, flatShading: !0 }), p = new d(h, f);
|
|
1957
2131
|
p.position.set(0, e + 0.85, 0), this.add(p);
|
|
1958
|
-
const y = new
|
|
2132
|
+
const y = new me(16755200, 1.5, 15);
|
|
1959
2133
|
y.position.set(0, e / 2 + 0.1, 0), y.castShadow = !0, this.add(y);
|
|
1960
2134
|
}
|
|
1961
2135
|
}
|
|
1962
|
-
class
|
|
2136
|
+
class No extends A {
|
|
1963
2137
|
constructor() {
|
|
1964
2138
|
super();
|
|
1965
|
-
const e = new
|
|
1966
|
-
for (let
|
|
1967
|
-
const
|
|
1968
|
-
|
|
1969
|
-
const s = new
|
|
1970
|
-
s.scale.set(
|
|
2139
|
+
const e = new se(1, 0), o = new w({ color: 8421504, flatShading: !0 }), n = new w({ color: 4950843, flatShading: !0, opacity: 0.8, transparent: !0 });
|
|
2140
|
+
for (let a = 0; a < 5; a++) {
|
|
2141
|
+
const r = new d(e, o);
|
|
2142
|
+
r.scale.set(0.8 + Math.random() * 0.4, 0.8 + Math.random() * 0.4, 0.8 + Math.random() * 0.4), r.rotation.set(Math.random() * Math.PI, Math.random() * Math.PI, Math.random() * Math.PI), r.position.set((Math.random() - 0.5) * 4, 0, (Math.random() - 0.5) * 4), this.add(r);
|
|
2143
|
+
const s = new d(e, n);
|
|
2144
|
+
s.scale.set(r.scale.x * 0.9, r.scale.y * 0.5, r.scale.z * 0.9), s.rotation.copy(r.rotation), s.position.copy(r.position), s.position.y += 0.3, this.add(s);
|
|
1971
2145
|
}
|
|
1972
2146
|
}
|
|
1973
2147
|
}
|
|
1974
|
-
class
|
|
2148
|
+
class Oo extends d {
|
|
1975
2149
|
constructor(e = 1, o = 4, n = 4) {
|
|
1976
|
-
super(), this.geometry = new
|
|
2150
|
+
super(), this.geometry = new At(e, o, n), this.material = new w({ color: 8421504, flatShading: !0 });
|
|
1977
2151
|
}
|
|
1978
2152
|
}
|
|
1979
|
-
class
|
|
2153
|
+
class zo extends A {
|
|
1980
2154
|
constructor() {
|
|
1981
2155
|
super();
|
|
1982
|
-
const e = new
|
|
2156
|
+
const e = new se(1, 0), o = new w({ color: 8421504, flatShading: !0 });
|
|
1983
2157
|
for (let n = 0; n < 5; n++) {
|
|
1984
|
-
const
|
|
1985
|
-
|
|
2158
|
+
const a = new d(e, o);
|
|
2159
|
+
a.scale.set(0.8 + Math.random() * 0.4, 0.8 + Math.random() * 0.4, 0.8 + Math.random() * 0.4), a.rotation.set(Math.random() * Math.PI, Math.random() * Math.PI, Math.random() * Math.PI), a.position.set((Math.random() - 0.5) * 4, 0, (Math.random() - 0.5) * 4), this.add(a);
|
|
1986
2160
|
}
|
|
1987
2161
|
}
|
|
1988
2162
|
}
|
|
1989
|
-
class
|
|
2163
|
+
class _o extends A {
|
|
1990
2164
|
constructor() {
|
|
1991
2165
|
super();
|
|
1992
|
-
const e = new
|
|
2166
|
+
const e = new Pt(), o = new J({
|
|
1993
2167
|
color: 8965375,
|
|
1994
2168
|
transparent: !0,
|
|
1995
2169
|
opacity: 0.4,
|
|
@@ -1997,32 +2171,32 @@ class Lo extends P {
|
|
|
1997
2171
|
metalness: 0.1,
|
|
1998
2172
|
reflectivity: 0.8,
|
|
1999
2173
|
transmission: 0.9,
|
|
2000
|
-
side:
|
|
2001
|
-
}), n = new
|
|
2174
|
+
side: q
|
|
2175
|
+
}), n = new d(e, o);
|
|
2002
2176
|
n.rotation.x = -Math.PI / 2, this.add(n);
|
|
2003
2177
|
}
|
|
2004
2178
|
}
|
|
2005
|
-
class
|
|
2179
|
+
class ko extends A {
|
|
2006
2180
|
constructor() {
|
|
2007
2181
|
super();
|
|
2008
2182
|
const e = [
|
|
2009
|
-
new
|
|
2183
|
+
new b(0, 0),
|
|
2010
2184
|
// Bottom
|
|
2011
|
-
new
|
|
2185
|
+
new b(0.8, 0),
|
|
2012
2186
|
// Base
|
|
2013
|
-
new
|
|
2187
|
+
new b(1, 1.5),
|
|
2014
2188
|
// Rounded body
|
|
2015
|
-
new
|
|
2189
|
+
new b(0.5, 2.2),
|
|
2016
2190
|
// Neck
|
|
2017
|
-
new
|
|
2191
|
+
new b(0.6, 2.5)
|
|
2018
2192
|
// Mouth
|
|
2019
|
-
], o = new
|
|
2193
|
+
], o = new H(e, 10), n = new E(0.3, 0.4, 0.2, 8), a = new w({
|
|
2020
2194
|
color: 8965375,
|
|
2021
2195
|
transparent: !0,
|
|
2022
2196
|
opacity: 0.5,
|
|
2023
2197
|
roughness: 0.1,
|
|
2024
2198
|
metalness: 0.3
|
|
2025
|
-
}),
|
|
2199
|
+
}), r = new w({
|
|
2026
2200
|
color: 16724838,
|
|
2027
2201
|
// Vibrant potion color
|
|
2028
2202
|
transparent: !0,
|
|
@@ -2030,84 +2204,84 @@ class Ro extends P {
|
|
|
2030
2204
|
}), s = new w({
|
|
2031
2205
|
color: 9127187,
|
|
2032
2206
|
roughness: 1
|
|
2033
|
-
}), c = new
|
|
2207
|
+
}), c = new d(o, a), i = new d(o, r), l = new d(n, s);
|
|
2034
2208
|
i.scale.set(0.8, 0.8, 0.8), i.position.y = 0.1, l.position.y = 2.5;
|
|
2035
|
-
const u = new
|
|
2209
|
+
const u = new A();
|
|
2036
2210
|
u.add(c, i, l), this.add(u);
|
|
2037
2211
|
}
|
|
2038
2212
|
}
|
|
2039
|
-
class
|
|
2213
|
+
class Ro extends A {
|
|
2040
2214
|
constructor() {
|
|
2041
2215
|
super();
|
|
2042
|
-
const e = new
|
|
2216
|
+
const e = new E(0.3, 0.4, 0.1, 16), o = new w({
|
|
2043
2217
|
color: 3355443,
|
|
2044
2218
|
roughness: 0.6,
|
|
2045
2219
|
metalness: 0.3
|
|
2046
|
-
}), n = new
|
|
2220
|
+
}), n = new d(e, o);
|
|
2047
2221
|
n.position.y = 0.05;
|
|
2048
|
-
const
|
|
2222
|
+
const a = new E(0.1, 0.1, 0.7, 16), r = new w({
|
|
2049
2223
|
color: 5592405,
|
|
2050
2224
|
roughness: 0.5,
|
|
2051
2225
|
metalness: 0.4
|
|
2052
|
-
}), s = new
|
|
2226
|
+
}), s = new d(a, r);
|
|
2053
2227
|
s.position.y = 0.4;
|
|
2054
|
-
const c = new
|
|
2228
|
+
const c = new Z(0.075, 0.2, 16), i = new w({
|
|
2055
2229
|
color: 16733440,
|
|
2056
2230
|
emissive: 16733440,
|
|
2057
2231
|
emissiveIntensity: 0.6,
|
|
2058
2232
|
transparent: !0,
|
|
2059
2233
|
opacity: 0.8
|
|
2060
|
-
}), l = new
|
|
2234
|
+
}), l = new d(c, i);
|
|
2061
2235
|
l.position.y = 0.8, this.add(n, s, l);
|
|
2062
2236
|
}
|
|
2063
2237
|
}
|
|
2064
|
-
class
|
|
2238
|
+
class Fo extends A {
|
|
2065
2239
|
constructor() {
|
|
2066
2240
|
super();
|
|
2067
|
-
const e = new
|
|
2241
|
+
const e = new S(3, 4, 0.1), o = new w({
|
|
2068
2242
|
color: 3026478,
|
|
2069
2243
|
roughness: 0.8,
|
|
2070
2244
|
metalness: 0.6
|
|
2071
|
-
}), n = new
|
|
2245
|
+
}), n = new S(0.2, 0.5, 0.2), a = new w({
|
|
2072
2246
|
color: 11184810,
|
|
2073
2247
|
roughness: 0.5,
|
|
2074
2248
|
metalness: 0.7
|
|
2075
|
-
}),
|
|
2249
|
+
}), r = new E(0.3, 0.3, 0.1, 16), s = new w({
|
|
2076
2250
|
color: 5592405,
|
|
2077
2251
|
roughness: 0.7,
|
|
2078
2252
|
metalness: 0.5
|
|
2079
|
-
}), c = new
|
|
2080
|
-
for (let
|
|
2081
|
-
const
|
|
2082
|
-
|
|
2253
|
+
}), c = new d(e, o);
|
|
2254
|
+
for (let v = -1; v <= 1; v++) {
|
|
2255
|
+
const M = new d(n, a);
|
|
2256
|
+
M.position.set(v, 1.5, 0.1), c.add(M);
|
|
2083
2257
|
}
|
|
2084
|
-
const i = new
|
|
2258
|
+
const i = new d(r, s);
|
|
2085
2259
|
i.rotation.x = Math.PI / 2, i.position.set(0, 0.5, 0.15), c.add(i);
|
|
2086
|
-
const l = new
|
|
2260
|
+
const l = new z(0.15, 8, 8), u = new w({
|
|
2087
2261
|
color: 16711680,
|
|
2088
2262
|
emissive: 16711680,
|
|
2089
2263
|
emissiveIntensity: 0.5
|
|
2090
|
-
}), m = new
|
|
2264
|
+
}), m = new d(l, u);
|
|
2091
2265
|
m.position.set(0, -1, 0.1), c.add(m), this.add(c);
|
|
2092
|
-
let h = 0.015,
|
|
2266
|
+
let h = 0.015, f = 0.8, p = 0.2;
|
|
2093
2267
|
function y() {
|
|
2094
2268
|
requestAnimationFrame(y);
|
|
2095
|
-
const
|
|
2096
|
-
m.material.emissiveIntensity =
|
|
2269
|
+
const v = p + Math.abs(Math.sin(Date.now() * h)) * (f - p);
|
|
2270
|
+
m.material.emissiveIntensity = v;
|
|
2097
2271
|
}
|
|
2098
2272
|
y();
|
|
2099
2273
|
}
|
|
2100
2274
|
}
|
|
2101
|
-
class
|
|
2275
|
+
class Lo extends d {
|
|
2102
2276
|
constructor({
|
|
2103
2277
|
flaskRadius: e = 1,
|
|
2104
2278
|
//
|
|
2105
2279
|
neckRadius: o = 0.3,
|
|
2106
2280
|
height: n = 2.5,
|
|
2107
|
-
neckHeight:
|
|
2108
|
-
radialSegments:
|
|
2281
|
+
neckHeight: a = 1,
|
|
2282
|
+
radialSegments: r = 16
|
|
2109
2283
|
} = {}) {
|
|
2110
|
-
super(), this.geometry = new
|
|
2284
|
+
super(), this.geometry = new Tt({ flaskRadius: e, neckRadius: o, height: n, neckHeight: a, radialSegments: r }), this.material = new J({
|
|
2111
2285
|
color: 8965375,
|
|
2112
2286
|
transparent: !0,
|
|
2113
2287
|
opacity: 0.4,
|
|
@@ -2115,129 +2289,129 @@ class Do extends f {
|
|
|
2115
2289
|
metalness: 0.1,
|
|
2116
2290
|
reflectivity: 0.8,
|
|
2117
2291
|
transmission: 0.9,
|
|
2118
|
-
side:
|
|
2292
|
+
side: q,
|
|
2119
2293
|
wireframe: !1
|
|
2120
2294
|
});
|
|
2121
2295
|
}
|
|
2122
2296
|
}
|
|
2123
|
-
class
|
|
2297
|
+
class Do extends A {
|
|
2124
2298
|
constructor() {
|
|
2125
2299
|
super();
|
|
2126
2300
|
const e = [
|
|
2127
|
-
new
|
|
2301
|
+
new b(0, 0),
|
|
2128
2302
|
// Bottom of the flask
|
|
2129
|
-
new
|
|
2303
|
+
new b(1.2, 0),
|
|
2130
2304
|
// Base
|
|
2131
|
-
new
|
|
2305
|
+
new b(1.5, 1.5),
|
|
2132
2306
|
// Mid-body
|
|
2133
|
-
new
|
|
2307
|
+
new b(1, 3),
|
|
2134
2308
|
// Narrow neck
|
|
2135
|
-
new
|
|
2309
|
+
new b(0.6, 3.5)
|
|
2136
2310
|
// Mouth of the flask
|
|
2137
|
-
], o = new
|
|
2311
|
+
], o = new H(e, 12), n = new E(0.6, 0.7, 0.3, 8), a = new w({
|
|
2138
2312
|
color: 8965290,
|
|
2139
2313
|
transparent: !0,
|
|
2140
2314
|
opacity: 0.4,
|
|
2141
2315
|
roughness: 0.1,
|
|
2142
2316
|
metalness: 0.5
|
|
2143
|
-
}),
|
|
2317
|
+
}), r = new w({
|
|
2144
2318
|
color: 9127187,
|
|
2145
2319
|
roughness: 1
|
|
2146
|
-
}), s = new
|
|
2320
|
+
}), s = new d(o, a), c = new d(n, r);
|
|
2147
2321
|
c.position.y = 3.5, this.add(s, c);
|
|
2148
2322
|
}
|
|
2149
2323
|
}
|
|
2150
|
-
class
|
|
2324
|
+
class qo extends A {
|
|
2151
2325
|
constructor() {
|
|
2152
2326
|
super();
|
|
2153
|
-
const e = new
|
|
2327
|
+
const e = new S(2, 3, 0.1), o = new w({
|
|
2154
2328
|
color: 3355443,
|
|
2155
2329
|
roughness: 0.8,
|
|
2156
2330
|
metalness: 0.5
|
|
2157
|
-
}), n = new
|
|
2331
|
+
}), n = new d(e, o), a = new E(0.1, 0.1, 0.2, 8), r = new E(0.05, 0.05, 1, 8), s = new w({
|
|
2158
2332
|
color: 11184810,
|
|
2159
2333
|
roughness: 0.5,
|
|
2160
2334
|
metalness: 0.7
|
|
2161
2335
|
});
|
|
2162
2336
|
for (let c = -0.5; c <= 0.5; c += 0.5) {
|
|
2163
|
-
const i = new
|
|
2337
|
+
const i = new d(a, s);
|
|
2164
2338
|
i.position.set(c, 1, 0.1);
|
|
2165
|
-
const l = new
|
|
2339
|
+
const l = new d(r, s);
|
|
2166
2340
|
l.position.y = 0.5, i.add(l), this.add(i);
|
|
2167
2341
|
}
|
|
2168
2342
|
this.add(n);
|
|
2169
2343
|
}
|
|
2170
2344
|
}
|
|
2171
|
-
class
|
|
2345
|
+
class Xo extends A {
|
|
2172
2346
|
constructor() {
|
|
2173
2347
|
super();
|
|
2174
|
-
const e = new
|
|
2348
|
+
const e = new S(1, 0.2, 0.5), o = new w({
|
|
2175
2349
|
color: 4473924,
|
|
2176
2350
|
roughness: 0.6,
|
|
2177
2351
|
metalness: 0.3
|
|
2178
|
-
}), n = new
|
|
2352
|
+
}), n = new d(e, o);
|
|
2179
2353
|
n.position.y = 0.1;
|
|
2180
|
-
const
|
|
2181
|
-
|
|
2182
|
-
const s = new
|
|
2354
|
+
const a = new S(0.2, 1, 0.2), r = new d(a, o);
|
|
2355
|
+
r.position.set(0, 0.6, -0.2);
|
|
2356
|
+
const s = new E(0.1, 0.1, 0.4, 8), c = new w({
|
|
2183
2357
|
color: 3355443,
|
|
2184
2358
|
roughness: 0.5,
|
|
2185
2359
|
metalness: 0.6
|
|
2186
|
-
}), i = new
|
|
2360
|
+
}), i = new d(s, c);
|
|
2187
2361
|
i.position.set(0, 1.1, -0.35), i.rotation.x = -Math.PI / 4;
|
|
2188
|
-
const l = new
|
|
2362
|
+
const l = new S(0.6, 0.1, 0.6), u = new w({
|
|
2189
2363
|
color: 5592405,
|
|
2190
2364
|
roughness: 0.8,
|
|
2191
2365
|
metalness: 0.2
|
|
2192
|
-
}), m = new
|
|
2193
|
-
m.position.set(0, 0.6, 0), this.add(n,
|
|
2366
|
+
}), m = new d(l, u);
|
|
2367
|
+
m.position.set(0, 0.6, 0), this.add(n, r, i, m);
|
|
2194
2368
|
}
|
|
2195
2369
|
}
|
|
2196
|
-
class
|
|
2370
|
+
class Vo extends A {
|
|
2197
2371
|
constructor() {
|
|
2198
2372
|
super();
|
|
2199
|
-
const e = new Ct(), o = new
|
|
2373
|
+
const e = new Ct(), o = new E(0.2, 0.3, 1.5, 8);
|
|
2200
2374
|
o.translate(0, 0.75, 0);
|
|
2201
2375
|
const n = new w({
|
|
2202
2376
|
color: 6045747,
|
|
2203
2377
|
// Dark earthy tone
|
|
2204
2378
|
roughness: 1,
|
|
2205
2379
|
metalness: 0,
|
|
2206
|
-
side:
|
|
2380
|
+
side: q
|
|
2207
2381
|
// Render inside and outside
|
|
2208
|
-
}),
|
|
2382
|
+
}), a = new w({
|
|
2209
2383
|
color: 9132587,
|
|
2210
2384
|
// Slightly lighter earthy color
|
|
2211
2385
|
roughness: 0.8,
|
|
2212
2386
|
metalness: 0.1
|
|
2213
|
-
}),
|
|
2214
|
-
s.position.set(0.3, 1.3, 0), s.rotation.z = Math.PI / 4, this.add(
|
|
2387
|
+
}), r = new d(e, n), s = new d(o, a);
|
|
2388
|
+
s.position.set(0.3, 1.3, 0), s.rotation.z = Math.PI / 4, this.add(r, s);
|
|
2215
2389
|
}
|
|
2216
2390
|
}
|
|
2217
|
-
class
|
|
2391
|
+
class Zo extends A {
|
|
2218
2392
|
constructor() {
|
|
2219
2393
|
super();
|
|
2220
|
-
const e = 100, o = 0.05, n = new
|
|
2394
|
+
const e = 100, o = 0.05, n = new Ie(
|
|
2221
2395
|
Array.from({ length: e }, (l, u) => {
|
|
2222
2396
|
const m = u * 0.2;
|
|
2223
|
-
return new
|
|
2397
|
+
return new g(
|
|
2224
2398
|
Math.cos(m) * 0.4,
|
|
2225
2399
|
u * o,
|
|
2226
2400
|
// Gradual height increase
|
|
2227
2401
|
Math.sin(m) * 0.4
|
|
2228
2402
|
);
|
|
2229
2403
|
})
|
|
2230
|
-
),
|
|
2404
|
+
), a = new Ee(n, 200, 0.1, 8, !1), r = new w({
|
|
2231
2405
|
color: 8965375,
|
|
2232
2406
|
transparent: !0,
|
|
2233
2407
|
opacity: 0.3,
|
|
2234
2408
|
roughness: 0.1,
|
|
2235
2409
|
metalness: 0.2,
|
|
2236
2410
|
emissive: 8965375
|
|
2237
|
-
}), s = new
|
|
2411
|
+
}), s = new d(a, r);
|
|
2238
2412
|
this.add(s);
|
|
2239
2413
|
function c() {
|
|
2240
|
-
|
|
2414
|
+
r.emissiveIntensity = 0.2 + Math.sin(Date.now() * 5e-3) * 0.1;
|
|
2241
2415
|
}
|
|
2242
2416
|
function i() {
|
|
2243
2417
|
requestAnimationFrame(i), c();
|
|
@@ -2245,67 +2419,46 @@ class jo extends P {
|
|
|
2245
2419
|
i();
|
|
2246
2420
|
}
|
|
2247
2421
|
}
|
|
2248
|
-
class
|
|
2422
|
+
class Ho extends d {
|
|
2249
2423
|
constructor({
|
|
2250
2424
|
radius: e = 0.3,
|
|
2251
2425
|
//
|
|
2252
2426
|
height: o = 0.4,
|
|
2253
2427
|
count: n = 3,
|
|
2254
|
-
thickness:
|
|
2255
|
-
radialSegments:
|
|
2428
|
+
thickness: a = 0.03,
|
|
2429
|
+
radialSegments: r = 16
|
|
2256
2430
|
} = {}) {
|
|
2257
|
-
super(), this.geometry = new
|
|
2431
|
+
super(), this.geometry = new Bt({ radius: e, height: o, count: n, thickness: a, radialSegments: r }), this.material = new w({
|
|
2258
2432
|
color: 8947848,
|
|
2259
2433
|
roughness: 0.7,
|
|
2260
2434
|
metalness: 0.3
|
|
2261
2435
|
});
|
|
2262
2436
|
}
|
|
2263
2437
|
}
|
|
2264
|
-
class
|
|
2438
|
+
class Yo extends A {
|
|
2265
2439
|
constructor() {
|
|
2266
2440
|
super();
|
|
2267
|
-
const e = new
|
|
2441
|
+
const e = new E(0.5, 0.6, 0.3, 16), o = new w({
|
|
2268
2442
|
color: 3355443,
|
|
2269
2443
|
roughness: 0.6,
|
|
2270
2444
|
metalness: 0.5
|
|
2271
|
-
}), n = new
|
|
2445
|
+
}), n = new d(e, o);
|
|
2272
2446
|
n.position.y = 0.15;
|
|
2273
|
-
const
|
|
2447
|
+
const a = new E(0.15, 0.15, 2, 12, 1, !0), r = new w({
|
|
2274
2448
|
color: 16737792,
|
|
2275
2449
|
roughness: 0.5,
|
|
2276
2450
|
metalness: 0.8,
|
|
2277
|
-
side:
|
|
2278
|
-
}), s = new
|
|
2451
|
+
side: q
|
|
2452
|
+
}), s = new d(a, r);
|
|
2279
2453
|
s.position.y = 1.3;
|
|
2280
|
-
const c = new
|
|
2454
|
+
const c = new z(0.3, 16, 16), i = new d(c, r);
|
|
2281
2455
|
i.position.y = 2.4, this.add(n, s, i);
|
|
2282
|
-
const l = [];
|
|
2283
|
-
for (let h = 0; h < 5; h++) {
|
|
2284
|
-
const d = new ge({ color: 10079487 }), p = [
|
|
2285
|
-
new M(0, 2.4, 0),
|
|
2286
|
-
new M((Math.random() - 0.5) * 1.5, Math.random() * 2.4, (Math.random() - 0.5) * 1.5)
|
|
2287
|
-
], y = new g().setFromPoints(p), x = new Ie(y, d);
|
|
2288
|
-
this.add(x), l.push(x);
|
|
2289
|
-
}
|
|
2290
|
-
function u() {
|
|
2291
|
-
l.forEach((h) => {
|
|
2292
|
-
const d = [
|
|
2293
|
-
new M(0, 2.4, 0),
|
|
2294
|
-
new M((Math.random() - 0.5) * 1.5, Math.random() * 2.4, (Math.random() - 0.5) * 1.5)
|
|
2295
|
-
];
|
|
2296
|
-
h.geometry.setFromPoints(d);
|
|
2297
|
-
});
|
|
2298
|
-
}
|
|
2299
|
-
function m() {
|
|
2300
|
-
requestAnimationFrame(m), u();
|
|
2301
|
-
}
|
|
2302
|
-
m();
|
|
2303
2456
|
}
|
|
2304
2457
|
}
|
|
2305
|
-
class
|
|
2306
|
-
constructor(e = 0.2, o = 0.2, n = 3,
|
|
2458
|
+
class jo extends A {
|
|
2459
|
+
constructor(e = 0.2, o = 0.2, n = 3, a = 32) {
|
|
2307
2460
|
super();
|
|
2308
|
-
const
|
|
2461
|
+
const r = new ne(e, o, n, a), s = new J({
|
|
2309
2462
|
color: 8965375,
|
|
2310
2463
|
transparent: !0,
|
|
2311
2464
|
opacity: 0.4,
|
|
@@ -2314,48 +2467,48 @@ class $o extends P {
|
|
|
2314
2467
|
reflectivity: 0.8,
|
|
2315
2468
|
transmission: 0.9,
|
|
2316
2469
|
// For glass effect
|
|
2317
|
-
side:
|
|
2318
|
-
}), c = new
|
|
2470
|
+
side: q
|
|
2471
|
+
}), c = new d(r, s);
|
|
2319
2472
|
this.add(c);
|
|
2320
2473
|
}
|
|
2321
2474
|
}
|
|
2322
|
-
class
|
|
2475
|
+
class Qo extends A {
|
|
2323
2476
|
constructor(e = 3, o = [65450, 16711850, 11141375]) {
|
|
2324
2477
|
super();
|
|
2325
|
-
const n = new
|
|
2478
|
+
const n = new S(3, 0.2, 1), a = new w({
|
|
2326
2479
|
color: 9127187,
|
|
2327
2480
|
// Wooden color or change to metallic tone
|
|
2328
2481
|
roughness: 0.7,
|
|
2329
2482
|
metalness: 0.3
|
|
2330
|
-
}),
|
|
2331
|
-
|
|
2332
|
-
const s = new
|
|
2483
|
+
}), r = new d(n, a);
|
|
2484
|
+
r.position.y = 0.5;
|
|
2485
|
+
const s = new ne(0.1, 0.1, 1, 16), c = new w({
|
|
2333
2486
|
color: 11184810,
|
|
2334
2487
|
transparent: !0,
|
|
2335
2488
|
opacity: 0.4,
|
|
2336
2489
|
roughness: 0.1,
|
|
2337
2490
|
metalness: 0.5,
|
|
2338
|
-
side:
|
|
2491
|
+
side: q
|
|
2339
2492
|
});
|
|
2340
2493
|
for (let i = 0; i < e; i++) {
|
|
2341
|
-
const l = new
|
|
2494
|
+
const l = new d(s, c), u = (i - (e - 1) / 2) * 0.8;
|
|
2342
2495
|
l.position.set(u, 1, 0);
|
|
2343
|
-
const m = new
|
|
2496
|
+
const m = new ne(0.099, 0.099, 0.5, 16, !1), h = o[i % o.length], f = new w({
|
|
2344
2497
|
color: h,
|
|
2345
2498
|
emissive: h,
|
|
2346
2499
|
emissiveIntensity: 0.5,
|
|
2347
2500
|
transparent: !0,
|
|
2348
2501
|
opacity: 0.6
|
|
2349
|
-
}), p = new
|
|
2350
|
-
p.position.set(0, -0.25, 0), l.add(p),
|
|
2502
|
+
}), p = new d(m, f);
|
|
2503
|
+
p.position.set(0, -0.25, 0), l.add(p), r.add(l);
|
|
2351
2504
|
}
|
|
2352
|
-
this.add(
|
|
2505
|
+
this.add(r);
|
|
2353
2506
|
}
|
|
2354
2507
|
}
|
|
2355
|
-
class
|
|
2508
|
+
class Ko extends d {
|
|
2356
2509
|
constructor() {
|
|
2357
2510
|
super();
|
|
2358
|
-
const e = new
|
|
2511
|
+
const e = new Ut(), o = new J({
|
|
2359
2512
|
color: 5597999,
|
|
2360
2513
|
roughness: 0.1,
|
|
2361
2514
|
transmission: 0.9,
|
|
@@ -2368,24 +2521,24 @@ class en extends f {
|
|
|
2368
2521
|
this.geometry = e, this.material = o;
|
|
2369
2522
|
}
|
|
2370
2523
|
}
|
|
2371
|
-
class
|
|
2524
|
+
class kt extends Y {
|
|
2372
2525
|
constructor(e = 5, o = 0.5, n = 1) {
|
|
2373
2526
|
super();
|
|
2374
|
-
const
|
|
2527
|
+
const a = Math.PI * 2 / e, r = a / 2, s = a / 4;
|
|
2375
2528
|
this.moveTo(Math.cos(0) * n, -Math.sin(0) * n);
|
|
2376
2529
|
for (let c = 1; c <= e; ++c) {
|
|
2377
|
-
let i = Math.cos(
|
|
2378
|
-
this.quadraticCurveTo(i, l, u, m), i = Math.cos(
|
|
2530
|
+
let i = Math.cos(a * c - s * 3) * (o / Math.cos(s)), l = -Math.sin(a * c - s * 3) * (o / Math.cos(s)), u = Math.cos(a * c - r) * o, m = -Math.sin(a * c - r) * o;
|
|
2531
|
+
this.quadraticCurveTo(i, l, u, m), i = Math.cos(a * c - s) * (o / Math.cos(s)), l = -Math.sin(a * c - s) * (o / Math.cos(s)), u = Math.cos(a * c) * n, m = -Math.sin(a * c) * n, this.quadraticCurveTo(i, l, u, m);
|
|
2379
2532
|
}
|
|
2380
2533
|
this.closePath();
|
|
2381
2534
|
}
|
|
2382
2535
|
}
|
|
2383
|
-
class
|
|
2384
|
-
constructor(e = 5, o = 0.5, n = 1,
|
|
2536
|
+
class $o extends d {
|
|
2537
|
+
constructor(e = 5, o = 0.5, n = 1, a = 0.25) {
|
|
2385
2538
|
super();
|
|
2386
|
-
const
|
|
2387
|
-
depth:
|
|
2388
|
-
bevelEnabled:
|
|
2539
|
+
const r = new kt(e, o, n), s = new j(r, {
|
|
2540
|
+
depth: a,
|
|
2541
|
+
bevelEnabled: a > 0,
|
|
2389
2542
|
bevelThickness: 0,
|
|
2390
2543
|
bevelSize: 0
|
|
2391
2544
|
}), c = new w({
|
|
@@ -2399,26 +2552,26 @@ class tn extends f {
|
|
|
2399
2552
|
s.center(), this.geometry = s, this.material = c;
|
|
2400
2553
|
}
|
|
2401
2554
|
}
|
|
2402
|
-
class
|
|
2403
|
-
constructor(e = 5, o = 0.5, n = 1,
|
|
2555
|
+
class Rt extends Y {
|
|
2556
|
+
constructor(e = 5, o = 0.5, n = 1, a = 5, r = 0.25) {
|
|
2404
2557
|
super();
|
|
2405
2558
|
const s = Math.PI * 2 / e, c = s / 4;
|
|
2406
2559
|
this.moveTo(Math.cos(0) * n, -Math.sin(0) * n);
|
|
2407
2560
|
for (let i = 1; i <= e; ++i)
|
|
2408
2561
|
this.lineTo(Math.cos(s * i - c * 3) * o, -Math.sin(s * i - c * 3) * o), this.lineTo(Math.cos(s * i - c * 2) * o, -Math.sin(s * i - c * 2) * o), this.lineTo(Math.cos(s * i - c) * n, -Math.sin(s * i - c) * n), this.lineTo(Math.cos(s * i) * n, -Math.sin(s * i) * n);
|
|
2409
|
-
if (this.closePath(),
|
|
2410
|
-
const i = new
|
|
2411
|
-
i.moveTo(Math.cos(0) *
|
|
2412
|
-
for (let u = 1; u <
|
|
2413
|
-
i.lineTo(Math.cos(l * u) *
|
|
2414
|
-
i.lineTo(Math.cos(0) *
|
|
2562
|
+
if (this.closePath(), r > 0 && a > 2) {
|
|
2563
|
+
const i = new Ae(), l = Math.PI * 2 / a;
|
|
2564
|
+
i.moveTo(Math.cos(0) * r, -Math.sin(0) * r);
|
|
2565
|
+
for (let u = 1; u < a; ++u)
|
|
2566
|
+
i.lineTo(Math.cos(l * u) * r, -Math.sin(l * u) * r);
|
|
2567
|
+
i.lineTo(Math.cos(0) * r, -Math.sin(0) * r), this.holes.push(i);
|
|
2415
2568
|
}
|
|
2416
2569
|
}
|
|
2417
2570
|
}
|
|
2418
|
-
class
|
|
2419
|
-
constructor(e = 5, o = 0.5, n = 1,
|
|
2571
|
+
class Jo extends d {
|
|
2572
|
+
constructor(e = 5, o = 0.5, n = 1, a = 5, r = 0.25, s = 0.25) {
|
|
2420
2573
|
super();
|
|
2421
|
-
const c = new
|
|
2574
|
+
const c = new Rt(e, o, n, a, r), i = new j(c, {
|
|
2422
2575
|
depth: s,
|
|
2423
2576
|
bevelEnabled: s > 0,
|
|
2424
2577
|
bevelThickness: 0,
|
|
@@ -2426,14 +2579,13 @@ class on extends f {
|
|
|
2426
2579
|
}), l = new w({
|
|
2427
2580
|
color: 11184810,
|
|
2428
2581
|
metalness: 0.8,
|
|
2429
|
-
roughness: 0.2
|
|
2430
|
-
reflectivity: 0.5
|
|
2582
|
+
roughness: 0.2
|
|
2431
2583
|
});
|
|
2432
2584
|
i.center(), this.geometry = i, this.material = l;
|
|
2433
2585
|
}
|
|
2434
2586
|
}
|
|
2435
|
-
class
|
|
2436
|
-
constructor(e = 1, o = 2.1, n = 1.4,
|
|
2587
|
+
class Ft extends Y {
|
|
2588
|
+
constructor(e = 1, o = 2.1, n = 1.4, a = 1.6) {
|
|
2437
2589
|
super(), this.moveTo(0, n * e / 3), this.bezierCurveTo(
|
|
2438
2590
|
-o * 0.375 * e,
|
|
2439
2591
|
n * e,
|
|
@@ -2442,7 +2594,7 @@ class zt extends R {
|
|
|
2442
2594
|
n * e / 3,
|
|
2443
2595
|
// Control point 2 for the left side of the heart
|
|
2444
2596
|
0,
|
|
2445
|
-
-
|
|
2597
|
+
-a * e
|
|
2446
2598
|
// Bottom tip of the heart, controlled by `tipDepth`
|
|
2447
2599
|
), this.bezierCurveTo(
|
|
2448
2600
|
o * e,
|
|
@@ -2457,12 +2609,12 @@ class zt extends R {
|
|
|
2457
2609
|
);
|
|
2458
2610
|
}
|
|
2459
2611
|
}
|
|
2460
|
-
class
|
|
2461
|
-
constructor(e = 1, o = 1, n = 1,
|
|
2612
|
+
class Wo extends d {
|
|
2613
|
+
constructor(e = 1, o = 1, n = 1, a = 10, r = 0.25) {
|
|
2462
2614
|
super();
|
|
2463
|
-
const s = new
|
|
2464
|
-
depth:
|
|
2465
|
-
bevelEnabled:
|
|
2615
|
+
const s = new Ft(e, o, n, a), c = new j(s, {
|
|
2616
|
+
depth: r,
|
|
2617
|
+
bevelEnabled: r > 0,
|
|
2466
2618
|
bevelThickness: 0,
|
|
2467
2619
|
bevelSize: 0
|
|
2468
2620
|
}), i = new w({
|
|
@@ -2476,22 +2628,22 @@ class nn extends f {
|
|
|
2476
2628
|
c.center(), this.geometry = c, this.material = i;
|
|
2477
2629
|
}
|
|
2478
2630
|
}
|
|
2479
|
-
class
|
|
2631
|
+
class Lt extends Y {
|
|
2480
2632
|
constructor(e = 5, o = 0.5, n = 1) {
|
|
2481
2633
|
super();
|
|
2482
|
-
const
|
|
2634
|
+
const a = Math.PI * 2 / e, r = a / 2;
|
|
2483
2635
|
this.moveTo(Math.cos(0) * n, Math.sin(0) * n);
|
|
2484
2636
|
for (let s = 1; s <= e; ++s)
|
|
2485
|
-
this.lineTo(Math.cos(
|
|
2637
|
+
this.lineTo(Math.cos(a * s - r) * o, Math.sin(a * s - r) * o), this.lineTo(Math.cos(a * s) * n, Math.sin(a * s) * n);
|
|
2486
2638
|
this.closePath();
|
|
2487
2639
|
}
|
|
2488
2640
|
}
|
|
2489
|
-
class
|
|
2490
|
-
constructor(e = 5, o = 0.5, n = 1,
|
|
2641
|
+
class en extends d {
|
|
2642
|
+
constructor(e = 5, o = 0.5, n = 1, a = 0.25) {
|
|
2491
2643
|
super();
|
|
2492
|
-
const
|
|
2493
|
-
depth:
|
|
2494
|
-
bevelEnabled:
|
|
2644
|
+
const r = new Lt(e, o, n), s = new j(r, {
|
|
2645
|
+
depth: a,
|
|
2646
|
+
bevelEnabled: a > 0,
|
|
2495
2647
|
bevelThickness: 0,
|
|
2496
2648
|
bevelSize: 0
|
|
2497
2649
|
}), c = new w({
|
|
@@ -2505,18 +2657,18 @@ class sn extends f {
|
|
|
2505
2657
|
s.center(), this.geometry = s, this.material = c;
|
|
2506
2658
|
}
|
|
2507
2659
|
}
|
|
2508
|
-
class
|
|
2660
|
+
class tn extends d {
|
|
2509
2661
|
constructor() {
|
|
2510
|
-
super(), this.geometry = new
|
|
2662
|
+
super(), this.geometry = new Gt(), this.material = new w({ color: 16777215 });
|
|
2511
2663
|
}
|
|
2512
2664
|
}
|
|
2513
|
-
class
|
|
2665
|
+
class on extends d {
|
|
2514
2666
|
constructor({
|
|
2515
2667
|
trunkRadiusTop: e = 0.25,
|
|
2516
2668
|
trunkRadiusBottom: o = 0.4,
|
|
2517
2669
|
trunkHeight: n = 2.5,
|
|
2518
|
-
trunkSegments:
|
|
2519
|
-
trunkColor:
|
|
2670
|
+
trunkSegments: a = 14,
|
|
2671
|
+
trunkColor: r = 9127187,
|
|
2520
2672
|
leafSize: s = 0.8,
|
|
2521
2673
|
leafCount: c = 6,
|
|
2522
2674
|
leafDetail: i = 0,
|
|
@@ -2524,74 +2676,72 @@ class an extends f {
|
|
|
2524
2676
|
leafColor: u = 2263842
|
|
2525
2677
|
} = {}) {
|
|
2526
2678
|
super();
|
|
2527
|
-
const m = new
|
|
2679
|
+
const m = new _t({
|
|
2528
2680
|
trunkRadiusTop: e,
|
|
2529
2681
|
trunkRadiusBottom: o,
|
|
2530
2682
|
trunkHeight: n,
|
|
2531
|
-
trunkSegments:
|
|
2532
|
-
trunkColor: a,
|
|
2683
|
+
trunkSegments: a,
|
|
2533
2684
|
leafSize: s,
|
|
2534
2685
|
leafCount: c,
|
|
2535
2686
|
leafDetail: i,
|
|
2536
|
-
leafSpreadRadius: l
|
|
2537
|
-
leafColor: u
|
|
2687
|
+
leafSpreadRadius: l
|
|
2538
2688
|
}), h = new w({
|
|
2539
|
-
color:
|
|
2689
|
+
color: r,
|
|
2540
2690
|
roughness: 0.9,
|
|
2541
2691
|
metalness: 0,
|
|
2542
2692
|
flatShading: !0
|
|
2543
|
-
}),
|
|
2693
|
+
}), f = new w({
|
|
2544
2694
|
color: u,
|
|
2545
2695
|
roughness: 0.8,
|
|
2546
2696
|
metalness: 0,
|
|
2547
2697
|
flatShading: !0
|
|
2548
2698
|
});
|
|
2549
|
-
this.geometry = m, this.material = [h,
|
|
2699
|
+
this.geometry = m, this.material = [h, f];
|
|
2550
2700
|
}
|
|
2551
2701
|
}
|
|
2552
|
-
class
|
|
2702
|
+
class nn extends d {
|
|
2553
2703
|
constructor({
|
|
2554
2704
|
radius: e = 3,
|
|
2555
2705
|
//
|
|
2556
2706
|
height: o = 0.6,
|
|
2557
2707
|
widthSegments: n = 64,
|
|
2558
|
-
heightSegments:
|
|
2559
|
-
phiStart:
|
|
2708
|
+
heightSegments: a = 16,
|
|
2709
|
+
phiStart: r = 0,
|
|
2560
2710
|
phiLength: s = Math.PI * 2
|
|
2561
2711
|
} = {}) {
|
|
2562
|
-
super(), this.geometry = new
|
|
2712
|
+
super(), this.geometry = new Nt({
|
|
2563
2713
|
radius: e,
|
|
2564
2714
|
height: o,
|
|
2565
2715
|
widthSegments: n,
|
|
2566
|
-
heightSegments:
|
|
2567
|
-
phiStart:
|
|
2716
|
+
heightSegments: a,
|
|
2717
|
+
phiStart: r,
|
|
2568
2718
|
phiLength: s
|
|
2569
2719
|
}), this.material = new w({ color: 65280, flatShading: !0 });
|
|
2570
2720
|
}
|
|
2571
2721
|
}
|
|
2572
|
-
class
|
|
2722
|
+
class sn extends d {
|
|
2573
2723
|
constructor({
|
|
2574
|
-
radius: e =
|
|
2724
|
+
radius: e = ye(5, Math.PI / 10),
|
|
2575
2725
|
//
|
|
2576
2726
|
widthSegments: o = 64,
|
|
2577
2727
|
heightSegments: n = 32,
|
|
2578
|
-
phiStart:
|
|
2579
|
-
phiLength:
|
|
2728
|
+
phiStart: a = 0,
|
|
2729
|
+
phiLength: r = Math.PI * 2,
|
|
2580
2730
|
thetaLength: s = Math.PI / 10
|
|
2581
2731
|
} = {}) {
|
|
2582
|
-
super(), this.geometry = new
|
|
2732
|
+
super(), this.geometry = new zt({
|
|
2583
2733
|
radius: e,
|
|
2584
2734
|
widthSegments: o,
|
|
2585
2735
|
heightSegments: n,
|
|
2586
|
-
phiStart:
|
|
2587
|
-
phiLength:
|
|
2736
|
+
phiStart: a,
|
|
2737
|
+
phiLength: r,
|
|
2588
2738
|
thetaLength: s
|
|
2589
2739
|
}), this.material = new w({ color: 65280, flatShading: !0 });
|
|
2590
2740
|
}
|
|
2591
2741
|
}
|
|
2592
|
-
function
|
|
2593
|
-
t.onBeforeCompile = (
|
|
2594
|
-
|
|
2742
|
+
function rn(t, { time: e = 0, waveFrequency: o = 0.2, waveAmplitude: n = 0.5 } = {}) {
|
|
2743
|
+
t.onBeforeCompile = (a) => {
|
|
2744
|
+
a.uniforms.time = { value: e }, a.uniforms.waveFrequency = { value: o }, a.uniforms.waveAmplitude = { value: n }, a.vertexShader = `
|
|
2595
2745
|
uniform float time;
|
|
2596
2746
|
uniform float waveFrequency;
|
|
2597
2747
|
uniform float waveAmplitude;
|
|
@@ -2605,20 +2755,20 @@ function un(t, { time: e = 0, waveFrequency: o = 0.2, waveAmplitude: n = 0.5 } =
|
|
|
2605
2755
|
|
|
2606
2756
|
return displaced;
|
|
2607
2757
|
}
|
|
2608
|
-
` +
|
|
2758
|
+
` + a.vertexShader, a.vertexShader = a.vertexShader.replace(
|
|
2609
2759
|
"#include <begin_vertex>",
|
|
2610
2760
|
`
|
|
2611
2761
|
vec3 transformed = waterDisplacement(position, normal);
|
|
2612
2762
|
`
|
|
2613
|
-
), t.userData.shader =
|
|
2763
|
+
), t.userData.shader = a;
|
|
2614
2764
|
};
|
|
2615
2765
|
}
|
|
2616
|
-
function
|
|
2766
|
+
function an(t, e) {
|
|
2617
2767
|
t.userData.shader && (t.userData.shader.uniforms.time.value += e);
|
|
2618
2768
|
}
|
|
2619
|
-
function
|
|
2620
|
-
t.onBeforeCompile = (
|
|
2621
|
-
|
|
2769
|
+
function cn(t, { time: e = 0, intensity: o = 1, direction: n = L.XYZ, scale: a = 10 } = {}) {
|
|
2770
|
+
t.onBeforeCompile = (r) => {
|
|
2771
|
+
r.uniforms.time = { value: e }, r.uniforms.direction = { value: n }, r.uniforms.intensity = { value: o }, r.uniforms.scale = { value: a }, r.vertexShader = `
|
|
2622
2772
|
uniform float time;
|
|
2623
2773
|
uniform vec3 direction;
|
|
2624
2774
|
uniform float intensity;
|
|
@@ -2649,7 +2799,7 @@ function hn(t, { time: e = 0, intensity: o = 1, direction: n = _.XYZ, scale: r =
|
|
|
2649
2799
|
|
|
2650
2800
|
return o4.y * d.y + o4.x * (1.0 - d.y);
|
|
2651
2801
|
}
|
|
2652
|
-
` +
|
|
2802
|
+
` + r.vertexShader, r.vertexShader = r.vertexShader.replace(
|
|
2653
2803
|
"#include <begin_vertex>",
|
|
2654
2804
|
`
|
|
2655
2805
|
vec3 transformed = vec3(position);
|
|
@@ -2657,14 +2807,179 @@ function hn(t, { time: e = 0, intensity: o = 1, direction: n = _.XYZ, scale: r =
|
|
|
2657
2807
|
transformed += normalize(direction) * n * intensity;
|
|
2658
2808
|
vec3 transformedNormal = normal;
|
|
2659
2809
|
`
|
|
2660
|
-
), t.userData.shader =
|
|
2810
|
+
), t.userData.shader = r;
|
|
2661
2811
|
};
|
|
2662
2812
|
}
|
|
2663
|
-
function
|
|
2813
|
+
function ln(t, e) {
|
|
2664
2814
|
t.userData.shader && (t.userData.shader.uniforms.time.value += e);
|
|
2665
2815
|
}
|
|
2666
|
-
const
|
|
2667
|
-
uniforms: {
|
|
2816
|
+
const ee = {
|
|
2817
|
+
uniforms: {
|
|
2818
|
+
turbidity: { value: 10 },
|
|
2819
|
+
rayleigh: { value: 2 },
|
|
2820
|
+
mieCoefficient: { value: 5e-3 },
|
|
2821
|
+
mieDirectionalG: { value: 0.8 },
|
|
2822
|
+
sunPosition: { value: new g().setFromSphericalCoords(1, F.degToRad(90), F.degToRad(180)) },
|
|
2823
|
+
up: { value: new g(0, 1, 0) }
|
|
2824
|
+
},
|
|
2825
|
+
vertexShader: `
|
|
2826
|
+
uniform vec3 sunPosition;
|
|
2827
|
+
uniform float rayleigh;
|
|
2828
|
+
uniform float turbidity;
|
|
2829
|
+
uniform float mieCoefficient;
|
|
2830
|
+
uniform vec3 up;
|
|
2831
|
+
|
|
2832
|
+
varying vec3 vWorldPosition;
|
|
2833
|
+
varying vec3 vSunDirection;
|
|
2834
|
+
varying float vSunfade;
|
|
2835
|
+
varying vec3 vBetaR;
|
|
2836
|
+
varying vec3 vBetaM;
|
|
2837
|
+
varying float vSunE;
|
|
2838
|
+
|
|
2839
|
+
// constants for atmospheric scattering
|
|
2840
|
+
const float e = 2.71828182845904523536028747135266249775724709369995957;
|
|
2841
|
+
const float pi = 3.141592653589793238462643383279502884197169;
|
|
2842
|
+
|
|
2843
|
+
// wavelength of used primaries, according to preetham
|
|
2844
|
+
const vec3 lambda = vec3( 680E-9, 550E-9, 450E-9 );
|
|
2845
|
+
// this pre-calculation replaces older TotalRayleigh(vec3 lambda) function:
|
|
2846
|
+
// (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))
|
|
2847
|
+
const vec3 totalRayleigh = vec3( 5.804542996261093E-6, 1.3562911419845635E-5, 3.0265902468824876E-5 );
|
|
2848
|
+
|
|
2849
|
+
// mie stuff
|
|
2850
|
+
// K coefficient for the primaries
|
|
2851
|
+
const float v = 4.0;
|
|
2852
|
+
const vec3 K = vec3( 0.686, 0.678, 0.666 );
|
|
2853
|
+
// MieConst = pi * pow( ( 2.0 * pi ) / lambda, vec3( v - 2.0 ) ) * K
|
|
2854
|
+
const vec3 MieConst = vec3( 1.8399918514433978E14, 2.7798023919660528E14, 4.0790479543861094E14 );
|
|
2855
|
+
|
|
2856
|
+
// earth shadow hack
|
|
2857
|
+
// cutoffAngle = pi / 1.95;
|
|
2858
|
+
const float cutoffAngle = 1.6110731556870734;
|
|
2859
|
+
const float steepness = 1.5;
|
|
2860
|
+
const float EE = 1000.0;
|
|
2861
|
+
|
|
2862
|
+
float sunIntensity( float zenithAngleCos ) {
|
|
2863
|
+
zenithAngleCos = clamp( zenithAngleCos, -1.0, 1.0 );
|
|
2864
|
+
return EE * max( 0.0, 1.0 - pow( e, -( ( cutoffAngle - acos( zenithAngleCos ) ) / steepness ) ) );
|
|
2865
|
+
}
|
|
2866
|
+
|
|
2867
|
+
vec3 totalMie( float T ) {
|
|
2868
|
+
float c = ( 0.2 * T ) * 10E-18;
|
|
2869
|
+
return 0.434 * c * MieConst;
|
|
2870
|
+
}
|
|
2871
|
+
|
|
2872
|
+
void main() {
|
|
2873
|
+
vec4 worldPosition = modelMatrix * vec4( position, 1.0 );
|
|
2874
|
+
vWorldPosition = worldPosition.xyz;
|
|
2875
|
+
|
|
2876
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
2877
|
+
gl_Position.z = gl_Position.w; // set z to camera.far
|
|
2878
|
+
|
|
2879
|
+
vSunDirection = normalize( sunPosition );
|
|
2880
|
+
|
|
2881
|
+
vSunE = sunIntensity( dot( vSunDirection, up ) );
|
|
2882
|
+
|
|
2883
|
+
vSunfade = 1.0 - clamp( 1.0 - exp( ( sunPosition.y / 450000.0 ) ), 0.0, 1.0 );
|
|
2884
|
+
|
|
2885
|
+
float rayleighCoefficient = rayleigh - ( 1.0 * ( 1.0 - vSunfade ) );
|
|
2886
|
+
|
|
2887
|
+
// extinction (absorption + out scattering)
|
|
2888
|
+
// rayleigh coefficients
|
|
2889
|
+
vBetaR = totalRayleigh * rayleighCoefficient;
|
|
2890
|
+
|
|
2891
|
+
// mie coefficients
|
|
2892
|
+
vBetaM = totalMie( turbidity ) * mieCoefficient;
|
|
2893
|
+
}
|
|
2894
|
+
`,
|
|
2895
|
+
fragmentShader: `
|
|
2896
|
+
varying vec3 vWorldPosition;
|
|
2897
|
+
varying vec3 vSunDirection;
|
|
2898
|
+
varying float vSunfade;
|
|
2899
|
+
varying vec3 vBetaR;
|
|
2900
|
+
varying vec3 vBetaM;
|
|
2901
|
+
varying float vSunE;
|
|
2902
|
+
|
|
2903
|
+
uniform float mieDirectionalG;
|
|
2904
|
+
uniform vec3 up;
|
|
2905
|
+
|
|
2906
|
+
// constants for atmospheric scattering
|
|
2907
|
+
const float pi = 3.141592653589793238462643383279502884197169;
|
|
2908
|
+
|
|
2909
|
+
const float n = 1.0003; // refractive index of air
|
|
2910
|
+
const float N = 2.545E25; // number of molecules per unit volume for air at 288.15K and 1013mb (sea level -45 celsius)
|
|
2911
|
+
|
|
2912
|
+
// optical length at zenith for molecules
|
|
2913
|
+
const float rayleighZenithLength = 8.4E3;
|
|
2914
|
+
const float mieZenithLength = 1.25E3;
|
|
2915
|
+
// 66 arc seconds -> degrees, and the cosine of that
|
|
2916
|
+
const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;
|
|
2917
|
+
|
|
2918
|
+
// 3.0 / ( 16.0 * pi )
|
|
2919
|
+
const float THREE_OVER_SIXTEENPI = 0.05968310365946075;
|
|
2920
|
+
// 1.0 / ( 4.0 * pi )
|
|
2921
|
+
const float ONE_OVER_FOURPI = 0.07957747154594767;
|
|
2922
|
+
|
|
2923
|
+
float rayleighPhase( float cosTheta ) {
|
|
2924
|
+
return THREE_OVER_SIXTEENPI * ( 1.0 + pow( cosTheta, 2.0 ) );
|
|
2925
|
+
}
|
|
2926
|
+
|
|
2927
|
+
float hgPhase( float cosTheta, float g ) {
|
|
2928
|
+
float g2 = pow( g, 2.0 );
|
|
2929
|
+
float inverse = 1.0 / pow( 1.0 - 2.0 * g * cosTheta + g2, 1.5 );
|
|
2930
|
+
return ONE_OVER_FOURPI * ( ( 1.0 - g2 ) * inverse );
|
|
2931
|
+
}
|
|
2932
|
+
|
|
2933
|
+
void main() {
|
|
2934
|
+
vec3 direction = normalize( vWorldPosition - cameraPosition );
|
|
2935
|
+
|
|
2936
|
+
// optical length
|
|
2937
|
+
// cutoff angle at 90 to avoid singularity in next formula.
|
|
2938
|
+
float zenithAngle = acos( max( 0.0, dot( up, direction ) ) );
|
|
2939
|
+
float inverse = 1.0 / ( cos( zenithAngle ) + 0.15 * pow( 93.885 - ( ( zenithAngle * 180.0 ) / pi ), -1.253 ) );
|
|
2940
|
+
float sR = rayleighZenithLength * inverse;
|
|
2941
|
+
float sM = mieZenithLength * inverse;
|
|
2942
|
+
|
|
2943
|
+
// combined extinction factor
|
|
2944
|
+
vec3 Fex = exp( -( vBetaR * sR + vBetaM * sM ) );
|
|
2945
|
+
|
|
2946
|
+
// in scattering
|
|
2947
|
+
float cosTheta = dot( direction, vSunDirection );
|
|
2948
|
+
|
|
2949
|
+
float rPhase = rayleighPhase( cosTheta * 0.5 + 0.5 );
|
|
2950
|
+
vec3 betaRTheta = vBetaR * rPhase;
|
|
2951
|
+
|
|
2952
|
+
float mPhase = hgPhase( cosTheta, mieDirectionalG );
|
|
2953
|
+
vec3 betaMTheta = vBetaM * mPhase;
|
|
2954
|
+
|
|
2955
|
+
vec3 Lin = pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * ( 1.0 - Fex ), vec3( 1.5 ) );
|
|
2956
|
+
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 ) );
|
|
2957
|
+
|
|
2958
|
+
// night sky
|
|
2959
|
+
float theta = acos( direction.y ); // elevation --> y-axis, [-pi/2, pi/2]
|
|
2960
|
+
float phi = atan( direction.z, direction.x ); // azimuth --> x-axis [-pi/2, pi/2]
|
|
2961
|
+
vec2 uv = vec2( phi, theta ) / vec2( 2.0 * pi, pi ) + vec2( 0.5, 0.0 );
|
|
2962
|
+
vec3 L0 = vec3( 0.1 ) * Fex;
|
|
2963
|
+
|
|
2964
|
+
// composition + solar disc
|
|
2965
|
+
float sundisk = smoothstep( sunAngularDiameterCos, sunAngularDiameterCos + 0.00002, cosTheta );
|
|
2966
|
+
L0 += ( vSunE * 19000.0 * Fex ) * sundisk;
|
|
2967
|
+
|
|
2968
|
+
vec3 texColor = ( Lin + L0 ) * 0.04 + vec3( 0.0, 0.0003, 0.00075 );
|
|
2969
|
+
|
|
2970
|
+
vec3 retColor = pow( texColor, vec3( 1.0 / ( 1.2 + ( 1.2 * vSunfade ) ) ) );
|
|
2971
|
+
|
|
2972
|
+
gl_FragColor = vec4( retColor, 1.0 );
|
|
2973
|
+
|
|
2974
|
+
#include <tonemapping_fragment>
|
|
2975
|
+
#include <colorspace_fragment>
|
|
2976
|
+
}
|
|
2977
|
+
`
|
|
2978
|
+
}, te = {
|
|
2979
|
+
uniforms: {
|
|
2980
|
+
topColor: { value: new K(0.5, 0.8, 1) },
|
|
2981
|
+
bottomColor: { value: new K(1, 1, 1) }
|
|
2982
|
+
},
|
|
2668
2983
|
vertexShader: `
|
|
2669
2984
|
varying vec3 vPosition;
|
|
2670
2985
|
void main() {
|
|
@@ -2673,15 +2988,15 @@ const se = {
|
|
|
2673
2988
|
}
|
|
2674
2989
|
`,
|
|
2675
2990
|
fragmentShader: `
|
|
2991
|
+
uniform vec3 topColor;
|
|
2992
|
+
uniform vec3 bottomColor;
|
|
2676
2993
|
varying vec3 vPosition;
|
|
2677
2994
|
void main() {
|
|
2678
2995
|
float y = normalize(vPosition).y * 0.5 + 0.5; // Normalizing y to range 0 to 1
|
|
2679
|
-
vec3 topColor = vec3(0.5, 0.8, 1.0); // Light blue
|
|
2680
|
-
vec3 bottomColor = vec3(1.0, 1.0, 1.0); // Light white/gray for the horizon
|
|
2681
2996
|
gl_FragColor = vec4(mix(bottomColor, topColor, y), 1.0);
|
|
2682
2997
|
}
|
|
2683
2998
|
`
|
|
2684
|
-
},
|
|
2999
|
+
}, un = {
|
|
2685
3000
|
uniforms: {
|
|
2686
3001
|
tDiffuse: { value: null },
|
|
2687
3002
|
opacity: { value: 1 }
|
|
@@ -2702,10 +3017,10 @@ const se = {
|
|
|
2702
3017
|
gl_FragColor = opacity * texel;
|
|
2703
3018
|
}
|
|
2704
3019
|
`
|
|
2705
|
-
},
|
|
3020
|
+
}, oe = {
|
|
2706
3021
|
uniforms: {
|
|
2707
|
-
topColor: { value: new
|
|
2708
|
-
bottomColor: { value: new
|
|
3022
|
+
topColor: { value: new K(51) },
|
|
3023
|
+
bottomColor: { value: new K(17) },
|
|
2709
3024
|
offset: { value: 33 },
|
|
2710
3025
|
exponent: { value: 0.6 }
|
|
2711
3026
|
},
|
|
@@ -2729,322 +3044,330 @@ const se = {
|
|
|
2729
3044
|
}
|
|
2730
3045
|
`
|
|
2731
3046
|
};
|
|
2732
|
-
class
|
|
2733
|
-
constructor(
|
|
2734
|
-
super()
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
3047
|
+
class mn extends d {
|
|
3048
|
+
constructor() {
|
|
3049
|
+
super();
|
|
3050
|
+
N(this, "geometry");
|
|
3051
|
+
N(this, "material");
|
|
3052
|
+
this.geometry = new S(1, 1, 1), this.material = new $({
|
|
3053
|
+
uniforms: ee.uniforms,
|
|
3054
|
+
vertexShader: ee.vertexShader,
|
|
3055
|
+
fragmentShader: ee.fragmentShader,
|
|
3056
|
+
depthWrite: !1,
|
|
3057
|
+
side: re
|
|
3058
|
+
}), this.scale.setScalar(45e4);
|
|
3059
|
+
const o = F.degToRad(89), n = F.degToRad(180), a = new g().setFromSphericalCoords(1, o, n);
|
|
3060
|
+
this.material.uniforms.sunPosition.value = a;
|
|
3061
|
+
}
|
|
3062
|
+
/**
|
|
3063
|
+
* Set the sun position.
|
|
3064
|
+
*
|
|
3065
|
+
* Elevation (theta, θ)
|
|
3066
|
+
* - Angle measured above or below the horizon (from the xy-plane towards the zenith or nadir).
|
|
3067
|
+
* - Ranges from 0 to π/2 radians (or 0 to 90 degrees).
|
|
3068
|
+
* - This is the vertical angle in the xy-plane.
|
|
3069
|
+
*
|
|
3070
|
+
* Azimuth (phi, φ)
|
|
3071
|
+
* - Angle measured around the horizon from a reference direction (e.g., north, east).
|
|
3072
|
+
* - Ranges from 0 to 2π radians (or 0 to 360 degrees).
|
|
3073
|
+
* - This is the horizontal angle in the xy-plane.
|
|
3074
|
+
*/
|
|
3075
|
+
sunPosition(o, n) {
|
|
3076
|
+
const a = new g();
|
|
3077
|
+
a.setFromSphericalCoords(1, o, n), this.material.uniforms.sunPosition.value = a;
|
|
3078
|
+
}
|
|
3079
|
+
}
|
|
3080
|
+
class hn extends d {
|
|
3081
|
+
constructor(o = 1e3) {
|
|
3082
|
+
super();
|
|
3083
|
+
N(this, "geometry");
|
|
3084
|
+
N(this, "material");
|
|
3085
|
+
this.geometry = new S(o, o, o), this.material = new $({
|
|
3086
|
+
uniforms: te.uniforms,
|
|
3087
|
+
vertexShader: te.vertexShader,
|
|
3088
|
+
fragmentShader: te.fragmentShader,
|
|
3089
|
+
side: re
|
|
2748
3090
|
});
|
|
2749
3091
|
}
|
|
2750
3092
|
}
|
|
2751
|
-
class
|
|
2752
|
-
constructor(
|
|
3093
|
+
class fn extends d {
|
|
3094
|
+
constructor(o = 1e3) {
|
|
2753
3095
|
super();
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
3096
|
+
N(this, "geometry");
|
|
3097
|
+
N(this, "material");
|
|
3098
|
+
this.geometry = new z(o, 32, 15), this.material = new $({
|
|
3099
|
+
vertexShader: oe.vertexShader,
|
|
3100
|
+
fragmentShader: oe.fragmentShader,
|
|
3101
|
+
uniforms: oe.uniforms,
|
|
3102
|
+
side: re
|
|
3103
|
+
});
|
|
2762
3104
|
}
|
|
2763
3105
|
}
|
|
2764
|
-
const
|
|
3106
|
+
const pn = (t) => {
|
|
2765
3107
|
const e = new Uint8Array(4 * t * t);
|
|
2766
3108
|
for (let n = 0; n < t * t; n++) {
|
|
2767
|
-
const
|
|
2768
|
-
e[
|
|
3109
|
+
const a = n * 4, r = (n % t ^ Math.floor(n / t)) & 1 ? 255 : 0;
|
|
3110
|
+
e[a] = r, e[a + 1] = r, e[a + 2] = r, e[a + 3] = 255;
|
|
2769
3111
|
}
|
|
2770
|
-
const o = new
|
|
2771
|
-
return o.wrapS =
|
|
3112
|
+
const o = new Ge(e, t, t, Pe, Te);
|
|
3113
|
+
return o.wrapS = ie, o.wrapT = ie, o.minFilter = Ce, o.needsUpdate = !0, o;
|
|
2772
3114
|
};
|
|
2773
|
-
function
|
|
2774
|
-
const e = new
|
|
3115
|
+
function dn(t) {
|
|
3116
|
+
const e = new ae().setFromObject(t), o = new g();
|
|
2775
3117
|
e.getCenter(o), t.position.sub(o);
|
|
2776
3118
|
}
|
|
2777
|
-
function
|
|
2778
|
-
const o = new
|
|
3119
|
+
function yn(t, e = new g(0, 0, 0)) {
|
|
3120
|
+
const o = new ae().setFromObject(t), n = new g();
|
|
2779
3121
|
o.getCenter(n);
|
|
2780
|
-
const
|
|
2781
|
-
t.position.add(
|
|
3122
|
+
const a = new g().subVectors(e, n);
|
|
3123
|
+
t.position.add(a);
|
|
2782
3124
|
}
|
|
2783
|
-
function
|
|
3125
|
+
function wn(t) {
|
|
2784
3126
|
t.computeBoundingBox();
|
|
2785
|
-
const
|
|
2786
|
-
|
|
3127
|
+
const e = t.boundingBox;
|
|
3128
|
+
if (e) {
|
|
3129
|
+
const o = e.getCenter(new g());
|
|
3130
|
+
t.translateX(-o.x), t.translateY(-o.y), t.translateZ(-o.z);
|
|
3131
|
+
}
|
|
2787
3132
|
}
|
|
2788
|
-
function
|
|
3133
|
+
function Dt(t, e, o) {
|
|
2789
3134
|
return Math.max(0, Math.min(1, (t - e) / (o - e)));
|
|
2790
3135
|
}
|
|
2791
|
-
function
|
|
3136
|
+
function vn(t, e, o, n, a, r = 20, s = 0, c = 1) {
|
|
2792
3137
|
const i = [];
|
|
2793
|
-
for (let l = 0; l <=
|
|
2794
|
-
const u = l /
|
|
2795
|
-
i.push(new
|
|
3138
|
+
for (let l = 0; l <= r; l++) {
|
|
3139
|
+
const u = l / r, m = t(Dt(u, s, c)), h = e + m * (o - e), f = n + u * (a - n);
|
|
3140
|
+
i.push(new b(h, f));
|
|
2796
3141
|
}
|
|
2797
3142
|
return i;
|
|
2798
3143
|
}
|
|
2799
|
-
function
|
|
2800
|
-
const o = new
|
|
3144
|
+
function Mn(t) {
|
|
3145
|
+
const o = new ae().setFromObject(t).getCenter(new g());
|
|
2801
3146
|
t.translateX(-o.x), t.translateY(-o.y), t.translateZ(-o.z), t.updateMatrixWorld(!0);
|
|
2802
3147
|
}
|
|
2803
|
-
function
|
|
3148
|
+
function xn(t) {
|
|
2804
3149
|
t.geometry.computeBoundingBox();
|
|
2805
|
-
const
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
let a = [];
|
|
2810
|
-
for (let s = 0; s <= r; s++) {
|
|
2811
|
-
const c = s / r, i = B.CUBIC(c, t.x, e.x, o.x, n.x), l = B.CUBIC(c, t.y, e.y, o.y, n.y);
|
|
2812
|
-
a.push(new v(i, l));
|
|
3150
|
+
const e = t.geometry.boundingBox;
|
|
3151
|
+
if (e) {
|
|
3152
|
+
const o = e.getCenter(new g());
|
|
3153
|
+
t.geometry.translate(-o.x, -o.y, -o.z);
|
|
2813
3154
|
}
|
|
2814
|
-
|
|
2815
|
-
|
|
3155
|
+
}
|
|
3156
|
+
const qt = (t, e, o, n, a = 24) => {
|
|
2816
3157
|
let r = [];
|
|
2817
|
-
for (let
|
|
2818
|
-
const
|
|
2819
|
-
r.push(new
|
|
3158
|
+
for (let s = 0; s <= a; s++) {
|
|
3159
|
+
const c = s / a, i = k.CUBIC(c, t.x, e.x, o.x, n.x), l = k.CUBIC(c, t.y, e.y, o.y, n.y);
|
|
3160
|
+
r.push(new b(i, l));
|
|
2820
3161
|
}
|
|
2821
3162
|
return r;
|
|
2822
|
-
},
|
|
2823
|
-
let a = [];
|
|
2824
|
-
for (let s = 0; s <= r; s++) {
|
|
2825
|
-
const c = s / r, i = B.EXPONENTIAL(c, o, n) * (e.x - t.x) + t.x, l = t.y + c * (e.y - t.y);
|
|
2826
|
-
a.push(new v(i, l));
|
|
2827
|
-
}
|
|
2828
|
-
return a;
|
|
2829
|
-
}, Zt = (t, e, o, n, r = 24) => {
|
|
3163
|
+
}, Xt = (t, e, o, n = 24) => {
|
|
2830
3164
|
let a = [];
|
|
2831
|
-
for (let
|
|
2832
|
-
const
|
|
2833
|
-
a.push(new
|
|
3165
|
+
for (let r = 0; r <= n; r++) {
|
|
3166
|
+
const s = r / n, c = k.DAMPED(s, o) * (e.x - t.x) + t.x, i = t.y + s * (e.y - t.y);
|
|
3167
|
+
a.push(new b(c, i));
|
|
2834
3168
|
}
|
|
2835
3169
|
return a;
|
|
2836
|
-
},
|
|
2837
|
-
let s = [];
|
|
2838
|
-
for (let c = 0; c <= a; c++) {
|
|
2839
|
-
const i = c / a, l = o * i * i + n * i + r + t.x, u = t.y + i * (e.y - t.y);
|
|
2840
|
-
s.push(new v(l, u));
|
|
2841
|
-
}
|
|
2842
|
-
return s;
|
|
2843
|
-
}, Qt = (t, e, o, n = 24) => {
|
|
3170
|
+
}, Vt = (t, e, o, n, a = 24) => {
|
|
2844
3171
|
let r = [];
|
|
2845
|
-
for (let
|
|
2846
|
-
const
|
|
2847
|
-
r.push(new
|
|
3172
|
+
for (let s = 0; s <= a; s++) {
|
|
3173
|
+
const c = s / a, i = k.EXPONENTIAL(c, o, n) * (e.x - t.x) + t.x, l = t.y + c * (e.y - t.y);
|
|
3174
|
+
r.push(new b(i, l));
|
|
2848
3175
|
}
|
|
2849
3176
|
return r;
|
|
2850
|
-
},
|
|
3177
|
+
}, Zt = (t, e, o, n, a = 24) => {
|
|
2851
3178
|
let r = [];
|
|
2852
|
-
for (let
|
|
2853
|
-
const
|
|
2854
|
-
r.push(new
|
|
3179
|
+
for (let s = 0; s <= a; s++) {
|
|
3180
|
+
const c = s / a, i = k.LOGARITHMIC(c, o, n) * (e.x - t.x) + t.x, l = t.y + c * (e.y - t.y);
|
|
3181
|
+
r.push(new b(i, l));
|
|
2855
3182
|
}
|
|
2856
3183
|
return r;
|
|
2857
|
-
},
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
createParabolicCurvePoints: Yt,
|
|
2863
|
-
createQuadraticCurvePoints: Qt,
|
|
2864
|
-
createSigmoidCurvePoints: Ht
|
|
2865
|
-
};
|
|
2866
|
-
class Gn {
|
|
2867
|
-
static dispose(e) {
|
|
2868
|
-
e == null || e.traverse((o) => {
|
|
2869
|
-
o.geometry && o.geometry.dispose(), o.material && (Array.isArray(o.material) ? o.material.forEach((n) => n.dispose()) : o.material.dispose());
|
|
2870
|
-
});
|
|
3184
|
+
}, Ht = (t, e, o, n, a, r = 24) => {
|
|
3185
|
+
let s = [];
|
|
3186
|
+
for (let c = 0; c <= r; c++) {
|
|
3187
|
+
const i = c / r, l = o * i * i + n * i + a + t.x, u = t.y + i * (e.y - t.y);
|
|
3188
|
+
s.push(new b(l, u));
|
|
2871
3189
|
}
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
function u(h) {
|
|
2879
|
-
l || (l = h);
|
|
2880
|
-
const p = (h - l) / 1e3 / a;
|
|
2881
|
-
i.uniforms.opacity.value = Math.max(1 - p, 0), p < 1 ? (s.render(), requestAnimationFrame(u)) : (s.passes[0] = new ne(r, o), l = null, requestAnimationFrame(m));
|
|
2882
|
-
}
|
|
2883
|
-
function m(h) {
|
|
2884
|
-
l || (l = h);
|
|
2885
|
-
const p = (h - l) / 1e3 / a;
|
|
2886
|
-
i.uniforms.opacity.value = Math.min(p, 1), p < 1 && (s.render(), requestAnimationFrame(m));
|
|
2887
|
-
}
|
|
2888
|
-
requestAnimationFrame(u);
|
|
3190
|
+
return s;
|
|
3191
|
+
}, Yt = (t, e, o, n = 24) => {
|
|
3192
|
+
let a = [];
|
|
3193
|
+
for (let r = 0; r <= n; r++) {
|
|
3194
|
+
const s = r / n, c = k.QUADRATIC(s, t.x, e.x, o.x), i = k.QUADRATIC(s, t.y, e.y, o.y);
|
|
3195
|
+
a.push(new b(c, i));
|
|
2889
3196
|
}
|
|
2890
|
-
|
|
3197
|
+
return a;
|
|
3198
|
+
}, jt = (t, e, o, n = 24) => {
|
|
3199
|
+
let a = [];
|
|
3200
|
+
for (let r = 0; r <= n; r++) {
|
|
3201
|
+
const s = r / n, c = k.SIGMOID(s, o) * (e.x - t.x) + t.x, i = t.y + s * (e.y - t.y);
|
|
3202
|
+
a.push(new b(c, i));
|
|
3203
|
+
}
|
|
3204
|
+
return a;
|
|
3205
|
+
}, gn = {
|
|
3206
|
+
createCubicCurvePoints: qt,
|
|
3207
|
+
createDampedCurvePoints: Xt,
|
|
3208
|
+
createExponentialCurvePoints: Vt,
|
|
3209
|
+
createLogarithmicCurvePoints: Zt,
|
|
3210
|
+
createParabolicCurvePoints: Ht,
|
|
3211
|
+
createQuadraticCurvePoints: Yt,
|
|
3212
|
+
createSigmoidCurvePoints: jt
|
|
3213
|
+
};
|
|
2891
3214
|
export {
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
3215
|
+
mn as AtmosphericSkybox,
|
|
3216
|
+
_o as Beaker,
|
|
3217
|
+
Pt as BeakerGeometry,
|
|
3218
|
+
io as BifurcatedStaircaseGeometry,
|
|
3219
|
+
tn as Bone,
|
|
3220
|
+
Gt as BoneGeometry,
|
|
3221
|
+
xo as Book,
|
|
3222
|
+
he as BookGeometry,
|
|
3223
|
+
To as Bookshelf,
|
|
3224
|
+
It as BookshelfGeometry,
|
|
3225
|
+
ko as Bottle,
|
|
3226
|
+
so as Bubbling,
|
|
3227
|
+
Ro as BunsenBurner,
|
|
3228
|
+
$o as Burst,
|
|
3229
|
+
kt as BurstShape,
|
|
3230
|
+
Bo as Candle,
|
|
3231
|
+
go as CrossHeadstone,
|
|
3232
|
+
vt as CrossHeadstoneGeometry,
|
|
3233
|
+
hn as DaySkybox,
|
|
3234
|
+
Co as Desk,
|
|
3235
|
+
lo as DioramaGeometry,
|
|
3236
|
+
L as Direction,
|
|
3237
|
+
no as Easing,
|
|
3238
|
+
Fo as ElectricPanel,
|
|
3239
|
+
Lo as ErlenmeyerFlask,
|
|
3240
|
+
Tt as ErlenmeyerFlaskGeometry,
|
|
3241
|
+
Q as Falloff,
|
|
3242
|
+
Ao as FenceColumn,
|
|
3243
|
+
bt as FenceColumnGeometry,
|
|
3244
|
+
Do as Flask,
|
|
3245
|
+
Jo as Gear,
|
|
3246
|
+
Rt as GearShape,
|
|
3247
|
+
Wo as Heart,
|
|
3248
|
+
Ft as HeartShape,
|
|
3249
|
+
nn as Hill,
|
|
3250
|
+
Nt as HillGeometry,
|
|
3251
|
+
uo as LShapedStaircaseGeometry,
|
|
3252
|
+
Uo as Lantern,
|
|
3253
|
+
qo as LeverPanel,
|
|
3254
|
+
bo as Mausoleum,
|
|
3255
|
+
Xo as Microscope,
|
|
3256
|
+
Mo as Moon,
|
|
3257
|
+
Vo as MortarAndPestle,
|
|
2934
3258
|
Ct as MortarGeometry,
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
vo as
|
|
2976
|
-
|
|
2977
|
-
yn as
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
Ke as circularEaseIn,
|
|
3259
|
+
No as MossyRocks,
|
|
3260
|
+
sn as Mound,
|
|
3261
|
+
zt as MoundGeometry,
|
|
3262
|
+
fn as NightSkybox,
|
|
3263
|
+
So as ObeliskHeadstone,
|
|
3264
|
+
Mt as ObeliskHeadstoneGeometry,
|
|
3265
|
+
k as ParametricCurve,
|
|
3266
|
+
gn as ParametricCurveUtils,
|
|
3267
|
+
Oo as Rock,
|
|
3268
|
+
At as RockGeometry,
|
|
3269
|
+
zo as Rocks,
|
|
3270
|
+
Io as RoundedHeadstone,
|
|
3271
|
+
xt as RoundedHeadstoneGeometry,
|
|
3272
|
+
fo as SimpleLeafGeometry,
|
|
3273
|
+
mo as SpiralStaircaseGeometry,
|
|
3274
|
+
Zo as SpiralTube,
|
|
3275
|
+
Eo as SquareHeadstone,
|
|
3276
|
+
gt as SquareHeadstoneGeometry,
|
|
3277
|
+
ho as StaircaseGeometry,
|
|
3278
|
+
Ho as Stand,
|
|
3279
|
+
Bt as StandGeometry,
|
|
3280
|
+
en as Star,
|
|
3281
|
+
Lt as StarShape,
|
|
3282
|
+
Yo as TeslaCoil,
|
|
3283
|
+
jo as TestTube,
|
|
3284
|
+
ne as TestTubeGeometry,
|
|
3285
|
+
Qo as TestTubeRack,
|
|
3286
|
+
on as Tree,
|
|
3287
|
+
_t as TreeGeometry,
|
|
3288
|
+
Ko as WineBottle,
|
|
3289
|
+
Ut as WineBottleGeometry,
|
|
3290
|
+
Go as WroughtIronBar,
|
|
3291
|
+
de as WroughtIronBarGeometry,
|
|
3292
|
+
Po as WroughtIronFence,
|
|
3293
|
+
St as WroughtIronFenceGeometry,
|
|
3294
|
+
cn as addNoiseDisplacement,
|
|
3295
|
+
rn as addWaterDisplacement,
|
|
3296
|
+
ee as atmosphericShader,
|
|
3297
|
+
Ot as capHeightFromRadius,
|
|
3298
|
+
yo as capWidthFromRadius,
|
|
3299
|
+
vo as cartesianToSpherical,
|
|
3300
|
+
dn as centerGroup,
|
|
3301
|
+
yn as centerGroupAtTarget,
|
|
3302
|
+
wn as centerInstancedMesh,
|
|
3303
|
+
Mn as centerMesh,
|
|
3304
|
+
xn as centerMeshGeometry,
|
|
3305
|
+
pn as checkerboardTexture,
|
|
3306
|
+
Qe as circularEaseIn,
|
|
2984
3307
|
$e as circularEaseInOut,
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
3308
|
+
Ke as circularEaseOut,
|
|
3309
|
+
et as concave,
|
|
3310
|
+
tt as convex,
|
|
3311
|
+
qt as createCubicCurvePoints,
|
|
3312
|
+
Xt as createDampedCurvePoints,
|
|
3313
|
+
Vt as createExponentialCurvePoints,
|
|
2991
3314
|
Zt as createLogarithmicCurvePoints,
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3315
|
+
Ht as createParabolicCurvePoints,
|
|
3316
|
+
Yt as createQuadraticCurvePoints,
|
|
3317
|
+
jt as createSigmoidCurvePoints,
|
|
3318
|
+
at as cubicCurve,
|
|
3319
|
+
ke as cubicEaseIn,
|
|
3320
|
+
Fe as cubicEaseInOut,
|
|
3321
|
+
Re as cubicEaseOut,
|
|
3322
|
+
ct as dampedCurve,
|
|
3323
|
+
te as daySkyShader,
|
|
3324
|
+
$t as displacementBrush,
|
|
3325
|
+
it as exponentialCurve,
|
|
3326
|
+
He as exponentialEaseIn,
|
|
3004
3327
|
je as exponentialEaseInOut,
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3328
|
+
Ye as exponentialEaseOut,
|
|
3329
|
+
un as fadeShader,
|
|
3330
|
+
Jt as flattenBrush,
|
|
3331
|
+
rt as gaussian,
|
|
3332
|
+
vn as interpolateCurve,
|
|
3333
|
+
st as inverse,
|
|
3334
|
+
Je as linear,
|
|
3335
|
+
ot as logarithmic,
|
|
3336
|
+
lt as logarithmicCurve,
|
|
3337
|
+
yt as logarithmicRandomMax,
|
|
3015
3338
|
wt as logarithmicRandomMin,
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3339
|
+
oe as nightSkyShader,
|
|
3340
|
+
Wt as noiseBrush,
|
|
3341
|
+
ut as parabolicCurve,
|
|
3342
|
+
mt as quadraticCurve,
|
|
3020
3343
|
Oe as quadraticEaseIn,
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3344
|
+
_e as quadraticEaseInOut,
|
|
3345
|
+
ze as quadraticEaseOut,
|
|
3346
|
+
Le as quarticEaseIn,
|
|
3347
|
+
qe as quarticEaseInOut,
|
|
3348
|
+
De as quarticEaseOut,
|
|
3349
|
+
Xe as quinticEaseIn,
|
|
3350
|
+
Ze as quinticEaseInOut,
|
|
3351
|
+
Ve as quinticEaseOut,
|
|
3352
|
+
po as radiusFromCapHeight,
|
|
3353
|
+
ye as radiusFromCapWidth,
|
|
3354
|
+
dt as randomFloat,
|
|
3355
|
+
ro as randomInteger,
|
|
3356
|
+
Et as randomTransformVertices,
|
|
3357
|
+
ao as rowOfBooksByCount,
|
|
3358
|
+
co as rowOfBooksByLength,
|
|
3359
|
+
pe as rowOfBooksByScales,
|
|
3360
|
+
ht as sigmoidCurve,
|
|
3361
|
+
Be as sineEaseIn,
|
|
3362
|
+
Ne as sineEaseInOut,
|
|
3363
|
+
Ue as sineEaseOut,
|
|
3364
|
+
eo as smoothBrush,
|
|
3365
|
+
We as smoothstep,
|
|
3366
|
+
wo as sphericalToCartesian,
|
|
3367
|
+
to as spikeBrush,
|
|
3368
|
+
nt as squareRoot,
|
|
3369
|
+
oo as twistBrush,
|
|
3370
|
+
ln as updateNoiseDisplacementTime,
|
|
3371
|
+
an as updateWaterDisplacementTime
|
|
3049
3372
|
};
|
|
3050
3373
|
//# sourceMappingURL=index.es.js.map
|