archgine 1.0.39 → 1.0.41
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/lib/applications/app-offscreen.d.ts +1 -1
- package/lib/environment.worker.js +1 -1
- package/lib/index.mjs +33 -28
- package/lib/index.umd.js +15 -15
- package/lib/renderer.worker.js +547 -542
- package/package.json +3 -2
|
@@ -12,7 +12,7 @@ export declare class AppOffscreen<Config extends IApplicationConfig> extends Eve
|
|
|
12
12
|
readonly workerMessageHandler: (e: MessageEvent) => void;
|
|
13
13
|
readonly cameraHandler: (e: MessageEvent) => void;
|
|
14
14
|
readonly runningHandler: (time: DOMHighResTimeStamp) => void;
|
|
15
|
-
constructor(config
|
|
15
|
+
constructor(config: Config | undefined, worker: Worker);
|
|
16
16
|
destroy(): void;
|
|
17
17
|
bindEvents(): void;
|
|
18
18
|
unbindEvents(): void;
|
|
@@ -3997,7 +3997,7 @@ Fu.__DOMHandler = Eu;
|
|
|
3997
3997
|
Fu.normalizeLineEndings = Le;
|
|
3998
3998
|
Fu.DOMParser = Ie;
|
|
3999
3999
|
var gr = Fu.DOMParser;
|
|
4000
|
-
const Er = "1.0.
|
|
4000
|
+
const Er = "1.0.41";
|
|
4001
4001
|
function vr() {
|
|
4002
4002
|
return typeof window < "u" && ({}.toString.call(window) === "[object Window]" || {}.toString.call(window) === "[object global]");
|
|
4003
4003
|
}
|
package/lib/index.mjs
CHANGED
|
@@ -3997,7 +3997,7 @@ $u.__DOMHandler = Ta;
|
|
|
3997
3997
|
$u.normalizeLineEndings = rd;
|
|
3998
3998
|
$u.DOMParser = id;
|
|
3999
3999
|
var wx = $u.DOMParser;
|
|
4000
|
-
const Tx = "1.0.
|
|
4000
|
+
const Tx = "1.0.41";
|
|
4001
4001
|
function _x() {
|
|
4002
4002
|
return typeof window < "u" && ({}.toString.call(window) === "[object Window]" || {}.toString.call(window) === "[object global]");
|
|
4003
4003
|
}
|
|
@@ -4854,7 +4854,7 @@ class Y {
|
|
|
4854
4854
|
yield this.x, yield this.y;
|
|
4855
4855
|
}
|
|
4856
4856
|
}
|
|
4857
|
-
const dl = new Y(),
|
|
4857
|
+
const dl = new Y(), rw = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4858
4858
|
__proto__: null,
|
|
4859
4859
|
default: Y
|
|
4860
4860
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -8691,7 +8691,7 @@ class Nt {
|
|
|
8691
8691
|
return y;
|
|
8692
8692
|
}
|
|
8693
8693
|
}
|
|
8694
|
-
const os = new Nt(), ta = [new Y(), new Y(), new Y(), new Y()], Fr = new Y(), Dn = new Y(),
|
|
8694
|
+
const os = new Nt(), ta = [new Y(), new Y(), new Y(), new Y()], Fr = new Y(), Dn = new Y(), iw = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8695
8695
|
__proto__: null,
|
|
8696
8696
|
default: Nt
|
|
8697
8697
|
}, Symbol.toStringTag, { value: "Module" })), Mx = te.window.requestAnimationFrame, ea = te.window.performance ? () => te.window.performance.now() : () => (/* @__PURE__ */ new Date()).getTime(), kf = Mx;
|
|
@@ -17170,7 +17170,7 @@ class Kb extends Wr {
|
|
|
17170
17170
|
}
|
|
17171
17171
|
const Yt = new Nt(), Nn = new Y(), Nl = new Y();
|
|
17172
17172
|
var Bn = /* @__PURE__ */ ((r) => (r.SELECTED = "SELECTED", r.POINTEROVER = "POINTEROVER", r.POINTERLEAVE = "POINTERLEAVE", r))(Bn || {});
|
|
17173
|
-
class
|
|
17173
|
+
class aw extends Wr {
|
|
17174
17174
|
name = "SvgApp";
|
|
17175
17175
|
params;
|
|
17176
17176
|
renderer;
|
|
@@ -17525,16 +17525,7 @@ class tw {
|
|
|
17525
17525
|
return n.set(c, f), n;
|
|
17526
17526
|
}
|
|
17527
17527
|
}
|
|
17528
|
-
|
|
17529
|
-
return new Worker(
|
|
17530
|
-
"/renderer.worker.js",
|
|
17531
|
-
{
|
|
17532
|
-
type: "module",
|
|
17533
|
-
name: r == null ? void 0 : r.name
|
|
17534
|
-
}
|
|
17535
|
-
);
|
|
17536
|
-
}
|
|
17537
|
-
class rw extends jb {
|
|
17528
|
+
class ew extends jb {
|
|
17538
17529
|
name = "OpeView";
|
|
17539
17530
|
constructor(t = {}) {
|
|
17540
17531
|
super(t), this.initController(this.camera);
|
|
@@ -17551,9 +17542,10 @@ class rw extends jb {
|
|
|
17551
17542
|
}
|
|
17552
17543
|
}
|
|
17553
17544
|
var ei = /* @__PURE__ */ ((r) => (r.INIT = "init", r.LOAD = "load", r.LOADED = "loaded", r.GET_LAYERS = "getLayers", r.TERMINATE = "terminate", r.CAMERA_SYNC = "cameraSync", r.CAMERA_CHANGED = "cameraChanged", r.SCENES_CHANGED = "scenesChanged", r.UPDATE_LAYERS_VISIBILITY = "updateLayersVisibility", r))(ei || {});
|
|
17554
|
-
class
|
|
17545
|
+
class uw extends Wr {
|
|
17555
17546
|
cvs;
|
|
17556
|
-
worker = new
|
|
17547
|
+
// worker: Worker = new RenderWorker();
|
|
17548
|
+
worker;
|
|
17557
17549
|
view;
|
|
17558
17550
|
boundingBox = new Nt();
|
|
17559
17551
|
// // readonly runningHandler = this.running.bind(this);
|
|
@@ -17561,11 +17553,11 @@ class ow extends Wr {
|
|
|
17561
17553
|
// readonly workerErrorHandler = this.handleWorkerError.bind(this);
|
|
17562
17554
|
cameraHandler = this.handleCameraChanged.bind(this);
|
|
17563
17555
|
runningHandler = this.running.bind(this);
|
|
17564
|
-
constructor(t = {}) {
|
|
17556
|
+
constructor(t = {}, e) {
|
|
17565
17557
|
super(), t.workerRender = !0, this.params = t, te.config = t;
|
|
17566
|
-
const
|
|
17567
|
-
if (!
|
|
17568
|
-
this.cvs =
|
|
17558
|
+
const n = tw.createCanvas(t);
|
|
17559
|
+
if (!n.transferControlToOffscreen) throw new Error("not support transferControlToOffscreen");
|
|
17560
|
+
this.cvs = n.transferControlToOffscreen(), this.view = new ew(t), this.view.camera.name = "mainCamera", this.view.camera.resize(), this.worker = e, this.bindEvents();
|
|
17569
17561
|
}
|
|
17570
17562
|
destroy() {
|
|
17571
17563
|
super.destroy(), this.unbindEvents(), this.worker.postMessage({ task: ei.TERMINATE }), this.worker.terminate();
|
|
@@ -17596,6 +17588,9 @@ class ow extends Wr {
|
|
|
17596
17588
|
if (!A) return;
|
|
17597
17589
|
this.boundingBox.fromString(A);
|
|
17598
17590
|
break;
|
|
17591
|
+
case "pong":
|
|
17592
|
+
console.log("response: pong");
|
|
17593
|
+
break;
|
|
17599
17594
|
}
|
|
17600
17595
|
}
|
|
17601
17596
|
handleCameraChanged(t) {
|
|
@@ -17642,7 +17637,8 @@ class ow extends Wr {
|
|
|
17642
17637
|
}
|
|
17643
17638
|
// life cycle
|
|
17644
17639
|
start() {
|
|
17645
|
-
|
|
17640
|
+
const t = this.cvs, e = JSON.stringify(this.params);
|
|
17641
|
+
this.worker.postMessage({ task: ei.INIT, data: { cvs: t, config: e } }, [t]), requestAnimationFrame(this.runningHandler);
|
|
17646
17642
|
}
|
|
17647
17643
|
running(t) {
|
|
17648
17644
|
var e;
|
|
@@ -17651,7 +17647,7 @@ class ow extends Wr {
|
|
|
17651
17647
|
stop() {
|
|
17652
17648
|
}
|
|
17653
17649
|
}
|
|
17654
|
-
function
|
|
17650
|
+
function ow(r) {
|
|
17655
17651
|
return new Worker(
|
|
17656
17652
|
"/environment.worker.js",
|
|
17657
17653
|
{
|
|
@@ -17660,19 +17656,28 @@ function lw(r) {
|
|
|
17660
17656
|
}
|
|
17661
17657
|
);
|
|
17662
17658
|
}
|
|
17659
|
+
function lw(r) {
|
|
17660
|
+
return new Worker(
|
|
17661
|
+
"/renderer.worker.js",
|
|
17662
|
+
{
|
|
17663
|
+
type: "module",
|
|
17664
|
+
name: r == null ? void 0 : r.name
|
|
17665
|
+
}
|
|
17666
|
+
);
|
|
17667
|
+
}
|
|
17663
17668
|
export {
|
|
17664
17669
|
Jb as AppEnum,
|
|
17665
|
-
|
|
17670
|
+
uw as AppOffscreen,
|
|
17666
17671
|
_r as AssetTypeEnum,
|
|
17667
|
-
|
|
17672
|
+
iw as Box2,
|
|
17668
17673
|
Xt as Color,
|
|
17669
17674
|
me as ColorsEnum,
|
|
17670
|
-
|
|
17675
|
+
ow as EnvironmentWorker,
|
|
17671
17676
|
te as GLOB,
|
|
17672
17677
|
Yu as LayerTypeEnum,
|
|
17673
17678
|
Ut as Monitor,
|
|
17674
|
-
|
|
17675
|
-
|
|
17676
|
-
|
|
17679
|
+
lw as RendererWorker,
|
|
17680
|
+
aw as SvgApp,
|
|
17681
|
+
rw as Vector2,
|
|
17677
17682
|
V1 as defaultConfig
|
|
17678
17683
|
};
|