@galacean/effects-core 2.4.0-beta.0 → 2.4.0-beta.2
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/asset-loader.d.ts +1 -2
- package/dist/binary-asset.d.ts +0 -2
- package/dist/comp-vfx-item.d.ts +2 -2
- package/dist/components/base-render-component.d.ts +1 -0
- package/dist/components/component.d.ts +1 -0
- package/dist/components/post-process-volume.d.ts +2 -2
- package/dist/components/renderer-component.d.ts +0 -5
- package/dist/composition.d.ts +2 -8
- package/dist/effects-object.d.ts +1 -1
- package/dist/engine.d.ts +5 -3
- package/dist/fallback/migration.d.ts +1 -0
- package/dist/index.js +752 -1028
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +748 -1022
- package/dist/index.mjs.map +1 -1
- package/dist/material/mask-ref-manager.d.ts +4 -1
- package/dist/material/material.d.ts +6 -1
- package/dist/material/types.d.ts +2 -0
- package/dist/plugins/camera/camera-controller-node.d.ts +2 -2
- package/dist/plugins/interact/interact-item.d.ts +1 -0
- package/dist/plugins/particle/particle-system-renderer.d.ts +2 -0
- package/dist/plugins/particle/particle-system.d.ts +1 -1
- package/dist/plugins/particle/trail-mesh.d.ts +1 -1
- package/dist/serialization-helper.d.ts +0 -4
- package/dist/vfx-item.d.ts +10 -4
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Description: Galacean Effects runtime core for the web
|
|
4
4
|
* Author: Ant Group CO., Ltd.
|
|
5
5
|
* Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
|
|
6
|
-
* Version: v2.4.0-beta.
|
|
6
|
+
* Version: v2.4.0-beta.2
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -2000,7 +2000,7 @@ function getDirectStore(target) {
|
|
|
2000
2000
|
function EffectsObject(engine) {
|
|
2001
2001
|
this.engine = engine;
|
|
2002
2002
|
this.guid = generateGUID();
|
|
2003
|
-
this.
|
|
2003
|
+
this.defination = {};
|
|
2004
2004
|
this.engine.addInstance(this);
|
|
2005
2005
|
}
|
|
2006
2006
|
var _proto = EffectsObject.prototype;
|
|
@@ -2025,11 +2025,7 @@ function getDirectStore(target) {
|
|
|
2025
2025
|
* 反序列化函数
|
|
2026
2026
|
*
|
|
2027
2027
|
* @param data - 对象的序列化的数据
|
|
2028
|
-
*/ _proto.fromData = function fromData(data) {
|
|
2029
|
-
if (data.id) {
|
|
2030
|
-
this.setInstanceId(data.id);
|
|
2031
|
-
}
|
|
2032
|
-
};
|
|
2028
|
+
*/ _proto.fromData = function fromData(data) {};
|
|
2033
2029
|
/**
|
|
2034
2030
|
*
|
|
2035
2031
|
*/ _proto.dispose = function dispose() {};
|
|
@@ -2125,9 +2121,6 @@ function getDirectStore(target) {
|
|
|
2125
2121
|
};
|
|
2126
2122
|
_proto.fromData = function fromData(data) {
|
|
2127
2123
|
EffectsObject.prototype.fromData.call(this, data);
|
|
2128
|
-
if (data.item) {
|
|
2129
|
-
this.item = data.item;
|
|
2130
|
-
}
|
|
2131
2124
|
};
|
|
2132
2125
|
_proto.dispose = function dispose() {
|
|
2133
2126
|
if (this.isEnableCalled) {
|
|
@@ -2192,11 +2185,15 @@ function getDirectStore(target) {
|
|
|
2192
2185
|
]);
|
|
2193
2186
|
return Component;
|
|
2194
2187
|
}(EffectsObject);
|
|
2188
|
+
__decorate([
|
|
2189
|
+
serialize()
|
|
2190
|
+
], Component.prototype, "item", void 0);
|
|
2195
2191
|
__decorate([
|
|
2196
2192
|
serialize()
|
|
2197
2193
|
], Component.prototype, "_enabled", void 0);
|
|
2198
2194
|
/**
|
|
2199
2195
|
* @since 2.0.0
|
|
2196
|
+
* @deprecated 2.4.0 Please use Component instead
|
|
2200
2197
|
*/ var Behaviour = /*#__PURE__*/ function(Component) {
|
|
2201
2198
|
_inherits(Behaviour, Component);
|
|
2202
2199
|
function Behaviour() {
|
|
@@ -2226,10 +2223,6 @@ __decorate([
|
|
|
2226
2223
|
}
|
|
2227
2224
|
var _proto = RendererComponent.prototype;
|
|
2228
2225
|
_proto.render = function render(renderer) {};
|
|
2229
|
-
_proto.setVFXItem = function setVFXItem(item) {
|
|
2230
|
-
Component.prototype.setVFXItem.call(this, item);
|
|
2231
|
-
this.item.rendererComponents.push(this);
|
|
2232
|
-
};
|
|
2233
2226
|
_proto.onEnable = function onEnable() {
|
|
2234
2227
|
var _this_item_composition;
|
|
2235
2228
|
(_this_item_composition = this.item.composition) == null ? void 0 : _this_item_composition.renderFrame.addMeshToDefaultRenderPass(this);
|
|
@@ -2238,18 +2231,6 @@ __decorate([
|
|
|
2238
2231
|
var _this_item_composition;
|
|
2239
2232
|
(_this_item_composition = this.item.composition) == null ? void 0 : _this_item_composition.renderFrame.removeMeshFromDefaultRenderPass(this);
|
|
2240
2233
|
};
|
|
2241
|
-
_proto.fromData = function fromData(data) {
|
|
2242
|
-
Component.prototype.fromData.call(this, data);
|
|
2243
|
-
};
|
|
2244
|
-
_proto.toData = function toData() {
|
|
2245
|
-
Component.prototype.toData.call(this);
|
|
2246
|
-
};
|
|
2247
|
-
_proto.dispose = function dispose() {
|
|
2248
|
-
if (this.item) {
|
|
2249
|
-
removeItem(this.item.rendererComponents, this);
|
|
2250
|
-
}
|
|
2251
|
-
Component.prototype.dispose.call(this);
|
|
2252
|
-
};
|
|
2253
2234
|
_create_class(RendererComponent, [
|
|
2254
2235
|
{
|
|
2255
2236
|
key: "priority",
|
|
@@ -3872,11 +3853,11 @@ EffectComponent = __decorate([
|
|
|
3872
3853
|
effectsClass(DataType.EffectComponent)
|
|
3873
3854
|
], EffectComponent);
|
|
3874
3855
|
|
|
3875
|
-
var PostProcessVolume = /*#__PURE__*/ function(
|
|
3876
|
-
_inherits(PostProcessVolume,
|
|
3856
|
+
var PostProcessVolume = /*#__PURE__*/ function(Component) {
|
|
3857
|
+
_inherits(PostProcessVolume, Component);
|
|
3877
3858
|
function PostProcessVolume(engine) {
|
|
3878
3859
|
var _this;
|
|
3879
|
-
_this =
|
|
3860
|
+
_this = Component.call(this, engine) || this;
|
|
3880
3861
|
_this.bloom = {
|
|
3881
3862
|
threshold: 0,
|
|
3882
3863
|
intensity: 0,
|
|
@@ -3907,7 +3888,7 @@ var PostProcessVolume = /*#__PURE__*/ function(Behaviour) {
|
|
|
3907
3888
|
}
|
|
3908
3889
|
};
|
|
3909
3890
|
return PostProcessVolume;
|
|
3910
|
-
}(
|
|
3891
|
+
}(Component);
|
|
3911
3892
|
__decorate([
|
|
3912
3893
|
serialize()
|
|
3913
3894
|
], PostProcessVolume.prototype, "bloom", void 0);
|
|
@@ -6140,12 +6121,7 @@ function setMaskMode(material, maskMode, colorMask) {
|
|
|
6140
6121
|
glContext.REPLACE
|
|
6141
6122
|
];
|
|
6142
6123
|
// 关闭/开启蒙版元素的颜色写入
|
|
6143
|
-
material.colorMask =
|
|
6144
|
-
colorMask,
|
|
6145
|
-
colorMask,
|
|
6146
|
-
colorMask,
|
|
6147
|
-
colorMask
|
|
6148
|
-
];
|
|
6124
|
+
material.colorMask = colorMask;
|
|
6149
6125
|
break;
|
|
6150
6126
|
case MaskMode.OBSCURED:
|
|
6151
6127
|
material.stencilTest = true;
|
|
@@ -7617,13 +7593,6 @@ var MaterialRenderType;
|
|
|
7617
7593
|
set: /**
|
|
7618
7594
|
* 设置 Material 的通过 alpha 值决定临时覆盖值计算的开关
|
|
7619
7595
|
* @param value - 是否开启 alpha 抖动
|
|
7620
|
-
*/ function set(value) {}
|
|
7621
|
-
},
|
|
7622
|
-
{
|
|
7623
|
-
key: "colorMask",
|
|
7624
|
-
set: /**
|
|
7625
|
-
* 设置 Material 颜色缓冲区的写入开关
|
|
7626
|
-
* @param value
|
|
7627
7596
|
*/ function set(value) {}
|
|
7628
7597
|
},
|
|
7629
7598
|
{
|
|
@@ -7682,10 +7651,15 @@ var MaskProcessor = /*#__PURE__*/ function() {
|
|
|
7682
7651
|
} else if (mode === ObscuredMode.OBSCURED || mode === ObscuredMode.REVERSE_OBSCURED) {
|
|
7683
7652
|
maskMode = mode === ObscuredMode.OBSCURED ? MaskMode.OBSCURED : MaskMode.REVERSE_OBSCURED;
|
|
7684
7653
|
this.maskRef = ref.maskManager.getRefValue();
|
|
7654
|
+
this.maskable = ref;
|
|
7685
7655
|
}
|
|
7686
7656
|
}
|
|
7687
7657
|
return maskMode;
|
|
7688
7658
|
};
|
|
7659
|
+
_proto.drawStencilMask = function drawStencilMask(renderer) {
|
|
7660
|
+
var _this_maskable;
|
|
7661
|
+
(_this_maskable = this.maskable) == null ? void 0 : _this_maskable.drawStencilMask(renderer);
|
|
7662
|
+
};
|
|
7689
7663
|
return MaskProcessor;
|
|
7690
7664
|
}();
|
|
7691
7665
|
|
|
@@ -12592,17 +12566,16 @@ function getBezier2DValue(out, t, p0, p1, cpx0, cpy0, cpx1, cpy1) {
|
|
|
12592
12566
|
if (!this.getVisible()) {
|
|
12593
12567
|
return;
|
|
12594
12568
|
}
|
|
12595
|
-
|
|
12596
|
-
|
|
12597
|
-
|
|
12598
|
-
|
|
12599
|
-
|
|
12600
|
-
|
|
12601
|
-
|
|
12602
|
-
|
|
12603
|
-
|
|
12604
|
-
|
|
12605
|
-
}
|
|
12569
|
+
this.maskManager.drawStencilMask(renderer);
|
|
12570
|
+
this.draw(renderer);
|
|
12571
|
+
};
|
|
12572
|
+
/**
|
|
12573
|
+
* @internal
|
|
12574
|
+
*/ _proto.drawStencilMask = function drawStencilMask(renderer) {
|
|
12575
|
+
var previousColorMask = this.material.colorMask;
|
|
12576
|
+
this.material.colorMask = false;
|
|
12577
|
+
this.draw(renderer);
|
|
12578
|
+
this.material.colorMask = previousColorMask;
|
|
12606
12579
|
};
|
|
12607
12580
|
_proto.onStart = function onStart() {
|
|
12608
12581
|
this.item.getHitTestParams = this.getHitTestParams;
|
|
@@ -12740,10 +12713,27 @@ function getBezier2DValue(out, t, p0, p1, cpx0, cpy0, cpx1, cpy1) {
|
|
|
12740
12713
|
}
|
|
12741
12714
|
return material;
|
|
12742
12715
|
};
|
|
12716
|
+
_proto.draw = function draw(renderer) {
|
|
12717
|
+
if (renderer.renderingData.currentFrame.globalUniforms) {
|
|
12718
|
+
renderer.setGlobalMatrix("effects_ObjectToWorld", this.transform.getWorldMatrix());
|
|
12719
|
+
}
|
|
12720
|
+
for(var i = 0; i < this.materials.length; i++){
|
|
12721
|
+
var material = this.materials[i];
|
|
12722
|
+
material.setVector2("_Size", this.transform.size);
|
|
12723
|
+
if (this.renderer.renderMode === RenderMode.BILLBOARD || this.renderer.renderMode === RenderMode.VERTICAL_BILLBOARD || this.renderer.renderMode === RenderMode.HORIZONTAL_BILLBOARD) {
|
|
12724
|
+
material.setVector3("_Scale", this.transform.scale);
|
|
12725
|
+
}
|
|
12726
|
+
renderer.drawGeometry(this.geometry, material, i);
|
|
12727
|
+
}
|
|
12728
|
+
};
|
|
12743
12729
|
_proto.fromData = function fromData(data) {
|
|
12744
12730
|
RendererComponent.prototype.fromData.call(this, data);
|
|
12745
12731
|
var _data_renderer;
|
|
12746
12732
|
var renderer = (_data_renderer = data.renderer) != null ? _data_renderer : {};
|
|
12733
|
+
var maskProps = data.mask;
|
|
12734
|
+
if (maskProps && maskProps.ref) {
|
|
12735
|
+
maskProps.ref = this.engine.findObject(maskProps.ref);
|
|
12736
|
+
}
|
|
12747
12737
|
var maskMode = this.maskManager.getMaskMode(data);
|
|
12748
12738
|
// TODO 新蒙板上线后移除
|
|
12749
12739
|
//-------------------------------------------------------------------------
|
|
@@ -12751,15 +12741,15 @@ function getBezier2DValue(out, t, p0, p1, cpx0, cpy0, cpx1, cpy1) {
|
|
|
12751
12741
|
//@ts-expect-error
|
|
12752
12742
|
var split = data.splits && !data.textureSheetAnimation ? data.splits[0] : undefined;
|
|
12753
12743
|
var shapeGeometry = undefined;
|
|
12754
|
-
if (shapeData !== undefined && !("aPoint" in shapeData && "index" in shapeData)) {
|
|
12744
|
+
if (shapeData !== undefined && shapeData !== null && !("aPoint" in shapeData && "index" in shapeData)) {
|
|
12755
12745
|
shapeGeometry = getGeometryByShape(shapeData, split);
|
|
12756
12746
|
}
|
|
12757
|
-
var _renderer_renderMode, _renderer_blending,
|
|
12747
|
+
var _renderer_renderMode, _renderer_blending, _renderer_side;
|
|
12758
12748
|
//-------------------------------------------------------------------------
|
|
12759
12749
|
this.renderer = {
|
|
12760
12750
|
renderMode: (_renderer_renderMode = renderer.renderMode) != null ? _renderer_renderMode : RenderMode.MESH,
|
|
12761
12751
|
blending: (_renderer_blending = renderer.blending) != null ? _renderer_blending : BlendingMode.ALPHA,
|
|
12762
|
-
texture:
|
|
12752
|
+
texture: renderer.texture ? this.engine.findObject(renderer.texture) : this.engine.emptyTexture,
|
|
12763
12753
|
occlusion: !!renderer.occlusion,
|
|
12764
12754
|
transparentOcclusion: !!renderer.transparentOcclusion || maskMode === MaskMode.MASK,
|
|
12765
12755
|
side: (_renderer_side = renderer.side) != null ? _renderer_side : SideMode.DOUBLE,
|
|
@@ -12976,14 +12966,14 @@ var ShapeComponent = /*#__PURE__*/ function(BaseRenderComponent) {
|
|
|
12976
12966
|
var control2 = easingIns[pointIndex.easingIn];
|
|
12977
12967
|
this.graphicsPath.bezierCurveTo(control1.x + lastPoint.x, control1.y + lastPoint.y, control2.x + point.x, control2.y + point.y, point.x, point.y, 1);
|
|
12978
12968
|
}
|
|
12979
|
-
var pointIndex1 = indices[0];
|
|
12980
|
-
var lastPointIndex1 = indices[indices.length - 1];
|
|
12981
|
-
var point1 = points[pointIndex1.point];
|
|
12982
|
-
var lastPoint1 = points[lastPointIndex1.point];
|
|
12983
|
-
var control11 = easingOuts[lastPointIndex1.easingOut];
|
|
12984
|
-
var control21 = easingIns[pointIndex1.easingIn];
|
|
12985
|
-
this.graphicsPath.bezierCurveTo(control11.x + lastPoint1.x, control11.y + lastPoint1.y, control21.x + point1.x, control21.y + point1.y, point1.x, point1.y, 1);
|
|
12986
12969
|
if (shape.close) {
|
|
12970
|
+
var pointIndex1 = indices[0];
|
|
12971
|
+
var lastPointIndex1 = indices[indices.length - 1];
|
|
12972
|
+
var point1 = points[pointIndex1.point];
|
|
12973
|
+
var lastPoint1 = points[lastPointIndex1.point];
|
|
12974
|
+
var control11 = easingOuts[lastPointIndex1.easingOut];
|
|
12975
|
+
var control21 = easingIns[pointIndex1.easingIn];
|
|
12976
|
+
this.graphicsPath.bezierCurveTo(control11.x + lastPoint1.x, control11.y + lastPoint1.y, control21.x + point1.x, control21.y + point1.y, point1.x, point1.y, 1);
|
|
12987
12977
|
this.graphicsPath.closePath();
|
|
12988
12978
|
}
|
|
12989
12979
|
}
|
|
@@ -13113,6 +13103,10 @@ var ShapeComponent = /*#__PURE__*/ function(BaseRenderComponent) {
|
|
|
13113
13103
|
break;
|
|
13114
13104
|
}
|
|
13115
13105
|
}
|
|
13106
|
+
var maskProps = data.mask;
|
|
13107
|
+
if (maskProps && maskProps.ref) {
|
|
13108
|
+
maskProps.ref = this.engine.findObject(maskProps.ref);
|
|
13109
|
+
}
|
|
13116
13110
|
var maskMode = this.maskManager.getMaskMode(data);
|
|
13117
13111
|
var maskRef = this.maskManager.getRefValue();
|
|
13118
13112
|
this.material.stencilRef = maskRef !== undefined ? [
|
|
@@ -13262,11 +13256,11 @@ var Fake3DAnimationMode;
|
|
|
13262
13256
|
Fake3DAnimationMode[Fake3DAnimationMode["Linear"] = 1] = "Linear";
|
|
13263
13257
|
})(Fake3DAnimationMode || (Fake3DAnimationMode = {}));
|
|
13264
13258
|
|
|
13265
|
-
var CameraController = /*#__PURE__*/ function(
|
|
13266
|
-
_inherits(CameraController,
|
|
13259
|
+
var CameraController = /*#__PURE__*/ function(Component) {
|
|
13260
|
+
_inherits(CameraController, Component);
|
|
13267
13261
|
function CameraController(engine, props) {
|
|
13268
13262
|
var _this;
|
|
13269
|
-
_this =
|
|
13263
|
+
_this = Component.call(this, engine) || this;
|
|
13270
13264
|
if (props) {
|
|
13271
13265
|
_this.fromData(props);
|
|
13272
13266
|
}
|
|
@@ -13287,11 +13281,11 @@ var CameraController = /*#__PURE__*/ function(Behaviour) {
|
|
|
13287
13281
|
}
|
|
13288
13282
|
};
|
|
13289
13283
|
_proto.fromData = function fromData(data) {
|
|
13290
|
-
|
|
13284
|
+
Component.prototype.fromData.call(this, data);
|
|
13291
13285
|
this.options = data.options;
|
|
13292
13286
|
};
|
|
13293
13287
|
return CameraController;
|
|
13294
|
-
}(
|
|
13288
|
+
}(Component);
|
|
13295
13289
|
CameraController = __decorate([
|
|
13296
13290
|
effectsClass(DataType.CameraController)
|
|
13297
13291
|
], CameraController);
|
|
@@ -15372,6 +15366,7 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
15372
15366
|
};
|
|
15373
15367
|
_this.duringPlay = false;
|
|
15374
15368
|
/** 是否响应点击和拖拽交互事件 */ _this._interactive = true;
|
|
15369
|
+
_this.lastTime = -1;
|
|
15375
15370
|
_this.getHitTestParams = function(force) {
|
|
15376
15371
|
if (!_this.clickable) {
|
|
15377
15372
|
return;
|
|
@@ -15462,11 +15457,21 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
15462
15457
|
var _this_previewContent;
|
|
15463
15458
|
this.duringPlay = true;
|
|
15464
15459
|
// trigger messageBegin when item enter
|
|
15465
|
-
if (this.
|
|
15466
|
-
|
|
15467
|
-
|
|
15468
|
-
|
|
15460
|
+
if (this.lastTime <= this.item.time) {
|
|
15461
|
+
if (this.item.time >= 0 && this.lastTime < 0) {
|
|
15462
|
+
var _this_item_composition;
|
|
15463
|
+
var options = this.item.props.content.options;
|
|
15464
|
+
(_this_item_composition = this.item.composition) == null ? void 0 : _this_item_composition.addInteractiveItem(this.item, options.type);
|
|
15465
|
+
}
|
|
15466
|
+
} else {
|
|
15467
|
+
// loop trigger
|
|
15468
|
+
if (this.item.time >= 0) {
|
|
15469
|
+
var _this_item_composition1;
|
|
15470
|
+
var options1 = this.item.props.content.options;
|
|
15471
|
+
(_this_item_composition1 = this.item.composition) == null ? void 0 : _this_item_composition1.addInteractiveItem(this.item, options1.type);
|
|
15472
|
+
}
|
|
15469
15473
|
}
|
|
15474
|
+
this.lastTime = this.item.time;
|
|
15470
15475
|
(_this_previewContent = this.previewContent) == null ? void 0 : _this_previewContent.updateMesh();
|
|
15471
15476
|
if (!this.dragEvent || !this.bouncingArg) {
|
|
15472
15477
|
return;
|
|
@@ -18598,6 +18603,7 @@ function modifyMaxKeyframeShader(shader, maxVertex, maxFrag) {
|
|
|
18598
18603
|
this.particleMesh.mesh.material.setVector4("uParams", uParams.set(time, this.item.duration, 0, 0));
|
|
18599
18604
|
};
|
|
18600
18605
|
_proto.render = function render(renderer) {
|
|
18606
|
+
this.maskManager.drawStencilMask(renderer);
|
|
18601
18607
|
for(var _iterator = _create_for_of_iterator_helper_loose(this.meshes), _step; !(_step = _iterator()).done;){
|
|
18602
18608
|
var mesh = _step.value;
|
|
18603
18609
|
mesh.render(renderer);
|
|
@@ -19439,7 +19445,7 @@ var ParticleSystem = /*#__PURE__*/ function(Component) {
|
|
|
19439
19445
|
mask: maskProps.maskRef,
|
|
19440
19446
|
maskMode: maskProps.maskMode,
|
|
19441
19447
|
forceTarget: forceTarget,
|
|
19442
|
-
diffuse: renderer.texture,
|
|
19448
|
+
diffuse: renderer.texture ? this.engine.findObject(renderer.texture) : undefined,
|
|
19443
19449
|
sizeOverLifetime: sizeOverLifetimeGetter,
|
|
19444
19450
|
anchor: anchor
|
|
19445
19451
|
};
|
|
@@ -19526,7 +19532,7 @@ var ParticleSystem = /*#__PURE__*/ function(Component) {
|
|
|
19526
19532
|
maxTrailCount: options.maxCount,
|
|
19527
19533
|
pointCountPerTrail: Math.round(trails.maxPointPerTrail) || 32,
|
|
19528
19534
|
blending: trails.blending,
|
|
19529
|
-
texture: trails.texture,
|
|
19535
|
+
texture: trails.texture ? this.engine.findObject(trails.texture) : undefined,
|
|
19530
19536
|
opacityOverLifetime: createValueGetter(trails.opacityOverLifetime || 1),
|
|
19531
19537
|
widthOverTrail: createValueGetter(trails.widthOverTrail || 1),
|
|
19532
19538
|
// order: vfxItem.listIndex + (trails.orderOffset || 0),
|
|
@@ -19547,6 +19553,7 @@ var ParticleSystem = /*#__PURE__*/ function(Component) {
|
|
|
19547
19553
|
}
|
|
19548
19554
|
this.renderer = new ParticleSystemRenderer(this.engine, particleMeshProps, trailMeshProps);
|
|
19549
19555
|
this.renderer.item = this.item;
|
|
19556
|
+
this.renderer.maskManager = this.maskManager;
|
|
19550
19557
|
this.meshes = this.renderer.meshes;
|
|
19551
19558
|
var interaction = props.interaction;
|
|
19552
19559
|
if (interaction) {
|
|
@@ -19565,8 +19572,9 @@ var ParticleSystem = /*#__PURE__*/ function(Component) {
|
|
|
19565
19572
|
var maskRef = 0;
|
|
19566
19573
|
if (data.mask) {
|
|
19567
19574
|
var _data_mask = data.mask, mode = _data_mask.mode, ref = _data_mask.ref;
|
|
19575
|
+
var refComponent = this.engine.findObject(ref);
|
|
19568
19576
|
maskMode = mode;
|
|
19569
|
-
maskRef =
|
|
19577
|
+
maskRef = refComponent.maskManager.getRefValue();
|
|
19570
19578
|
}
|
|
19571
19579
|
return {
|
|
19572
19580
|
maskMode: maskMode,
|
|
@@ -20654,13 +20662,11 @@ Vector2PropertyPlayableAsset = __decorate([
|
|
|
20654
20662
|
effectsClass(DataType.Vector2PropertyPlayableAsset)
|
|
20655
20663
|
], Vector2PropertyPlayableAsset);
|
|
20656
20664
|
|
|
20657
|
-
|
|
20658
|
-
|
|
20659
|
-
*/ var CompositionComponent = /*#__PURE__*/ function(Behaviour) {
|
|
20660
|
-
_inherits(CompositionComponent, Behaviour);
|
|
20665
|
+
var CompositionComponent = /*#__PURE__*/ function(Component) {
|
|
20666
|
+
_inherits(CompositionComponent, Component);
|
|
20661
20667
|
function CompositionComponent() {
|
|
20662
20668
|
var _this;
|
|
20663
|
-
_this =
|
|
20669
|
+
_this = Component.apply(this, arguments) || this;
|
|
20664
20670
|
_this.time = 0;
|
|
20665
20671
|
_this.startTime = 0;
|
|
20666
20672
|
_this.items = [] // 场景的所有元素
|
|
@@ -20836,13 +20842,10 @@ Vector2PropertyPlayableAsset = __decorate([
|
|
|
20836
20842
|
return startOrder;
|
|
20837
20843
|
};
|
|
20838
20844
|
_proto.fromData = function fromData(data) {
|
|
20839
|
-
|
|
20845
|
+
Component.prototype.fromData.call(this, data);
|
|
20840
20846
|
var compositionData = data;
|
|
20841
|
-
this.items = compositionData.items;
|
|
20842
20847
|
var _compositionData_startTime;
|
|
20843
20848
|
this.startTime = (_compositionData_startTime = compositionData.startTime) != null ? _compositionData_startTime : 0;
|
|
20844
|
-
this.sceneBindings = compositionData.sceneBindings;
|
|
20845
|
-
this.timelineAsset = compositionData.timelineAsset;
|
|
20846
20849
|
};
|
|
20847
20850
|
_proto.resolveBindings = function resolveBindings() {
|
|
20848
20851
|
for(var _iterator = _create_for_of_iterator_helper_loose(this.sceneBindings), _step; !(_step = _iterator()).done;){
|
|
@@ -20865,7 +20868,19 @@ Vector2PropertyPlayableAsset = __decorate([
|
|
|
20865
20868
|
}
|
|
20866
20869
|
};
|
|
20867
20870
|
return CompositionComponent;
|
|
20868
|
-
}(
|
|
20871
|
+
}(Component);
|
|
20872
|
+
__decorate([
|
|
20873
|
+
serialize()
|
|
20874
|
+
], CompositionComponent.prototype, "items", void 0);
|
|
20875
|
+
__decorate([
|
|
20876
|
+
serialize()
|
|
20877
|
+
], CompositionComponent.prototype, "sceneBindings", void 0);
|
|
20878
|
+
__decorate([
|
|
20879
|
+
serialize()
|
|
20880
|
+
], CompositionComponent.prototype, "timelineAsset", void 0);
|
|
20881
|
+
CompositionComponent = __decorate([
|
|
20882
|
+
effectsClass("CompositionComponent")
|
|
20883
|
+
], CompositionComponent);
|
|
20869
20884
|
|
|
20870
20885
|
/**
|
|
20871
20886
|
*
|
|
@@ -21057,631 +21072,161 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
21057
21072
|
// }
|
|
21058
21073
|
(TickData);
|
|
21059
21074
|
|
|
21060
|
-
|
|
21061
|
-
|
|
21062
|
-
|
|
21063
|
-
|
|
21064
|
-
|
|
21075
|
+
/**
|
|
21076
|
+
* 合成抽象类:核心对象,通常一个场景只包含一个合成,可能会有多个合成。
|
|
21077
|
+
* 合成中包含了相关的 Item 元素,支持对 Item 元素的创建、更新和销毁。
|
|
21078
|
+
* 也负责 Item 相关的动画播放控制,和持有渲染帧数据。
|
|
21079
|
+
*/ var Composition = /*#__PURE__*/ function(EventEmitter) {
|
|
21080
|
+
_inherits(Composition, EventEmitter);
|
|
21081
|
+
function Composition(props, scene) {
|
|
21082
|
+
var _this;
|
|
21083
|
+
var _scene_jsonScene_renderSettings;
|
|
21084
|
+
_this = EventEmitter.call(this) || this;
|
|
21085
|
+
/**
|
|
21086
|
+
*
|
|
21087
|
+
*/ _this.sceneTicking = new SceneTicking();
|
|
21088
|
+
/**
|
|
21089
|
+
* 动画播放速度
|
|
21090
|
+
*/ _this.speed = 1;
|
|
21091
|
+
/**
|
|
21092
|
+
* 合成是否结束
|
|
21093
|
+
*/ _this.isEnded = false;
|
|
21094
|
+
/**
|
|
21095
|
+
* 用于保存与当前合成相关的插件数据
|
|
21096
|
+
*/ _this.loaderData = {};
|
|
21097
|
+
/**
|
|
21098
|
+
* 预合成数组
|
|
21099
|
+
*/ _this.refContent = [];
|
|
21100
|
+
/**
|
|
21101
|
+
* 是否开启后处理
|
|
21102
|
+
*/ _this.postProcessingEnabled = false;
|
|
21103
|
+
// TODO: 待优化
|
|
21104
|
+
_this.assigned = false;
|
|
21105
|
+
/**
|
|
21106
|
+
* 销毁状态位
|
|
21107
|
+
*/ _this.destroyed = false;
|
|
21108
|
+
_this.postLoaders = [];
|
|
21109
|
+
/**
|
|
21110
|
+
* 合成暂停/播放 标识
|
|
21111
|
+
*/ _this.paused = false;
|
|
21112
|
+
_this.lastVideoUpdateTime = 0;
|
|
21113
|
+
_this.isEndCalled = false;
|
|
21114
|
+
_this._textures = [];
|
|
21115
|
+
var _props_reusable = props.reusable, reusable = _props_reusable === void 0 ? false : _props_reusable, _props_speed = props.speed, speed = _props_speed === void 0 ? 1 : _props_speed, _props_baseRenderOrder = props.baseRenderOrder, baseRenderOrder = _props_baseRenderOrder === void 0 ? 0 : _props_baseRenderOrder, renderer = props.renderer, event = props.event, width = props.width, height = props.height, handleItemMessage = props.handleItemMessage;
|
|
21116
|
+
_this.renderer = renderer;
|
|
21117
|
+
_this._textures = scene.textureOptions;
|
|
21118
|
+
var _scene_jsonScene_renderSettings_postProcessingEnabled;
|
|
21119
|
+
_this.postProcessingEnabled = (_scene_jsonScene_renderSettings_postProcessingEnabled = (_scene_jsonScene_renderSettings = scene.jsonScene.renderSettings) == null ? void 0 : _scene_jsonScene_renderSettings.postProcessingEnabled) != null ? _scene_jsonScene_renderSettings_postProcessingEnabled : false;
|
|
21120
|
+
_this.getEngine().renderLevel = scene.renderLevel;
|
|
21121
|
+
if (reusable) {
|
|
21122
|
+
_this.keepResource = true;
|
|
21123
|
+
scene.textures = undefined;
|
|
21124
|
+
scene.consumed = true;
|
|
21065
21125
|
}
|
|
21066
|
-
|
|
21067
|
-
|
|
21068
|
-
|
|
21069
|
-
|
|
21070
|
-
|
|
21071
|
-
var key = _step.value;
|
|
21072
|
-
// TODO 待移除,序列化属性通过 effectsObject 对象直接获取
|
|
21073
|
-
var value = effectsObject.taggedProperties[key];
|
|
21074
|
-
if (value === undefined) {
|
|
21075
|
-
value = effectsObject[key];
|
|
21076
|
-
}
|
|
21077
|
-
if (EffectsObject.is(value)) {
|
|
21078
|
-
SerializationHelper.collectSerializableObject(value, res);
|
|
21079
|
-
} else if (isArray(value)) {
|
|
21080
|
-
for(var _iterator1 = _create_for_of_iterator_helper_loose(value), _step1; !(_step1 = _iterator1()).done;){
|
|
21081
|
-
var arrayValue = _step1.value;
|
|
21082
|
-
if (EffectsObject.is(arrayValue)) {
|
|
21083
|
-
SerializationHelper.collectSerializableObject(arrayValue, res);
|
|
21084
|
-
}
|
|
21085
|
-
}
|
|
21086
|
-
} else if (isObject(value)) {
|
|
21087
|
-
// 非 EffectsObject 对象只递归一层
|
|
21088
|
-
for(var _iterator2 = _create_for_of_iterator_helper_loose(Object.keys(value)), _step2; !(_step2 = _iterator2()).done;){
|
|
21089
|
-
var objectKey = _step2.value;
|
|
21090
|
-
var objectValue = value[objectKey];
|
|
21091
|
-
if (EffectsObject.is(objectValue)) {
|
|
21092
|
-
SerializationHelper.collectSerializableObject(objectValue, res);
|
|
21093
|
-
}
|
|
21094
|
-
}
|
|
21095
|
-
}
|
|
21126
|
+
var sourceContent = scene.jsonScene.compositions[0];
|
|
21127
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(scene.jsonScene.compositions), _step; !(_step = _iterator()).done;){
|
|
21128
|
+
var composition = _step.value;
|
|
21129
|
+
if (composition.id === scene.jsonScene.compositionId) {
|
|
21130
|
+
sourceContent = composition;
|
|
21096
21131
|
}
|
|
21097
21132
|
}
|
|
21133
|
+
assertExist(sourceContent);
|
|
21134
|
+
// Instantiate composition rootItem
|
|
21135
|
+
_this.rootItem = new VFXItem(_this.getEngine());
|
|
21136
|
+
_this.rootItem.name = "rootItem";
|
|
21137
|
+
_this.rootItem.duration = sourceContent.duration;
|
|
21138
|
+
_this.rootItem.endBehavior = sourceContent.endBehavior;
|
|
21139
|
+
_this.rootItem.composition = _assert_this_initialized(_this);
|
|
21140
|
+
// Create rootItem components
|
|
21141
|
+
//@ts-expect-error TODO update spec.
|
|
21142
|
+
var componentPaths = sourceContent.components;
|
|
21143
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(componentPaths), _step1; !(_step1 = _iterator1()).done;){
|
|
21144
|
+
var componentPath = _step1.value;
|
|
21145
|
+
var component = _this.getEngine().findObject(componentPath);
|
|
21146
|
+
_this.rootItem.components.push(component);
|
|
21147
|
+
component.item = _this.rootItem;
|
|
21148
|
+
}
|
|
21149
|
+
_this.rootComposition = _this.rootItem.getComponent(CompositionComponent);
|
|
21150
|
+
_this.width = width;
|
|
21151
|
+
_this.height = height;
|
|
21152
|
+
_this.renderOrder = baseRenderOrder;
|
|
21153
|
+
_this.id = sourceContent.id;
|
|
21154
|
+
_this.renderer = renderer;
|
|
21155
|
+
_this.event = event;
|
|
21156
|
+
var _scene_startTime, _scene_totalTime;
|
|
21157
|
+
_this.statistic = {
|
|
21158
|
+
loadStart: (_scene_startTime = scene.startTime) != null ? _scene_startTime : 0,
|
|
21159
|
+
loadTime: (_scene_totalTime = scene.totalTime) != null ? _scene_totalTime : 0,
|
|
21160
|
+
compileTime: 0,
|
|
21161
|
+
firstFrameTime: 0
|
|
21162
|
+
};
|
|
21163
|
+
_this.reusable = reusable;
|
|
21164
|
+
_this.speed = speed;
|
|
21165
|
+
_this.name = sourceContent.name;
|
|
21166
|
+
_this.pluginSystem = scene.pluginSystem;
|
|
21167
|
+
_this.pluginSystem.initializeComposition(_assert_this_initialized(_this), scene);
|
|
21168
|
+
_this.camera = new Camera(_this.name, _extends({}, sourceContent == null ? void 0 : sourceContent.camera, {
|
|
21169
|
+
aspect: width / height
|
|
21170
|
+
}));
|
|
21171
|
+
_this.url = scene.url;
|
|
21172
|
+
_this.assigned = true;
|
|
21173
|
+
_this.interactive = true;
|
|
21174
|
+
_this.handleItemMessage = handleItemMessage;
|
|
21175
|
+
_this.createRenderFrame();
|
|
21176
|
+
_this.rendererOptions = null;
|
|
21177
|
+
Composition.buildItemTree(_this.rootItem);
|
|
21178
|
+
_this.rootComposition.setChildrenRenderOrder(0);
|
|
21179
|
+
_this.pluginSystem.resetComposition(_assert_this_initialized(_this), _this.renderFrame);
|
|
21180
|
+
return _this;
|
|
21181
|
+
}
|
|
21182
|
+
var _proto = Composition.prototype;
|
|
21183
|
+
/**
|
|
21184
|
+
* 获取合成的时长
|
|
21185
|
+
*/ _proto.getDuration = function getDuration() {
|
|
21186
|
+
return this.rootItem.duration;
|
|
21098
21187
|
};
|
|
21099
|
-
|
|
21100
|
-
|
|
21101
|
-
|
|
21102
|
-
|
|
21103
|
-
|
|
21104
|
-
var serializedDatas = _extends({}, engine.jsonSceneData);
|
|
21105
|
-
// 递归收集所有需要序列化的对象
|
|
21106
|
-
SerializationHelper.collectSerializableObject(effectsObject, serializableMap);
|
|
21107
|
-
// 依次序列化
|
|
21108
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(Object.keys(serializableMap)), _step; !(_step = _iterator()).done;){
|
|
21109
|
-
var guid = _step.value;
|
|
21110
|
-
var serializeObject = serializableMap[guid];
|
|
21111
|
-
if (!serializedDatas[serializeObject.getInstanceId()]) {
|
|
21112
|
-
serializedDatas[serializeObject.getInstanceId()] = {};
|
|
21113
|
-
}
|
|
21114
|
-
SerializationHelper.serialize(serializeObject, serializedDatas[serializeObject.getInstanceId()]);
|
|
21115
|
-
}
|
|
21116
|
-
return serializedDatas;
|
|
21188
|
+
/**
|
|
21189
|
+
* 重新开始合成
|
|
21190
|
+
*/ _proto.restart = function restart() {
|
|
21191
|
+
this.reset();
|
|
21192
|
+
this.forwardTime(this.startTime);
|
|
21117
21193
|
};
|
|
21118
|
-
|
|
21119
|
-
|
|
21120
|
-
|
|
21121
|
-
|
|
21122
|
-
|
|
21123
|
-
|
|
21124
|
-
|
|
21125
|
-
|
|
21126
|
-
|
|
21127
|
-
|
|
21128
|
-
|
|
21129
|
-
|
|
21130
|
-
|
|
21131
|
-
|
|
21132
|
-
|
|
21133
|
-
|
|
21134
|
-
|
|
21135
|
-
|
|
21136
|
-
|
|
21137
|
-
|
|
21138
|
-
|
|
21139
|
-
|
|
21140
|
-
|
|
21141
|
-
|
|
21142
|
-
|
|
21143
|
-
|
|
21144
|
-
|
|
21145
|
-
|
|
21146
|
-
|
|
21147
|
-
|
|
21148
|
-
|
|
21149
|
-
|
|
21150
|
-
|
|
21151
|
-
|
|
21152
|
-
|
|
21153
|
-
|
|
21154
|
-
// TODO json 数据避免传 typedArray
|
|
21155
|
-
serializedData[key1] = value1;
|
|
21156
|
-
} else if (isArray(value1)) {
|
|
21157
|
-
if (!serializedData[key1]) {
|
|
21158
|
-
serializedData[key1] = [];
|
|
21159
|
-
}
|
|
21160
|
-
SerializationHelper.serializeArrayProperty(value1, serializedData[key1], 0);
|
|
21161
|
-
} else if (EffectsObject.is(value1)) {
|
|
21162
|
-
// TODO 处理 EffectsObject 递归序列化
|
|
21163
|
-
serializedData[key1] = {
|
|
21164
|
-
id: value1.getInstanceId()
|
|
21165
|
-
};
|
|
21166
|
-
} else if (isObject(value1)) {
|
|
21167
|
-
if (!serializedData[key1]) {
|
|
21168
|
-
serializedData[key1] = {};
|
|
21169
|
-
}
|
|
21170
|
-
SerializationHelper.serializeObjectProperty(value1, serializedData[key1], 0);
|
|
21171
|
-
}
|
|
21172
|
-
}
|
|
21173
|
-
return serializedData;
|
|
21174
|
-
};
|
|
21175
|
-
SerializationHelper.deserialize = function deserialize(serializedData, effectsObject) {
|
|
21176
|
-
var taggedProperties = effectsObject.taggedProperties;
|
|
21177
|
-
var serializedProperties = getMergedStore(effectsObject);
|
|
21178
|
-
var engine = effectsObject.engine;
|
|
21179
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(Object.keys(serializedData)), _step; !(_step = _iterator()).done;){
|
|
21180
|
-
var key = _step.value;
|
|
21181
|
-
if (serializedProperties && serializedProperties[key]) {
|
|
21182
|
-
continue;
|
|
21183
|
-
}
|
|
21184
|
-
var value = serializedData[key];
|
|
21185
|
-
taggedProperties[key] = SerializationHelper.deserializeProperty(value, engine, 0);
|
|
21186
|
-
}
|
|
21187
|
-
if (serializedProperties) {
|
|
21188
|
-
for(var _iterator1 = _create_for_of_iterator_helper_loose(Object.keys(serializedProperties)), _step1; !(_step1 = _iterator1()).done;){
|
|
21189
|
-
var key1 = _step1.value;
|
|
21190
|
-
var value1 = serializedData[key1];
|
|
21191
|
-
if (value1 === undefined) {
|
|
21192
|
-
continue;
|
|
21193
|
-
}
|
|
21194
|
-
var propertyType = serializedProperties[key1].type;
|
|
21195
|
-
// FIXME: taggedProperties 为 readonly,这里存在强制赋值
|
|
21196
|
-
// @ts-expect-error
|
|
21197
|
-
effectsObject[key1] = SerializationHelper.deserializeProperty(value1, engine, 0, propertyType);
|
|
21198
|
-
}
|
|
21199
|
-
}
|
|
21200
|
-
effectsObject.fromData(taggedProperties);
|
|
21201
|
-
};
|
|
21202
|
-
SerializationHelper.deserializeAsync = function deserializeAsync(serializedData, effectsObject) {
|
|
21203
|
-
return _async_to_generator(function() {
|
|
21204
|
-
var taggedProperties, serializedProperties, engine, _iterator, _step, key, value, _iterator1, _step1, key1, value1, propertyType;
|
|
21205
|
-
return __generator(this, function(_state) {
|
|
21206
|
-
switch(_state.label){
|
|
21207
|
-
case 0:
|
|
21208
|
-
taggedProperties = effectsObject.taggedProperties;
|
|
21209
|
-
serializedProperties = getMergedStore(effectsObject);
|
|
21210
|
-
engine = effectsObject.engine;
|
|
21211
|
-
_iterator = _create_for_of_iterator_helper_loose(Object.keys(serializedData));
|
|
21212
|
-
_state.label = 1;
|
|
21213
|
-
case 1:
|
|
21214
|
-
if (!!(_step = _iterator()).done) return [
|
|
21215
|
-
3,
|
|
21216
|
-
4
|
|
21217
|
-
];
|
|
21218
|
-
key = _step.value;
|
|
21219
|
-
if (serializedProperties && serializedProperties[key]) {
|
|
21220
|
-
return [
|
|
21221
|
-
3,
|
|
21222
|
-
3
|
|
21223
|
-
];
|
|
21224
|
-
}
|
|
21225
|
-
value = serializedData[key];
|
|
21226
|
-
return [
|
|
21227
|
-
4,
|
|
21228
|
-
SerializationHelper.deserializePropertyAsync(value, engine, 0)
|
|
21229
|
-
];
|
|
21230
|
-
case 2:
|
|
21231
|
-
taggedProperties[key] = _state.sent();
|
|
21232
|
-
_state.label = 3;
|
|
21233
|
-
case 3:
|
|
21234
|
-
return [
|
|
21235
|
-
3,
|
|
21236
|
-
1
|
|
21237
|
-
];
|
|
21238
|
-
case 4:
|
|
21239
|
-
if (!serializedProperties) return [
|
|
21240
|
-
3,
|
|
21241
|
-
8
|
|
21242
|
-
];
|
|
21243
|
-
_iterator1 = _create_for_of_iterator_helper_loose(Object.keys(serializedProperties));
|
|
21244
|
-
_state.label = 5;
|
|
21245
|
-
case 5:
|
|
21246
|
-
if (!!(_step1 = _iterator1()).done) return [
|
|
21247
|
-
3,
|
|
21248
|
-
8
|
|
21249
|
-
];
|
|
21250
|
-
key1 = _step1.value;
|
|
21251
|
-
value1 = serializedData[key1];
|
|
21252
|
-
if (value1 === undefined) {
|
|
21253
|
-
return [
|
|
21254
|
-
3,
|
|
21255
|
-
7
|
|
21256
|
-
];
|
|
21257
|
-
}
|
|
21258
|
-
propertyType = serializedProperties[key1].type;
|
|
21259
|
-
return [
|
|
21260
|
-
4,
|
|
21261
|
-
SerializationHelper.deserializePropertyAsync(value1, engine, 0, propertyType)
|
|
21262
|
-
];
|
|
21263
|
-
case 6:
|
|
21264
|
-
// FIXME: taggedProperties 为 readonly,这里存在强制赋值
|
|
21265
|
-
// @ts-expect-error
|
|
21266
|
-
effectsObject[key1] = _state.sent();
|
|
21267
|
-
_state.label = 7;
|
|
21268
|
-
case 7:
|
|
21269
|
-
return [
|
|
21270
|
-
3,
|
|
21271
|
-
5
|
|
21272
|
-
];
|
|
21273
|
-
case 8:
|
|
21274
|
-
effectsObject.fromData(taggedProperties);
|
|
21275
|
-
return [
|
|
21276
|
-
2
|
|
21277
|
-
];
|
|
21278
|
-
}
|
|
21279
|
-
});
|
|
21280
|
-
})();
|
|
21281
|
-
};
|
|
21282
|
-
SerializationHelper.checkTypedArray = function checkTypedArray(obj) {
|
|
21283
|
-
return _instanceof1(obj, Int8Array) || _instanceof1(obj, Uint8Array) || _instanceof1(obj, Uint8ClampedArray) || _instanceof1(obj, Int16Array) || _instanceof1(obj, Uint16Array) || _instanceof1(obj, Int32Array) || _instanceof1(obj, Uint32Array) || _instanceof1(obj, Float32Array) || _instanceof1(obj, Float64Array) || _instanceof1(obj, ArrayBuffer);
|
|
21284
|
-
};
|
|
21285
|
-
// check value is { id: 7e69662e964e4892ae8933f24562395b }
|
|
21286
|
-
SerializationHelper.checkDataPath = function checkDataPath(value) {
|
|
21287
|
-
return !!(isObject(value) && Object.keys(value).length === 1 && "id" in value && isString(value.id) && value.id.length === 32);
|
|
21288
|
-
};
|
|
21289
|
-
// TODO 测试函数,2.0 上线后移除
|
|
21290
|
-
SerializationHelper.checkGLTFNode = function checkGLTFNode(value) {
|
|
21291
|
-
return isObject(value) && value.nodeIndex !== undefined && value.isJoint !== undefined;
|
|
21292
|
-
};
|
|
21293
|
-
SerializationHelper.checkImageSource = function checkImageSource(value) {
|
|
21294
|
-
return isCanvas(value) || _instanceof1(value, HTMLImageElement);
|
|
21295
|
-
};
|
|
21296
|
-
SerializationHelper.deserializeProperty = function deserializeProperty(property, engine, level, type) {
|
|
21297
|
-
if (level > 14) {
|
|
21298
|
-
console.error("The nested object layers of the serialized data exceed the maximum limit.");
|
|
21299
|
-
return;
|
|
21300
|
-
}
|
|
21301
|
-
// 加载并链接 DataPath 字段表示的 EffectsObject 引用。Class 对象 copy [key, value] 会丢失对象信息,因此只递归数组对象和普通 js Object 结构对象。
|
|
21302
|
-
if (isArray(property)) {
|
|
21303
|
-
var res = [];
|
|
21304
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(property), _step; !(_step = _iterator()).done;){
|
|
21305
|
-
var value = _step.value;
|
|
21306
|
-
res.push(SerializationHelper.deserializeProperty(value, engine, level + 1, type));
|
|
21307
|
-
}
|
|
21308
|
-
return res;
|
|
21309
|
-
// TODO json 数据避免传 typedArray
|
|
21310
|
-
} else if (SerializationHelper.checkDataPath(property)) {
|
|
21311
|
-
return engine.assetLoader.loadGUID(property.id);
|
|
21312
|
-
} else if (isObject(property) && property.constructor === Object) {
|
|
21313
|
-
var res1;
|
|
21314
|
-
if (type) {
|
|
21315
|
-
res1 = new type();
|
|
21316
|
-
} else {
|
|
21317
|
-
res1 = {};
|
|
21318
|
-
}
|
|
21319
|
-
for(var _iterator1 = _create_for_of_iterator_helper_loose(Object.keys(property)), _step1; !(_step1 = _iterator1()).done;){
|
|
21320
|
-
var key = _step1.value;
|
|
21321
|
-
res1[key] = SerializationHelper.deserializeProperty(property[key], engine, level + 1);
|
|
21322
|
-
}
|
|
21323
|
-
return res1;
|
|
21324
|
-
} else {
|
|
21325
|
-
return property;
|
|
21326
|
-
}
|
|
21327
|
-
};
|
|
21328
|
-
SerializationHelper.deserializePropertyAsync = function deserializePropertyAsync(property, engine, level, type) {
|
|
21329
|
-
return _async_to_generator(function() {
|
|
21330
|
-
var res, _iterator, _step, value, _, res1, res2, _iterator1, _step1, key;
|
|
21331
|
-
return __generator(this, function(_state) {
|
|
21332
|
-
switch(_state.label){
|
|
21333
|
-
case 0:
|
|
21334
|
-
if (level > 14) {
|
|
21335
|
-
console.error("The nested object layers of the serialized data exceed the maximum limit.");
|
|
21336
|
-
return [
|
|
21337
|
-
2
|
|
21338
|
-
];
|
|
21339
|
-
}
|
|
21340
|
-
if (!isArray(property)) return [
|
|
21341
|
-
3,
|
|
21342
|
-
5
|
|
21343
|
-
];
|
|
21344
|
-
res = [];
|
|
21345
|
-
_iterator = _create_for_of_iterator_helper_loose(property);
|
|
21346
|
-
_state.label = 1;
|
|
21347
|
-
case 1:
|
|
21348
|
-
if (!!(_step = _iterator()).done) return [
|
|
21349
|
-
3,
|
|
21350
|
-
4
|
|
21351
|
-
];
|
|
21352
|
-
value = _step.value;
|
|
21353
|
-
_ = res.push;
|
|
21354
|
-
return [
|
|
21355
|
-
4,
|
|
21356
|
-
SerializationHelper.deserializePropertyAsync(value, engine, level + 1, type)
|
|
21357
|
-
];
|
|
21358
|
-
case 2:
|
|
21359
|
-
_.apply(res, [
|
|
21360
|
-
_state.sent()
|
|
21361
|
-
]);
|
|
21362
|
-
_state.label = 3;
|
|
21363
|
-
case 3:
|
|
21364
|
-
return [
|
|
21365
|
-
3,
|
|
21366
|
-
1
|
|
21367
|
-
];
|
|
21368
|
-
case 4:
|
|
21369
|
-
return [
|
|
21370
|
-
2,
|
|
21371
|
-
res
|
|
21372
|
-
];
|
|
21373
|
-
case 5:
|
|
21374
|
-
if (!SerializationHelper.checkDataPath(property)) return [
|
|
21375
|
-
3,
|
|
21376
|
-
7
|
|
21377
|
-
];
|
|
21378
|
-
return [
|
|
21379
|
-
4,
|
|
21380
|
-
engine.assetLoader.loadGUIDAsync(property.id)
|
|
21381
|
-
];
|
|
21382
|
-
case 6:
|
|
21383
|
-
res1 = _state.sent();
|
|
21384
|
-
return [
|
|
21385
|
-
2,
|
|
21386
|
-
res1
|
|
21387
|
-
];
|
|
21388
|
-
case 7:
|
|
21389
|
-
if (!(isObject(property) && property.constructor === Object)) return [
|
|
21390
|
-
3,
|
|
21391
|
-
12
|
|
21392
|
-
];
|
|
21393
|
-
if (type) {
|
|
21394
|
-
res2 = new type();
|
|
21395
|
-
} else {
|
|
21396
|
-
res2 = {};
|
|
21397
|
-
}
|
|
21398
|
-
_iterator1 = _create_for_of_iterator_helper_loose(Object.keys(property));
|
|
21399
|
-
_state.label = 8;
|
|
21400
|
-
case 8:
|
|
21401
|
-
if (!!(_step1 = _iterator1()).done) return [
|
|
21402
|
-
3,
|
|
21403
|
-
11
|
|
21404
|
-
];
|
|
21405
|
-
key = _step1.value;
|
|
21406
|
-
return [
|
|
21407
|
-
4,
|
|
21408
|
-
SerializationHelper.deserializePropertyAsync(property[key], engine, level + 1)
|
|
21409
|
-
];
|
|
21410
|
-
case 9:
|
|
21411
|
-
res2[key] = _state.sent();
|
|
21412
|
-
_state.label = 10;
|
|
21413
|
-
case 10:
|
|
21414
|
-
return [
|
|
21415
|
-
3,
|
|
21416
|
-
8
|
|
21417
|
-
];
|
|
21418
|
-
case 11:
|
|
21419
|
-
return [
|
|
21420
|
-
2,
|
|
21421
|
-
res2
|
|
21422
|
-
];
|
|
21423
|
-
case 12:
|
|
21424
|
-
return [
|
|
21425
|
-
2,
|
|
21426
|
-
property
|
|
21427
|
-
];
|
|
21428
|
-
case 13:
|
|
21429
|
-
return [
|
|
21430
|
-
2
|
|
21431
|
-
];
|
|
21432
|
-
}
|
|
21433
|
-
});
|
|
21434
|
-
})();
|
|
21435
|
-
};
|
|
21436
|
-
SerializationHelper.serializeObjectProperty = function serializeObjectProperty(objectProperty, serializedData, level) {
|
|
21437
|
-
if (level > 14) {
|
|
21438
|
-
console.error("The nested object layers of the serialized data exceed the maximum limit.");
|
|
21439
|
-
return;
|
|
21440
|
-
}
|
|
21441
|
-
if (!serializedData) {
|
|
21442
|
-
serializedData = {};
|
|
21443
|
-
}
|
|
21444
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(Object.keys(objectProperty)), _step; !(_step = _iterator()).done;){
|
|
21445
|
-
var key = _step.value;
|
|
21446
|
-
var value = objectProperty[key];
|
|
21447
|
-
if (typeof value === "number" || typeof value === "string" || typeof value === "boolean" || SerializationHelper.checkTypedArray(objectProperty)) {
|
|
21448
|
-
// TODO json 数据避免传 typedArray
|
|
21449
|
-
serializedData[key] = value;
|
|
21450
|
-
} else if (isArray(value)) {
|
|
21451
|
-
if (!serializedData[key]) {
|
|
21452
|
-
serializedData[key] = [];
|
|
21453
|
-
}
|
|
21454
|
-
SerializationHelper.serializeArrayProperty(value, serializedData[key], level + 1);
|
|
21455
|
-
} else if (EffectsObject.is(value)) {
|
|
21456
|
-
// TODO 处理 EffectsObject 递归序列化
|
|
21457
|
-
serializedData[key] = {
|
|
21458
|
-
id: value.getInstanceId()
|
|
21459
|
-
};
|
|
21460
|
-
} else if (isObject(value)) {
|
|
21461
|
-
if (!serializedData[key]) {
|
|
21462
|
-
serializedData[key] = {};
|
|
21463
|
-
}
|
|
21464
|
-
SerializationHelper.serializeObjectProperty(value, serializedData[key], level + 1);
|
|
21465
|
-
}
|
|
21466
|
-
}
|
|
21467
|
-
};
|
|
21468
|
-
SerializationHelper.serializeArrayProperty = function serializeArrayProperty(arrayProperty, serializedData, level) {
|
|
21469
|
-
if (level > 14) {
|
|
21470
|
-
console.error("The nested object layers of the serialized data exceed the maximum limit.");
|
|
21471
|
-
return;
|
|
21472
|
-
}
|
|
21473
|
-
if (!serializedData) {
|
|
21474
|
-
serializedData = [];
|
|
21475
|
-
}
|
|
21476
|
-
for(var i = 0; i < arrayProperty.length; i++){
|
|
21477
|
-
var value = arrayProperty[i];
|
|
21478
|
-
if (typeof value === "number" || typeof value === "string" || typeof value === "boolean" || SerializationHelper.checkTypedArray(arrayProperty)) {
|
|
21479
|
-
// TODO json 数据避免传 typedArray
|
|
21480
|
-
serializedData[i] = value;
|
|
21481
|
-
} else if (isArray(value)) {
|
|
21482
|
-
if (!serializedData[i]) {
|
|
21483
|
-
serializedData[i] = [];
|
|
21484
|
-
}
|
|
21485
|
-
SerializationHelper.serializeArrayProperty(value, serializedData[i], level + 1);
|
|
21486
|
-
} else if (EffectsObject.is(value)) {
|
|
21487
|
-
// TODO 处理 EffectsObject 递归序列化
|
|
21488
|
-
serializedData[i] = {
|
|
21489
|
-
id: value.getInstanceId()
|
|
21490
|
-
};
|
|
21491
|
-
} else if (isObject(value)) {
|
|
21492
|
-
if (!serializedData[i]) {
|
|
21493
|
-
serializedData[i] = {};
|
|
21494
|
-
}
|
|
21495
|
-
SerializationHelper.serializeObjectProperty(value, serializedData[i], level + 1);
|
|
21496
|
-
}
|
|
21497
|
-
}
|
|
21498
|
-
};
|
|
21499
|
-
return SerializationHelper;
|
|
21500
|
-
}();
|
|
21501
|
-
|
|
21502
|
-
var _obj$1;
|
|
21503
|
-
/**
|
|
21504
|
-
* 机型和渲染等级对应表
|
|
21505
|
-
*
|
|
21506
|
-
* 机型:B-低端机、A-中端机、S-高端机
|
|
21507
|
-
* 渲染等级:B-低、A-中、S-高、A+-中高、B+-全部
|
|
21508
|
-
*
|
|
21509
|
-
* - S(高端机):高、全部、中高
|
|
21510
|
-
* - A(中端机):中、全部、中高
|
|
21511
|
-
* - B(低端机):低、全部
|
|
21512
|
-
* - undefined(全部机型)
|
|
21513
|
-
*/ var renderLevelPassSet = (_obj$1 = {}, _obj$1[RenderLevel.S] = [
|
|
21514
|
-
RenderLevel.S,
|
|
21515
|
-
RenderLevel.BPlus,
|
|
21516
|
-
RenderLevel.APlus
|
|
21517
|
-
], _obj$1[RenderLevel.A] = [
|
|
21518
|
-
RenderLevel.A,
|
|
21519
|
-
RenderLevel.BPlus,
|
|
21520
|
-
RenderLevel.APlus
|
|
21521
|
-
], _obj$1[RenderLevel.B] = [
|
|
21522
|
-
RenderLevel.B,
|
|
21523
|
-
RenderLevel.BPlus
|
|
21524
|
-
], _obj$1);
|
|
21525
|
-
function passRenderLevel(l, renderLevel) {
|
|
21526
|
-
if (!l || !renderLevel) {
|
|
21527
|
-
return true;
|
|
21528
|
-
}
|
|
21529
|
-
var arr = renderLevelPassSet[renderLevel];
|
|
21530
|
-
if (arr) {
|
|
21531
|
-
return arr.includes(l);
|
|
21532
|
-
}
|
|
21533
|
-
return false;
|
|
21534
|
-
}
|
|
21535
|
-
|
|
21536
|
-
/**
|
|
21537
|
-
* 合成抽象类:核心对象,通常一个场景只包含一个合成,可能会有多个合成。
|
|
21538
|
-
* 合成中包含了相关的 Item 元素,支持对 Item 元素的创建、更新和销毁。
|
|
21539
|
-
* 也负责 Item 相关的动画播放控制,和持有渲染帧数据。
|
|
21540
|
-
*/ var Composition = /*#__PURE__*/ function(EventEmitter) {
|
|
21541
|
-
_inherits(Composition, EventEmitter);
|
|
21542
|
-
function Composition(props, scene) {
|
|
21543
|
-
var _this;
|
|
21544
|
-
var _scene_jsonScene_renderSettings;
|
|
21545
|
-
_this = EventEmitter.call(this) || this;
|
|
21546
|
-
/**
|
|
21547
|
-
*
|
|
21548
|
-
*/ _this.sceneTicking = new SceneTicking();
|
|
21549
|
-
/**
|
|
21550
|
-
* 动画播放速度
|
|
21551
|
-
*/ _this.speed = 1;
|
|
21552
|
-
/**
|
|
21553
|
-
* 合成是否结束
|
|
21554
|
-
*/ _this.isEnded = false;
|
|
21555
|
-
/**
|
|
21556
|
-
* 用于保存与当前合成相关的插件数据
|
|
21557
|
-
*/ _this.loaderData = {};
|
|
21558
|
-
/**
|
|
21559
|
-
* 预合成数组
|
|
21560
|
-
*/ _this.refContent = [];
|
|
21561
|
-
/**
|
|
21562
|
-
* 是否开启后处理
|
|
21563
|
-
*/ _this.postProcessingEnabled = false;
|
|
21564
|
-
// TODO: 待优化
|
|
21565
|
-
_this.assigned = false;
|
|
21566
|
-
/**
|
|
21567
|
-
* 销毁状态位
|
|
21568
|
-
*/ _this.destroyed = false;
|
|
21569
|
-
_this.postLoaders = [];
|
|
21570
|
-
/**
|
|
21571
|
-
* 合成暂停/播放 标识
|
|
21572
|
-
*/ _this.paused = false;
|
|
21573
|
-
_this.lastVideoUpdateTime = 0;
|
|
21574
|
-
_this.isEndCalled = false;
|
|
21575
|
-
_this._textures = [];
|
|
21576
|
-
var _props_reusable = props.reusable, reusable = _props_reusable === void 0 ? false : _props_reusable, _props_speed = props.speed, speed = _props_speed === void 0 ? 1 : _props_speed, _props_baseRenderOrder = props.baseRenderOrder, baseRenderOrder = _props_baseRenderOrder === void 0 ? 0 : _props_baseRenderOrder, renderer = props.renderer, event = props.event, width = props.width, height = props.height, handleItemMessage = props.handleItemMessage;
|
|
21577
|
-
_this.renderer = renderer;
|
|
21578
|
-
_this._textures = scene.textureOptions;
|
|
21579
|
-
var _scene_jsonScene_renderSettings_postProcessingEnabled;
|
|
21580
|
-
_this.postProcessingEnabled = (_scene_jsonScene_renderSettings_postProcessingEnabled = (_scene_jsonScene_renderSettings = scene.jsonScene.renderSettings) == null ? void 0 : _scene_jsonScene_renderSettings.postProcessingEnabled) != null ? _scene_jsonScene_renderSettings_postProcessingEnabled : false;
|
|
21581
|
-
_this.getEngine().renderLevel = scene.renderLevel;
|
|
21582
|
-
if (reusable) {
|
|
21583
|
-
_this.keepResource = true;
|
|
21584
|
-
scene.textures = undefined;
|
|
21585
|
-
scene.consumed = true;
|
|
21586
|
-
}
|
|
21587
|
-
var sourceContent = scene.jsonScene.compositions[0];
|
|
21588
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(scene.jsonScene.compositions), _step; !(_step = _iterator()).done;){
|
|
21589
|
-
var composition = _step.value;
|
|
21590
|
-
if (composition.id === scene.jsonScene.compositionId) {
|
|
21591
|
-
sourceContent = composition;
|
|
21592
|
-
}
|
|
21593
|
-
}
|
|
21594
|
-
assertExist(sourceContent);
|
|
21595
|
-
// Instantiate composition rootItem
|
|
21596
|
-
_this.rootItem = new VFXItem(_this.getEngine());
|
|
21597
|
-
_this.rootItem.name = "rootItem";
|
|
21598
|
-
_this.rootItem.duration = sourceContent.duration;
|
|
21599
|
-
_this.rootItem.endBehavior = sourceContent.endBehavior;
|
|
21600
|
-
_this.rootItem.composition = _assert_this_initialized(_this);
|
|
21601
|
-
// Create rootCompositionComponent
|
|
21602
|
-
_this.rootComposition = _this.rootItem.addComponent(CompositionComponent);
|
|
21603
|
-
filterItemsByRenderLevel(sourceContent, _this.getEngine(), scene.renderLevel);
|
|
21604
|
-
SerializationHelper.deserialize(sourceContent, _this.rootComposition);
|
|
21605
|
-
_this.width = width;
|
|
21606
|
-
_this.height = height;
|
|
21607
|
-
_this.renderOrder = baseRenderOrder;
|
|
21608
|
-
_this.id = sourceContent.id;
|
|
21609
|
-
_this.renderer = renderer;
|
|
21610
|
-
_this.event = event;
|
|
21611
|
-
var _scene_startTime, _scene_totalTime;
|
|
21612
|
-
_this.statistic = {
|
|
21613
|
-
loadStart: (_scene_startTime = scene.startTime) != null ? _scene_startTime : 0,
|
|
21614
|
-
loadTime: (_scene_totalTime = scene.totalTime) != null ? _scene_totalTime : 0,
|
|
21615
|
-
compileTime: 0,
|
|
21616
|
-
firstFrameTime: 0
|
|
21617
|
-
};
|
|
21618
|
-
_this.reusable = reusable;
|
|
21619
|
-
_this.speed = speed;
|
|
21620
|
-
_this.name = sourceContent.name;
|
|
21621
|
-
_this.pluginSystem = scene.pluginSystem;
|
|
21622
|
-
_this.pluginSystem.initializeComposition(_assert_this_initialized(_this), scene);
|
|
21623
|
-
_this.camera = new Camera(_this.name, _extends({}, sourceContent == null ? void 0 : sourceContent.camera, {
|
|
21624
|
-
aspect: width / height
|
|
21625
|
-
}));
|
|
21626
|
-
_this.url = scene.url;
|
|
21627
|
-
_this.assigned = true;
|
|
21628
|
-
_this.interactive = true;
|
|
21629
|
-
_this.handleItemMessage = handleItemMessage;
|
|
21630
|
-
_this.createRenderFrame();
|
|
21631
|
-
_this.rendererOptions = null;
|
|
21632
|
-
_this.buildItemTree(_this.rootItem);
|
|
21633
|
-
_this.rootComposition.setChildrenRenderOrder(0);
|
|
21634
|
-
_this.pluginSystem.resetComposition(_assert_this_initialized(_this), _this.renderFrame);
|
|
21635
|
-
return _this;
|
|
21636
|
-
}
|
|
21637
|
-
var _proto = Composition.prototype;
|
|
21638
|
-
/**
|
|
21639
|
-
* 获取合成的时长
|
|
21640
|
-
*/ _proto.getDuration = function getDuration() {
|
|
21641
|
-
return this.rootItem.duration;
|
|
21642
|
-
};
|
|
21643
|
-
/**
|
|
21644
|
-
* 重新开始合成
|
|
21645
|
-
*/ _proto.restart = function restart() {
|
|
21646
|
-
this.reset();
|
|
21647
|
-
this.forwardTime(this.startTime);
|
|
21648
|
-
};
|
|
21649
|
-
/**
|
|
21650
|
-
* 设置当前合成的渲染顺序
|
|
21651
|
-
* @param index - 序号,大的后绘制
|
|
21652
|
-
*/ _proto.setIndex = function setIndex(index) {
|
|
21653
|
-
this.renderOrder = index;
|
|
21654
|
-
};
|
|
21655
|
-
/**
|
|
21656
|
-
* 获取当前合成的渲染顺序
|
|
21657
|
-
* @returns
|
|
21658
|
-
*/ _proto.getIndex = function getIndex() {
|
|
21659
|
-
return this.renderOrder;
|
|
21660
|
-
};
|
|
21661
|
-
/**
|
|
21662
|
-
* 设置合成的动画速度
|
|
21663
|
-
* @param speed - 速度
|
|
21664
|
-
*/ _proto.setSpeed = function setSpeed(speed) {
|
|
21665
|
-
this.speed = speed;
|
|
21666
|
-
};
|
|
21667
|
-
/**
|
|
21668
|
-
* 设置合成的可见性
|
|
21669
|
-
* @since 2.0.0
|
|
21670
|
-
* @param visible - 是否可见
|
|
21671
|
-
*/ _proto.setVisible = function setVisible(visible) {
|
|
21672
|
-
this.rootItem.setVisible(visible);
|
|
21673
|
-
};
|
|
21674
|
-
/**
|
|
21675
|
-
* 获取合成的动画速度
|
|
21676
|
-
* @returns
|
|
21677
|
-
*/ _proto.getSpeed = function getSpeed() {
|
|
21678
|
-
return this.speed;
|
|
21679
|
-
};
|
|
21680
|
-
/**
|
|
21681
|
-
*
|
|
21682
|
-
*/ _proto.play = function play() {
|
|
21683
|
-
if (this.isEnded && this.reusable) {
|
|
21684
|
-
this.restart();
|
|
21194
|
+
/**
|
|
21195
|
+
* 设置当前合成的渲染顺序
|
|
21196
|
+
* @param index - 序号,大的后绘制
|
|
21197
|
+
*/ _proto.setIndex = function setIndex(index) {
|
|
21198
|
+
this.renderOrder = index;
|
|
21199
|
+
};
|
|
21200
|
+
/**
|
|
21201
|
+
* 获取当前合成的渲染顺序
|
|
21202
|
+
* @returns
|
|
21203
|
+
*/ _proto.getIndex = function getIndex() {
|
|
21204
|
+
return this.renderOrder;
|
|
21205
|
+
};
|
|
21206
|
+
/**
|
|
21207
|
+
* 设置合成的动画速度
|
|
21208
|
+
* @param speed - 速度
|
|
21209
|
+
*/ _proto.setSpeed = function setSpeed(speed) {
|
|
21210
|
+
this.speed = speed;
|
|
21211
|
+
};
|
|
21212
|
+
/**
|
|
21213
|
+
* 设置合成的可见性
|
|
21214
|
+
* @since 2.0.0
|
|
21215
|
+
* @param visible - 是否可见
|
|
21216
|
+
*/ _proto.setVisible = function setVisible(visible) {
|
|
21217
|
+
this.rootItem.setVisible(visible);
|
|
21218
|
+
};
|
|
21219
|
+
/**
|
|
21220
|
+
* 获取合成的动画速度
|
|
21221
|
+
* @returns
|
|
21222
|
+
*/ _proto.getSpeed = function getSpeed() {
|
|
21223
|
+
return this.speed;
|
|
21224
|
+
};
|
|
21225
|
+
/**
|
|
21226
|
+
*
|
|
21227
|
+
*/ _proto.play = function play() {
|
|
21228
|
+
if (this.isEnded && this.reusable) {
|
|
21229
|
+
this.restart();
|
|
21685
21230
|
}
|
|
21686
21231
|
if (this.rootComposition.isStartCalled) {
|
|
21687
21232
|
this.gotoAndPlay(this.time - this.startTime);
|
|
@@ -21847,38 +21392,6 @@ function passRenderLevel(l, renderLevel) {
|
|
|
21847
21392
|
}
|
|
21848
21393
|
};
|
|
21849
21394
|
/**
|
|
21850
|
-
* 构建父子树,同时保存到 itemCacheMap 中便于查找
|
|
21851
|
-
*/ _proto.buildItemTree = function buildItemTree(compVFXItem) {
|
|
21852
|
-
if (!compVFXItem.composition) {
|
|
21853
|
-
return;
|
|
21854
|
-
}
|
|
21855
|
-
var itemMap = new Map();
|
|
21856
|
-
var contentItems = compVFXItem.getComponent(CompositionComponent).items;
|
|
21857
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(contentItems), _step; !(_step = _iterator()).done;){
|
|
21858
|
-
var item = _step.value;
|
|
21859
|
-
itemMap.set(item.id, item);
|
|
21860
|
-
}
|
|
21861
|
-
for(var _iterator1 = _create_for_of_iterator_helper_loose(contentItems), _step1; !(_step1 = _iterator1()).done;){
|
|
21862
|
-
var item1 = _step1.value;
|
|
21863
|
-
if (item1.parentId === undefined) {
|
|
21864
|
-
item1.setParent(compVFXItem);
|
|
21865
|
-
} else {
|
|
21866
|
-
var parent = itemMap.get(item1.parentId);
|
|
21867
|
-
if (parent) {
|
|
21868
|
-
item1.setParent(parent);
|
|
21869
|
-
} else {
|
|
21870
|
-
throw new Error("The element references a non-existent element, please check the data.");
|
|
21871
|
-
}
|
|
21872
|
-
}
|
|
21873
|
-
}
|
|
21874
|
-
for(var _iterator2 = _create_for_of_iterator_helper_loose(contentItems), _step2; !(_step2 = _iterator2()).done;){
|
|
21875
|
-
var item2 = _step2.value;
|
|
21876
|
-
if (VFXItem.isComposition(item2)) {
|
|
21877
|
-
this.buildItemTree(item2);
|
|
21878
|
-
}
|
|
21879
|
-
}
|
|
21880
|
-
};
|
|
21881
|
-
/**
|
|
21882
21395
|
* 更新视频数据到纹理
|
|
21883
21396
|
* @override
|
|
21884
21397
|
*/ _proto.updateVideo = function updateVideo() {
|
|
@@ -22234,8 +21747,32 @@ function passRenderLevel(l, renderLevel) {
|
|
|
22234
21747
|
2
|
|
22235
21748
|
];
|
|
22236
21749
|
}
|
|
22237
|
-
});
|
|
22238
|
-
})();
|
|
21750
|
+
});
|
|
21751
|
+
})();
|
|
21752
|
+
};
|
|
21753
|
+
/**
|
|
21754
|
+
* @internal
|
|
21755
|
+
* 构建父子树,同时保存到 itemCacheMap 中便于查找
|
|
21756
|
+
*/ Composition.buildItemTree = function buildItemTree(compVFXItem) {
|
|
21757
|
+
var itemMap = new Map();
|
|
21758
|
+
var contentItems = compVFXItem.getComponent(CompositionComponent).items;
|
|
21759
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(contentItems), _step; !(_step = _iterator()).done;){
|
|
21760
|
+
var item = _step.value;
|
|
21761
|
+
itemMap.set(item.id, item);
|
|
21762
|
+
}
|
|
21763
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(contentItems), _step1; !(_step1 = _iterator1()).done;){
|
|
21764
|
+
var item1 = _step1.value;
|
|
21765
|
+
if (item1.parentId === undefined) {
|
|
21766
|
+
item1.setParent(compVFXItem);
|
|
21767
|
+
} else {
|
|
21768
|
+
var parent = itemMap.get(item1.parentId);
|
|
21769
|
+
if (parent) {
|
|
21770
|
+
item1.setParent(parent);
|
|
21771
|
+
} else {
|
|
21772
|
+
throw new Error("The element references a non-existent element, please check the data.");
|
|
21773
|
+
}
|
|
21774
|
+
}
|
|
21775
|
+
}
|
|
22239
21776
|
};
|
|
22240
21777
|
_create_class(Composition, [
|
|
22241
21778
|
{
|
|
@@ -22298,25 +21835,6 @@ function passRenderLevel(l, renderLevel) {
|
|
|
22298
21835
|
]);
|
|
22299
21836
|
return Composition;
|
|
22300
21837
|
}(EventEmitter);
|
|
22301
|
-
function filterItemsByRenderLevel(composition, engine, renderLevel) {
|
|
22302
|
-
var items = [];
|
|
22303
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(composition.items), _step; !(_step = _iterator()).done;){
|
|
22304
|
-
var itemDataPath = _step.value;
|
|
22305
|
-
var itemProps = engine.findEffectsObjectData(itemDataPath.id);
|
|
22306
|
-
if (passRenderLevel(itemProps.renderLevel, renderLevel)) {
|
|
22307
|
-
items.push(itemDataPath);
|
|
22308
|
-
} else {
|
|
22309
|
-
// 非预合成元素未达到渲染等级的转化为空节点。
|
|
22310
|
-
// 预合成元素有根据 item type 的子元素加载判断,没法保留空节点,这边先整体过滤掉。
|
|
22311
|
-
if (itemProps.type !== ItemType.composition) {
|
|
22312
|
-
itemProps.components = [];
|
|
22313
|
-
items.push(itemDataPath);
|
|
22314
|
-
}
|
|
22315
|
-
}
|
|
22316
|
-
}
|
|
22317
|
-
composition.items = items;
|
|
22318
|
-
return composition;
|
|
22319
|
-
}
|
|
22320
21838
|
|
|
22321
21839
|
var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
22322
21840
|
_inherits(VFXItem, EffectsObject);
|
|
@@ -22329,7 +21847,7 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
22329
21847
|
*/ _this.transform = new Transform();
|
|
22330
21848
|
/**
|
|
22331
21849
|
* 元素动画的当前时间
|
|
22332
|
-
*/ _this.time =
|
|
21850
|
+
*/ _this.time = -1;
|
|
22333
21851
|
/**
|
|
22334
21852
|
* 元素动画的持续时间
|
|
22335
21853
|
*/ _this.duration = 0;
|
|
@@ -22340,9 +21858,8 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
22340
21858
|
* 元素动画结束时行为(如何处理元素)
|
|
22341
21859
|
*/ _this.endBehavior = EndBehavior.forward;
|
|
22342
21860
|
_this.type = ItemType.base;
|
|
22343
|
-
_this.isDuringPlay = false;
|
|
22344
21861
|
_this.components = [];
|
|
22345
|
-
_this.
|
|
21862
|
+
_this.isDuringPlay = false;
|
|
22346
21863
|
/**
|
|
22347
21864
|
* 元素是否激活
|
|
22348
21865
|
*/ _this.active = true;
|
|
@@ -22610,6 +22127,25 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
22610
22127
|
return undefined;
|
|
22611
22128
|
};
|
|
22612
22129
|
/**
|
|
22130
|
+
* 复制 VFXItem,返回一个新的 VFXItem
|
|
22131
|
+
* @since 2.4.0
|
|
22132
|
+
* @returns 复制的新 VFXItem
|
|
22133
|
+
*/ _proto.duplicate = function duplicate() {
|
|
22134
|
+
var previousObjectIDMap = new Map();
|
|
22135
|
+
this.gatherPreviousObjectID(previousObjectIDMap);
|
|
22136
|
+
// 重新设置当前元素和组件的 ID 以及子元素和子元素组件的 ID,避免实例化新的对象时产生碰撞
|
|
22137
|
+
this.resetGUID();
|
|
22138
|
+
var newItem = this.engine.findObject({
|
|
22139
|
+
id: this.defination.id
|
|
22140
|
+
});
|
|
22141
|
+
newItem.resetGUID();
|
|
22142
|
+
this.resetGUID(previousObjectIDMap);
|
|
22143
|
+
if (this.composition) {
|
|
22144
|
+
newItem.setParent(this.composition.rootItem);
|
|
22145
|
+
}
|
|
22146
|
+
return newItem;
|
|
22147
|
+
};
|
|
22148
|
+
/**
|
|
22613
22149
|
* @internal
|
|
22614
22150
|
*/ _proto.beginPlay = function beginPlay() {
|
|
22615
22151
|
this.isDuringPlay = true;
|
|
@@ -22704,19 +22240,18 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
22704
22240
|
if (duration < 0) {
|
|
22705
22241
|
throw new Error("Item duration can't be less than 0, see " + HELP_LINK["Item duration can't be less than 0"] + ".");
|
|
22706
22242
|
}
|
|
22707
|
-
|
|
22708
|
-
|
|
22709
|
-
var
|
|
22710
|
-
|
|
22711
|
-
|
|
22712
|
-
this.
|
|
22713
|
-
|
|
22714
|
-
|
|
22715
|
-
|
|
22716
|
-
|
|
22717
|
-
|
|
22243
|
+
if (data.components) {
|
|
22244
|
+
this.components.length = 0;
|
|
22245
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(data.components), _step; !(_step = _iterator()).done;){
|
|
22246
|
+
var componentPath = _step.value;
|
|
22247
|
+
var component = this.engine.findObject(componentPath);
|
|
22248
|
+
this.components.push(component);
|
|
22249
|
+
// TODO ParticleSystemRenderer 现在是动态生成的,后面需要在 json 中单独表示为一个组件
|
|
22250
|
+
if (_instanceof1(component, ParticleSystem)) {
|
|
22251
|
+
if (!this.components.includes(component.renderer)) {
|
|
22252
|
+
this.components.push(component.renderer);
|
|
22253
|
+
}
|
|
22718
22254
|
}
|
|
22719
|
-
this.rendererComponents.push(component.renderer);
|
|
22720
22255
|
}
|
|
22721
22256
|
}
|
|
22722
22257
|
if (VFXItem.isComposition(this)) {
|
|
@@ -22725,24 +22260,24 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
22725
22260
|
};
|
|
22726
22261
|
_proto.toData = function toData() {
|
|
22727
22262
|
var _this_parent;
|
|
22728
|
-
this.
|
|
22729
|
-
this.
|
|
22730
|
-
this.
|
|
22263
|
+
this.defination.id = this.guid;
|
|
22264
|
+
this.defination.transform = this.transform.toData();
|
|
22265
|
+
this.defination.dataType = DataType.VFXItemData;
|
|
22731
22266
|
if (((_this_parent = this.parent) == null ? void 0 : _this_parent.name) !== "rootItem") {
|
|
22732
22267
|
var _this_parent1;
|
|
22733
|
-
this.
|
|
22268
|
+
this.defination.parentId = (_this_parent1 = this.parent) == null ? void 0 : _this_parent1.guid;
|
|
22734
22269
|
}
|
|
22735
22270
|
// TODO 统一 sprite 等其他组件的序列化逻辑
|
|
22736
|
-
if (!this.
|
|
22737
|
-
this.
|
|
22271
|
+
if (!this.defination.components) {
|
|
22272
|
+
this.defination.components = [];
|
|
22738
22273
|
for(var _iterator = _create_for_of_iterator_helper_loose(this.components), _step; !(_step = _iterator()).done;){
|
|
22739
22274
|
var component = _step.value;
|
|
22740
22275
|
if (_instanceof1(component, EffectComponent)) {
|
|
22741
|
-
this.
|
|
22276
|
+
this.defination.components.push(component);
|
|
22742
22277
|
}
|
|
22743
22278
|
}
|
|
22744
22279
|
}
|
|
22745
|
-
this.
|
|
22280
|
+
this.defination.content = {};
|
|
22746
22281
|
};
|
|
22747
22282
|
_proto.translateByPixel = function translateByPixel(x, y) {
|
|
22748
22283
|
if (this.composition) {
|
|
@@ -22799,17 +22334,52 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
22799
22334
|
if (!props) {
|
|
22800
22335
|
throw new Error("Referenced precomposition with Id: " + refId + " does not exist.");
|
|
22801
22336
|
}
|
|
22802
|
-
|
|
22803
|
-
|
|
22804
|
-
|
|
22805
|
-
|
|
22806
|
-
var
|
|
22807
|
-
|
|
22808
|
-
|
|
22809
|
-
|
|
22810
|
-
|
|
22337
|
+
//@ts-expect-error TODO update spec.
|
|
22338
|
+
var componentPaths = props.components;
|
|
22339
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(componentPaths), _step; !(_step = _iterator()).done;){
|
|
22340
|
+
var componentPath = _step.value;
|
|
22341
|
+
var component = this.engine.findObject(componentPath);
|
|
22342
|
+
component.item = this;
|
|
22343
|
+
this.components.push(component);
|
|
22344
|
+
component.setInstanceId(generateGUID());
|
|
22345
|
+
if (_instanceof1(component, CompositionComponent)) {
|
|
22346
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(component.items), _step1; !(_step1 = _iterator1()).done;){
|
|
22347
|
+
var vfxItem = _step1.value;
|
|
22348
|
+
vfxItem.setInstanceId(generateGUID());
|
|
22349
|
+
for(var _iterator2 = _create_for_of_iterator_helper_loose(vfxItem.components), _step2; !(_step2 = _iterator2()).done;){
|
|
22350
|
+
var component1 = _step2.value;
|
|
22351
|
+
component1.setInstanceId(generateGUID());
|
|
22352
|
+
}
|
|
22353
|
+
}
|
|
22811
22354
|
}
|
|
22812
22355
|
}
|
|
22356
|
+
Composition.buildItemTree(this);
|
|
22357
|
+
};
|
|
22358
|
+
_proto.resetGUID = function resetGUID(previousObjectIDMap) {
|
|
22359
|
+
var _previousObjectIDMap_get;
|
|
22360
|
+
var itemGUID = (_previousObjectIDMap_get = previousObjectIDMap == null ? void 0 : previousObjectIDMap.get(this)) != null ? _previousObjectIDMap_get : generateGUID();
|
|
22361
|
+
this.setInstanceId(itemGUID);
|
|
22362
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(this.components), _step; !(_step = _iterator()).done;){
|
|
22363
|
+
var component = _step.value;
|
|
22364
|
+
var _previousObjectIDMap_get1;
|
|
22365
|
+
var componentGUID = (_previousObjectIDMap_get1 = previousObjectIDMap == null ? void 0 : previousObjectIDMap.get(component)) != null ? _previousObjectIDMap_get1 : generateGUID();
|
|
22366
|
+
component.setInstanceId(componentGUID);
|
|
22367
|
+
}
|
|
22368
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(this.children), _step1; !(_step1 = _iterator1()).done;){
|
|
22369
|
+
var child = _step1.value;
|
|
22370
|
+
child.resetGUID(previousObjectIDMap);
|
|
22371
|
+
}
|
|
22372
|
+
};
|
|
22373
|
+
_proto.gatherPreviousObjectID = function gatherPreviousObjectID(previousObjectIDMap) {
|
|
22374
|
+
previousObjectIDMap.set(this, this.getInstanceId());
|
|
22375
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(this.components), _step; !(_step = _iterator()).done;){
|
|
22376
|
+
var component = _step.value;
|
|
22377
|
+
previousObjectIDMap.set(component, component.getInstanceId());
|
|
22378
|
+
}
|
|
22379
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(this.children), _step1; !(_step1 = _iterator1()).done;){
|
|
22380
|
+
var child = _step1.value;
|
|
22381
|
+
child.gatherPreviousObjectID(previousObjectIDMap);
|
|
22382
|
+
}
|
|
22813
22383
|
};
|
|
22814
22384
|
/**
|
|
22815
22385
|
*
|
|
@@ -22916,9 +22486,11 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
22916
22486
|
set: function set(value) {
|
|
22917
22487
|
if (this.listIndex !== value) {
|
|
22918
22488
|
this.listIndex = value;
|
|
22919
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(this.
|
|
22920
|
-
var
|
|
22921
|
-
|
|
22489
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(this.components), _step; !(_step = _iterator()).done;){
|
|
22490
|
+
var component = _step.value;
|
|
22491
|
+
if (_instanceof1(component, RendererComponent)) {
|
|
22492
|
+
component.priority = value;
|
|
22493
|
+
}
|
|
22922
22494
|
}
|
|
22923
22495
|
}
|
|
22924
22496
|
}
|
|
@@ -22942,9 +22514,6 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
22942
22514
|
]);
|
|
22943
22515
|
return VFXItem;
|
|
22944
22516
|
}(EffectsObject);
|
|
22945
|
-
__decorate([
|
|
22946
|
-
serialize()
|
|
22947
|
-
], VFXItem.prototype, "components", void 0);
|
|
22948
22517
|
VFXItem = __decorate([
|
|
22949
22518
|
effectsClass(DataType.VFXItemData)
|
|
22950
22519
|
], VFXItem);
|
|
@@ -26959,66 +26528,255 @@ var TextComponentBase = /*#__PURE__*/ function() {
|
|
|
26959
26528
|
if (fontStyle !== FontStyle.normal) {
|
|
26960
26529
|
fontDesc = fontStyle + " " + fontDesc;
|
|
26961
26530
|
}
|
|
26962
|
-
return fontDesc;
|
|
26531
|
+
return fontDesc;
|
|
26532
|
+
};
|
|
26533
|
+
_proto.setupOutline = function setupOutline() {
|
|
26534
|
+
var context = this.context;
|
|
26535
|
+
var _this_textStyle = this.textStyle, outlineColor = _this_textStyle.outlineColor, outlineWidth = _this_textStyle.outlineWidth;
|
|
26536
|
+
var r = outlineColor[0], g = outlineColor[1], b = outlineColor[2], a = outlineColor[3];
|
|
26537
|
+
if (context) {
|
|
26538
|
+
context.strokeStyle = "rgba(" + r * 255 + ", " + g * 255 + ", " + b * 255 + ", " + a + ")";
|
|
26539
|
+
context.lineWidth = outlineWidth * 2;
|
|
26540
|
+
}
|
|
26541
|
+
};
|
|
26542
|
+
_proto.setupShadow = function setupShadow() {
|
|
26543
|
+
var context = this.context;
|
|
26544
|
+
var _this_textStyle = this.textStyle, outlineColor = _this_textStyle.outlineColor, shadowBlur = _this_textStyle.shadowBlur, shadowOffsetX = _this_textStyle.shadowOffsetX, shadowOffsetY = _this_textStyle.shadowOffsetY;
|
|
26545
|
+
var r = outlineColor[0], g = outlineColor[1], b = outlineColor[2], a = outlineColor[3];
|
|
26546
|
+
if (context) {
|
|
26547
|
+
context.shadowColor = "rgba(" + r * 255 + ", " + g * 255 + ", " + b * 255 + ", " + a + ")";
|
|
26548
|
+
context.shadowBlur = shadowBlur;
|
|
26549
|
+
context.shadowOffsetX = shadowOffsetX;
|
|
26550
|
+
context.shadowOffsetY = -shadowOffsetY;
|
|
26551
|
+
}
|
|
26552
|
+
};
|
|
26553
|
+
return TextComponentBase;
|
|
26554
|
+
}();
|
|
26555
|
+
applyMixins(TextComponent, [
|
|
26556
|
+
TextComponentBase
|
|
26557
|
+
]);
|
|
26558
|
+
|
|
26559
|
+
// TODO: 注册必须用
|
|
26560
|
+
var TextLoader = /*#__PURE__*/ function(AbstractPlugin) {
|
|
26561
|
+
_inherits(TextLoader, AbstractPlugin);
|
|
26562
|
+
function TextLoader() {
|
|
26563
|
+
return AbstractPlugin.apply(this, arguments);
|
|
26564
|
+
}
|
|
26565
|
+
return TextLoader;
|
|
26566
|
+
}(AbstractPlugin);
|
|
26567
|
+
|
|
26568
|
+
var Asset = /*#__PURE__*/ function(EffectsObject) {
|
|
26569
|
+
_inherits(Asset, EffectsObject);
|
|
26570
|
+
function Asset() {
|
|
26571
|
+
return EffectsObject.apply(this, arguments);
|
|
26572
|
+
}
|
|
26573
|
+
return Asset;
|
|
26574
|
+
}(EffectsObject);
|
|
26575
|
+
|
|
26576
|
+
var BinaryAsset = /*#__PURE__*/ function(EffectsObject) {
|
|
26577
|
+
_inherits(BinaryAsset, EffectsObject);
|
|
26578
|
+
function BinaryAsset() {
|
|
26579
|
+
return EffectsObject.apply(this, arguments);
|
|
26580
|
+
}
|
|
26581
|
+
return BinaryAsset;
|
|
26582
|
+
}(EffectsObject);
|
|
26583
|
+
__decorate([
|
|
26584
|
+
serialize()
|
|
26585
|
+
], BinaryAsset.prototype, "buffer", void 0);
|
|
26586
|
+
BinaryAsset = __decorate([
|
|
26587
|
+
effectsClass(DataType.BinaryAsset)
|
|
26588
|
+
], BinaryAsset);
|
|
26589
|
+
|
|
26590
|
+
var SerializationHelper = /*#__PURE__*/ function() {
|
|
26591
|
+
function SerializationHelper() {}
|
|
26592
|
+
SerializationHelper.serialize = function serialize(effectsObject, serializedData) {
|
|
26593
|
+
effectsObject.toData();
|
|
26594
|
+
if (!serializedData) {
|
|
26595
|
+
serializedData = {};
|
|
26596
|
+
}
|
|
26597
|
+
var serializedProperties = getMergedStore(effectsObject);
|
|
26598
|
+
if (serializedProperties) {
|
|
26599
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(Object.keys(serializedProperties)), _step; !(_step = _iterator()).done;){
|
|
26600
|
+
var key = _step.value;
|
|
26601
|
+
var value = effectsObject[key];
|
|
26602
|
+
if (typeof value === "number" || typeof value === "string" || typeof value === "boolean" || SerializationHelper.checkTypedArray(value)) {
|
|
26603
|
+
// TODO json 数据避免传 typedArray
|
|
26604
|
+
serializedData[key] = value;
|
|
26605
|
+
} else if (isArray(value)) {
|
|
26606
|
+
if (!serializedData[key]) {
|
|
26607
|
+
serializedData[key] = [];
|
|
26608
|
+
}
|
|
26609
|
+
SerializationHelper.serializeArrayProperty(value, serializedData[key], 0);
|
|
26610
|
+
} else if (EffectsObject.is(value)) {
|
|
26611
|
+
// TODO 处理 EffectsObject 递归序列化
|
|
26612
|
+
serializedData[key] = {
|
|
26613
|
+
id: value.getInstanceId()
|
|
26614
|
+
};
|
|
26615
|
+
} else if (isObject(value)) {
|
|
26616
|
+
if (!serializedData[key]) {
|
|
26617
|
+
serializedData[key] = {};
|
|
26618
|
+
}
|
|
26619
|
+
SerializationHelper.serializeObjectProperty(value, serializedData[key], 0);
|
|
26620
|
+
}
|
|
26621
|
+
}
|
|
26622
|
+
}
|
|
26623
|
+
// TODO 待移除 tagggedProperties 为没有装饰器的临时方案
|
|
26624
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(Object.keys(effectsObject.defination)), _step1; !(_step1 = _iterator1()).done;){
|
|
26625
|
+
var key1 = _step1.value;
|
|
26626
|
+
var value1 = effectsObject.defination[key1];
|
|
26627
|
+
if (typeof value1 === "number" || typeof value1 === "string" || typeof value1 === "boolean" || SerializationHelper.checkTypedArray(value1)) {
|
|
26628
|
+
// TODO json 数据避免传 typedArray
|
|
26629
|
+
serializedData[key1] = value1;
|
|
26630
|
+
} else if (isArray(value1)) {
|
|
26631
|
+
if (!serializedData[key1]) {
|
|
26632
|
+
serializedData[key1] = [];
|
|
26633
|
+
}
|
|
26634
|
+
SerializationHelper.serializeArrayProperty(value1, serializedData[key1], 0);
|
|
26635
|
+
} else if (EffectsObject.is(value1)) {
|
|
26636
|
+
// TODO 处理 EffectsObject 递归序列化
|
|
26637
|
+
serializedData[key1] = {
|
|
26638
|
+
id: value1.getInstanceId()
|
|
26639
|
+
};
|
|
26640
|
+
} else if (isObject(value1)) {
|
|
26641
|
+
if (!serializedData[key1]) {
|
|
26642
|
+
serializedData[key1] = {};
|
|
26643
|
+
}
|
|
26644
|
+
SerializationHelper.serializeObjectProperty(value1, serializedData[key1], 0);
|
|
26645
|
+
}
|
|
26646
|
+
}
|
|
26647
|
+
return serializedData;
|
|
26648
|
+
};
|
|
26649
|
+
SerializationHelper.deserialize = function deserialize(serializedData, effectsObject) {
|
|
26650
|
+
effectsObject.defination = serializedData;
|
|
26651
|
+
var serializedProperties = getMergedStore(effectsObject);
|
|
26652
|
+
var engine = effectsObject.engine;
|
|
26653
|
+
if (serializedProperties) {
|
|
26654
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(Object.keys(serializedProperties)), _step; !(_step = _iterator()).done;){
|
|
26655
|
+
var key = _step.value;
|
|
26656
|
+
var value = serializedData[key];
|
|
26657
|
+
if (value === undefined) {
|
|
26658
|
+
continue;
|
|
26659
|
+
}
|
|
26660
|
+
var propertyType = serializedProperties[key].type;
|
|
26661
|
+
// FIXME: taggedProperties 为 readonly,这里存在强制赋值
|
|
26662
|
+
effectsObject[key] = SerializationHelper.deserializeProperty(value, engine, 0, propertyType);
|
|
26663
|
+
}
|
|
26664
|
+
}
|
|
26665
|
+
effectsObject.fromData(effectsObject.defination);
|
|
26666
|
+
};
|
|
26667
|
+
SerializationHelper.checkTypedArray = function checkTypedArray(obj) {
|
|
26668
|
+
return _instanceof1(obj, Int8Array) || _instanceof1(obj, Uint8Array) || _instanceof1(obj, Uint8ClampedArray) || _instanceof1(obj, Int16Array) || _instanceof1(obj, Uint16Array) || _instanceof1(obj, Int32Array) || _instanceof1(obj, Uint32Array) || _instanceof1(obj, Float32Array) || _instanceof1(obj, Float64Array) || _instanceof1(obj, ArrayBuffer);
|
|
26669
|
+
};
|
|
26670
|
+
// check value is { id: 7e69662e964e4892ae8933f24562395b }
|
|
26671
|
+
SerializationHelper.checkDataPath = function checkDataPath(value) {
|
|
26672
|
+
return !!(isObject(value) && Object.keys(value).length === 1 && "id" in value && isString(value.id) && value.id.length === 32);
|
|
26673
|
+
};
|
|
26674
|
+
// TODO 测试函数,2.0 上线后移除
|
|
26675
|
+
SerializationHelper.checkGLTFNode = function checkGLTFNode(value) {
|
|
26676
|
+
return isObject(value) && value.nodeIndex !== undefined && value.isJoint !== undefined;
|
|
26677
|
+
};
|
|
26678
|
+
SerializationHelper.checkImageSource = function checkImageSource(value) {
|
|
26679
|
+
return isCanvas(value) || _instanceof1(value, HTMLImageElement);
|
|
26680
|
+
};
|
|
26681
|
+
SerializationHelper.deserializeProperty = function deserializeProperty(property, engine, level, type, overrideDataPath) {
|
|
26682
|
+
if (overrideDataPath === void 0) overrideDataPath = true;
|
|
26683
|
+
if (level > 14) {
|
|
26684
|
+
console.error("The nested object layers of the serialized data exceed the maximum limit.");
|
|
26685
|
+
return;
|
|
26686
|
+
}
|
|
26687
|
+
// 加载并链接 DataPath 字段表示的 EffectsObject 引用。Class 对象 copy [key, value] 会丢失对象信息,因此只递归数组对象和普通 js Object 结构对象。
|
|
26688
|
+
if (isArray(property)) {
|
|
26689
|
+
var res = [];
|
|
26690
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(property), _step; !(_step = _iterator()).done;){
|
|
26691
|
+
var value = _step.value;
|
|
26692
|
+
res.push(SerializationHelper.deserializeProperty(value, engine, level + 1, type, overrideDataPath));
|
|
26693
|
+
}
|
|
26694
|
+
return res;
|
|
26695
|
+
// TODO json 数据避免传 typedArray
|
|
26696
|
+
} else if (SerializationHelper.checkDataPath(property)) {
|
|
26697
|
+
var referenceObject = engine.findObject(property);
|
|
26698
|
+
return overrideDataPath ? referenceObject : property;
|
|
26699
|
+
} else if (isObject(property) && property.constructor === Object) {
|
|
26700
|
+
var res1;
|
|
26701
|
+
if (type) {
|
|
26702
|
+
res1 = new type();
|
|
26703
|
+
} else {
|
|
26704
|
+
res1 = {};
|
|
26705
|
+
}
|
|
26706
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(Object.keys(property)), _step1; !(_step1 = _iterator1()).done;){
|
|
26707
|
+
var key = _step1.value;
|
|
26708
|
+
res1[key] = SerializationHelper.deserializeProperty(property[key], engine, level + 1, undefined, overrideDataPath);
|
|
26709
|
+
}
|
|
26710
|
+
return res1;
|
|
26711
|
+
} else {
|
|
26712
|
+
return property;
|
|
26713
|
+
}
|
|
26714
|
+
};
|
|
26715
|
+
SerializationHelper.serializeObjectProperty = function serializeObjectProperty(objectProperty, serializedData, level) {
|
|
26716
|
+
if (level > 14) {
|
|
26717
|
+
console.error("The nested object layers of the serialized data exceed the maximum limit.");
|
|
26718
|
+
return;
|
|
26719
|
+
}
|
|
26720
|
+
if (!serializedData) {
|
|
26721
|
+
serializedData = {};
|
|
26722
|
+
}
|
|
26723
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(Object.keys(objectProperty)), _step; !(_step = _iterator()).done;){
|
|
26724
|
+
var key = _step.value;
|
|
26725
|
+
var value = objectProperty[key];
|
|
26726
|
+
if (typeof value === "number" || typeof value === "string" || typeof value === "boolean" || SerializationHelper.checkTypedArray(objectProperty)) {
|
|
26727
|
+
// TODO json 数据避免传 typedArray
|
|
26728
|
+
serializedData[key] = value;
|
|
26729
|
+
} else if (isArray(value)) {
|
|
26730
|
+
if (!serializedData[key]) {
|
|
26731
|
+
serializedData[key] = [];
|
|
26732
|
+
}
|
|
26733
|
+
SerializationHelper.serializeArrayProperty(value, serializedData[key], level + 1);
|
|
26734
|
+
} else if (EffectsObject.is(value)) {
|
|
26735
|
+
// TODO 处理 EffectsObject 递归序列化
|
|
26736
|
+
serializedData[key] = {
|
|
26737
|
+
id: value.getInstanceId()
|
|
26738
|
+
};
|
|
26739
|
+
} else if (isObject(value)) {
|
|
26740
|
+
if (!serializedData[key]) {
|
|
26741
|
+
serializedData[key] = {};
|
|
26742
|
+
}
|
|
26743
|
+
SerializationHelper.serializeObjectProperty(value, serializedData[key], level + 1);
|
|
26744
|
+
}
|
|
26745
|
+
}
|
|
26963
26746
|
};
|
|
26964
|
-
|
|
26965
|
-
|
|
26966
|
-
|
|
26967
|
-
|
|
26968
|
-
if (context) {
|
|
26969
|
-
context.strokeStyle = "rgba(" + r * 255 + ", " + g * 255 + ", " + b * 255 + ", " + a + ")";
|
|
26970
|
-
context.lineWidth = outlineWidth * 2;
|
|
26747
|
+
SerializationHelper.serializeArrayProperty = function serializeArrayProperty(arrayProperty, serializedData, level) {
|
|
26748
|
+
if (level > 14) {
|
|
26749
|
+
console.error("The nested object layers of the serialized data exceed the maximum limit.");
|
|
26750
|
+
return;
|
|
26971
26751
|
}
|
|
26972
|
-
|
|
26973
|
-
|
|
26974
|
-
|
|
26975
|
-
var
|
|
26976
|
-
|
|
26977
|
-
|
|
26978
|
-
|
|
26979
|
-
|
|
26980
|
-
|
|
26981
|
-
|
|
26752
|
+
if (!serializedData) {
|
|
26753
|
+
serializedData = [];
|
|
26754
|
+
}
|
|
26755
|
+
for(var i = 0; i < arrayProperty.length; i++){
|
|
26756
|
+
var value = arrayProperty[i];
|
|
26757
|
+
if (typeof value === "number" || typeof value === "string" || typeof value === "boolean" || SerializationHelper.checkTypedArray(arrayProperty)) {
|
|
26758
|
+
// TODO json 数据避免传 typedArray
|
|
26759
|
+
serializedData[i] = value;
|
|
26760
|
+
} else if (isArray(value)) {
|
|
26761
|
+
if (!serializedData[i]) {
|
|
26762
|
+
serializedData[i] = [];
|
|
26763
|
+
}
|
|
26764
|
+
SerializationHelper.serializeArrayProperty(value, serializedData[i], level + 1);
|
|
26765
|
+
} else if (EffectsObject.is(value)) {
|
|
26766
|
+
// TODO 处理 EffectsObject 递归序列化
|
|
26767
|
+
serializedData[i] = {
|
|
26768
|
+
id: value.getInstanceId()
|
|
26769
|
+
};
|
|
26770
|
+
} else if (isObject(value)) {
|
|
26771
|
+
if (!serializedData[i]) {
|
|
26772
|
+
serializedData[i] = {};
|
|
26773
|
+
}
|
|
26774
|
+
SerializationHelper.serializeObjectProperty(value, serializedData[i], level + 1);
|
|
26775
|
+
}
|
|
26982
26776
|
}
|
|
26983
26777
|
};
|
|
26984
|
-
return
|
|
26778
|
+
return SerializationHelper;
|
|
26985
26779
|
}();
|
|
26986
|
-
applyMixins(TextComponent, [
|
|
26987
|
-
TextComponentBase
|
|
26988
|
-
]);
|
|
26989
|
-
|
|
26990
|
-
// TODO: 注册必须用
|
|
26991
|
-
var TextLoader = /*#__PURE__*/ function(AbstractPlugin) {
|
|
26992
|
-
_inherits(TextLoader, AbstractPlugin);
|
|
26993
|
-
function TextLoader() {
|
|
26994
|
-
return AbstractPlugin.apply(this, arguments);
|
|
26995
|
-
}
|
|
26996
|
-
return TextLoader;
|
|
26997
|
-
}(AbstractPlugin);
|
|
26998
|
-
|
|
26999
|
-
var Asset = /*#__PURE__*/ function(EffectsObject) {
|
|
27000
|
-
_inherits(Asset, EffectsObject);
|
|
27001
|
-
function Asset() {
|
|
27002
|
-
return EffectsObject.apply(this, arguments);
|
|
27003
|
-
}
|
|
27004
|
-
return Asset;
|
|
27005
|
-
}(EffectsObject);
|
|
27006
|
-
|
|
27007
|
-
var BinaryAsset = /*#__PURE__*/ function(EffectsObject) {
|
|
27008
|
-
_inherits(BinaryAsset, EffectsObject);
|
|
27009
|
-
function BinaryAsset() {
|
|
27010
|
-
return EffectsObject.apply(this, arguments);
|
|
27011
|
-
}
|
|
27012
|
-
var _proto = BinaryAsset.prototype;
|
|
27013
|
-
_proto.fromData = function fromData(data) {};
|
|
27014
|
-
return BinaryAsset;
|
|
27015
|
-
}(EffectsObject);
|
|
27016
|
-
__decorate([
|
|
27017
|
-
serialize()
|
|
27018
|
-
], BinaryAsset.prototype, "buffer", void 0);
|
|
27019
|
-
BinaryAsset = __decorate([
|
|
27020
|
-
effectsClass(DataType.BinaryAsset)
|
|
27021
|
-
], BinaryAsset);
|
|
27022
26780
|
|
|
27023
26781
|
/**
|
|
27024
26782
|
* @since 2.0.0
|
|
@@ -27027,9 +26785,10 @@ BinaryAsset = __decorate([
|
|
|
27027
26785
|
this.engine = engine;
|
|
27028
26786
|
}
|
|
27029
26787
|
var _proto = AssetLoader.prototype;
|
|
27030
|
-
_proto.loadGUID = function loadGUID(
|
|
27031
|
-
|
|
27032
|
-
|
|
26788
|
+
_proto.loadGUID = function loadGUID(dataPath) {
|
|
26789
|
+
var guid = dataPath.id;
|
|
26790
|
+
if (!dataPath) {
|
|
26791
|
+
return null;
|
|
27033
26792
|
}
|
|
27034
26793
|
var effectsObjectData = this.findData(guid);
|
|
27035
26794
|
var effectsObject;
|
|
@@ -27064,92 +26823,6 @@ BinaryAsset = __decorate([
|
|
|
27064
26823
|
SerializationHelper.deserialize(effectsObjectData, effectsObject);
|
|
27065
26824
|
return effectsObject;
|
|
27066
26825
|
};
|
|
27067
|
-
// 加载本地文件资产
|
|
27068
|
-
_proto.loadGUIDAsync = function loadGUIDAsync(guid) {
|
|
27069
|
-
var _this = this;
|
|
27070
|
-
return _async_to_generator(function() {
|
|
27071
|
-
var effectsObjectData, effectsObject, classConstructor;
|
|
27072
|
-
return __generator(this, function(_state) {
|
|
27073
|
-
switch(_state.label){
|
|
27074
|
-
case 0:
|
|
27075
|
-
if (_this.engine.objectInstance[guid]) {
|
|
27076
|
-
return [
|
|
27077
|
-
2,
|
|
27078
|
-
_this.engine.objectInstance[guid]
|
|
27079
|
-
];
|
|
27080
|
-
}
|
|
27081
|
-
effectsObjectData = _this.findData(guid);
|
|
27082
|
-
if (!!effectsObjectData) return [
|
|
27083
|
-
3,
|
|
27084
|
-
2
|
|
27085
|
-
];
|
|
27086
|
-
if (!_this.engine.database) {
|
|
27087
|
-
console.error("Object data with uuid: " + guid + " not found.");
|
|
27088
|
-
return [
|
|
27089
|
-
2,
|
|
27090
|
-
undefined
|
|
27091
|
-
];
|
|
27092
|
-
}
|
|
27093
|
-
return [
|
|
27094
|
-
4,
|
|
27095
|
-
_this.engine.database.loadGUID(guid)
|
|
27096
|
-
];
|
|
27097
|
-
case 1:
|
|
27098
|
-
effectsObject = _state.sent();
|
|
27099
|
-
if (!effectsObject) {
|
|
27100
|
-
console.error("Disk data with uuid: " + guid + " not found.");
|
|
27101
|
-
return [
|
|
27102
|
-
2,
|
|
27103
|
-
undefined
|
|
27104
|
-
];
|
|
27105
|
-
}
|
|
27106
|
-
_this.engine.addInstance(effectsObject);
|
|
27107
|
-
return [
|
|
27108
|
-
2,
|
|
27109
|
-
effectsObject
|
|
27110
|
-
];
|
|
27111
|
-
case 2:
|
|
27112
|
-
switch(effectsObjectData.dataType){
|
|
27113
|
-
case DataType.Material:
|
|
27114
|
-
effectsObject = Material.create(_this.engine);
|
|
27115
|
-
break;
|
|
27116
|
-
case DataType.Geometry:
|
|
27117
|
-
effectsObject = Geometry.create(_this.engine);
|
|
27118
|
-
break;
|
|
27119
|
-
case DataType.Texture:
|
|
27120
|
-
effectsObject = Texture.create(_this.engine);
|
|
27121
|
-
break;
|
|
27122
|
-
default:
|
|
27123
|
-
{
|
|
27124
|
-
classConstructor = AssetLoader.getClass(effectsObjectData.dataType);
|
|
27125
|
-
if (classConstructor) {
|
|
27126
|
-
effectsObject = new classConstructor(_this.engine);
|
|
27127
|
-
}
|
|
27128
|
-
}
|
|
27129
|
-
}
|
|
27130
|
-
if (!effectsObject) {
|
|
27131
|
-
console.error("Constructor for DataType: " + effectsObjectData.dataType + " not found.");
|
|
27132
|
-
return [
|
|
27133
|
-
2,
|
|
27134
|
-
undefined
|
|
27135
|
-
];
|
|
27136
|
-
}
|
|
27137
|
-
effectsObject.setInstanceId(effectsObjectData.id);
|
|
27138
|
-
_this.engine.addInstance(effectsObject);
|
|
27139
|
-
return [
|
|
27140
|
-
4,
|
|
27141
|
-
SerializationHelper.deserializeAsync(effectsObjectData, effectsObject)
|
|
27142
|
-
];
|
|
27143
|
-
case 3:
|
|
27144
|
-
_state.sent();
|
|
27145
|
-
return [
|
|
27146
|
-
2,
|
|
27147
|
-
effectsObject
|
|
27148
|
-
];
|
|
27149
|
-
}
|
|
27150
|
-
});
|
|
27151
|
-
})();
|
|
27152
|
-
};
|
|
27153
26826
|
_proto.findData = function findData(uuid) {
|
|
27154
26827
|
return this.engine.jsonSceneData[uuid];
|
|
27155
26828
|
};
|
|
@@ -27499,35 +27172,35 @@ function rotationZYXFromQuat(out, quat) {
|
|
|
27499
27172
|
];
|
|
27500
27173
|
}
|
|
27501
27174
|
}
|
|
27502
|
-
var _obj;
|
|
27503
|
-
var particleOriginTranslateMap = (_obj = {}, _obj[ParticleOrigin.PARTICLE_ORIGIN_CENTER] = [
|
|
27175
|
+
var _obj$1;
|
|
27176
|
+
var particleOriginTranslateMap = (_obj$1 = {}, _obj$1[ParticleOrigin.PARTICLE_ORIGIN_CENTER] = [
|
|
27504
27177
|
0,
|
|
27505
27178
|
0
|
|
27506
|
-
], _obj[ParticleOrigin.PARTICLE_ORIGIN_CENTER_BOTTOM] = [
|
|
27179
|
+
], _obj$1[ParticleOrigin.PARTICLE_ORIGIN_CENTER_BOTTOM] = [
|
|
27507
27180
|
0,
|
|
27508
27181
|
-0.5
|
|
27509
|
-
], _obj[ParticleOrigin.PARTICLE_ORIGIN_CENTER_TOP] = [
|
|
27182
|
+
], _obj$1[ParticleOrigin.PARTICLE_ORIGIN_CENTER_TOP] = [
|
|
27510
27183
|
0,
|
|
27511
27184
|
0.5
|
|
27512
|
-
], _obj[ParticleOrigin.PARTICLE_ORIGIN_LEFT_TOP] = [
|
|
27185
|
+
], _obj$1[ParticleOrigin.PARTICLE_ORIGIN_LEFT_TOP] = [
|
|
27513
27186
|
-0.5,
|
|
27514
27187
|
0.5
|
|
27515
|
-
], _obj[ParticleOrigin.PARTICLE_ORIGIN_LEFT_CENTER] = [
|
|
27188
|
+
], _obj$1[ParticleOrigin.PARTICLE_ORIGIN_LEFT_CENTER] = [
|
|
27516
27189
|
-0.5,
|
|
27517
27190
|
0
|
|
27518
|
-
], _obj[ParticleOrigin.PARTICLE_ORIGIN_LEFT_BOTTOM] = [
|
|
27191
|
+
], _obj$1[ParticleOrigin.PARTICLE_ORIGIN_LEFT_BOTTOM] = [
|
|
27519
27192
|
-0.5,
|
|
27520
27193
|
-0.5
|
|
27521
|
-
], _obj[ParticleOrigin.PARTICLE_ORIGIN_RIGHT_CENTER] = [
|
|
27194
|
+
], _obj$1[ParticleOrigin.PARTICLE_ORIGIN_RIGHT_CENTER] = [
|
|
27522
27195
|
0.5,
|
|
27523
27196
|
0
|
|
27524
|
-
], _obj[ParticleOrigin.PARTICLE_ORIGIN_RIGHT_BOTTOM] = [
|
|
27197
|
+
], _obj$1[ParticleOrigin.PARTICLE_ORIGIN_RIGHT_BOTTOM] = [
|
|
27525
27198
|
0.5,
|
|
27526
27199
|
-0.5
|
|
27527
|
-
], _obj[ParticleOrigin.PARTICLE_ORIGIN_RIGHT_TOP] = [
|
|
27200
|
+
], _obj$1[ParticleOrigin.PARTICLE_ORIGIN_RIGHT_TOP] = [
|
|
27528
27201
|
0.5,
|
|
27529
27202
|
0.5
|
|
27530
|
-
], _obj);
|
|
27203
|
+
], _obj$1);
|
|
27531
27204
|
function getBezierCurveFromHermite(m0, m1, p0, p3) {
|
|
27532
27205
|
var xStart = p0[0];
|
|
27533
27206
|
var yStart = p0[1];
|
|
@@ -27766,28 +27439,6 @@ var refCompositions = new Map();
|
|
|
27766
27439
|
}
|
|
27767
27440
|
}
|
|
27768
27441
|
}
|
|
27769
|
-
// Composition id 转 guid
|
|
27770
|
-
var compositionId = json.compositionId;
|
|
27771
|
-
var compositionIdToGUIDMap = {};
|
|
27772
|
-
for(var _iterator3 = _create_for_of_iterator_helper_loose(json.compositions), _step3; !(_step3 = _iterator3()).done;){
|
|
27773
|
-
var composition = _step3.value;
|
|
27774
|
-
var guid = generateGUID();
|
|
27775
|
-
compositionIdToGUIDMap[composition.id] = guid;
|
|
27776
|
-
if (composition.id === compositionId) {
|
|
27777
|
-
json.compositionId = guid;
|
|
27778
|
-
}
|
|
27779
|
-
composition.id = guid;
|
|
27780
|
-
}
|
|
27781
|
-
// 预合成元素 refId 同步改为生成的合成 guid
|
|
27782
|
-
for(var _iterator4 = _create_for_of_iterator_helper_loose(json.items), _step4; !(_step4 = _iterator4()).done;){
|
|
27783
|
-
var item = _step4.value;
|
|
27784
|
-
if (item.content) {
|
|
27785
|
-
var compositionOptions = item.content.options;
|
|
27786
|
-
if (compositionOptions && compositionOptions.refId !== undefined) {
|
|
27787
|
-
compositionOptions.refId = compositionIdToGUIDMap[compositionOptions.refId];
|
|
27788
|
-
}
|
|
27789
|
-
}
|
|
27790
|
-
}
|
|
27791
27442
|
return json;
|
|
27792
27443
|
}
|
|
27793
27444
|
function version32Migration(json) {
|
|
@@ -27814,21 +27465,68 @@ function version32Migration(json) {
|
|
|
27814
27465
|
itemMap.set(item.id, item);
|
|
27815
27466
|
}
|
|
27816
27467
|
processContent(mainComp);
|
|
27468
|
+
return json;
|
|
27469
|
+
}
|
|
27470
|
+
function version33Migration(json) {
|
|
27817
27471
|
// 老 shape 数据兼容
|
|
27818
|
-
for(var
|
|
27819
|
-
var
|
|
27820
|
-
if (
|
|
27821
|
-
var spriteComponent = componentMap.get(
|
|
27472
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(json.items), _step; !(_step = _iterator()).done;){
|
|
27473
|
+
var item = _step.value;
|
|
27474
|
+
if (item.type === ItemType.sprite) {
|
|
27475
|
+
var spriteComponent = componentMap.get(item.components[0].id);
|
|
27822
27476
|
if (spriteComponent) {
|
|
27823
27477
|
var shape = spriteComponent.renderer.shape;
|
|
27824
27478
|
var shapeData = void 0;
|
|
27825
27479
|
if (Number.isInteger(shape)) {
|
|
27826
27480
|
shapeData = json.shapes[shape];
|
|
27481
|
+
} else {
|
|
27482
|
+
shapeData = shape;
|
|
27827
27483
|
}
|
|
27828
27484
|
spriteComponent.renderer.shape = shapeData;
|
|
27829
27485
|
}
|
|
27830
27486
|
}
|
|
27831
27487
|
}
|
|
27488
|
+
// Composition id 转 guid, Composition 分离 CompositionComponent
|
|
27489
|
+
var compositionId = json.compositionId;
|
|
27490
|
+
var compositionIdToGUIDMap = {};
|
|
27491
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(json.compositions), _step1; !(_step1 = _iterator1()).done;){
|
|
27492
|
+
var composition = _step1.value;
|
|
27493
|
+
var guid = generateGUID();
|
|
27494
|
+
compositionIdToGUIDMap[composition.id] = guid;
|
|
27495
|
+
if (composition.id === compositionId) {
|
|
27496
|
+
json.compositionId = guid;
|
|
27497
|
+
}
|
|
27498
|
+
composition.id = guid;
|
|
27499
|
+
var compositionComponent = {
|
|
27500
|
+
id: generateGUID(),
|
|
27501
|
+
dataType: "CompositionComponent",
|
|
27502
|
+
items: composition.items,
|
|
27503
|
+
timelineAsset: composition.timelineAsset,
|
|
27504
|
+
sceneBindings: composition.sceneBindings,
|
|
27505
|
+
startTime: composition.startTime
|
|
27506
|
+
};
|
|
27507
|
+
//@ts-expect-error
|
|
27508
|
+
composition.timelineAsset = undefined;
|
|
27509
|
+
//@ts-expect-error
|
|
27510
|
+
composition.sceneBindings = undefined;
|
|
27511
|
+
composition.startTime = undefined;
|
|
27512
|
+
//@ts-expect-error
|
|
27513
|
+
composition.components = [
|
|
27514
|
+
{
|
|
27515
|
+
id: compositionComponent.id
|
|
27516
|
+
}
|
|
27517
|
+
];
|
|
27518
|
+
json.components.push(compositionComponent);
|
|
27519
|
+
}
|
|
27520
|
+
// 预合成元素 refId 同步改为生成的合成 guid
|
|
27521
|
+
for(var _iterator2 = _create_for_of_iterator_helper_loose(json.items), _step2; !(_step2 = _iterator2()).done;){
|
|
27522
|
+
var item1 = _step2.value;
|
|
27523
|
+
if (item1.content) {
|
|
27524
|
+
var compositionOptions = item1.content.options;
|
|
27525
|
+
if (compositionOptions && compositionOptions.refId !== undefined) {
|
|
27526
|
+
compositionOptions.refId = compositionIdToGUIDMap[compositionOptions.refId];
|
|
27527
|
+
}
|
|
27528
|
+
}
|
|
27529
|
+
}
|
|
27832
27530
|
return json;
|
|
27833
27531
|
}
|
|
27834
27532
|
function processContent(composition) {
|
|
@@ -28702,7 +28400,7 @@ function getStandardJSON(json) {
|
|
|
28702
28400
|
if (v0.test(json.version)) {
|
|
28703
28401
|
var _exec;
|
|
28704
28402
|
reverseParticle = ((_exec = /^(\d+)/.exec(json.version)) == null ? void 0 : _exec[0]) === "0";
|
|
28705
|
-
return version32Migration(version31Migration(version30Migration(version21Migration(getStandardJSONFromV0(json)))));
|
|
28403
|
+
return version33Migration(version32Migration(version31Migration(version30Migration(version21Migration(getStandardJSONFromV0(json))))));
|
|
28706
28404
|
}
|
|
28707
28405
|
reverseParticle = false;
|
|
28708
28406
|
var vs = standardVersion.exec(json.version) || [];
|
|
@@ -28727,6 +28425,9 @@ function getStandardJSON(json) {
|
|
|
28727
28425
|
if (minorVersion < 3) {
|
|
28728
28426
|
json = version32Migration(json);
|
|
28729
28427
|
}
|
|
28428
|
+
if (minorVersion < 4) {
|
|
28429
|
+
json = version33Migration(json);
|
|
28430
|
+
}
|
|
28730
28431
|
}
|
|
28731
28432
|
return json;
|
|
28732
28433
|
}
|
|
@@ -29010,6 +28711,40 @@ function getStandardItem(item, opt) {
|
|
|
29010
28711
|
}
|
|
29011
28712
|
}
|
|
29012
28713
|
|
|
28714
|
+
var _obj;
|
|
28715
|
+
/**
|
|
28716
|
+
* 机型和渲染等级对应表
|
|
28717
|
+
*
|
|
28718
|
+
* 机型:B-低端机、A-中端机、S-高端机
|
|
28719
|
+
* 渲染等级:B-低、A-中、S-高、A+-中高、B+-全部
|
|
28720
|
+
*
|
|
28721
|
+
* - S(高端机):高、全部、中高
|
|
28722
|
+
* - A(中端机):中、全部、中高
|
|
28723
|
+
* - B(低端机):低、全部
|
|
28724
|
+
* - undefined(全部机型)
|
|
28725
|
+
*/ var renderLevelPassSet = (_obj = {}, _obj[RenderLevel.S] = [
|
|
28726
|
+
RenderLevel.S,
|
|
28727
|
+
RenderLevel.BPlus,
|
|
28728
|
+
RenderLevel.APlus
|
|
28729
|
+
], _obj[RenderLevel.A] = [
|
|
28730
|
+
RenderLevel.A,
|
|
28731
|
+
RenderLevel.BPlus,
|
|
28732
|
+
RenderLevel.APlus
|
|
28733
|
+
], _obj[RenderLevel.B] = [
|
|
28734
|
+
RenderLevel.B,
|
|
28735
|
+
RenderLevel.BPlus
|
|
28736
|
+
], _obj);
|
|
28737
|
+
function passRenderLevel(l, renderLevel) {
|
|
28738
|
+
if (!l || !renderLevel) {
|
|
28739
|
+
return true;
|
|
28740
|
+
}
|
|
28741
|
+
var arr = renderLevelPassSet[renderLevel];
|
|
28742
|
+
if (arr) {
|
|
28743
|
+
return arr.includes(l);
|
|
28744
|
+
}
|
|
28745
|
+
return false;
|
|
28746
|
+
}
|
|
28747
|
+
|
|
29013
28748
|
var Scene;
|
|
29014
28749
|
(function(Scene) {
|
|
29015
28750
|
function isJSONObject(scene) {
|
|
@@ -29909,7 +29644,9 @@ function createTextureOptionsBySource(image, sourceFrom, id) {
|
|
|
29909
29644
|
if (_instanceof1(textureOptions, Texture)) {
|
|
29910
29645
|
this.engine.addInstance(textureOptions);
|
|
29911
29646
|
} else {
|
|
29912
|
-
textureOptions = this.engine.
|
|
29647
|
+
textureOptions = this.engine.findObject({
|
|
29648
|
+
id: scene.textureOptions[i].id
|
|
29649
|
+
});
|
|
29913
29650
|
scene.textureOptions[i] = textureOptions;
|
|
29914
29651
|
}
|
|
29915
29652
|
textureOptions.initialize();
|
|
@@ -31556,8 +31293,18 @@ var FBGeometryDataT = /*#__PURE__*/ function() {
|
|
|
31556
31293
|
_proto.addInstance = function addInstance(effectsObject) {
|
|
31557
31294
|
this.objectInstance[effectsObject.getInstanceId()] = effectsObject;
|
|
31558
31295
|
};
|
|
31559
|
-
|
|
31560
|
-
|
|
31296
|
+
/**
|
|
31297
|
+
* @ignore
|
|
31298
|
+
*/ _proto.findObject = function findObject(guid) {
|
|
31299
|
+
// 编辑器可能传 Class 对象,这边判断处理一下直接返回原对象。
|
|
31300
|
+
if (!(isObject(guid) && guid.constructor === Object)) {
|
|
31301
|
+
return guid;
|
|
31302
|
+
}
|
|
31303
|
+
if (this.objectInstance[guid.id]) {
|
|
31304
|
+
return this.objectInstance[guid.id];
|
|
31305
|
+
}
|
|
31306
|
+
var result = this.assetLoader.loadGUID(guid);
|
|
31307
|
+
return result;
|
|
31561
31308
|
};
|
|
31562
31309
|
_proto.removeInstance = function removeInstance(id) {
|
|
31563
31310
|
delete this.objectInstance[id];
|
|
@@ -31571,6 +31318,10 @@ var FBGeometryDataT = /*#__PURE__*/ function() {
|
|
|
31571
31318
|
}
|
|
31572
31319
|
for(var _iterator1 = _create_for_of_iterator_helper_loose(items), _step1; !(_step1 = _iterator1()).done;){
|
|
31573
31320
|
var vfxItemData = _step1.value;
|
|
31321
|
+
if (!passRenderLevel(vfxItemData.renderLevel, scene.renderLevel)) {
|
|
31322
|
+
vfxItemData.components = [];
|
|
31323
|
+
vfxItemData.type = ItemType.null;
|
|
31324
|
+
}
|
|
31574
31325
|
this.addEffectsObjectData(vfxItemData);
|
|
31575
31326
|
}
|
|
31576
31327
|
for(var _iterator2 = _create_for_of_iterator_helper_loose(materials), _step2; !(_step2 = _iterator2()).done;){
|
|
@@ -31625,45 +31376,20 @@ var FBGeometryDataT = /*#__PURE__*/ function() {
|
|
|
31625
31376
|
return _async_to_generator(function() {
|
|
31626
31377
|
var jsonScene, _iterator, _step, itemData, itemType;
|
|
31627
31378
|
return __generator(this, function(_state) {
|
|
31628
|
-
|
|
31629
|
-
|
|
31630
|
-
|
|
31631
|
-
|
|
31632
|
-
|
|
31633
|
-
|
|
31634
|
-
|
|
31635
|
-
|
|
31636
|
-
|
|
31637
|
-
|
|
31638
|
-
itemData = _step.value;
|
|
31639
|
-
itemType = itemData.type;
|
|
31640
|
-
if (!(itemType === "ECS" || itemType === "camera" || itemType === ItemType.sprite || itemType === ItemType.particle || itemType === ItemType.mesh || itemType === ItemType.skybox || itemType === ItemType.light || itemType === ItemType.tree || itemType === ItemType.interact || itemType === ItemType.camera)) {
|
|
31641
|
-
return [
|
|
31642
|
-
3,
|
|
31643
|
-
3
|
|
31644
|
-
];
|
|
31645
|
-
}
|
|
31646
|
-
if (!_this.database) return [
|
|
31647
|
-
3,
|
|
31648
|
-
3
|
|
31649
|
-
];
|
|
31650
|
-
return [
|
|
31651
|
-
4,
|
|
31652
|
-
_this.assetLoader.loadGUIDAsync(itemData.id)
|
|
31653
|
-
];
|
|
31654
|
-
case 2:
|
|
31655
|
-
_state.sent();
|
|
31656
|
-
_state.label = 3;
|
|
31657
|
-
case 3:
|
|
31658
|
-
return [
|
|
31659
|
-
3,
|
|
31660
|
-
1
|
|
31661
|
-
];
|
|
31662
|
-
case 4:
|
|
31663
|
-
return [
|
|
31664
|
-
2
|
|
31665
|
-
];
|
|
31379
|
+
jsonScene = scene.jsonScene;
|
|
31380
|
+
for(_iterator = _create_for_of_iterator_helper_loose(jsonScene.items); !(_step = _iterator()).done;){
|
|
31381
|
+
itemData = _step.value;
|
|
31382
|
+
itemType = itemData.type;
|
|
31383
|
+
if (!(itemType === "ECS" || itemType === "camera" || itemType === ItemType.sprite || itemType === ItemType.particle || itemType === ItemType.mesh || itemType === ItemType.skybox || itemType === ItemType.light || itemType === ItemType.tree || itemType === ItemType.interact || itemType === ItemType.camera)) {
|
|
31384
|
+
continue;
|
|
31385
|
+
}
|
|
31386
|
+
if (_this.database) {
|
|
31387
|
+
_this.assetLoader.loadGUID(itemData);
|
|
31388
|
+
}
|
|
31666
31389
|
}
|
|
31390
|
+
return [
|
|
31391
|
+
2
|
|
31392
|
+
];
|
|
31667
31393
|
});
|
|
31668
31394
|
})();
|
|
31669
31395
|
};
|
|
@@ -31911,8 +31637,8 @@ registerPlugin("sprite", SpriteLoader, VFXItem);
|
|
|
31911
31637
|
registerPlugin("particle", ParticleLoader, VFXItem);
|
|
31912
31638
|
registerPlugin("cal", CalculateLoader, VFXItem);
|
|
31913
31639
|
registerPlugin("interact", InteractLoader, VFXItem);
|
|
31914
|
-
var version = "2.4.0-beta.
|
|
31640
|
+
var version = "2.4.0-beta.2";
|
|
31915
31641
|
logger.info("Core version: " + version + ".");
|
|
31916
31642
|
|
|
31917
|
-
export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, Asset, AssetLoader, AssetManager, AssetService, BYTES_TYPE_MAP, BaseRenderComponent, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, COMPRESSED_TEXTURE, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, ColorCurve, ColorPropertyPlayableAsset, ColorPropertyTrack, Component, Composition, CompositionComponent, DEFAULT_FONTS, DEFAULT_FPS, Database, DestroyOptions, Downloader, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, EffectComponent, EffectsObject, EffectsPackage, Ellipse, Engine, EventEmitter, EventSystem, Fake3DAnimationMode, Fake3DComponent, FilterMode, Float16ArrayWrapper, FloatPropertyPlayableAsset, FloatPropertyTrack, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, GraphicsPath, HELP_LINK, HitTestType, InteractComponent, InteractLoader, InteractMesh, Item, KTXTexture, LineSegments, LinearValue, MaskMode, MaskProcessor, MaskRefManager, Material, MaterialDataBlock, MaterialRenderType, MaterialTrack, Mesh, MeshCollider, ObjectBindingTrack, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, ParticleTrack, PassTextureCache, PathSegments, PluginSystem, PolyStar, Polygon, PostProcessVolume, PropertyTrack, RENDER_PASS_NAME_PREFIX, RENDER_PREFER_LOOKUP_TEXTURE, RUNTIME_ENV, RandomSetValue, RandomValue, RandomVectorValue, RenderFrame, RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, RenderTargetHandle, RenderTextureFormat, Renderbuffer, Renderer, RendererComponent, RuntimeClip, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0, SEMANTIC_PRE_COLOR_ATTACHMENT_0, SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0, SPRITE_VERTEX_STRIDE, Scene, SemanticMap, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderFactory, ShaderType, ShaderVariant, ShapeComponent, ShapePath, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteLoader, StarType, StaticValue, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, Ticker, TimelineAsset, TimelineClip, TimelinePlayable, TrackAsset, TrackSortWrapper, TrackType, Transform, TransformAnimationPlayable, TransformPlayableAsset, TransformTrack, VFXItem, ValueGetter, Vector2Curve, Vector2PropertyPlayableAsset, Vector2PropertyTrack, Vector4Curve, Vector4PropertyPlayableAsset, Vector4PropertyTrack, addByOrder, addItem, addItemWithOrder, applyMixins, assertExist, asserts, base64ToFile, blend, buildLine, calculateTranslation, canvasPool, closePointEps, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, createCopyShader, createGLContext, createKeyFrameMeta, createShape, createValueGetter, curveEps, decimalEqual, defaultPlugins, deserializeMipmapTexture, earcut, effectsClass, effectsClassStore, enlargeBuffer, ensureFixedNumber, ensureVec3,
|
|
31643
|
+
export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, Asset, AssetLoader, AssetManager, AssetService, BYTES_TYPE_MAP, BaseRenderComponent, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, COMPRESSED_TEXTURE, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, ColorCurve, ColorPropertyPlayableAsset, ColorPropertyTrack, Component, Composition, CompositionComponent, DEFAULT_FONTS, DEFAULT_FPS, Database, DestroyOptions, Downloader, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, EffectComponent, EffectsObject, EffectsPackage, Ellipse, Engine, EventEmitter, EventSystem, Fake3DAnimationMode, Fake3DComponent, FilterMode, Float16ArrayWrapper, FloatPropertyPlayableAsset, FloatPropertyTrack, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, GraphicsPath, HELP_LINK, HitTestType, InteractComponent, InteractLoader, InteractMesh, Item, KTXTexture, LineSegments, LinearValue, MaskMode, MaskProcessor, MaskRefManager, Material, MaterialDataBlock, MaterialRenderType, MaterialTrack, Mesh, MeshCollider, ObjectBindingTrack, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, ParticleTrack, PassTextureCache, PathSegments, PluginSystem, PolyStar, Polygon, PostProcessVolume, PropertyTrack, RENDER_PASS_NAME_PREFIX, RENDER_PREFER_LOOKUP_TEXTURE, RUNTIME_ENV, RandomSetValue, RandomValue, RandomVectorValue, RenderFrame, RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, RenderTargetHandle, RenderTextureFormat, Renderbuffer, Renderer, RendererComponent, RuntimeClip, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0, SEMANTIC_PRE_COLOR_ATTACHMENT_0, SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0, SPRITE_VERTEX_STRIDE, Scene, SemanticMap, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderFactory, ShaderType, ShaderVariant, ShapeComponent, ShapePath, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteLoader, StarType, StaticValue, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, Ticker, TimelineAsset, TimelineClip, TimelinePlayable, TrackAsset, TrackSortWrapper, TrackType, Transform, TransformAnimationPlayable, TransformPlayableAsset, TransformTrack, VFXItem, ValueGetter, Vector2Curve, Vector2PropertyPlayableAsset, Vector2PropertyTrack, Vector4Curve, Vector4PropertyPlayableAsset, Vector4PropertyTrack, addByOrder, addItem, addItemWithOrder, applyMixins, assertExist, asserts, base64ToFile, blend, buildLine, calculateTranslation, canvasPool, closePointEps, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, createCopyShader, createGLContext, createKeyFrameMeta, createShape, createValueGetter, curveEps, decimalEqual, defaultPlugins, deserializeMipmapTexture, earcut, effectsClass, effectsClassStore, enlargeBuffer, ensureFixedNumber, ensureVec3, findPreviousRenderPass, gaussianDown_frag as gaussianDownFrag, gaussianDownHFrag, gaussianDownVFrag, gaussianUpFrag, generateEmptyTypedArray, generateGUID, generateHalfFloatTexture, generateTransparentTexture, generateWhiteTexture, getBackgroundImage, getColorFromGradientStops, getConfig, getDefaultTextureFactory, getGeometryByShape, getGeometryTriangles, getKTXTextureOptions, getKeyFrameMetaByRawValue, getMergedStore, getParticleMeshShader, getPixelRatio, getPreMultiAlpha, getStandardComposition, getStandardImage, getStandardItem, getStandardJSON, getTextureSize, glContext, glType2VertexFormatType, gpuTimer, imageDataFromColor, imageDataFromGradient, initErrors, initGLContext, integrate, interpolateColor, isAlipayMiniApp, isAndroid, isArray, isCanvas, isFunction, isIOS, isIOSByUA, isMiniProgram, isObject, isSimulatorCellPhone, isString, isUniformStruct, isUniformStructArray, isValidFontFamily, isWebGL2, isWechatMiniApp, itemFrag, itemFrame_frag as itemFrameFrag, itemVert, loadAVIFOptional, loadBinary, loadBlob, loadImage, loadMedia, loadVideo, loadWebPOptional, logger, index as math, maxSpriteMeshItemCount, modifyMaxKeyframeShader, nearestPowerOfTwo, noop, normalizeColor, numberToFix, parsePercent$1 as parsePercent, particleFrag, particleOriginTranslateMap$1 as particleOriginTranslateMap, particleUniformTypeMap, particleVert, passRenderLevel, pluginLoaderMap, randomInRange, registerPlugin, removeItem, rotateVec2, screenMeshVert, serialize, setBlendMode, setConfig, setDefaultTextureFactory, setMaskMode, setMaxSpriteMeshItemCount, setRayFromCamera, setSideMode, setSpriteMeshMaxItemCountByGPU, sortByOrder, index$1 as spec, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecFill, vecMulCombine, version, vertexFormatType2GLType };
|
|
31918
31644
|
//# sourceMappingURL=index.mjs.map
|