@tresjs/core 4.2.2 → 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 +248 -245
- 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 H, computed as V, watchEffect as Te, onUnmounted as K, shallowRef as $, watch 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",
|
|
@@ -40,9 +40,9 @@ const cn = "@tresjs/core", un = "module", fn = "4.2.2", dn = "pnpm@9.1.4", pn =
|
|
|
40
40
|
}, _n = "./dist/tres.js", wn = "./dist/tres.js", bn = "./dist/index.d.ts", Pn = [
|
|
41
41
|
"*.d.ts",
|
|
42
42
|
"dist"
|
|
43
|
-
],
|
|
43
|
+
], Mn = {
|
|
44
44
|
access: "public"
|
|
45
|
-
},
|
|
45
|
+
}, Cn = {
|
|
46
46
|
dev: "cd playground && npm run dev",
|
|
47
47
|
build: "vite build",
|
|
48
48
|
playground: "cd playground && npm run dev",
|
|
@@ -122,8 +122,8 @@ const cn = "@tresjs/core", un = "module", fn = "4.2.2", dn = "pnpm@9.1.4", pn =
|
|
|
122
122
|
module: wn,
|
|
123
123
|
types: bn,
|
|
124
124
|
files: Pn,
|
|
125
|
-
publishConfig:
|
|
126
|
-
scripts:
|
|
125
|
+
publishConfig: Mn,
|
|
126
|
+
scripts: Cn,
|
|
127
127
|
peerDependencies: En,
|
|
128
128
|
dependencies: Tn,
|
|
129
129
|
devDependencies: Sn
|
|
@@ -143,34 +143,37 @@ function at(e) {
|
|
|
143
143
|
function G(e) {
|
|
144
144
|
return typeof e == "function";
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function U(e) {
|
|
147
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;
|
|
172
169
|
}
|
|
173
|
-
|
|
170
|
+
function oe(e) {
|
|
171
|
+
return N(e) || xn(e) || Ln(e) || On(e);
|
|
172
|
+
}
|
|
173
|
+
function jn(e) {
|
|
174
|
+
return U(e) && !!e.isPrimitive;
|
|
175
|
+
}
|
|
176
|
+
const Bn = ({ sizes: e }) => {
|
|
174
177
|
const t = H([]), n = V(
|
|
175
178
|
() => t.value[0]
|
|
176
179
|
), r = (i) => {
|
|
@@ -194,7 +197,7 @@ 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 = [];
|
|
@@ -206,35 +209,35 @@ 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
|
-
const lt = j(), ct = j(), Ae = j(),
|
|
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
|
-
lt.trigger({ delta: ue, elapsed: fe, clock:
|
|
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
|
},
|
|
218
221
|
{ immediate: !1 }
|
|
219
222
|
);
|
|
220
223
|
Ae.on(() => {
|
|
221
|
-
ue =
|
|
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
|
-
}),
|
|
233
|
+
isActive: $n
|
|
234
|
+
}), Fr = !0, se = "[TresJS ▲ ■ ●] ";
|
|
232
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 Y() {
|
|
|
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);
|
|
@@ -411,7 +414,7 @@ function er(e, t, n) {
|
|
|
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;
|
|
@@ -439,7 +442,7 @@ 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
447
|
if (!G(e.setPixelRatio))
|
|
445
448
|
return;
|
|
@@ -450,7 +453,7 @@ 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
|
|
456
|
+
function or(e, t, n, r, s) {
|
|
454
457
|
const a = [...t.__tres.objects], i = Q(t);
|
|
455
458
|
if (e = Q(e), i === e)
|
|
456
459
|
return !0;
|
|
@@ -467,12 +470,12 @@ function rr(e, t, n, r, s) {
|
|
|
467
470
|
return !0;
|
|
468
471
|
}
|
|
469
472
|
function Q(e) {
|
|
470
|
-
return
|
|
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,7 +501,7 @@ 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 }
|
|
@@ -520,13 +523,13 @@ function sr({
|
|
|
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
|
-
}),
|
|
532
|
+
}), ce(() => t.clearColor, c);
|
|
530
533
|
const { pixelRatio: o } = en(), { logError: u } = Y(), f = (() => {
|
|
531
534
|
const v = new he(), b = {
|
|
532
535
|
shadowMap: {
|
|
@@ -543,21 +546,21 @@ function sr({
|
|
|
543
546
|
a();
|
|
544
547
|
}, 100), Te(() => {
|
|
545
548
|
const v = k(t.preset);
|
|
546
|
-
v && (v in
|
|
547
|
-
const b = (
|
|
548
|
-
const P = k(
|
|
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 = () => {
|
|
549
552
|
if (v)
|
|
550
|
-
return Ve(
|
|
553
|
+
return Ve(ae[v], E);
|
|
551
554
|
};
|
|
552
555
|
if (P !== void 0)
|
|
553
556
|
return P;
|
|
554
|
-
const
|
|
555
|
-
return
|
|
556
|
-
}, m = (
|
|
557
|
-
m(t.shadows, "shadowMap.enabled"), m(t.toneMapping ?? st, "toneMapping"), m(t.shadowMapType, "shadowMap.type"),
|
|
557
|
+
const M = S();
|
|
558
|
+
return M !== void 0 ? M : Ve(f, E);
|
|
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");
|
|
558
561
|
const d = b(t.clearColor, "clearColor");
|
|
559
562
|
d && l.value.setClearColor(
|
|
560
|
-
d ?
|
|
563
|
+
d ? Un(d) : new Z(0)
|
|
561
564
|
// default clear color is not easily/efficiently retrievable from three
|
|
562
565
|
);
|
|
563
566
|
}), K(() => {
|
|
@@ -566,14 +569,14 @@ function sr({
|
|
|
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
|
|
579
|
+
async function Nr(e, t, n, r, s) {
|
|
577
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(
|
|
@@ -582,16 +585,16 @@ async function Wr(e, t, n, r, s) {
|
|
|
582
585
|
o,
|
|
583
586
|
(f) => {
|
|
584
587
|
const g = f;
|
|
585
|
-
g.scene && Object.assign(g,
|
|
588
|
+
g.scene && Object.assign(g, lr(g.scene)), u(g);
|
|
586
589
|
},
|
|
587
590
|
r,
|
|
588
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 {
|
|
@@ -628,7 +631,7 @@ async function Nr(e, t) {
|
|
|
628
631
|
};
|
|
629
632
|
}
|
|
630
633
|
}
|
|
631
|
-
const
|
|
634
|
+
const cr = (e, t) => {
|
|
632
635
|
const n = V(() => t.renderer.value.domElement), r = $([]), { x: s, y: a } = tn({ target: n });
|
|
633
636
|
let i = 0;
|
|
634
637
|
const { width: l, height: c, top: o, left: u } = nn(n), y = ({ x: h, y: T }) => {
|
|
@@ -646,21 +649,21 @@ const lr = (e, t) => {
|
|
|
646
649
|
y: (h == null ? void 0 : h.clientY) ?? a.value
|
|
647
650
|
});
|
|
648
651
|
return T ? f(T) || [] : [];
|
|
649
|
-
}, v = j(), b = j(), m = j(), d = j(),
|
|
650
|
-
function
|
|
652
|
+
}, v = j(), b = j(), m = j(), d = j(), C = j(), E = j(), P = j(), S = j();
|
|
653
|
+
function M(h) {
|
|
651
654
|
const T = {};
|
|
652
|
-
for (const
|
|
653
|
-
typeof
|
|
655
|
+
for (const F in h)
|
|
656
|
+
typeof F != "function" && (T[F] = h[F]);
|
|
654
657
|
return T;
|
|
655
658
|
}
|
|
656
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
669
|
sourceEvent: T,
|
|
@@ -680,20 +683,20 @@ const lr = (e, t) => {
|
|
|
680
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
688
|
let B, R = !1;
|
|
686
|
-
const
|
|
687
|
-
var T,
|
|
689
|
+
const ne = (h) => {
|
|
690
|
+
var T, F, re;
|
|
688
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 ? (_(v, h), B === ((
|
|
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
696
|
R && (_(b, h), B = void 0, R = !1);
|
|
694
697
|
}, Le = (h) => _(m, h), Re = (h) => _(S, h);
|
|
695
|
-
return n.value.addEventListener("pointerup",
|
|
696
|
-
n != null && n.value && (n.value.removeEventListener("pointerup",
|
|
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
702
|
onClick: (h) => v.on(h).off,
|
|
@@ -701,13 +704,13 @@ const lr = (e, t) => {
|
|
|
701
704
|
onContextMenu: (h) => P.on(h).off,
|
|
702
705
|
onPointerMove: (h) => m.on(h).off,
|
|
703
706
|
onPointerUp: (h) => d.on(h).off,
|
|
704
|
-
onPointerDown: (h) =>
|
|
707
|
+
onPointerDown: (h) => C.on(h).off,
|
|
705
708
|
onPointerMissed: (h) => E.on(h).off,
|
|
706
709
|
onWheel: (h) => S.on(h).off,
|
|
707
710
|
forceUpdate: p
|
|
708
711
|
};
|
|
709
712
|
};
|
|
710
|
-
function
|
|
713
|
+
function Gr() {
|
|
711
714
|
const { logWarning: e } = Y();
|
|
712
715
|
function t(a, i, l) {
|
|
713
716
|
let c = null;
|
|
@@ -737,17 +740,17 @@ 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
|
|
750
|
-
function
|
|
752
|
+
const Me = H({}), Ce = (e) => Object.assign(Me.value, e);
|
|
753
|
+
function fr(e, t, n) {
|
|
751
754
|
var x;
|
|
752
755
|
const r = $(), s = $();
|
|
753
756
|
e && (r.value = e), t && (s.value = t);
|
|
@@ -776,8 +779,8 @@ function ur(e, t, n) {
|
|
|
776
779
|
let R = B.parent;
|
|
777
780
|
for (; R !== null && !w.stopPropagating && !A.includes(R); )
|
|
778
781
|
w.eventObject = R, c(R[p], w), A.push(R), R = R.parent;
|
|
779
|
-
const
|
|
780
|
-
n(
|
|
782
|
+
const ne = Gn(p.slice(2));
|
|
783
|
+
n(ne, { intersection: O, event: w });
|
|
781
784
|
}
|
|
782
785
|
}
|
|
783
786
|
const {
|
|
@@ -789,8 +792,8 @@ function ur(e, t, n) {
|
|
|
789
792
|
onPointerUp: b,
|
|
790
793
|
onPointerMissed: m,
|
|
791
794
|
onWheel: d,
|
|
792
|
-
forceUpdate:
|
|
793
|
-
} =
|
|
795
|
+
forceUpdate: C
|
|
796
|
+
} = cr(l, t);
|
|
794
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
799
|
g((p) => {
|
|
@@ -809,38 +812,38 @@ function ur(e, t, n) {
|
|
|
809
812
|
}), n("pointer-missed", { event: p });
|
|
810
813
|
});
|
|
811
814
|
function S(p) {
|
|
812
|
-
|
|
815
|
+
oe(p) && N(p) && l.value.push(p);
|
|
813
816
|
}
|
|
814
|
-
function
|
|
815
|
-
if (
|
|
817
|
+
function M(p) {
|
|
818
|
+
if (oe(p) && N(p)) {
|
|
816
819
|
const w = l.value.indexOf(p);
|
|
817
820
|
w > -1 && l.value.splice(w, 1);
|
|
818
821
|
}
|
|
819
822
|
}
|
|
820
823
|
function _(p) {
|
|
821
|
-
|
|
824
|
+
oe(p) && N(p) && p.onPointerMissed && P.push(p);
|
|
822
825
|
}
|
|
823
826
|
function L(p) {
|
|
824
|
-
if (
|
|
827
|
+
if (oe(p) && N(p)) {
|
|
825
828
|
const w = P.indexOf(p);
|
|
826
829
|
w > -1 && P.splice(w, 1);
|
|
827
830
|
}
|
|
828
831
|
}
|
|
829
832
|
return t.eventManager = {
|
|
830
|
-
forceUpdate:
|
|
833
|
+
forceUpdate: C,
|
|
831
834
|
registerObject: S,
|
|
832
|
-
deregisterObject:
|
|
835
|
+
deregisterObject: M,
|
|
833
836
|
registerPointerMissedObject: _,
|
|
834
837
|
deregisterPointerMissedObject: L
|
|
835
838
|
}, {
|
|
836
|
-
forceUpdate:
|
|
839
|
+
forceUpdate: C,
|
|
837
840
|
registerObject: S,
|
|
838
|
-
deregisterObject:
|
|
841
|
+
deregisterObject: M,
|
|
839
842
|
registerPointerMissedObject: _,
|
|
840
843
|
deregisterPointerMissedObject: L
|
|
841
844
|
};
|
|
842
845
|
}
|
|
843
|
-
function
|
|
846
|
+
function dr(e, t, n = 10) {
|
|
844
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,
|
|
@@ -874,14 +877,14 @@ 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
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
886
|
const o = ve(), u = ve(), y = ve();
|
|
884
|
-
|
|
887
|
+
M();
|
|
885
888
|
let f = {};
|
|
886
889
|
function g(_) {
|
|
887
890
|
f = _;
|
|
@@ -897,16 +900,16 @@ function dr() {
|
|
|
897
900
|
}
|
|
898
901
|
}
|
|
899
902
|
function b() {
|
|
900
|
-
t && (t = !1,
|
|
903
|
+
t && (t = !1, M(), S());
|
|
901
904
|
}
|
|
902
905
|
function m() {
|
|
903
|
-
t = !0,
|
|
906
|
+
t = !0, M(), cancelAnimationFrame(i);
|
|
904
907
|
}
|
|
905
908
|
function d() {
|
|
906
|
-
n = !1,
|
|
909
|
+
n = !1, M();
|
|
907
910
|
}
|
|
908
|
-
function
|
|
909
|
-
n = !0,
|
|
911
|
+
function C() {
|
|
912
|
+
n = !0, M();
|
|
910
913
|
}
|
|
911
914
|
function E() {
|
|
912
915
|
a.value = !0;
|
|
@@ -930,7 +933,7 @@ function dr() {
|
|
|
930
933
|
}, p = { delta: _, elapsed: L, clock: r, ...x };
|
|
931
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
|
-
function
|
|
936
|
+
function M() {
|
|
934
937
|
const _ = !t && !n;
|
|
935
938
|
r.running !== _ && (r.running ? r.stop() : r.start()), s.value = r.running;
|
|
936
939
|
}
|
|
@@ -939,7 +942,7 @@ function dr() {
|
|
|
939
942
|
register: (_, L, x) => v(_, L, x),
|
|
940
943
|
start: b,
|
|
941
944
|
stop: m,
|
|
942
|
-
pause:
|
|
945
|
+
pause: C,
|
|
943
946
|
resume: d,
|
|
944
947
|
pauseRender: E,
|
|
945
948
|
resumeRender: P,
|
|
@@ -949,7 +952,7 @@ function dr() {
|
|
|
949
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;
|
|
@@ -978,11 +981,11 @@ function pr(e, t, n = 100) {
|
|
|
978
981
|
cancel: o
|
|
979
982
|
};
|
|
980
983
|
}
|
|
981
|
-
const
|
|
984
|
+
const te = /* @__PURE__ */ new WeakMap();
|
|
982
985
|
function gt(e) {
|
|
983
|
-
if (e = e || pe(),
|
|
984
|
-
return
|
|
985
|
-
const t = 100, n = Date.now(), a =
|
|
986
|
+
if (e = e || pe(), te.has(e))
|
|
987
|
+
return te.get(e);
|
|
988
|
+
const t = 100, n = Date.now(), a = mr(() => {
|
|
986
989
|
if (Date.now() - n >= t)
|
|
987
990
|
return !0;
|
|
988
991
|
{
|
|
@@ -990,14 +993,14 @@ function gt(e) {
|
|
|
990
993
|
return !!(i && l.width > 0 && l.height > 0);
|
|
991
994
|
}
|
|
992
995
|
}, e);
|
|
993
|
-
return
|
|
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
|
-
return
|
|
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,13 +1008,13 @@ function mr({
|
|
|
1005
1008
|
rendererOptions: s,
|
|
1006
1009
|
emit: a
|
|
1007
1010
|
}) {
|
|
1008
|
-
const i = $(e), l =
|
|
1011
|
+
const i = $(e), l = dr(n, t), {
|
|
1009
1012
|
camera: c,
|
|
1010
1013
|
cameras: o,
|
|
1011
1014
|
registerCamera: u,
|
|
1012
1015
|
deregisterCamera: y,
|
|
1013
1016
|
setCameraActive: f
|
|
1014
|
-
} =
|
|
1017
|
+
} = Bn({ sizes: l, scene: e }), g = {
|
|
1015
1018
|
mode: H(s.renderMode || "always"),
|
|
1016
1019
|
priority: H(0),
|
|
1017
1020
|
frames: H(0),
|
|
@@ -1024,7 +1027,7 @@ function mr({
|
|
|
1024
1027
|
function b() {
|
|
1025
1028
|
s.renderMode === "manual" && (g.frames.value = 1);
|
|
1026
1029
|
}
|
|
1027
|
-
const { renderer: m } =
|
|
1030
|
+
const { renderer: m } = ir(
|
|
1028
1031
|
{
|
|
1029
1032
|
scene: e,
|
|
1030
1033
|
canvas: t,
|
|
@@ -1056,28 +1059,28 @@ function mr({
|
|
|
1056
1059
|
},
|
|
1057
1060
|
render: g,
|
|
1058
1061
|
advance: b,
|
|
1059
|
-
extend:
|
|
1062
|
+
extend: Ce,
|
|
1060
1063
|
invalidate: v,
|
|
1061
1064
|
registerCamera: u,
|
|
1062
1065
|
setCameraActive: f,
|
|
1063
1066
|
deregisterCamera: y,
|
|
1064
|
-
loop:
|
|
1067
|
+
loop: pr()
|
|
1065
1068
|
};
|
|
1066
1069
|
_e("useTres", d), d.scene.value.__tres = {
|
|
1067
1070
|
root: d
|
|
1068
1071
|
}, d.loop.register(() => {
|
|
1069
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
|
-
d.loop.setReady(!1), d.loop.start(),
|
|
1073
|
-
a("ready", d), d.loop.setReady(!0),
|
|
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);
|
|
1074
1077
|
}), K(() => {
|
|
1075
1078
|
E(), d.loop.stop();
|
|
1076
1079
|
});
|
|
1077
|
-
const P = 100, S = an({ every: P }), { isSupported:
|
|
1080
|
+
const P = 100, S = an({ every: P }), { isSupported: M, memory: _ } = ln({ interval: P }), L = 160;
|
|
1078
1081
|
let x = performance.now();
|
|
1079
1082
|
const p = ({ timestamp: O }) => {
|
|
1080
|
-
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,
|
|
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
1085
|
let w = 0;
|
|
1083
1086
|
const A = 1, { pause: D } = it(({ delta: O }) => {
|
|
@@ -1088,13 +1091,13 @@ function mr({
|
|
|
1088
1091
|
}), d;
|
|
1089
1092
|
}
|
|
1090
1093
|
function pe() {
|
|
1091
|
-
const e =
|
|
1094
|
+
const e = Mt("useTres");
|
|
1092
1095
|
if (!e)
|
|
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,
|
|
@@ -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;
|
|
@@ -1168,18 +1171,18 @@ const { logError: Ke } = Y(), Qe = [
|
|
|
1168
1171
|
"onPointerMissed",
|
|
1169
1172
|
"onLostPointerCapture",
|
|
1170
1173
|
"onWheel"
|
|
1171
|
-
],
|
|
1174
|
+
], vr = (e) => {
|
|
1172
1175
|
const t = e.scene.value;
|
|
1173
1176
|
function n(o, u, y, f) {
|
|
1174
|
-
if (f || (f = {}), f.args || (f.args = []), o === "template" ||
|
|
1177
|
+
if (f || (f = {}), f.args || (f.args = []), o === "template" || Nn(o))
|
|
1175
1178
|
return null;
|
|
1176
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
1183
|
), g = f.object.type;
|
|
1181
1184
|
const b = {};
|
|
1182
|
-
v =
|
|
1185
|
+
v = gr(
|
|
1183
1186
|
f.object,
|
|
1184
1187
|
{
|
|
1185
1188
|
object: (d) => d,
|
|
@@ -1187,8 +1190,8 @@ const { logError: Ke } = Y(), Qe = [
|
|
|
1187
1190
|
__tres: () => b
|
|
1188
1191
|
},
|
|
1189
1192
|
{
|
|
1190
|
-
object: (d,
|
|
1191
|
-
|
|
1193
|
+
object: (d, C, E, P) => {
|
|
1194
|
+
or(d, E, P, { patchProp: a, remove: s, insert: r }, e);
|
|
1192
1195
|
},
|
|
1193
1196
|
__tres: (d) => {
|
|
1194
1197
|
Object.assign(b, d);
|
|
@@ -1196,7 +1199,7 @@ const { logError: Ke } = Y(), Qe = [
|
|
|
1196
1199
|
}
|
|
1197
1200
|
);
|
|
1198
1201
|
} else {
|
|
1199
|
-
const b =
|
|
1202
|
+
const b = Me.value[g];
|
|
1200
1203
|
b || Ke(
|
|
1201
1204
|
`${g} is not defined on the THREE namespace. Use extend to add it to the catalog.`
|
|
1202
1205
|
), v = new b(...f.args);
|
|
@@ -1216,7 +1219,7 @@ const { logError: Ke } = Y(), Qe = [
|
|
|
1216
1219
|
return;
|
|
1217
1220
|
u = u || t;
|
|
1218
1221
|
const y = o.__tres ? o : z(o, {}, e), f = u.__tres ? u : z(u, {}, e);
|
|
1219
|
-
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 ?
|
|
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
1225
|
var v, b, m, d;
|
|
@@ -1226,7 +1229,7 @@ const { logError: Ke } = Y(), Qe = [
|
|
|
1226
1229
|
const y = (m = o.__tres) == null ? void 0 : m.dispose;
|
|
1227
1230
|
be(y) || (y === null ? u = !1 : u = y);
|
|
1228
1231
|
const f = (d = o.__tres) == null ? void 0 : d.primitive, g = u === "default" ? !f : !!u;
|
|
1229
|
-
if (o.__tres && "objects" in o.__tres && [...o.__tres.objects].forEach((
|
|
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)) {
|
|
1230
1233
|
if (G(u))
|
|
1231
1234
|
u(o);
|
|
1232
1235
|
else if (G(o.dispose))
|
|
@@ -1238,12 +1241,12 @@ const { logError: Ke } = Y(), Qe = [
|
|
|
1238
1241
|
"__tres" in o && delete o.__tres;
|
|
1239
1242
|
}
|
|
1240
1243
|
function a(o, u, y, f) {
|
|
1241
|
-
var
|
|
1244
|
+
var C, E;
|
|
1242
1245
|
if (!o)
|
|
1243
1246
|
return;
|
|
1244
1247
|
let g = o, v = u;
|
|
1245
1248
|
if (o.__tres && (o.__tres.memoizedProps[u] = f), u === "attach") {
|
|
1246
|
-
const P = ((
|
|
1249
|
+
const P = ((C = o.__tres) == null ? void 0 : C.parent) || o.parent;
|
|
1247
1250
|
s(o), z(o, { attach: f }, e), P && r(o, P);
|
|
1248
1251
|
return;
|
|
1249
1252
|
}
|
|
@@ -1251,17 +1254,17 @@ const { logError: Ke } = Y(), Qe = [
|
|
|
1251
1254
|
o.__tres || (o = z(o, {}, e)), o.__tres.dispose = f;
|
|
1252
1255
|
return;
|
|
1253
1256
|
}
|
|
1254
|
-
if (
|
|
1257
|
+
if (N(o) && v === "blocks-pointer-events") {
|
|
1255
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 b =
|
|
1262
|
+
let b = ie(v), m = g == null ? void 0 : g[b];
|
|
1260
1263
|
if (v === "args") {
|
|
1261
|
-
const P = o, S = y ?? [],
|
|
1262
|
-
_ && S.length && !
|
|
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(
|
|
1263
1266
|
P,
|
|
1264
|
-
new
|
|
1267
|
+
new Me.value[_](...f)
|
|
1265
1268
|
));
|
|
1266
1269
|
return;
|
|
1267
1270
|
}
|
|
@@ -1269,14 +1272,14 @@ const { logError: Ke } = Y(), Qe = [
|
|
|
1269
1272
|
if (v === "args")
|
|
1270
1273
|
return;
|
|
1271
1274
|
g.setAttribute(
|
|
1272
|
-
|
|
1275
|
+
ie(v),
|
|
1273
1276
|
new Wt(...f)
|
|
1274
1277
|
);
|
|
1275
1278
|
return;
|
|
1276
1279
|
}
|
|
1277
1280
|
if (v.includes("-") && m === void 0) {
|
|
1278
1281
|
const P = v.split("-");
|
|
1279
|
-
m = P.reduce((S,
|
|
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
1284
|
let d = f;
|
|
1282
1285
|
if (d === "" && (d = !0), G(m)) {
|
|
@@ -1315,20 +1318,20 @@ const { logError: Ke } = Y(), 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
|
|
1327
|
+
const _r = typeof Proxy == "function", wr = "devtools-plugin:setup", br = "plugin:settings:set";
|
|
1325
1328
|
let q, Ee;
|
|
1326
|
-
function
|
|
1329
|
+
function Pr() {
|
|
1327
1330
|
var e;
|
|
1328
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
1336
|
class Cr {
|
|
1334
1337
|
constructor(t, n) {
|
|
@@ -1358,9 +1361,9 @@ class Cr {
|
|
|
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,10 +1395,10 @@ class Cr {
|
|
|
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
1403
|
const i = a ? new Cr(n, s) : null;
|
|
1401
1404
|
(r.__VUE_DEVTOOLS_PLUGINS__ = r.__VUE_DEVTOOLS_PLUGINS__ || []).push({
|
|
@@ -1405,7 +1408,7 @@ function Mr(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,22 +1463,22 @@ 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
1484
|
id: X,
|
|
@@ -1489,7 +1492,7 @@ function Ar(e, t) {
|
|
|
1489
1492
|
}, 5e3), n.on.getInspectorTree((a) => {
|
|
1490
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;
|
|
@@ -1500,11 +1503,11 @@ function Ar(e, t) {
|
|
|
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 === X &&
|
|
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 },
|
|
@@ -1575,16 +1578,16 @@ const kr = ["data-scene", "data-tres"], xr = /* @__PURE__ */ Be({
|
|
|
1575
1578
|
setup(e, { expose: t, emit: n }) {
|
|
1576
1579
|
var b;
|
|
1577
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 d = (
|
|
1583
|
-
return d && (d.app = o), _e("useTres", m), _e("extend",
|
|
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
1588
|
}), y = (m) => {
|
|
1586
|
-
const d = u(m), { render:
|
|
1587
|
-
|
|
1589
|
+
const d = u(m), { render: C } = Rt(vr(m));
|
|
1590
|
+
C(He(d), c.value);
|
|
1588
1591
|
}, f = (m, d = !1) => {
|
|
1589
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
|
|
@@ -1592,7 +1595,7 @@ const kr = ["data-scene", "data-tres"], xr = /* @__PURE__ */ Be({
|
|
|
1592
1595
|
}, g = V(() => r.disableRender), v = $(null);
|
|
1593
1596
|
return t({ context: v, dispose: () => f(v.value, !0) }), St(() => {
|
|
1594
1597
|
const m = l;
|
|
1595
|
-
v.value =
|
|
1598
|
+
v.value = hr({
|
|
1596
1599
|
scene: c.value,
|
|
1597
1600
|
canvas: m,
|
|
1598
1601
|
windowSize: r.windowSize ?? !1,
|
|
@@ -1600,29 +1603,29 @@ const kr = ["data-scene", "data-tres"], xr = /* @__PURE__ */ Be({
|
|
|
1600
1603
|
rendererOptions: r,
|
|
1601
1604
|
emit: s
|
|
1602
1605
|
});
|
|
1603
|
-
const { registerCamera: d, camera:
|
|
1606
|
+
const { registerCamera: d, camera: C, cameras: E, deregisterCamera: P } = v.value;
|
|
1604
1607
|
y(v.value);
|
|
1605
1608
|
const S = () => {
|
|
1606
|
-
const
|
|
1609
|
+
const M = new we(
|
|
1607
1610
|
45,
|
|
1608
1611
|
window.innerWidth / window.innerHeight,
|
|
1609
1612
|
0.1,
|
|
1610
1613
|
1e3
|
|
1611
1614
|
);
|
|
1612
|
-
|
|
1615
|
+
M.position.set(3, 3, 3), M.lookAt(0, 0, 0), d(M);
|
|
1613
1616
|
const _ = Te(() => {
|
|
1614
|
-
E.value.length >= 2 && (
|
|
1617
|
+
E.value.length >= 2 && (M.removeFromParent(), P(M), _ == null || _());
|
|
1615
1618
|
});
|
|
1616
1619
|
};
|
|
1617
|
-
|
|
1620
|
+
ce(
|
|
1618
1621
|
() => r.camera,
|
|
1619
|
-
(
|
|
1620
|
-
|
|
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
1630
|
), S());
|
|
1628
1631
|
}), K(() => {
|
|
@@ -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]);
|
|
@@ -1689,39 +1692,39 @@ class wt extends zt {
|
|
|
1689
1692
|
}
|
|
1690
1693
|
}
|
|
1691
1694
|
const { logWarning: Ze } = Y();
|
|
1692
|
-
let
|
|
1693
|
-
const
|
|
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:
|
|
1720
|
+
}, { logWarning: jr } = Y();
|
|
1718
1721
|
let I = null;
|
|
1719
|
-
const
|
|
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));
|
|
@@ -1737,38 +1740,38 @@ const Qr = {
|
|
|
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
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1749
|
+
Lr as TresCanvas,
|
|
1750
|
+
Me as catalogue,
|
|
1751
|
+
pr as createRenderLoop,
|
|
1752
|
+
Zr as default,
|
|
1750
1753
|
dt as dispose,
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1754
|
+
Ce as extend,
|
|
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,
|
|
1760
1763
|
Y as useLogger,
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
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
|
};
|