@tresjs/core 3.6.0 → 4.0.0-next.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/README.md +6 -6
- package/dist/components/TresCanvas.vue.d.ts +4 -3
- package/dist/composables/useRenderer/index.d.ts +1 -1
- package/dist/devtools/highlight.d.ts +7 -0
- package/dist/devtools/index.d.ts +1 -0
- package/dist/devtools/plugin.d.ts +15 -0
- package/dist/devtools/utils.d.ts +7 -0
- package/dist/tres.js +768 -427
- package/dist/tres.umd.cjs +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/utils/index.d.ts +7 -0
- package/package.json +1 -1
package/dist/tres.js
CHANGED
|
@@ -1,432 +1,489 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name: @tresjs/core
|
|
3
|
-
* version:
|
|
3
|
+
* version: v4.0.0-next.0
|
|
4
4
|
* (c) 2023
|
|
5
5
|
* description: Declarative ThreeJS using Vue Components
|
|
6
6
|
* author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
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(
|
|
14
17
|
() => t.value[0]
|
|
15
|
-
),
|
|
16
|
-
t.value.some(({ uuid:
|
|
17
|
-
},
|
|
18
|
-
t.value = t.value.filter(({ uuid: l }) => l !==
|
|
19
|
-
},
|
|
20
|
-
const l =
|
|
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);
|
|
21
24
|
if (!l)
|
|
22
25
|
return;
|
|
23
|
-
const
|
|
24
|
-
t.value = [l, ...
|
|
26
|
+
const c = t.value.filter(({ uuid: m }) => m !== l.uuid);
|
|
27
|
+
t.value = [l, ...c];
|
|
25
28
|
};
|
|
26
|
-
return
|
|
27
|
-
e.aspectRatio.value && t.value.forEach((
|
|
28
|
-
|
|
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();
|
|
29
32
|
});
|
|
30
|
-
}),
|
|
33
|
+
}), r.userData.tres__registerCamera = a, r.userData.tres__deregisterCamera = s, U(() => {
|
|
31
34
|
t.value = [];
|
|
32
35
|
}), {
|
|
33
|
-
camera:
|
|
36
|
+
camera: n,
|
|
34
37
|
cameras: t,
|
|
35
|
-
registerCamera:
|
|
36
|
-
deregisterCamera:
|
|
37
|
-
setCameraActive:
|
|
38
|
+
registerCamera: a,
|
|
39
|
+
deregisterCamera: s,
|
|
40
|
+
setCameraActive: o
|
|
38
41
|
};
|
|
39
|
-
},
|
|
40
|
-
let
|
|
41
|
-
const { pause:
|
|
42
|
+
}, fe = L(), de = L(), q = L(), x = new He();
|
|
43
|
+
let V = 0, $ = 0;
|
|
44
|
+
const { pause: it, resume: lt, isActive: ut } = ce(
|
|
42
45
|
() => {
|
|
43
|
-
|
|
46
|
+
fe.trigger({ delta: V, elapsed: $, clock: x }), de.trigger({ delta: V, elapsed: $, clock: x }), q.trigger({ delta: V, elapsed: $, clock: x });
|
|
44
47
|
},
|
|
45
48
|
{ immediate: !1 }
|
|
46
49
|
);
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
q.on(() => {
|
|
51
|
+
V = x.getDelta(), $ = x.getElapsedTime();
|
|
49
52
|
});
|
|
50
|
-
const
|
|
51
|
-
onBeforeLoop:
|
|
52
|
-
onLoop:
|
|
53
|
-
onAfterLoop:
|
|
54
|
-
pause:
|
|
55
|
-
resume:
|
|
56
|
-
isActive:
|
|
57
|
-
}),
|
|
58
|
-
function
|
|
59
|
-
function e(
|
|
60
|
-
console.error(`${
|
|
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 || "");
|
|
61
64
|
}
|
|
62
|
-
function
|
|
63
|
-
console.warn(`${
|
|
65
|
+
function r(n) {
|
|
66
|
+
console.warn(`${re} ${n}`);
|
|
64
67
|
}
|
|
65
|
-
function t(
|
|
68
|
+
function t(n, a) {
|
|
66
69
|
}
|
|
67
70
|
return {
|
|
68
71
|
logError: e,
|
|
69
|
-
logWarning:
|
|
72
|
+
logWarning: r,
|
|
70
73
|
logMessage: t
|
|
71
74
|
};
|
|
72
75
|
}
|
|
73
|
-
function
|
|
74
|
-
return typeof e == "number" ? [e, e, e] : e instanceof
|
|
76
|
+
function er(e) {
|
|
77
|
+
return typeof e == "number" ? [e, e, e] : e instanceof Ne ? [e.x, e.y, e.z] : e;
|
|
75
78
|
}
|
|
76
|
-
function
|
|
77
|
-
return e instanceof
|
|
79
|
+
function ct(e) {
|
|
80
|
+
return e instanceof N ? e : Array.isArray(e) ? new N(...e) : new N(e);
|
|
78
81
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
class ft extends ue.Mesh {
|
|
83
|
+
constructor(...t) {
|
|
84
|
+
super(...t);
|
|
85
|
+
G(this, "type", "HightlightMesh");
|
|
86
|
+
G(this, "createTime");
|
|
87
|
+
this.createTime = Date.now();
|
|
88
|
+
}
|
|
89
|
+
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);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
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) {
|
|
85
100
|
return e && e.nodeType === 1;
|
|
86
101
|
}
|
|
87
102
|
function R(e) {
|
|
88
|
-
return e.replace(/-([a-z])/g, (
|
|
103
|
+
return e.replace(/-([a-z])/g, (r, t) => t.toUpperCase());
|
|
89
104
|
}
|
|
90
|
-
function
|
|
91
|
-
const t = /* @__PURE__ */ Object.create(null),
|
|
92
|
-
for (let
|
|
93
|
-
t[
|
|
94
|
-
return
|
|
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];
|
|
95
110
|
}
|
|
96
|
-
const
|
|
97
|
-
const t = /* @__PURE__ */ new Set(),
|
|
98
|
-
for (const
|
|
99
|
-
const
|
|
100
|
-
t.has(
|
|
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));
|
|
101
116
|
}
|
|
102
|
-
return
|
|
103
|
-
},
|
|
104
|
-
if (!
|
|
117
|
+
return n;
|
|
118
|
+
}, oe = (e, r) => {
|
|
119
|
+
if (!r)
|
|
105
120
|
return;
|
|
106
|
-
const t = Array.isArray(
|
|
107
|
-
return t == null ? void 0 : t.reduce((
|
|
108
|
-
},
|
|
109
|
-
const
|
|
110
|
-
|
|
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);
|
|
111
126
|
};
|
|
112
|
-
function
|
|
113
|
-
if (
|
|
114
|
-
const
|
|
115
|
-
return
|
|
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);
|
|
116
131
|
}
|
|
117
|
-
if (e ===
|
|
132
|
+
if (e === r)
|
|
118
133
|
return !0;
|
|
119
|
-
if (e === null || typeof e != "object" ||
|
|
134
|
+
if (e === null || typeof e != "object" || r === null || typeof r != "object")
|
|
120
135
|
return !1;
|
|
121
|
-
const t = Object.keys(e),
|
|
122
|
-
if (t.length !==
|
|
136
|
+
const t = Object.keys(e), n = Object.keys(r);
|
|
137
|
+
if (t.length !== n.length)
|
|
123
138
|
return !1;
|
|
124
|
-
for (const
|
|
125
|
-
if (!
|
|
139
|
+
for (const a of t)
|
|
140
|
+
if (!n.includes(a) || !ge(e[a], r[a]))
|
|
126
141
|
return !1;
|
|
127
142
|
return !0;
|
|
128
143
|
}
|
|
129
|
-
function
|
|
130
|
-
if (!Array.isArray(e) || !Array.isArray(
|
|
144
|
+
function ht(e, r) {
|
|
145
|
+
if (!Array.isArray(e) || !Array.isArray(r) || e.length !== r.length)
|
|
131
146
|
return !1;
|
|
132
147
|
for (let t = 0; t < e.length; t++)
|
|
133
|
-
if (!
|
|
148
|
+
if (!ge(e[t], r[t]))
|
|
134
149
|
return !1;
|
|
135
150
|
return !0;
|
|
136
151
|
}
|
|
137
|
-
const
|
|
152
|
+
const yt = Array.isArray;
|
|
153
|
+
function _t(e, r, t, n) {
|
|
154
|
+
const a = (l) => {
|
|
155
|
+
if (l.uuid === r)
|
|
156
|
+
return l;
|
|
157
|
+
for (const c of l.children) {
|
|
158
|
+
const m = a(c);
|
|
159
|
+
if (m)
|
|
160
|
+
return m;
|
|
161
|
+
}
|
|
162
|
+
}, s = a(e);
|
|
163
|
+
if (!s) {
|
|
164
|
+
console.warn("Object with UUID not found in the scene.");
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
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]];
|
|
171
|
+
else {
|
|
172
|
+
console.warn(`Property path is not valid: ${t.join(".")}`);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
const i = t[t.length - 1];
|
|
176
|
+
o[i] !== void 0 ? o[i] = n : console.warn(`Property path is not valid: ${t.join(".")}`);
|
|
177
|
+
}
|
|
178
|
+
function wt(e) {
|
|
179
|
+
const r = new Ve({
|
|
180
|
+
color: 11003607,
|
|
181
|
+
// Highlight color, e.g., yellow
|
|
182
|
+
transparent: !0,
|
|
183
|
+
opacity: 0.2,
|
|
184
|
+
depthTest: !1,
|
|
185
|
+
// So the highlight is always visible
|
|
186
|
+
side: $e
|
|
187
|
+
// To e
|
|
188
|
+
});
|
|
189
|
+
return new ft(e.geometry.clone(), r);
|
|
190
|
+
}
|
|
191
|
+
const bt = Number.parseInt(Ue.replace("dev", "")), H = {
|
|
138
192
|
realistic: {
|
|
139
193
|
shadows: !0,
|
|
140
194
|
physicallyCorrectLights: !0,
|
|
141
|
-
outputColorSpace:
|
|
142
|
-
toneMapping:
|
|
195
|
+
outputColorSpace: Fe,
|
|
196
|
+
toneMapping: Ge,
|
|
143
197
|
toneMappingExposure: 3,
|
|
144
198
|
shadowMap: {
|
|
145
199
|
enabled: !0,
|
|
146
|
-
type:
|
|
200
|
+
type: ze
|
|
147
201
|
}
|
|
148
202
|
}
|
|
149
203
|
};
|
|
150
|
-
function
|
|
204
|
+
function Et({
|
|
151
205
|
scene: e,
|
|
152
|
-
canvas:
|
|
206
|
+
canvas: r,
|
|
153
207
|
options: t,
|
|
154
|
-
disableRender:
|
|
155
|
-
contextParts: { sizes:
|
|
208
|
+
disableRender: n,
|
|
209
|
+
contextParts: { sizes: a, camera: s }
|
|
156
210
|
}) {
|
|
157
|
-
const
|
|
158
|
-
alpha:
|
|
159
|
-
depth:
|
|
160
|
-
canvas:
|
|
161
|
-
context:
|
|
162
|
-
stencil:
|
|
163
|
-
antialias:
|
|
164
|
-
precision:
|
|
165
|
-
powerPreference:
|
|
166
|
-
premultipliedAlpha:
|
|
167
|
-
preserveDrawingBuffer:
|
|
168
|
-
logarithmicDepthBuffer:
|
|
169
|
-
failIfMajorPerformanceCaveat:
|
|
170
|
-
})),
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}),
|
|
174
|
-
|
|
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);
|
|
175
229
|
});
|
|
176
|
-
const { pixelRatio: l } =
|
|
177
|
-
|
|
178
|
-
|
|
230
|
+
const { pixelRatio: l } = Ze();
|
|
231
|
+
A(() => {
|
|
232
|
+
i.value.setPixelRatio(l.value);
|
|
179
233
|
});
|
|
180
|
-
const { logError:
|
|
181
|
-
const
|
|
234
|
+
const { logError: c } = j(), f = (() => {
|
|
235
|
+
const d = new z(), y = {
|
|
182
236
|
shadowMap: {
|
|
183
|
-
enabled:
|
|
184
|
-
type:
|
|
237
|
+
enabled: d.shadowMap.enabled,
|
|
238
|
+
type: d.shadowMap.type
|
|
185
239
|
},
|
|
186
|
-
toneMapping:
|
|
187
|
-
toneMappingExposure:
|
|
188
|
-
outputColorSpace:
|
|
240
|
+
toneMapping: d.toneMapping,
|
|
241
|
+
toneMappingExposure: d.toneMappingExposure,
|
|
242
|
+
outputColorSpace: d.outputColorSpace
|
|
189
243
|
};
|
|
190
|
-
return
|
|
244
|
+
return d.dispose(), y;
|
|
191
245
|
})();
|
|
192
|
-
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
const
|
|
196
|
-
const
|
|
197
|
-
if (
|
|
198
|
-
return
|
|
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);
|
|
199
253
|
};
|
|
200
|
-
if (
|
|
201
|
-
return
|
|
202
|
-
const
|
|
203
|
-
return
|
|
204
|
-
},
|
|
205
|
-
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
|
|
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)
|
|
209
263
|
// default clear color is not easily/efficiently retrievable from three
|
|
210
264
|
);
|
|
211
265
|
});
|
|
212
|
-
const { pause: u, resume:
|
|
213
|
-
return
|
|
214
|
-
|
|
215
|
-
}),
|
|
216
|
-
u(),
|
|
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();
|
|
217
271
|
}), {
|
|
218
|
-
renderer:
|
|
272
|
+
renderer: i
|
|
219
273
|
};
|
|
220
274
|
}
|
|
221
|
-
const
|
|
222
|
-
function
|
|
223
|
-
const
|
|
275
|
+
const ae = (e) => typeof e == "function", Ct = (e) => !!e && e.constructor === Array;
|
|
276
|
+
function Mt(e) {
|
|
277
|
+
const r = { nodes: {}, materials: {} };
|
|
224
278
|
return e && e.traverse((t) => {
|
|
225
|
-
t.name && (
|
|
226
|
-
}),
|
|
279
|
+
t.name && (r.nodes[t.name] = t), t.material && !r.materials[t.material.name] && (r.materials[t.material.name] = t.material);
|
|
280
|
+
}), r;
|
|
227
281
|
}
|
|
228
|
-
async function
|
|
229
|
-
const { logError:
|
|
230
|
-
|
|
231
|
-
const l = (Array.isArray(
|
|
232
|
-
(
|
|
233
|
-
|
|
234
|
-
|
|
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,
|
|
235
289
|
(u) => {
|
|
236
|
-
u.scene && Object.assign(u,
|
|
290
|
+
u.scene && Object.assign(u, Mt(u.scene)), m(u);
|
|
237
291
|
},
|
|
238
|
-
|
|
239
|
-
(u) => f(
|
|
292
|
+
n,
|
|
293
|
+
(u) => f(s("[useLoader] - Failed to load resource", u))
|
|
240
294
|
);
|
|
241
295
|
})
|
|
242
296
|
);
|
|
243
|
-
return
|
|
297
|
+
return Ct(r) ? await Promise.all(l) : await l[0];
|
|
244
298
|
}
|
|
245
|
-
async function
|
|
246
|
-
const
|
|
299
|
+
async function rr(e) {
|
|
300
|
+
const r = new We(), t = new Qe(r), n = (a) => new Promise((s, o) => {
|
|
247
301
|
t.load(
|
|
248
|
-
|
|
249
|
-
(
|
|
302
|
+
a,
|
|
303
|
+
(i) => s(i),
|
|
250
304
|
() => null,
|
|
251
305
|
() => {
|
|
252
|
-
|
|
306
|
+
o(new Error("[useTextures] - Failed to load texture"));
|
|
253
307
|
}
|
|
254
308
|
);
|
|
255
309
|
});
|
|
256
|
-
if (
|
|
257
|
-
const
|
|
258
|
-
return e.length > 1 ?
|
|
310
|
+
if (yt(e)) {
|
|
311
|
+
const a = await Promise.all(e.map((s) => n(s)));
|
|
312
|
+
return e.length > 1 ? a : a[0];
|
|
259
313
|
} else {
|
|
260
314
|
const {
|
|
261
|
-
map:
|
|
262
|
-
displacementMap:
|
|
263
|
-
normalMap:
|
|
264
|
-
roughnessMap:
|
|
315
|
+
map: a,
|
|
316
|
+
displacementMap: s,
|
|
317
|
+
normalMap: o,
|
|
318
|
+
roughnessMap: i,
|
|
265
319
|
metalnessMap: l,
|
|
266
|
-
aoMap:
|
|
267
|
-
alphaMap:
|
|
320
|
+
aoMap: c,
|
|
321
|
+
alphaMap: m,
|
|
268
322
|
matcap: f
|
|
269
323
|
} = e;
|
|
270
324
|
return {
|
|
271
|
-
map:
|
|
272
|
-
displacementMap:
|
|
273
|
-
normalMap:
|
|
274
|
-
roughnessMap:
|
|
275
|
-
metalnessMap: l ? await
|
|
276
|
-
aoMap:
|
|
277
|
-
alphaMap:
|
|
278
|
-
matcap: f ? await
|
|
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
|
|
279
333
|
};
|
|
280
334
|
}
|
|
281
335
|
}
|
|
282
|
-
const
|
|
283
|
-
const
|
|
284
|
-
if (
|
|
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)
|
|
285
339
|
return {
|
|
286
|
-
x: (
|
|
287
|
-
y: -((
|
|
340
|
+
x: (v - m.value) / i.value * 2 - 1,
|
|
341
|
+
y: -((b - c.value) / l.value) * 2 + 1
|
|
288
342
|
};
|
|
289
|
-
}, u = ({ x:
|
|
343
|
+
}, u = ({ x: v, y: b }) => {
|
|
290
344
|
if (t.value)
|
|
291
|
-
return
|
|
292
|
-
},
|
|
293
|
-
const
|
|
294
|
-
x: (
|
|
295
|
-
y: (
|
|
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
|
|
296
350
|
});
|
|
297
|
-
return
|
|
298
|
-
},
|
|
299
|
-
|
|
300
|
-
},
|
|
301
|
-
|
|
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);
|
|
302
356
|
};
|
|
303
|
-
let
|
|
304
|
-
const
|
|
305
|
-
var
|
|
306
|
-
|
|
307
|
-
},
|
|
308
|
-
var
|
|
309
|
-
|
|
310
|
-
},
|
|
311
|
-
return
|
|
312
|
-
|
|
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));
|
|
313
367
|
}), {
|
|
314
|
-
intersects:
|
|
315
|
-
onClick: (
|
|
316
|
-
onPointerMove: (
|
|
368
|
+
intersects: _,
|
|
369
|
+
onClick: (v) => d.on(v).off,
|
|
370
|
+
onPointerMove: (v) => y.on(v).off
|
|
317
371
|
};
|
|
318
372
|
};
|
|
319
|
-
function
|
|
320
|
-
const { logWarning: e } =
|
|
321
|
-
function
|
|
373
|
+
function nr() {
|
|
374
|
+
const { logWarning: e } = j();
|
|
375
|
+
function r(s, o, i) {
|
|
322
376
|
let l = null;
|
|
323
|
-
return
|
|
324
|
-
|
|
325
|
-
}), l || e(`Child with ${
|
|
377
|
+
return s.traverse((c) => {
|
|
378
|
+
c[o] === i && (l = c);
|
|
379
|
+
}), l || e(`Child with ${o} '${i}' not found.`), l;
|
|
326
380
|
}
|
|
327
|
-
function t(
|
|
381
|
+
function t(s, o, i) {
|
|
328
382
|
const l = [];
|
|
329
|
-
return
|
|
330
|
-
|
|
331
|
-
}), l.length || e(`Children with ${
|
|
383
|
+
return s.traverse((c) => {
|
|
384
|
+
c[o].includes(i) && l.push(c);
|
|
385
|
+
}), l.length || e(`Children with ${o} '${i}' not found.`), l;
|
|
332
386
|
}
|
|
333
|
-
function
|
|
334
|
-
return
|
|
387
|
+
function n(s, o) {
|
|
388
|
+
return r(s, "name", o);
|
|
335
389
|
}
|
|
336
|
-
function
|
|
337
|
-
return t(
|
|
390
|
+
function a(s, o) {
|
|
391
|
+
return t(s, "name", o);
|
|
338
392
|
}
|
|
339
393
|
return {
|
|
340
|
-
seek:
|
|
341
|
-
seekByName:
|
|
394
|
+
seek: r,
|
|
395
|
+
seekByName: n,
|
|
342
396
|
seekAll: t,
|
|
343
|
-
seekAllByName:
|
|
397
|
+
seekAllByName: a
|
|
344
398
|
};
|
|
345
399
|
}
|
|
346
|
-
const
|
|
347
|
-
const t =
|
|
400
|
+
const St = ({ scene: e, contextParts: r }) => {
|
|
401
|
+
const t = le({
|
|
348
402
|
click: /* @__PURE__ */ new Map(),
|
|
349
403
|
pointerMove: /* @__PURE__ */ new Map(),
|
|
350
404
|
pointerEnter: /* @__PURE__ */ new Map(),
|
|
351
405
|
pointerLeave: /* @__PURE__ */ new Map()
|
|
352
|
-
}),
|
|
353
|
-
|
|
354
|
-
}, o = (u) => {
|
|
355
|
-
r.value.delete(u);
|
|
356
|
-
}, c = (u) => {
|
|
357
|
-
Object.values(t).forEach((v) => v.delete(u)), o(u);
|
|
406
|
+
}), n = B(/* @__PURE__ */ new Set()), a = (u) => {
|
|
407
|
+
n.value.add(u);
|
|
358
408
|
}, s = (u) => {
|
|
359
|
-
|
|
360
|
-
|
|
409
|
+
n.value.delete(u);
|
|
410
|
+
}, o = (u) => {
|
|
411
|
+
Object.values(t).forEach((g) => g.delete(u)), s(u);
|
|
412
|
+
}, 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);
|
|
361
415
|
};
|
|
362
|
-
e.userData.tres__registerAtPointerEventHandler =
|
|
363
|
-
const l =
|
|
364
|
-
() =>
|
|
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(
|
|
365
419
|
[
|
|
366
|
-
...Array.from(
|
|
420
|
+
...Array.from(n.value),
|
|
367
421
|
...Object.values(t).map((u) => Array.from(u.keys())).flat()
|
|
368
422
|
],
|
|
369
423
|
({ uuid: u }) => u
|
|
370
424
|
)
|
|
371
|
-
), { onClick:
|
|
372
|
-
|
|
373
|
-
var
|
|
374
|
-
u.length && ((
|
|
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));
|
|
375
429
|
});
|
|
376
430
|
let f;
|
|
377
|
-
return
|
|
378
|
-
var
|
|
379
|
-
const
|
|
380
|
-
f && 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;
|
|
381
435
|
}), {
|
|
382
|
-
registerObject:
|
|
383
|
-
deregisterObject:
|
|
436
|
+
registerObject: i,
|
|
437
|
+
deregisterObject: o
|
|
384
438
|
};
|
|
385
439
|
};
|
|
386
|
-
function
|
|
387
|
-
let
|
|
440
|
+
function ve(e) {
|
|
441
|
+
let r = 0;
|
|
388
442
|
return e.traverse((t) => {
|
|
389
443
|
if (t.isMesh && t.geometry) {
|
|
390
|
-
const
|
|
391
|
-
|
|
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;
|
|
392
446
|
}
|
|
393
|
-
}),
|
|
447
|
+
}), r;
|
|
448
|
+
}
|
|
449
|
+
function kt(e) {
|
|
450
|
+
return (e / 1024).toFixed(2);
|
|
394
451
|
}
|
|
395
|
-
const
|
|
396
|
-
function
|
|
452
|
+
const J = B({}), X = (e) => Object.assign(J.value, e);
|
|
453
|
+
function Tt({
|
|
397
454
|
scene: e,
|
|
398
|
-
canvas:
|
|
455
|
+
canvas: r,
|
|
399
456
|
windowSize: t,
|
|
400
|
-
disableRender:
|
|
401
|
-
rendererOptions:
|
|
457
|
+
disableRender: n,
|
|
458
|
+
rendererOptions: a
|
|
402
459
|
}) {
|
|
403
|
-
const
|
|
404
|
-
() =>
|
|
405
|
-
),
|
|
406
|
-
height:
|
|
407
|
-
width:
|
|
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 = {
|
|
463
|
+
height: i,
|
|
464
|
+
width: o,
|
|
408
465
|
aspectRatio: l
|
|
409
|
-
},
|
|
466
|
+
}, m = D(e), {
|
|
410
467
|
camera: f,
|
|
411
468
|
cameras: u,
|
|
412
|
-
registerCamera:
|
|
413
|
-
deregisterCamera:
|
|
414
|
-
setCameraActive:
|
|
415
|
-
} =
|
|
469
|
+
registerCamera: g,
|
|
470
|
+
deregisterCamera: _,
|
|
471
|
+
setCameraActive: d
|
|
472
|
+
} = st({ sizes: c, scene: e }), { renderer: y } = Et(
|
|
416
473
|
{
|
|
417
474
|
scene: e,
|
|
418
|
-
canvas:
|
|
419
|
-
options:
|
|
420
|
-
contextParts: { sizes:
|
|
421
|
-
disableRender:
|
|
475
|
+
canvas: r,
|
|
476
|
+
options: a,
|
|
477
|
+
contextParts: { sizes: c, camera: f },
|
|
478
|
+
disableRender: n
|
|
422
479
|
}
|
|
423
|
-
),
|
|
424
|
-
sizes:
|
|
425
|
-
scene:
|
|
480
|
+
), p = {
|
|
481
|
+
sizes: c,
|
|
482
|
+
scene: m,
|
|
426
483
|
camera: f,
|
|
427
|
-
cameras:
|
|
428
|
-
renderer:
|
|
429
|
-
raycaster:
|
|
484
|
+
cameras: Se(u),
|
|
485
|
+
renderer: y,
|
|
486
|
+
raycaster: D(new Je()),
|
|
430
487
|
controls: B(null),
|
|
431
488
|
perf: {
|
|
432
489
|
maxFrames: 160,
|
|
@@ -440,131 +497,136 @@ function mt({
|
|
|
440
497
|
accumulator: []
|
|
441
498
|
}
|
|
442
499
|
},
|
|
443
|
-
extend:
|
|
444
|
-
registerCamera:
|
|
445
|
-
setCameraActive:
|
|
446
|
-
deregisterCamera:
|
|
500
|
+
extend: X,
|
|
501
|
+
registerCamera: g,
|
|
502
|
+
setCameraActive: d,
|
|
503
|
+
deregisterCamera: _
|
|
447
504
|
};
|
|
448
|
-
|
|
449
|
-
const
|
|
450
|
-
let
|
|
451
|
-
const
|
|
452
|
-
|
|
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));
|
|
453
510
|
};
|
|
454
|
-
let
|
|
455
|
-
const
|
|
456
|
-
window.__TRES__DEVTOOLS__ && (
|
|
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));
|
|
457
514
|
}, { immediate: !0 });
|
|
458
|
-
return
|
|
459
|
-
|
|
460
|
-
}),
|
|
515
|
+
return U(() => {
|
|
516
|
+
be();
|
|
517
|
+
}), p;
|
|
461
518
|
}
|
|
462
|
-
function
|
|
463
|
-
const e =
|
|
519
|
+
function Ot() {
|
|
520
|
+
const e = ke("useTres");
|
|
464
521
|
if (!e)
|
|
465
522
|
throw new Error("useTresContext must be used together with useTresContextProvider");
|
|
466
523
|
return e;
|
|
467
524
|
}
|
|
468
|
-
const
|
|
469
|
-
let
|
|
470
|
-
const { logError:
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
525
|
+
const or = Ot;
|
|
526
|
+
let h = null;
|
|
527
|
+
const { logError: se } = j(), W = [
|
|
528
|
+
"onClick",
|
|
529
|
+
"onPointerMove",
|
|
530
|
+
"onPointerEnter",
|
|
531
|
+
"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))
|
|
474
536
|
return null;
|
|
475
|
-
let
|
|
537
|
+
let a = e.replace("Tres", ""), s;
|
|
476
538
|
if (e === "primitive") {
|
|
477
|
-
(
|
|
478
|
-
const l =
|
|
479
|
-
|
|
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 });
|
|
480
542
|
} else {
|
|
481
|
-
const l =
|
|
482
|
-
l ||
|
|
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);
|
|
483
545
|
}
|
|
484
|
-
return
|
|
485
|
-
...
|
|
486
|
-
tres__name:
|
|
487
|
-
},
|
|
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;
|
|
488
550
|
},
|
|
489
|
-
insert(e,
|
|
490
|
-
var
|
|
491
|
-
|
|
492
|
-
const t =
|
|
551
|
+
insert(e, r) {
|
|
552
|
+
var n, a, s, o;
|
|
553
|
+
r && r.isScene && (h = r);
|
|
554
|
+
const t = r || h;
|
|
493
555
|
if (e != null && e.isObject3D) {
|
|
494
556
|
if (e != null && e.isCamera) {
|
|
495
|
-
if (!(
|
|
557
|
+
if (!(h != null && h.userData.tres__registerCamera))
|
|
496
558
|
throw "could not find tres__registerCamera on scene's userData";
|
|
497
|
-
(
|
|
559
|
+
(a = h == null ? void 0 : (n = h.userData).tres__registerCamera) == null || a.call(n, e);
|
|
498
560
|
}
|
|
499
|
-
if (e
|
|
500
|
-
if (!(
|
|
561
|
+
if (e && W.some((i) => e[i])) {
|
|
562
|
+
if (!(h != null && h.userData.tres__registerAtPointerEventHandler))
|
|
501
563
|
throw "could not find tres__registerAtPointerEventHandler on scene's userData";
|
|
502
|
-
(
|
|
564
|
+
(o = h == null ? void 0 : (s = h.userData).tres__registerAtPointerEventHandler) == null || o.call(s, e);
|
|
503
565
|
}
|
|
504
566
|
}
|
|
505
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));
|
|
506
568
|
},
|
|
507
569
|
remove(e) {
|
|
508
|
-
var
|
|
570
|
+
var r, t;
|
|
509
571
|
if (e) {
|
|
510
572
|
if (e.isObject3D) {
|
|
511
|
-
const
|
|
573
|
+
const n = e, a = (c) => {
|
|
512
574
|
var f, u;
|
|
513
|
-
const
|
|
514
|
-
|
|
515
|
-
},
|
|
516
|
-
var
|
|
517
|
-
if (!
|
|
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)
|
|
518
580
|
throw "could not find tres__deregisterBlockingObjectAtPointerEventHandler on scene's userData";
|
|
519
|
-
if ((f =
|
|
581
|
+
if ((f = h == null ? void 0 : (m = h.userData).tres__deregisterBlockingObjectAtPointerEventHandler) == null || f.call(m, c), !s)
|
|
520
582
|
throw "could not find tres__deregisterAtPointerEventHandler on scene's userData";
|
|
521
|
-
|
|
522
|
-
}, l = (
|
|
523
|
-
const
|
|
524
|
-
if (!
|
|
583
|
+
c && W.some((u) => c[u]) && (s == null || s(c));
|
|
584
|
+
}, l = (c) => {
|
|
585
|
+
const m = h == null ? void 0 : h.userData.tres__deregisterCamera;
|
|
586
|
+
if (!m)
|
|
525
587
|
throw "could not find tres__deregisterCamera on scene's userData";
|
|
526
|
-
|
|
588
|
+
c.isCamera && (m == null || m(c));
|
|
527
589
|
};
|
|
528
|
-
(
|
|
529
|
-
|
|
530
|
-
}), n
|
|
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);
|
|
531
593
|
}
|
|
532
594
|
(t = e.dispose) == null || t.call(e);
|
|
533
595
|
}
|
|
534
596
|
},
|
|
535
|
-
patchProp(e,
|
|
536
|
-
var
|
|
597
|
+
patchProp(e, r, t, n) {
|
|
598
|
+
var a, s, o, i;
|
|
537
599
|
if (e) {
|
|
538
|
-
let l = e,
|
|
539
|
-
if (e.isObject3D &&
|
|
540
|
-
|
|
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);
|
|
541
603
|
return;
|
|
542
604
|
}
|
|
543
|
-
let
|
|
544
|
-
if (
|
|
545
|
-
const
|
|
546
|
-
|
|
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)));
|
|
547
609
|
return;
|
|
548
610
|
}
|
|
549
611
|
if (l.type === "BufferGeometry") {
|
|
550
|
-
if (
|
|
612
|
+
if (c === "args")
|
|
551
613
|
return;
|
|
552
614
|
l.setAttribute(
|
|
553
|
-
R(
|
|
554
|
-
new
|
|
615
|
+
R(c),
|
|
616
|
+
new Ke(...n)
|
|
555
617
|
);
|
|
556
618
|
return;
|
|
557
619
|
}
|
|
558
|
-
if (
|
|
559
|
-
const
|
|
560
|
-
f =
|
|
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));
|
|
561
623
|
}
|
|
562
|
-
let u =
|
|
563
|
-
if (u === "" && (u = !0),
|
|
564
|
-
Array.isArray(u) ? e[
|
|
624
|
+
let u = n;
|
|
625
|
+
if (u === "" && (u = !0), ae(f)) {
|
|
626
|
+
W.includes(r) || (Array.isArray(u) ? e[m](...u) : e[m](u));
|
|
565
627
|
return;
|
|
566
628
|
}
|
|
567
|
-
!(f != null && f.set) && !
|
|
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);
|
|
568
630
|
}
|
|
569
631
|
},
|
|
570
632
|
parentNode(e) {
|
|
@@ -579,9 +641,288 @@ const { logError: te } = x(), dt = {
|
|
|
579
641
|
setScopeId: () => void 0,
|
|
580
642
|
cloneNode: () => void 0,
|
|
581
643
|
insertStaticContent: () => void 0
|
|
582
|
-
}, { render:
|
|
583
|
-
|
|
584
|
-
|
|
644
|
+
}, { render: xt } = Te(At);
|
|
645
|
+
X(ue);
|
|
646
|
+
function Dt() {
|
|
647
|
+
return he().__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
|
648
|
+
}
|
|
649
|
+
function he() {
|
|
650
|
+
return typeof navigator < "u" && typeof window < "u" ? window : typeof global < "u" ? global : {};
|
|
651
|
+
}
|
|
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;
|
|
657
|
+
}
|
|
658
|
+
function Rt() {
|
|
659
|
+
return It() ? K.now() : Date.now();
|
|
660
|
+
}
|
|
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;
|
|
669
|
+
}
|
|
670
|
+
const a = `__vue-devtools-plugin-settings__${r.id}`;
|
|
671
|
+
let s = Object.assign({}, n);
|
|
672
|
+
try {
|
|
673
|
+
const o = localStorage.getItem(a), i = JSON.parse(o);
|
|
674
|
+
Object.assign(s, i);
|
|
675
|
+
} catch {
|
|
676
|
+
}
|
|
677
|
+
this.fallbacks = {
|
|
678
|
+
getSettings() {
|
|
679
|
+
return s;
|
|
680
|
+
},
|
|
681
|
+
setSettings(o) {
|
|
682
|
+
try {
|
|
683
|
+
localStorage.setItem(a, JSON.stringify(o));
|
|
684
|
+
} catch {
|
|
685
|
+
}
|
|
686
|
+
s = o;
|
|
687
|
+
},
|
|
688
|
+
now() {
|
|
689
|
+
return Rt();
|
|
690
|
+
}
|
|
691
|
+
}, t && t.on(jt, (o, i) => {
|
|
692
|
+
o === this.plugin.id && this.fallbacks.setSettings(i);
|
|
693
|
+
}), this.proxiedOn = new Proxy({}, {
|
|
694
|
+
get: (o, i) => this.target ? this.target.on[i] : (...l) => {
|
|
695
|
+
this.onQueue.push({
|
|
696
|
+
method: i,
|
|
697
|
+
args: l
|
|
698
|
+
});
|
|
699
|
+
}
|
|
700
|
+
}), 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,
|
|
703
|
+
args: l,
|
|
704
|
+
resolve: () => {
|
|
705
|
+
}
|
|
706
|
+
}), this.fallbacks[i](...l)) : (...l) => new Promise((c) => {
|
|
707
|
+
this.targetQueue.push({
|
|
708
|
+
method: i,
|
|
709
|
+
args: l,
|
|
710
|
+
resolve: c
|
|
711
|
+
});
|
|
712
|
+
})
|
|
713
|
+
});
|
|
714
|
+
}
|
|
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));
|
|
721
|
+
}
|
|
722
|
+
}
|
|
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);
|
|
727
|
+
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);
|
|
734
|
+
}
|
|
735
|
+
}
|
|
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);
|
|
739
|
+
}
|
|
740
|
+
const ye = (e) => {
|
|
741
|
+
const r = {
|
|
742
|
+
id: e.uuid,
|
|
743
|
+
label: e.type,
|
|
744
|
+
children: [],
|
|
745
|
+
tags: []
|
|
746
|
+
};
|
|
747
|
+
e.name !== "" && r.tags.push({
|
|
748
|
+
label: e.name,
|
|
749
|
+
textColor: 5750629,
|
|
750
|
+
backgroundColor: 15793395
|
|
751
|
+
});
|
|
752
|
+
const t = ve(e);
|
|
753
|
+
return t > 0 && r.tags.push({
|
|
754
|
+
label: `${kt(t)} KB`,
|
|
755
|
+
textColor: 15707189,
|
|
756
|
+
backgroundColor: 16775644,
|
|
757
|
+
tooltip: "Memory usage"
|
|
758
|
+
}), e.type.includes("Light") && (r.tags.push({
|
|
759
|
+
label: `${e.intensity}`,
|
|
760
|
+
textColor: 9738662,
|
|
761
|
+
backgroundColor: 16316922,
|
|
762
|
+
tooltip: "Intensity"
|
|
763
|
+
}), r.tags.push({
|
|
764
|
+
label: `#${e.color.getHexString()}`,
|
|
765
|
+
textColor: 9738662,
|
|
766
|
+
backgroundColor: 16316922,
|
|
767
|
+
tooltip: "Color"
|
|
768
|
+
})), e.type.includes("Camera") && (r.tags.push({
|
|
769
|
+
label: `${e.fov}°`,
|
|
770
|
+
textColor: 9738662,
|
|
771
|
+
backgroundColor: 16316922,
|
|
772
|
+
tooltip: "Field of view"
|
|
773
|
+
}), r.tags.push({
|
|
774
|
+
// 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)}`,
|
|
776
|
+
textColor: 9738662,
|
|
777
|
+
backgroundColor: 16316922,
|
|
778
|
+
tooltip: "Position"
|
|
779
|
+
})), r;
|
|
780
|
+
};
|
|
781
|
+
function _e(e, r) {
|
|
782
|
+
e.children.forEach((t) => {
|
|
783
|
+
if (t.type === "HightlightMesh")
|
|
784
|
+
return;
|
|
785
|
+
const n = ye(t);
|
|
786
|
+
r.children.push(n), _e(t, n);
|
|
787
|
+
});
|
|
788
|
+
}
|
|
789
|
+
const $t = [], O = "tres:inspector", Ut = le({
|
|
790
|
+
sceneGraph: null
|
|
791
|
+
});
|
|
792
|
+
function Ft(e, r) {
|
|
793
|
+
Nt(
|
|
794
|
+
{
|
|
795
|
+
id: "dev.esm.tres",
|
|
796
|
+
label: "TresJS 🪐",
|
|
797
|
+
logo: "https://raw.githubusercontent.com/Tresjs/tres/main/public/favicon.svg",
|
|
798
|
+
packageName: "tresjs",
|
|
799
|
+
homepage: "https://tresjs.org",
|
|
800
|
+
componentStateTypes: $t,
|
|
801
|
+
app: e
|
|
802
|
+
},
|
|
803
|
+
(t) => {
|
|
804
|
+
typeof t.now != "function" && Vt(
|
|
805
|
+
// eslint-disable-next-line max-len
|
|
806
|
+
"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,
|
|
809
|
+
label: "TresJS 🪐",
|
|
810
|
+
icon: "account_tree",
|
|
811
|
+
treeFilterPlaceholder: "Search instances"
|
|
812
|
+
}), setInterval(() => {
|
|
813
|
+
t.sendInspectorTree(O);
|
|
814
|
+
}, 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];
|
|
820
|
+
}
|
|
821
|
+
});
|
|
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)
|
|
827
|
+
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;
|
|
831
|
+
}
|
|
832
|
+
s.state = {
|
|
833
|
+
object: [
|
|
834
|
+
{
|
|
835
|
+
key: "uuid",
|
|
836
|
+
editable: !0,
|
|
837
|
+
value: o.uuid
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
key: "name",
|
|
841
|
+
editable: !0,
|
|
842
|
+
value: o.name
|
|
843
|
+
},
|
|
844
|
+
{
|
|
845
|
+
key: "type",
|
|
846
|
+
editable: !0,
|
|
847
|
+
value: o.type
|
|
848
|
+
},
|
|
849
|
+
{
|
|
850
|
+
key: "position",
|
|
851
|
+
editable: !0,
|
|
852
|
+
value: o.position
|
|
853
|
+
},
|
|
854
|
+
{
|
|
855
|
+
key: "rotation",
|
|
856
|
+
editable: !0,
|
|
857
|
+
value: o.rotation
|
|
858
|
+
},
|
|
859
|
+
{
|
|
860
|
+
key: "scale",
|
|
861
|
+
editable: !0,
|
|
862
|
+
value: o.scale
|
|
863
|
+
},
|
|
864
|
+
{
|
|
865
|
+
key: "geometry",
|
|
866
|
+
value: o.geometry
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
key: "material",
|
|
870
|
+
value: o.material
|
|
871
|
+
},
|
|
872
|
+
{
|
|
873
|
+
key: "color",
|
|
874
|
+
editable: !0,
|
|
875
|
+
value: o.color
|
|
876
|
+
},
|
|
877
|
+
{
|
|
878
|
+
key: "intensity",
|
|
879
|
+
editable: !0,
|
|
880
|
+
value: o.intensity
|
|
881
|
+
},
|
|
882
|
+
{
|
|
883
|
+
key: "castShadow",
|
|
884
|
+
editable: !0,
|
|
885
|
+
value: o.castShadow
|
|
886
|
+
},
|
|
887
|
+
{
|
|
888
|
+
key: "receiveShadow",
|
|
889
|
+
editable: !0,
|
|
890
|
+
value: o.receiveShadow
|
|
891
|
+
},
|
|
892
|
+
{
|
|
893
|
+
key: "frustumCulled",
|
|
894
|
+
editable: !0,
|
|
895
|
+
value: o.frustumCulled
|
|
896
|
+
},
|
|
897
|
+
{
|
|
898
|
+
key: "matrixAutoUpdate",
|
|
899
|
+
editable: !0,
|
|
900
|
+
value: o.matrixAutoUpdate
|
|
901
|
+
},
|
|
902
|
+
{
|
|
903
|
+
key: "matrixWorldNeedsUpdate",
|
|
904
|
+
editable: !0,
|
|
905
|
+
value: o.matrixWorldNeedsUpdate
|
|
906
|
+
},
|
|
907
|
+
{
|
|
908
|
+
key: "matrixWorld",
|
|
909
|
+
value: o.matrixWorld
|
|
910
|
+
},
|
|
911
|
+
{
|
|
912
|
+
key: "visible",
|
|
913
|
+
editable: !0,
|
|
914
|
+
value: o.visible
|
|
915
|
+
}
|
|
916
|
+
]
|
|
917
|
+
};
|
|
918
|
+
}
|
|
919
|
+
}), t.on.editInspectorState((s) => {
|
|
920
|
+
s.inspectorId === O && _t(r.scene.value, s.nodeId, s.path, s.state.value);
|
|
921
|
+
});
|
|
922
|
+
}
|
|
923
|
+
);
|
|
924
|
+
}
|
|
925
|
+
const Gt = ["data-scene"], zt = /* @__PURE__ */ Z({
|
|
585
926
|
__name: "TresCanvas",
|
|
586
927
|
props: {
|
|
587
928
|
shadows: { type: Boolean, default: void 0 },
|
|
@@ -607,107 +948,107 @@ const gt = ["data-scene"], yt = /* @__PURE__ */ q({
|
|
|
607
948
|
logarithmicDepthBuffer: { type: Boolean, default: void 0 },
|
|
608
949
|
failIfMajorPerformanceCaveat: { type: Boolean, default: void 0 }
|
|
609
950
|
},
|
|
610
|
-
setup(e, { expose:
|
|
611
|
-
var
|
|
612
|
-
const t = e, { logWarning:
|
|
951
|
+
setup(e, { expose: r }) {
|
|
952
|
+
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({
|
|
613
954
|
setup() {
|
|
614
|
-
var
|
|
615
|
-
const
|
|
616
|
-
return
|
|
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() : []);
|
|
617
958
|
}
|
|
618
|
-
}),
|
|
619
|
-
const
|
|
620
|
-
|
|
621
|
-
}, f = (
|
|
622
|
-
|
|
623
|
-
}, u =
|
|
624
|
-
return
|
|
625
|
-
const
|
|
626
|
-
|
|
627
|
-
scene:
|
|
628
|
-
canvas:
|
|
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,
|
|
629
970
|
windowSize: t.windowSize,
|
|
630
971
|
disableRender: u,
|
|
631
972
|
rendererOptions: t
|
|
632
|
-
}),
|
|
633
|
-
const { registerCamera:
|
|
634
|
-
|
|
635
|
-
const
|
|
636
|
-
const
|
|
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(
|
|
637
978
|
45,
|
|
638
979
|
window.innerWidth / window.innerHeight,
|
|
639
980
|
0.1,
|
|
640
981
|
1e3
|
|
641
982
|
);
|
|
642
|
-
|
|
643
|
-
const
|
|
644
|
-
|
|
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());
|
|
645
986
|
});
|
|
646
987
|
};
|
|
647
|
-
|
|
988
|
+
ie(
|
|
648
989
|
() => t.camera,
|
|
649
|
-
(
|
|
650
|
-
|
|
990
|
+
(w, S) => {
|
|
991
|
+
w && y(w), S && (S.removeFromParent(), M(S));
|
|
651
992
|
},
|
|
652
993
|
{
|
|
653
994
|
immediate: !0
|
|
654
995
|
}
|
|
655
|
-
),
|
|
996
|
+
), p.value || (n(
|
|
656
997
|
"No camera found. Creating a default perspective camera. To have full control over a camera, please add one to the scene."
|
|
657
|
-
),
|
|
658
|
-
}), (
|
|
998
|
+
), P());
|
|
999
|
+
}), (d, y) => (xe(), De("canvas", {
|
|
659
1000
|
ref_key: "canvas",
|
|
660
|
-
ref:
|
|
661
|
-
"data-scene":
|
|
662
|
-
class:
|
|
663
|
-
style:
|
|
1001
|
+
ref: a,
|
|
1002
|
+
"data-scene": s.value.uuid,
|
|
1003
|
+
class: Le(d.$attrs.class),
|
|
1004
|
+
style: Be({
|
|
664
1005
|
display: "block",
|
|
665
1006
|
width: "100%",
|
|
666
1007
|
height: "100%",
|
|
667
|
-
position:
|
|
1008
|
+
position: d.windowSize ? "fixed" : "relative",
|
|
668
1009
|
top: 0,
|
|
669
1010
|
left: 0,
|
|
670
1011
|
pointerEvents: "auto",
|
|
671
1012
|
touchAction: "none",
|
|
672
|
-
...
|
|
1013
|
+
...d.$attrs.style
|
|
673
1014
|
})
|
|
674
|
-
}, null, 14,
|
|
1015
|
+
}, null, 14, Gt));
|
|
675
1016
|
}
|
|
676
|
-
}),
|
|
1017
|
+
}), Wt = [
|
|
677
1018
|
"TresCanvas",
|
|
678
1019
|
"TresLeches",
|
|
679
1020
|
"TresScene"
|
|
680
|
-
],
|
|
1021
|
+
], Qt = {
|
|
681
1022
|
template: {
|
|
682
1023
|
compilerOptions: {
|
|
683
|
-
isCustomElement: (e) => e.startsWith("Tres") && !
|
|
1024
|
+
isCustomElement: (e) => e.startsWith("Tres") && !Wt.includes(e) || e === "primitive"
|
|
684
1025
|
}
|
|
685
1026
|
}
|
|
686
|
-
},
|
|
1027
|
+
}, ar = Qt, sr = {
|
|
687
1028
|
install(e) {
|
|
688
|
-
e.component("TresCanvas",
|
|
1029
|
+
e.component("TresCanvas", zt);
|
|
689
1030
|
}
|
|
690
1031
|
};
|
|
691
1032
|
export {
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
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
|
|
713
1054
|
};
|