@quick-threejs/reactive 0.1.27 → 0.1.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{app.module-BQotCgts.js → app.module-Bhlwvbrt.js} +7 -7
- package/dist/{app.module-n-JVGlLg.mjs → app.module-Dy3P3_8R.mjs} +983 -972
- package/dist/common/blueprints/props.blueprint.d.ts +22 -1
- package/dist/core/app/camera/camera.module.d.ts +5 -5
- package/dist/core/app/camera/camera.service.d.ts +3 -6
- package/dist/core/app/debug/debug.module.d.ts +12 -9
- package/dist/core/app/debug/debug.service.d.ts +16 -12
- package/dist/core/app/renderer/renderer.service.d.ts +1 -3
- package/dist/main.js +2 -2
- package/dist/main.mjs +110 -72
- package/dist/worker.js +1 -1
- package/dist/worker.mjs +1 -1
- package/package.json +5 -5
package/dist/main.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var $e = Object.defineProperty;
|
|
2
2
|
var We = (c, e, t) => e in c ? $e(c, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[e] = t;
|
|
3
|
-
var
|
|
4
|
-
import { s as V, C as qe, P as Ye, a as Ce, f as Qe, m as le, b as Me, J as ee, K as Je, i as y, S as Ze, c as et, W as te, d as Ie, e as tt, L as st, R as nt, U as rt, g as it, h as Oe, A as z, D as X, j as _e, Q as ot } from "./app.module-
|
|
5
|
-
import { k as sn, o as nn, n as rn, l as on } from "./app.module-
|
|
3
|
+
var _ = (c, e, t) => We(c, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { s as V, C as qe, P as Ye, a as Ce, f as Qe, m as le, b as Me, J as ee, K as Je, i as y, S as Ze, c as et, W as te, d as Ie, e as tt, L as st, R as nt, U as rt, g as it, h as Oe, A as z, D as X, j as _e, Q as ot } from "./app.module-Dy3P3_8R.mjs";
|
|
5
|
+
import { k as sn, o as nn, n as rn, l as on } from "./app.module-Dy3P3_8R.mjs";
|
|
6
6
|
import { TrianglesDrawMode as at, TriangleFanDrawMode as ue, TriangleStripDrawMode as Ne, Loader as De, LoaderUtils as j, FileLoader as $, Color as D, LinearSRGBColorSpace as S, SpotLight as ct, PointLight as lt, DirectionalLight as ut, MeshBasicMaterial as B, SRGBColorSpace as N, MeshPhysicalMaterial as v, Vector2 as Pe, Matrix4 as W, Vector3 as F, Quaternion as ke, InstancedMesh as dt, InstancedBufferAttribute as ht, Object3D as Fe, TextureLoader as ft, ImageBitmapLoader as He, BufferAttribute as K, InterleavedBuffer as pt, InterleavedBufferAttribute as mt, LinearFilter as de, LinearMipmapLinearFilter as Ue, RepeatWrapping as he, NearestFilter as Ge, PointsMaterial as gt, Material as se, LineBasicMaterial as At, MeshStandardMaterial as Be, DoubleSide as Tt, PropertyBinding as _t, BufferGeometry as je, SkinnedMesh as Rt, Mesh as Et, LineSegments as wt, Line as Lt, LineLoop as xt, Points as yt, Group as ne, PerspectiveCamera as bt, MathUtils as St, OrthographicCamera as vt, Skeleton as Ct, AnimationClip as Mt, Bone as It, InterpolateLinear as Ke, ColorManagement as fe, NearestMipmapNearestFilter as Ot, LinearMipmapNearestFilter as Nt, NearestMipmapLinearFilter as Dt, ClampToEdgeWrapping as Pt, MirroredRepeatWrapping as kt, InterpolateDiscrete as Ft, FrontSide as Ht, Texture as Re, VectorKeyframeTrack as Ee, NumberKeyframeTrack as we, QuaternionKeyframeTrack as Le, Box3 as Ut, Sphere as Gt, Interpolant as Bt, LoadingManager as jt, CubeTextureLoader as Kt, AudioLoader as Vt, VideoTexture as Ve, CanvasTexture as zt } from "three";
|
|
7
7
|
class Te {
|
|
8
8
|
constructor() {
|
|
@@ -11,25 +11,25 @@ class Te {
|
|
|
11
11
|
*
|
|
12
12
|
* @required
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
_(this, "location");
|
|
15
15
|
/**
|
|
16
16
|
* @description Initialize the app on construct.
|
|
17
17
|
*
|
|
18
18
|
* @default true
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
_(this, "initOnConstruct");
|
|
21
21
|
/**
|
|
22
22
|
* @description App `canvas` element reference.
|
|
23
23
|
*
|
|
24
24
|
* @default undefined
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
_(this, "canvas");
|
|
27
27
|
/**
|
|
28
28
|
* @description Set the `canvas` view in fullscreen and auto-resize it.
|
|
29
29
|
*
|
|
30
30
|
* @default true
|
|
31
31
|
*/
|
|
32
|
-
|
|
32
|
+
_(this, "fullScreen");
|
|
33
33
|
/**
|
|
34
34
|
* Default used camera.
|
|
35
35
|
*
|
|
@@ -37,19 +37,19 @@ class Te {
|
|
|
37
37
|
*
|
|
38
38
|
* @default DefaultCameraType.PERSPECTIVE
|
|
39
39
|
*/
|
|
40
|
-
|
|
40
|
+
_(this, "defaultCamera");
|
|
41
41
|
/**
|
|
42
42
|
* @description Start timer update on launch.
|
|
43
43
|
*
|
|
44
44
|
* @default true
|
|
45
45
|
*/
|
|
46
|
-
|
|
46
|
+
_(this, "startTimer");
|
|
47
47
|
/**
|
|
48
48
|
* @description Resources to load.
|
|
49
49
|
*
|
|
50
50
|
* @default []
|
|
51
51
|
*/
|
|
52
|
-
|
|
52
|
+
_(this, "loaderDataSources", []);
|
|
53
53
|
/**
|
|
54
54
|
* @description Will directly load the resources on initialization.
|
|
55
55
|
*
|
|
@@ -57,13 +57,24 @@ class Te {
|
|
|
57
57
|
*
|
|
58
58
|
* @default true
|
|
59
59
|
*/
|
|
60
|
-
|
|
60
|
+
_(this, "loadResourcesOnInit");
|
|
61
61
|
/**
|
|
62
62
|
* @description Enable the debug mode
|
|
63
63
|
*
|
|
64
|
+
* @remark __Deactivated if the value is `false` or `undefined`__
|
|
65
|
+
*
|
|
64
66
|
* @default undefined
|
|
65
67
|
*/
|
|
66
|
-
|
|
68
|
+
_(this, "enableDebug");
|
|
69
|
+
/**
|
|
70
|
+
* Will enable orbit controls for the cameras.
|
|
71
|
+
*
|
|
72
|
+
* @remark __Deactivated if the value is `false` or `undefined`__
|
|
73
|
+
* @remark __This property depends on {@link RegisterPropsBlueprint.enableDebug enableDebug}__
|
|
74
|
+
*
|
|
75
|
+
* @default undefined
|
|
76
|
+
*/
|
|
77
|
+
_(this, "enableControls");
|
|
67
78
|
/**
|
|
68
79
|
* Define the {@link THREE.AxesHelper} sizes.
|
|
69
80
|
*
|
|
@@ -72,7 +83,7 @@ class Te {
|
|
|
72
83
|
*
|
|
73
84
|
* @default undefined
|
|
74
85
|
*/
|
|
75
|
-
|
|
86
|
+
_(this, "axesSizes");
|
|
76
87
|
/**
|
|
77
88
|
* Define the {@link THREE.GridHelper} sizes.
|
|
78
89
|
*
|
|
@@ -81,27 +92,37 @@ class Te {
|
|
|
81
92
|
*
|
|
82
93
|
* @default undefined
|
|
83
94
|
*/
|
|
84
|
-
|
|
95
|
+
_(this, "gridSizes");
|
|
85
96
|
/**
|
|
86
97
|
* Display a mini perfective camera at the top right corner of the screen.
|
|
87
98
|
*
|
|
99
|
+
* @remark __Deactivated if the value is `false` or `undefined`__
|
|
100
|
+
* @remark __This property depends on {@link RegisterPropsBlueprint.enableDebug enableDebug}__
|
|
101
|
+
*
|
|
102
|
+
* @default undefined
|
|
103
|
+
*/
|
|
104
|
+
_(this, "withMiniCamera");
|
|
105
|
+
/**
|
|
106
|
+
* Display the camera helper.
|
|
107
|
+
*
|
|
108
|
+
* @remark __Deactivated if the value is `false` or `undefined`__
|
|
88
109
|
* @remark __This property depends on {@link RegisterPropsBlueprint.enableDebug enableDebug}__
|
|
89
110
|
*
|
|
90
|
-
* @default
|
|
111
|
+
* @default undefined
|
|
91
112
|
*/
|
|
92
|
-
|
|
113
|
+
_(this, "withCameraHelper");
|
|
93
114
|
/**
|
|
94
115
|
* @description Handler called when the app is ready.
|
|
95
116
|
*
|
|
96
117
|
* @default undefined
|
|
97
118
|
*/
|
|
98
|
-
|
|
119
|
+
_(this, "onReady");
|
|
99
120
|
}
|
|
100
121
|
}
|
|
101
122
|
class Js {
|
|
102
123
|
constructor() {
|
|
103
124
|
/** @description Handler triggered when the app is ready. */
|
|
104
|
-
|
|
125
|
+
_(this, "onReady");
|
|
105
126
|
}
|
|
106
127
|
}
|
|
107
128
|
var Xt = Object.defineProperty, $t = Object.getOwnPropertyDescriptor, Wt = (c, e, t, r) => {
|
|
@@ -111,10 +132,10 @@ var Xt = Object.defineProperty, $t = Object.getOwnPropertyDescriptor, Wt = (c, e
|
|
|
111
132
|
};
|
|
112
133
|
let q = class {
|
|
113
134
|
constructor() {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
135
|
+
_(this, "workerPool", qe(void 0, !0));
|
|
136
|
+
_(this, "canvas");
|
|
137
|
+
_(this, "worker");
|
|
138
|
+
_(this, "thread");
|
|
118
139
|
}
|
|
119
140
|
init(c) {
|
|
120
141
|
this.worker = c.worker, this.thread = c.thread;
|
|
@@ -131,7 +152,7 @@ var qt = Object.defineProperty, Yt = Object.getOwnPropertyDescriptor, Qt = (c, e
|
|
|
131
152
|
let pe = class extends Ye {
|
|
132
153
|
constructor(e) {
|
|
133
154
|
super();
|
|
134
|
-
|
|
155
|
+
_(this, "canvas");
|
|
135
156
|
this._service = e;
|
|
136
157
|
}
|
|
137
158
|
init(e) {
|
|
@@ -801,14 +822,14 @@ class Ts {
|
|
|
801
822
|
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((l) => {
|
|
802
823
|
const d = l.pop(), u = d.isGroup ? d.children : [d], h = l[0].count, f = [];
|
|
803
824
|
for (const p of u) {
|
|
804
|
-
const A = new W(), m = new F(), g = new ke(),
|
|
805
|
-
for (let
|
|
806
|
-
o.TRANSLATION && m.fromBufferAttribute(o.TRANSLATION,
|
|
807
|
-
for (const
|
|
808
|
-
if (
|
|
809
|
-
const b = o[
|
|
825
|
+
const A = new W(), m = new F(), g = new ke(), R = new F(1, 1, 1), w = new dt(p.geometry, p.material, h);
|
|
826
|
+
for (let E = 0; E < h; E++)
|
|
827
|
+
o.TRANSLATION && m.fromBufferAttribute(o.TRANSLATION, E), o.ROTATION && g.fromBufferAttribute(o.ROTATION, E), o.SCALE && R.fromBufferAttribute(o.SCALE, E), w.setMatrixAt(E, A.compose(m, g, R));
|
|
828
|
+
for (const E in o)
|
|
829
|
+
if (E === "_COLOR_0") {
|
|
830
|
+
const b = o[E];
|
|
810
831
|
w.instanceColor = new ht(b.array, b.itemSize, b.normalized);
|
|
811
|
-
} else
|
|
832
|
+
} else E !== "TRANSLATION" && E !== "ROTATION" && E !== "SCALE" && p.geometry.setAttribute(E, o[E]);
|
|
812
833
|
Fe.prototype.copy.call(w, p), this.parser.assignFinalMaterial(w), f.push(w);
|
|
813
834
|
}
|
|
814
835
|
return d.isGroup ? (d.clear(), d.add(...f), d) : f[0];
|
|
@@ -903,10 +924,10 @@ class Xe extends Bt {
|
|
|
903
924
|
return t;
|
|
904
925
|
}
|
|
905
926
|
interpolate_(e, t, r, s) {
|
|
906
|
-
const i = this.resultBuffer, n = this.sampleValues, a = this.valueSize, o = a * 2, l = a * 3, d = s - t, u = (r - t) / d, h = u * u, f = h * u, p = e * l, A = p - l, m = -2 * f + 3 * h, g = f - h,
|
|
907
|
-
for (let
|
|
908
|
-
const b = n[A +
|
|
909
|
-
i[
|
|
927
|
+
const i = this.resultBuffer, n = this.sampleValues, a = this.valueSize, o = a * 2, l = a * 3, d = s - t, u = (r - t) / d, h = u * u, f = h * u, p = e * l, A = p - l, m = -2 * f + 3 * h, g = f - h, R = 1 - m, w = g - h + u;
|
|
928
|
+
for (let E = 0; E !== a; E++) {
|
|
929
|
+
const b = n[A + E + a], M = n[A + E + o] * d, x = n[p + E + a], U = n[p + E] * d;
|
|
930
|
+
i[E] = R * b + w * M + m * x + g * U;
|
|
910
931
|
}
|
|
911
932
|
return i;
|
|
912
933
|
}
|
|
@@ -1160,11 +1181,21 @@ class Os {
|
|
|
1160
1181
|
* Textures) can be reused directly and are not marked here.
|
|
1161
1182
|
*
|
|
1162
1183
|
* Example: CesiumMilkTruck sample model reuses "Wheel" meshes.
|
|
1184
|
+
*
|
|
1185
|
+
* @param {Object} cache
|
|
1186
|
+
* @param {Object3D} index
|
|
1163
1187
|
*/
|
|
1164
1188
|
_addNodeRef(e, t) {
|
|
1165
1189
|
t !== void 0 && (e.refs[t] === void 0 && (e.refs[t] = e.uses[t] = 0), e.refs[t]++);
|
|
1166
1190
|
}
|
|
1167
|
-
/**
|
|
1191
|
+
/**
|
|
1192
|
+
* Returns a reference to a shared resource, cloning it if necessary.
|
|
1193
|
+
*
|
|
1194
|
+
* @param {Object} cache
|
|
1195
|
+
* @param {Number} index
|
|
1196
|
+
* @param {Object} object
|
|
1197
|
+
* @return {Object}
|
|
1198
|
+
*/
|
|
1168
1199
|
_getNodeRef(e, t, r) {
|
|
1169
1200
|
if (e.refs[t] <= 1) return r;
|
|
1170
1201
|
const s = r.clone(), i = (n, a) => {
|
|
@@ -1322,13 +1353,13 @@ class Os {
|
|
|
1322
1353
|
const a = n[0], o = re[s.type], l = H[s.componentType], d = l.BYTES_PER_ELEMENT, u = d * o, h = s.byteOffset || 0, f = s.bufferView !== void 0 ? r.bufferViews[s.bufferView].byteStride : void 0, p = s.normalized === !0;
|
|
1323
1354
|
let A, m;
|
|
1324
1355
|
if (f && f !== u) {
|
|
1325
|
-
const g = Math.floor(h / f),
|
|
1326
|
-
let w = t.cache.get(
|
|
1327
|
-
w || (A = new l(a, g * f, s.count * f / d), w = new pt(A, f / d), t.cache.add(
|
|
1356
|
+
const g = Math.floor(h / f), R = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + g + ":" + s.count;
|
|
1357
|
+
let w = t.cache.get(R);
|
|
1358
|
+
w || (A = new l(a, g * f, s.count * f / d), w = new pt(A, f / d), t.cache.add(R, w)), m = new mt(w, o, h % f / d, p);
|
|
1328
1359
|
} else
|
|
1329
1360
|
a === null ? A = new l(s.count * o) : A = new l(a, h, s.count * o), m = new K(A, o, p);
|
|
1330
1361
|
if (s.sparse !== void 0) {
|
|
1331
|
-
const g = re.SCALAR,
|
|
1362
|
+
const g = re.SCALAR, R = H[s.sparse.indices.componentType], w = s.sparse.indices.byteOffset || 0, E = s.sparse.values.byteOffset || 0, b = new R(n[1], w, s.sparse.count * g), M = new l(n[2], E, s.sparse.count * o);
|
|
1332
1363
|
a !== null && (m = new K(m.array.slice(), m.itemSize, m.normalized)), m.normalized = !1;
|
|
1333
1364
|
for (let x = 0, U = b.length; x < U; x++) {
|
|
1334
1365
|
const I = b[x];
|
|
@@ -1397,9 +1428,11 @@ class Os {
|
|
|
1397
1428
|
}
|
|
1398
1429
|
/**
|
|
1399
1430
|
* Asynchronously assigns a texture to the given material parameters.
|
|
1431
|
+
*
|
|
1400
1432
|
* @param {Object} materialParams
|
|
1401
1433
|
* @param {string} mapName
|
|
1402
1434
|
* @param {Object} mapDef
|
|
1435
|
+
* @param {string} colorSpace
|
|
1403
1436
|
* @return {Promise<Texture>}
|
|
1404
1437
|
*/
|
|
1405
1438
|
assignTexture(e, t, r, s) {
|
|
@@ -1487,7 +1520,12 @@ class Os {
|
|
|
1487
1520
|
return i.name && (u.name = i.name), C(u, i), t.associations.set(u, { materials: e }), i.extensions && P(s, u, i), u;
|
|
1488
1521
|
});
|
|
1489
1522
|
}
|
|
1490
|
-
/**
|
|
1523
|
+
/**
|
|
1524
|
+
* When Object3D instances are targeted by animation, they need unique names.
|
|
1525
|
+
*
|
|
1526
|
+
* @param {String} originalName
|
|
1527
|
+
* @return {String}
|
|
1528
|
+
*/
|
|
1491
1529
|
createUniqueName(e) {
|
|
1492
1530
|
const t = _t.sanitizeNodeName(e || "");
|
|
1493
1531
|
return t in this.nodeNamesUsed ? t + "_" + ++this.nodeNamesUsed[t] : (this.nodeNamesUsed[t] = 0, t);
|
|
@@ -1535,17 +1573,17 @@ class Os {
|
|
|
1535
1573
|
for (let f = 0, p = d.length; f < p; f++) {
|
|
1536
1574
|
const A = d[f], m = n[f];
|
|
1537
1575
|
let g;
|
|
1538
|
-
const
|
|
1576
|
+
const R = l[f];
|
|
1539
1577
|
if (m.mode === L.TRIANGLES || m.mode === L.TRIANGLE_STRIP || m.mode === L.TRIANGLE_FAN || m.mode === void 0)
|
|
1540
|
-
g = i.isSkinnedMesh === !0 ? new Rt(A,
|
|
1578
|
+
g = i.isSkinnedMesh === !0 ? new Rt(A, R) : new Et(A, R), g.isSkinnedMesh === !0 && g.normalizeSkinWeights(), m.mode === L.TRIANGLE_STRIP ? g.geometry = xe(g.geometry, Ne) : m.mode === L.TRIANGLE_FAN && (g.geometry = xe(g.geometry, ue));
|
|
1541
1579
|
else if (m.mode === L.LINES)
|
|
1542
|
-
g = new wt(A,
|
|
1580
|
+
g = new wt(A, R);
|
|
1543
1581
|
else if (m.mode === L.LINE_STRIP)
|
|
1544
|
-
g = new Lt(A,
|
|
1582
|
+
g = new Lt(A, R);
|
|
1545
1583
|
else if (m.mode === L.LINE_LOOP)
|
|
1546
|
-
g = new xt(A,
|
|
1584
|
+
g = new xt(A, R);
|
|
1547
1585
|
else if (m.mode === L.POINTS)
|
|
1548
|
-
g = new yt(A,
|
|
1586
|
+
g = new yt(A, R);
|
|
1549
1587
|
else
|
|
1550
1588
|
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + m.mode);
|
|
1551
1589
|
Object.keys(g.geometry.morphAttributes).length > 0 && vs(g, i), g.name = t.createUniqueName(i.name || "mesh_" + e), C(g, i), m.extensions && P(s, g, m), t.assignFinalMaterial(g), u.push(g);
|
|
@@ -1609,8 +1647,8 @@ class Os {
|
|
|
1609
1647
|
loadAnimation(e) {
|
|
1610
1648
|
const t = this.json, r = this, s = t.animations[e], i = s.name ? s.name : "animation_" + e, n = [], a = [], o = [], l = [], d = [];
|
|
1611
1649
|
for (let u = 0, h = s.channels.length; u < h; u++) {
|
|
1612
|
-
const f = s.channels[u], p = s.samplers[f.sampler], A = f.target, m = A.node, g = s.parameters !== void 0 ? s.parameters[p.input] : p.input,
|
|
1613
|
-
A.node !== void 0 && (n.push(this.getDependency("node", m)), a.push(this.getDependency("accessor", g)), o.push(this.getDependency("accessor",
|
|
1650
|
+
const f = s.channels[u], p = s.samplers[f.sampler], A = f.target, m = A.node, g = s.parameters !== void 0 ? s.parameters[p.input] : p.input, R = s.parameters !== void 0 ? s.parameters[p.output] : p.output;
|
|
1651
|
+
A.node !== void 0 && (n.push(this.getDependency("node", m)), a.push(this.getDependency("accessor", g)), o.push(this.getDependency("accessor", R)), l.push(p), d.push(A));
|
|
1614
1652
|
}
|
|
1615
1653
|
return Promise.all([
|
|
1616
1654
|
Promise.all(n),
|
|
@@ -1620,11 +1658,11 @@ class Os {
|
|
|
1620
1658
|
Promise.all(d)
|
|
1621
1659
|
]).then(function(u) {
|
|
1622
1660
|
const h = u[0], f = u[1], p = u[2], A = u[3], m = u[4], g = [];
|
|
1623
|
-
for (let
|
|
1624
|
-
const
|
|
1625
|
-
if (
|
|
1626
|
-
|
|
1627
|
-
const I = r._createAnimationTracks(
|
|
1661
|
+
for (let R = 0, w = h.length; R < w; R++) {
|
|
1662
|
+
const E = h[R], b = f[R], M = p[R], x = A[R], U = m[R];
|
|
1663
|
+
if (E === void 0) continue;
|
|
1664
|
+
E.updateMatrix && E.updateMatrix();
|
|
1665
|
+
const I = r._createAnimationTracks(E, b, M, x, U);
|
|
1628
1666
|
if (I)
|
|
1629
1667
|
for (let Z = 0; Z < I.length; Z++)
|
|
1630
1668
|
g.push(I[Z]);
|
|
@@ -2029,15 +2067,15 @@ function Ps() {
|
|
|
2029
2067
|
const A = { index: null, attributes: [] };
|
|
2030
2068
|
for (const m in d) {
|
|
2031
2069
|
const g = self[u[m]];
|
|
2032
|
-
let
|
|
2070
|
+
let R, w;
|
|
2033
2071
|
if (l.useUniqueIDs)
|
|
2034
|
-
w = d[m],
|
|
2072
|
+
w = d[m], R = a.GetAttributeByUniqueId(h, w);
|
|
2035
2073
|
else {
|
|
2036
2074
|
if (w = a.GetAttributeId(h, n[d[m]]), w === -1) continue;
|
|
2037
|
-
|
|
2075
|
+
R = a.GetAttribute(h, w);
|
|
2038
2076
|
}
|
|
2039
|
-
const
|
|
2040
|
-
m === "color" && (
|
|
2077
|
+
const E = s(n, a, h, m, g, R);
|
|
2078
|
+
m === "color" && (E.vertexColorSpace = l.vertexColorSpace), A.attributes.push(E);
|
|
2041
2079
|
}
|
|
2042
2080
|
return p === n.TRIANGULAR_MESH && (A.index = r(n, a, h)), n.destroy(h), A;
|
|
2043
2081
|
}
|
|
@@ -2050,10 +2088,10 @@ function Ps() {
|
|
|
2050
2088
|
function s(n, a, o, l, d, u) {
|
|
2051
2089
|
const h = u.num_components(), p = o.num_points() * h, A = p * d.BYTES_PER_ELEMENT, m = i(n, d), g = n._malloc(A);
|
|
2052
2090
|
a.GetAttributeDataArrayForAllPoints(o, u, m, A, g);
|
|
2053
|
-
const
|
|
2091
|
+
const R = new d(n.HEAPF32.buffer, g, p).slice();
|
|
2054
2092
|
return n._free(g), {
|
|
2055
2093
|
name: l,
|
|
2056
|
-
array:
|
|
2094
|
+
array: R,
|
|
2057
2095
|
itemSize: h
|
|
2058
2096
|
};
|
|
2059
2097
|
}
|
|
@@ -2083,12 +2121,12 @@ var ks = Object.defineProperty, Fs = Object.getOwnPropertyDescriptor, Hs = (c, e
|
|
|
2083
2121
|
};
|
|
2084
2122
|
let Y = class {
|
|
2085
2123
|
constructor() {
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2124
|
+
_(this, "loadingManager", new jt());
|
|
2125
|
+
_(this, "loaders", {});
|
|
2126
|
+
_(this, "sources", []);
|
|
2127
|
+
_(this, "loadedResources", {});
|
|
2128
|
+
_(this, "toLoadCount", 0);
|
|
2129
|
+
_(this, "loadedCount", 0);
|
|
2092
2130
|
}
|
|
2093
2131
|
/** @description The video loader. based on {@link HTMLVideoElement}. */
|
|
2094
2132
|
get videoLoader() {
|
|
@@ -2143,8 +2181,8 @@ var Us = Object.defineProperty, Gs = Object.getOwnPropertyDescriptor, Bs = (c, e
|
|
|
2143
2181
|
}, js = (c, e) => (t, r) => e(t, r, c);
|
|
2144
2182
|
let Q = class {
|
|
2145
2183
|
constructor(c) {
|
|
2146
|
-
|
|
2147
|
-
|
|
2184
|
+
_(this, "load$$", new Ze());
|
|
2185
|
+
_(this, "load$", this.load$$.pipe(
|
|
2148
2186
|
le((c) => ({
|
|
2149
2187
|
...c,
|
|
2150
2188
|
loadedCount: c.resource ? this._service.loadedCount + 1 : this._service.loadedCount,
|
|
@@ -2152,7 +2190,7 @@ let Q = class {
|
|
|
2152
2190
|
})),
|
|
2153
2191
|
et()
|
|
2154
2192
|
));
|
|
2155
|
-
|
|
2193
|
+
_(this, "serializedLoad$", this.load$.pipe(
|
|
2156
2194
|
le((c) => {
|
|
2157
2195
|
var t;
|
|
2158
2196
|
let e = c.resource;
|
|
@@ -2178,7 +2216,7 @@ let Q = class {
|
|
|
2178
2216
|
};
|
|
2179
2217
|
})
|
|
2180
2218
|
));
|
|
2181
|
-
|
|
2219
|
+
_(this, "loadCompleted$", this.load$.pipe(
|
|
2182
2220
|
Me((c) => c.toLoadCount === c.loadedCount)
|
|
2183
2221
|
));
|
|
2184
2222
|
this._service = c;
|
|
@@ -2195,7 +2233,7 @@ var Ks = Object.defineProperty, Vs = Object.getOwnPropertyDescriptor, zs = (c, e
|
|
|
2195
2233
|
}, ce = (c, e) => (t, r) => e(t, r, c);
|
|
2196
2234
|
let J = class {
|
|
2197
2235
|
constructor(c, e, t) {
|
|
2198
|
-
|
|
2236
|
+
_(this, "_subscriptions", []);
|
|
2199
2237
|
this._controller = c, this._service = e, this._props = t, this._subscriptions.push(
|
|
2200
2238
|
this._controller.load$.subscribe(
|
|
2201
2239
|
this._service.handleLoad.bind(this._service)
|
|
@@ -2278,7 +2316,7 @@ var Xs = Object.defineProperty, $s = Object.getOwnPropertyDescriptor, Ws = (c, e
|
|
|
2278
2316
|
let Ae = class extends nt {
|
|
2279
2317
|
constructor(e, t, r, s, i, n) {
|
|
2280
2318
|
super();
|
|
2281
|
-
|
|
2319
|
+
_(this, "initialized", !1);
|
|
2282
2320
|
this._service = e, this._controller = t, this._loaderController = r, this.props = s, this.loader = i, this.container = n, this.props.initOnConstruct && this.init();
|
|
2283
2321
|
}
|
|
2284
2322
|
async _initCanvas() {
|
package/dist/worker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./app.module-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./app.module-Bhlwvbrt.js");var g=n.requireWorker();const o=n.getDefaultExportFromCjs(g),T=o.expose;o.registerSerializer;o.Transfer;const h=a=>{const r=n.instance.createChildContainer();r.register(n.CONTAINER_TOKEN,{useValue:r});const e=r.resolve(n.AppModule),d={container:r,module:e},l={};n.PROXY_EVENT_LISTENERS.forEach(t=>{var i,s;l[t]=(s=(i=e[t])==null?void 0:i.bind)==null?void 0:s.call(i,e)});const c=t=>{var u,E,f,m,b;if(!((u=t.data)!=null&&u.canvas)||e.isInitialized())return;const i=!!((E=t.data)!=null&&E.startTimer),s=!!((f=t.data)!=null&&f.withMiniCamera),S=!!((m=t.data)!=null&&m.fullScreen);e.init({...t.data,startTimer:i,withMiniCamera:s,fullScreen:S}),(b=a==null?void 0:a.onReady)==null||b.call(a,d),self==null||self.removeEventListener("message",c)};return self==null||self.addEventListener("message",c),T({...l,isInitialized:e.isInitialized.bind(e),dispose:e.dispose.bind(e),beforeStep$:e.beforeStep$.bind(e),step$:e.step$.bind(e)}),d};exports.launchApp=h;
|
package/dist/worker.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as h, p as x, d as C, h as S, k as T, a as g } from "./app.module-
|
|
1
|
+
import { r as h, p as x, d as C, h as S, k as T, a as g } from "./app.module-Dy3P3_8R.mjs";
|
|
2
2
|
var I = h();
|
|
3
3
|
const r = /* @__PURE__ */ x(I), N = r.expose;
|
|
4
4
|
r.registerSerializer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quick-threejs/reactive",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.29",
|
|
4
4
|
"description": "Reactively quick start a three.js app ⚡️",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -38,19 +38,19 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"rxjs": "^7.8.1",
|
|
40
40
|
"threads": "^1.7.0",
|
|
41
|
-
"three": "^0.
|
|
41
|
+
"three": "^0.172.0",
|
|
42
42
|
"vite-plugin-glslify": "^2.1.0",
|
|
43
|
-
"@quick-threejs/utils": "0.1.
|
|
43
|
+
"@quick-threejs/utils": "0.1.16"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"three": "^0.
|
|
46
|
+
"three": "^0.172.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/events": "^3.0.3",
|
|
50
50
|
"@types/jest": "^29.5.14",
|
|
51
51
|
"@types/node": "^22.10.2",
|
|
52
52
|
"@types/stats.js": "^0.17.3",
|
|
53
|
-
"@types/three": "^0.
|
|
53
|
+
"@types/three": "^0.172.0",
|
|
54
54
|
"babel-jest": "^29.7.0",
|
|
55
55
|
"events": "^3.3.0",
|
|
56
56
|
"jest": "^29.7.0",
|