@tresjs/core 2.1.2 → 2.2.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 +2 -1
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/usePointerEventHandler/index.d.ts +14 -0
- package/dist/composables/useRaycaster/index.d.ts +16 -31
- package/dist/composables/useTres/index.d.ts +29 -11
- package/dist/keys.d.ts +6 -0
- package/dist/tres.js +387 -323
- package/dist/tres.umd.cjs +3 -3
- package/dist/types/index.d.ts +2 -2
- package/dist/utils/index.d.ts +1 -0
- package/package.json +29 -27
package/dist/tres.js
CHANGED
|
@@ -1,67 +1,71 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name: @tresjs/core
|
|
3
|
-
* version: v2.
|
|
3
|
+
* version: v2.2.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 { ref as
|
|
9
|
-
import * as
|
|
10
|
-
import { PerspectiveCamera as
|
|
11
|
-
import { createEventHook as
|
|
12
|
-
const
|
|
13
|
-
function
|
|
14
|
-
const e = Math.random() * 4294967295 | 0, t = Math.random() * 4294967295 | 0,
|
|
15
|
-
return (
|
|
8
|
+
import { ref as G, shallowReactive as ce, toRefs as ue, provide as Te, inject as Le, watchEffect as fe, toRef as _e, shallowRef as Ae, computed as V, watch as D, onUnmounted as le, reactive as Se, createRenderer as Oe, defineComponent as de, onMounted as ke, h as L } from "vue";
|
|
9
|
+
import * as q from "three";
|
|
10
|
+
import { PerspectiveCamera as z, OrthographicCamera as je, Clock as pe, Color as W, SRGBColorSpace as De, ACESFilmicToneMapping as Ie, PCFSoftShadowMap as Be, PCFShadowMap as He, LinearSRGBColorSpace as ae, NoToneMapping as ne, WebGLRenderer as Ge, LoadingManager as Ve, TextureLoader as Ne, Raycaster as Fe, Vector2 as ze, BufferAttribute as We } from "three";
|
|
11
|
+
import { createEventHook as A, useRafFn as Ue, toValue as m, useWindowSize as Ye, useElementSize as $e, useDevicePixelRatio as qe, unrefElement as U, usePointer as Ke, useElementBounding as Je } from "@vueuse/core";
|
|
12
|
+
const me = G({}), ve = (e) => void Object.assign(me.value, e), re = (e) => typeof e == "function", ge = (e) => !!e && e.constructor === Array, b = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"];
|
|
13
|
+
function Xe() {
|
|
14
|
+
const e = Math.random() * 4294967295 | 0, t = Math.random() * 4294967295 | 0, n = Math.random() * 4294967295 | 0, a = Math.random() * 4294967295 | 0;
|
|
15
|
+
return (b[e & 255] + b[e >> 8 & 255] + b[e >> 16 & 255] + b[e >> 24 & 255] + "-" + b[t & 255] + b[t >> 8 & 255] + "-" + b[t >> 16 & 15 | 64] + b[t >> 24 & 255] + "-" + b[n & 63 | 128] + b[n >> 8 & 255] + "-" + b[n >> 16 & 255] + b[n >> 24 & 255] + b[a & 255] + b[a >> 8 & 255] + b[a >> 16 & 255] + b[a >> 24 & 255]).toLowerCase();
|
|
16
16
|
}
|
|
17
|
-
const
|
|
18
|
-
function
|
|
19
|
-
const e =
|
|
20
|
-
uuid:
|
|
17
|
+
const K = Symbol();
|
|
18
|
+
function Qe() {
|
|
19
|
+
const e = ce({
|
|
20
|
+
uuid: Xe(),
|
|
21
21
|
camera: void 0,
|
|
22
22
|
cameras: [],
|
|
23
|
+
canvas: void 0,
|
|
23
24
|
scene: void 0,
|
|
24
25
|
renderer: void 0,
|
|
25
|
-
aspectRatio:
|
|
26
|
+
aspectRatio: void 0,
|
|
27
|
+
pointerEventHandler: void 0
|
|
26
28
|
});
|
|
27
|
-
function t(
|
|
28
|
-
return e[
|
|
29
|
+
function t(o) {
|
|
30
|
+
return e[o];
|
|
29
31
|
}
|
|
30
|
-
function o
|
|
31
|
-
e[
|
|
32
|
+
function n(o, i) {
|
|
33
|
+
e[o] = i;
|
|
32
34
|
}
|
|
33
35
|
const a = {
|
|
34
36
|
state: e,
|
|
35
|
-
...
|
|
37
|
+
...ue(e),
|
|
36
38
|
getState: t,
|
|
37
|
-
setState:
|
|
39
|
+
setState: n
|
|
38
40
|
};
|
|
39
|
-
return
|
|
41
|
+
return Te(K, a), a;
|
|
40
42
|
}
|
|
41
|
-
const
|
|
42
|
-
state:
|
|
43
|
+
const S = () => Le(K, {
|
|
44
|
+
state: ce({
|
|
43
45
|
camera: void 0,
|
|
44
46
|
cameras: [],
|
|
47
|
+
canvas: void 0,
|
|
45
48
|
scene: void 0,
|
|
46
|
-
renderer: void 0
|
|
49
|
+
renderer: void 0,
|
|
50
|
+
pointerEventHandler: void 0
|
|
47
51
|
})
|
|
48
52
|
});
|
|
49
|
-
var
|
|
50
|
-
const
|
|
51
|
-
let
|
|
52
|
-
function
|
|
53
|
-
const { state: e, setState: t, aspectRatio:
|
|
54
|
-
function a(s = "Perspective",
|
|
55
|
-
var l, d,
|
|
53
|
+
var Ze = /* @__PURE__ */ ((e) => (e.Perspective = "Perspective", e.Orthographic = "Orthographic", e))(Ze || {});
|
|
54
|
+
const et = 45;
|
|
55
|
+
let x;
|
|
56
|
+
function tt() {
|
|
57
|
+
const { state: e, setState: t, aspectRatio: n } = S();
|
|
58
|
+
function a(s = "Perspective", c) {
|
|
59
|
+
var l, d, p;
|
|
56
60
|
if (s === "Perspective") {
|
|
57
|
-
const { near:
|
|
61
|
+
const { near: y, far: h, fov: v } = c || {
|
|
58
62
|
near: 0.1,
|
|
59
63
|
far: 1e3,
|
|
60
|
-
fov:
|
|
64
|
+
fov: et
|
|
61
65
|
};
|
|
62
|
-
|
|
66
|
+
x = new z(v, ((l = e.aspectRatio) == null ? void 0 : l.value) || window.innerWidth / window.innerHeight, y, h), (d = e.cameras) == null || d.push(x);
|
|
63
67
|
} else {
|
|
64
|
-
const { left:
|
|
68
|
+
const { left: y, right: h, top: v, bottom: M, near: w, far: E } = c || {
|
|
65
69
|
left: -100,
|
|
66
70
|
right: 100,
|
|
67
71
|
top: 100,
|
|
@@ -69,342 +73,404 @@ function Ee() {
|
|
|
69
73
|
near: 0.1,
|
|
70
74
|
far: 1e3
|
|
71
75
|
};
|
|
72
|
-
|
|
76
|
+
x = new je(y, h, v, M, w, E), (p = e.cameras) == null || p.push(x);
|
|
73
77
|
}
|
|
74
|
-
return e.camera =
|
|
78
|
+
return e.camera = x, t("camera", e.camera), x;
|
|
75
79
|
}
|
|
76
|
-
function
|
|
80
|
+
function o() {
|
|
77
81
|
var s;
|
|
78
|
-
e.camera instanceof
|
|
82
|
+
e.camera instanceof z && e.aspectRatio && (e.camera.aspect = e.aspectRatio.value), (s = e.camera) == null || s.updateProjectionMatrix();
|
|
79
83
|
}
|
|
80
|
-
function
|
|
81
|
-
var
|
|
82
|
-
(
|
|
84
|
+
function i(s) {
|
|
85
|
+
var c;
|
|
86
|
+
(c = e.cameras) == null || c.push(s), s instanceof z && e.aspectRatio && (s.aspect = e.aspectRatio.value), s.updateProjectionMatrix(), t("camera", s);
|
|
83
87
|
}
|
|
84
|
-
function
|
|
85
|
-
var
|
|
86
|
-
((
|
|
88
|
+
function u(s) {
|
|
89
|
+
var c;
|
|
90
|
+
((c = e.cameras) == null ? void 0 : c.length) === 0 && i(s);
|
|
87
91
|
}
|
|
88
|
-
function
|
|
92
|
+
function r() {
|
|
89
93
|
e.cameras = [];
|
|
90
94
|
}
|
|
91
|
-
return
|
|
92
|
-
|
|
95
|
+
return fe(() => {
|
|
96
|
+
n != null && n.value && o();
|
|
93
97
|
}), {
|
|
94
|
-
activeCamera:
|
|
98
|
+
activeCamera: _e(e, "camera"),
|
|
95
99
|
createCamera: a,
|
|
96
|
-
updateCamera:
|
|
97
|
-
pushCamera:
|
|
98
|
-
clearCameras:
|
|
99
|
-
setFirstCamera:
|
|
100
|
+
updateCamera: o,
|
|
101
|
+
pushCamera: i,
|
|
102
|
+
clearCameras: r,
|
|
103
|
+
setFirstCamera: u
|
|
100
104
|
};
|
|
101
105
|
}
|
|
102
|
-
const
|
|
103
|
-
let
|
|
104
|
-
const { pause:
|
|
106
|
+
const we = A(), be = A(), J = A(), _ = new pe();
|
|
107
|
+
let I = 0, B = 0;
|
|
108
|
+
const { pause: at, resume: nt, isActive: rt } = Ue(
|
|
105
109
|
() => {
|
|
106
|
-
|
|
110
|
+
we.trigger({ delta: I, elapsed: B, clock: _ }), be.trigger({ delta: I, elapsed: B, clock: _ }), J.trigger({ delta: I, elapsed: B, clock: _ });
|
|
107
111
|
},
|
|
108
112
|
{ immediate: !1 }
|
|
109
113
|
);
|
|
110
|
-
|
|
111
|
-
|
|
114
|
+
J.on(() => {
|
|
115
|
+
I = _.getDelta(), B = _.getElapsedTime();
|
|
112
116
|
});
|
|
113
|
-
function
|
|
117
|
+
function he() {
|
|
114
118
|
return {
|
|
115
|
-
onBeforeLoop:
|
|
116
|
-
onLoop:
|
|
117
|
-
onAfterLoop:
|
|
118
|
-
pause:
|
|
119
|
-
resume:
|
|
120
|
-
isActive:
|
|
119
|
+
onBeforeLoop: we.on,
|
|
120
|
+
onLoop: be.on,
|
|
121
|
+
onAfterLoop: J.on,
|
|
122
|
+
pause: at,
|
|
123
|
+
resume: nt,
|
|
124
|
+
isActive: rt
|
|
121
125
|
};
|
|
122
126
|
}
|
|
123
|
-
function
|
|
124
|
-
return e instanceof
|
|
127
|
+
function ot(e) {
|
|
128
|
+
return e instanceof W ? e : Array.isArray(e) ? new W(...e) : new W(e);
|
|
125
129
|
}
|
|
126
|
-
const
|
|
130
|
+
const Y = {
|
|
127
131
|
realistic: {
|
|
128
|
-
outputColorSpace:
|
|
129
|
-
toneMapping:
|
|
132
|
+
outputColorSpace: De,
|
|
133
|
+
toneMapping: Ie,
|
|
130
134
|
toneMappingExposure: 3,
|
|
131
135
|
shadowMap: {
|
|
132
136
|
enabled: !0,
|
|
133
|
-
type:
|
|
137
|
+
type: Be
|
|
134
138
|
}
|
|
135
139
|
}
|
|
136
|
-
},
|
|
137
|
-
for (const
|
|
138
|
-
t[
|
|
140
|
+
}, ye = (e, t) => {
|
|
141
|
+
for (const n of Object.keys(t))
|
|
142
|
+
t[n] instanceof Object && Object.assign(t[n], ye(e[n], t[n]));
|
|
139
143
|
return Object.assign(e || {}, t), e;
|
|
140
|
-
},
|
|
141
|
-
function
|
|
142
|
-
return e.replace(/-([a-z])/g, (t,
|
|
144
|
+
}, it = "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", st = /* @__PURE__ */ ct(it);
|
|
145
|
+
function j(e) {
|
|
146
|
+
return e.replace(/-([a-z])/g, (t, n) => n.toUpperCase());
|
|
143
147
|
}
|
|
144
|
-
function
|
|
145
|
-
const
|
|
146
|
-
for (let
|
|
147
|
-
|
|
148
|
-
return t ? (
|
|
148
|
+
function ct(e, t) {
|
|
149
|
+
const n = /* @__PURE__ */ Object.create(null), a = e.split(",");
|
|
150
|
+
for (let o = 0; o < a.length; o++)
|
|
151
|
+
n[a[o]] = !0;
|
|
152
|
+
return t ? (o) => !!n[o.toLowerCase()] : (o) => !!n[o];
|
|
149
153
|
}
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
+
const ut = (e, t) => {
|
|
155
|
+
const n = /* @__PURE__ */ new Set(), a = [];
|
|
156
|
+
for (const o of e) {
|
|
157
|
+
const i = t(o);
|
|
158
|
+
n.has(i) || (n.add(i), a.push(o));
|
|
159
|
+
}
|
|
160
|
+
return a;
|
|
161
|
+
}, Mt = !0, oe = "[TresJS ▲ ■ ●] ";
|
|
162
|
+
function O() {
|
|
163
|
+
function e(a, o) {
|
|
164
|
+
console.error(`${oe} ${a}`, o || "");
|
|
154
165
|
}
|
|
155
166
|
function t(a) {
|
|
156
|
-
console.warn(`${
|
|
167
|
+
console.warn(`${oe} ${a}`);
|
|
157
168
|
}
|
|
158
|
-
function
|
|
169
|
+
function n(a, o) {
|
|
159
170
|
}
|
|
160
171
|
return {
|
|
161
172
|
logError: e,
|
|
162
173
|
logWarning: t,
|
|
163
|
-
logMessage:
|
|
174
|
+
logMessage: n
|
|
164
175
|
};
|
|
165
176
|
}
|
|
166
|
-
function
|
|
167
|
-
|
|
168
|
-
const t = we(), o = E(!1), {
|
|
177
|
+
function ft(e) {
|
|
178
|
+
const t = Ae(), n = G(!1), {
|
|
169
179
|
alpha: a = !0,
|
|
170
|
-
antialias:
|
|
171
|
-
depth:
|
|
172
|
-
logarithmicDepthBuffer:
|
|
173
|
-
failIfMajorPerformanceCaveat:
|
|
180
|
+
antialias: o = !0,
|
|
181
|
+
depth: i,
|
|
182
|
+
logarithmicDepthBuffer: u,
|
|
183
|
+
failIfMajorPerformanceCaveat: r,
|
|
174
184
|
precision: s,
|
|
175
|
-
premultipliedAlpha:
|
|
185
|
+
premultipliedAlpha: c,
|
|
176
186
|
stencil: l,
|
|
177
187
|
shadows: d = !1,
|
|
178
|
-
shadowMapType:
|
|
179
|
-
useLegacyLights:
|
|
180
|
-
outputColorSpace:
|
|
181
|
-
toneMapping:
|
|
182
|
-
toneMappingExposure:
|
|
188
|
+
shadowMapType: p = He,
|
|
189
|
+
useLegacyLights: y = !1,
|
|
190
|
+
outputColorSpace: h = ae,
|
|
191
|
+
toneMapping: v = ne,
|
|
192
|
+
toneMappingExposure: M = 1,
|
|
183
193
|
context: w = void 0,
|
|
184
|
-
powerPreference:
|
|
185
|
-
preserveDrawingBuffer:
|
|
186
|
-
clearColor:
|
|
187
|
-
windowSize:
|
|
188
|
-
preset:
|
|
189
|
-
} =
|
|
190
|
-
|
|
191
|
-
|
|
194
|
+
powerPreference: E = "default",
|
|
195
|
+
preserveDrawingBuffer: k = !1,
|
|
196
|
+
clearColor: C,
|
|
197
|
+
windowSize: R = !1,
|
|
198
|
+
preset: N = void 0
|
|
199
|
+
} = ue(e), { state: f, setState: g } = S(), { width: X, height: Q } = m(R) == !0 || m(R) === "" || m(R) === "true" ? Ye() : $e(f.container), { logError: Ee, logWarning: Me } = O(), { pixelRatio: Z } = qe(), { pause: Pe, resume: Ce } = he(), F = V(() => X.value / Q.value);
|
|
200
|
+
setTimeout(() => {
|
|
201
|
+
var P;
|
|
202
|
+
!m(R) && !((P = f.canvas) != null && P.value.offsetHeight) && Me(`Oops... Seems like your canvas height is currently 0px, it's posible that you couldn't watch your scene.
|
|
203
|
+
You could set windowSize=true to force the canvas to be the size of the window.`);
|
|
204
|
+
}, 1e3);
|
|
192
205
|
const ee = () => {
|
|
193
|
-
t.value && (t.value.setSize(
|
|
206
|
+
t.value && (t.value.setSize(X.value, Q.value), t.value.setPixelRatio(Math.min(Z.value, 2)));
|
|
194
207
|
}, te = () => {
|
|
195
208
|
if (!t.value)
|
|
196
209
|
return;
|
|
197
|
-
const
|
|
198
|
-
if (
|
|
199
|
-
|
|
210
|
+
const P = m(N);
|
|
211
|
+
if (P) {
|
|
212
|
+
P in Y || Ee("Renderer Preset must be one of these: " + Object.keys(Y).join(", ")), ye(t.value, Y[P]);
|
|
200
213
|
return;
|
|
201
214
|
}
|
|
202
|
-
t.value.shadowMap.enabled =
|
|
203
|
-
},
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
canvas:
|
|
207
|
-
alpha:
|
|
208
|
-
antialias:
|
|
209
|
-
context:
|
|
210
|
-
depth:
|
|
211
|
-
failIfMajorPerformanceCaveat:
|
|
212
|
-
logarithmicDepthBuffer: u
|
|
213
|
-
powerPreference:
|
|
214
|
-
precision:
|
|
215
|
-
stencil:
|
|
216
|
-
preserveDrawingBuffer:
|
|
217
|
-
premultipliedAlpha:
|
|
218
|
-
}),
|
|
219
|
-
},
|
|
220
|
-
t.value && (t.value.dispose(), t.value = void 0,
|
|
215
|
+
t.value.shadowMap.enabled = m(d), t.value.shadowMap.type = m(p), t.value.toneMapping = m(v) || ne, t.value.toneMappingExposure = m(M), t.value.outputColorSpace = m(h) || ae, C != null && C.value && t.value.setClearColor(ot(m(C))), t.value.useLegacyLights = m(y);
|
|
216
|
+
}, Re = () => {
|
|
217
|
+
const P = U(f.canvas);
|
|
218
|
+
P && (t.value = new Ge({
|
|
219
|
+
canvas: P,
|
|
220
|
+
alpha: m(a),
|
|
221
|
+
antialias: m(o),
|
|
222
|
+
context: m(w),
|
|
223
|
+
depth: m(i),
|
|
224
|
+
failIfMajorPerformanceCaveat: m(r),
|
|
225
|
+
logarithmicDepthBuffer: m(u),
|
|
226
|
+
powerPreference: m(E),
|
|
227
|
+
precision: m(s),
|
|
228
|
+
stencil: m(l),
|
|
229
|
+
preserveDrawingBuffer: m(k),
|
|
230
|
+
premultipliedAlpha: m(c)
|
|
231
|
+
}), g("renderer", t.value), g("clock", new pe()), g("aspectRatio", F), te(), ee(), Ce(), n.value = !0);
|
|
232
|
+
}, xe = () => {
|
|
233
|
+
t.value && (t.value.dispose(), t.value = void 0, n.value = !1, Pe());
|
|
221
234
|
};
|
|
222
|
-
return
|
|
223
|
-
[d,
|
|
235
|
+
return D([F, Z], ee), D(
|
|
236
|
+
[d, p, h, y, v, M, C],
|
|
224
237
|
te
|
|
225
|
-
),
|
|
226
|
-
() => [
|
|
238
|
+
), D(
|
|
239
|
+
() => [f.canvas, f.container],
|
|
227
240
|
() => {
|
|
228
|
-
|
|
241
|
+
U(f.canvas) && U(f.container) && Re();
|
|
229
242
|
},
|
|
230
243
|
{ immediate: !0, deep: !0 }
|
|
231
244
|
), {
|
|
232
245
|
renderer: t,
|
|
233
|
-
isReady:
|
|
234
|
-
dispose:
|
|
235
|
-
aspectRatio:
|
|
246
|
+
isReady: n,
|
|
247
|
+
dispose: xe,
|
|
248
|
+
aspectRatio: F
|
|
236
249
|
};
|
|
237
250
|
}
|
|
238
|
-
function
|
|
251
|
+
function lt(e) {
|
|
239
252
|
const t = { nodes: {}, materials: {} };
|
|
240
|
-
return e && e.traverse((
|
|
241
|
-
|
|
253
|
+
return e && e.traverse((n) => {
|
|
254
|
+
n.name && (t.nodes[n.name] = n), n.material && !t.materials[n.material.name] && (t.materials[n.material.name] = n.material);
|
|
242
255
|
}), t;
|
|
243
256
|
}
|
|
244
|
-
async function
|
|
245
|
-
const { logError:
|
|
246
|
-
|
|
257
|
+
async function Pt(e, t, n, a, o) {
|
|
258
|
+
const { logError: i } = O(), u = new e();
|
|
259
|
+
o && o(u), n && n(u);
|
|
247
260
|
const s = (Array.isArray(t) ? t : [t]).map(
|
|
248
|
-
(
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
(
|
|
252
|
-
|
|
261
|
+
(c) => new Promise((l, d) => {
|
|
262
|
+
u.load(
|
|
263
|
+
c,
|
|
264
|
+
(p) => {
|
|
265
|
+
p.scene && Object.assign(p, lt(p.scene)), l(p);
|
|
253
266
|
},
|
|
254
267
|
a,
|
|
255
|
-
(
|
|
268
|
+
(p) => d(i("[useLoader] - Failed to load resource", p))
|
|
256
269
|
);
|
|
257
270
|
})
|
|
258
271
|
);
|
|
259
|
-
return
|
|
272
|
+
return ge(t) ? await Promise.all(s) : await s[0];
|
|
260
273
|
}
|
|
261
|
-
async function
|
|
262
|
-
const t = new
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
(
|
|
274
|
+
async function Ct(e) {
|
|
275
|
+
const t = new Ve(), n = new Ne(t), a = (o) => new Promise((i, u) => {
|
|
276
|
+
n.load(
|
|
277
|
+
o,
|
|
278
|
+
(r) => i(r),
|
|
266
279
|
() => null,
|
|
267
280
|
() => {
|
|
268
|
-
|
|
281
|
+
u(new Error("[useTextures] - Failed to load texture"));
|
|
269
282
|
}
|
|
270
283
|
);
|
|
271
284
|
});
|
|
272
|
-
if (
|
|
273
|
-
const
|
|
274
|
-
return e.length > 1 ?
|
|
285
|
+
if (ge(e)) {
|
|
286
|
+
const o = await Promise.all(e.map((i) => a(i)));
|
|
287
|
+
return e.length > 1 ? o : o[0];
|
|
275
288
|
} else {
|
|
276
289
|
const {
|
|
277
|
-
map:
|
|
278
|
-
displacementMap:
|
|
279
|
-
normalMap:
|
|
280
|
-
roughnessMap:
|
|
290
|
+
map: o,
|
|
291
|
+
displacementMap: i,
|
|
292
|
+
normalMap: u,
|
|
293
|
+
roughnessMap: r,
|
|
281
294
|
metalnessMap: s,
|
|
282
|
-
aoMap:
|
|
295
|
+
aoMap: c,
|
|
283
296
|
alphaMap: l,
|
|
284
297
|
matcap: d
|
|
285
298
|
} = e;
|
|
286
299
|
return {
|
|
287
|
-
map:
|
|
288
|
-
displacementMap:
|
|
289
|
-
normalMap:
|
|
290
|
-
roughnessMap:
|
|
300
|
+
map: o ? await a(o) : null,
|
|
301
|
+
displacementMap: i ? await a(i) : null,
|
|
302
|
+
normalMap: u ? await a(u) : null,
|
|
303
|
+
roughnessMap: r ? await a(r) : null,
|
|
291
304
|
metalnessMap: s ? await a(s) : null,
|
|
292
|
-
aoMap:
|
|
305
|
+
aoMap: c ? await a(c) : null,
|
|
293
306
|
alphaMap: l ? await a(l) : null,
|
|
294
307
|
matcap: d ? await a(d) : null
|
|
295
308
|
};
|
|
296
309
|
}
|
|
297
310
|
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
311
|
+
const dt = (e) => {
|
|
312
|
+
const { state: t } = S(), n = V(() => {
|
|
313
|
+
var f;
|
|
314
|
+
return (f = t.canvas) == null ? void 0 : f.value;
|
|
315
|
+
}), { x: a, y: o } = Ke({ target: n }), { width: i, height: u, top: r, left: s } = Je(n), c = new Fe(), l = ({ x: f, y: g }) => {
|
|
316
|
+
if (n.value)
|
|
317
|
+
return {
|
|
318
|
+
x: (f - s.value) / i.value * 2 - 1,
|
|
319
|
+
y: -((g - r.value) / u.value) * 2 + 1
|
|
320
|
+
};
|
|
321
|
+
}, d = ({ x: f, y: g }) => {
|
|
322
|
+
if (t.camera)
|
|
323
|
+
return c.setFromCamera(new ze(f, g), t.camera), c.intersectObjects(e.value, !1);
|
|
324
|
+
}, p = (f) => {
|
|
325
|
+
const g = l({
|
|
326
|
+
x: (f == null ? void 0 : f.clientX) ?? a.value,
|
|
327
|
+
y: (f == null ? void 0 : f.clientY) ?? o.value
|
|
328
|
+
});
|
|
329
|
+
return g ? d(g) || [] : [];
|
|
330
|
+
}, y = V(() => p()), h = A(), v = A(), M = (f, g) => {
|
|
331
|
+
f.trigger({ event: g, intersects: p(g) });
|
|
332
|
+
}, w = (f) => {
|
|
333
|
+
M(v, f);
|
|
334
|
+
};
|
|
335
|
+
let E;
|
|
336
|
+
const k = (f) => {
|
|
337
|
+
var g;
|
|
338
|
+
E = (g = p(f)[0]) == null ? void 0 : g.object;
|
|
339
|
+
}, C = (f) => {
|
|
340
|
+
var g;
|
|
341
|
+
f instanceof PointerEvent && E === ((g = p(f)[0]) == null ? void 0 : g.object) && M(h, f);
|
|
342
|
+
}, R = (f) => v.trigger({ event: f, intersects: [] }), N = fe(() => {
|
|
343
|
+
n != null && n.value && (n.value.addEventListener("pointerup", C), n.value.addEventListener("pointerdown", k), n.value.addEventListener("pointermove", w), n.value.addEventListener("pointerleave", R), N());
|
|
344
|
+
});
|
|
345
|
+
return le(() => {
|
|
346
|
+
n != null && n.value && (n.value.removeEventListener("pointerup", C), n.value.removeEventListener("pointerdown", k), n.value.removeEventListener("pointermove", w), n.value.removeEventListener("pointerleave", R));
|
|
308
347
|
}), {
|
|
309
|
-
|
|
310
|
-
|
|
348
|
+
intersects: y,
|
|
349
|
+
onClick: (f) => h.on(f).off,
|
|
350
|
+
onPointerMove: (f) => v.on(f).off
|
|
311
351
|
};
|
|
312
|
-
}
|
|
313
|
-
function
|
|
314
|
-
const { logWarning: e } =
|
|
315
|
-
function t(a,
|
|
316
|
-
let
|
|
317
|
-
return a.traverse((
|
|
318
|
-
|
|
319
|
-
}),
|
|
352
|
+
};
|
|
353
|
+
function Rt() {
|
|
354
|
+
const { logWarning: e } = O();
|
|
355
|
+
function t(a, o, i) {
|
|
356
|
+
let u = null;
|
|
357
|
+
return a.traverse((r) => {
|
|
358
|
+
r[o] === i && (u = r);
|
|
359
|
+
}), u || e(`Child with ${o} '${i}' not found.`), u;
|
|
320
360
|
}
|
|
321
|
-
function
|
|
322
|
-
return t(a, "name",
|
|
361
|
+
function n(a, o) {
|
|
362
|
+
return t(a, "name", o);
|
|
323
363
|
}
|
|
324
364
|
return {
|
|
325
365
|
seek: t,
|
|
326
|
-
seekByName:
|
|
366
|
+
seekByName: n
|
|
327
367
|
};
|
|
328
368
|
}
|
|
329
|
-
const pt =
|
|
330
|
-
|
|
331
|
-
|
|
369
|
+
const pt = () => {
|
|
370
|
+
const e = Se({
|
|
371
|
+
click: /* @__PURE__ */ new Map(),
|
|
372
|
+
pointerMove: /* @__PURE__ */ new Map(),
|
|
373
|
+
pointerEnter: /* @__PURE__ */ new Map(),
|
|
374
|
+
pointerLeave: /* @__PURE__ */ new Map()
|
|
375
|
+
}), t = (r) => {
|
|
376
|
+
Object.values(e).forEach((s) => s.delete(r));
|
|
377
|
+
}, n = (r) => {
|
|
378
|
+
const { onClick: s, onPointerMove: c, onPointerEnter: l, onPointerLeave: d } = r;
|
|
379
|
+
s && e.click.set(r, s), c && e.pointerMove.set(r, c), l && e.pointerEnter.set(r, l), d && e.pointerLeave.set(r, d), r.addEventListener("removed", () => {
|
|
380
|
+
r.traverse((p) => {
|
|
381
|
+
t(p);
|
|
382
|
+
}), t(r);
|
|
383
|
+
});
|
|
384
|
+
}, a = V(
|
|
385
|
+
() => ut(
|
|
386
|
+
Object.values(e).map((r) => Array.from(r.keys())).flat(),
|
|
387
|
+
({ uuid: r }) => r
|
|
388
|
+
)
|
|
389
|
+
), { onClick: o, onPointerMove: i } = dt(a);
|
|
390
|
+
o(({ intersects: r, event: s }) => {
|
|
391
|
+
var c;
|
|
392
|
+
r.length && ((c = e.click.get(r[0].object)) == null || c(r[0], s));
|
|
393
|
+
});
|
|
394
|
+
let u;
|
|
395
|
+
return i(({ intersects: r, event: s }) => {
|
|
396
|
+
var y, h, v, M;
|
|
397
|
+
const c = (y = r == null ? void 0 : r[0]) == null ? void 0 : y.object, { pointerLeave: l, pointerEnter: d, pointerMove: p } = e;
|
|
398
|
+
u && u !== c && ((h = l.get(u)) == null || h(u, s)), c && (u !== c && ((v = d.get(c)) == null || v(r[0], s)), (M = p.get(c)) == null || M(r[0], s)), u = c || null;
|
|
399
|
+
}), {
|
|
400
|
+
registerObject: n,
|
|
401
|
+
deregisterObject: t
|
|
402
|
+
};
|
|
403
|
+
}, H = {
|
|
332
404
|
GEOMETRY_VIA_PROP: "tres__geometryViaProp",
|
|
333
|
-
MATERIAL_VIA_PROP: "tres__materialViaProp"
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
405
|
+
MATERIAL_VIA_PROP: "tres__materialViaProp",
|
|
406
|
+
REGISTER_AT_POINTER_EVENT_HANDLER: "tres__registerAtPointerEventHandler"
|
|
407
|
+
};
|
|
408
|
+
let $ = null, T = null;
|
|
409
|
+
const { logError: ie } = O(), mt = {
|
|
410
|
+
createElement(e, t, n, a) {
|
|
411
|
+
var s, c;
|
|
412
|
+
if (a || (a = {}), a.args || (a.args = []), e === "template" || st(e))
|
|
340
413
|
return null;
|
|
341
|
-
let
|
|
414
|
+
let o = e.replace("Tres", ""), i;
|
|
342
415
|
if (e === "primitive") {
|
|
343
|
-
(a == null ? void 0 : a.object) === void 0 &&
|
|
416
|
+
(a == null ? void 0 : a.object) === void 0 && ie("Tres primitives need a prop 'object'");
|
|
344
417
|
const l = a.object;
|
|
345
|
-
|
|
418
|
+
o = l.type, i = Object.assign(l, { type: o, attach: a.attach, primitive: !0 });
|
|
346
419
|
} else {
|
|
347
|
-
const l =
|
|
348
|
-
l ||
|
|
349
|
-
}
|
|
350
|
-
if (r.isCamera && le) {
|
|
351
|
-
a != null && a.position || r.position.set(3, 3, 3), a != null && a.lookAt || r.lookAt(0, 0, 0);
|
|
352
|
-
const { setFirstCamera: l } = Ee();
|
|
353
|
-
l(r), le = !1;
|
|
420
|
+
const l = me.value[o];
|
|
421
|
+
l || ie(`${o} is not defined on the THREE namespace. Use extend to add it to the catalog.`), i = new l(...a.args);
|
|
354
422
|
}
|
|
355
|
-
(a == null ? void 0 : a.attach) === void 0 && (
|
|
356
|
-
const { GEOMETRY_VIA_PROP:
|
|
357
|
-
return
|
|
423
|
+
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"));
|
|
424
|
+
const { GEOMETRY_VIA_PROP: u, MATERIAL_VIA_PROP: r } = H;
|
|
425
|
+
return i.isObject3D && ((s = a == null ? void 0 : a.material) != null && s.isMaterial && (i.userData[r] = !0), (c = a == null ? void 0 : a.geometry) != null && c.isBufferGeometry && (i.userData[u] = !0)), i;
|
|
358
426
|
},
|
|
359
427
|
insert(e, t) {
|
|
360
|
-
var
|
|
361
|
-
if (t && t.isScene && (
|
|
362
|
-
|
|
428
|
+
var n, a, o, i, u, r, s;
|
|
429
|
+
if (t && t.isScene && (T = t), (((n = e == null ? void 0 : e.__vnode) == null ? void 0 : n.type) === "TresGroup" || ((a = e == null ? void 0 : e.__vnode) == null ? void 0 : a.type) === "TresObject3D") && t === null && !((i = (o = e == null ? void 0 : e.__vnode) == null ? void 0 : o.ctx) != null && i.asyncResolved)) {
|
|
430
|
+
$ = e;
|
|
363
431
|
return;
|
|
364
432
|
} else
|
|
365
|
-
(
|
|
366
|
-
t || (t =
|
|
433
|
+
(u = e == null ? void 0 : e.__vnode) != null && u.type.includes("Controls") && t === null && ($ = T);
|
|
434
|
+
t || (t = $), e != null && e.isObject3D && (t != null && t.isObject3D) ? (t.add(e), e.dispatchEvent({ type: "added" }), (s = (r = T == null ? void 0 : T.userData) == null ? void 0 : r[H.REGISTER_AT_POINTER_EVENT_HANDLER]) == null || s.call(r, e)) : 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));
|
|
367
435
|
},
|
|
368
436
|
remove(e) {
|
|
369
|
-
var t,
|
|
437
|
+
var t, n;
|
|
370
438
|
if (e) {
|
|
371
439
|
if (e.isObject3D) {
|
|
372
|
-
const a = e,
|
|
373
|
-
var s,
|
|
374
|
-
const { GEOMETRY_VIA_PROP:
|
|
375
|
-
|
|
440
|
+
const a = e, o = (i) => {
|
|
441
|
+
var s, c;
|
|
442
|
+
const { GEOMETRY_VIA_PROP: u, MATERIAL_VIA_PROP: r } = H;
|
|
443
|
+
i.userData[r] || (s = i.material) == null || s.dispose(), i.userData[u] || (c = i.geometry) == null || c.dispose();
|
|
376
444
|
};
|
|
377
|
-
a.traverse((
|
|
445
|
+
a.traverse((i) => {
|
|
446
|
+
o(i);
|
|
447
|
+
}), o(a);
|
|
378
448
|
}
|
|
379
|
-
(t = e.removeFromParent) == null || t.call(e), (
|
|
449
|
+
(t = e.removeFromParent) == null || t.call(e), (n = e.dispose) == null || n.call(e);
|
|
380
450
|
}
|
|
381
451
|
},
|
|
382
|
-
patchProp(e, t,
|
|
452
|
+
patchProp(e, t, n, a) {
|
|
383
453
|
if (e) {
|
|
384
|
-
let
|
|
385
|
-
if (
|
|
386
|
-
if (
|
|
454
|
+
let o = e, i = t, u = j(i), r = o == null ? void 0 : o[u];
|
|
455
|
+
if (o.type === "BufferGeometry") {
|
|
456
|
+
if (i === "args")
|
|
387
457
|
return;
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
new
|
|
458
|
+
o.setAttribute(
|
|
459
|
+
j(i),
|
|
460
|
+
new We(...a)
|
|
391
461
|
);
|
|
392
462
|
return;
|
|
393
463
|
}
|
|
394
|
-
if (
|
|
395
|
-
const
|
|
396
|
-
|
|
397
|
-
}
|
|
398
|
-
if (vt(r)) {
|
|
399
|
-
const f = r;
|
|
400
|
-
e.events[f] = a;
|
|
464
|
+
if (i.includes("-") && r === void 0) {
|
|
465
|
+
const c = i.split("-");
|
|
466
|
+
r = c.reduce((l, d) => l[j(d)], o), i = c.pop(), u = i.toLowerCase(), r != null && r.set || (o = c.reduce((l, d) => l[j(d)], o));
|
|
401
467
|
}
|
|
402
468
|
let s = a;
|
|
403
|
-
if (s === "" && (s = !0),
|
|
404
|
-
Array.isArray(s) ? e[
|
|
469
|
+
if (s === "" && (s = !0), re(r)) {
|
|
470
|
+
Array.isArray(s) ? e[u](...s) : e[u](s);
|
|
405
471
|
return;
|
|
406
472
|
}
|
|
407
|
-
!(
|
|
473
|
+
!(r != null && r.set) && !re(r) ? o[u] = s : r.constructor === s.constructor && (r != null && r.copy) ? r == null || r.copy(s) : Array.isArray(s) ? r.set(...s) : !r.isColor && r.setScalar ? r.setScalar(s) : r.set(s);
|
|
408
474
|
}
|
|
409
475
|
},
|
|
410
476
|
parentNode(e) {
|
|
@@ -419,15 +485,15 @@ const gt = {
|
|
|
419
485
|
setScopeId: () => void 0,
|
|
420
486
|
cloneNode: () => void 0,
|
|
421
487
|
insertStaticContent: () => void 0
|
|
422
|
-
}, { createApp:
|
|
423
|
-
const t =
|
|
424
|
-
function
|
|
488
|
+
}, { createApp: vt } = Oe(mt), gt = (e) => {
|
|
489
|
+
const t = vt(n);
|
|
490
|
+
function n() {
|
|
425
491
|
return e && e.default ? e.default() : [];
|
|
426
492
|
}
|
|
427
493
|
return t;
|
|
428
494
|
};
|
|
429
|
-
|
|
430
|
-
const { logWarning:
|
|
495
|
+
ve(q);
|
|
496
|
+
const { logWarning: se } = O(), wt = de({
|
|
431
497
|
name: "TresScene",
|
|
432
498
|
props: [
|
|
433
499
|
"shadows",
|
|
@@ -446,57 +512,54 @@ const { logWarning: de } = F(), bt = be({
|
|
|
446
512
|
"disableRender",
|
|
447
513
|
"camera"
|
|
448
514
|
],
|
|
449
|
-
setup(e, { slots: t, expose:
|
|
450
|
-
e.physicallyCorrectLights === !0 &&
|
|
451
|
-
const a =
|
|
452
|
-
|
|
453
|
-
const
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
}), he(() => {
|
|
459
|
-
c("renderer", null);
|
|
515
|
+
setup(e, { slots: t, expose: n }) {
|
|
516
|
+
e.physicallyCorrectLights === !0 && se("physicallyCorrectLights is deprecated, useLegacyLights is now false by default");
|
|
517
|
+
const a = G(), o = G(), i = new q.Scene(), u = pt(), { setState: r } = S();
|
|
518
|
+
i.userData[H.REGISTER_AT_POINTER_EVENT_HANDLER] = u.registerObject, r("scene", i), r("canvas", o), r("container", a), r("pointerEventHandler", u);
|
|
519
|
+
const { onLoop: s, resume: c } = he();
|
|
520
|
+
ke(() => {
|
|
521
|
+
h();
|
|
522
|
+
}), le(() => {
|
|
523
|
+
r("renderer", null);
|
|
460
524
|
});
|
|
461
|
-
const { activeCamera:
|
|
462
|
-
function
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
m !== null && ((b = (g = (R = m.object) == null ? void 0 : R.events) == null ? void 0 : g.onClick) == null || b.call(g, m));
|
|
525
|
+
const { activeCamera: l, pushCamera: d, clearCameras: p } = tt();
|
|
526
|
+
function y() {
|
|
527
|
+
const w = i.getObjectByProperty("isCamera", !0);
|
|
528
|
+
if (w)
|
|
529
|
+
d(w);
|
|
530
|
+
else {
|
|
531
|
+
se("No camera found. Creating a default perspective camera. To have full control over a camera, please add one to the scene.");
|
|
532
|
+
const E = new q.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1e3);
|
|
533
|
+
E.position.set(3, 3, 3), E.lookAt(0, 0, 0), d(E);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
function h() {
|
|
537
|
+
const { renderer: w } = ft(e);
|
|
538
|
+
e.camera && d(e.camera), s(() => {
|
|
539
|
+
var E;
|
|
540
|
+
l.value && e.disableRender !== !0 && ((E = w.value) == null || E.render(i, l.value));
|
|
478
541
|
});
|
|
479
542
|
}
|
|
480
|
-
let
|
|
481
|
-
function
|
|
482
|
-
|
|
483
|
-
const w =
|
|
484
|
-
|
|
543
|
+
let v;
|
|
544
|
+
function M() {
|
|
545
|
+
v = gt(t);
|
|
546
|
+
const w = S();
|
|
547
|
+
v.provide("useTres", w), v.provide(K, w), v.provide("extend", ve), v.mount(i), y();
|
|
485
548
|
}
|
|
486
|
-
return
|
|
487
|
-
scene:
|
|
488
|
-
}),
|
|
549
|
+
return M(), n({
|
|
550
|
+
scene: i
|
|
551
|
+
}), D(
|
|
489
552
|
() => e.camera,
|
|
490
553
|
(w) => {
|
|
491
|
-
w && (
|
|
554
|
+
w && (p(), d(w));
|
|
492
555
|
}
|
|
493
|
-
), () =>
|
|
494
|
-
|
|
556
|
+
), () => L(
|
|
557
|
+
L(
|
|
495
558
|
"div",
|
|
496
559
|
{
|
|
497
560
|
ref: a,
|
|
498
|
-
"data-scene":
|
|
499
|
-
key:
|
|
561
|
+
"data-scene": i.uuid,
|
|
562
|
+
key: i.uuid,
|
|
500
563
|
style: {
|
|
501
564
|
position: "relative",
|
|
502
565
|
width: "100%",
|
|
@@ -506,7 +569,7 @@ const { logWarning: de } = F(), bt = be({
|
|
|
506
569
|
}
|
|
507
570
|
},
|
|
508
571
|
[
|
|
509
|
-
|
|
572
|
+
L(
|
|
510
573
|
"div",
|
|
511
574
|
{
|
|
512
575
|
style: {
|
|
@@ -515,9 +578,9 @@ const { logWarning: de } = F(), bt = be({
|
|
|
515
578
|
}
|
|
516
579
|
},
|
|
517
580
|
[
|
|
518
|
-
|
|
519
|
-
ref:
|
|
520
|
-
"data-scene":
|
|
581
|
+
L("canvas", {
|
|
582
|
+
ref: o,
|
|
583
|
+
"data-scene": i.uuid,
|
|
521
584
|
style: {
|
|
522
585
|
display: "block",
|
|
523
586
|
width: "100%",
|
|
@@ -533,7 +596,7 @@ const { logWarning: de } = F(), bt = be({
|
|
|
533
596
|
)
|
|
534
597
|
);
|
|
535
598
|
}
|
|
536
|
-
}),
|
|
599
|
+
}), bt = de({
|
|
537
600
|
name: "TresCanvas",
|
|
538
601
|
props: [
|
|
539
602
|
"shadows",
|
|
@@ -552,32 +615,33 @@ const { logWarning: de } = F(), bt = be({
|
|
|
552
615
|
"disableRender",
|
|
553
616
|
"camera"
|
|
554
617
|
],
|
|
555
|
-
setup(e, { slots: t, expose:
|
|
556
|
-
const a =
|
|
557
|
-
return
|
|
618
|
+
setup(e, { slots: t, expose: n }) {
|
|
619
|
+
const a = Qe();
|
|
620
|
+
return n(a), () => L(wt, e, t);
|
|
558
621
|
}
|
|
559
|
-
}),
|
|
622
|
+
}), xt = {
|
|
560
623
|
install(e) {
|
|
561
|
-
e.component("TresCanvas",
|
|
624
|
+
e.component("TresCanvas", bt);
|
|
562
625
|
}
|
|
563
626
|
};
|
|
564
627
|
export {
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
628
|
+
Ze as CameraType,
|
|
629
|
+
K as TRES_CONTEXT_KEY,
|
|
630
|
+
bt as TresCanvas,
|
|
631
|
+
me as catalogue,
|
|
632
|
+
xt as default,
|
|
633
|
+
ve as extend,
|
|
634
|
+
Mt as isProd,
|
|
635
|
+
lt as trasverseObjects,
|
|
636
|
+
tt as useCamera,
|
|
637
|
+
Pt as useLoader,
|
|
638
|
+
O as useLogger,
|
|
639
|
+
pt as usePointerEventHandler,
|
|
640
|
+
dt as useRaycaster,
|
|
641
|
+
he as useRenderLoop,
|
|
642
|
+
ft as useRenderer,
|
|
643
|
+
Rt as useSeek,
|
|
644
|
+
Ct as useTexture,
|
|
645
|
+
S as useTres,
|
|
646
|
+
Qe as useTresProvider
|
|
583
647
|
};
|