@tresjs/core 0.4.0 → 1.0.0

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/tres.js CHANGED
@@ -1,31 +1,31 @@
1
1
  /**
2
2
  * name: @tresjs/core
3
- * version: v0.4.0
3
+ * version: v1.0.0
4
4
  * (c) 2022
5
5
  * description: Declarative ThreeJS using Vue Components
6
6
  * author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
7
7
  */
8
- import { computed as F, watch as R, inject as Q, defineComponent as _, shallowRef as $, ref as O, reactive as le, toRefs as fe, provide as T, onBeforeUnmount as me, h as G } from "vue";
9
- import { useWindowSize as X, createEventHook as U, useRafFn as de, useElementSize as ge, useDevicePixelRatio as he, unrefElement as A, resolveUnref as v } from "@vueuse/core";
10
- import * as we from "three";
11
- import { PerspectiveCamera as I, OrthographicCamera as Ce, Color as z, Vector3 as ve, Clock as Me, Scene as Se, LoadingManager as Y, TextureLoader as ye, PCFShadowMap as xe, LinearEncoding as Ee, NoToneMapping as Pe, WebGLRenderer as Le } from "three";
12
- var Re = /* @__PURE__ */ ((e) => (e.Perspective = "Perspective", e.Orthographic = "Orthographic", e))(Re || {});
8
+ import { computed as D, watch as O, inject as X, defineComponent as _, shallowRef as j, reactive as fe, toRefs as me, ref as F, provide as A, onBeforeUnmount as de, h as J } from "vue";
9
+ import { useWindowSize as Y, createEventHook as U, useRafFn as ge, useElementSize as he, useDevicePixelRatio as we, unrefElement as B, resolveUnref as S } from "@vueuse/core";
10
+ import * as ve from "three";
11
+ import { PerspectiveCamera as $, OrthographicCamera as Ce, Color as I, Vector3 as ye, Clock as Me, Scene as Se, LoadingManager as xe, TextureLoader as Ee, PCFShadowMap as Pe, LinearEncoding as Le, NoToneMapping as Te, WebGLRenderer as Re } from "three";
12
+ var Oe = /* @__PURE__ */ ((e) => (e.Perspective = "Perspective", e.Orthographic = "Orthographic", e))(Oe || {});
13
13
  const P = {
14
14
  cameras: []
15
- }, Te = 45;
16
- let y;
15
+ }, Ae = 45;
16
+ let E;
17
17
  function Z() {
18
- const { width: e, height: t } = X();
19
- function a(s = "Perspective", i) {
20
- if (s === "Perspective") {
21
- const { near: l, far: d, fov: m } = i || {
18
+ const { width: e, height: t } = Y(), { setState: n } = oe();
19
+ function a(i = "Perspective", f) {
20
+ if (i === "Perspective") {
21
+ const { near: u, far: m, fov: d } = f || {
22
22
  near: 0.1,
23
23
  far: 1e3,
24
- fov: Te
24
+ fov: Ae
25
25
  };
26
- y = new I(m, r.value, l, d), P.cameras.push(y);
26
+ E = new $(d, r.value, u, m), P.cameras.push(E);
27
27
  } else {
28
- const { left: l, right: d, top: m, bottom: h, near: M, far: S } = i || {
28
+ const { left: u, right: m, top: d, bottom: w, near: C, far: x } = f || {
29
29
  left: -100,
30
30
  right: 100,
31
31
  top: 100,
@@ -33,26 +33,26 @@ function Z() {
33
33
  near: 0.1,
34
34
  far: 1e3
35
35
  };
36
- y = new Ce(l, d, m, h, M, S), P.cameras.push(y);
36
+ E = new Ce(u, m, d, w, C, x), P.cameras.push(E);
37
37
  }
38
- return P.cameras.push(y), y;
38
+ return P.cameras.push(E), E;
39
39
  }
40
- const r = F(() => e.value / t.value), n = F(() => P.cameras[0]);
41
- function o() {
42
- n.value instanceof I && (n.value.aspect = r.value), n.value.updateProjectionMatrix();
40
+ const r = D(() => e.value / t.value), o = D(() => P.cameras[0]);
41
+ function s() {
42
+ o.value instanceof $ && (o.value.aspect = r.value), o.value.updateProjectionMatrix();
43
43
  }
44
- function p(s) {
45
- const i = Q("camera");
46
- s && i && (i.value = s), P.cameras.push(s), s instanceof I && (s.aspect = r.value), s.updateProjectionMatrix();
44
+ function c(i) {
45
+ const f = X("camera");
46
+ i && f && (f.value = i, n("camera", f.value)), P.cameras.push(i), i instanceof $ && (i.aspect = r.value), i.updateProjectionMatrix();
47
47
  }
48
- return R(r, o), {
49
- activeCamera: n,
48
+ return O(r, s), {
49
+ activeCamera: o,
50
50
  createCamera: a,
51
- updateCamera: o,
52
- pushCamera: p
51
+ updateCamera: s,
52
+ pushCamera: c
53
53
  };
54
54
  }
55
- let b = { ...we };
55
+ let b = { ...ve };
56
56
  delete b.Scene;
57
57
  function be() {
58
58
  return {
@@ -62,222 +62,246 @@ function be() {
62
62
  catalogue: b
63
63
  };
64
64
  }
65
- const Oe = (e) => typeof e < "u", k = (e) => !!e && e.constructor === Array;
66
- function je(e) {
67
- return typeof e == "number" ? [e, e, e] : e instanceof ve ? [e.x, e.y, e.z] : e;
65
+ const Be = (e) => typeof e < "u", V = (e) => !!e && e.constructor === Array;
66
+ function $e(e) {
67
+ return typeof e == "number" ? [e, e, e] : e instanceof ye ? [e.x, e.y, e.z] : e;
68
68
  }
69
- function J(e) {
70
- return e instanceof z ? e : Array.isArray(e) ? new z(...e) : new z(e);
69
+ function q(e) {
70
+ return e instanceof I ? e : Array.isArray(e) ? new I(...e) : new I(e);
71
71
  }
72
- const q = "[TresJS \u25B2 \u25A0 \u25CF] ";
73
- function ee() {
74
- function e(r, n) {
75
- console.error(`${q} ${r}`, n || "");
72
+ const K = "[TresJS \u25B2 \u25A0 \u25CF] ";
73
+ function W() {
74
+ function e(a, r) {
75
+ console.error(`${K} ${a}`, r || "");
76
76
  }
77
- function t(r) {
78
- console.warn(`${q} ${r}`);
77
+ function t(a) {
78
+ console.warn(`${K} ${a}`);
79
79
  }
80
- function a(r, n) {
80
+ function n(a, r) {
81
81
  }
82
82
  return {
83
83
  logError: e,
84
84
  logWarning: t,
85
- logMessage: a
85
+ logMessage: n
86
86
  };
87
87
  }
88
- const Be = ["rotation", "scale", "position"];
89
- function Ae() {
90
- const { catalogue: e } = be(), { logMessage: t, logError: a } = ee();
91
- function r() {
92
- return Object.entries(e).filter(([n, o]) => {
93
- var p, s;
94
- return (s = (p = o == null ? void 0 : o.prototype) == null ? void 0 : p.constructor) == null ? void 0 : s.toString().includes("class");
95
- }).map(([n, o]) => {
96
- const p = _({
97
- name: n,
98
- setup(s, { slots: i, attrs: l, ...d }) {
99
- t(n, {
100
- props: s,
101
- slots: i,
102
- attrs: l,
88
+ const Ie = ["rotation", "scale", "position"];
89
+ function ze(e) {
90
+ const { logMessage: t, logError: n } = W();
91
+ function a(r) {
92
+ return Object.entries(r).filter(([o, s]) => {
93
+ var c, i;
94
+ return (i = (c = s == null ? void 0 : s.prototype) == null ? void 0 : c.constructor) == null ? void 0 : i.toString().includes("class");
95
+ }).map(([o, s]) => {
96
+ const c = `${e}${o}`, i = _({
97
+ name: c,
98
+ setup(f, { slots: u, attrs: m, ...d }) {
99
+ t(c, {
100
+ props: f,
101
+ slots: u,
102
+ attrs: m,
103
103
  ctx: d
104
104
  });
105
- let m;
106
- const { scene: h } = oe(), { pushCamera: M } = Z();
107
- function S() {
108
- if ((i == null ? void 0 : i.default) && (i == null ? void 0 : i.default())) {
109
- const C = i.default().map((c) => {
110
- var f;
111
- let w;
112
- return (f = c == null ? void 0 : c.props) != null && f.args ? w = new e[c.type.name](...c.props.args) : w = new e[c.type.name](), c != null && c.props && x(c.props, w), w;
105
+ let w;
106
+ const { scene: C } = ae(), { pushCamera: x } = Z();
107
+ function L() {
108
+ if ((u == null ? void 0 : u.default) && (u == null ? void 0 : u.default())) {
109
+ const y = u.default().map((l) => {
110
+ var h;
111
+ let v;
112
+ const g = l.type.name.replace(e, "");
113
+ return (h = l == null ? void 0 : l.props) != null && h.args ? v = new r[g](...l.props.args) : v = new r[g](), l != null && l.props && T(l.props, v), v;
113
114
  });
114
- m = new o(...C);
115
+ w = new s(...y);
115
116
  } else
116
- l.args ? m = new o(...l.args) : m = new o();
117
- x(l, m), n === "PerspectiveCamera" || n === "OrtographicCamera" ? M(m) : h == null || h.value.add(m), t("Instance added", h), d.expose(m);
117
+ m.args ? w = new s(...m.args) : w = new s();
118
+ T(m, w), c.includes("Camera") && x(w), w.isObject3D && (C == null || C.value.add(w)), t("Instance added", C), d.expose(w);
118
119
  }
119
- function x(C, c) {
120
- Object.entries(C).forEach(([w, f]) => {
121
- const g = w.replace(/(-\w)/g, (E) => E[1].toUpperCase());
122
- if (!(g === "args" || f === void 0)) {
123
- Be.includes(w) && f && (f = je(f));
120
+ function T(y, l) {
121
+ Object.entries(y).forEach(([v, g]) => {
122
+ const h = v.replace(/(-\w)/g, (M) => M[1].toUpperCase());
123
+ if (!(h === "args" || g === void 0)) {
124
+ Ie.includes(v) && g && (g = $e(g));
124
125
  try {
125
- c[g] && Oe(c[g].set) ? k(f) ? c[g].set(...f) : c[g].set(f) : (f === "" && (f = !0), c[g] = f);
126
- } catch (E) {
127
- a(`There was an error setting ${g} property`, E);
126
+ l[h] && Be(l[h].set) ? V(g) ? l[h].set(...g) : l[h].set(g) : (g === "" && (g = !0), l[h] = g);
127
+ } catch (M) {
128
+ n(`There was an error setting ${h} property`, M);
128
129
  }
129
130
  }
130
- }), C.ref && (C.ref = c);
131
+ }), y.ref && (y.ref = l);
131
132
  }
132
- return S(), () => {
133
+ return L(), () => {
133
134
  };
134
135
  }
135
136
  });
136
- return [n, p];
137
+ return [c, i];
137
138
  });
138
139
  }
139
140
  return {
140
- createComponentInstances: r
141
+ createComponentInstances: a
141
142
  };
142
143
  }
143
- const te = U(), ne = U(), re = U(), K = new Me(), { pause: Ie, resume: ze, isActive: De } = de(
144
+ const ee = U(), te = U(), ne = U(), Q = new Me(), { pause: De, resume: Fe, isActive: _e } = ge(
144
145
  () => {
145
- const e = K.getElapsedTime(), t = K.getDelta();
146
- te.trigger({ delta: t, elapsed: e }), ne.trigger({ delta: t, elapsed: e }), re.trigger({ delta: t, elapsed: e });
146
+ const e = Q.getElapsedTime(), t = Q.getDelta();
147
+ ee.trigger({ delta: t, elapsed: e }), te.trigger({ delta: t, elapsed: e }), ne.trigger({ delta: t, elapsed: e });
147
148
  },
148
149
  { immediate: !1 }
149
150
  );
150
- function ae() {
151
+ function re() {
151
152
  return {
152
- onBeforeLoop: te.on,
153
- onLoop: ne.on,
154
- onAfterLoop: re.on,
155
- pause: Ie,
156
- resume: ze,
157
- isActive: De
153
+ onBeforeLoop: ee.on,
154
+ onLoop: te.on,
155
+ onAfterLoop: ne.on,
156
+ pause: De,
157
+ resume: Fe,
158
+ isActive: _e
158
159
  };
159
160
  }
160
- const Fe = $(new Se());
161
- function oe() {
161
+ const je = j(new Se());
162
+ function ae() {
162
163
  return {
163
- scene: Fe
164
+ scene: je
164
165
  };
165
166
  }
166
- function Ne() {
167
- const e = new Y(), t = O(e);
168
- return { loadingManager: e, loadingManagerRef: t };
167
+ function Ue(e) {
168
+ const t = { nodes: {}, materials: {} };
169
+ return e && e.traverse((n) => {
170
+ n.name && (t.nodes[n.name] = n), n.material && !t.materials[n.material.name] && (t.materials[n.material.name] = n.material);
171
+ }), t;
172
+ }
173
+ async function Je(e, t, n, a, r) {
174
+ const { logError: o } = W(), s = new e();
175
+ r && r(s), n && n(e);
176
+ const i = (Array.isArray(t) ? t : [t]).map(
177
+ (f) => new Promise((u, m) => {
178
+ s.load(
179
+ f,
180
+ (d) => {
181
+ d.scene && Object.assign(d, Ue(d.scene)), u(d);
182
+ },
183
+ a,
184
+ (d) => m(o("[useLoader] - Failed to load resource", d))
185
+ );
186
+ })
187
+ );
188
+ return V(t) ? await Promise.all(i) : await i[0];
169
189
  }
170
- async function Ge(e) {
171
- const t = new Y(), a = new ye(t), r = (n) => new Promise((o, p) => {
172
- a.load(
173
- n,
174
- (s) => o(s),
190
+ async function qe(e) {
191
+ const t = new xe(), n = new Ee(t), a = (r) => new Promise((o, s) => {
192
+ n.load(
193
+ r,
194
+ (c) => o(c),
175
195
  () => null,
176
196
  () => {
177
- p(new Error("[useTextures] - Failed to load texture"));
197
+ s(new Error("[useTextures] - Failed to load texture"));
178
198
  }
179
199
  );
180
200
  });
181
- if (k(e)) {
182
- const n = await Promise.all(e.map((o) => r(o)));
183
- return e.length > 1 ? n : n[0];
201
+ if (V(e)) {
202
+ const r = await Promise.all(e.map((o) => a(o)));
203
+ return e.length > 1 ? r : r[0];
184
204
  } else {
185
- const { map: n, displacementMap: o, normalMap: p, roughnessMap: s, metalnessMap: i, aoMap: l } = e;
205
+ const { map: r, displacementMap: o, normalMap: s, roughnessMap: c, metalnessMap: i, aoMap: f } = e;
186
206
  return {
187
- map: n ? await r(n) : null,
188
- displacementMap: o ? await r(o) : null,
189
- normalMap: p ? await r(p) : null,
190
- roughnessMap: s ? await r(s) : null,
191
- metalnessMap: i ? await r(i) : null,
192
- aoMap: l ? await r(l) : null
207
+ map: r ? await a(r) : null,
208
+ displacementMap: o ? await a(o) : null,
209
+ normalMap: s ? await a(s) : null,
210
+ roughnessMap: c ? await a(c) : null,
211
+ metalnessMap: i ? await a(i) : null,
212
+ aoMap: f ? await a(f) : null
193
213
  };
194
214
  }
195
215
  }
196
- const L = le({});
197
- function Je() {
198
- function e(a) {
199
- return L[a];
216
+ const R = fe({});
217
+ function oe() {
218
+ function e(n) {
219
+ return R[n];
200
220
  }
201
- function t(a, r) {
202
- L[a] = r;
221
+ function t(n, a) {
222
+ R[n] = a;
203
223
  }
204
224
  return {
205
- state: L,
206
- ...fe(L),
225
+ state: R,
226
+ ...me(R),
207
227
  getState: e,
208
228
  setState: t
209
229
  };
210
230
  }
211
- const u = $(), D = O(!1);
212
- function _e(e, t, a) {
231
+ const p = j(), z = F(!1);
232
+ function Ve(e, t, n) {
213
233
  const {
214
- alpha: r = !1,
215
- antialias: n,
234
+ alpha: a = !1,
235
+ antialias: r,
216
236
  depth: o,
217
- logarithmicDepthBuffer: p,
218
- failIfMajorPerformanceCaveat: s,
237
+ logarithmicDepthBuffer: s,
238
+ failIfMajorPerformanceCaveat: c,
219
239
  precision: i,
220
- premultipliedAlpha: l,
221
- stencil: d,
240
+ premultipliedAlpha: f,
241
+ stencil: u,
222
242
  shadows: m = !1,
223
- shadowMapType: h = xe,
224
- physicallyCorrectLights: M = !1,
225
- outputEncoding: S = Ee,
226
- toneMapping: x = Pe,
227
- toneMappingExposure: C = 1,
228
- context: c = void 0,
229
- powerPreference: w = "default",
230
- preserveDrawingBuffer: f = !1,
231
- clearColor: g = J("#000000"),
232
- windowSize: E = !1
233
- } = a, { width: j, height: B } = E ? X() : ge(t), { pixelRatio: V } = he(), { pause: se, resume: ie } = ae(), ce = F(() => j.value / B.value), W = () => {
234
- !u.value || (u.value.setSize(j.value, B.value), u.value.setPixelRatio(V.value));
243
+ shadowMapType: d = Pe,
244
+ physicallyCorrectLights: w = !1,
245
+ outputEncoding: C = Le,
246
+ toneMapping: x = Te,
247
+ toneMappingExposure: L = 1,
248
+ context: T = void 0,
249
+ powerPreference: y = "default",
250
+ preserveDrawingBuffer: l = !1,
251
+ clearColor: v = q("#000000"),
252
+ windowSize: g = !1
253
+ } = n, { width: h, height: M } = g ? Y() : he(t), { pixelRatio: k } = we(), { pause: se, resume: ie } = re(), ce = D(() => h.value / M.value), N = () => {
254
+ !p.value || (p.value.setSize(h.value, M.value), p.value.setPixelRatio(k.value));
235
255
  }, H = () => {
236
- !u.value || (u.value.shadowMap.enabled = v(m), u.value.outputEncoding = v(S), u.value.shadowMap.type = v(h), u.value.physicallyCorrectLights = v(M), u.value.toneMapping = v(x), u.value.toneMappingExposure = v(C), u.value.setClearColor(J(v(g))));
256
+ !p.value || (p.value.shadowMap.enabled = S(m), p.value.outputEncoding = S(C), p.value.shadowMap.type = S(d), p.value.physicallyCorrectLights = S(w), p.value.toneMapping = S(x), p.value.toneMappingExposure = S(L), p.value.setClearColor(q(S(v))));
237
257
  }, ue = () => {
238
- const N = A(e);
239
- u.value || !N || (u.value = new Le({
240
- canvas: N,
241
- alpha: r,
242
- antialias: n,
243
- context: c,
258
+ const G = B(e);
259
+ if (p.value || !G)
260
+ return;
261
+ p.value = new Re({
262
+ canvas: G,
263
+ alpha: a,
264
+ antialias: r,
265
+ context: T,
244
266
  depth: o,
245
- failIfMajorPerformanceCaveat: s,
246
- logarithmicDepthBuffer: p,
247
- powerPreference: w,
267
+ failIfMajorPerformanceCaveat: c,
268
+ logarithmicDepthBuffer: s,
269
+ powerPreference: y,
248
270
  precision: i,
249
- stencil: d,
250
- preserveDrawingBuffer: f,
251
- premultipliedAlpha: l
252
- }), H(), W(), ie(), D.value = !0);
253
- }, pe = () => {
254
- !u.value || (u.value.dispose(), u.value = void 0, D.value = !1, se());
271
+ stencil: u,
272
+ preserveDrawingBuffer: l,
273
+ premultipliedAlpha: f
274
+ });
275
+ const { setState: pe } = oe();
276
+ pe("renderer", p.value), H(), N(), ie(), z.value = !0;
277
+ }, le = () => {
278
+ !p.value || (p.value.dispose(), p.value = void 0, z.value = !1, se());
255
279
  };
256
- return R([j, B, V], W), R(
280
+ return O([h, M, k], N), O(
257
281
  () => [
258
282
  m,
259
- h,
260
- S,
261
- M,
262
- x,
283
+ d,
263
284
  C,
264
- g
285
+ w,
286
+ x,
287
+ L,
288
+ v
265
289
  ],
266
290
  H
267
- ), R(
291
+ ), O(
268
292
  () => [e, t],
269
293
  () => {
270
- A(e) && A(t) && ue();
294
+ B(e) && B(t) && ue();
271
295
  },
272
296
  { immediate: !0, deep: !0 }
273
297
  ), {
274
- renderer: u,
275
- isReady: D,
276
- dispose: pe,
298
+ renderer: p,
299
+ isReady: z,
300
+ dispose: le,
277
301
  aspectRatio: ce
278
302
  };
279
303
  }
280
- const $e = _({
304
+ const We = _({
281
305
  name: "TresCanvas",
282
306
  props: {
283
307
  shadows: Boolean,
@@ -292,13 +316,14 @@ const $e = _({
292
316
  clearColor: String,
293
317
  windowSize: Boolean
294
318
  },
295
- setup(e, { slots: t, attrs: a }) {
296
- const { logError: r } = ee(), n = O(), o = O(), { renderer: p, dispose: s, aspectRatio: i } = _e(n, o, e), l = $();
297
- return T("camera", l), T("renderer", p), T("aspect-ratio", i), t.default && !t.default().some((d) => d.type.name === "Scene") && r("TresCanvas must contain a Scene component."), t.default && !t.default().some(
298
- (d) => d.type.name === "PerspectiveCamera" || d.type.name === "OrtographicCamera"
299
- ) && r("Scene must contain a Camera component."), me(() => s()), () => {
319
+ setup(e, { slots: t, attrs: n }) {
320
+ const { logError: a } = W(), r = F(), o = F(), { renderer: s, dispose: c, aspectRatio: i } = Ve(r, o, e), f = j();
321
+ return A("camera", f), A("renderer", s), A("aspect-ratio", i), t.default && !t.default().some((u) => u.type.name === "Scene") && a("TresCanvas must contain a Scene component."), t.default && !t.default().some((u) => {
322
+ var m;
323
+ return (m = u.type.name) == null ? void 0 : m.includes("Camera");
324
+ }) && a("Scene must contain a Camera component."), de(() => c()), () => {
300
325
  if (t.default)
301
- return G(
326
+ return J(
302
327
  "div",
303
328
  {
304
329
  ref: o,
@@ -306,12 +331,12 @@ const $e = _({
306
331
  position: "relative",
307
332
  width: "100%",
308
333
  height: "100vh",
309
- ...a.style
334
+ ...n.style
310
335
  }
311
336
  },
312
337
  [
313
- G("canvas", {
314
- ref: n,
338
+ J("canvas", {
339
+ ref: r,
315
340
  style: { width: "100%", height: "100%", position: "absolute", top: 0, left: 0 }
316
341
  }),
317
342
  t.default()
@@ -319,37 +344,39 @@ const $e = _({
319
344
  );
320
345
  };
321
346
  }
322
- }), Ue = _({
347
+ }), ke = _({
323
348
  name: "Scene",
324
349
  setup(e, { slots: t }) {
325
- const { scene: a } = oe(), r = Q("renderer"), { activeCamera: n } = Z(), { onLoop: o } = ae();
326
- return T("local-scene", a), o(() => {
327
- (r == null ? void 0 : r.value) && (n == null ? void 0 : n.value) && (a == null ? void 0 : a.value) && r.value.render(a == null ? void 0 : a.value, n.value);
350
+ const { scene: n } = ae(), a = X("renderer"), { activeCamera: r } = Z(), { onLoop: o } = re();
351
+ return A("local-scene", n), o(() => {
352
+ (a == null ? void 0 : a.value) && (r == null ? void 0 : r.value) && (n == null ? void 0 : n.value) && a.value.render(n == null ? void 0 : n.value, r.value);
328
353
  }), () => {
329
354
  if (t.default)
330
355
  return t.default();
331
356
  };
332
357
  }
333
- }), qe = Symbol("UseTresState"), Ke = {
334
- install(e) {
335
- e.component("TresCanvas", $e), e.component("Scene", Ue);
336
- const { createComponentInstances: t } = Ae();
337
- t().forEach(([r, n]) => {
338
- e.component(r, n);
358
+ }), Ke = Symbol("UseTresState"), Qe = {
359
+ install(e, t) {
360
+ const n = (t == null ? void 0 : t.prefix) || "Tres";
361
+ e.component(`${n}Canvas`, We), e.component(`${n}Scene`, ke);
362
+ const { catalogue: a } = be(), { createComponentInstances: r } = ze(n);
363
+ r(t != null && t.extends ? { ...a, ...t.extends } : a).forEach(([s, c]) => {
364
+ e.component(s, c);
339
365
  });
340
366
  }
341
367
  };
342
368
  export {
343
- Re as CameraType,
344
- qe as UseTresStateSymbol,
345
- Ke as default,
369
+ Oe as CameraType,
370
+ Ke as UseTresStateSymbol,
371
+ Qe as default,
372
+ Ue as trasverseObjects,
346
373
  Z as useCamera,
347
- be as useCatalog,
348
- Ae as useInstanceCreator,
349
- Ne as useLoadingManager,
350
- ae as useRenderLoop,
351
- _e as useRenderer,
352
- oe as useScene,
353
- Ge as useTexture,
354
- Je as useTres
374
+ be as useCatalogue,
375
+ ze as useInstanceCreator,
376
+ Je as useLoader,
377
+ re as useRenderLoop,
378
+ Ve as useRenderer,
379
+ ae as useScene,
380
+ qe as useTexture,
381
+ oe as useTres
355
382
  };