@tresjs/core 4.0.0-next.0 → 4.0.0-next.1

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.
Files changed (42) hide show
  1. package/dist/index.d.ts +3 -17
  2. package/dist/{components → src/components}/TresCanvas.vue.d.ts +10 -2
  3. package/dist/{composables → src/composables}/useCamera/index.d.ts +12 -12
  4. package/dist/src/composables/usePointerEventHandler/index.d.ts +17 -0
  5. package/dist/{composables → src/composables}/useRaycaster/index.d.ts +3 -3
  6. package/dist/{composables → src/composables}/useRenderer/const.d.ts +4 -0
  7. package/dist/{composables → src/composables}/useRenderer/index.d.ts +8 -3
  8. package/dist/src/composables/useSizes/index.d.ts +11 -0
  9. package/dist/src/composables/useTresContextProvider/index.d.ts +75 -0
  10. package/dist/src/core/nodeOps.d.ts +4 -0
  11. package/dist/src/directives/index.d.ts +5 -0
  12. package/dist/src/directives/vAlwaysLookAt.d.ts +6 -0
  13. package/dist/src/directives/vDistanceTo.d.ts +6 -0
  14. package/dist/src/directives/vLightHelper.d.ts +6 -0
  15. package/dist/src/directives/vLog.d.ts +6 -0
  16. package/dist/src/index.d.ts +18 -0
  17. package/dist/{types → src/types}/index.d.ts +20 -16
  18. package/dist/{utils → src/utils}/index.d.ts +3 -2
  19. package/dist/tres.js +938 -665
  20. package/dist/tres.umd.cjs +3 -3
  21. package/package.json +20 -20
  22. package/dist/composables/usePointerEventHandler/index.d.ts +0 -19
  23. package/dist/composables/useTresContextProvider/index.d.ts +0 -44
  24. package/dist/core/nodeOps.d.ts +0 -3
  25. package/dist/core/renderer.d.ts +0 -5
  26. /package/dist/{components → src/components}/index.d.ts +0 -0
  27. /package/dist/{composables → src/composables}/index.d.ts +0 -0
  28. /package/dist/{composables → src/composables}/useLoader/index.d.ts +0 -0
  29. /package/dist/{composables → src/composables}/useLogger.d.ts +0 -0
  30. /package/dist/{composables → src/composables}/useRenderLoop/index.d.ts +0 -0
  31. /package/dist/{composables → src/composables}/useSeek/index.d.ts +0 -0
  32. /package/dist/{composables → src/composables}/useTexture/index.d.ts +0 -0
  33. /package/dist/{core → src/core}/catalogue.d.ts +0 -0
  34. /package/dist/{core → src/core}/revision.d.ts +0 -0
  35. /package/dist/{devtools → src/devtools}/highlight.d.ts +0 -0
  36. /package/dist/{devtools → src/devtools}/index.d.ts +0 -0
  37. /package/dist/{devtools → src/devtools}/plugin.d.ts +0 -0
  38. /package/dist/{devtools → src/devtools}/utils.d.ts +0 -0
  39. /package/dist/{utils → src/utils}/normalize.d.ts +0 -0
  40. /package/dist/{utils → src/utils}/perf.d.ts +0 -0
  41. /package/dist/{utils → src/utils}/template-compiler-options.d.ts +0 -0
  42. /package/dist/{utils → src/utils}/test-utils.d.ts +0 -0
package/dist/tres.js CHANGED
@@ -1,490 +1,640 @@
1
1
  /**
2
2
  * name: @tresjs/core
3
- * version: v4.0.0-next.0
4
- * (c) 2023
3
+ * version: v4.0.0-next.1
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
- var Me = Object.defineProperty;
9
- var Pe = (e, r, t) => r in e ? Me(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
10
- var G = (e, r, t) => (Pe(e, typeof r != "symbol" ? r + "" : r, t), t);
11
- import { ref as B, computed as k, watchEffect as A, onUnmounted as U, shallowRef as D, watch as ie, reactive as le, readonly as Se, provide as Q, inject as ke, createRenderer as Te, defineComponent as Z, useSlots as Oe, getCurrentInstance as ee, onMounted as Ae, openBlock as xe, createElementBlock as De, normalizeClass as Le, normalizeStyle as Be, h as te, Fragment as je } from "vue";
12
- import * as ue from "three";
13
- import { PerspectiveCamera as Y, OrthographicCamera as Ie, Camera as Re, Clock as He, Vector3 as Ne, Color as N, MeshBasicMaterial as Ve, DoubleSide as $e, REVISION as Ue, SRGBColorSpace as Fe, ACESFilmicToneMapping as Ge, PCFSoftShadowMap as ze, WebGLRenderer as z, LoadingManager as We, TextureLoader as Qe, Vector2 as Ye, Raycaster as Je, BufferAttribute as Ke, Scene as qe } from "three";
14
- import { createEventHook as L, useRafFn as ce, toValue as E, unrefElement as Xe, useDevicePixelRatio as Ze, usePointer as et, useElementBounding as tt, useWindowSize as rt, useElementSize as nt, useFps as ot, useMemory as at } from "@vueuse/core";
15
- const st = ({ sizes: e, scene: r }) => {
16
- const t = B([]), n = k(
17
- () => t.value[0]
18
- ), a = (i, l = !1) => {
19
- t.value.some(({ uuid: c }) => c === i.uuid) || (l ? o(i) : t.value.push(i));
20
- }, s = (i) => {
21
- t.value = t.value.filter(({ uuid: l }) => l !== i.uuid);
22
- }, o = (i) => {
23
- const l = i instanceof Re ? i : t.value.find((m) => m.uuid === i);
8
+ var He = Object.defineProperty;
9
+ var Ne = (t, e, r) => e in t ? He(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
10
+ var Y = (t, e, r) => (Ne(t, typeof e != "symbol" ? e + "" : e, r), r);
11
+ import { ref as T, computed as x, watchEffect as se, onUnmounted as J, shallowRef as $, watch as I, reactive as be, readonly as Z, provide as ee, inject as Fe, defineComponent as le, useSlots as We, getCurrentInstance as ue, onMounted as Ue, openBlock as Ge, createElementBlock as ze, normalizeClass as Ve, unref as Je, normalizeStyle as Qe, createRenderer as Ye, h as ce, Fragment as qe } from "vue";
12
+ import * as Me from "three";
13
+ import { PerspectiveCamera as te, Camera as Ke, Clock as Xe, Vector3 as _e, Color as G, MeshBasicMaterial as Ee, DoubleSide as Ze, REVISION as et, SRGBColorSpace as tt, ACESFilmicToneMapping as Ce, PCFSoftShadowMap as rt, NoToneMapping as nt, WebGLRenderer as q, LoadingManager as ot, TextureLoader as st, Vector2 as it, Raycaster as at, BufferAttribute as lt, Scene as ut, Line as ct, BufferGeometry as de, Float32BufferAttribute as fe, LineBasicMaterial as dt, Mesh as ft, BackSide as pt, DirectionalLightHelper as mt, PointLightHelper as vt, SpotLightHelper as gt, HemisphereLightHelper as ht, ArrowHelper as yt } from "three";
14
+ import { createEventHook as H, useRafFn as Se, toValue as M, unrefElement as wt, useDevicePixelRatio as bt, usePointer as Mt, useElementBounding as _t, useWindowSize as Et, useElementSize as Ct, refDebounced as pe, useFps as St, useMemory as xt } from "@vueuse/core";
15
+ const kt = "@tresjs/core", Tt = "module", Pt = "4.0.0-next.1", At = "pnpm@8.10.2", Lt = "Declarative ThreeJS using Vue Components", Ot = "Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)", Bt = "MIT", jt = [
16
+ "vue",
17
+ "3d",
18
+ "threejs",
19
+ "three",
20
+ "threejs-vue"
21
+ ], Dt = !1, It = {
22
+ ".": {
23
+ types: "./dist/index.d.ts",
24
+ require: "./dist/tres.umd.cjs",
25
+ import: "./dist/tres.js"
26
+ },
27
+ "./components": {
28
+ types: "./dist/components/index.d.ts"
29
+ },
30
+ "./composables": {
31
+ types: "./dist/composables/index.d.ts"
32
+ },
33
+ "./types": {
34
+ types: "./dist/types/index.d.ts"
35
+ },
36
+ "./utils": {
37
+ types: "./dist/utils/index.d.ts"
38
+ },
39
+ "./*": "./*"
40
+ }, Rt = "./dist/tres.js", $t = "./dist/tres.js", Ht = "./dist/index.d.ts", Nt = [
41
+ "dist",
42
+ "*.d.ts"
43
+ ], Ft = {
44
+ access: "public"
45
+ }, Wt = {
46
+ dev: "cd playground && npm run dev",
47
+ build: "vite build",
48
+ playground: "cd playground && npm run dev",
49
+ test: "vitest",
50
+ "test:ci": "vitest run",
51
+ "test:ui": "vitest --ui",
52
+ release: "release-it",
53
+ coverage: "vitest run --coverage",
54
+ lint: "eslint . --ext .js,.jsx,.ts,.tsx,.vue",
55
+ "docs:dev": "vitepress dev docs",
56
+ "docs:build": "vitepress build docs",
57
+ "docs:serve": "vitepress serve docs",
58
+ "docs:preview": "vitepress preview docs",
59
+ "docs:contributors": "esno scripts/update-contributors.ts"
60
+ }, Ut = {
61
+ three: ">=0.133",
62
+ vue: ">=3.4"
63
+ }, Gt = {
64
+ "@alvarosabu/utils": "^3.1.1",
65
+ "@vueuse/core": "^10.7.1"
66
+ }, zt = {
67
+ "@release-it/conventional-changelog": "^8.0.1",
68
+ "@stackblitz/sdk": "^1.9.0",
69
+ "@tresjs/cientos": "3.7.0",
70
+ "@tresjs/eslint-config-vue": "^0.2.1",
71
+ "@types/three": "^0.160.0",
72
+ "@typescript-eslint/eslint-plugin": "^6.17.0",
73
+ "@typescript-eslint/parser": "^6.17.0",
74
+ "@vitejs/plugin-vue": "^5.0.2",
75
+ "@vitest/coverage-c8": "^0.33.0",
76
+ "@vitest/ui": "^1.1.1",
77
+ "@vue/test-utils": "^2.4.3",
78
+ eslint: "^8.56.0",
79
+ "eslint-plugin-vue": "^9.19.2",
80
+ esno: "^4.0.0",
81
+ gsap: "^3.12.4",
82
+ jsdom: "^23.0.1",
83
+ kolorist: "^1.8.0",
84
+ ohmyfetch: "^0.4.21",
85
+ pathe: "^1.1.1",
86
+ "release-it": "^17.0.1",
87
+ "rollup-plugin-analyzer": "^4.0.0",
88
+ "rollup-plugin-copy": "^3.5.0",
89
+ "rollup-plugin-visualizer": "^5.12.0",
90
+ three: "^0.160.0",
91
+ unocss: "^0.58.3",
92
+ unplugin: "^1.6.0",
93
+ "unplugin-vue-components": "^0.26.0",
94
+ vite: "^5.0.10",
95
+ "vite-plugin-banner": "^0.7.1",
96
+ "vite-plugin-dts": "3.7.0",
97
+ "vite-plugin-inspect": "^0.8.1",
98
+ "vite-plugin-require-transform": "^1.0.21",
99
+ "vite-svg-loader": "^5.1.0",
100
+ vitepress: "1.0.0-rc.34",
101
+ vitest: "^1.1.1",
102
+ vue: "^3.4.3",
103
+ "vue-demi": "^0.14.6"
104
+ }, Vt = {
105
+ name: kt,
106
+ type: Tt,
107
+ version: Pt,
108
+ packageManager: At,
109
+ description: Lt,
110
+ author: Ot,
111
+ license: Bt,
112
+ keywords: jt,
113
+ sideEffects: Dt,
114
+ exports: It,
115
+ main: Rt,
116
+ module: $t,
117
+ types: Ht,
118
+ files: Nt,
119
+ publishConfig: Ft,
120
+ scripts: Wt,
121
+ peerDependencies: Ut,
122
+ dependencies: Gt,
123
+ devDependencies: zt
124
+ }, Jt = ({ sizes: t, scene: e }) => {
125
+ const r = T([]), s = x(
126
+ () => r.value[0]
127
+ ), o = (a, l = !1) => {
128
+ r.value.some(({ uuid: f }) => f === a.uuid) || (l ? n(a) : r.value.push(a));
129
+ }, i = (a) => {
130
+ r.value = r.value.filter(({ uuid: l }) => l !== a.uuid);
131
+ }, n = (a) => {
132
+ const l = a instanceof Ke ? a : r.value.find((c) => c.uuid === a);
24
133
  if (!l)
25
134
  return;
26
- const c = t.value.filter(({ uuid: m }) => m !== l.uuid);
27
- t.value = [l, ...c];
135
+ const f = r.value.filter(({ uuid: c }) => c !== l.uuid);
136
+ r.value = [l, ...f];
28
137
  };
29
- return A(() => {
30
- e.aspectRatio.value && t.value.forEach((i) => {
31
- i instanceof Y && (i.aspect = e.aspectRatio.value), (i instanceof Y || i instanceof Ie) && i.updateProjectionMatrix();
138
+ return se(() => {
139
+ t.aspectRatio.value && r.value.forEach((a) => {
140
+ !a.manual && (a instanceof te || Qt(a)) && (a instanceof te ? a.aspect = t.aspectRatio.value : (a.left = t.width.value * -0.5, a.right = t.width.value * 0.5, a.top = t.height.value * 0.5, a.bottom = t.height.value * -0.5), a.updateProjectionMatrix());
32
141
  });
33
- }), r.userData.tres__registerCamera = a, r.userData.tres__deregisterCamera = s, U(() => {
34
- t.value = [];
142
+ }), J(() => {
143
+ r.value = [];
35
144
  }), {
36
- camera: n,
37
- cameras: t,
38
- registerCamera: a,
39
- deregisterCamera: s,
40
- setCameraActive: o
145
+ camera: s,
146
+ cameras: r,
147
+ registerCamera: o,
148
+ deregisterCamera: i,
149
+ setCameraActive: n
41
150
  };
42
- }, fe = L(), de = L(), q = L(), x = new He();
43
- let V = 0, $ = 0;
44
- const { pause: it, resume: lt, isActive: ut } = ce(
151
+ };
152
+ function Qt(t) {
153
+ return t.hasOwnProperty("isOrthographicCamera") && t.isOrthographicCamera;
154
+ }
155
+ const xe = H(), ke = H(), ie = H(), R = new Xe();
156
+ let z = 0, V = 0;
157
+ const { pause: Yt, resume: qt, isActive: Kt } = Se(
45
158
  () => {
46
- fe.trigger({ delta: V, elapsed: $, clock: x }), de.trigger({ delta: V, elapsed: $, clock: x }), q.trigger({ delta: V, elapsed: $, clock: x });
159
+ xe.trigger({ delta: z, elapsed: V, clock: R }), ke.trigger({ delta: z, elapsed: V, clock: R }), ie.trigger({ delta: z, elapsed: V, clock: R });
47
160
  },
48
161
  { immediate: !1 }
49
162
  );
50
- q.on(() => {
51
- V = x.getDelta(), $ = x.getElapsedTime();
163
+ ie.on(() => {
164
+ z = R.getDelta(), V = R.getElapsedTime();
52
165
  });
53
- const me = () => ({
54
- onBeforeLoop: fe.on,
55
- onLoop: de.on,
56
- onAfterLoop: q.on,
57
- pause: it,
58
- resume: lt,
59
- isActive: ut
60
- }), Zt = !0, re = "[TresJS ▲ ■ ●] ";
61
- function j() {
62
- function e(n, a) {
63
- console.error(`${re} ${n}`, a || "");
166
+ const ae = () => ({
167
+ onBeforeLoop: xe.on,
168
+ onLoop: ke.on,
169
+ onAfterLoop: ie.on,
170
+ pause: Yt,
171
+ resume: qt,
172
+ isActive: Kt
173
+ }), Wr = !0, me = "[TresJS ▲ ■ ●] ";
174
+ function P() {
175
+ function t(s, o) {
176
+ console.error(`${me} ${s}`, o || "");
64
177
  }
65
- function r(n) {
66
- console.warn(`${re} ${n}`);
178
+ function e(s) {
179
+ console.warn(`${me} ${s}`);
67
180
  }
68
- function t(n, a) {
181
+ function r(s, o) {
69
182
  }
70
183
  return {
71
- logError: e,
72
- logWarning: r,
73
- logMessage: t
184
+ logError: t,
185
+ logWarning: e,
186
+ logMessage: r
74
187
  };
75
188
  }
76
- function er(e) {
77
- return typeof e == "number" ? [e, e, e] : e instanceof Ne ? [e.x, e.y, e.z] : e;
189
+ function Ur(t) {
190
+ return typeof t == "number" ? [t, t, t] : t instanceof _e ? [t.x, t.y, t.z] : t;
78
191
  }
79
- function ct(e) {
80
- return e instanceof N ? e : Array.isArray(e) ? new N(...e) : new N(e);
192
+ function Xt(t) {
193
+ return t instanceof G ? t : Array.isArray(t) ? new G(...t) : new G(t);
81
194
  }
82
- class ft extends ue.Mesh {
83
- constructor(...t) {
84
- super(...t);
85
- G(this, "type", "HightlightMesh");
86
- G(this, "createTime");
195
+ class Zt extends Me.Mesh {
196
+ constructor(...r) {
197
+ super(...r);
198
+ Y(this, "type", "HightlightMesh");
199
+ Y(this, "createTime");
87
200
  this.createTime = Date.now();
88
201
  }
89
202
  onBeforeRender() {
90
- const n = (Date.now() - this.createTime) / 1e3, o = 1 + 0.07 * Math.sin(2.5 * n);
91
- this.scale.set(o, o, o);
203
+ const s = (Date.now() - this.createTime) / 1e3, n = 1 + 0.07 * Math.sin(2.5 * s);
204
+ this.scale.set(n, n, n);
92
205
  }
93
206
  }
94
- const pe = (e, r) => {
95
- for (const t of Object.keys(r))
96
- r[t] instanceof Object && Object.assign(r[t], pe(e[t], r[t]));
97
- return Object.assign(e || {}, r), e;
98
- }, dt = "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", mt = /* @__PURE__ */ pt(dt);
99
- function ne(e) {
100
- return e && e.nodeType === 1;
207
+ const Te = (t, e) => {
208
+ for (const r of Object.keys(e))
209
+ e[r] instanceof Object && Object.assign(e[r], Te(t[r], e[r]));
210
+ return Object.assign(t || {}, e), t;
211
+ }, er = "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", tr = /* @__PURE__ */ rr(er);
212
+ function ve(t) {
213
+ return t && t.nodeType === 1;
101
214
  }
102
- function R(e) {
103
- return e.replace(/-([a-z])/g, (r, t) => t.toUpperCase());
215
+ function F(t) {
216
+ return t.replace(/-([a-z])/g, (e, r) => r.toUpperCase());
104
217
  }
105
- function pt(e, r) {
106
- const t = /* @__PURE__ */ Object.create(null), n = e.split(",");
107
- for (let a = 0; a < n.length; a++)
108
- t[n[a]] = !0;
109
- return r ? (a) => !!t[a.toLowerCase()] : (a) => !!t[a];
218
+ function rr(t, e) {
219
+ const r = /* @__PURE__ */ Object.create(null), s = t.split(",");
220
+ for (let o = 0; o < s.length; o++)
221
+ r[s[o]] = !0;
222
+ return e ? (o) => !!r[o.toLowerCase()] : (o) => !!r[o];
110
223
  }
111
- const gt = (e, r) => {
112
- const t = /* @__PURE__ */ new Set(), n = [];
113
- for (const a of e) {
114
- const s = r(a);
115
- t.has(s) || (t.add(s), n.push(a));
224
+ const nr = (t, e) => {
225
+ const r = /* @__PURE__ */ new Set(), s = [];
226
+ for (const o of t) {
227
+ const i = e(o);
228
+ r.has(i) || (r.add(i), s.push(o));
116
229
  }
117
- return n;
118
- }, oe = (e, r) => {
119
- if (!r)
230
+ return s;
231
+ }, ge = (t, e) => {
232
+ if (!e)
120
233
  return;
121
- const t = Array.isArray(r) ? r : r.match(/([^[.\]])+/g);
122
- return t == null ? void 0 : t.reduce((n, a) => n && n[a], e);
123
- }, vt = (e, r, t) => {
124
- const n = Array.isArray(r) ? r : r.match(/([^[.\]])+/g);
125
- n && n.reduce((a, s, o) => (a[s] === void 0 && (a[s] = {}), o === n.length - 1 && (a[s] = t), a[s]), e);
234
+ const r = Array.isArray(e) ? e : e.match(/([^[.\]])+/g);
235
+ return r == null ? void 0 : r.reduce((s, o) => s && s[o], t);
236
+ }, or = (t, e, r) => {
237
+ const s = Array.isArray(e) ? e : e.match(/([^[.\]])+/g);
238
+ s && s.reduce((o, i, n) => (o[i] === void 0 && (o[i] = {}), n === s.length - 1 && (o[i] = r), o[i]), t);
126
239
  };
127
- function ge(e, r) {
128
- if (ne(e) && ne(r)) {
129
- const a = e.attributes, s = r.attributes;
130
- return a.length !== s.length ? !1 : Array.from(a).every(({ name: o, value: i }) => r.getAttribute(o) === i);
240
+ function Pe(t, e) {
241
+ if (ve(t) && ve(e)) {
242
+ const o = t.attributes, i = e.attributes;
243
+ return o.length !== i.length ? !1 : Array.from(o).every(({ name: n, value: a }) => e.getAttribute(n) === a);
131
244
  }
132
- if (e === r)
245
+ if (t === e)
133
246
  return !0;
134
- if (e === null || typeof e != "object" || r === null || typeof r != "object")
247
+ if (t === null || typeof t != "object" || e === null || typeof e != "object")
135
248
  return !1;
136
- const t = Object.keys(e), n = Object.keys(r);
137
- if (t.length !== n.length)
249
+ const r = Object.keys(t), s = Object.keys(e);
250
+ if (r.length !== s.length)
138
251
  return !1;
139
- for (const a of t)
140
- if (!n.includes(a) || !ge(e[a], r[a]))
252
+ for (const o of r)
253
+ if (!s.includes(o) || !Pe(t[o], e[o]))
141
254
  return !1;
142
255
  return !0;
143
256
  }
144
- function ht(e, r) {
145
- if (!Array.isArray(e) || !Array.isArray(r) || e.length !== r.length)
257
+ function sr(t, e) {
258
+ if (!Array.isArray(t) || !Array.isArray(e) || t.length !== e.length)
146
259
  return !1;
147
- for (let t = 0; t < e.length; t++)
148
- if (!ge(e[t], r[t]))
260
+ for (let r = 0; r < t.length; r++)
261
+ if (!Pe(t[r], e[r]))
149
262
  return !1;
150
263
  return !0;
151
264
  }
152
- const yt = Array.isArray;
153
- function _t(e, r, t, n) {
154
- const a = (l) => {
155
- if (l.uuid === r)
265
+ const ir = Array.isArray;
266
+ function ar(t, e, r, s) {
267
+ const o = (l) => {
268
+ if (l.uuid === e)
156
269
  return l;
157
- for (const c of l.children) {
158
- const m = a(c);
159
- if (m)
160
- return m;
270
+ for (const f of l.children) {
271
+ const c = o(f);
272
+ if (c)
273
+ return c;
161
274
  }
162
- }, s = a(e);
163
- if (!s) {
275
+ }, i = o(t);
276
+ if (!i) {
164
277
  console.warn("Object with UUID not found in the scene.");
165
278
  return;
166
279
  }
167
- let o = s;
168
- for (let l = 0; l < t.length - 1; l++)
169
- if (o[t[l]] !== void 0)
170
- o = o[t[l]];
280
+ let n = i;
281
+ for (let l = 0; l < r.length - 1; l++)
282
+ if (n[r[l]] !== void 0)
283
+ n = n[r[l]];
171
284
  else {
172
- console.warn(`Property path is not valid: ${t.join(".")}`);
285
+ console.warn(`Property path is not valid: ${r.join(".")}`);
173
286
  return;
174
287
  }
175
- const i = t[t.length - 1];
176
- o[i] !== void 0 ? o[i] = n : console.warn(`Property path is not valid: ${t.join(".")}`);
288
+ const a = r[r.length - 1];
289
+ n[a] !== void 0 ? n[a] = s : console.warn(`Property path is not valid: ${r.join(".")}`);
177
290
  }
178
- function wt(e) {
179
- const r = new Ve({
291
+ function lr(t) {
292
+ const e = new Ee({
180
293
  color: 11003607,
181
294
  // Highlight color, e.g., yellow
182
295
  transparent: !0,
183
296
  opacity: 0.2,
184
297
  depthTest: !1,
185
298
  // So the highlight is always visible
186
- side: $e
299
+ side: Ze
187
300
  // To e
188
301
  });
189
- return new ft(e.geometry.clone(), r);
302
+ return new Zt(t.geometry.clone(), e);
303
+ }
304
+ function Ae(t) {
305
+ var r;
306
+ let e = t.value;
307
+ return t.value && ((r = t.value) != null && r.isMesh) && (e = t.value.position), Array.isArray(t.value) && (e = new _e(...e)), e;
190
308
  }
191
- const bt = Number.parseInt(Ue.replace("dev", "")), H = {
309
+ const ur = Number.parseInt(et.replace("dev", "")), W = {
192
310
  realistic: {
193
311
  shadows: !0,
194
312
  physicallyCorrectLights: !0,
195
- outputColorSpace: Fe,
196
- toneMapping: Ge,
313
+ outputColorSpace: tt,
314
+ toneMapping: Ce,
197
315
  toneMappingExposure: 3,
198
316
  shadowMap: {
199
317
  enabled: !0,
200
- type: ze
318
+ type: rt
201
319
  }
320
+ },
321
+ flat: {
322
+ toneMapping: nt,
323
+ toneMappingExposure: 1
202
324
  }
203
325
  };
204
- function Et({
205
- scene: e,
206
- canvas: r,
207
- options: t,
208
- disableRender: n,
209
- contextParts: { sizes: a, camera: s }
326
+ function cr({
327
+ scene: t,
328
+ canvas: e,
329
+ options: r,
330
+ disableRender: s,
331
+ emit: o,
332
+ contextParts: { sizes: i, camera: n, render: a, invalidate: l, advance: f }
210
333
  }) {
211
- const o = k(() => ({
212
- alpha: E(t.alpha),
213
- depth: E(t.depth),
214
- canvas: Xe(r),
215
- context: E(t.context),
216
- stencil: E(t.stencil),
217
- antialias: E(t.antialias) === void 0 ? !0 : E(t.antialias),
218
- precision: E(t.precision),
219
- powerPreference: E(t.powerPreference),
220
- premultipliedAlpha: E(t.premultipliedAlpha),
221
- preserveDrawingBuffer: E(t.preserveDrawingBuffer),
222
- logarithmicDepthBuffer: E(t.logarithmicDepthBuffer),
223
- failIfMajorPerformanceCaveat: E(t.failIfMajorPerformanceCaveat)
224
- })), i = D(new z(o.value));
225
- ie(o, () => {
226
- i.value.dispose(), i.value = new z(o.value);
227
- }), A(() => {
228
- i.value.setSize(a.width.value, a.height.value);
229
- });
230
- const { pixelRatio: l } = Ze();
231
- A(() => {
232
- i.value.setPixelRatio(l.value);
334
+ const c = x(() => ({
335
+ alpha: M(r.alpha) ?? !0,
336
+ depth: M(r.depth),
337
+ canvas: wt(e),
338
+ context: M(r.context),
339
+ stencil: M(r.stencil),
340
+ antialias: M(r.antialias) ?? !0,
341
+ precision: M(r.precision),
342
+ powerPreference: M(r.powerPreference),
343
+ premultipliedAlpha: M(r.premultipliedAlpha),
344
+ preserveDrawingBuffer: M(r.preserveDrawingBuffer),
345
+ logarithmicDepthBuffer: M(r.logarithmicDepthBuffer),
346
+ failIfMajorPerformanceCaveat: M(r.failIfMajorPerformanceCaveat)
347
+ })), u = $(new q(c.value));
348
+ function d() {
349
+ r.renderMode === "on-demand" && l();
350
+ }
351
+ I(c, () => {
352
+ u.value.dispose(), u.value = new q(c.value), d();
353
+ }), I([i.width, i.height], () => {
354
+ u.value.setSize(i.width.value, i.height.value), d();
355
+ }, {
356
+ immediate: !0
357
+ }), I(() => r.clearColor, d);
358
+ const { pixelRatio: p } = bt();
359
+ I(p, () => {
360
+ u.value.setPixelRatio(p.value);
233
361
  });
234
- const { logError: c } = j(), f = (() => {
235
- const d = new z(), y = {
362
+ const { logError: h } = P(), { resume: _, onLoop: y } = ae();
363
+ y(() => {
364
+ n.value && !M(s) && a.frames.value > 0 && (u.value.render(t, n.value), o("render", u.value)), a.priority.value = 0, M(r.renderMode) === "always" ? a.frames.value = 1 : a.frames.value = Math.max(0, a.frames.value - 1);
365
+ }), _();
366
+ const g = (() => {
367
+ const w = new q(), m = {
236
368
  shadowMap: {
237
- enabled: d.shadowMap.enabled,
238
- type: d.shadowMap.type
369
+ enabled: w.shadowMap.enabled,
370
+ type: w.shadowMap.type
239
371
  },
240
- toneMapping: d.toneMapping,
241
- toneMappingExposure: d.toneMappingExposure,
242
- outputColorSpace: d.outputColorSpace
372
+ toneMapping: w.toneMapping,
373
+ toneMappingExposure: w.toneMappingExposure,
374
+ outputColorSpace: w.outputColorSpace
243
375
  };
244
- return d.dispose(), y;
245
- })();
246
- A(() => {
247
- const d = E(t.preset);
248
- d && (d in H || c(`Renderer Preset must be one of these: ${Object.keys(H).join(", ")}`), pe(i.value, H[d]));
249
- const y = (M, P) => {
250
- const w = E(M), S = () => {
251
- if (d)
252
- return oe(H[d], P);
376
+ return w.dispose(), m;
377
+ })(), E = M(r.renderMode);
378
+ return E === "on-demand" && l(), E === "manual" && setTimeout(() => {
379
+ f();
380
+ }, 1), se(() => {
381
+ const w = M(r.preset);
382
+ w && (w in W || h(`Renderer Preset must be one of these: ${Object.keys(W).join(", ")}`), Te(u.value, W[w])), E === "always" && (a.frames.value = Math.max(1, a.frames.value));
383
+ const m = (L, A) => {
384
+ const O = M(L), Q = () => {
385
+ if (w)
386
+ return ge(W[w], A);
253
387
  };
254
- if (w !== void 0)
255
- return w;
256
- const v = S();
257
- return v !== void 0 ? v : oe(f, P);
258
- }, p = (M, P) => vt(i.value, P, y(M, P));
259
- p(t.shadows, "shadowMap.enabled"), p(t.toneMapping, "toneMapping"), p(t.shadowMapType, "shadowMap.type"), bt < 150 && p(!t.useLegacyLights, "physicallyCorrectLights"), p(t.outputColorSpace, "outputColorSpace"), p(t.toneMappingExposure, "toneMappingExposure");
260
- const C = y(t.clearColor, "clearColor");
261
- C && i.value.setClearColor(
262
- C ? ct(C) : new N(0)
388
+ if (O !== void 0)
389
+ return O;
390
+ const N = Q();
391
+ return N !== void 0 ? N : ge(g, A);
392
+ }, v = (L, A) => or(u.value, A, m(L, A));
393
+ v(r.shadows, "shadowMap.enabled"), v(r.toneMapping ?? Ce, "toneMapping"), v(r.shadowMapType, "shadowMap.type"), ur < 150 && v(!r.useLegacyLights, "physicallyCorrectLights"), v(r.outputColorSpace, "outputColorSpace"), v(r.toneMappingExposure, "toneMappingExposure");
394
+ const C = m(r.clearColor, "clearColor");
395
+ C && u.value.setClearColor(
396
+ C ? Xt(C) : new G(0)
263
397
  // default clear color is not easily/efficiently retrievable from three
264
398
  );
265
- });
266
- const { pause: u, resume: g, onLoop: _ } = me();
267
- return _(() => {
268
- s.value && !E(n) && i.value.render(e, s.value);
269
- }), g(), U(() => {
270
- u(), i.value.dispose(), i.value.forceContextLoss();
399
+ }), J(() => {
400
+ u.value.dispose(), u.value.forceContextLoss();
271
401
  }), {
272
- renderer: i
402
+ renderer: u
273
403
  };
274
404
  }
275
- const ae = (e) => typeof e == "function", Ct = (e) => !!e && e.constructor === Array;
276
- function Mt(e) {
277
- const r = { nodes: {}, materials: {} };
278
- return e && e.traverse((t) => {
279
- t.name && (r.nodes[t.name] = t), t.material && !r.materials[t.material.name] && (r.materials[t.material.name] = t.material);
280
- }), r;
405
+ const K = (t) => typeof t == "function", dr = (t) => !!t && t.constructor === Array;
406
+ function fr(t) {
407
+ const e = { nodes: {}, materials: {} };
408
+ return t && t.traverse((r) => {
409
+ r.name && (e.nodes[r.name] = r), r.material && !e.materials[r.material.name] && (e.materials[r.material.name] = r.material);
410
+ }), e;
281
411
  }
282
- async function tr(e, r, t, n, a) {
283
- const { logError: s } = j(), o = new e();
284
- a && a(o), t && t(o);
285
- const l = (Array.isArray(r) ? r : [r]).map(
286
- (c) => new Promise((m, f) => {
287
- o.load(
288
- c,
289
- (u) => {
290
- u.scene && Object.assign(u, Mt(u.scene)), m(u);
412
+ async function Gr(t, e, r, s, o) {
413
+ const { logError: i } = P(), n = new t();
414
+ o && o(n), r && r(n);
415
+ const l = (Array.isArray(e) ? e : [e]).map(
416
+ (f) => new Promise((c, u) => {
417
+ n.load(
418
+ f,
419
+ (d) => {
420
+ d.scene && Object.assign(d, fr(d.scene)), c(d);
291
421
  },
292
- n,
293
- (u) => f(s("[useLoader] - Failed to load resource", u))
422
+ s,
423
+ (d) => u(i("[useLoader] - Failed to load resource", d))
294
424
  );
295
425
  })
296
426
  );
297
- return Ct(r) ? await Promise.all(l) : await l[0];
427
+ return dr(e) ? await Promise.all(l) : await l[0];
298
428
  }
299
- async function rr(e) {
300
- const r = new We(), t = new Qe(r), n = (a) => new Promise((s, o) => {
301
- t.load(
302
- a,
303
- (i) => s(i),
429
+ async function zr(t) {
430
+ const e = new ot(), r = new st(e), s = (o) => new Promise((i, n) => {
431
+ r.load(
432
+ o,
433
+ (a) => i(a),
304
434
  () => null,
305
435
  () => {
306
- o(new Error("[useTextures] - Failed to load texture"));
436
+ n(new Error("[useTextures] - Failed to load texture"));
307
437
  }
308
438
  );
309
439
  });
310
- if (yt(e)) {
311
- const a = await Promise.all(e.map((s) => n(s)));
312
- return e.length > 1 ? a : a[0];
440
+ if (ir(t)) {
441
+ const o = await Promise.all(t.map((i) => s(i)));
442
+ return t.length > 1 ? o : o[0];
313
443
  } else {
314
444
  const {
315
- map: a,
316
- displacementMap: s,
317
- normalMap: o,
318
- roughnessMap: i,
445
+ map: o,
446
+ displacementMap: i,
447
+ normalMap: n,
448
+ roughnessMap: a,
319
449
  metalnessMap: l,
320
- aoMap: c,
321
- alphaMap: m,
322
- matcap: f
323
- } = e;
450
+ aoMap: f,
451
+ alphaMap: c,
452
+ matcap: u
453
+ } = t;
324
454
  return {
325
- map: a ? await n(a) : null,
326
- displacementMap: s ? await n(s) : null,
327
- normalMap: o ? await n(o) : null,
328
- roughnessMap: i ? await n(i) : null,
329
- metalnessMap: l ? await n(l) : null,
330
- aoMap: c ? await n(c) : null,
331
- alphaMap: m ? await n(m) : null,
332
- matcap: f ? await n(f) : null
455
+ map: o ? await s(o) : null,
456
+ displacementMap: i ? await s(i) : null,
457
+ normalMap: n ? await s(n) : null,
458
+ roughnessMap: a ? await s(a) : null,
459
+ metalnessMap: l ? await s(l) : null,
460
+ aoMap: f ? await s(f) : null,
461
+ alphaMap: c ? await s(c) : null,
462
+ matcap: u ? await s(u) : null
333
463
  };
334
464
  }
335
465
  }
336
- const Pt = (e, { renderer: r, camera: t, raycaster: n }) => {
337
- const a = k(() => r.value.domElement), { x: s, y: o } = et({ target: a }), { width: i, height: l, top: c, left: m } = tt(a), f = ({ x: v, y: b }) => {
338
- if (a.value)
466
+ const pr = (t, e) => {
467
+ const r = x(() => e.renderer.value.domElement), { x: s, y: o } = Mt({ target: r }), { width: i, height: n, top: a, left: l } = _t(r), f = ({ x: m, y: v }) => {
468
+ if (r.value)
339
469
  return {
340
- x: (v - m.value) / i.value * 2 - 1,
341
- y: -((b - c.value) / l.value) * 2 + 1
470
+ x: (m - l.value) / i.value * 2 - 1,
471
+ y: -((v - a.value) / n.value) * 2 + 1
342
472
  };
343
- }, u = ({ x: v, y: b }) => {
344
- if (t.value)
345
- return n.value.setFromCamera(new Ye(v, b), t.value), n.value.intersectObjects(e.value, !1);
346
- }, g = (v) => {
347
- const b = f({
348
- x: (v == null ? void 0 : v.clientX) ?? s.value,
349
- y: (v == null ? void 0 : v.clientY) ?? o.value
473
+ }, c = ({ x: m, y: v }) => {
474
+ if (e.camera.value)
475
+ return e.raycaster.value.setFromCamera(new it(m, v), e.camera.value), e.raycaster.value.intersectObjects(t.value, !1);
476
+ }, u = (m) => {
477
+ const v = f({
478
+ x: (m == null ? void 0 : m.clientX) ?? s.value,
479
+ y: (m == null ? void 0 : m.clientY) ?? o.value
350
480
  });
351
- return b ? u(b) || [] : [];
352
- }, _ = k(() => g()), d = L(), y = L(), p = (v, b) => {
353
- v.trigger({ event: b, intersects: g(b) });
354
- }, C = (v) => {
355
- p(y, v);
481
+ return v ? c(v) || [] : [];
482
+ }, d = x(() => u()), p = H(), h = H(), _ = (m, v) => {
483
+ m.trigger({ event: v, intersects: u(v) });
484
+ }, y = (m) => {
485
+ _(h, m);
356
486
  };
357
- let M;
358
- const P = (v) => {
359
- var b;
360
- M = (b = g(v)[0]) == null ? void 0 : b.object;
361
- }, w = (v) => {
362
- var b;
363
- v instanceof PointerEvent && M === ((b = g(v)[0]) == null ? void 0 : b.object) && p(d, v);
364
- }, S = (v) => y.trigger({ event: v, intersects: [] });
365
- return a.value.addEventListener("pointerup", w), a.value.addEventListener("pointerdown", P), a.value.addEventListener("pointermove", C), a.value.addEventListener("pointerleave", S), U(() => {
366
- a != null && a.value && (a.value.removeEventListener("pointerup", w), a.value.removeEventListener("pointerdown", P), a.value.removeEventListener("pointermove", C), a.value.removeEventListener("pointerleave", S));
487
+ let b;
488
+ const g = (m) => {
489
+ var v;
490
+ b = (v = u(m)[0]) == null ? void 0 : v.object;
491
+ }, E = (m) => {
492
+ var v;
493
+ m instanceof PointerEvent && b === ((v = u(m)[0]) == null ? void 0 : v.object) && _(p, m);
494
+ }, w = (m) => h.trigger({ event: m, intersects: [] });
495
+ return r.value.addEventListener("pointerup", E), r.value.addEventListener("pointerdown", g), r.value.addEventListener("pointermove", y), r.value.addEventListener("pointerleave", w), J(() => {
496
+ r != null && r.value && (r.value.removeEventListener("pointerup", E), r.value.removeEventListener("pointerdown", g), r.value.removeEventListener("pointermove", y), r.value.removeEventListener("pointerleave", w));
367
497
  }), {
368
- intersects: _,
369
- onClick: (v) => d.on(v).off,
370
- onPointerMove: (v) => y.on(v).off
498
+ intersects: d,
499
+ onClick: (m) => p.on(m).off,
500
+ onPointerMove: (m) => h.on(m).off
371
501
  };
372
502
  };
373
- function nr() {
374
- const { logWarning: e } = j();
375
- function r(s, o, i) {
503
+ function Vr() {
504
+ const { logWarning: t } = P();
505
+ function e(i, n, a) {
376
506
  let l = null;
377
- return s.traverse((c) => {
378
- c[o] === i && (l = c);
379
- }), l || e(`Child with ${o} '${i}' not found.`), l;
507
+ return i.traverse((f) => {
508
+ f[n] === a && (l = f);
509
+ }), l || t(`Child with ${n} '${a}' not found.`), l;
380
510
  }
381
- function t(s, o, i) {
511
+ function r(i, n, a) {
382
512
  const l = [];
383
- return s.traverse((c) => {
384
- c[o].includes(i) && l.push(c);
385
- }), l.length || e(`Children with ${o} '${i}' not found.`), l;
513
+ return i.traverse((f) => {
514
+ f[n].includes(a) && l.push(f);
515
+ }), l.length || t(`Children with ${n} '${a}' not found.`), l;
386
516
  }
387
- function n(s, o) {
388
- return r(s, "name", o);
517
+ function s(i, n) {
518
+ return e(i, "name", n);
389
519
  }
390
- function a(s, o) {
391
- return t(s, "name", o);
520
+ function o(i, n) {
521
+ return r(i, "name", n);
392
522
  }
393
523
  return {
394
- seek: r,
395
- seekByName: n,
396
- seekAll: t,
397
- seekAllByName: a
524
+ seek: e,
525
+ seekByName: s,
526
+ seekAll: r,
527
+ seekAllByName: o
398
528
  };
399
529
  }
400
- const St = ({ scene: e, contextParts: r }) => {
401
- const t = le({
530
+ const mr = (t) => {
531
+ const e = be({
402
532
  click: /* @__PURE__ */ new Map(),
403
533
  pointerMove: /* @__PURE__ */ new Map(),
404
534
  pointerEnter: /* @__PURE__ */ new Map(),
405
535
  pointerLeave: /* @__PURE__ */ new Map()
406
- }), n = B(/* @__PURE__ */ new Set()), a = (u) => {
407
- n.value.add(u);
408
- }, s = (u) => {
409
- n.value.delete(u);
536
+ }), r = T(/* @__PURE__ */ new Set()), s = (u) => {
537
+ r.value.add(u);
410
538
  }, o = (u) => {
411
- Object.values(t).forEach((g) => g.delete(u)), s(u);
539
+ r.value.delete(u);
412
540
  }, i = (u) => {
413
- const { onClick: g, onPointerMove: _, onPointerEnter: d, onPointerLeave: y } = u;
414
- g && t.click.set(u, g), _ && t.pointerMove.set(u, _), d && t.pointerEnter.set(u, d), y && t.pointerLeave.set(u, y);
415
- };
416
- e.userData.tres__registerAtPointerEventHandler = i, e.userData.tres__deregisterAtPointerEventHandler = o, e.userData.tres__registerBlockingObjectAtPointerEventHandler = a, e.userData.tres__deregisterBlockingObjectAtPointerEventHandler = s;
417
- const l = k(
418
- () => gt(
541
+ Object.values(e).forEach((d) => d.delete(u)), o(u);
542
+ }, n = (u) => {
543
+ const { onClick: d, onPointerMove: p, onPointerEnter: h, onPointerLeave: _ } = u;
544
+ d && e.click.set(u, d), p && e.pointerMove.set(u, p), h && e.pointerEnter.set(u, h), _ && e.pointerLeave.set(u, _);
545
+ }, a = x(
546
+ () => nr(
419
547
  [
420
- ...Array.from(n.value),
421
- ...Object.values(t).map((u) => Array.from(u.keys())).flat()
548
+ ...Array.from(r.value),
549
+ ...Object.values(e).map((u) => Array.from(u.keys())).flat()
422
550
  ],
423
551
  ({ uuid: u }) => u
424
552
  )
425
- ), { onClick: c, onPointerMove: m } = Pt(l, r);
426
- c(({ intersects: u, event: g }) => {
427
- var _;
428
- u.length && ((_ = t.click.get(u[0].object)) == null || _(u[0], g));
553
+ );
554
+ t.registerObjectAtPointerEventHandler = n, t.deregisterObjectAtPointerEventHandler = i, t.registerBlockingObjectAtPointerEventHandler = s, t.deregisterBlockingObjectAtPointerEventHandler = o;
555
+ const { onClick: l, onPointerMove: f } = pr(a, t);
556
+ l(({ intersects: u, event: d }) => {
557
+ var p;
558
+ u.length && ((p = e.click.get(u[0].object)) == null || p(u[0], d));
429
559
  });
430
- let f;
431
- return m(({ intersects: u, event: g }) => {
432
- var C, M, P, w;
433
- const _ = (C = u == null ? void 0 : u[0]) == null ? void 0 : C.object, { pointerLeave: d, pointerEnter: y, pointerMove: p } = t;
434
- f && f !== _ && ((M = d.get(f)) == null || M(f, g)), _ && (f !== _ && ((P = y.get(_)) == null || P(u[0], g)), (w = p.get(_)) == null || w(u[0], g)), f = _ || null;
560
+ let c;
561
+ return f(({ intersects: u, event: d }) => {
562
+ var b, g, E, w;
563
+ const p = (b = u == null ? void 0 : u[0]) == null ? void 0 : b.object, { pointerLeave: h, pointerEnter: _, pointerMove: y } = e;
564
+ c && c !== p && ((g = h.get(c)) == null || g(c, d)), p && (c !== p && ((E = _.get(p)) == null || E(u[0], d)), (w = y.get(p)) == null || w(u[0], d)), c = p || null;
435
565
  }), {
436
- registerObject: i,
437
- deregisterObject: o
566
+ registerObject: n,
567
+ deregisterObject: i,
568
+ registerBlockingObject: s,
569
+ deregisterBlockingObject: o
438
570
  };
439
571
  };
440
- function ve(e) {
441
- let r = 0;
442
- return e.traverse((t) => {
443
- if (t.isMesh && t.geometry) {
444
- const n = t.geometry, a = n.attributes.position.count * 3 * Float32Array.BYTES_PER_ELEMENT, s = n.index ? n.index.count * Uint32Array.BYTES_PER_ELEMENT : 0, o = n.attributes.normal ? n.attributes.normal.count * 3 * Float32Array.BYTES_PER_ELEMENT : 0, i = n.attributes.uv ? n.attributes.uv.count * 2 * Float32Array.BYTES_PER_ELEMENT : 0, l = a + s + o + i;
445
- r += l;
572
+ function Le(t) {
573
+ let e = 0;
574
+ return t.traverse((r) => {
575
+ if (r.isMesh && r.geometry) {
576
+ const s = r.geometry, o = s.attributes.position.count * 3 * Float32Array.BYTES_PER_ELEMENT, i = s.index ? s.index.count * Uint32Array.BYTES_PER_ELEMENT : 0, n = s.attributes.normal ? s.attributes.normal.count * 3 * Float32Array.BYTES_PER_ELEMENT : 0, a = s.attributes.uv ? s.attributes.uv.count * 2 * Float32Array.BYTES_PER_ELEMENT : 0, l = o + i + n + a;
577
+ e += l;
446
578
  }
447
- }), r;
579
+ }), e;
448
580
  }
449
- function kt(e) {
450
- return (e / 1024).toFixed(2);
581
+ function vr(t) {
582
+ return (t / 1024).toFixed(2);
451
583
  }
452
- const J = B({}), X = (e) => Object.assign(J.value, e);
453
- function Tt({
454
- scene: e,
455
- canvas: r,
456
- windowSize: t,
457
- disableRender: n,
458
- rendererOptions: a
459
- }) {
460
- const s = k(
461
- () => E(t) ? rt() : nt(E(r).parentElement)
462
- ), o = k(() => s.value.width.value), i = k(() => s.value.height.value), l = k(() => o.value / i.value), c = {
584
+ const re = T({}), ne = (t) => Object.assign(re.value, t);
585
+ function gr(t, e, r = 10) {
586
+ const s = M(t) ? Et() : Ct(x(() => M(e).parentElement)), o = Z(pe(s.width, r)), i = Z(pe(s.height, r)), n = x(() => o.value / i.value);
587
+ return {
463
588
  height: i,
464
589
  width: o,
465
- aspectRatio: l
466
- }, m = D(e), {
590
+ aspectRatio: n
591
+ };
592
+ }
593
+ function hr({
594
+ scene: t,
595
+ canvas: e,
596
+ windowSize: r,
597
+ disableRender: s,
598
+ rendererOptions: o,
599
+ emit: i
600
+ }) {
601
+ const { logWarning: n } = P(), a = $(t), l = gr(r, e), {
467
602
  camera: f,
468
- cameras: u,
469
- registerCamera: g,
470
- deregisterCamera: _,
471
- setCameraActive: d
472
- } = st({ sizes: c, scene: e }), { renderer: y } = Et(
603
+ cameras: c,
604
+ registerCamera: u,
605
+ deregisterCamera: d,
606
+ setCameraActive: p
607
+ } = Jt({ sizes: l, scene: t }), h = {
608
+ mode: T(o.renderMode || "always"),
609
+ priority: T(0),
610
+ frames: T(0),
611
+ maxFrames: 60,
612
+ canBeInvalidated: x(() => h.mode.value === "on-demand" && h.frames.value === 0)
613
+ };
614
+ function _(B = 1) {
615
+ o.renderMode === "on-demand" ? h.frames.value = Math.min(h.maxFrames, h.frames.value + B) : n("`invalidate` can only be used when `renderMode` is set to `on-demand`");
616
+ }
617
+ function y() {
618
+ o.renderMode === "manual" ? h.frames.value = 1 : n("`advance` can only be used when `renderMode` is set to `manual`");
619
+ }
620
+ const { renderer: b } = cr(
473
621
  {
474
- scene: e,
475
- canvas: r,
476
- options: a,
477
- contextParts: { sizes: c, camera: f },
478
- disableRender: n
622
+ scene: t,
623
+ canvas: e,
624
+ options: o,
625
+ emit: i,
626
+ // TODO: replace contextParts with full ctx at https://github.com/Tresjs/tres/issues/516
627
+ contextParts: { sizes: l, camera: f, render: h, invalidate: _, advance: y },
628
+ disableRender: s
479
629
  }
480
- ), p = {
481
- sizes: c,
482
- scene: m,
630
+ ), g = {
631
+ sizes: l,
632
+ scene: a,
483
633
  camera: f,
484
- cameras: Se(u),
485
- renderer: y,
486
- raycaster: D(new Je()),
487
- controls: B(null),
634
+ cameras: Z(c),
635
+ renderer: b,
636
+ raycaster: $(new at()),
637
+ controls: T(null),
488
638
  perf: {
489
639
  maxFrames: 160,
490
640
  fps: {
@@ -497,432 +647,454 @@ function Tt({
497
647
  accumulator: []
498
648
  }
499
649
  },
500
- extend: X,
501
- registerCamera: g,
502
- setCameraActive: d,
503
- deregisterCamera: _
650
+ render: h,
651
+ advance: y,
652
+ extend: ne,
653
+ invalidate: _,
654
+ registerCamera: u,
655
+ setCameraActive: p,
656
+ deregisterCamera: d
504
657
  };
505
- Q("useTres", p);
506
- const C = 100, M = ot({ every: C }), { isSupported: P, memory: w } = at({ interval: C }), S = 160;
507
- let v = performance.now();
508
- const b = ({ timestamp: I }) => {
509
- p.scene.value && (p.perf.memory.allocatedMem = ve(p.scene.value)), I - v >= C && (v = I, p.perf.fps.accumulator.push(M.value), p.perf.fps.accumulator.length > S && p.perf.fps.accumulator.shift(), p.perf.fps.value = M.value, P.value && w.value && (p.perf.memory.accumulator.push(w.value.usedJSHeapSize / 1024 / 1024), p.perf.memory.accumulator.length > S && p.perf.memory.accumulator.shift(), p.perf.memory.currentMem = p.perf.memory.accumulator.reduce((Ee, Ce) => Ee + Ce, 0) / p.perf.memory.accumulator.length));
658
+ ee("useTres", g), g.scene.value.__tres = {
659
+ root: g
510
660
  };
511
- let F = 0;
512
- const we = 1, { pause: be, resume: Yt } = ce(({ delta: I }) => {
513
- window.__TRES__DEVTOOLS__ && (b({ timestamp: performance.now() }), F += I, F >= we && (window.__TRES__DEVTOOLS__.cb(p), F = 0));
661
+ const E = 100, w = St({ every: E }), { isSupported: m, memory: v } = xt({ interval: E }), C = 160;
662
+ let L = performance.now();
663
+ const A = ({ timestamp: B }) => {
664
+ g.scene.value && (g.perf.memory.allocatedMem = Le(g.scene.value)), B - L >= E && (L = B, g.perf.fps.accumulator.push(w.value), g.perf.fps.accumulator.length > C && g.perf.fps.accumulator.shift(), g.perf.fps.value = w.value, m.value && v.value && (g.perf.memory.accumulator.push(v.value.usedJSHeapSize / 1024 / 1024), g.perf.memory.accumulator.length > C && g.perf.memory.accumulator.shift(), g.perf.memory.currentMem = g.perf.memory.accumulator.reduce((Re, $e) => Re + $e, 0) / g.perf.memory.accumulator.length));
665
+ };
666
+ let O = 0;
667
+ const Q = 1, { pause: N } = Se(({ delta: B }) => {
668
+ window.__TRES__DEVTOOLS__ && (A({ timestamp: performance.now() }), O += B, O >= Q && (window.__TRES__DEVTOOLS__.cb(g), O = 0));
514
669
  }, { immediate: !0 });
515
- return U(() => {
516
- be();
517
- }), p;
670
+ return J(() => {
671
+ N();
672
+ }), g;
518
673
  }
519
- function Ot() {
520
- const e = ke("useTres");
521
- if (!e)
674
+ function yr() {
675
+ const t = Fe("useTres");
676
+ if (!t)
522
677
  throw new Error("useTresContext must be used together with useTresContextProvider");
523
- return e;
678
+ return t;
524
679
  }
525
- const or = Ot;
526
- let h = null;
527
- const { logError: se } = j(), W = [
680
+ const Jr = yr;
681
+ const { logError: he } = P(), X = [
528
682
  "onClick",
529
683
  "onPointerMove",
530
684
  "onPointerEnter",
531
685
  "onPointerLeave"
532
- ], At = {
533
- createElement(e, r, t, n) {
534
- var o, i;
535
- if (n || (n = {}), n.args || (n.args = []), e === "template" || mt(e))
536
- return null;
537
- let a = e.replace("Tres", ""), s;
538
- if (e === "primitive") {
539
- (n == null ? void 0 : n.object) === void 0 && se("Tres primitives need a prop 'object'");
540
- const l = n.object;
541
- a = l.type, s = Object.assign(l, { type: a, attach: n.attach, primitive: !0 });
542
- } else {
543
- const l = J.value[a];
544
- l || se(`${a} is not defined on the THREE namespace. Use extend to add it to the catalog.`), s = new l(...n.args);
545
- }
546
- return s.isCamera && (n != null && n.position || s.position.set(3, 3, 3), n != null && n.lookAt || s.lookAt(0, 0, 0)), (n == null ? void 0 : n.attach) === void 0 && (s.isMaterial ? s.attach = "material" : s.isBufferGeometry && (s.attach = "geometry")), s.isObject3D && ((o = n == null ? void 0 : n.material) != null && o.isMaterial && (s.userData.tres__materialViaProp = !0), (i = n == null ? void 0 : n.geometry) != null && i.isBufferGeometry && (s.userData.tres__geometryViaProp = !0)), s.userData = {
547
- ...s.userData,
548
- tres__name: a
549
- }, s;
550
- },
551
- insert(e, r) {
552
- var n, a, s, o;
553
- r && r.isScene && (h = r);
554
- const t = r || h;
555
- if (e != null && e.isObject3D) {
556
- if (e != null && e.isCamera) {
557
- if (!(h != null && h.userData.tres__registerCamera))
558
- throw "could not find tres__registerCamera on scene's userData";
559
- (a = h == null ? void 0 : (n = h.userData).tres__registerCamera) == null || a.call(n, e);
686
+ ];
687
+ function ye(t) {
688
+ const e = t.__tres.root;
689
+ e && e.render && e.render.canBeInvalidated.value && e.invalidate();
690
+ }
691
+ const Oe = () => {
692
+ let t = null;
693
+ return {
694
+ createElement(e, r, s, o) {
695
+ if (o || (o = {}), o.args || (o.args = []), e === "template" || tr(e))
696
+ return null;
697
+ let i = e.replace("Tres", ""), n;
698
+ if (e === "primitive") {
699
+ (o == null ? void 0 : o.object) === void 0 && he("Tres primitives need a prop 'object'");
700
+ const a = o.object;
701
+ i = a.type, n = Object.assign(a.clone(), { type: i });
702
+ } else {
703
+ const a = re.value[i];
704
+ a || he(`${i} is not defined on the THREE namespace. Use extend to add it to the catalog.`), n = new a(...o.args);
560
705
  }
561
- if (e && W.some((i) => e[i])) {
562
- if (!(h != null && h.userData.tres__registerAtPointerEventHandler))
563
- throw "could not find tres__registerAtPointerEventHandler on scene's userData";
564
- (o = h == null ? void 0 : (s = h.userData).tres__registerAtPointerEventHandler) == null || o.call(s, e);
706
+ return n ? (n.isCamera && (o != null && o.position || n.position.set(3, 3, 3), o != null && o.lookAt || n.lookAt(0, 0, 0)), (o == null ? void 0 : o.attach) === void 0 && (n.isMaterial ? n.attach = "material" : n.isBufferGeometry && (n.attach = "geometry")), n.__tres = {
707
+ ...n.__tres,
708
+ type: i,
709
+ memoizedProps: o,
710
+ eventCount: 0,
711
+ disposable: !0,
712
+ primitive: e === "primitive"
713
+ }, n.isObject3D && (o != null && o.material || o != null && o.geometry) && (n.__tres.disposable = !1), n) : null;
714
+ },
715
+ insert(e, r) {
716
+ if (!e)
717
+ return;
718
+ r && r.isScene && (t = r), t && (e.__tres.root = t.__tres.root);
719
+ const s = r || t;
720
+ if (e != null && e.isObject3D) {
721
+ const { registerCamera: o, registerObjectAtPointerEventHandler: i } = e.__tres.root;
722
+ e != null && e.isCamera && o(e), e && X.some((n) => e[n]) && i(e);
565
723
  }
566
- }
567
- e != null && e.isObject3D && (t != null && t.isObject3D) ? (t.add(e), e.dispatchEvent({ type: "added" })) : e != null && e.isFog ? t.fog = e : typeof (e == null ? void 0 : e.attach) == "string" && (e.__previousAttach = e[t == null ? void 0 : t.attach], t && (t[e.attach] = e));
568
- },
569
- remove(e) {
570
- var r, t;
571
- if (e) {
724
+ e != null && e.isObject3D && (s != null && s.isObject3D) ? (s.add(e), e.dispatchEvent({ type: "added" })) : e != null && e.isFog ? s.fog = e : typeof (e == null ? void 0 : e.attach) == "string" && (e.__previousAttach = e[s == null ? void 0 : s.attach], s && (s[e.attach] = e));
725
+ },
726
+ remove(e) {
727
+ var i, n;
728
+ if (!e)
729
+ return;
730
+ const r = e.__tres;
731
+ e.parent = e.parent || t;
732
+ const {
733
+ deregisterObjectAtPointerEventHandler: s,
734
+ deregisterBlockingObjectAtPointerEventHandler: o
735
+ } = r.root;
572
736
  if (e.isObject3D) {
573
- const n = e, a = (c) => {
574
- var f, u;
575
- const m = c;
576
- c.userData.tres__materialViaProp || ((f = m.material) == null || f.dispose(), m.material = void 0), c.userData.tres__geometryViaProp || ((u = m.geometry) == null || u.dispose(), m.geometry = void 0);
577
- }, s = h == null ? void 0 : h.userData.tres__deregisterAtPointerEventHandler, o = h == null ? void 0 : h.userData.tres__deregisterBlockingObjectAtPointerEventHandler, i = (c) => {
578
- var m, f;
579
- if (!o)
580
- throw "could not find tres__deregisterBlockingObjectAtPointerEventHandler on scene's userData";
581
- if ((f = h == null ? void 0 : (m = h.userData).tres__deregisterBlockingObjectAtPointerEventHandler) == null || f.call(m, c), !s)
582
- throw "could not find tres__deregisterAtPointerEventHandler on scene's userData";
583
- c && W.some((u) => c[u]) && (s == null || s(c));
737
+ const a = (c) => {
738
+ var d, p;
739
+ const u = c;
740
+ r.disposable && ((d = u.material) == null || d.dispose(), u.material = void 0, (p = u.geometry) == null || p.dispose(), u.geometry = void 0);
584
741
  }, l = (c) => {
585
- const m = h == null ? void 0 : h.userData.tres__deregisterCamera;
586
- if (!m)
587
- throw "could not find tres__deregisterCamera on scene's userData";
588
- c.isCamera && (m == null || m(c));
742
+ o(c), c && X.some((u) => c[u]) && (s == null || s(c));
743
+ }, f = (c) => {
744
+ const u = e.__tres.root.deregisterCamera;
745
+ c.isCamera && (u == null || u(c));
589
746
  };
590
- (r = e.removeFromParent) == null || r.call(e), n.traverse((c) => {
591
- a(c), l(c), i == null || i(c);
592
- }), a(n), l(n), i == null || i(n);
747
+ (i = e.removeFromParent) == null || i.call(e), e.traverse((c) => {
748
+ a(c), f(c), l == null || l(c);
749
+ }), a(e), f(e), l == null || l(e), ye(e), (n = e.dispose) == null || n.call(e);
593
750
  }
594
- (t = e.dispose) == null || t.call(e);
595
- }
596
- },
597
- patchProp(e, r, t, n) {
598
- var a, s, o, i;
599
- if (e) {
600
- let l = e, c = r;
601
- if (e.isObject3D && c === "blocks-pointer-events") {
602
- n || n === "" ? (s = h == null ? void 0 : (a = h.userData).tres__registerBlockingObjectAtPointerEventHandler) == null || s.call(a, e) : (i = h == null ? void 0 : (o = h.userData).tres__deregisterBlockingObjectAtPointerEventHandler) == null || i.call(o, e);
603
- return;
604
- }
605
- let m = R(c), f = l == null ? void 0 : l[m];
606
- if (c === "args") {
607
- const g = e, _ = t ?? [], d = n ?? [], y = e.userData.tres__name || e.type;
608
- y && _.length && !ht(_, d) && (l = Object.assign(g, new J.value[y](...n)));
609
- return;
610
- }
611
- if (l.type === "BufferGeometry") {
612
- if (c === "args")
751
+ },
752
+ patchProp(e, r, s, o) {
753
+ if (e) {
754
+ let i = e, n = r;
755
+ if (e.__tres.primitive && n === "object" && s !== null) {
756
+ const c = Oe.createElement("primitive", void 0, void 0, {
757
+ object: o
758
+ });
759
+ for (const u in c) {
760
+ if (u === "uuid")
761
+ continue;
762
+ const d = e[u], p = c[u];
763
+ !(d != null && d.set) && !K(d) ? e[u] = p : d.constructor === p.constructor && (d != null && d.copy) ? d == null || d.copy(p) : Array.isArray(p) ? d.set(...p) : !d.isColor && d.setScalar ? d.setScalar(p) : d.set(p);
764
+ }
765
+ c.__tres.root = t == null ? void 0 : t.__tres.root, c.isGroup ? (e.geometry = void 0, e.material = void 0) : delete e.isGroup;
766
+ }
767
+ if (e.__tres.root) {
768
+ const {
769
+ registerBlockingObjectAtPointerEventHandler: c,
770
+ deregisterBlockingObjectAtPointerEventHandler: u
771
+ } = e.__tres.root;
772
+ if (e.isObject3D && n === "blocks-pointer-events") {
773
+ o || o === "" ? c(e) : u(e);
774
+ return;
775
+ }
776
+ }
777
+ let a = F(n), l = i == null ? void 0 : i[a];
778
+ if (n === "args") {
779
+ const c = e, u = s ?? [], d = o ?? [], p = e.__tres.type || e.type;
780
+ p && u.length && !sr(u, d) && (i = Object.assign(c, new re.value[p](...o)));
613
781
  return;
614
- l.setAttribute(
615
- R(c),
616
- new Ke(...n)
617
- );
618
- return;
619
- }
620
- if (c.includes("-") && f === void 0) {
621
- const g = c.split("-");
622
- f = g.reduce((_, d) => _[R(d)], l), c = g.pop(), m = c.toLowerCase(), f != null && f.set || (l = g.reduce((_, d) => _[R(d)], l));
623
- }
624
- let u = n;
625
- if (u === "" && (u = !0), ae(f)) {
626
- W.includes(r) || (Array.isArray(u) ? e[m](...u) : e[m](u));
627
- return;
782
+ }
783
+ if (i.type === "BufferGeometry") {
784
+ if (n === "args")
785
+ return;
786
+ i.setAttribute(
787
+ F(n),
788
+ new lt(...o)
789
+ );
790
+ return;
791
+ }
792
+ if (n.includes("-") && l === void 0) {
793
+ const c = n.split("-");
794
+ l = c.reduce((u, d) => u[F(d)], i), n = c.pop(), a = n.toLowerCase(), l != null && l.set || (i = c.reduce((u, d) => u[F(d)], i));
795
+ }
796
+ let f = o;
797
+ if (f === "" && (f = !0), K(l)) {
798
+ X.includes(r) || (Array.isArray(f) ? e[a](...f) : e[a](f));
799
+ return;
800
+ }
801
+ !(l != null && l.set) && !K(l) ? i[a] = f : l.constructor === f.constructor && (l != null && l.copy) ? l == null || l.copy(f) : Array.isArray(f) ? l.set(...f) : !l.isColor && l.setScalar ? l.setScalar(f) : l.set(f), ye(e);
628
802
  }
629
- !(f != null && f.set) && !ae(f) ? l[m] = u : f.constructor === u.constructor && (f != null && f.copy) ? f == null || f.copy(u) : Array.isArray(u) ? f.set(...u) : !f.isColor && f.setScalar ? f.setScalar(u) : f.set(u);
630
- }
631
- },
632
- parentNode(e) {
633
- return (e == null ? void 0 : e.parent) || null;
634
- },
635
- createText: () => void 0,
636
- createComment: () => void 0,
637
- setText: () => void 0,
638
- setElementText: () => void 0,
639
- nextSibling: () => void 0,
640
- querySelector: () => void 0,
641
- setScopeId: () => void 0,
642
- cloneNode: () => void 0,
643
- insertStaticContent: () => void 0
644
- }, { render: xt } = Te(At);
645
- X(ue);
646
- function Dt() {
647
- return he().__VUE_DEVTOOLS_GLOBAL_HOOK__;
803
+ },
804
+ parentNode(e) {
805
+ return (e == null ? void 0 : e.parent) || null;
806
+ },
807
+ createText: () => void 0,
808
+ createComment: () => void 0,
809
+ setText: () => void 0,
810
+ setElementText: () => void 0,
811
+ nextSibling: () => void 0,
812
+ querySelector: () => void 0,
813
+ setScopeId: () => void 0,
814
+ cloneNode: () => void 0,
815
+ insertStaticContent: () => void 0
816
+ };
817
+ };
818
+ function wr() {
819
+ return Be().__VUE_DEVTOOLS_GLOBAL_HOOK__;
648
820
  }
649
- function he() {
821
+ function Be() {
650
822
  return typeof navigator < "u" && typeof window < "u" ? window : typeof global < "u" ? global : {};
651
823
  }
652
- const Lt = typeof Proxy == "function", Bt = "devtools-plugin:setup", jt = "plugin:settings:set";
653
- let T, K;
654
- function It() {
655
- var e;
656
- return T !== void 0 || (typeof window < "u" && window.performance ? (T = !0, K = window.performance) : typeof global < "u" && (!((e = global.perf_hooks) === null || e === void 0) && e.performance) ? (T = !0, K = global.perf_hooks.performance) : T = !1), T;
824
+ const br = typeof Proxy == "function", Mr = "devtools-plugin:setup", _r = "plugin:settings:set";
825
+ let j, oe;
826
+ function Er() {
827
+ var t;
828
+ return j !== void 0 || (typeof window < "u" && window.performance ? (j = !0, oe = window.performance) : typeof global < "u" && (!((t = global.perf_hooks) === null || t === void 0) && t.performance) ? (j = !0, oe = global.perf_hooks.performance) : j = !1), j;
657
829
  }
658
- function Rt() {
659
- return It() ? K.now() : Date.now();
830
+ function Cr() {
831
+ return Er() ? oe.now() : Date.now();
660
832
  }
661
- class Ht {
662
- constructor(r, t) {
663
- this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = r, this.hook = t;
664
- const n = {};
665
- if (r.settings)
666
- for (const o in r.settings) {
667
- const i = r.settings[o];
668
- n[o] = i.defaultValue;
833
+ class Sr {
834
+ constructor(e, r) {
835
+ this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = e, this.hook = r;
836
+ const s = {};
837
+ if (e.settings)
838
+ for (const n in e.settings) {
839
+ const a = e.settings[n];
840
+ s[n] = a.defaultValue;
669
841
  }
670
- const a = `__vue-devtools-plugin-settings__${r.id}`;
671
- let s = Object.assign({}, n);
842
+ const o = `__vue-devtools-plugin-settings__${e.id}`;
843
+ let i = Object.assign({}, s);
672
844
  try {
673
- const o = localStorage.getItem(a), i = JSON.parse(o);
674
- Object.assign(s, i);
845
+ const n = localStorage.getItem(o), a = JSON.parse(n);
846
+ Object.assign(i, a);
675
847
  } catch {
676
848
  }
677
849
  this.fallbacks = {
678
850
  getSettings() {
679
- return s;
851
+ return i;
680
852
  },
681
- setSettings(o) {
853
+ setSettings(n) {
682
854
  try {
683
- localStorage.setItem(a, JSON.stringify(o));
855
+ localStorage.setItem(o, JSON.stringify(n));
684
856
  } catch {
685
857
  }
686
- s = o;
858
+ i = n;
687
859
  },
688
860
  now() {
689
- return Rt();
861
+ return Cr();
690
862
  }
691
- }, t && t.on(jt, (o, i) => {
692
- o === this.plugin.id && this.fallbacks.setSettings(i);
863
+ }, r && r.on(_r, (n, a) => {
864
+ n === this.plugin.id && this.fallbacks.setSettings(a);
693
865
  }), this.proxiedOn = new Proxy({}, {
694
- get: (o, i) => this.target ? this.target.on[i] : (...l) => {
866
+ get: (n, a) => this.target ? this.target.on[a] : (...l) => {
695
867
  this.onQueue.push({
696
- method: i,
868
+ method: a,
697
869
  args: l
698
870
  });
699
871
  }
700
872
  }), this.proxiedTarget = new Proxy({}, {
701
- get: (o, i) => this.target ? this.target[i] : i === "on" ? this.proxiedOn : Object.keys(this.fallbacks).includes(i) ? (...l) => (this.targetQueue.push({
702
- method: i,
873
+ get: (n, a) => this.target ? this.target[a] : a === "on" ? this.proxiedOn : Object.keys(this.fallbacks).includes(a) ? (...l) => (this.targetQueue.push({
874
+ method: a,
703
875
  args: l,
704
876
  resolve: () => {
705
877
  }
706
- }), this.fallbacks[i](...l)) : (...l) => new Promise((c) => {
878
+ }), this.fallbacks[a](...l)) : (...l) => new Promise((f) => {
707
879
  this.targetQueue.push({
708
- method: i,
880
+ method: a,
709
881
  args: l,
710
- resolve: c
882
+ resolve: f
711
883
  });
712
884
  })
713
885
  });
714
886
  }
715
- async setRealTarget(r) {
716
- this.target = r;
717
- for (const t of this.onQueue)
718
- this.target.on[t.method](...t.args);
719
- for (const t of this.targetQueue)
720
- t.resolve(await this.target[t.method](...t.args));
887
+ async setRealTarget(e) {
888
+ this.target = e;
889
+ for (const r of this.onQueue)
890
+ this.target.on[r.method](...r.args);
891
+ for (const r of this.targetQueue)
892
+ r.resolve(await this.target[r.method](...r.args));
721
893
  }
722
894
  }
723
- function Nt(e, r) {
724
- const t = e, n = he(), a = Dt(), s = Lt && t.enableEarlyProxy;
725
- if (a && (n.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !s))
726
- a.emit(Bt, e, r);
895
+ function xr(t, e) {
896
+ const r = t, s = Be(), o = wr(), i = br && r.enableEarlyProxy;
897
+ if (o && (s.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !i))
898
+ o.emit(Mr, t, e);
727
899
  else {
728
- const o = s ? new Ht(t, a) : null;
729
- (n.__VUE_DEVTOOLS_PLUGINS__ = n.__VUE_DEVTOOLS_PLUGINS__ || []).push({
730
- pluginDescriptor: t,
731
- setupFn: r,
732
- proxy: o
733
- }), o && r(o.proxiedTarget);
900
+ const n = i ? new Sr(r, o) : null;
901
+ (s.__VUE_DEVTOOLS_PLUGINS__ = s.__VUE_DEVTOOLS_PLUGINS__ || []).push({
902
+ pluginDescriptor: r,
903
+ setupFn: e,
904
+ proxy: n
905
+ }), n && e(n.proxiedTarget);
734
906
  }
735
907
  }
736
- function Vt(e, r) {
737
- const t = `▲ ■ ●${e}`;
738
- typeof __VUE_DEVTOOLS_TOAST__ == "function" ? __VUE_DEVTOOLS_TOAST__(t, r) : r === "error" ? console.error(t) : r === "warn" ? console.warn(t) : console.log(t);
908
+ function kr(t, e) {
909
+ const r = `▲ ■ ●${t}`;
910
+ typeof __VUE_DEVTOOLS_TOAST__ == "function" ? __VUE_DEVTOOLS_TOAST__(r, e) : e === "error" ? console.error(r) : e === "warn" ? console.warn(r) : console.log(r);
739
911
  }
740
- const ye = (e) => {
741
- const r = {
742
- id: e.uuid,
743
- label: e.type,
912
+ const je = (t) => {
913
+ const e = {
914
+ id: t.uuid,
915
+ label: t.type,
744
916
  children: [],
745
917
  tags: []
746
918
  };
747
- e.name !== "" && r.tags.push({
748
- label: e.name,
919
+ t.name !== "" && e.tags.push({
920
+ label: t.name,
749
921
  textColor: 5750629,
750
922
  backgroundColor: 15793395
751
923
  });
752
- const t = ve(e);
753
- return t > 0 && r.tags.push({
754
- label: `${kt(t)} KB`,
924
+ const r = Le(t);
925
+ return r > 0 && e.tags.push({
926
+ label: `${vr(r)} KB`,
755
927
  textColor: 15707189,
756
928
  backgroundColor: 16775644,
757
929
  tooltip: "Memory usage"
758
- }), e.type.includes("Light") && (r.tags.push({
759
- label: `${e.intensity}`,
930
+ }), t.type.includes("Light") && (e.tags.push({
931
+ label: `${t.intensity}`,
760
932
  textColor: 9738662,
761
933
  backgroundColor: 16316922,
762
934
  tooltip: "Intensity"
763
- }), r.tags.push({
764
- label: `#${e.color.getHexString()}`,
935
+ }), e.tags.push({
936
+ label: `#${t.color.getHexString()}`,
765
937
  textColor: 9738662,
766
938
  backgroundColor: 16316922,
767
939
  tooltip: "Color"
768
- })), e.type.includes("Camera") && (r.tags.push({
769
- label: `${e.fov}°`,
940
+ })), t.type.includes("Camera") && (e.tags.push({
941
+ label: `${t.fov}°`,
770
942
  textColor: 9738662,
771
943
  backgroundColor: 16316922,
772
944
  tooltip: "Field of view"
773
- }), r.tags.push({
945
+ }), e.tags.push({
774
946
  // eslint-disable-next-line max-len
775
- label: `x: ${Math.round(e.position.x)} y: ${Math.round(e.position.y)} z: ${Math.round(e.position.z)}`,
947
+ label: `x: ${Math.round(t.position.x)} y: ${Math.round(t.position.y)} z: ${Math.round(t.position.z)}`,
776
948
  textColor: 9738662,
777
949
  backgroundColor: 16316922,
778
950
  tooltip: "Position"
779
- })), r;
951
+ })), e;
780
952
  };
781
- function _e(e, r) {
782
- e.children.forEach((t) => {
783
- if (t.type === "HightlightMesh")
953
+ function De(t, e) {
954
+ t.children.forEach((r) => {
955
+ if (r.type === "HightlightMesh")
784
956
  return;
785
- const n = ye(t);
786
- r.children.push(n), _e(t, n);
957
+ const s = je(r);
958
+ e.children.push(s), De(r, s);
787
959
  });
788
960
  }
789
- const $t = [], O = "tres:inspector", Ut = le({
961
+ const Tr = [], D = "tres:inspector", Pr = be({
790
962
  sceneGraph: null
791
963
  });
792
- function Ft(e, r) {
793
- Nt(
964
+ function Ar(t, e) {
965
+ xr(
794
966
  {
795
967
  id: "dev.esm.tres",
796
968
  label: "TresJS 🪐",
797
969
  logo: "https://raw.githubusercontent.com/Tresjs/tres/main/public/favicon.svg",
798
970
  packageName: "tresjs",
799
971
  homepage: "https://tresjs.org",
800
- componentStateTypes: $t,
801
- app: e
972
+ componentStateTypes: Tr,
973
+ app: t
802
974
  },
803
- (t) => {
804
- typeof t.now != "function" && Vt(
975
+ (r) => {
976
+ typeof r.now != "function" && kr(
805
977
  // eslint-disable-next-line max-len
806
978
  "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."
807
- ), t.addInspector({
808
- id: O,
979
+ ), r.addInspector({
980
+ id: D,
809
981
  label: "TresJS 🪐",
810
982
  icon: "account_tree",
811
983
  treeFilterPlaceholder: "Search instances"
812
984
  }), setInterval(() => {
813
- t.sendInspectorTree(O);
985
+ r.sendInspectorTree(D);
814
986
  }, 1e3), setInterval(() => {
815
- t.notifyComponentUpdate();
816
- }, 5e3), t.on.getInspectorTree((s) => {
817
- if (s.inspectorId === O) {
818
- const o = ye(r.scene.value);
819
- _e(r.scene.value, o), Ut.sceneGraph = o, s.rootNodes = [o];
987
+ r.notifyComponentUpdate();
988
+ }, 5e3), r.on.getInspectorTree((i) => {
989
+ if (i.inspectorId === D) {
990
+ const n = je(e.scene.value);
991
+ De(e.scene.value, n), Pr.sceneGraph = n, i.rootNodes = [n];
820
992
  }
821
993
  });
822
- let n = null, a = null;
823
- t.on.getInspectorState((s) => {
824
- if (s.inspectorId === O) {
825
- const [o] = r.scene.value.getObjectsByProperty("uuid", s.nodeId);
826
- if (!o)
994
+ let s = null, o = null;
995
+ r.on.getInspectorState((i) => {
996
+ if (i.inspectorId === D) {
997
+ const [n] = e.scene.value.getObjectsByProperty("uuid", i.nodeId);
998
+ if (!n)
827
999
  return;
828
- if (a && n && n.parent && a.remove(n), o.isMesh) {
829
- const i = wt(o);
830
- o.add(i), n = i, a = o;
1000
+ if (o && s && s.parent && o.remove(s), n.isMesh) {
1001
+ const a = lr(n);
1002
+ n.add(a), s = a, o = n;
831
1003
  }
832
- s.state = {
1004
+ i.state = {
833
1005
  object: [
834
1006
  {
835
1007
  key: "uuid",
836
1008
  editable: !0,
837
- value: o.uuid
1009
+ value: n.uuid
838
1010
  },
839
1011
  {
840
1012
  key: "name",
841
1013
  editable: !0,
842
- value: o.name
1014
+ value: n.name
843
1015
  },
844
1016
  {
845
1017
  key: "type",
846
1018
  editable: !0,
847
- value: o.type
1019
+ value: n.type
848
1020
  },
849
1021
  {
850
1022
  key: "position",
851
1023
  editable: !0,
852
- value: o.position
1024
+ value: n.position
853
1025
  },
854
1026
  {
855
1027
  key: "rotation",
856
1028
  editable: !0,
857
- value: o.rotation
1029
+ value: n.rotation
858
1030
  },
859
1031
  {
860
1032
  key: "scale",
861
1033
  editable: !0,
862
- value: o.scale
1034
+ value: n.scale
863
1035
  },
864
1036
  {
865
1037
  key: "geometry",
866
- value: o.geometry
1038
+ value: n.geometry
867
1039
  },
868
1040
  {
869
1041
  key: "material",
870
- value: o.material
1042
+ value: n.material
871
1043
  },
872
1044
  {
873
1045
  key: "color",
874
1046
  editable: !0,
875
- value: o.color
1047
+ value: n.color
876
1048
  },
877
1049
  {
878
1050
  key: "intensity",
879
1051
  editable: !0,
880
- value: o.intensity
1052
+ value: n.intensity
881
1053
  },
882
1054
  {
883
1055
  key: "castShadow",
884
1056
  editable: !0,
885
- value: o.castShadow
1057
+ value: n.castShadow
886
1058
  },
887
1059
  {
888
1060
  key: "receiveShadow",
889
1061
  editable: !0,
890
- value: o.receiveShadow
1062
+ value: n.receiveShadow
891
1063
  },
892
1064
  {
893
1065
  key: "frustumCulled",
894
1066
  editable: !0,
895
- value: o.frustumCulled
1067
+ value: n.frustumCulled
896
1068
  },
897
1069
  {
898
1070
  key: "matrixAutoUpdate",
899
1071
  editable: !0,
900
- value: o.matrixAutoUpdate
1072
+ value: n.matrixAutoUpdate
901
1073
  },
902
1074
  {
903
1075
  key: "matrixWorldNeedsUpdate",
904
1076
  editable: !0,
905
- value: o.matrixWorldNeedsUpdate
1077
+ value: n.matrixWorldNeedsUpdate
906
1078
  },
907
1079
  {
908
1080
  key: "matrixWorld",
909
- value: o.matrixWorld
1081
+ value: n.matrixWorld
910
1082
  },
911
1083
  {
912
1084
  key: "visible",
913
1085
  editable: !0,
914
- value: o.visible
1086
+ value: n.visible
915
1087
  }
916
1088
  ]
917
1089
  };
918
1090
  }
919
- }), t.on.editInspectorState((s) => {
920
- s.inspectorId === O && _t(r.scene.value, s.nodeId, s.path, s.state.value);
1091
+ }), r.on.editInspectorState((i) => {
1092
+ i.inspectorId === D && ar(e.scene.value, i.nodeId, i.path, i.state.value);
921
1093
  });
922
1094
  }
923
1095
  );
924
1096
  }
925
- const Gt = ["data-scene"], zt = /* @__PURE__ */ Z({
1097
+ const Lr = ["data-scene", "data-tres"], Or = /* @__PURE__ */ le({
926
1098
  __name: "TresCanvas",
927
1099
  props: {
928
1100
  shadows: { type: Boolean, default: void 0 },
@@ -932,6 +1104,7 @@ const Gt = ["data-scene"], zt = /* @__PURE__ */ Z({
932
1104
  useLegacyLights: { type: Boolean, default: void 0 },
933
1105
  outputColorSpace: {},
934
1106
  toneMappingExposure: {},
1107
+ renderMode: { default: "always" },
935
1108
  camera: {},
936
1109
  preset: {},
937
1110
  windowSize: { type: Boolean, default: void 0 },
@@ -948,107 +1121,207 @@ const Gt = ["data-scene"], zt = /* @__PURE__ */ Z({
948
1121
  logarithmicDepthBuffer: { type: Boolean, default: void 0 },
949
1122
  failIfMajorPerformanceCaveat: { type: Boolean, default: void 0 }
950
1123
  },
951
- setup(e, { expose: r }) {
1124
+ emits: ["render"],
1125
+ setup(t, { expose: e, emit: r }) {
952
1126
  var _;
953
- const t = e, { logWarning: n } = j(), a = B(), s = D(new qe()), { resume: o } = me(), i = Oe(), l = (_ = ee()) == null ? void 0 : _.appContext.app, c = (d) => Z({
1127
+ const s = t, o = r, i = T(), n = $(new ut()), { resume: a } = ae(), l = We(), f = (_ = ue()) == null ? void 0 : _.appContext.app;
1128
+ ne(Me);
1129
+ const c = (y) => le({
954
1130
  setup() {
955
- var p;
956
- const y = (p = ee()) == null ? void 0 : p.appContext;
957
- return y && (y.app = l), Q("useTres", d), Q("extend", X), typeof window < "u" && Ft(y.app, d), () => te(je, null, i != null && i.default ? i.default() : []);
1131
+ var g;
1132
+ const b = (g = ue()) == null ? void 0 : g.appContext;
1133
+ return b && (b.app = f), ee("useTres", y), ee("extend", ne), typeof window < "u" && Ar(b == null ? void 0 : b.app, y), () => ce(qe, null, l != null && l.default ? l.default() : []);
958
1134
  }
959
- }), m = (d) => {
960
- const y = c(d);
961
- xt(te(y), s.value);
962
- }, f = (d, y = !1) => {
963
- s.value.children = [], y && (d.renderer.value.dispose(), d.renderer.value.renderLists.dispose(), d.renderer.value.forceContextLoss()), m(d), o();
964
- }, u = k(() => t.disableRender), g = D(null);
965
- return r({ context: g, dispose: () => f(g.value, !0) }), Ae(() => {
966
- const d = a;
967
- g.value = Tt({
968
- scene: s.value,
969
- canvas: d,
970
- windowSize: t.windowSize,
971
- disableRender: u,
972
- rendererOptions: t
973
- }), St({ scene: s.value, contextParts: g.value });
974
- const { registerCamera: y, camera: p, cameras: C, deregisterCamera: M } = g.value;
975
- m(g.value);
976
- const P = () => {
977
- const w = new Y(
1135
+ }), u = (y) => {
1136
+ const b = c(y), { render: g } = Ye(Oe());
1137
+ g(ce(b), n.value);
1138
+ }, d = (y, b = !1) => {
1139
+ n.value.children = [], b && (y.renderer.value.dispose(), y.renderer.value.renderLists.dispose(), y.renderer.value.forceContextLoss()), u(y), a();
1140
+ }, p = x(() => s.disableRender), h = $(null);
1141
+ return e({ context: h, dispose: () => d(h.value, !0) }), Ue(() => {
1142
+ const y = i;
1143
+ h.value = hr({
1144
+ scene: n.value,
1145
+ canvas: y,
1146
+ windowSize: s.windowSize ?? !1,
1147
+ disableRender: p.value ?? !1,
1148
+ rendererOptions: s,
1149
+ emit: o
1150
+ }), mr(h.value);
1151
+ const { registerCamera: b, camera: g, cameras: E, deregisterCamera: w } = h.value;
1152
+ u(h.value);
1153
+ const m = () => {
1154
+ const v = new te(
978
1155
  45,
979
1156
  window.innerWidth / window.innerHeight,
980
1157
  0.1,
981
1158
  1e3
982
1159
  );
983
- w.position.set(3, 3, 3), w.lookAt(0, 0, 0), y(w);
984
- const S = A(() => {
985
- C.value.length >= 2 && (w.removeFromParent(), M(w), S == null || S());
1160
+ v.position.set(3, 3, 3), v.lookAt(0, 0, 0), b(v);
1161
+ const C = se(() => {
1162
+ E.value.length >= 2 && (v.removeFromParent(), w(v), C == null || C());
986
1163
  });
987
1164
  };
988
- ie(
989
- () => t.camera,
990
- (w, S) => {
991
- w && y(w), S && (S.removeFromParent(), M(S));
1165
+ I(
1166
+ () => s.camera,
1167
+ (v, C) => {
1168
+ v && b(v), C && (C.removeFromParent(), w(C));
992
1169
  },
993
1170
  {
994
1171
  immediate: !0
995
1172
  }
996
- ), p.value || (n(
997
- "No camera found. Creating a default perspective camera. To have full control over a camera, please add one to the scene."
998
- ), P());
999
- }), (d, y) => (xe(), De("canvas", {
1173
+ ), g.value || m();
1174
+ }), (y, b) => (Ge(), ze("canvas", {
1000
1175
  ref_key: "canvas",
1001
- ref: a,
1002
- "data-scene": s.value.uuid,
1003
- class: Le(d.$attrs.class),
1004
- style: Be({
1176
+ ref: i,
1177
+ "data-scene": n.value.uuid,
1178
+ class: Ve(y.$attrs.class),
1179
+ "data-tres": `tresjs ${Je(Vt).version}`,
1180
+ style: Qe({
1005
1181
  display: "block",
1006
1182
  width: "100%",
1007
1183
  height: "100%",
1008
- position: d.windowSize ? "fixed" : "relative",
1184
+ position: y.windowSize ? "fixed" : "relative",
1009
1185
  top: 0,
1010
1186
  left: 0,
1011
1187
  pointerEvents: "auto",
1012
1188
  touchAction: "none",
1013
- ...d.$attrs.style
1189
+ ...y.$attrs.style
1014
1190
  })
1015
- }, null, 14, Gt));
1191
+ }, null, 14, Lr));
1016
1192
  }
1017
- }), Wt = [
1193
+ }), Br = [
1018
1194
  "TresCanvas",
1019
1195
  "TresLeches",
1020
1196
  "TresScene"
1021
- ], Qt = {
1197
+ ], jr = {
1022
1198
  template: {
1023
1199
  compilerOptions: {
1024
- isCustomElement: (e) => e.startsWith("Tres") && !Wt.includes(e) || e === "primitive"
1200
+ isCustomElement: (t) => t.startsWith("Tres") && !Br.includes(t) || t === "primitive"
1201
+ }
1202
+ }
1203
+ }, Qr = jr, Yr = {
1204
+ mounted: (t, e) => {
1205
+ if (e.arg) {
1206
+ console.log(`v-log:${e.arg}`, t[e.arg]);
1207
+ return;
1025
1208
  }
1209
+ console.log("v-log", t);
1210
+ }
1211
+ };
1212
+ class Ie extends ct {
1213
+ constructor(e, r) {
1214
+ const s = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0, 1, 1, 0], o = new de();
1215
+ o.setAttribute("position", new fe(s, 3)), o.computeBoundingSphere();
1216
+ const i = new dt({ fog: !1 });
1217
+ super(o, i), this.light = e, this.color = r, this.type = "RectAreaLightHelper";
1218
+ const n = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0], a = new de();
1219
+ a.setAttribute("position", new fe(n, 3)), a.computeBoundingSphere(), this.add(new ft(a, new Ee({ side: pt, fog: !1 })));
1026
1220
  }
1027
- }, ar = Qt, sr = {
1028
- install(e) {
1029
- e.component("TresCanvas", zt);
1221
+ updateMatrixWorld() {
1222
+ if (this.scale.set(0.5 * this.light.width, 0.5 * this.light.height, 1), this.color !== void 0)
1223
+ this.material.color.set(this.color), this.children[0].material.color.set(this.color);
1224
+ else {
1225
+ this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);
1226
+ const e = this.material.color, r = Math.max(e.r, e.g, e.b);
1227
+ r > 1 && e.multiplyScalar(1 / r), this.children[0].material.color.copy(this.material.color);
1228
+ }
1229
+ this.matrixWorld.extractRotation(this.light.matrixWorld).scale(this.scale).copyPosition(this.light.matrixWorld), this.children[0].matrixWorld.copy(this.matrixWorld);
1230
+ }
1231
+ dispose() {
1232
+ this.geometry.dispose(), this.material.dispose(), this.children[0].geometry.dispose(), this.children[0].material.dispose();
1233
+ }
1234
+ }
1235
+ const { logWarning: we } = P();
1236
+ let U, k;
1237
+ const Dr = {
1238
+ DirectionalLight: mt,
1239
+ PointLight: vt,
1240
+ SpotLight: gt,
1241
+ HemisphereLight: ht,
1242
+ RectAreaLight: Ie
1243
+ }, qr = {
1244
+ mounted: (t) => {
1245
+ if (!t.isLight) {
1246
+ we(`${t.type} is not a light`);
1247
+ return;
1248
+ }
1249
+ U = Dr[t.type], t.parent.add(new U(t, 1, t.color.getHex()));
1250
+ },
1251
+ updated: (t) => {
1252
+ k = t.parent.children.find((e) => e instanceof U), !(k instanceof Ie) && k.update();
1253
+ },
1254
+ unmounted: (t) => {
1255
+ if (!t.isLight) {
1256
+ we(`${t.type} is not a light`);
1257
+ return;
1258
+ }
1259
+ k = t.parent.children.find((e) => e instanceof U), k && k.dispose && k.dispose(), t.parent.remove(k);
1260
+ }
1261
+ }, { logWarning: Ir } = P(), Kr = {
1262
+ updated: (t, e) => {
1263
+ const r = Ae(e);
1264
+ if (!r) {
1265
+ Ir(`v-always-look-at: problem with binding value: ${e.value}`);
1266
+ return;
1267
+ }
1268
+ const { onLoop: s } = ae();
1269
+ s(() => {
1270
+ t.lookAt(r);
1271
+ });
1272
+ }
1273
+ }, { logWarning: Rr } = P(), Xr = {
1274
+ updated: (t, e) => {
1275
+ var o;
1276
+ const r = Ae(e);
1277
+ if (!r) {
1278
+ Rr(`v-distance-to: problem with binding value: ${e.value}`);
1279
+ return;
1280
+ }
1281
+ S && (S.dispose(), t.parent.remove(S));
1282
+ const s = r.clone().sub(t.position);
1283
+ s.normalize(), S = new yt(s, t.position, t.position.distanceTo(r), 16776960), t.parent.add(S), console.table(
1284
+ [
1285
+ ["Distance:", t.position.distanceTo(r)],
1286
+ [`origin: ${t.name || t.type}`, `x:${t.position.x}, y:${t.position.y}, z:${(o = t.position) == null ? void 0 : o.z}`],
1287
+ [`Destiny: ${t.name || t.type}`, `x:${r.x}, y:${r.y}, z:${r == null ? void 0 : r.z}`]
1288
+ ]
1289
+ );
1290
+ },
1291
+ unmounted: (t) => {
1292
+ S == null || S.dispose(), t.parent.remove(S);
1293
+ }
1294
+ };
1295
+ let S = null;
1296
+ const Zr = {
1297
+ install(t) {
1298
+ t.component("TresCanvas", Or);
1030
1299
  }
1031
1300
  };
1032
1301
  export {
1033
- zt as TresCanvas,
1034
- J as catalogue,
1035
- sr as default,
1036
- X as extend,
1037
- Zt as isProd,
1038
- ct as normalizeColor,
1039
- er as normalizeVectorFlexibleParam,
1040
- ar as templateCompilerOptions,
1041
- Mt as trasverseObjects,
1042
- st as useCamera,
1043
- tr as useLoader,
1044
- j as useLogger,
1045
- St as usePointerEventHandler,
1046
- Pt as useRaycaster,
1047
- me as useRenderLoop,
1048
- Et as useRenderer,
1049
- nr as useSeek,
1050
- rr as useTexture,
1051
- or as useTres,
1052
- Ot as useTresContext,
1053
- Tt as useTresContextProvider
1302
+ Or as TresCanvas,
1303
+ re as catalogue,
1304
+ Zr as default,
1305
+ ne as extend,
1306
+ Wr as isProd,
1307
+ Xt as normalizeColor,
1308
+ Ur as normalizeVectorFlexibleParam,
1309
+ Qr as templateCompilerOptions,
1310
+ fr as trasverseObjects,
1311
+ Jt as useCamera,
1312
+ Gr as useLoader,
1313
+ P as useLogger,
1314
+ mr as usePointerEventHandler,
1315
+ pr as useRaycaster,
1316
+ ae as useRenderLoop,
1317
+ cr as useRenderer,
1318
+ Vr as useSeek,
1319
+ zr as useTexture,
1320
+ Jr as useTres,
1321
+ yr as useTresContext,
1322
+ hr as useTresContextProvider,
1323
+ Kr as vAlwaysLookAt,
1324
+ Xr as vDistanceTo,
1325
+ qr as vLightHelper,
1326
+ Yr as vLog
1054
1327
  };