@tresjs/core 4.2.1 → 4.2.3
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/src/utils/is.d.ts +2 -1
- package/dist/tres.js +506 -503
- package/dist/tres.umd.cjs +2 -2
- package/package.json +1 -1
package/dist/tres.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name: @tresjs/core
|
|
3
|
-
* version: v4.2.
|
|
3
|
+
* version: v4.2.3
|
|
4
4
|
* (c) 2024
|
|
5
5
|
* description: Declarative ThreeJS using Vue Components
|
|
6
6
|
* author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
var bt = Object.defineProperty;
|
|
9
9
|
var Pt = (e, t, n) => t in e ? bt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
10
10
|
var me = (e, t, n) => Pt(e, typeof t != "symbol" ? t + "" : t, n);
|
|
11
|
-
import { ref as
|
|
11
|
+
import { ref as H, computed as V, watchEffect as Te, onUnmounted as K, shallowRef as $, watch as ce, readonly as ye, unref as J, provide as _e, inject as Mt, isRef as Ct, reactive as Et, defineComponent as Be, useSlots as Tt, getCurrentInstance as Ie, onMounted as St, openBlock as At, createElementBlock as kt, normalizeClass as xt, normalizeStyle as Lt, createRenderer as Rt, h as He, Fragment as Ot } from "vue";
|
|
12
12
|
import * as et from "three";
|
|
13
|
-
import { PerspectiveCamera as we, Camera as Dt, Clock as tt, Vector3 as Se, Color as
|
|
13
|
+
import { PerspectiveCamera as we, Camera as Dt, Clock as tt, Vector3 as Se, Color as Z, Scene as nt, MathUtils as rt, MeshBasicMaterial as ot, DoubleSide as jt, REVISION as Bt, SRGBColorSpace as It, ACESFilmicToneMapping as st, PCFSoftShadowMap as Ht, NoToneMapping as $t, WebGLRenderer as he, TextureLoader as Ut, Vector2 as ge, Raycaster as Ft, BufferAttribute as Wt, Object3D as Nt, Line as zt, BufferGeometry as $e, Float32BufferAttribute as Ue, LineBasicMaterial as Gt, Mesh as Vt, BackSide as Yt, DirectionalLightHelper as qt, PointLightHelper as Jt, SpotLightHelper as Kt, HemisphereLightHelper as Qt, ArrowHelper as Xt } from "three";
|
|
14
14
|
import { createEventHook as j, useRafFn as it, toValue as k, unrefElement as Zt, useDevicePixelRatio as en, usePointer as tn, useElementBounding as nn, useWindowSize as rn, useElementSize as on, refDebounced as Fe, tryOnScopeDispose as sn, useFps as an, useMemory as ln } from "@vueuse/core";
|
|
15
|
-
const cn = "@tresjs/core", un = "module", fn = "4.2.
|
|
15
|
+
const cn = "@tresjs/core", un = "module", fn = "4.2.3", dn = "pnpm@9.1.4", pn = "Declarative ThreeJS using Vue Components", mn = "Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)", hn = "MIT", gn = [
|
|
16
16
|
"vue",
|
|
17
17
|
"3d",
|
|
18
18
|
"threejs",
|
|
@@ -140,38 +140,41 @@ function kn(e) {
|
|
|
140
140
|
function at(e) {
|
|
141
141
|
return typeof e == "string";
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function G(e) {
|
|
144
144
|
return typeof e == "function";
|
|
145
145
|
}
|
|
146
|
-
function
|
|
147
|
-
return e === Object(e) && !de(e) && !
|
|
146
|
+
function U(e) {
|
|
147
|
+
return e === Object(e) && !de(e) && !G(e);
|
|
148
148
|
}
|
|
149
|
-
function
|
|
150
|
-
return
|
|
149
|
+
function N(e) {
|
|
150
|
+
return U(e) && "isObject3D" in e && !!e.isObject3D;
|
|
151
151
|
}
|
|
152
152
|
function We(e) {
|
|
153
|
-
return
|
|
153
|
+
return U(e) && "isCamera" in e && !!e.isCamera;
|
|
154
154
|
}
|
|
155
155
|
function xn(e) {
|
|
156
|
-
return
|
|
156
|
+
return U(e) && "isBufferGeometry" in e && !!e.isBufferGeometry;
|
|
157
157
|
}
|
|
158
158
|
function Ln(e) {
|
|
159
|
-
return
|
|
159
|
+
return U(e) && "isMaterial" in e && !!e.isMaterial;
|
|
160
160
|
}
|
|
161
161
|
function Rn(e) {
|
|
162
|
-
return
|
|
162
|
+
return U(e) && "isLight" in e && !!e.isLight;
|
|
163
163
|
}
|
|
164
164
|
function On(e) {
|
|
165
|
-
return
|
|
166
|
-
}
|
|
167
|
-
function re(e) {
|
|
168
|
-
return W(e) || xn(e) || Ln(e) || Rn(e);
|
|
165
|
+
return U(e) && "isFog" in e && !!e.isFog;
|
|
169
166
|
}
|
|
170
167
|
function Dn(e) {
|
|
171
|
-
return
|
|
168
|
+
return U(e) && "isScene" in e && !!e.isScene;
|
|
169
|
+
}
|
|
170
|
+
function oe(e) {
|
|
171
|
+
return N(e) || xn(e) || Ln(e) || On(e);
|
|
172
172
|
}
|
|
173
|
-
|
|
174
|
-
|
|
173
|
+
function jn(e) {
|
|
174
|
+
return U(e) && !!e.isPrimitive;
|
|
175
|
+
}
|
|
176
|
+
const Bn = ({ sizes: e }) => {
|
|
177
|
+
const t = H([]), n = V(
|
|
175
178
|
() => t.value[0]
|
|
176
179
|
), r = (i) => {
|
|
177
180
|
const l = i instanceof Dt ? i : t.value.find((o) => o.uuid === i);
|
|
@@ -194,9 +197,9 @@ const jn = ({ sizes: e }) => {
|
|
|
194
197
|
};
|
|
195
198
|
return Te(() => {
|
|
196
199
|
e.aspectRatio.value && t.value.forEach((i) => {
|
|
197
|
-
!i.manual && (i instanceof we ||
|
|
200
|
+
!i.manual && (i instanceof we || In(i)) && (i instanceof we ? i.aspect = e.aspectRatio.value : (i.left = e.width.value * -0.5, i.right = e.width.value * 0.5, i.top = e.height.value * 0.5, i.bottom = e.height.value * -0.5), i.updateProjectionMatrix());
|
|
198
201
|
});
|
|
199
|
-
}),
|
|
202
|
+
}), K(() => {
|
|
200
203
|
t.value = [];
|
|
201
204
|
}), {
|
|
202
205
|
camera: n,
|
|
@@ -206,12 +209,12 @@ const jn = ({ sizes: e }) => {
|
|
|
206
209
|
setCameraActive: r
|
|
207
210
|
};
|
|
208
211
|
};
|
|
209
|
-
function
|
|
212
|
+
function In(e) {
|
|
210
213
|
return e.hasOwnProperty("isOrthographicCamera") && e.isOrthographicCamera;
|
|
211
214
|
}
|
|
212
215
|
const lt = j(), ct = j(), Ae = j(), ee = new tt();
|
|
213
216
|
let ue = 0, fe = 0;
|
|
214
|
-
const { pause:
|
|
217
|
+
const { pause: Hn, resume: Ne, isActive: $n } = it(
|
|
215
218
|
() => {
|
|
216
219
|
lt.trigger({ delta: ue, elapsed: fe, clock: ee }), ct.trigger({ delta: ue, elapsed: fe, clock: ee }), Ae.trigger({ delta: ue, elapsed: fe, clock: ee });
|
|
217
220
|
},
|
|
@@ -221,20 +224,20 @@ Ae.on(() => {
|
|
|
221
224
|
ue = ee.getDelta(), fe = ee.getElapsedTime();
|
|
222
225
|
});
|
|
223
226
|
let ze = !1;
|
|
224
|
-
const
|
|
227
|
+
const Ur = () => (ze || (ze = !0, Ne()), {
|
|
225
228
|
onBeforeLoop: lt.on,
|
|
226
229
|
onLoop: ct.on,
|
|
227
230
|
onAfterLoop: Ae.on,
|
|
228
|
-
pause:
|
|
231
|
+
pause: Hn,
|
|
229
232
|
resume: Ne,
|
|
230
|
-
isActive:
|
|
231
|
-
}),
|
|
232
|
-
function
|
|
233
|
+
isActive: $n
|
|
234
|
+
}), Fr = !0, se = "[TresJS ▲ ■ ●] ";
|
|
235
|
+
function Y() {
|
|
233
236
|
function e(...r) {
|
|
234
|
-
typeof r[0] == "string" ? r[0] =
|
|
237
|
+
typeof r[0] == "string" ? r[0] = se + r[0] : r.unshift(se), console.error(...r);
|
|
235
238
|
}
|
|
236
239
|
function t(...r) {
|
|
237
|
-
typeof r[0] == "string" ? r[0] =
|
|
240
|
+
typeof r[0] == "string" ? r[0] = se + r[0] : r.unshift(se), console.warn(...r);
|
|
238
241
|
}
|
|
239
242
|
function n(r, s) {
|
|
240
243
|
}
|
|
@@ -244,13 +247,13 @@ function z() {
|
|
|
244
247
|
logMessage: n
|
|
245
248
|
};
|
|
246
249
|
}
|
|
247
|
-
function
|
|
250
|
+
function Wr(e) {
|
|
248
251
|
return typeof e == "number" ? [e, e, e] : e instanceof Se ? [e.x, e.y, e.z] : e;
|
|
249
252
|
}
|
|
250
|
-
function
|
|
251
|
-
return e instanceof
|
|
253
|
+
function Un(e) {
|
|
254
|
+
return e instanceof Z ? e : Array.isArray(e) ? new Z(...e) : new Z(e);
|
|
252
255
|
}
|
|
253
|
-
class
|
|
256
|
+
class Fn extends et.Mesh {
|
|
254
257
|
constructor(...n) {
|
|
255
258
|
super(...n);
|
|
256
259
|
me(this, "type", "HightlightMesh");
|
|
@@ -266,18 +269,18 @@ const ut = (e, t) => {
|
|
|
266
269
|
for (const n of Object.keys(t))
|
|
267
270
|
t[n] instanceof Object && Object.assign(t[n], ut(e[n], t[n]));
|
|
268
271
|
return Object.assign(e || {}, t), e;
|
|
269
|
-
},
|
|
272
|
+
}, Wn = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot", Nn = /* @__PURE__ */ Vn(Wn);
|
|
270
273
|
function Ge(e) {
|
|
271
274
|
return e && e.nodeType === 1;
|
|
272
275
|
}
|
|
273
|
-
function
|
|
276
|
+
function ie(e) {
|
|
274
277
|
return e.replace(/-([a-z])/g, (t, n) => n.toUpperCase());
|
|
275
278
|
}
|
|
276
|
-
const
|
|
277
|
-
function
|
|
278
|
-
return e.replace(
|
|
279
|
+
const zn = /\B([A-Z])/g;
|
|
280
|
+
function Gn(e) {
|
|
281
|
+
return e.replace(zn, "-$1").toLowerCase();
|
|
279
282
|
}
|
|
280
|
-
function
|
|
283
|
+
function Vn(e, t) {
|
|
281
284
|
const n = /* @__PURE__ */ Object.create(null), r = e.split(",");
|
|
282
285
|
for (let s = 0; s < r.length; s++)
|
|
283
286
|
n[r[s]] = !0;
|
|
@@ -288,7 +291,7 @@ const Ve = (e, t) => {
|
|
|
288
291
|
return;
|
|
289
292
|
const n = Array.isArray(t) ? t : t.match(/([^[.\]])+/g);
|
|
290
293
|
return n == null ? void 0 : n.reduce((r, s) => r && r[s], e);
|
|
291
|
-
},
|
|
294
|
+
}, Yn = (e, t, n) => {
|
|
292
295
|
const r = Array.isArray(t) ? t : t.match(/([^[.\]])+/g);
|
|
293
296
|
r && r.reduce((s, a, i) => (s[a] === void 0 && (s[a] = {}), i === r.length - 1 && (s[a] = n), s[a]), e);
|
|
294
297
|
};
|
|
@@ -309,7 +312,7 @@ function ft(e, t) {
|
|
|
309
312
|
return !1;
|
|
310
313
|
return !0;
|
|
311
314
|
}
|
|
312
|
-
function
|
|
315
|
+
function qn(e, t) {
|
|
313
316
|
if (!Array.isArray(e) || !Array.isArray(t) || e.length !== t.length)
|
|
314
317
|
return !1;
|
|
315
318
|
for (let n = 0; n < e.length; n++)
|
|
@@ -317,8 +320,8 @@ function Yn(e, t) {
|
|
|
317
320
|
return !1;
|
|
318
321
|
return !0;
|
|
319
322
|
}
|
|
320
|
-
const
|
|
321
|
-
function
|
|
323
|
+
const Jn = Array.isArray;
|
|
324
|
+
function Kn(e, t, n, r) {
|
|
322
325
|
const s = (c) => {
|
|
323
326
|
if (c.uuid === t)
|
|
324
327
|
return c;
|
|
@@ -343,7 +346,7 @@ function Jn(e, t, n, r) {
|
|
|
343
346
|
const l = n[n.length - 1];
|
|
344
347
|
i[l] !== void 0 ? i[l] = r : console.warn(`Property path is not valid: ${n.join(".")}`);
|
|
345
348
|
}
|
|
346
|
-
function
|
|
349
|
+
function Qn(e) {
|
|
347
350
|
const t = new ot({
|
|
348
351
|
color: 11003607,
|
|
349
352
|
// Highlight color, e.g., yellow
|
|
@@ -354,18 +357,18 @@ function Kn(e) {
|
|
|
354
357
|
side: jt
|
|
355
358
|
// To e
|
|
356
359
|
});
|
|
357
|
-
return new
|
|
360
|
+
return new Fn(e.geometry.clone(), t);
|
|
358
361
|
}
|
|
359
|
-
function
|
|
362
|
+
function Xn(e) {
|
|
360
363
|
var n;
|
|
361
364
|
let t = e.value;
|
|
362
365
|
return e.value && ((n = e.value) != null && n.isMesh) && (t = e.value.position), Array.isArray(e.value) && (t = new Se(...t)), t;
|
|
363
366
|
}
|
|
364
|
-
function
|
|
367
|
+
function Zn(e) {
|
|
365
368
|
return "map" in e;
|
|
366
369
|
}
|
|
367
370
|
function Ye(e) {
|
|
368
|
-
|
|
371
|
+
Zn(e) && e.map && e.map.dispose(), e.dispose();
|
|
369
372
|
}
|
|
370
373
|
function dt(e) {
|
|
371
374
|
var n, r;
|
|
@@ -374,7 +377,7 @@ function dt(e) {
|
|
|
374
377
|
e && ((r = e.dispose) == null || r.call(e)), s.geometry && (s.geometry.dispose(), delete s.geometry), Array.isArray(s.material) ? (s.material.forEach((a) => Ye(a)), delete s.material) : s.material && (Ye(s.material), delete s.material);
|
|
375
378
|
}
|
|
376
379
|
}
|
|
377
|
-
function
|
|
380
|
+
function er(e, t) {
|
|
378
381
|
let n = 0;
|
|
379
382
|
for (let r = 0; r < e.length; r++)
|
|
380
383
|
t(e[r], r) && (e[n] = e[r], n++);
|
|
@@ -395,7 +398,7 @@ function qe(...e) {
|
|
|
395
398
|
return e.map((t, n) => n === 0 ? t : t.charAt(0).toUpperCase() + t.slice(1)).join("");
|
|
396
399
|
}
|
|
397
400
|
const Je = /-\d+$/;
|
|
398
|
-
function
|
|
401
|
+
function tr(e, t, n) {
|
|
399
402
|
if (at(n)) {
|
|
400
403
|
if (Je.test(n)) {
|
|
401
404
|
const a = n.replace(Je, ""), { target: i, key: l } = Pe(e, a);
|
|
@@ -407,11 +410,11 @@ function er(e, t, n) {
|
|
|
407
410
|
}
|
|
408
411
|
}
|
|
409
412
|
const { target: r, key: s } = Pe(e, n);
|
|
410
|
-
t.__tres.previousAttach = r[s], r[s] =
|
|
413
|
+
t.__tres.previousAttach = r[s], r[s] = Q(t);
|
|
411
414
|
} else
|
|
412
415
|
t.__tres.previousAttach = n(e, t);
|
|
413
416
|
}
|
|
414
|
-
function
|
|
417
|
+
function nr(e, t, n) {
|
|
415
418
|
var r, s, a;
|
|
416
419
|
if (at(n)) {
|
|
417
420
|
const { target: i, key: l } = Pe(e, n), c = t.__tres.previousAttach;
|
|
@@ -420,7 +423,7 @@ function tr(e, t, n) {
|
|
|
420
423
|
(s = (r = t.__tres) == null ? void 0 : r.previousAttach) == null || s.call(r, e, t);
|
|
421
424
|
(a = t.__tres) == null || delete a.previousAttach;
|
|
422
425
|
}
|
|
423
|
-
function
|
|
426
|
+
function z(e, t, n) {
|
|
424
427
|
const r = e;
|
|
425
428
|
return r.__tres = {
|
|
426
429
|
type: "unknown",
|
|
@@ -439,9 +442,9 @@ function pt(e) {
|
|
|
439
442
|
const t = (n = e == null ? void 0 : e.__tres) == null ? void 0 : n.root;
|
|
440
443
|
t && t.render && t.render.canBeInvalidated.value && t.invalidate();
|
|
441
444
|
}
|
|
442
|
-
function
|
|
445
|
+
function rr(e, t, n) {
|
|
443
446
|
var s;
|
|
444
|
-
if (!
|
|
447
|
+
if (!G(e.setPixelRatio))
|
|
445
448
|
return;
|
|
446
449
|
let r = 0;
|
|
447
450
|
if (de(n) && n.length >= 2) {
|
|
@@ -450,29 +453,29 @@ function nr(e, t, n) {
|
|
|
450
453
|
} else kn(n) ? r = n : r = t;
|
|
451
454
|
r !== ((s = e.getPixelRatio) == null ? void 0 : s.call(e)) && e.setPixelRatio(r);
|
|
452
455
|
}
|
|
453
|
-
function
|
|
454
|
-
const a = [...t.__tres.objects], i =
|
|
455
|
-
if (e =
|
|
456
|
+
function or(e, t, n, r, s) {
|
|
457
|
+
const a = [...t.__tres.objects], i = Q(t);
|
|
458
|
+
if (e = Q(e), i === e)
|
|
456
459
|
return !0;
|
|
457
|
-
const l =
|
|
460
|
+
const l = z(e, t.__tres ?? {}, s), c = t.parent ?? t.__tres.parent ?? null, o = { ...t.__tres.memoizedProps };
|
|
458
461
|
delete o.object;
|
|
459
462
|
for (const u of a)
|
|
460
463
|
mt(u, s), ht(u, s);
|
|
461
464
|
i.__tres.objects = [], r.remove(t);
|
|
462
|
-
for (const [u,
|
|
463
|
-
r.patchProp(l, u, l[u],
|
|
465
|
+
for (const [u, y] of Object.entries(o))
|
|
466
|
+
r.patchProp(l, u, l[u], y);
|
|
464
467
|
n(e), r.insert(t, c);
|
|
465
468
|
for (const u of a)
|
|
466
469
|
r.insert(u, t);
|
|
467
470
|
return !0;
|
|
468
471
|
}
|
|
469
|
-
function
|
|
470
|
-
return
|
|
472
|
+
function Q(e) {
|
|
473
|
+
return jn(e) ? (e.object.__tres = e.__tres, e.object) : e;
|
|
471
474
|
}
|
|
472
475
|
function mt(e, t) {
|
|
473
476
|
var r, s, a, i;
|
|
474
477
|
const n = ((r = e.__tres) == null ? void 0 : r.parent) || t.scene.value;
|
|
475
|
-
e.__tres && (e.__tres.parent = null), n && n.__tres && "objects" in n.__tres &&
|
|
478
|
+
e.__tres && (e.__tres.parent = null), n && n.__tres && "objects" in n.__tres && er(n.__tres.objects, (l) => l !== e), (s = e.__tres) != null && s.attach ? nr(n, e, e.__tres.attach) : ((i = (a = e.parent) == null ? void 0 : a.remove) == null || i.call(a, Q(e)), e.parent = null);
|
|
476
479
|
}
|
|
477
480
|
function ht(e, t) {
|
|
478
481
|
var n;
|
|
@@ -481,7 +484,7 @@ function ht(e, t) {
|
|
|
481
484
|
t.deregisterCamera(r), (s = t.eventManager) == null || s.deregisterPointerMissedObject(r);
|
|
482
485
|
}), t.deregisterCamera(e), pt(e);
|
|
483
486
|
}
|
|
484
|
-
const
|
|
487
|
+
const sr = Number.parseInt(Bt.replace("dev", "")), ae = {
|
|
485
488
|
realistic: {
|
|
486
489
|
shadows: !0,
|
|
487
490
|
physicallyCorrectLights: !0,
|
|
@@ -498,12 +501,12 @@ const or = Number.parseInt(Bt.replace("dev", "")), ie = {
|
|
|
498
501
|
toneMappingExposure: 1
|
|
499
502
|
}
|
|
500
503
|
};
|
|
501
|
-
function
|
|
504
|
+
function ir({
|
|
502
505
|
canvas: e,
|
|
503
506
|
options: t,
|
|
504
507
|
contextParts: { sizes: n, render: r, invalidate: s, advance: a }
|
|
505
508
|
}) {
|
|
506
|
-
const i =
|
|
509
|
+
const i = V(() => ({
|
|
507
510
|
alpha: k(t.alpha) ?? !0,
|
|
508
511
|
depth: k(t.depth),
|
|
509
512
|
canvas: Zt(e),
|
|
@@ -516,82 +519,82 @@ function sr({
|
|
|
516
519
|
preserveDrawingBuffer: k(t.preserveDrawingBuffer),
|
|
517
520
|
logarithmicDepthBuffer: k(t.logarithmicDepthBuffer),
|
|
518
521
|
failIfMajorPerformanceCaveat: k(t.failIfMajorPerformanceCaveat)
|
|
519
|
-
})), l =
|
|
522
|
+
})), l = $(new he(i.value));
|
|
520
523
|
function c() {
|
|
521
524
|
t.renderMode === "on-demand" && s();
|
|
522
525
|
}
|
|
523
|
-
|
|
526
|
+
ce(i, () => {
|
|
524
527
|
l.value.dispose(), l.value = new he(i.value), c();
|
|
525
|
-
}),
|
|
528
|
+
}), ce([n.width, n.height], () => {
|
|
526
529
|
l.value.setSize(n.width.value, n.height.value), c();
|
|
527
530
|
}, {
|
|
528
531
|
immediate: !0
|
|
529
|
-
}),
|
|
530
|
-
const { pixelRatio: o } = en(), { logError: u } =
|
|
531
|
-
const
|
|
532
|
+
}), ce(() => t.clearColor, c);
|
|
533
|
+
const { pixelRatio: o } = en(), { logError: u } = Y(), f = (() => {
|
|
534
|
+
const v = new he(), b = {
|
|
532
535
|
shadowMap: {
|
|
533
|
-
enabled:
|
|
534
|
-
type:
|
|
536
|
+
enabled: v.shadowMap.enabled,
|
|
537
|
+
type: v.shadowMap.type
|
|
535
538
|
},
|
|
536
|
-
toneMapping:
|
|
537
|
-
toneMappingExposure:
|
|
538
|
-
outputColorSpace:
|
|
539
|
+
toneMapping: v.toneMapping,
|
|
540
|
+
toneMappingExposure: v.toneMappingExposure,
|
|
541
|
+
outputColorSpace: v.outputColorSpace
|
|
539
542
|
};
|
|
540
|
-
return
|
|
541
|
-
})(),
|
|
542
|
-
return
|
|
543
|
+
return v.dispose(), b;
|
|
544
|
+
})(), g = k(t.renderMode);
|
|
545
|
+
return g === "on-demand" && s(), g === "manual" && setTimeout(() => {
|
|
543
546
|
a();
|
|
544
547
|
}, 100), Te(() => {
|
|
545
|
-
const
|
|
546
|
-
|
|
547
|
-
const
|
|
548
|
-
const
|
|
549
|
-
if (
|
|
550
|
-
return Ve(
|
|
548
|
+
const v = k(t.preset);
|
|
549
|
+
v && (v in ae || u(`Renderer Preset must be one of these: ${Object.keys(ae).join(", ")}`), ut(l.value, ae[v])), rr(l.value, o.value, k(t.dpr)), g === "always" && (r.frames.value = Math.max(1, r.frames.value));
|
|
550
|
+
const b = (C, E) => {
|
|
551
|
+
const P = k(C), S = () => {
|
|
552
|
+
if (v)
|
|
553
|
+
return Ve(ae[v], E);
|
|
551
554
|
};
|
|
552
|
-
if (
|
|
553
|
-
return
|
|
554
|
-
const M =
|
|
555
|
+
if (P !== void 0)
|
|
556
|
+
return P;
|
|
557
|
+
const M = S();
|
|
555
558
|
return M !== void 0 ? M : Ve(f, E);
|
|
556
|
-
}, m = (
|
|
557
|
-
m(t.shadows, "shadowMap.enabled"), m(t.toneMapping ?? st, "toneMapping"), m(t.shadowMapType, "shadowMap.type"),
|
|
558
|
-
const
|
|
559
|
-
|
|
560
|
-
|
|
559
|
+
}, m = (C, E) => Yn(l.value, E, b(C, E));
|
|
560
|
+
m(t.shadows, "shadowMap.enabled"), m(t.toneMapping ?? st, "toneMapping"), m(t.shadowMapType, "shadowMap.type"), sr < 150 && m(!t.useLegacyLights, "physicallyCorrectLights"), m(t.outputColorSpace, "outputColorSpace"), m(t.toneMappingExposure, "toneMappingExposure");
|
|
561
|
+
const d = b(t.clearColor, "clearColor");
|
|
562
|
+
d && l.value.setClearColor(
|
|
563
|
+
d ? Un(d) : new Z(0)
|
|
561
564
|
// default clear color is not easily/efficiently retrievable from three
|
|
562
565
|
);
|
|
563
|
-
}),
|
|
566
|
+
}), K(() => {
|
|
564
567
|
l.value.dispose(), l.value.forceContextLoss();
|
|
565
568
|
}), {
|
|
566
569
|
renderer: l
|
|
567
570
|
};
|
|
568
571
|
}
|
|
569
|
-
const
|
|
570
|
-
function
|
|
572
|
+
const ar = (e) => !!e && e.constructor === Array;
|
|
573
|
+
function lr(e) {
|
|
571
574
|
const t = { nodes: {}, materials: {} };
|
|
572
575
|
return e && e.traverse((n) => {
|
|
573
576
|
n.name && (t.nodes[n.name] = n), n.material && !t.materials[n.material.name] && (t.materials[n.material.name] = n.material);
|
|
574
577
|
}), t;
|
|
575
578
|
}
|
|
576
|
-
async function
|
|
577
|
-
const { logError: a } =
|
|
579
|
+
async function Nr(e, t, n, r, s) {
|
|
580
|
+
const { logError: a } = Y(), i = new e();
|
|
578
581
|
s && s(i), n && n(i);
|
|
579
582
|
const c = (Array.isArray(t) ? t : [t]).map(
|
|
580
|
-
(o) => new Promise((u,
|
|
583
|
+
(o) => new Promise((u, y) => {
|
|
581
584
|
i.load(
|
|
582
585
|
o,
|
|
583
586
|
(f) => {
|
|
584
|
-
const
|
|
585
|
-
|
|
587
|
+
const g = f;
|
|
588
|
+
g.scene && Object.assign(g, lr(g.scene)), u(g);
|
|
586
589
|
},
|
|
587
590
|
r,
|
|
588
|
-
(f) =>
|
|
591
|
+
(f) => y(a("[useLoader] - Failed to load resource", f))
|
|
589
592
|
);
|
|
590
593
|
})
|
|
591
594
|
);
|
|
592
|
-
return
|
|
595
|
+
return ar(t) ? await Promise.all(c) : await c[0];
|
|
593
596
|
}
|
|
594
|
-
async function
|
|
597
|
+
async function zr(e, t) {
|
|
595
598
|
const n = new Ut(t), r = (s) => new Promise((a, i) => {
|
|
596
599
|
n.load(
|
|
597
600
|
s,
|
|
@@ -602,7 +605,7 @@ async function Nr(e, t) {
|
|
|
602
605
|
}
|
|
603
606
|
);
|
|
604
607
|
});
|
|
605
|
-
if (
|
|
608
|
+
if (Jn(e)) {
|
|
606
609
|
const s = await Promise.all(e.map((a) => r(a)));
|
|
607
610
|
return e.length > 1 ? s : s[0];
|
|
608
611
|
} else {
|
|
@@ -614,7 +617,7 @@ async function Nr(e, t) {
|
|
|
614
617
|
metalnessMap: c,
|
|
615
618
|
aoMap: o,
|
|
616
619
|
alphaMap: u,
|
|
617
|
-
matcap:
|
|
620
|
+
matcap: y
|
|
618
621
|
} = e;
|
|
619
622
|
return {
|
|
620
623
|
map: s ? await r(s) : null,
|
|
@@ -624,91 +627,91 @@ async function Nr(e, t) {
|
|
|
624
627
|
metalnessMap: c ? await r(c) : null,
|
|
625
628
|
aoMap: o ? await r(o) : null,
|
|
626
629
|
alphaMap: u ? await r(u) : null,
|
|
627
|
-
matcap:
|
|
630
|
+
matcap: y ? await r(y) : null
|
|
628
631
|
};
|
|
629
632
|
}
|
|
630
633
|
}
|
|
631
|
-
const
|
|
632
|
-
const n =
|
|
634
|
+
const cr = (e, t) => {
|
|
635
|
+
const n = V(() => t.renderer.value.domElement), r = $([]), { x: s, y: a } = tn({ target: n });
|
|
633
636
|
let i = 0;
|
|
634
|
-
const { width: l, height: c, top: o, left: u } = nn(n),
|
|
637
|
+
const { width: l, height: c, top: o, left: u } = nn(n), y = ({ x: h, y: T }) => {
|
|
635
638
|
if (n.value)
|
|
636
639
|
return {
|
|
637
640
|
x: (h - u.value) / l.value * 2 - 1,
|
|
638
|
-
y: -((
|
|
641
|
+
y: -((T - o.value) / c.value) * 2 + 1
|
|
639
642
|
};
|
|
640
|
-
}, f = ({ x: h, y:
|
|
643
|
+
}, f = ({ x: h, y: T }) => {
|
|
641
644
|
if (t.camera.value)
|
|
642
|
-
return t.raycaster.value.setFromCamera(new ge(h,
|
|
643
|
-
},
|
|
644
|
-
const
|
|
645
|
+
return t.raycaster.value.setFromCamera(new ge(h, T), t.camera.value), r.value = t.raycaster.value.intersectObjects(e.value, !0), r.value;
|
|
646
|
+
}, g = (h) => {
|
|
647
|
+
const T = y({
|
|
645
648
|
x: (h == null ? void 0 : h.clientX) ?? s.value,
|
|
646
649
|
y: (h == null ? void 0 : h.clientY) ?? a.value
|
|
647
650
|
});
|
|
648
|
-
return
|
|
649
|
-
},
|
|
651
|
+
return T ? f(T) || [] : [];
|
|
652
|
+
}, v = j(), b = j(), m = j(), d = j(), C = j(), E = j(), P = j(), S = j();
|
|
650
653
|
function M(h) {
|
|
651
|
-
const
|
|
652
|
-
for (const
|
|
653
|
-
typeof
|
|
654
|
-
return
|
|
654
|
+
const T = {};
|
|
655
|
+
for (const F in h)
|
|
656
|
+
typeof F != "function" && (T[F] = h[F]);
|
|
657
|
+
return T;
|
|
655
658
|
}
|
|
656
|
-
const
|
|
659
|
+
const _ = (h, T) => {
|
|
657
660
|
var Oe, De, je;
|
|
658
|
-
const
|
|
661
|
+
const F = M(T), re = new Se(T == null ? void 0 : T.clientX, T == null ? void 0 : T.clientY, 0).unproject((Oe = t.camera) == null ? void 0 : Oe.value);
|
|
659
662
|
h.trigger({
|
|
660
|
-
...
|
|
663
|
+
...F,
|
|
661
664
|
intersections: r.value,
|
|
662
665
|
// The unprojectedPoint is wrong, math needs to be fixed
|
|
663
|
-
unprojectedPoint:
|
|
666
|
+
unprojectedPoint: re,
|
|
664
667
|
ray: (De = t.raycaster) == null ? void 0 : De.value.ray,
|
|
665
668
|
camera: (je = t.camera) == null ? void 0 : je.value,
|
|
666
|
-
sourceEvent:
|
|
669
|
+
sourceEvent: T,
|
|
667
670
|
delta: i,
|
|
668
671
|
stopPropagating: !1
|
|
669
672
|
});
|
|
670
673
|
};
|
|
671
674
|
let L;
|
|
672
675
|
const x = (h) => {
|
|
673
|
-
|
|
674
|
-
},
|
|
676
|
+
g(h), _(m, h), L = h;
|
|
677
|
+
}, p = () => {
|
|
675
678
|
L && x(L);
|
|
676
679
|
};
|
|
677
|
-
let
|
|
678
|
-
const
|
|
679
|
-
var
|
|
680
|
-
|
|
680
|
+
let w, A, D;
|
|
681
|
+
const O = (h) => {
|
|
682
|
+
var T;
|
|
683
|
+
w = (T = r.value[0]) == null ? void 0 : T.object, i = 0, A = new ge(
|
|
681
684
|
(h == null ? void 0 : h.clientX) ?? s.value,
|
|
682
685
|
(h == null ? void 0 : h.clientY) ?? a.value
|
|
683
|
-
),
|
|
686
|
+
), _(C, h);
|
|
684
687
|
};
|
|
685
|
-
let
|
|
686
|
-
const
|
|
687
|
-
var
|
|
688
|
-
h instanceof PointerEvent && (r.value.length === 0 &&
|
|
688
|
+
let B, R = !1;
|
|
689
|
+
const ne = (h) => {
|
|
690
|
+
var T, F, re;
|
|
691
|
+
h instanceof PointerEvent && (r.value.length === 0 && _(E, h), w === ((T = r.value[0]) == null ? void 0 : T.object) && (D = new ge(
|
|
689
692
|
(h == null ? void 0 : h.clientX) ?? s.value,
|
|
690
693
|
(h == null ? void 0 : h.clientY) ?? a.value
|
|
691
|
-
), i = A == null ? void 0 : A.distanceTo(D), h.button === 0 ? (
|
|
694
|
+
), i = A == null ? void 0 : A.distanceTo(D), h.button === 0 ? (_(v, h), B === ((F = r.value[0]) == null ? void 0 : F.object) ? R = !0 : (B = (re = r.value[0]) == null ? void 0 : re.object, R = !1)) : h.button === 2 && _(P, h)), _(d, h));
|
|
692
695
|
}, xe = (h) => {
|
|
693
|
-
|
|
694
|
-
}, Le = (h) =>
|
|
695
|
-
return n.value.addEventListener("pointerup",
|
|
696
|
-
n != null && n.value && (n.value.removeEventListener("pointerup",
|
|
696
|
+
R && (_(b, h), B = void 0, R = !1);
|
|
697
|
+
}, Le = (h) => _(m, h), Re = (h) => _(S, h);
|
|
698
|
+
return n.value.addEventListener("pointerup", ne), n.value.addEventListener("pointerdown", O), n.value.addEventListener("pointermove", x), n.value.addEventListener("pointerleave", Le), n.value.addEventListener("dblclick", xe), n.value.addEventListener("wheel", Re), K(() => {
|
|
699
|
+
n != null && n.value && (n.value.removeEventListener("pointerup", ne), n.value.removeEventListener("pointerdown", O), n.value.removeEventListener("pointermove", x), n.value.removeEventListener("pointerleave", Le), n.value.removeEventListener("dblclick", xe), n.value.removeEventListener("wheel", Re));
|
|
697
700
|
}), {
|
|
698
701
|
intersects: r,
|
|
699
|
-
onClick: (h) =>
|
|
700
|
-
onDblClick: (h) =>
|
|
701
|
-
onContextMenu: (h) =>
|
|
702
|
+
onClick: (h) => v.on(h).off,
|
|
703
|
+
onDblClick: (h) => b.on(h).off,
|
|
704
|
+
onContextMenu: (h) => P.on(h).off,
|
|
702
705
|
onPointerMove: (h) => m.on(h).off,
|
|
703
|
-
onPointerUp: (h) =>
|
|
704
|
-
onPointerDown: (h) =>
|
|
706
|
+
onPointerUp: (h) => d.on(h).off,
|
|
707
|
+
onPointerDown: (h) => C.on(h).off,
|
|
705
708
|
onPointerMissed: (h) => E.on(h).off,
|
|
706
|
-
onWheel: (h) =>
|
|
707
|
-
forceUpdate:
|
|
709
|
+
onWheel: (h) => S.on(h).off,
|
|
710
|
+
forceUpdate: p
|
|
708
711
|
};
|
|
709
712
|
};
|
|
710
|
-
function
|
|
711
|
-
const { logWarning: e } =
|
|
713
|
+
function Gr() {
|
|
714
|
+
const { logWarning: e } = Y();
|
|
712
715
|
function t(a, i, l) {
|
|
713
716
|
let c = null;
|
|
714
717
|
return a.traverse((o) => {
|
|
@@ -737,111 +740,111 @@ function zr() {
|
|
|
737
740
|
function ke(e) {
|
|
738
741
|
let t = 0;
|
|
739
742
|
return e.traverse((n) => {
|
|
740
|
-
if (n.isMesh && n.geometry) {
|
|
743
|
+
if (n.isMesh && n.geometry && n.type !== "HightlightMesh") {
|
|
741
744
|
const r = n.geometry, s = r.attributes.position.count * 3 * Float32Array.BYTES_PER_ELEMENT, a = r.index ? r.index.count * Uint32Array.BYTES_PER_ELEMENT : 0, i = r.attributes.normal ? r.attributes.normal.count * 3 * Float32Array.BYTES_PER_ELEMENT : 0, l = r.attributes.uv ? r.attributes.uv.count * 2 * Float32Array.BYTES_PER_ELEMENT : 0, c = s + a + i + l;
|
|
742
745
|
t += c;
|
|
743
746
|
}
|
|
744
747
|
}), t;
|
|
745
748
|
}
|
|
746
|
-
function
|
|
749
|
+
function ur(e) {
|
|
747
750
|
return (e / 1024).toFixed(2);
|
|
748
751
|
}
|
|
749
|
-
const Me =
|
|
750
|
-
function
|
|
752
|
+
const Me = H({}), Ce = (e) => Object.assign(Me.value, e);
|
|
753
|
+
function fr(e, t, n) {
|
|
751
754
|
var x;
|
|
752
|
-
const r =
|
|
755
|
+
const r = $(), s = $();
|
|
753
756
|
e && (r.value = e), t && (s.value = t);
|
|
754
|
-
const a = (
|
|
755
|
-
var
|
|
756
|
-
return ((
|
|
757
|
-
}, i = (
|
|
758
|
-
var
|
|
759
|
-
return ((
|
|
760
|
-
}, l =
|
|
761
|
-
function c(
|
|
762
|
-
if (Array.isArray(
|
|
763
|
-
for (const A of
|
|
764
|
-
A(
|
|
765
|
-
typeof
|
|
757
|
+
const a = (p) => {
|
|
758
|
+
var w;
|
|
759
|
+
return ((w = p.__tres) == null ? void 0 : w.eventCount) > 0;
|
|
760
|
+
}, i = (p) => {
|
|
761
|
+
var w;
|
|
762
|
+
return ((w = p.children) == null ? void 0 : w.some((A) => i(A))) || a(p);
|
|
763
|
+
}, l = $(((x = r.value) == null ? void 0 : x.children).filter(i) || []);
|
|
764
|
+
function c(p, w) {
|
|
765
|
+
if (Array.isArray(p))
|
|
766
|
+
for (const A of p)
|
|
767
|
+
A(w);
|
|
768
|
+
typeof p == "function" && p(w);
|
|
766
769
|
}
|
|
767
|
-
function o(
|
|
768
|
-
const A = [], D = () =>
|
|
769
|
-
|
|
770
|
-
for (const
|
|
771
|
-
if (
|
|
770
|
+
function o(p, w) {
|
|
771
|
+
const A = [], D = () => w.stopPropagating = !0;
|
|
772
|
+
w.stopPropagation = D;
|
|
773
|
+
for (const O of w == null ? void 0 : w.intersections) {
|
|
774
|
+
if (w.stopPropagating)
|
|
772
775
|
return;
|
|
773
|
-
|
|
774
|
-
const { object:
|
|
775
|
-
|
|
776
|
-
let
|
|
777
|
-
for (;
|
|
778
|
-
|
|
779
|
-
const
|
|
780
|
-
n(
|
|
776
|
+
w = { ...w, ...O };
|
|
777
|
+
const { object: B } = O;
|
|
778
|
+
w.eventObject = B, c(B[p], w), A.push(B);
|
|
779
|
+
let R = B.parent;
|
|
780
|
+
for (; R !== null && !w.stopPropagating && !A.includes(R); )
|
|
781
|
+
w.eventObject = R, c(R[p], w), A.push(R), R = R.parent;
|
|
782
|
+
const ne = Gn(p.slice(2));
|
|
783
|
+
n(ne, { intersection: O, event: w });
|
|
781
784
|
}
|
|
782
785
|
}
|
|
783
786
|
const {
|
|
784
787
|
onClick: u,
|
|
785
|
-
onDblClick:
|
|
788
|
+
onDblClick: y,
|
|
786
789
|
onContextMenu: f,
|
|
787
|
-
onPointerMove:
|
|
788
|
-
onPointerDown:
|
|
789
|
-
onPointerUp:
|
|
790
|
+
onPointerMove: g,
|
|
791
|
+
onPointerDown: v,
|
|
792
|
+
onPointerUp: b,
|
|
790
793
|
onPointerMissed: m,
|
|
791
|
-
onWheel:
|
|
792
|
-
forceUpdate:
|
|
793
|
-
} =
|
|
794
|
-
|
|
794
|
+
onWheel: d,
|
|
795
|
+
forceUpdate: C
|
|
796
|
+
} = cr(l, t);
|
|
797
|
+
b((p) => o("onPointerUp", p)), v((p) => o("onPointerDown", p)), u((p) => o("onClick", p)), y((p) => o("onDoubleClick", p)), f((p) => o("onContextMenu", p)), d((p) => o("onWheel", p));
|
|
795
798
|
let E = [];
|
|
796
|
-
|
|
797
|
-
const
|
|
799
|
+
g((p) => {
|
|
800
|
+
const w = p.intersections.map(({ object: D }) => D), A = p.intersections;
|
|
798
801
|
E.forEach(({ object: D }) => {
|
|
799
|
-
|
|
800
|
-
}),
|
|
801
|
-
E.includes(D) || (o("onPointerEnter",
|
|
802
|
-
}), o("onPointerMove",
|
|
802
|
+
w.includes(D) || (p.intersections = E, o("onPointerLeave", p), o("onPointerOut", p));
|
|
803
|
+
}), p.intersections = A, p.intersections.forEach(({ object: D }) => {
|
|
804
|
+
E.includes(D) || (o("onPointerEnter", p), o("onPointerOver", p));
|
|
805
|
+
}), o("onPointerMove", p), E = p.intersections;
|
|
803
806
|
});
|
|
804
|
-
const
|
|
805
|
-
m((
|
|
806
|
-
const
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
}), n("pointer-missed", { event:
|
|
807
|
+
const P = [];
|
|
808
|
+
m((p) => {
|
|
809
|
+
const w = () => p.stopPropagating = !0;
|
|
810
|
+
p.stopPropagation = w, P.forEach((A) => {
|
|
811
|
+
p.stopPropagating || (p.eventObject = A, c(A.onPointerMissed, p));
|
|
812
|
+
}), n("pointer-missed", { event: p });
|
|
810
813
|
});
|
|
811
|
-
function
|
|
812
|
-
|
|
814
|
+
function S(p) {
|
|
815
|
+
oe(p) && N(p) && l.value.push(p);
|
|
813
816
|
}
|
|
814
|
-
function M(
|
|
815
|
-
if (
|
|
816
|
-
const
|
|
817
|
-
|
|
817
|
+
function M(p) {
|
|
818
|
+
if (oe(p) && N(p)) {
|
|
819
|
+
const w = l.value.indexOf(p);
|
|
820
|
+
w > -1 && l.value.splice(w, 1);
|
|
818
821
|
}
|
|
819
822
|
}
|
|
820
|
-
function
|
|
821
|
-
|
|
823
|
+
function _(p) {
|
|
824
|
+
oe(p) && N(p) && p.onPointerMissed && P.push(p);
|
|
822
825
|
}
|
|
823
|
-
function L(
|
|
824
|
-
if (
|
|
825
|
-
const
|
|
826
|
-
|
|
826
|
+
function L(p) {
|
|
827
|
+
if (oe(p) && N(p)) {
|
|
828
|
+
const w = P.indexOf(p);
|
|
829
|
+
w > -1 && P.splice(w, 1);
|
|
827
830
|
}
|
|
828
831
|
}
|
|
829
832
|
return t.eventManager = {
|
|
830
|
-
forceUpdate:
|
|
831
|
-
registerObject:
|
|
833
|
+
forceUpdate: C,
|
|
834
|
+
registerObject: S,
|
|
832
835
|
deregisterObject: M,
|
|
833
|
-
registerPointerMissedObject:
|
|
836
|
+
registerPointerMissedObject: _,
|
|
834
837
|
deregisterPointerMissedObject: L
|
|
835
838
|
}, {
|
|
836
|
-
forceUpdate:
|
|
837
|
-
registerObject:
|
|
839
|
+
forceUpdate: C,
|
|
840
|
+
registerObject: S,
|
|
838
841
|
deregisterObject: M,
|
|
839
|
-
registerPointerMissedObject:
|
|
842
|
+
registerPointerMissedObject: _,
|
|
840
843
|
deregisterPointerMissedObject: L
|
|
841
844
|
};
|
|
842
845
|
}
|
|
843
|
-
function
|
|
844
|
-
const r = k(e) ? rn() : on(
|
|
846
|
+
function dr(e, t, n = 10) {
|
|
847
|
+
const r = k(e) ? rn() : on(V(() => k(t).parentElement)), s = ye(Fe(r.width, n)), a = ye(Fe(r.height, n)), i = V(() => s.value / a.value);
|
|
845
848
|
return {
|
|
846
849
|
height: a,
|
|
847
850
|
width: s,
|
|
@@ -852,9 +855,9 @@ function ve() {
|
|
|
852
855
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
|
|
853
856
|
let n = 0, r = !1;
|
|
854
857
|
const s = () => {
|
|
855
|
-
const o = Array.from(e.entries()).sort((u,
|
|
856
|
-
const f = u[1].priority -
|
|
857
|
-
return f === 0 ? u[1].addI -
|
|
858
|
+
const o = Array.from(e.entries()).sort((u, y) => {
|
|
859
|
+
const f = u[1].priority - y[1].priority;
|
|
860
|
+
return f === 0 ? u[1].addI - y[1].addI : f;
|
|
858
861
|
});
|
|
859
862
|
t.clear(), o.forEach((u) => t.add(u[0]));
|
|
860
863
|
}, a = (o) => {
|
|
@@ -862,9 +865,9 @@ function ve() {
|
|
|
862
865
|
};
|
|
863
866
|
return { on: (o, u = 0) => {
|
|
864
867
|
e.set(o, { priority: u, addI: n++ });
|
|
865
|
-
const
|
|
866
|
-
return sn(
|
|
867
|
-
off:
|
|
868
|
+
const y = () => a(o);
|
|
869
|
+
return sn(y), r = !0, {
|
|
870
|
+
off: y
|
|
868
871
|
};
|
|
869
872
|
}, off: a, trigger: (...o) => {
|
|
870
873
|
r && (s(), r = !1), t.forEach((u) => u(...o));
|
|
@@ -874,82 +877,82 @@ function ve() {
|
|
|
874
877
|
return e.size;
|
|
875
878
|
} };
|
|
876
879
|
}
|
|
877
|
-
function
|
|
880
|
+
function pr() {
|
|
878
881
|
let e = !0, t = !0, n = !1;
|
|
879
|
-
const r = new tt(!1), s =
|
|
882
|
+
const r = new tt(!1), s = H(r.running), a = H(!1);
|
|
880
883
|
let i;
|
|
881
884
|
const l = rt.generateUUID();
|
|
882
885
|
let c = null;
|
|
883
|
-
const o = ve(), u = ve(),
|
|
886
|
+
const o = ve(), u = ve(), y = ve();
|
|
884
887
|
M();
|
|
885
888
|
let f = {};
|
|
886
|
-
function _
|
|
887
|
-
f =
|
|
889
|
+
function g(_) {
|
|
890
|
+
f = _;
|
|
888
891
|
}
|
|
889
|
-
function
|
|
892
|
+
function v(_, L, x = 0) {
|
|
890
893
|
switch (L) {
|
|
891
894
|
case "before":
|
|
892
|
-
return o.on(
|
|
895
|
+
return o.on(_, x);
|
|
893
896
|
case "render":
|
|
894
|
-
return c || (c =
|
|
897
|
+
return c || (c = _), u.dispose(), u.on(_);
|
|
895
898
|
case "after":
|
|
896
|
-
return
|
|
899
|
+
return y.on(_, x);
|
|
897
900
|
}
|
|
898
901
|
}
|
|
899
|
-
function
|
|
900
|
-
t && (t = !1, M(),
|
|
902
|
+
function b() {
|
|
903
|
+
t && (t = !1, M(), S());
|
|
901
904
|
}
|
|
902
905
|
function m() {
|
|
903
906
|
t = !0, M(), cancelAnimationFrame(i);
|
|
904
907
|
}
|
|
905
|
-
function
|
|
908
|
+
function d() {
|
|
906
909
|
n = !1, M();
|
|
907
910
|
}
|
|
908
|
-
function
|
|
911
|
+
function C() {
|
|
909
912
|
n = !0, M();
|
|
910
913
|
}
|
|
911
914
|
function E() {
|
|
912
915
|
a.value = !0;
|
|
913
916
|
}
|
|
914
|
-
function
|
|
917
|
+
function P() {
|
|
915
918
|
a.value = !1;
|
|
916
919
|
}
|
|
917
|
-
function
|
|
920
|
+
function S() {
|
|
918
921
|
if (!e) {
|
|
919
|
-
i = requestAnimationFrame(
|
|
922
|
+
i = requestAnimationFrame(S);
|
|
920
923
|
return;
|
|
921
924
|
}
|
|
922
|
-
const
|
|
923
|
-
camera:
|
|
924
|
-
scene:
|
|
925
|
-
renderer:
|
|
926
|
-
raycaster:
|
|
927
|
-
controls:
|
|
925
|
+
const _ = r.getDelta(), L = r.getElapsedTime(), x = {
|
|
926
|
+
camera: J(f.camera),
|
|
927
|
+
scene: J(f.scene),
|
|
928
|
+
renderer: J(f.renderer),
|
|
929
|
+
raycaster: J(f.raycaster),
|
|
930
|
+
controls: J(f.controls),
|
|
928
931
|
invalidate: f.invalidate,
|
|
929
932
|
advance: f.advance
|
|
930
|
-
},
|
|
931
|
-
s.value && o.trigger(
|
|
933
|
+
}, p = { delta: _, elapsed: L, clock: r, ...x };
|
|
934
|
+
s.value && o.trigger(p), a.value || (u.count ? u.trigger(p) : c && c(p)), s.value && y.trigger(p), i = requestAnimationFrame(S);
|
|
932
935
|
}
|
|
933
936
|
function M() {
|
|
934
|
-
const
|
|
935
|
-
r.running !==
|
|
937
|
+
const _ = !t && !n;
|
|
938
|
+
r.running !== _ && (r.running ? r.stop() : r.start()), s.value = r.running;
|
|
936
939
|
}
|
|
937
940
|
return {
|
|
938
941
|
loopId: l,
|
|
939
|
-
register: (
|
|
940
|
-
start:
|
|
942
|
+
register: (_, L, x) => v(_, L, x),
|
|
943
|
+
start: b,
|
|
941
944
|
stop: m,
|
|
942
|
-
pause:
|
|
943
|
-
resume:
|
|
945
|
+
pause: C,
|
|
946
|
+
resume: d,
|
|
944
947
|
pauseRender: E,
|
|
945
|
-
resumeRender:
|
|
948
|
+
resumeRender: P,
|
|
946
949
|
isRenderPaused: a,
|
|
947
950
|
isActive: s,
|
|
948
|
-
setContext:
|
|
949
|
-
setReady: (
|
|
951
|
+
setContext: g,
|
|
952
|
+
setReady: (_) => e = _
|
|
950
953
|
};
|
|
951
954
|
}
|
|
952
|
-
function
|
|
955
|
+
function mr(e, t, n = 100) {
|
|
953
956
|
n = n <= 0 ? 100 : n;
|
|
954
957
|
const r = j(), s = /* @__PURE__ */ new Set();
|
|
955
958
|
let a = !1, i = !1, l = null;
|
|
@@ -960,8 +963,8 @@ function pr(e, t, n = 100) {
|
|
|
960
963
|
i = !0, l && clearTimeout(l);
|
|
961
964
|
}
|
|
962
965
|
c();
|
|
963
|
-
const u = (f, ...
|
|
964
|
-
f(...
|
|
966
|
+
const u = (f, ...g) => {
|
|
967
|
+
f(...g);
|
|
965
968
|
};
|
|
966
969
|
return {
|
|
967
970
|
on: (f) => {
|
|
@@ -969,8 +972,8 @@ function pr(e, t, n = 100) {
|
|
|
969
972
|
return u(f, t), { off: () => {
|
|
970
973
|
} };
|
|
971
974
|
{
|
|
972
|
-
const
|
|
973
|
-
return s.add(
|
|
975
|
+
const g = r.on(f);
|
|
976
|
+
return s.add(g.off), r.on(f);
|
|
974
977
|
}
|
|
975
978
|
},
|
|
976
979
|
off: r.off,
|
|
@@ -982,7 +985,7 @@ const te = /* @__PURE__ */ new WeakMap();
|
|
|
982
985
|
function gt(e) {
|
|
983
986
|
if (e = e || pe(), te.has(e))
|
|
984
987
|
return te.get(e);
|
|
985
|
-
const t = 100, n = Date.now(), a =
|
|
988
|
+
const t = 100, n = Date.now(), a = mr(() => {
|
|
986
989
|
if (Date.now() - n >= t)
|
|
987
990
|
return !0;
|
|
988
991
|
{
|
|
@@ -992,12 +995,12 @@ function gt(e) {
|
|
|
992
995
|
}, e);
|
|
993
996
|
return te.set(e, a), a;
|
|
994
997
|
}
|
|
995
|
-
function
|
|
998
|
+
function Vr(e) {
|
|
996
999
|
const t = pe();
|
|
997
1000
|
if (t)
|
|
998
1001
|
return te.has(t) ? te.get(t).on(e) : gt(t).on(e);
|
|
999
1002
|
}
|
|
1000
|
-
function
|
|
1003
|
+
function hr({
|
|
1001
1004
|
scene: e,
|
|
1002
1005
|
canvas: t,
|
|
1003
1006
|
windowSize: n,
|
|
@@ -1005,43 +1008,43 @@ function mr({
|
|
|
1005
1008
|
rendererOptions: s,
|
|
1006
1009
|
emit: a
|
|
1007
1010
|
}) {
|
|
1008
|
-
const
|
|
1009
|
-
camera:
|
|
1010
|
-
cameras:
|
|
1011
|
-
registerCamera:
|
|
1012
|
-
deregisterCamera:
|
|
1013
|
-
setCameraActive:
|
|
1014
|
-
} =
|
|
1015
|
-
mode:
|
|
1016
|
-
priority:
|
|
1017
|
-
frames:
|
|
1011
|
+
const i = $(e), l = dr(n, t), {
|
|
1012
|
+
camera: c,
|
|
1013
|
+
cameras: o,
|
|
1014
|
+
registerCamera: u,
|
|
1015
|
+
deregisterCamera: y,
|
|
1016
|
+
setCameraActive: f
|
|
1017
|
+
} = Bn({ sizes: l, scene: e }), g = {
|
|
1018
|
+
mode: H(s.renderMode || "always"),
|
|
1019
|
+
priority: H(0),
|
|
1020
|
+
frames: H(0),
|
|
1018
1021
|
maxFrames: 60,
|
|
1019
|
-
canBeInvalidated:
|
|
1022
|
+
canBeInvalidated: V(() => g.mode.value === "on-demand" && g.frames.value === 0)
|
|
1020
1023
|
};
|
|
1021
|
-
function
|
|
1022
|
-
s.renderMode === "on-demand"
|
|
1024
|
+
function v(O = 1) {
|
|
1025
|
+
s.renderMode === "on-demand" && (g.frames.value = Math.min(g.maxFrames, g.frames.value + O));
|
|
1023
1026
|
}
|
|
1024
|
-
function
|
|
1025
|
-
s.renderMode === "manual"
|
|
1027
|
+
function b() {
|
|
1028
|
+
s.renderMode === "manual" && (g.frames.value = 1);
|
|
1026
1029
|
}
|
|
1027
|
-
const { renderer:
|
|
1030
|
+
const { renderer: m } = ir(
|
|
1028
1031
|
{
|
|
1029
1032
|
scene: e,
|
|
1030
1033
|
canvas: t,
|
|
1031
1034
|
options: s,
|
|
1032
1035
|
emit: a,
|
|
1033
1036
|
// TODO: replace contextParts with full ctx at https://github.com/Tresjs/tres/issues/516
|
|
1034
|
-
contextParts: { sizes:
|
|
1037
|
+
contextParts: { sizes: l, camera: c, render: g, invalidate: v, advance: b },
|
|
1035
1038
|
disableRender: r
|
|
1036
1039
|
}
|
|
1037
|
-
),
|
|
1038
|
-
sizes:
|
|
1039
|
-
scene:
|
|
1040
|
-
camera:
|
|
1041
|
-
cameras: ye(
|
|
1042
|
-
renderer:
|
|
1043
|
-
raycaster:
|
|
1044
|
-
controls:
|
|
1040
|
+
), d = {
|
|
1041
|
+
sizes: l,
|
|
1042
|
+
scene: i,
|
|
1043
|
+
camera: c,
|
|
1044
|
+
cameras: ye(o),
|
|
1045
|
+
renderer: m,
|
|
1046
|
+
raycaster: $(new Ft()),
|
|
1047
|
+
controls: H(null),
|
|
1045
1048
|
perf: {
|
|
1046
1049
|
maxFrames: 160,
|
|
1047
1050
|
fps: {
|
|
@@ -1054,38 +1057,38 @@ function mr({
|
|
|
1054
1057
|
accumulator: []
|
|
1055
1058
|
}
|
|
1056
1059
|
},
|
|
1057
|
-
render:
|
|
1058
|
-
advance:
|
|
1060
|
+
render: g,
|
|
1061
|
+
advance: b,
|
|
1059
1062
|
extend: Ce,
|
|
1060
|
-
invalidate:
|
|
1061
|
-
registerCamera:
|
|
1062
|
-
setCameraActive:
|
|
1063
|
-
deregisterCamera:
|
|
1064
|
-
loop:
|
|
1063
|
+
invalidate: v,
|
|
1064
|
+
registerCamera: u,
|
|
1065
|
+
setCameraActive: f,
|
|
1066
|
+
deregisterCamera: y,
|
|
1067
|
+
loop: pr()
|
|
1065
1068
|
};
|
|
1066
|
-
_e("useTres",
|
|
1067
|
-
root:
|
|
1068
|
-
},
|
|
1069
|
-
|
|
1069
|
+
_e("useTres", d), d.scene.value.__tres = {
|
|
1070
|
+
root: d
|
|
1071
|
+
}, d.loop.register(() => {
|
|
1072
|
+
c.value && g.frames.value > 0 && (m.value.render(e, c.value), a("render", d.renderer.value)), g.priority.value = 0, g.mode.value === "always" ? g.frames.value = 1 : g.frames.value = Math.max(0, g.frames.value - 1);
|
|
1070
1073
|
}, "render");
|
|
1071
|
-
const { on:
|
|
1072
|
-
|
|
1073
|
-
a("ready",
|
|
1074
|
-
}),
|
|
1075
|
-
|
|
1074
|
+
const { on: C, cancel: E } = gt(d);
|
|
1075
|
+
d.loop.setReady(!1), d.loop.start(), C(() => {
|
|
1076
|
+
a("ready", d), d.loop.setReady(!0), fr(e, d, a);
|
|
1077
|
+
}), K(() => {
|
|
1078
|
+
E(), d.loop.stop();
|
|
1076
1079
|
});
|
|
1077
|
-
const
|
|
1078
|
-
let
|
|
1079
|
-
const
|
|
1080
|
-
|
|
1080
|
+
const P = 100, S = an({ every: P }), { isSupported: M, memory: _ } = ln({ interval: P }), L = 160;
|
|
1081
|
+
let x = performance.now();
|
|
1082
|
+
const p = ({ timestamp: O }) => {
|
|
1083
|
+
d.scene.value && (d.perf.memory.allocatedMem = ke(d.scene.value)), O - x >= P && (x = O, d.perf.fps.accumulator.push(S.value), d.perf.fps.accumulator.length > L && d.perf.fps.accumulator.shift(), d.perf.fps.value = S.value, M.value && _.value && (d.perf.memory.accumulator.push(_.value.usedJSHeapSize / 1024 / 1024), d.perf.memory.accumulator.length > L && d.perf.memory.accumulator.shift(), d.perf.memory.currentMem = d.perf.memory.accumulator.reduce((B, R) => B + R, 0) / d.perf.memory.accumulator.length));
|
|
1081
1084
|
};
|
|
1082
|
-
let
|
|
1083
|
-
const
|
|
1084
|
-
window.__TRES__DEVTOOLS__ && (
|
|
1085
|
+
let w = 0;
|
|
1086
|
+
const A = 1, { pause: D } = it(({ delta: O }) => {
|
|
1087
|
+
window.__TRES__DEVTOOLS__ && (p({ timestamp: performance.now() }), w += O, w >= A && (window.__TRES__DEVTOOLS__.cb(d), w = 0));
|
|
1085
1088
|
}, { immediate: !0 });
|
|
1086
|
-
return
|
|
1087
|
-
|
|
1088
|
-
}),
|
|
1089
|
+
return K(() => {
|
|
1090
|
+
D();
|
|
1091
|
+
}), d;
|
|
1089
1092
|
}
|
|
1090
1093
|
function pe() {
|
|
1091
1094
|
const e = Mt("useTres");
|
|
@@ -1093,8 +1096,8 @@ function pe() {
|
|
|
1093
1096
|
throw new Error("useTresContext must be used together with useTresContextProvider");
|
|
1094
1097
|
return e;
|
|
1095
1098
|
}
|
|
1096
|
-
const
|
|
1097
|
-
function
|
|
1099
|
+
const Yr = pe;
|
|
1100
|
+
function qr() {
|
|
1098
1101
|
const {
|
|
1099
1102
|
camera: e,
|
|
1100
1103
|
scene: t,
|
|
@@ -1114,14 +1117,14 @@ function Yr() {
|
|
|
1114
1117
|
invalidate: i,
|
|
1115
1118
|
advance: l
|
|
1116
1119
|
});
|
|
1117
|
-
function c(
|
|
1118
|
-
return r.register(
|
|
1120
|
+
function c(y, f = 0) {
|
|
1121
|
+
return r.register(y, "before", f);
|
|
1119
1122
|
}
|
|
1120
|
-
function o(
|
|
1121
|
-
return r.register(
|
|
1123
|
+
function o(y) {
|
|
1124
|
+
return r.register(y, "render");
|
|
1122
1125
|
}
|
|
1123
|
-
function u(
|
|
1124
|
-
return r.register(
|
|
1126
|
+
function u(y, f = 0) {
|
|
1127
|
+
return r.register(y, "after", f);
|
|
1125
1128
|
}
|
|
1126
1129
|
return {
|
|
1127
1130
|
pause: r.pause,
|
|
@@ -1134,7 +1137,7 @@ function Yr() {
|
|
|
1134
1137
|
onAfterRender: u
|
|
1135
1138
|
};
|
|
1136
1139
|
}
|
|
1137
|
-
function
|
|
1140
|
+
function gr(e, t = {}, n = {}) {
|
|
1138
1141
|
let r = e;
|
|
1139
1142
|
const s = (l) => {
|
|
1140
1143
|
r = l;
|
|
@@ -1153,7 +1156,7 @@ function hr(e, t = {}, n = {}) {
|
|
|
1153
1156
|
};
|
|
1154
1157
|
return a = new Proxy({}, i), a;
|
|
1155
1158
|
}
|
|
1156
|
-
const { logError: Ke } =
|
|
1159
|
+
const { logError: Ke } = Y(), Qe = [
|
|
1157
1160
|
"onClick",
|
|
1158
1161
|
"onContextMenu",
|
|
1159
1162
|
"onPointerMove",
|
|
@@ -1168,68 +1171,68 @@ const { logError: Ke } = z(), Qe = [
|
|
|
1168
1171
|
"onPointerMissed",
|
|
1169
1172
|
"onLostPointerCapture",
|
|
1170
1173
|
"onWheel"
|
|
1171
|
-
],
|
|
1174
|
+
], vr = (e) => {
|
|
1172
1175
|
const t = e.scene.value;
|
|
1173
|
-
function n(o, u,
|
|
1174
|
-
if (f || (f = {}), f.args || (f.args = []), o === "template" ||
|
|
1176
|
+
function n(o, u, y, f) {
|
|
1177
|
+
if (f || (f = {}), f.args || (f.args = []), o === "template" || Nn(o))
|
|
1175
1178
|
return null;
|
|
1176
|
-
let
|
|
1179
|
+
let g = o.replace("Tres", ""), v;
|
|
1177
1180
|
if (o === "primitive") {
|
|
1178
|
-
(!
|
|
1181
|
+
(!U(f.object) || Ct(f.object)) && Ke(
|
|
1179
1182
|
"Tres primitives need an 'object' prop, whose value is an object or shallowRef<object>"
|
|
1180
|
-
),
|
|
1181
|
-
const
|
|
1182
|
-
|
|
1183
|
+
), g = f.object.type;
|
|
1184
|
+
const b = {};
|
|
1185
|
+
v = gr(
|
|
1183
1186
|
f.object,
|
|
1184
1187
|
{
|
|
1185
|
-
object: (
|
|
1188
|
+
object: (d) => d,
|
|
1186
1189
|
isPrimitive: () => !0,
|
|
1187
|
-
__tres: () =>
|
|
1190
|
+
__tres: () => b
|
|
1188
1191
|
},
|
|
1189
1192
|
{
|
|
1190
|
-
object: (
|
|
1191
|
-
|
|
1193
|
+
object: (d, C, E, P) => {
|
|
1194
|
+
or(d, E, P, { patchProp: a, remove: s, insert: r }, e);
|
|
1192
1195
|
},
|
|
1193
|
-
__tres: (
|
|
1194
|
-
Object.assign(
|
|
1196
|
+
__tres: (d) => {
|
|
1197
|
+
Object.assign(b, d);
|
|
1195
1198
|
}
|
|
1196
1199
|
}
|
|
1197
1200
|
);
|
|
1198
1201
|
} else {
|
|
1199
|
-
const
|
|
1200
|
-
|
|
1201
|
-
`${
|
|
1202
|
-
),
|
|
1202
|
+
const b = Me.value[g];
|
|
1203
|
+
b || Ke(
|
|
1204
|
+
`${g} is not defined on the THREE namespace. Use extend to add it to the catalog.`
|
|
1205
|
+
), v = new b(...f.args);
|
|
1203
1206
|
}
|
|
1204
|
-
return
|
|
1205
|
-
...
|
|
1206
|
-
type:
|
|
1207
|
+
return v ? (v.isCamera && (f != null && f.position || v.position.set(3, 3, 3), f != null && f.lookAt || v.lookAt(0, 0, 0)), v = z(v, {
|
|
1208
|
+
...v.__tres,
|
|
1209
|
+
type: g,
|
|
1207
1210
|
memoizedProps: f,
|
|
1208
1211
|
eventCount: 0,
|
|
1209
1212
|
primitive: o === "primitive",
|
|
1210
1213
|
attach: f.attach
|
|
1211
|
-
}, e),
|
|
1214
|
+
}, e), v) : null;
|
|
1212
1215
|
}
|
|
1213
1216
|
function r(o, u) {
|
|
1214
|
-
var
|
|
1217
|
+
var g, v, b;
|
|
1215
1218
|
if (!o)
|
|
1216
1219
|
return;
|
|
1217
1220
|
u = u || t;
|
|
1218
|
-
const
|
|
1219
|
-
o =
|
|
1221
|
+
const y = o.__tres ? o : z(o, {}, e), f = u.__tres ? u : z(u, {}, e);
|
|
1222
|
+
o = Q(y), u = Q(f), o.__tres && ((g = o.__tres) == null ? void 0 : g.eventCount) > 0 && ((v = e.eventManager) == null || v.registerObject(o)), e.registerCamera(o), (b = e.eventManager) == null || b.registerPointerMissedObject(o), y.__tres.attach ? tr(f, y, y.__tres.attach) : N(o) && N(f) && (f.add(o), o.dispatchEvent({ type: "added" })), y.__tres.parent = f, f.__tres.objects && !f.__tres.objects.includes(y) && f.__tres.objects.push(y);
|
|
1220
1223
|
}
|
|
1221
1224
|
function s(o, u) {
|
|
1222
|
-
var
|
|
1225
|
+
var v, b, m, d;
|
|
1223
1226
|
if (!o)
|
|
1224
1227
|
return;
|
|
1225
|
-
o != null && o.__tres && ((
|
|
1226
|
-
const
|
|
1227
|
-
be(
|
|
1228
|
-
const f = (
|
|
1229
|
-
if (o.__tres && "objects" in o.__tres && [...o.__tres.objects].forEach((
|
|
1230
|
-
if (
|
|
1228
|
+
o != null && o.__tres && ((v = o.__tres) == null ? void 0 : v.eventCount) > 0 && ((b = e.eventManager) == null || b.deregisterObject(o)), u = be(u) ? "default" : u;
|
|
1229
|
+
const y = (m = o.__tres) == null ? void 0 : m.dispose;
|
|
1230
|
+
be(y) || (y === null ? u = !1 : u = y);
|
|
1231
|
+
const f = (d = o.__tres) == null ? void 0 : d.primitive, g = u === "default" ? !f : !!u;
|
|
1232
|
+
if (o.__tres && "objects" in o.__tres && [...o.__tres.objects].forEach((C) => s(C, u)), g && o.children && [...o.children].forEach((C) => s(C, u)), mt(o, e), ht(o, e), g && !Dn(o)) {
|
|
1233
|
+
if (G(u))
|
|
1231
1234
|
u(o);
|
|
1232
|
-
else if (
|
|
1235
|
+
else if (G(o.dispose))
|
|
1233
1236
|
try {
|
|
1234
1237
|
o.dispose();
|
|
1235
1238
|
} catch {
|
|
@@ -1237,66 +1240,66 @@ const { logError: Ke } = z(), Qe = [
|
|
|
1237
1240
|
}
|
|
1238
1241
|
"__tres" in o && delete o.__tres;
|
|
1239
1242
|
}
|
|
1240
|
-
function a(o, u,
|
|
1241
|
-
var
|
|
1243
|
+
function a(o, u, y, f) {
|
|
1244
|
+
var C, E;
|
|
1242
1245
|
if (!o)
|
|
1243
1246
|
return;
|
|
1244
|
-
let
|
|
1247
|
+
let g = o, v = u;
|
|
1245
1248
|
if (o.__tres && (o.__tres.memoizedProps[u] = f), u === "attach") {
|
|
1246
|
-
const
|
|
1247
|
-
s(o),
|
|
1249
|
+
const P = ((C = o.__tres) == null ? void 0 : C.parent) || o.parent;
|
|
1250
|
+
s(o), z(o, { attach: f }, e), P && r(o, P);
|
|
1248
1251
|
return;
|
|
1249
1252
|
}
|
|
1250
1253
|
if (u === "dispose") {
|
|
1251
|
-
o.__tres || (o =
|
|
1254
|
+
o.__tres || (o = z(o, {}, e)), o.__tres.dispose = f;
|
|
1252
1255
|
return;
|
|
1253
1256
|
}
|
|
1254
|
-
if (
|
|
1255
|
-
f || f === "" ? o[
|
|
1257
|
+
if (N(o) && v === "blocks-pointer-events") {
|
|
1258
|
+
f || f === "" ? o[v] = f : delete o[v];
|
|
1256
1259
|
return;
|
|
1257
1260
|
}
|
|
1258
1261
|
Qe.includes(u) && o.__tres && (o.__tres.eventCount += 1);
|
|
1259
|
-
let
|
|
1260
|
-
if (
|
|
1261
|
-
const
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
new Me.value[
|
|
1262
|
+
let b = ie(v), m = g == null ? void 0 : g[b];
|
|
1263
|
+
if (v === "args") {
|
|
1264
|
+
const P = o, S = y ?? [], M = f ?? [], _ = ((E = o.__tres) == null ? void 0 : E.type) || o.type;
|
|
1265
|
+
_ && S.length && !qn(S, M) && (g = Object.assign(
|
|
1266
|
+
P,
|
|
1267
|
+
new Me.value[_](...f)
|
|
1265
1268
|
));
|
|
1266
1269
|
return;
|
|
1267
1270
|
}
|
|
1268
|
-
if (
|
|
1269
|
-
if (
|
|
1271
|
+
if (g.type === "BufferGeometry") {
|
|
1272
|
+
if (v === "args")
|
|
1270
1273
|
return;
|
|
1271
|
-
|
|
1272
|
-
|
|
1274
|
+
g.setAttribute(
|
|
1275
|
+
ie(v),
|
|
1273
1276
|
new Wt(...f)
|
|
1274
1277
|
);
|
|
1275
1278
|
return;
|
|
1276
1279
|
}
|
|
1277
|
-
if (
|
|
1278
|
-
const
|
|
1279
|
-
m =
|
|
1280
|
+
if (v.includes("-") && m === void 0) {
|
|
1281
|
+
const P = v.split("-");
|
|
1282
|
+
m = P.reduce((S, M) => S[ie(M)], g), v = P.pop(), b = v, m != null && m.set || (g = P.reduce((S, M) => S[ie(M)], g));
|
|
1280
1283
|
}
|
|
1281
|
-
let
|
|
1282
|
-
if (
|
|
1283
|
-
Qe.includes(u) || (de(
|
|
1284
|
+
let d = f;
|
|
1285
|
+
if (d === "" && (d = !0), G(m)) {
|
|
1286
|
+
Qe.includes(u) || (de(d) ? o[b](...d) : o[b](d)), b.startsWith("on") && G(d) && (g[b] = d);
|
|
1284
1287
|
return;
|
|
1285
1288
|
}
|
|
1286
|
-
!(m != null && m.set) && !
|
|
1289
|
+
!(m != null && m.set) && !G(m) ? g[b] = d : m.constructor === d.constructor && (m != null && m.copy) ? m == null || m.copy(d) : de(d) ? m.set(...d) : !m.isColor && m.setScalar ? m.setScalar(d) : m.set(d), pt(o);
|
|
1287
1290
|
}
|
|
1288
1291
|
function i(o) {
|
|
1289
1292
|
var u;
|
|
1290
1293
|
return ((u = o == null ? void 0 : o.__tres) == null ? void 0 : u.parent) || null;
|
|
1291
1294
|
}
|
|
1292
1295
|
function l(o) {
|
|
1293
|
-
const u =
|
|
1296
|
+
const u = z(new Nt(), { type: "Comment" }, e);
|
|
1294
1297
|
return u.name = o, u;
|
|
1295
1298
|
}
|
|
1296
1299
|
function c(o) {
|
|
1297
|
-
var
|
|
1298
|
-
const u = i(o),
|
|
1299
|
-
return f < 0 || f >=
|
|
1300
|
+
var g;
|
|
1301
|
+
const u = i(o), y = ((g = u == null ? void 0 : u.__tres) == null ? void 0 : g.objects) || [], f = y.indexOf(o);
|
|
1302
|
+
return f < 0 || f >= y.length - 1 ? null : y[f + 1];
|
|
1300
1303
|
}
|
|
1301
1304
|
return {
|
|
1302
1305
|
insert: r,
|
|
@@ -1315,22 +1318,22 @@ const { logError: Ke } = z(), Qe = [
|
|
|
1315
1318
|
insertStaticContent: () => void 0
|
|
1316
1319
|
};
|
|
1317
1320
|
};
|
|
1318
|
-
function
|
|
1321
|
+
function yr() {
|
|
1319
1322
|
return vt().__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
|
1320
1323
|
}
|
|
1321
1324
|
function vt() {
|
|
1322
1325
|
return typeof navigator < "u" && typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : {};
|
|
1323
1326
|
}
|
|
1324
|
-
const
|
|
1325
|
-
let
|
|
1326
|
-
function
|
|
1327
|
+
const _r = typeof Proxy == "function", wr = "devtools-plugin:setup", br = "plugin:settings:set";
|
|
1328
|
+
let q, Ee;
|
|
1329
|
+
function Pr() {
|
|
1327
1330
|
var e;
|
|
1328
|
-
return
|
|
1331
|
+
return q !== void 0 || (typeof window < "u" && window.performance ? (q = !0, Ee = window.performance) : typeof globalThis < "u" && (!((e = globalThis.perf_hooks) === null || e === void 0) && e.performance) ? (q = !0, Ee = globalThis.perf_hooks.performance) : q = !1), q;
|
|
1329
1332
|
}
|
|
1330
|
-
function
|
|
1331
|
-
return
|
|
1333
|
+
function Mr() {
|
|
1334
|
+
return Pr() ? Ee.now() : Date.now();
|
|
1332
1335
|
}
|
|
1333
|
-
class
|
|
1336
|
+
class Cr {
|
|
1334
1337
|
constructor(t, n) {
|
|
1335
1338
|
this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = t, this.hook = n;
|
|
1336
1339
|
const r = {};
|
|
@@ -1358,9 +1361,9 @@ class Mr {
|
|
|
1358
1361
|
a = i;
|
|
1359
1362
|
},
|
|
1360
1363
|
now() {
|
|
1361
|
-
return
|
|
1364
|
+
return Mr();
|
|
1362
1365
|
}
|
|
1363
|
-
}, n && n.on(
|
|
1366
|
+
}, n && n.on(br, (i, l) => {
|
|
1364
1367
|
i === this.plugin.id && this.fallbacks.setSettings(l);
|
|
1365
1368
|
}), this.proxiedOn = new Proxy({}, {
|
|
1366
1369
|
get: (i, l) => this.target ? this.target.on[l] : (...c) => {
|
|
@@ -1392,12 +1395,12 @@ class Mr {
|
|
|
1392
1395
|
n.resolve(await this.target[n.method](...n.args));
|
|
1393
1396
|
}
|
|
1394
1397
|
}
|
|
1395
|
-
function
|
|
1396
|
-
const n = e, r = vt(), s =
|
|
1398
|
+
function Er(e, t) {
|
|
1399
|
+
const n = e, r = vt(), s = yr(), a = _r && n.enableEarlyProxy;
|
|
1397
1400
|
if (s && (r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !a))
|
|
1398
|
-
s.emit(
|
|
1401
|
+
s.emit(wr, e, t);
|
|
1399
1402
|
else {
|
|
1400
|
-
const i = a ? new
|
|
1403
|
+
const i = a ? new Cr(n, s) : null;
|
|
1401
1404
|
(r.__VUE_DEVTOOLS_PLUGINS__ = r.__VUE_DEVTOOLS_PLUGINS__ || []).push({
|
|
1402
1405
|
pluginDescriptor: n,
|
|
1403
1406
|
setupFn: t,
|
|
@@ -1405,7 +1408,7 @@ function Cr(e, t) {
|
|
|
1405
1408
|
}), i && t(i.proxiedTarget);
|
|
1406
1409
|
}
|
|
1407
1410
|
}
|
|
1408
|
-
function
|
|
1411
|
+
function Tr(e, t) {
|
|
1409
1412
|
const n = `▲ ■ ●${e}`;
|
|
1410
1413
|
typeof Xe == "function" ? Xe(n, t) : console.log(n);
|
|
1411
1414
|
}
|
|
@@ -1426,17 +1429,17 @@ const yt = (e) => {
|
|
|
1426
1429
|
});
|
|
1427
1430
|
const n = ke(e);
|
|
1428
1431
|
return n > 0 && t.tags.push({
|
|
1429
|
-
label: `${
|
|
1432
|
+
label: `${ur(n)} KB`,
|
|
1430
1433
|
textColor: 15707189,
|
|
1431
1434
|
backgroundColor: 16775644,
|
|
1432
1435
|
tooltip: "Memory usage"
|
|
1433
|
-
}), e.type.includes("Light") && (t.tags.push({
|
|
1436
|
+
}), e.type.includes("Light") && (Rn(e) && t.tags.push({
|
|
1434
1437
|
label: `${e.intensity}`,
|
|
1435
1438
|
textColor: 9738662,
|
|
1436
1439
|
backgroundColor: 16316922,
|
|
1437
1440
|
tooltip: "Intensity"
|
|
1438
1441
|
}), t.tags.push({
|
|
1439
|
-
label: `#${e.color.getHexString()}`,
|
|
1442
|
+
label: `#${new Z(e.color).getHexString()}`,
|
|
1440
1443
|
textColor: 9738662,
|
|
1441
1444
|
backgroundColor: 16316922,
|
|
1442
1445
|
tooltip: "Color"
|
|
@@ -1460,51 +1463,51 @@ function _t(e, t, n = "") {
|
|
|
1460
1463
|
t.children.push(s), _t(r, s, n);
|
|
1461
1464
|
});
|
|
1462
1465
|
}
|
|
1463
|
-
const
|
|
1466
|
+
const Sr = [], X = "tres:inspector", Ar = Et({
|
|
1464
1467
|
sceneGraph: null
|
|
1465
1468
|
});
|
|
1466
|
-
function
|
|
1467
|
-
|
|
1469
|
+
function kr(e, t) {
|
|
1470
|
+
Er(
|
|
1468
1471
|
{
|
|
1469
1472
|
id: "dev.esm.tres",
|
|
1470
1473
|
label: "TresJS 🪐",
|
|
1471
1474
|
logo: "https://raw.githubusercontent.com/Tresjs/tres/main/public/favicon.svg",
|
|
1472
1475
|
packageName: "tresjs",
|
|
1473
1476
|
homepage: "https://tresjs.org",
|
|
1474
|
-
componentStateTypes:
|
|
1477
|
+
componentStateTypes: Sr,
|
|
1475
1478
|
app: e
|
|
1476
1479
|
},
|
|
1477
1480
|
(n) => {
|
|
1478
|
-
typeof n.now != "function" &&
|
|
1481
|
+
typeof n.now != "function" && Tr(
|
|
1479
1482
|
"You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."
|
|
1480
1483
|
), n.addInspector({
|
|
1481
|
-
id:
|
|
1484
|
+
id: X,
|
|
1482
1485
|
label: "TresJS 🪐",
|
|
1483
1486
|
icon: "account_tree",
|
|
1484
1487
|
treeFilterPlaceholder: "Search instances"
|
|
1485
1488
|
}), setInterval(() => {
|
|
1486
|
-
n.sendInspectorTree(
|
|
1489
|
+
n.sendInspectorTree(X);
|
|
1487
1490
|
}, 1e3), setInterval(() => {
|
|
1488
1491
|
n.notifyComponentUpdate();
|
|
1489
1492
|
}, 5e3), n.on.getInspectorTree((a) => {
|
|
1490
|
-
if (a.inspectorId ===
|
|
1493
|
+
if (a.inspectorId === X) {
|
|
1491
1494
|
const i = yt(t.scene.value);
|
|
1492
|
-
_t(t.scene.value, i, a.filter),
|
|
1495
|
+
_t(t.scene.value, i, a.filter), Ar.sceneGraph = i, a.rootNodes = [i];
|
|
1493
1496
|
}
|
|
1494
1497
|
});
|
|
1495
1498
|
let r = null, s = null;
|
|
1496
1499
|
n.on.getInspectorState((a) => {
|
|
1497
1500
|
var i;
|
|
1498
|
-
if (a.inspectorId ===
|
|
1501
|
+
if (a.inspectorId === X) {
|
|
1499
1502
|
const [l] = t.scene.value.getObjectsByProperty("uuid", a.nodeId);
|
|
1500
1503
|
if (!l)
|
|
1501
1504
|
return;
|
|
1502
1505
|
if (s && r && r.parent && s.remove(r), l.isMesh) {
|
|
1503
|
-
const c =
|
|
1506
|
+
const c = Qn(l);
|
|
1504
1507
|
l.add(c), r = c, s = l;
|
|
1505
1508
|
}
|
|
1506
1509
|
a.state = {
|
|
1507
|
-
object: Object.entries(l).map(([c, o]) => ({ key: c, value: o, editable: !0 })
|
|
1510
|
+
object: Object.entries(l).map(([c, o]) => c === "children" ? { key: c, value: o.filter((u) => u.type !== "HightlightMesh") } : { key: c, value: o, editable: !0 }).filter(({ key: c }) => c !== "parent")
|
|
1508
1511
|
}, l.isScene && (a.state.info = {
|
|
1509
1512
|
memory: ke(l),
|
|
1510
1513
|
objects: l.children.length,
|
|
@@ -1523,12 +1526,12 @@ function Ar(e, t) {
|
|
|
1523
1526
|
}))) || []);
|
|
1524
1527
|
}
|
|
1525
1528
|
}), n.on.editInspectorState((a) => {
|
|
1526
|
-
a.inspectorId ===
|
|
1529
|
+
a.inspectorId === X && Kn(t.scene.value, a.nodeId, a.path, a.state.value);
|
|
1527
1530
|
});
|
|
1528
1531
|
}
|
|
1529
1532
|
);
|
|
1530
1533
|
}
|
|
1531
|
-
const
|
|
1534
|
+
const xr = ["data-scene", "data-tres"], Lr = /* @__PURE__ */ Be({
|
|
1532
1535
|
__name: "TresCanvas",
|
|
1533
1536
|
props: {
|
|
1534
1537
|
shadows: { type: Boolean, default: void 0 },
|
|
@@ -1573,66 +1576,66 @@ const kr = ["data-scene", "data-tres"], xr = /* @__PURE__ */ Be({
|
|
|
1573
1576
|
"ready"
|
|
1574
1577
|
],
|
|
1575
1578
|
setup(e, { expose: t, emit: n }) {
|
|
1576
|
-
var
|
|
1577
|
-
const r = e, s = n, a = Tt(), { logWarning: i } =
|
|
1579
|
+
var b;
|
|
1580
|
+
const r = e, s = n, a = Tt(), { logWarning: i } = Y(), l = H(), c = $(new nt()), o = (b = Ie()) == null ? void 0 : b.appContext.app;
|
|
1578
1581
|
Ce(et);
|
|
1579
1582
|
const u = (m) => Be({
|
|
1580
1583
|
setup() {
|
|
1581
|
-
var
|
|
1582
|
-
const
|
|
1583
|
-
return
|
|
1584
|
+
var C;
|
|
1585
|
+
const d = (C = Ie()) == null ? void 0 : C.appContext;
|
|
1586
|
+
return d && (d.app = o), _e("useTres", m), _e("extend", Ce), typeof window < "u" && kr(d == null ? void 0 : d.app, m), () => He(Ot, null, a != null && a.default ? a.default() : []);
|
|
1584
1587
|
}
|
|
1585
|
-
}),
|
|
1586
|
-
const
|
|
1587
|
-
|
|
1588
|
-
}, f = (m,
|
|
1589
|
-
dt(m.scene.value),
|
|
1588
|
+
}), y = (m) => {
|
|
1589
|
+
const d = u(m), { render: C } = Rt(vr(m));
|
|
1590
|
+
C(He(d), c.value);
|
|
1591
|
+
}, f = (m, d = !1) => {
|
|
1592
|
+
dt(m.scene.value), d && (m.renderer.value.dispose(), m.renderer.value.renderLists.dispose(), m.renderer.value.forceContextLoss()), c.value.__tres = {
|
|
1590
1593
|
root: m
|
|
1591
|
-
},
|
|
1592
|
-
},
|
|
1593
|
-
return t({ context:
|
|
1594
|
+
}, y(m);
|
|
1595
|
+
}, g = V(() => r.disableRender), v = $(null);
|
|
1596
|
+
return t({ context: v, dispose: () => f(v.value, !0) }), St(() => {
|
|
1594
1597
|
const m = l;
|
|
1595
|
-
|
|
1598
|
+
v.value = hr({
|
|
1596
1599
|
scene: c.value,
|
|
1597
1600
|
canvas: m,
|
|
1598
1601
|
windowSize: r.windowSize ?? !1,
|
|
1599
|
-
disableRender:
|
|
1602
|
+
disableRender: g.value ?? !1,
|
|
1600
1603
|
rendererOptions: r,
|
|
1601
1604
|
emit: s
|
|
1602
1605
|
});
|
|
1603
|
-
const { registerCamera:
|
|
1604
|
-
v
|
|
1605
|
-
const
|
|
1606
|
+
const { registerCamera: d, camera: C, cameras: E, deregisterCamera: P } = v.value;
|
|
1607
|
+
y(v.value);
|
|
1608
|
+
const S = () => {
|
|
1606
1609
|
const M = new we(
|
|
1607
1610
|
45,
|
|
1608
1611
|
window.innerWidth / window.innerHeight,
|
|
1609
1612
|
0.1,
|
|
1610
1613
|
1e3
|
|
1611
1614
|
);
|
|
1612
|
-
M.position.set(3, 3, 3), M.lookAt(0, 0, 0),
|
|
1613
|
-
const
|
|
1614
|
-
E.value.length >= 2 && (M.removeFromParent(),
|
|
1615
|
+
M.position.set(3, 3, 3), M.lookAt(0, 0, 0), d(M);
|
|
1616
|
+
const _ = Te(() => {
|
|
1617
|
+
E.value.length >= 2 && (M.removeFromParent(), P(M), _ == null || _());
|
|
1615
1618
|
});
|
|
1616
1619
|
};
|
|
1617
|
-
|
|
1620
|
+
ce(
|
|
1618
1621
|
() => r.camera,
|
|
1619
|
-
(M,
|
|
1620
|
-
M &&
|
|
1622
|
+
(M, _) => {
|
|
1623
|
+
M && d(M), _ && (_.removeFromParent(), P(_));
|
|
1621
1624
|
},
|
|
1622
1625
|
{
|
|
1623
1626
|
immediate: !0
|
|
1624
1627
|
}
|
|
1625
|
-
),
|
|
1628
|
+
), C.value || (i(
|
|
1626
1629
|
"No camera found. Creating a default perspective camera. To have full control over a camera, please add one to the scene."
|
|
1627
|
-
),
|
|
1628
|
-
}),
|
|
1629
|
-
f(
|
|
1630
|
-
}), (m,
|
|
1630
|
+
), S());
|
|
1631
|
+
}), K(() => {
|
|
1632
|
+
f(v.value);
|
|
1633
|
+
}), (m, d) => (At(), kt("canvas", {
|
|
1631
1634
|
ref_key: "canvas",
|
|
1632
1635
|
ref: l,
|
|
1633
1636
|
"data-scene": c.value.uuid,
|
|
1634
1637
|
class: xt(m.$attrs.class),
|
|
1635
|
-
"data-tres": `tresjs ${
|
|
1638
|
+
"data-tres": `tresjs ${J(An).version}`,
|
|
1636
1639
|
style: Lt({
|
|
1637
1640
|
display: "block",
|
|
1638
1641
|
width: "100%",
|
|
@@ -1644,19 +1647,19 @@ const kr = ["data-scene", "data-tres"], xr = /* @__PURE__ */ Be({
|
|
|
1644
1647
|
touchAction: "none",
|
|
1645
1648
|
...m.$attrs.style
|
|
1646
1649
|
})
|
|
1647
|
-
}, null, 14,
|
|
1650
|
+
}, null, 14, xr));
|
|
1648
1651
|
}
|
|
1649
|
-
}),
|
|
1652
|
+
}), Rr = [
|
|
1650
1653
|
"TresCanvas",
|
|
1651
1654
|
"TresLeches",
|
|
1652
1655
|
"TresScene"
|
|
1653
|
-
],
|
|
1656
|
+
], Or = {
|
|
1654
1657
|
template: {
|
|
1655
1658
|
compilerOptions: {
|
|
1656
|
-
isCustomElement: (e) => e.startsWith("Tres") && !
|
|
1659
|
+
isCustomElement: (e) => e.startsWith("Tres") && !Rr.includes(e) || e === "primitive"
|
|
1657
1660
|
}
|
|
1658
1661
|
}
|
|
1659
|
-
},
|
|
1662
|
+
}, Jr = Or, Kr = {
|
|
1660
1663
|
mounted: (e, t) => {
|
|
1661
1664
|
if (t.arg) {
|
|
1662
1665
|
console.log(`v-log:${t.arg}`, e[t.arg]);
|
|
@@ -1688,45 +1691,45 @@ class wt extends zt {
|
|
|
1688
1691
|
this.geometry.dispose(), this.material.dispose(), this.children[0].geometry.dispose(), this.children[0].material.dispose();
|
|
1689
1692
|
}
|
|
1690
1693
|
}
|
|
1691
|
-
const { logWarning: Ze } =
|
|
1692
|
-
let
|
|
1693
|
-
const
|
|
1694
|
+
const { logWarning: Ze } = Y();
|
|
1695
|
+
let le, W;
|
|
1696
|
+
const Dr = {
|
|
1694
1697
|
DirectionalLight: qt,
|
|
1695
1698
|
PointLight: Jt,
|
|
1696
1699
|
SpotLight: Kt,
|
|
1697
1700
|
HemisphereLight: Qt,
|
|
1698
1701
|
RectAreaLight: wt
|
|
1699
|
-
},
|
|
1702
|
+
}, Qr = {
|
|
1700
1703
|
mounted: (e) => {
|
|
1701
1704
|
if (!e.isLight) {
|
|
1702
1705
|
Ze(`${e.type} is not a light`);
|
|
1703
1706
|
return;
|
|
1704
1707
|
}
|
|
1705
|
-
|
|
1708
|
+
le = Dr[e.type], e.parent.add(new le(e, 1, e.color.getHex()));
|
|
1706
1709
|
},
|
|
1707
1710
|
updated: (e) => {
|
|
1708
|
-
|
|
1711
|
+
W = e.parent.children.find((t) => t instanceof le), !(W instanceof wt) && W.update();
|
|
1709
1712
|
},
|
|
1710
1713
|
unmounted: (e) => {
|
|
1711
1714
|
if (!e.isLight) {
|
|
1712
1715
|
Ze(`${e.type} is not a light`);
|
|
1713
1716
|
return;
|
|
1714
1717
|
}
|
|
1715
|
-
|
|
1718
|
+
W = e.parent.children.find((t) => t instanceof le), W && W.dispose && W.dispose(), e.parent.remove(W);
|
|
1716
1719
|
}
|
|
1717
|
-
}, { logWarning:
|
|
1718
|
-
let
|
|
1719
|
-
const
|
|
1720
|
+
}, { logWarning: jr } = Y();
|
|
1721
|
+
let I = null;
|
|
1722
|
+
const Xr = {
|
|
1720
1723
|
updated: (e, t) => {
|
|
1721
1724
|
var s;
|
|
1722
|
-
const n =
|
|
1725
|
+
const n = Xn(t);
|
|
1723
1726
|
if (!n) {
|
|
1724
|
-
|
|
1727
|
+
jr(`v-distance-to: problem with binding value: ${t.value}`);
|
|
1725
1728
|
return;
|
|
1726
1729
|
}
|
|
1727
|
-
|
|
1730
|
+
I && (I.dispose(), e.parent.remove(I));
|
|
1728
1731
|
const r = n.clone().sub(e.position);
|
|
1729
|
-
r.normalize(),
|
|
1732
|
+
r.normalize(), I = new Xt(r, e.position, e.position.distanceTo(n), 16776960), e.parent.add(I), console.table(
|
|
1730
1733
|
[
|
|
1731
1734
|
["Distance:", e.position.distanceTo(n)],
|
|
1732
1735
|
[`origin: ${e.name || e.type}`, `x:${e.position.x}, y:${e.position.y}, z:${(s = e.position) == null ? void 0 : s.z}`],
|
|
@@ -1735,40 +1738,40 @@ const Qr = {
|
|
|
1735
1738
|
);
|
|
1736
1739
|
},
|
|
1737
1740
|
unmounted: (e) => {
|
|
1738
|
-
|
|
1741
|
+
I == null || I.dispose(), e.parent.remove(I);
|
|
1739
1742
|
}
|
|
1740
|
-
},
|
|
1743
|
+
}, Zr = {
|
|
1741
1744
|
install(e) {
|
|
1742
|
-
e.component("TresCanvas",
|
|
1745
|
+
e.component("TresCanvas", Lr);
|
|
1743
1746
|
}
|
|
1744
1747
|
};
|
|
1745
1748
|
export {
|
|
1746
|
-
|
|
1749
|
+
Lr as TresCanvas,
|
|
1747
1750
|
Me as catalogue,
|
|
1748
|
-
|
|
1749
|
-
|
|
1751
|
+
pr as createRenderLoop,
|
|
1752
|
+
Zr as default,
|
|
1750
1753
|
dt as dispose,
|
|
1751
1754
|
Ce as extend,
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1755
|
+
Fr as isProd,
|
|
1756
|
+
Un as normalizeColor,
|
|
1757
|
+
Wr as normalizeVectorFlexibleParam,
|
|
1758
|
+
Vr as onTresReady,
|
|
1759
|
+
Jr as templateCompilerOptions,
|
|
1760
|
+
lr as trasverseObjects,
|
|
1761
|
+
Bn as useCamera,
|
|
1762
|
+
Nr as useLoader,
|
|
1763
|
+
Y as useLogger,
|
|
1764
|
+
qr as useLoop,
|
|
1765
|
+
cr as useRaycaster,
|
|
1766
|
+
Ur as useRenderLoop,
|
|
1767
|
+
ir as useRenderer,
|
|
1768
|
+
Gr as useSeek,
|
|
1769
|
+
zr as useTexture,
|
|
1770
|
+
Yr as useTres,
|
|
1768
1771
|
pe as useTresContext,
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1772
|
+
hr as useTresContextProvider,
|
|
1773
|
+
fr as useTresEventManager,
|
|
1774
|
+
Xr as vDistanceTo,
|
|
1775
|
+
Qr as vLightHelper,
|
|
1776
|
+
Kr as vLog
|
|
1774
1777
|
};
|