@tresjs/core 3.0.1 → 3.1.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/dist/components/TresCanvas.vue.d.ts +85 -139
- package/dist/composables/useCamera/index.d.ts +2 -3198
- package/dist/composables/useRenderer/index.d.ts +4 -4
- package/dist/composables/useTresContextProvider/index.d.ts +3 -3
- package/dist/core/renderer.d.ts +2 -6
- package/dist/tres.js +386 -366
- package/dist/tres.umd.cjs +2 -2
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/test-utils.d.ts +1 -0
- package/package.json +25 -25
package/dist/tres.js
CHANGED
|
@@ -1,475 +1,504 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name: @tresjs/core
|
|
3
|
-
* version: v3.0.
|
|
3
|
+
* version: v3.1.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
|
-
import {
|
|
9
|
-
import * as
|
|
10
|
-
import { PerspectiveCamera as W, OrthographicCamera as
|
|
11
|
-
import { createEventHook as
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const u = t.value.filter(({ uuid: c }) => c !== s.uuid);
|
|
24
|
-
t.value = [s, ...u];
|
|
8
|
+
import { computed as M, ref as j, watchEffect as O, triggerRef as G, shallowRef as I, watch as V, onUnmounted as se, watchPostEffect as ie, reactive as ue, readonly as le, provide as Q, inject as ce, createRenderer as fe, defineComponent as q, useSlots as me, h as U, Fragment as pe, openBlock as ve, createElementBlock as de, normalizeStyle as ge } from "vue";
|
|
9
|
+
import * as ye from "three";
|
|
10
|
+
import { PerspectiveCamera as W, OrthographicCamera as we, Camera as Ce, Clock as Pe, SRGBColorSpace as Me, ACESFilmicToneMapping as _e, PCFSoftShadowMap as Ee, Vector3 as Le, Color as B, WebGLRenderer as z, LoadingManager as xe, TextureLoader as Ae, Vector2 as he, Raycaster as ke, BufferAttribute as be, Scene as Te } from "three";
|
|
11
|
+
import { createEventHook as k, useRafFn as De, toValue as g, unrefElement as Se, useDevicePixelRatio as Oe, usePointer as Be, useElementBounding as Re, useWindowSize as Fe, useElementSize as je } from "@vueuse/core";
|
|
12
|
+
const ze = ({ sizes: e, scene: n }) => {
|
|
13
|
+
var s, u;
|
|
14
|
+
const t = M(() => n.value.children.filter((l) => l.isCamera)), a = j(((u = (s = t.value) == null ? void 0 : s[0]) == null ? void 0 : u.uuid) ?? ""), r = M(
|
|
15
|
+
() => t.value.find((l) => l.uuid === a.value) ?? t.value.at(0)
|
|
16
|
+
), i = (l, c = !1) => {
|
|
17
|
+
t.value.some(({ uuid: p }) => p === l.uuid) || (n.value.add(l), G(n), c && o(l));
|
|
18
|
+
}, f = (l) => {
|
|
19
|
+
n.value.remove(l), G(n);
|
|
20
|
+
}, o = (l) => {
|
|
21
|
+
const c = l instanceof Ce ? l.uuid : l;
|
|
22
|
+
c && (a.value = c);
|
|
25
23
|
};
|
|
26
|
-
return
|
|
27
|
-
e.aspectRatio.value && t.value.forEach((
|
|
28
|
-
|
|
24
|
+
return O(() => {
|
|
25
|
+
e.aspectRatio.value && t.value.forEach((l) => {
|
|
26
|
+
l instanceof W && (l.aspect = e.aspectRatio.value), (l instanceof W || l instanceof we) && l.updateProjectionMatrix();
|
|
29
27
|
});
|
|
30
|
-
}),
|
|
31
|
-
|
|
32
|
-
}), {
|
|
33
|
-
camera: n,
|
|
28
|
+
}), n.value.userData.tres__registerCamera = i, n.value.userData.tres__deregisterCamera = f, {
|
|
29
|
+
camera: r,
|
|
34
30
|
cameras: t,
|
|
35
|
-
addCamera:
|
|
36
|
-
removeCamera:
|
|
37
|
-
setCameraActive:
|
|
31
|
+
addCamera: i,
|
|
32
|
+
removeCamera: f,
|
|
33
|
+
setCameraActive: o
|
|
38
34
|
};
|
|
39
|
-
},
|
|
35
|
+
}, Z = k(), ee = k(), N = k(), h = new Pe();
|
|
40
36
|
let R = 0, F = 0;
|
|
41
|
-
const { pause:
|
|
37
|
+
const { pause: He, resume: Ge, isActive: Ve } = De(
|
|
42
38
|
() => {
|
|
43
|
-
|
|
39
|
+
Z.trigger({ delta: R, elapsed: F, clock: h }), ee.trigger({ delta: R, elapsed: F, clock: h }), N.trigger({ delta: R, elapsed: F, clock: h });
|
|
44
40
|
},
|
|
45
41
|
{ immediate: !1 }
|
|
46
42
|
);
|
|
47
|
-
|
|
48
|
-
R =
|
|
43
|
+
N.on(() => {
|
|
44
|
+
R = h.getDelta(), F = h.getElapsedTime();
|
|
49
45
|
});
|
|
50
|
-
const
|
|
51
|
-
onBeforeLoop:
|
|
52
|
-
onLoop:
|
|
53
|
-
onAfterLoop:
|
|
54
|
-
pause:
|
|
55
|
-
resume:
|
|
56
|
-
isActive:
|
|
57
|
-
}),
|
|
46
|
+
const te = () => ({
|
|
47
|
+
onBeforeLoop: Z.on,
|
|
48
|
+
onLoop: ee.on,
|
|
49
|
+
onAfterLoop: N.on,
|
|
50
|
+
pause: He,
|
|
51
|
+
resume: Ge,
|
|
52
|
+
isActive: Ve
|
|
53
|
+
}), D = {
|
|
58
54
|
realistic: {
|
|
59
|
-
outputColorSpace:
|
|
60
|
-
toneMapping:
|
|
55
|
+
outputColorSpace: Me,
|
|
56
|
+
toneMapping: _e,
|
|
61
57
|
toneMappingExposure: 3,
|
|
62
58
|
shadowMap: {
|
|
63
59
|
enabled: !0,
|
|
64
|
-
type:
|
|
60
|
+
type: Ee
|
|
65
61
|
}
|
|
66
62
|
}
|
|
67
|
-
},
|
|
68
|
-
for (const t of Object.keys(
|
|
69
|
-
|
|
70
|
-
return Object.assign(e || {},
|
|
71
|
-
},
|
|
72
|
-
function
|
|
73
|
-
return e.replace(/-([a-z])/g, (
|
|
63
|
+
}, re = (e, n) => {
|
|
64
|
+
for (const t of Object.keys(n))
|
|
65
|
+
n[t] instanceof Object && Object.assign(n[t], re(e[t], n[t]));
|
|
66
|
+
return Object.assign(e || {}, n), e;
|
|
67
|
+
}, We = "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", $e = /* @__PURE__ */ Ie(We);
|
|
68
|
+
function S(e) {
|
|
69
|
+
return e.replace(/-([a-z])/g, (n, t) => t.toUpperCase());
|
|
74
70
|
}
|
|
75
|
-
function
|
|
76
|
-
const t = /* @__PURE__ */ Object.create(null),
|
|
77
|
-
for (let r = 0; r <
|
|
78
|
-
t[
|
|
79
|
-
return
|
|
71
|
+
function Ie(e, n) {
|
|
72
|
+
const t = /* @__PURE__ */ Object.create(null), a = e.split(",");
|
|
73
|
+
for (let r = 0; r < a.length; r++)
|
|
74
|
+
t[a[r]] = !0;
|
|
75
|
+
return n ? (r) => !!t[r.toLowerCase()] : (r) => !!t[r];
|
|
80
76
|
}
|
|
81
|
-
const
|
|
82
|
-
const t = /* @__PURE__ */ new Set(),
|
|
77
|
+
const Ne = (e, n) => {
|
|
78
|
+
const t = /* @__PURE__ */ new Set(), a = [];
|
|
83
79
|
for (const r of e) {
|
|
84
|
-
const i =
|
|
85
|
-
t.has(i) || (t.add(i),
|
|
80
|
+
const i = n(r);
|
|
81
|
+
t.has(i) || (t.add(i), a.push(r));
|
|
86
82
|
}
|
|
87
|
-
return
|
|
88
|
-
},
|
|
89
|
-
if (!
|
|
83
|
+
return a;
|
|
84
|
+
}, J = (e, n) => {
|
|
85
|
+
if (!n)
|
|
90
86
|
return;
|
|
91
|
-
const t = Array.isArray(
|
|
92
|
-
return t == null ? void 0 : t.reduce((
|
|
93
|
-
},
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
function
|
|
98
|
-
|
|
99
|
-
|
|
87
|
+
const t = Array.isArray(n) ? n : n.match(/([^[.\]])+/g);
|
|
88
|
+
return t == null ? void 0 : t.reduce((a, r) => a && a[r], e);
|
|
89
|
+
}, qe = (e, n, t) => {
|
|
90
|
+
const a = Array.isArray(n) ? n : n.match(/([^[.\]])+/g);
|
|
91
|
+
a && a.reduce((r, i, f) => (r[i] === void 0 && (r[i] = {}), f === a.length - 1 && (r[i] = t), r[i]), e);
|
|
92
|
+
};
|
|
93
|
+
function ne(e, n) {
|
|
94
|
+
if (e === n)
|
|
95
|
+
return !0;
|
|
96
|
+
if (e === null || typeof e != "object" || n === null || typeof n != "object")
|
|
97
|
+
return !1;
|
|
98
|
+
const t = Object.keys(e), a = Object.keys(n);
|
|
99
|
+
if (t.length !== a.length)
|
|
100
|
+
return !1;
|
|
101
|
+
for (const r of t)
|
|
102
|
+
if (!a.includes(r) || !ne(e[r], n[r]))
|
|
103
|
+
return !1;
|
|
104
|
+
return !0;
|
|
105
|
+
}
|
|
106
|
+
function Ue(e, n) {
|
|
107
|
+
if (!Array.isArray(e) || !Array.isArray(n) || e.length !== n.length)
|
|
108
|
+
return !1;
|
|
109
|
+
for (let t = 0; t < e.length; t++)
|
|
110
|
+
if (!ne(e[t], n[t]))
|
|
111
|
+
return !1;
|
|
112
|
+
return !0;
|
|
113
|
+
}
|
|
114
|
+
const ct = !0, K = "[TresJS ▲ ■ ●] ";
|
|
115
|
+
function b() {
|
|
116
|
+
function e(a, r) {
|
|
117
|
+
console.error(`${K} ${a}`, r || "");
|
|
100
118
|
}
|
|
101
|
-
function a
|
|
102
|
-
console.warn(`${
|
|
119
|
+
function n(a) {
|
|
120
|
+
console.warn(`${K} ${a}`);
|
|
103
121
|
}
|
|
104
|
-
function t(
|
|
122
|
+
function t(a, r) {
|
|
105
123
|
}
|
|
106
124
|
return {
|
|
107
125
|
logError: e,
|
|
108
|
-
logWarning:
|
|
126
|
+
logWarning: n,
|
|
109
127
|
logMessage: t
|
|
110
128
|
};
|
|
111
129
|
}
|
|
112
|
-
function
|
|
113
|
-
return typeof e == "number" ? [e, e, e] : e instanceof
|
|
130
|
+
function ft(e) {
|
|
131
|
+
return typeof e == "number" ? [e, e, e] : e instanceof Le ? [e.x, e.y, e.z] : e;
|
|
114
132
|
}
|
|
115
|
-
function
|
|
116
|
-
return e instanceof
|
|
133
|
+
function Je(e) {
|
|
134
|
+
return e instanceof B ? e : Array.isArray(e) ? new B(...e) : new B(e);
|
|
117
135
|
}
|
|
118
|
-
function
|
|
136
|
+
function Ke({
|
|
119
137
|
scene: e,
|
|
120
|
-
canvas:
|
|
138
|
+
canvas: n,
|
|
121
139
|
options: t,
|
|
122
|
-
disableRender:
|
|
140
|
+
disableRender: a,
|
|
123
141
|
contextParts: { sizes: r, camera: i }
|
|
124
142
|
}) {
|
|
125
|
-
const
|
|
126
|
-
alpha:
|
|
127
|
-
depth:
|
|
128
|
-
canvas:
|
|
129
|
-
context:
|
|
130
|
-
stencil:
|
|
131
|
-
antialias:
|
|
143
|
+
const f = M(() => ({
|
|
144
|
+
alpha: g(t.alpha),
|
|
145
|
+
depth: g(t.depth),
|
|
146
|
+
canvas: Se(n),
|
|
147
|
+
context: g(t.context),
|
|
148
|
+
stencil: g(t.stencil),
|
|
149
|
+
antialias: g(t.antialias) === void 0 ? (
|
|
132
150
|
// an opinionated default of tres
|
|
133
151
|
!0
|
|
134
|
-
) :
|
|
135
|
-
precision:
|
|
136
|
-
powerPreference:
|
|
137
|
-
premultipliedAlpha:
|
|
138
|
-
preserveDrawingBuffer:
|
|
139
|
-
logarithmicDepthBuffer:
|
|
140
|
-
failIfMajorPerformanceCaveat:
|
|
141
|
-
})), o =
|
|
142
|
-
|
|
143
|
-
o.value.dispose(), o.value = new
|
|
144
|
-
}),
|
|
152
|
+
) : g(t.antialias),
|
|
153
|
+
precision: g(t.precision),
|
|
154
|
+
powerPreference: g(t.powerPreference),
|
|
155
|
+
premultipliedAlpha: g(t.premultipliedAlpha),
|
|
156
|
+
preserveDrawingBuffer: g(t.preserveDrawingBuffer),
|
|
157
|
+
logarithmicDepthBuffer: g(t.logarithmicDepthBuffer),
|
|
158
|
+
failIfMajorPerformanceCaveat: g(t.failIfMajorPerformanceCaveat)
|
|
159
|
+
})), o = I(new z(f.value));
|
|
160
|
+
V(f, () => {
|
|
161
|
+
o.value.dispose(), o.value = new z(f.value);
|
|
162
|
+
}), O(() => {
|
|
145
163
|
o.value.setSize(r.width.value, r.height.value);
|
|
146
164
|
});
|
|
147
|
-
const { pixelRatio: s } =
|
|
148
|
-
|
|
165
|
+
const { pixelRatio: s } = Oe();
|
|
166
|
+
O(() => {
|
|
149
167
|
o.value.setPixelRatio(s.value);
|
|
150
168
|
});
|
|
151
|
-
const { logError: u } =
|
|
152
|
-
const
|
|
169
|
+
const { logError: u } = b(), c = (() => {
|
|
170
|
+
const v = new z(), C = {
|
|
153
171
|
shadowMap: {
|
|
154
|
-
enabled:
|
|
155
|
-
type:
|
|
172
|
+
enabled: v.shadowMap.enabled,
|
|
173
|
+
type: v.shadowMap.type
|
|
156
174
|
},
|
|
157
|
-
toneMapping:
|
|
158
|
-
toneMappingExposure:
|
|
159
|
-
outputColorSpace:
|
|
160
|
-
useLegacyLights:
|
|
175
|
+
toneMapping: v.toneMapping,
|
|
176
|
+
toneMappingExposure: v.toneMappingExposure,
|
|
177
|
+
outputColorSpace: v.outputColorSpace,
|
|
178
|
+
useLegacyLights: v.useLegacyLights
|
|
161
179
|
};
|
|
162
|
-
return
|
|
180
|
+
return v.dispose(), C;
|
|
163
181
|
})();
|
|
164
|
-
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
const
|
|
168
|
-
const
|
|
169
|
-
if (
|
|
170
|
-
return
|
|
182
|
+
O(() => {
|
|
183
|
+
const v = g(t.preset);
|
|
184
|
+
v && (v in D || u("Renderer Preset must be one of these: " + Object.keys(D).join(", ")), re(o.value, D[v]));
|
|
185
|
+
const C = (x, E) => {
|
|
186
|
+
const A = g(x), T = () => {
|
|
187
|
+
if (v)
|
|
188
|
+
return J(D[v], E);
|
|
171
189
|
};
|
|
172
|
-
if (
|
|
173
|
-
return
|
|
174
|
-
const m =
|
|
175
|
-
return m !== void 0 ? m :
|
|
176
|
-
},
|
|
177
|
-
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
|
|
190
|
+
if (A !== void 0)
|
|
191
|
+
return A;
|
|
192
|
+
const m = T();
|
|
193
|
+
return m !== void 0 ? m : J(c, E);
|
|
194
|
+
}, y = (x, E) => qe(o.value, E, C(x, E));
|
|
195
|
+
y(t.shadows, "shadowMap.enabled"), y(t.toneMapping, "toneMapping"), y(t.shadowMapType, "shadowMap.type"), y(t.useLegacyLights, "useLegacyLights"), y(t.outputColorSpace, "outputColorSpace"), y(t.toneMappingExposure, "toneMappingExposure");
|
|
196
|
+
const _ = C(t.clearColor, "clearColor");
|
|
197
|
+
_ && o.value.setClearColor(
|
|
198
|
+
_ ? Je(_) : new B(0)
|
|
181
199
|
// default clear color is not easily/efficiently retrievable from three
|
|
182
200
|
);
|
|
183
201
|
});
|
|
184
|
-
const { pause:
|
|
185
|
-
return
|
|
186
|
-
i.value && !
|
|
187
|
-
}),
|
|
188
|
-
|
|
202
|
+
const { pause: p, resume: P, onLoop: L } = te();
|
|
203
|
+
return L(() => {
|
|
204
|
+
i.value && !g(a) && o.value.render(e.value, i.value);
|
|
205
|
+
}), P(), se(() => {
|
|
206
|
+
p(), o.value.dispose(), o.value.forceContextLoss();
|
|
189
207
|
}), {
|
|
190
208
|
renderer: o
|
|
191
209
|
};
|
|
192
210
|
}
|
|
193
|
-
function
|
|
194
|
-
|
|
211
|
+
const X = (e) => typeof e == "function", ae = (e) => !!e && e.constructor === Array;
|
|
212
|
+
function Xe(e) {
|
|
213
|
+
const n = { nodes: {}, materials: {} };
|
|
195
214
|
return e && e.traverse((t) => {
|
|
196
|
-
t.name && (
|
|
197
|
-
}),
|
|
215
|
+
t.name && (n.nodes[t.name] = t), t.material && !n.materials[t.material.name] && (n.materials[t.material.name] = t.material);
|
|
216
|
+
}), n;
|
|
198
217
|
}
|
|
199
|
-
async function
|
|
200
|
-
const { logError: i } =
|
|
201
|
-
r && r(
|
|
202
|
-
const s = (Array.isArray(
|
|
203
|
-
(u) => new Promise((
|
|
204
|
-
|
|
218
|
+
async function mt(e, n, t, a, r) {
|
|
219
|
+
const { logError: i } = b(), f = new e();
|
|
220
|
+
r && r(f), t && t(f);
|
|
221
|
+
const s = (Array.isArray(n) ? n : [n]).map(
|
|
222
|
+
(u) => new Promise((l, c) => {
|
|
223
|
+
f.load(
|
|
205
224
|
u,
|
|
206
|
-
(
|
|
207
|
-
|
|
225
|
+
(p) => {
|
|
226
|
+
p.scene && Object.assign(p, Xe(p.scene)), l(p);
|
|
208
227
|
},
|
|
209
|
-
|
|
210
|
-
(
|
|
228
|
+
a,
|
|
229
|
+
(p) => c(i("[useLoader] - Failed to load resource", p))
|
|
211
230
|
);
|
|
212
231
|
})
|
|
213
232
|
);
|
|
214
|
-
return
|
|
233
|
+
return ae(n) ? await Promise.all(s) : await s[0];
|
|
215
234
|
}
|
|
216
|
-
async function
|
|
217
|
-
const
|
|
235
|
+
async function pt(e) {
|
|
236
|
+
const n = new xe(), t = new Ae(n), a = (r) => new Promise((i, f) => {
|
|
218
237
|
t.load(
|
|
219
238
|
r,
|
|
220
239
|
(o) => i(o),
|
|
221
240
|
() => null,
|
|
222
241
|
() => {
|
|
223
|
-
|
|
242
|
+
f(new Error("[useTextures] - Failed to load texture"));
|
|
224
243
|
}
|
|
225
244
|
);
|
|
226
245
|
});
|
|
227
|
-
if (
|
|
228
|
-
const r = await Promise.all(e.map((i) =>
|
|
246
|
+
if (ae(e)) {
|
|
247
|
+
const r = await Promise.all(e.map((i) => a(i)));
|
|
229
248
|
return e.length > 1 ? r : r[0];
|
|
230
249
|
} else {
|
|
231
250
|
const {
|
|
232
251
|
map: r,
|
|
233
252
|
displacementMap: i,
|
|
234
|
-
normalMap:
|
|
253
|
+
normalMap: f,
|
|
235
254
|
roughnessMap: o,
|
|
236
255
|
metalnessMap: s,
|
|
237
256
|
aoMap: u,
|
|
238
|
-
alphaMap:
|
|
239
|
-
matcap:
|
|
257
|
+
alphaMap: l,
|
|
258
|
+
matcap: c
|
|
240
259
|
} = e;
|
|
241
260
|
return {
|
|
242
|
-
map: r ? await
|
|
243
|
-
displacementMap: i ? await
|
|
244
|
-
normalMap:
|
|
245
|
-
roughnessMap: o ? await
|
|
246
|
-
metalnessMap: s ? await
|
|
247
|
-
aoMap: u ? await
|
|
248
|
-
alphaMap:
|
|
249
|
-
matcap:
|
|
261
|
+
map: r ? await a(r) : null,
|
|
262
|
+
displacementMap: i ? await a(i) : null,
|
|
263
|
+
normalMap: f ? await a(f) : null,
|
|
264
|
+
roughnessMap: o ? await a(o) : null,
|
|
265
|
+
metalnessMap: s ? await a(s) : null,
|
|
266
|
+
aoMap: u ? await a(u) : null,
|
|
267
|
+
alphaMap: l ? await a(l) : null,
|
|
268
|
+
matcap: c ? await a(c) : null
|
|
250
269
|
};
|
|
251
270
|
}
|
|
252
271
|
}
|
|
253
|
-
const
|
|
254
|
-
const r =
|
|
272
|
+
const Ye = (e, { renderer: n, camera: t, raycaster: a }) => {
|
|
273
|
+
const r = M(() => n.value.domElement), { x: i, y: f } = Be({ target: r }), { width: o, height: s, top: u, left: l } = Re(r), c = ({ x: m, y: w }) => {
|
|
255
274
|
if (r.value)
|
|
256
275
|
return {
|
|
257
|
-
x: (m -
|
|
258
|
-
y: -((
|
|
276
|
+
x: (m - l.value) / o.value * 2 - 1,
|
|
277
|
+
y: -((w - u.value) / s.value) * 2 + 1
|
|
259
278
|
};
|
|
260
|
-
},
|
|
279
|
+
}, p = ({ x: m, y: w }) => {
|
|
261
280
|
if (t.value)
|
|
262
|
-
return
|
|
263
|
-
},
|
|
264
|
-
const
|
|
281
|
+
return a.value.setFromCamera(new he(m, w), t.value), a.value.intersectObjects(e.value, !1);
|
|
282
|
+
}, P = (m) => {
|
|
283
|
+
const w = c({
|
|
265
284
|
x: (m == null ? void 0 : m.clientX) ?? i.value,
|
|
266
|
-
y: (m == null ? void 0 : m.clientY) ??
|
|
285
|
+
y: (m == null ? void 0 : m.clientY) ?? f.value
|
|
267
286
|
});
|
|
268
|
-
return
|
|
269
|
-
},
|
|
270
|
-
m.trigger({ event:
|
|
271
|
-
},
|
|
272
|
-
|
|
287
|
+
return w ? p(w) || [] : [];
|
|
288
|
+
}, L = M(() => P()), v = k(), C = k(), y = (m, w) => {
|
|
289
|
+
m.trigger({ event: w, intersects: P(w) });
|
|
290
|
+
}, _ = (m) => {
|
|
291
|
+
y(C, m);
|
|
273
292
|
};
|
|
274
|
-
let
|
|
275
|
-
const
|
|
276
|
-
var
|
|
277
|
-
|
|
278
|
-
},
|
|
279
|
-
var
|
|
280
|
-
m instanceof PointerEvent &&
|
|
281
|
-
},
|
|
282
|
-
return
|
|
283
|
-
r
|
|
293
|
+
let x;
|
|
294
|
+
const E = (m) => {
|
|
295
|
+
var w;
|
|
296
|
+
x = (w = P(m)[0]) == null ? void 0 : w.object;
|
|
297
|
+
}, A = (m) => {
|
|
298
|
+
var w;
|
|
299
|
+
m instanceof PointerEvent && x === ((w = P(m)[0]) == null ? void 0 : w.object) && y(v, m);
|
|
300
|
+
}, T = (m) => C.trigger({ event: m, intersects: [] });
|
|
301
|
+
return ie((m) => {
|
|
302
|
+
r.value && (r.value.addEventListener("pointerup", A), r.value.addEventListener("pointerdown", E), r.value.addEventListener("pointermove", _), r.value.addEventListener("pointerleave", T), m(() => {
|
|
303
|
+
r != null && r.value && (r.value.removeEventListener("pointerup", A), r.value.removeEventListener("pointerdown", E), r.value.removeEventListener("pointermove", _), r.value.removeEventListener("pointerleave", T));
|
|
304
|
+
}));
|
|
284
305
|
}), {
|
|
285
|
-
intersects:
|
|
286
|
-
onClick: (m) =>
|
|
287
|
-
onPointerMove: (m) =>
|
|
306
|
+
intersects: L,
|
|
307
|
+
onClick: (m) => v.on(m).off,
|
|
308
|
+
onPointerMove: (m) => C.on(m).off
|
|
288
309
|
};
|
|
289
310
|
};
|
|
290
|
-
function
|
|
291
|
-
const { logWarning: e } =
|
|
292
|
-
function a
|
|
293
|
-
let
|
|
294
|
-
return
|
|
295
|
-
o[r] === i && (
|
|
296
|
-
}),
|
|
311
|
+
function vt() {
|
|
312
|
+
const { logWarning: e } = b();
|
|
313
|
+
function n(a, r, i) {
|
|
314
|
+
let f = null;
|
|
315
|
+
return a.traverse((o) => {
|
|
316
|
+
o[r] === i && (f = o);
|
|
317
|
+
}), f || e(`Child with ${r} '${i}' not found.`), f;
|
|
297
318
|
}
|
|
298
|
-
function t(
|
|
299
|
-
return a
|
|
319
|
+
function t(a, r) {
|
|
320
|
+
return n(a, "name", r);
|
|
300
321
|
}
|
|
301
322
|
return {
|
|
302
|
-
seek:
|
|
323
|
+
seek: n,
|
|
303
324
|
seekByName: t
|
|
304
325
|
};
|
|
305
326
|
}
|
|
306
|
-
const
|
|
307
|
-
const t =
|
|
327
|
+
const Qe = ({ scene: e, contextParts: n }) => {
|
|
328
|
+
const t = ue({
|
|
308
329
|
click: /* @__PURE__ */ new Map(),
|
|
309
330
|
pointerMove: /* @__PURE__ */ new Map(),
|
|
310
331
|
pointerEnter: /* @__PURE__ */ new Map(),
|
|
311
332
|
pointerLeave: /* @__PURE__ */ new Map()
|
|
312
|
-
}),
|
|
313
|
-
Object.values(t).forEach((
|
|
333
|
+
}), a = (u) => {
|
|
334
|
+
Object.values(t).forEach((l) => l.delete(u));
|
|
314
335
|
}, r = (u) => {
|
|
315
|
-
const { onClick:
|
|
316
|
-
|
|
336
|
+
const { onClick: l, onPointerMove: c, onPointerEnter: p, onPointerLeave: P } = u;
|
|
337
|
+
l && t.click.set(u, l), c && t.pointerMove.set(u, c), p && t.pointerEnter.set(u, p), P && t.pointerLeave.set(u, P);
|
|
317
338
|
};
|
|
318
|
-
e.userData.tres__registerAtPointerEventHandler = r, e.userData.tres__deregisterAtPointerEventHandler =
|
|
319
|
-
const i =
|
|
320
|
-
() =>
|
|
339
|
+
e.userData.tres__registerAtPointerEventHandler = r, e.userData.tres__deregisterAtPointerEventHandler = a;
|
|
340
|
+
const i = M(
|
|
341
|
+
() => Ne(
|
|
321
342
|
Object.values(t).map((u) => Array.from(u.keys())).flat(),
|
|
322
343
|
({ uuid: u }) => u
|
|
323
344
|
)
|
|
324
|
-
), { onClick:
|
|
325
|
-
|
|
326
|
-
var
|
|
327
|
-
u.length && ((
|
|
345
|
+
), { onClick: f, onPointerMove: o } = Ye(i, n);
|
|
346
|
+
f(({ intersects: u, event: l }) => {
|
|
347
|
+
var c;
|
|
348
|
+
u.length && ((c = t.click.get(u[0].object)) == null || c(u[0], l));
|
|
328
349
|
});
|
|
329
350
|
let s;
|
|
330
|
-
return o(({ intersects: u, event:
|
|
331
|
-
var
|
|
332
|
-
const
|
|
333
|
-
s && s !==
|
|
351
|
+
return o(({ intersects: u, event: l }) => {
|
|
352
|
+
var v, C, y, _;
|
|
353
|
+
const c = (v = u == null ? void 0 : u[0]) == null ? void 0 : v.object, { pointerLeave: p, pointerEnter: P, pointerMove: L } = t;
|
|
354
|
+
s && s !== c && ((C = p.get(s)) == null || C(s, l)), c && (s !== c && ((y = P.get(c)) == null || y(u[0], l)), (_ = L.get(c)) == null || _(u[0], l)), s = c || null;
|
|
334
355
|
}), {
|
|
335
356
|
registerObject: r,
|
|
336
|
-
deregisterObject:
|
|
357
|
+
deregisterObject: a
|
|
337
358
|
};
|
|
338
|
-
};
|
|
339
|
-
function
|
|
359
|
+
}, $ = j({}), oe = (e) => void Object.assign($.value, e);
|
|
360
|
+
function Ze({
|
|
340
361
|
scene: e,
|
|
341
|
-
canvas:
|
|
362
|
+
canvas: n,
|
|
342
363
|
windowSize: t,
|
|
343
|
-
disableRender:
|
|
364
|
+
disableRender: a,
|
|
344
365
|
rendererOptions: r
|
|
345
366
|
}) {
|
|
346
|
-
const i =
|
|
347
|
-
() =>
|
|
348
|
-
|
|
367
|
+
const i = M(
|
|
368
|
+
() => {
|
|
369
|
+
var y;
|
|
370
|
+
return g(t) ? Fe() : je((y = g(n)) == null ? void 0 : y.parentElement);
|
|
371
|
+
}
|
|
372
|
+
), f = M(() => i.value.width.value), o = M(() => i.value.height.value), s = M(() => f.value / o.value), u = {
|
|
349
373
|
height: o,
|
|
350
|
-
width:
|
|
374
|
+
width: f,
|
|
351
375
|
aspectRatio: s
|
|
352
|
-
},
|
|
353
|
-
camera:
|
|
354
|
-
cameras:
|
|
355
|
-
addCamera:
|
|
356
|
-
removeCamera:
|
|
357
|
-
setCameraActive:
|
|
358
|
-
} =
|
|
376
|
+
}, {
|
|
377
|
+
camera: l,
|
|
378
|
+
cameras: c,
|
|
379
|
+
addCamera: p,
|
|
380
|
+
removeCamera: P,
|
|
381
|
+
setCameraActive: L
|
|
382
|
+
} = ze({ sizes: u, scene: e }), { renderer: v } = Ke(
|
|
359
383
|
{
|
|
360
384
|
scene: e,
|
|
361
|
-
canvas:
|
|
385
|
+
canvas: n,
|
|
362
386
|
options: r,
|
|
363
|
-
contextParts: { sizes: u, camera:
|
|
364
|
-
disableRender:
|
|
387
|
+
contextParts: { sizes: u, camera: l },
|
|
388
|
+
disableRender: a
|
|
365
389
|
}
|
|
366
|
-
),
|
|
390
|
+
), C = {
|
|
367
391
|
sizes: u,
|
|
368
|
-
scene:
|
|
369
|
-
camera:
|
|
370
|
-
cameras:
|
|
371
|
-
renderer:
|
|
372
|
-
raycaster:
|
|
373
|
-
controls:
|
|
374
|
-
extend:
|
|
375
|
-
addCamera:
|
|
376
|
-
removeCamera:
|
|
377
|
-
setCameraActive:
|
|
392
|
+
scene: e,
|
|
393
|
+
camera: l,
|
|
394
|
+
cameras: le(c),
|
|
395
|
+
renderer: v,
|
|
396
|
+
raycaster: I(new ke()),
|
|
397
|
+
controls: j(null),
|
|
398
|
+
extend: oe,
|
|
399
|
+
addCamera: p,
|
|
400
|
+
removeCamera: P,
|
|
401
|
+
setCameraActive: L
|
|
378
402
|
};
|
|
379
|
-
return
|
|
403
|
+
return Q("useTres", C), C;
|
|
380
404
|
}
|
|
381
|
-
function
|
|
382
|
-
const e =
|
|
405
|
+
function et() {
|
|
406
|
+
const e = ce("useTres");
|
|
383
407
|
if (!e)
|
|
384
408
|
throw new Error("useTresContext must be used together with useTresContextProvider");
|
|
385
409
|
return e;
|
|
386
410
|
}
|
|
387
|
-
const
|
|
388
|
-
let
|
|
389
|
-
const { logError:
|
|
390
|
-
createElement(e,
|
|
391
|
-
var
|
|
392
|
-
if (
|
|
411
|
+
const dt = et;
|
|
412
|
+
let H = null, d = null;
|
|
413
|
+
const { logError: Y } = b(), tt = {
|
|
414
|
+
createElement(e, n, t, a) {
|
|
415
|
+
var f, o;
|
|
416
|
+
if (a || (a = {}), a.args || (a.args = []), e === "template" || $e(e))
|
|
393
417
|
return null;
|
|
394
418
|
let r = e.replace("Tres", ""), i;
|
|
395
419
|
if (e === "primitive") {
|
|
396
|
-
(
|
|
397
|
-
const s =
|
|
398
|
-
r = s.type, i = Object.assign(s, { type: r, attach:
|
|
420
|
+
(a == null ? void 0 : a.object) === void 0 && Y("Tres primitives need a prop 'object'");
|
|
421
|
+
const s = a.object;
|
|
422
|
+
r = s.type, i = Object.assign(s, { type: r, attach: a.attach, primitive: !0 });
|
|
399
423
|
} else {
|
|
400
|
-
const s =
|
|
401
|
-
s ||
|
|
424
|
+
const s = $.value[r];
|
|
425
|
+
s || Y(`${r} is not defined on the THREE namespace. Use extend to add it to the catalog.`), i = new s(...a.args);
|
|
402
426
|
}
|
|
403
|
-
return i.isCamera && (
|
|
427
|
+
return i.isCamera && (a != null && a.position || i.position.set(3, 3, 3), a != null && a.lookAt || i.lookAt(0, 0, 0)), (a == null ? void 0 : a.attach) === void 0 && (i.isMaterial ? i.attach = "material" : i.isBufferGeometry && (i.attach = "geometry")), i.isObject3D && ((f = a == null ? void 0 : a.material) != null && f.isMaterial && (i.userData.tres__materialViaProp = !0), (o = a == null ? void 0 : a.geometry) != null && o.isBufferGeometry && (i.userData.tres__geometryViaProp = !0)), i;
|
|
404
428
|
},
|
|
405
|
-
insert(e,
|
|
406
|
-
var t,
|
|
407
|
-
if (
|
|
408
|
-
|
|
429
|
+
insert(e, n) {
|
|
430
|
+
var t, a, r, i, f, o, s, u, l;
|
|
431
|
+
if (n && n.isScene && (d = n), (((t = e == null ? void 0 : e.__vnode) == null ? void 0 : t.type) === "TresGroup" || ((a = e == null ? void 0 : e.__vnode) == null ? void 0 : a.type) === "TresObject3D") && n === null && !((i = (r = e == null ? void 0 : e.__vnode) == null ? void 0 : r.ctx) != null && i.asyncResolved)) {
|
|
432
|
+
H = e;
|
|
409
433
|
return;
|
|
410
434
|
} else
|
|
411
|
-
(
|
|
412
|
-
if (
|
|
435
|
+
(f = e == null ? void 0 : e.__vnode) != null && f.type.includes("Controls") && n === null && (H = d);
|
|
436
|
+
if (n || (n = H), e != null && e.isObject3D) {
|
|
413
437
|
if (e != null && e.isCamera) {
|
|
414
|
-
if (!(
|
|
438
|
+
if (!(d != null && d.userData.tres__registerCamera))
|
|
415
439
|
throw "could not find tres__registerCamera on scene's userData";
|
|
416
|
-
(s =
|
|
440
|
+
(s = d == null ? void 0 : (o = d.userData).tres__registerCamera) == null || s.call(o, e);
|
|
417
441
|
}
|
|
418
442
|
if (e != null && e.onClick || e != null && e.onPointerMove || e != null && e.onPointerEnter || e != null && e.onPointerLeave) {
|
|
419
|
-
if (!(
|
|
443
|
+
if (!(d != null && d.userData.tres__registerAtPointerEventHandler))
|
|
420
444
|
throw "could not find tres__registerAtPointerEventHandler on scene's userData";
|
|
421
|
-
(
|
|
445
|
+
(l = d == null ? void 0 : (u = d.userData).tres__registerAtPointerEventHandler) == null || l.call(u, e);
|
|
422
446
|
}
|
|
423
447
|
}
|
|
424
|
-
e != null && e.isObject3D && (
|
|
448
|
+
e != null && e.isObject3D && (n != null && n.isObject3D) ? (n.add(e), e.dispatchEvent({ type: "added" })) : e != null && e.isFog ? n.fog = e : typeof (e == null ? void 0 : e.attach) == "string" && (e.__previousAttach = e[n == null ? void 0 : n.attach], n && (n[e.attach] = e));
|
|
425
449
|
},
|
|
426
450
|
remove(e) {
|
|
427
|
-
var
|
|
451
|
+
var n, t;
|
|
428
452
|
if (e) {
|
|
429
453
|
if (e.isObject3D) {
|
|
430
|
-
const
|
|
431
|
-
var
|
|
454
|
+
const a = e, r = (s) => {
|
|
455
|
+
var l, c;
|
|
432
456
|
const u = s;
|
|
433
|
-
s.userData.tres__materialViaProp || (
|
|
434
|
-
}, i =
|
|
457
|
+
s.userData.tres__materialViaProp || (l = u.material) == null || l.dispose(), s.userData.tres__geometryViaProp || (c = u.geometry) == null || c.dispose();
|
|
458
|
+
}, i = d == null ? void 0 : d.userData.tres__deregisterAtPointerEventHandler, f = (s) => {
|
|
435
459
|
if (!i)
|
|
436
460
|
throw "could not find tres__deregisterAtPointerEventHandler on scene's userData";
|
|
437
461
|
(s != null && s.onClick || s != null && s.onPointerMove || s != null && s.onPointerEnter || s != null && s.onPointerLeave) && (i == null || i(s));
|
|
438
462
|
}, o = (s) => {
|
|
439
|
-
const u =
|
|
463
|
+
const u = d == null ? void 0 : d.userData.tres__deregisterCamera;
|
|
440
464
|
if (!u)
|
|
441
465
|
throw "could not find tres__deregisterCamera on scene's userData";
|
|
442
466
|
s.isCamera && (u == null || u(s));
|
|
443
467
|
};
|
|
444
|
-
|
|
445
|
-
r(s), o(s),
|
|
446
|
-
}), r(
|
|
468
|
+
a.traverse((s) => {
|
|
469
|
+
r(s), o(s), f == null || f(s);
|
|
470
|
+
}), r(a), o(a), f == null || f(a);
|
|
447
471
|
}
|
|
448
|
-
(
|
|
472
|
+
(n = e.removeFromParent) == null || n.call(e), (t = e.dispose) == null || t.call(e);
|
|
449
473
|
}
|
|
450
474
|
},
|
|
451
|
-
patchProp(e,
|
|
475
|
+
patchProp(e, n, t, a) {
|
|
452
476
|
if (e) {
|
|
453
|
-
let r = e, i =
|
|
477
|
+
let r = e, i = n, f = S(i), o = r == null ? void 0 : r[f];
|
|
478
|
+
if (i === "args") {
|
|
479
|
+
const u = e, l = t ?? [], c = a ?? [];
|
|
480
|
+
e.type && !Ue(l, c) && (r = Object.assign(u, new $.value[e.type](...a)));
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
454
483
|
if (r.type === "BufferGeometry") {
|
|
455
484
|
if (i === "args")
|
|
456
485
|
return;
|
|
457
486
|
r.setAttribute(
|
|
458
|
-
|
|
459
|
-
new
|
|
487
|
+
S(i),
|
|
488
|
+
new be(...a)
|
|
460
489
|
);
|
|
461
490
|
return;
|
|
462
491
|
}
|
|
463
492
|
if (i.includes("-") && o === void 0) {
|
|
464
493
|
const u = i.split("-");
|
|
465
|
-
o = u.reduce((
|
|
494
|
+
o = u.reduce((l, c) => l[S(c)], r), i = u.pop(), f = i.toLowerCase(), o != null && o.set || (r = u.reduce((l, c) => l[S(c)], r));
|
|
466
495
|
}
|
|
467
|
-
let s =
|
|
468
|
-
if (s === "" && (s = !0),
|
|
469
|
-
Array.isArray(s) ? e[
|
|
496
|
+
let s = a;
|
|
497
|
+
if (s === "" && (s = !0), X(o)) {
|
|
498
|
+
Array.isArray(s) ? e[f](...s) : e[f](s);
|
|
470
499
|
return;
|
|
471
500
|
}
|
|
472
|
-
!(o != null && o.set) && !
|
|
501
|
+
!(o != null && o.set) && !X(o) ? r[f] = s : o.constructor === s.constructor && (o != null && o.copy) ? o == null || o.copy(s) : Array.isArray(s) ? o.set(...s) : !o.isColor && o.setScalar ? o.setScalar(s) : o.set(s);
|
|
473
502
|
}
|
|
474
503
|
},
|
|
475
504
|
parentNode(e) {
|
|
@@ -484,15 +513,9 @@ const { logError: J } = k(), Xe = {
|
|
|
484
513
|
setScopeId: () => void 0,
|
|
485
514
|
cloneNode: () => void 0,
|
|
486
515
|
insertStaticContent: () => void 0
|
|
487
|
-
}, {
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
return e && e.default ? e.default() : [];
|
|
491
|
-
}
|
|
492
|
-
return a;
|
|
493
|
-
};
|
|
494
|
-
$(pe);
|
|
495
|
-
const Ze = ["data-scene"], et = /* @__PURE__ */ ie({
|
|
516
|
+
}, { render: rt } = fe(tt);
|
|
517
|
+
oe(ye);
|
|
518
|
+
const nt = ["data-scene"], at = /* @__PURE__ */ q({
|
|
496
519
|
__name: "TresCanvas",
|
|
497
520
|
props: {
|
|
498
521
|
shadows: { type: Boolean },
|
|
@@ -519,92 +542,89 @@ const Ze = ["data-scene"], et = /* @__PURE__ */ ie({
|
|
|
519
542
|
failIfMajorPerformanceCaveat: { type: Boolean }
|
|
520
543
|
},
|
|
521
544
|
setup(e) {
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
const i =
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
d.position.set(3, 3, 3), d.lookAt(0, 0, 0), f(d);
|
|
543
|
-
const v = b(
|
|
544
|
-
() => {
|
|
545
|
-
C.value.length >= 2 && (d.removeFromParent(), M(d), v == null || v());
|
|
546
|
-
}
|
|
547
|
-
);
|
|
548
|
-
};
|
|
549
|
-
K(() => a.camera, (d, v) => {
|
|
550
|
-
d ? f(d) : v && (v.removeFromParent(), M(v));
|
|
551
|
-
}, {
|
|
552
|
-
immediate: !0
|
|
553
|
-
}), w.value || (t(
|
|
545
|
+
const n = e, { logWarning: t } = b(), a = j(), r = I(new Te());
|
|
546
|
+
te();
|
|
547
|
+
const i = me(), f = M(() => n.disableRender), o = Ze({
|
|
548
|
+
scene: r,
|
|
549
|
+
canvas: a,
|
|
550
|
+
windowSize: M(() => n.windowSize),
|
|
551
|
+
disableRender: f,
|
|
552
|
+
rendererOptions: n
|
|
553
|
+
});
|
|
554
|
+
Qe({ scene: r.value, contextParts: o });
|
|
555
|
+
const s = q({
|
|
556
|
+
setup() {
|
|
557
|
+
return Q("useTres", o), () => U(pe, null, i && i.default ? i.default() : []);
|
|
558
|
+
}
|
|
559
|
+
}), u = () => {
|
|
560
|
+
const c = r.value;
|
|
561
|
+
rt(U(s), c), G(r);
|
|
562
|
+
};
|
|
563
|
+
V(a, (c) => {
|
|
564
|
+
c && (u(), !o.camera.value && !n.camera && (t(
|
|
554
565
|
"No camera found. Creating a default perspective camera. To have full control over a camera, please add one to the scene."
|
|
555
|
-
),
|
|
556
|
-
}), (
|
|
566
|
+
), l()));
|
|
567
|
+
}), V(() => n.camera, (c, p) => {
|
|
568
|
+
c ? o.addCamera(c, !0) : p && (p.removeFromParent(), o.removeCamera(p));
|
|
569
|
+
}, {
|
|
570
|
+
immediate: !0
|
|
571
|
+
});
|
|
572
|
+
const l = () => {
|
|
573
|
+
const c = new W(45, window.innerWidth / window.innerHeight, 0.1, 1e3);
|
|
574
|
+
c.position.set(3, 3, 3), c.lookAt(0, 0, 0), o.addCamera(c), o.cameras.value.length >= 2 && (c.removeFromParent(), o.removeCamera(c));
|
|
575
|
+
};
|
|
576
|
+
return (c, p) => (ve(), de("canvas", {
|
|
557
577
|
ref_key: "canvas",
|
|
558
|
-
ref:
|
|
578
|
+
ref: a,
|
|
559
579
|
"data-scene": r.value.uuid,
|
|
560
|
-
style:
|
|
580
|
+
style: ge({
|
|
561
581
|
display: "block",
|
|
562
582
|
width: "100%",
|
|
563
583
|
height: "100%",
|
|
564
|
-
position:
|
|
584
|
+
position: c.windowSize ? "fixed" : "relative",
|
|
565
585
|
top: 0,
|
|
566
586
|
left: 0,
|
|
567
587
|
pointerEvents: "auto",
|
|
568
588
|
touchAction: "none",
|
|
569
589
|
zIndex: 1
|
|
570
590
|
})
|
|
571
|
-
}, null, 12,
|
|
591
|
+
}, null, 12, nt));
|
|
572
592
|
}
|
|
573
|
-
}),
|
|
593
|
+
}), ot = [
|
|
574
594
|
"TresCanvas",
|
|
575
595
|
"TresLeches",
|
|
576
596
|
"TresScene"
|
|
577
|
-
],
|
|
597
|
+
], st = {
|
|
578
598
|
template: {
|
|
579
599
|
compilerOptions: {
|
|
580
|
-
isCustomElement: (e) => e.startsWith("Tres") && !
|
|
600
|
+
isCustomElement: (e) => e.startsWith("Tres") && !ot.includes(e) || e === "primitive"
|
|
581
601
|
}
|
|
582
602
|
}
|
|
583
|
-
},
|
|
603
|
+
}, gt = st, yt = {
|
|
584
604
|
install(e) {
|
|
585
|
-
e.component("TresCanvas",
|
|
605
|
+
e.component("TresCanvas", at);
|
|
586
606
|
}
|
|
587
607
|
};
|
|
588
608
|
export {
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
609
|
+
at as TresCanvas,
|
|
610
|
+
$ as catalogue,
|
|
611
|
+
yt as default,
|
|
612
|
+
oe as extend,
|
|
613
|
+
ct as isProd,
|
|
614
|
+
Je as normalizeColor,
|
|
615
|
+
ft as normalizeVectorFlexibleParam,
|
|
616
|
+
gt as templateCompilerOptions,
|
|
617
|
+
Xe as trasverseObjects,
|
|
618
|
+
ze as useCamera,
|
|
619
|
+
mt as useLoader,
|
|
620
|
+
b as useLogger,
|
|
621
|
+
Qe as usePointerEventHandler,
|
|
622
|
+
Ye as useRaycaster,
|
|
623
|
+
te as useRenderLoop,
|
|
624
|
+
Ke as useRenderer,
|
|
625
|
+
vt as useSeek,
|
|
626
|
+
pt as useTexture,
|
|
627
|
+
dt as useTres,
|
|
628
|
+
et as useTresContext,
|
|
629
|
+
Ze as useTresContextProvider
|
|
610
630
|
};
|