@shjjs/visual-ui 3.0.7 → 3.0.9
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/es/commons/plugins/datasource/index.mjs +53 -52
- package/es/commons/plugins/datasource/utils/utils.mjs +5 -5
- package/es/components/Commons/components/CustomComponentRender/index.vue.mjs +2 -2
- package/es/components/Commons/components/CustomComponentRender/index.vue2.mjs +8 -6
- package/es/components/Commons/components/ModelViewer/index.vue.mjs +81 -71
- package/es/components/Scene/components/Amap2d/index.vue.mjs +2 -2
- package/es/components/Scene/components/Amap2d/index.vue2.mjs +140 -136
- package/es/components/Scene/components/Amap3d/index.vue.mjs +2 -2
- package/es/components/Scene/components/Amap3d/index.vue2.mjs +221 -213
- package/es/components/Scene/components/Map3d/index.vue.mjs +2 -2
- package/es/components/Scene/components/Map3d/utils/map.mjs +23 -21
- package/es/components/Scene/components/Vr/index.vue.mjs +1 -1
- package/es/components/Scene/components/Vr/index.vue2.mjs +326 -249
- package/es/packages/commons/plugins/datasource/utils/utils.d.ts +1 -1
- package/es/packages/components/Commons/components/ModelViewer/index.vue.d.ts +2 -1
- package/es/packages/components/Scene/components/Amap2d/index.vue.d.ts +2 -0
- package/es/packages/components/Scene/components/Vr/index.vue.d.ts +2 -1
- package/es/widgets.css +1 -1
- package/package.json +76 -76
- package/umd/index.js +1272 -1269
- package/umd/widgets.css +1 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { cloneDeep as
|
|
5
|
-
import { parseStaticData as
|
|
6
|
-
import { parseUrlData as
|
|
7
|
-
import { parseVariableData as
|
|
8
|
-
import { parseAPIPort as
|
|
9
|
-
import { DataSourceUtils as
|
|
10
|
-
import { parseStorage as
|
|
11
|
-
import { parseMqttData as
|
|
12
|
-
import { parseWebSocketData as
|
|
13
|
-
import { MqttConnectionPoolManager as
|
|
14
|
-
import { WebSocketConnectionPoolManager as
|
|
15
|
-
import { mappingData as
|
|
16
|
-
import { groupData as
|
|
17
|
-
import { storageData as
|
|
18
|
-
const
|
|
1
|
+
var x = Object.defineProperty;
|
|
2
|
+
var k = (l, t, e) => t in l ? x(l, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[t] = e;
|
|
3
|
+
var h = (l, t, e) => k(l, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { cloneDeep as C, isString as M } from "lodash";
|
|
5
|
+
import { parseStaticData as v } from "./sources/static.mjs";
|
|
6
|
+
import { parseUrlData as A } from "./sources/url.mjs";
|
|
7
|
+
import { parseVariableData as E } from "./sources/variable.mjs";
|
|
8
|
+
import { parseAPIPort as U } from "./sources/api.mjs";
|
|
9
|
+
import { DataSourceUtils as B } from "./utils/utils.mjs";
|
|
10
|
+
import { parseStorage as T } from "./sources/storage.mjs";
|
|
11
|
+
import { parseMqttData as W } from "./sources/mqtt.mjs";
|
|
12
|
+
import { parseWebSocketData as q } from "./sources/websocket.mjs";
|
|
13
|
+
import { MqttConnectionPoolManager as S } from "./utils/mqttConnectionPool.mjs";
|
|
14
|
+
import { WebSocketConnectionPoolManager as D } from "./utils/websocketConnectionPool.mjs";
|
|
15
|
+
import { mappingData as K } from "./utils/mappingData.mjs";
|
|
16
|
+
import { groupData as b } from "./utils/groupData.mjs";
|
|
17
|
+
import { storageData as g } from "./utils/storageData.mjs";
|
|
18
|
+
const c = class c {
|
|
19
19
|
/**
|
|
20
20
|
* 添加数据源解析器
|
|
21
21
|
* @param type - 数据源类型
|
|
@@ -224,7 +224,7 @@ const l = class l {
|
|
|
224
224
|
r(s);
|
|
225
225
|
return;
|
|
226
226
|
}
|
|
227
|
-
e ? (
|
|
227
|
+
e ? (g(o.source.storage, s.noMappingData), r(s.noMappingData)) : (g(o.source.storage, s.finalKeyData), r(s.finalKeyData));
|
|
228
228
|
});
|
|
229
229
|
}
|
|
230
230
|
/**
|
|
@@ -236,31 +236,32 @@ const l = class l {
|
|
|
236
236
|
* @returns
|
|
237
237
|
*/
|
|
238
238
|
static processData(t, e, a, r) {
|
|
239
|
-
const { filter: o, mapping: i, dynamicMapping: n, isUserdata: s } =
|
|
240
|
-
return new Promise(function(
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
(
|
|
244
|
-
|
|
239
|
+
const { filter: o, mapping: i, dynamicMapping: n, isUserdata: s } = C(t);
|
|
240
|
+
return new Promise(function(y) {
|
|
241
|
+
const w = e;
|
|
242
|
+
c.filterData(o, e).then(
|
|
243
|
+
(p) => {
|
|
244
|
+
var d;
|
|
245
|
+
const u = {
|
|
245
246
|
id: a,
|
|
246
247
|
finalKeyData: { id: a, data: null },
|
|
247
248
|
finalUserData: { id: a, data: null },
|
|
248
|
-
filteredData: { id: a, data:
|
|
249
|
-
rawData: { id: a, data:
|
|
249
|
+
filteredData: { id: a, data: p },
|
|
250
|
+
rawData: { id: a, data: w },
|
|
250
251
|
noMappingData: null
|
|
251
252
|
};
|
|
252
253
|
if (r)
|
|
253
|
-
|
|
254
|
+
u.finalUserData.data = u.noMappingData = p;
|
|
254
255
|
else {
|
|
255
|
-
const
|
|
256
|
-
|
|
256
|
+
const f = K(
|
|
257
|
+
p,
|
|
257
258
|
i,
|
|
258
259
|
n,
|
|
259
260
|
s
|
|
260
|
-
);
|
|
261
|
-
|
|
261
|
+
), m = !!((d = f.mappedData) != null && d.length);
|
|
262
|
+
u.finalKeyData.data = m ? b(f.mappedData, f.finalMapping) : p, u.finalUserData.data = m ? f.mappedData : p;
|
|
262
263
|
}
|
|
263
|
-
|
|
264
|
+
y(u);
|
|
264
265
|
}
|
|
265
266
|
);
|
|
266
267
|
});
|
|
@@ -272,11 +273,11 @@ const l = class l {
|
|
|
272
273
|
* @returns
|
|
273
274
|
*/
|
|
274
275
|
static async filterData(t, e) {
|
|
275
|
-
if (!
|
|
276
|
+
if (!M(t))
|
|
276
277
|
return e;
|
|
277
278
|
try {
|
|
278
279
|
let a = t.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g, "");
|
|
279
|
-
a =
|
|
280
|
+
a = B.replaceStringVariables(a);
|
|
280
281
|
const r = `
|
|
281
282
|
${a}
|
|
282
283
|
if (typeof filter !== 'function') {
|
|
@@ -295,38 +296,38 @@ const l = class l {
|
|
|
295
296
|
static destroy() {
|
|
296
297
|
this.timerPool.forEach((t) => {
|
|
297
298
|
clearInterval(t);
|
|
298
|
-
}), this.timerPool.clear(), this.dataSourceStatePool.clear(), this.dataSourceStatePool = /* @__PURE__ */ new Map(), this.waitingPool.clear(), this.waitingPool = /* @__PURE__ */ new Map(),
|
|
299
|
+
}), this.timerPool.clear(), this.dataSourceStatePool.clear(), this.dataSourceStatePool = /* @__PURE__ */ new Map(), this.waitingPool.clear(), this.waitingPool = /* @__PURE__ */ new Map(), S.closeAllConnections(), D.closeAllConnections();
|
|
299
300
|
}
|
|
300
301
|
static clearMqttConnectionById(t) {
|
|
301
|
-
|
|
302
|
+
S.removeConnectionByUUID(t);
|
|
302
303
|
}
|
|
303
304
|
static clearWebSocketConnectionById(t) {
|
|
304
|
-
|
|
305
|
+
D.removeConnectionByUUID(t);
|
|
305
306
|
}
|
|
306
307
|
};
|
|
307
308
|
/**
|
|
308
309
|
* 定时器池
|
|
309
310
|
*/
|
|
310
|
-
|
|
311
|
+
h(c, "timerPool", /* @__PURE__ */ new Map()), /**
|
|
311
312
|
* 数据源状态池 - 跟踪所有数据源的执行状态
|
|
312
313
|
*/
|
|
313
|
-
|
|
314
|
+
h(c, "dataSourceStatePool", /* @__PURE__ */ new Map()), /**
|
|
314
315
|
* 等待执行的数据源池 - 存储因依赖关系而等待的数据源
|
|
315
316
|
*/
|
|
316
|
-
|
|
317
|
+
h(c, "waitingPool", /* @__PURE__ */ new Map()), /**
|
|
317
318
|
* 数据源解析器
|
|
318
319
|
*/
|
|
319
|
-
|
|
320
|
-
{ type: "url", parser:
|
|
321
|
-
{ type: "static", parser:
|
|
322
|
-
{ type: "variable", parser:
|
|
323
|
-
{ type: "api", parser:
|
|
324
|
-
{ type: "storage", parser:
|
|
325
|
-
{ type: "mqtt", parser:
|
|
326
|
-
{ type: "ws", parser:
|
|
320
|
+
h(c, "parsers", /* @__PURE__ */ new Set([
|
|
321
|
+
{ type: "url", parser: A },
|
|
322
|
+
{ type: "static", parser: v },
|
|
323
|
+
{ type: "variable", parser: E },
|
|
324
|
+
{ type: "api", parser: U },
|
|
325
|
+
{ type: "storage", parser: T },
|
|
326
|
+
{ type: "mqtt", parser: W },
|
|
327
|
+
{ type: "ws", parser: q }
|
|
327
328
|
]));
|
|
328
|
-
let
|
|
329
|
+
let P = c;
|
|
329
330
|
export {
|
|
330
|
-
|
|
331
|
-
|
|
331
|
+
B as DataSourceUtils,
|
|
332
|
+
P as SHJDatasourceV2
|
|
332
333
|
};
|
|
@@ -5,7 +5,7 @@ import { cloneDeep as g } from "lodash";
|
|
|
5
5
|
import { SHJDatasourceV2 as u } from "../index.mjs";
|
|
6
6
|
import { storageData as V } from "./storageData.mjs";
|
|
7
7
|
import "../../event/actions/fullScreenAction.mjs";
|
|
8
|
-
import { EventUtils as
|
|
8
|
+
import { EventUtils as h } from "../../event/utils/utils.mjs";
|
|
9
9
|
const i = class i {
|
|
10
10
|
static executeAllVariable(a) {
|
|
11
11
|
a.forEach((e) => {
|
|
@@ -87,7 +87,7 @@ const i = class i {
|
|
|
87
87
|
}
|
|
88
88
|
r._callbacks ?? (r._callbacks = /* @__PURE__ */ new Map()), r._callbacks.forEach(
|
|
89
89
|
(n) => n(a._value)
|
|
90
|
-
), t &&
|
|
90
|
+
), t && h.updateWidgetVariableData(r);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
static getVariableById(a) {
|
|
@@ -96,8 +96,8 @@ const i = class i {
|
|
|
96
96
|
static getVariableByName(a) {
|
|
97
97
|
return window._variables.find((e) => e.name === a);
|
|
98
98
|
}
|
|
99
|
-
static
|
|
100
|
-
const e = window._variables.find((t) => t.
|
|
99
|
+
static getVariableValueById(a) {
|
|
100
|
+
const e = window._variables.find((t) => t.id === a);
|
|
101
101
|
return e ? e._value : null;
|
|
102
102
|
}
|
|
103
103
|
static noneData(a) {
|
|
@@ -124,7 +124,7 @@ d(i, "addVariable", (a) => {
|
|
|
124
124
|
sources: [a.sources],
|
|
125
125
|
noUseMapping: !0,
|
|
126
126
|
callback: (e) => {
|
|
127
|
-
i.setVariableById(a, e, !
|
|
127
|
+
i.setVariableById(a, e, !0);
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
130
|
}), d(i, "deleteVariableById", (a) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./index.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const
|
|
4
|
+
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-dde8cdcf"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
r as default
|
|
7
7
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as d, onMounted as J, computed as a, shallowRef as b, ref as u, watch as j, createElementBlock as E, openBlock as c, createElementVNode as H, createBlock as V, createCommentVNode as
|
|
2
|
-
import { useVueImportMap as
|
|
1
|
+
import { defineComponent as d, onMounted as J, computed as a, shallowRef as b, ref as u, watch as j, createElementBlock as E, openBlock as c, createElementVNode as H, createBlock as V, createCommentVNode as k, unref as O } from "vue";
|
|
2
|
+
import { useVueImportMap as P, Sandbox as x, useStore as N } from "@vue/repl";
|
|
3
3
|
import { useWatch as D } from "./hooks/useWatch.mjs";
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
@@ -171,7 +171,7 @@ const B = { class: "custom-component-render" }, R = { class: "preview-content" }
|
|
|
171
171
|
J(() => {
|
|
172
172
|
window.SHJDatasourceV2 = M, window.SHJParseEvent = T;
|
|
173
173
|
});
|
|
174
|
-
const e = a(() => _(i.option)), { productionMode: p, vueVersion: v, importMap: h } =
|
|
174
|
+
const e = a(() => _(i.option)), { productionMode: p, vueVersion: v, importMap: h } = P(), w = a(() => ({
|
|
175
175
|
script: {
|
|
176
176
|
inlineTemplate: p.value,
|
|
177
177
|
isProd: p.value,
|
|
@@ -188,7 +188,7 @@ const B = { class: "custom-component-render" }, R = { class: "preview-content" }
|
|
|
188
188
|
if (!(l.value === s && o.value)) {
|
|
189
189
|
l.value = s, t.value = !0;
|
|
190
190
|
try {
|
|
191
|
-
const r =
|
|
191
|
+
const r = N(
|
|
192
192
|
{ builtinImportMap: h, vueVersion: v, sfcOptions: w },
|
|
193
193
|
s
|
|
194
194
|
);
|
|
@@ -265,6 +265,7 @@ const B = { class: "custom-component-render" }, R = { class: "preview-content" }
|
|
|
265
265
|
#app {
|
|
266
266
|
height: 100%;
|
|
267
267
|
overflow: hidden;
|
|
268
|
+
background-color: transparent !important;
|
|
268
269
|
}
|
|
269
270
|
</style>
|
|
270
271
|
${g}
|
|
@@ -273,12 +274,13 @@ const B = { class: "custom-component-render" }, R = { class: "preview-content" }
|
|
|
273
274
|
}));
|
|
274
275
|
return (s, r) => (c(), E("div", B, [
|
|
275
276
|
H("div", R, [
|
|
276
|
-
!t.value && o.value ? (c(), V(
|
|
277
|
+
!t.value && o.value ? (c(), V(O(x), {
|
|
277
278
|
key: 0,
|
|
278
279
|
store: o.value,
|
|
280
|
+
theme: "dark",
|
|
279
281
|
"clear-console": !1,
|
|
280
282
|
"preview-options": C.value
|
|
281
|
-
}, null, 8, ["store", "preview-options"])) :
|
|
283
|
+
}, null, 8, ["store", "preview-options"])) : k("", !0)
|
|
282
284
|
])
|
|
283
285
|
]));
|
|
284
286
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as P, computed as K, ref as N, onMounted as W, onBeforeUnmount as Y, watch as c, createElementBlock as _, openBlock as j } from "vue";
|
|
2
2
|
import "@babylonjs/loaders/glTF";
|
|
3
3
|
import * as t from "@babylonjs/core";
|
|
4
|
-
import { cloneDeep as
|
|
4
|
+
import { cloneDeep as d, isEqual as h } from "lodash";
|
|
5
5
|
/* empty css */
|
|
6
6
|
/* empty css */
|
|
7
7
|
import "../../../Interaction/components/Tabs/index.mjs";
|
|
@@ -157,13 +157,13 @@ import "../../../Scene/components/UnityIframe/index.mjs";
|
|
|
157
157
|
import "../../../Scene/components/UnityWebgl/index.mjs";
|
|
158
158
|
import "../../../Scene/components/Vr/index.mjs";
|
|
159
159
|
import "../../../Scene/components/Earth/index.mjs";
|
|
160
|
-
import { SHJParseEvent as
|
|
160
|
+
import { SHJParseEvent as z } from "../../../../commons/plugins/event/index.mjs";
|
|
161
161
|
import "../../../../commons/plugins/datasource/utils/request.mjs";
|
|
162
162
|
import "mqtt";
|
|
163
163
|
import "nanoid";
|
|
164
|
-
import { upgradeModelViewer as
|
|
165
|
-
const
|
|
166
|
-
...
|
|
164
|
+
import { upgradeModelViewer as J } from "./version.mjs";
|
|
165
|
+
const U = P({ name: "ShjModelViewer" }), Qt = /* @__PURE__ */ P({
|
|
166
|
+
...U,
|
|
167
167
|
props: {
|
|
168
168
|
option: {},
|
|
169
169
|
sources: {},
|
|
@@ -171,10 +171,10 @@ const J = z({ name: "ShjModelViewer" }), Xt = /* @__PURE__ */ z({
|
|
|
171
171
|
basicEvents: {}
|
|
172
172
|
},
|
|
173
173
|
emits: ["on-load-success", "on-play-animation"],
|
|
174
|
-
setup(y, { expose:
|
|
175
|
-
const e =
|
|
176
|
-
let
|
|
177
|
-
const B = () => {
|
|
174
|
+
setup(y, { expose: H, emit: I }) {
|
|
175
|
+
const e = K(() => J(y.option)), E = I;
|
|
176
|
+
let A, o, n, p, v, s, w, g, u, b, l, a;
|
|
177
|
+
const C = N(), B = () => {
|
|
178
178
|
n || (n = new t.ArcRotateCamera(
|
|
179
179
|
"Camera",
|
|
180
180
|
e.value.camera.alpha,
|
|
@@ -194,9 +194,9 @@ const J = z({ name: "ShjModelViewer" }), Xt = /* @__PURE__ */ z({
|
|
|
194
194
|
e.value.camera.lowerBetaLimit
|
|
195
195
|
), n.upperBetaLimit = t.Tools.ToRadians(
|
|
196
196
|
e.value.camera.upperBetaLimit
|
|
197
|
-
), n.useBouncingBehavior = e.value.camera.useBouncingBehavior, n.wheelDeltaPercentage = e.value.camera.wheelDeltaPercentage || 0.01, n.useAutoRotationBehavior = e.value.camera.autoRotation, n.panningSensibility = 1 / (e.value.camera.panningSensibility || 0.01), n.attachControl(
|
|
197
|
+
), n.useBouncingBehavior = e.value.camera.useBouncingBehavior, n.wheelDeltaPercentage = e.value.camera.wheelDeltaPercentage || 0.01, n.useAutoRotationBehavior = e.value.camera.autoRotation, n.panningSensibility = 1 / (e.value.camera.panningSensibility || 0.01), n.attachControl(C.value, !0);
|
|
198
198
|
}, F = () => {
|
|
199
|
-
o || (o = new t.Scene(
|
|
199
|
+
o || (o = new t.Scene(A)), o.environmentTexture = t.CubeTexture.CreateFromPrefilteredData(
|
|
200
200
|
e.value.scene.environmentTexture,
|
|
201
201
|
o
|
|
202
202
|
), o.environmentIntensity = e.value.scene.environmentIntensity, e.value.scene.colorShow ? o.clearColor = t.Color4.FromHexString(
|
|
@@ -224,11 +224,11 @@ const J = z({ name: "ShjModelViewer" }), Xt = /* @__PURE__ */ z({
|
|
|
224
224
|
), p.diffuse = t.Color3.FromHexString(
|
|
225
225
|
e.value.directionalLight.diffuse || "#ffffff"
|
|
226
226
|
), p.intensity = e.value.directionalLight.intensity, p.shadowMinZ = e.value.directionalLight.shadowMinZ, p.shadowMaxZ = e.value.directionalLight.shadowMaxZ, p.autoCalcShadowZBounds = e.value.directionalLight.autoCalcShadowZBounds, e.value.directionalLight.shadowGenerator.enable) {
|
|
227
|
-
const { mapSize: i, transparencyShadow: r, usePercentageCloserFiltering: m, bias:
|
|
227
|
+
const { mapSize: i, transparencyShadow: r, usePercentageCloserFiltering: m, bias: f } = e.value.directionalLight.shadowGenerator;
|
|
228
228
|
if (!s && (s = new t.ShadowGenerator(i, p), l))
|
|
229
229
|
for (let L = 0; L < l.length; L++)
|
|
230
230
|
e.value.meshes.isCasterShadow && s && s.addShadowCaster(l[L], !0);
|
|
231
|
-
s.mapSize = i, s.transparencyShadow = r, s.usePercentageCloserFiltering = m, s.bias =
|
|
231
|
+
s.mapSize = i, s.transparencyShadow = r, s.usePercentageCloserFiltering = m, s.bias = f;
|
|
232
232
|
} else
|
|
233
233
|
s && (s.dispose(), s = null);
|
|
234
234
|
e.value.directionalLight.lightGizmo && e.value.directionalLight.lightGizmo.enable ? (v || (v = new t.LightGizmo(), v.light = p), v.scaleRatio = e.value.directionalLight.lightGizmo.scaleRatio) : v && (v.dispose(), v = null);
|
|
@@ -254,10 +254,10 @@ const J = z({ name: "ShjModelViewer" }), Xt = /* @__PURE__ */ z({
|
|
|
254
254
|
width: i,
|
|
255
255
|
height: r,
|
|
256
256
|
position: m,
|
|
257
|
-
rotation:
|
|
257
|
+
rotation: f,
|
|
258
258
|
scaling: L,
|
|
259
|
-
material:
|
|
260
|
-
receiveShadows:
|
|
259
|
+
material: T,
|
|
260
|
+
receiveShadows: q
|
|
261
261
|
} = e.value.ground;
|
|
262
262
|
u || (u = t.MeshBuilder.CreateGround(
|
|
263
263
|
"ground",
|
|
@@ -268,24 +268,24 @@ const J = z({ name: "ShjModelViewer" }), Xt = /* @__PURE__ */ z({
|
|
|
268
268
|
m[1],
|
|
269
269
|
m[2]
|
|
270
270
|
), u.rotation = new t.Vector3(
|
|
271
|
-
t.Tools.ToRadians(
|
|
272
|
-
t.Tools.ToRadians(
|
|
273
|
-
t.Tools.ToRadians(
|
|
271
|
+
t.Tools.ToRadians(f[0]),
|
|
272
|
+
t.Tools.ToRadians(f[1]),
|
|
273
|
+
t.Tools.ToRadians(f[2])
|
|
274
274
|
), u.scaling = new t.Vector3(L[0], L[1], L[2]);
|
|
275
275
|
const x = new t.StandardMaterial("", o);
|
|
276
276
|
x.emissiveTexture = new t.Texture(
|
|
277
|
-
|
|
277
|
+
T.emissiveTexture,
|
|
278
278
|
o
|
|
279
279
|
), x.diffuseTexture = new t.Texture(
|
|
280
|
-
|
|
280
|
+
T.emissiveTexture,
|
|
281
281
|
o
|
|
282
282
|
), x.ambientTexture = new t.Texture(
|
|
283
|
-
|
|
283
|
+
T.emissiveTexture,
|
|
284
284
|
o
|
|
285
285
|
), x.diffuseColor = new t.Color3(1, 1, 1), x.opacityTexture = new t.Texture(
|
|
286
|
-
|
|
286
|
+
T.opacityTexture,
|
|
287
287
|
o
|
|
288
|
-
), u.material = x, u.receiveShadows =
|
|
288
|
+
), u.material = x, u.receiveShadows = q;
|
|
289
289
|
} else
|
|
290
290
|
u && (u.dispose(), u = null);
|
|
291
291
|
}, M = () => {
|
|
@@ -306,7 +306,7 @@ const J = z({ name: "ShjModelViewer" }), Xt = /* @__PURE__ */ z({
|
|
|
306
306
|
if (o) {
|
|
307
307
|
o.stopAllAnimations();
|
|
308
308
|
const m = o.getAnimationGroupByName(i);
|
|
309
|
-
m && (E("on-play-animation"),
|
|
309
|
+
m && (E("on-play-animation"), z.parseEvents(y.useEvents, "on-play-animation"), m.start(
|
|
310
310
|
r.loop,
|
|
311
311
|
r.speedRatio,
|
|
312
312
|
m.from,
|
|
@@ -335,10 +335,7 @@ const J = z({ name: "ShjModelViewer" }), Xt = /* @__PURE__ */ z({
|
|
|
335
335
|
l[i].isPickable = !1, l[i].receiveShadows = e.value.meshes.isCasterShadow, e.value.meshes.isCasterShadow && s && s.addShadowCaster(l[i], !0);
|
|
336
336
|
e.value.animation.animationGroups = o.animationGroups.map((i) => ({ uniqueId: i.uniqueId, name: i.name })), y.basicEvents && (y.basicEvents.function[0].args[0].select = o.animationGroups.map(
|
|
337
337
|
(i) => ({ name: i.name, value: i.name })
|
|
338
|
-
)),
|
|
339
|
-
loop: e.value.animation.defaultAnimation.loop,
|
|
340
|
-
speedRatio: e.value.animation.defaultAnimation.speedRatio
|
|
341
|
-
}) : o.animationGroups && o.animationGroups[0] && o.animationGroups[0].stop();
|
|
338
|
+
)), k();
|
|
342
339
|
}, V = () => {
|
|
343
340
|
const i = e.value.pipelineOption;
|
|
344
341
|
i && i.enabled ? (a || (a = new t.DefaultRenderingPipeline(
|
|
@@ -351,104 +348,117 @@ const J = z({ name: "ShjModelViewer" }), Xt = /* @__PURE__ */ z({
|
|
|
351
348
|
), a.chromaticAberration.direction.y = Math.cos(
|
|
352
349
|
i.chromaticAberrationDirection
|
|
353
350
|
)), a.sharpenEnabled = i.sharpenEnabled, a.sharpen.edgeAmount = i.sharpenEdgeAmount, a.sharpen.colorAmount = i.sharpenColorAmount) : a && (a.dispose(), a = null);
|
|
354
|
-
},
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
351
|
+
}, k = () => {
|
|
352
|
+
o.stopAllAnimations(), e.value.animation.defaultAnimation && e.value.animation.defaultAnimation.name ? D(e.value.animation.defaultAnimation.name, {
|
|
353
|
+
loop: e.value.animation.defaultAnimation.loop,
|
|
354
|
+
speedRatio: e.value.animation.defaultAnimation.speedRatio
|
|
355
|
+
}) : o.animationGroups && o.animationGroups[0] && o.animationGroups[0].stop();
|
|
356
|
+
}, Z = function() {
|
|
357
|
+
F(), B(), G(), R(), O(), M(), S(), V(), E("on-load-success"), z.parseEvents(y.useEvents, "on-load-success");
|
|
358
|
+
};
|
|
359
|
+
return W(() => {
|
|
360
|
+
A = new t.Engine(C.value, !0), A && e.value.meshes.url && (Z(), A.runRenderLoop(function() {
|
|
359
361
|
o && o.render();
|
|
360
362
|
}));
|
|
361
|
-
}),
|
|
362
|
-
o.dispose(),
|
|
363
|
-
}),
|
|
363
|
+
}), Y(() => {
|
|
364
|
+
o.dispose(), A.dispose();
|
|
365
|
+
}), H({
|
|
364
366
|
playAnimation: (i, r) => {
|
|
365
|
-
const m = r[0].value,
|
|
367
|
+
const m = r[0].value, f = {
|
|
366
368
|
loop: r[1].keys[0].defaultValue,
|
|
367
369
|
speedRatio: r[1].keys[1].defaultValue
|
|
368
370
|
};
|
|
369
|
-
D(m,
|
|
371
|
+
D(m, f);
|
|
370
372
|
}
|
|
371
|
-
}),
|
|
372
|
-
() =>
|
|
373
|
+
}), c(
|
|
374
|
+
() => d(e.value.camera),
|
|
373
375
|
(i, r) => {
|
|
374
|
-
!
|
|
376
|
+
!h(i, r) && n && B();
|
|
375
377
|
},
|
|
376
378
|
{
|
|
377
379
|
deep: !0
|
|
378
380
|
}
|
|
379
|
-
),
|
|
380
|
-
() =>
|
|
381
|
+
), c(
|
|
382
|
+
() => d(e.value.scene),
|
|
381
383
|
(i, r) => {
|
|
382
|
-
!
|
|
384
|
+
!h(i, r) && o && F();
|
|
383
385
|
},
|
|
384
386
|
{
|
|
385
387
|
deep: !0
|
|
386
388
|
}
|
|
387
|
-
),
|
|
388
|
-
() =>
|
|
389
|
+
), c(
|
|
390
|
+
() => d(e.value.directionalLight),
|
|
389
391
|
(i, r) => {
|
|
390
|
-
|
|
392
|
+
h(i, r) || R();
|
|
391
393
|
},
|
|
392
394
|
{
|
|
393
395
|
deep: !0
|
|
394
396
|
}
|
|
395
|
-
),
|
|
396
|
-
() =>
|
|
397
|
+
), c(
|
|
398
|
+
() => d(e.value.hemisphericLight),
|
|
397
399
|
(i, r) => {
|
|
398
|
-
|
|
400
|
+
h(i, r) || G();
|
|
399
401
|
},
|
|
400
402
|
{
|
|
401
403
|
deep: !0
|
|
402
404
|
}
|
|
403
|
-
),
|
|
404
|
-
() =>
|
|
405
|
+
), c(
|
|
406
|
+
() => d(e.value.ground),
|
|
405
407
|
(i, r) => {
|
|
406
|
-
|
|
408
|
+
h(i, r) || O();
|
|
407
409
|
},
|
|
408
410
|
{
|
|
409
411
|
deep: !0
|
|
410
412
|
}
|
|
411
|
-
),
|
|
412
|
-
() =>
|
|
413
|
+
), c(
|
|
414
|
+
() => d(e.value.skybox),
|
|
413
415
|
(i, r) => {
|
|
414
|
-
|
|
416
|
+
h(i, r) || M();
|
|
415
417
|
},
|
|
416
418
|
{
|
|
417
419
|
deep: !0
|
|
418
420
|
}
|
|
419
|
-
),
|
|
420
|
-
() =>
|
|
421
|
+
), c(
|
|
422
|
+
() => d(e.value.meshes),
|
|
421
423
|
(i, r) => {
|
|
422
|
-
!
|
|
424
|
+
!h(i, r) && l && i.url === r.url && S();
|
|
423
425
|
},
|
|
424
426
|
{
|
|
425
427
|
deep: !0
|
|
426
428
|
}
|
|
427
|
-
),
|
|
428
|
-
() =>
|
|
429
|
+
), c(
|
|
430
|
+
() => d(e.value.meshes.url),
|
|
429
431
|
(i, r) => {
|
|
430
|
-
|
|
431
|
-
|
|
432
|
+
h(i, r) || (o.meshes.forEach((m, f) => {
|
|
433
|
+
f > 1 && m.dispose();
|
|
432
434
|
}), l = null, S());
|
|
433
435
|
},
|
|
434
436
|
{
|
|
435
437
|
deep: !0
|
|
436
438
|
}
|
|
437
|
-
),
|
|
438
|
-
() =>
|
|
439
|
+
), c(
|
|
440
|
+
() => d(e.value.pipelineOption),
|
|
441
|
+
(i, r) => {
|
|
442
|
+
h(i, r) || V();
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
deep: !0
|
|
446
|
+
}
|
|
447
|
+
), c(
|
|
448
|
+
() => d(e.value.animation),
|
|
439
449
|
(i, r) => {
|
|
440
|
-
|
|
450
|
+
h(i, r) || k();
|
|
441
451
|
},
|
|
442
452
|
{
|
|
443
453
|
deep: !0
|
|
444
454
|
}
|
|
445
|
-
), (i, r) => (
|
|
455
|
+
), (i, r) => (j(), _("canvas", {
|
|
446
456
|
ref_key: "canvasRef",
|
|
447
|
-
ref:
|
|
457
|
+
ref: C,
|
|
448
458
|
class: "babylon-canvas"
|
|
449
459
|
}, null, 512));
|
|
450
460
|
}
|
|
451
461
|
});
|
|
452
462
|
export {
|
|
453
|
-
|
|
463
|
+
Qt as default
|
|
454
464
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./index.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const
|
|
4
|
+
const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-fc5fed6a"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
c as default
|
|
7
7
|
};
|