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