modern-canvas 0.18.2 → 0.19.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/dist/index.js +860 -721
- package/dist/scene/2d/element/Element2D.d.ts +1 -1
- package/dist/scene/2d/element/Element2DConnection.d.ts +13 -1
- package/dist/scene/2d/element/Element2DShape.d.ts +40 -1
- package/dist/scene/2d/element/connectionRouter.d.ts +21 -0
- package/dist/scene/2d/element/index.d.ts +1 -0
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -184,34 +184,34 @@ function De(e, t, n = {}) {
|
|
|
184
184
|
}
|
|
185
185
|
//#endregion
|
|
186
186
|
//#region src/core/shared/dom.ts
|
|
187
|
-
var Oe = "WebGL2RenderingContext" in globalThis, ke = "ImageBitmap" in globalThis, Ae = "ResizeObserver" in globalThis, je = "PointerEvent" in globalThis, Me = "WheelEvent" in globalThis, Ne = "MouseEvent" in globalThis,
|
|
188
|
-
function
|
|
187
|
+
var Oe = "WebGL2RenderingContext" in globalThis, ke = "ImageBitmap" in globalThis, Ae = "ResizeObserver" in globalThis, je = "PointerEvent" in globalThis, Me = "WheelEvent" in globalThis, Ne = "MouseEvent" in globalThis, Pe = "ontouchstart" in globalThis, Fe = "onclick" in globalThis, Ie = "createImageBitmap" in globalThis, Le = "AudioContext" in globalThis, Re = "webkitAudioContext" in globalThis, ze = "OfflineAudioContext" in globalThis, Be = "webkitOfflineAudioContext" in globalThis, Ve = Le || Re, He = typeof window < "u", Ue = typeof navigator < "u" && navigator?.userAgent?.indexOf("Mac") >= 0, We = globalThis.devicePixelRatio || 1, Ge = (e) => typeof e == "object" && !!e && e.nodeType === 1, Ke = (e) => Ge(e) && e.tagName === "VIDEO", qe = (e) => Ge(e) && e.tagName === "IMG";
|
|
188
|
+
function Je(e) {
|
|
189
189
|
return typeof e == "object" && !!e && e.nodeType === 1 && e.tagName === "CANVAS";
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function Ye(e) {
|
|
192
192
|
return Oe && e instanceof globalThis.WebGL2RenderingContext;
|
|
193
193
|
}
|
|
194
|
-
function
|
|
195
|
-
if (
|
|
194
|
+
function Xe() {
|
|
195
|
+
if (He) return globalThis.document.createElement("canvas");
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function Ze(e, t = globalThis.location) {
|
|
198
198
|
if (e.startsWith("data:")) return "";
|
|
199
199
|
t ||= globalThis.location;
|
|
200
200
|
let n = new URL(e, document.baseURI);
|
|
201
201
|
return n.hostname !== t.hostname || n.port !== t.port || n.protocol !== t.protocol ? "anonymous" : "";
|
|
202
202
|
}
|
|
203
|
-
function
|
|
204
|
-
n === null && !t.startsWith("data:") ? e.crossOrigin =
|
|
203
|
+
function Qe(e, t, n) {
|
|
204
|
+
n === null && !t.startsWith("data:") ? e.crossOrigin = Ze(t) : n !== !1 && (e.crossOrigin = typeof n == "string" ? n : "anonymous");
|
|
205
205
|
}
|
|
206
206
|
//#endregion
|
|
207
207
|
//#region src/core/shared/id.ts
|
|
208
|
-
var
|
|
209
|
-
function
|
|
210
|
-
return
|
|
208
|
+
var $e = 0;
|
|
209
|
+
function et() {
|
|
210
|
+
return ++$e;
|
|
211
211
|
}
|
|
212
212
|
//#endregion
|
|
213
213
|
//#region src/core/input/InputEvent.ts
|
|
214
|
-
var
|
|
214
|
+
var tt = class e {
|
|
215
215
|
cursor;
|
|
216
216
|
bubbles = !1;
|
|
217
217
|
cancelBubble = !1;
|
|
@@ -246,14 +246,14 @@ var et = class e {
|
|
|
246
246
|
initUIEvent(...e) {
|
|
247
247
|
throw Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.");
|
|
248
248
|
}
|
|
249
|
-
},
|
|
249
|
+
}, nt = class extends tt {
|
|
250
250
|
getModifierState(...e) {
|
|
251
251
|
throw Error("getModifierState() is a legacy DOM API. It is not implemented in the Federated Events API.");
|
|
252
252
|
}
|
|
253
253
|
initKeyboardEvent(...e) {
|
|
254
254
|
throw Error("initKeyboardEvent() is a legacy DOM API. It is not implemented in the Federated Events API.");
|
|
255
255
|
}
|
|
256
|
-
},
|
|
256
|
+
}, rt = class extends tt {
|
|
257
257
|
client = {
|
|
258
258
|
x: 0,
|
|
259
259
|
y: 0
|
|
@@ -336,7 +336,7 @@ var et = class e {
|
|
|
336
336
|
get globalY() {
|
|
337
337
|
return this.global.y;
|
|
338
338
|
}
|
|
339
|
-
},
|
|
339
|
+
}, it = class extends rt {
|
|
340
340
|
width = 0;
|
|
341
341
|
height = 0;
|
|
342
342
|
isPrimary = !1;
|
|
@@ -346,20 +346,20 @@ var et = class e {
|
|
|
346
346
|
getPredictedEvents() {
|
|
347
347
|
throw Error("getPredictedEvents is not supported!");
|
|
348
348
|
}
|
|
349
|
-
},
|
|
349
|
+
}, at = class extends rt {
|
|
350
350
|
static DOM_DELTA_PIXEL = 0;
|
|
351
351
|
DOM_DELTA_PIXEL = 0;
|
|
352
352
|
static DOM_DELTA_LINE = 1;
|
|
353
353
|
DOM_DELTA_LINE = 1;
|
|
354
354
|
static DOM_DELTA_PAGE = 2;
|
|
355
355
|
DOM_DELTA_PAGE = 2;
|
|
356
|
-
},
|
|
356
|
+
}, ot = {
|
|
357
357
|
touchstart: "pointerdown",
|
|
358
358
|
touchend: "pointerup",
|
|
359
359
|
touchendoutside: "pointerupoutside",
|
|
360
360
|
touchmove: "pointermove",
|
|
361
361
|
touchcancel: "pointercancel"
|
|
362
|
-
},
|
|
362
|
+
}, st = class extends e {
|
|
363
363
|
event;
|
|
364
364
|
target;
|
|
365
365
|
cursor = "default";
|
|
@@ -377,16 +377,16 @@ var et = class e {
|
|
|
377
377
|
removeEventListeners() {
|
|
378
378
|
if (!this.setuped || !this.target) return;
|
|
379
379
|
let e = this.target.style;
|
|
380
|
-
globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "", e.msTouchAction = "") : je && (e.touchAction = ""), je ? (this.target.removeEventListener("pointerdown", this._onPointerDown), this.target.removeEventListener("pointerleave", this._onPointerOver), this.target.removeEventListener("pointerover", this._onPointerOver), this.target.removeEventListener("pointermove", this._onPointerMove), this.target.removeEventListener("pointerup", this._onPointerUp)) : (this.target.removeEventListener("mousedown", this._onPointerDown), this.target.removeEventListener("mouseout", this._onPointerOver), this.target.removeEventListener("mouseover", this._onPointerOver), this.target.removeEventListener("mousemove", this._onPointerMove), this.target.removeEventListener("mouseup", this._onPointerUp)),
|
|
380
|
+
globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "", e.msTouchAction = "") : je && (e.touchAction = ""), je ? (this.target.removeEventListener("pointerdown", this._onPointerDown), this.target.removeEventListener("pointerleave", this._onPointerOver), this.target.removeEventListener("pointerover", this._onPointerOver), this.target.removeEventListener("pointermove", this._onPointerMove), this.target.removeEventListener("pointerup", this._onPointerUp)) : (this.target.removeEventListener("mousedown", this._onPointerDown), this.target.removeEventListener("mouseout", this._onPointerOver), this.target.removeEventListener("mouseover", this._onPointerOver), this.target.removeEventListener("mousemove", this._onPointerMove), this.target.removeEventListener("mouseup", this._onPointerUp)), Pe && (this.target.removeEventListener("touchstart", this._onPointerDown), this.target.removeEventListener("touchmove", this._onPointerMove), this.target.removeEventListener("touchend", this._onPointerUp)), this.target.removeEventListener("wheel", this._onWheel), document.removeEventListener("keydown", this._onKeyDown), document.removeEventListener("keypress", this._onKeyPress), document.removeEventListener("keyup", this._onKeyUp), this.target = void 0, this.setuped = !1;
|
|
381
381
|
}
|
|
382
382
|
addEventListeners() {
|
|
383
383
|
if (this.setuped || !this.target) return;
|
|
384
384
|
let e = this.target.style;
|
|
385
|
-
e && (globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "none", e.msTouchAction = "none") : je && (e.touchAction = "none")), je ? (this.target.addEventListener("pointerdown", this._onPointerDown), this.target.addEventListener("pointerleave", this._onPointerOver), this.target.addEventListener("pointerover", this._onPointerOver), this.target.addEventListener("pointermove", this._onPointerMove), this.target.addEventListener("pointerup", this._onPointerUp)) : (this.target.addEventListener("mousedown", this._onPointerDown), this.target.addEventListener("mouseout", this._onPointerOver), this.target.addEventListener("mouseover", this._onPointerOver), this.target.addEventListener("mousemove", this._onPointerMove), this.target.addEventListener("mouseup", this._onPointerUp)),
|
|
385
|
+
e && (globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "none", e.msTouchAction = "none") : je && (e.touchAction = "none")), je ? (this.target.addEventListener("pointerdown", this._onPointerDown), this.target.addEventListener("pointerleave", this._onPointerOver), this.target.addEventListener("pointerover", this._onPointerOver), this.target.addEventListener("pointermove", this._onPointerMove), this.target.addEventListener("pointerup", this._onPointerUp)) : (this.target.addEventListener("mousedown", this._onPointerDown), this.target.addEventListener("mouseout", this._onPointerOver), this.target.addEventListener("mouseover", this._onPointerOver), this.target.addEventListener("mousemove", this._onPointerMove), this.target.addEventListener("mouseup", this._onPointerUp)), Pe && (this.target.addEventListener("touchstart", this._onPointerDown), this.target.addEventListener("touchmove", this._onPointerMove), this.target.addEventListener("touchend", this._onPointerUp)), this.target.addEventListener("wheel", this._onWheel), document.addEventListener("keydown", this._onKeyDown), document.addEventListener("keypress", this._onKeyPress), document.addEventListener("keyup", this._onKeyUp), this.setuped = !0;
|
|
386
386
|
}
|
|
387
387
|
normalize(e) {
|
|
388
388
|
let t = [];
|
|
389
|
-
if (
|
|
389
|
+
if (Pe && e instanceof globalThis.TouchEvent) for (let n = 0, r = e.changedTouches.length; n < r; n++) {
|
|
390
390
|
let r = e.changedTouches[n];
|
|
391
391
|
r.button === void 0 && (r.button = 0), r.buttons === void 0 && (r.buttons = 1), r.isPrimary === void 0 && (r.isPrimary = e.touches.length === 1 && e.type === "touchstart"), r.width === void 0 && (r.width = r.radiusX || 1), r.height === void 0 && (r.height = r.radiusY || 1), r.tiltX === void 0 && (r.tiltX = 0), r.tiltY === void 0 && (r.tiltY = 0), r.pointerType === void 0 && (r.pointerType = "touch"), r.pointerId === void 0 && (r.pointerId = r.identifier || 0), r.pressure === void 0 && (r.pressure = r.force || .5), r.twist === void 0 && (r.twist = 0), r.tangentialPressure === void 0 && (r.tangentialPressure = 0), r.layerX === void 0 && (r.layerX = r.offsetX = r.clientX), r.layerY === void 0 && (r.layerY = r.offsetY = r.clientY), r.type = e.type, t.push(r);
|
|
392
392
|
}
|
|
@@ -399,8 +399,8 @@ var et = class e {
|
|
|
399
399
|
return t;
|
|
400
400
|
}
|
|
401
401
|
_clonePointerEvent(e) {
|
|
402
|
-
let t = new
|
|
403
|
-
return t.nativeEvent = e, t.pointerId = e.pointerId, t.width = e.width, t.height = e.height, t.isPrimary = e.isPrimary, t.pointerType = e.pointerType, t.pressure = e.pressure, t.tangentialPressure = e.tangentialPressure, t.tiltX = e.tiltX, t.tiltY = e.tiltY, t.twist = e.twist, t.isTrusted = e.isTrusted, this._copyMouseEvent(t, e), this.mapPositionToPoint(t.screen, e.clientX, e.clientY), t.global.x = t.screen.x, t.global.y = t.screen.y, t.offset.x = t.screen.x, t.offset.y = t.screen.y, t.type === "pointerleave" ? t.type = "pointerout" : t.type.startsWith("mouse") ? t.type = t.type.replace("mouse", "pointer") : t.type.startsWith("touch") && (t.type =
|
|
402
|
+
let t = new it();
|
|
403
|
+
return t.nativeEvent = e, t.pointerId = e.pointerId, t.width = e.width, t.height = e.height, t.isPrimary = e.isPrimary, t.pointerType = e.pointerType, t.pressure = e.pressure, t.tangentialPressure = e.tangentialPressure, t.tiltX = e.tiltX, t.tiltY = e.tiltY, t.twist = e.twist, t.isTrusted = e.isTrusted, this._copyMouseEvent(t, e), this.mapPositionToPoint(t.screen, e.clientX, e.clientY), t.global.x = t.screen.x, t.global.y = t.screen.y, t.offset.x = t.screen.x, t.offset.y = t.screen.y, t.type === "pointerleave" ? t.type = "pointerout" : t.type.startsWith("mouse") ? t.type = t.type.replace("mouse", "pointer") : t.type.startsWith("touch") && (t.type = ot[t.type] || t.type), t;
|
|
404
404
|
}
|
|
405
405
|
_copyInputEvent(e, t) {
|
|
406
406
|
e.nativeEvent = t, e.bubbles = t.bubbles, e.cancelBubble = t.cancelBubble, e.cancelable = t.cancelable, e.composed = t.composed, e.currentTarget = t.currentTarget, e.defaultPrevented = t.defaultPrevented, e.eventPhase = t.eventPhase, e.isTrusted = t.isTrusted, e.returnValue = t.returnValue, e.srcElement = t.srcElement, e.timeStamp = t.timeStamp, e.type = t.type;
|
|
@@ -409,11 +409,11 @@ var et = class e {
|
|
|
409
409
|
this._copyInputEvent(e, t), e.altKey = t.altKey, e.button = t.button, e.buttons = t.buttons, e.client.x = t.clientX, e.client.y = t.clientY, e.ctrlKey = t.ctrlKey, e.metaKey = t.metaKey, e.movement.x = t.movementX, e.movement.y = t.movementY, e.page.x = t.pageX, e.page.y = t.pageY, e.relatedTarget = null, e.shiftKey = t.shiftKey;
|
|
410
410
|
}
|
|
411
411
|
_cloneWheelEvent(e) {
|
|
412
|
-
let t = new
|
|
412
|
+
let t = new at();
|
|
413
413
|
return this._copyMouseEvent(t, e), t.wheelDeltaY = e.wheelDeltaY, t.deltaX = e.deltaX, t.deltaY = e.deltaY, t.deltaZ = e.deltaZ, t.deltaMode = e.deltaMode, this.mapPositionToPoint(t.screen, e.clientX, e.clientY), t.global.x = t.screen.x, t.global.y = t.screen.y, t.offset.x = t.screen.x, t.offset.y = t.screen.y, t;
|
|
414
414
|
}
|
|
415
415
|
_cloneKeyboardEvent(e) {
|
|
416
|
-
let t = new
|
|
416
|
+
let t = new nt();
|
|
417
417
|
return this._copyInputEvent(t, e), t.altKey = e.altKey, t.charCode = e.charCode, t.code = e.code, t.ctrlKey = e.ctrlKey, t.isComposing = e.isComposing, t.key = e.key, t.keyCode = e.keyCode, t.location = e.location, t.metaKey = e.metaKey, t.repeat = e.repeat, t.shiftKey = e.shiftKey, t;
|
|
418
418
|
}
|
|
419
419
|
setCursor(e = "default") {
|
|
@@ -461,25 +461,25 @@ var et = class e {
|
|
|
461
461
|
this.event?.cursor && this.setCursor(this.event.cursor);
|
|
462
462
|
};
|
|
463
463
|
_onPointerDown = (e) => {
|
|
464
|
-
if (
|
|
464
|
+
if (Pe && e.pointerType === "touch") return;
|
|
465
465
|
let t = this.normalize(e);
|
|
466
466
|
for (let e = 0, n = t.length; e < n; e++) this.emit("pointerdown", this.event = this._clonePointerEvent(t[e]));
|
|
467
467
|
this.event?.cursor && this.setCursor(this.event.cursor);
|
|
468
468
|
};
|
|
469
469
|
_onPointerOver = (e) => {
|
|
470
|
-
if (!this.enableClickEvent ||
|
|
470
|
+
if (!this.enableClickEvent || Pe && e.pointerType === "touch") return;
|
|
471
471
|
let t = this.normalize(e);
|
|
472
472
|
for (let e = 0, n = t.length; e < n; e++) this.emit("pointerover", this.event = this._clonePointerEvent(t[e]));
|
|
473
473
|
this.event?.cursor && this.setCursor(this.event.cursor);
|
|
474
474
|
};
|
|
475
475
|
_onPointerMove = (e) => {
|
|
476
|
-
if (!this.enableMoveEvent ||
|
|
476
|
+
if (!this.enableMoveEvent || Pe && e.pointerType === "touch") return;
|
|
477
477
|
let t = this.normalize(e);
|
|
478
478
|
for (let e = 0, n = t.length; e < n; e++) this.emit("pointermove", this.event = this._clonePointerEvent(t[e]));
|
|
479
479
|
this.event?.cursor && this.setCursor(this.event.cursor);
|
|
480
480
|
};
|
|
481
481
|
_onPointerUp = (e) => {
|
|
482
|
-
if (!this.enableClickEvent ||
|
|
482
|
+
if (!this.enableClickEvent || Pe && e.pointerType === "touch") return;
|
|
483
483
|
let t = e.target;
|
|
484
484
|
e.composedPath && e.composedPath().length > 0 && (t = e.composedPath()[0]);
|
|
485
485
|
let n = t === this.target ? "" : "outside", r = this.normalize(e);
|
|
@@ -498,8 +498,8 @@ var et = class e {
|
|
|
498
498
|
destroy() {
|
|
499
499
|
this.removeEventListeners(), super.destroy();
|
|
500
500
|
}
|
|
501
|
-
},
|
|
502
|
-
instanceId =
|
|
501
|
+
}, C = class extends n {
|
|
502
|
+
instanceId = et();
|
|
503
503
|
destroyed = !1;
|
|
504
504
|
get json() {
|
|
505
505
|
return this.toJSON();
|
|
@@ -517,7 +517,7 @@ var et = class e {
|
|
|
517
517
|
destroy() {
|
|
518
518
|
this.destroyed || (this.destroyed = !0, this._destroy(), this.emit("destroy"), this.removeAllListeners());
|
|
519
519
|
}
|
|
520
|
-
},
|
|
520
|
+
}, ct = class extends C {}, w = class extends ct {}, lt = class e {
|
|
521
521
|
get x() {
|
|
522
522
|
return this.min.x;
|
|
523
523
|
}
|
|
@@ -651,7 +651,7 @@ var et = class e {
|
|
|
651
651
|
//#endregion
|
|
652
652
|
//#region src/core/math/Color.ts
|
|
653
653
|
b([ue]);
|
|
654
|
-
var
|
|
654
|
+
var T = class {
|
|
655
655
|
get value() {
|
|
656
656
|
return this._value;
|
|
657
657
|
}
|
|
@@ -734,16 +734,16 @@ var E = class {
|
|
|
734
734
|
this.a
|
|
735
735
|
];
|
|
736
736
|
}
|
|
737
|
-
},
|
|
738
|
-
function
|
|
737
|
+
}, ut = _e / 180, dt = 180 / _e;
|
|
738
|
+
function ft(e, t, n) {
|
|
739
739
|
return Math.max(t, Math.min(e, n));
|
|
740
740
|
}
|
|
741
|
-
function
|
|
741
|
+
function E(e, t, n) {
|
|
742
742
|
return (1 - n) * e + n * t;
|
|
743
743
|
}
|
|
744
744
|
//#endregion
|
|
745
745
|
//#region src/core/math/ColorMatrix.ts
|
|
746
|
-
var
|
|
746
|
+
var pt = class {
|
|
747
747
|
_array = new Float32Array(20);
|
|
748
748
|
constructor() {
|
|
749
749
|
this.identity();
|
|
@@ -775,18 +775,18 @@ var ft = class {
|
|
|
775
775
|
hueRotate(e = 0) {
|
|
776
776
|
let t = Math.sin(e), n = Math.cos(e), r = .213, i = .715, a = .072;
|
|
777
777
|
return this.multiply([
|
|
778
|
-
r + n * (1 - r) + t *
|
|
779
|
-
i + n *
|
|
780
|
-
a + n *
|
|
778
|
+
r + n * (1 - r) + t * -.213,
|
|
779
|
+
i + n * -.715 + t * -.715,
|
|
780
|
+
a + n * -.072 + t * (1 - a),
|
|
781
781
|
0,
|
|
782
782
|
0,
|
|
783
|
-
r + n *
|
|
783
|
+
r + n * -.213 + t * .143,
|
|
784
784
|
i + n * (1 - i) + t * .14,
|
|
785
|
-
a + n *
|
|
785
|
+
a + n * -.072 + t * -.283,
|
|
786
786
|
0,
|
|
787
787
|
0,
|
|
788
|
-
r + n *
|
|
789
|
-
i + n *
|
|
788
|
+
r + n * -.213 + t * -.787,
|
|
789
|
+
i + n * -.715 + t * i,
|
|
790
790
|
a + n * (1 - a) + t * a,
|
|
791
791
|
0,
|
|
792
792
|
0,
|
|
@@ -873,7 +873,7 @@ var ft = class {
|
|
|
873
873
|
]);
|
|
874
874
|
}
|
|
875
875
|
invert(e = 1) {
|
|
876
|
-
let t =
|
|
876
|
+
let t = E(1, -1, e), n = E(0, 255, e);
|
|
877
877
|
return this.multiply([
|
|
878
878
|
t,
|
|
879
879
|
0,
|
|
@@ -898,21 +898,21 @@ var ft = class {
|
|
|
898
898
|
]);
|
|
899
899
|
}
|
|
900
900
|
sepia(e = 1) {
|
|
901
|
-
let t =
|
|
901
|
+
let t = ft(e, 0, 1);
|
|
902
902
|
return this.multiply([
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
903
|
+
E(1, .393, t),
|
|
904
|
+
E(0, .7689999, t),
|
|
905
|
+
E(0, .18899999, t),
|
|
906
906
|
0,
|
|
907
907
|
0,
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
908
|
+
E(0, .349, t),
|
|
909
|
+
E(1, .6859999, t),
|
|
910
|
+
E(0, .16799999, t),
|
|
911
911
|
0,
|
|
912
912
|
0,
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
913
|
+
E(0, .272, t),
|
|
914
|
+
E(0, .5339999, t),
|
|
915
|
+
E(1, .13099999, t),
|
|
916
916
|
0,
|
|
917
917
|
0,
|
|
918
918
|
0,
|
|
@@ -947,7 +947,7 @@ var ft = class {
|
|
|
947
947
|
]);
|
|
948
948
|
}
|
|
949
949
|
grayscale(e = 1) {
|
|
950
|
-
let t =
|
|
950
|
+
let t = ft(e, 0, 1), n = E(1, .3, t), r = E(0, .3, t), i = E(1, .59, t), a = E(0, .59, t), o = E(1, .11, t), s = E(0, .11, t);
|
|
951
951
|
return this.multiply([
|
|
952
952
|
n,
|
|
953
953
|
a,
|
|
@@ -999,10 +999,10 @@ var ft = class {
|
|
|
999
999
|
toArray() {
|
|
1000
1000
|
return this._array;
|
|
1001
1001
|
}
|
|
1002
|
-
},
|
|
1002
|
+
}, mt = class e extends lt {
|
|
1003
1003
|
rotation;
|
|
1004
1004
|
get rotationDegrees() {
|
|
1005
|
-
return this.rotation /
|
|
1005
|
+
return this.rotation / ut;
|
|
1006
1006
|
}
|
|
1007
1007
|
constructor(...e) {
|
|
1008
1008
|
let t, n;
|
|
@@ -1012,7 +1012,7 @@ var ft = class {
|
|
|
1012
1012
|
if (!this.rotation && (!("rotation" in e) || !e.rotation)) return super.overlap(e, t);
|
|
1013
1013
|
{
|
|
1014
1014
|
let t = (e, t) => Math.abs(e.x * t.x + e.y * t.y), n = (e) => {
|
|
1015
|
-
let { width: n, height: r, rotation: i = 0 } = e, a = i /
|
|
1015
|
+
let { width: n, height: r, rotation: i = 0 } = e, a = i / ut;
|
|
1016
1016
|
a = -a % 180;
|
|
1017
1017
|
let o = a / 180 * Math.PI, s = {
|
|
1018
1018
|
x: Math.cos(o),
|
|
@@ -1054,7 +1054,7 @@ var ft = class {
|
|
|
1054
1054
|
clone() {
|
|
1055
1055
|
return new e(this.toJSON());
|
|
1056
1056
|
}
|
|
1057
|
-
},
|
|
1057
|
+
}, ht = class {
|
|
1058
1058
|
_array;
|
|
1059
1059
|
x = 0;
|
|
1060
1060
|
y = 0;
|
|
@@ -1077,13 +1077,13 @@ var ft = class {
|
|
|
1077
1077
|
}
|
|
1078
1078
|
};
|
|
1079
1079
|
//#endregion
|
|
1080
|
-
//#region \0@oxc-project+runtime@0.
|
|
1081
|
-
function
|
|
1080
|
+
//#region \0@oxc-project+runtime@0.132.0/helpers/decorateMetadata.js
|
|
1081
|
+
function D(e, t) {
|
|
1082
1082
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
|
|
1083
1083
|
}
|
|
1084
1084
|
//#endregion
|
|
1085
|
-
//#region \0@oxc-project+runtime@0.
|
|
1086
|
-
function
|
|
1085
|
+
//#region \0@oxc-project+runtime@0.132.0/helpers/decorate.js
|
|
1086
|
+
function O(e, t, n, r) {
|
|
1087
1087
|
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
1088
1088
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
1089
1089
|
else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
|
|
@@ -1091,7 +1091,7 @@ function k(e, t, n, r) {
|
|
|
1091
1091
|
}
|
|
1092
1092
|
//#endregion
|
|
1093
1093
|
//#region src/core/os/MainLoop.ts
|
|
1094
|
-
var
|
|
1094
|
+
var gt = class extends C {
|
|
1095
1095
|
_starting = !1;
|
|
1096
1096
|
_nextDeltaTime = 0;
|
|
1097
1097
|
_startedProcess;
|
|
@@ -1121,22 +1121,22 @@ var ht = class extends w {
|
|
|
1121
1121
|
super._destroy(), this.stop();
|
|
1122
1122
|
}
|
|
1123
1123
|
};
|
|
1124
|
-
|
|
1124
|
+
O([_({ fallback: 60 }), D("design:type", Number)], gt.prototype, "fps", void 0), O([_({ fallback: 1 }), D("design:type", Number)], gt.prototype, "speed", void 0);
|
|
1125
1125
|
//#endregion
|
|
1126
1126
|
//#region src/core/renderers/gl/buffer/const.ts
|
|
1127
|
-
var
|
|
1127
|
+
var _t = /* @__PURE__ */ function(e) {
|
|
1128
1128
|
return e[e.elementArrayBuffer = 34963] = "elementArrayBuffer", e[e.arrayBuffer = 34962] = "arrayBuffer", e[e.uniformBuffer = 35345] = "uniformBuffer", e;
|
|
1129
|
-
}({}),
|
|
1129
|
+
}({}), vt = class {
|
|
1130
1130
|
native;
|
|
1131
|
-
target =
|
|
1131
|
+
target = _t.arrayBuffer;
|
|
1132
1132
|
byteLength = 0;
|
|
1133
1133
|
dirty = !0;
|
|
1134
1134
|
constructor(e) {
|
|
1135
1135
|
this.native = e;
|
|
1136
1136
|
}
|
|
1137
|
-
},
|
|
1137
|
+
}, k = /* @__PURE__ */ function(e) {
|
|
1138
1138
|
return e[e.mapRead = 1] = "mapRead", e[e.mapWrite = 2] = "mapWrite", e[e.copySrc = 4] = "copySrc", e[e.copyDst = 8] = "copyDst", e[e.index = 16] = "index", e[e.vertex = 32] = "vertex", e[e.uniform = 64] = "uniform", e[e.storage = 128] = "storage", e[e.indirect = 256] = "indirect", e[e.queryResolve = 512] = "queryResolve", e[e.static = 1024] = "static", e;
|
|
1139
|
-
}({}),
|
|
1139
|
+
}({}), yt, bt = class extends n {
|
|
1140
1140
|
screen = {
|
|
1141
1141
|
x: 0,
|
|
1142
1142
|
y: 0,
|
|
@@ -1155,12 +1155,12 @@ var gt = /* @__PURE__ */ function(e) {
|
|
|
1155
1155
|
this.view && (this.view.width = Math.floor(e * this.pixelRatio), this.view.height = Math.floor(t * this.pixelRatio)), this.screen.width = e, this.screen.height = t, n && this.view && (this.view.style.width = `${e}px`, this.view.style.height = `${t}px`);
|
|
1156
1156
|
}
|
|
1157
1157
|
};
|
|
1158
|
-
|
|
1158
|
+
O([_({ fallback: We }), D("design:type", Number)], bt.prototype, "pixelRatio", void 0), O([_({ internal: !0 }), D("design:type", typeof (yt = typeof HTMLCanvasElement < "u" && HTMLCanvasElement) == "function" ? yt : Object)], bt.prototype, "view", void 0);
|
|
1159
1159
|
//#endregion
|
|
1160
1160
|
//#region src/core/renderers/shared/shader/UniformGroup.ts
|
|
1161
|
-
var
|
|
1161
|
+
var xt = 0, St = class {
|
|
1162
1162
|
isUniformGroup = !0;
|
|
1163
|
-
uid = ++
|
|
1163
|
+
uid = ++xt;
|
|
1164
1164
|
uniforms;
|
|
1165
1165
|
ubo;
|
|
1166
1166
|
isStatic;
|
|
@@ -1171,14 +1171,14 @@ var bt = 0, xt = class {
|
|
|
1171
1171
|
update() {
|
|
1172
1172
|
this._dirtyId++;
|
|
1173
1173
|
}
|
|
1174
|
-
},
|
|
1175
|
-
function
|
|
1176
|
-
let n =
|
|
1177
|
-
return n === void 0 && (
|
|
1174
|
+
}, Ct = Object.create(null), wt = Object.create(null);
|
|
1175
|
+
function Tt(e, t) {
|
|
1176
|
+
let n = wt[e];
|
|
1177
|
+
return n === void 0 && (Ct[t] === void 0 && (Ct[t] = 1), wt[e] = n = Ct[t]++), n;
|
|
1178
1178
|
}
|
|
1179
1179
|
//#endregion
|
|
1180
1180
|
//#region src/core/renderers/gl/system/GlSystem.ts
|
|
1181
|
-
var
|
|
1181
|
+
var A = class extends e {
|
|
1182
1182
|
get _gl() {
|
|
1183
1183
|
return this._renderer.gl;
|
|
1184
1184
|
}
|
|
@@ -1192,7 +1192,7 @@ var j = class extends e {
|
|
|
1192
1192
|
_setup() {}
|
|
1193
1193
|
flush() {}
|
|
1194
1194
|
reset() {}
|
|
1195
|
-
},
|
|
1195
|
+
}, Et = class extends A {
|
|
1196
1196
|
install(e) {
|
|
1197
1197
|
super.install(e), e.buffer = this;
|
|
1198
1198
|
}
|
|
@@ -1202,8 +1202,8 @@ var j = class extends e {
|
|
|
1202
1202
|
return this.glBuffers.get(e.instanceId) || this._createGlBuffer(e);
|
|
1203
1203
|
}
|
|
1204
1204
|
_createGlBuffer(e) {
|
|
1205
|
-
let t = this._gl, n = new
|
|
1206
|
-
return e.usage &
|
|
1205
|
+
let t = this._gl, n = new vt(t.createBuffer()), r = _t.arrayBuffer;
|
|
1206
|
+
return e.usage & k.index ? r = _t.elementArrayBuffer : e.usage & k.uniform && (r = _t.uniformBuffer), n.target = r, this.glBuffers.set(e.instanceId, n), this.buffers.get(e.instanceId) || ("on" in e && (e.on("updateProperty", (e) => {
|
|
1207
1207
|
switch (e) {
|
|
1208
1208
|
case "usage":
|
|
1209
1209
|
case "data":
|
|
@@ -1226,7 +1226,7 @@ var j = class extends e {
|
|
|
1226
1226
|
n.dirty = !1;
|
|
1227
1227
|
let { _gl: r } = this, { usage: i, data: a } = e;
|
|
1228
1228
|
r.bindBuffer(n.target, n.native);
|
|
1229
|
-
let o = i &
|
|
1229
|
+
let o = i & k.static ? r.STATIC_DRAW : r.DYNAMIC_DRAW;
|
|
1230
1230
|
if (a) if (n.byteLength >= a.byteLength) {
|
|
1231
1231
|
let e = a.length * a.BYTES_PER_ELEMENT;
|
|
1232
1232
|
r.bufferSubData(n.target, 0, a, 0, e / a.BYTES_PER_ELEMENT);
|
|
@@ -1241,13 +1241,13 @@ var j = class extends e {
|
|
|
1241
1241
|
}
|
|
1242
1242
|
this.buffers.clear(), this.glBuffers.clear();
|
|
1243
1243
|
}
|
|
1244
|
-
},
|
|
1245
|
-
function
|
|
1246
|
-
return
|
|
1244
|
+
}, Dt;
|
|
1245
|
+
function Ot() {
|
|
1246
|
+
return Dt ||= "mediump", Dt;
|
|
1247
1247
|
}
|
|
1248
1248
|
//#endregion
|
|
1249
1249
|
//#region src/core/renderers/gl/shader/preprocessors/addProgramDefines.ts
|
|
1250
|
-
function
|
|
1250
|
+
function kt(e, t, n) {
|
|
1251
1251
|
return t ? e : n ? (e = e.replace("out vec4 finalColor;", ""), `#ifdef GL_ES
|
|
1252
1252
|
#define in varying
|
|
1253
1253
|
#define finalColor gl_FragColor
|
|
@@ -1261,7 +1261,7 @@ ${e}`;
|
|
|
1261
1261
|
}
|
|
1262
1262
|
//#endregion
|
|
1263
1263
|
//#region src/core/renderers/gl/shader/preprocessors/ensurePrecision.ts
|
|
1264
|
-
function
|
|
1264
|
+
function At(e, t, n) {
|
|
1265
1265
|
let r = n ? t.maxSupportedFragmentPrecision : t.maxSupportedVertexPrecision;
|
|
1266
1266
|
if (e.substring(0, 9) !== "precision") {
|
|
1267
1267
|
let i = n ? t.requestedFragmentPrecision : t.requestedVertexPrecision;
|
|
@@ -1271,31 +1271,31 @@ function kt(e, t, n) {
|
|
|
1271
1271
|
}
|
|
1272
1272
|
//#endregion
|
|
1273
1273
|
//#region src/core/renderers/gl/shader/preprocessors/insertVersion.ts
|
|
1274
|
-
function
|
|
1274
|
+
function jt(e, t) {
|
|
1275
1275
|
return t ? `#version 300 es\n${e}` : e;
|
|
1276
1276
|
}
|
|
1277
1277
|
//#endregion
|
|
1278
1278
|
//#region src/core/renderers/gl/shader/preprocessors/setProgramName.ts
|
|
1279
|
-
var
|
|
1280
|
-
function
|
|
1279
|
+
var Mt = {}, Nt = {};
|
|
1280
|
+
function Pt(e, { name: t = "program" }, n = !0) {
|
|
1281
1281
|
t = t.replace(/\s+/g, "-"), t += n ? "-fragment" : "-vertex";
|
|
1282
|
-
let r = n ?
|
|
1282
|
+
let r = n ? Mt : Nt;
|
|
1283
1283
|
return r[t] ? (r[t]++, t += `-${r[t]}`) : r[t] = 1, e.includes("#define SHADER_NAME") ? e : `${`#define SHADER_NAME ${t}`}\n${e}`;
|
|
1284
1284
|
}
|
|
1285
1285
|
//#endregion
|
|
1286
1286
|
//#region src/core/renderers/gl/shader/preprocessors/stripVersion.ts
|
|
1287
|
-
function
|
|
1287
|
+
function Ft(e, t) {
|
|
1288
1288
|
return t ? e.replace("#version 300 es", "") : e;
|
|
1289
1289
|
}
|
|
1290
1290
|
//#endregion
|
|
1291
1291
|
//#region src/core/renderers/gl/shader/GlProgram.ts
|
|
1292
|
-
var
|
|
1293
|
-
stripVersion:
|
|
1294
|
-
ensurePrecision:
|
|
1295
|
-
addProgramDefines:
|
|
1296
|
-
setProgramName:
|
|
1297
|
-
insertVersion:
|
|
1298
|
-
},
|
|
1292
|
+
var It = Object.create(null), Lt = {
|
|
1293
|
+
stripVersion: Ft,
|
|
1294
|
+
ensurePrecision: At,
|
|
1295
|
+
addProgramDefines: kt,
|
|
1296
|
+
setProgramName: Pt,
|
|
1297
|
+
insertVersion: jt
|
|
1298
|
+
}, Rt = class e {
|
|
1299
1299
|
static defaultOptions = {
|
|
1300
1300
|
preferredVertexPrecision: "highp",
|
|
1301
1301
|
preferredFragmentPrecision: "mediump"
|
|
@@ -1318,25 +1318,25 @@ var Ft = Object.create(null), It = {
|
|
|
1318
1318
|
requestedFragmentPrecision: t.preferredFragmentPrecision,
|
|
1319
1319
|
requestedVertexPrecision: t.preferredVertexPrecision,
|
|
1320
1320
|
maxSupportedVertexPrecision: "highp",
|
|
1321
|
-
maxSupportedFragmentPrecision:
|
|
1321
|
+
maxSupportedFragmentPrecision: Ot()
|
|
1322
1322
|
},
|
|
1323
1323
|
setProgramName: { name: t.name },
|
|
1324
1324
|
addProgramDefines: i,
|
|
1325
1325
|
insertVersion: i
|
|
1326
1326
|
};
|
|
1327
|
-
Object.keys(
|
|
1327
|
+
Object.keys(Lt).forEach((e) => {
|
|
1328
1328
|
let t = a[e];
|
|
1329
|
-
n =
|
|
1330
|
-
}), this.fragment = n, this.vertex = r, this.transformFeedbackVaryings = t.transformFeedbackVaryings, this.id =
|
|
1329
|
+
n = Lt[e](n, t, !0), r = Lt[e](r, t, !1);
|
|
1330
|
+
}), this.fragment = n, this.vertex = r, this.transformFeedbackVaryings = t.transformFeedbackVaryings, this.id = Tt(`${r}:${n}`, "GlProgram");
|
|
1331
1331
|
}
|
|
1332
1332
|
destroy() {
|
|
1333
|
-
this.fragment = "", this.vertex = "", this.attributes = Object.create(null), this.uniforms = Object.create(null), this.transformFeedbackVaryings = void 0, this._cacheKey && delete
|
|
1333
|
+
this.fragment = "", this.vertex = "", this.attributes = Object.create(null), this.uniforms = Object.create(null), this.transformFeedbackVaryings = void 0, this._cacheKey && delete It[this._cacheKey];
|
|
1334
1334
|
}
|
|
1335
1335
|
static from(t) {
|
|
1336
1336
|
let n = `${t.vertex}:${t.fragment}`;
|
|
1337
|
-
return
|
|
1337
|
+
return It[n] || (It[n] = new e(t), It[n]._cacheKey = n), It[n];
|
|
1338
1338
|
}
|
|
1339
|
-
},
|
|
1339
|
+
}, zt = {
|
|
1340
1340
|
uint8x2: {
|
|
1341
1341
|
size: 2,
|
|
1342
1342
|
stride: 2,
|
|
@@ -1488,18 +1488,18 @@ var Ft = Object.create(null), It = {
|
|
|
1488
1488
|
normalized: !1
|
|
1489
1489
|
}
|
|
1490
1490
|
};
|
|
1491
|
-
function
|
|
1492
|
-
return
|
|
1491
|
+
function Bt(e) {
|
|
1492
|
+
return zt[e] ?? zt.float32;
|
|
1493
1493
|
}
|
|
1494
1494
|
//#endregion
|
|
1495
1495
|
//#region src/core/renderers/gl/shader/GlProgramData.ts
|
|
1496
|
-
var
|
|
1496
|
+
var Vt = class {
|
|
1497
1497
|
native;
|
|
1498
1498
|
uniformDirtyGroups = Object.create(null);
|
|
1499
1499
|
constructor(e) {
|
|
1500
1500
|
this.native = e;
|
|
1501
1501
|
}
|
|
1502
|
-
},
|
|
1502
|
+
}, Ht, Ut = {
|
|
1503
1503
|
FLOAT: "float",
|
|
1504
1504
|
FLOAT_VEC2: "vec2",
|
|
1505
1505
|
FLOAT_VEC3: "vec3",
|
|
@@ -1528,7 +1528,7 @@ var Bt = class {
|
|
|
1528
1528
|
SAMPLER_2D_ARRAY: "sampler2DArray",
|
|
1529
1529
|
INT_SAMPLER_2D_ARRAY: "sampler2DArray",
|
|
1530
1530
|
UNSIGNED_INT_SAMPLER_2D_ARRAY: "sampler2DArray"
|
|
1531
|
-
},
|
|
1531
|
+
}, Wt = {
|
|
1532
1532
|
float: "float32",
|
|
1533
1533
|
vec2: "float32x2",
|
|
1534
1534
|
vec3: "float32x3",
|
|
@@ -1546,29 +1546,29 @@ var Bt = class {
|
|
|
1546
1546
|
bvec3: "uint32x3",
|
|
1547
1547
|
bvec4: "uint32x4"
|
|
1548
1548
|
};
|
|
1549
|
-
function
|
|
1550
|
-
if (!
|
|
1551
|
-
let t = Object.keys(
|
|
1552
|
-
|
|
1549
|
+
function Gt(e, t) {
|
|
1550
|
+
if (!Ht) {
|
|
1551
|
+
let t = Object.keys(Ut);
|
|
1552
|
+
Ht = {};
|
|
1553
1553
|
for (let n = 0; n < t.length; ++n) {
|
|
1554
1554
|
let r = t[n];
|
|
1555
|
-
|
|
1555
|
+
Ht[e[r]] = Ut[r];
|
|
1556
1556
|
}
|
|
1557
1557
|
}
|
|
1558
|
-
return
|
|
1558
|
+
return Ht[t];
|
|
1559
1559
|
}
|
|
1560
|
-
function
|
|
1561
|
-
return
|
|
1560
|
+
function Kt(e, t) {
|
|
1561
|
+
return Wt[Gt(e, t)] || "float32";
|
|
1562
1562
|
}
|
|
1563
1563
|
//#endregion
|
|
1564
1564
|
//#region src/core/renderers/gl/shader/GlShaderSystem.ts
|
|
1565
|
-
var
|
|
1565
|
+
var qt = class extends A {
|
|
1566
1566
|
install(e) {
|
|
1567
1567
|
super.install(e), e.shader = this;
|
|
1568
1568
|
}
|
|
1569
1569
|
glProgramDatas = /* @__PURE__ */ new Map();
|
|
1570
1570
|
currentProgram = null;
|
|
1571
|
-
globalUniforms = new
|
|
1571
|
+
globalUniforms = new St({
|
|
1572
1572
|
projectionMatrix: new Float32Array([
|
|
1573
1573
|
1,
|
|
1574
1574
|
0,
|
|
@@ -1609,7 +1609,7 @@ var Kt = class extends j {
|
|
|
1609
1609
|
return this.glProgramDatas.get(e.id) || this._createGlProgramData(e);
|
|
1610
1610
|
}
|
|
1611
1611
|
_createGlProgramData(e) {
|
|
1612
|
-
let t = this._gl, n = new
|
|
1612
|
+
let t = this._gl, n = new Vt(t.createProgram());
|
|
1613
1613
|
this.glProgramDatas.set(e.id, n), this.useProgram(e);
|
|
1614
1614
|
let r = this._createGlShader(e.vertex, t.VERTEX_SHADER), i = this._createGlShader(e.fragment, t.FRAGMENT_SHADER);
|
|
1615
1615
|
if (t.attachShader(n.native, r), t.attachShader(n.native, i), t.linkProgram(n.native), !t.getProgramParameter(n.native, t.LINK_STATUS)) throw Error(`Failed to link program: ${t.getProgramInfoLog(n.native)}`);
|
|
@@ -1617,11 +1617,11 @@ var Kt = class extends j {
|
|
|
1617
1617
|
for (let e = t.getProgramParameter(n.native, t.ACTIVE_ATTRIBUTES), r = 0; r < e; r++) {
|
|
1618
1618
|
let e = t.getActiveAttrib(n.native, r);
|
|
1619
1619
|
if (!e || e.name.startsWith("gl_")) continue;
|
|
1620
|
-
let i =
|
|
1620
|
+
let i = Kt(t, e.type);
|
|
1621
1621
|
a[e.name] = {
|
|
1622
1622
|
location: 0,
|
|
1623
1623
|
format: i,
|
|
1624
|
-
stride:
|
|
1624
|
+
stride: Bt(i).stride,
|
|
1625
1625
|
offset: 0,
|
|
1626
1626
|
instance: !1,
|
|
1627
1627
|
start: 0
|
|
@@ -1638,7 +1638,7 @@ var Kt = class extends j {
|
|
|
1638
1638
|
for (let e = t.getProgramParameter(n.native, t.ACTIVE_UNIFORMS), r = 0; r < e; r++) {
|
|
1639
1639
|
let e = t.getActiveUniform(n.native, r);
|
|
1640
1640
|
if (!e) continue;
|
|
1641
|
-
let i = e.name.replace(/\[.*?\]$/, ""), a =
|
|
1641
|
+
let i = e.name.replace(/\[.*?\]$/, ""), a = Gt(t, e.type), o = e.size;
|
|
1642
1642
|
c[i] = {
|
|
1643
1643
|
name: i,
|
|
1644
1644
|
index: r,
|
|
@@ -1673,7 +1673,7 @@ var Kt = class extends j {
|
|
|
1673
1673
|
let { type: s, isArray: c, name: l } = o;
|
|
1674
1674
|
o.location === void 0 && (o.location = r.getUniformLocation(t.native, l));
|
|
1675
1675
|
let u = o.location;
|
|
1676
|
-
if (
|
|
1676
|
+
if (Jt(o.value, a)) switch (o.value = Yt(o.value, a), s) {
|
|
1677
1677
|
case "float":
|
|
1678
1678
|
c ? r.uniform1fv(u, a) : r.uniform1f(u, a);
|
|
1679
1679
|
break;
|
|
@@ -1760,7 +1760,7 @@ var Kt = class extends j {
|
|
|
1760
1760
|
super.destroy(), this.bind(null);
|
|
1761
1761
|
}
|
|
1762
1762
|
};
|
|
1763
|
-
function
|
|
1763
|
+
function Jt(e, t) {
|
|
1764
1764
|
if (typeof t == "object" && t) {
|
|
1765
1765
|
let n = t.length;
|
|
1766
1766
|
if (typeof e != "object" || !e || e.length !== n) return !0;
|
|
@@ -1769,7 +1769,7 @@ function qt(e, t) {
|
|
|
1769
1769
|
}
|
|
1770
1770
|
return e !== t;
|
|
1771
1771
|
}
|
|
1772
|
-
function
|
|
1772
|
+
function Yt(e, t) {
|
|
1773
1773
|
if (typeof t == "object" && t) {
|
|
1774
1774
|
let n = t.length;
|
|
1775
1775
|
if (typeof e == "object" && e && e.length === n) {
|
|
@@ -1782,10 +1782,10 @@ function Jt(e, t) {
|
|
|
1782
1782
|
}
|
|
1783
1783
|
//#endregion
|
|
1784
1784
|
//#region src/core/renderers/gl/state/GlBlendMode.ts
|
|
1785
|
-
var
|
|
1785
|
+
var Xt = /* @__PURE__ */ function(e) {
|
|
1786
1786
|
return e.normal = "normal", e.add = "add", e.multiply = "multiply", e.screen = "screen", e.none = "none", e.normalNpm = "normalNpm", e.addNpm = "add_npm", e.screenNpm = "screenNpm", e.srcIn = "srcIn", e.srcOut = "srcOut", e.srcAtop = "srcAtop", e.dstOver = "dstOver", e.dstIn = "dstIn", e.dstOut = "dstOut", e.dstAtop = "dstAtop", e.xor = "xor", e.subtract = "subtract", e;
|
|
1787
1787
|
}({});
|
|
1788
|
-
function
|
|
1788
|
+
function Zt(e) {
|
|
1789
1789
|
return {
|
|
1790
1790
|
normal: [e.ONE, e.ONE_MINUS_SRC_ALPHA],
|
|
1791
1791
|
add: [e.ONE, e.ONE],
|
|
@@ -1840,7 +1840,7 @@ function Xt(e) {
|
|
|
1840
1840
|
}
|
|
1841
1841
|
//#endregion
|
|
1842
1842
|
//#region src/core/renderers/gl/state/GlStateSystem.ts
|
|
1843
|
-
var
|
|
1843
|
+
var Qt = class e {
|
|
1844
1844
|
static _properties = [
|
|
1845
1845
|
"blend",
|
|
1846
1846
|
"offsets",
|
|
@@ -1867,14 +1867,14 @@ var Zt = class e {
|
|
|
1867
1867
|
let t = new e();
|
|
1868
1868
|
return t.depthTest = !1, t.blend = !0, t;
|
|
1869
1869
|
}
|
|
1870
|
-
_blendMode =
|
|
1870
|
+
_blendMode = Xt.normal;
|
|
1871
1871
|
_polygonOffset = 0;
|
|
1872
1872
|
bitmap = 0;
|
|
1873
1873
|
get blendMode() {
|
|
1874
1874
|
return this._blendMode;
|
|
1875
1875
|
}
|
|
1876
1876
|
set blendMode(e) {
|
|
1877
|
-
this.blend = e !==
|
|
1877
|
+
this.blend = e !== Xt.none, this._blendMode = e;
|
|
1878
1878
|
}
|
|
1879
1879
|
get polygonOffset() {
|
|
1880
1880
|
return this._polygonOffset;
|
|
@@ -1886,19 +1886,19 @@ var Zt = class e {
|
|
|
1886
1886
|
if (e) for (let t in e) this[t] = e[t];
|
|
1887
1887
|
}
|
|
1888
1888
|
};
|
|
1889
|
-
|
|
1890
|
-
var
|
|
1889
|
+
Qt._init();
|
|
1890
|
+
var $t = class extends A {
|
|
1891
1891
|
install(e) {
|
|
1892
1892
|
super.install(e), e.state = this;
|
|
1893
1893
|
}
|
|
1894
1894
|
_blendEq = !1;
|
|
1895
|
-
_setters =
|
|
1895
|
+
_setters = Qt._properties.map((e) => this[`set${e.replace(/^\S/, (e) => e.toUpperCase())}`]);
|
|
1896
1896
|
boundStateBitmap = 0;
|
|
1897
1897
|
boundBlendMode;
|
|
1898
1898
|
blendModes;
|
|
1899
|
-
defaultState = new
|
|
1899
|
+
defaultState = new Qt({ blend: !0 });
|
|
1900
1900
|
_updateContext(e) {
|
|
1901
|
-
super._updateContext(e), this.blendModes =
|
|
1901
|
+
super._updateContext(e), this.blendModes = Zt(e);
|
|
1902
1902
|
}
|
|
1903
1903
|
toggle(e, t) {
|
|
1904
1904
|
this._renderer.gl[t ? "enable" : "disable"](e);
|
|
@@ -1941,14 +1941,14 @@ var Qt = class extends j {
|
|
|
1941
1941
|
}
|
|
1942
1942
|
reset() {
|
|
1943
1943
|
super.reset();
|
|
1944
|
-
let e = (1 <<
|
|
1944
|
+
let e = (1 << Qt._properties.length) - 1;
|
|
1945
1945
|
this.boundStateBitmap = ~this.defaultState.bitmap & e, this.boundBlendMode = void 0, this._blendEq = !0, this.bind(this.defaultState);
|
|
1946
1946
|
}
|
|
1947
|
-
},
|
|
1947
|
+
}, en = class extends A {
|
|
1948
1948
|
install(e) {
|
|
1949
1949
|
super.install(e), e.batch2D = this;
|
|
1950
1950
|
}
|
|
1951
|
-
_state =
|
|
1951
|
+
_state = Qt.for2D();
|
|
1952
1952
|
_batchSize = 4096 * 4;
|
|
1953
1953
|
_batchables = [];
|
|
1954
1954
|
_vertexCount = 0;
|
|
@@ -1969,8 +1969,8 @@ var Qt = class extends j {
|
|
|
1969
1969
|
}
|
|
1970
1970
|
_createShader(e) {
|
|
1971
1971
|
let t = this._renderer, n = {
|
|
1972
|
-
instanceId:
|
|
1973
|
-
glProgram: new
|
|
1972
|
+
instanceId: et(),
|
|
1973
|
+
glProgram: new Rt({
|
|
1974
1974
|
vertex: "precision highp float;\nin vec2 aPosition;\nin vec2 aUv;\nin vec4 aTextureParams;\nin vec4 aModulate;\n\nuniform vec2 size;\nuniform mat3 projectionMatrix;\nuniform mat3 viewMatrix;\n\nout float vTextureId;\nout float vClipOutsideUv;\nout vec2 vUv;\nout vec4 vModulate;\n\nvec2 roundPixels(vec2 position, vec2 targetSize) {\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n}\n\nvoid main(void) {\n mat3 modelMatrix = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n mat3 modelViewProjectionMatrix = projectionMatrix * viewMatrix * modelMatrix;\n gl_Position = vec4((modelViewProjectionMatrix * vec3(aPosition, 1.0)).xy, 0.0, 1.0);\n vTextureId = aTextureParams.x;\n vClipOutsideUv = aTextureParams.y;\n if (aTextureParams.z == 1.) {\n gl_Position.xy = roundPixels(gl_Position.xy, size);\n }\n vUv = aUv;\n vModulate = aModulate;\n}",
|
|
1975
1975
|
fragment: `precision highp float;
|
|
1976
1976
|
in float vTextureId;
|
|
@@ -1999,15 +1999,15 @@ void main(void) {
|
|
|
1999
1999
|
}`
|
|
2000
2000
|
})
|
|
2001
2001
|
}, r = {
|
|
2002
|
-
instanceId:
|
|
2003
|
-
usage:
|
|
2002
|
+
instanceId: et(),
|
|
2003
|
+
usage: k.vertex,
|
|
2004
2004
|
data: new Float32Array()
|
|
2005
2005
|
}, i = {
|
|
2006
|
-
instanceId:
|
|
2007
|
-
usage:
|
|
2006
|
+
instanceId: et(),
|
|
2007
|
+
usage: k.index,
|
|
2008
2008
|
data: new Uint32Array()
|
|
2009
2009
|
}, a = {
|
|
2010
|
-
instanceId:
|
|
2010
|
+
instanceId: et(),
|
|
2011
2011
|
topology: "triangle-list",
|
|
2012
2012
|
attributes: Object.fromEntries(Object.entries(this._attributes).map(([e, t]) => [e, {
|
|
2013
2013
|
...t,
|
|
@@ -2047,7 +2047,7 @@ void main(void) {
|
|
|
2047
2047
|
let { indices: r, vertices: p, uvs: h = new Float32Array(), size: g = {
|
|
2048
2048
|
width: 0,
|
|
2049
2049
|
height: 0
|
|
2050
|
-
}, texture: ee, blendMode: te =
|
|
2050
|
+
}, texture: ee, blendMode: te = Xt.normal, clipOutsideUv: ne, roundPixels: re, modulate: ie = [
|
|
2051
2051
|
255,
|
|
2052
2052
|
255,
|
|
2053
2053
|
255,
|
|
@@ -2077,22 +2077,22 @@ void main(void) {
|
|
|
2077
2077
|
}
|
|
2078
2078
|
}
|
|
2079
2079
|
_getBufferData(e) {
|
|
2080
|
-
let t =
|
|
2080
|
+
let t = tn(Math.ceil(e / 8)), n = nn(t), r = t * 8;
|
|
2081
2081
|
this._attributeBuffer.length <= n && (this._attributeBuffer.length = n + 1);
|
|
2082
2082
|
let i = this._attributeBuffer[n];
|
|
2083
2083
|
return i || (this._attributeBuffer[n] = i = /* @__PURE__ */ new ArrayBuffer(r * this._vertexSize * 4)), i;
|
|
2084
2084
|
}
|
|
2085
2085
|
_getIndexBufferData(e) {
|
|
2086
|
-
let t =
|
|
2086
|
+
let t = tn(Math.ceil(e / 12)), n = nn(t), r = t * 12;
|
|
2087
2087
|
this._indexBuffers.length <= n && (this._indexBuffers.length = n + 1);
|
|
2088
2088
|
let i = this._indexBuffers[n];
|
|
2089
2089
|
return i || (this._indexBuffers[n] = i = new Uint32Array(r)), i;
|
|
2090
2090
|
}
|
|
2091
2091
|
};
|
|
2092
|
-
function
|
|
2092
|
+
function tn(e) {
|
|
2093
2093
|
return e += +(e === 0), --e, e |= e >>> 1, e |= e >>> 2, e |= e >>> 4, e |= e >>> 8, e |= e >>> 16, e + 1;
|
|
2094
2094
|
}
|
|
2095
|
-
function
|
|
2095
|
+
function nn(e) {
|
|
2096
2096
|
let t = (e > 65535) << 4;
|
|
2097
2097
|
e >>>= t;
|
|
2098
2098
|
let n = (e > 255) << 3;
|
|
@@ -2100,11 +2100,11 @@ function tn(e) {
|
|
|
2100
2100
|
}
|
|
2101
2101
|
//#endregion
|
|
2102
2102
|
//#region src/core/renderers/gl/const.ts
|
|
2103
|
-
var
|
|
2103
|
+
var j = /* @__PURE__ */ function(e) {
|
|
2104
2104
|
return e[e.disabled = 0] = "disabled", e[e.renderingMaskAdd = 1] = "renderingMaskAdd", e[e.maskActive = 2] = "maskActive", e[e.inverseMaskActive = 3] = "inverseMaskActive", e[e.renderingMaskRemove = 4] = "renderingMaskRemove", e[e.none = 5] = "none", e;
|
|
2105
|
-
}({}),
|
|
2105
|
+
}({}), rn = /* @__PURE__ */ function(e) {
|
|
2106
2106
|
return e[e.none = 0] = "none", e[e.color = 16384] = "color", e[e.stencil = 1024] = "stencil", e[e.depth = 256] = "depth", e[e.colorDepth = 16640] = "colorDepth", e[e.colorStencil = 17408] = "colorStencil", e[e.depthStencil = 1280] = "depthStencil", e[e.all = 17664] = "all", e;
|
|
2107
|
-
}({}),
|
|
2107
|
+
}({}), an = class extends A {
|
|
2108
2108
|
install(e) {
|
|
2109
2109
|
super.install(e), e.mask = this;
|
|
2110
2110
|
}
|
|
@@ -2123,16 +2123,16 @@ var M = /* @__PURE__ */ function(e) {
|
|
|
2123
2123
|
};
|
|
2124
2124
|
this.stack.push(n);
|
|
2125
2125
|
let r = this._renderer.renderTarget.current?.instanceId ?? -1, i = this._maskStackHash[r] ?? 0;
|
|
2126
|
-
"x" in t ? this._renderer.scissor.push(t) : "render" in t && (this._renderer.flush(), this._renderer.renderTarget.ensureDepthStencil(), this._renderer.stencil.bind(
|
|
2126
|
+
"x" in t ? this._renderer.scissor.push(t) : "render" in t && (this._renderer.flush(), this._renderer.renderTarget.ensureDepthStencil(), this._renderer.stencil.bind(j.renderingMaskAdd, i), this._renderer.colorMask.bind(0), i++, t.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(j.maskActive, i), this._renderer.colorMask.bind(15)), this._maskStackHash[r] = i;
|
|
2127
2127
|
}
|
|
2128
2128
|
pop(e) {
|
|
2129
2129
|
let t = this.stack.pop();
|
|
2130
2130
|
if (!t || t.source !== e) return;
|
|
2131
2131
|
let { mask: n } = t, r = this._renderer.renderTarget.current?.instanceId ?? -1, i = this._maskStackHash[r] ?? 0;
|
|
2132
|
-
"x" in n ? this._renderer.scissor.pop() : "render" in n && (this._renderer.flush(), i === 0 ? (this._renderer.clear(
|
|
2132
|
+
"x" in n ? this._renderer.scissor.pop() : "render" in n && (this._renderer.flush(), i === 0 ? (this._renderer.clear(rn.stencil), this._renderer.stencil.bind(j.disabled, i)) : this._renderer.stencil.bind(j.renderingMaskRemove, i), i--, n.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(j.maskActive, i), this._renderer.colorMask.bind(15)), this._maskStackHash[r] = i;
|
|
2133
2133
|
}
|
|
2134
|
-
},
|
|
2135
|
-
|
|
2134
|
+
}, on = [];
|
|
2135
|
+
on[j.none] = {}, on[j.disabled] = {}, on[j.renderingMaskAdd] = {
|
|
2136
2136
|
stencilFront: {
|
|
2137
2137
|
compare: "equal",
|
|
2138
2138
|
passOp: "increment-clamp"
|
|
@@ -2141,7 +2141,7 @@ an[M.none] = {}, an[M.disabled] = {}, an[M.renderingMaskAdd] = {
|
|
|
2141
2141
|
compare: "equal",
|
|
2142
2142
|
passOp: "increment-clamp"
|
|
2143
2143
|
}
|
|
2144
|
-
},
|
|
2144
|
+
}, on[j.renderingMaskRemove] = {
|
|
2145
2145
|
stencilFront: {
|
|
2146
2146
|
compare: "equal",
|
|
2147
2147
|
passOp: "decrement-clamp"
|
|
@@ -2150,7 +2150,7 @@ an[M.none] = {}, an[M.disabled] = {}, an[M.renderingMaskAdd] = {
|
|
|
2150
2150
|
compare: "equal",
|
|
2151
2151
|
passOp: "decrement-clamp"
|
|
2152
2152
|
}
|
|
2153
|
-
},
|
|
2153
|
+
}, on[j.maskActive] = {
|
|
2154
2154
|
stencilFront: {
|
|
2155
2155
|
compare: "equal",
|
|
2156
2156
|
passOp: "keep"
|
|
@@ -2159,7 +2159,7 @@ an[M.none] = {}, an[M.disabled] = {}, an[M.renderingMaskAdd] = {
|
|
|
2159
2159
|
compare: "equal",
|
|
2160
2160
|
passOp: "keep"
|
|
2161
2161
|
}
|
|
2162
|
-
},
|
|
2162
|
+
}, on[j.inverseMaskActive] = {
|
|
2163
2163
|
stencilFront: {
|
|
2164
2164
|
compare: "not-equal",
|
|
2165
2165
|
passOp: "keep"
|
|
@@ -2169,17 +2169,17 @@ an[M.none] = {}, an[M.disabled] = {}, an[M.renderingMaskAdd] = {
|
|
|
2169
2169
|
passOp: "keep"
|
|
2170
2170
|
}
|
|
2171
2171
|
};
|
|
2172
|
-
var
|
|
2172
|
+
var sn = class extends A {
|
|
2173
2173
|
install(e) {
|
|
2174
2174
|
super.install(e), e.stencil = this;
|
|
2175
2175
|
}
|
|
2176
2176
|
_cache = {
|
|
2177
2177
|
enabled: !1,
|
|
2178
|
-
stencilMode:
|
|
2178
|
+
stencilMode: j.none,
|
|
2179
2179
|
refCount: 0
|
|
2180
2180
|
};
|
|
2181
2181
|
current = { [-1]: {
|
|
2182
|
-
stencilMode:
|
|
2182
|
+
stencilMode: j.disabled,
|
|
2183
2183
|
refCount: 0
|
|
2184
2184
|
} };
|
|
2185
2185
|
_passOpMap;
|
|
@@ -2209,20 +2209,20 @@ var on = class extends j {
|
|
|
2209
2209
|
super._setup(), this._renderer.renderTarget.on("updateRenderTarget", this._updateRenderTarget);
|
|
2210
2210
|
}
|
|
2211
2211
|
reset() {
|
|
2212
|
-
this._cache.enabled = !1, this._cache.stencilMode =
|
|
2212
|
+
this._cache.enabled = !1, this._cache.stencilMode = j.none, this._cache.refCount = 0;
|
|
2213
2213
|
}
|
|
2214
2214
|
_updateRenderTarget = (e) => {
|
|
2215
2215
|
if (e) {
|
|
2216
2216
|
let t = this.current[e.instanceId];
|
|
2217
2217
|
t ||= this.current[e.instanceId] = {
|
|
2218
|
-
stencilMode:
|
|
2218
|
+
stencilMode: j.disabled,
|
|
2219
2219
|
refCount: 0
|
|
2220
2220
|
}, this.bind(t.stencilMode, t.refCount);
|
|
2221
2221
|
}
|
|
2222
2222
|
};
|
|
2223
2223
|
bind(e, t) {
|
|
2224
|
-
let n = this.current[this._renderer.renderTarget.current?.instanceId ?? -1], r = this._gl, i =
|
|
2225
|
-
if (n.stencilMode = e, n.refCount = t, e ===
|
|
2224
|
+
let n = this.current[this._renderer.renderTarget.current?.instanceId ?? -1], r = this._gl, i = on[e], a = this._cache;
|
|
2225
|
+
if (n.stencilMode = e, n.refCount = t, e === j.disabled) {
|
|
2226
2226
|
this._cache.enabled && (this._cache.enabled = !1, r.disable(r.STENCIL_TEST));
|
|
2227
2227
|
return;
|
|
2228
2228
|
}
|
|
@@ -2231,8 +2231,8 @@ var on = class extends j {
|
|
|
2231
2231
|
destroy() {
|
|
2232
2232
|
super.destroy(), this._renderer.renderTarget.off("updateRenderTarget", this._updateRenderTarget);
|
|
2233
2233
|
}
|
|
2234
|
-
},
|
|
2235
|
-
current = new
|
|
2234
|
+
}, cn = class extends A {
|
|
2235
|
+
current = new lt(0, 0, 0, 0);
|
|
2236
2236
|
install(e) {
|
|
2237
2237
|
super.install(e), e.viewport = this;
|
|
2238
2238
|
}
|
|
@@ -2240,7 +2240,7 @@ var on = class extends j {
|
|
|
2240
2240
|
let t = this.current, n = Math.floor(e.x), r = Math.floor(e.y), i = Math.floor(e.width), a = Math.floor(e.height);
|
|
2241
2241
|
t.x === n && t.y === r && t.width === i && t.height === a || (this._gl.viewport(n, r, i, a), t.x = n, t.y = r, t.width = i, t.height = a);
|
|
2242
2242
|
}
|
|
2243
|
-
},
|
|
2243
|
+
}, ln = class {
|
|
2244
2244
|
framebuffer;
|
|
2245
2245
|
width = -1;
|
|
2246
2246
|
height = -1;
|
|
@@ -2251,7 +2251,7 @@ var on = class extends j {
|
|
|
2251
2251
|
constructor(e) {
|
|
2252
2252
|
this.framebuffer = e;
|
|
2253
2253
|
}
|
|
2254
|
-
},
|
|
2254
|
+
}, un = class extends A {
|
|
2255
2255
|
install(e) {
|
|
2256
2256
|
super.install(e), e.renderTarget = this;
|
|
2257
2257
|
}
|
|
@@ -2261,7 +2261,7 @@ var on = class extends j {
|
|
|
2261
2261
|
_msaaSamples = [];
|
|
2262
2262
|
_hasMRT = !0;
|
|
2263
2263
|
_writeDepthTexture = !0;
|
|
2264
|
-
projection = new
|
|
2264
|
+
projection = new ht();
|
|
2265
2265
|
_updateContext(e) {
|
|
2266
2266
|
if (super._updateContext(e), this._hasMRT = !0, this._writeDepthTexture = !0, this._renderer.version === 1) {
|
|
2267
2267
|
let t = this._renderer.extensions.drawBuffers, n = this._renderer.extensions.depthTexture;
|
|
@@ -2297,7 +2297,7 @@ var on = class extends j {
|
|
|
2297
2297
|
return this.glRenderTargets.get(e.instanceId) || this._createGlRenderTarget(e);
|
|
2298
2298
|
}
|
|
2299
2299
|
_createGlRenderTarget(e) {
|
|
2300
|
-
let t = this._gl, n = new
|
|
2300
|
+
let t = this._gl, n = new ln(t.createFramebuffer());
|
|
2301
2301
|
return this.glRenderTargets.set(e.instanceId, n), this.renderTargets.get(e.instanceId) || (this.renderTargets.set(e.instanceId, e), this._update(e, n), "on" in e && (e.on("updateProperty", (t) => {
|
|
2302
2302
|
switch (t) {
|
|
2303
2303
|
case "width":
|
|
@@ -2374,28 +2374,28 @@ var on = class extends j {
|
|
|
2374
2374
|
reset() {
|
|
2375
2375
|
super.reset(), this._renderer.contextLost || this.glRenderTargets.forEach((e) => this.destroyGpuRenderTarget(e)), this.renderTargets.clear(), this.glRenderTargets.clear(), this.current = null, this._msaaSamples.length = 0;
|
|
2376
2376
|
}
|
|
2377
|
-
},
|
|
2377
|
+
}, dn = /* @__PURE__ */ function(e) {
|
|
2378
2378
|
return e[e.RGBA = 6408] = "RGBA", e[e.RGB = 6407] = "RGB", e[e.RG = 33319] = "RG", e[e.RED = 6403] = "RED", e[e.RGBA_INTEGER = 36249] = "RGBA_INTEGER", e[e.RGB_INTEGER = 36248] = "RGB_INTEGER", e[e.RG_INTEGER = 33320] = "RG_INTEGER", e[e.RED_INTEGER = 36244] = "RED_INTEGER", e[e.ALPHA = 6406] = "ALPHA", e[e.LUMINANCE = 6409] = "LUMINANCE", e[e.LUMINANCE_ALPHA = 6410] = "LUMINANCE_ALPHA", e[e.DEPTH_COMPONENT = 6402] = "DEPTH_COMPONENT", e[e.DEPTH_STENCIL = 34041] = "DEPTH_STENCIL", e;
|
|
2379
|
-
}({}),
|
|
2379
|
+
}({}), fn = /* @__PURE__ */ function(e) {
|
|
2380
2380
|
return e[e.TEXTURE_2D = 3553] = "TEXTURE_2D", e[e.TEXTURE_CUBE_MAP = 34067] = "TEXTURE_CUBE_MAP", e[e.TEXTURE_2D_ARRAY = 35866] = "TEXTURE_2D_ARRAY", e[e.TEXTURE_CUBE_MAP_POSITIVE_X = 34069] = "TEXTURE_CUBE_MAP_POSITIVE_X", e[e.TEXTURE_CUBE_MAP_NEGATIVE_X = 34070] = "TEXTURE_CUBE_MAP_NEGATIVE_X", e[e.TEXTURE_CUBE_MAP_POSITIVE_Y = 34071] = "TEXTURE_CUBE_MAP_POSITIVE_Y", e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072] = "TEXTURE_CUBE_MAP_NEGATIVE_Y", e[e.TEXTURE_CUBE_MAP_POSITIVE_Z = 34073] = "TEXTURE_CUBE_MAP_POSITIVE_Z", e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074] = "TEXTURE_CUBE_MAP_NEGATIVE_Z", e;
|
|
2381
|
-
}({}),
|
|
2381
|
+
}({}), M = /* @__PURE__ */ function(e) {
|
|
2382
2382
|
return e[e.UNSIGNED_BYTE = 5121] = "UNSIGNED_BYTE", e[e.UNSIGNED_SHORT = 5123] = "UNSIGNED_SHORT", e[e.UNSIGNED_SHORT_5_6_5 = 33635] = "UNSIGNED_SHORT_5_6_5", e[e.UNSIGNED_SHORT_4_4_4_4 = 32819] = "UNSIGNED_SHORT_4_4_4_4", e[e.UNSIGNED_SHORT_5_5_5_1 = 32820] = "UNSIGNED_SHORT_5_5_5_1", e[e.UNSIGNED_INT = 5125] = "UNSIGNED_INT", e[e.UNSIGNED_INT_10F_11F_11F_REV = 35899] = "UNSIGNED_INT_10F_11F_11F_REV", e[e.UNSIGNED_INT_2_10_10_10_REV = 33640] = "UNSIGNED_INT_2_10_10_10_REV", e[e.UNSIGNED_INT_24_8 = 34042] = "UNSIGNED_INT_24_8", e[e.UNSIGNED_INT_5_9_9_9_REV = 35902] = "UNSIGNED_INT_5_9_9_9_REV", e[e.BYTE = 5120] = "BYTE", e[e.SHORT = 5122] = "SHORT", e[e.INT = 5124] = "INT", e[e.FLOAT = 5126] = "FLOAT", e[e.FLOAT_32_UNSIGNED_INT_24_8_REV = 36269] = "FLOAT_32_UNSIGNED_INT_24_8_REV", e[e.HALF_FLOAT = 36193] = "HALF_FLOAT", e;
|
|
2383
|
-
}({}),
|
|
2383
|
+
}({}), pn = class {
|
|
2384
2384
|
native;
|
|
2385
|
-
target =
|
|
2385
|
+
target = fn.TEXTURE_2D;
|
|
2386
2386
|
width = -1;
|
|
2387
2387
|
height = -1;
|
|
2388
2388
|
mipmap = !1;
|
|
2389
|
-
type =
|
|
2390
|
-
internalFormat =
|
|
2391
|
-
format =
|
|
2389
|
+
type = M.UNSIGNED_BYTE;
|
|
2390
|
+
internalFormat = dn.RGBA;
|
|
2391
|
+
format = dn.RGBA;
|
|
2392
2392
|
constructor(e) {
|
|
2393
2393
|
this.native = e;
|
|
2394
2394
|
}
|
|
2395
2395
|
};
|
|
2396
2396
|
//#endregion
|
|
2397
2397
|
//#region src/core/renderers/gl/texture/mapFormatToGlFormat.ts
|
|
2398
|
-
function
|
|
2398
|
+
function mn(e) {
|
|
2399
2399
|
return {
|
|
2400
2400
|
r8unorm: e.RED,
|
|
2401
2401
|
r8snorm: e.RED,
|
|
@@ -2443,7 +2443,7 @@ function pn(e) {
|
|
|
2443
2443
|
}
|
|
2444
2444
|
//#endregion
|
|
2445
2445
|
//#region src/core/renderers/gl/texture/mapFormatToGlInternalFormat.ts
|
|
2446
|
-
function
|
|
2446
|
+
function hn(e, t) {
|
|
2447
2447
|
let n = {}, r = e.RGBA;
|
|
2448
2448
|
return e instanceof WebGLRenderingContext ? t.srgb && (n = {
|
|
2449
2449
|
"rgba8unorm-srgb": t.srgb.SRGB8_ALPHA8_EXT,
|
|
@@ -2559,7 +2559,7 @@ function mn(e, t) {
|
|
|
2559
2559
|
}
|
|
2560
2560
|
//#endregion
|
|
2561
2561
|
//#region src/core/renderers/gl/texture/mapFormatToGlType.ts
|
|
2562
|
-
function
|
|
2562
|
+
function gn(e) {
|
|
2563
2563
|
return {
|
|
2564
2564
|
r8unorm: e.UNSIGNED_BYTE,
|
|
2565
2565
|
r8snorm: e.BYTE,
|
|
@@ -2607,7 +2607,7 @@ function hn(e) {
|
|
|
2607
2607
|
}
|
|
2608
2608
|
//#endregion
|
|
2609
2609
|
//#region src/core/renderers/gl/texture/updateTextureStyle.ts
|
|
2610
|
-
var
|
|
2610
|
+
var _n = {
|
|
2611
2611
|
linear: {
|
|
2612
2612
|
linear: 9987,
|
|
2613
2613
|
nearest: 9985
|
|
@@ -2616,10 +2616,10 @@ var gn = {
|
|
|
2616
2616
|
linear: 9986,
|
|
2617
2617
|
nearest: 9984
|
|
2618
2618
|
}
|
|
2619
|
-
},
|
|
2619
|
+
}, vn = {
|
|
2620
2620
|
linear: 9729,
|
|
2621
2621
|
nearest: 9728
|
|
2622
|
-
},
|
|
2622
|
+
}, yn = {
|
|
2623
2623
|
never: 512,
|
|
2624
2624
|
less: 513,
|
|
2625
2625
|
equal: 514,
|
|
@@ -2628,32 +2628,32 @@ var gn = {
|
|
|
2628
2628
|
"not-equal": 517,
|
|
2629
2629
|
"greater-equal": 518,
|
|
2630
2630
|
always: 519
|
|
2631
|
-
},
|
|
2631
|
+
}, bn = {
|
|
2632
2632
|
"clamp-to-edge": 33071,
|
|
2633
2633
|
repeat: 10497,
|
|
2634
2634
|
"mirror-repeat": 33648
|
|
2635
2635
|
};
|
|
2636
|
-
function
|
|
2636
|
+
function xn(e, t, n, r, i, a, o, s) {
|
|
2637
2637
|
let { addressModeU: c = "repeat", addressModeV: l = "repeat", addressModeW: u = "repeat", magFilter: d = "linear", minFilter: f = "linear", mipmapFilter: p = "linear", maxAnisotropy: m = 0, compare: h } = e, g = a;
|
|
2638
2638
|
if (!s || c !== "repeat" || l !== "repeat" || u !== "repeat") {
|
|
2639
|
-
let e =
|
|
2639
|
+
let e = bn[o ? "clamp-to-edge" : c], n = bn[o ? "clamp-to-edge" : l], r = bn[o ? "clamp-to-edge" : u];
|
|
2640
2640
|
t[i](g, t.TEXTURE_WRAP_S, e), t[i](g, t.TEXTURE_WRAP_T, n), t.TEXTURE_WRAP_R && t[i](g, t.TEXTURE_WRAP_R, r);
|
|
2641
2641
|
}
|
|
2642
|
-
if ((!s || d !== "linear") && t[i](g, t.TEXTURE_MAG_FILTER,
|
|
2642
|
+
if ((!s || d !== "linear") && t[i](g, t.TEXTURE_MAG_FILTER, vn[d]), n) {
|
|
2643
2643
|
if (!s || p !== "linear") {
|
|
2644
|
-
let e =
|
|
2644
|
+
let e = _n[f][p];
|
|
2645
2645
|
t[i](g, t.TEXTURE_MIN_FILTER, e);
|
|
2646
2646
|
}
|
|
2647
|
-
} else t[i](g, t.TEXTURE_MIN_FILTER,
|
|
2647
|
+
} else t[i](g, t.TEXTURE_MIN_FILTER, vn[f]);
|
|
2648
2648
|
if (r && m > 1) {
|
|
2649
2649
|
let e = Math.min(m, t.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));
|
|
2650
2650
|
t[i](g, r.TEXTURE_MAX_ANISOTROPY_EXT, e);
|
|
2651
2651
|
}
|
|
2652
|
-
h && t[i](g, t.TEXTURE_COMPARE_FUNC,
|
|
2652
|
+
h && t[i](g, t.TEXTURE_COMPARE_FUNC, yn[h]);
|
|
2653
2653
|
}
|
|
2654
2654
|
//#endregion
|
|
2655
2655
|
//#region src/core/renderers/gl/texture/uploaders/index.ts
|
|
2656
|
-
var
|
|
2656
|
+
var Sn = {
|
|
2657
2657
|
buffer: {
|
|
2658
2658
|
id: "buffer",
|
|
2659
2659
|
upload: (e, t, n) => {
|
|
@@ -2667,8 +2667,8 @@ var xn = {
|
|
|
2667
2667
|
c < o || l < s ? ((i !== o || a !== s) && n.texImage2D(t.target, 0, t.internalFormat, o, s, 0, t.format, t.type, null), r === 2 ? n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, c, l, t.format, t.type, e.source) : n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, t.format, t.type, e.source)) : i === o && a === s ? n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, t.format, t.type, e.source) : r === 2 ? n.texImage2D(t.target, 0, t.internalFormat, o, s, 0, t.format, t.type, e.source) : n.texImage2D(t.target, 0, t.internalFormat, t.format, t.type, e.source), t.width = o, t.height = s;
|
|
2668
2668
|
}
|
|
2669
2669
|
}
|
|
2670
|
-
},
|
|
2671
|
-
uploaders = { ...
|
|
2670
|
+
}, Cn = class extends A {
|
|
2671
|
+
uploaders = { ...Sn };
|
|
2672
2672
|
textures = /* @__PURE__ */ new Map();
|
|
2673
2673
|
glTextures = /* @__PURE__ */ new Map();
|
|
2674
2674
|
_mapFormatToInternalFormat = Object.create(null);
|
|
@@ -2683,14 +2683,14 @@ var xn = {
|
|
|
2683
2683
|
super.install(e), e.texture = this;
|
|
2684
2684
|
}
|
|
2685
2685
|
_updateContext(e) {
|
|
2686
|
-
super._updateContext(e), Object.keys(this._mapFormatToInternalFormat).length || (this._mapFormatToInternalFormat =
|
|
2686
|
+
super._updateContext(e), Object.keys(this._mapFormatToInternalFormat).length || (this._mapFormatToInternalFormat = hn(e, this._renderer.extensions), this._mapFormatToType = gn(e), this._mapFormatToFormat = mn(e)), this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE), this.maxTextureImageUnits = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);
|
|
2687
2687
|
for (let e = 0; e < this.maxTextureImageUnits; e++) this.unbind(e);
|
|
2688
2688
|
}
|
|
2689
2689
|
getGlTexture(e) {
|
|
2690
2690
|
return this.glTextures.get(e.instanceId) || this._createGlTexture(e);
|
|
2691
2691
|
}
|
|
2692
2692
|
_createGlTexture(e) {
|
|
2693
|
-
let t = this._gl, n = new
|
|
2693
|
+
let t = this._gl, n = new pn(t.createTexture());
|
|
2694
2694
|
if (t.bindTexture(n.target, n.native), n.type = this._mapFormatToType[e.format], n.internalFormat = this._mapFormatToInternalFormat[e.format], n.format = this._mapFormatToFormat[e.format], this.glTextures.set(e.instanceId, n), e.mipmap && (this._renderer.supports.nonPowOf2mipmaps || e.isPowerOfTwo)) {
|
|
2695
2695
|
let t = Math.max(e.width, e.height);
|
|
2696
2696
|
e.mipLevelCount = Math.floor(Math.log2(t)) + 1;
|
|
@@ -2750,7 +2750,7 @@ var xn = {
|
|
|
2750
2750
|
}
|
|
2751
2751
|
updateStyle(e, t = !1) {
|
|
2752
2752
|
let n = this._gl;
|
|
2753
|
-
|
|
2753
|
+
xn(e, n, e.mipLevelCount > 1, this._renderer.extensions.anisotropicFiltering, "texParameteri", n.TEXTURE_2D, !this._renderer.supports.nonPowOf2wrapping && !e.isPowerOfTwo, t);
|
|
2754
2754
|
}
|
|
2755
2755
|
updateGpuTexture(e) {
|
|
2756
2756
|
this.bind(e);
|
|
@@ -2765,50 +2765,50 @@ var xn = {
|
|
|
2765
2765
|
let e = this._gl;
|
|
2766
2766
|
this._renderer.contextLost || this.glTextures.forEach((t) => e.deleteTexture(t.native)), this.textures.clear(), this.glTextures.clear(), this._location = 0, this.current.length = 0, this._premultiplyAlpha = !1, this._renderer.contextLost || e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this._premultiplyAlpha);
|
|
2767
2767
|
}
|
|
2768
|
-
},
|
|
2769
|
-
uint8x2:
|
|
2770
|
-
uint8x4:
|
|
2771
|
-
sint8x2:
|
|
2772
|
-
sint8x4:
|
|
2773
|
-
unorm8x2:
|
|
2774
|
-
unorm8x4:
|
|
2775
|
-
snorm8x2:
|
|
2776
|
-
snorm8x4:
|
|
2777
|
-
uint16x2:
|
|
2778
|
-
uint16x4:
|
|
2779
|
-
sint16x2:
|
|
2780
|
-
sint16x4:
|
|
2781
|
-
unorm16x2:
|
|
2782
|
-
unorm16x4:
|
|
2783
|
-
snorm16x2:
|
|
2784
|
-
snorm16x4:
|
|
2785
|
-
float16x2:
|
|
2786
|
-
float16x4:
|
|
2787
|
-
float32:
|
|
2788
|
-
float32x2:
|
|
2789
|
-
float32x3:
|
|
2790
|
-
float32x4:
|
|
2791
|
-
uint32:
|
|
2792
|
-
uint32x2:
|
|
2793
|
-
uint32x3:
|
|
2794
|
-
uint32x4:
|
|
2795
|
-
sint32:
|
|
2796
|
-
sint32x2:
|
|
2797
|
-
sint32x3:
|
|
2798
|
-
sint32x4:
|
|
2768
|
+
}, wn = {
|
|
2769
|
+
uint8x2: M.UNSIGNED_BYTE,
|
|
2770
|
+
uint8x4: M.UNSIGNED_BYTE,
|
|
2771
|
+
sint8x2: M.BYTE,
|
|
2772
|
+
sint8x4: M.BYTE,
|
|
2773
|
+
unorm8x2: M.UNSIGNED_BYTE,
|
|
2774
|
+
unorm8x4: M.UNSIGNED_BYTE,
|
|
2775
|
+
snorm8x2: M.BYTE,
|
|
2776
|
+
snorm8x4: M.BYTE,
|
|
2777
|
+
uint16x2: M.UNSIGNED_SHORT,
|
|
2778
|
+
uint16x4: M.UNSIGNED_SHORT,
|
|
2779
|
+
sint16x2: M.SHORT,
|
|
2780
|
+
sint16x4: M.SHORT,
|
|
2781
|
+
unorm16x2: M.UNSIGNED_SHORT,
|
|
2782
|
+
unorm16x4: M.UNSIGNED_SHORT,
|
|
2783
|
+
snorm16x2: M.SHORT,
|
|
2784
|
+
snorm16x4: M.SHORT,
|
|
2785
|
+
float16x2: M.HALF_FLOAT,
|
|
2786
|
+
float16x4: M.HALF_FLOAT,
|
|
2787
|
+
float32: M.FLOAT,
|
|
2788
|
+
float32x2: M.FLOAT,
|
|
2789
|
+
float32x3: M.FLOAT,
|
|
2790
|
+
float32x4: M.FLOAT,
|
|
2791
|
+
uint32: M.UNSIGNED_INT,
|
|
2792
|
+
uint32x2: M.UNSIGNED_INT,
|
|
2793
|
+
uint32x3: M.UNSIGNED_INT,
|
|
2794
|
+
uint32x4: M.UNSIGNED_INT,
|
|
2795
|
+
sint32: M.INT,
|
|
2796
|
+
sint32x2: M.INT,
|
|
2797
|
+
sint32x3: M.INT,
|
|
2798
|
+
sint32x4: M.INT
|
|
2799
2799
|
};
|
|
2800
|
-
function
|
|
2801
|
-
return
|
|
2800
|
+
function Tn(e) {
|
|
2801
|
+
return wn[e] ?? wn.float32;
|
|
2802
2802
|
}
|
|
2803
2803
|
//#endregion
|
|
2804
2804
|
//#region src/core/renderers/gl/geometry/GlGeometrySystem.ts
|
|
2805
|
-
var
|
|
2805
|
+
var En = {
|
|
2806
2806
|
"point-list": 0,
|
|
2807
2807
|
"line-list": 1,
|
|
2808
2808
|
"line-strip": 3,
|
|
2809
2809
|
"triangle-list": 4,
|
|
2810
2810
|
"triangle-strip": 5
|
|
2811
|
-
},
|
|
2811
|
+
}, Dn = class extends A {
|
|
2812
2812
|
_geometryVaoHash = {};
|
|
2813
2813
|
hasInstance = !1;
|
|
2814
2814
|
current = null;
|
|
@@ -2847,11 +2847,11 @@ var Tn = {
|
|
|
2847
2847
|
}
|
|
2848
2848
|
for (let e in r) {
|
|
2849
2849
|
let t = r[e];
|
|
2850
|
-
i[t.buffer.instanceId] +=
|
|
2850
|
+
i[t.buffer.instanceId] += Bt(t.format).stride;
|
|
2851
2851
|
}
|
|
2852
2852
|
for (let e in r) {
|
|
2853
2853
|
let t = r[e];
|
|
2854
|
-
t.stride ??= i[t.buffer.instanceId], t.start ??= a[t.buffer.instanceId], a[t.buffer.instanceId] +=
|
|
2854
|
+
t.stride ??= i[t.buffer.instanceId], t.start ??= a[t.buffer.instanceId], a[t.buffer.instanceId] += Bt(t.format).stride;
|
|
2855
2855
|
}
|
|
2856
2856
|
}
|
|
2857
2857
|
_createVao(e, t) {
|
|
@@ -2886,7 +2886,7 @@ var Tn = {
|
|
|
2886
2886
|
a !== c && (r.bind(s), a = c);
|
|
2887
2887
|
let e = l.location;
|
|
2888
2888
|
n.enableVertexAttribArray(e);
|
|
2889
|
-
let t =
|
|
2889
|
+
let t = Bt(o.format), i = Tn(o.format);
|
|
2890
2890
|
if (l.format?.substring(1, 4) === "int" ? n.vertexAttribIPointer(e, t.size, i, o.stride ?? 0, o.start ?? 0) : n.vertexAttribPointer(e, t.size, i, t.normalized, o.stride ?? 0, o.start ?? 0), o.instance) if (this.hasInstance) {
|
|
2891
2891
|
let t = o.divisor ?? 1;
|
|
2892
2892
|
n.vertexAttribDivisor(e, t);
|
|
@@ -2919,7 +2919,7 @@ var Tn = {
|
|
|
2919
2919
|
let { topology: t, size: n, start: r = 0, instanceCount: i } = e, { gl: a } = this._renderer, o = this.current;
|
|
2920
2920
|
if (!o) return this;
|
|
2921
2921
|
t = t || o.topology || "triangle-list";
|
|
2922
|
-
let s =
|
|
2922
|
+
let s = En[t];
|
|
2923
2923
|
if (i = i || o.instanceCount || 1, o.indexBuffer) {
|
|
2924
2924
|
n ||= o.indexBuffer.data.length;
|
|
2925
2925
|
let e = o.indexBuffer.data.BYTES_PER_ELEMENT, t = e === 2 ? a.UNSIGNED_SHORT : a.UNSIGNED_INT;
|
|
@@ -2940,7 +2940,7 @@ var Tn = {
|
|
|
2940
2940
|
}
|
|
2941
2941
|
this._geometryVaoHash = {}, this.current = null, this.currentVao = null;
|
|
2942
2942
|
}
|
|
2943
|
-
},
|
|
2943
|
+
}, On = class extends A {
|
|
2944
2944
|
install(e) {
|
|
2945
2945
|
super.install(e), e.colorMask = this;
|
|
2946
2946
|
}
|
|
@@ -2951,19 +2951,19 @@ var Tn = {
|
|
|
2951
2951
|
};
|
|
2952
2952
|
//#endregion
|
|
2953
2953
|
//#region src/core/renderers/gl/GlScissorSystem.ts
|
|
2954
|
-
function
|
|
2954
|
+
function kn(e, t, n) {
|
|
2955
2955
|
let [r, i, a, o, s, c, l, u, d] = e, f = r * t + o * n + l, p = i * t + s * n + u, m = a * t + c * n + d;
|
|
2956
2956
|
return {
|
|
2957
2957
|
x: f / m,
|
|
2958
2958
|
y: p / m
|
|
2959
2959
|
};
|
|
2960
2960
|
}
|
|
2961
|
-
function
|
|
2961
|
+
function An(e, t) {
|
|
2962
2962
|
let { x: n, y: r, width: i, height: a } = t, o = [
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2963
|
+
kn(e, n, r),
|
|
2964
|
+
kn(e, n + i, r),
|
|
2965
|
+
kn(e, n + i, r + a),
|
|
2966
|
+
kn(e, n, r + a)
|
|
2967
2967
|
], s = o.map((e) => e.x), c = o.map((e) => e.y), l = Math.min(...s), u = Math.max(...s), d = Math.min(...c), f = Math.max(...c);
|
|
2968
2968
|
return {
|
|
2969
2969
|
x: l,
|
|
@@ -2972,7 +2972,7 @@ function kn(e, t) {
|
|
|
2972
2972
|
height: f - d
|
|
2973
2973
|
};
|
|
2974
2974
|
}
|
|
2975
|
-
var
|
|
2975
|
+
var jn = class extends A {
|
|
2976
2976
|
install(e) {
|
|
2977
2977
|
super.install(e), e.scissor = this;
|
|
2978
2978
|
}
|
|
@@ -2999,28 +2999,28 @@ var An = class extends j {
|
|
|
2999
2999
|
bind(e) {
|
|
3000
3000
|
let t = this._gl;
|
|
3001
3001
|
if (e) {
|
|
3002
|
-
let { pixelRatio: n, viewport: r } = this._renderer, { viewMatrix: i } = this._renderer.shader.uniforms, { x: a, y: o, width: s, height: c } =
|
|
3002
|
+
let { pixelRatio: n, viewport: r } = this._renderer, { viewMatrix: i } = this._renderer.shader.uniforms, { x: a, y: o, width: s, height: c } = An(i, e), l = r.current.height / n - (o + c);
|
|
3003
3003
|
t.scissor(a * n, l * n, s * n, c * n);
|
|
3004
3004
|
} else t.disable(t.SCISSOR_TEST);
|
|
3005
3005
|
}
|
|
3006
3006
|
destroy() {
|
|
3007
3007
|
super.destroy(), this._renderer.renderTarget.off("updateRenderTarget", this._updateRenderTarget);
|
|
3008
3008
|
}
|
|
3009
|
-
},
|
|
3009
|
+
}, Mn = class extends bt {
|
|
3010
3010
|
contextLost = !1;
|
|
3011
3011
|
_systems = [
|
|
3012
|
-
new
|
|
3013
|
-
new
|
|
3014
|
-
new
|
|
3015
|
-
new En(),
|
|
3016
|
-
new ln(),
|
|
3017
|
-
new Qt(),
|
|
3018
|
-
new rn(),
|
|
3012
|
+
new Cn(),
|
|
3013
|
+
new Et(),
|
|
3014
|
+
new qt(),
|
|
3019
3015
|
new Dn(),
|
|
3020
|
-
new
|
|
3021
|
-
new An(),
|
|
3016
|
+
new un(),
|
|
3022
3017
|
new $t(),
|
|
3023
|
-
new
|
|
3018
|
+
new an(),
|
|
3019
|
+
new On(),
|
|
3020
|
+
new sn(),
|
|
3021
|
+
new jn(),
|
|
3022
|
+
new en(),
|
|
3023
|
+
new cn()
|
|
3024
3024
|
];
|
|
3025
3025
|
bindPoints = /* @__PURE__ */ new Map();
|
|
3026
3026
|
supports = {
|
|
@@ -3032,9 +3032,9 @@ var An = class extends j {
|
|
|
3032
3032
|
msaa: !0,
|
|
3033
3033
|
nonPowOf2mipmaps: !0
|
|
3034
3034
|
};
|
|
3035
|
-
constructor(e =
|
|
3035
|
+
constructor(e = Xe(), t) {
|
|
3036
3036
|
if (super(), !e) throw Error("Failed to createHTMLCanvas");
|
|
3037
|
-
|
|
3037
|
+
Je(e) ? this._setupContext(e, t) : (this.gl = e, this.version = Ye(this.gl) ? 2 : 1), this._setupBindPoints()._setupExtensions()._setupPolyfill()._setupSupports(), this._systems.forEach((e) => e.install(this)), this._systems.forEach((e) => e.emit("updateContext", this.gl)), this._systems.forEach((e) => e.emit("setup"));
|
|
3038
3038
|
}
|
|
3039
3039
|
_setupContext(e, t) {
|
|
3040
3040
|
this.view = e;
|
|
@@ -3114,8 +3114,8 @@ var An = class extends j {
|
|
|
3114
3114
|
height: this.screen.height * this.pixelRatio
|
|
3115
3115
|
});
|
|
3116
3116
|
}
|
|
3117
|
-
clear(e =
|
|
3118
|
-
typeof e == "boolean" && (e = e ?
|
|
3117
|
+
clear(e = rn.all) {
|
|
3118
|
+
typeof e == "boolean" && (e = e ? rn.all : rn.none), e && this.gl.clear(e);
|
|
3119
3119
|
}
|
|
3120
3120
|
reset() {
|
|
3121
3121
|
this._systems.forEach((e) => e.reset());
|
|
@@ -3132,7 +3132,7 @@ var An = class extends j {
|
|
|
3132
3132
|
for (let e = 0; e < i; e += a) c.set(s.subarray(e, e + a), o - e);
|
|
3133
3133
|
return c;
|
|
3134
3134
|
}
|
|
3135
|
-
},
|
|
3135
|
+
}, Nn = class {}, Pn = class extends Nn {
|
|
3136
3136
|
install(e) {
|
|
3137
3137
|
let t = async (e) => {
|
|
3138
3138
|
let { parseFont: t } = await import("modern-font");
|
|
@@ -3146,15 +3146,15 @@ var An = class extends j {
|
|
|
3146
3146
|
e.register(n, t);
|
|
3147
3147
|
}), e.font = this, this;
|
|
3148
3148
|
}
|
|
3149
|
-
},
|
|
3149
|
+
}, Fn, In = class extends w {
|
|
3150
3150
|
constructor(e) {
|
|
3151
3151
|
super(), this.setProperties(e);
|
|
3152
3152
|
}
|
|
3153
3153
|
};
|
|
3154
|
-
|
|
3154
|
+
O([_({ fallback: k.index }), D("design:type", typeof (Fn = k !== void 0 && k) == "function" ? Fn : Object)], In.prototype, "usage", void 0), O([_({ default: () => new Uint32Array() }), D("design:type", Object)], In.prototype, "data", void 0);
|
|
3155
3155
|
//#endregion
|
|
3156
3156
|
//#region src/scene/resources/geometries/Geometry.ts
|
|
3157
|
-
var
|
|
3157
|
+
var Ln, Rn, zn = class extends w {
|
|
3158
3158
|
constructor(e = {}) {
|
|
3159
3159
|
super(), this.setProperties(e);
|
|
3160
3160
|
}
|
|
@@ -3162,32 +3162,32 @@ var In, Ln, Rn = class extends T {
|
|
|
3162
3162
|
e.flush(), t.activate(e, n), e.geometry.bind(this, t.glProgram), e.geometry.draw(), e.geometry.unbind();
|
|
3163
3163
|
}
|
|
3164
3164
|
};
|
|
3165
|
-
|
|
3165
|
+
O([_({ fallback: "triangle-list" }), D("design:type", Object)], zn.prototype, "topology", void 0), O([_({ default: () => ({}) }), D("design:type", typeof (Ln = typeof Record < "u" && Record) == "function" ? Ln : Object)], zn.prototype, "attributes", void 0), O([_({ default: () => new In() }), D("design:type", typeof (Rn = In !== void 0 && In) == "function" ? Rn : Object)], zn.prototype, "indexBuffer", void 0), O([_({ fallback: 1 }), D("design:type", Number)], zn.prototype, "instanceCount", void 0);
|
|
3166
3166
|
//#endregion
|
|
3167
3167
|
//#region src/scene/resources/geometries/VertexBuffer.ts
|
|
3168
|
-
var
|
|
3168
|
+
var Bn, N = class extends w {
|
|
3169
3169
|
constructor(e) {
|
|
3170
3170
|
super(), this.setProperties(e);
|
|
3171
3171
|
}
|
|
3172
3172
|
};
|
|
3173
|
-
|
|
3173
|
+
O([_({ fallback: k.vertex }), D("design:type", typeof (Bn = k !== void 0 && k) == "function" ? Bn : Object)], N.prototype, "usage", void 0), O([_({ default: () => new Float32Array() }), D("design:type", Object)], N.prototype, "data", void 0);
|
|
3174
3174
|
//#endregion
|
|
3175
3175
|
//#region src/scene/resources/geometries/VertexAttribute.ts
|
|
3176
|
-
var
|
|
3176
|
+
var Vn, P = class extends w {
|
|
3177
3177
|
constructor(e) {
|
|
3178
3178
|
super(), this.setProperties(e);
|
|
3179
3179
|
}
|
|
3180
3180
|
};
|
|
3181
|
-
|
|
3181
|
+
O([_({ default: () => new N() }), D("design:type", typeof (Vn = N !== void 0 && N) == "function" ? Vn : Object)], P.prototype, "buffer", void 0), O([_({ fallback: "float32" }), D("design:type", Object)], P.prototype, "format", void 0), O([_(), D("design:type", Boolean)], P.prototype, "instance", void 0), O([_(), D("design:type", Number)], P.prototype, "stride", void 0), O([_(), D("design:type", Number)], P.prototype, "offset", void 0), O([_(), D("design:type", Number)], P.prototype, "start", void 0), O([_(), D("design:type", Number)], P.prototype, "divisor", void 0);
|
|
3182
3182
|
//#endregion
|
|
3183
3183
|
//#region src/scene/resources/geometries/QuadGeometry.ts
|
|
3184
|
-
var
|
|
3184
|
+
var Hn = class extends zn {
|
|
3185
3185
|
constructor() {
|
|
3186
3186
|
super({
|
|
3187
3187
|
topology: "triangle-strip",
|
|
3188
|
-
attributes: { position: new
|
|
3188
|
+
attributes: { position: new P({
|
|
3189
3189
|
format: "float32x2",
|
|
3190
|
-
buffer: new
|
|
3190
|
+
buffer: new N({ data: new Float32Array([
|
|
3191
3191
|
0,
|
|
3192
3192
|
0,
|
|
3193
3193
|
1,
|
|
@@ -3198,7 +3198,7 @@ var Vn = class extends Rn {
|
|
|
3198
3198
|
1
|
|
3199
3199
|
]) })
|
|
3200
3200
|
}) },
|
|
3201
|
-
indexBuffer: new
|
|
3201
|
+
indexBuffer: new In({ data: new Uint32Array([
|
|
3202
3202
|
0,
|
|
3203
3203
|
1,
|
|
3204
3204
|
3,
|
|
@@ -3206,8 +3206,8 @@ var Vn = class extends Rn {
|
|
|
3206
3206
|
]) })
|
|
3207
3207
|
});
|
|
3208
3208
|
}
|
|
3209
|
-
},
|
|
3210
|
-
function
|
|
3209
|
+
}, Un;
|
|
3210
|
+
function Wn() {
|
|
3211
3211
|
return {
|
|
3212
3212
|
projectionMatrix: new Float32Array([
|
|
3213
3213
|
1,
|
|
@@ -3239,13 +3239,13 @@ function Un() {
|
|
|
3239
3239
|
])
|
|
3240
3240
|
};
|
|
3241
3241
|
}
|
|
3242
|
-
var
|
|
3242
|
+
var F = class extends w {
|
|
3243
3243
|
static instance = new this();
|
|
3244
3244
|
glProgram;
|
|
3245
3245
|
constructor(e = {}) {
|
|
3246
3246
|
super();
|
|
3247
3247
|
let { uniforms: t, gl: n } = e;
|
|
3248
|
-
t && (this.uniforms = t), this.glProgram = new
|
|
3248
|
+
t && (this.uniforms = t), this.glProgram = new Rt({
|
|
3249
3249
|
vertex: "in vec2 position;\nuniform mat3 projectionMatrix;\nuniform mat3 modelViewMatrix;\nvoid main(void) {\n gl_Position = vec4((projectionMatrix * modelViewMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}",
|
|
3250
3250
|
fragment: "uniform vec4 tint;\nvoid main(void) {\n gl_FragColor = tint;\n}",
|
|
3251
3251
|
...n
|
|
@@ -3258,13 +3258,13 @@ var I = class extends T {
|
|
|
3258
3258
|
}, e.shader.updateUniforms(this);
|
|
3259
3259
|
}
|
|
3260
3260
|
};
|
|
3261
|
-
|
|
3261
|
+
O([_({ default: Wn }), D("design:type", typeof (Un = typeof Record < "u" && Record) == "function" ? Un : Object)], F.prototype, "uniforms", void 0);
|
|
3262
3262
|
//#endregion
|
|
3263
3263
|
//#region src/scene/resources/materials/EffectMaterial.ts
|
|
3264
|
-
var
|
|
3265
|
-
function
|
|
3264
|
+
var Gn = /^uniform \w+ (.+?);\s*\/\/\s*=\s*([^;]+?)[\s;]*$/gm, Kn = /vec(\d)\((.*)\)/;
|
|
3265
|
+
function qn(e) {
|
|
3266
3266
|
e = e.trim();
|
|
3267
|
-
let t = e.match(
|
|
3267
|
+
let t = e.match(Kn);
|
|
3268
3268
|
if (t) {
|
|
3269
3269
|
let e = Array.from({ length: Number(t[1]) }, () => 0);
|
|
3270
3270
|
return t[2].split(",").forEach((t, n) => {
|
|
@@ -3273,7 +3273,7 @@ function Kn(e) {
|
|
|
3273
3273
|
}
|
|
3274
3274
|
return Number(e);
|
|
3275
3275
|
}
|
|
3276
|
-
var
|
|
3276
|
+
var Jn = class e extends F {
|
|
3277
3277
|
static RE = {
|
|
3278
3278
|
getColor: /\sgetColor\s*\(/,
|
|
3279
3279
|
getFromColor: /\sgetFromColor\s*\(/,
|
|
@@ -3309,12 +3309,12 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3309
3309
|
progress: 0
|
|
3310
3310
|
}
|
|
3311
3311
|
}), this.has = n;
|
|
3312
|
-
let r = t.matchAll(
|
|
3312
|
+
let r = t.matchAll(Gn);
|
|
3313
3313
|
for (let e of r) e[1] && e[2] && e[1].split(",").forEach((t) => {
|
|
3314
|
-
this.uniforms[t.trim()] =
|
|
3314
|
+
this.uniforms[t.trim()] = qn(e[2]);
|
|
3315
3315
|
});
|
|
3316
3316
|
}
|
|
3317
|
-
},
|
|
3317
|
+
}, Yn = class extends F {
|
|
3318
3318
|
static _instance;
|
|
3319
3319
|
static get instance() {
|
|
3320
3320
|
return this._instance ??= new this();
|
|
@@ -3358,20 +3358,20 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3358
3358
|
}
|
|
3359
3359
|
});
|
|
3360
3360
|
}
|
|
3361
|
-
},
|
|
3361
|
+
}, I = class extends zn {
|
|
3362
3362
|
static _instance;
|
|
3363
3363
|
static get instance() {
|
|
3364
3364
|
return this._instance ??= new this();
|
|
3365
3365
|
}
|
|
3366
|
-
static draw(e, t =
|
|
3366
|
+
static draw(e, t = Yn.instance, n) {
|
|
3367
3367
|
this.instance.draw(e, t, n);
|
|
3368
3368
|
}
|
|
3369
3369
|
constructor() {
|
|
3370
3370
|
super({
|
|
3371
3371
|
attributes: {
|
|
3372
|
-
position: new
|
|
3372
|
+
position: new P({
|
|
3373
3373
|
format: "float32x2",
|
|
3374
|
-
buffer: new
|
|
3374
|
+
buffer: new N({ data: new Float32Array([
|
|
3375
3375
|
-1,
|
|
3376
3376
|
-1,
|
|
3377
3377
|
1,
|
|
@@ -3382,9 +3382,9 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3382
3382
|
1
|
|
3383
3383
|
]) })
|
|
3384
3384
|
}),
|
|
3385
|
-
uv: new
|
|
3385
|
+
uv: new P({
|
|
3386
3386
|
format: "float32x2",
|
|
3387
|
-
buffer: new
|
|
3387
|
+
buffer: new N({ data: new Float32Array([
|
|
3388
3388
|
0,
|
|
3389
3389
|
0,
|
|
3390
3390
|
1,
|
|
@@ -3396,7 +3396,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3396
3396
|
]) })
|
|
3397
3397
|
})
|
|
3398
3398
|
},
|
|
3399
|
-
indexBuffer: new
|
|
3399
|
+
indexBuffer: new In({ data: new Uint32Array([
|
|
3400
3400
|
0,
|
|
3401
3401
|
1,
|
|
3402
3402
|
2,
|
|
@@ -3406,27 +3406,27 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3406
3406
|
]) })
|
|
3407
3407
|
});
|
|
3408
3408
|
}
|
|
3409
|
-
},
|
|
3409
|
+
}, Xn = class extends zn {
|
|
3410
3410
|
positionBuffer;
|
|
3411
3411
|
uvBuffer;
|
|
3412
3412
|
constructor(e) {
|
|
3413
|
-
let t = new
|
|
3413
|
+
let t = new N({ data: new Float32Array() }), n = new N({ data: new Float32Array() });
|
|
3414
3414
|
super({
|
|
3415
3415
|
...e,
|
|
3416
3416
|
attributes: {
|
|
3417
|
-
position: new
|
|
3417
|
+
position: new P({
|
|
3418
3418
|
format: "float32x2",
|
|
3419
3419
|
buffer: t
|
|
3420
3420
|
}),
|
|
3421
|
-
uv: new
|
|
3421
|
+
uv: new P({
|
|
3422
3422
|
format: "float32x2",
|
|
3423
3423
|
buffer: n
|
|
3424
3424
|
})
|
|
3425
3425
|
},
|
|
3426
|
-
indexBuffer: new
|
|
3426
|
+
indexBuffer: new In({ data: new Uint32Array() })
|
|
3427
3427
|
}), this.positionBuffer = t, this.uvBuffer = n;
|
|
3428
3428
|
}
|
|
3429
|
-
},
|
|
3429
|
+
}, L = class extends w {
|
|
3430
3430
|
get valid() {
|
|
3431
3431
|
return !!(this.width && this.height);
|
|
3432
3432
|
}
|
|
@@ -3440,10 +3440,10 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3440
3440
|
super._destroy(), this.colorTextures.forEach((e) => e.destroy());
|
|
3441
3441
|
}
|
|
3442
3442
|
};
|
|
3443
|
-
|
|
3443
|
+
O([_({ fallback: !1 }), D("design:type", Boolean)], L.prototype, "isRoot", void 0), O([_({ fallback: 0 }), D("design:type", Number)], L.prototype, "x", void 0), O([_({ fallback: 0 }), D("design:type", Number)], L.prototype, "y", void 0), O([_({ fallback: 0 }), D("design:type", Number)], L.prototype, "width", void 0), O([_({ fallback: 0 }), D("design:type", Number)], L.prototype, "height", void 0), O([_({ fallback: 0 }), D("design:type", Number)], L.prototype, "mipLevel", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], L.prototype, "msaa", void 0), O([_({ default: () => [new R()] }), D("design:type", Array)], L.prototype, "colorTextures", void 0);
|
|
3444
3444
|
//#endregion
|
|
3445
3445
|
//#region src/scene/resources/textures/Texture2D.ts
|
|
3446
|
-
var
|
|
3446
|
+
var R = class extends w {
|
|
3447
3447
|
static get EMPTY() {
|
|
3448
3448
|
return new this({
|
|
3449
3449
|
width: 1,
|
|
@@ -3554,10 +3554,10 @@ var z = class extends T {
|
|
|
3554
3554
|
super._destroy(), ke && this.source instanceof ImageBitmap && this.source.close();
|
|
3555
3555
|
}
|
|
3556
3556
|
};
|
|
3557
|
-
|
|
3557
|
+
O([_({ fallback: "unknown" }), D("design:type", String)], R.prototype, "uploadMethodId", void 0), O([_({ internal: !0 }), D("design:type", Object)], R.prototype, "source", void 0), O([_({ fallback: 0 }), D("design:type", Number)], R.prototype, "width", void 0), O([_({ fallback: 0 }), D("design:type", Number)], R.prototype, "height", void 0), O([_({ fallback: 1 }), D("design:type", Number)], R.prototype, "pixelRatio", void 0), O([_({ fallback: "bgra8unorm" }), D("design:type", Object)], R.prototype, "format", void 0), O([_({ fallback: "premultiply-alpha-on-upload" }), D("design:type", Object)], R.prototype, "alphaMode", void 0), O([_({ fallback: 1 }), D("design:type", Number)], R.prototype, "mipLevelCount", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], R.prototype, "mipmap", void 0), O([_({ fallback: "clamp-to-edge" }), D("design:type", Object)], R.prototype, "addressModeU", void 0), O([_({ fallback: "clamp-to-edge" }), D("design:type", Object)], R.prototype, "addressModeV", void 0), O([_({ fallback: "clamp-to-edge" }), D("design:type", Object)], R.prototype, "addressModeW", void 0), O([_({ fallback: "linear" }), D("design:type", Object)], R.prototype, "magFilter", void 0), O([_({ fallback: "linear" }), D("design:type", Object)], R.prototype, "minFilter", void 0), O([_({ fallback: "linear" }), D("design:type", Object)], R.prototype, "mipmapFilter", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], R.prototype, "isPowerOfTwo", void 0);
|
|
3558
3558
|
//#endregion
|
|
3559
3559
|
//#region src/scene/resources/textures/AnimatedTexture.ts
|
|
3560
|
-
var
|
|
3560
|
+
var Zn = class extends w {
|
|
3561
3561
|
frames;
|
|
3562
3562
|
frameIndex = 0;
|
|
3563
3563
|
get currentFrame() {
|
|
@@ -3567,7 +3567,7 @@ var Xn = class extends T {
|
|
|
3567
3567
|
super();
|
|
3568
3568
|
let t;
|
|
3569
3569
|
if (Array.isArray(e)) t = e;
|
|
3570
|
-
else if (e instanceof
|
|
3570
|
+
else if (e instanceof R) t = [{
|
|
3571
3571
|
texture: e,
|
|
3572
3572
|
duration: 0
|
|
3573
3573
|
}];
|
|
@@ -3582,7 +3582,7 @@ var Xn = class extends T {
|
|
|
3582
3582
|
e.texture.destroy();
|
|
3583
3583
|
});
|
|
3584
3584
|
}
|
|
3585
|
-
},
|
|
3585
|
+
}, Qn = class extends R {
|
|
3586
3586
|
constructor(e = {}) {
|
|
3587
3587
|
super({
|
|
3588
3588
|
pixelRatio: 2,
|
|
@@ -3602,14 +3602,14 @@ var Xn = class extends T {
|
|
|
3602
3602
|
}
|
|
3603
3603
|
super._updateProperty(e, t, n);
|
|
3604
3604
|
}
|
|
3605
|
-
},
|
|
3605
|
+
}, $n = class e extends R {
|
|
3606
3606
|
static _cached = /* @__PURE__ */ new Map();
|
|
3607
3607
|
static get(t) {
|
|
3608
|
-
let n = new
|
|
3608
|
+
let n = new T(t), r = n.toHex(), i = this._cached.get(r);
|
|
3609
3609
|
return i || (i = new e(n), this._cached.set(r, i)), i;
|
|
3610
3610
|
}
|
|
3611
3611
|
constructor(e) {
|
|
3612
|
-
let t = e instanceof
|
|
3612
|
+
let t = e instanceof T ? e : new T(e);
|
|
3613
3613
|
super({
|
|
3614
3614
|
width: 1,
|
|
3615
3615
|
height: 1,
|
|
@@ -3623,7 +3623,7 @@ var Xn = class extends T {
|
|
|
3623
3623
|
mipmap: !0
|
|
3624
3624
|
});
|
|
3625
3625
|
}
|
|
3626
|
-
},
|
|
3626
|
+
}, er = class e extends R {
|
|
3627
3627
|
static test(e) {
|
|
3628
3628
|
return u(e);
|
|
3629
3629
|
}
|
|
@@ -3647,7 +3647,7 @@ var Xn = class extends T {
|
|
|
3647
3647
|
constructor(t, n, r) {
|
|
3648
3648
|
super(e.linearGradient(t, n, r));
|
|
3649
3649
|
}
|
|
3650
|
-
},
|
|
3650
|
+
}, tr = class extends R {
|
|
3651
3651
|
constructor(e = {}) {
|
|
3652
3652
|
super({
|
|
3653
3653
|
...e,
|
|
@@ -3657,7 +3657,7 @@ var Xn = class extends T {
|
|
|
3657
3657
|
};
|
|
3658
3658
|
//#endregion
|
|
3659
3659
|
//#region src/scene/resources/textures/VideoTexture.ts
|
|
3660
|
-
function
|
|
3660
|
+
function nr(e) {
|
|
3661
3661
|
return {
|
|
3662
3662
|
autoLoad: !!(e?.autoLoad ?? !0),
|
|
3663
3663
|
autoPlay: !!(e?.autoPlay ?? !1),
|
|
@@ -3668,7 +3668,7 @@ function tr(e) {
|
|
|
3668
3668
|
playsinline: !!(e?.playsinline ?? !0)
|
|
3669
3669
|
};
|
|
3670
3670
|
}
|
|
3671
|
-
var
|
|
3671
|
+
var rr = class e extends R {
|
|
3672
3672
|
static mimeTypes = new Map(Object.entries({
|
|
3673
3673
|
ogv: "video/ogg",
|
|
3674
3674
|
mov: "video/quicktime",
|
|
@@ -3702,11 +3702,11 @@ var nr = class e extends z {
|
|
|
3702
3702
|
_reject;
|
|
3703
3703
|
_seekResolves = [];
|
|
3704
3704
|
constructor(t, n) {
|
|
3705
|
-
let r =
|
|
3706
|
-
if (!
|
|
3705
|
+
let r = nr(n);
|
|
3706
|
+
if (!Ke(t)) {
|
|
3707
3707
|
typeof t == "string" && (t = [t]);
|
|
3708
3708
|
let n = t[0].src || t[0], i = document.createElement("video");
|
|
3709
|
-
r.autoLoad && i.setAttribute("preload", "auto"), r.playsinline && (i.setAttribute("webkit-playsinline", ""), i.setAttribute("playsinline", "")), r.muted && (i.setAttribute("muted", ""), i.muted = !0), r.loop && i.setAttribute("loop", ""), r.autoPlay && i.setAttribute("autoplay", ""),
|
|
3709
|
+
r.autoLoad && i.setAttribute("preload", "auto"), r.playsinline && (i.setAttribute("webkit-playsinline", ""), i.setAttribute("playsinline", "")), r.muted && (i.setAttribute("muted", ""), i.muted = !0), r.loop && i.setAttribute("loop", ""), r.autoPlay && i.setAttribute("autoplay", ""), Qe(i, n, r.crossorigin);
|
|
3710
3710
|
for (let n = 0; n < t.length; ++n) {
|
|
3711
3711
|
let { src: r, mime: a } = t[n];
|
|
3712
3712
|
if (r ||= t[n], r.startsWith("data:")) a = r.slice(5, r.indexOf(";"));
|
|
@@ -3793,16 +3793,16 @@ var nr = class e extends z {
|
|
|
3793
3793
|
e && (e.removeEventListener("play", this._onPlayStart), e.removeEventListener("pause", this._onPlayStop), e.removeEventListener("seeked", this._onSeeked), e.removeEventListener("canplay", this._onCanPlay), e.removeEventListener("canplaythrough", this._onCanPlay), e.removeEventListener("error", this._onError, !0), e.pause(), e.src = "", e.load());
|
|
3794
3794
|
}
|
|
3795
3795
|
};
|
|
3796
|
-
|
|
3796
|
+
O([_({
|
|
3797
3797
|
internal: !0,
|
|
3798
3798
|
fallback: !0
|
|
3799
|
-
}),
|
|
3799
|
+
}), D("design:type", Boolean)], rr.prototype, "autoUpdate", void 0), O([_({
|
|
3800
3800
|
internal: !0,
|
|
3801
3801
|
fallback: 0
|
|
3802
|
-
}),
|
|
3802
|
+
}), D("design:type", Number)], rr.prototype, "fps", void 0);
|
|
3803
3803
|
//#endregion
|
|
3804
3804
|
//#region src/scene/resources/textures/ViewportTexture.ts
|
|
3805
|
-
var
|
|
3805
|
+
var ir = class extends R {}, ar = class extends oe {
|
|
3806
3806
|
fillStyle;
|
|
3807
3807
|
strokeStyle;
|
|
3808
3808
|
strokeAlignment;
|
|
@@ -3814,7 +3814,7 @@ var rr = class extends z {}, ir = class extends oe {
|
|
|
3814
3814
|
transformVertex;
|
|
3815
3815
|
_draws = [];
|
|
3816
3816
|
_parseDrawStyle(e) {
|
|
3817
|
-
return e ? e instanceof
|
|
3817
|
+
return e ? e instanceof R ? { texture: e } : { texture: $n.get(e) } : {};
|
|
3818
3818
|
}
|
|
3819
3819
|
stroke(e) {
|
|
3820
3820
|
if (!this.curves.length) return;
|
|
@@ -3902,7 +3902,7 @@ var rr = class extends z {}, ir = class extends oe {
|
|
|
3902
3902
|
destroy() {
|
|
3903
3903
|
this.reset();
|
|
3904
3904
|
}
|
|
3905
|
-
},
|
|
3905
|
+
}, or = class {
|
|
3906
3906
|
front = [];
|
|
3907
3907
|
default = [];
|
|
3908
3908
|
back = [];
|
|
@@ -3945,7 +3945,7 @@ var rr = class extends z {}, ir = class extends oe {
|
|
|
3945
3945
|
toJSON() {
|
|
3946
3946
|
return [...this.default];
|
|
3947
3947
|
}
|
|
3948
|
-
},
|
|
3948
|
+
}, sr = class extends C {
|
|
3949
3949
|
parent;
|
|
3950
3950
|
getPropertyDeclarations() {
|
|
3951
3951
|
super.getPropertyDeclarations();
|
|
@@ -3964,22 +3964,22 @@ var rr = class extends z {}, ir = class extends oe {
|
|
|
3964
3964
|
deleteProperty: (e, t) => Reflect.has(e, t) || String(t).startsWith("_") ? Reflect.deleteProperty(e, t) : (e.setProperty(String(t), void 0), !0)
|
|
3965
3965
|
});
|
|
3966
3966
|
}
|
|
3967
|
-
},
|
|
3968
|
-
function
|
|
3969
|
-
let t =
|
|
3970
|
-
return t++,
|
|
3967
|
+
}, cr, lr, ur = {};
|
|
3968
|
+
function dr(e) {
|
|
3969
|
+
let t = ur[e] ?? 0;
|
|
3970
|
+
return t++, ur[e] = t, t;
|
|
3971
3971
|
}
|
|
3972
|
-
var
|
|
3972
|
+
var z = lr = class extends C {
|
|
3973
3973
|
static parse(e, t = "Node") {
|
|
3974
3974
|
if (Array.isArray(e)) return e.map((e) => this.parse(e));
|
|
3975
|
-
let { is: n, meta: r = {}, children: i, ...a } = e, o = new ((me.get(n ?? r.inCanvasIs ?? t)) ??
|
|
3975
|
+
let { is: n, meta: r = {}, children: i, ...a } = e, o = new ((me.get(n ?? r.inCanvasIs ?? t)) ?? lr)({
|
|
3976
3976
|
...a,
|
|
3977
3977
|
meta: r
|
|
3978
3978
|
});
|
|
3979
3979
|
return i?.forEach((e) => o.appendChild(this.parse(e))), o;
|
|
3980
3980
|
}
|
|
3981
3981
|
_mask;
|
|
3982
|
-
_meta = new
|
|
3982
|
+
_meta = new sr(this);
|
|
3983
3983
|
get meta() {
|
|
3984
3984
|
return this._meta;
|
|
3985
3985
|
}
|
|
@@ -4002,7 +4002,7 @@ var B = cr = class extends w {
|
|
|
4002
4002
|
}).append(t), this.on("treeEnter", this._onTreeEnter).on("treeExit", this._onTreeExit).on("parented", this._onParented).on("unparented", this._onUnparented).on("ready", this._onReady).on("process", this._onProcess), this.updateProcessable(), this.updateRenderable();
|
|
4003
4003
|
}
|
|
4004
4004
|
_defaultName() {
|
|
4005
|
-
return `@${this.is}@${
|
|
4005
|
+
return `@${this.is}@${dr(this.is)}`;
|
|
4006
4006
|
}
|
|
4007
4007
|
setProperties(e) {
|
|
4008
4008
|
if (e) {
|
|
@@ -4069,7 +4069,7 @@ var B = cr = class extends w {
|
|
|
4069
4069
|
}
|
|
4070
4070
|
return this;
|
|
4071
4071
|
}
|
|
4072
|
-
_children = new
|
|
4072
|
+
_children = new or();
|
|
4073
4073
|
get children() {
|
|
4074
4074
|
return this._children.default;
|
|
4075
4075
|
}
|
|
@@ -4226,7 +4226,7 @@ var B = cr = class extends w {
|
|
|
4226
4226
|
append(...e) {
|
|
4227
4227
|
let t;
|
|
4228
4228
|
t = Array.isArray(e[0]) ? e[0] : e, t.forEach((e) => {
|
|
4229
|
-
e instanceof
|
|
4229
|
+
e instanceof lr ? this.appendChild(e) : this.appendChild(lr.parse(e));
|
|
4230
4230
|
});
|
|
4231
4231
|
}
|
|
4232
4232
|
before(...e) {
|
|
@@ -4329,13 +4329,13 @@ var B = cr = class extends w {
|
|
|
4329
4329
|
});
|
|
4330
4330
|
}
|
|
4331
4331
|
};
|
|
4332
|
-
|
|
4332
|
+
O([_({ default: () => c() }), D("design:type", String)], z.prototype, "id", void 0), O([_({ default: () => c() }), D("design:type", String)], z.prototype, "name", void 0), O([_({ fallback: "inherit" }), D("design:type", Object)], z.prototype, "processMode", void 0), O([_({ fallback: "default" }), D("design:type", Object)], z.prototype, "processSortMode", void 0), O([_({ fallback: "inherit" }), D("design:type", Object)], z.prototype, "renderMode", void 0), O([_({ fallback: "inherit" }), D("design:type", Object)], z.prototype, "inputMode", void 0), O([_({ fallback: "default" }), D("design:type", Object)], z.prototype, "internalMode", void 0), O([_({
|
|
4333
4333
|
internal: !0,
|
|
4334
4334
|
default: !0
|
|
4335
|
-
}),
|
|
4335
|
+
}), D("design:type", Boolean)], z.prototype, "needsRender", void 0), z = lr = O([x("Node"), D("design:paramtypes", [typeof (cr = typeof Partial < "u" && Partial) == "function" ? cr : Object, Array])], z);
|
|
4336
4336
|
//#endregion
|
|
4337
4337
|
//#region src/scene/main/TimelineNode.ts
|
|
4338
|
-
var
|
|
4338
|
+
var fr, B = class extends z {
|
|
4339
4339
|
insideTimeRange = !1;
|
|
4340
4340
|
get _timeline() {
|
|
4341
4341
|
return this._tree?.timeline;
|
|
@@ -4366,7 +4366,7 @@ var dr, V = class extends B {
|
|
|
4366
4366
|
return this._globalStartTime + this._globalDuration;
|
|
4367
4367
|
}
|
|
4368
4368
|
get currentTimeProgress() {
|
|
4369
|
-
return this._duration ?
|
|
4369
|
+
return this._duration ? ft(this._currentTime / this._duration, 0, 1) : 0;
|
|
4370
4370
|
}
|
|
4371
4371
|
isInsideTimeRange() {
|
|
4372
4372
|
let e = this._currentTime;
|
|
@@ -4406,10 +4406,10 @@ var dr, V = class extends B {
|
|
|
4406
4406
|
super._process(e), this._updateCurrentTime();
|
|
4407
4407
|
}
|
|
4408
4408
|
};
|
|
4409
|
-
|
|
4409
|
+
O([_({ fallback: !1 }), D("design:type", Boolean)], B.prototype, "loop", void 0), O([_({ fallback: 0 }), D("design:type", Number)], B.prototype, "delay", void 0), O([_({ fallback: 0 }), D("design:type", Number)], B.prototype, "duration", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], B.prototype, "paused", void 0), B = O([x("TimelineNode"), D("design:paramtypes", [typeof (fr = typeof Partial < "u" && Partial) == "function" ? fr : Object, Array])], B);
|
|
4410
4410
|
//#endregion
|
|
4411
4411
|
//#region src/scene/main/CanvasItem.ts
|
|
4412
|
-
var
|
|
4412
|
+
var pr, mr = class extends B {
|
|
4413
4413
|
_blendMode;
|
|
4414
4414
|
_parentGlobalVisible;
|
|
4415
4415
|
_globalVisible;
|
|
@@ -4427,7 +4427,7 @@ var fr, pr = class extends V {
|
|
|
4427
4427
|
255,
|
|
4428
4428
|
255
|
|
4429
4429
|
];
|
|
4430
|
-
context = new
|
|
4430
|
+
context = new ar();
|
|
4431
4431
|
_resetContext = !0;
|
|
4432
4432
|
needsDraw = !0;
|
|
4433
4433
|
needsLayout = !1;
|
|
@@ -4489,7 +4489,7 @@ var fr, pr = class extends V {
|
|
|
4489
4489
|
}
|
|
4490
4490
|
_updateGlobalOpacity() {
|
|
4491
4491
|
this._parentGlobalOpacity = this.getParent()?.opacity;
|
|
4492
|
-
let e =
|
|
4492
|
+
let e = ft(this.opacity, 0, 1) * (this._parentGlobalOpacity ?? 1);
|
|
4493
4493
|
this._globalOpacity !== e && (this._globalOpacity = e, this._updateModulate(), this.requestPaint(), this.updateRenderable());
|
|
4494
4494
|
}
|
|
4495
4495
|
_draw() {
|
|
@@ -4554,7 +4554,7 @@ var fr, pr = class extends V {
|
|
|
4554
4554
|
_render(e) {
|
|
4555
4555
|
this._updateBatchables();
|
|
4556
4556
|
let t = this._tree?.pixelate, n = this._tree?.roundPixels, r = this._batchables;
|
|
4557
|
-
for (let i, a, o = r.length, s = 0; s < o; s++) i = r[s], a = i.texture, a instanceof
|
|
4557
|
+
for (let i, a, o = r.length, s = 0; s < o; s++) i = r[s], a = i.texture, a instanceof ir && (a = this._handleViewportTexture(i)), e.batch2D.render({
|
|
4558
4558
|
...i,
|
|
4559
4559
|
roundPixels: n,
|
|
4560
4560
|
size: t ? i.size : void 0,
|
|
@@ -4566,19 +4566,19 @@ var fr, pr = class extends V {
|
|
|
4566
4566
|
super._destroy(), this.context.destroy(), this._drawBatchables = [], this._layoutBatchables = [], this._batchables = [];
|
|
4567
4567
|
}
|
|
4568
4568
|
};
|
|
4569
|
-
|
|
4569
|
+
O([_(), D("design:type", Object)], mr.prototype, "blendMode", void 0), O([_({
|
|
4570
4570
|
internal: !0,
|
|
4571
4571
|
fallback: !0
|
|
4572
|
-
}),
|
|
4572
|
+
}), D("design:type", Boolean)], mr.prototype, "visible", void 0), O([_({
|
|
4573
4573
|
internal: !0,
|
|
4574
4574
|
fallback: 1
|
|
4575
|
-
}),
|
|
4575
|
+
}), D("design:type", Number)], mr.prototype, "opacity", void 0), mr = O([x("CanvasItem"), D("design:paramtypes", [typeof (pr = typeof Partial < "u" && Partial) == "function" ? pr : Object, Array])], mr);
|
|
4576
4576
|
//#endregion
|
|
4577
4577
|
//#region src/scene/main/Viewport.ts
|
|
4578
|
-
var
|
|
4578
|
+
var V = class extends z {
|
|
4579
4579
|
canvasTransform = new v();
|
|
4580
4580
|
renderTargetIndex = 0;
|
|
4581
|
-
renderTargets = [new
|
|
4581
|
+
renderTargets = [new L(), new L()];
|
|
4582
4582
|
get valid() {
|
|
4583
4583
|
return !!(this.width && this.height);
|
|
4584
4584
|
}
|
|
@@ -4625,7 +4625,7 @@ var H = class extends B {
|
|
|
4625
4625
|
return !1;
|
|
4626
4626
|
}
|
|
4627
4627
|
activateWithCopy(e, t) {
|
|
4628
|
-
this.resize(t.width, t.height), this.activate(e) && (e.clear(), t.texture.activate(e, 0),
|
|
4628
|
+
this.resize(t.width, t.height), this.activate(e) && (e.clear(), t.texture.activate(e, 0), I.draw(e, Yn.instance, { sampler: 0 }));
|
|
4629
4629
|
}
|
|
4630
4630
|
renderStart(e, t) {
|
|
4631
4631
|
this.activate(e, t) && e.clear();
|
|
@@ -4638,7 +4638,7 @@ var H = class extends B {
|
|
|
4638
4638
|
this.renderStart(e), super.render(e, t), this.renderEnd(e, n);
|
|
4639
4639
|
}
|
|
4640
4640
|
getRect() {
|
|
4641
|
-
return new
|
|
4641
|
+
return new lt(this.x, this.y, this.width, this.height);
|
|
4642
4642
|
}
|
|
4643
4643
|
toCanvasGlobal(e, t) {
|
|
4644
4644
|
return this.canvasTransform.applyAffineInverse(e, t);
|
|
@@ -4650,16 +4650,16 @@ var H = class extends B {
|
|
|
4650
4650
|
super._destroy(), this.canvasTransform.destroy(), this.renderTargets.forEach((e) => e.destroy());
|
|
4651
4651
|
}
|
|
4652
4652
|
};
|
|
4653
|
-
|
|
4653
|
+
O([_({ fallback: 0 }), D("design:type", Number)], V.prototype, "x", void 0), O([_({ fallback: 0 }), D("design:type", Number)], V.prototype, "y", void 0), O([_({ fallback: 0 }), D("design:type", Number)], V.prototype, "width", void 0), O([_({ fallback: 0 }), D("design:type", Number)], V.prototype, "height", void 0), O([_({ fallback: 0 }), D("design:type", Number)], V.prototype, "mipLevel", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], V.prototype, "msaa", void 0), V = O([x("Viewport")], V);
|
|
4654
4654
|
//#endregion
|
|
4655
4655
|
//#region src/scene/main/Effect.ts
|
|
4656
|
-
var
|
|
4656
|
+
var hr, H = class extends B {
|
|
4657
4657
|
material;
|
|
4658
4658
|
get _effectMode() {
|
|
4659
4659
|
return this.effectMode ?? "parent";
|
|
4660
4660
|
}
|
|
4661
|
-
viewport1 = new
|
|
4662
|
-
viewport2 = new
|
|
4661
|
+
viewport1 = new V();
|
|
4662
|
+
viewport2 = new V();
|
|
4663
4663
|
_renderId = 0;
|
|
4664
4664
|
_renderViewport;
|
|
4665
4665
|
_previousSibling;
|
|
@@ -4676,7 +4676,7 @@ var mr, U = class extends V {
|
|
|
4676
4676
|
_updateProperty(e, t, n) {
|
|
4677
4677
|
switch (super._updateProperty(e, t, n), e) {
|
|
4678
4678
|
case "glsl": {
|
|
4679
|
-
let e = new
|
|
4679
|
+
let e = new Jn(t);
|
|
4680
4680
|
!this.effectMode && e.has.transition && (this.effectMode = "transition"), this.material = e;
|
|
4681
4681
|
break;
|
|
4682
4682
|
}
|
|
@@ -4711,7 +4711,7 @@ var mr, U = class extends V {
|
|
|
4711
4711
|
}
|
|
4712
4712
|
}
|
|
4713
4713
|
getRect() {
|
|
4714
|
-
return new
|
|
4714
|
+
return new lt(this._rect);
|
|
4715
4715
|
}
|
|
4716
4716
|
_processParent() {
|
|
4717
4717
|
let e = this._tree?.renderStack;
|
|
@@ -4864,13 +4864,13 @@ var mr, U = class extends V {
|
|
|
4864
4864
|
}
|
|
4865
4865
|
apply(e, t, n) {
|
|
4866
4866
|
this.material && (n?.redraw ? t.redraw(e, () => {
|
|
4867
|
-
|
|
4867
|
+
I.draw(e, this.material, {
|
|
4868
4868
|
from: 0,
|
|
4869
4869
|
to: 1,
|
|
4870
4870
|
progress: this.currentTimeProgress,
|
|
4871
4871
|
ratio: t.width / t.height
|
|
4872
4872
|
});
|
|
4873
|
-
}) :
|
|
4873
|
+
}) : I.draw(e, this.material, {
|
|
4874
4874
|
from: 0,
|
|
4875
4875
|
to: 1,
|
|
4876
4876
|
progress: this.currentTimeProgress,
|
|
@@ -4881,10 +4881,10 @@ var mr, U = class extends V {
|
|
|
4881
4881
|
super._destroy(), this.viewport1.destroy(), this.viewport2.destroy();
|
|
4882
4882
|
}
|
|
4883
4883
|
};
|
|
4884
|
-
|
|
4884
|
+
O([_({ internal: !0 }), D("design:type", Object)], H.prototype, "material", void 0), O([_(), D("design:type", Object)], H.prototype, "effectMode", void 0), O([_(), D("design:type", String)], H.prototype, "glsl", void 0), O([_(), D("design:type", String)], H.prototype, "glslSrc", void 0), H = O([x("Effect"), D("design:paramtypes", [typeof (hr = typeof Partial < "u" && Partial) == "function" ? hr : Object, Array])], H);
|
|
4885
4885
|
//#endregion
|
|
4886
4886
|
//#region src/scene/main/RenderStack.ts
|
|
4887
|
-
var
|
|
4887
|
+
var gr = class {
|
|
4888
4888
|
currentCall;
|
|
4889
4889
|
calls = [];
|
|
4890
4890
|
createCall(e) {
|
|
@@ -4906,11 +4906,11 @@ var hr = class {
|
|
|
4906
4906
|
});
|
|
4907
4907
|
}), this.calls = [];
|
|
4908
4908
|
}
|
|
4909
|
-
},
|
|
4909
|
+
}, _r, vr, yr = vr = class extends z {
|
|
4910
4910
|
currentTime = 0;
|
|
4911
4911
|
static from(e, t = !1) {
|
|
4912
4912
|
let [n, r] = e ? Array.isArray(e) ? e : [0, e] : [];
|
|
4913
|
-
return new
|
|
4913
|
+
return new vr({
|
|
4914
4914
|
startTime: n,
|
|
4915
4915
|
endTime: r,
|
|
4916
4916
|
loop: t
|
|
@@ -4928,16 +4928,16 @@ var hr = class {
|
|
|
4928
4928
|
}
|
|
4929
4929
|
addTime(e) {
|
|
4930
4930
|
let t = this.endTime, n = Math.min(this.startTime, this.endTime), r = this.currentTime;
|
|
4931
|
-
return r += e, this.loop && r > t && (r = n + r % t), r =
|
|
4931
|
+
return r += e, this.loop && r > t && (r = n + r % t), r = ft(r, n, t), this.currentTime = r, this.emit("updateCurrentTime", r, e), this;
|
|
4932
4932
|
}
|
|
4933
4933
|
_process(e) {
|
|
4934
4934
|
super._process(e), this.paused || this.addTime(e);
|
|
4935
4935
|
}
|
|
4936
4936
|
};
|
|
4937
|
-
|
|
4937
|
+
O([_({ fallback: 0 }), D("design:type", Number)], yr.prototype, "startTime", void 0), O([_({ fallback: 2 ** 53 - 1 }), D("design:type", Number)], yr.prototype, "endTime", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], yr.prototype, "loop", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], yr.prototype, "paused", void 0), yr = vr = O([x("Timeline"), D("design:paramtypes", [typeof (_r = typeof Partial < "u" && Partial) == "function" ? _r : Object])], yr);
|
|
4938
4938
|
//#endregion
|
|
4939
4939
|
//#region src/scene/main/Window.ts
|
|
4940
|
-
var
|
|
4940
|
+
var br = class extends V {
|
|
4941
4941
|
constructor() {
|
|
4942
4942
|
super(), this.renderTargets.forEach((e) => e.isRoot = !0);
|
|
4943
4943
|
}
|
|
@@ -4948,19 +4948,19 @@ var yr = class extends H {
|
|
|
4948
4948
|
super.flush(e), this.finish(e);
|
|
4949
4949
|
}
|
|
4950
4950
|
};
|
|
4951
|
-
|
|
4951
|
+
br = O([x("Window", {
|
|
4952
4952
|
processMode: "always",
|
|
4953
4953
|
renderMode: "always"
|
|
4954
|
-
}),
|
|
4954
|
+
}), D("design:paramtypes", [])], br);
|
|
4955
4955
|
//#endregion
|
|
4956
4956
|
//#region src/scene/main/SceneTree.ts
|
|
4957
|
-
var
|
|
4958
|
-
input = new
|
|
4959
|
-
renderStack = new
|
|
4960
|
-
root = new
|
|
4961
|
-
timeline = new
|
|
4957
|
+
var U = class extends gt {
|
|
4958
|
+
input = new st();
|
|
4959
|
+
renderStack = new gr();
|
|
4960
|
+
root = new br().setTree(this);
|
|
4961
|
+
timeline = new yr().setTree(this);
|
|
4962
4962
|
nodeMap = /* @__PURE__ */ new Map();
|
|
4963
|
-
_backgroundColor = new
|
|
4963
|
+
_backgroundColor = new T();
|
|
4964
4964
|
_previousViewport;
|
|
4965
4965
|
_currentViewport;
|
|
4966
4966
|
getPreviousViewport() {
|
|
@@ -5004,36 +5004,36 @@ var br = class extends ht {
|
|
|
5004
5004
|
_renderScreen(e) {
|
|
5005
5005
|
this.root.finish(e), e.state.reset(), e.renderTarget.unbind(), this.backgroundColor && e.gl.clearColor(...this._backgroundColor.toArray()), e.clear(), this.backgroundColor && e.gl.clearColor(0, 0, 0, 0);
|
|
5006
5006
|
let t = this.root.texture;
|
|
5007
|
-
t.activate(e, 0),
|
|
5007
|
+
t.activate(e, 0), I.draw(e), t.inactivate(e);
|
|
5008
5008
|
}
|
|
5009
5009
|
_destroy() {
|
|
5010
5010
|
super._destroy(), this.root.destroy(), this.input.destroy(), this.nodeMap.clear();
|
|
5011
5011
|
}
|
|
5012
5012
|
};
|
|
5013
|
-
|
|
5013
|
+
O([_({ alias: "root.msaa" }), D("design:type", Boolean)], U.prototype, "msaa", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], U.prototype, "pixelate", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], U.prototype, "roundPixels", void 0), O([_(), D("design:type", Object)], U.prototype, "backgroundColor", void 0), O([_({
|
|
5014
5014
|
internal: !0,
|
|
5015
5015
|
fallback: !1
|
|
5016
|
-
}),
|
|
5016
|
+
}), D("design:type", Boolean)], U.prototype, "debug", void 0), O([_({
|
|
5017
5017
|
internal: !0,
|
|
5018
5018
|
fallback: !1
|
|
5019
|
-
}),
|
|
5019
|
+
}), D("design:type", Boolean)], U.prototype, "processPaused", void 0), O([_({
|
|
5020
5020
|
internal: !0,
|
|
5021
5021
|
default: () => de
|
|
5022
|
-
}),
|
|
5022
|
+
}), D("design:type", Object)], U.prototype, "fonts", void 0);
|
|
5023
5023
|
//#endregion
|
|
5024
5024
|
//#region src/scene/main/Transition.ts
|
|
5025
|
-
var xr, Sr = class extends
|
|
5025
|
+
var xr, Sr = class extends H {
|
|
5026
5026
|
constructor(e, t = []) {
|
|
5027
5027
|
super(), this.setProperties(e).append(t);
|
|
5028
5028
|
}
|
|
5029
5029
|
};
|
|
5030
|
-
Sr =
|
|
5030
|
+
Sr = O([x("Transition", {
|
|
5031
5031
|
effectMode: "transition",
|
|
5032
5032
|
duration: 2e3
|
|
5033
|
-
}),
|
|
5033
|
+
}), D("design:paramtypes", [typeof (xr = typeof Partial < "u" && Partial) == "function" ? xr : Object, Array])], Sr);
|
|
5034
5034
|
//#endregion
|
|
5035
5035
|
//#region src/scene/2d/Node2D.ts
|
|
5036
|
-
var Cr, wr = class extends
|
|
5036
|
+
var Cr, wr = class extends mr {
|
|
5037
5037
|
rotation = 0;
|
|
5038
5038
|
position = new y(0, 0, () => this.updateGlobalTransform());
|
|
5039
5039
|
scale = new y(1, 1, () => this.updateGlobalTransform());
|
|
@@ -5085,7 +5085,7 @@ var Cr, wr = class extends pr {
|
|
|
5085
5085
|
super._destroy(), this.position.destroy(), this.scale.destroy(), this.skew.destroy(), this.pivot.destroy(), this.extraTransform.destroy(), this.transform.destroy(), this.globalPosition.destroy(), this.globalScale.destroy(), this.globalSkew.destroy(), this.globalTransform.destroy();
|
|
5086
5086
|
}
|
|
5087
5087
|
};
|
|
5088
|
-
wr =
|
|
5088
|
+
wr = O([x("Node2D"), D("design:paramtypes", [typeof (Cr = typeof Partial < "u" && Partial) == "function" ? Cr : Object, Array])], wr);
|
|
5089
5089
|
//#endregion
|
|
5090
5090
|
//#region src/scene/2d/Camera2D.ts
|
|
5091
5091
|
var Tr, Er = class extends wr {
|
|
@@ -5129,7 +5129,7 @@ var Tr, Er = class extends wr {
|
|
|
5129
5129
|
return this.setZoom(this._zoom.x + e, this._zoom.y + t);
|
|
5130
5130
|
}
|
|
5131
5131
|
setZoom(e, t = e) {
|
|
5132
|
-
return this._zoom.set(
|
|
5132
|
+
return this._zoom.set(ft(e, this._minZoom.x, this._maxZoom.x), ft(t, this._minZoom.y, this._maxZoom.y)), this;
|
|
5133
5133
|
}
|
|
5134
5134
|
setZoomAtOrigin(e, t, n) {
|
|
5135
5135
|
let r;
|
|
@@ -5202,7 +5202,7 @@ var Tr, Er = class extends wr {
|
|
|
5202
5202
|
});
|
|
5203
5203
|
}
|
|
5204
5204
|
_getZoomByWheel(e, t) {
|
|
5205
|
-
let n = e.ctrlKey &&
|
|
5205
|
+
let n = e.ctrlKey && Ue ? 10 : 1, r = -e.deltaY * (e.deltaMode === 1 ? .05 : e.deltaMode ? 1 : .002) * n, i = Math.log(t) + r;
|
|
5206
5206
|
return Math.round(Math.exp(i) * 1e4) / 1e4;
|
|
5207
5207
|
}
|
|
5208
5208
|
_updateTransform() {
|
|
@@ -5232,19 +5232,104 @@ var Tr, Er = class extends wr {
|
|
|
5232
5232
|
};
|
|
5233
5233
|
}
|
|
5234
5234
|
};
|
|
5235
|
-
|
|
5235
|
+
O([_({
|
|
5236
5236
|
internal: !0,
|
|
5237
5237
|
fallback: !1
|
|
5238
|
-
}),
|
|
5238
|
+
}), D("design:type", Boolean)], Er.prototype, "spaceKey", void 0), O([_({
|
|
5239
5239
|
internal: !0,
|
|
5240
5240
|
fallback: !1
|
|
5241
|
-
}),
|
|
5241
|
+
}), D("design:type", Boolean)], Er.prototype, "grabbing", void 0), Er = O([x("Camera2D", {
|
|
5242
5242
|
processMode: "disabled",
|
|
5243
5243
|
renderMode: "disabled"
|
|
5244
|
-
}),
|
|
5244
|
+
}), D("design:paramtypes", [typeof (Tr = typeof Partial < "u" && Partial) == "function" ? Tr : Object, Array])], Er);
|
|
5245
|
+
//#endregion
|
|
5246
|
+
//#region src/scene/2d/element/connectionRouter.ts
|
|
5247
|
+
function Dr(e, t) {
|
|
5248
|
+
return Math.abs(e) >= Math.abs(t) ? {
|
|
5249
|
+
x: Math.sign(e) || 1,
|
|
5250
|
+
y: 0
|
|
5251
|
+
} : {
|
|
5252
|
+
x: 0,
|
|
5253
|
+
y: Math.sign(t) || 1
|
|
5254
|
+
};
|
|
5255
|
+
}
|
|
5256
|
+
function Or(e, t, n, r = {}) {
|
|
5257
|
+
let i = t.point, a = n.point, o = new oe();
|
|
5258
|
+
switch (e) {
|
|
5259
|
+
case "curved": {
|
|
5260
|
+
let e = t.dir ?? Dr(a.x - i.x, a.y - i.y), s = n.dir ?? Dr(i.x - a.x, i.y - a.y), c = Math.hypot(a.x - i.x, a.y - i.y), l = Math.max((r.stub ?? 16) * 2, c * .4), u = i.x + e.x * l, d = i.y + e.y * l, f = a.x + s.x * l, p = a.y + s.y * l;
|
|
5261
|
+
for (let e = 0; e <= 32; e++) {
|
|
5262
|
+
let t = e / 32, n = 1 - t, r = n * n * n, s = 3 * n * n * t, c = 3 * n * t * t, l = t * t * t, m = r * i.x + s * u + c * f + l * a.x, h = r * i.y + s * d + c * p + l * a.y;
|
|
5263
|
+
e === 0 ? o.moveTo(m, h) : o.lineTo(m, h);
|
|
5264
|
+
}
|
|
5265
|
+
break;
|
|
5266
|
+
}
|
|
5267
|
+
case "orthogonal": {
|
|
5268
|
+
let e = Ar(t, n, r);
|
|
5269
|
+
for (let t = 0; t < e.length; t++) t === 0 ? o.moveTo(e[t].x, e[t].y) : o.lineTo(e[t].x, e[t].y);
|
|
5270
|
+
break;
|
|
5271
|
+
}
|
|
5272
|
+
default:
|
|
5273
|
+
o.moveTo(i.x, i.y).lineTo(a.x, a.y);
|
|
5274
|
+
break;
|
|
5275
|
+
}
|
|
5276
|
+
return o;
|
|
5277
|
+
}
|
|
5278
|
+
function kr(e) {
|
|
5279
|
+
return Dr(e.x, e.y);
|
|
5280
|
+
}
|
|
5281
|
+
function Ar(e, t, n) {
|
|
5282
|
+
let r = e.point, i = t.point, a = n.stub ?? 16, o = kr(e.dir ?? Dr(i.x - r.x, i.y - r.y)), s = kr(t.dir ?? Dr(r.x - i.x, r.y - i.y)), c = {
|
|
5283
|
+
x: r.x + o.x * a,
|
|
5284
|
+
y: r.y + o.y * a
|
|
5285
|
+
}, l = {
|
|
5286
|
+
x: i.x + s.x * a,
|
|
5287
|
+
y: i.y + s.y * a
|
|
5288
|
+
}, u = [{
|
|
5289
|
+
x: r.x,
|
|
5290
|
+
y: r.y
|
|
5291
|
+
}, c], d = o.y === 0, f = s.y === 0;
|
|
5292
|
+
if (d && f) {
|
|
5293
|
+
let e = (c.x + l.x) / 2;
|
|
5294
|
+
u.push({
|
|
5295
|
+
x: e,
|
|
5296
|
+
y: c.y
|
|
5297
|
+
}, {
|
|
5298
|
+
x: e,
|
|
5299
|
+
y: l.y
|
|
5300
|
+
});
|
|
5301
|
+
} else if (!d && !f) {
|
|
5302
|
+
let e = (c.y + l.y) / 2;
|
|
5303
|
+
u.push({
|
|
5304
|
+
x: c.x,
|
|
5305
|
+
y: e
|
|
5306
|
+
}, {
|
|
5307
|
+
x: l.x,
|
|
5308
|
+
y: e
|
|
5309
|
+
});
|
|
5310
|
+
} else d ? u.push({
|
|
5311
|
+
x: l.x,
|
|
5312
|
+
y: c.y
|
|
5313
|
+
}) : u.push({
|
|
5314
|
+
x: c.x,
|
|
5315
|
+
y: l.y
|
|
5316
|
+
});
|
|
5317
|
+
return u.push(l, {
|
|
5318
|
+
x: i.x,
|
|
5319
|
+
y: i.y
|
|
5320
|
+
}), jr(u);
|
|
5321
|
+
}
|
|
5322
|
+
function jr(e) {
|
|
5323
|
+
let t = [];
|
|
5324
|
+
for (let n = 0; n < e.length; n++) {
|
|
5325
|
+
let r = e[n], i = t[t.length - 1];
|
|
5326
|
+
(!i || Math.abs(i.x - r.x) > .001 || Math.abs(i.y - r.y) > .001) && t.push(r);
|
|
5327
|
+
}
|
|
5328
|
+
return t;
|
|
5329
|
+
}
|
|
5245
5330
|
//#endregion
|
|
5246
5331
|
//#region src/css/parseCssFilter.ts
|
|
5247
|
-
var
|
|
5332
|
+
var Mr = {
|
|
5248
5333
|
brightness: 1,
|
|
5249
5334
|
contrast: 1,
|
|
5250
5335
|
grayscale: 0,
|
|
@@ -5254,12 +5339,12 @@ var Dr = {
|
|
|
5254
5339
|
saturate: 1,
|
|
5255
5340
|
sepia: 0
|
|
5256
5341
|
};
|
|
5257
|
-
function
|
|
5258
|
-
let t = new
|
|
5342
|
+
function Nr(e) {
|
|
5343
|
+
let t = new pt();
|
|
5259
5344
|
if (e === "none") return t;
|
|
5260
5345
|
let n = Te(e).reduce((e, { name: t, args: n }) => (e[t] = n[0].normalizedIntValue, e), {});
|
|
5261
|
-
Object.keys(
|
|
5262
|
-
n[e] = n[e] ??
|
|
5346
|
+
Object.keys(Mr).forEach((e) => {
|
|
5347
|
+
n[e] = n[e] ?? Mr[e];
|
|
5263
5348
|
});
|
|
5264
5349
|
for (let e in n) {
|
|
5265
5350
|
let r = n[e];
|
|
@@ -5294,7 +5379,7 @@ function Or(e) {
|
|
|
5294
5379
|
}
|
|
5295
5380
|
//#endregion
|
|
5296
5381
|
//#region src/css/parseCssTransformOrigin.ts
|
|
5297
|
-
function
|
|
5382
|
+
function Pr(e) {
|
|
5298
5383
|
let [t, n = t] = e.split(" ");
|
|
5299
5384
|
return [t, n].map((e) => {
|
|
5300
5385
|
switch (e = e.trim(), e) {
|
|
@@ -5309,11 +5394,11 @@ function kr(e) {
|
|
|
5309
5394
|
}
|
|
5310
5395
|
//#endregion
|
|
5311
5396
|
//#region src/scene/effects/ColorAdjustEffect.ts
|
|
5312
|
-
var
|
|
5397
|
+
var Fr, Ir, W = class extends H {
|
|
5313
5398
|
static {
|
|
5314
|
-
|
|
5399
|
+
Ir = this;
|
|
5315
5400
|
}
|
|
5316
|
-
static material = new
|
|
5401
|
+
static material = new F({ gl: {
|
|
5317
5402
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5318
5403
|
fragment: "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform float gamma;\nuniform float contrast;\nuniform float saturation;\nuniform float brightness;\nuniform float red;\nuniform float green;\nuniform float blue;\nuniform float alpha;\n\nvoid main(void) {\n vec4 c = texture2D(sampler, vUv);\n if (c.a > 0.0) {\n c.rgb /= c.a;\n vec3 rgb = pow(c.rgb, vec3(1. / gamma));\n rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);\n rgb.r *= red;\n rgb.g *= green;\n rgb.b *= blue;\n c.rgb = rgb * brightness;\n c.rgb *= c.a;\n }\n gl_FragColor = c * alpha;\n}"
|
|
5319
5404
|
} });
|
|
@@ -5322,7 +5407,7 @@ var Ar, jr, W = class extends U {
|
|
|
5322
5407
|
}
|
|
5323
5408
|
apply(e, t) {
|
|
5324
5409
|
t.redraw(e, () => {
|
|
5325
|
-
|
|
5410
|
+
I.draw(e, Ir.material, {
|
|
5326
5411
|
sampler: 0,
|
|
5327
5412
|
saturation: this.saturation,
|
|
5328
5413
|
contrast: this.contrast,
|
|
@@ -5336,18 +5421,18 @@ var Ar, jr, W = class extends U {
|
|
|
5336
5421
|
});
|
|
5337
5422
|
}
|
|
5338
5423
|
};
|
|
5339
|
-
|
|
5424
|
+
O([_({ fallback: 1 }), D("design:type", Number)], W.prototype, "saturation", void 0), O([_({ fallback: 1 }), D("design:type", Number)], W.prototype, "contrast", void 0), O([_({ fallback: 1 }), D("design:type", Number)], W.prototype, "brightness", void 0), O([_({ fallback: 1 }), D("design:type", Number)], W.prototype, "red", void 0), O([_({ fallback: 1 }), D("design:type", Number)], W.prototype, "green", void 0), O([_({ fallback: 1 }), D("design:type", Number)], W.prototype, "blue", void 0), O([_({ fallback: 1 }), D("design:type", Number)], W.prototype, "alpha", void 0), O([_({ fallback: 1 }), D("design:type", Number)], W.prototype, "gamma", void 0), W = Ir = O([x("ColorAdjustEffect"), D("design:paramtypes", [typeof (Fr = typeof Partial < "u" && Partial) == "function" ? Fr : Object, Array])], W);
|
|
5340
5425
|
//#endregion
|
|
5341
5426
|
//#region src/scene/effects/ColorFilterEffect.ts
|
|
5342
|
-
var
|
|
5427
|
+
var Lr, Rr, zr = class extends H {
|
|
5343
5428
|
static {
|
|
5344
|
-
|
|
5429
|
+
Rr = this;
|
|
5345
5430
|
}
|
|
5346
|
-
static material = new
|
|
5431
|
+
static material = new F({ gl: {
|
|
5347
5432
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5348
5433
|
fragment: "in vec2 vUv;\nuniform sampler2D sampler;\nuniform float m[20];\n\nvoid main(void) {\n vec4 c = texture2D(sampler, vUv);\n if (c.a > 0.0) {\n c.rgb /= c.a;\n }\n gl_FragColor = vec4(\n m[0] * c.r + m[1] * c.g + m[2] * c.b + m[3] * c.a + m[4] / 255.0,\n m[5] * c.r + m[6] * c.g + m[7] * c.b + m[8] * c.a + m[9] / 255.0,\n m[10] * c.r + m[11] * c.g + m[12] * c.b + m[13] * c.a + m[14] / 255.0,\n m[15] * c.r + m[16] * c.g + m[17] * c.b + m[18] * c.a + m[19] / 255.0\n );\n}"
|
|
5349
5434
|
} });
|
|
5350
|
-
_colorMatrix = new
|
|
5435
|
+
_colorMatrix = new pt();
|
|
5351
5436
|
constructor(e, t = []) {
|
|
5352
5437
|
super(), this.setProperties(e).append(t);
|
|
5353
5438
|
}
|
|
@@ -5391,25 +5476,25 @@ var Mr, Nr, Pr = class extends U {
|
|
|
5391
5476
|
break;
|
|
5392
5477
|
}
|
|
5393
5478
|
}), t.redraw(e, () => {
|
|
5394
|
-
|
|
5479
|
+
I.draw(e, Rr.material, {
|
|
5395
5480
|
sampler: 0,
|
|
5396
5481
|
m: r.toArray()
|
|
5397
5482
|
});
|
|
5398
5483
|
});
|
|
5399
5484
|
}
|
|
5400
5485
|
};
|
|
5401
|
-
|
|
5486
|
+
O([_(), D("design:type", String)], zr.prototype, "filter", void 0), zr = Rr = O([x("ColorFilterEffect"), D("design:paramtypes", [typeof (Lr = typeof Partial < "u" && Partial) == "function" ? Lr : Object, Array])], zr);
|
|
5402
5487
|
//#endregion
|
|
5403
5488
|
//#region src/scene/effects/ColorOverlayEffect.ts
|
|
5404
|
-
var
|
|
5489
|
+
var Br, Vr, Hr = 50, Ur = class extends H {
|
|
5405
5490
|
static {
|
|
5406
|
-
|
|
5491
|
+
Vr = this;
|
|
5407
5492
|
}
|
|
5408
|
-
static material = new
|
|
5493
|
+
static material = new F({ gl: {
|
|
5409
5494
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5410
5495
|
fragment: `precision mediump float;
|
|
5411
5496
|
uniform sampler2D sampler;
|
|
5412
|
-
uniform vec4 colors[${
|
|
5497
|
+
uniform vec4 colors[${Hr}];
|
|
5413
5498
|
varying vec2 vUv;
|
|
5414
5499
|
|
|
5415
5500
|
float calcWidth() {
|
|
@@ -5418,7 +5503,7 @@ float calcWidth() {
|
|
|
5418
5503
|
|
|
5419
5504
|
int calcCount() {
|
|
5420
5505
|
int count = 0;
|
|
5421
|
-
for (int i = 0; i < ${
|
|
5506
|
+
for (int i = 0; i < ${Hr}; i++) {
|
|
5422
5507
|
if (colors[i] != vec4(0,0,0,0)){
|
|
5423
5508
|
count++;
|
|
5424
5509
|
}
|
|
@@ -5430,7 +5515,7 @@ vec4 calcColor(float x) {
|
|
|
5430
5515
|
float perUnit = calcWidth() / float(calcCount());
|
|
5431
5516
|
int index = int(x / perUnit);
|
|
5432
5517
|
|
|
5433
|
-
for(int i=0; i<${
|
|
5518
|
+
for(int i=0; i<${Hr}; i++){
|
|
5434
5519
|
if(i==index){
|
|
5435
5520
|
return colors[i];
|
|
5436
5521
|
}
|
|
@@ -5445,7 +5530,7 @@ void main(void) {
|
|
|
5445
5530
|
gl_FragColor = vec4(mix(color.rgb, mask.rgb, color.a * mask.a), color.a);
|
|
5446
5531
|
}`
|
|
5447
5532
|
} });
|
|
5448
|
-
_color = new
|
|
5533
|
+
_color = new T();
|
|
5449
5534
|
constructor(e, t = []) {
|
|
5450
5535
|
super(), this.setProperties(e).append(t);
|
|
5451
5536
|
}
|
|
@@ -5456,31 +5541,31 @@ void main(void) {
|
|
|
5456
5541
|
let t = this._color.toArray();
|
|
5457
5542
|
return t[3] = this.alpha, t;
|
|
5458
5543
|
});
|
|
5459
|
-
for (; t.length <
|
|
5544
|
+
for (; t.length < Hr;) t.push([
|
|
5460
5545
|
0,
|
|
5461
5546
|
0,
|
|
5462
5547
|
0,
|
|
5463
5548
|
0
|
|
5464
5549
|
]);
|
|
5465
|
-
|
|
5550
|
+
I.draw(e, Vr.material, {
|
|
5466
5551
|
sampler: 0,
|
|
5467
|
-
colors: t.slice(0,
|
|
5552
|
+
colors: t.slice(0, Hr).flatMap((e) => e)
|
|
5468
5553
|
});
|
|
5469
5554
|
});
|
|
5470
5555
|
}
|
|
5471
5556
|
};
|
|
5472
|
-
|
|
5557
|
+
O([_({ default: () => [] }), D("design:type", Array)], Ur.prototype, "colors", void 0), O([_({ fallback: .5 }), D("design:type", Number)], Ur.prototype, "alpha", void 0), Ur = Vr = O([x("ColorOverlayEffect"), D("design:paramtypes", [typeof (Br = typeof Partial < "u" && Partial) == "function" ? Br : Object, Array])], Ur);
|
|
5473
5558
|
//#endregion
|
|
5474
5559
|
//#region src/scene/effects/ColorRemoveEffect.ts
|
|
5475
|
-
var
|
|
5560
|
+
var Wr, Gr, Kr = class extends H {
|
|
5476
5561
|
static {
|
|
5477
|
-
|
|
5562
|
+
Gr = this;
|
|
5478
5563
|
}
|
|
5479
|
-
static material = new
|
|
5564
|
+
static material = new F({ gl: {
|
|
5480
5565
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5481
5566
|
fragment: "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform float epsilon;\nconst int MAX_COLORS = 50;\nuniform vec3 originalColors[MAX_COLORS];\n\nvoid main(void) {\n vec4 color = texture2D(sampler, vUv);\n\n for (int i = 0; i < MAX_COLORS; i++) {\n vec3 origColor = originalColors[i];\n if (origColor.r < 0.0) {\n break;\n }\n vec3 colorDiff = origColor - color.rgb;\n if (length(colorDiff) < epsilon) {\n gl_FragColor = vec4(0, 0, 0, 0);\n return;\n }\n }\n\n gl_FragColor = color;\n}"
|
|
5482
5567
|
} });
|
|
5483
|
-
_color = new
|
|
5568
|
+
_color = new T();
|
|
5484
5569
|
constructor(e, t = []) {
|
|
5485
5570
|
super(), this.setProperties(e).append(t);
|
|
5486
5571
|
}
|
|
@@ -5494,7 +5579,7 @@ var zr, Br, Vr = class extends U {
|
|
|
5494
5579
|
r.slice(0, 50).forEach((e, t) => {
|
|
5495
5580
|
n[t * 3] = e[0], n[t * 3 + 1] = e[1], n[t * 3 + 2] = e[2];
|
|
5496
5581
|
}), t.redraw(e, () => {
|
|
5497
|
-
|
|
5582
|
+
I.draw(e, Gr.material, {
|
|
5498
5583
|
sampler: 0,
|
|
5499
5584
|
epsilon: this.epsilon,
|
|
5500
5585
|
originalColors: n
|
|
@@ -5502,19 +5587,19 @@ var zr, Br, Vr = class extends U {
|
|
|
5502
5587
|
});
|
|
5503
5588
|
}
|
|
5504
5589
|
};
|
|
5505
|
-
|
|
5590
|
+
O([_({ default: () => [] }), D("design:type", Array)], Kr.prototype, "colors", void 0), O([_({ fallback: .5 }), D("design:type", Number)], Kr.prototype, "epsilon", void 0), Kr = Gr = O([x("ColorRemoveEffect"), D("design:paramtypes", [typeof (Wr = typeof Partial < "u" && Partial) == "function" ? Wr : Object, Array])], Kr);
|
|
5506
5591
|
//#endregion
|
|
5507
5592
|
//#region src/scene/effects/ColorReplaceEffect.ts
|
|
5508
|
-
var
|
|
5593
|
+
var qr, Jr, Yr = 50, Xr = class extends H {
|
|
5509
5594
|
static {
|
|
5510
|
-
|
|
5595
|
+
Jr = this;
|
|
5511
5596
|
}
|
|
5512
|
-
static material = new
|
|
5597
|
+
static material = new F({ gl: {
|
|
5513
5598
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5514
5599
|
fragment: `varying vec2 vUv;
|
|
5515
5600
|
uniform sampler2D sampler;
|
|
5516
5601
|
uniform float epsilon;
|
|
5517
|
-
const int MAX_COLORS = ${
|
|
5602
|
+
const int MAX_COLORS = ${Yr};
|
|
5518
5603
|
uniform vec3 originalColors[MAX_COLORS];
|
|
5519
5604
|
uniform vec3 targetColors[MAX_COLORS];
|
|
5520
5605
|
|
|
@@ -5542,7 +5627,7 @@ void main(void) {
|
|
|
5542
5627
|
}
|
|
5543
5628
|
}`
|
|
5544
5629
|
} });
|
|
5545
|
-
_color = new
|
|
5630
|
+
_color = new T();
|
|
5546
5631
|
constructor(e, t = []) {
|
|
5547
5632
|
super(), this.setProperties(e).append(t);
|
|
5548
5633
|
}
|
|
@@ -5551,8 +5636,8 @@ void main(void) {
|
|
|
5551
5636
|
this._color.value = e[0];
|
|
5552
5637
|
let t = this._color.toArray().slice(0, 3);
|
|
5553
5638
|
return this._color.value = e[1], [t, this._color.toArray().slice(0, 3)];
|
|
5554
|
-
}), r = this.epsilon, i = new Float32Array(
|
|
5555
|
-
for (; n.length <
|
|
5639
|
+
}), r = this.epsilon, i = new Float32Array(Yr * 3), a = new Float32Array(Yr * 3);
|
|
5640
|
+
for (; n.length < Yr;) n.push([[
|
|
5556
5641
|
-1,
|
|
5557
5642
|
0,
|
|
5558
5643
|
0
|
|
@@ -5562,10 +5647,10 @@ void main(void) {
|
|
|
5562
5647
|
0,
|
|
5563
5648
|
1
|
|
5564
5649
|
]]);
|
|
5565
|
-
n.slice(0,
|
|
5650
|
+
n.slice(0, Yr).forEach(([e, t], n) => {
|
|
5566
5651
|
i[n * 3] = e[0], i[n * 3 + 1] = e[1], i[n * 3 + 2] = e[2], a[n * 3] = t[0], a[n * 3 + 1] = t[1], a[n * 3 + 2] = t[2];
|
|
5567
5652
|
}), t.redraw(e, () => {
|
|
5568
|
-
|
|
5653
|
+
I.draw(e, Jr.material, {
|
|
5569
5654
|
sampler: 0,
|
|
5570
5655
|
epsilon: r,
|
|
5571
5656
|
originalColors: i,
|
|
@@ -5574,17 +5659,17 @@ void main(void) {
|
|
|
5574
5659
|
});
|
|
5575
5660
|
}
|
|
5576
5661
|
};
|
|
5577
|
-
|
|
5662
|
+
O([_({ default: () => [] }), D("design:type", Array)], Xr.prototype, "colors", void 0), O([_({ fallback: .05 }), D("design:type", Number)], Xr.prototype, "epsilon", void 0), Xr = Jr = O([x("ColorReplaceEffect"), D("design:paramtypes", [typeof (qr = typeof Partial < "u" && Partial) == "function" ? qr : Object, Array])], Xr);
|
|
5578
5663
|
//#endregion
|
|
5579
5664
|
//#region src/scene/effects/DrawboardEffect.frag?raw
|
|
5580
|
-
var
|
|
5665
|
+
var Zr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nuniform vec2 inputSize;\nuniform vec2 zoom;\nuniform vec2 translate;\nuniform float gridScale;\nuniform vec2 gridSize;\nuniform int checkerboard;\nuniform int checkerboardStyle;\nuniform float dotBackgroundBaseColor;\nuniform float dotBackgroundZoomedOutColor;\nuniform float dotColorDiff;\nuniform int pixelGrid;\nuniform int watermark;\nuniform sampler2D watermarkTexture;\nuniform vec2 watermarkSize;\nuniform vec2 watermarkOffset;\nuniform vec2 watermarkSpacing;\nuniform float watermarkRotation;\nuniform float watermarkAlpha;\n\nconst float VIEWPORT_SPACE_MIN_DOT_RADIUS = 0.5;\nconst float CANVAS_SPACE_DOT_RADIUS = 1.;\nconst float CANVAS_SPACE_DOT_GRID_SIZE_PX = 16.;\n\nconst int CHECKERBOARD_STYLE_NONE = 0;\nconst int CHECKERBOARD_STYLE_GRID = 1;\nconst int CHECKERBOARD_STYLE_GRID_DARK = 2;\nconst int CHECKERBOARD_STYLE_DOTS = 3;\n\nfloat _round(float val) {\n return floor(val + .5);\n}\n\nvec2 _round(vec2 pt) {\n return floor(pt + .5);\n}\n\nfloat scaledGridSize(float zoomScale) {\n if (zoomScale < 0.03125) {\n return 32.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.0625) {\n return 16.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.125) {\n return 8.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.25) {\n return 4.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.5) {\n return 2.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else {\n return CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n}\n\nvec4 renderCheckerboard(vec2 coord, vec4 color) {\n float value;\n if (checkerboardStyle == CHECKERBOARD_STYLE_GRID) {\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n value = fractValue.x * fractValue.y < 0.0 ? 1.0 : 0.95;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_GRID_DARK) {\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n value = fractValue.x * fractValue.y < 0.0 ? 0.12 : 0.17;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_DOTS) {\n float zoomScale = zoom.x;\n float gridPixelSize = scaledGridSize(zoomScale);\n float zoomInterpolationFactor = smoothstep(0.5, 1.0, zoomScale);\n float dotColor = dotBackgroundZoomedOutColor + dotColorDiff * zoomInterpolationFactor;\n vec2 nearestGridPoint = _round(coord / gridPixelSize) * gridPixelSize;\n float canvasSpaceDist = length(coord - nearestGridPoint);\n float viewportSpaceDist = canvasSpaceDist * zoomScale;\n float viewportSpaceDotRadius = max(VIEWPORT_SPACE_MIN_DOT_RADIUS, CANVAS_SPACE_DOT_RADIUS * zoomScale);\n float dist = 1.0 - smoothstep(0., 1., (viewportSpaceDist - viewportSpaceDotRadius + .5));\n value = mix(dotBackgroundBaseColor, dotColor, dist);\n }\n return vec4(value * (1.0 - color.a) + color.rgb, 1);\n}\n\nvec4 renderPixelGrid(vec2 coord, vec4 color) {\n vec3 rgb = color.rgb;\n vec2 corner = fract(coord);\n float gridWeight = max(float(corner.x < gridSize.x), float(corner.y < gridSize.y));\n vec3 gridColor;\n vec3 weights = vec3(0.299, 0.587, 0.114);\n float c2 = dot(rgb * rgb, weights);\n float luminance = sqrt(c2);\n if (luminance > 0.5) {\n float target = (luminance - 0.05) / luminance;\n gridColor = rgb * target;\n }\n else {\n float target = luminance * 0.8 + 0.15;\n float c1 = dot(rgb, weights);\n float a = 1.0 - 2.0 * c1 + c2;\n float b = c2 - c1;\n gridColor = mix(rgb, vec3(1), (b + sqrt(b * b - a * (c2 - target * target))) / a);\n }\n return vec4(mix(rgb, gridColor, gridWeight), color.a);\n}\n\nvec4 renderWatermark(vec2 coord, vec4 color) {\n float hw = watermarkSize.x * 0.5;\n float hh = watermarkSize.y * 0.5;\n float c = cos(-watermarkRotation);\n float s = sin(-watermarkRotation);\n vec2 blockSize = watermarkSize + watermarkSpacing;\n vec2 tiles = max(floor(inputSize / blockSize), vec2(1.0));\n vec2 gridCoverage = tiles * blockSize;\n vec2 startPos = watermarkOffset;\n vec2 localPix = coord - startPos;\n vec2 blockIndex = floor(localPix / blockSize);\n vec2 wmCenter = startPos + blockIndex * blockSize + watermarkSize * 0.5 + watermarkSpacing / 2.0;\n vec2 local = coord - wmCenter;\n vec2 inv = vec2(\n local.x * c + local.y * s,\n -local.x * s + local.y * c\n );\n if (inv.x >= -hw && inv.x <= hw && inv.y >= -hh && inv.y <= hh) {\n vec2 wmUV = (inv + vec2(hw, hh)) / watermarkSize;\n vec4 wmColor = texture(watermarkTexture, wmUV);\n float alpha = wmColor.a * watermarkAlpha;\n return mix(color, wmColor, alpha);\n } else {\n return color;\n }\n}\n\nvoid main(void) {\n vec4 color = texture(uTexture, vUv);\n vec2 coord = vec2(vUv.x, 1.0 - vUv.y);\n coord = (coord * inputSize - translate) / zoom;\n if (checkerboard > 0) {\n color = renderCheckerboard(coord, color);\n }\n if (watermark > 0) {\n color = renderWatermark(coord, color);\n }\n if (pixelGrid > 0) {\n color = renderPixelGrid(coord, color);\n }\n gl_FragColor = color;\n}\n", Qr, $r, G = class extends H {
|
|
5581
5666
|
static {
|
|
5582
|
-
|
|
5667
|
+
$r = this;
|
|
5583
5668
|
}
|
|
5584
5669
|
_watermark;
|
|
5585
|
-
static material = new
|
|
5670
|
+
static material = new F({ gl: {
|
|
5586
5671
|
vertex: "attribute vec2 position;\nin vec2 uv;\nuniform mat3 projectionMatrix;\nuniform mat3 viewMatrix;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position.xy, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5587
|
-
fragment:
|
|
5672
|
+
fragment: Zr
|
|
5588
5673
|
} });
|
|
5589
5674
|
constructor(e, t = []) {
|
|
5590
5675
|
super(), this.setProperties(e).append(t);
|
|
@@ -5608,7 +5693,7 @@ var Kr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
|
|
|
5608
5693
|
t.redraw(e, () => {
|
|
5609
5694
|
this._watermark ? this._watermark.activate(e, 1) : e.texture.unbind(1);
|
|
5610
5695
|
let n = e.shader.uniforms.viewMatrix, r = this._watermark ? [this.watermarkWidth, this.watermarkWidth * this._watermark.height / this._watermark.width] : [0, 0], i = Math.max(r[0], r[1]);
|
|
5611
|
-
|
|
5696
|
+
I.draw(e, $r.material, {
|
|
5612
5697
|
uTexture: 0,
|
|
5613
5698
|
inputSize: [t.width, t.height],
|
|
5614
5699
|
zoom: [n[0], n[4]],
|
|
@@ -5632,20 +5717,20 @@ var Kr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
|
|
|
5632
5717
|
});
|
|
5633
5718
|
}
|
|
5634
5719
|
};
|
|
5635
|
-
|
|
5720
|
+
O([_({ fallback: !1 }), D("design:type", Boolean)], G.prototype, "checkerboard", void 0), O([_({ fallback: "grid" }), D("design:type", Object)], G.prototype, "checkerboardStyle", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], G.prototype, "pixelGrid", void 0), O([_(), D("design:type", String)], G.prototype, "watermark", void 0), O([_({ fallback: 100 }), D("design:type", Number)], G.prototype, "watermarkWidth", void 0), O([_({ fallback: .05 }), D("design:type", Number)], G.prototype, "watermarkAlpha", void 0), O([_({ fallback: .5236 }), D("design:type", Number)], G.prototype, "watermarkRotation", void 0), G = $r = O([x("DrawboardEffect"), D("design:paramtypes", [typeof (Qr = typeof Partial < "u" && Partial) == "function" ? Qr : Object, Array])], G);
|
|
5636
5721
|
//#endregion
|
|
5637
5722
|
//#region src/scene/effects/GaussianBlurEffect.ts
|
|
5638
|
-
var
|
|
5723
|
+
var ei, ti, ni = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(void) {\n gl_FragColor = vec4(0.0);\n float flag = 0.0;\n for (int i = 0; i < 9; i++) {\n vec2 uv = vUv[i];\n if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) {\n flag = 1.0;\n break;\n }\n }\n if (flag == 1.0) {\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n } else {\n gl_FragColor += texture2D(sampler, vUv[0]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[1]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[2]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[3]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[5]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[6]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[7]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[8]) * 0.028532;\n }\n}", ri = class extends H {
|
|
5639
5724
|
static {
|
|
5640
|
-
|
|
5725
|
+
ti = this;
|
|
5641
5726
|
}
|
|
5642
|
-
static materialX = new
|
|
5727
|
+
static materialX = new F({ gl: {
|
|
5643
5728
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nuniform float uStrength;\nvarying vec2 vUv[9];\n\nvoid main(void) {\n gl_Position = vec4(position, 0, 1);\n vUv[0] = uv + vec2(-4.0 * uStrength, 0.0);\n vUv[1] = uv + vec2(-3.0 * uStrength, 0.0);\n vUv[2] = uv + vec2(-2.0 * uStrength, 0.0);\n vUv[3] = uv + vec2(-1.0 * uStrength, 0.0);\n vUv[4] = uv + vec2(0.0 * uStrength, 0.0);\n vUv[5] = uv + vec2(1.0 * uStrength, 0.0);\n vUv[6] = uv + vec2(2.0 * uStrength, 0.0);\n vUv[7] = uv + vec2(3.0 * uStrength, 0.0);\n vUv[8] = uv + vec2(4.0 * uStrength, 0.0);\n}",
|
|
5644
|
-
fragment:
|
|
5729
|
+
fragment: ni
|
|
5645
5730
|
} });
|
|
5646
|
-
static materialY = new
|
|
5731
|
+
static materialY = new F({ gl: {
|
|
5647
5732
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nuniform float uStrength;\nvarying vec2 vUv[9];\n\nvoid main(void) {\n gl_Position = vec4(position, 0, 1);\n vUv[0] = uv + vec2(0.0, -4.0 * uStrength);\n vUv[1] = uv + vec2(0.0, -3.0 * uStrength);\n vUv[2] = uv + vec2(0.0, -2.0 * uStrength);\n vUv[3] = uv + vec2(0.0, -1.0 * uStrength);\n vUv[4] = uv + vec2(0.0, 0.0 * uStrength);\n vUv[5] = uv + vec2(0.0, 1.0 * uStrength);\n vUv[6] = uv + vec2(0.0, 2.0 * uStrength);\n vUv[7] = uv + vec2(0.0, 3.0 * uStrength);\n vUv[8] = uv + vec2(0.0, 4.0 * uStrength);\n}",
|
|
5648
|
-
fragment:
|
|
5733
|
+
fragment: ni
|
|
5649
5734
|
} });
|
|
5650
5735
|
constructor(e, t = []) {
|
|
5651
5736
|
super(), this.setProperties(e).append(t);
|
|
@@ -5653,39 +5738,39 @@ var Yr, Xr, Zr = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(
|
|
|
5653
5738
|
apply(e, t) {
|
|
5654
5739
|
let n = 1 / t.width, r = 1 / t.height, i = Math.max(this.quality, 1);
|
|
5655
5740
|
for (let r = 0; r < i; r++) t.redraw(e, () => {
|
|
5656
|
-
|
|
5741
|
+
I.draw(e, ti.materialX, {
|
|
5657
5742
|
sampler: 0,
|
|
5658
5743
|
uStrength: n * (this.strength / i)
|
|
5659
5744
|
});
|
|
5660
5745
|
});
|
|
5661
5746
|
for (let n = 0; n < i; n++) t.redraw(e, () => {
|
|
5662
|
-
|
|
5747
|
+
I.draw(e, ti.materialY, {
|
|
5663
5748
|
sampler: 0,
|
|
5664
5749
|
uStrength: r * (this.strength / i)
|
|
5665
5750
|
});
|
|
5666
5751
|
});
|
|
5667
5752
|
}
|
|
5668
5753
|
};
|
|
5669
|
-
|
|
5754
|
+
O([_({ fallback: 4 }), D("design:type", Number)], ri.prototype, "strength", void 0), O([_({ fallback: 3 }), D("design:type", Number)], ri.prototype, "quality", void 0), ri = ti = O([x("GaussianBlurEffect"), D("design:paramtypes", [typeof (ei = typeof Partial < "u" && Partial) == "function" ? ei : Object, Array])], ri);
|
|
5670
5755
|
//#endregion
|
|
5671
5756
|
//#region src/scene/effects/DropShadowEffect.ts
|
|
5672
|
-
var
|
|
5757
|
+
var ii, ai, oi = class extends H {
|
|
5673
5758
|
static {
|
|
5674
|
-
|
|
5759
|
+
ai = this;
|
|
5675
5760
|
}
|
|
5676
|
-
static material = new
|
|
5761
|
+
static material = new F({ gl: {
|
|
5677
5762
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5678
5763
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform float uAlpha;\nuniform vec3 uColor;\nuniform vec2 uOffset;\nuniform vec4 uInputSize;\n\nvoid main(void) {\n vec4 sample = texture2D(sampler, vUv + uOffset * uInputSize.zw);\n sample.rgb = uColor.rgb * sample.a;\n sample *= uAlpha;\n gl_FragColor = sample;\n}"
|
|
5679
5764
|
} });
|
|
5680
|
-
blurEffect = new
|
|
5681
|
-
viewport3 = new
|
|
5682
|
-
_color = new
|
|
5765
|
+
blurEffect = new ri();
|
|
5766
|
+
viewport3 = new V();
|
|
5767
|
+
_color = new T();
|
|
5683
5768
|
constructor(e, t = []) {
|
|
5684
5769
|
super(), this.setProperties(e).append(t);
|
|
5685
5770
|
}
|
|
5686
5771
|
apply(e, t) {
|
|
5687
5772
|
this.viewport3.activateWithCopy(e, t), this.viewport3.redraw(e, () => {
|
|
5688
|
-
this._color.value = this.color,
|
|
5773
|
+
this._color.value = this.color, I.draw(e, ai.material, {
|
|
5689
5774
|
sampler: 0,
|
|
5690
5775
|
uAlpha: this._color.a,
|
|
5691
5776
|
uColor: this._color.toArray().slice(0, 3),
|
|
@@ -5698,18 +5783,18 @@ var $r, ei, ti = class extends U {
|
|
|
5698
5783
|
]
|
|
5699
5784
|
});
|
|
5700
5785
|
}), this.blurEffect.strength = this.blur, this.blurEffect.apply(e, this.viewport3), t.redraw(e, () => {
|
|
5701
|
-
this.viewport3.texture.activate(e, 1),
|
|
5786
|
+
this.viewport3.texture.activate(e, 1), I.draw(e, Yn.instance, { sampler: 1 }), this.shadowOnly || I.draw(e, Yn.instance, { sampler: 0 }), e.texture.unbind(1);
|
|
5702
5787
|
});
|
|
5703
5788
|
}
|
|
5704
5789
|
};
|
|
5705
|
-
|
|
5790
|
+
O([_({ fallback: "#000000FF" }), D("design:type", Object)], oi.prototype, "color", void 0), O([_({ fallback: 4 }), D("design:type", Number)], oi.prototype, "blur", void 0), O([_({ fallback: 4 }), D("design:type", Number)], oi.prototype, "offsetX", void 0), O([_({ fallback: 4 }), D("design:type", Number)], oi.prototype, "offsetY", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], oi.prototype, "shadowOnly", void 0), oi = ai = O([x("DropShadowEffect"), D("design:paramtypes", [typeof (ii = typeof Partial < "u" && Partial) == "function" ? ii : Object, Array])], oi);
|
|
5706
5791
|
//#endregion
|
|
5707
5792
|
//#region src/scene/effects/EmbossEffect.ts
|
|
5708
|
-
var
|
|
5793
|
+
var si, ci, li = class extends H {
|
|
5709
5794
|
static {
|
|
5710
|
-
|
|
5795
|
+
ci = this;
|
|
5711
5796
|
}
|
|
5712
|
-
static material = new
|
|
5797
|
+
static material = new F({ gl: {
|
|
5713
5798
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5714
5799
|
fragment: "precision mediump float;\nuniform sampler2D sampler;\nuniform vec4 inputSize;\nuniform float strength;\nvarying vec2 vUv;\n\nvoid main(void) {\n vec2 onePixel = inputSize.zw;\n vec4 color;\n color.rgb = vec3(0.5);\n color -= texture2D(sampler, vUv - onePixel) * strength;\n color += texture2D(sampler, vUv + onePixel) * strength;\n color.rgb = vec3((color.r + color.g + color.b) / 3.0);\n float alpha = texture2D(sampler, vUv).a;\n gl_FragColor = vec4(color.rgb * alpha, alpha);\n}"
|
|
5715
5800
|
} });
|
|
@@ -5718,7 +5803,7 @@ var ni, ri, ii = class extends U {
|
|
|
5718
5803
|
}
|
|
5719
5804
|
apply(e, t) {
|
|
5720
5805
|
t.redraw(e, () => {
|
|
5721
|
-
|
|
5806
|
+
I.draw(e, ci.material, {
|
|
5722
5807
|
sampler: 0,
|
|
5723
5808
|
strength: this.strength,
|
|
5724
5809
|
inputSize: [
|
|
@@ -5731,14 +5816,14 @@ var ni, ri, ii = class extends U {
|
|
|
5731
5816
|
});
|
|
5732
5817
|
}
|
|
5733
5818
|
};
|
|
5734
|
-
|
|
5819
|
+
O([_({ fallback: 5 }), D("design:type", Number)], li.prototype, "strength", void 0), li = ci = O([x("EmbossEffect"), D("design:paramtypes", [typeof (si = typeof Partial < "u" && Partial) == "function" ? si : Object, Array])], li);
|
|
5735
5820
|
//#endregion
|
|
5736
5821
|
//#region src/scene/effects/GlitchEffect.ts
|
|
5737
|
-
var
|
|
5822
|
+
var ui, di, K = class extends H {
|
|
5738
5823
|
static {
|
|
5739
|
-
|
|
5824
|
+
di = this;
|
|
5740
5825
|
}
|
|
5741
|
-
static material = new
|
|
5826
|
+
static material = new F({ gl: {
|
|
5742
5827
|
vertex: "in vec2 position;\nin vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5743
5828
|
fragment: "\nin vec2 vUv;\nuniform sampler2D sampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\nuniform float aspect;\n\nuniform sampler2D displacementMap;\nuniform float offset;\nuniform float sinDir;\nuniform float cosDir;\nuniform int fillMode;\n\nuniform float seed;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nconst int TRANSPARENT = 0;\nconst int ORIGINAL = 1;\nconst int LOOP = 2;\nconst int CLAMP = 3;\nconst int MIRROR = 4;\n\nvoid main(void) {\n vec2 coord = (vUv * filterArea.xy) / dimensions;\n\n if (coord.x > 1.0 || coord.y > 1.0) {\n return;\n }\n\n float cx = coord.x - 0.5;\n float cy = (coord.y - 0.5) * aspect;\n float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5;\n\n // displacementMap: repeat\n // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny);\n\n // displacementMap: mirror\n ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny);\n\n vec4 dc = texture(displacementMap, vec2(0.5, ny));\n\n float displacement = (dc.r - dc.g) * (offset / filterArea.x);\n\n coord = vUv + vec2(cosDir * displacement, sinDir * displacement * aspect);\n\n if (fillMode == CLAMP) {\n coord = clamp(coord, filterClamp.xy, filterClamp.zw);\n } else {\n if (coord.x > filterClamp.z) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.x -= filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x = filterClamp.z * 2.0 - coord.x;\n }\n } else if (coord.x < filterClamp.x) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.x += filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x *= -filterClamp.z;\n }\n }\n\n if (coord.y > filterClamp.w) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.y -= filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y = filterClamp.w * 2.0 - coord.y;\n }\n } else if (coord.y < filterClamp.y) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.y += filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y *= -filterClamp.w;\n }\n }\n }\n\n gl_FragColor.r = texture(sampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r;\n gl_FragColor.g = texture(sampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g;\n gl_FragColor.b = texture(sampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b;\n gl_FragColor.a = texture(sampler, coord).a;\n}"
|
|
5744
5829
|
} });
|
|
@@ -5748,7 +5833,7 @@ var ai, oi, K = class extends U {
|
|
|
5748
5833
|
_offsets;
|
|
5749
5834
|
_needsRedraw = !1;
|
|
5750
5835
|
constructor(e, t = []) {
|
|
5751
|
-
super(), this.setProperties(e).append(t), this._canvas = document.createElement("canvas"), this._canvas.width = 4, this._canvas.height = this.sampleSize, this._texture = new
|
|
5836
|
+
super(), this.setProperties(e).append(t), this._canvas = document.createElement("canvas"), this._canvas.width = 4, this._canvas.height = this.sampleSize, this._texture = new R(this._canvas), this._sizes = new Float32Array(this.slices), this._offsets = new Float32Array(this.slices);
|
|
5752
5837
|
}
|
|
5753
5838
|
redraw() {
|
|
5754
5839
|
let e = this.sampleSize, t = this._texture, n = this._canvas.getContext("2d");
|
|
@@ -5765,7 +5850,7 @@ var ai, oi, K = class extends U {
|
|
|
5765
5850
|
this._needsRedraw || (this._needsRedraw = !0, this.redraw());
|
|
5766
5851
|
let n = t.width, r = t.height, i = this.direction * (Math.PI / 180), a = Math.sin(i), o = Math.cos(i);
|
|
5767
5852
|
t.redraw(e, () => {
|
|
5768
|
-
this._texture.activate(e, 1),
|
|
5853
|
+
this._texture.activate(e, 1), I.draw(e, di.material, {
|
|
5769
5854
|
sampler: 0,
|
|
5770
5855
|
filterClamp: [
|
|
5771
5856
|
0,
|
|
@@ -5794,14 +5879,14 @@ var ai, oi, K = class extends U {
|
|
|
5794
5879
|
});
|
|
5795
5880
|
}
|
|
5796
5881
|
};
|
|
5797
|
-
|
|
5882
|
+
O([_({ fallback: 10 }), D("design:type", Number)], K.prototype, "slices", void 0), O([_({ fallback: 512 }), D("design:type", Number)], K.prototype, "sampleSize", void 0), O([_({ fallback: 100 }), D("design:type", Number)], K.prototype, "offset", void 0), O([_({ fallback: 0 }), D("design:type", Number)], K.prototype, "direction", void 0), O([_({ fallback: 2 }), D("design:type", Number)], K.prototype, "fillMode", void 0), O([_({ fallback: 0 }), D("design:type", Number)], K.prototype, "seed", void 0), O([_({ default: () => [2, 2] }), D("design:type", Array)], K.prototype, "red", void 0), O([_({ default: () => [-10, 4] }), D("design:type", Array)], K.prototype, "green", void 0), O([_({ default: () => [10, -4] }), D("design:type", Array)], K.prototype, "blue", void 0), K = di = O([x("GlitchEffect"), D("design:paramtypes", [typeof (ui = typeof Partial < "u" && Partial) == "function" ? ui : Object, Array])], K);
|
|
5798
5883
|
//#endregion
|
|
5799
5884
|
//#region src/scene/effects/GodrayEffect.ts
|
|
5800
|
-
var
|
|
5885
|
+
var fi, pi, mi = "vec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 permute(vec4 x) {\n return mod289(((x * 34.0) + 1.0) * x);\n}\nvec4 taylorInvSqrt(vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\nvec3 fade(vec3 t) {\n return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);\n}\n// Classic Perlin noise, periodic variant\nfloat pnoise(vec3 P, vec3 rep) {\n vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period\n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n vec3 g000 = vec3(gx0.x, gy0.x, gz0.x);\n vec3 g100 = vec3(gx0.y, gy0.y, gz0.y);\n vec3 g010 = vec3(gx0.z, gy0.z, gz0.z);\n vec3 g110 = vec3(gx0.w, gy0.w, gz0.w);\n vec3 g001 = vec3(gx1.x, gy1.x, gz1.x);\n vec3 g101 = vec3(gx1.y, gy1.y, gz1.y);\n vec3 g011 = vec3(gx1.z, gy1.z, gz1.z);\n vec3 g111 = vec3(gx1.w, gy1.w, gz1.w);\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\nfloat turb(vec3 P, vec3 rep, float lacunarity, float gain) {\n float sum = 0.0;\n float sc = 1.0;\n float totalgain = 1.0;\n for (float i = 0.0; i < 6.0; i++) {\n sum += totalgain * pnoise(P * sc, rep);\n sc *= lacunarity;\n totalgain *= gain;\n }\n return abs(sum);\n}", q = class extends H {
|
|
5801
5886
|
static {
|
|
5802
|
-
|
|
5887
|
+
pi = this;
|
|
5803
5888
|
}
|
|
5804
|
-
static material = new
|
|
5889
|
+
static material = new F({ gl: {
|
|
5805
5890
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5806
5891
|
fragment: `precision highp float;
|
|
5807
5892
|
varying vec2 vUv;
|
|
@@ -5814,7 +5899,7 @@ uniform float uTime;
|
|
|
5814
5899
|
uniform vec3 uRay;
|
|
5815
5900
|
uniform vec4 uInputSize;
|
|
5816
5901
|
|
|
5817
|
-
${
|
|
5902
|
+
${mi}
|
|
5818
5903
|
|
|
5819
5904
|
void main(void) {
|
|
5820
5905
|
bool uParallel = uParallel > 0.5;
|
|
@@ -5853,7 +5938,7 @@ void main(void) {
|
|
|
5853
5938
|
apply(e, t) {
|
|
5854
5939
|
let n = this.angle * (Math.PI / 180), r = this.parallel ? [Math.cos(n), Math.sin(n)] : this.center;
|
|
5855
5940
|
t.redraw(e, () => {
|
|
5856
|
-
|
|
5941
|
+
I.draw(e, pi.material, {
|
|
5857
5942
|
sampler: 0,
|
|
5858
5943
|
uDimensions: [t.width, t.height],
|
|
5859
5944
|
uParallel: +!!this.parallel,
|
|
@@ -5875,15 +5960,15 @@ void main(void) {
|
|
|
5875
5960
|
});
|
|
5876
5961
|
}
|
|
5877
5962
|
};
|
|
5878
|
-
|
|
5963
|
+
O([_({ fallback: 0 }), D("design:type", Number)], q.prototype, "time", void 0), O([_({ fallback: 30 }), D("design:type", Number)], q.prototype, "angle", void 0), O([_({ fallback: .5 }), D("design:type", Number)], q.prototype, "gain", void 0), O([_({ fallback: 2.5 }), D("design:type", Number)], q.prototype, "lacunarity", void 0), O([_({ fallback: !0 }), D("design:type", Boolean)], q.prototype, "parallel", void 0), O([_({ default: () => [0, 0] }), D("design:type", Array)], q.prototype, "center", void 0), O([_({ fallback: 1 }), D("design:type", Number)], q.prototype, "alpha", void 0), q = pi = O([x("GodrayEffect"), D("design:paramtypes", [typeof (fi = typeof Partial < "u" && Partial) == "function" ? fi : Object, Array])], q);
|
|
5879
5964
|
//#endregion
|
|
5880
5965
|
//#region src/scene/effects/KawaseBlurEffect.ts
|
|
5881
|
-
var
|
|
5966
|
+
var hi, gi = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n\nvoid main(void) {\n vec4 color = vec4(0.0);\n color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y + uOffset.y));\n color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y + uOffset.y));\n color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y - uOffset.y));\n color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y - uOffset.y));\n color *= 0.25;\n gl_FragColor = color;\n}", _i = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\nuniform vec4 uInputClamp;\nvoid main(void) {\n vec4 color = vec4(0.0);\n color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color *= 0.25;\n gl_FragColor = color;\n}", vi = class extends H {
|
|
5882
5967
|
_kernels = [0];
|
|
5883
5968
|
constructor(e, t = []) {
|
|
5884
|
-
super(), this.material = new
|
|
5969
|
+
super(), this.material = new F({ gl: {
|
|
5885
5970
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5886
|
-
fragment: e?.clamp ?
|
|
5971
|
+
fragment: e?.clamp ? _i : gi
|
|
5887
5972
|
} }), this.setProperties(e).append(t), this._generateKernels();
|
|
5888
5973
|
}
|
|
5889
5974
|
_updateProperty(e, t, n) {
|
|
@@ -5907,7 +5992,7 @@ var ui, di = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffse
|
|
|
5907
5992
|
this._kernels.forEach((i) => {
|
|
5908
5993
|
let a = i + .5;
|
|
5909
5994
|
t.redraw(e, () => {
|
|
5910
|
-
|
|
5995
|
+
I.draw(e, this.material, {
|
|
5911
5996
|
sampler: 0,
|
|
5912
5997
|
uOffset: [a * n, a * r],
|
|
5913
5998
|
uInputClamp: [
|
|
@@ -5921,14 +6006,14 @@ var ui, di = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffse
|
|
|
5921
6006
|
});
|
|
5922
6007
|
}
|
|
5923
6008
|
};
|
|
5924
|
-
|
|
6009
|
+
O([_({ fallback: 4 }), D("design:type", Number)], vi.prototype, "strength", void 0), O([_({ fallback: 3 }), D("design:type", Number)], vi.prototype, "quality", void 0), O([_({ default: () => [1, 1] }), D("design:type", Array)], vi.prototype, "pixelSize", void 0), vi = O([x("KawaseBlurEffect"), D("design:paramtypes", [typeof (hi = typeof Partial < "u" && Partial) == "function" ? hi : Object, Array])], vi);
|
|
5925
6010
|
//#endregion
|
|
5926
6011
|
//#region src/scene/effects/MaskEffect.ts
|
|
5927
|
-
var
|
|
6012
|
+
var yi, bi, xi = class extends H {
|
|
5928
6013
|
static {
|
|
5929
|
-
|
|
6014
|
+
bi = this;
|
|
5930
6015
|
}
|
|
5931
|
-
static material = new
|
|
6016
|
+
static material = new F({ gl: {
|
|
5932
6017
|
vertex: "attribute vec2 position;\nin vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5933
6018
|
fragment: "in vec2 vUv;\n\nuniform sampler2D sampler;\nuniform sampler2D mask;\nuniform float rotation;\n\nvec2 rotateUV(vec2 uv, float angle) {\n uv -= 0.5;\n float cosAngle = cos(angle);\n float sinAngle = sin(angle);\n mat2 rotationMatrix = mat2(\n cosAngle, -sinAngle,\n sinAngle, cosAngle\n );\n uv = rotationMatrix * uv;\n uv += 0.5;\n return uv;\n}\n\nvoid main(void) {\n vec4 color = texture(sampler, vUv);\n vec4 maskColor = texture(mask, rotateUV(vUv, rotation));\n gl_FragColor = mix(vec4(0.), color, maskColor.a);\n}"
|
|
5934
6019
|
} });
|
|
@@ -5948,7 +6033,7 @@ var mi, hi, gi = class extends U {
|
|
|
5948
6033
|
}
|
|
5949
6034
|
apply(e, t, n) {
|
|
5950
6035
|
this.texture && t.redraw(e, () => {
|
|
5951
|
-
this.texture.activate(e, 1),
|
|
6036
|
+
this.texture.activate(e, 1), I.draw(e, bi.material, {
|
|
5952
6037
|
sampler: 0,
|
|
5953
6038
|
mask: 1,
|
|
5954
6039
|
rotation: n.target?.globalRotation ?? 0
|
|
@@ -5956,33 +6041,33 @@ var mi, hi, gi = class extends U {
|
|
|
5956
6041
|
});
|
|
5957
6042
|
}
|
|
5958
6043
|
};
|
|
5959
|
-
|
|
6044
|
+
O([_({ fallback: "" }), D("design:type", String)], xi.prototype, "image", void 0), xi = bi = O([x("MaskEffect"), D("design:paramtypes", [typeof (yi = typeof Partial < "u" && Partial) == "function" ? yi : Object, Array])], xi);
|
|
5960
6045
|
//#endregion
|
|
5961
6046
|
//#region src/scene/effects/OutlineEffect.ts
|
|
5962
|
-
var
|
|
6047
|
+
var Si, Ci, wi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uThickness;\nuniform vec3 uColor;\nuniform float uAlpha;\nuniform float uKnockout;\nuniform vec4 uInputClamp;\n\nconst float DOUBLE_PI = 2. * 3.14159265358979323846264;\nconst float ANGLE_STEP = {ANGLE_STEP};\n\nfloat outlineMaxAlphaAtPos(vec2 pos) {\n if (uThickness.x == 0. || uThickness.y == 0.) {\n return 0.;\n }\n vec4 displacedColor;\n vec2 displacedPos;\n float maxAlpha = 0.;\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ANGLE_STEP) {\n displacedPos.x = vUv.x + uThickness.x * cos(angle);\n displacedPos.y = vUv.y + uThickness.y * sin(angle);\n displacedColor = texture2D(sampler, clamp(displacedPos, uInputClamp.xy, uInputClamp.zw));\n maxAlpha = max(maxAlpha, displacedColor.a);\n }\n return maxAlpha;\n}\n\nvoid main(void) {\n vec4 sourceColor = texture2D(sampler, vUv);\n vec4 contentColor = sourceColor * float(uKnockout < 0.5);\n float outlineAlpha = uAlpha * outlineMaxAlphaAtPos(vUv.xy) * (1.-sourceColor.a);\n vec4 outlineColor = vec4(vec3(uColor) * outlineAlpha, outlineAlpha);\n gl_FragColor = contentColor + outlineColor;\n}", J = class extends H {
|
|
5963
6048
|
static {
|
|
5964
|
-
|
|
6049
|
+
Ci = this;
|
|
5965
6050
|
}
|
|
5966
6051
|
static MIN_SAMPLES = 1;
|
|
5967
6052
|
static MAX_SAMPLES = 100;
|
|
5968
6053
|
static getAngleStep(e) {
|
|
5969
|
-
return Number.parseFloat((Math.PI * 2 / Math.max(e *
|
|
6054
|
+
return Number.parseFloat((Math.PI * 2 / Math.max(e * Ci.MAX_SAMPLES, Ci.MIN_SAMPLES)).toFixed(7));
|
|
5970
6055
|
}
|
|
5971
|
-
_color = new
|
|
6056
|
+
_color = new T();
|
|
5972
6057
|
constructor(e, t = []) {
|
|
5973
|
-
super(), this.setProperties(e).append(t), this.material = new
|
|
6058
|
+
super(), this.setProperties(e).append(t), this.material = new F({ gl: {
|
|
5974
6059
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5975
|
-
fragment:
|
|
6060
|
+
fragment: wi.replace(/\{ANGLE_STEP\}/, Ci.getAngleStep(this.quality).toFixed(7))
|
|
5976
6061
|
} });
|
|
5977
6062
|
}
|
|
5978
6063
|
apply(e, t) {
|
|
5979
6064
|
t.redraw(e, () => {
|
|
5980
|
-
this._color.value = this.color,
|
|
6065
|
+
this._color.value = this.color, I.draw(e, this.material, {
|
|
5981
6066
|
sampler: 0,
|
|
5982
6067
|
uThickness: [this.width / t.width, this.width / t.height],
|
|
5983
6068
|
uColor: this._color.toArray().slice(0, 3),
|
|
5984
6069
|
uAlpha: this.opacity === 1 ? this._color.a : this.opacity,
|
|
5985
|
-
uAngleStep:
|
|
6070
|
+
uAngleStep: Ci.getAngleStep(this.quality),
|
|
5986
6071
|
uKnockout: +!!this.knockout,
|
|
5987
6072
|
uInputClamp: [
|
|
5988
6073
|
0,
|
|
@@ -5994,14 +6079,14 @@ var _i, vi, yi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D s
|
|
|
5994
6079
|
});
|
|
5995
6080
|
}
|
|
5996
6081
|
};
|
|
5997
|
-
|
|
6082
|
+
O([_({ fallback: "#000000ff" }), D("design:type", Object)], J.prototype, "color", void 0), O([_({ fallback: 1 }), D("design:type", Number)], J.prototype, "width", void 0), O([_({ fallback: "solid" }), D("design:type", String)], J.prototype, "style", void 0), O([_(), D("design:type", Object)], J.prototype, "image", void 0), O([_({ fallback: 1 }), D("design:type", Number)], J.prototype, "opacity", void 0), O([_({ fallback: .1 }), D("design:type", Number)], J.prototype, "quality", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], J.prototype, "knockout", void 0), J = Ci = O([x("OutlineEffect"), D("design:paramtypes", [typeof (Si = typeof Partial < "u" && Partial) == "function" ? Si : Object, Array])], J);
|
|
5998
6083
|
//#endregion
|
|
5999
6084
|
//#region src/scene/effects/PixelateEffect.ts
|
|
6000
|
-
var
|
|
6085
|
+
var Ti, Ei, Di = class extends H {
|
|
6001
6086
|
static {
|
|
6002
|
-
|
|
6087
|
+
Ei = this;
|
|
6003
6088
|
}
|
|
6004
|
-
static material = new
|
|
6089
|
+
static material = new F({ gl: {
|
|
6005
6090
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6006
6091
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 offset;\nuniform vec2 step;\n\nvoid main(void) {\n vec2 uv = vUv;\n uv = floor((uv - offset) / step) * step + offset + step / 2.0;\n gl_FragColor = texture2D(sampler, uv);\n}"
|
|
6007
6092
|
} });
|
|
@@ -6015,18 +6100,18 @@ var bi, xi, Si = class extends U {
|
|
|
6015
6100
|
offset: [(r[0] + i[0]) / t.width, 1 - (r[1] + i[1]) / t.height],
|
|
6016
6101
|
step: [this.strength * r[0] / t.width, this.strength * r[1] / t.height]
|
|
6017
6102
|
};
|
|
6018
|
-
|
|
6103
|
+
I.draw(e, Ei.material, a);
|
|
6019
6104
|
});
|
|
6020
6105
|
}
|
|
6021
6106
|
};
|
|
6022
|
-
|
|
6107
|
+
O([_({ fallback: 10 }), D("design:type", Number)], Di.prototype, "strength", void 0), Di = Ei = O([x("PixelateEffect"), D("design:paramtypes", [typeof (Ti = typeof Partial < "u" && Partial) == "function" ? Ti : Object, Array])], Di);
|
|
6023
6108
|
//#endregion
|
|
6024
6109
|
//#region src/scene/effects/ZoomBlurEffect.ts
|
|
6025
|
-
var
|
|
6110
|
+
var Oi, ki, Ai = class extends H {
|
|
6026
6111
|
static {
|
|
6027
|
-
|
|
6112
|
+
ki = this;
|
|
6028
6113
|
}
|
|
6029
|
-
static material = new
|
|
6114
|
+
static material = new F({ gl: {
|
|
6030
6115
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6031
6116
|
fragment: "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec4 uInputSize;\n\nuniform vec2 uCenter;\nuniform float uStrength;\nuniform float uInnerRadius;\nuniform float uRadius;\n\nconst float MAX_KERNEL_SIZE = 32.0;\n\nhighp float rand(vec2 co, float seed) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(co + seed, vec2(a, b)), sn = mod(dt, 3.14159);\n return fract(sin(sn) * c + seed);\n}\n\nvoid main() {\n float minGradient = uInnerRadius * 0.3;\n float innerRadius1 = (uInnerRadius + minGradient * 0.5) / uInputSize.x;\n\n float gradient = uRadius * 0.3;\n float radius1 = (uRadius - gradient * 0.5) / uInputSize.x;\n\n float countLimit = MAX_KERNEL_SIZE;\n\n vec2 dir = vec2(uCenter.xy / uInputSize.xy - vUv);\n float dist = length(vec2(dir.x, dir.y * uInputSize.y / uInputSize.x));\n\n float strength1 = uStrength;\n\n float delta = 0.0;\n float gap;\n if (dist < innerRadius1) {\n delta = innerRadius1 - dist;\n gap = minGradient;\n } else if (radius1 >= 0.0 && dist > radius1) { // radius1 < 0 means it's infinity\n delta = dist - radius1;\n gap = gradient;\n }\n\n if (delta > 0.0) {\n float normalCount = gap / uInputSize.x;\n delta = (normalCount - delta) / normalCount;\n countLimit *= delta;\n strength1 *= delta;\n if (countLimit < 1.0) {\n gl_FragColor = texture2D(sampler, vUv);\n return;\n }\n }\n\n float offset = rand(vUv, 0.0);\n\n float total = 0.0;\n vec4 color = vec4(0.0);\n\n dir *= strength1;\n\n for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) {\n float percent = (t + offset) / MAX_KERNEL_SIZE;\n float weight = 4.0 * (percent - percent * percent);\n vec2 p = vUv + dir * percent;\n color += texture2D(sampler, p) * weight;\n total += weight;\n\n if (t > countLimit){\n break;\n }\n }\n\n color /= total;\n\n gl_FragColor = color;\n}"
|
|
6032
6117
|
} });
|
|
@@ -6035,7 +6120,7 @@ var Ci, wi, Ti = class extends U {
|
|
|
6035
6120
|
}
|
|
6036
6121
|
apply(e, t) {
|
|
6037
6122
|
t.redraw(e, () => {
|
|
6038
|
-
|
|
6123
|
+
I.draw(e, ki.material, {
|
|
6039
6124
|
sampler: 0,
|
|
6040
6125
|
uCenter: [t.width / 2, t.height / 2],
|
|
6041
6126
|
uInnerRadius: this.innerRadius,
|
|
@@ -6051,10 +6136,10 @@ var Ci, wi, Ti = class extends U {
|
|
|
6051
6136
|
});
|
|
6052
6137
|
}
|
|
6053
6138
|
};
|
|
6054
|
-
|
|
6139
|
+
O([_(), D("design:type", Array)], Ai.prototype, "center", void 0), O([_({ fallback: 20 }), D("design:type", Number)], Ai.prototype, "innerRadius", void 0), O([_({ fallback: -1 }), D("design:type", Number)], Ai.prototype, "radius", void 0), O([_({ fallback: .1 }), D("design:type", Number)], Ai.prototype, "strength", void 0), Ai = ki = O([x("ZoomBlurEffect"), D("design:paramtypes", [typeof (Oi = typeof Partial < "u" && Partial) == "function" ? Oi : Object, Array])], Ai);
|
|
6055
6140
|
//#endregion
|
|
6056
6141
|
//#region src/scene/2d/element/utils.ts
|
|
6057
|
-
function
|
|
6142
|
+
function ji(e, t) {
|
|
6058
6143
|
let { x: n, y: r, width: i, height: a } = t, o = !1, s = new v().translate(-n, -r).scale(1 / i, 1 / a);
|
|
6059
6144
|
if (e.cropRect) {
|
|
6060
6145
|
let { left: t = 0, top: n = 0, right: r = 0, bottom: i = 0 } = e.cropRect;
|
|
@@ -6076,7 +6161,7 @@ function Ei(e, t) {
|
|
|
6076
6161
|
}
|
|
6077
6162
|
//#endregion
|
|
6078
6163
|
//#region src/scene/2d/element/Element2DFill.ts
|
|
6079
|
-
var Y = class extends
|
|
6164
|
+
var Y = class extends C {
|
|
6080
6165
|
_parent;
|
|
6081
6166
|
texture;
|
|
6082
6167
|
animatedTexture;
|
|
@@ -6109,7 +6194,7 @@ var Y = class extends w {
|
|
|
6109
6194
|
}
|
|
6110
6195
|
}
|
|
6111
6196
|
async loadTexture() {
|
|
6112
|
-
if (this.linearGradient || this.radialGradient) this.texture = new
|
|
6197
|
+
if (this.linearGradient || this.radialGradient) this.texture = new er(this.linearGradient ?? this.radialGradient, Math.floor(this._parent.size.width), Math.floor(this._parent.size.height));
|
|
6113
6198
|
else if (d(this.image)) this.animatedTexture = void 0, this.texture = void 0;
|
|
6114
6199
|
else if (this._parent.tree?.log(`load image ${this.image}`), this.image !== "viewport") {
|
|
6115
6200
|
let e = this.image.split("?")[0].endsWith(".gif"), t = this.image, n = await $.loadBy(t, async () => {
|
|
@@ -6130,12 +6215,12 @@ var Y = class extends w {
|
|
|
6130
6215
|
width: e,
|
|
6131
6216
|
height: t
|
|
6132
6217
|
} };
|
|
6133
|
-
if (this.image === "viewport") n.fillStyle = new
|
|
6218
|
+
if (this.image === "viewport") n.fillStyle = new ir();
|
|
6134
6219
|
else {
|
|
6135
6220
|
let i = this.animatedTexture?.currentFrame.texture ?? this.texture;
|
|
6136
6221
|
r = {
|
|
6137
6222
|
...r,
|
|
6138
|
-
...
|
|
6223
|
+
...ji(this, this.tile && i ? {
|
|
6139
6224
|
x: 0,
|
|
6140
6225
|
y: 0,
|
|
6141
6226
|
width: i.sourceWidth,
|
|
@@ -6171,10 +6256,10 @@ var Y = class extends w {
|
|
|
6171
6256
|
this.updateFrameIndex();
|
|
6172
6257
|
}
|
|
6173
6258
|
};
|
|
6174
|
-
|
|
6259
|
+
O([_({ fallback: !0 }), D("design:type", Boolean)], Y.prototype, "enabled", void 0), O([_(), D("design:type", Object)], Y.prototype, "color", void 0), O([_(), D("design:type", Object)], Y.prototype, "image", void 0), O([_(), D("design:type", Object)], Y.prototype, "linearGradient", void 0), O([_(), D("design:type", Object)], Y.prototype, "radialGradient", void 0), O([_(), D("design:type", Object)], Y.prototype, "cropRect", void 0), O([_(), D("design:type", Object)], Y.prototype, "stretchRect", void 0), O([_(), D("design:type", Object)], Y.prototype, "dpi", void 0), O([_(), D("design:type", Object)], Y.prototype, "rotateWithShape", void 0), O([_(), D("design:type", Object)], Y.prototype, "tile", void 0), O([_(), D("design:type", Object)], Y.prototype, "opacity", void 0);
|
|
6175
6260
|
//#endregion
|
|
6176
6261
|
//#region src/scene/2d/element/Element2DBackground.ts
|
|
6177
|
-
var
|
|
6262
|
+
var Mi = class extends Y {
|
|
6178
6263
|
setProperties(e) {
|
|
6179
6264
|
return super._setProperties(d(e) ? void 0 : f(e));
|
|
6180
6265
|
}
|
|
@@ -6186,10 +6271,10 @@ var Di = class extends Y {
|
|
|
6186
6271
|
}
|
|
6187
6272
|
}
|
|
6188
6273
|
};
|
|
6189
|
-
|
|
6274
|
+
O([_(), D("design:type", Object)], Mi.prototype, "fillWithShape", void 0);
|
|
6190
6275
|
//#endregion
|
|
6191
6276
|
//#region src/scene/2d/element/Element2DConnection.ts
|
|
6192
|
-
var
|
|
6277
|
+
var Ni = class extends C {
|
|
6193
6278
|
_parent;
|
|
6194
6279
|
constructor(e) {
|
|
6195
6280
|
super(), this._parent = e;
|
|
@@ -6204,32 +6289,51 @@ var Oi = class extends w {
|
|
|
6204
6289
|
switch (super._updateProperty(e, t, n), e) {
|
|
6205
6290
|
case "start":
|
|
6206
6291
|
case "end":
|
|
6292
|
+
case "mode":
|
|
6207
6293
|
this._parent.requestDraw();
|
|
6208
6294
|
break;
|
|
6209
6295
|
}
|
|
6210
6296
|
}
|
|
6211
6297
|
resolveAnchor(e) {
|
|
6298
|
+
return this.resolveEndpoint(e)?.point;
|
|
6299
|
+
}
|
|
6300
|
+
resolveEndpoint(e) {
|
|
6212
6301
|
if (!e?.id) return;
|
|
6213
6302
|
let t = this._parent.tree?.getNodeById(e.id);
|
|
6214
6303
|
if (!t) return;
|
|
6215
6304
|
if (e.idx !== void 0) {
|
|
6216
6305
|
let n = t.shape.connectionPoints?.find((t) => t.idx === e.idx);
|
|
6217
6306
|
if (n) {
|
|
6218
|
-
let e =
|
|
6219
|
-
|
|
6220
|
-
|
|
6307
|
+
let e = t.globalTransform.apply(new y(n.x * t.size.x, n.y * t.size.y)), r;
|
|
6308
|
+
return r = n.ang === void 0 ? Dr(n.x - .5, n.y - .5) : {
|
|
6309
|
+
x: Math.cos(n.ang),
|
|
6310
|
+
y: Math.sin(n.ang)
|
|
6311
|
+
}, {
|
|
6312
|
+
point: e,
|
|
6313
|
+
dir: Pi(r, t.globalRotation)
|
|
6221
6314
|
};
|
|
6222
|
-
return t.globalTransform.apply(new y(e.x, e.y));
|
|
6223
6315
|
}
|
|
6224
6316
|
}
|
|
6225
6317
|
let { min: n, size: r } = t.globalAabb;
|
|
6226
|
-
return new y(n.x + r.x / 2, n.y + r.y / 2);
|
|
6318
|
+
return { point: new y(n.x + r.x / 2, n.y + r.y / 2) };
|
|
6319
|
+
}
|
|
6320
|
+
route() {
|
|
6321
|
+
let e = this.resolveEndpoint(this.start), t = this.resolveEndpoint(this.end);
|
|
6322
|
+
if (!(!e && !t)) return Or(this.mode, e ?? t, t ?? e);
|
|
6227
6323
|
}
|
|
6228
6324
|
};
|
|
6229
|
-
|
|
6325
|
+
O([_(), D("design:type", Object)], Ni.prototype, "start", void 0), O([_(), D("design:type", Object)], Ni.prototype, "end", void 0), O([_({ fallback: "straight" }), D("design:type", Object)], Ni.prototype, "mode", void 0);
|
|
6326
|
+
function Pi(e, t) {
|
|
6327
|
+
if (!t) return e;
|
|
6328
|
+
let n = Math.cos(t), r = Math.sin(t);
|
|
6329
|
+
return {
|
|
6330
|
+
x: e.x * n - e.y * r,
|
|
6331
|
+
y: e.x * r + e.y * n
|
|
6332
|
+
};
|
|
6333
|
+
}
|
|
6230
6334
|
//#endregion
|
|
6231
6335
|
//#region src/scene/2d/element/Element2DForeground.ts
|
|
6232
|
-
var
|
|
6336
|
+
var Fi = class extends Y {
|
|
6233
6337
|
setProperties(e) {
|
|
6234
6338
|
return super._setProperties(d(e) ? void 0 : h(e));
|
|
6235
6339
|
}
|
|
@@ -6241,10 +6345,10 @@ var ki = class extends Y {
|
|
|
6241
6345
|
}
|
|
6242
6346
|
}
|
|
6243
6347
|
};
|
|
6244
|
-
|
|
6348
|
+
O([_(), D("design:type", Object)], Fi.prototype, "fillWithShape", void 0);
|
|
6245
6349
|
//#endregion
|
|
6246
6350
|
//#region src/scene/2d/element/Element2DOutline.ts
|
|
6247
|
-
var
|
|
6351
|
+
var Ii = class extends Y {
|
|
6248
6352
|
setProperties(e) {
|
|
6249
6353
|
return super._setProperties(d(e) ? void 0 : g(e));
|
|
6250
6354
|
}
|
|
@@ -6264,7 +6368,7 @@ var Ai = class extends Y {
|
|
|
6264
6368
|
}
|
|
6265
6369
|
draw() {
|
|
6266
6370
|
let { width: e, height: t } = this._parent.size, n = this._parent.context;
|
|
6267
|
-
this.image === "viewport" ? n.strokeStyle = new
|
|
6371
|
+
this.image === "viewport" ? n.strokeStyle = new ir() : n.strokeStyle = this.texture ?? this.color ?? "#000000FF", n.lineWidth = this.width || 1, n.lineCap = this.lineCap, n.lineJoin = this.lineJoin, n.stroke({ ...ji(this, {
|
|
6268
6372
|
x: 0,
|
|
6269
6373
|
y: 0,
|
|
6270
6374
|
width: e,
|
|
@@ -6272,10 +6376,10 @@ var Ai = class extends Y {
|
|
|
6272
6376
|
}) });
|
|
6273
6377
|
}
|
|
6274
6378
|
};
|
|
6275
|
-
|
|
6379
|
+
O([_(), D("design:type", Object)], Ii.prototype, "color", void 0), O([_(), D("design:type", Object)], Ii.prototype, "width", void 0), O([_({ fallback: "solid" }), D("design:type", Object)], Ii.prototype, "style", void 0), O([_({ fallback: "butt" }), D("design:type", Object)], Ii.prototype, "lineCap", void 0), O([_({ fallback: "miter" }), D("design:type", Object)], Ii.prototype, "lineJoin", void 0);
|
|
6276
6380
|
//#endregion
|
|
6277
6381
|
//#region src/scene/2d/element/Element2DShadow.ts
|
|
6278
|
-
var
|
|
6382
|
+
var Li = class extends C {
|
|
6279
6383
|
_parent;
|
|
6280
6384
|
constructor(e) {
|
|
6281
6385
|
super(), this._parent = e;
|
|
@@ -6296,18 +6400,28 @@ var ji = class extends w {
|
|
|
6296
6400
|
}
|
|
6297
6401
|
updateEffect() {
|
|
6298
6402
|
let e = "__$shadow", t = this._parent.getNode(e);
|
|
6299
|
-
this.enabled && (this.blur || this.offsetX || this.offsetY) ? (t || (t = new
|
|
6403
|
+
this.enabled && (this.blur || this.offsetX || this.offsetY) ? (t || (t = new oi({ name: e }), this._parent.appendChild(t, "back")), t.setProperties(this.getProperties())) : t && this._parent.removeChild(t);
|
|
6300
6404
|
}
|
|
6301
6405
|
};
|
|
6302
|
-
|
|
6406
|
+
O([_({ fallback: !0 }), D("design:type", Boolean)], Li.prototype, "enabled", void 0), O([_({ fallback: "#000000FF" }), D("design:type", Object)], Li.prototype, "color", void 0), O([_({ fallback: 0 }), D("design:type", Object)], Li.prototype, "blur", void 0), O([_({ fallback: 0 }), D("design:type", Object)], Li.prototype, "offsetY", void 0), O([_({ fallback: 0 }), D("design:type", Object)], Li.prototype, "offsetX", void 0);
|
|
6303
6407
|
//#endregion
|
|
6304
6408
|
//#region src/scene/2d/element/Element2DShape.ts
|
|
6305
|
-
var
|
|
6409
|
+
var Ri = class extends C {
|
|
6306
6410
|
_parent;
|
|
6307
6411
|
_path2DSet = new se();
|
|
6412
|
+
_localPath;
|
|
6413
|
+
_hitPath2DSet;
|
|
6414
|
+
_hitWidth = 0;
|
|
6415
|
+
_hitHeight = 0;
|
|
6308
6416
|
constructor(e) {
|
|
6309
6417
|
super(), this._parent = e, this._updatePath2DSet();
|
|
6310
6418
|
}
|
|
6419
|
+
setLocalPath(e) {
|
|
6420
|
+
this._localPath = e, this._parent.requestDraw();
|
|
6421
|
+
}
|
|
6422
|
+
get localPath() {
|
|
6423
|
+
return this._localPath;
|
|
6424
|
+
}
|
|
6311
6425
|
setProperties(e) {
|
|
6312
6426
|
return super.setProperties(d(e) ? void 0 : te(e));
|
|
6313
6427
|
}
|
|
@@ -6324,6 +6438,30 @@ var Mi = class extends w {
|
|
|
6324
6438
|
isValid() {
|
|
6325
6439
|
return !!(this.enabled && this._path2DSet.paths.some((e) => e.getLength()));
|
|
6326
6440
|
}
|
|
6441
|
+
isPointInside(e, t) {
|
|
6442
|
+
let n = t?.strokeWidth ?? 1, r = t?.tolerance ?? 0, i = this._localPath;
|
|
6443
|
+
if (i && i.getLength()) return i.isPointInStroke(e, {
|
|
6444
|
+
strokeWidth: n,
|
|
6445
|
+
tolerance: r,
|
|
6446
|
+
closed: !1
|
|
6447
|
+
});
|
|
6448
|
+
let a = this._getHitPath2DSet();
|
|
6449
|
+
return a ? !!a.hitTest(e, {
|
|
6450
|
+
stroke: !0,
|
|
6451
|
+
tolerance: r + n / 2
|
|
6452
|
+
}) : !1;
|
|
6453
|
+
}
|
|
6454
|
+
_getHitPath2DSet() {
|
|
6455
|
+
if (!this.isValid()) return;
|
|
6456
|
+
let { width: e, height: t } = this._parent.size;
|
|
6457
|
+
if (!(!e || !t)) {
|
|
6458
|
+
if (!this._hitPath2DSet || this._hitWidth !== e || this._hitHeight !== t) {
|
|
6459
|
+
let n = new v().scale(e, t);
|
|
6460
|
+
this._hitPath2DSet = new se(this._path2DSet.paths.map((e) => e.clone().applyTransform(n))), this._hitWidth = e, this._hitHeight = t;
|
|
6461
|
+
}
|
|
6462
|
+
return this._hitPath2DSet;
|
|
6463
|
+
}
|
|
6464
|
+
}
|
|
6327
6465
|
_updatePath2DSet() {
|
|
6328
6466
|
let e;
|
|
6329
6467
|
if (this.svg) {
|
|
@@ -6350,10 +6488,11 @@ var Mi = class extends w {
|
|
|
6350
6488
|
let [t, n, r, i] = e;
|
|
6351
6489
|
this._path2DSet.paths.forEach((e) => {
|
|
6352
6490
|
e.applyTransform(new v().translate(-t, -n).scale(1 / r, 1 / i));
|
|
6353
|
-
});
|
|
6491
|
+
}), this._hitPath2DSet = void 0;
|
|
6354
6492
|
}
|
|
6355
6493
|
draw(e = !1) {
|
|
6356
|
-
if (!e && this.
|
|
6494
|
+
if (!e && this._localPath && this._localPath.getLength()) this._parent.context.addPath(this._localPath.clone());
|
|
6495
|
+
else if (!e && this.isValid()) {
|
|
6357
6496
|
let e = this._parent.context, { width: t, height: n } = this._parent.size;
|
|
6358
6497
|
this._path2DSet.paths.forEach((r) => {
|
|
6359
6498
|
e.addPath(r.clone().applyTransform(new v().scale(t, n)));
|
|
@@ -6365,24 +6504,24 @@ var Mi = class extends w {
|
|
|
6365
6504
|
t && n && (r ? e.roundRect(0, 0, t, n, r) : e.rect(0, 0, t, n));
|
|
6366
6505
|
}
|
|
6367
6506
|
};
|
|
6368
|
-
|
|
6507
|
+
O([_({ fallback: !0 }), D("design:type", Boolean)], Ri.prototype, "enabled", void 0), O([_(), D("design:type", Object)], Ri.prototype, "preset", void 0), O([_(), D("design:type", Object)], Ri.prototype, "svg", void 0), O([_(), D("design:type", Object)], Ri.prototype, "viewBox", void 0), O([_(), D("design:type", Object)], Ri.prototype, "paths", void 0), O([_(), D("design:type", Object)], Ri.prototype, "connectionPoints", void 0);
|
|
6369
6508
|
//#endregion
|
|
6370
6509
|
//#region src/scene/2d/element/Element2DStyle.ts
|
|
6371
|
-
var
|
|
6510
|
+
var zi = class extends w {
|
|
6372
6511
|
constructor(e) {
|
|
6373
6512
|
super(), this.setProperties(e);
|
|
6374
6513
|
}
|
|
6375
|
-
},
|
|
6514
|
+
}, Bi = {
|
|
6376
6515
|
...o(),
|
|
6377
6516
|
left: 0,
|
|
6378
6517
|
top: 0,
|
|
6379
6518
|
width: 0,
|
|
6380
6519
|
height: 0
|
|
6381
6520
|
};
|
|
6382
|
-
for (let e in
|
|
6521
|
+
for (let e in Bi) i(zi, e, { fallback: Bi[e] });
|
|
6383
6522
|
//#endregion
|
|
6384
6523
|
//#region src/scene/2d/element/Element2DText.ts
|
|
6385
|
-
var
|
|
6524
|
+
var Vi, X = class extends C {
|
|
6386
6525
|
_parent;
|
|
6387
6526
|
base;
|
|
6388
6527
|
get textContent() {
|
|
@@ -6393,7 +6532,7 @@ var Fi, X = class extends w {
|
|
|
6393
6532
|
}
|
|
6394
6533
|
_textContent = "";
|
|
6395
6534
|
_autoDrawMode;
|
|
6396
|
-
_texture = new
|
|
6535
|
+
_texture = new Qn({ mipmap: !0 });
|
|
6397
6536
|
_textureMap = /* @__PURE__ */ new Map();
|
|
6398
6537
|
constructor(e) {
|
|
6399
6538
|
super(), this._parent = e, this.base = new pe(), this.base.setPropertyAccessor(this);
|
|
@@ -6464,7 +6603,7 @@ var Fi, X = class extends w {
|
|
|
6464
6603
|
}), this._parent.requestDraw());
|
|
6465
6604
|
}
|
|
6466
6605
|
async _loadTexture(e, t) {
|
|
6467
|
-
return e.linearGradient || e.radialGradient ? new
|
|
6606
|
+
return e.linearGradient || e.radialGradient ? new er(e.linearGradient ?? e.radialGradient, t.width, t.height) : d(e.image) ? void 0 : (this._parent.tree?.log(`load image ${e.image}`), await $.texture.load(e.image));
|
|
6468
6607
|
}
|
|
6469
6608
|
setContent(e) {
|
|
6470
6609
|
this.content = re(e);
|
|
@@ -6493,7 +6632,7 @@ var Fi, X = class extends w {
|
|
|
6493
6632
|
if (n.style.fill && !d(n.style.fill)) if (typeof n.style.fill == "object") {
|
|
6494
6633
|
let r = n.style.fill, o = this._textureMap.get(`${a}.${i}.fill`) ?? this._textureMap.get(`${a}.fill`) ?? this._textureMap.get("fill");
|
|
6495
6634
|
r.enabled !== !1 && (o || r.color) && (e.addPath(n), e.style = { ...n.style }, e.fillStyle = o?.texture ?? r.color, e.fill({
|
|
6496
|
-
...
|
|
6635
|
+
...ji(r, o?.box ?? {
|
|
6497
6636
|
x: 0,
|
|
6498
6637
|
y: 0,
|
|
6499
6638
|
width: this._parent.size.width,
|
|
@@ -6505,7 +6644,7 @@ var Fi, X = class extends w {
|
|
|
6505
6644
|
if (n.style.stroke && !d(n.style.stroke)) if (typeof n.style.stroke == "object") {
|
|
6506
6645
|
let r = n.style.stroke, o = this._textureMap.get(`${a}.${i}.outline`) ?? this._textureMap.get(`${a}.outline`) ?? this._textureMap.get("outline");
|
|
6507
6646
|
r.enabled !== !1 && (o || r.color) && (r.width === void 0 || r.width) && (e.addPath(n), e.style = { ...n.style }, e.lineWidth = r.width || 1, e.strokeStyle = o?.texture ?? r.color, e.lineCap = r.lineCap, e.lineJoin = r.lineJoin, e.stroke({
|
|
6508
|
-
...
|
|
6647
|
+
...ji(r, o?.box ?? {
|
|
6509
6648
|
x: 0,
|
|
6510
6649
|
y: 0,
|
|
6511
6650
|
width: this._parent.size.width,
|
|
@@ -6535,7 +6674,7 @@ var Fi, X = class extends w {
|
|
|
6535
6674
|
}
|
|
6536
6675
|
process(e) {}
|
|
6537
6676
|
};
|
|
6538
|
-
|
|
6677
|
+
O([_({ fallback: !0 }), D("design:type", Object)], X.prototype, "enabled", void 0), O([_({ fallback: () => [] }), D("design:type", Object)], X.prototype, "content", void 0), O([_({ alias: "_parent.style.json" }), D("design:type", Object)], X.prototype, "style", void 0), O([_(), D("design:type", Object)], X.prototype, "effects", void 0), O([_(), D("design:type", Object)], X.prototype, "fill", void 0), O([_(), D("design:type", Object)], X.prototype, "outline", void 0), O([_({ alias: "base.measureDom" }), D("design:type", typeof (Vi = typeof HTMLElement < "u" && HTMLElement) == "function" ? Vi : Object)], X.prototype, "measureDom", void 0), O([_({ alias: "base.fonts" }), D("design:type", Object)], X.prototype, "fonts", void 0), O([_({ fallback: "auto" }), D("design:type", Object)], X.prototype, "drawMode", void 0);
|
|
6539
6678
|
//#endregion
|
|
6540
6679
|
//#region src/scene/2d/element/Flexbox.ts
|
|
6541
6680
|
var Z = {
|
|
@@ -6548,7 +6687,7 @@ var Z = {
|
|
|
6548
6687
|
horizontal: 6,
|
|
6549
6688
|
vertical: 7,
|
|
6550
6689
|
all: 8
|
|
6551
|
-
},
|
|
6690
|
+
}, Hi = {
|
|
6552
6691
|
column: 0,
|
|
6553
6692
|
row: 1,
|
|
6554
6693
|
all: 2
|
|
@@ -6562,42 +6701,42 @@ var Z = {
|
|
|
6562
6701
|
"space-between": 6,
|
|
6563
6702
|
"space-around": 7,
|
|
6564
6703
|
"space-evenly": 8
|
|
6565
|
-
},
|
|
6704
|
+
}, Ui = {
|
|
6566
6705
|
flex: 0,
|
|
6567
6706
|
none: 1,
|
|
6568
6707
|
contents: 2
|
|
6569
|
-
},
|
|
6708
|
+
}, Wi = {
|
|
6570
6709
|
inherit: 0,
|
|
6571
6710
|
ltr: 1,
|
|
6572
6711
|
rtl: 2
|
|
6573
|
-
},
|
|
6712
|
+
}, Gi = {
|
|
6574
6713
|
column: 0,
|
|
6575
6714
|
"column-reverse": 1,
|
|
6576
6715
|
row: 2,
|
|
6577
6716
|
"row-reverse": 3
|
|
6578
|
-
},
|
|
6717
|
+
}, Ki = {
|
|
6579
6718
|
"no-wrap": 0,
|
|
6580
6719
|
wrap: 1,
|
|
6581
6720
|
"Wrap-reverse": 2
|
|
6582
|
-
},
|
|
6721
|
+
}, qi = {
|
|
6583
6722
|
"flex-start": 0,
|
|
6584
6723
|
center: 1,
|
|
6585
6724
|
"flex-end": 2,
|
|
6586
6725
|
"space-between": 3,
|
|
6587
6726
|
"space-around": 4,
|
|
6588
6727
|
"space-evenly": 5
|
|
6589
|
-
},
|
|
6728
|
+
}, Ji = {
|
|
6590
6729
|
visible: 0,
|
|
6591
6730
|
hidden: 1,
|
|
6592
6731
|
scroll: 2
|
|
6593
|
-
},
|
|
6732
|
+
}, Yi = {
|
|
6594
6733
|
static: 0,
|
|
6595
6734
|
relative: 1,
|
|
6596
6735
|
absolute: 2
|
|
6597
|
-
},
|
|
6736
|
+
}, Xi = {
|
|
6598
6737
|
"border-box": 0,
|
|
6599
6738
|
"content-box": 1
|
|
6600
|
-
},
|
|
6739
|
+
}, Zi = class e {
|
|
6601
6740
|
_parent;
|
|
6602
6741
|
static _yoga;
|
|
6603
6742
|
static async load() {
|
|
@@ -6609,14 +6748,14 @@ var Z = {
|
|
|
6609
6748
|
this._parent = e, this._addChild = this._addChild.bind(this), this._removeChild = this._removeChild.bind(this), this._parent.on("addChild", this._addChild), this._parent.on("removeChild", this._removeChild);
|
|
6610
6749
|
}
|
|
6611
6750
|
_addChild(e, t) {
|
|
6612
|
-
if (e instanceof
|
|
6751
|
+
if (e instanceof ta && e.flexbox.node && this.node) {
|
|
6613
6752
|
this.node.insertChild(e.flexbox.node, t);
|
|
6614
6753
|
let n = e.style.getProperties();
|
|
6615
6754
|
for (let t in n) e.flexbox.updateStyleProperty(t, n[t]);
|
|
6616
6755
|
}
|
|
6617
6756
|
}
|
|
6618
6757
|
_removeChild(e, t) {
|
|
6619
|
-
e instanceof
|
|
6758
|
+
e instanceof ta && e.flexbox.node && this.node && this.node.removeChild(e.flexbox.node);
|
|
6620
6759
|
}
|
|
6621
6760
|
updateStyleProperty(e, t) {
|
|
6622
6761
|
let n = this.node;
|
|
@@ -6650,10 +6789,10 @@ var Z = {
|
|
|
6650
6789
|
n.setBorder(Z.all, this._parent.style.borderWidth);
|
|
6651
6790
|
break;
|
|
6652
6791
|
case "direction":
|
|
6653
|
-
n.setDirection(t ?
|
|
6792
|
+
n.setDirection(t ? Wi[t] ?? Wi.inherit : Wi.inherit);
|
|
6654
6793
|
break;
|
|
6655
6794
|
case "display":
|
|
6656
|
-
n.setDisplay(t ?
|
|
6795
|
+
n.setDisplay(t ? Ui[t] ?? Ui.flex : Ui.flex);
|
|
6657
6796
|
break;
|
|
6658
6797
|
case "flex":
|
|
6659
6798
|
n.setFlex(t);
|
|
@@ -6662,7 +6801,7 @@ var Z = {
|
|
|
6662
6801
|
n.setFlexBasis(t);
|
|
6663
6802
|
break;
|
|
6664
6803
|
case "flexDirection":
|
|
6665
|
-
n.setFlexDirection(t ?
|
|
6804
|
+
n.setFlexDirection(t ? Gi[t] ?? Gi.row : Gi.row);
|
|
6666
6805
|
break;
|
|
6667
6806
|
case "flexGrow":
|
|
6668
6807
|
n.setFlexGrow(t);
|
|
@@ -6671,16 +6810,16 @@ var Z = {
|
|
|
6671
6810
|
n.setFlexShrink(t);
|
|
6672
6811
|
break;
|
|
6673
6812
|
case "flexWrap":
|
|
6674
|
-
n.setFlexWrap(t ?
|
|
6813
|
+
n.setFlexWrap(t ? Ki[t] ?? Ki.wrap : Ki.wrap);
|
|
6675
6814
|
break;
|
|
6676
6815
|
case "height":
|
|
6677
6816
|
n.setHeight(t);
|
|
6678
6817
|
break;
|
|
6679
6818
|
case "justifyContent":
|
|
6680
|
-
n.setJustifyContent(t ?
|
|
6819
|
+
n.setJustifyContent(t ? qi[t] ?? qi["flex-start"] : qi["flex-start"]);
|
|
6681
6820
|
break;
|
|
6682
6821
|
case "gap":
|
|
6683
|
-
t !== void 0 && n.setGap(
|
|
6822
|
+
t !== void 0 && n.setGap(Hi.all, t);
|
|
6684
6823
|
break;
|
|
6685
6824
|
case "marginTop":
|
|
6686
6825
|
n.setMargin(Z.top, t);
|
|
@@ -6710,7 +6849,7 @@ var Z = {
|
|
|
6710
6849
|
n.setMinWidth(t);
|
|
6711
6850
|
break;
|
|
6712
6851
|
case "overflow":
|
|
6713
|
-
n.setOverflow(t ?
|
|
6852
|
+
n.setOverflow(t ? Ji[t] ?? Ji.visible : Ji.visible);
|
|
6714
6853
|
break;
|
|
6715
6854
|
case "paddingTop":
|
|
6716
6855
|
n.setPadding(Z.top, t);
|
|
@@ -6740,10 +6879,10 @@ var Z = {
|
|
|
6740
6879
|
n.setPosition(Z.right, t);
|
|
6741
6880
|
break;
|
|
6742
6881
|
case "position":
|
|
6743
|
-
n.setPositionType(t ?
|
|
6882
|
+
n.setPositionType(t ? Yi[t] ?? Yi.relative : Yi.relative);
|
|
6744
6883
|
break;
|
|
6745
6884
|
case "boxSizing":
|
|
6746
|
-
n.setBoxSizing(t ?
|
|
6885
|
+
n.setBoxSizing(t ? Xi[t] ?? Xi["content-box"] : Xi["content-box"]);
|
|
6747
6886
|
break;
|
|
6748
6887
|
case "width":
|
|
6749
6888
|
n.setWidth(t);
|
|
@@ -6754,7 +6893,7 @@ var Z = {
|
|
|
6754
6893
|
}
|
|
6755
6894
|
update() {
|
|
6756
6895
|
let e = this._parent, t = this.node;
|
|
6757
|
-
if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0,
|
|
6896
|
+
if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0, Wi.ltr), t.hasNewLayout())) {
|
|
6758
6897
|
let { left: n, top: r, width: i, height: a } = t.getComputedLayout();
|
|
6759
6898
|
(!Number.isNaN(n) && n !== e.position.x || !Number.isNaN(r) && r !== e.position.y) && e.position.set(n, r), (!Number.isNaN(i) && i !== e.size.x || !Number.isNaN(a) && a !== e.size.y) && e.size.set(i, a), t.markLayoutSeen();
|
|
6760
6899
|
}
|
|
@@ -6762,10 +6901,10 @@ var Z = {
|
|
|
6762
6901
|
destroy() {
|
|
6763
6902
|
this.node?.free(), this.node = void 0;
|
|
6764
6903
|
}
|
|
6765
|
-
},
|
|
6766
|
-
flexbox = new
|
|
6767
|
-
aabb = new
|
|
6768
|
-
globalAabb = new
|
|
6904
|
+
}, Qi, $i = new Set(Object.keys(a())), ea = new Set(Object.keys(s())), ta = class extends wr {
|
|
6905
|
+
flexbox = new Zi(this);
|
|
6906
|
+
aabb = new lt();
|
|
6907
|
+
globalAabb = new lt();
|
|
6769
6908
|
_parentGlobalDisplay;
|
|
6770
6909
|
_globalDisplay;
|
|
6771
6910
|
get globalDisplay() {
|
|
@@ -6776,7 +6915,7 @@ var Z = {
|
|
|
6776
6915
|
});
|
|
6777
6916
|
_allowPointerEvents = !0;
|
|
6778
6917
|
_overflowHidden = !1;
|
|
6779
|
-
_style = new
|
|
6918
|
+
_style = new zi().on("updateProperty", (...e) => {
|
|
6780
6919
|
this.onUpdateStyleProperty(e[0], e[1], e[2]);
|
|
6781
6920
|
});
|
|
6782
6921
|
get style() {
|
|
@@ -6785,14 +6924,14 @@ var Z = {
|
|
|
6785
6924
|
set style(e) {
|
|
6786
6925
|
this._style.resetProperties().setProperties(e);
|
|
6787
6926
|
}
|
|
6788
|
-
_background = new
|
|
6927
|
+
_background = new Mi(this);
|
|
6789
6928
|
get background() {
|
|
6790
6929
|
return this._background;
|
|
6791
6930
|
}
|
|
6792
6931
|
set background(e) {
|
|
6793
6932
|
this._background.resetProperties().setProperties(e);
|
|
6794
6933
|
}
|
|
6795
|
-
_shape = new
|
|
6934
|
+
_shape = new Ri(this);
|
|
6796
6935
|
get shape() {
|
|
6797
6936
|
return this._shape;
|
|
6798
6937
|
}
|
|
@@ -6806,14 +6945,14 @@ var Z = {
|
|
|
6806
6945
|
set fill(e) {
|
|
6807
6946
|
this._fill.resetProperties().setProperties(e);
|
|
6808
6947
|
}
|
|
6809
|
-
_outline = new
|
|
6948
|
+
_outline = new Ii(this);
|
|
6810
6949
|
get outline() {
|
|
6811
6950
|
return this._outline;
|
|
6812
6951
|
}
|
|
6813
6952
|
set outline(e) {
|
|
6814
6953
|
this._outline.resetProperties().setProperties(e);
|
|
6815
6954
|
}
|
|
6816
|
-
_foreground = new
|
|
6955
|
+
_foreground = new Fi(this);
|
|
6817
6956
|
get foreground() {
|
|
6818
6957
|
return this._foreground;
|
|
6819
6958
|
}
|
|
@@ -6827,14 +6966,14 @@ var Z = {
|
|
|
6827
6966
|
set text(e) {
|
|
6828
6967
|
this._text.resetProperties().setProperties(e);
|
|
6829
6968
|
}
|
|
6830
|
-
_shadow = new
|
|
6969
|
+
_shadow = new Li(this);
|
|
6831
6970
|
get shadow() {
|
|
6832
6971
|
return this._shadow;
|
|
6833
6972
|
}
|
|
6834
6973
|
set shadow(e) {
|
|
6835
6974
|
this._shadow.resetProperties().setProperties(e);
|
|
6836
6975
|
}
|
|
6837
|
-
_connection = new
|
|
6976
|
+
_connection = new Ni(this);
|
|
6838
6977
|
get connection() {
|
|
6839
6978
|
return this._connection;
|
|
6840
6979
|
}
|
|
@@ -6905,7 +7044,7 @@ var Z = {
|
|
|
6905
7044
|
this._updateGlobalDisplay();
|
|
6906
7045
|
break;
|
|
6907
7046
|
case "rotate":
|
|
6908
|
-
this.rotation = (t || 0) *
|
|
7047
|
+
this.rotation = (t || 0) * ut, this.updateGlobalTransform();
|
|
6909
7048
|
break;
|
|
6910
7049
|
case "scaleX":
|
|
6911
7050
|
this.scale.x = t, this.text.isValid() && (t ^ n) < 0 && this.requestDraw();
|
|
@@ -6926,7 +7065,7 @@ var Z = {
|
|
|
6926
7065
|
}), this.extraTransform.translate(this.pivot.x, this.pivot.y), this.updateGlobalTransform();
|
|
6927
7066
|
break;
|
|
6928
7067
|
case "transformOrigin": {
|
|
6929
|
-
let e =
|
|
7068
|
+
let e = Pr(t ?? "");
|
|
6930
7069
|
this.pivot.set(e[0] * this.size.width, e[1] * this.size.height);
|
|
6931
7070
|
break;
|
|
6932
7071
|
}
|
|
@@ -6970,7 +7109,7 @@ var Z = {
|
|
|
6970
7109
|
this.requestDraw();
|
|
6971
7110
|
break;
|
|
6972
7111
|
}
|
|
6973
|
-
if ((
|
|
7112
|
+
if ((ea.has(e) || $i.has(e)) && this.text.isValid() && this.text.update(), this.globalDisplay === "flex") this.flexbox.updateStyleProperty(e, t);
|
|
6974
7113
|
else switch (e) {
|
|
6975
7114
|
case "left":
|
|
6976
7115
|
this.position.x = Number(t);
|
|
@@ -6990,24 +7129,24 @@ var Z = {
|
|
|
6990
7129
|
super.requestLayout(), this.flexbox.update();
|
|
6991
7130
|
}
|
|
6992
7131
|
_process(e) {
|
|
6993
|
-
super._process(e), this.foreground.process(e), this.fill.process(e), this.text.process(e), this.outline.process(e), this.background.process(e), this._connection.isValid() && this.
|
|
7132
|
+
super._process(e), this.foreground.process(e), this.fill.process(e), this.text.process(e), this.outline.process(e), this.background.process(e), this._connection.isValid() && this._updateConnection();
|
|
6994
7133
|
let t = this.getParent();
|
|
6995
7134
|
this._parentGlobalDisplay !== t?.globalDisplay && this._updateGlobalDisplay(), this.flexbox.update();
|
|
6996
7135
|
}
|
|
6997
|
-
|
|
6998
|
-
let e = this._connection.
|
|
6999
|
-
if (!e
|
|
7000
|
-
let
|
|
7001
|
-
this.position.x =
|
|
7136
|
+
_updateConnection() {
|
|
7137
|
+
let e = this._connection.route();
|
|
7138
|
+
if (!e || !e.getLength()) return;
|
|
7139
|
+
let t = e.getBoundingBox(), n = Math.max(t.width, 1), r = Math.max(t.height, 1);
|
|
7140
|
+
this.position.x = t.x, this.position.y = t.y, this.size.width = n, this.size.height = r, this.updateGlobalTransform(), e.applyTransform(new v().translate(-t.x, -t.y)), this._shape.setLocalPath(e);
|
|
7002
7141
|
}
|
|
7003
7142
|
_updateStyleFilter(e) {
|
|
7004
|
-
d(e) ? (this._colorFilterEffect?.remove(), this._colorFilterEffect = void 0, this.requestRender()) : (this._colorFilterEffect || (this._colorFilterEffect = new
|
|
7143
|
+
d(e) ? (this._colorFilterEffect?.remove(), this._colorFilterEffect = void 0, this.requestRender()) : (this._colorFilterEffect || (this._colorFilterEffect = new zr({
|
|
7005
7144
|
name: "styleFilter",
|
|
7006
7145
|
internalMode: "front"
|
|
7007
7146
|
}), this.append(this._colorFilterEffect)), this._colorFilterEffect.filter = e);
|
|
7008
7147
|
}
|
|
7009
7148
|
_updateStyleMaskImage(e) {
|
|
7010
|
-
d(e) ? (this._maskEffect?.remove(), this._maskEffect = void 0, this.requestRender()) : (this._maskEffect || (this._maskEffect = new
|
|
7149
|
+
d(e) ? (this._maskEffect?.remove(), this._maskEffect = void 0, this.requestRender()) : (this._maskEffect || (this._maskEffect = new xi({
|
|
7011
7150
|
name: "styleMaskImage",
|
|
7012
7151
|
internalMode: "back"
|
|
7013
7152
|
}), this.append(this._maskEffect)), this._maskEffect.image = e);
|
|
@@ -7038,11 +7177,11 @@ var Z = {
|
|
|
7038
7177
|
}
|
|
7039
7178
|
getObb() {
|
|
7040
7179
|
let e = this.pivot, t = this.transform.apply(e).sub(e);
|
|
7041
|
-
return new
|
|
7180
|
+
return new mt(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.rotation);
|
|
7042
7181
|
}
|
|
7043
7182
|
getGlobalObb() {
|
|
7044
7183
|
let e = this.pivot, t = this.globalTransform.apply(e).sub(e);
|
|
7045
|
-
return new
|
|
7184
|
+
return new mt(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.globalRotation);
|
|
7046
7185
|
}
|
|
7047
7186
|
_draw() {
|
|
7048
7187
|
super._draw(), this._background.isValid() && (this._shape.draw(!this._background.fillWithShape), this._background.draw()), this._fill.isValid() && (this._shape.draw(), this._fill.draw()), this._outline.isValid() && (this._shape.draw(), this._outline.draw()), this._foreground.isValid() && (this._shape.draw(!this._foreground.fillWithShape), this._foreground.draw()), this._text.isValid() && this._text.draw(), this._drawContent();
|
|
@@ -7054,8 +7193,8 @@ var Z = {
|
|
|
7054
7193
|
this.isVisibleInTree() && this._input(e, t);
|
|
7055
7194
|
}
|
|
7056
7195
|
_positionInput(e, t) {
|
|
7057
|
-
let { width: n, height: r } = this.size;
|
|
7058
|
-
return e.x >= 0 && e.x < n && e.y >= 0 && e.y < r;
|
|
7196
|
+
let { width: n, height: r } = this.size, i = (Number(this._outline.width) || 0) / 2 + 1;
|
|
7197
|
+
return e.x < -i || e.x >= n + i || e.y < -i || e.y >= r + i ? !1 : this._shape.isValid() || this._shape.localPath ? this._shape.isPointInside(e, { strokeWidth: Number(this._outline.width) || 1 }) : e.x >= 0 && e.x < n && e.y >= 0 && e.y < r;
|
|
7059
7198
|
}
|
|
7060
7199
|
_input(e, t) {
|
|
7061
7200
|
switch (t) {
|
|
@@ -7094,10 +7233,10 @@ var Z = {
|
|
|
7094
7233
|
super._destroy(), this.flexbox.destroy(), this.aabb.destroy(), this.globalAabb.destroy(), this.size.destroy(), this.style.destroy(), this.background.destroy(), this.shape.destroy(), this.fill.destroy(), this.outline.destroy(), this.text.destroy(), this.foreground.destroy(), this.shadow.destroy(), this.connection.destroy(), this._colorFilterEffect = void 0, this._maskEffect = void 0;
|
|
7095
7234
|
}
|
|
7096
7235
|
};
|
|
7097
|
-
|
|
7236
|
+
ta = O([x("Element2D"), D("design:paramtypes", [typeof (Qi = typeof Partial < "u" && Partial) == "function" ? Qi : Object, Array])], ta);
|
|
7098
7237
|
//#endregion
|
|
7099
7238
|
//#region src/scene/2d/TextureRect2D.ts
|
|
7100
|
-
var
|
|
7239
|
+
var na = class extends ta {
|
|
7101
7240
|
texture;
|
|
7102
7241
|
constructor(e, t = []) {
|
|
7103
7242
|
super(), this.setProperties(e).append(t);
|
|
@@ -7111,8 +7250,8 @@ var Xi = class extends Yi {
|
|
|
7111
7250
|
} });
|
|
7112
7251
|
}
|
|
7113
7252
|
}
|
|
7114
|
-
},
|
|
7115
|
-
texture = new
|
|
7253
|
+
}, ra, ia = class extends na {
|
|
7254
|
+
texture = new Qn();
|
|
7116
7255
|
animation;
|
|
7117
7256
|
constructor(e, t = []) {
|
|
7118
7257
|
super(), this.setProperties(e), this.append(t);
|
|
@@ -7141,10 +7280,10 @@ var Xi = class extends Yi {
|
|
|
7141
7280
|
this.animation?.goToAndStop(this.currentTime, !1), this.texture.requestUpdate("source"), this.requestDraw(), super._process(e);
|
|
7142
7281
|
}
|
|
7143
7282
|
};
|
|
7144
|
-
|
|
7283
|
+
O([_({ fallback: "" }), D("design:type", String)], ia.prototype, "src", void 0), ia = O([x("Lottie2D"), D("design:paramtypes", [typeof (ra = typeof Partial < "u" && Partial) == "function" ? ra : Object, Array])], ia);
|
|
7145
7284
|
//#endregion
|
|
7146
7285
|
//#region src/scene/2d/TransformRect2D.ts
|
|
7147
|
-
var
|
|
7286
|
+
var aa = class extends ta {
|
|
7148
7287
|
constructor(e, t = []) {
|
|
7149
7288
|
super(), this.setProperties(e).append(t);
|
|
7150
7289
|
}
|
|
@@ -7157,20 +7296,20 @@ var $i = class extends Yi {
|
|
|
7157
7296
|
}
|
|
7158
7297
|
}
|
|
7159
7298
|
_drawCircle(e, t) {
|
|
7160
|
-
this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.fillStyle =
|
|
7299
|
+
this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.fillStyle = R.WHITE, this.context.fill(), this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.strokeStyle = "rgba(0, 0, 0, 0.2)", this.context.stroke();
|
|
7161
7300
|
}
|
|
7162
7301
|
_drawEllipse(e, t) {
|
|
7163
|
-
this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.fillStyle =
|
|
7302
|
+
this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.fillStyle = R.WHITE, this.context.fill(), this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.strokeStyle = "rgba(0, 0, 0, 0.2)", this.context.stroke();
|
|
7164
7303
|
}
|
|
7165
7304
|
_draw() {
|
|
7166
7305
|
let { width: e, height: t } = this.getRect();
|
|
7167
7306
|
this.context.rect(0, 0, e, t), this.context.strokeStyle = "#00FF00", this.context.stroke(), this._drawCircle(0, 0), this._drawCircle(e, t), this._drawCircle(0, t), this._drawEllipse(0, t / 2), this._drawCircle(e, 0), this._drawEllipse(e, t / 2);
|
|
7168
7307
|
}
|
|
7169
7308
|
};
|
|
7170
|
-
|
|
7309
|
+
O([_({ fallback: 6 }), D("design:type", Number)], aa.prototype, "handleSize", void 0);
|
|
7171
7310
|
//#endregion
|
|
7172
7311
|
//#region src/scene/2d/Video2D.ts
|
|
7173
|
-
var
|
|
7312
|
+
var oa, sa = class extends na {
|
|
7174
7313
|
get videoDuration() {
|
|
7175
7314
|
return (this.texture?.duration ?? 0) * 1e3;
|
|
7176
7315
|
}
|
|
@@ -7210,11 +7349,11 @@ var ea, ta = class extends Xi {
|
|
|
7210
7349
|
super._process(e), this._updateVideoCurrentTime();
|
|
7211
7350
|
}
|
|
7212
7351
|
};
|
|
7213
|
-
|
|
7352
|
+
O([_({ fallback: "" }), D("design:type", String)], sa.prototype, "src", void 0), sa = O([x("Video2D"), D("design:paramtypes", [typeof (oa = typeof Partial < "u" && Partial) == "function" ? oa : Object, Array])], sa);
|
|
7214
7353
|
//#endregion
|
|
7215
7354
|
//#region src/scene/animation/Animation.ts
|
|
7216
|
-
var
|
|
7217
|
-
function
|
|
7355
|
+
var ca, la = (e) => e, ua = ma(.25, .1, .25, 1), da = ma(.42, 0, 1, 1), fa = ma(0, 0, .58, 1), pa = ma(.42, 0, .58, 1);
|
|
7356
|
+
function ma(e, t, n, r) {
|
|
7218
7357
|
let i = 1e-6, a = 3 * e - 3 * n + 1, o = 3 * n - 6 * e, s = 3 * e, c = 3 * t - 3 * r + 1, l = 3 * r - 6 * t, u = 3 * t, d = (e) => (3 * a * e + 2 * o) * e + s, f = (e) => ((a * e + o) * e + s) * e, p = (e) => ((c * e + l) * e + u) * e;
|
|
7219
7358
|
function m(e) {
|
|
7220
7359
|
let t = e, n, r;
|
|
@@ -7234,13 +7373,13 @@ function ca(e, t, n, r) {
|
|
|
7234
7373
|
}
|
|
7235
7374
|
return (e) => p(m(e));
|
|
7236
7375
|
}
|
|
7237
|
-
var
|
|
7238
|
-
linear:
|
|
7239
|
-
ease:
|
|
7240
|
-
easeIn:
|
|
7241
|
-
easeOut:
|
|
7242
|
-
easeInOut:
|
|
7243
|
-
},
|
|
7376
|
+
var ha = {
|
|
7377
|
+
linear: la,
|
|
7378
|
+
ease: ua,
|
|
7379
|
+
easeIn: da,
|
|
7380
|
+
easeOut: fa,
|
|
7381
|
+
easeInOut: pa
|
|
7382
|
+
}, ga = class extends B {
|
|
7244
7383
|
_keyframes = [];
|
|
7245
7384
|
_isFirstUpdatePosition = !1;
|
|
7246
7385
|
_cachedProps = new t();
|
|
@@ -7275,7 +7414,7 @@ var la = {
|
|
|
7275
7414
|
e = [this.getParent()].filter(Boolean);
|
|
7276
7415
|
break;
|
|
7277
7416
|
}
|
|
7278
|
-
return e.filter((e) => e instanceof
|
|
7417
|
+
return e.filter((e) => e instanceof ta);
|
|
7279
7418
|
}
|
|
7280
7419
|
_updateKeyframes() {
|
|
7281
7420
|
let e = [], t = this.keyframes;
|
|
@@ -7307,7 +7446,7 @@ var la = {
|
|
|
7307
7446
|
}
|
|
7308
7447
|
let e = this._getTargets(), t = 1 / e.length, n = this.currentTimeProgress;
|
|
7309
7448
|
e.forEach((e, r) => {
|
|
7310
|
-
let i = t === 1 ? n :
|
|
7449
|
+
let i = t === 1 ? n : ft(Math.max(0, n - t * r) / t, 0, 1), a = this._cachedProps.get(e);
|
|
7311
7450
|
if (!a) return;
|
|
7312
7451
|
let o = this._parseKeyframes(i, a);
|
|
7313
7452
|
o?.length && this._commitStyle(i, e, a, o[0], o[1]);
|
|
@@ -7323,10 +7462,10 @@ var la = {
|
|
|
7323
7462
|
});
|
|
7324
7463
|
}
|
|
7325
7464
|
_parseEasing(e) {
|
|
7326
|
-
if (!e) return
|
|
7327
|
-
if (e in
|
|
7465
|
+
if (!e) return ha.linear;
|
|
7466
|
+
if (e in ha) return ha[e];
|
|
7328
7467
|
let t = e.replace(/cubic-bezier\((.+)\)/, "$1").split(",").map((e) => Number(e));
|
|
7329
|
-
return
|
|
7468
|
+
return ma(t[0], t[1], t[2], t[3]);
|
|
7330
7469
|
}
|
|
7331
7470
|
_parseKeyframes(e, t) {
|
|
7332
7471
|
let n, r = this._keyframes;
|
|
@@ -7378,10 +7517,10 @@ var la = {
|
|
|
7378
7517
|
let a = Math.max(t[e]?.length ?? 0, n[e]?.length ?? 0), o = t[e], s = n[e];
|
|
7379
7518
|
i += `${e}(${Array.from({ length: a }, (e, t) => {
|
|
7380
7519
|
let n = o?.[t], i = s?.[t], a = n?.normalizedIntValue ?? 0, c = i?.normalizedIntValue ?? 0;
|
|
7381
|
-
return Number.isNaN(a) || Number.isNaN(c) ? i?.value ?? 0 :
|
|
7520
|
+
return Number.isNaN(a) || Number.isNaN(c) ? i?.value ?? 0 : E(a, c, r);
|
|
7382
7521
|
}).join(", ")}) `;
|
|
7383
7522
|
}), i;
|
|
7384
|
-
} else if (!Array.isArray(a) && !Array.isArray(o)) return Number.isNaN(a.normalizedIntValue) || Number.isNaN(o.normalizedIntValue) ? o.value :
|
|
7523
|
+
} else if (!Array.isArray(a) && !Array.isArray(o)) return Number.isNaN(a.normalizedIntValue) || Number.isNaN(o.normalizedIntValue) ? o.value : E(a.normalizedIntValue, o.normalizedIntValue, r);
|
|
7385
7524
|
}
|
|
7386
7525
|
isPlaying() {
|
|
7387
7526
|
return !this.paused && this.isInsideTimeRange();
|
|
@@ -7404,14 +7543,14 @@ var la = {
|
|
|
7404
7543
|
});
|
|
7405
7544
|
}
|
|
7406
7545
|
};
|
|
7407
|
-
|
|
7546
|
+
O([_({ fallback: "parent" }), D("design:type", Object)], ga.prototype, "effectMode", void 0), O([_({ default: () => [] }), D("design:type", Array)], ga.prototype, "keyframes", void 0), O([_(), D("design:type", Object)], ga.prototype, "easing", void 0), ga = O([x("Animation", {
|
|
7408
7547
|
renderMode: "disabled",
|
|
7409
7548
|
processSortMode: "parent-before",
|
|
7410
7549
|
duration: 2e3
|
|
7411
|
-
}),
|
|
7550
|
+
}), D("design:paramtypes", [typeof (ca = typeof Partial < "u" && Partial) == "function" ? ca : Object, Array])], ga);
|
|
7412
7551
|
//#endregion
|
|
7413
7552
|
//#region src/scene/audio/html/HTMLAudioContext.ts
|
|
7414
|
-
var
|
|
7553
|
+
var _a = class t extends e {
|
|
7415
7554
|
static _instance;
|
|
7416
7555
|
static get instance() {
|
|
7417
7556
|
return this._instance ||= new t(), this._instance;
|
|
@@ -7441,7 +7580,7 @@ var da = class t extends e {
|
|
|
7441
7580
|
togglePause() {
|
|
7442
7581
|
return this.paused = !this.paused, this.refreshPaused(), this.paused;
|
|
7443
7582
|
}
|
|
7444
|
-
},
|
|
7583
|
+
}, va = class t extends e {
|
|
7445
7584
|
static PADDING = .1;
|
|
7446
7585
|
_source = null;
|
|
7447
7586
|
_audio = null;
|
|
@@ -7568,7 +7707,7 @@ var da = class t extends e {
|
|
|
7568
7707
|
let e = this._source;
|
|
7569
7708
|
e && (e.onended = null, e.onplay = null, e.onpause = null, this._stop()), this._source = null, this._playbackRate = 1, this._volume = 1, this._loop = !1, this._end = 0, this._start = 0, this._duration = 0, this._playing = !1, this._pausedReal = !1, this._paused = !1, this._muted = !1, this._audio &&= (this._audio.context.off("refresh", this.refresh), this._audio.context.off("refreshPaused", this.refreshPaused), null);
|
|
7570
7709
|
}
|
|
7571
|
-
},
|
|
7710
|
+
}, ya = class {
|
|
7572
7711
|
parent;
|
|
7573
7712
|
source = new globalThis.Audio();
|
|
7574
7713
|
_src = "";
|
|
@@ -7585,7 +7724,7 @@ var da = class t extends e {
|
|
|
7585
7724
|
return !!this.source && this.source.readyState === 4;
|
|
7586
7725
|
}
|
|
7587
7726
|
get context() {
|
|
7588
|
-
return
|
|
7727
|
+
return _a.instance;
|
|
7589
7728
|
}
|
|
7590
7729
|
constructor(e) {
|
|
7591
7730
|
this.parent = e;
|
|
@@ -7596,9 +7735,9 @@ var da = class t extends e {
|
|
|
7596
7735
|
});
|
|
7597
7736
|
}
|
|
7598
7737
|
createSound() {
|
|
7599
|
-
return new
|
|
7738
|
+
return new va();
|
|
7600
7739
|
}
|
|
7601
|
-
},
|
|
7740
|
+
}, ba = class extends e {
|
|
7602
7741
|
_input;
|
|
7603
7742
|
_output;
|
|
7604
7743
|
_processers = [];
|
|
@@ -7620,7 +7759,7 @@ var da = class t extends e {
|
|
|
7620
7759
|
get destination() {
|
|
7621
7760
|
return this._input;
|
|
7622
7761
|
}
|
|
7623
|
-
},
|
|
7762
|
+
}, xa = class {
|
|
7624
7763
|
destination;
|
|
7625
7764
|
source;
|
|
7626
7765
|
constructor(e, t = null) {
|
|
@@ -7635,21 +7774,21 @@ var da = class t extends e {
|
|
|
7635
7774
|
};
|
|
7636
7775
|
//#endregion
|
|
7637
7776
|
//#region src/scene/audio/web/WebAudioContext.ts
|
|
7638
|
-
function
|
|
7639
|
-
if (
|
|
7640
|
-
if (
|
|
7777
|
+
function Sa() {
|
|
7778
|
+
if (Le) return new AudioContext();
|
|
7779
|
+
if (Re) {
|
|
7641
7780
|
let e = globalThis.webkitAudioContext;
|
|
7642
7781
|
return new e();
|
|
7643
7782
|
} else throw Error("Failed to createAudioContext");
|
|
7644
7783
|
}
|
|
7645
|
-
function
|
|
7646
|
-
if (
|
|
7647
|
-
if (
|
|
7784
|
+
function Ca(e, t, n) {
|
|
7785
|
+
if (ze) return new OfflineAudioContext(e, t, n);
|
|
7786
|
+
if (Be) {
|
|
7648
7787
|
let r = globalThis.webkitOfflineAudioContext;
|
|
7649
7788
|
return new r(e, t, n);
|
|
7650
7789
|
} else throw Error("Failed to createOfflineAudioContext");
|
|
7651
7790
|
}
|
|
7652
|
-
var
|
|
7791
|
+
var wa = class e extends ba {
|
|
7653
7792
|
static _instance;
|
|
7654
7793
|
static get instance() {
|
|
7655
7794
|
return this._instance ||= new e(), this._instance;
|
|
@@ -7690,8 +7829,8 @@ var va = class e extends ma {
|
|
|
7690
7829
|
_compressor;
|
|
7691
7830
|
_analyser;
|
|
7692
7831
|
constructor() {
|
|
7693
|
-
let e =
|
|
7694
|
-
r.connect(n), n.connect(e.destination), super(r, n), this._context = e, this._offlineContext = t, this._compressor = n, this._analyser = r, this._locked = e.state === "suspended" && (
|
|
7832
|
+
let e = Sa(), t = Ca(1, 2, ze ? Math.max(8e3, Math.min(96e3, e.sampleRate)) : 44100), n = e.createDynamicsCompressor(), r = e.createAnalyser();
|
|
7833
|
+
r.connect(n), n.connect(e.destination), super(r, n), this._context = e, this._offlineContext = t, this._compressor = n, this._analyser = r, this._locked = e.state === "suspended" && (Pe || Fe), He && (this._locked && (this._unlock(), document.addEventListener("mousedown", this._unlock, !0), document.addEventListener("touchstart", this._unlock, !0), document.addEventListener("touchend", this._unlock, !0)), globalThis.addEventListener("focus", this._onFocus), globalThis.addEventListener("blur", this._onBlur));
|
|
7695
7834
|
}
|
|
7696
7835
|
_onFocus() {
|
|
7697
7836
|
if (!this.autoPause) return;
|
|
@@ -7731,7 +7870,7 @@ var va = class e extends ma {
|
|
|
7731
7870
|
setParamValue(e, t) {
|
|
7732
7871
|
e.setValueAtTime ? e.setValueAtTime(t, this._context.currentTime) : e.value = t;
|
|
7733
7872
|
}
|
|
7734
|
-
},
|
|
7873
|
+
}, Ta = class extends e {
|
|
7735
7874
|
_audio = null;
|
|
7736
7875
|
_sourceNode = null;
|
|
7737
7876
|
_gain = null;
|
|
@@ -7864,7 +8003,7 @@ var va = class e extends ma {
|
|
|
7864
8003
|
destroy() {
|
|
7865
8004
|
super.destroy(), this._stop(), this._gain?.disconnect(), this._gain = null, this._audio?.context.off("refresh", this.refresh), this._audio?.context.off("refreshPaused", this.refreshPaused), this._audio = null, this._processors.forEach((e) => e.disconnect()), this._processors.length = 0, this._end = 0, this._playbackRate = 1, this._volume = 1, this._loop = !1, this._elapsed = 0, this._duration = 0, this._paused = !1, this._muted = !1, this._pausedReal = !1;
|
|
7866
8005
|
}
|
|
7867
|
-
},
|
|
8006
|
+
}, Ea = class extends ba {
|
|
7868
8007
|
parent;
|
|
7869
8008
|
_sourceBuffer;
|
|
7870
8009
|
_sourceNode;
|
|
@@ -7872,7 +8011,7 @@ var va = class e extends ma {
|
|
|
7872
8011
|
gain;
|
|
7873
8012
|
analyser;
|
|
7874
8013
|
get context() {
|
|
7875
|
-
return
|
|
8014
|
+
return wa.instance;
|
|
7876
8015
|
}
|
|
7877
8016
|
get isPlayable() {
|
|
7878
8017
|
return !!this._sourceNode.buffer;
|
|
@@ -7887,8 +8026,8 @@ var va = class e extends ma {
|
|
|
7887
8026
|
this._sourceNode.buffer = e;
|
|
7888
8027
|
}
|
|
7889
8028
|
constructor(e) {
|
|
7890
|
-
let t =
|
|
7891
|
-
n.connect(i), i.connect(r), r.connect(
|
|
8029
|
+
let t = wa.audioContext, n = t.createBufferSource(), r = t.createGain(), i = t.createAnalyser();
|
|
8030
|
+
n.connect(i), i.connect(r), r.connect(wa.instance.destination), super(i, r), this.parent = e, this._sourceNode = n, this.gain = r, this.analyser = i;
|
|
7892
8031
|
}
|
|
7893
8032
|
async load() {
|
|
7894
8033
|
return this._sourceLoad ||= new Promise((e) => {
|
|
@@ -7901,7 +8040,7 @@ var va = class e extends ma {
|
|
|
7901
8040
|
});
|
|
7902
8041
|
}
|
|
7903
8042
|
_decode(e) {
|
|
7904
|
-
return Promise.resolve(e instanceof AudioBuffer ? e :
|
|
8043
|
+
return Promise.resolve(e instanceof AudioBuffer ? e : wa.decode(e)).then((e) => (this.parent.isLoaded = !0, this.buffer = e, e));
|
|
7905
8044
|
}
|
|
7906
8045
|
cloneSource() {
|
|
7907
8046
|
let e = this.context, t = this._sourceNode, n = e.audioContext.createBufferSource(), r = e.audioContext.createGain();
|
|
@@ -7911,15 +8050,15 @@ var va = class e extends ma {
|
|
|
7911
8050
|
};
|
|
7912
8051
|
}
|
|
7913
8052
|
createSound() {
|
|
7914
|
-
return new
|
|
8053
|
+
return new Ta();
|
|
7915
8054
|
}
|
|
7916
|
-
},
|
|
8055
|
+
}, Da, Oa = class extends B {
|
|
7917
8056
|
static {
|
|
7918
|
-
|
|
8057
|
+
Da = this;
|
|
7919
8058
|
}
|
|
7920
8059
|
static _soundPool = [];
|
|
7921
8060
|
_sounds = [];
|
|
7922
|
-
_platformAudio =
|
|
8061
|
+
_platformAudio = Ve ? new Ea(this) : new ya(this);
|
|
7923
8062
|
get platformAudio() {
|
|
7924
8063
|
return this._platformAudio;
|
|
7925
8064
|
}
|
|
@@ -8012,7 +8151,7 @@ var va = class e extends ma {
|
|
|
8012
8151
|
this._sounds.length = 0;
|
|
8013
8152
|
}
|
|
8014
8153
|
_createSound() {
|
|
8015
|
-
return
|
|
8154
|
+
return Da._soundPool.length > 0 ? Da._soundPool.pop().init(this._platformAudio) : this._platformAudio.createSound().init(this._platformAudio);
|
|
8016
8155
|
}
|
|
8017
8156
|
refresh() {
|
|
8018
8157
|
for (let e = this._sounds.length, t = 0; t < e; t++) this._sounds[t].refresh();
|
|
@@ -8028,7 +8167,7 @@ var va = class e extends ma {
|
|
|
8028
8167
|
this._recycleSound(e);
|
|
8029
8168
|
};
|
|
8030
8169
|
_recycleSound(e) {
|
|
8031
|
-
e.destroy(),
|
|
8170
|
+
e.destroy(), Da._soundPool.includes(e) || Da._soundPool.push(e);
|
|
8032
8171
|
}
|
|
8033
8172
|
_prevTime = 0;
|
|
8034
8173
|
_timer = 0;
|
|
@@ -8044,12 +8183,12 @@ var va = class e extends ma {
|
|
|
8044
8183
|
}, 100);
|
|
8045
8184
|
}
|
|
8046
8185
|
};
|
|
8047
|
-
|
|
8186
|
+
Oa = Da = O([x("Audio"), D("design:paramtypes", [Object])], Oa);
|
|
8048
8187
|
//#endregion
|
|
8049
8188
|
//#region src/scene/audio/AudioSpectrum.ts
|
|
8050
|
-
var
|
|
8189
|
+
var ka = class extends wr {}, Aa, ja = class extends ta {
|
|
8051
8190
|
_audioBuffer;
|
|
8052
|
-
_src =
|
|
8191
|
+
_src = He ? new R({ source: document.createElement("canvas") }) : void 0;
|
|
8053
8192
|
_needsUpdateTexture = !1;
|
|
8054
8193
|
constructor(e = {}) {
|
|
8055
8194
|
super(), this.setProperties(e);
|
|
@@ -8068,7 +8207,7 @@ var Ca = class extends wr {}, wa, Ta = class extends Yi {
|
|
|
8068
8207
|
}
|
|
8069
8208
|
}
|
|
8070
8209
|
async _loadSrc(e) {
|
|
8071
|
-
await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) =>
|
|
8210
|
+
await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) => wa.decode(e)).then((e) => {
|
|
8072
8211
|
this._audioBuffer = e, this.syncTexture(!0);
|
|
8073
8212
|
});
|
|
8074
8213
|
}
|
|
@@ -8103,16 +8242,16 @@ var Ca = class extends wr {}, wa, Ta = class extends Yi {
|
|
|
8103
8242
|
this.syncTexture(), super._process(e);
|
|
8104
8243
|
}
|
|
8105
8244
|
};
|
|
8106
|
-
|
|
8245
|
+
O([_(), D("design:type", Object)], ja.prototype, "src", void 0), O([_({ fallback: 0 }), D("design:type", Number)], ja.prototype, "gap", void 0), O([_({ fallback: "#000000" }), D("design:type", String)], ja.prototype, "color", void 0), ja = O([x("AudioWaveform"), D("design:paramtypes", [typeof (Aa = typeof Partial < "u" && Partial) == "function" ? Aa : Object])], ja);
|
|
8107
8246
|
//#endregion
|
|
8108
8247
|
//#region src/scene/transitions/KawaseTransition.ts
|
|
8109
|
-
var
|
|
8248
|
+
var Ma, Na = class extends Sr {
|
|
8110
8249
|
static {
|
|
8111
|
-
|
|
8250
|
+
Ma = this;
|
|
8112
8251
|
}
|
|
8113
8252
|
blur = 10;
|
|
8114
8253
|
quality = 10;
|
|
8115
|
-
static material = new
|
|
8254
|
+
static material = new F({ gl: {
|
|
8116
8255
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
8117
8256
|
fragment: "precision highp float;\nin vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 offset;\nuniform float progress;\n\nvoid main(void) {\n vec2 offset1 = vec2(offset.x - progress * offset.x, offset.y - progress * offset.y);\n vec4 color = vec4(0.0);\n color += texture(sampler, vec2(vUv.x - offset1.x, vUv.y + offset1.y));\n color += texture(sampler, vec2(vUv.x + offset1.x, vUv.y + offset1.y));\n color += texture(sampler, vec2(vUv.x + offset1.x, vUv.y - offset1.y));\n color += texture(sampler, vec2(vUv.x - offset1.x, vUv.y - offset1.y));\n color *= 0.25;\n gl_FragColor = color;\n}"
|
|
8118
8257
|
} });
|
|
@@ -8127,7 +8266,7 @@ var Ea, Da = class extends Sr {
|
|
|
8127
8266
|
let d = 1 / s, f = 1 / c, p = [], m, h = o - 1;
|
|
8128
8267
|
for (let e = 0; e < h; e++) m = u[e] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p });
|
|
8129
8268
|
m = u[h] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p }), l.forEach((t) => {
|
|
8130
|
-
|
|
8269
|
+
I.draw(e, Ma.material, {
|
|
8131
8270
|
sampler: r,
|
|
8132
8271
|
progress: i,
|
|
8133
8272
|
...t
|
|
@@ -8135,35 +8274,35 @@ var Ea, Da = class extends Sr {
|
|
|
8135
8274
|
});
|
|
8136
8275
|
}
|
|
8137
8276
|
};
|
|
8138
|
-
|
|
8277
|
+
Na = Ma = O([x("KawaseTransition")], Na);
|
|
8139
8278
|
//#endregion
|
|
8140
8279
|
//#region src/scene/transitions/LeftEraseTransition.ts
|
|
8141
|
-
var
|
|
8280
|
+
var Pa, Fa = class extends Sr {
|
|
8142
8281
|
static {
|
|
8143
|
-
|
|
8282
|
+
Pa = this;
|
|
8144
8283
|
}
|
|
8145
|
-
static material = new
|
|
8284
|
+
static material = new F({ gl: {
|
|
8146
8285
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
8147
8286
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform float progress;\nuniform sampler2D previous;\nuniform sampler2D next;\n\nfloat easeInOutQuint(float t) {\n return t < 0.5 ? 16.0*t*t*t*t*t : 1.0+16.0*(--t)*t*t*t*t;\n}\n\nvoid main() {\n vec4 src1Color = texture2D(previous, vUv);\n vec4 src2Color = texture2D(next, vUv);\n float mProgress = 1.0 - progress;\n float mixPercent = 0.0;\n if (vUv.x <= mProgress) {\n mixPercent = 1.0;\n }\n gl_FragColor = mix(src2Color, src1Color, mixPercent);\n}"
|
|
8148
8287
|
} });
|
|
8149
8288
|
apply(e) {
|
|
8150
|
-
|
|
8289
|
+
I.draw(e, Pa.material, {
|
|
8151
8290
|
previous: 0,
|
|
8152
8291
|
next: 1,
|
|
8153
8292
|
progress: this.currentTimeProgress
|
|
8154
8293
|
});
|
|
8155
8294
|
}
|
|
8156
8295
|
};
|
|
8157
|
-
|
|
8296
|
+
Fa = Pa = O([x("LeftEraseTransition")], Fa);
|
|
8158
8297
|
//#endregion
|
|
8159
8298
|
//#region src/scene/transitions/TiltShiftTransition.ts
|
|
8160
|
-
var
|
|
8299
|
+
var Ia, La = class extends Sr {
|
|
8161
8300
|
static {
|
|
8162
|
-
|
|
8301
|
+
Ia = this;
|
|
8163
8302
|
}
|
|
8164
8303
|
blur = 100;
|
|
8165
8304
|
gradientBlur = 600;
|
|
8166
|
-
static material = new
|
|
8305
|
+
static material = new F({ gl: {
|
|
8167
8306
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
8168
8307
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform float blur;\nuniform float gradientBlur;\nuniform vec2 start;\nuniform vec2 end;\nuniform vec2 delta;\nuniform vec2 texSize;\nuniform float progress;\n\nfloat random(vec3 scale, float seed) {\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n}\n\nvoid main(void) {\n float blur1 = blur - progress * blur;\n float gradientBlur1 = progress * gradientBlur;\n\n vec4 color = vec4(0.0);\n float total = 0.0;\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\n float radius = smoothstep(0.0, 1.0, abs(dot(vUv * texSize - start, normal)) / gradientBlur1) * blur1;\n\n for (float t = -30.0; t <= 30.0; t++) {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 sample1 = texture2D(sampler, vUv + delta / texSize * percent * radius);\n sample1.rgb *= sample1.a;\n color += sample1 * weight;\n total += weight;\n }\n\n color /= total;\n color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}"
|
|
8169
8308
|
} });
|
|
@@ -8171,7 +8310,7 @@ var Aa, ja = class extends Sr {
|
|
|
8171
8310
|
let n = this.currentTimeProgress, r, i;
|
|
8172
8311
|
n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
|
|
8173
8312
|
let a = t.width, o = t.height, s = [0, o / 2], c = [600, o / 2], l = [a, o], u = c[0] - s[0], d = c[1] - s[1], f = Math.sqrt(u * u + d * d);
|
|
8174
|
-
|
|
8313
|
+
I.draw(e, Ia.material, {
|
|
8175
8314
|
sampler: r,
|
|
8176
8315
|
progress: i,
|
|
8177
8316
|
blur: this.blur,
|
|
@@ -8180,7 +8319,7 @@ var Aa, ja = class extends Sr {
|
|
|
8180
8319
|
end: c,
|
|
8181
8320
|
delta: [u / f, d / f],
|
|
8182
8321
|
texSize: l
|
|
8183
|
-
}),
|
|
8322
|
+
}), I.draw(e, Ia.material, {
|
|
8184
8323
|
sampler: r,
|
|
8185
8324
|
progress: i,
|
|
8186
8325
|
blur: this.blur,
|
|
@@ -8192,18 +8331,18 @@ var Aa, ja = class extends Sr {
|
|
|
8192
8331
|
});
|
|
8193
8332
|
}
|
|
8194
8333
|
};
|
|
8195
|
-
|
|
8334
|
+
La = Ia = O([x("TiltShiftTransition")], La);
|
|
8196
8335
|
//#endregion
|
|
8197
8336
|
//#region src/scene/transitions/TwistTransition.ts
|
|
8198
|
-
var
|
|
8337
|
+
var Ra, za = class extends Sr {
|
|
8199
8338
|
static {
|
|
8200
|
-
|
|
8339
|
+
Ra = this;
|
|
8201
8340
|
}
|
|
8202
8341
|
radius;
|
|
8203
8342
|
angle = 4;
|
|
8204
8343
|
padding = 20;
|
|
8205
8344
|
offset;
|
|
8206
|
-
static material = new
|
|
8345
|
+
static material = new F({ gl: {
|
|
8207
8346
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
8208
8347
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform vec4 filterArea;\nuniform float progress;\n\nvec2 mapCoord(vec2 coord) {\n coord -= filterArea.zw;\n coord *= filterArea.xy;\n return coord;\n}\n\nvec2 unmapCoord(vec2 coord) {\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n return coord;\n}\n\nvec2 twist(vec2 coord, float radius) {\n coord -= offset;\n float dist = length(coord);\n if (dist < radius) {\n float ratioDist = (radius - dist) / radius;\n float angleMod = ratioDist * ratioDist * angle;\n float s = sin(angleMod);\n float c = cos(angleMod);\n coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\n }\n coord += offset;\n return coord;\n}\n\nvoid main(void) {\n vec2 coord = mapCoord(vUv);\n coord = twist(coord, radius - (progress * radius));\n coord = unmapCoord(coord);\n gl_FragColor = texture2D(sampler, coord);\n}"
|
|
8209
8348
|
} });
|
|
@@ -8211,7 +8350,7 @@ var Ma, Na = class extends Sr {
|
|
|
8211
8350
|
let n = this.currentTimeProgress, r, i;
|
|
8212
8351
|
n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
|
|
8213
8352
|
let a = t.width, o = t.height;
|
|
8214
|
-
|
|
8353
|
+
I.draw(e, Ra.material, {
|
|
8215
8354
|
sampler: r,
|
|
8216
8355
|
progress: i,
|
|
8217
8356
|
filterArea: [
|
|
@@ -8227,16 +8366,16 @@ var Ma, Na = class extends Sr {
|
|
|
8227
8366
|
});
|
|
8228
8367
|
}
|
|
8229
8368
|
};
|
|
8230
|
-
|
|
8369
|
+
za = Ra = O([x("TwistTransition")], za);
|
|
8231
8370
|
//#endregion
|
|
8232
8371
|
//#region src/asset/loaders/GifLoader.ts
|
|
8233
|
-
var
|
|
8372
|
+
var Ba = class extends Nn {
|
|
8234
8373
|
install(e) {
|
|
8235
8374
|
let t = async (t) => {
|
|
8236
8375
|
let { decodeFrames: n } = await import("modern-gif");
|
|
8237
|
-
return await t.arrayBuffer().then((t) => n(t, e.gifWorkerUrl ? { workerUrl: e.gifWorkerUrl } : void 0)).then((e) => new
|
|
8376
|
+
return await t.arrayBuffer().then((t) => n(t, e.gifWorkerUrl ? { workerUrl: e.gifWorkerUrl } : void 0)).then((e) => new Zn(e.map((e) => ({
|
|
8238
8377
|
duration: e.delay,
|
|
8239
|
-
texture: new
|
|
8378
|
+
texture: new tr({
|
|
8240
8379
|
source: e.data,
|
|
8241
8380
|
width: e.width,
|
|
8242
8381
|
height: e.height
|
|
@@ -8247,14 +8386,14 @@ var Pa = class extends Mn {
|
|
|
8247
8386
|
e.register(n, t);
|
|
8248
8387
|
}), e.gif = this, this;
|
|
8249
8388
|
}
|
|
8250
|
-
},
|
|
8389
|
+
}, Va = class extends Nn {
|
|
8251
8390
|
install(e) {
|
|
8252
8391
|
let t = async (e) => JSON.parse(await e.text());
|
|
8253
8392
|
return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), ["application/json"].forEach((n) => {
|
|
8254
8393
|
e.register(n, t);
|
|
8255
8394
|
}), e.json = this, this;
|
|
8256
8395
|
}
|
|
8257
|
-
},
|
|
8396
|
+
}, Ha = class extends Nn {
|
|
8258
8397
|
install(e) {
|
|
8259
8398
|
return this.load = async (t, n) => (await import("lottie-web").then((e) => e.default)).loadAnimation({
|
|
8260
8399
|
container: null,
|
|
@@ -8265,14 +8404,14 @@ var Pa = class extends Mn {
|
|
|
8265
8404
|
animationData: await e.loadBy(t, () => e.fetch(t).then((e) => e.json()))
|
|
8266
8405
|
}), e.lottie = this, this;
|
|
8267
8406
|
}
|
|
8268
|
-
},
|
|
8407
|
+
}, Ua = class extends Nn {
|
|
8269
8408
|
install(e) {
|
|
8270
8409
|
let t = async (e) => e.text();
|
|
8271
8410
|
return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), e.text = this, this;
|
|
8272
8411
|
}
|
|
8273
|
-
},
|
|
8412
|
+
}, Wa = class extends Nn {
|
|
8274
8413
|
install(e) {
|
|
8275
|
-
let t = (t) => e.fetchImageBitmap(t, { premultiplyAlpha: "premultiply" }).then((e) => new
|
|
8414
|
+
let t = (t) => e.fetchImageBitmap(t, { premultiplyAlpha: "premultiply" }).then((e) => new R({
|
|
8276
8415
|
source: e,
|
|
8277
8416
|
uploadMethodId: "image",
|
|
8278
8417
|
mipmap: !0,
|
|
@@ -8294,11 +8433,11 @@ var Pa = class extends Mn {
|
|
|
8294
8433
|
e.register(n, t);
|
|
8295
8434
|
}), e.texture = this, this;
|
|
8296
8435
|
}
|
|
8297
|
-
},
|
|
8436
|
+
}, Ga = class extends Nn {
|
|
8298
8437
|
install(e) {
|
|
8299
|
-
return this.load = (t) => e.awaitBy(() => new
|
|
8438
|
+
return this.load = (t) => e.awaitBy(() => new rr(t).load()), e.video = this, this;
|
|
8300
8439
|
}
|
|
8301
|
-
},
|
|
8440
|
+
}, Ka = Object.entries({
|
|
8302
8441
|
"font/woff": ["woff"],
|
|
8303
8442
|
"font/ttf": ["ttf"],
|
|
8304
8443
|
"font/otf": ["otf"],
|
|
@@ -8314,31 +8453,31 @@ var Pa = class extends Mn {
|
|
|
8314
8453
|
"image/webp": ["webp"],
|
|
8315
8454
|
"application/json": ["json"]
|
|
8316
8455
|
});
|
|
8317
|
-
function
|
|
8318
|
-
for (let [t, n] of
|
|
8456
|
+
function qa(e) {
|
|
8457
|
+
for (let [t, n] of Ka) if (n.includes(e)) return t;
|
|
8319
8458
|
}
|
|
8320
|
-
function
|
|
8459
|
+
function Ja(e) {
|
|
8321
8460
|
let t;
|
|
8322
8461
|
if (e.startsWith("data:")) t = e.match(/^data:(.+?);/)?.[1];
|
|
8323
8462
|
else if (e.startsWith("http")) {
|
|
8324
8463
|
let n = e.split(/[#?]/)[0].split(".").pop()?.trim();
|
|
8325
|
-
n && (t =
|
|
8464
|
+
n && (t = qa(n));
|
|
8326
8465
|
}
|
|
8327
8466
|
return t;
|
|
8328
8467
|
}
|
|
8329
8468
|
//#endregion
|
|
8330
8469
|
//#region src/asset/Assets.ts
|
|
8331
|
-
var
|
|
8470
|
+
var Ya = "WeakRef" in globalThis, Xa = class extends e {
|
|
8332
8471
|
defaultHandler = (e) => e;
|
|
8333
8472
|
_handlers = /* @__PURE__ */ new Map();
|
|
8334
8473
|
_handleing = /* @__PURE__ */ new Map();
|
|
8335
8474
|
_handled = /* @__PURE__ */ new Map();
|
|
8336
|
-
_gc =
|
|
8475
|
+
_gc = Ya ? new FinalizationRegistry((e) => {
|
|
8337
8476
|
let t = this.get(e);
|
|
8338
8477
|
t && "destroy" in t && t.destroy(), this._handled.delete(e);
|
|
8339
8478
|
}) : void 0;
|
|
8340
8479
|
constructor() {
|
|
8341
|
-
super(),
|
|
8480
|
+
super(), Ya || S.on(this.gc.bind(this), { sort: 2 });
|
|
8342
8481
|
}
|
|
8343
8482
|
use(e) {
|
|
8344
8483
|
return e.install(this), this;
|
|
@@ -8382,11 +8521,11 @@ var Ua = "WeakRef" in globalThis, Wa = class extends e {
|
|
|
8382
8521
|
}
|
|
8383
8522
|
get(e) {
|
|
8384
8523
|
let t = this._handled.get(e);
|
|
8385
|
-
return
|
|
8524
|
+
return Ya && t instanceof WeakRef && (t = t.deref(), t || this._handleing.delete(e)), t;
|
|
8386
8525
|
}
|
|
8387
8526
|
set(e, t) {
|
|
8388
8527
|
let n = t;
|
|
8389
|
-
|
|
8528
|
+
Ya && typeof t == "object" && (this._gc.register(t, e), n = new WeakRef(t)), this._handled.set(e, n);
|
|
8390
8529
|
}
|
|
8391
8530
|
async awaitBy(e) {
|
|
8392
8531
|
let t = e(), n = c();
|
|
@@ -8401,7 +8540,7 @@ var Ua = "WeakRef" in globalThis, Wa = class extends e {
|
|
|
8401
8540
|
return this._handleing.set(e, r), r;
|
|
8402
8541
|
}
|
|
8403
8542
|
async load(e, t) {
|
|
8404
|
-
let n = await this.loadBy(e), r =
|
|
8543
|
+
let n = await this.loadBy(e), r = Ja(e);
|
|
8405
8544
|
return r === void 0 && (r = n.type?.split(";")[0] ?? void 0), ((r ? this._handlers.get(r) : void 0) ?? this.defaultHandler)(n, t);
|
|
8406
8545
|
}
|
|
8407
8546
|
async waitUntilLoad() {
|
|
@@ -8415,14 +8554,14 @@ var Ua = "WeakRef" in globalThis, Wa = class extends e {
|
|
|
8415
8554
|
n && "destroy" in n && n.destroy();
|
|
8416
8555
|
}), this._handled.clear();
|
|
8417
8556
|
}
|
|
8418
|
-
}, $ = new
|
|
8557
|
+
}, $ = new Xa().use(new Pn()).use(new Ba()).use(new Va()).use(new Ha()).use(new Ua()).use(new Wa()).use(new Ga()), Za = {
|
|
8419
8558
|
alpha: !0,
|
|
8420
8559
|
stencil: !0,
|
|
8421
8560
|
antialias: !1,
|
|
8422
8561
|
premultipliedAlpha: !0,
|
|
8423
8562
|
preserveDrawingBuffer: !1,
|
|
8424
8563
|
powerPreference: "default"
|
|
8425
|
-
},
|
|
8564
|
+
}, Qa = class extends U {
|
|
8426
8565
|
renderer;
|
|
8427
8566
|
get view() {
|
|
8428
8567
|
return this.renderer.view;
|
|
@@ -8453,14 +8592,14 @@ var Ua = "WeakRef" in globalThis, Wa = class extends e {
|
|
|
8453
8592
|
}
|
|
8454
8593
|
}) : void 0;
|
|
8455
8594
|
constructor(e = {}) {
|
|
8456
|
-
let { view: t, width: n, height: r, pixelRatio: i =
|
|
8457
|
-
super(), this.renderer = new
|
|
8458
|
-
alpha:
|
|
8459
|
-
stencil:
|
|
8460
|
-
antialias:
|
|
8461
|
-
premultipliedAlpha:
|
|
8462
|
-
preserveDrawingBuffer:
|
|
8463
|
-
powerPreference:
|
|
8595
|
+
let { view: t, width: n, height: r, pixelRatio: i = We, autoResize: a, data: o } = e;
|
|
8596
|
+
super(), this.renderer = new Mn(t, {
|
|
8597
|
+
alpha: Za.alpha ?? e.alpha,
|
|
8598
|
+
stencil: Za.stencil ?? e.stencil,
|
|
8599
|
+
antialias: Za.antialias ?? e.antialias,
|
|
8600
|
+
premultipliedAlpha: Za.premultipliedAlpha ?? e.premultipliedAlpha,
|
|
8601
|
+
preserveDrawingBuffer: Za.preserveDrawingBuffer ?? e.preserveDrawingBuffer,
|
|
8602
|
+
powerPreference: Za.powerPreference ?? e.powerPreference
|
|
8464
8603
|
}), this._setupInput(), this.pixelRatio = i, a ? !t && this.renderer.view && (this.renderer.view.style.width = "100%", this.renderer.view.style.height = "100%") : this.resize(n || this.gl.drawingBufferWidth || this.view?.clientWidth || 200, r || this.gl.drawingBufferHeight || this.view?.clientHeight || 200, !t), this.setProperties(e), o && this.root.append(o);
|
|
8465
8604
|
}
|
|
8466
8605
|
_updateProperty(e, t, n) {
|
|
@@ -8544,22 +8683,22 @@ var Ua = "WeakRef" in globalThis, Wa = class extends e {
|
|
|
8544
8683
|
super._destroy(), this._resizeObserver?.disconnect(), this.renderer.destroy();
|
|
8545
8684
|
}
|
|
8546
8685
|
};
|
|
8547
|
-
|
|
8686
|
+
O([_({ fallback: !1 }), D("design:type", Boolean)], Qa.prototype, "autoResize", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], Qa.prototype, "autoStart", void 0);
|
|
8548
8687
|
//#endregion
|
|
8549
8688
|
//#region src/render.ts
|
|
8550
|
-
var
|
|
8551
|
-
function
|
|
8552
|
-
return
|
|
8689
|
+
var $a, eo = [], to = !1;
|
|
8690
|
+
function no() {
|
|
8691
|
+
return $a ??= new Qa({
|
|
8553
8692
|
pixelRatio: 1,
|
|
8554
8693
|
width: 1,
|
|
8555
8694
|
height: 1,
|
|
8556
8695
|
preserveDrawingBuffer: !0
|
|
8557
8696
|
});
|
|
8558
8697
|
}
|
|
8559
|
-
async function
|
|
8560
|
-
if (!
|
|
8561
|
-
for (
|
|
8562
|
-
let t =
|
|
8698
|
+
async function ro(e = 100) {
|
|
8699
|
+
if (!to) {
|
|
8700
|
+
for (to = !0; eo.length;) {
|
|
8701
|
+
let t = eo.shift();
|
|
8563
8702
|
if (t) try {
|
|
8564
8703
|
await t();
|
|
8565
8704
|
} catch (e) {
|
|
@@ -8567,11 +8706,11 @@ async function Za(e = 100) {
|
|
|
8567
8706
|
}
|
|
8568
8707
|
else await new Promise((t) => setTimeout(t, e));
|
|
8569
8708
|
}
|
|
8570
|
-
|
|
8709
|
+
to = !1;
|
|
8571
8710
|
}
|
|
8572
8711
|
}
|
|
8573
|
-
async function
|
|
8574
|
-
let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [], onBefore: s, onKeyframe: c, ...l } = e, u = Math.floor(r), d = Math.floor(i), f =
|
|
8712
|
+
async function io(e) {
|
|
8713
|
+
let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [], onBefore: s, onKeyframe: c, ...l } = e, u = Math.floor(r), d = Math.floor(i), f = no();
|
|
8575
8714
|
if (f.resetProperties(), f.setProperties(l), f.debug = t, f.fonts = n, f.timeline.currentTime = 0, f.resize(u, d, !0), f.root.removeChildren(!0), f.root.append(a), await s?.(f), await f.waitAndRender(), o.length) {
|
|
8576
8715
|
let e = o.length, t = o[e - 1];
|
|
8577
8716
|
for (let n = 0; n < e; n++) {
|
|
@@ -8589,15 +8728,15 @@ async function Qa(e) {
|
|
|
8589
8728
|
toCanvas2D: () => f.toCanvas2D(new ImageData(p, u, d))
|
|
8590
8729
|
};
|
|
8591
8730
|
}
|
|
8592
|
-
async function
|
|
8731
|
+
async function ao(e) {
|
|
8593
8732
|
return new Promise((t) => {
|
|
8594
|
-
|
|
8733
|
+
eo.push(async () => t(await io(e).then((e) => e.toCanvas2D()))), ro();
|
|
8595
8734
|
});
|
|
8596
8735
|
}
|
|
8597
|
-
async function
|
|
8736
|
+
async function oo(e) {
|
|
8598
8737
|
return new Promise((t) => {
|
|
8599
|
-
|
|
8738
|
+
eo.push(async () => t(await io(e).then((e) => e.pixels))), ro();
|
|
8600
8739
|
});
|
|
8601
8740
|
}
|
|
8602
8741
|
//#endregion
|
|
8603
|
-
export {
|
|
8742
|
+
export { lt as Aabb2D, Zn as AnimatedTexture, ga as Animation, Xa as Assets, Oa as Audio, ba as AudioPipeline, xa as AudioProcessor, ka as AudioSpectrum, ja as AudioWaveform, k as BufferUsage, Er as Camera2D, ar as CanvasContext, mr as CanvasItem, Qn as CanvasTexture, T as Color, W as ColorAdjustEffect, zr as ColorFilterEffect, pt as ColorMatrix, Ur as ColorOverlayEffect, Kr as ColorRemoveEffect, Xr as ColorReplaceEffect, $n as ColorTexture, C as CoreObject, ut as DEG_TO_RAD, We as DEVICE_PIXEL_RATIO, G as DrawboardEffect, oi as DropShadowEffect, H as Effect, Jn as EffectMaterial, ta as Element2D, Mi as Element2DBackground, Ni as Element2DConnection, Y as Element2DFill, Fi as Element2DForeground, Ii as Element2DOutline, Li as Element2DShadow, Ri as Element2DShape, zi as Element2DStyle, X as Element2DText, li as EmbossEffect, Qa as Engine, Zi as Flexbox, Pn as FontLoader, ri as GaussianBlurEffect, zn as Geometry, Ba as GifLoader, en as GlBatch2DSystem, Xt as GlBlendMode, vt as GlBuffer, Et as GlBufferSystem, _t as GlBufferTarget, an as GlMaskSystem, Rt as GlProgram, ln as GlRenderTarget, un as GlRenderTargetSystem, qt as GlShaderSystem, Qt as GlState, $t as GlStateSystem, sn as GlStencilSystem, A as GlSystem, cn as GlViewportSystem, K as GlitchEffect, q as GodrayEffect, er as GradientTexture, ya as HTMLAudio, _a as HTMLAudioContext, va as HTMLSound, He as IN_BROWSER, Ue as IN_MAC_OS, In as IndexBuffer, st as Input, tt as InputEvent, Va as JsonLoader, vi as KawaseBlurEffect, Na as KawaseTransition, nt as KeyboardInputEvent, Fa as LeftEraseTransition, Nn as Loader, ia as Lottie2D, Ha as LottieLoader, gt as MainLoop, xi as MaskEffect, F as Material, sr as Meta, rt as MouseInputEvent, z as Node, wr as Node2D, mt as Obb2D, J as OutlineEffect, _e as PI, ve as PI_2, Di as PixelateEffect, tr as PixelsTexture, it as PointerInputEvent, ht as Projection2D, Hn as QuadGeometry, I as QuadUvGeometry, dt as RAD_TO_DEG, ct as RefCounted, L as RenderTarget, bt as Renderer, w as Resource, Le as SUPPORTS_AUDIO_CONTEXT, Fe as SUPPORTS_CLICK_EVENTS, Ie as SUPPORTS_CREATE_IMAGE_BITMAP, ke as SUPPORTS_IMAGE_BITMAP, Ne as SUPPORTS_MOUSE_EVENTS, ze as SUPPORTS_OFFLINE_AUDIO_CONTEXT, je as SUPPORTS_POINTER_EVENTS, Ae as SUPPORTS_RESIZE_OBSERVER, Pe as SUPPORTS_TOUCH_EVENTS, Oe as SUPPORTS_WEBGL2, Re as SUPPORTS_WEBKIT_AUDIO_CONTEXT, Be as SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, Ve as SUPPORTS_WEB_AUDIO, Me as SUPPORTS_WHEEL_EVENTS, U as SceneTree, Ua as TextLoader, R as Texture2D, Wa as TextureLoader, na as TextureRect2D, S as Ticker, La as TiltShiftTransition, yr as Timeline, B as TimelineNode, aa as TransformRect2D, Sr as Transition, za as TwistTransition, St as UniformGroup, Xn as UvGeometry, Yn as UvMaterial, P as VertexAttribute, N as VertexBuffer, sa as Video2D, Ga as VideoLoader, rr as VideoTexture, V as Viewport, ir as ViewportTexture, Ea as WebAudio, wa as WebAudioContext, Mn as WebGLRenderer, Ta as WebSound, at as WheelInputEvent, br as Window, Ai as ZoomBlurEffect, Q as alignMap, $ as assets, Dr as axisDir, Xi as boxSizingMap, ft as clamp, _i as clampFrag, Xe as createHTMLCanvas, Tt as createIdFromString, he as createNode, Qe as crossOrigin, ma as cubicBezier, x as customNode, me as customNodes, Za as defaultOptions, Ze as determineCrossOrigin, Wi as directionMap, Ui as displayMap, ua as ease, da as easeIn, pa as easeInOut, fa as easeOut, Z as edgeMap, Gi as flexDirectionMap, Ki as flexWrapMap, gi as frag, Ce as getDefaultCssPropertyValue, no as getRenderEngine, Hi as gutterMap, et as instanceId, Je as isCanvasElement, Ge as isElementNode, qe as isImageElement, ye as isPow2, Ke as isVideoElement, Ye as isWebgl2, qi as justifyMap, E as lerp, la as linear, nn as log2, Zt as mapGlBlendModes, tn as nextPow2, ge as nextTick, Ji as overflowMap, Nr as parseCssFilter, Te as parseCssFunctions, we as parseCssProperty, Pr as parseCssTransformOrigin, Yi as positionTypeMap, ao as render, oo as renderPixels, Or as routeConnection, on as stencilModeMap, ha as timingFunctions };
|