@tresjs/core 2.1.3 → 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 +373 -310
- package/dist/tres.umd.cjs +3 -3
- package/dist/types/index.d.ts +0 -1
- package/dist/utils/index.d.ts +1 -0
- package/package.json +7 -5
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,343 +73,404 @@ function xe() {
|
|
|
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: at, resume: nt, isActive: rt } =
|
|
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:
|
|
119
|
+
onBeforeLoop: we.on,
|
|
120
|
+
onLoop: be.on,
|
|
121
|
+
onAfterLoop: J.on,
|
|
118
122
|
pause: at,
|
|
119
123
|
resume: nt,
|
|
120
124
|
isActive: rt
|
|
121
125
|
};
|
|
122
126
|
}
|
|
123
127
|
function ot(e) {
|
|
124
|
-
return e instanceof
|
|
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
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);
|
|
141
|
-
function
|
|
142
|
-
return e.replace(/-([a-z])/g, (t,
|
|
145
|
+
function j(e) {
|
|
146
|
+
return e.replace(/-([a-z])/g, (t, n) => n.toUpperCase());
|
|
143
147
|
}
|
|
144
148
|
function ct(e, t) {
|
|
145
|
-
const
|
|
146
|
-
for (let
|
|
147
|
-
|
|
148
|
-
return 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
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
|
-
const t =
|
|
177
|
+
function ft(e) {
|
|
178
|
+
const t = Ae(), n = G(!1), {
|
|
168
179
|
alpha: a = !0,
|
|
169
|
-
antialias:
|
|
170
|
-
depth:
|
|
171
|
-
logarithmicDepthBuffer:
|
|
172
|
-
failIfMajorPerformanceCaveat:
|
|
180
|
+
antialias: o = !0,
|
|
181
|
+
depth: i,
|
|
182
|
+
logarithmicDepthBuffer: u,
|
|
183
|
+
failIfMajorPerformanceCaveat: r,
|
|
173
184
|
precision: s,
|
|
174
|
-
premultipliedAlpha:
|
|
185
|
+
premultipliedAlpha: c,
|
|
175
186
|
stencil: l,
|
|
176
187
|
shadows: d = !1,
|
|
177
|
-
shadowMapType:
|
|
178
|
-
useLegacyLights:
|
|
179
|
-
outputColorSpace:
|
|
180
|
-
toneMapping:
|
|
181
|
-
toneMappingExposure:
|
|
188
|
+
shadowMapType: p = He,
|
|
189
|
+
useLegacyLights: y = !1,
|
|
190
|
+
outputColorSpace: h = ae,
|
|
191
|
+
toneMapping: v = ne,
|
|
192
|
+
toneMappingExposure: M = 1,
|
|
182
193
|
context: w = void 0,
|
|
183
|
-
powerPreference:
|
|
184
|
-
preserveDrawingBuffer:
|
|
185
|
-
clearColor:
|
|
186
|
-
windowSize:
|
|
187
|
-
preset:
|
|
188
|
-
} =
|
|
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);
|
|
189
200
|
setTimeout(() => {
|
|
190
|
-
|
|
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.
|
|
191
203
|
You could set windowSize=true to force the canvas to be the size of the window.`);
|
|
192
204
|
}, 1e3);
|
|
193
205
|
const ee = () => {
|
|
194
|
-
t.value && (t.value.setSize(
|
|
206
|
+
t.value && (t.value.setSize(X.value, Q.value), t.value.setPixelRatio(Math.min(Z.value, 2)));
|
|
195
207
|
}, te = () => {
|
|
196
208
|
if (!t.value)
|
|
197
209
|
return;
|
|
198
|
-
const
|
|
199
|
-
if (
|
|
200
|
-
|
|
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]);
|
|
201
213
|
return;
|
|
202
214
|
}
|
|
203
|
-
t.value.shadowMap.enabled =
|
|
204
|
-
},
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
canvas:
|
|
208
|
-
alpha:
|
|
209
|
-
antialias:
|
|
210
|
-
context:
|
|
211
|
-
depth:
|
|
212
|
-
failIfMajorPerformanceCaveat:
|
|
213
|
-
logarithmicDepthBuffer:
|
|
214
|
-
powerPreference:
|
|
215
|
-
precision:
|
|
216
|
-
stencil:
|
|
217
|
-
preserveDrawingBuffer:
|
|
218
|
-
premultipliedAlpha:
|
|
219
|
-
}),
|
|
220
|
-
},
|
|
221
|
-
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());
|
|
222
234
|
};
|
|
223
|
-
return
|
|
224
|
-
[d,
|
|
235
|
+
return D([F, Z], ee), D(
|
|
236
|
+
[d, p, h, y, v, M, C],
|
|
225
237
|
te
|
|
226
|
-
),
|
|
227
|
-
() => [
|
|
238
|
+
), D(
|
|
239
|
+
() => [f.canvas, f.container],
|
|
228
240
|
() => {
|
|
229
|
-
|
|
241
|
+
U(f.canvas) && U(f.container) && Re();
|
|
230
242
|
},
|
|
231
243
|
{ immediate: !0, deep: !0 }
|
|
232
244
|
), {
|
|
233
245
|
renderer: t,
|
|
234
|
-
isReady:
|
|
235
|
-
dispose:
|
|
236
|
-
aspectRatio:
|
|
246
|
+
isReady: n,
|
|
247
|
+
dispose: xe,
|
|
248
|
+
aspectRatio: F
|
|
237
249
|
};
|
|
238
250
|
}
|
|
239
|
-
function
|
|
251
|
+
function lt(e) {
|
|
240
252
|
const t = { nodes: {}, materials: {} };
|
|
241
|
-
return e && e.traverse((
|
|
242
|
-
|
|
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);
|
|
243
255
|
}), t;
|
|
244
256
|
}
|
|
245
|
-
async function
|
|
246
|
-
const { logError:
|
|
247
|
-
|
|
257
|
+
async function Pt(e, t, n, a, o) {
|
|
258
|
+
const { logError: i } = O(), u = new e();
|
|
259
|
+
o && o(u), n && n(u);
|
|
248
260
|
const s = (Array.isArray(t) ? t : [t]).map(
|
|
249
|
-
(
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
(
|
|
253
|
-
|
|
261
|
+
(c) => new Promise((l, d) => {
|
|
262
|
+
u.load(
|
|
263
|
+
c,
|
|
264
|
+
(p) => {
|
|
265
|
+
p.scene && Object.assign(p, lt(p.scene)), l(p);
|
|
254
266
|
},
|
|
255
267
|
a,
|
|
256
|
-
(
|
|
268
|
+
(p) => d(i("[useLoader] - Failed to load resource", p))
|
|
257
269
|
);
|
|
258
270
|
})
|
|
259
271
|
);
|
|
260
|
-
return
|
|
272
|
+
return ge(t) ? await Promise.all(s) : await s[0];
|
|
261
273
|
}
|
|
262
|
-
async function
|
|
263
|
-
const t = new Ve(),
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
(
|
|
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),
|
|
267
279
|
() => null,
|
|
268
280
|
() => {
|
|
269
|
-
|
|
281
|
+
u(new Error("[useTextures] - Failed to load texture"));
|
|
270
282
|
}
|
|
271
283
|
);
|
|
272
284
|
});
|
|
273
|
-
if (
|
|
274
|
-
const
|
|
275
|
-
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];
|
|
276
288
|
} else {
|
|
277
289
|
const {
|
|
278
|
-
map:
|
|
279
|
-
displacementMap:
|
|
280
|
-
normalMap:
|
|
281
|
-
roughnessMap:
|
|
290
|
+
map: o,
|
|
291
|
+
displacementMap: i,
|
|
292
|
+
normalMap: u,
|
|
293
|
+
roughnessMap: r,
|
|
282
294
|
metalnessMap: s,
|
|
283
|
-
aoMap:
|
|
295
|
+
aoMap: c,
|
|
284
296
|
alphaMap: l,
|
|
285
297
|
matcap: d
|
|
286
298
|
} = e;
|
|
287
299
|
return {
|
|
288
|
-
map:
|
|
289
|
-
displacementMap:
|
|
290
|
-
normalMap:
|
|
291
|
-
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,
|
|
292
304
|
metalnessMap: s ? await a(s) : null,
|
|
293
|
-
aoMap:
|
|
305
|
+
aoMap: c ? await a(c) : null,
|
|
294
306
|
alphaMap: l ? await a(l) : null,
|
|
295
307
|
matcap: d ? await a(d) : null
|
|
296
308
|
};
|
|
297
309
|
}
|
|
298
310
|
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
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));
|
|
309
347
|
}), {
|
|
310
|
-
|
|
311
|
-
|
|
348
|
+
intersects: y,
|
|
349
|
+
onClick: (f) => h.on(f).off,
|
|
350
|
+
onPointerMove: (f) => v.on(f).off
|
|
312
351
|
};
|
|
313
|
-
}
|
|
314
|
-
function
|
|
315
|
-
const { logWarning: e } =
|
|
316
|
-
function t(a,
|
|
317
|
-
let
|
|
318
|
-
return a.traverse((
|
|
319
|
-
|
|
320
|
-
}),
|
|
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;
|
|
321
360
|
}
|
|
322
|
-
function
|
|
323
|
-
return t(a, "name",
|
|
361
|
+
function n(a, o) {
|
|
362
|
+
return t(a, "name", o);
|
|
324
363
|
}
|
|
325
364
|
return {
|
|
326
365
|
seek: t,
|
|
327
|
-
seekByName:
|
|
366
|
+
seekByName: n
|
|
328
367
|
};
|
|
329
368
|
}
|
|
330
|
-
const
|
|
331
|
-
|
|
332
|
-
|
|
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 = {
|
|
333
404
|
GEOMETRY_VIA_PROP: "tres__geometryViaProp",
|
|
334
|
-
MATERIAL_VIA_PROP: "tres__materialViaProp"
|
|
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;
|
|
340
412
|
if (a || (a = {}), a.args || (a.args = []), e === "template" || st(e))
|
|
341
413
|
return null;
|
|
342
|
-
let
|
|
414
|
+
let o = e.replace("Tres", ""), i;
|
|
343
415
|
if (e === "primitive") {
|
|
344
|
-
(a == null ? void 0 : a.object) === void 0 &&
|
|
416
|
+
(a == null ? void 0 : a.object) === void 0 && ie("Tres primitives need a prop 'object'");
|
|
345
417
|
const l = a.object;
|
|
346
|
-
|
|
418
|
+
o = l.type, i = Object.assign(l, { type: o, attach: a.attach, primitive: !0 });
|
|
347
419
|
} else {
|
|
348
|
-
const l =
|
|
349
|
-
l ||
|
|
350
|
-
}
|
|
351
|
-
if (r.isCamera && ue) {
|
|
352
|
-
a != null && a.position || r.position.set(3, 3, 3), a != null && a.lookAt || r.lookAt(0, 0, 0);
|
|
353
|
-
const { setFirstCamera: l } = xe();
|
|
354
|
-
l(r), ue = !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);
|
|
355
422
|
}
|
|
356
|
-
(a == null ? void 0 : a.attach) === void 0 && (
|
|
357
|
-
const { GEOMETRY_VIA_PROP:
|
|
358
|
-
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;
|
|
359
426
|
},
|
|
360
427
|
insert(e, t) {
|
|
361
|
-
var
|
|
362
|
-
if (t && t.isScene && (
|
|
363
|
-
|
|
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;
|
|
364
431
|
return;
|
|
365
432
|
} else
|
|
366
|
-
(
|
|
367
|
-
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));
|
|
368
435
|
},
|
|
369
436
|
remove(e) {
|
|
370
|
-
var t,
|
|
437
|
+
var t, n;
|
|
371
438
|
if (e) {
|
|
372
439
|
if (e.isObject3D) {
|
|
373
|
-
const a = e,
|
|
374
|
-
var s,
|
|
375
|
-
const { GEOMETRY_VIA_PROP:
|
|
376
|
-
|
|
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();
|
|
377
444
|
};
|
|
378
|
-
a.traverse((
|
|
445
|
+
a.traverse((i) => {
|
|
446
|
+
o(i);
|
|
447
|
+
}), o(a);
|
|
379
448
|
}
|
|
380
|
-
(t = e.removeFromParent) == null || t.call(e), (
|
|
449
|
+
(t = e.removeFromParent) == null || t.call(e), (n = e.dispose) == null || n.call(e);
|
|
381
450
|
}
|
|
382
451
|
},
|
|
383
|
-
patchProp(e, t,
|
|
452
|
+
patchProp(e, t, n, a) {
|
|
384
453
|
if (e) {
|
|
385
|
-
let
|
|
386
|
-
if (
|
|
387
|
-
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")
|
|
388
457
|
return;
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
new
|
|
458
|
+
o.setAttribute(
|
|
459
|
+
j(i),
|
|
460
|
+
new We(...a)
|
|
392
461
|
);
|
|
393
462
|
return;
|
|
394
463
|
}
|
|
395
|
-
if (
|
|
396
|
-
const
|
|
397
|
-
|
|
398
|
-
}
|
|
399
|
-
if (mt(r)) {
|
|
400
|
-
const u = r;
|
|
401
|
-
e.events[u] = 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));
|
|
402
467
|
}
|
|
403
468
|
let s = a;
|
|
404
|
-
if (s === "" && (s = !0), re(
|
|
405
|
-
Array.isArray(s) ? e[
|
|
469
|
+
if (s === "" && (s = !0), re(r)) {
|
|
470
|
+
Array.isArray(s) ? e[u](...s) : e[u](s);
|
|
406
471
|
return;
|
|
407
472
|
}
|
|
408
|
-
!(
|
|
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);
|
|
409
474
|
}
|
|
410
475
|
},
|
|
411
476
|
parentNode(e) {
|
|
@@ -420,15 +485,15 @@ const pt = {
|
|
|
420
485
|
setScopeId: () => void 0,
|
|
421
486
|
cloneNode: () => void 0,
|
|
422
487
|
insertStaticContent: () => void 0
|
|
423
|
-
}, { createApp: vt } =
|
|
424
|
-
const t = vt(
|
|
425
|
-
function
|
|
488
|
+
}, { createApp: vt } = Oe(mt), gt = (e) => {
|
|
489
|
+
const t = vt(n);
|
|
490
|
+
function n() {
|
|
426
491
|
return e && e.default ? e.default() : [];
|
|
427
492
|
}
|
|
428
493
|
return t;
|
|
429
494
|
};
|
|
430
|
-
|
|
431
|
-
const { logWarning:
|
|
495
|
+
ve(q);
|
|
496
|
+
const { logWarning: se } = O(), wt = de({
|
|
432
497
|
name: "TresScene",
|
|
433
498
|
props: [
|
|
434
499
|
"shadows",
|
|
@@ -447,57 +512,54 @@ const { logWarning: fe } = F(), wt = we({
|
|
|
447
512
|
"disableRender",
|
|
448
513
|
"camera"
|
|
449
514
|
],
|
|
450
|
-
setup(e, { slots: t, expose:
|
|
451
|
-
e.physicallyCorrectLights === !0 &&
|
|
452
|
-
const a =
|
|
453
|
-
|
|
454
|
-
const
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
}), ge(() => {
|
|
460
|
-
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);
|
|
461
524
|
});
|
|
462
|
-
const { activeCamera:
|
|
463
|
-
function
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
m !== null && ((h = (g = (R = m.object) == null ? void 0 : R.events) == null ? void 0 : g.onClick) == null || h.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));
|
|
479
541
|
});
|
|
480
542
|
}
|
|
481
|
-
let
|
|
482
|
-
function
|
|
483
|
-
|
|
484
|
-
const w =
|
|
485
|
-
|
|
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();
|
|
486
548
|
}
|
|
487
|
-
return
|
|
488
|
-
scene:
|
|
489
|
-
}),
|
|
549
|
+
return M(), n({
|
|
550
|
+
scene: i
|
|
551
|
+
}), D(
|
|
490
552
|
() => e.camera,
|
|
491
553
|
(w) => {
|
|
492
|
-
w && (
|
|
554
|
+
w && (p(), d(w));
|
|
493
555
|
}
|
|
494
|
-
), () =>
|
|
495
|
-
|
|
556
|
+
), () => L(
|
|
557
|
+
L(
|
|
496
558
|
"div",
|
|
497
559
|
{
|
|
498
560
|
ref: a,
|
|
499
|
-
"data-scene":
|
|
500
|
-
key:
|
|
561
|
+
"data-scene": i.uuid,
|
|
562
|
+
key: i.uuid,
|
|
501
563
|
style: {
|
|
502
564
|
position: "relative",
|
|
503
565
|
width: "100%",
|
|
@@ -507,7 +569,7 @@ const { logWarning: fe } = F(), wt = we({
|
|
|
507
569
|
}
|
|
508
570
|
},
|
|
509
571
|
[
|
|
510
|
-
|
|
572
|
+
L(
|
|
511
573
|
"div",
|
|
512
574
|
{
|
|
513
575
|
style: {
|
|
@@ -516,9 +578,9 @@ const { logWarning: fe } = F(), wt = we({
|
|
|
516
578
|
}
|
|
517
579
|
},
|
|
518
580
|
[
|
|
519
|
-
|
|
520
|
-
ref:
|
|
521
|
-
"data-scene":
|
|
581
|
+
L("canvas", {
|
|
582
|
+
ref: o,
|
|
583
|
+
"data-scene": i.uuid,
|
|
522
584
|
style: {
|
|
523
585
|
display: "block",
|
|
524
586
|
width: "100%",
|
|
@@ -534,7 +596,7 @@ const { logWarning: fe } = F(), wt = we({
|
|
|
534
596
|
)
|
|
535
597
|
);
|
|
536
598
|
}
|
|
537
|
-
}), bt =
|
|
599
|
+
}), bt = de({
|
|
538
600
|
name: "TresCanvas",
|
|
539
601
|
props: [
|
|
540
602
|
"shadows",
|
|
@@ -553,32 +615,33 @@ const { logWarning: fe } = F(), wt = we({
|
|
|
553
615
|
"disableRender",
|
|
554
616
|
"camera"
|
|
555
617
|
],
|
|
556
|
-
setup(e, { slots: t, expose:
|
|
557
|
-
const a =
|
|
558
|
-
return
|
|
618
|
+
setup(e, { slots: t, expose: n }) {
|
|
619
|
+
const a = Qe();
|
|
620
|
+
return n(a), () => L(wt, e, t);
|
|
559
621
|
}
|
|
560
|
-
}),
|
|
622
|
+
}), xt = {
|
|
561
623
|
install(e) {
|
|
562
624
|
e.component("TresCanvas", bt);
|
|
563
625
|
}
|
|
564
626
|
};
|
|
565
627
|
export {
|
|
566
|
-
|
|
567
|
-
|
|
628
|
+
Ze as CameraType,
|
|
629
|
+
K as TRES_CONTEXT_KEY,
|
|
568
630
|
bt as TresCanvas,
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
631
|
+
me as catalogue,
|
|
632
|
+
xt as default,
|
|
633
|
+
ve as extend,
|
|
572
634
|
Mt as isProd,
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
Rt as
|
|
582
|
-
|
|
583
|
-
|
|
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
|
|
584
647
|
};
|