@tresjs/core 4.2.6 → 4.2.8
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/composables/useLoader/index.d.ts +1 -1
- package/dist/tres.js +310 -307
- package/dist/tres.umd.cjs +2 -2
- package/package.json +7 -3
package/dist/tres.js
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name: @tresjs/core
|
|
3
|
-
* version: v4.2.
|
|
3
|
+
* version: v4.2.8
|
|
4
4
|
* (c) 2024
|
|
5
5
|
* description: Declarative ThreeJS using Vue Components
|
|
6
6
|
* author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
|
|
7
7
|
*/
|
|
8
8
|
var bt = Object.defineProperty;
|
|
9
|
-
var
|
|
10
|
-
var me = (e, t, n) =>
|
|
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
|
|
9
|
+
var Ct = (e, t, n) => t in e ? bt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
10
|
+
var me = (e, t, n) => Ct(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 ce, readonly as ye, unref as J, provide as _e, inject as Mt, isRef as Pt, reactive as Et, defineComponent as Be, useSlots as Tt, getCurrentInstance as Ie, onMounted as St, openBlock as At, createElementBlock as xt, normalizeClass as kt, normalizeStyle as Lt, createRenderer as Rt, h as He, Fragment as Ot } from "vue";
|
|
12
12
|
import * as et from "three";
|
|
13
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.8", 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
|
+
type: "git",
|
|
17
|
+
url: "git+https://github.com/Tresjs/tres.git"
|
|
18
|
+
}, vn = [
|
|
16
19
|
"vue",
|
|
17
20
|
"3d",
|
|
18
21
|
"threejs",
|
|
19
22
|
"three",
|
|
20
23
|
"threejs-vue"
|
|
21
|
-
],
|
|
24
|
+
], yn = !1, _n = {
|
|
22
25
|
".": {
|
|
23
26
|
types: "./dist/index.d.ts",
|
|
24
27
|
import: "./dist/tres.js",
|
|
@@ -37,15 +40,15 @@ const cn = "@tresjs/core", un = "module", fn = "4.2.6", dn = "pnpm@9.1.4", pn =
|
|
|
37
40
|
types: "./dist/src/utils/index.d.ts"
|
|
38
41
|
},
|
|
39
42
|
"./*": "./*"
|
|
40
|
-
},
|
|
43
|
+
}, wn = "./dist/tres.js", bn = "./dist/tres.js", Cn = "./dist/index.d.ts", Mn = [
|
|
41
44
|
"*.d.ts",
|
|
42
45
|
"dist"
|
|
43
|
-
],
|
|
46
|
+
], Pn = {
|
|
44
47
|
access: "public"
|
|
45
|
-
},
|
|
46
|
-
dev: "cd playground && npm run dev",
|
|
48
|
+
}, En = {
|
|
49
|
+
dev: "cd playground/vue && npm run dev",
|
|
50
|
+
"dev:nuxt": "cd playground/nuxt && npm run dev",
|
|
47
51
|
build: "vite build",
|
|
48
|
-
playground: "cd playground && npm run dev",
|
|
49
52
|
test: "vitest",
|
|
50
53
|
"test:ci": "vitest run",
|
|
51
54
|
"test:ui": "vitest --ui --coverage.enabled=true",
|
|
@@ -59,14 +62,14 @@ const cn = "@tresjs/core", un = "module", fn = "4.2.6", dn = "pnpm@9.1.4", pn =
|
|
|
59
62
|
"docs:preview": "vitepress preview docs",
|
|
60
63
|
"docs:contributors": "esno scripts/update-contributors.ts",
|
|
61
64
|
prepare: "node .husky/install.mjs"
|
|
62
|
-
},
|
|
65
|
+
}, Tn = {
|
|
63
66
|
three: ">=0.133",
|
|
64
67
|
vue: ">=3.4"
|
|
65
|
-
},
|
|
68
|
+
}, Sn = {
|
|
66
69
|
"@alvarosabu/utils": "^3.2.0",
|
|
67
70
|
"@vue/devtools-api": "^6.6.3",
|
|
68
71
|
"@vueuse/core": "^10.11.0"
|
|
69
|
-
},
|
|
72
|
+
}, An = {
|
|
70
73
|
"@release-it/conventional-changelog": "^8.0.1",
|
|
71
74
|
"@stackblitz/sdk": "^1.11.0",
|
|
72
75
|
"@tresjs/cientos": "3.9.0",
|
|
@@ -107,7 +110,7 @@ const cn = "@tresjs/core", un = "module", fn = "4.2.6", dn = "pnpm@9.1.4", pn =
|
|
|
107
110
|
vitest: "^2.0.2",
|
|
108
111
|
vue: "^3.4.31",
|
|
109
112
|
"vue-demi": "^0.14.8"
|
|
110
|
-
},
|
|
113
|
+
}, xn = {
|
|
111
114
|
name: cn,
|
|
112
115
|
type: un,
|
|
113
116
|
version: fn,
|
|
@@ -115,18 +118,19 @@ const cn = "@tresjs/core", un = "module", fn = "4.2.6", dn = "pnpm@9.1.4", pn =
|
|
|
115
118
|
description: pn,
|
|
116
119
|
author: mn,
|
|
117
120
|
license: hn,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
121
|
+
repository: gn,
|
|
122
|
+
keywords: vn,
|
|
123
|
+
sideEffects: yn,
|
|
124
|
+
exports: _n,
|
|
125
|
+
main: wn,
|
|
126
|
+
module: bn,
|
|
127
|
+
types: Cn,
|
|
128
|
+
files: Mn,
|
|
129
|
+
publishConfig: Pn,
|
|
130
|
+
scripts: En,
|
|
131
|
+
peerDependencies: Tn,
|
|
132
|
+
dependencies: Sn,
|
|
133
|
+
devDependencies: An
|
|
130
134
|
};
|
|
131
135
|
function be(e) {
|
|
132
136
|
return typeof e > "u";
|
|
@@ -134,7 +138,7 @@ function be(e) {
|
|
|
134
138
|
function de(e) {
|
|
135
139
|
return Array.isArray(e);
|
|
136
140
|
}
|
|
137
|
-
function
|
|
141
|
+
function kn(e) {
|
|
138
142
|
return typeof e == "number";
|
|
139
143
|
}
|
|
140
144
|
function at(e) {
|
|
@@ -152,28 +156,28 @@ function N(e) {
|
|
|
152
156
|
function We(e) {
|
|
153
157
|
return U(e) && "isCamera" in e && !!e.isCamera;
|
|
154
158
|
}
|
|
155
|
-
function
|
|
159
|
+
function Ln(e) {
|
|
156
160
|
return U(e) && "isBufferGeometry" in e && !!e.isBufferGeometry;
|
|
157
161
|
}
|
|
158
|
-
function
|
|
162
|
+
function Rn(e) {
|
|
159
163
|
return U(e) && "isMaterial" in e && !!e.isMaterial;
|
|
160
164
|
}
|
|
161
|
-
function
|
|
165
|
+
function On(e) {
|
|
162
166
|
return U(e) && "isLight" in e && !!e.isLight;
|
|
163
167
|
}
|
|
164
|
-
function
|
|
168
|
+
function Dn(e) {
|
|
165
169
|
return U(e) && "isFog" in e && !!e.isFog;
|
|
166
170
|
}
|
|
167
|
-
function
|
|
171
|
+
function jn(e) {
|
|
168
172
|
return U(e) && "isScene" in e && !!e.isScene;
|
|
169
173
|
}
|
|
170
174
|
function oe(e) {
|
|
171
|
-
return N(e) ||
|
|
175
|
+
return N(e) || Ln(e) || Rn(e) || Dn(e);
|
|
172
176
|
}
|
|
173
|
-
function
|
|
177
|
+
function Bn(e) {
|
|
174
178
|
return U(e) && !!e.isPrimitive;
|
|
175
179
|
}
|
|
176
|
-
const
|
|
180
|
+
const In = ({ sizes: e }) => {
|
|
177
181
|
const t = H([]), n = V(
|
|
178
182
|
() => t.value[0]
|
|
179
183
|
), r = (i) => {
|
|
@@ -197,7 +201,7 @@ const Bn = ({ sizes: e }) => {
|
|
|
197
201
|
};
|
|
198
202
|
return Te(() => {
|
|
199
203
|
e.aspectRatio.value && t.value.forEach((i) => {
|
|
200
|
-
!i.manual && (i instanceof we ||
|
|
204
|
+
!i.manual && (i instanceof we || Hn(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());
|
|
201
205
|
});
|
|
202
206
|
}), K(() => {
|
|
203
207
|
t.value = [];
|
|
@@ -209,12 +213,12 @@ const Bn = ({ sizes: e }) => {
|
|
|
209
213
|
setCameraActive: r
|
|
210
214
|
};
|
|
211
215
|
};
|
|
212
|
-
function
|
|
216
|
+
function Hn(e) {
|
|
213
217
|
return e.hasOwnProperty("isOrthographicCamera") && e.isOrthographicCamera;
|
|
214
218
|
}
|
|
215
219
|
const lt = j(), ct = j(), Ae = j(), ee = new tt();
|
|
216
220
|
let ue = 0, fe = 0;
|
|
217
|
-
const { pause:
|
|
221
|
+
const { pause: $n, resume: Ne, isActive: Un } = it(
|
|
218
222
|
() => {
|
|
219
223
|
lt.trigger({ delta: ue, elapsed: fe, clock: ee }), ct.trigger({ delta: ue, elapsed: fe, clock: ee }), Ae.trigger({ delta: ue, elapsed: fe, clock: ee });
|
|
220
224
|
},
|
|
@@ -228,9 +232,9 @@ const Ur = () => (ze || (ze = !0, Ne()), {
|
|
|
228
232
|
onBeforeLoop: lt.on,
|
|
229
233
|
onLoop: ct.on,
|
|
230
234
|
onAfterLoop: Ae.on,
|
|
231
|
-
pause:
|
|
235
|
+
pause: $n,
|
|
232
236
|
resume: Ne,
|
|
233
|
-
isActive:
|
|
237
|
+
isActive: Un
|
|
234
238
|
}), Fr = !0, se = "[TresJS ▲ ■ ●] ";
|
|
235
239
|
function Y() {
|
|
236
240
|
function e(...r) {
|
|
@@ -250,10 +254,10 @@ function Y() {
|
|
|
250
254
|
function Wr(e) {
|
|
251
255
|
return typeof e == "number" ? [e, e, e] : e instanceof Se ? [e.x, e.y, e.z] : e;
|
|
252
256
|
}
|
|
253
|
-
function
|
|
257
|
+
function Fn(e) {
|
|
254
258
|
return e instanceof Z ? e : Array.isArray(e) ? new Z(...e) : new Z(e);
|
|
255
259
|
}
|
|
256
|
-
class
|
|
260
|
+
class Wn extends et.Mesh {
|
|
257
261
|
constructor(...n) {
|
|
258
262
|
super(...n);
|
|
259
263
|
me(this, "type", "HightlightMesh");
|
|
@@ -269,18 +273,18 @@ const ut = (e, t) => {
|
|
|
269
273
|
for (const n of Object.keys(t))
|
|
270
274
|
t[n] instanceof Object && Object.assign(t[n], ut(e[n], t[n]));
|
|
271
275
|
return Object.assign(e || {}, t), e;
|
|
272
|
-
},
|
|
276
|
+
}, Nn = "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", zn = /* @__PURE__ */ Yn(Nn);
|
|
273
277
|
function Ge(e) {
|
|
274
278
|
return e && e.nodeType === 1;
|
|
275
279
|
}
|
|
276
280
|
function ie(e) {
|
|
277
281
|
return e.replace(/-([a-z])/g, (t, n) => n.toUpperCase());
|
|
278
282
|
}
|
|
279
|
-
const
|
|
280
|
-
function
|
|
281
|
-
return e.replace(
|
|
283
|
+
const Gn = /\B([A-Z])/g;
|
|
284
|
+
function Vn(e) {
|
|
285
|
+
return e.replace(Gn, "-$1").toLowerCase();
|
|
282
286
|
}
|
|
283
|
-
function
|
|
287
|
+
function Yn(e, t) {
|
|
284
288
|
const n = /* @__PURE__ */ Object.create(null), r = e.split(",");
|
|
285
289
|
for (let s = 0; s < r.length; s++)
|
|
286
290
|
n[r[s]] = !0;
|
|
@@ -291,7 +295,7 @@ const Ve = (e, t) => {
|
|
|
291
295
|
return;
|
|
292
296
|
const n = Array.isArray(t) ? t : t.match(/([^[.\]])+/g);
|
|
293
297
|
return n == null ? void 0 : n.reduce((r, s) => r && r[s], e);
|
|
294
|
-
},
|
|
298
|
+
}, qn = (e, t, n) => {
|
|
295
299
|
const r = Array.isArray(t) ? t : t.match(/([^[.\]])+/g);
|
|
296
300
|
r && r.reduce((s, l, i) => (s[l] === void 0 && (s[l] = {}), i === r.length - 1 && (s[l] = n), s[l]), e);
|
|
297
301
|
};
|
|
@@ -312,7 +316,7 @@ function ft(e, t) {
|
|
|
312
316
|
return !1;
|
|
313
317
|
return !0;
|
|
314
318
|
}
|
|
315
|
-
function
|
|
319
|
+
function Jn(e, t) {
|
|
316
320
|
if (!Array.isArray(e) || !Array.isArray(t) || e.length !== t.length)
|
|
317
321
|
return !1;
|
|
318
322
|
for (let n = 0; n < e.length; n++)
|
|
@@ -320,8 +324,8 @@ function qn(e, t) {
|
|
|
320
324
|
return !1;
|
|
321
325
|
return !0;
|
|
322
326
|
}
|
|
323
|
-
const
|
|
324
|
-
function
|
|
327
|
+
const Kn = Array.isArray;
|
|
328
|
+
function Qn(e, t, n, r) {
|
|
325
329
|
const s = (c) => {
|
|
326
330
|
if (c.uuid === t)
|
|
327
331
|
return c;
|
|
@@ -346,7 +350,7 @@ function Kn(e, t, n, r) {
|
|
|
346
350
|
const a = n[n.length - 1];
|
|
347
351
|
i[a] !== void 0 ? i[a] = r : console.warn(`Property path is not valid: ${n.join(".")}`);
|
|
348
352
|
}
|
|
349
|
-
function
|
|
353
|
+
function Xn(e) {
|
|
350
354
|
const t = new ot({
|
|
351
355
|
color: 11003607,
|
|
352
356
|
// Highlight color, e.g., yellow
|
|
@@ -357,18 +361,18 @@ function Qn(e) {
|
|
|
357
361
|
side: jt
|
|
358
362
|
// To e
|
|
359
363
|
});
|
|
360
|
-
return new
|
|
364
|
+
return new Wn(e.geometry.clone(), t);
|
|
361
365
|
}
|
|
362
|
-
function
|
|
366
|
+
function Zn(e) {
|
|
363
367
|
var n;
|
|
364
368
|
let t = e.value;
|
|
365
369
|
return e.value && ((n = e.value) != null && n.isMesh) && (t = e.value.position), Array.isArray(e.value) && (t = new Se(...t)), t;
|
|
366
370
|
}
|
|
367
|
-
function
|
|
371
|
+
function er(e) {
|
|
368
372
|
return "map" in e;
|
|
369
373
|
}
|
|
370
374
|
function Ye(e) {
|
|
371
|
-
|
|
375
|
+
er(e) && e.map && e.map.dispose(), e.dispose();
|
|
372
376
|
}
|
|
373
377
|
function dt(e) {
|
|
374
378
|
var n, r;
|
|
@@ -377,13 +381,13 @@ function dt(e) {
|
|
|
377
381
|
e && ((r = e.dispose) == null || r.call(e)), s.geometry && (s.geometry.dispose(), delete s.geometry), Array.isArray(s.material) ? (s.material.forEach((l) => Ye(l)), delete s.material) : s.material && (Ye(s.material), delete s.material);
|
|
378
382
|
}
|
|
379
383
|
}
|
|
380
|
-
function
|
|
384
|
+
function tr(e, t) {
|
|
381
385
|
let n = 0;
|
|
382
386
|
for (let r = 0; r < e.length; r++)
|
|
383
387
|
t(e[r], r) && (e[n] = e[r], n++);
|
|
384
388
|
return e.length = n, e;
|
|
385
389
|
}
|
|
386
|
-
function
|
|
390
|
+
function Ce(e, t) {
|
|
387
391
|
let n = e;
|
|
388
392
|
if (t.includes("-")) {
|
|
389
393
|
const r = t.split("-");
|
|
@@ -398,10 +402,10 @@ function qe(...e) {
|
|
|
398
402
|
return e.map((t, n) => n === 0 ? t : t.charAt(0).toUpperCase() + t.slice(1)).join("");
|
|
399
403
|
}
|
|
400
404
|
const Je = /-\d+$/;
|
|
401
|
-
function
|
|
405
|
+
function nr(e, t, n) {
|
|
402
406
|
if (at(n)) {
|
|
403
407
|
if (Je.test(n)) {
|
|
404
|
-
const l = n.replace(Je, ""), { target: i, key: a } =
|
|
408
|
+
const l = n.replace(Je, ""), { target: i, key: a } = Ce(e, l);
|
|
405
409
|
if (!Array.isArray(i[a])) {
|
|
406
410
|
const c = i[a], o = [];
|
|
407
411
|
o.__tresDetach = () => {
|
|
@@ -409,15 +413,15 @@ function tr(e, t, n) {
|
|
|
409
413
|
}, i[a] = o;
|
|
410
414
|
}
|
|
411
415
|
}
|
|
412
|
-
const { target: r, key: s } =
|
|
416
|
+
const { target: r, key: s } = Ce(e, n);
|
|
413
417
|
t.__tres.previousAttach = r[s], r[s] = Q(t);
|
|
414
418
|
} else
|
|
415
419
|
t.__tres.previousAttach = n(e, t);
|
|
416
420
|
}
|
|
417
|
-
function
|
|
421
|
+
function rr(e, t, n) {
|
|
418
422
|
var r, s, l;
|
|
419
423
|
if (at(n)) {
|
|
420
|
-
const { target: i, key: a } =
|
|
424
|
+
const { target: i, key: a } = Ce(e, n), c = t.__tres.previousAttach;
|
|
421
425
|
c === void 0 ? delete i[a] : i[a] = c, "__tresDetach" in i && i.__tresDetach();
|
|
422
426
|
} else
|
|
423
427
|
(s = (r = t.__tres) == null ? void 0 : r.previousAttach) == null || s.call(r, e, t);
|
|
@@ -442,7 +446,7 @@ function pt(e) {
|
|
|
442
446
|
const t = (n = e == null ? void 0 : e.__tres) == null ? void 0 : n.root;
|
|
443
447
|
t && t.render && t.render.canBeInvalidated.value && t.invalidate();
|
|
444
448
|
}
|
|
445
|
-
function
|
|
449
|
+
function or(e, t, n) {
|
|
446
450
|
var s;
|
|
447
451
|
if (!G(e.setPixelRatio))
|
|
448
452
|
return;
|
|
@@ -450,10 +454,10 @@ function rr(e, t, n) {
|
|
|
450
454
|
if (de(n) && n.length >= 2) {
|
|
451
455
|
const [l, i] = n;
|
|
452
456
|
r = rt.clamp(t, l, i);
|
|
453
|
-
} else
|
|
457
|
+
} else kn(n) ? r = n : r = t;
|
|
454
458
|
r !== ((s = e.getPixelRatio) == null ? void 0 : s.call(e)) && e.setPixelRatio(r);
|
|
455
459
|
}
|
|
456
|
-
function
|
|
460
|
+
function sr(e, t, n, r, s) {
|
|
457
461
|
const l = [...t.__tres.objects], i = Q(t);
|
|
458
462
|
if (e = Q(e), i === e)
|
|
459
463
|
return !0;
|
|
@@ -470,12 +474,12 @@ function or(e, t, n, r, s) {
|
|
|
470
474
|
return !0;
|
|
471
475
|
}
|
|
472
476
|
function Q(e) {
|
|
473
|
-
return
|
|
477
|
+
return Bn(e) ? (e.object.__tres = e.__tres, e.object) : e;
|
|
474
478
|
}
|
|
475
479
|
function mt(e, t) {
|
|
476
480
|
var r, s, l, i;
|
|
477
481
|
const n = ((r = e.__tres) == null ? void 0 : r.parent) || t.scene.value;
|
|
478
|
-
e.__tres && (e.__tres.parent = null), n && n.__tres && "objects" in n.__tres &&
|
|
482
|
+
e.__tres && (e.__tres.parent = null), n && n.__tres && "objects" in n.__tres && tr(n.__tres.objects, (a) => a !== e), (s = e.__tres) != null && s.attach ? rr(n, e, e.__tres.attach) : ((i = (l = e.parent) == null ? void 0 : l.remove) == null || i.call(l, Q(e)), e.parent = null);
|
|
479
483
|
}
|
|
480
484
|
function ht(e, t) {
|
|
481
485
|
var n;
|
|
@@ -484,7 +488,7 @@ function ht(e, t) {
|
|
|
484
488
|
t.deregisterCamera(r), (s = t.eventManager) == null || s.deregisterPointerMissedObject(r);
|
|
485
489
|
}), t.deregisterCamera(e), pt(e);
|
|
486
490
|
}
|
|
487
|
-
const
|
|
491
|
+
const ir = Number.parseInt(Bt.replace("dev", "")), ae = {
|
|
488
492
|
realistic: {
|
|
489
493
|
shadows: !0,
|
|
490
494
|
physicallyCorrectLights: !0,
|
|
@@ -501,7 +505,7 @@ const sr = Number.parseInt(Bt.replace("dev", "")), ae = {
|
|
|
501
505
|
toneMappingExposure: 1
|
|
502
506
|
}
|
|
503
507
|
};
|
|
504
|
-
function
|
|
508
|
+
function ar({
|
|
505
509
|
canvas: e,
|
|
506
510
|
options: t,
|
|
507
511
|
contextParts: { sizes: n, render: r, invalidate: s, advance: l }
|
|
@@ -530,37 +534,37 @@ function ir({
|
|
|
530
534
|
}, {
|
|
531
535
|
immediate: !0
|
|
532
536
|
}), ce(() => t.clearColor, c);
|
|
533
|
-
const { pixelRatio: o } = en(), { logError: u } = Y(),
|
|
534
|
-
const
|
|
537
|
+
const { pixelRatio: o } = en(), { logError: u } = Y(), d = (() => {
|
|
538
|
+
const h = new he(), b = {
|
|
535
539
|
shadowMap: {
|
|
536
|
-
enabled:
|
|
537
|
-
type:
|
|
540
|
+
enabled: h.shadowMap.enabled,
|
|
541
|
+
type: h.shadowMap.type
|
|
538
542
|
},
|
|
539
|
-
toneMapping:
|
|
540
|
-
toneMappingExposure:
|
|
541
|
-
outputColorSpace:
|
|
543
|
+
toneMapping: h.toneMapping,
|
|
544
|
+
toneMappingExposure: h.toneMappingExposure,
|
|
545
|
+
outputColorSpace: h.outputColorSpace
|
|
542
546
|
};
|
|
543
|
-
return
|
|
544
|
-
})(),
|
|
545
|
-
return
|
|
547
|
+
return h.dispose(), b;
|
|
548
|
+
})(), g = k(t.renderMode);
|
|
549
|
+
return g === "on-demand" && s(), g === "manual" && setTimeout(() => {
|
|
546
550
|
l();
|
|
547
551
|
}, 100), Te(() => {
|
|
548
|
-
const
|
|
549
|
-
|
|
550
|
-
const b = (
|
|
551
|
-
const
|
|
552
|
-
if (
|
|
553
|
-
return Ve(ae[
|
|
552
|
+
const h = k(t.preset);
|
|
553
|
+
h && (h in ae || u(`Renderer Preset must be one of these: ${Object.keys(ae).join(", ")}`), ut(a.value, ae[h])), or(a.value, o.value, k(t.dpr)), g === "always" && (r.frames.value = Math.max(1, r.frames.value));
|
|
554
|
+
const b = (M, P) => {
|
|
555
|
+
const C = k(M), E = () => {
|
|
556
|
+
if (h)
|
|
557
|
+
return Ve(ae[h], P);
|
|
554
558
|
};
|
|
555
|
-
if (
|
|
556
|
-
return
|
|
559
|
+
if (C !== void 0)
|
|
560
|
+
return C;
|
|
557
561
|
const S = E();
|
|
558
|
-
return S !== void 0 ? S : Ve(
|
|
559
|
-
}, y = (
|
|
560
|
-
y(t.shadows, "shadowMap.enabled"), y(t.toneMapping ?? st, "toneMapping"), y(t.shadowMapType, "shadowMap.type"),
|
|
561
|
-
const
|
|
562
|
-
|
|
563
|
-
|
|
562
|
+
return S !== void 0 ? S : Ve(d, P);
|
|
563
|
+
}, y = (M, P) => qn(a.value, P, b(M, P));
|
|
564
|
+
y(t.shadows, "shadowMap.enabled"), y(t.toneMapping ?? st, "toneMapping"), y(t.shadowMapType, "shadowMap.type"), ir < 150 && y(!t.useLegacyLights, "physicallyCorrectLights"), y(t.outputColorSpace, "outputColorSpace"), y(t.toneMappingExposure, "toneMappingExposure");
|
|
565
|
+
const f = b(t.clearColor, "clearColor");
|
|
566
|
+
f && a.value.setClearColor(
|
|
567
|
+
f ? Fn(f) : new Z(0)
|
|
564
568
|
// default clear color is not easily/efficiently retrievable from three
|
|
565
569
|
);
|
|
566
570
|
}), K(() => {
|
|
@@ -569,7 +573,6 @@ function ir({
|
|
|
569
573
|
renderer: a
|
|
570
574
|
};
|
|
571
575
|
}
|
|
572
|
-
const ar = (e) => !!e && e.constructor === Array;
|
|
573
576
|
function lr(e) {
|
|
574
577
|
const t = { nodes: {}, materials: {} };
|
|
575
578
|
return e && e.traverse((n) => {
|
|
@@ -579,20 +582,20 @@ function lr(e) {
|
|
|
579
582
|
async function Nr(e, t, n, r, s) {
|
|
580
583
|
const { logError: l } = Y(), i = new e();
|
|
581
584
|
s && s(i), n && n(i);
|
|
582
|
-
const
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
585
|
+
const a = Array.isArray(t) ? t : [t];
|
|
586
|
+
return await new Promise((c, o) => {
|
|
587
|
+
i.load(
|
|
588
|
+
a,
|
|
589
|
+
(u) => {
|
|
590
|
+
const v = u;
|
|
591
|
+
v.scene && Object.assign(v, lr(v.scene)), c(v);
|
|
592
|
+
},
|
|
593
|
+
r,
|
|
594
|
+
(u) => {
|
|
595
|
+
l("[useLoader] - Failed to load resource", u), o(u);
|
|
596
|
+
}
|
|
597
|
+
);
|
|
598
|
+
});
|
|
596
599
|
}
|
|
597
600
|
async function zr(e, t) {
|
|
598
601
|
const n = new Ut(t), r = (s) => new Promise((l, i) => {
|
|
@@ -605,7 +608,7 @@ async function zr(e, t) {
|
|
|
605
608
|
}
|
|
606
609
|
);
|
|
607
610
|
});
|
|
608
|
-
if (
|
|
611
|
+
if (Kn(e)) {
|
|
609
612
|
const s = await Promise.all(e.map((l) => r(l)));
|
|
610
613
|
return e.length > 1 ? s : s[0];
|
|
611
614
|
} else {
|
|
@@ -640,16 +643,16 @@ const cr = (e, t) => {
|
|
|
640
643
|
x: (m - u.value) / a.value * 2 - 1,
|
|
641
644
|
y: -((T - o.value) / c.value) * 2 + 1
|
|
642
645
|
};
|
|
643
|
-
},
|
|
646
|
+
}, d = ({ x: m, y: T }) => {
|
|
644
647
|
if (t.camera.value)
|
|
645
648
|
return t.raycaster.value.setFromCamera(new ge(m, T), t.camera.value), r.value = t.raycaster.value.intersectObjects(e.value, !0), r.value;
|
|
646
|
-
},
|
|
649
|
+
}, g = (m) => {
|
|
647
650
|
const T = v({
|
|
648
651
|
x: (m == null ? void 0 : m.clientX) ?? s.value,
|
|
649
652
|
y: (m == null ? void 0 : m.clientY) ?? l.value
|
|
650
653
|
});
|
|
651
|
-
return T ?
|
|
652
|
-
},
|
|
654
|
+
return T ? d(T) || [] : [];
|
|
655
|
+
}, h = j(), b = j(), y = j(), f = j(), M = j(), P = j(), C = j(), E = j();
|
|
653
656
|
function S(m) {
|
|
654
657
|
const T = {};
|
|
655
658
|
for (const F in m)
|
|
@@ -673,7 +676,7 @@ const cr = (e, t) => {
|
|
|
673
676
|
};
|
|
674
677
|
let A;
|
|
675
678
|
const L = (m) => {
|
|
676
|
-
|
|
679
|
+
g(m), _(y, m), A = m;
|
|
677
680
|
}, p = () => {
|
|
678
681
|
A && L(A);
|
|
679
682
|
};
|
|
@@ -683,15 +686,15 @@ const cr = (e, t) => {
|
|
|
683
686
|
w = (T = r.value[0]) == null ? void 0 : T.object, i = 0, x = new ge(
|
|
684
687
|
(m == null ? void 0 : m.clientX) ?? s.value,
|
|
685
688
|
(m == null ? void 0 : m.clientY) ?? l.value
|
|
686
|
-
), _(
|
|
689
|
+
), _(M, m);
|
|
687
690
|
};
|
|
688
691
|
let B, R = !1;
|
|
689
692
|
const ne = (m) => {
|
|
690
693
|
var T, F, re;
|
|
691
|
-
m instanceof PointerEvent && (r.value.length === 0 && _(
|
|
694
|
+
m instanceof PointerEvent && (r.value.length === 0 && _(P, m), w === ((T = r.value[0]) == null ? void 0 : T.object) && (D = new ge(
|
|
692
695
|
(m == null ? void 0 : m.clientX) ?? s.value,
|
|
693
696
|
(m == null ? void 0 : m.clientY) ?? l.value
|
|
694
|
-
), i = x == null ? void 0 : x.distanceTo(D), m.button === 0 ? (_(
|
|
697
|
+
), i = x == null ? void 0 : x.distanceTo(D), m.button === 0 ? (_(h, m), B === ((F = r.value[0]) == null ? void 0 : F.object) ? R = !0 : (B = (re = r.value[0]) == null ? void 0 : re.object, R = !1)) : m.button === 2 && _(C, m)), _(f, m));
|
|
695
698
|
}, ke = (m) => {
|
|
696
699
|
R && (_(b, m), B = void 0, R = !1);
|
|
697
700
|
}, Le = (m) => _(y, m), Re = (m) => _(E, m);
|
|
@@ -699,13 +702,13 @@ const cr = (e, t) => {
|
|
|
699
702
|
n != null && n.value && (n.value.removeEventListener("pointerup", ne), n.value.removeEventListener("pointerdown", O), n.value.removeEventListener("pointermove", L), n.value.removeEventListener("pointerleave", Le), n.value.removeEventListener("dblclick", ke), n.value.removeEventListener("wheel", Re));
|
|
700
703
|
}), {
|
|
701
704
|
intersects: r,
|
|
702
|
-
onClick: (m) =>
|
|
705
|
+
onClick: (m) => h.on(m).off,
|
|
703
706
|
onDblClick: (m) => b.on(m).off,
|
|
704
|
-
onContextMenu: (m) =>
|
|
707
|
+
onContextMenu: (m) => C.on(m).off,
|
|
705
708
|
onPointerMove: (m) => y.on(m).off,
|
|
706
|
-
onPointerUp: (m) =>
|
|
707
|
-
onPointerDown: (m) =>
|
|
708
|
-
onPointerMissed: (m) =>
|
|
709
|
+
onPointerUp: (m) => f.on(m).off,
|
|
710
|
+
onPointerDown: (m) => M.on(m).off,
|
|
711
|
+
onPointerMissed: (m) => P.on(m).off,
|
|
709
712
|
onWheel: (m) => E.on(m).off,
|
|
710
713
|
forceUpdate: p
|
|
711
714
|
};
|
|
@@ -749,7 +752,7 @@ function xe(e) {
|
|
|
749
752
|
function ur(e) {
|
|
750
753
|
return (e / 1024).toFixed(2);
|
|
751
754
|
}
|
|
752
|
-
const
|
|
755
|
+
const Me = H({}), Pe = (e) => Object.assign(Me.value, e);
|
|
753
756
|
function fr(e, t, n) {
|
|
754
757
|
var L;
|
|
755
758
|
const r = $(), s = $();
|
|
@@ -779,35 +782,35 @@ function fr(e, t, n) {
|
|
|
779
782
|
let R = B.parent;
|
|
780
783
|
for (; R !== null && !w.stopPropagating && !x.includes(R); )
|
|
781
784
|
w.eventObject = R, c(R[p], w), x.push(R), R = R.parent;
|
|
782
|
-
const ne =
|
|
785
|
+
const ne = Vn(p.slice(2));
|
|
783
786
|
n(ne, { intersection: O, event: w });
|
|
784
787
|
}
|
|
785
788
|
}
|
|
786
789
|
const {
|
|
787
790
|
onClick: u,
|
|
788
791
|
onDblClick: v,
|
|
789
|
-
onContextMenu:
|
|
790
|
-
onPointerMove:
|
|
791
|
-
onPointerDown:
|
|
792
|
+
onContextMenu: d,
|
|
793
|
+
onPointerMove: g,
|
|
794
|
+
onPointerDown: h,
|
|
792
795
|
onPointerUp: b,
|
|
793
796
|
onPointerMissed: y,
|
|
794
|
-
onWheel:
|
|
795
|
-
forceUpdate:
|
|
797
|
+
onWheel: f,
|
|
798
|
+
forceUpdate: M
|
|
796
799
|
} = cr(a, t);
|
|
797
|
-
b((p) => o("onPointerUp", p)),
|
|
798
|
-
let
|
|
799
|
-
|
|
800
|
+
b((p) => o("onPointerUp", p)), h((p) => o("onPointerDown", p)), u((p) => o("onClick", p)), v((p) => o("onDoubleClick", p)), d((p) => o("onContextMenu", p)), f((p) => o("onWheel", p));
|
|
801
|
+
let P = [];
|
|
802
|
+
g((p) => {
|
|
800
803
|
const w = p.intersections.map(({ object: D }) => D), x = p.intersections;
|
|
801
|
-
|
|
802
|
-
w.includes(D) || (p.intersections =
|
|
804
|
+
P.forEach(({ object: D }) => {
|
|
805
|
+
w.includes(D) || (p.intersections = P, o("onPointerLeave", p), o("onPointerOut", p));
|
|
803
806
|
}), p.intersections = x, p.intersections.forEach(({ object: D }) => {
|
|
804
|
-
|
|
805
|
-
}), o("onPointerMove", p),
|
|
807
|
+
P.includes(D) || (o("onPointerEnter", p), o("onPointerOver", p));
|
|
808
|
+
}), o("onPointerMove", p), P = p.intersections;
|
|
806
809
|
});
|
|
807
|
-
const
|
|
810
|
+
const C = [];
|
|
808
811
|
y((p) => {
|
|
809
812
|
const w = () => p.stopPropagating = !0;
|
|
810
|
-
p.stopPropagation = w,
|
|
813
|
+
p.stopPropagation = w, C.forEach((x) => {
|
|
811
814
|
p.stopPropagating || (p.eventObject = x, c(x.onPointerMissed, p));
|
|
812
815
|
}), n("pointer-missed", { event: p });
|
|
813
816
|
});
|
|
@@ -821,22 +824,22 @@ function fr(e, t, n) {
|
|
|
821
824
|
}
|
|
822
825
|
}
|
|
823
826
|
function _(p) {
|
|
824
|
-
oe(p) && N(p) && p.onPointerMissed &&
|
|
827
|
+
oe(p) && N(p) && p.onPointerMissed && C.push(p);
|
|
825
828
|
}
|
|
826
829
|
function A(p) {
|
|
827
830
|
if (oe(p) && N(p)) {
|
|
828
|
-
const w =
|
|
829
|
-
w > -1 &&
|
|
831
|
+
const w = C.indexOf(p);
|
|
832
|
+
w > -1 && C.splice(w, 1);
|
|
830
833
|
}
|
|
831
834
|
}
|
|
832
835
|
return t.eventManager = {
|
|
833
|
-
forceUpdate:
|
|
836
|
+
forceUpdate: M,
|
|
834
837
|
registerObject: E,
|
|
835
838
|
deregisterObject: S,
|
|
836
839
|
registerPointerMissedObject: _,
|
|
837
840
|
deregisterPointerMissedObject: A
|
|
838
841
|
}, {
|
|
839
|
-
forceUpdate:
|
|
842
|
+
forceUpdate: M,
|
|
840
843
|
registerObject: E,
|
|
841
844
|
deregisterObject: S,
|
|
842
845
|
registerPointerMissedObject: _,
|
|
@@ -856,8 +859,8 @@ function ve() {
|
|
|
856
859
|
let n = 0, r = !1;
|
|
857
860
|
const s = () => {
|
|
858
861
|
const o = Array.from(e.entries()).sort((u, v) => {
|
|
859
|
-
const
|
|
860
|
-
return
|
|
862
|
+
const d = u[1].priority - v[1].priority;
|
|
863
|
+
return d === 0 ? u[1].addI - v[1].addI : d;
|
|
861
864
|
});
|
|
862
865
|
t.clear(), o.forEach((u) => t.add(u[0]));
|
|
863
866
|
}, l = (o) => {
|
|
@@ -885,11 +888,11 @@ function pr() {
|
|
|
885
888
|
let c = null;
|
|
886
889
|
const o = ve(), u = ve(), v = ve();
|
|
887
890
|
S();
|
|
888
|
-
let
|
|
889
|
-
function
|
|
890
|
-
|
|
891
|
+
let d = {};
|
|
892
|
+
function g(_) {
|
|
893
|
+
d = _;
|
|
891
894
|
}
|
|
892
|
-
function
|
|
895
|
+
function h(_, A, L = 0) {
|
|
893
896
|
switch (A) {
|
|
894
897
|
case "before":
|
|
895
898
|
return o.on(_, L);
|
|
@@ -905,16 +908,16 @@ function pr() {
|
|
|
905
908
|
function y() {
|
|
906
909
|
t = !0, S(), cancelAnimationFrame(i);
|
|
907
910
|
}
|
|
908
|
-
function
|
|
911
|
+
function f() {
|
|
909
912
|
n = !1, S();
|
|
910
913
|
}
|
|
911
|
-
function
|
|
914
|
+
function M() {
|
|
912
915
|
n = !0, S();
|
|
913
916
|
}
|
|
914
|
-
function
|
|
917
|
+
function P() {
|
|
915
918
|
l.value = !0;
|
|
916
919
|
}
|
|
917
|
-
function
|
|
920
|
+
function C() {
|
|
918
921
|
l.value = !1;
|
|
919
922
|
}
|
|
920
923
|
function E() {
|
|
@@ -923,13 +926,13 @@ function pr() {
|
|
|
923
926
|
return;
|
|
924
927
|
}
|
|
925
928
|
const _ = r.getDelta(), A = r.getElapsedTime(), L = {
|
|
926
|
-
camera: J(
|
|
927
|
-
scene: J(
|
|
928
|
-
renderer: J(
|
|
929
|
-
raycaster: J(
|
|
930
|
-
controls: J(
|
|
931
|
-
invalidate:
|
|
932
|
-
advance:
|
|
929
|
+
camera: J(d.camera),
|
|
930
|
+
scene: J(d.scene),
|
|
931
|
+
renderer: J(d.renderer),
|
|
932
|
+
raycaster: J(d.raycaster),
|
|
933
|
+
controls: J(d.controls),
|
|
934
|
+
invalidate: d.invalidate,
|
|
935
|
+
advance: d.advance
|
|
933
936
|
}, p = { delta: _, elapsed: A, clock: r, ...L };
|
|
934
937
|
s.value && o.trigger(p), l.value || (u.count ? u.trigger(p) : c && c(p)), s.value && v.trigger(p), i = requestAnimationFrame(E);
|
|
935
938
|
}
|
|
@@ -939,16 +942,16 @@ function pr() {
|
|
|
939
942
|
}
|
|
940
943
|
return {
|
|
941
944
|
loopId: a,
|
|
942
|
-
register: (_, A, L) =>
|
|
945
|
+
register: (_, A, L) => h(_, A, L),
|
|
943
946
|
start: b,
|
|
944
947
|
stop: y,
|
|
945
|
-
pause:
|
|
946
|
-
resume:
|
|
947
|
-
pauseRender:
|
|
948
|
-
resumeRender:
|
|
948
|
+
pause: M,
|
|
949
|
+
resume: f,
|
|
950
|
+
pauseRender: P,
|
|
951
|
+
resumeRender: C,
|
|
949
952
|
isRenderPaused: l,
|
|
950
953
|
isActive: s,
|
|
951
|
-
setContext:
|
|
954
|
+
setContext: g,
|
|
952
955
|
setReady: (_) => e = _
|
|
953
956
|
};
|
|
954
957
|
}
|
|
@@ -957,23 +960,23 @@ function mr(e, t, n = 100) {
|
|
|
957
960
|
const r = j(), s = /* @__PURE__ */ new Set();
|
|
958
961
|
let l = !1, i = !1, a = null;
|
|
959
962
|
function c() {
|
|
960
|
-
a && clearTimeout(a), !i && !l && e() ? (r.trigger(t), s.forEach((
|
|
963
|
+
a && clearTimeout(a), !i && !l && e() ? (r.trigger(t), s.forEach((d) => d()), s.clear(), l = !0) : !i && !l && (a = setTimeout(c, n));
|
|
961
964
|
}
|
|
962
965
|
function o() {
|
|
963
966
|
i = !0, a && clearTimeout(a);
|
|
964
967
|
}
|
|
965
968
|
c();
|
|
966
|
-
const u = (
|
|
967
|
-
|
|
969
|
+
const u = (d, ...g) => {
|
|
970
|
+
d(...g);
|
|
968
971
|
};
|
|
969
972
|
return {
|
|
970
|
-
on: (
|
|
973
|
+
on: (d) => {
|
|
971
974
|
if (l)
|
|
972
|
-
return u(
|
|
975
|
+
return u(d, t), { off: () => {
|
|
973
976
|
} };
|
|
974
977
|
{
|
|
975
|
-
const
|
|
976
|
-
return s.add(
|
|
978
|
+
const g = r.on(d);
|
|
979
|
+
return s.add(g.off), r.on(d);
|
|
977
980
|
}
|
|
978
981
|
},
|
|
979
982
|
off: r.off,
|
|
@@ -1013,31 +1016,31 @@ function hr({
|
|
|
1013
1016
|
cameras: o,
|
|
1014
1017
|
registerCamera: u,
|
|
1015
1018
|
deregisterCamera: v,
|
|
1016
|
-
setCameraActive:
|
|
1017
|
-
} =
|
|
1019
|
+
setCameraActive: d
|
|
1020
|
+
} = In({ sizes: a, scene: e }), g = {
|
|
1018
1021
|
mode: H(s.renderMode || "always"),
|
|
1019
1022
|
priority: H(0),
|
|
1020
1023
|
frames: H(0),
|
|
1021
1024
|
maxFrames: 60,
|
|
1022
|
-
canBeInvalidated: V(() =>
|
|
1025
|
+
canBeInvalidated: V(() => g.mode.value === "on-demand" && g.frames.value === 0)
|
|
1023
1026
|
};
|
|
1024
|
-
function
|
|
1025
|
-
s.renderMode === "on-demand" && (
|
|
1027
|
+
function h(O = 1) {
|
|
1028
|
+
s.renderMode === "on-demand" && (g.frames.value = Math.min(g.maxFrames, g.frames.value + O));
|
|
1026
1029
|
}
|
|
1027
1030
|
function b() {
|
|
1028
|
-
s.renderMode === "manual" && (
|
|
1031
|
+
s.renderMode === "manual" && (g.frames.value = 1);
|
|
1029
1032
|
}
|
|
1030
|
-
const { renderer: y } =
|
|
1033
|
+
const { renderer: y } = ar(
|
|
1031
1034
|
{
|
|
1032
1035
|
scene: e,
|
|
1033
1036
|
canvas: t,
|
|
1034
1037
|
options: s,
|
|
1035
1038
|
emit: l,
|
|
1036
1039
|
// TODO: replace contextParts with full ctx at https://github.com/Tresjs/tres/issues/516
|
|
1037
|
-
contextParts: { sizes: a, camera: c, render:
|
|
1040
|
+
contextParts: { sizes: a, camera: c, render: g, invalidate: h, advance: b },
|
|
1038
1041
|
disableRender: r
|
|
1039
1042
|
}
|
|
1040
|
-
),
|
|
1043
|
+
), f = {
|
|
1041
1044
|
sizes: a,
|
|
1042
1045
|
scene: i,
|
|
1043
1046
|
camera: c,
|
|
@@ -1057,41 +1060,41 @@ function hr({
|
|
|
1057
1060
|
accumulator: []
|
|
1058
1061
|
}
|
|
1059
1062
|
},
|
|
1060
|
-
render:
|
|
1063
|
+
render: g,
|
|
1061
1064
|
advance: b,
|
|
1062
|
-
extend:
|
|
1063
|
-
invalidate:
|
|
1065
|
+
extend: Pe,
|
|
1066
|
+
invalidate: h,
|
|
1064
1067
|
registerCamera: u,
|
|
1065
|
-
setCameraActive:
|
|
1068
|
+
setCameraActive: d,
|
|
1066
1069
|
deregisterCamera: v,
|
|
1067
1070
|
loop: pr()
|
|
1068
1071
|
};
|
|
1069
|
-
_e("useTres",
|
|
1070
|
-
root:
|
|
1071
|
-
},
|
|
1072
|
-
c.value &&
|
|
1072
|
+
_e("useTres", f), f.scene.value.__tres = {
|
|
1073
|
+
root: f
|
|
1074
|
+
}, f.loop.register(() => {
|
|
1075
|
+
c.value && g.frames.value > 0 && (y.value.render(e, c.value), l("render", f.renderer.value)), g.priority.value = 0, g.mode.value === "always" ? g.frames.value = 1 : g.frames.value = Math.max(0, g.frames.value - 1);
|
|
1073
1076
|
}, "render");
|
|
1074
|
-
const { on:
|
|
1075
|
-
|
|
1076
|
-
l("ready",
|
|
1077
|
+
const { on: M, cancel: P } = gt(f);
|
|
1078
|
+
f.loop.setReady(!1), f.loop.start(), M(() => {
|
|
1079
|
+
l("ready", f), f.loop.setReady(!0), fr(e, f, l);
|
|
1077
1080
|
}), K(() => {
|
|
1078
|
-
|
|
1081
|
+
P(), f.loop.stop();
|
|
1079
1082
|
});
|
|
1080
|
-
const
|
|
1083
|
+
const C = 100, E = an({ every: C }), { isSupported: S, memory: _ } = ln({ interval: C }), A = 160;
|
|
1081
1084
|
let L = performance.now();
|
|
1082
1085
|
const p = ({ timestamp: O }) => {
|
|
1083
|
-
|
|
1086
|
+
f.scene.value && (f.perf.memory.allocatedMem = xe(f.scene.value)), O - L >= C && (L = O, f.perf.fps.accumulator.push(E.value), f.perf.fps.accumulator.length > A && f.perf.fps.accumulator.shift(), f.perf.fps.value = E.value, S.value && _.value && (f.perf.memory.accumulator.push(_.value.usedJSHeapSize / 1024 / 1024), f.perf.memory.accumulator.length > A && f.perf.memory.accumulator.shift(), f.perf.memory.currentMem = f.perf.memory.accumulator.reduce((B, R) => B + R, 0) / f.perf.memory.accumulator.length));
|
|
1084
1087
|
};
|
|
1085
1088
|
let w = 0;
|
|
1086
1089
|
const x = 1, { pause: D } = it(({ delta: O }) => {
|
|
1087
|
-
window.__TRES__DEVTOOLS__ && (p({ timestamp: performance.now() }), w += O, w >= x && (window.__TRES__DEVTOOLS__.cb(
|
|
1090
|
+
window.__TRES__DEVTOOLS__ && (p({ timestamp: performance.now() }), w += O, w >= x && (window.__TRES__DEVTOOLS__.cb(f), w = 0));
|
|
1088
1091
|
}, { immediate: !0 });
|
|
1089
1092
|
return K(() => {
|
|
1090
1093
|
D();
|
|
1091
|
-
}),
|
|
1094
|
+
}), f;
|
|
1092
1095
|
}
|
|
1093
1096
|
function pe() {
|
|
1094
|
-
const e =
|
|
1097
|
+
const e = Mt("useTres");
|
|
1095
1098
|
if (!e)
|
|
1096
1099
|
throw new Error("useTresContext must be used together with useTresContextProvider");
|
|
1097
1100
|
return e;
|
|
@@ -1117,14 +1120,14 @@ function qr() {
|
|
|
1117
1120
|
invalidate: i,
|
|
1118
1121
|
advance: a
|
|
1119
1122
|
});
|
|
1120
|
-
function c(v,
|
|
1121
|
-
return r.register(v, "before",
|
|
1123
|
+
function c(v, d = 0) {
|
|
1124
|
+
return r.register(v, "before", d);
|
|
1122
1125
|
}
|
|
1123
1126
|
function o(v) {
|
|
1124
1127
|
return r.register(v, "render");
|
|
1125
1128
|
}
|
|
1126
|
-
function u(v,
|
|
1127
|
-
return r.register(v, "after",
|
|
1129
|
+
function u(v, d = 0) {
|
|
1130
|
+
return r.register(v, "after", d);
|
|
1128
1131
|
}
|
|
1129
1132
|
return {
|
|
1130
1133
|
pause: r.pause,
|
|
@@ -1173,63 +1176,63 @@ const { logError: Ke } = Y(), Qe = [
|
|
|
1173
1176
|
"onWheel"
|
|
1174
1177
|
], vr = (e) => {
|
|
1175
1178
|
const t = e.scene.value;
|
|
1176
|
-
function n(o, u, v,
|
|
1177
|
-
if (
|
|
1179
|
+
function n(o, u, v, d) {
|
|
1180
|
+
if (d || (d = {}), d.args || (d.args = []), o === "template" || zn(o))
|
|
1178
1181
|
return null;
|
|
1179
|
-
let
|
|
1182
|
+
let g = o.replace("Tres", ""), h;
|
|
1180
1183
|
if (o === "primitive") {
|
|
1181
|
-
(!U(
|
|
1184
|
+
(!U(d.object) || Pt(d.object)) && Ke(
|
|
1182
1185
|
"Tres primitives need an 'object' prop, whose value is an object or shallowRef<object>"
|
|
1183
|
-
),
|
|
1186
|
+
), g = d.object.type;
|
|
1184
1187
|
const b = {};
|
|
1185
|
-
|
|
1186
|
-
|
|
1188
|
+
h = gr(
|
|
1189
|
+
d.object,
|
|
1187
1190
|
{
|
|
1188
|
-
object: (
|
|
1191
|
+
object: (f) => f,
|
|
1189
1192
|
isPrimitive: () => !0,
|
|
1190
1193
|
__tres: () => b
|
|
1191
1194
|
},
|
|
1192
1195
|
{
|
|
1193
|
-
object: (
|
|
1194
|
-
|
|
1196
|
+
object: (f, M, P, C) => {
|
|
1197
|
+
sr(f, P, C, { patchProp: l, remove: s, insert: r }, e);
|
|
1195
1198
|
},
|
|
1196
|
-
__tres: (
|
|
1197
|
-
Object.assign(b,
|
|
1199
|
+
__tres: (f) => {
|
|
1200
|
+
Object.assign(b, f);
|
|
1198
1201
|
}
|
|
1199
1202
|
}
|
|
1200
1203
|
);
|
|
1201
1204
|
} else {
|
|
1202
|
-
const b =
|
|
1205
|
+
const b = Me.value[g];
|
|
1203
1206
|
b || Ke(
|
|
1204
|
-
`${
|
|
1205
|
-
),
|
|
1207
|
+
`${g} is not defined on the THREE namespace. Use extend to add it to the catalog.`
|
|
1208
|
+
), h = new b(...d.args);
|
|
1206
1209
|
}
|
|
1207
|
-
return
|
|
1208
|
-
...
|
|
1209
|
-
type:
|
|
1210
|
-
memoizedProps:
|
|
1210
|
+
return h ? (h.isCamera && (d != null && d.position || h.position.set(3, 3, 3), d != null && d.lookAt || h.lookAt(0, 0, 0)), h = z(h, {
|
|
1211
|
+
...h.__tres,
|
|
1212
|
+
type: g,
|
|
1213
|
+
memoizedProps: d,
|
|
1211
1214
|
eventCount: 0,
|
|
1212
1215
|
primitive: o === "primitive",
|
|
1213
|
-
attach:
|
|
1214
|
-
}, e),
|
|
1216
|
+
attach: d.attach
|
|
1217
|
+
}, e), h) : null;
|
|
1215
1218
|
}
|
|
1216
1219
|
function r(o, u) {
|
|
1217
|
-
var
|
|
1220
|
+
var g, h, b;
|
|
1218
1221
|
if (!o)
|
|
1219
1222
|
return;
|
|
1220
1223
|
u = u || t;
|
|
1221
|
-
const v = o.__tres ? o : z(o, {}, e),
|
|
1222
|
-
o = Q(v), u = Q(
|
|
1224
|
+
const v = o.__tres ? o : z(o, {}, e), d = u.__tres ? u : z(u, {}, e);
|
|
1225
|
+
o = Q(v), u = Q(d), o.__tres && ((g = o.__tres) == null ? void 0 : g.eventCount) > 0 && ((h = e.eventManager) == null || h.registerObject(o)), e.registerCamera(o), (b = e.eventManager) == null || b.registerPointerMissedObject(o), v.__tres.attach ? nr(d, v, v.__tres.attach) : N(o) && N(d) && (d.add(o), o.dispatchEvent({ type: "added" })), v.__tres.parent = d, d.__tres.objects && !d.__tres.objects.includes(v) && d.__tres.objects.push(v);
|
|
1223
1226
|
}
|
|
1224
1227
|
function s(o, u) {
|
|
1225
|
-
var
|
|
1228
|
+
var h, b, y, f;
|
|
1226
1229
|
if (!o)
|
|
1227
1230
|
return;
|
|
1228
|
-
o != null && o.__tres && ((
|
|
1231
|
+
o != null && o.__tres && ((h = o.__tres) == null ? void 0 : h.eventCount) > 0 && ((b = e.eventManager) == null || b.deregisterObject(o)), u = be(u) ? "default" : u;
|
|
1229
1232
|
const v = (y = o.__tres) == null ? void 0 : y.dispose;
|
|
1230
1233
|
be(v) || (v === null ? u = !1 : u = v);
|
|
1231
|
-
const
|
|
1232
|
-
if (o.__tres && "objects" in o.__tres && [...o.__tres.objects].forEach((
|
|
1234
|
+
const d = (f = o.__tres) == null ? void 0 : f.primitive, g = u === "default" ? !d : !!u;
|
|
1235
|
+
if (o.__tres && "objects" in o.__tres && [...o.__tres.objects].forEach((M) => s(M, u)), g && o.children && [...o.children].forEach((M) => s(M, u)), mt(o, e), ht(o, e), g && !jn(o)) {
|
|
1233
1236
|
if (G(u))
|
|
1234
1237
|
u(o);
|
|
1235
1238
|
else if (G(o.dispose))
|
|
@@ -1240,53 +1243,53 @@ const { logError: Ke } = Y(), Qe = [
|
|
|
1240
1243
|
}
|
|
1241
1244
|
"__tres" in o && delete o.__tres;
|
|
1242
1245
|
}
|
|
1243
|
-
function l(o, u, v,
|
|
1244
|
-
var
|
|
1246
|
+
function l(o, u, v, d) {
|
|
1247
|
+
var M, P;
|
|
1245
1248
|
if (!o)
|
|
1246
1249
|
return;
|
|
1247
|
-
let
|
|
1248
|
-
if (o.__tres && (o.__tres.memoizedProps[u] =
|
|
1249
|
-
const
|
|
1250
|
-
s(o), z(o, { attach:
|
|
1250
|
+
let g = o, h = u;
|
|
1251
|
+
if (o.__tres && (o.__tres.memoizedProps[u] = d), u === "attach") {
|
|
1252
|
+
const C = ((M = o.__tres) == null ? void 0 : M.parent) || o.parent;
|
|
1253
|
+
s(o), z(o, { attach: d }, e), C && r(o, C);
|
|
1251
1254
|
return;
|
|
1252
1255
|
}
|
|
1253
1256
|
if (u === "dispose") {
|
|
1254
|
-
o.__tres || (o = z(o, {}, e)), o.__tres.dispose =
|
|
1257
|
+
o.__tres || (o = z(o, {}, e)), o.__tres.dispose = d;
|
|
1255
1258
|
return;
|
|
1256
1259
|
}
|
|
1257
|
-
if (N(o) &&
|
|
1258
|
-
|
|
1260
|
+
if (N(o) && h === "blocks-pointer-events") {
|
|
1261
|
+
d || d === "" ? o[h] = d : delete o[h];
|
|
1259
1262
|
return;
|
|
1260
1263
|
}
|
|
1261
1264
|
Qe.includes(u) && o.__tres && (o.__tres.eventCount += 1);
|
|
1262
|
-
let b = ie(
|
|
1263
|
-
if (
|
|
1264
|
-
const
|
|
1265
|
-
_ && E.length && !
|
|
1266
|
-
|
|
1267
|
-
new
|
|
1265
|
+
let b = ie(h), y = g == null ? void 0 : g[b];
|
|
1266
|
+
if (h === "args") {
|
|
1267
|
+
const C = o, E = v ?? [], S = d ?? [], _ = ((P = o.__tres) == null ? void 0 : P.type) || o.type;
|
|
1268
|
+
_ && E.length && !Jn(E, S) && (g = Object.assign(
|
|
1269
|
+
C,
|
|
1270
|
+
new Me.value[_](...d)
|
|
1268
1271
|
));
|
|
1269
1272
|
return;
|
|
1270
1273
|
}
|
|
1271
|
-
if (
|
|
1272
|
-
if (
|
|
1274
|
+
if (g.type === "BufferGeometry") {
|
|
1275
|
+
if (h === "args")
|
|
1273
1276
|
return;
|
|
1274
|
-
|
|
1275
|
-
ie(
|
|
1276
|
-
new Wt(...
|
|
1277
|
+
g.setAttribute(
|
|
1278
|
+
ie(h),
|
|
1279
|
+
new Wt(...d)
|
|
1277
1280
|
);
|
|
1278
1281
|
return;
|
|
1279
1282
|
}
|
|
1280
|
-
if (
|
|
1281
|
-
const
|
|
1282
|
-
y =
|
|
1283
|
+
if (h.includes("-") && y === void 0) {
|
|
1284
|
+
const C = h.split("-");
|
|
1285
|
+
y = C.reduce((E, S) => E[ie(S)], g), h = C.pop(), b = h, y != null && y.set || (g = C.reduce((E, S) => E[ie(S)], g));
|
|
1283
1286
|
}
|
|
1284
|
-
let
|
|
1285
|
-
if (
|
|
1286
|
-
Qe.includes(u) || (de(
|
|
1287
|
+
let f = d;
|
|
1288
|
+
if (f === "" && (f = !0), G(y)) {
|
|
1289
|
+
Qe.includes(u) || (de(f) ? o[b](...f) : o[b](f)), b.startsWith("on") && G(f) && (g[b] = f);
|
|
1287
1290
|
return;
|
|
1288
1291
|
}
|
|
1289
|
-
!(y != null && y.set) && !G(y) ?
|
|
1292
|
+
!(y != null && y.set) && !G(y) ? g[b] = f : y.constructor === f.constructor && (y != null && y.copy) ? y == null || y.copy(f) : de(f) ? y.set(...f) : !y.isColor && y.setScalar ? y.setScalar(f) : y.set(f), pt(o);
|
|
1290
1293
|
}
|
|
1291
1294
|
function i(o) {
|
|
1292
1295
|
var u;
|
|
@@ -1297,9 +1300,9 @@ const { logError: Ke } = Y(), Qe = [
|
|
|
1297
1300
|
return u.name = o, u;
|
|
1298
1301
|
}
|
|
1299
1302
|
function c(o) {
|
|
1300
|
-
var
|
|
1301
|
-
const u = i(o), v = ((
|
|
1302
|
-
return
|
|
1303
|
+
var g;
|
|
1304
|
+
const u = i(o), v = ((g = u == null ? void 0 : u.__tres) == null ? void 0 : g.objects) || [], d = v.indexOf(o);
|
|
1305
|
+
return d < 0 || d >= v.length - 1 ? null : v[d + 1];
|
|
1303
1306
|
}
|
|
1304
1307
|
return {
|
|
1305
1308
|
insert: r,
|
|
@@ -1326,14 +1329,14 @@ function vt() {
|
|
|
1326
1329
|
}
|
|
1327
1330
|
const _r = typeof Proxy == "function", wr = "devtools-plugin:setup", br = "plugin:settings:set";
|
|
1328
1331
|
let q, Ee;
|
|
1329
|
-
function
|
|
1332
|
+
function Cr() {
|
|
1330
1333
|
var e;
|
|
1331
1334
|
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;
|
|
1332
1335
|
}
|
|
1333
|
-
function
|
|
1334
|
-
return
|
|
1336
|
+
function Mr() {
|
|
1337
|
+
return Cr() ? Ee.now() : Date.now();
|
|
1335
1338
|
}
|
|
1336
|
-
class
|
|
1339
|
+
class Pr {
|
|
1337
1340
|
constructor(t, n) {
|
|
1338
1341
|
this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = t, this.hook = n;
|
|
1339
1342
|
const r = {};
|
|
@@ -1361,7 +1364,7 @@ class Mr {
|
|
|
1361
1364
|
l = i;
|
|
1362
1365
|
},
|
|
1363
1366
|
now() {
|
|
1364
|
-
return
|
|
1367
|
+
return Mr();
|
|
1365
1368
|
}
|
|
1366
1369
|
}, n && n.on(br, (i, a) => {
|
|
1367
1370
|
i === this.plugin.id && this.fallbacks.setSettings(a);
|
|
@@ -1400,7 +1403,7 @@ function Er(e, t) {
|
|
|
1400
1403
|
if (s && (r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !l))
|
|
1401
1404
|
s.emit(wr, e, t);
|
|
1402
1405
|
else {
|
|
1403
|
-
const i = l ? new
|
|
1406
|
+
const i = l ? new Pr(n, s) : null;
|
|
1404
1407
|
(r.__VUE_DEVTOOLS_PLUGINS__ = r.__VUE_DEVTOOLS_PLUGINS__ || []).push({
|
|
1405
1408
|
pluginDescriptor: n,
|
|
1406
1409
|
setupFn: t,
|
|
@@ -1433,7 +1436,7 @@ const yt = (e) => {
|
|
|
1433
1436
|
textColor: 15707189,
|
|
1434
1437
|
backgroundColor: 16775644,
|
|
1435
1438
|
tooltip: "Memory usage"
|
|
1436
|
-
}), e.type.includes("Light") && (
|
|
1439
|
+
}), e.type.includes("Light") && (On(e) && t.tags.push({
|
|
1437
1440
|
label: `${e.intensity}`,
|
|
1438
1441
|
textColor: 9738662,
|
|
1439
1442
|
backgroundColor: 16316922,
|
|
@@ -1503,7 +1506,7 @@ function xr(e, t) {
|
|
|
1503
1506
|
if (!a)
|
|
1504
1507
|
return;
|
|
1505
1508
|
if (s && r && r.parent && s.remove(r), a.isMesh) {
|
|
1506
|
-
const c =
|
|
1509
|
+
const c = Xn(a);
|
|
1507
1510
|
a.add(c), r = c, s = a;
|
|
1508
1511
|
}
|
|
1509
1512
|
l.state = {
|
|
@@ -1526,7 +1529,7 @@ function xr(e, t) {
|
|
|
1526
1529
|
}))) || []);
|
|
1527
1530
|
}
|
|
1528
1531
|
}), n.on.editInspectorState((l) => {
|
|
1529
|
-
l.inspectorId === X &&
|
|
1532
|
+
l.inspectorId === X && Qn(t.scene.value, l.nodeId, l.path, l.state.value);
|
|
1530
1533
|
});
|
|
1531
1534
|
}
|
|
1532
1535
|
);
|
|
@@ -1578,37 +1581,37 @@ const kr = ["data-scene", "data-tres"], Lr = /* @__PURE__ */ Be({
|
|
|
1578
1581
|
setup(e, { expose: t, emit: n }) {
|
|
1579
1582
|
var y;
|
|
1580
1583
|
const r = e, s = n, l = Tt(), { logWarning: i } = Y(), a = H(), c = $(new nt()), o = (y = Ie()) == null ? void 0 : y.appContext.app;
|
|
1581
|
-
|
|
1582
|
-
const u = (
|
|
1584
|
+
Pe(et);
|
|
1585
|
+
const u = (f, M = !1) => Be({
|
|
1583
1586
|
setup() {
|
|
1584
|
-
var
|
|
1585
|
-
const
|
|
1586
|
-
return
|
|
1587
|
+
var C;
|
|
1588
|
+
const P = (C = Ie()) == null ? void 0 : C.appContext;
|
|
1589
|
+
return P && (P.app = o), _e("useTres", f), _e("extend", Pe), typeof window < "u" && xr(P == null ? void 0 : P.app, f), () => He(Ot, null, M ? [] : l.default());
|
|
1587
1590
|
}
|
|
1588
|
-
}), v = (
|
|
1589
|
-
const
|
|
1590
|
-
|
|
1591
|
-
},
|
|
1592
|
-
dt(
|
|
1593
|
-
root:
|
|
1591
|
+
}), v = (f, M = !1) => {
|
|
1592
|
+
const P = u(f, M), { render: C } = Rt(vr(f));
|
|
1593
|
+
C(He(P), c.value);
|
|
1594
|
+
}, d = (f, M = !1) => {
|
|
1595
|
+
dt(f.scene.value), M && (f.renderer.value.dispose(), f.renderer.value.renderLists.dispose(), f.renderer.value.forceContextLoss()), c.value.__tres = {
|
|
1596
|
+
root: f
|
|
1594
1597
|
};
|
|
1595
|
-
},
|
|
1596
|
-
t({ context:
|
|
1598
|
+
}, g = V(() => r.disableRender), h = $(null);
|
|
1599
|
+
t({ context: h, dispose: () => d(h.value, !0) });
|
|
1597
1600
|
const b = () => {
|
|
1598
|
-
|
|
1601
|
+
d(h.value), v(h.value, !0);
|
|
1599
1602
|
};
|
|
1600
1603
|
return St(() => {
|
|
1601
|
-
const
|
|
1602
|
-
|
|
1604
|
+
const f = a;
|
|
1605
|
+
h.value = hr({
|
|
1603
1606
|
scene: c.value,
|
|
1604
|
-
canvas:
|
|
1607
|
+
canvas: f,
|
|
1605
1608
|
windowSize: r.windowSize ?? !1,
|
|
1606
|
-
disableRender:
|
|
1609
|
+
disableRender: g.value ?? !1,
|
|
1607
1610
|
rendererOptions: r,
|
|
1608
1611
|
emit: s
|
|
1609
1612
|
});
|
|
1610
|
-
const { registerCamera:
|
|
1611
|
-
v(
|
|
1613
|
+
const { registerCamera: M, camera: P, cameras: C, deregisterCamera: E } = h.value;
|
|
1614
|
+
v(h.value);
|
|
1612
1615
|
const S = () => {
|
|
1613
1616
|
const _ = new we(
|
|
1614
1617
|
45,
|
|
@@ -1616,38 +1619,38 @@ const kr = ["data-scene", "data-tres"], Lr = /* @__PURE__ */ Be({
|
|
|
1616
1619
|
0.1,
|
|
1617
1620
|
1e3
|
|
1618
1621
|
);
|
|
1619
|
-
_.position.set(3, 3, 3), _.lookAt(0, 0, 0),
|
|
1622
|
+
_.position.set(3, 3, 3), _.lookAt(0, 0, 0), M(_);
|
|
1620
1623
|
const A = Te(() => {
|
|
1621
|
-
|
|
1624
|
+
C.value.length >= 2 && (_.removeFromParent(), E(_), A == null || A());
|
|
1622
1625
|
});
|
|
1623
1626
|
};
|
|
1624
1627
|
ce(
|
|
1625
1628
|
() => r.camera,
|
|
1626
1629
|
(_, A) => {
|
|
1627
|
-
_ &&
|
|
1630
|
+
_ && M(_), A && (A.removeFromParent(), E(A));
|
|
1628
1631
|
},
|
|
1629
1632
|
{
|
|
1630
1633
|
immediate: !0
|
|
1631
1634
|
}
|
|
1632
|
-
),
|
|
1635
|
+
), P.value || (i(
|
|
1633
1636
|
"No camera found. Creating a default perspective camera. To have full control over a camera, please add one to the scene."
|
|
1634
1637
|
), S());
|
|
1635
|
-
}), K(b), (
|
|
1638
|
+
}), K(b), (f, M) => (At(), xt("canvas", {
|
|
1636
1639
|
ref_key: "canvas",
|
|
1637
1640
|
ref: a,
|
|
1638
1641
|
"data-scene": c.value.uuid,
|
|
1639
|
-
class: kt(
|
|
1640
|
-
"data-tres": `tresjs ${J(
|
|
1642
|
+
class: kt(f.$attrs.class),
|
|
1643
|
+
"data-tres": `tresjs ${J(xn).version}`,
|
|
1641
1644
|
style: Lt({
|
|
1642
1645
|
display: "block",
|
|
1643
1646
|
width: "100%",
|
|
1644
1647
|
height: "100%",
|
|
1645
|
-
position:
|
|
1648
|
+
position: f.windowSize ? "fixed" : "relative",
|
|
1646
1649
|
top: 0,
|
|
1647
1650
|
left: 0,
|
|
1648
1651
|
pointerEvents: "auto",
|
|
1649
1652
|
touchAction: "none",
|
|
1650
|
-
...
|
|
1653
|
+
...f.$attrs.style
|
|
1651
1654
|
})
|
|
1652
1655
|
}, null, 14, kr));
|
|
1653
1656
|
}
|
|
@@ -1724,7 +1727,7 @@ let I = null;
|
|
|
1724
1727
|
const Xr = {
|
|
1725
1728
|
updated: (e, t) => {
|
|
1726
1729
|
var s;
|
|
1727
|
-
const n =
|
|
1730
|
+
const n = Zn(t);
|
|
1728
1731
|
if (!n) {
|
|
1729
1732
|
jr(`v-distance-to: problem with binding value: ${t.value}`);
|
|
1730
1733
|
return;
|
|
@@ -1749,24 +1752,24 @@ const Xr = {
|
|
|
1749
1752
|
};
|
|
1750
1753
|
export {
|
|
1751
1754
|
Lr as TresCanvas,
|
|
1752
|
-
|
|
1755
|
+
Me as catalogue,
|
|
1753
1756
|
pr as createRenderLoop,
|
|
1754
1757
|
Zr as default,
|
|
1755
1758
|
dt as dispose,
|
|
1756
|
-
|
|
1759
|
+
Pe as extend,
|
|
1757
1760
|
Fr as isProd,
|
|
1758
|
-
|
|
1761
|
+
Fn as normalizeColor,
|
|
1759
1762
|
Wr as normalizeVectorFlexibleParam,
|
|
1760
1763
|
Vr as onTresReady,
|
|
1761
1764
|
Jr as templateCompilerOptions,
|
|
1762
1765
|
lr as trasverseObjects,
|
|
1763
|
-
|
|
1766
|
+
In as useCamera,
|
|
1764
1767
|
Nr as useLoader,
|
|
1765
1768
|
Y as useLogger,
|
|
1766
1769
|
qr as useLoop,
|
|
1767
1770
|
cr as useRaycaster,
|
|
1768
1771
|
Ur as useRenderLoop,
|
|
1769
|
-
|
|
1772
|
+
ar as useRenderer,
|
|
1770
1773
|
Gr as useSeek,
|
|
1771
1774
|
zr as useTexture,
|
|
1772
1775
|
Yr as useTres,
|