@tresjs/core 4.0.0-rc.0 → 4.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/components/TresCanvas.vue.d.ts +4 -4
- package/dist/src/composables/index.d.ts +2 -1
- package/dist/src/composables/useCamera/index.d.ts +5 -5
- package/dist/src/composables/useLoop/index.d.ts +18 -0
- package/dist/src/composables/usePointerEventHandler/index.d.ts +2 -2
- package/dist/src/composables/useRaycaster/index.d.ts +3 -3
- package/dist/src/composables/useRenderLoop/index.d.ts +2 -2
- package/dist/src/composables/useRenderer/index.d.ts +6 -6
- package/dist/src/composables/useTresContextProvider/index.d.ts +8 -6
- package/dist/src/composables/useTresEventManager/index.d.ts +2 -2
- package/dist/src/core/catalogue.d.ts +1 -1
- package/dist/src/core/loop.d.ts +38 -0
- package/dist/src/core/nodeOps.d.ts +1 -1
- package/dist/src/devtools/plugin.d.ts +1 -1
- package/dist/src/directives/index.d.ts +3 -5
- package/dist/src/directives/vDistanceTo.d.ts +1 -1
- package/dist/src/index.d.ts +4 -3
- package/dist/src/types/index.d.ts +1 -1
- package/dist/src/utils/createPriorityEventHook.d.ts +18 -0
- package/dist/src/utils/index.d.ts +1 -1
- package/dist/src/utils/perf.d.ts +1 -1
- package/dist/tres.js +953 -849
- package/dist/tres.umd.cjs +2 -2
- package/package.json +22 -21
- package/dist/src/directives/vAlwaysLookAt.d.ts +0 -7
- package/dist/src/directives/vRotate.d.ts +0 -13
package/dist/tres.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name: @tresjs/core
|
|
3
|
-
* version: v4.0.0-rc.
|
|
3
|
+
* version: v4.0.0-rc.2
|
|
4
4
|
* (c) 2024
|
|
5
5
|
* description: Declarative ThreeJS using Vue Components
|
|
6
6
|
* author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
|
|
7
7
|
*/
|
|
8
|
-
var
|
|
9
|
-
var ot = (e,
|
|
10
|
-
var se = (e,
|
|
11
|
-
import { ref as
|
|
12
|
-
import * as
|
|
13
|
-
import { PerspectiveCamera as fe, Camera as
|
|
14
|
-
import { createEventHook as
|
|
15
|
-
const
|
|
8
|
+
var nt = Object.defineProperty;
|
|
9
|
+
var ot = (e, t, n) => t in e ? nt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
10
|
+
var se = (e, t, n) => (ot(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
11
|
+
import { ref as A, computed as B, watchEffect as ve, onUnmounted as N, shallowRef as U, watch as V, reactive as $e, readonly as ue, unref as W, provide as ce, inject as st, defineComponent as Se, useSlots as it, getCurrentInstance as xe, onMounted as at, openBlock as lt, createElementBlock as ut, normalizeClass as ct, normalizeStyle as ft, createRenderer as dt, h as Te, Fragment as pt } from "vue";
|
|
12
|
+
import * as Fe from "three";
|
|
13
|
+
import { PerspectiveCamera as fe, Camera as mt, Clock as We, Vector3 as ge, Color as re, Scene as Ne, MeshBasicMaterial as ze, DoubleSide as vt, REVISION as gt, SRGBColorSpace as ht, ACESFilmicToneMapping as Ge, PCFSoftShadowMap as yt, NoToneMapping as bt, WebGLRenderer as ie, TextureLoader as wt, Vector2 as ae, MathUtils as Mt, Raycaster as Pt, BufferAttribute as Ct, Line as _t, BufferGeometry as Ae, Float32BufferAttribute as Oe, LineBasicMaterial as Et, Mesh as kt, BackSide as St, DirectionalLightHelper as xt, PointLightHelper as Tt, SpotLightHelper as At, HemisphereLightHelper as Ot, ArrowHelper as Lt } from "three";
|
|
14
|
+
import { createEventHook as x, useRafFn as Ve, toValue as k, unrefElement as Dt, useDevicePixelRatio as Bt, usePointer as Rt, useElementBounding as jt, useWindowSize as It, useElementSize as Ht, refDebounced as Le, tryOnScopeDispose as Ut, useFps as $t, useMemory as Ft } from "@vueuse/core";
|
|
15
|
+
const Wt = "@tresjs/core", Nt = "module", zt = "4.0.0-rc.2", Gt = "pnpm@8.15.6", Vt = "Declarative ThreeJS using Vue Components", qt = "Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)", Yt = "MIT", Jt = [
|
|
16
16
|
"vue",
|
|
17
17
|
"3d",
|
|
18
18
|
"threejs",
|
|
19
19
|
"three",
|
|
20
20
|
"threejs-vue"
|
|
21
|
-
], Qt = !1,
|
|
21
|
+
], Qt = !1, Kt = {
|
|
22
22
|
".": {
|
|
23
23
|
types: "./dist/index.d.ts",
|
|
24
24
|
import: "./dist/tres.js",
|
|
@@ -37,18 +37,18 @@ const Ut = "@tresjs/core", Ft = "module", Nt = "4.0.0-rc.0", zt = "pnpm@8.15.6",
|
|
|
37
37
|
types: "./dist/src/utils/index.d.ts"
|
|
38
38
|
},
|
|
39
39
|
"./*": "./*"
|
|
40
|
-
},
|
|
40
|
+
}, Xt = "./dist/tres.js", Zt = "./dist/tres.js", er = "./dist/index.d.ts", tr = [
|
|
41
41
|
"*.d.ts",
|
|
42
42
|
"dist"
|
|
43
|
-
],
|
|
43
|
+
], rr = {
|
|
44
44
|
access: "public"
|
|
45
|
-
},
|
|
45
|
+
}, nr = {
|
|
46
46
|
dev: "cd playground && npm run dev",
|
|
47
47
|
build: "vite build",
|
|
48
48
|
playground: "cd playground && npm run dev",
|
|
49
49
|
test: "vitest",
|
|
50
50
|
"test:ci": "vitest run",
|
|
51
|
-
"test:ui": "vitest --ui",
|
|
51
|
+
"test:ui": "vitest --ui --coverage.enabled=true",
|
|
52
52
|
release: "release-it",
|
|
53
53
|
coverage: "vitest run --coverage",
|
|
54
54
|
lint: "eslint .",
|
|
@@ -59,27 +59,28 @@ const Ut = "@tresjs/core", Ft = "module", Nt = "4.0.0-rc.0", zt = "pnpm@8.15.6",
|
|
|
59
59
|
"docs:preview": "vitepress preview docs",
|
|
60
60
|
"docs:contributors": "esno scripts/update-contributors.ts",
|
|
61
61
|
prepare: "node .husky/install.mjs"
|
|
62
|
-
},
|
|
62
|
+
}, or = {
|
|
63
63
|
three: ">=0.133",
|
|
64
64
|
vue: ">=3.4"
|
|
65
|
-
},
|
|
65
|
+
}, sr = {
|
|
66
66
|
"@alvarosabu/utils": "^3.2.0",
|
|
67
67
|
"@vue/devtools-api": "^6.6.1",
|
|
68
68
|
"@vueuse/core": "^10.9.0"
|
|
69
|
-
},
|
|
69
|
+
}, ir = {
|
|
70
70
|
"@release-it/conventional-changelog": "^8.0.1",
|
|
71
|
-
"@stackblitz/sdk": "^1.
|
|
72
|
-
"@tresjs/cientos": "3.
|
|
73
|
-
"@tresjs/eslint-config": "^1.
|
|
74
|
-
"@types/three": "^0.
|
|
75
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
76
|
-
"@typescript-eslint/parser": "^7.
|
|
71
|
+
"@stackblitz/sdk": "^1.10.0",
|
|
72
|
+
"@tresjs/cientos": "3.9.0",
|
|
73
|
+
"@tresjs/eslint-config": "^1.1.0",
|
|
74
|
+
"@types/three": "^0.164.1",
|
|
75
|
+
"@typescript-eslint/eslint-plugin": "^7.10.0",
|
|
76
|
+
"@typescript-eslint/parser": "^7.10.0",
|
|
77
77
|
"@vitejs/plugin-vue": "^5.0.4",
|
|
78
78
|
"@vitest/coverage-c8": "^0.33.0",
|
|
79
|
-
"@vitest/
|
|
80
|
-
"@
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
"@vitest/coverage-v8": "^1.6.0",
|
|
80
|
+
"@vitest/ui": "^1.6.0",
|
|
81
|
+
"@vue/test-utils": "^2.4.6",
|
|
82
|
+
eslint: "^9.3.0",
|
|
83
|
+
"eslint-plugin-vue": "^9.26.0",
|
|
83
84
|
esno: "^4.7.0",
|
|
84
85
|
gsap: "^3.12.5",
|
|
85
86
|
husky: "^9.0.11",
|
|
@@ -87,217 +88,217 @@ const Ut = "@tresjs/core", Ft = "module", Nt = "4.0.0-rc.0", zt = "pnpm@8.15.6",
|
|
|
87
88
|
kolorist: "^1.8.0",
|
|
88
89
|
ohmyfetch: "^0.4.21",
|
|
89
90
|
pathe: "^1.1.2",
|
|
90
|
-
"release-it": "^17.
|
|
91
|
+
"release-it": "^17.3.0",
|
|
91
92
|
"rollup-plugin-analyzer": "^4.0.0",
|
|
92
93
|
"rollup-plugin-copy": "^3.5.0",
|
|
93
94
|
"rollup-plugin-visualizer": "^5.12.0",
|
|
94
|
-
three: "^0.
|
|
95
|
-
unocss: "^0.
|
|
95
|
+
three: "^0.164.1",
|
|
96
|
+
unocss: "^0.60.3",
|
|
96
97
|
unplugin: "^1.10.1",
|
|
97
|
-
"unplugin-vue-components": "^0.
|
|
98
|
-
vite: "^5.2.
|
|
98
|
+
"unplugin-vue-components": "^0.27.0",
|
|
99
|
+
vite: "^5.2.11",
|
|
99
100
|
"vite-plugin-banner": "^0.7.1",
|
|
100
|
-
"vite-plugin-dts": "3.9.
|
|
101
|
+
"vite-plugin-dts": "3.9.1",
|
|
101
102
|
"vite-plugin-inspect": "^0.8.4",
|
|
102
103
|
"vite-plugin-require-transform": "^1.0.21",
|
|
103
104
|
"vite-svg-loader": "^5.1.0",
|
|
104
|
-
vitepress: "1.
|
|
105
|
-
vitest: "^1.
|
|
106
|
-
vue: "^3.4.
|
|
105
|
+
vitepress: "1.2.2",
|
|
106
|
+
vitest: "^1.6.0",
|
|
107
|
+
vue: "^3.4.27",
|
|
107
108
|
"vue-demi": "^0.14.7"
|
|
108
|
-
},
|
|
109
|
-
name:
|
|
110
|
-
type:
|
|
111
|
-
version:
|
|
112
|
-
packageManager:
|
|
113
|
-
description:
|
|
114
|
-
author:
|
|
115
|
-
license:
|
|
116
|
-
keywords:
|
|
109
|
+
}, ar = {
|
|
110
|
+
name: Wt,
|
|
111
|
+
type: Nt,
|
|
112
|
+
version: zt,
|
|
113
|
+
packageManager: Gt,
|
|
114
|
+
description: Vt,
|
|
115
|
+
author: qt,
|
|
116
|
+
license: Yt,
|
|
117
|
+
keywords: Jt,
|
|
117
118
|
sideEffects: Qt,
|
|
118
|
-
exports:
|
|
119
|
-
main:
|
|
120
|
-
module:
|
|
121
|
-
types:
|
|
122
|
-
files:
|
|
123
|
-
publishConfig:
|
|
124
|
-
scripts:
|
|
125
|
-
peerDependencies:
|
|
126
|
-
dependencies:
|
|
127
|
-
devDependencies:
|
|
128
|
-
},
|
|
129
|
-
const
|
|
130
|
-
() =>
|
|
131
|
-
),
|
|
132
|
-
const s =
|
|
119
|
+
exports: Kt,
|
|
120
|
+
main: Xt,
|
|
121
|
+
module: Zt,
|
|
122
|
+
types: er,
|
|
123
|
+
files: tr,
|
|
124
|
+
publishConfig: rr,
|
|
125
|
+
scripts: nr,
|
|
126
|
+
peerDependencies: or,
|
|
127
|
+
dependencies: sr,
|
|
128
|
+
devDependencies: ir
|
|
129
|
+
}, lr = ({ sizes: e }) => {
|
|
130
|
+
const t = A([]), n = B(
|
|
131
|
+
() => t.value[0]
|
|
132
|
+
), o = (r) => {
|
|
133
|
+
const s = r instanceof mt ? r : t.value.find((a) => a.uuid === r);
|
|
133
134
|
if (!s)
|
|
134
135
|
return;
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
}, i = (
|
|
138
|
-
|
|
139
|
-
},
|
|
140
|
-
|
|
136
|
+
const u = t.value.filter(({ uuid: a }) => a !== s.uuid);
|
|
137
|
+
t.value = [s, ...u];
|
|
138
|
+
}, i = (r, s = !1) => {
|
|
139
|
+
t.value.some(({ uuid: u }) => u === r.uuid) || (s ? o(r) : t.value.push(r));
|
|
140
|
+
}, l = (r) => {
|
|
141
|
+
t.value = t.value.filter(({ uuid: s }) => s !== r.uuid);
|
|
141
142
|
};
|
|
142
143
|
return ve(() => {
|
|
143
|
-
e.aspectRatio.value &&
|
|
144
|
-
!
|
|
144
|
+
e.aspectRatio.value && t.value.forEach((r) => {
|
|
145
|
+
!r.manual && (r instanceof fe || ur(r)) && (r instanceof fe ? r.aspect = e.aspectRatio.value : (r.left = e.width.value * -0.5, r.right = e.width.value * 0.5, r.top = e.height.value * 0.5, r.bottom = e.height.value * -0.5), r.updateProjectionMatrix());
|
|
145
146
|
});
|
|
146
|
-
}),
|
|
147
|
-
|
|
147
|
+
}), N(() => {
|
|
148
|
+
t.value = [];
|
|
148
149
|
}), {
|
|
149
|
-
camera:
|
|
150
|
-
cameras:
|
|
150
|
+
camera: n,
|
|
151
|
+
cameras: t,
|
|
151
152
|
registerCamera: i,
|
|
152
|
-
deregisterCamera:
|
|
153
|
-
setCameraActive:
|
|
153
|
+
deregisterCamera: l,
|
|
154
|
+
setCameraActive: o
|
|
154
155
|
};
|
|
155
156
|
};
|
|
156
|
-
function
|
|
157
|
+
function ur(e) {
|
|
157
158
|
return e.hasOwnProperty("isOrthographicCamera") && e.isOrthographicCamera;
|
|
158
159
|
}
|
|
159
|
-
const
|
|
160
|
-
let
|
|
161
|
-
const { pause:
|
|
160
|
+
const qe = x(), Ye = x(), he = x(), q = new We();
|
|
161
|
+
let ne = 0, oe = 0;
|
|
162
|
+
const { pause: cr, resume: fr, isActive: dr } = Ve(
|
|
162
163
|
() => {
|
|
163
|
-
|
|
164
|
+
qe.trigger({ delta: ne, elapsed: oe, clock: q }), Ye.trigger({ delta: ne, elapsed: oe, clock: q }), he.trigger({ delta: ne, elapsed: oe, clock: q });
|
|
164
165
|
},
|
|
165
166
|
{ immediate: !1 }
|
|
166
167
|
);
|
|
167
|
-
|
|
168
|
-
|
|
168
|
+
he.on(() => {
|
|
169
|
+
ne = q.getDelta(), oe = q.getElapsedTime();
|
|
169
170
|
});
|
|
170
|
-
const
|
|
171
|
-
onBeforeLoop:
|
|
172
|
-
onLoop:
|
|
173
|
-
onAfterLoop:
|
|
174
|
-
pause:
|
|
175
|
-
resume:
|
|
176
|
-
isActive:
|
|
177
|
-
}),
|
|
178
|
-
function
|
|
179
|
-
function e(...
|
|
180
|
-
typeof
|
|
171
|
+
const ln = () => ({
|
|
172
|
+
onBeforeLoop: qe.on,
|
|
173
|
+
onLoop: Ye.on,
|
|
174
|
+
onAfterLoop: he.on,
|
|
175
|
+
pause: cr,
|
|
176
|
+
resume: fr,
|
|
177
|
+
isActive: dr
|
|
178
|
+
}), un = !0, K = "[TresJS ▲ ■ ●] ";
|
|
179
|
+
function $() {
|
|
180
|
+
function e(...o) {
|
|
181
|
+
typeof o[0] == "string" ? o[0] = K + o[0] : o.unshift(K), console.error(...o);
|
|
181
182
|
}
|
|
182
|
-
function
|
|
183
|
-
typeof
|
|
183
|
+
function t(...o) {
|
|
184
|
+
typeof o[0] == "string" ? o[0] = K + o[0] : o.unshift(K), console.warn(...o);
|
|
184
185
|
}
|
|
185
|
-
function o
|
|
186
|
+
function n(o, i) {
|
|
186
187
|
}
|
|
187
188
|
return {
|
|
188
189
|
logError: e,
|
|
189
|
-
logWarning:
|
|
190
|
-
logMessage:
|
|
190
|
+
logWarning: t,
|
|
191
|
+
logMessage: n
|
|
191
192
|
};
|
|
192
193
|
}
|
|
193
|
-
function
|
|
194
|
-
return typeof e == "number" ? [e, e, e] : e instanceof
|
|
194
|
+
function cn(e) {
|
|
195
|
+
return typeof e == "number" ? [e, e, e] : e instanceof ge ? [e.x, e.y, e.z] : e;
|
|
195
196
|
}
|
|
196
|
-
function
|
|
197
|
-
return e instanceof
|
|
197
|
+
function pr(e) {
|
|
198
|
+
return e instanceof re ? e : Array.isArray(e) ? new re(...e) : new re(e);
|
|
198
199
|
}
|
|
199
|
-
class
|
|
200
|
-
constructor(...
|
|
201
|
-
super(...
|
|
200
|
+
class mr extends Fe.Mesh {
|
|
201
|
+
constructor(...n) {
|
|
202
|
+
super(...n);
|
|
202
203
|
se(this, "type", "HightlightMesh");
|
|
203
204
|
se(this, "createTime");
|
|
204
205
|
this.createTime = Date.now();
|
|
205
206
|
}
|
|
206
207
|
onBeforeRender() {
|
|
207
|
-
const
|
|
208
|
-
this.scale.set(
|
|
208
|
+
const o = (Date.now() - this.createTime) / 1e3, r = 1 + 0.07 * Math.sin(2.5 * o);
|
|
209
|
+
this.scale.set(r, r, r);
|
|
209
210
|
}
|
|
210
211
|
}
|
|
211
|
-
const
|
|
212
|
-
for (const
|
|
213
|
-
|
|
214
|
-
return Object.assign(e || {},
|
|
215
|
-
},
|
|
216
|
-
function
|
|
212
|
+
const Je = (e, t) => {
|
|
213
|
+
for (const n of Object.keys(t))
|
|
214
|
+
t[n] instanceof Object && Object.assign(t[n], Je(e[n], t[n]));
|
|
215
|
+
return Object.assign(e || {}, t), e;
|
|
216
|
+
}, vr = "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", gr = /* @__PURE__ */ br(vr);
|
|
217
|
+
function De(e) {
|
|
217
218
|
return e && e.nodeType === 1;
|
|
218
219
|
}
|
|
219
|
-
function
|
|
220
|
-
return e.replace(/-([a-z])/g, (
|
|
220
|
+
function X(e) {
|
|
221
|
+
return e.replace(/-([a-z])/g, (t, n) => n.toUpperCase());
|
|
221
222
|
}
|
|
222
|
-
const
|
|
223
|
-
function
|
|
224
|
-
return e.replace(
|
|
223
|
+
const hr = /\B([A-Z])/g;
|
|
224
|
+
function yr(e) {
|
|
225
|
+
return e.replace(hr, "-$1").toLowerCase();
|
|
225
226
|
}
|
|
226
|
-
function
|
|
227
|
-
const
|
|
228
|
-
for (let i = 0; i <
|
|
229
|
-
o[
|
|
230
|
-
return
|
|
227
|
+
function br(e, t) {
|
|
228
|
+
const n = /* @__PURE__ */ Object.create(null), o = e.split(",");
|
|
229
|
+
for (let i = 0; i < o.length; i++)
|
|
230
|
+
n[o[i]] = !0;
|
|
231
|
+
return (i) => !!n[i];
|
|
231
232
|
}
|
|
232
|
-
const
|
|
233
|
-
const
|
|
233
|
+
const wr = (e, t) => {
|
|
234
|
+
const n = /* @__PURE__ */ new Set(), o = [];
|
|
234
235
|
for (const i of e) {
|
|
235
|
-
const
|
|
236
|
-
|
|
236
|
+
const l = t(i);
|
|
237
|
+
n.has(l) || (n.add(l), o.push(i));
|
|
237
238
|
}
|
|
238
|
-
return
|
|
239
|
-
},
|
|
240
|
-
if (!
|
|
239
|
+
return o;
|
|
240
|
+
}, Be = (e, t) => {
|
|
241
|
+
if (!t)
|
|
241
242
|
return;
|
|
242
|
-
const
|
|
243
|
-
return
|
|
244
|
-
},
|
|
245
|
-
const
|
|
246
|
-
|
|
243
|
+
const n = Array.isArray(t) ? t : t.match(/([^[.\]])+/g);
|
|
244
|
+
return n == null ? void 0 : n.reduce((o, i) => o && o[i], e);
|
|
245
|
+
}, Mr = (e, t, n) => {
|
|
246
|
+
const o = Array.isArray(t) ? t : t.match(/([^[.\]])+/g);
|
|
247
|
+
o && o.reduce((i, l, r) => (i[l] === void 0 && (i[l] = {}), r === o.length - 1 && (i[l] = n), i[l]), e);
|
|
247
248
|
};
|
|
248
|
-
function
|
|
249
|
-
if (
|
|
250
|
-
const i = e.attributes,
|
|
251
|
-
return i.length !==
|
|
249
|
+
function Qe(e, t) {
|
|
250
|
+
if (De(e) && De(t)) {
|
|
251
|
+
const i = e.attributes, l = t.attributes;
|
|
252
|
+
return i.length !== l.length ? !1 : Array.from(i).every(({ name: r, value: s }) => t.getAttribute(r) === s);
|
|
252
253
|
}
|
|
253
|
-
if (e ===
|
|
254
|
+
if (e === t)
|
|
254
255
|
return !0;
|
|
255
|
-
if (e === null || typeof e != "object" ||
|
|
256
|
+
if (e === null || typeof e != "object" || t === null || typeof t != "object")
|
|
256
257
|
return !1;
|
|
257
|
-
const
|
|
258
|
-
if (
|
|
258
|
+
const n = Object.keys(e), o = Object.keys(t);
|
|
259
|
+
if (n.length !== o.length)
|
|
259
260
|
return !1;
|
|
260
|
-
for (const i of
|
|
261
|
-
if (!
|
|
261
|
+
for (const i of n)
|
|
262
|
+
if (!o.includes(i) || !Qe(e[i], t[i]))
|
|
262
263
|
return !1;
|
|
263
264
|
return !0;
|
|
264
265
|
}
|
|
265
|
-
function
|
|
266
|
-
if (!Array.isArray(e) || !Array.isArray(
|
|
266
|
+
function Pr(e, t) {
|
|
267
|
+
if (!Array.isArray(e) || !Array.isArray(t) || e.length !== t.length)
|
|
267
268
|
return !1;
|
|
268
|
-
for (let
|
|
269
|
-
if (!
|
|
269
|
+
for (let n = 0; n < e.length; n++)
|
|
270
|
+
if (!Qe(e[n], t[n]))
|
|
270
271
|
return !1;
|
|
271
272
|
return !0;
|
|
272
273
|
}
|
|
273
|
-
const
|
|
274
|
-
function
|
|
275
|
-
const i = (
|
|
276
|
-
if (
|
|
277
|
-
return
|
|
278
|
-
for (const
|
|
279
|
-
const y = i(
|
|
274
|
+
const Cr = Array.isArray;
|
|
275
|
+
function _r(e, t, n, o) {
|
|
276
|
+
const i = (u) => {
|
|
277
|
+
if (u.uuid === t)
|
|
278
|
+
return u;
|
|
279
|
+
for (const a of u.children) {
|
|
280
|
+
const y = i(a);
|
|
280
281
|
if (y)
|
|
281
282
|
return y;
|
|
282
283
|
}
|
|
283
|
-
},
|
|
284
|
-
if (!
|
|
284
|
+
}, l = i(e);
|
|
285
|
+
if (!l) {
|
|
285
286
|
console.warn("Object with UUID not found in the scene.");
|
|
286
287
|
return;
|
|
287
288
|
}
|
|
288
|
-
let
|
|
289
|
-
for (let
|
|
290
|
-
if (
|
|
291
|
-
|
|
289
|
+
let r = l;
|
|
290
|
+
for (let u = 0; u < n.length - 1; u++)
|
|
291
|
+
if (r[n[u]] !== void 0)
|
|
292
|
+
r = r[n[u]];
|
|
292
293
|
else {
|
|
293
|
-
console.warn(`Property path is not valid: ${
|
|
294
|
+
console.warn(`Property path is not valid: ${n.join(".")}`);
|
|
294
295
|
return;
|
|
295
296
|
}
|
|
296
|
-
const s =
|
|
297
|
-
|
|
297
|
+
const s = n[n.length - 1];
|
|
298
|
+
r[s] !== void 0 ? r[s] = o : console.warn(`Property path is not valid: ${n.join(".")}`);
|
|
298
299
|
}
|
|
299
|
-
function
|
|
300
|
-
const
|
|
300
|
+
function Er(e) {
|
|
301
|
+
const t = new ze({
|
|
301
302
|
color: 11003607,
|
|
302
303
|
// Highlight color, e.g., yellow
|
|
303
304
|
transparent: !0,
|
|
@@ -307,32 +308,32 @@ function Eo(e) {
|
|
|
307
308
|
side: vt
|
|
308
309
|
// To e
|
|
309
310
|
});
|
|
310
|
-
return new
|
|
311
|
+
return new mr(e.geometry.clone(), t);
|
|
311
312
|
}
|
|
312
|
-
function
|
|
313
|
-
var
|
|
314
|
-
let
|
|
315
|
-
return e.value && ((
|
|
313
|
+
function kr(e) {
|
|
314
|
+
var n;
|
|
315
|
+
let t = e.value;
|
|
316
|
+
return e.value && ((n = e.value) != null && n.isMesh) && (t = e.value.position), Array.isArray(e.value) && (t = new ge(...t)), t;
|
|
316
317
|
}
|
|
317
|
-
function
|
|
318
|
+
function Sr(e) {
|
|
318
319
|
return "map" in e;
|
|
319
320
|
}
|
|
320
|
-
function
|
|
321
|
-
|
|
321
|
+
function Re(e) {
|
|
322
|
+
Sr(e) && e.map && e.map.dispose(), e.dispose();
|
|
322
323
|
}
|
|
323
|
-
function
|
|
324
|
-
var
|
|
325
|
-
if (e.parent && ((
|
|
324
|
+
function ye(e) {
|
|
325
|
+
var n, o;
|
|
326
|
+
if (e.parent && ((n = e.removeFromParent) == null || n.call(e)), delete e.__tres, [...e.children].forEach((i) => ye(i)), !(e instanceof Ne)) {
|
|
326
327
|
const i = e;
|
|
327
|
-
i.geometry && (i.geometry.dispose(), delete i.geometry), Array.isArray(i.material) ? (i.material.forEach((
|
|
328
|
+
e && ((o = e.dispose) == null || o.call(e)), i.geometry && (i.geometry.dispose(), delete i.geometry), Array.isArray(i.material) ? (i.material.forEach((l) => Re(l)), delete i.material) : i.material && (Re(i.material), delete i.material);
|
|
328
329
|
}
|
|
329
330
|
}
|
|
330
|
-
const
|
|
331
|
+
const xr = Number.parseInt(gt.replace("dev", "")), Z = {
|
|
331
332
|
realistic: {
|
|
332
333
|
shadows: !0,
|
|
333
334
|
physicallyCorrectLights: !0,
|
|
334
335
|
outputColorSpace: ht,
|
|
335
|
-
toneMapping:
|
|
336
|
+
toneMapping: Ge,
|
|
336
337
|
toneMappingExposure: 3,
|
|
337
338
|
shadowMap: {
|
|
338
339
|
enabled: !0,
|
|
@@ -340,364 +341,447 @@ const So = Number.parseInt(gt.replace("dev", "")), X = {
|
|
|
340
341
|
}
|
|
341
342
|
},
|
|
342
343
|
flat: {
|
|
343
|
-
toneMapping:
|
|
344
|
+
toneMapping: bt,
|
|
344
345
|
toneMappingExposure: 1
|
|
345
346
|
}
|
|
346
347
|
};
|
|
347
|
-
function
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
disableRender: n,
|
|
352
|
-
emit: i,
|
|
353
|
-
contextParts: { sizes: a, camera: t, render: s, invalidate: l, advance: c }
|
|
348
|
+
function Tr({
|
|
349
|
+
canvas: e,
|
|
350
|
+
options: t,
|
|
351
|
+
contextParts: { sizes: n, render: o, invalidate: i, advance: l }
|
|
354
352
|
}) {
|
|
355
|
-
const
|
|
356
|
-
alpha:
|
|
357
|
-
depth:
|
|
358
|
-
canvas: Dt(
|
|
359
|
-
context:
|
|
360
|
-
stencil:
|
|
361
|
-
antialias:
|
|
362
|
-
precision:
|
|
363
|
-
powerPreference:
|
|
364
|
-
premultipliedAlpha:
|
|
365
|
-
preserveDrawingBuffer:
|
|
366
|
-
logarithmicDepthBuffer:
|
|
367
|
-
failIfMajorPerformanceCaveat:
|
|
368
|
-
})),
|
|
369
|
-
function
|
|
370
|
-
|
|
353
|
+
const r = B(() => ({
|
|
354
|
+
alpha: k(t.alpha) ?? !0,
|
|
355
|
+
depth: k(t.depth),
|
|
356
|
+
canvas: Dt(e),
|
|
357
|
+
context: k(t.context),
|
|
358
|
+
stencil: k(t.stencil),
|
|
359
|
+
antialias: k(t.antialias) ?? !0,
|
|
360
|
+
precision: k(t.precision),
|
|
361
|
+
powerPreference: k(t.powerPreference),
|
|
362
|
+
premultipliedAlpha: k(t.premultipliedAlpha),
|
|
363
|
+
preserveDrawingBuffer: k(t.preserveDrawingBuffer),
|
|
364
|
+
logarithmicDepthBuffer: k(t.logarithmicDepthBuffer),
|
|
365
|
+
failIfMajorPerformanceCaveat: k(t.failIfMajorPerformanceCaveat)
|
|
366
|
+
})), s = U(new ie(r.value));
|
|
367
|
+
function u() {
|
|
368
|
+
t.renderMode === "on-demand" && i();
|
|
371
369
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
}),
|
|
375
|
-
|
|
370
|
+
V(r, () => {
|
|
371
|
+
s.value.dispose(), s.value = new ie(r.value), u();
|
|
372
|
+
}), V([n.width, n.height], () => {
|
|
373
|
+
s.value.setSize(n.width.value, n.height.value), u();
|
|
376
374
|
}, {
|
|
377
375
|
immediate: !0
|
|
378
|
-
}),
|
|
379
|
-
const { pixelRatio:
|
|
380
|
-
|
|
381
|
-
|
|
376
|
+
}), V(() => t.clearColor, u);
|
|
377
|
+
const { pixelRatio: a } = Bt();
|
|
378
|
+
V(a, () => {
|
|
379
|
+
s.value.setPixelRatio(a.value);
|
|
382
380
|
});
|
|
383
|
-
const { logError:
|
|
384
|
-
|
|
385
|
-
t.value && !S(n) && s.frames.value > 0 && (u.value.render(e, t.value), i("render", u.value)), s.priority.value = 0, S(o.renderMode) === "always" ? s.frames.value = 1 : s.frames.value = Math.max(0, s.frames.value - 1);
|
|
386
|
-
}), m();
|
|
387
|
-
const p = (() => {
|
|
388
|
-
const _ = new ie(), v = {
|
|
381
|
+
const { logError: y } = $(), p = (() => {
|
|
382
|
+
const f = new ie(), b = {
|
|
389
383
|
shadowMap: {
|
|
390
|
-
enabled:
|
|
391
|
-
type:
|
|
384
|
+
enabled: f.shadowMap.enabled,
|
|
385
|
+
type: f.shadowMap.type
|
|
392
386
|
},
|
|
393
|
-
toneMapping:
|
|
394
|
-
toneMappingExposure:
|
|
395
|
-
outputColorSpace:
|
|
387
|
+
toneMapping: f.toneMapping,
|
|
388
|
+
toneMappingExposure: f.toneMappingExposure,
|
|
389
|
+
outputColorSpace: f.outputColorSpace
|
|
396
390
|
};
|
|
397
|
-
return
|
|
398
|
-
})(),
|
|
399
|
-
return
|
|
400
|
-
|
|
401
|
-
},
|
|
402
|
-
const
|
|
403
|
-
|
|
404
|
-
const
|
|
405
|
-
const
|
|
406
|
-
if (
|
|
407
|
-
return
|
|
391
|
+
return f.dispose(), b;
|
|
392
|
+
})(), P = k(t.renderMode);
|
|
393
|
+
return P === "on-demand" && i(), P === "manual" && setTimeout(() => {
|
|
394
|
+
l();
|
|
395
|
+
}, 100), ve(() => {
|
|
396
|
+
const f = k(t.preset);
|
|
397
|
+
f && (f in Z || y(`Renderer Preset must be one of these: ${Object.keys(Z).join(", ")}`), Je(s.value, Z[f])), P === "always" && (o.frames.value = Math.max(1, o.frames.value));
|
|
398
|
+
const b = (v, h) => {
|
|
399
|
+
const _ = k(v), g = () => {
|
|
400
|
+
if (f)
|
|
401
|
+
return Be(Z[f], h);
|
|
408
402
|
};
|
|
409
|
-
if (
|
|
410
|
-
return
|
|
411
|
-
const
|
|
412
|
-
return
|
|
413
|
-
},
|
|
414
|
-
|
|
415
|
-
const
|
|
416
|
-
|
|
417
|
-
|
|
403
|
+
if (_ !== void 0)
|
|
404
|
+
return _;
|
|
405
|
+
const M = g();
|
|
406
|
+
return M !== void 0 ? M : Be(p, h);
|
|
407
|
+
}, m = (v, h) => Mr(s.value, h, b(v, h));
|
|
408
|
+
m(t.shadows, "shadowMap.enabled"), m(t.toneMapping ?? Ge, "toneMapping"), m(t.shadowMapType, "shadowMap.type"), xr < 150 && m(!t.useLegacyLights, "physicallyCorrectLights"), m(t.outputColorSpace, "outputColorSpace"), m(t.toneMappingExposure, "toneMappingExposure");
|
|
409
|
+
const w = b(t.clearColor, "clearColor");
|
|
410
|
+
w && s.value.setClearColor(
|
|
411
|
+
w ? pr(w) : new re(0)
|
|
418
412
|
// default clear color is not easily/efficiently retrievable from three
|
|
419
413
|
);
|
|
420
|
-
}),
|
|
421
|
-
|
|
414
|
+
}), N(() => {
|
|
415
|
+
s.value.dispose(), s.value.forceContextLoss();
|
|
422
416
|
}), {
|
|
423
|
-
renderer:
|
|
417
|
+
renderer: s
|
|
424
418
|
};
|
|
425
419
|
}
|
|
426
|
-
const
|
|
427
|
-
function
|
|
428
|
-
const
|
|
429
|
-
return e && e.traverse((
|
|
430
|
-
|
|
431
|
-
}),
|
|
420
|
+
const ee = (e) => typeof e == "function", Ar = (e) => !!e && e.constructor === Array;
|
|
421
|
+
function Or(e) {
|
|
422
|
+
const t = { nodes: {}, materials: {} };
|
|
423
|
+
return e && e.traverse((n) => {
|
|
424
|
+
n.name && (t.nodes[n.name] = n), n.material && !t.materials[n.material.name] && (t.materials[n.material.name] = n.material);
|
|
425
|
+
}), t;
|
|
432
426
|
}
|
|
433
|
-
async function
|
|
434
|
-
const { logError:
|
|
435
|
-
i && i(
|
|
436
|
-
const
|
|
437
|
-
(
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
(
|
|
441
|
-
|
|
427
|
+
async function fn(e, t, n, o, i) {
|
|
428
|
+
const { logError: l } = $(), r = new e();
|
|
429
|
+
i && i(r), n && n(r);
|
|
430
|
+
const u = (Array.isArray(t) ? t : [t]).map(
|
|
431
|
+
(a) => new Promise((y, c) => {
|
|
432
|
+
r.load(
|
|
433
|
+
a,
|
|
434
|
+
(p) => {
|
|
435
|
+
p.scene && Object.assign(p, Or(p.scene)), y(p);
|
|
442
436
|
},
|
|
443
|
-
|
|
444
|
-
(
|
|
437
|
+
o,
|
|
438
|
+
(p) => c(l("[useLoader] - Failed to load resource", p))
|
|
445
439
|
);
|
|
446
440
|
})
|
|
447
441
|
);
|
|
448
|
-
return
|
|
442
|
+
return Ar(t) ? await Promise.all(u) : await u[0];
|
|
449
443
|
}
|
|
450
|
-
async function
|
|
451
|
-
const
|
|
452
|
-
|
|
444
|
+
async function dn(e, t) {
|
|
445
|
+
const n = new wt(t), o = (i) => new Promise((l, r) => {
|
|
446
|
+
n.load(
|
|
453
447
|
i,
|
|
454
|
-
(s) =>
|
|
448
|
+
(s) => l(s),
|
|
455
449
|
() => null,
|
|
456
450
|
() => {
|
|
457
|
-
|
|
451
|
+
r(new Error("[useTextures] - Failed to load texture"));
|
|
458
452
|
}
|
|
459
453
|
);
|
|
460
454
|
});
|
|
461
|
-
if (
|
|
462
|
-
const i = await Promise.all(e.map((
|
|
455
|
+
if (Cr(e)) {
|
|
456
|
+
const i = await Promise.all(e.map((l) => o(l)));
|
|
463
457
|
return e.length > 1 ? i : i[0];
|
|
464
458
|
} else {
|
|
465
459
|
const {
|
|
466
460
|
map: i,
|
|
467
|
-
displacementMap:
|
|
468
|
-
normalMap:
|
|
461
|
+
displacementMap: l,
|
|
462
|
+
normalMap: r,
|
|
469
463
|
roughnessMap: s,
|
|
470
|
-
metalnessMap:
|
|
471
|
-
aoMap:
|
|
464
|
+
metalnessMap: u,
|
|
465
|
+
aoMap: a,
|
|
472
466
|
alphaMap: y,
|
|
473
|
-
matcap:
|
|
467
|
+
matcap: c
|
|
474
468
|
} = e;
|
|
475
469
|
return {
|
|
476
|
-
map: i ? await
|
|
477
|
-
displacementMap:
|
|
478
|
-
normalMap:
|
|
479
|
-
roughnessMap: s ? await
|
|
480
|
-
metalnessMap:
|
|
481
|
-
aoMap:
|
|
482
|
-
alphaMap: y ? await
|
|
483
|
-
matcap:
|
|
470
|
+
map: i ? await o(i) : null,
|
|
471
|
+
displacementMap: l ? await o(l) : null,
|
|
472
|
+
normalMap: r ? await o(r) : null,
|
|
473
|
+
roughnessMap: s ? await o(s) : null,
|
|
474
|
+
metalnessMap: u ? await o(u) : null,
|
|
475
|
+
aoMap: a ? await o(a) : null,
|
|
476
|
+
alphaMap: y ? await o(y) : null,
|
|
477
|
+
matcap: c ? await o(c) : null
|
|
484
478
|
};
|
|
485
479
|
}
|
|
486
480
|
}
|
|
487
|
-
const
|
|
488
|
-
const
|
|
489
|
-
let
|
|
490
|
-
const { width: s, height:
|
|
491
|
-
if (
|
|
481
|
+
const Ke = (e, t) => {
|
|
482
|
+
const n = B(() => t.renderer.value.domElement), o = U([]), { x: i, y: l } = Rt({ target: n });
|
|
483
|
+
let r = 0;
|
|
484
|
+
const { width: s, height: u, top: a, left: y } = jt(n), c = ({ x: d, y: E }) => {
|
|
485
|
+
if (n.value)
|
|
492
486
|
return {
|
|
493
|
-
x: (
|
|
494
|
-
y: -((E -
|
|
487
|
+
x: (d - y.value) / s.value * 2 - 1,
|
|
488
|
+
y: -((E - a.value) / u.value) * 2 + 1
|
|
495
489
|
};
|
|
496
|
-
},
|
|
497
|
-
if (
|
|
498
|
-
return
|
|
499
|
-
},
|
|
500
|
-
const E =
|
|
501
|
-
x: (
|
|
502
|
-
y: (
|
|
490
|
+
}, p = ({ x: d, y: E }) => {
|
|
491
|
+
if (t.camera.value)
|
|
492
|
+
return t.raycaster.value.setFromCamera(new ae(d, E), t.camera.value), o.value = t.raycaster.value.intersectObjects(e.value, !0), o.value;
|
|
493
|
+
}, P = (d) => {
|
|
494
|
+
const E = c({
|
|
495
|
+
x: (d == null ? void 0 : d.clientX) ?? i.value,
|
|
496
|
+
y: (d == null ? void 0 : d.clientY) ?? l.value
|
|
503
497
|
});
|
|
504
|
-
return E ?
|
|
505
|
-
},
|
|
506
|
-
function M(
|
|
498
|
+
return E ? p(E) || [] : [];
|
|
499
|
+
}, f = x(), b = x(), m = x(), w = x(), v = x(), h = x(), _ = x(), g = x();
|
|
500
|
+
function M(d) {
|
|
507
501
|
const E = {};
|
|
508
|
-
for (const
|
|
509
|
-
typeof
|
|
502
|
+
for (const I in d)
|
|
503
|
+
typeof I != "function" && (E[I] = d[I]);
|
|
510
504
|
return E;
|
|
511
505
|
}
|
|
512
|
-
const
|
|
513
|
-
var _e,
|
|
514
|
-
const
|
|
515
|
-
|
|
516
|
-
...
|
|
517
|
-
intersections:
|
|
506
|
+
const C = (d, E) => {
|
|
507
|
+
var _e, Ee, ke;
|
|
508
|
+
const I = M(E), Q = new ge(E == null ? void 0 : E.clientX, E == null ? void 0 : E.clientY, 0).unproject((_e = t.camera) == null ? void 0 : _e.value);
|
|
509
|
+
d.trigger({
|
|
510
|
+
...I,
|
|
511
|
+
intersections: o.value,
|
|
518
512
|
// The unprojectedPoint is wrong, math needs to be fixed
|
|
519
513
|
unprojectedPoint: Q,
|
|
520
|
-
ray: (
|
|
521
|
-
camera: (
|
|
514
|
+
ray: (Ee = t.raycaster) == null ? void 0 : Ee.value.ray,
|
|
515
|
+
camera: (ke = t.camera) == null ? void 0 : ke.value,
|
|
522
516
|
sourceEvent: E,
|
|
523
|
-
delta:
|
|
517
|
+
delta: r,
|
|
524
518
|
stopPropagating: !1
|
|
525
519
|
});
|
|
526
520
|
};
|
|
527
|
-
let
|
|
528
|
-
const
|
|
529
|
-
|
|
530
|
-
},
|
|
531
|
-
|
|
521
|
+
let R;
|
|
522
|
+
const O = (d) => {
|
|
523
|
+
P(d), C(m, d), R = d;
|
|
524
|
+
}, T = () => {
|
|
525
|
+
R && O(R);
|
|
532
526
|
};
|
|
533
|
-
let
|
|
534
|
-
const
|
|
527
|
+
let S, j, L;
|
|
528
|
+
const Y = (d) => {
|
|
535
529
|
var E;
|
|
536
|
-
|
|
537
|
-
(
|
|
538
|
-
(
|
|
539
|
-
),
|
|
530
|
+
S = (E = o.value[0]) == null ? void 0 : E.object, r = 0, j = new ae(
|
|
531
|
+
(d == null ? void 0 : d.clientX) ?? i.value,
|
|
532
|
+
(d == null ? void 0 : d.clientY) ?? l.value
|
|
533
|
+
), C(v, d);
|
|
540
534
|
};
|
|
541
|
-
let
|
|
542
|
-
const we = (
|
|
543
|
-
var E,
|
|
544
|
-
|
|
545
|
-
(
|
|
546
|
-
(
|
|
547
|
-
),
|
|
548
|
-
},
|
|
549
|
-
|
|
550
|
-
},
|
|
551
|
-
return
|
|
552
|
-
|
|
535
|
+
let z, J = !1;
|
|
536
|
+
const we = (d) => {
|
|
537
|
+
var E, I, Q;
|
|
538
|
+
d instanceof PointerEvent && (o.value.length === 0 && C(h, d), S === ((E = o.value[0]) == null ? void 0 : E.object) && (L = new ae(
|
|
539
|
+
(d == null ? void 0 : d.clientX) ?? i.value,
|
|
540
|
+
(d == null ? void 0 : d.clientY) ?? l.value
|
|
541
|
+
), r = j == null ? void 0 : j.distanceTo(L), d.button === 0 ? (C(f, d), z === ((I = o.value[0]) == null ? void 0 : I.object) ? J = !0 : (z = (Q = o.value[0]) == null ? void 0 : Q.object, J = !1)) : d.button === 2 && C(_, d)), C(w, d));
|
|
542
|
+
}, Me = (d) => {
|
|
543
|
+
J && (C(b, d), z = void 0, J = !1);
|
|
544
|
+
}, Pe = (d) => C(m, d), Ce = (d) => C(g, d);
|
|
545
|
+
return n.value.addEventListener("pointerup", we), n.value.addEventListener("pointerdown", Y), n.value.addEventListener("pointermove", O), n.value.addEventListener("pointerleave", Pe), n.value.addEventListener("dblclick", Me), n.value.addEventListener("wheel", Ce), N(() => {
|
|
546
|
+
n != null && n.value && (n.value.removeEventListener("pointerup", we), n.value.removeEventListener("pointerdown", Y), n.value.removeEventListener("pointermove", O), n.value.removeEventListener("pointerleave", Pe), n.value.removeEventListener("dblclick", Me), n.value.removeEventListener("wheel", Ce));
|
|
553
547
|
}), {
|
|
554
|
-
intersects:
|
|
555
|
-
onClick: (
|
|
556
|
-
onDblClick: (
|
|
557
|
-
onContextMenu: (
|
|
558
|
-
onPointerMove: (
|
|
559
|
-
onPointerUp: (
|
|
560
|
-
onPointerDown: (
|
|
561
|
-
onPointerMissed: (
|
|
562
|
-
onWheel: (
|
|
563
|
-
forceUpdate:
|
|
548
|
+
intersects: o,
|
|
549
|
+
onClick: (d) => f.on(d).off,
|
|
550
|
+
onDblClick: (d) => b.on(d).off,
|
|
551
|
+
onContextMenu: (d) => _.on(d).off,
|
|
552
|
+
onPointerMove: (d) => m.on(d).off,
|
|
553
|
+
onPointerUp: (d) => w.on(d).off,
|
|
554
|
+
onPointerDown: (d) => v.on(d).off,
|
|
555
|
+
onPointerMissed: (d) => h.on(d).off,
|
|
556
|
+
onWheel: (d) => g.on(d).off,
|
|
557
|
+
forceUpdate: T
|
|
564
558
|
};
|
|
565
559
|
};
|
|
566
|
-
function
|
|
567
|
-
const { logWarning: e } =
|
|
568
|
-
function
|
|
569
|
-
let
|
|
570
|
-
return
|
|
571
|
-
|
|
572
|
-
}),
|
|
560
|
+
function pn() {
|
|
561
|
+
const { logWarning: e } = $();
|
|
562
|
+
function t(l, r, s) {
|
|
563
|
+
let u = null;
|
|
564
|
+
return l.traverse((a) => {
|
|
565
|
+
a[r] === s && (u = a);
|
|
566
|
+
}), u || e(`Child with ${r} '${s}' not found.`), u;
|
|
573
567
|
}
|
|
574
|
-
function
|
|
575
|
-
const
|
|
576
|
-
return
|
|
577
|
-
|
|
578
|
-
}),
|
|
568
|
+
function n(l, r, s) {
|
|
569
|
+
const u = [];
|
|
570
|
+
return l.traverse((a) => {
|
|
571
|
+
a[r].includes(s) && u.push(a);
|
|
572
|
+
}), u.length || e(`Children with ${r} '${s}' not found.`), u;
|
|
579
573
|
}
|
|
580
|
-
function
|
|
581
|
-
return
|
|
574
|
+
function o(l, r) {
|
|
575
|
+
return t(l, "name", r);
|
|
582
576
|
}
|
|
583
|
-
function i(
|
|
584
|
-
return
|
|
577
|
+
function i(l, r) {
|
|
578
|
+
return n(l, "name", r);
|
|
585
579
|
}
|
|
586
580
|
return {
|
|
587
|
-
seek:
|
|
588
|
-
seekByName:
|
|
589
|
-
seekAll:
|
|
581
|
+
seek: t,
|
|
582
|
+
seekByName: o,
|
|
583
|
+
seekAll: n,
|
|
590
584
|
seekAllByName: i
|
|
591
585
|
};
|
|
592
586
|
}
|
|
593
|
-
const
|
|
594
|
-
const
|
|
587
|
+
const mn = (e) => {
|
|
588
|
+
const t = $e({
|
|
595
589
|
click: /* @__PURE__ */ new Map(),
|
|
596
590
|
pointerMove: /* @__PURE__ */ new Map(),
|
|
597
591
|
pointerEnter: /* @__PURE__ */ new Map(),
|
|
598
592
|
pointerLeave: /* @__PURE__ */ new Map()
|
|
599
|
-
}),
|
|
600
|
-
|
|
601
|
-
}, i = (
|
|
602
|
-
|
|
603
|
-
},
|
|
604
|
-
Object.values(
|
|
605
|
-
},
|
|
606
|
-
const { onClick:
|
|
607
|
-
|
|
608
|
-
}, s =
|
|
609
|
-
() =>
|
|
593
|
+
}), n = A(/* @__PURE__ */ new Set()), o = (c) => {
|
|
594
|
+
n.value.add(c);
|
|
595
|
+
}, i = (c) => {
|
|
596
|
+
n.value.delete(c);
|
|
597
|
+
}, l = (c) => {
|
|
598
|
+
Object.values(t).forEach((p) => p.delete(c)), i(c);
|
|
599
|
+
}, r = (c) => {
|
|
600
|
+
const { onClick: p, onPointerMove: P, onPointerEnter: f, onPointerLeave: b } = c;
|
|
601
|
+
p && t.click.set(c, p), P && t.pointerMove.set(c, P), f && t.pointerEnter.set(c, f), b && t.pointerLeave.set(c, b);
|
|
602
|
+
}, s = B(
|
|
603
|
+
() => wr(
|
|
610
604
|
[
|
|
611
|
-
...Array.from(
|
|
612
|
-
...Object.values(
|
|
605
|
+
...Array.from(n.value),
|
|
606
|
+
...Object.values(t).map((c) => Array.from(c.keys())).flat()
|
|
613
607
|
],
|
|
614
|
-
({ uuid:
|
|
608
|
+
({ uuid: c }) => c
|
|
615
609
|
)
|
|
616
610
|
);
|
|
617
|
-
e.registerObjectAtPointerEventHandler =
|
|
618
|
-
const { onClick:
|
|
619
|
-
|
|
620
|
-
var
|
|
621
|
-
|
|
611
|
+
e.registerObjectAtPointerEventHandler = r, e.deregisterObjectAtPointerEventHandler = l, e.registerBlockingObjectAtPointerEventHandler = o, e.deregisterBlockingObjectAtPointerEventHandler = i;
|
|
612
|
+
const { onClick: u, onPointerMove: a } = Ke(s, e);
|
|
613
|
+
u(({ intersects: c, event: p }) => {
|
|
614
|
+
var P;
|
|
615
|
+
c.length && ((P = t.click.get(c[0].object)) == null || P(c[0], p));
|
|
622
616
|
});
|
|
623
617
|
let y;
|
|
624
|
-
return
|
|
625
|
-
var
|
|
626
|
-
const
|
|
627
|
-
y && y !==
|
|
618
|
+
return a(({ intersects: c, event: p }) => {
|
|
619
|
+
var w, v, h, _;
|
|
620
|
+
const P = (w = c == null ? void 0 : c[0]) == null ? void 0 : w.object, { pointerLeave: f, pointerEnter: b, pointerMove: m } = t;
|
|
621
|
+
y && y !== P && ((v = f.get(y)) == null || v(y, p)), P && (y !== P && ((h = b.get(P)) == null || h(c[0], p)), (_ = m.get(P)) == null || _(c[0], p)), y = P || null;
|
|
628
622
|
}), {
|
|
629
|
-
registerObject:
|
|
630
|
-
deregisterObject:
|
|
631
|
-
registerBlockingObject:
|
|
623
|
+
registerObject: r,
|
|
624
|
+
deregisterObject: l,
|
|
625
|
+
registerBlockingObject: o,
|
|
632
626
|
deregisterBlockingObject: i
|
|
633
627
|
};
|
|
634
628
|
};
|
|
635
|
-
function
|
|
636
|
-
let
|
|
637
|
-
return e.traverse((
|
|
638
|
-
if (
|
|
639
|
-
const
|
|
640
|
-
|
|
629
|
+
function be(e) {
|
|
630
|
+
let t = 0;
|
|
631
|
+
return e.traverse((n) => {
|
|
632
|
+
if (n.isMesh && n.geometry) {
|
|
633
|
+
const o = n.geometry, i = o.attributes.position.count * 3 * Float32Array.BYTES_PER_ELEMENT, l = o.index ? o.index.count * Uint32Array.BYTES_PER_ELEMENT : 0, r = o.attributes.normal ? o.attributes.normal.count * 3 * Float32Array.BYTES_PER_ELEMENT : 0, s = o.attributes.uv ? o.attributes.uv.count * 2 * Float32Array.BYTES_PER_ELEMENT : 0, u = i + l + r + s;
|
|
634
|
+
t += u;
|
|
641
635
|
}
|
|
642
|
-
}),
|
|
636
|
+
}), t;
|
|
643
637
|
}
|
|
644
|
-
function
|
|
638
|
+
function Lr(e) {
|
|
645
639
|
return (e / 1024).toFixed(2);
|
|
646
640
|
}
|
|
647
|
-
const
|
|
648
|
-
function
|
|
649
|
-
const
|
|
641
|
+
const de = A({}), pe = (e) => Object.assign(de.value, e);
|
|
642
|
+
function Dr(e, t, n = 10) {
|
|
643
|
+
const o = k(e) ? It() : Ht(B(() => k(t).parentElement)), i = ue(Le(o.width, n)), l = ue(Le(o.height, n)), r = B(() => i.value / l.value);
|
|
650
644
|
return {
|
|
651
|
-
height:
|
|
645
|
+
height: l,
|
|
652
646
|
width: i,
|
|
653
|
-
aspectRatio:
|
|
647
|
+
aspectRatio: r
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
function le() {
|
|
651
|
+
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
|
|
652
|
+
let n = 0, o = !1;
|
|
653
|
+
const i = () => {
|
|
654
|
+
const a = Array.from(e.entries()).sort((y, c) => {
|
|
655
|
+
const p = y[1].priority - c[1].priority;
|
|
656
|
+
return p === 0 ? y[1].addI - c[1].addI : p;
|
|
657
|
+
});
|
|
658
|
+
t.clear(), a.forEach((y) => t.add(y[0]));
|
|
659
|
+
}, l = (a) => {
|
|
660
|
+
e.delete(a), t.delete(a);
|
|
661
|
+
};
|
|
662
|
+
return { on: (a, y = 0) => {
|
|
663
|
+
e.set(a, { priority: y, addI: n++ });
|
|
664
|
+
const c = () => l(a);
|
|
665
|
+
return Ut(c), o = !0, {
|
|
666
|
+
off: c
|
|
667
|
+
};
|
|
668
|
+
}, off: l, trigger: (...a) => {
|
|
669
|
+
o && (i(), o = !1), t.forEach((y) => y(...a));
|
|
670
|
+
}, dispose: () => {
|
|
671
|
+
e.clear(), t.clear();
|
|
672
|
+
}, get count() {
|
|
673
|
+
return e.size;
|
|
674
|
+
} };
|
|
675
|
+
}
|
|
676
|
+
function Br() {
|
|
677
|
+
const e = new We(!1), t = A(!1), n = A(!1);
|
|
678
|
+
let o;
|
|
679
|
+
const i = Mt.generateUUID();
|
|
680
|
+
let l = null;
|
|
681
|
+
const r = le(), s = le(), u = le();
|
|
682
|
+
let a = {};
|
|
683
|
+
function y(h) {
|
|
684
|
+
a = h;
|
|
685
|
+
}
|
|
686
|
+
function c(h, _, g = 0) {
|
|
687
|
+
switch (_) {
|
|
688
|
+
case "before":
|
|
689
|
+
return r.on(h, g);
|
|
690
|
+
case "render":
|
|
691
|
+
return l || (l = h), s.dispose(), s.on(h);
|
|
692
|
+
case "after":
|
|
693
|
+
return u.on(h, g);
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
function p() {
|
|
697
|
+
t.value || (e.start(), t.value = !0, v());
|
|
698
|
+
}
|
|
699
|
+
function P() {
|
|
700
|
+
t.value && (e.stop(), cancelAnimationFrame(o), t.value = !1);
|
|
701
|
+
}
|
|
702
|
+
function f() {
|
|
703
|
+
e.stop(), t.value = !1;
|
|
704
|
+
}
|
|
705
|
+
function b() {
|
|
706
|
+
e.start(), t.value = !0;
|
|
707
|
+
}
|
|
708
|
+
function m() {
|
|
709
|
+
n.value = !0;
|
|
710
|
+
}
|
|
711
|
+
function w() {
|
|
712
|
+
n.value = !1;
|
|
713
|
+
}
|
|
714
|
+
function v() {
|
|
715
|
+
const h = e.getDelta(), _ = e.getElapsedTime(), g = {
|
|
716
|
+
camera: W(a.camera),
|
|
717
|
+
scene: W(a.scene),
|
|
718
|
+
renderer: W(a.renderer),
|
|
719
|
+
raycaster: W(a.raycaster),
|
|
720
|
+
controls: W(a.controls),
|
|
721
|
+
invalidate: a.invalidate,
|
|
722
|
+
advance: a.advance
|
|
723
|
+
}, M = { delta: h, elapsed: _, clock: e, ...g };
|
|
724
|
+
t.value && r.trigger(M), n.value || (s.count ? s.trigger(M) : l && l(M)), t.value && u.trigger(M), o = requestAnimationFrame(v);
|
|
725
|
+
}
|
|
726
|
+
return {
|
|
727
|
+
loopId: i,
|
|
728
|
+
register: (h, _, g) => c(h, _, g),
|
|
729
|
+
start: p,
|
|
730
|
+
stop: P,
|
|
731
|
+
pause: f,
|
|
732
|
+
resume: b,
|
|
733
|
+
pauseRender: m,
|
|
734
|
+
resumeRender: w,
|
|
735
|
+
isRenderPaused: n,
|
|
736
|
+
isActive: t,
|
|
737
|
+
setContext: y
|
|
654
738
|
};
|
|
655
739
|
}
|
|
656
|
-
function
|
|
740
|
+
function Rr({
|
|
657
741
|
scene: e,
|
|
658
|
-
canvas:
|
|
659
|
-
windowSize:
|
|
660
|
-
disableRender:
|
|
742
|
+
canvas: t,
|
|
743
|
+
windowSize: n,
|
|
744
|
+
disableRender: o,
|
|
661
745
|
rendererOptions: i,
|
|
662
|
-
emit:
|
|
746
|
+
emit: l
|
|
663
747
|
}) {
|
|
664
|
-
const { logWarning:
|
|
665
|
-
camera:
|
|
748
|
+
const { logWarning: r } = $(), s = U(e), u = Dr(n, t), {
|
|
749
|
+
camera: a,
|
|
666
750
|
cameras: y,
|
|
667
|
-
registerCamera:
|
|
668
|
-
deregisterCamera:
|
|
669
|
-
setCameraActive:
|
|
670
|
-
} =
|
|
671
|
-
mode:
|
|
672
|
-
priority:
|
|
673
|
-
frames:
|
|
751
|
+
registerCamera: c,
|
|
752
|
+
deregisterCamera: p,
|
|
753
|
+
setCameraActive: P
|
|
754
|
+
} = lr({ sizes: u, scene: e }), f = {
|
|
755
|
+
mode: A(i.renderMode || "always"),
|
|
756
|
+
priority: A(0),
|
|
757
|
+
frames: A(0),
|
|
674
758
|
maxFrames: 60,
|
|
675
|
-
canBeInvalidated:
|
|
759
|
+
canBeInvalidated: B(() => f.mode.value === "on-demand" && f.frames.value === 0)
|
|
676
760
|
};
|
|
677
|
-
function
|
|
678
|
-
i.renderMode === "on-demand" ?
|
|
761
|
+
function b(L = 1) {
|
|
762
|
+
i.renderMode === "on-demand" ? f.frames.value = Math.min(f.maxFrames, f.frames.value + L) : r("`invalidate` can only be used when `renderMode` is set to `on-demand`");
|
|
679
763
|
}
|
|
680
|
-
function
|
|
681
|
-
i.renderMode === "manual" ?
|
|
764
|
+
function m() {
|
|
765
|
+
i.renderMode === "manual" ? f.frames.value = 1 : r("`advance` can only be used when `renderMode` is set to `manual`");
|
|
682
766
|
}
|
|
683
|
-
const { renderer:
|
|
767
|
+
const { renderer: w } = Tr(
|
|
684
768
|
{
|
|
685
769
|
scene: e,
|
|
686
|
-
canvas:
|
|
770
|
+
canvas: t,
|
|
687
771
|
options: i,
|
|
688
|
-
emit:
|
|
772
|
+
emit: l,
|
|
689
773
|
// TODO: replace contextParts with full ctx at https://github.com/Tresjs/tres/issues/516
|
|
690
|
-
contextParts: { sizes:
|
|
691
|
-
disableRender:
|
|
774
|
+
contextParts: { sizes: u, camera: a, render: f, invalidate: b, advance: m },
|
|
775
|
+
disableRender: o
|
|
692
776
|
}
|
|
693
|
-
),
|
|
694
|
-
sizes:
|
|
777
|
+
), v = {
|
|
778
|
+
sizes: u,
|
|
695
779
|
scene: s,
|
|
696
|
-
camera:
|
|
780
|
+
camera: a,
|
|
697
781
|
cameras: ue(y),
|
|
698
|
-
renderer:
|
|
699
|
-
raycaster:
|
|
700
|
-
controls:
|
|
782
|
+
renderer: w,
|
|
783
|
+
raycaster: U(new Pt()),
|
|
784
|
+
controls: A(null),
|
|
701
785
|
perf: {
|
|
702
786
|
maxFrames: 160,
|
|
703
787
|
fps: {
|
|
@@ -710,107 +794,152 @@ function Do({
|
|
|
710
794
|
accumulator: []
|
|
711
795
|
}
|
|
712
796
|
},
|
|
713
|
-
render:
|
|
714
|
-
advance:
|
|
715
|
-
extend:
|
|
716
|
-
invalidate:
|
|
717
|
-
registerCamera:
|
|
718
|
-
setCameraActive:
|
|
719
|
-
deregisterCamera:
|
|
720
|
-
|
|
721
|
-
ce("useTres", p), p.scene.value.__tres = {
|
|
722
|
-
root: p
|
|
797
|
+
render: f,
|
|
798
|
+
advance: m,
|
|
799
|
+
extend: pe,
|
|
800
|
+
invalidate: b,
|
|
801
|
+
registerCamera: c,
|
|
802
|
+
setCameraActive: P,
|
|
803
|
+
deregisterCamera: p,
|
|
804
|
+
loop: Br()
|
|
723
805
|
};
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
806
|
+
ce("useTres", v), v.scene.value.__tres = {
|
|
807
|
+
root: v
|
|
808
|
+
}, v.loop.register(() => {
|
|
809
|
+
a.value && f.frames.value > 0 && (w.value.render(e, a.value), l("render", v.renderer.value)), f.priority.value = 0, f.mode.value === "always" ? f.frames.value = 1 : f.frames.value = Math.max(0, f.frames.value - 1);
|
|
810
|
+
}, "render"), v.loop.start(), N(() => {
|
|
811
|
+
v.loop.stop();
|
|
812
|
+
});
|
|
813
|
+
const h = 100, _ = $t({ every: h }), { isSupported: g, memory: M } = Ft({ interval: h }), C = 160;
|
|
814
|
+
let R = performance.now();
|
|
815
|
+
const O = ({ timestamp: L }) => {
|
|
816
|
+
v.scene.value && (v.perf.memory.allocatedMem = be(v.scene.value)), L - R >= h && (R = L, v.perf.fps.accumulator.push(_.value), v.perf.fps.accumulator.length > C && v.perf.fps.accumulator.shift(), v.perf.fps.value = _.value, g.value && M.value && (v.perf.memory.accumulator.push(M.value.usedJSHeapSize / 1024 / 1024), v.perf.memory.accumulator.length > C && v.perf.memory.accumulator.shift(), v.perf.memory.currentMem = v.perf.memory.accumulator.reduce((Y, z) => Y + z, 0) / v.perf.memory.accumulator.length));
|
|
728
817
|
};
|
|
729
|
-
let
|
|
730
|
-
const
|
|
731
|
-
window.__TRES__DEVTOOLS__ && (
|
|
818
|
+
let T = 0;
|
|
819
|
+
const S = 1, { pause: j } = Ve(({ delta: L }) => {
|
|
820
|
+
window.__TRES__DEVTOOLS__ && (O({ timestamp: performance.now() }), T += L, T >= S && (window.__TRES__DEVTOOLS__.cb(v), T = 0));
|
|
732
821
|
}, { immediate: !0 });
|
|
733
|
-
return
|
|
734
|
-
|
|
735
|
-
}),
|
|
822
|
+
return N(() => {
|
|
823
|
+
j();
|
|
824
|
+
}), v;
|
|
736
825
|
}
|
|
737
|
-
function
|
|
738
|
-
const e =
|
|
826
|
+
function Xe() {
|
|
827
|
+
const e = st("useTres");
|
|
739
828
|
if (!e)
|
|
740
829
|
throw new Error("useTresContext must be used together with useTresContextProvider");
|
|
741
830
|
return e;
|
|
742
831
|
}
|
|
743
|
-
const
|
|
744
|
-
function
|
|
745
|
-
const
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
832
|
+
const vn = Xe;
|
|
833
|
+
function gn() {
|
|
834
|
+
const {
|
|
835
|
+
camera: e,
|
|
836
|
+
scene: t,
|
|
837
|
+
renderer: n,
|
|
838
|
+
loop: o,
|
|
839
|
+
raycaster: i,
|
|
840
|
+
controls: l,
|
|
841
|
+
invalidate: r,
|
|
842
|
+
advance: s
|
|
843
|
+
} = Xe();
|
|
844
|
+
o.setContext({
|
|
845
|
+
camera: e,
|
|
846
|
+
scene: t,
|
|
847
|
+
renderer: n,
|
|
848
|
+
raycaster: i,
|
|
849
|
+
controls: l,
|
|
850
|
+
invalidate: r,
|
|
851
|
+
advance: s
|
|
852
|
+
});
|
|
853
|
+
function u(c, p = 0) {
|
|
854
|
+
return o.register(c, "before", p);
|
|
855
|
+
}
|
|
856
|
+
function a(c) {
|
|
857
|
+
return o.register(c, "render");
|
|
858
|
+
}
|
|
859
|
+
function y(c, p = 0) {
|
|
860
|
+
return o.register(c, "after", p);
|
|
861
|
+
}
|
|
862
|
+
return {
|
|
863
|
+
pause: o.pause,
|
|
864
|
+
resume: o.resume,
|
|
865
|
+
pauseRender: o.pauseRender,
|
|
866
|
+
resumeRender: o.resumeRender,
|
|
867
|
+
isActive: o.isActive,
|
|
868
|
+
onBeforeRender: u,
|
|
869
|
+
render: a,
|
|
870
|
+
onAfterRender: y
|
|
871
|
+
};
|
|
872
|
+
}
|
|
873
|
+
function jr(e, t, n) {
|
|
874
|
+
const o = U(), i = U();
|
|
875
|
+
e && (o.value = e), t && (i.value = t);
|
|
876
|
+
const l = B(
|
|
877
|
+
() => o.value ? o.value.children : []
|
|
749
878
|
);
|
|
750
|
-
function
|
|
751
|
-
if (Array.isArray(
|
|
752
|
-
for (const
|
|
753
|
-
|
|
754
|
-
typeof
|
|
879
|
+
function r(g, M) {
|
|
880
|
+
if (Array.isArray(g))
|
|
881
|
+
for (const C of g)
|
|
882
|
+
C(M);
|
|
883
|
+
typeof g == "function" && g(M);
|
|
755
884
|
}
|
|
756
|
-
function s(
|
|
757
|
-
const
|
|
758
|
-
M.stopPropagation =
|
|
759
|
-
for (const
|
|
885
|
+
function s(g, M) {
|
|
886
|
+
const C = [], R = () => M.stopPropagating = !0;
|
|
887
|
+
M.stopPropagation = R;
|
|
888
|
+
for (const O of M == null ? void 0 : M.intersections) {
|
|
760
889
|
if (M.stopPropagating)
|
|
761
890
|
return;
|
|
762
|
-
M = { ...M, ...
|
|
763
|
-
const { object:
|
|
764
|
-
M.eventObject =
|
|
765
|
-
let
|
|
766
|
-
for (;
|
|
767
|
-
M.eventObject =
|
|
768
|
-
const
|
|
769
|
-
|
|
891
|
+
M = { ...M, ...O };
|
|
892
|
+
const { object: T } = O;
|
|
893
|
+
M.eventObject = T, r(T[g], M), C.push(T);
|
|
894
|
+
let S = T.parent;
|
|
895
|
+
for (; S !== null && !M.stopPropagating && !C.includes(S); )
|
|
896
|
+
M.eventObject = S, r(S[g], M), C.push(S), S = S.parent;
|
|
897
|
+
const j = yr(g.slice(2));
|
|
898
|
+
n(j, { intersection: O, event: M });
|
|
770
899
|
}
|
|
771
900
|
}
|
|
772
901
|
const {
|
|
773
|
-
onClick:
|
|
774
|
-
onDblClick:
|
|
902
|
+
onClick: u,
|
|
903
|
+
onDblClick: a,
|
|
775
904
|
onContextMenu: y,
|
|
776
|
-
onPointerMove:
|
|
777
|
-
onPointerDown:
|
|
778
|
-
onPointerUp:
|
|
779
|
-
onPointerMissed:
|
|
780
|
-
onWheel:
|
|
781
|
-
forceUpdate:
|
|
782
|
-
} =
|
|
783
|
-
|
|
784
|
-
let
|
|
785
|
-
|
|
786
|
-
const M =
|
|
787
|
-
|
|
788
|
-
M.includes(
|
|
789
|
-
}),
|
|
790
|
-
|
|
791
|
-
}), s("onPointerMove",
|
|
905
|
+
onPointerMove: c,
|
|
906
|
+
onPointerDown: p,
|
|
907
|
+
onPointerUp: P,
|
|
908
|
+
onPointerMissed: f,
|
|
909
|
+
onWheel: b,
|
|
910
|
+
forceUpdate: m
|
|
911
|
+
} = Ke(l, t);
|
|
912
|
+
P((g) => s("onPointerUp", g)), p((g) => s("onPointerDown", g)), u((g) => s("onClick", g)), a((g) => s("onDoubleClick", g)), y((g) => s("onContextMenu", g)), b((g) => s("onWheel", g));
|
|
913
|
+
let w = [];
|
|
914
|
+
c((g) => {
|
|
915
|
+
const M = g.intersections.map(({ object: C }) => C);
|
|
916
|
+
w.forEach((C) => {
|
|
917
|
+
M.includes(C) || (s("onPointerLeave", g), s("onPointerOut", g));
|
|
918
|
+
}), g.intersections.forEach(({ object: C }) => {
|
|
919
|
+
w.includes(C) || (s("onPointerEnter", g), s("onPointerOver", g));
|
|
920
|
+
}), s("onPointerMove", g), w = M;
|
|
792
921
|
});
|
|
793
|
-
const
|
|
794
|
-
|
|
795
|
-
const M = () =>
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
}),
|
|
922
|
+
const v = [];
|
|
923
|
+
f((g) => {
|
|
924
|
+
const M = () => g.stopPropagating = !0;
|
|
925
|
+
g.stopPropagation = M, v.forEach((C) => {
|
|
926
|
+
g.stopPropagating || (g.eventObject = C, r(C.onPointerMissed, g));
|
|
927
|
+
}), n("pointer-missed", { event: g });
|
|
799
928
|
});
|
|
800
|
-
function h(
|
|
801
|
-
|
|
929
|
+
function h(g) {
|
|
930
|
+
v.push(g);
|
|
802
931
|
}
|
|
803
|
-
function _(
|
|
804
|
-
const M =
|
|
805
|
-
M > -1 &&
|
|
932
|
+
function _(g) {
|
|
933
|
+
const M = v.indexOf(g);
|
|
934
|
+
M > -1 && v.splice(M, 1);
|
|
806
935
|
}
|
|
807
|
-
return
|
|
808
|
-
forceUpdate:
|
|
936
|
+
return t.eventManager = {
|
|
937
|
+
forceUpdate: m,
|
|
809
938
|
registerPointerMissedObject: h,
|
|
810
939
|
deregisterPointerMissedObject: _
|
|
811
|
-
}, { forceUpdate:
|
|
940
|
+
}, { forceUpdate: m, registerPointerMissedObject: h, deregisterPointerMissedObject: _ };
|
|
812
941
|
}
|
|
813
|
-
const { logError: je } =
|
|
942
|
+
const { logError: je } = $(), Ir = [
|
|
814
943
|
"onClick",
|
|
815
944
|
"onContextMenu",
|
|
816
945
|
"onPointerMove",
|
|
@@ -826,124 +955,124 @@ const { logError: je } = B(), Ro = [
|
|
|
826
955
|
"onLostPointerCapture",
|
|
827
956
|
"onWheel"
|
|
828
957
|
];
|
|
829
|
-
function
|
|
830
|
-
var
|
|
831
|
-
const
|
|
832
|
-
|
|
958
|
+
function Ie(e) {
|
|
959
|
+
var n;
|
|
960
|
+
const t = (n = e == null ? void 0 : e.__tres) == null ? void 0 : n.root;
|
|
961
|
+
t && t.render && t.render.canBeInvalidated.value && t.invalidate();
|
|
833
962
|
}
|
|
834
|
-
const
|
|
963
|
+
const Hr = () => {
|
|
835
964
|
let e = null;
|
|
836
|
-
function r
|
|
837
|
-
if (
|
|
965
|
+
function t(r, s, u, a) {
|
|
966
|
+
if (a || (a = {}), a.args || (a.args = []), r === "template" || gr(r))
|
|
838
967
|
return null;
|
|
839
|
-
let y =
|
|
840
|
-
if (
|
|
841
|
-
(
|
|
842
|
-
const
|
|
843
|
-
y =
|
|
968
|
+
let y = r.replace("Tres", ""), c;
|
|
969
|
+
if (r === "primitive") {
|
|
970
|
+
(a == null ? void 0 : a.object) === void 0 && je("Tres primitives need a prop 'object'");
|
|
971
|
+
const p = a.object;
|
|
972
|
+
y = p.type, c = Object.assign(p.clone(), { type: y });
|
|
844
973
|
} else {
|
|
845
|
-
const
|
|
846
|
-
|
|
974
|
+
const p = de.value[y];
|
|
975
|
+
p || je(
|
|
847
976
|
`${y} is not defined on the THREE namespace. Use extend to add it to the catalog.`
|
|
848
|
-
),
|
|
977
|
+
), c = new p(...a.args);
|
|
849
978
|
}
|
|
850
|
-
return
|
|
851
|
-
...
|
|
979
|
+
return c ? (c.isCamera && (a != null && a.position || c.position.set(3, 3, 3), a != null && a.lookAt || c.lookAt(0, 0, 0)), (a == null ? void 0 : a.attach) === void 0 && (c.isMaterial ? c.attach = "material" : c.isBufferGeometry && (c.attach = "geometry")), c.__tres = {
|
|
980
|
+
...c.__tres,
|
|
852
981
|
type: y,
|
|
853
|
-
memoizedProps:
|
|
982
|
+
memoizedProps: a,
|
|
854
983
|
eventCount: 0,
|
|
855
984
|
disposable: !0,
|
|
856
|
-
primitive:
|
|
857
|
-
},
|
|
985
|
+
primitive: r === "primitive"
|
|
986
|
+
}, c.isObject3D && c.__tres && (a != null && a.material || a != null && a.geometry) && (c.__tres.disposable = !1), c) : null;
|
|
858
987
|
}
|
|
859
|
-
function
|
|
860
|
-
var
|
|
861
|
-
if (!
|
|
988
|
+
function n(r, s) {
|
|
989
|
+
var a, y, c, p, P;
|
|
990
|
+
if (!r)
|
|
862
991
|
return;
|
|
863
|
-
s && s.isScene && (e = s), e &&
|
|
864
|
-
const
|
|
865
|
-
if (
|
|
866
|
-
const { registerCamera:
|
|
867
|
-
|
|
992
|
+
s && s.isScene && (e = s), e && r.__tres && (r.__tres.root = e.__tres.root);
|
|
993
|
+
const u = s || e;
|
|
994
|
+
if (r != null && r.isObject3D) {
|
|
995
|
+
const { registerCamera: f } = (a = r == null ? void 0 : r.__tres) == null ? void 0 : a.root;
|
|
996
|
+
r != null && r.isCamera && f(r), r.onPointerMissed && ((y = r == null ? void 0 : r.__tres) != null && y.root) && ((P = (p = (c = r == null ? void 0 : r.__tres) == null ? void 0 : c.root) == null ? void 0 : p.eventManager) == null || P.registerPointerMissedObject(r));
|
|
868
997
|
}
|
|
869
|
-
|
|
998
|
+
r != null && r.isObject3D && (u != null && u.isObject3D) ? (u.add(r), r.dispatchEvent({ type: "added" })) : r != null && r.isFog ? u.fog = r : typeof (r == null ? void 0 : r.attach) == "string" && (r.__previousAttach = r[u == null ? void 0 : u.attach], u && (u[r.attach] = r));
|
|
870
999
|
}
|
|
871
|
-
function
|
|
872
|
-
var
|
|
873
|
-
if (!
|
|
1000
|
+
function o(r) {
|
|
1001
|
+
var u, a, y, c;
|
|
1002
|
+
if (!r)
|
|
874
1003
|
return;
|
|
875
|
-
const s =
|
|
876
|
-
if (
|
|
877
|
-
const
|
|
878
|
-
var
|
|
879
|
-
const
|
|
880
|
-
|
|
1004
|
+
const s = r.__tres;
|
|
1005
|
+
if (r.parent = r.parent || e, r.isObject3D) {
|
|
1006
|
+
const p = (f) => {
|
|
1007
|
+
var m, w;
|
|
1008
|
+
const b = (w = (m = r == null ? void 0 : r.__tres) == null ? void 0 : m.root) == null ? void 0 : w.deregisterCamera;
|
|
1009
|
+
f.isCamera && (b == null || b(f));
|
|
881
1010
|
};
|
|
882
|
-
(
|
|
883
|
-
var
|
|
884
|
-
|
|
885
|
-
}),
|
|
1011
|
+
(u = r.removeFromParent) == null || u.call(r), r.traverse((f) => {
|
|
1012
|
+
var b, m;
|
|
1013
|
+
p(f), f.onPointerMissed && ((m = (b = s == null ? void 0 : s.root) == null ? void 0 : b.eventManager) == null || m.deregisterPointerMissedObject(f));
|
|
1014
|
+
}), p(r), Ie(r), !((a = r.__tres) == null ? void 0 : a.primitive) && ((y = r.__tres) != null && y.disposable) && ye(r), (c = r.dispose) == null || c.call(r);
|
|
886
1015
|
}
|
|
887
1016
|
}
|
|
888
|
-
function i(
|
|
889
|
-
var y,
|
|
890
|
-
if (
|
|
891
|
-
let
|
|
892
|
-
if ((y =
|
|
893
|
-
const
|
|
894
|
-
object:
|
|
1017
|
+
function i(r, s, u, a) {
|
|
1018
|
+
var y, c;
|
|
1019
|
+
if (r) {
|
|
1020
|
+
let p = r, P = s;
|
|
1021
|
+
if ((y = r == null ? void 0 : r.__tres) != null && y.primitive && P === "object" && u !== null) {
|
|
1022
|
+
const w = t("primitive", void 0, void 0, {
|
|
1023
|
+
object: a
|
|
895
1024
|
});
|
|
896
|
-
for (const
|
|
897
|
-
if (
|
|
1025
|
+
for (const v in w) {
|
|
1026
|
+
if (v === "uuid")
|
|
898
1027
|
continue;
|
|
899
|
-
const h =
|
|
900
|
-
!(h != null && h.set) && !
|
|
1028
|
+
const h = r[v], _ = w[v];
|
|
1029
|
+
!(h != null && h.set) && !ee(h) ? r[v] = _ : h.constructor === _.constructor && (h != null && h.copy) ? h == null || h.copy(_) : Array.isArray(_) ? h.set(..._) : !h.isColor && h.setScalar ? h.setScalar(_) : h.set(_);
|
|
901
1030
|
}
|
|
902
|
-
|
|
1031
|
+
w != null && w.__tres && (w.__tres.root = e == null ? void 0 : e.__tres.root), w != null && w.isGroup ? (r.geometry = void 0, r.material = void 0) : delete r.isGroup;
|
|
903
1032
|
}
|
|
904
|
-
if (
|
|
905
|
-
|
|
1033
|
+
if (r != null && r.isObject3D && P === "blocks-pointer-events") {
|
|
1034
|
+
a || a === "" ? r[P] = a : delete r[P];
|
|
906
1035
|
return;
|
|
907
1036
|
}
|
|
908
|
-
let
|
|
909
|
-
if (
|
|
910
|
-
const
|
|
911
|
-
_ &&
|
|
912
|
-
|
|
913
|
-
new
|
|
1037
|
+
let f = X(P), b = p == null ? void 0 : p[f];
|
|
1038
|
+
if (P === "args") {
|
|
1039
|
+
const w = r, v = u ?? [], h = a ?? [], _ = ((c = r == null ? void 0 : r.__tres) == null ? void 0 : c.type) || r.type;
|
|
1040
|
+
_ && v.length && !Pr(v, h) && (p = Object.assign(
|
|
1041
|
+
w,
|
|
1042
|
+
new de.value[_](...a)
|
|
914
1043
|
));
|
|
915
1044
|
return;
|
|
916
1045
|
}
|
|
917
|
-
if (
|
|
918
|
-
if (
|
|
1046
|
+
if (p.type === "BufferGeometry") {
|
|
1047
|
+
if (P === "args")
|
|
919
1048
|
return;
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
new
|
|
1049
|
+
p.setAttribute(
|
|
1050
|
+
X(P),
|
|
1051
|
+
new Ct(...a)
|
|
923
1052
|
);
|
|
924
1053
|
return;
|
|
925
1054
|
}
|
|
926
|
-
if (
|
|
927
|
-
const
|
|
928
|
-
|
|
1055
|
+
if (P.includes("-") && b === void 0) {
|
|
1056
|
+
const w = P.split("-");
|
|
1057
|
+
b = w.reduce((v, h) => v[X(h)], p), P = w.pop(), f = P, b != null && b.set || (p = w.reduce((v, h) => v[X(h)], p));
|
|
929
1058
|
}
|
|
930
|
-
let
|
|
931
|
-
if (
|
|
932
|
-
|
|
1059
|
+
let m = a;
|
|
1060
|
+
if (m === "" && (m = !0), ee(b)) {
|
|
1061
|
+
Ir.includes(s) || (Array.isArray(m) ? r[f](...m) : r[f](m)), f.startsWith("on") && ee(m) && (p[f] = m);
|
|
933
1062
|
return;
|
|
934
1063
|
}
|
|
935
|
-
!(
|
|
1064
|
+
!(b != null && b.set) && !ee(b) ? p[f] = m : b.constructor === m.constructor && (b != null && b.copy) ? b == null || b.copy(m) : Array.isArray(m) ? b.set(...m) : !b.isColor && b.setScalar ? b.setScalar(m) : b.set(m), Ie(r);
|
|
936
1065
|
}
|
|
937
1066
|
}
|
|
938
|
-
function
|
|
939
|
-
return (
|
|
1067
|
+
function l(r) {
|
|
1068
|
+
return (r == null ? void 0 : r.parent) || null;
|
|
940
1069
|
}
|
|
941
1070
|
return {
|
|
942
|
-
insert:
|
|
943
|
-
remove:
|
|
944
|
-
createElement:
|
|
1071
|
+
insert: n,
|
|
1072
|
+
remove: o,
|
|
1073
|
+
createElement: t,
|
|
945
1074
|
patchProp: i,
|
|
946
|
-
parentNode:
|
|
1075
|
+
parentNode: l,
|
|
947
1076
|
createText: () => void 0,
|
|
948
1077
|
createComment: () => void 0,
|
|
949
1078
|
setText: () => void 0,
|
|
@@ -955,195 +1084,195 @@ const Io = () => {
|
|
|
955
1084
|
insertStaticContent: () => void 0
|
|
956
1085
|
};
|
|
957
1086
|
};
|
|
958
|
-
function
|
|
959
|
-
return
|
|
1087
|
+
function Ur() {
|
|
1088
|
+
return Ze().__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
|
960
1089
|
}
|
|
961
|
-
function
|
|
1090
|
+
function Ze() {
|
|
962
1091
|
return typeof navigator < "u" && typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : {};
|
|
963
1092
|
}
|
|
964
|
-
const $
|
|
965
|
-
let
|
|
966
|
-
function
|
|
1093
|
+
const $r = typeof Proxy == "function", Fr = "devtools-plugin:setup", Wr = "plugin:settings:set";
|
|
1094
|
+
let F, me;
|
|
1095
|
+
function Nr() {
|
|
967
1096
|
var e;
|
|
968
|
-
return
|
|
1097
|
+
return F !== void 0 || (typeof window < "u" && window.performance ? (F = !0, me = window.performance) : typeof globalThis < "u" && (!((e = globalThis.perf_hooks) === null || e === void 0) && e.performance) ? (F = !0, me = globalThis.perf_hooks.performance) : F = !1), F;
|
|
969
1098
|
}
|
|
970
|
-
function
|
|
971
|
-
return
|
|
1099
|
+
function zr() {
|
|
1100
|
+
return Nr() ? me.now() : Date.now();
|
|
972
1101
|
}
|
|
973
|
-
class
|
|
974
|
-
constructor(
|
|
975
|
-
this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin =
|
|
976
|
-
const
|
|
977
|
-
if (
|
|
978
|
-
for (const
|
|
979
|
-
const s =
|
|
980
|
-
|
|
1102
|
+
class Gr {
|
|
1103
|
+
constructor(t, n) {
|
|
1104
|
+
this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = t, this.hook = n;
|
|
1105
|
+
const o = {};
|
|
1106
|
+
if (t.settings)
|
|
1107
|
+
for (const r in t.settings) {
|
|
1108
|
+
const s = t.settings[r];
|
|
1109
|
+
o[r] = s.defaultValue;
|
|
981
1110
|
}
|
|
982
|
-
const i = `__vue-devtools-plugin-settings__${
|
|
983
|
-
let
|
|
1111
|
+
const i = `__vue-devtools-plugin-settings__${t.id}`;
|
|
1112
|
+
let l = Object.assign({}, o);
|
|
984
1113
|
try {
|
|
985
|
-
const
|
|
986
|
-
Object.assign(
|
|
1114
|
+
const r = localStorage.getItem(i), s = JSON.parse(r);
|
|
1115
|
+
Object.assign(l, s);
|
|
987
1116
|
} catch {
|
|
988
1117
|
}
|
|
989
1118
|
this.fallbacks = {
|
|
990
1119
|
getSettings() {
|
|
991
|
-
return
|
|
1120
|
+
return l;
|
|
992
1121
|
},
|
|
993
|
-
setSettings(
|
|
1122
|
+
setSettings(r) {
|
|
994
1123
|
try {
|
|
995
|
-
localStorage.setItem(i, JSON.stringify(
|
|
1124
|
+
localStorage.setItem(i, JSON.stringify(r));
|
|
996
1125
|
} catch {
|
|
997
1126
|
}
|
|
998
|
-
|
|
1127
|
+
l = r;
|
|
999
1128
|
},
|
|
1000
1129
|
now() {
|
|
1001
|
-
return
|
|
1130
|
+
return zr();
|
|
1002
1131
|
}
|
|
1003
|
-
},
|
|
1004
|
-
|
|
1132
|
+
}, n && n.on(Wr, (r, s) => {
|
|
1133
|
+
r === this.plugin.id && this.fallbacks.setSettings(s);
|
|
1005
1134
|
}), this.proxiedOn = new Proxy({}, {
|
|
1006
|
-
get: (
|
|
1135
|
+
get: (r, s) => this.target ? this.target.on[s] : (...u) => {
|
|
1007
1136
|
this.onQueue.push({
|
|
1008
1137
|
method: s,
|
|
1009
|
-
args:
|
|
1138
|
+
args: u
|
|
1010
1139
|
});
|
|
1011
1140
|
}
|
|
1012
1141
|
}), this.proxiedTarget = new Proxy({}, {
|
|
1013
|
-
get: (
|
|
1142
|
+
get: (r, s) => this.target ? this.target[s] : s === "on" ? this.proxiedOn : Object.keys(this.fallbacks).includes(s) ? (...u) => (this.targetQueue.push({
|
|
1014
1143
|
method: s,
|
|
1015
|
-
args:
|
|
1144
|
+
args: u,
|
|
1016
1145
|
resolve: () => {
|
|
1017
1146
|
}
|
|
1018
|
-
}), this.fallbacks[s](...
|
|
1147
|
+
}), this.fallbacks[s](...u)) : (...u) => new Promise((a) => {
|
|
1019
1148
|
this.targetQueue.push({
|
|
1020
1149
|
method: s,
|
|
1021
|
-
args:
|
|
1022
|
-
resolve:
|
|
1150
|
+
args: u,
|
|
1151
|
+
resolve: a
|
|
1023
1152
|
});
|
|
1024
1153
|
})
|
|
1025
1154
|
});
|
|
1026
1155
|
}
|
|
1027
|
-
async setRealTarget(
|
|
1028
|
-
this.target =
|
|
1029
|
-
for (const
|
|
1030
|
-
this.target.on[
|
|
1031
|
-
for (const
|
|
1032
|
-
|
|
1156
|
+
async setRealTarget(t) {
|
|
1157
|
+
this.target = t;
|
|
1158
|
+
for (const n of this.onQueue)
|
|
1159
|
+
this.target.on[n.method](...n.args);
|
|
1160
|
+
for (const n of this.targetQueue)
|
|
1161
|
+
n.resolve(await this.target[n.method](...n.args));
|
|
1033
1162
|
}
|
|
1034
1163
|
}
|
|
1035
|
-
function
|
|
1036
|
-
const
|
|
1037
|
-
if (i && (
|
|
1038
|
-
i.emit(
|
|
1164
|
+
function Vr(e, t) {
|
|
1165
|
+
const n = e, o = Ze(), i = Ur(), l = $r && n.enableEarlyProxy;
|
|
1166
|
+
if (i && (o.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !l))
|
|
1167
|
+
i.emit(Fr, e, t);
|
|
1039
1168
|
else {
|
|
1040
|
-
const
|
|
1041
|
-
(
|
|
1042
|
-
pluginDescriptor:
|
|
1043
|
-
setupFn:
|
|
1044
|
-
proxy:
|
|
1045
|
-
}),
|
|
1169
|
+
const r = l ? new Gr(n, i) : null;
|
|
1170
|
+
(o.__VUE_DEVTOOLS_PLUGINS__ = o.__VUE_DEVTOOLS_PLUGINS__ || []).push({
|
|
1171
|
+
pluginDescriptor: n,
|
|
1172
|
+
setupFn: t,
|
|
1173
|
+
proxy: r
|
|
1174
|
+
}), r && t(r.proxiedTarget);
|
|
1046
1175
|
}
|
|
1047
1176
|
}
|
|
1048
|
-
function
|
|
1049
|
-
const
|
|
1050
|
-
typeof
|
|
1177
|
+
function qr(e, t) {
|
|
1178
|
+
const n = `▲ ■ ●${e}`;
|
|
1179
|
+
typeof He == "function" ? He(n, t) : console.log(n);
|
|
1051
1180
|
}
|
|
1052
|
-
function
|
|
1053
|
-
throw new Error(e +
|
|
1181
|
+
function He(e, t) {
|
|
1182
|
+
throw new Error(e + t);
|
|
1054
1183
|
}
|
|
1055
|
-
const
|
|
1056
|
-
const
|
|
1184
|
+
const et = (e) => {
|
|
1185
|
+
const t = {
|
|
1057
1186
|
id: e.uuid,
|
|
1058
1187
|
label: e.type,
|
|
1059
1188
|
children: [],
|
|
1060
1189
|
tags: []
|
|
1061
1190
|
};
|
|
1062
|
-
e.name !== "" &&
|
|
1191
|
+
e.name !== "" && t.tags.push({
|
|
1063
1192
|
label: e.name,
|
|
1064
1193
|
textColor: 5750629,
|
|
1065
1194
|
backgroundColor: 15793395
|
|
1066
1195
|
});
|
|
1067
|
-
const
|
|
1068
|
-
return
|
|
1069
|
-
label: `${
|
|
1196
|
+
const n = be(e);
|
|
1197
|
+
return n > 0 && t.tags.push({
|
|
1198
|
+
label: `${Lr(n)} KB`,
|
|
1070
1199
|
textColor: 15707189,
|
|
1071
1200
|
backgroundColor: 16775644,
|
|
1072
1201
|
tooltip: "Memory usage"
|
|
1073
|
-
}), e.type.includes("Light") && (
|
|
1202
|
+
}), e.type.includes("Light") && (t.tags.push({
|
|
1074
1203
|
label: `${e.intensity}`,
|
|
1075
1204
|
textColor: 9738662,
|
|
1076
1205
|
backgroundColor: 16316922,
|
|
1077
1206
|
tooltip: "Intensity"
|
|
1078
|
-
}),
|
|
1207
|
+
}), t.tags.push({
|
|
1079
1208
|
label: `#${e.color.getHexString()}`,
|
|
1080
1209
|
textColor: 9738662,
|
|
1081
1210
|
backgroundColor: 16316922,
|
|
1082
1211
|
tooltip: "Color"
|
|
1083
|
-
})), e.type.includes("Camera") && (
|
|
1212
|
+
})), e.type.includes("Camera") && (t.tags.push({
|
|
1084
1213
|
label: `${e.fov}°`,
|
|
1085
1214
|
textColor: 9738662,
|
|
1086
1215
|
backgroundColor: 16316922,
|
|
1087
1216
|
tooltip: "Field of view"
|
|
1088
|
-
}),
|
|
1217
|
+
}), t.tags.push({
|
|
1089
1218
|
label: `x: ${Math.round(e.position.x)} y: ${Math.round(e.position.y)} z: ${Math.round(e.position.z)}`,
|
|
1090
1219
|
textColor: 9738662,
|
|
1091
1220
|
backgroundColor: 16316922,
|
|
1092
1221
|
tooltip: "Position"
|
|
1093
|
-
})),
|
|
1222
|
+
})), t;
|
|
1094
1223
|
};
|
|
1095
|
-
function
|
|
1096
|
-
e.children.forEach((
|
|
1097
|
-
if (
|
|
1224
|
+
function tt(e, t, n = "") {
|
|
1225
|
+
e.children.forEach((o) => {
|
|
1226
|
+
if (o.type === "HightlightMesh" || n && !o.type.includes(n) && !o.name.includes(n))
|
|
1098
1227
|
return;
|
|
1099
|
-
const i =
|
|
1100
|
-
|
|
1228
|
+
const i = et(o);
|
|
1229
|
+
t.children.push(i), tt(o, i, n);
|
|
1101
1230
|
});
|
|
1102
1231
|
}
|
|
1103
|
-
const
|
|
1232
|
+
const Yr = [], G = "tres:inspector", Jr = $e({
|
|
1104
1233
|
sceneGraph: null
|
|
1105
1234
|
});
|
|
1106
|
-
function
|
|
1107
|
-
|
|
1235
|
+
function Qr(e, t) {
|
|
1236
|
+
Vr(
|
|
1108
1237
|
{
|
|
1109
1238
|
id: "dev.esm.tres",
|
|
1110
1239
|
label: "TresJS 🪐",
|
|
1111
1240
|
logo: "https://raw.githubusercontent.com/Tresjs/tres/main/public/favicon.svg",
|
|
1112
1241
|
packageName: "tresjs",
|
|
1113
1242
|
homepage: "https://tresjs.org",
|
|
1114
|
-
componentStateTypes:
|
|
1243
|
+
componentStateTypes: Yr,
|
|
1115
1244
|
app: e
|
|
1116
1245
|
},
|
|
1117
|
-
(
|
|
1118
|
-
typeof
|
|
1246
|
+
(n) => {
|
|
1247
|
+
typeof n.now != "function" && qr(
|
|
1119
1248
|
"You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."
|
|
1120
|
-
),
|
|
1121
|
-
id:
|
|
1249
|
+
), n.addInspector({
|
|
1250
|
+
id: G,
|
|
1122
1251
|
label: "TresJS 🪐",
|
|
1123
1252
|
icon: "account_tree",
|
|
1124
1253
|
treeFilterPlaceholder: "Search instances"
|
|
1125
1254
|
}), setInterval(() => {
|
|
1126
|
-
|
|
1255
|
+
n.sendInspectorTree(G);
|
|
1127
1256
|
}, 1e3), setInterval(() => {
|
|
1128
|
-
|
|
1129
|
-
}, 5e3),
|
|
1130
|
-
if (
|
|
1131
|
-
const
|
|
1132
|
-
|
|
1257
|
+
n.notifyComponentUpdate();
|
|
1258
|
+
}, 5e3), n.on.getInspectorTree((l) => {
|
|
1259
|
+
if (l.inspectorId === G) {
|
|
1260
|
+
const r = et(t.scene.value);
|
|
1261
|
+
tt(t.scene.value, r, l.filter), Jr.sceneGraph = r, l.rootNodes = [r];
|
|
1133
1262
|
}
|
|
1134
1263
|
});
|
|
1135
|
-
let
|
|
1136
|
-
|
|
1137
|
-
var
|
|
1138
|
-
if (
|
|
1139
|
-
const [s] =
|
|
1264
|
+
let o = null, i = null;
|
|
1265
|
+
n.on.getInspectorState((l) => {
|
|
1266
|
+
var r;
|
|
1267
|
+
if (l.inspectorId === G) {
|
|
1268
|
+
const [s] = t.scene.value.getObjectsByProperty("uuid", l.nodeId);
|
|
1140
1269
|
if (!s)
|
|
1141
1270
|
return;
|
|
1142
|
-
if (i &&
|
|
1143
|
-
const
|
|
1144
|
-
s.add(
|
|
1271
|
+
if (i && o && o.parent && i.remove(o), s.isMesh) {
|
|
1272
|
+
const u = Er(s);
|
|
1273
|
+
s.add(u), o = u, i = s;
|
|
1145
1274
|
}
|
|
1146
|
-
|
|
1275
|
+
l.state = {
|
|
1147
1276
|
object: [
|
|
1148
1277
|
{
|
|
1149
1278
|
key: "uuid",
|
|
@@ -1228,30 +1357,30 @@ function Qo(e, r) {
|
|
|
1228
1357
|
value: s.visible
|
|
1229
1358
|
}
|
|
1230
1359
|
]
|
|
1231
|
-
}, s.isScene && (
|
|
1232
|
-
memory:
|
|
1360
|
+
}, s.isScene && (l.state.info = {
|
|
1361
|
+
memory: be(s),
|
|
1233
1362
|
objects: s.children.length,
|
|
1234
|
-
calls:
|
|
1235
|
-
triangles:
|
|
1236
|
-
points:
|
|
1237
|
-
lines:
|
|
1238
|
-
},
|
|
1239
|
-
key:
|
|
1363
|
+
calls: t.renderer.value.info.render.calls,
|
|
1364
|
+
triangles: t.renderer.value.info.render.triangles,
|
|
1365
|
+
points: t.renderer.value.info.render.points,
|
|
1366
|
+
lines: t.renderer.value.info.render.lines
|
|
1367
|
+
}, l.state.programs = ((r = t.renderer.value.info.programs) == null ? void 0 : r.map((u) => ({
|
|
1368
|
+
key: u.name,
|
|
1240
1369
|
value: {
|
|
1241
|
-
...
|
|
1242
|
-
vertexShader:
|
|
1243
|
-
attributes:
|
|
1244
|
-
uniforms:
|
|
1370
|
+
...u,
|
|
1371
|
+
vertexShader: u.vertexShader,
|
|
1372
|
+
attributes: u.getAttributes(),
|
|
1373
|
+
uniforms: u.getUniforms()
|
|
1245
1374
|
}
|
|
1246
1375
|
}))) || []);
|
|
1247
1376
|
}
|
|
1248
|
-
}),
|
|
1249
|
-
|
|
1377
|
+
}), n.on.editInspectorState((l) => {
|
|
1378
|
+
l.inspectorId === G && _r(t.scene.value, l.nodeId, l.path, l.state.value);
|
|
1250
1379
|
});
|
|
1251
1380
|
}
|
|
1252
1381
|
);
|
|
1253
1382
|
}
|
|
1254
|
-
const
|
|
1383
|
+
const Kr = ["data-scene", "data-tres"], Xr = /* @__PURE__ */ Se({
|
|
1255
1384
|
__name: "TresCanvas",
|
|
1256
1385
|
props: {
|
|
1257
1386
|
shadows: { type: Boolean, default: void 0 },
|
|
@@ -1293,115 +1422,115 @@ const Jo = ["data-scene", "data-tres"], Ko = /* @__PURE__ */ ke({
|
|
|
1293
1422
|
"pointer-missed",
|
|
1294
1423
|
"wheel"
|
|
1295
1424
|
],
|
|
1296
|
-
setup(e, { expose:
|
|
1297
|
-
var
|
|
1298
|
-
const
|
|
1299
|
-
|
|
1300
|
-
const
|
|
1425
|
+
setup(e, { expose: t, emit: n }) {
|
|
1426
|
+
var b;
|
|
1427
|
+
const o = e, i = n, l = it(), { logWarning: r } = $(), s = A(), u = U(new Ne()), a = (b = xe()) == null ? void 0 : b.appContext.app;
|
|
1428
|
+
pe(Fe);
|
|
1429
|
+
const y = (m) => Se({
|
|
1301
1430
|
setup() {
|
|
1302
|
-
var
|
|
1303
|
-
const
|
|
1304
|
-
return
|
|
1431
|
+
var v;
|
|
1432
|
+
const w = (v = xe()) == null ? void 0 : v.appContext;
|
|
1433
|
+
return w && (w.app = a), ce("useTres", m), ce("extend", pe), typeof window < "u" && Qr(w == null ? void 0 : w.app, m), () => Te(pt, null, l != null && l.default ? l.default() : []);
|
|
1305
1434
|
}
|
|
1306
|
-
}),
|
|
1307
|
-
const
|
|
1308
|
-
|
|
1309
|
-
},
|
|
1310
|
-
|
|
1311
|
-
root:
|
|
1312
|
-
},
|
|
1313
|
-
}, P =
|
|
1314
|
-
return
|
|
1315
|
-
const
|
|
1316
|
-
|
|
1317
|
-
scene:
|
|
1318
|
-
canvas:
|
|
1319
|
-
windowSize:
|
|
1435
|
+
}), c = (m) => {
|
|
1436
|
+
const w = y(m), { render: v } = dt(Hr());
|
|
1437
|
+
v(Te(w), u.value);
|
|
1438
|
+
}, p = (m, w = !1) => {
|
|
1439
|
+
ye(m.scene.value), w && (m.renderer.value.dispose(), m.renderer.value.renderLists.dispose(), m.renderer.value.forceContextLoss()), u.value.__tres = {
|
|
1440
|
+
root: m
|
|
1441
|
+
}, c(m);
|
|
1442
|
+
}, P = B(() => o.disableRender), f = U(null);
|
|
1443
|
+
return t({ context: f, dispose: () => p(f.value, !0) }), at(() => {
|
|
1444
|
+
const m = s;
|
|
1445
|
+
f.value = Rr({
|
|
1446
|
+
scene: u.value,
|
|
1447
|
+
canvas: m,
|
|
1448
|
+
windowSize: o.windowSize ?? !1,
|
|
1320
1449
|
disableRender: P.value ?? !1,
|
|
1321
|
-
rendererOptions:
|
|
1450
|
+
rendererOptions: o,
|
|
1322
1451
|
emit: i
|
|
1323
|
-
}),
|
|
1324
|
-
const { registerCamera:
|
|
1325
|
-
|
|
1326
|
-
const
|
|
1327
|
-
const
|
|
1452
|
+
}), jr(u.value, f.value, i);
|
|
1453
|
+
const { registerCamera: w, camera: v, cameras: h, deregisterCamera: _ } = f.value;
|
|
1454
|
+
c(f.value);
|
|
1455
|
+
const g = () => {
|
|
1456
|
+
const M = new fe(
|
|
1328
1457
|
45,
|
|
1329
1458
|
window.innerWidth / window.innerHeight,
|
|
1330
1459
|
0.1,
|
|
1331
1460
|
1e3
|
|
1332
1461
|
);
|
|
1333
|
-
|
|
1334
|
-
const
|
|
1335
|
-
|
|
1462
|
+
M.position.set(3, 3, 3), M.lookAt(0, 0, 0), w(M);
|
|
1463
|
+
const C = ve(() => {
|
|
1464
|
+
h.value.length >= 2 && (M.removeFromParent(), _(M), C == null || C());
|
|
1336
1465
|
});
|
|
1337
1466
|
};
|
|
1338
|
-
|
|
1339
|
-
() =>
|
|
1340
|
-
(
|
|
1341
|
-
|
|
1467
|
+
V(
|
|
1468
|
+
() => o.camera,
|
|
1469
|
+
(M, C) => {
|
|
1470
|
+
M && w(M), C && (C.removeFromParent(), _(C));
|
|
1342
1471
|
},
|
|
1343
1472
|
{
|
|
1344
1473
|
immediate: !0
|
|
1345
1474
|
}
|
|
1346
|
-
),
|
|
1475
|
+
), v.value || (r(
|
|
1347
1476
|
"No camera found. Creating a default perspective camera. To have full control over a camera, please add one to the scene."
|
|
1348
|
-
),
|
|
1349
|
-
}),
|
|
1350
|
-
|
|
1351
|
-
}), (
|
|
1477
|
+
), g());
|
|
1478
|
+
}), N(() => {
|
|
1479
|
+
p(f.value);
|
|
1480
|
+
}), (m, w) => (lt(), ut("canvas", {
|
|
1352
1481
|
ref_key: "canvas",
|
|
1353
1482
|
ref: s,
|
|
1354
|
-
"data-scene":
|
|
1355
|
-
class:
|
|
1356
|
-
"data-tres": `tresjs ${
|
|
1357
|
-
style:
|
|
1483
|
+
"data-scene": u.value.uuid,
|
|
1484
|
+
class: ct(m.$attrs.class),
|
|
1485
|
+
"data-tres": `tresjs ${W(ar).version}`,
|
|
1486
|
+
style: ft({
|
|
1358
1487
|
display: "block",
|
|
1359
1488
|
width: "100%",
|
|
1360
1489
|
height: "100%",
|
|
1361
|
-
position:
|
|
1490
|
+
position: m.windowSize ? "fixed" : "relative",
|
|
1362
1491
|
top: 0,
|
|
1363
1492
|
left: 0,
|
|
1364
1493
|
pointerEvents: "auto",
|
|
1365
1494
|
touchAction: "none",
|
|
1366
|
-
...
|
|
1495
|
+
...m.$attrs.style
|
|
1367
1496
|
})
|
|
1368
|
-
}, null, 14,
|
|
1497
|
+
}, null, 14, Kr));
|
|
1369
1498
|
}
|
|
1370
|
-
}),
|
|
1499
|
+
}), Zr = [
|
|
1371
1500
|
"TresCanvas",
|
|
1372
1501
|
"TresLeches",
|
|
1373
1502
|
"TresScene"
|
|
1374
|
-
],
|
|
1503
|
+
], en = {
|
|
1375
1504
|
template: {
|
|
1376
1505
|
compilerOptions: {
|
|
1377
|
-
isCustomElement: (e) => e.startsWith("Tres") && !
|
|
1506
|
+
isCustomElement: (e) => e.startsWith("Tres") && !Zr.includes(e) || e === "primitive"
|
|
1378
1507
|
}
|
|
1379
1508
|
}
|
|
1380
|
-
},
|
|
1381
|
-
mounted: (e,
|
|
1382
|
-
if (
|
|
1383
|
-
console.log(`v-log:${
|
|
1509
|
+
}, hn = en, yn = {
|
|
1510
|
+
mounted: (e, t) => {
|
|
1511
|
+
if (t.arg) {
|
|
1512
|
+
console.log(`v-log:${t.arg}`, e[t.arg]);
|
|
1384
1513
|
return;
|
|
1385
1514
|
}
|
|
1386
1515
|
console.log("v-log", e);
|
|
1387
1516
|
}
|
|
1388
1517
|
};
|
|
1389
|
-
class
|
|
1390
|
-
constructor(
|
|
1391
|
-
const
|
|
1392
|
-
i.setAttribute("position", new
|
|
1393
|
-
const
|
|
1394
|
-
super(i,
|
|
1395
|
-
const
|
|
1396
|
-
s.setAttribute("position", new
|
|
1518
|
+
class rt extends _t {
|
|
1519
|
+
constructor(t, n) {
|
|
1520
|
+
const o = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0, 1, 1, 0], i = new Ae();
|
|
1521
|
+
i.setAttribute("position", new Oe(o, 3)), i.computeBoundingSphere();
|
|
1522
|
+
const l = new Et({ fog: !1 });
|
|
1523
|
+
super(i, l), this.light = t, this.color = n, this.type = "RectAreaLightHelper";
|
|
1524
|
+
const r = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0], s = new Ae();
|
|
1525
|
+
s.setAttribute("position", new Oe(r, 3)), s.computeBoundingSphere(), this.add(new kt(s, new ze({ side: St, fog: !1 })));
|
|
1397
1526
|
}
|
|
1398
1527
|
updateMatrixWorld() {
|
|
1399
1528
|
if (this.scale.set(0.5 * this.light.width, 0.5 * this.light.height, 1), this.color !== void 0)
|
|
1400
1529
|
this.material.color.set(this.color), this.children[0].material.color.set(this.color);
|
|
1401
1530
|
else {
|
|
1402
1531
|
this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);
|
|
1403
|
-
const
|
|
1404
|
-
|
|
1532
|
+
const t = this.material.color, n = Math.max(t.r, t.g, t.b);
|
|
1533
|
+
n > 1 && t.multiplyScalar(1 / n), this.children[0].material.color.copy(this.material.color);
|
|
1405
1534
|
}
|
|
1406
1535
|
this.matrixWorld.extractRotation(this.light.matrixWorld).scale(this.scale).copyPosition(this.light.matrixWorld), this.children[0].matrixWorld.copy(this.matrixWorld);
|
|
1407
1536
|
}
|
|
@@ -1409,112 +1538,87 @@ class et extends _t {
|
|
|
1409
1538
|
this.geometry.dispose(), this.material.dispose(), this.children[0].geometry.dispose(), this.children[0].material.dispose();
|
|
1410
1539
|
}
|
|
1411
1540
|
}
|
|
1412
|
-
const { logWarning:
|
|
1413
|
-
let
|
|
1414
|
-
const
|
|
1415
|
-
DirectionalLight:
|
|
1416
|
-
PointLight:
|
|
1417
|
-
SpotLight:
|
|
1418
|
-
HemisphereLight:
|
|
1419
|
-
RectAreaLight:
|
|
1420
|
-
},
|
|
1541
|
+
const { logWarning: Ue } = $();
|
|
1542
|
+
let te, H;
|
|
1543
|
+
const tn = {
|
|
1544
|
+
DirectionalLight: xt,
|
|
1545
|
+
PointLight: Tt,
|
|
1546
|
+
SpotLight: At,
|
|
1547
|
+
HemisphereLight: Ot,
|
|
1548
|
+
RectAreaLight: rt
|
|
1549
|
+
}, bn = {
|
|
1421
1550
|
mounted: (e) => {
|
|
1422
1551
|
if (!e.isLight) {
|
|
1423
|
-
|
|
1552
|
+
Ue(`${e.type} is not a light`);
|
|
1424
1553
|
return;
|
|
1425
1554
|
}
|
|
1426
|
-
|
|
1555
|
+
te = tn[e.type], e.parent.add(new te(e, 1, e.color.getHex()));
|
|
1427
1556
|
},
|
|
1428
1557
|
updated: (e) => {
|
|
1429
|
-
|
|
1558
|
+
H = e.parent.children.find((t) => t instanceof te), !(H instanceof rt) && H.update();
|
|
1430
1559
|
},
|
|
1431
1560
|
unmounted: (e) => {
|
|
1432
1561
|
if (!e.isLight) {
|
|
1433
|
-
|
|
1562
|
+
Ue(`${e.type} is not a light`);
|
|
1434
1563
|
return;
|
|
1435
1564
|
}
|
|
1436
|
-
|
|
1565
|
+
H = e.parent.children.find((t) => t instanceof te), H && H.dispose && H.dispose(), e.parent.remove(H);
|
|
1437
1566
|
}
|
|
1438
|
-
}, { logWarning:
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
tr(`v-always-look-at: problem with binding value: ${r.value}`);
|
|
1443
|
-
return;
|
|
1444
|
-
}
|
|
1445
|
-
const { onLoop: n } = ne();
|
|
1446
|
-
n(() => {
|
|
1447
|
-
e.lookAt(o);
|
|
1448
|
-
});
|
|
1449
|
-
}
|
|
1450
|
-
}, { logWarning: or } = B();
|
|
1451
|
-
let R = null;
|
|
1452
|
-
const wr = {
|
|
1453
|
-
updated: (e, r) => {
|
|
1567
|
+
}, { logWarning: rn } = $();
|
|
1568
|
+
let D = null;
|
|
1569
|
+
const wn = {
|
|
1570
|
+
updated: (e, t) => {
|
|
1454
1571
|
var i;
|
|
1455
|
-
const
|
|
1456
|
-
if (!
|
|
1457
|
-
|
|
1572
|
+
const n = kr(t);
|
|
1573
|
+
if (!n) {
|
|
1574
|
+
rn(`v-distance-to: problem with binding value: ${t.value}`);
|
|
1458
1575
|
return;
|
|
1459
1576
|
}
|
|
1460
|
-
|
|
1461
|
-
const
|
|
1462
|
-
|
|
1577
|
+
D && (D.dispose(), e.parent.remove(D));
|
|
1578
|
+
const o = n.clone().sub(e.position);
|
|
1579
|
+
o.normalize(), D = new Lt(o, e.position, e.position.distanceTo(n), 16776960), e.parent.add(D), console.table(
|
|
1463
1580
|
[
|
|
1464
|
-
["Distance:", e.position.distanceTo(
|
|
1581
|
+
["Distance:", e.position.distanceTo(n)],
|
|
1465
1582
|
[`origin: ${e.name || e.type}`, `x:${e.position.x}, y:${e.position.y}, z:${(i = e.position) == null ? void 0 : i.z}`],
|
|
1466
|
-
[`Destiny: ${e.name || e.type}`, `x:${
|
|
1583
|
+
[`Destiny: ${e.name || e.type}`, `x:${n.x}, y:${n.y}, z:${n == null ? void 0 : n.z}`]
|
|
1467
1584
|
]
|
|
1468
1585
|
);
|
|
1469
1586
|
},
|
|
1470
1587
|
unmounted: (e) => {
|
|
1471
|
-
|
|
1472
|
-
}
|
|
1473
|
-
}, { logWarning: rr } = B(), br = {
|
|
1474
|
-
mounted: (e, r) => {
|
|
1475
|
-
if (e.isCamera) {
|
|
1476
|
-
rr(`Rotate the ${e.type} is not a good idea`);
|
|
1477
|
-
return;
|
|
1478
|
-
}
|
|
1479
|
-
const o = r.value ?? 0.01, n = D(r.modifiers.x || r.arg === "x" ? 1 : 0), i = D(r.modifiers.y || r.arg === "y" ? 1 : 0), a = D(r.modifiers.z || r.arg === "z" ? 1 : 0);
|
|
1480
|
-
n.value + i.value + a.value === 0 && (n.value = 1, i.value = 1);
|
|
1481
|
-
const t = new Ot().setFromAxisAngle(new re(n.value, i.value, a.value).normalize(), o), { onLoop: s } = ne();
|
|
1482
|
-
s(() => {
|
|
1483
|
-
e.applyQuaternion(t);
|
|
1484
|
-
});
|
|
1588
|
+
D == null || D.dispose(), e.parent.remove(D);
|
|
1485
1589
|
}
|
|
1486
|
-
},
|
|
1590
|
+
}, Mn = {
|
|
1487
1591
|
install(e) {
|
|
1488
|
-
e.component("TresCanvas",
|
|
1592
|
+
e.component("TresCanvas", Xr);
|
|
1489
1593
|
}
|
|
1490
1594
|
};
|
|
1491
1595
|
export {
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1596
|
+
Xr as TresCanvas,
|
|
1597
|
+
de as catalogue,
|
|
1598
|
+
Br as createRenderLoop,
|
|
1599
|
+
Mn as default,
|
|
1600
|
+
ye as dispose,
|
|
1601
|
+
pe as extend,
|
|
1602
|
+
un as isProd,
|
|
1603
|
+
pr as normalizeColor,
|
|
1604
|
+
cn as normalizeVectorFlexibleParam,
|
|
1605
|
+
hn as templateCompilerOptions,
|
|
1606
|
+
Or as trasverseObjects,
|
|
1607
|
+
lr as useCamera,
|
|
1608
|
+
fn as useLoader,
|
|
1609
|
+
$ as useLogger,
|
|
1610
|
+
gn as useLoop,
|
|
1611
|
+
mn as usePointerEventHandler,
|
|
1612
|
+
Ke as useRaycaster,
|
|
1613
|
+
ln as useRenderLoop,
|
|
1614
|
+
Tr as useRenderer,
|
|
1615
|
+
pn as useSeek,
|
|
1616
|
+
dn as useTexture,
|
|
1617
|
+
vn as useTres,
|
|
1618
|
+
Xe as useTresContext,
|
|
1619
|
+
Rr as useTresContextProvider,
|
|
1620
|
+
jr as useTresEventManager,
|
|
1621
|
+
wn as vDistanceTo,
|
|
1622
|
+
bn as vLightHelper,
|
|
1623
|
+
yn as vLog
|
|
1520
1624
|
};
|