@tresjs/core 2.1.3 → 2.3.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/index.d.ts +2 -0
- package/dist/keys.d.ts +6 -0
- package/dist/tres.js +375 -307
- 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.3.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
|
|
8
|
+
import { ref as V, shallowReactive as ce, toRefs as ue, provide as Te, inject as Le, watchEffect as fe, toRef as _e, shallowRef as Ae, computed as G, 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, Vector3 as De, Color as W, SRGBColorSpace as Ie, ACESFilmicToneMapping as Be, PCFSoftShadowMap as He, PCFShadowMap as Ve, LinearSRGBColorSpace as ae, NoToneMapping as ne, WebGLRenderer as Ge, LoadingManager as Fe, TextureLoader as Ne, Raycaster as ze, Vector2 as We, BufferAttribute as Ue } from "three";
|
|
11
|
+
import { createEventHook as A, useRafFn as Ye, toValue as m, useWindowSize as $e, useElementSize as qe, useDevicePixelRatio as Ke, unrefElement as U, usePointer as Je, useElementBounding as Xe } from "@vueuse/core";
|
|
12
|
+
const me = V({}), 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
13
|
function Qe() {
|
|
14
|
-
const e = Math.random() * 4294967295 | 0, t = Math.random() * 4294967295 | 0,
|
|
15
|
-
return (
|
|
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
|
|
17
|
+
const K = Symbol();
|
|
18
18
|
function Ze() {
|
|
19
|
-
const e =
|
|
19
|
+
const e = ce({
|
|
20
20
|
uuid: Qe(),
|
|
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
53
|
var et = /* @__PURE__ */ ((e) => (e.Perspective = "Perspective", e.Orthographic = "Orthographic", e))(et || {});
|
|
50
54
|
const tt = 45;
|
|
51
|
-
let
|
|
52
|
-
function
|
|
53
|
-
const { state: e, setState: t, aspectRatio:
|
|
54
|
-
function a(s = "Perspective",
|
|
55
|
-
var l, d,
|
|
55
|
+
let R;
|
|
56
|
+
function at() {
|
|
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
64
|
fov: tt
|
|
61
65
|
};
|
|
62
|
-
|
|
66
|
+
R = new z(v, ((l = e.aspectRatio) == null ? void 0 : l.value) || window.innerWidth / window.innerHeight, y, h), (d = e.cameras) == null || d.push(R);
|
|
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,407 @@ function xe() {
|
|
|
69
73
|
near: 0.1,
|
|
70
74
|
far: 1e3
|
|
71
75
|
};
|
|
72
|
-
|
|
76
|
+
R = new je(y, h, v, M, w, E), (p = e.cameras) == null || p.push(R);
|
|
73
77
|
}
|
|
74
|
-
return e.camera =
|
|
78
|
+
return e.camera = R, t("camera", e.camera), R;
|
|
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: nt, resume: rt, isActive: ot } = Ye(
|
|
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: nt,
|
|
123
|
+
resume: rt,
|
|
124
|
+
isActive: ot
|
|
121
125
|
};
|
|
122
126
|
}
|
|
123
|
-
function
|
|
124
|
-
return e
|
|
127
|
+
function Pt(e) {
|
|
128
|
+
return typeof e == "number" ? [e, e, e] : e instanceof De ? [e.x, e.y, e.z] : e;
|
|
129
|
+
}
|
|
130
|
+
function it(e) {
|
|
131
|
+
return e instanceof W ? e : Array.isArray(e) ? new W(...e) : new W(e);
|
|
125
132
|
}
|
|
126
|
-
const
|
|
133
|
+
const Y = {
|
|
127
134
|
realistic: {
|
|
128
135
|
outputColorSpace: Ie,
|
|
129
136
|
toneMapping: Be,
|
|
130
137
|
toneMappingExposure: 3,
|
|
131
138
|
shadowMap: {
|
|
132
139
|
enabled: !0,
|
|
133
|
-
type:
|
|
140
|
+
type: He
|
|
134
141
|
}
|
|
135
142
|
}
|
|
136
|
-
},
|
|
137
|
-
for (const
|
|
138
|
-
t[
|
|
143
|
+
}, ye = (e, t) => {
|
|
144
|
+
for (const n of Object.keys(t))
|
|
145
|
+
t[n] instanceof Object && Object.assign(t[n], ye(e[n], t[n]));
|
|
139
146
|
return Object.assign(e || {}, t), e;
|
|
140
|
-
},
|
|
141
|
-
function
|
|
142
|
-
return e.replace(/-([a-z])/g, (t,
|
|
147
|
+
}, st = "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", ct = /* @__PURE__ */ ut(st);
|
|
148
|
+
function j(e) {
|
|
149
|
+
return e.replace(/-([a-z])/g, (t, n) => n.toUpperCase());
|
|
143
150
|
}
|
|
144
|
-
function
|
|
145
|
-
const
|
|
146
|
-
for (let
|
|
147
|
-
|
|
148
|
-
return t ? (
|
|
151
|
+
function ut(e, t) {
|
|
152
|
+
const n = /* @__PURE__ */ Object.create(null), a = e.split(",");
|
|
153
|
+
for (let o = 0; o < a.length; o++)
|
|
154
|
+
n[a[o]] = !0;
|
|
155
|
+
return t ? (o) => !!n[o.toLowerCase()] : (o) => !!n[o];
|
|
149
156
|
}
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
157
|
+
const ft = (e, t) => {
|
|
158
|
+
const n = /* @__PURE__ */ new Set(), a = [];
|
|
159
|
+
for (const o of e) {
|
|
160
|
+
const i = t(o);
|
|
161
|
+
n.has(i) || (n.add(i), a.push(o));
|
|
162
|
+
}
|
|
163
|
+
return a;
|
|
164
|
+
}, xt = !0, oe = "[TresJS ▲ ■ ●] ";
|
|
165
|
+
function O() {
|
|
166
|
+
function e(a, o) {
|
|
167
|
+
console.error(`${oe} ${a}`, o || "");
|
|
154
168
|
}
|
|
155
169
|
function t(a) {
|
|
156
170
|
console.warn(`${oe} ${a}`);
|
|
157
171
|
}
|
|
158
|
-
function
|
|
172
|
+
function n(a, o) {
|
|
159
173
|
}
|
|
160
174
|
return {
|
|
161
175
|
logError: e,
|
|
162
176
|
logWarning: t,
|
|
163
|
-
logMessage:
|
|
177
|
+
logMessage: n
|
|
164
178
|
};
|
|
165
179
|
}
|
|
166
|
-
function
|
|
167
|
-
const t =
|
|
180
|
+
function lt(e) {
|
|
181
|
+
const t = Ae(), n = V(!1), {
|
|
168
182
|
alpha: a = !0,
|
|
169
|
-
antialias:
|
|
170
|
-
depth:
|
|
171
|
-
logarithmicDepthBuffer:
|
|
172
|
-
failIfMajorPerformanceCaveat:
|
|
183
|
+
antialias: o = !0,
|
|
184
|
+
depth: i,
|
|
185
|
+
logarithmicDepthBuffer: u,
|
|
186
|
+
failIfMajorPerformanceCaveat: r,
|
|
173
187
|
precision: s,
|
|
174
|
-
premultipliedAlpha:
|
|
188
|
+
premultipliedAlpha: c,
|
|
175
189
|
stencil: l,
|
|
176
190
|
shadows: d = !1,
|
|
177
|
-
shadowMapType:
|
|
178
|
-
useLegacyLights:
|
|
179
|
-
outputColorSpace:
|
|
180
|
-
toneMapping:
|
|
181
|
-
toneMappingExposure:
|
|
191
|
+
shadowMapType: p = Ve,
|
|
192
|
+
useLegacyLights: y = !1,
|
|
193
|
+
outputColorSpace: h = ae,
|
|
194
|
+
toneMapping: v = ne,
|
|
195
|
+
toneMappingExposure: M = 1,
|
|
182
196
|
context: w = void 0,
|
|
183
|
-
powerPreference:
|
|
184
|
-
preserveDrawingBuffer:
|
|
185
|
-
clearColor:
|
|
186
|
-
windowSize:
|
|
187
|
-
preset:
|
|
188
|
-
} =
|
|
197
|
+
powerPreference: E = "default",
|
|
198
|
+
preserveDrawingBuffer: k = !1,
|
|
199
|
+
clearColor: x,
|
|
200
|
+
windowSize: C = !1,
|
|
201
|
+
preset: F = void 0
|
|
202
|
+
} = ue(e), { state: f, setState: g } = S(), { width: X, height: Q } = m(C) == !0 || m(C) === "" || m(C) === "true" ? $e() : qe(f.container), { logError: Ee, logWarning: Me } = O(), { pixelRatio: Z } = Ke(), { pause: Pe, resume: xe } = he(), N = G(() => X.value / Q.value);
|
|
189
203
|
setTimeout(() => {
|
|
190
|
-
|
|
204
|
+
var P;
|
|
205
|
+
!m(C) && !((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
206
|
You could set windowSize=true to force the canvas to be the size of the window.`);
|
|
192
207
|
}, 1e3);
|
|
193
208
|
const ee = () => {
|
|
194
|
-
t.value && (t.value.setSize(
|
|
209
|
+
t.value && (t.value.setSize(X.value, Q.value), t.value.setPixelRatio(Math.min(Z.value, 2)));
|
|
195
210
|
}, te = () => {
|
|
196
211
|
if (!t.value)
|
|
197
212
|
return;
|
|
198
|
-
const
|
|
199
|
-
if (
|
|
200
|
-
|
|
213
|
+
const P = m(F);
|
|
214
|
+
if (P) {
|
|
215
|
+
P in Y || Ee("Renderer Preset must be one of these: " + Object.keys(Y).join(", ")), ye(t.value, Y[P]);
|
|
201
216
|
return;
|
|
202
217
|
}
|
|
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,
|
|
218
|
+
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, x != null && x.value && t.value.setClearColor(it(m(x))), t.value.useLegacyLights = m(y);
|
|
219
|
+
}, Ce = () => {
|
|
220
|
+
const P = U(f.canvas);
|
|
221
|
+
P && (t.value = new Ge({
|
|
222
|
+
canvas: P,
|
|
223
|
+
alpha: m(a),
|
|
224
|
+
antialias: m(o),
|
|
225
|
+
context: m(w),
|
|
226
|
+
depth: m(i),
|
|
227
|
+
failIfMajorPerformanceCaveat: m(r),
|
|
228
|
+
logarithmicDepthBuffer: m(u),
|
|
229
|
+
powerPreference: m(E),
|
|
230
|
+
precision: m(s),
|
|
231
|
+
stencil: m(l),
|
|
232
|
+
preserveDrawingBuffer: m(k),
|
|
233
|
+
premultipliedAlpha: m(c)
|
|
234
|
+
}), g("renderer", t.value), g("clock", new pe()), g("aspectRatio", N), te(), ee(), xe(), n.value = !0);
|
|
235
|
+
}, Re = () => {
|
|
236
|
+
t.value && (t.value.dispose(), t.value = void 0, n.value = !1, Pe());
|
|
222
237
|
};
|
|
223
|
-
return
|
|
224
|
-
[d,
|
|
238
|
+
return D([N, Z], ee), D(
|
|
239
|
+
[d, p, h, y, v, M, x],
|
|
225
240
|
te
|
|
226
|
-
),
|
|
227
|
-
() => [
|
|
241
|
+
), D(
|
|
242
|
+
() => [f.canvas, f.container],
|
|
228
243
|
() => {
|
|
229
|
-
|
|
244
|
+
U(f.canvas) && U(f.container) && Ce();
|
|
230
245
|
},
|
|
231
246
|
{ immediate: !0, deep: !0 }
|
|
232
247
|
), {
|
|
233
248
|
renderer: t,
|
|
234
|
-
isReady:
|
|
235
|
-
dispose:
|
|
236
|
-
aspectRatio:
|
|
249
|
+
isReady: n,
|
|
250
|
+
dispose: Re,
|
|
251
|
+
aspectRatio: N
|
|
237
252
|
};
|
|
238
253
|
}
|
|
239
|
-
function
|
|
254
|
+
function dt(e) {
|
|
240
255
|
const t = { nodes: {}, materials: {} };
|
|
241
|
-
return e && e.traverse((
|
|
242
|
-
|
|
256
|
+
return e && e.traverse((n) => {
|
|
257
|
+
n.name && (t.nodes[n.name] = n), n.material && !t.materials[n.material.name] && (t.materials[n.material.name] = n.material);
|
|
243
258
|
}), t;
|
|
244
259
|
}
|
|
245
|
-
async function
|
|
246
|
-
const { logError:
|
|
247
|
-
|
|
260
|
+
async function Ct(e, t, n, a, o) {
|
|
261
|
+
const { logError: i } = O(), u = new e();
|
|
262
|
+
o && o(u), n && n(u);
|
|
248
263
|
const s = (Array.isArray(t) ? t : [t]).map(
|
|
249
|
-
(
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
(
|
|
253
|
-
|
|
264
|
+
(c) => new Promise((l, d) => {
|
|
265
|
+
u.load(
|
|
266
|
+
c,
|
|
267
|
+
(p) => {
|
|
268
|
+
p.scene && Object.assign(p, dt(p.scene)), l(p);
|
|
254
269
|
},
|
|
255
270
|
a,
|
|
256
|
-
(
|
|
271
|
+
(p) => d(i("[useLoader] - Failed to load resource", p))
|
|
257
272
|
);
|
|
258
273
|
})
|
|
259
274
|
);
|
|
260
|
-
return
|
|
275
|
+
return ge(t) ? await Promise.all(s) : await s[0];
|
|
261
276
|
}
|
|
262
277
|
async function Rt(e) {
|
|
263
|
-
const t = new
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
(
|
|
278
|
+
const t = new Fe(), n = new Ne(t), a = (o) => new Promise((i, u) => {
|
|
279
|
+
n.load(
|
|
280
|
+
o,
|
|
281
|
+
(r) => i(r),
|
|
267
282
|
() => null,
|
|
268
283
|
() => {
|
|
269
|
-
|
|
284
|
+
u(new Error("[useTextures] - Failed to load texture"));
|
|
270
285
|
}
|
|
271
286
|
);
|
|
272
287
|
});
|
|
273
|
-
if (
|
|
274
|
-
const
|
|
275
|
-
return e.length > 1 ?
|
|
288
|
+
if (ge(e)) {
|
|
289
|
+
const o = await Promise.all(e.map((i) => a(i)));
|
|
290
|
+
return e.length > 1 ? o : o[0];
|
|
276
291
|
} else {
|
|
277
292
|
const {
|
|
278
|
-
map:
|
|
279
|
-
displacementMap:
|
|
280
|
-
normalMap:
|
|
281
|
-
roughnessMap:
|
|
293
|
+
map: o,
|
|
294
|
+
displacementMap: i,
|
|
295
|
+
normalMap: u,
|
|
296
|
+
roughnessMap: r,
|
|
282
297
|
metalnessMap: s,
|
|
283
|
-
aoMap:
|
|
298
|
+
aoMap: c,
|
|
284
299
|
alphaMap: l,
|
|
285
300
|
matcap: d
|
|
286
301
|
} = e;
|
|
287
302
|
return {
|
|
288
|
-
map:
|
|
289
|
-
displacementMap:
|
|
290
|
-
normalMap:
|
|
291
|
-
roughnessMap:
|
|
303
|
+
map: o ? await a(o) : null,
|
|
304
|
+
displacementMap: i ? await a(i) : null,
|
|
305
|
+
normalMap: u ? await a(u) : null,
|
|
306
|
+
roughnessMap: r ? await a(r) : null,
|
|
292
307
|
metalnessMap: s ? await a(s) : null,
|
|
293
|
-
aoMap:
|
|
308
|
+
aoMap: c ? await a(c) : null,
|
|
294
309
|
alphaMap: l ? await a(l) : null,
|
|
295
310
|
matcap: d ? await a(d) : null
|
|
296
311
|
};
|
|
297
312
|
}
|
|
298
313
|
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
314
|
+
const pt = (e) => {
|
|
315
|
+
const { state: t } = S(), n = G(() => {
|
|
316
|
+
var f;
|
|
317
|
+
return (f = t.canvas) == null ? void 0 : f.value;
|
|
318
|
+
}), { x: a, y: o } = Je({ target: n }), { width: i, height: u, top: r, left: s } = Xe(n), c = new ze(), l = ({ x: f, y: g }) => {
|
|
319
|
+
if (n.value)
|
|
320
|
+
return {
|
|
321
|
+
x: (f - s.value) / i.value * 2 - 1,
|
|
322
|
+
y: -((g - r.value) / u.value) * 2 + 1
|
|
323
|
+
};
|
|
324
|
+
}, d = ({ x: f, y: g }) => {
|
|
325
|
+
if (t.camera)
|
|
326
|
+
return c.setFromCamera(new We(f, g), t.camera), c.intersectObjects(e.value, !1);
|
|
327
|
+
}, p = (f) => {
|
|
328
|
+
const g = l({
|
|
329
|
+
x: (f == null ? void 0 : f.clientX) ?? a.value,
|
|
330
|
+
y: (f == null ? void 0 : f.clientY) ?? o.value
|
|
331
|
+
});
|
|
332
|
+
return g ? d(g) || [] : [];
|
|
333
|
+
}, y = G(() => p()), h = A(), v = A(), M = (f, g) => {
|
|
334
|
+
f.trigger({ event: g, intersects: p(g) });
|
|
335
|
+
}, w = (f) => {
|
|
336
|
+
M(v, f);
|
|
337
|
+
};
|
|
338
|
+
let E;
|
|
339
|
+
const k = (f) => {
|
|
340
|
+
var g;
|
|
341
|
+
E = (g = p(f)[0]) == null ? void 0 : g.object;
|
|
342
|
+
}, x = (f) => {
|
|
343
|
+
var g;
|
|
344
|
+
f instanceof PointerEvent && E === ((g = p(f)[0]) == null ? void 0 : g.object) && M(h, f);
|
|
345
|
+
}, C = (f) => v.trigger({ event: f, intersects: [] }), F = fe(() => {
|
|
346
|
+
n != null && n.value && (n.value.addEventListener("pointerup", x), n.value.addEventListener("pointerdown", k), n.value.addEventListener("pointermove", w), n.value.addEventListener("pointerleave", C), F());
|
|
347
|
+
});
|
|
348
|
+
return le(() => {
|
|
349
|
+
n != null && n.value && (n.value.removeEventListener("pointerup", x), n.value.removeEventListener("pointerdown", k), n.value.removeEventListener("pointermove", w), n.value.removeEventListener("pointerleave", C));
|
|
309
350
|
}), {
|
|
310
|
-
|
|
311
|
-
|
|
351
|
+
intersects: y,
|
|
352
|
+
onClick: (f) => h.on(f).off,
|
|
353
|
+
onPointerMove: (f) => v.on(f).off
|
|
312
354
|
};
|
|
313
|
-
}
|
|
314
|
-
function
|
|
315
|
-
const { logWarning: e } =
|
|
316
|
-
function t(a,
|
|
317
|
-
let
|
|
318
|
-
return a.traverse((
|
|
319
|
-
|
|
320
|
-
}),
|
|
355
|
+
};
|
|
356
|
+
function Tt() {
|
|
357
|
+
const { logWarning: e } = O();
|
|
358
|
+
function t(a, o, i) {
|
|
359
|
+
let u = null;
|
|
360
|
+
return a.traverse((r) => {
|
|
361
|
+
r[o] === i && (u = r);
|
|
362
|
+
}), u || e(`Child with ${o} '${i}' not found.`), u;
|
|
321
363
|
}
|
|
322
|
-
function
|
|
323
|
-
return t(a, "name",
|
|
364
|
+
function n(a, o) {
|
|
365
|
+
return t(a, "name", o);
|
|
324
366
|
}
|
|
325
367
|
return {
|
|
326
368
|
seek: t,
|
|
327
|
-
seekByName:
|
|
369
|
+
seekByName: n
|
|
328
370
|
};
|
|
329
371
|
}
|
|
330
|
-
const
|
|
331
|
-
|
|
332
|
-
|
|
372
|
+
const mt = () => {
|
|
373
|
+
const e = Se({
|
|
374
|
+
click: /* @__PURE__ */ new Map(),
|
|
375
|
+
pointerMove: /* @__PURE__ */ new Map(),
|
|
376
|
+
pointerEnter: /* @__PURE__ */ new Map(),
|
|
377
|
+
pointerLeave: /* @__PURE__ */ new Map()
|
|
378
|
+
}), t = (r) => {
|
|
379
|
+
Object.values(e).forEach((s) => s.delete(r));
|
|
380
|
+
}, n = (r) => {
|
|
381
|
+
const { onClick: s, onPointerMove: c, onPointerEnter: l, onPointerLeave: d } = r;
|
|
382
|
+
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", () => {
|
|
383
|
+
r.traverse((p) => {
|
|
384
|
+
t(p);
|
|
385
|
+
}), t(r);
|
|
386
|
+
});
|
|
387
|
+
}, a = G(
|
|
388
|
+
() => ft(
|
|
389
|
+
Object.values(e).map((r) => Array.from(r.keys())).flat(),
|
|
390
|
+
({ uuid: r }) => r
|
|
391
|
+
)
|
|
392
|
+
), { onClick: o, onPointerMove: i } = pt(a);
|
|
393
|
+
o(({ intersects: r, event: s }) => {
|
|
394
|
+
var c;
|
|
395
|
+
r.length && ((c = e.click.get(r[0].object)) == null || c(r[0], s));
|
|
396
|
+
});
|
|
397
|
+
let u;
|
|
398
|
+
return i(({ intersects: r, event: s }) => {
|
|
399
|
+
var y, h, v, M;
|
|
400
|
+
const c = (y = r == null ? void 0 : r[0]) == null ? void 0 : y.object, { pointerLeave: l, pointerEnter: d, pointerMove: p } = e;
|
|
401
|
+
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;
|
|
402
|
+
}), {
|
|
403
|
+
registerObject: n,
|
|
404
|
+
deregisterObject: t
|
|
405
|
+
};
|
|
406
|
+
}, H = {
|
|
333
407
|
GEOMETRY_VIA_PROP: "tres__geometryViaProp",
|
|
334
|
-
MATERIAL_VIA_PROP: "tres__materialViaProp"
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
408
|
+
MATERIAL_VIA_PROP: "tres__materialViaProp",
|
|
409
|
+
REGISTER_AT_POINTER_EVENT_HANDLER: "tres__registerAtPointerEventHandler"
|
|
410
|
+
};
|
|
411
|
+
let $ = null, T = null;
|
|
412
|
+
const { logError: ie } = O(), vt = {
|
|
413
|
+
createElement(e, t, n, a) {
|
|
414
|
+
var s, c;
|
|
415
|
+
if (a || (a = {}), a.args || (a.args = []), e === "template" || ct(e))
|
|
341
416
|
return null;
|
|
342
|
-
let
|
|
417
|
+
let o = e.replace("Tres", ""), i;
|
|
343
418
|
if (e === "primitive") {
|
|
344
|
-
(a == null ? void 0 : a.object) === void 0 &&
|
|
419
|
+
(a == null ? void 0 : a.object) === void 0 && ie("Tres primitives need a prop 'object'");
|
|
345
420
|
const l = a.object;
|
|
346
|
-
|
|
421
|
+
o = l.type, i = Object.assign(l, { type: o, attach: a.attach, primitive: !0 });
|
|
347
422
|
} 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;
|
|
423
|
+
const l = me.value[o];
|
|
424
|
+
l || ie(`${o} is not defined on the THREE namespace. Use extend to add it to the catalog.`), i = new l(...a.args);
|
|
355
425
|
}
|
|
356
|
-
(a == null ? void 0 : a.attach) === void 0 && (
|
|
357
|
-
const { GEOMETRY_VIA_PROP:
|
|
358
|
-
return
|
|
426
|
+
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"));
|
|
427
|
+
const { GEOMETRY_VIA_PROP: u, MATERIAL_VIA_PROP: r } = H;
|
|
428
|
+
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
429
|
},
|
|
360
430
|
insert(e, t) {
|
|
361
|
-
var
|
|
362
|
-
if (t && t.isScene && (
|
|
363
|
-
|
|
431
|
+
var n, a, o, i, u, r, s;
|
|
432
|
+
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)) {
|
|
433
|
+
$ = e;
|
|
364
434
|
return;
|
|
365
435
|
} else
|
|
366
|
-
(
|
|
367
|
-
t || (t =
|
|
436
|
+
(u = e == null ? void 0 : e.__vnode) != null && u.type.includes("Controls") && t === null && ($ = T);
|
|
437
|
+
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
438
|
},
|
|
369
439
|
remove(e) {
|
|
370
|
-
var t,
|
|
440
|
+
var t, n;
|
|
371
441
|
if (e) {
|
|
372
442
|
if (e.isObject3D) {
|
|
373
|
-
const a = e,
|
|
374
|
-
var s,
|
|
375
|
-
const { GEOMETRY_VIA_PROP:
|
|
376
|
-
|
|
443
|
+
const a = e, o = (i) => {
|
|
444
|
+
var s, c;
|
|
445
|
+
const { GEOMETRY_VIA_PROP: u, MATERIAL_VIA_PROP: r } = H;
|
|
446
|
+
i.userData[r] || (s = i.material) == null || s.dispose(), i.userData[u] || (c = i.geometry) == null || c.dispose();
|
|
377
447
|
};
|
|
378
|
-
a.traverse((
|
|
448
|
+
a.traverse((i) => {
|
|
449
|
+
o(i);
|
|
450
|
+
}), o(a);
|
|
379
451
|
}
|
|
380
|
-
(t = e.removeFromParent) == null || t.call(e), (
|
|
452
|
+
(t = e.removeFromParent) == null || t.call(e), (n = e.dispose) == null || n.call(e);
|
|
381
453
|
}
|
|
382
454
|
},
|
|
383
|
-
patchProp(e, t,
|
|
455
|
+
patchProp(e, t, n, a) {
|
|
384
456
|
if (e) {
|
|
385
|
-
let
|
|
386
|
-
if (
|
|
387
|
-
if (
|
|
457
|
+
let o = e, i = t, u = j(i), r = o == null ? void 0 : o[u];
|
|
458
|
+
if (o.type === "BufferGeometry") {
|
|
459
|
+
if (i === "args")
|
|
388
460
|
return;
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
new
|
|
461
|
+
o.setAttribute(
|
|
462
|
+
j(i),
|
|
463
|
+
new Ue(...a)
|
|
392
464
|
);
|
|
393
465
|
return;
|
|
394
466
|
}
|
|
395
|
-
if (
|
|
396
|
-
const
|
|
397
|
-
|
|
398
|
-
}
|
|
399
|
-
if (mt(r)) {
|
|
400
|
-
const u = r;
|
|
401
|
-
e.events[u] = a;
|
|
467
|
+
if (i.includes("-") && r === void 0) {
|
|
468
|
+
const c = i.split("-");
|
|
469
|
+
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
470
|
}
|
|
403
471
|
let s = a;
|
|
404
|
-
if (s === "" && (s = !0), re(
|
|
405
|
-
Array.isArray(s) ? e[
|
|
472
|
+
if (s === "" && (s = !0), re(r)) {
|
|
473
|
+
Array.isArray(s) ? e[u](...s) : e[u](s);
|
|
406
474
|
return;
|
|
407
475
|
}
|
|
408
|
-
!(
|
|
476
|
+
!(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
477
|
}
|
|
410
478
|
},
|
|
411
479
|
parentNode(e) {
|
|
@@ -420,15 +488,15 @@ const pt = {
|
|
|
420
488
|
setScopeId: () => void 0,
|
|
421
489
|
cloneNode: () => void 0,
|
|
422
490
|
insertStaticContent: () => void 0
|
|
423
|
-
}, { createApp:
|
|
424
|
-
const t =
|
|
425
|
-
function
|
|
491
|
+
}, { createApp: gt } = Oe(vt), wt = (e) => {
|
|
492
|
+
const t = gt(n);
|
|
493
|
+
function n() {
|
|
426
494
|
return e && e.default ? e.default() : [];
|
|
427
495
|
}
|
|
428
496
|
return t;
|
|
429
497
|
};
|
|
430
|
-
|
|
431
|
-
const { logWarning:
|
|
498
|
+
ve(q);
|
|
499
|
+
const { logWarning: se } = O(), bt = de({
|
|
432
500
|
name: "TresScene",
|
|
433
501
|
props: [
|
|
434
502
|
"shadows",
|
|
@@ -447,57 +515,54 @@ const { logWarning: fe } = F(), wt = we({
|
|
|
447
515
|
"disableRender",
|
|
448
516
|
"camera"
|
|
449
517
|
],
|
|
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);
|
|
518
|
+
setup(e, { slots: t, expose: n }) {
|
|
519
|
+
e.physicallyCorrectLights === !0 && se("physicallyCorrectLights is deprecated, useLegacyLights is now false by default");
|
|
520
|
+
const a = V(), o = V(), i = new q.Scene(), u = mt(), { setState: r } = S();
|
|
521
|
+
i.userData[H.REGISTER_AT_POINTER_EVENT_HANDLER] = u.registerObject, r("scene", i), r("canvas", o), r("container", a), r("pointerEventHandler", u);
|
|
522
|
+
const { onLoop: s, resume: c } = he();
|
|
523
|
+
ke(() => {
|
|
524
|
+
h();
|
|
525
|
+
}), le(() => {
|
|
526
|
+
r("renderer", null);
|
|
461
527
|
});
|
|
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));
|
|
528
|
+
const { activeCamera: l, pushCamera: d, clearCameras: p } = at();
|
|
529
|
+
function y() {
|
|
530
|
+
const w = i.getObjectByProperty("isCamera", !0);
|
|
531
|
+
if (w)
|
|
532
|
+
d(w);
|
|
533
|
+
else {
|
|
534
|
+
se("No camera found. Creating a default perspective camera. To have full control over a camera, please add one to the scene.");
|
|
535
|
+
const E = new q.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1e3);
|
|
536
|
+
E.position.set(3, 3, 3), E.lookAt(0, 0, 0), d(E);
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
function h() {
|
|
540
|
+
const { renderer: w } = lt(e);
|
|
541
|
+
e.camera && d(e.camera), s(() => {
|
|
542
|
+
var E;
|
|
543
|
+
l.value && e.disableRender !== !0 && ((E = w.value) == null || E.render(i, l.value));
|
|
479
544
|
});
|
|
480
545
|
}
|
|
481
|
-
let
|
|
482
|
-
function
|
|
483
|
-
|
|
484
|
-
const w =
|
|
485
|
-
|
|
546
|
+
let v;
|
|
547
|
+
function M() {
|
|
548
|
+
v = wt(t);
|
|
549
|
+
const w = S();
|
|
550
|
+
v.provide("useTres", w), v.provide(K, w), v.provide("extend", ve), v.mount(i), y();
|
|
486
551
|
}
|
|
487
|
-
return
|
|
488
|
-
scene:
|
|
489
|
-
}),
|
|
552
|
+
return M(), n({
|
|
553
|
+
scene: i
|
|
554
|
+
}), D(
|
|
490
555
|
() => e.camera,
|
|
491
556
|
(w) => {
|
|
492
|
-
w && (
|
|
557
|
+
w && (p(), d(w));
|
|
493
558
|
}
|
|
494
|
-
), () =>
|
|
495
|
-
|
|
559
|
+
), () => L(
|
|
560
|
+
L(
|
|
496
561
|
"div",
|
|
497
562
|
{
|
|
498
563
|
ref: a,
|
|
499
|
-
"data-scene":
|
|
500
|
-
key:
|
|
564
|
+
"data-scene": i.uuid,
|
|
565
|
+
key: i.uuid,
|
|
501
566
|
style: {
|
|
502
567
|
position: "relative",
|
|
503
568
|
width: "100%",
|
|
@@ -507,7 +572,7 @@ const { logWarning: fe } = F(), wt = we({
|
|
|
507
572
|
}
|
|
508
573
|
},
|
|
509
574
|
[
|
|
510
|
-
|
|
575
|
+
L(
|
|
511
576
|
"div",
|
|
512
577
|
{
|
|
513
578
|
style: {
|
|
@@ -516,9 +581,9 @@ const { logWarning: fe } = F(), wt = we({
|
|
|
516
581
|
}
|
|
517
582
|
},
|
|
518
583
|
[
|
|
519
|
-
|
|
520
|
-
ref:
|
|
521
|
-
"data-scene":
|
|
584
|
+
L("canvas", {
|
|
585
|
+
ref: o,
|
|
586
|
+
"data-scene": i.uuid,
|
|
522
587
|
style: {
|
|
523
588
|
display: "block",
|
|
524
589
|
width: "100%",
|
|
@@ -534,7 +599,7 @@ const { logWarning: fe } = F(), wt = we({
|
|
|
534
599
|
)
|
|
535
600
|
);
|
|
536
601
|
}
|
|
537
|
-
}),
|
|
602
|
+
}), ht = de({
|
|
538
603
|
name: "TresCanvas",
|
|
539
604
|
props: [
|
|
540
605
|
"shadows",
|
|
@@ -553,32 +618,35 @@ const { logWarning: fe } = F(), wt = we({
|
|
|
553
618
|
"disableRender",
|
|
554
619
|
"camera"
|
|
555
620
|
],
|
|
556
|
-
setup(e, { slots: t, expose:
|
|
621
|
+
setup(e, { slots: t, expose: n }) {
|
|
557
622
|
const a = Ze();
|
|
558
|
-
return
|
|
623
|
+
return n(a), () => L(bt, e, t);
|
|
559
624
|
}
|
|
560
|
-
}),
|
|
625
|
+
}), Lt = {
|
|
561
626
|
install(e) {
|
|
562
|
-
e.component("TresCanvas",
|
|
627
|
+
e.component("TresCanvas", ht);
|
|
563
628
|
}
|
|
564
629
|
};
|
|
565
630
|
export {
|
|
566
631
|
et as CameraType,
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
632
|
+
K as TRES_CONTEXT_KEY,
|
|
633
|
+
ht as TresCanvas,
|
|
634
|
+
me as catalogue,
|
|
635
|
+
Lt as default,
|
|
636
|
+
ve as extend,
|
|
637
|
+
xt as isProd,
|
|
638
|
+
it as normalizeColor,
|
|
639
|
+
Pt as normalizeVectorFlexibleParam,
|
|
640
|
+
dt as trasverseObjects,
|
|
641
|
+
at as useCamera,
|
|
642
|
+
Ct as useLoader,
|
|
643
|
+
O as useLogger,
|
|
644
|
+
mt as usePointerEventHandler,
|
|
645
|
+
pt as useRaycaster,
|
|
646
|
+
he as useRenderLoop,
|
|
647
|
+
lt as useRenderer,
|
|
648
|
+
Tt as useSeek,
|
|
581
649
|
Rt as useTexture,
|
|
582
|
-
|
|
650
|
+
S as useTres,
|
|
583
651
|
Ze as useTresProvider
|
|
584
652
|
};
|