@galacean/effects-core 2.1.0-beta.0 → 2.1.1
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/README.md +1 -1
- package/dist/components/renderer-component.d.ts +2 -0
- package/dist/components/shape-component.d.ts +2 -261
- package/dist/composition.d.ts +0 -1
- package/dist/events/types.d.ts +7 -0
- package/dist/index.js +282 -395
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +283 -396
- package/dist/index.mjs.map +1 -1
- package/dist/plugins/shape/graphics-path.d.ts +2 -2
- package/dist/plugins/shape/rectangle.d.ts +1 -1
- package/dist/plugins/shape/shape-path.d.ts +2 -2
- package/dist/plugins/sprite/sprite-item.d.ts +1 -1
- package/dist/plugins/timeline/playable-assets/color-property-playable-asset.d.ts +1 -1
- package/dist/plugins/timeline/playable-assets/index.d.ts +2 -0
- package/dist/plugins/timeline/playable-assets/timeline-asset.d.ts +8 -2
- package/dist/plugins/timeline/playable-assets/vector4-property-playable-asset.d.ts +1 -1
- package/dist/render/render-frame.d.ts +5 -2
- package/dist/render/renderer.d.ts +2 -1
- package/package.json +2 -2
package/dist/index.js
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.1.
|
|
6
|
+
* Version: v2.1.1
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
@@ -1094,39 +1094,39 @@ function _inherits(subClass, superClass) {
|
|
|
1094
1094
|
})(MaskMode || (MaskMode = {}));
|
|
1095
1095
|
/**
|
|
1096
1096
|
* 发射器形状
|
|
1097
|
-
*/ var
|
|
1098
|
-
(function(
|
|
1097
|
+
*/ var ParticleEmitterShapeType;
|
|
1098
|
+
(function(ParticleEmitterShapeType) {
|
|
1099
1099
|
/**
|
|
1100
1100
|
* 没有类型
|
|
1101
|
-
*/
|
|
1101
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["NONE"] = 0] = "NONE";
|
|
1102
1102
|
/**
|
|
1103
1103
|
* 圆球
|
|
1104
|
-
*/
|
|
1104
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["SPHERE"] = 1] = "SPHERE";
|
|
1105
1105
|
/**
|
|
1106
1106
|
* 圆锥
|
|
1107
|
-
*/
|
|
1107
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["CONE"] = 2] = "CONE";
|
|
1108
1108
|
/**
|
|
1109
1109
|
* 半球
|
|
1110
|
-
*/
|
|
1110
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["HEMISPHERE"] = 3] = "HEMISPHERE";
|
|
1111
1111
|
/**
|
|
1112
1112
|
* 圆
|
|
1113
|
-
*/
|
|
1113
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["CIRCLE"] = 4] = "CIRCLE";
|
|
1114
1114
|
/**
|
|
1115
1115
|
* 圆环
|
|
1116
|
-
*/
|
|
1116
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["DONUT"] = 5] = "DONUT";
|
|
1117
1117
|
/**
|
|
1118
1118
|
* 矩形
|
|
1119
|
-
*/
|
|
1119
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["RECTANGLE"] = 6] = "RECTANGLE";
|
|
1120
1120
|
/**
|
|
1121
1121
|
* 矩形框
|
|
1122
|
-
*/
|
|
1122
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["RECTANGLE_EDGE"] = 7] = "RECTANGLE_EDGE";
|
|
1123
1123
|
/**
|
|
1124
1124
|
* 直线
|
|
1125
|
-
*/
|
|
1125
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["EDGE"] = 8] = "EDGE";
|
|
1126
1126
|
/**
|
|
1127
1127
|
* 贴图
|
|
1128
|
-
*/
|
|
1129
|
-
})(
|
|
1128
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["TEXTURE"] = 9] = "TEXTURE";
|
|
1129
|
+
})(ParticleEmitterShapeType || (ParticleEmitterShapeType = {}));
|
|
1130
1130
|
/**
|
|
1131
1131
|
* 插件类型
|
|
1132
1132
|
*/ var PluginType;
|
|
@@ -1622,6 +1622,34 @@ var BuiltinObjectGUID = {
|
|
|
1622
1622
|
UnlitShader: "unlit000000000000000000000000000"
|
|
1623
1623
|
};
|
|
1624
1624
|
|
|
1625
|
+
/**
|
|
1626
|
+
* 矢量图形类型
|
|
1627
|
+
*/ var ShapePrimitiveType;
|
|
1628
|
+
(function(ShapePrimitiveType) {
|
|
1629
|
+
/**
|
|
1630
|
+
* 自定义图形
|
|
1631
|
+
*/ ShapePrimitiveType[ShapePrimitiveType["Custom"] = 0] = "Custom";
|
|
1632
|
+
/**
|
|
1633
|
+
* 矩形
|
|
1634
|
+
*/ ShapePrimitiveType[ShapePrimitiveType["Rectangle"] = 1] = "Rectangle";
|
|
1635
|
+
/**
|
|
1636
|
+
* 椭圆
|
|
1637
|
+
*/ ShapePrimitiveType[ShapePrimitiveType["Ellipse"] = 2] = "Ellipse";
|
|
1638
|
+
/**
|
|
1639
|
+
* 多边形
|
|
1640
|
+
*/ ShapePrimitiveType[ShapePrimitiveType["Polygon"] = 3] = "Polygon";
|
|
1641
|
+
/**
|
|
1642
|
+
* 星形
|
|
1643
|
+
*/ ShapePrimitiveType[ShapePrimitiveType["Star"] = 4] = "Star";
|
|
1644
|
+
})(ShapePrimitiveType || (ShapePrimitiveType = {}));
|
|
1645
|
+
|
|
1646
|
+
// 本期无该功能 待补充
|
|
1647
|
+
var ShapeConnectType;
|
|
1648
|
+
(function(ShapeConnectType) {})(ShapeConnectType || (ShapeConnectType = {}));
|
|
1649
|
+
// @待补充
|
|
1650
|
+
var ShapePointType;
|
|
1651
|
+
(function(ShapePointType) {})(ShapePointType || (ShapePointType = {}));
|
|
1652
|
+
|
|
1625
1653
|
/**
|
|
1626
1654
|
* 动态换图类型
|
|
1627
1655
|
* @since 1.1.0
|
|
@@ -1652,6 +1680,7 @@ var DataType;
|
|
|
1652
1680
|
DataType["PostProcessVolume"] = "PostProcessVolume";
|
|
1653
1681
|
DataType["Geometry"] = "Geometry";
|
|
1654
1682
|
DataType["Texture"] = "Texture";
|
|
1683
|
+
DataType["Image"] = "Image";
|
|
1655
1684
|
DataType["AnimationClip"] = "AnimationClip";
|
|
1656
1685
|
DataType["TextComponent"] = "TextComponent";
|
|
1657
1686
|
DataType["BinaryAsset"] = "BinaryAsset";
|
|
@@ -1683,6 +1712,8 @@ var DataType;
|
|
|
1683
1712
|
DataType["VideoComponent"] = "VideoComponent";
|
|
1684
1713
|
DataType["AudioComponent"] = "AudioComponent";
|
|
1685
1714
|
DataType["RichTextComponent"] = "RichTextComponent";
|
|
1715
|
+
DataType["OrientationComponent"] = "OrientationComponent";
|
|
1716
|
+
DataType["ShapeComponent"] = "ShapeComponent";
|
|
1686
1717
|
// Non-EffectObject
|
|
1687
1718
|
DataType["TimelineClip"] = "TimelineClip";
|
|
1688
1719
|
})(DataType || (DataType = {}));
|
|
@@ -1777,7 +1808,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
1777
1808
|
get BlendingMode () { return BlendingMode; },
|
|
1778
1809
|
get SideMode () { return SideMode; },
|
|
1779
1810
|
get MaskMode () { return MaskMode; },
|
|
1780
|
-
get
|
|
1811
|
+
get ParticleEmitterShapeType () { return ParticleEmitterShapeType; },
|
|
1781
1812
|
get PluginType () { return PluginType; },
|
|
1782
1813
|
get InteractType () { return InteractType; },
|
|
1783
1814
|
get InteractBehavior () { return InteractBehavior; },
|
|
@@ -1816,6 +1847,9 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
1816
1847
|
get TextWeight () { return TextWeight; },
|
|
1817
1848
|
get FontStyle () { return FontStyle; },
|
|
1818
1849
|
BuiltinObjectGUID: BuiltinObjectGUID,
|
|
1850
|
+
get ShapePrimitiveType () { return ShapePrimitiveType; },
|
|
1851
|
+
get ShapeConnectType () { return ShapeConnectType; },
|
|
1852
|
+
get ShapePointType () { return ShapePointType; },
|
|
1819
1853
|
get BackgroundType () { return BackgroundType; },
|
|
1820
1854
|
get MultimediaType () { return MultimediaType; },
|
|
1821
1855
|
get DataType () { return DataType; },
|
|
@@ -2136,6 +2170,14 @@ __decorate([
|
|
|
2136
2170
|
Component.prototype.setVFXItem.call(this, item);
|
|
2137
2171
|
this.item.rendererComponents.push(this);
|
|
2138
2172
|
};
|
|
2173
|
+
_proto.onEnable = function onEnable() {
|
|
2174
|
+
var _this_item_composition;
|
|
2175
|
+
(_this_item_composition = this.item.composition) == null ? void 0 : _this_item_composition.renderFrame.addMeshToDefaultRenderPass(this);
|
|
2176
|
+
};
|
|
2177
|
+
_proto.onDisable = function onDisable() {
|
|
2178
|
+
var _this_item_composition;
|
|
2179
|
+
(_this_item_composition = this.item.composition) == null ? void 0 : _this_item_composition.renderFrame.removeMeshFromDefaultRenderPass(this);
|
|
2180
|
+
};
|
|
2139
2181
|
_proto.fromData = function fromData(data) {
|
|
2140
2182
|
Component.prototype.fromData.call(this, data);
|
|
2141
2183
|
};
|
|
@@ -10656,16 +10698,16 @@ var seed$5 = 1;
|
|
|
10656
10698
|
depthAction: exports.TextureLoadAction.clear
|
|
10657
10699
|
};
|
|
10658
10700
|
}
|
|
10659
|
-
|
|
10701
|
+
this.drawObjectPass = new RenderPass(renderer, {
|
|
10702
|
+
name: RENDER_PASS_NAME_PREFIX,
|
|
10703
|
+
priority: RenderPassPriorityNormal,
|
|
10704
|
+
meshOrder: exports.OrderType.ascending,
|
|
10705
|
+
depthStencilAttachment: depthStencilAttachment,
|
|
10706
|
+
attachments: attachments,
|
|
10707
|
+
clearAction: drawObjectPassClearAction
|
|
10708
|
+
});
|
|
10660
10709
|
var renderPasses = [
|
|
10661
|
-
|
|
10662
|
-
name: RENDER_PASS_NAME_PREFIX,
|
|
10663
|
-
priority: RenderPassPriorityNormal,
|
|
10664
|
-
meshOrder: exports.OrderType.ascending,
|
|
10665
|
-
depthStencilAttachment: depthStencilAttachment,
|
|
10666
|
-
attachments: attachments,
|
|
10667
|
-
clearAction: drawObjectPassClearAction
|
|
10668
|
-
})
|
|
10710
|
+
this.drawObjectPass
|
|
10669
10711
|
];
|
|
10670
10712
|
this.setRenderPasses(renderPasses);
|
|
10671
10713
|
if (postProcessingEnabled) {
|
|
@@ -10787,216 +10829,15 @@ var seed$5 = 1;
|
|
|
10787
10829
|
* 根据 Mesh 优先级添加到 RenderPass
|
|
10788
10830
|
* @param mesh - 要添加的 Mesh 对象
|
|
10789
10831
|
*/ _proto.addMeshToDefaultRenderPass = function addMeshToDefaultRenderPass(mesh) {
|
|
10790
|
-
|
|
10791
|
-
return;
|
|
10792
|
-
}
|
|
10793
|
-
this.renderPasses[0].addMesh(mesh);
|
|
10794
|
-
// const renderPasses = this.renderPasses;
|
|
10795
|
-
// const infoMap = this.renderPassInfoMap;
|
|
10796
|
-
// const { priority } = mesh;
|
|
10797
|
-
// for (let i = 1; i < renderPasses.length; i++) {
|
|
10798
|
-
// const renderPass = renderPasses[i - 1];
|
|
10799
|
-
// const info = infoMap.get(renderPasses[i])!;
|
|
10800
|
-
// if (info && info.listStart > priority && (priority > infoMap.get(renderPass)!.listEnd || i === 1)) {
|
|
10801
|
-
// return this.addToRenderPass(renderPass, mesh);
|
|
10802
|
-
// }
|
|
10803
|
-
// }
|
|
10804
|
-
// // TODO: diff逻辑待优化,有时会添加进找不到的元素
|
|
10805
|
-
// let last = renderPasses[renderPasses.length - 1];
|
|
10806
|
-
// // TODO: 是否添加mesh到pass的判断方式需要优化,先通过长度判断是否有postprocess
|
|
10807
|
-
// for (const pass of renderPasses) {
|
|
10808
|
-
// if (!(pass instanceof HQGaussianDownSamplePass
|
|
10809
|
-
// || pass instanceof BloomThresholdPass
|
|
10810
|
-
// || pass instanceof ToneMappingPass
|
|
10811
|
-
// || pass instanceof HQGaussianUpSamplePass
|
|
10812
|
-
// || pass.name === 'mars-final-copy')) {
|
|
10813
|
-
// last = pass;
|
|
10814
|
-
// }
|
|
10815
|
-
// }
|
|
10816
|
-
// // if (priority > infoMap.get(last)!.listStart || renderPasses.length === 1) {
|
|
10817
|
-
// // return this.addToRenderPass(last, mesh);
|
|
10818
|
-
// // }
|
|
10819
|
-
// return this.addToRenderPass(last, mesh);
|
|
10820
|
-
// if (false) {
|
|
10821
|
-
// throw Error('render pass not found');
|
|
10822
|
-
// }
|
|
10832
|
+
this.drawObjectPass.addMesh(mesh);
|
|
10823
10833
|
};
|
|
10824
10834
|
/**
|
|
10825
10835
|
* 把 Mesh 从 RenderPass 中移除,
|
|
10826
10836
|
* 如果 renderPass 中没有 mesh,此 renderPass 会被删除
|
|
10827
10837
|
* @param mesh - 要删除的 Mesh 对象
|
|
10828
10838
|
*/ _proto.removeMeshFromDefaultRenderPass = function removeMeshFromDefaultRenderPass(mesh) {
|
|
10829
|
-
|
|
10830
|
-
// const infoMap = this.renderPassInfoMap;
|
|
10831
|
-
// for (let i = renderPasses.length - 1; i >= 0; i--) {
|
|
10832
|
-
// const renderPass = renderPasses[i];
|
|
10833
|
-
// const info = infoMap.get(renderPass)!;
|
|
10834
|
-
// // 只有渲染场景物体的pass才有 info
|
|
10835
|
-
// if (!info) {
|
|
10836
|
-
// continue;
|
|
10837
|
-
// }
|
|
10838
|
-
// if (info.listStart <= mesh.priority && info.listEnd >= mesh.priority) {
|
|
10839
|
-
// const idx = renderPass.meshes.indexOf(mesh);
|
|
10840
|
-
// if (idx === -1) {
|
|
10841
|
-
// return;
|
|
10842
|
-
// }
|
|
10843
|
-
// // TODO hack: 现在的除了rp1和finalcopy pass,所有renderpass的meshes是一个copy加上一个filter mesh,这里的判断当filter mesh被删除后当前pass需不需要删除,
|
|
10844
|
-
// // 判断需要更鲁棒。
|
|
10845
|
-
// const shouldRestoreRenderPass = idx === 1 && renderPass.meshes[0].name === MARS_COPY_MESH_NAME;
|
|
10846
|
-
// renderPass.removeMesh(mesh);
|
|
10847
|
-
// if (shouldRestoreRenderPass) {
|
|
10848
|
-
// const nextRenderPass = renderPasses[i + 1];
|
|
10849
|
-
// const meshes = renderPass.meshes;
|
|
10850
|
-
// if (!info.intermedia) {
|
|
10851
|
-
// info.preRenderPass?.resetColorAttachments([]);
|
|
10852
|
-
// //this.renderer.extension.resetColorAttachments?.(info.preRenderPass, []);
|
|
10853
|
-
// }
|
|
10854
|
-
// for (let j = 1; j < meshes.length; j++) {
|
|
10855
|
-
// info.preRenderPass?.addMesh(meshes[j]);
|
|
10856
|
-
// }
|
|
10857
|
-
// const cp = renderPass.attachments[0]?.texture;
|
|
10858
|
-
// const keepColor = cp === this.resource.color_a || cp === this.resource.color_b;
|
|
10859
|
-
// renderPass.dispose({
|
|
10860
|
-
// meshes: DestroyOptions.keep,
|
|
10861
|
-
// colorAttachment: keepColor ? RenderPassDestroyAttachmentType.keep : RenderPassDestroyAttachmentType.destroy,
|
|
10862
|
-
// depthStencilAttachment: RenderPassDestroyAttachmentType.keep,
|
|
10863
|
-
// });
|
|
10864
|
-
// removeItem(renderPasses, renderPass);
|
|
10865
|
-
// this.removeRenderPass(renderPass);
|
|
10866
|
-
// infoMap.delete(renderPass);
|
|
10867
|
-
// if (nextRenderPass) {
|
|
10868
|
-
// this.updateRenderInfo(nextRenderPass);
|
|
10869
|
-
// }
|
|
10870
|
-
// if (info.preRenderPass) {
|
|
10871
|
-
// this.updateRenderInfo(info.preRenderPass);
|
|
10872
|
-
// }
|
|
10873
|
-
// if (info.prePasses) {
|
|
10874
|
-
// info.prePasses.forEach(rp => {
|
|
10875
|
-
// this.removeRenderPass(rp.pass);
|
|
10876
|
-
// if (rp?.destroyOptions !== false) {
|
|
10877
|
-
// rp.pass.attachments.forEach(c => {
|
|
10878
|
-
// if (c.texture !== this.resource.color_b || c.texture !== this.resource.color_a) {
|
|
10879
|
-
// c.texture.dispose();
|
|
10880
|
-
// }
|
|
10881
|
-
// });
|
|
10882
|
-
// const options: RenderPassDestroyOptions = {
|
|
10883
|
-
// ...(rp?.destroyOptions ? rp.destroyOptions as RenderPassDestroyOptions : {}),
|
|
10884
|
-
// depthStencilAttachment: RenderPassDestroyAttachmentType.keep,
|
|
10885
|
-
// };
|
|
10886
|
-
// rp.pass.dispose(options);
|
|
10887
|
-
// }
|
|
10888
|
-
// });
|
|
10889
|
-
// }
|
|
10890
|
-
// this.resetRenderPassDefaultAttachment(renderPasses, Math.max(i - 1, 0));
|
|
10891
|
-
// if (renderPasses.length === 1) {
|
|
10892
|
-
// renderPasses[0].resetColorAttachments([]);
|
|
10893
|
-
// //this.renderer.extension.resetColorAttachments?.(renderPasses[0], []);
|
|
10894
|
-
// this.removeRenderPass(this.resource.finalCopyRP);
|
|
10895
|
-
// }
|
|
10896
|
-
// }
|
|
10897
|
-
// return this.resetClearActions();
|
|
10898
|
-
// }
|
|
10899
|
-
// }
|
|
10839
|
+
this.drawObjectPass.removeMesh(mesh);
|
|
10900
10840
|
};
|
|
10901
|
-
// /**
|
|
10902
|
-
// * 将 Mesh 所有在 RenderPass 进行切分
|
|
10903
|
-
// * @param mesh - 目标 Mesh 对象
|
|
10904
|
-
// * @param options - 切分选项,包含 RenderPass 相关的 Attachment 等数据
|
|
10905
|
-
// */
|
|
10906
|
-
// splitDefaultRenderPassByMesh (mesh: Mesh, options: RenderPassSplitOptions): RenderPass {
|
|
10907
|
-
// const index = this.findMeshRenderPassIndex(mesh);
|
|
10908
|
-
// const renderPass = this.renderPasses[index];
|
|
10909
|
-
// if (false) {
|
|
10910
|
-
// if (!renderPass) {
|
|
10911
|
-
// throw Error('RenderPassNotFound');
|
|
10912
|
-
// }
|
|
10913
|
-
// }
|
|
10914
|
-
// this.createResource();
|
|
10915
|
-
// const meshIndex = renderPass.meshes.indexOf(mesh);
|
|
10916
|
-
// const ms0 = renderPass.meshes.slice(0, meshIndex);
|
|
10917
|
-
// const ms1 = renderPass.meshes.slice(meshIndex);
|
|
10918
|
-
// const infoMap = this.renderPassInfoMap;
|
|
10919
|
-
// // TODO 为什么要加这个判断?
|
|
10920
|
-
// // if (renderPass.attachments[0] && this.renderPasses[index + 1] !== this.resource.finalCopyRP) {
|
|
10921
|
-
// // throw Error('not implement');
|
|
10922
|
-
// // } else {
|
|
10923
|
-
// if (!options.attachments?.length) {
|
|
10924
|
-
// throw Error('should include at least one color attachment');
|
|
10925
|
-
// }
|
|
10926
|
-
// const defRPS = this.renderPasses;
|
|
10927
|
-
// const defIndex = defRPS.indexOf(renderPass);
|
|
10928
|
-
// const lastDefRP = defRPS[defIndex - 1];
|
|
10929
|
-
// removeItem(defRPS, renderPass);
|
|
10930
|
-
// const lastInfo = infoMap.get(renderPass);
|
|
10931
|
-
// infoMap.delete(renderPass);
|
|
10932
|
-
// const filter = GPUCapability.getInstance().level === 2 ? glContext.LINEAR : glContext.NEAREST;
|
|
10933
|
-
// const rp0 = new RenderPass({
|
|
10934
|
-
// name: RENDER_PASS_NAME_PREFIX + defIndex,
|
|
10935
|
-
// priority: renderPass.priority,
|
|
10936
|
-
// attachments: [{
|
|
10937
|
-
// texture: {
|
|
10938
|
-
// sourceType: TextureSourceType.framebuffer,
|
|
10939
|
-
// format: glContext.RGBA,
|
|
10940
|
-
// name: 'frame_a',
|
|
10941
|
-
// minFilter: filter,
|
|
10942
|
-
// magFilter: filter,
|
|
10943
|
-
// },
|
|
10944
|
-
// }],
|
|
10945
|
-
// clearAction: renderPass.clearAction || { colorAction: TextureLoadAction.clear },
|
|
10946
|
-
// storeAction: renderPass.storeAction,
|
|
10947
|
-
// depthStencilAttachment: this.resource.depthStencil,
|
|
10948
|
-
// meshes: ms0,
|
|
10949
|
-
// meshOrder: OrderType.ascending,
|
|
10950
|
-
// });
|
|
10951
|
-
// ms1.unshift(this.createCopyMesh());
|
|
10952
|
-
// const renderPasses = this.renderPasses;
|
|
10953
|
-
// renderPasses[index] = rp0;
|
|
10954
|
-
// const prePasses: RenderPass[] = [];
|
|
10955
|
-
// const restMeshes = ms1.slice();
|
|
10956
|
-
// if (options.prePasses) {
|
|
10957
|
-
// options.prePasses.forEach((pass, i) => {
|
|
10958
|
-
// pass.priority = renderPass.priority + 1 + i;
|
|
10959
|
-
// pass.setMeshes(ms1);
|
|
10960
|
-
// prePasses.push(pass);
|
|
10961
|
-
// });
|
|
10962
|
-
// renderPasses.splice(index + 1, 0, ...prePasses);
|
|
10963
|
-
// restMeshes.splice(0, 2);
|
|
10964
|
-
// }
|
|
10965
|
-
// const copyRP = this.resource.finalCopyRP;
|
|
10966
|
-
// if (!renderPasses.includes(copyRP)) {
|
|
10967
|
-
// renderPasses.push(copyRP);
|
|
10968
|
-
// }
|
|
10969
|
-
// // let sourcePass = (prePasses.length && !options.useLastDefaultPassColor) ? prePasses[prePasses.length - 1] : rp0;
|
|
10970
|
-
// const finalFilterPass = prePasses[prePasses.length - 1];
|
|
10971
|
-
// finalFilterPass.initialize(this.renderer);
|
|
10972
|
-
// // 不切RT,接着上一个pass的渲染结果渲染
|
|
10973
|
-
// const rp1 = new RenderPass({
|
|
10974
|
-
// name: RENDER_PASS_NAME_PREFIX + (defIndex + 1),
|
|
10975
|
-
// priority: renderPass.priority + 1 + (options.prePasses?.length || 0),
|
|
10976
|
-
// meshes: restMeshes,
|
|
10977
|
-
// meshOrder: OrderType.ascending,
|
|
10978
|
-
// depthStencilAttachment: this.resource.depthStencil,
|
|
10979
|
-
// storeAction: options.storeAction,
|
|
10980
|
-
// clearAction: {
|
|
10981
|
-
// depthAction: TextureLoadAction.whatever,
|
|
10982
|
-
// stencilAction: TextureLoadAction.whatever,
|
|
10983
|
-
// colorAction: TextureLoadAction.whatever,
|
|
10984
|
-
// },
|
|
10985
|
-
// });
|
|
10986
|
-
// renderPasses.splice(index + 1 + (options.prePasses?.length || 0), 0, rp1);
|
|
10987
|
-
// this.setRenderPasses(renderPasses);
|
|
10988
|
-
// this.updateRenderInfo(finalFilterPass);
|
|
10989
|
-
// this.updateRenderInfo(rp0);
|
|
10990
|
-
// this.updateRenderInfo(rp1);
|
|
10991
|
-
// // 目的是删除滤镜元素后,把之前滤镜用到的prePass给删除,逻辑有些复杂,考虑优化
|
|
10992
|
-
// infoMap.get(rp0)!.prePasses = lastInfo!.prePasses;
|
|
10993
|
-
// prePasses.pop();
|
|
10994
|
-
// infoMap.get(finalFilterPass)!.prePasses = prePasses.map((pass, i) => {
|
|
10995
|
-
// return { pass, destroyOptions: false };
|
|
10996
|
-
// });
|
|
10997
|
-
// this.resetClearActions();
|
|
10998
|
-
// return finalFilterPass;
|
|
10999
|
-
// }
|
|
11000
10841
|
/**
|
|
11001
10842
|
* 销毁 RenderFrame
|
|
11002
10843
|
* @param options - 可以有选择销毁一些对象
|
|
@@ -11116,45 +10957,6 @@ var seed$5 = 1;
|
|
|
11116
10957
|
this.clearAction.colorAction = exports.TextureLoadAction.whatever;
|
|
11117
10958
|
}
|
|
11118
10959
|
};
|
|
11119
|
-
// protected updateRenderInfo (renderPass: RenderPass): RenderPassInfo {
|
|
11120
|
-
// const map = this.renderPassInfoMap;
|
|
11121
|
-
// const passes = this.renderPasses;
|
|
11122
|
-
// let info: RenderPassInfo;
|
|
11123
|
-
// if (!map.has(renderPass)) {
|
|
11124
|
-
// info = {
|
|
11125
|
-
// intermedia: false,
|
|
11126
|
-
// renderPass: renderPass,
|
|
11127
|
-
// listStart: 0,
|
|
11128
|
-
// listEnd: 0,
|
|
11129
|
-
// };
|
|
11130
|
-
// map.set(renderPass, info);
|
|
11131
|
-
// } else {
|
|
11132
|
-
// info = map.get(renderPass)!;
|
|
11133
|
-
// }
|
|
11134
|
-
// info.intermedia = renderPass.attachments.length > 0;
|
|
11135
|
-
// const meshes = renderPass.meshes;
|
|
11136
|
-
// if (meshes[0]) {
|
|
11137
|
-
// info.listStart = (meshes[0].name === MARS_COPY_MESH_NAME ? meshes[1] : meshes[0]).priority;
|
|
11138
|
-
// info.listEnd = meshes[meshes.length - 1].priority;
|
|
11139
|
-
// } else {
|
|
11140
|
-
// info.listStart = 0;
|
|
11141
|
-
// info.listEnd = 0;
|
|
11142
|
-
// }
|
|
11143
|
-
// const index = passes.indexOf(renderPass);
|
|
11144
|
-
// const depthStencilActon = index === 0 ? TextureLoadAction.clear : TextureLoadAction.whatever;
|
|
11145
|
-
// if (index === 0) {
|
|
11146
|
-
// renderPass.clearAction.colorAction = TextureLoadAction.clear;
|
|
11147
|
-
// }
|
|
11148
|
-
// renderPass.clearAction.depthAction = depthStencilActon;
|
|
11149
|
-
// renderPass.clearAction.stencilAction = depthStencilActon;
|
|
11150
|
-
// if (index > -1) {
|
|
11151
|
-
// renderPass.semantics.setSemantic('EDITOR_TRANSFORM', () => this.editorTransform);
|
|
11152
|
-
// } else {
|
|
11153
|
-
// renderPass.semantics.setSemantic('EDITOR_TRANSFORM', undefined);
|
|
11154
|
-
// }
|
|
11155
|
-
// info.preRenderPass = passes[index - 1];
|
|
11156
|
-
// return info;
|
|
11157
|
-
// }
|
|
11158
10960
|
/**
|
|
11159
10961
|
* 设置 RenderPass 数组,直接修改内部的 RenderPass 数组
|
|
11160
10962
|
* @param passes - RenderPass 数组
|
|
@@ -11355,7 +11157,7 @@ var FinalCopyRP = /*#__PURE__*/ function(RenderPass) {
|
|
|
11355
11157
|
var GlobalUniforms = function GlobalUniforms() {
|
|
11356
11158
|
this.floats = {};
|
|
11357
11159
|
this.ints = {};
|
|
11358
|
-
|
|
11160
|
+
this.vector3s = {};
|
|
11359
11161
|
this.vector4s = {};
|
|
11360
11162
|
this.matrices = {};
|
|
11361
11163
|
//...
|
|
@@ -11596,6 +11398,9 @@ var Renderer = /*#__PURE__*/ function() {
|
|
|
11596
11398
|
_proto.setGlobalVector4 = function setGlobalVector4(name, value) {
|
|
11597
11399
|
// OVERRIDE
|
|
11598
11400
|
};
|
|
11401
|
+
_proto.setGlobalVector3 = function setGlobalVector3(name, value) {
|
|
11402
|
+
// OVERRIDE
|
|
11403
|
+
};
|
|
11599
11404
|
_proto.setGlobalMatrix = function setGlobalMatrix(name, value) {
|
|
11600
11405
|
// OVERRIDE
|
|
11601
11406
|
};
|
|
@@ -13261,10 +13066,10 @@ var Vector4Curve = /*#__PURE__*/ function(ValueGetter) {
|
|
|
13261
13066
|
}
|
|
13262
13067
|
var _proto = Vector4Curve.prototype;
|
|
13263
13068
|
_proto.onCreate = function onCreate(arg) {
|
|
13264
|
-
this.xCurve = createValueGetter(arg
|
|
13265
|
-
this.yCurve = createValueGetter(arg
|
|
13266
|
-
this.zCurve = createValueGetter(arg
|
|
13267
|
-
this.wCurve = createValueGetter(arg
|
|
13069
|
+
this.xCurve = createValueGetter(arg[0]);
|
|
13070
|
+
this.yCurve = createValueGetter(arg[1]);
|
|
13071
|
+
this.zCurve = createValueGetter(arg[2]);
|
|
13072
|
+
this.wCurve = createValueGetter(arg[3]);
|
|
13268
13073
|
};
|
|
13269
13074
|
_proto.getValue = function getValue(t) {
|
|
13270
13075
|
var x = this.xCurve.getValue(t);
|
|
@@ -13284,8 +13089,8 @@ var SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0 = "PRE_MAIN_COLOR_0";
|
|
|
13284
13089
|
var SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0 = "PRE_MAIN_COLOR_SIZE_0";
|
|
13285
13090
|
var PLAYER_OPTIONS_ENV_EDITOR = "editor";
|
|
13286
13091
|
var HELP_LINK = {
|
|
13287
|
-
"Item duration can't be less than 0": "https://galacean.
|
|
13288
|
-
"ValueType: 21/22 is not supported": "https://galacean.
|
|
13092
|
+
"Item duration can't be less than 0": "https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#AOnQS",
|
|
13093
|
+
"ValueType: 21/22 is not supported": "https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#smO1b"
|
|
13289
13094
|
};
|
|
13290
13095
|
|
|
13291
13096
|
var _obj$3;
|
|
@@ -13364,10 +13169,10 @@ var ColorCurve = /*#__PURE__*/ function(ValueGetter) {
|
|
|
13364
13169
|
}
|
|
13365
13170
|
var _proto = ColorCurve.prototype;
|
|
13366
13171
|
_proto.onCreate = function onCreate(arg) {
|
|
13367
|
-
this.rCurve = createValueGetter(arg
|
|
13368
|
-
this.gCurve = createValueGetter(arg
|
|
13369
|
-
this.bCurve = createValueGetter(arg
|
|
13370
|
-
this.aCurve = createValueGetter(arg
|
|
13172
|
+
this.rCurve = createValueGetter(arg[0]);
|
|
13173
|
+
this.gCurve = createValueGetter(arg[1]);
|
|
13174
|
+
this.bCurve = createValueGetter(arg[2]);
|
|
13175
|
+
this.aCurve = createValueGetter(arg[3]);
|
|
13371
13176
|
};
|
|
13372
13177
|
_proto.getValue = function getValue(t) {
|
|
13373
13178
|
var r = this.rCurve.getValue(t);
|
|
@@ -15406,7 +15211,7 @@ var PolyStar = /*#__PURE__*/ function(ShapePrimitive) {
|
|
|
15406
15211
|
|
|
15407
15212
|
// const tempPoints = [new Point(), new Point(), new Point(), new Point()];
|
|
15408
15213
|
/**
|
|
15409
|
-
* The `Rectangle` object is an area defined by its position, as indicated by its
|
|
15214
|
+
* The `Rectangle` object is an area defined by its position, as indicated by its upper-left corner
|
|
15410
15215
|
* point (`x`, `y`) and by its `width` and its `height`.
|
|
15411
15216
|
*/ var Rectangle$1 = /*#__PURE__*/ function(ShapePrimitive) {
|
|
15412
15217
|
_inherits(Rectangle, ShapePrimitive);
|
|
@@ -15814,8 +15619,8 @@ var ShapePath = /*#__PURE__*/ function() {
|
|
|
15814
15619
|
};
|
|
15815
15620
|
/**
|
|
15816
15621
|
* Draws a rectangle shape. This method adds a new rectangle path to the current drawing.
|
|
15817
|
-
* @param x - The x-coordinate of the
|
|
15818
|
-
* @param y - The y-coordinate of the
|
|
15622
|
+
* @param x - The x-coordinate of the upper-left corner of the rectangle.
|
|
15623
|
+
* @param y - The y-coordinate of the upper-left corner of the rectangle.
|
|
15819
15624
|
* @param w - The width of the rectangle.
|
|
15820
15625
|
* @param h - The height of the rectangle.
|
|
15821
15626
|
* @param transform - An optional `Matrix` object to apply a transformation to the rectangle.
|
|
@@ -15960,8 +15765,8 @@ var GraphicsPath = /*#__PURE__*/ function() {
|
|
|
15960
15765
|
};
|
|
15961
15766
|
/**
|
|
15962
15767
|
* Draws a rectangle shape. This method adds a new rectangle path to the current drawing.
|
|
15963
|
-
* @param x - The x-coordinate of the
|
|
15964
|
-
* @param y - The y-coordinate of the
|
|
15768
|
+
* @param x - The x-coordinate of the upper-left corner of the rectangle.
|
|
15769
|
+
* @param y - The y-coordinate of the upper-left corner of the rectangle.
|
|
15965
15770
|
* @param w - The width of the rectangle.
|
|
15966
15771
|
* @param h - The height of the rectangle.
|
|
15967
15772
|
* @param transform - An optional `Matrix` object to apply a transformation to the rectangle.
|
|
@@ -16031,7 +15836,7 @@ exports.ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
|
|
|
16031
15836
|
_this.curveValues = [];
|
|
16032
15837
|
_this.animated = true;
|
|
16033
15838
|
_this.vert = "\nprecision highp float;\n\nattribute vec3 aPos;//x y\n\nuniform mat4 effects_MatrixVP;\nuniform mat4 effects_MatrixInvV;\nuniform mat4 effects_ObjectToWorld;\n\nvoid main() {\n vec4 pos = vec4(aPos.xyz, 1.0);\n gl_Position = effects_MatrixVP * effects_ObjectToWorld * pos;\n}\n";
|
|
16034
|
-
_this.frag = "\nprecision highp float;\n\nuniform vec4 _Color;\n\nvoid main() {\n vec4 color = _Color;\n gl_FragColor = color;\n}\n";
|
|
15839
|
+
_this.frag = "\nprecision highp float;\n\nuniform vec4 _Color;\n\nvoid main() {\n vec4 color = _Color;\n color.rgb *= color.a;\n gl_FragColor = color;\n}\n";
|
|
16035
15840
|
if (!_this.geometry) {
|
|
16036
15841
|
_this.geometry = Geometry.create(engine, {
|
|
16037
15842
|
attributes: {
|
|
@@ -16140,7 +15945,7 @@ exports.ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
|
|
|
16140
15945
|
this.path.clear();
|
|
16141
15946
|
var shapeData = data;
|
|
16142
15947
|
switch(shapeData.type){
|
|
16143
|
-
case
|
|
15948
|
+
case ShapePrimitiveType.Custom:
|
|
16144
15949
|
{
|
|
16145
15950
|
var customData = shapeData;
|
|
16146
15951
|
var points = customData.points;
|
|
@@ -16177,28 +15982,28 @@ exports.ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
|
|
|
16177
15982
|
}
|
|
16178
15983
|
break;
|
|
16179
15984
|
}
|
|
16180
|
-
case
|
|
15985
|
+
case ShapePrimitiveType.Ellipse:
|
|
16181
15986
|
{
|
|
16182
15987
|
var ellipseData = shapeData;
|
|
16183
15988
|
this.path.ellipse(0, 0, ellipseData.xRadius, ellipseData.yRadius);
|
|
16184
15989
|
this.setFillColor(ellipseData.fill);
|
|
16185
15990
|
break;
|
|
16186
15991
|
}
|
|
16187
|
-
case
|
|
15992
|
+
case ShapePrimitiveType.Rectangle:
|
|
16188
15993
|
{
|
|
16189
15994
|
var rectangleData = shapeData;
|
|
16190
|
-
this.path.rect(-rectangleData.width / 2, rectangleData.height / 2, rectangleData.width, rectangleData.height);
|
|
15995
|
+
this.path.rect(-rectangleData.width / 2, -rectangleData.height / 2, rectangleData.width, rectangleData.height);
|
|
16191
15996
|
this.setFillColor(rectangleData.fill);
|
|
16192
15997
|
break;
|
|
16193
15998
|
}
|
|
16194
|
-
case
|
|
15999
|
+
case ShapePrimitiveType.Star:
|
|
16195
16000
|
{
|
|
16196
16001
|
var starData = shapeData;
|
|
16197
16002
|
this.path.polyStar(starData.pointCount, starData.outerRadius, starData.innerRadius, starData.outerRoundness, starData.innerRoundness, StarType.Star);
|
|
16198
16003
|
this.setFillColor(starData.fill);
|
|
16199
16004
|
break;
|
|
16200
16005
|
}
|
|
16201
|
-
case
|
|
16006
|
+
case ShapePrimitiveType.Polygon:
|
|
16202
16007
|
{
|
|
16203
16008
|
var polygonData = shapeData;
|
|
16204
16009
|
this.path.polyStar(polygonData.pointCount, polygonData.radius, polygonData.radius, polygonData.roundness, polygonData.roundness, StarType.Polygon);
|
|
@@ -16230,28 +16035,6 @@ exports.ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
|
|
|
16230
16035
|
exports.ShapeComponent = __decorate([
|
|
16231
16036
|
effectsClass("ShapeComponent")
|
|
16232
16037
|
], exports.ShapeComponent);
|
|
16233
|
-
exports.ShapePrimitiveType = void 0;
|
|
16234
|
-
(function(ShapePrimitiveType) {
|
|
16235
|
-
/**
|
|
16236
|
-
* 自定义图形
|
|
16237
|
-
*/ ShapePrimitiveType[ShapePrimitiveType["Custom"] = 0] = "Custom";
|
|
16238
|
-
/**
|
|
16239
|
-
* 矩形
|
|
16240
|
-
*/ ShapePrimitiveType[ShapePrimitiveType["Rectangle"] = 1] = "Rectangle";
|
|
16241
|
-
/**
|
|
16242
|
-
* 椭圆
|
|
16243
|
-
*/ ShapePrimitiveType[ShapePrimitiveType["Ellipse"] = 2] = "Ellipse";
|
|
16244
|
-
/**
|
|
16245
|
-
* 多边形
|
|
16246
|
-
*/ ShapePrimitiveType[ShapePrimitiveType["Polygon"] = 3] = "Polygon";
|
|
16247
|
-
/**
|
|
16248
|
-
* 星形
|
|
16249
|
-
*/ ShapePrimitiveType[ShapePrimitiveType["Star"] = 4] = "Star";
|
|
16250
|
-
})(exports.ShapePrimitiveType || (exports.ShapePrimitiveType = {}));
|
|
16251
|
-
exports.ShapeConnectType = void 0;
|
|
16252
|
-
(function(ShapeConnectType) {})(exports.ShapeConnectType || (exports.ShapeConnectType = {}));
|
|
16253
|
-
exports.ShapePointType = void 0;
|
|
16254
|
-
(function(ShapePointType) {})(exports.ShapePointType || (exports.ShapePointType = {}));
|
|
16255
16038
|
|
|
16256
16039
|
exports.Fake3DComponent = /*#__PURE__*/ function(Component) {
|
|
16257
16040
|
_inherits(Fake3DComponent, Component);
|
|
@@ -16812,18 +16595,18 @@ exports.InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16812
16595
|
this.item.getHitTestParams = this.getHitTestParams;
|
|
16813
16596
|
};
|
|
16814
16597
|
_proto.onDisable = function onDisable() {
|
|
16598
|
+
RendererComponent.prototype.onDisable.call(this);
|
|
16815
16599
|
if (this.item && this.item.composition) {
|
|
16816
|
-
var _this_previewContent;
|
|
16817
16600
|
if (this.duringPlay && !this.item.transform.getValid()) {
|
|
16818
16601
|
this.item.composition.removeInteractiveItem(this.item, this.item.props.content.options.type);
|
|
16819
16602
|
this.duringPlay = false;
|
|
16820
16603
|
}
|
|
16821
16604
|
this.clickable = false;
|
|
16822
|
-
(_this_previewContent = this.previewContent) == null ? void 0 : _this_previewContent.mesh.dispose();
|
|
16823
16605
|
this.endDragTarget();
|
|
16824
16606
|
}
|
|
16825
16607
|
};
|
|
16826
16608
|
_proto.onEnable = function onEnable() {
|
|
16609
|
+
RendererComponent.prototype.onEnable.call(this);
|
|
16827
16610
|
var type = this.interactData.options.type;
|
|
16828
16611
|
if (type === InteractType.CLICK) {
|
|
16829
16612
|
this.clickable = true;
|
|
@@ -16855,10 +16638,14 @@ exports.InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16855
16638
|
};
|
|
16856
16639
|
_proto.render = function render(renderer) {
|
|
16857
16640
|
if (this.previewContent) {
|
|
16641
|
+
this.previewContent.mesh.worldMatrix = this.transform.getWorldMatrix();
|
|
16858
16642
|
this.previewContent.mesh.render(renderer);
|
|
16859
16643
|
}
|
|
16860
16644
|
};
|
|
16861
|
-
_proto.onDestroy = function onDestroy() {
|
|
16645
|
+
_proto.onDestroy = function onDestroy() {
|
|
16646
|
+
var _this_previewContent;
|
|
16647
|
+
(_this_previewContent = this.previewContent) == null ? void 0 : _this_previewContent.mesh.dispose();
|
|
16648
|
+
};
|
|
16862
16649
|
_proto.endDragTarget = function endDragTarget() {
|
|
16863
16650
|
// OVERRIDE
|
|
16864
16651
|
};
|
|
@@ -17216,7 +17003,7 @@ var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
|
|
|
17216
17003
|
// 更新节点时间
|
|
17217
17004
|
for(var _iterator3 = _create_for_of_iterator_helper_loose(this.playables), _step3; !(_step3 = _iterator3()).done;){
|
|
17218
17005
|
var playable = _step3.value;
|
|
17219
|
-
this.updatePlayableTime(playable, dt);
|
|
17006
|
+
this.updatePlayableTime(playable, dt / 1000);
|
|
17220
17007
|
}
|
|
17221
17008
|
};
|
|
17222
17009
|
_proto.connect = function connect(source, sourceOutputPort, destination, destinationInputPort) {
|
|
@@ -18437,7 +18224,7 @@ exports.VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
18437
18224
|
options: {}
|
|
18438
18225
|
};
|
|
18439
18226
|
}
|
|
18440
|
-
if (duration
|
|
18227
|
+
if (duration < 0) {
|
|
18441
18228
|
throw new Error("Item duration can't be less than 0, see " + HELP_LINK["Item duration can't be less than 0"] + ".");
|
|
18442
18229
|
}
|
|
18443
18230
|
this.rendererComponents.length = 0;
|
|
@@ -18798,6 +18585,16 @@ exports.SpriteComponent = /*#__PURE__*/ function(BaseRenderComponent) {
|
|
|
18798
18585
|
}
|
|
18799
18586
|
var life = Math.min(Math.max(time / duration, 0.0), 1.0);
|
|
18800
18587
|
var ta = this.textureSheetAnimation;
|
|
18588
|
+
var video = this.renderer.texture.source.video;
|
|
18589
|
+
if (video) {
|
|
18590
|
+
if (time === 0) {
|
|
18591
|
+
video.pause();
|
|
18592
|
+
} else {
|
|
18593
|
+
video.play().catch(function(e) {
|
|
18594
|
+
_this.engine.renderErrors.add(e);
|
|
18595
|
+
});
|
|
18596
|
+
}
|
|
18597
|
+
}
|
|
18801
18598
|
if (ta) {
|
|
18802
18599
|
var _this_material_getVector4;
|
|
18803
18600
|
var total = ta.total || ta.row * ta.col;
|
|
@@ -18852,21 +18649,20 @@ exports.SpriteComponent = /*#__PURE__*/ function(BaseRenderComponent) {
|
|
|
18852
18649
|
dy
|
|
18853
18650
|
]);
|
|
18854
18651
|
}
|
|
18855
|
-
var video = this.renderer.texture.source.video;
|
|
18856
|
-
if (video) {
|
|
18857
|
-
if (time === 0 || time === this.item.duration) {
|
|
18858
|
-
video.pause();
|
|
18859
|
-
} else {
|
|
18860
|
-
video.play().catch(function(e) {
|
|
18861
|
-
_this.engine.renderErrors.add(e);
|
|
18862
|
-
});
|
|
18863
|
-
}
|
|
18864
|
-
}
|
|
18865
18652
|
};
|
|
18866
18653
|
_proto.onDestroy = function onDestroy() {
|
|
18654
|
+
var textures = this.getTextures();
|
|
18867
18655
|
if (this.item && this.item.composition) {
|
|
18868
|
-
this.item.composition.destroyTextures(
|
|
18656
|
+
this.item.composition.destroyTextures(textures);
|
|
18869
18657
|
}
|
|
18658
|
+
textures.forEach(function(texture) {
|
|
18659
|
+
var source = texture.source;
|
|
18660
|
+
if (source.sourceType === exports.TextureSourceType.video && (source == null ? void 0 : source.video)) {
|
|
18661
|
+
source.video.pause();
|
|
18662
|
+
source.video.src = "";
|
|
18663
|
+
source.video.load();
|
|
18664
|
+
}
|
|
18665
|
+
});
|
|
18870
18666
|
};
|
|
18871
18667
|
_proto.createGeometry = function createGeometry(mode) {
|
|
18872
18668
|
var maxVertex = 12 * this.splits.length;
|
|
@@ -19305,7 +19101,7 @@ var ShapeNone = /*#__PURE__*/ function() {
|
|
|
19305
19101
|
return ShapeNone;
|
|
19306
19102
|
}();
|
|
19307
19103
|
var _obj$2;
|
|
19308
|
-
var map = (_obj$2 = {}, _obj$2[
|
|
19104
|
+
var map = (_obj$2 = {}, _obj$2[ParticleEmitterShapeType.NONE] = ShapeNone, _obj$2[ParticleEmitterShapeType.CONE] = Cone, _obj$2[ParticleEmitterShapeType.SPHERE] = Sphere, _obj$2[ParticleEmitterShapeType.HEMISPHERE] = Hemisphere, _obj$2[ParticleEmitterShapeType.CIRCLE] = Circle, _obj$2[ParticleEmitterShapeType.DONUT] = Donut, _obj$2[ParticleEmitterShapeType.RECTANGLE] = Rectangle, _obj$2[ParticleEmitterShapeType.EDGE] = Edge, _obj$2[ParticleEmitterShapeType.RECTANGLE_EDGE] = RectangleEdge, _obj$2[ParticleEmitterShapeType.TEXTURE] = TextureShape, _obj$2);
|
|
19309
19105
|
function createShape(shapeOptions) {
|
|
19310
19106
|
if (!shapeOptions) {
|
|
19311
19107
|
return new ShapeNone();
|
|
@@ -19322,7 +19118,7 @@ function createShape(shapeOptions) {
|
|
|
19322
19118
|
throw new Error("Invalid shape: " + type + ".");
|
|
19323
19119
|
}
|
|
19324
19120
|
var ctrl = new Ctrl(options);
|
|
19325
|
-
if (type !==
|
|
19121
|
+
if (type !== ParticleEmitterShapeType.NONE) {
|
|
19326
19122
|
var alignSpeedDirection = shapeOptions.alignSpeedDirection, _shapeOptions_upDirection = shapeOptions.upDirection, upDirection = _shapeOptions_upDirection === void 0 ? [
|
|
19327
19123
|
0,
|
|
19328
19124
|
0,
|
|
@@ -24252,9 +24048,9 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
24252
24048
|
var sceneBinding = _step.value;
|
|
24253
24049
|
sceneBinding.key.boundObject = sceneBinding.value;
|
|
24254
24050
|
}
|
|
24255
|
-
//
|
|
24051
|
+
// 为了通过帧对比,需要保证和原有的 update 时机一致。
|
|
24256
24052
|
// 因此这边更新一次对象绑定,后续 timeline playable 中 sort tracks 的排序才能和原先的版本对上。
|
|
24257
|
-
// 如果不需要严格保证和之前的 updata 时机一致,这边的更新和 timeline
|
|
24053
|
+
// 如果不需要严格保证和之前的 updata 时机一致,这边的更新和 timeline asset 中的 sortTracks 都能去掉。
|
|
24258
24054
|
for(var _iterator1 = _create_for_of_iterator_helper_loose(this.timelineAsset.tracks), _step1; !(_step1 = _iterator1()).done;){
|
|
24259
24055
|
var masterTrack = _step1.value;
|
|
24260
24056
|
this.updateTrackAnimatedObject(masterTrack);
|
|
@@ -24358,6 +24154,51 @@ var Vector4PropertyMixerPlayable = /*#__PURE__*/ function(Playable) {
|
|
|
24358
24154
|
return Vector4PropertyMixerPlayable;
|
|
24359
24155
|
}(Playable);
|
|
24360
24156
|
|
|
24157
|
+
var ColorPropertyMixerPlayable = /*#__PURE__*/ function(Playable) {
|
|
24158
|
+
_inherits(ColorPropertyMixerPlayable, Playable);
|
|
24159
|
+
function ColorPropertyMixerPlayable() {
|
|
24160
|
+
var _this;
|
|
24161
|
+
_this = Playable.apply(this, arguments) || this;
|
|
24162
|
+
_this.propertyName = "";
|
|
24163
|
+
return _this;
|
|
24164
|
+
}
|
|
24165
|
+
var _proto = ColorPropertyMixerPlayable.prototype;
|
|
24166
|
+
_proto.processFrame = function processFrame(context) {
|
|
24167
|
+
var boundObject = context.output.getUserData();
|
|
24168
|
+
if (!boundObject) {
|
|
24169
|
+
return;
|
|
24170
|
+
}
|
|
24171
|
+
var hasInput = false;
|
|
24172
|
+
var value = boundObject[this.propertyName];
|
|
24173
|
+
if (!_instanceof1(value, Color)) {
|
|
24174
|
+
return;
|
|
24175
|
+
}
|
|
24176
|
+
value.setZero();
|
|
24177
|
+
// evaluate the curve
|
|
24178
|
+
for(var i = 0; i < this.getInputCount(); i++){
|
|
24179
|
+
var weight = this.getInputWeight(i);
|
|
24180
|
+
if (weight > 0) {
|
|
24181
|
+
var propertyClipPlayable = this.getInput(i);
|
|
24182
|
+
if (!_instanceof1(propertyClipPlayable, PropertyClipPlayable)) {
|
|
24183
|
+
console.error("ColorPropertyMixerPlayable received incompatible input");
|
|
24184
|
+
continue;
|
|
24185
|
+
}
|
|
24186
|
+
var curveValue = propertyClipPlayable.value;
|
|
24187
|
+
value.r += curveValue.r * weight;
|
|
24188
|
+
value.g += curveValue.g * weight;
|
|
24189
|
+
value.b += curveValue.b * weight;
|
|
24190
|
+
value.a += curveValue.a * weight;
|
|
24191
|
+
hasInput = true;
|
|
24192
|
+
}
|
|
24193
|
+
}
|
|
24194
|
+
// set value
|
|
24195
|
+
if (hasInput) {
|
|
24196
|
+
boundObject[this.propertyName] = value;
|
|
24197
|
+
}
|
|
24198
|
+
};
|
|
24199
|
+
return ColorPropertyMixerPlayable;
|
|
24200
|
+
}(Playable);
|
|
24201
|
+
|
|
24361
24202
|
var PropertyTrack = /*#__PURE__*/ function(TrackAsset) {
|
|
24362
24203
|
_inherits(PropertyTrack, TrackAsset);
|
|
24363
24204
|
function PropertyTrack() {
|
|
@@ -24517,7 +24358,7 @@ exports.ColorPropertyTrack = /*#__PURE__*/ function(PropertyTrack) {
|
|
|
24517
24358
|
}
|
|
24518
24359
|
var _proto = ColorPropertyTrack.prototype;
|
|
24519
24360
|
_proto.createTrackMixer = function createTrackMixer(graph) {
|
|
24520
|
-
var mixer = new
|
|
24361
|
+
var mixer = new ColorPropertyMixerPlayable(graph);
|
|
24521
24362
|
var propertyNames = this.propertyNames;
|
|
24522
24363
|
if (propertyNames.length > 0) {
|
|
24523
24364
|
var propertyName = propertyNames[propertyNames.length - 1];
|
|
@@ -24531,6 +24372,27 @@ exports.ColorPropertyTrack = __decorate([
|
|
|
24531
24372
|
effectsClass(DataType.ColorPropertyTrack)
|
|
24532
24373
|
], exports.ColorPropertyTrack);
|
|
24533
24374
|
|
|
24375
|
+
exports.ColorPropertyPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
24376
|
+
_inherits(ColorPropertyPlayableAsset, PlayableAsset);
|
|
24377
|
+
function ColorPropertyPlayableAsset() {
|
|
24378
|
+
return PlayableAsset.apply(this, arguments);
|
|
24379
|
+
}
|
|
24380
|
+
var _proto = ColorPropertyPlayableAsset.prototype;
|
|
24381
|
+
_proto.createPlayable = function createPlayable(graph) {
|
|
24382
|
+
var clipPlayable = new PropertyClipPlayable(graph);
|
|
24383
|
+
clipPlayable.curve = createValueGetter(this.curveData);
|
|
24384
|
+
clipPlayable.value = clipPlayable.curve.getValue(0);
|
|
24385
|
+
return clipPlayable;
|
|
24386
|
+
};
|
|
24387
|
+
return ColorPropertyPlayableAsset;
|
|
24388
|
+
}(PlayableAsset);
|
|
24389
|
+
__decorate([
|
|
24390
|
+
serialize()
|
|
24391
|
+
], exports.ColorPropertyPlayableAsset.prototype, "curveData", void 0);
|
|
24392
|
+
exports.ColorPropertyPlayableAsset = __decorate([
|
|
24393
|
+
effectsClass(DataType.ColorPropertyPlayableAsset)
|
|
24394
|
+
], exports.ColorPropertyPlayableAsset);
|
|
24395
|
+
|
|
24534
24396
|
exports.FloatPropertyPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
24535
24397
|
_inherits(FloatPropertyPlayableAsset, PlayableAsset);
|
|
24536
24398
|
function FloatPropertyPlayableAsset() {
|
|
@@ -24590,6 +24452,7 @@ exports.TimelineAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
|
24590
24452
|
var _this;
|
|
24591
24453
|
_this = PlayableAsset.apply(this, arguments) || this;
|
|
24592
24454
|
_this.tracks = [];
|
|
24455
|
+
_this.cacheFlattenedTracks = null;
|
|
24593
24456
|
return _this;
|
|
24594
24457
|
}
|
|
24595
24458
|
var _proto = TimelineAsset.prototype;
|
|
@@ -24602,16 +24465,62 @@ exports.TimelineAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
|
24602
24465
|
track.create(this);
|
|
24603
24466
|
}
|
|
24604
24467
|
}
|
|
24605
|
-
|
|
24468
|
+
this.sortTracks(this.tracks);
|
|
24469
|
+
timelinePlayable.compileTracks(graph, this.flattenedTracks);
|
|
24606
24470
|
return timelinePlayable;
|
|
24607
24471
|
};
|
|
24608
24472
|
_proto.createTrack = function createTrack(classConstructor, parent, name) {
|
|
24609
24473
|
var newTrack = new classConstructor(this.engine);
|
|
24610
24474
|
newTrack.name = name ? name : classConstructor.name;
|
|
24611
24475
|
parent.addChild(newTrack);
|
|
24476
|
+
this.invalidate();
|
|
24612
24477
|
return newTrack;
|
|
24613
24478
|
};
|
|
24479
|
+
/**
|
|
24480
|
+
* Invalidates the asset, called when tracks data changed
|
|
24481
|
+
*/ _proto.invalidate = function invalidate() {
|
|
24482
|
+
this.cacheFlattenedTracks = null;
|
|
24483
|
+
};
|
|
24484
|
+
_proto.addSubTracksRecursive = function addSubTracksRecursive(track, allTracks) {
|
|
24485
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(track.getChildTracks()), _step; !(_step = _iterator()).done;){
|
|
24486
|
+
var subTrack = _step.value;
|
|
24487
|
+
allTracks.push(subTrack);
|
|
24488
|
+
}
|
|
24489
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(track.getChildTracks()), _step1; !(_step1 = _iterator1()).done;){
|
|
24490
|
+
var subTrack1 = _step1.value;
|
|
24491
|
+
this.addSubTracksRecursive(subTrack1, allTracks);
|
|
24492
|
+
}
|
|
24493
|
+
};
|
|
24494
|
+
_proto.sortTracks = function sortTracks(tracks) {
|
|
24495
|
+
var sortedTracks = [];
|
|
24496
|
+
for(var i = 0; i < tracks.length; i++){
|
|
24497
|
+
sortedTracks.push(new TrackSortWrapper(tracks[i], i));
|
|
24498
|
+
}
|
|
24499
|
+
sortedTracks.sort(compareTracks);
|
|
24500
|
+
tracks.length = 0;
|
|
24501
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(sortedTracks), _step; !(_step = _iterator()).done;){
|
|
24502
|
+
var trackWrapper = _step.value;
|
|
24503
|
+
tracks.push(trackWrapper.track);
|
|
24504
|
+
}
|
|
24505
|
+
};
|
|
24614
24506
|
_proto.fromData = function fromData(data) {};
|
|
24507
|
+
_create_class(TimelineAsset, [
|
|
24508
|
+
{
|
|
24509
|
+
key: "flattenedTracks",
|
|
24510
|
+
get: function get() {
|
|
24511
|
+
if (!this.cacheFlattenedTracks) {
|
|
24512
|
+
this.cacheFlattenedTracks = [];
|
|
24513
|
+
// flatten track tree
|
|
24514
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(this.tracks), _step; !(_step = _iterator()).done;){
|
|
24515
|
+
var masterTrack = _step.value;
|
|
24516
|
+
this.cacheFlattenedTracks.push(masterTrack);
|
|
24517
|
+
this.addSubTracksRecursive(masterTrack, this.cacheFlattenedTracks);
|
|
24518
|
+
}
|
|
24519
|
+
}
|
|
24520
|
+
return this.cacheFlattenedTracks;
|
|
24521
|
+
}
|
|
24522
|
+
}
|
|
24523
|
+
]);
|
|
24615
24524
|
return TimelineAsset;
|
|
24616
24525
|
}(PlayableAsset);
|
|
24617
24526
|
__decorate([
|
|
@@ -24644,18 +24553,11 @@ var TimelinePlayable = /*#__PURE__*/ function(Playable) {
|
|
|
24644
24553
|
}
|
|
24645
24554
|
};
|
|
24646
24555
|
_proto.compileTracks = function compileTracks(graph, tracks) {
|
|
24647
|
-
|
|
24648
|
-
var outputTrack = [];
|
|
24649
|
-
// flatten track tree
|
|
24650
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(tracks), _step; !(_step = _iterator()).done;){
|
|
24651
|
-
var masterTrack = _step.value;
|
|
24652
|
-
outputTrack.push(masterTrack);
|
|
24653
|
-
this.addSubTracksRecursive(masterTrack, outputTrack);
|
|
24654
|
-
}
|
|
24556
|
+
var outputTrack = tracks;
|
|
24655
24557
|
// map for searching track instance with track asset guid
|
|
24656
24558
|
var trackInstanceMap = {};
|
|
24657
|
-
for(var
|
|
24658
|
-
var track =
|
|
24559
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(outputTrack), _step; !(_step = _iterator()).done;){
|
|
24560
|
+
var track = _step.value;
|
|
24659
24561
|
// create track mixer and track output
|
|
24660
24562
|
var trackMixPlayable = track.createPlayableGraph(graph, this.clips);
|
|
24661
24563
|
this.addInput(trackMixPlayable, 0);
|
|
@@ -24671,11 +24573,11 @@ var TimelinePlayable = /*#__PURE__*/ function(Playable) {
|
|
|
24671
24573
|
}
|
|
24672
24574
|
}
|
|
24673
24575
|
// build trackInstance tree
|
|
24674
|
-
for(var
|
|
24675
|
-
var track1 =
|
|
24576
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(outputTrack), _step1; !(_step1 = _iterator1()).done;){
|
|
24577
|
+
var track1 = _step1.value;
|
|
24676
24578
|
var trackInstance1 = trackInstanceMap[track1.getInstanceId()];
|
|
24677
|
-
for(var
|
|
24678
|
-
var child =
|
|
24579
|
+
for(var _iterator2 = _create_for_of_iterator_helper_loose(track1.getChildTracks()), _step2; !(_step2 = _iterator2()).done;){
|
|
24580
|
+
var child = _step2.value;
|
|
24679
24581
|
var childTrackInstance = trackInstanceMap[child.getInstanceId()];
|
|
24680
24582
|
trackInstance1.addChild(childTrackInstance);
|
|
24681
24583
|
}
|
|
@@ -24692,28 +24594,6 @@ var TimelinePlayable = /*#__PURE__*/ function(Playable) {
|
|
|
24692
24594
|
this.updateTrackAnimatedObject(trackInstance.children);
|
|
24693
24595
|
}
|
|
24694
24596
|
};
|
|
24695
|
-
_proto.sortTracks = function sortTracks(tracks) {
|
|
24696
|
-
var sortedTracks = [];
|
|
24697
|
-
for(var i = 0; i < tracks.length; i++){
|
|
24698
|
-
sortedTracks.push(new TrackSortWrapper(tracks[i], i));
|
|
24699
|
-
}
|
|
24700
|
-
sortedTracks.sort(compareTracks);
|
|
24701
|
-
tracks.length = 0;
|
|
24702
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(sortedTracks), _step; !(_step = _iterator()).done;){
|
|
24703
|
-
var trackWrapper = _step.value;
|
|
24704
|
-
tracks.push(trackWrapper.track);
|
|
24705
|
-
}
|
|
24706
|
-
};
|
|
24707
|
-
_proto.addSubTracksRecursive = function addSubTracksRecursive(track, allTracks) {
|
|
24708
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(track.getChildTracks()), _step; !(_step = _iterator()).done;){
|
|
24709
|
-
var subTrack = _step.value;
|
|
24710
|
-
allTracks.push(subTrack);
|
|
24711
|
-
}
|
|
24712
|
-
for(var _iterator1 = _create_for_of_iterator_helper_loose(track.getChildTracks()), _step1; !(_step1 = _iterator1()).done;){
|
|
24713
|
-
var subTrack1 = _step1.value;
|
|
24714
|
-
this.addSubTracksRecursive(subTrack1, allTracks);
|
|
24715
|
-
}
|
|
24716
|
-
};
|
|
24717
24597
|
return TimelinePlayable;
|
|
24718
24598
|
}(Playable);
|
|
24719
24599
|
var TrackSortWrapper = function TrackSortWrapper(track, originalIndex) {
|
|
@@ -24735,6 +24615,27 @@ function compareTracks(a, b) {
|
|
|
24735
24615
|
}
|
|
24736
24616
|
}
|
|
24737
24617
|
|
|
24618
|
+
exports.Vector4PropertyPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
24619
|
+
_inherits(Vector4PropertyPlayableAsset, PlayableAsset);
|
|
24620
|
+
function Vector4PropertyPlayableAsset() {
|
|
24621
|
+
return PlayableAsset.apply(this, arguments);
|
|
24622
|
+
}
|
|
24623
|
+
var _proto = Vector4PropertyPlayableAsset.prototype;
|
|
24624
|
+
_proto.createPlayable = function createPlayable(graph) {
|
|
24625
|
+
var clipPlayable = new PropertyClipPlayable(graph);
|
|
24626
|
+
clipPlayable.curve = createValueGetter(this.curveData);
|
|
24627
|
+
clipPlayable.value = clipPlayable.curve.getValue(0);
|
|
24628
|
+
return clipPlayable;
|
|
24629
|
+
};
|
|
24630
|
+
return Vector4PropertyPlayableAsset;
|
|
24631
|
+
}(PlayableAsset);
|
|
24632
|
+
__decorate([
|
|
24633
|
+
serialize()
|
|
24634
|
+
], exports.Vector4PropertyPlayableAsset.prototype, "curveData", void 0);
|
|
24635
|
+
exports.Vector4PropertyPlayableAsset = __decorate([
|
|
24636
|
+
effectsClass("Vector4PropertyPlayableAsset")
|
|
24637
|
+
], exports.Vector4PropertyPlayableAsset);
|
|
24638
|
+
|
|
24738
24639
|
exports.ObjectBindingTrack = /*#__PURE__*/ function(TrackAsset1) {
|
|
24739
24640
|
_inherits(ObjectBindingTrack, TrackAsset1);
|
|
24740
24641
|
function ObjectBindingTrack() {
|
|
@@ -24772,7 +24673,7 @@ var TextLayout = /*#__PURE__*/ function() {
|
|
|
24772
24673
|
function TextLayout(options) {
|
|
24773
24674
|
this.width = 0;
|
|
24774
24675
|
this.height = 0;
|
|
24775
|
-
var _options_textHeight = options.textHeight, textHeight = _options_textHeight === void 0 ? 100 : _options_textHeight, _options_textWidth = options.textWidth, textWidth = _options_textWidth === void 0 ? 100 : _options_textWidth, _options_textOverflow = options.textOverflow, textOverflow = _options_textOverflow === void 0 ? TextOverflow.display : _options_textOverflow, _options_textBaseline = options.textBaseline, textBaseline = _options_textBaseline === void 0 ? TextBaseline.top : _options_textBaseline, _options_textAlign = options.textAlign, textAlign = _options_textAlign === void 0 ? TextAlignment.left : _options_textAlign,
|
|
24676
|
+
var _options_textHeight = options.textHeight, textHeight = _options_textHeight === void 0 ? 100 : _options_textHeight, _options_textWidth = options.textWidth, textWidth = _options_textWidth === void 0 ? 100 : _options_textWidth, _options_textOverflow = options.textOverflow, textOverflow = _options_textOverflow === void 0 ? TextOverflow.display : _options_textOverflow, _options_textBaseline = options.textBaseline, textBaseline = _options_textBaseline === void 0 ? TextBaseline.top : _options_textBaseline, _options_textAlign = options.textAlign, textAlign = _options_textAlign === void 0 ? TextAlignment.left : _options_textAlign, _options_text = options.text, text = _options_text === void 0 ? " " : _options_text, _options_letterSpace = options.letterSpace, letterSpace = _options_letterSpace === void 0 ? 0 : _options_letterSpace, _options_autoWidth = options.autoWidth, autoWidth = _options_autoWidth === void 0 ? false : _options_autoWidth, fontSize = options.fontSize, _options_lineHeight = options.lineHeight, lineHeight = _options_lineHeight === void 0 ? fontSize : _options_lineHeight;
|
|
24776
24677
|
var tempWidth = fontSize + letterSpace;
|
|
24777
24678
|
this.autoWidth = autoWidth;
|
|
24778
24679
|
this.maxTextWidth = text.length * tempWidth;
|
|
@@ -26667,13 +26568,13 @@ function getStandardParticleContent(particle) {
|
|
|
26667
26568
|
var options = particle.options;
|
|
26668
26569
|
var transform = particle.transform;
|
|
26669
26570
|
var shape = {
|
|
26670
|
-
type:
|
|
26571
|
+
type: ParticleEmitterShapeType.NONE
|
|
26671
26572
|
};
|
|
26672
26573
|
if (particle.shape) {
|
|
26673
26574
|
var _particle_shape_shape;
|
|
26674
26575
|
var shapeType = (_particle_shape_shape = particle.shape.shape) == null ? void 0 : _particle_shape_shape.replace(/([A-Z])/g, "_$1").toUpperCase().replace(/^_/, "");
|
|
26675
26576
|
shape = _extends({}, particle.shape, {
|
|
26676
|
-
type:
|
|
26577
|
+
type: ParticleEmitterShapeType[shapeType]
|
|
26677
26578
|
});
|
|
26678
26579
|
if (particle.shape.upDirection) {
|
|
26679
26580
|
var _particle_shape_upDirection = particle.shape.upDirection, x = _particle_shape_upDirection[0], y = _particle_shape_upDirection[1], z = _particle_shape_upDirection[2];
|
|
@@ -28537,7 +28438,8 @@ var listOrder = 0;
|
|
|
28537
28438
|
var itemProps = sourceItemData;
|
|
28538
28439
|
if (passRenderLevel(sourceItemData.renderLevel, this.renderLevel)) {
|
|
28539
28440
|
itemProps.listIndex = listOrder++;
|
|
28540
|
-
if (itemProps.type === ItemType.sprite || itemProps.type === ItemType.particle || itemProps.type === ItemType.spine
|
|
28441
|
+
if (itemProps.type === ItemType.sprite || itemProps.type === ItemType.particle || itemProps.type === ItemType.spine || //@ts-expect-error
|
|
28442
|
+
itemProps.type === ItemType.shape) {
|
|
28541
28443
|
for(var _iterator2 = _create_for_of_iterator_helper_loose(itemProps.components), _step2; !(_step2 = _iterator2()).done;){
|
|
28542
28444
|
var componentPath = _step2.value;
|
|
28543
28445
|
var componentData = componentMap[componentPath.id];
|
|
@@ -28573,10 +28475,10 @@ var listOrder = 0;
|
|
|
28573
28475
|
if (Number.isInteger(shape)) {
|
|
28574
28476
|
var _this_jsonScene;
|
|
28575
28477
|
shapeData = (_this_jsonScene = this.jsonScene) == null ? void 0 : _this_jsonScene.shapes[shape];
|
|
28576
|
-
} else {
|
|
28478
|
+
} else if (shape) {
|
|
28577
28479
|
shapeData = shape;
|
|
28578
28480
|
}
|
|
28579
|
-
if (shapeData !== undefined) {
|
|
28481
|
+
if (shapeData !== undefined && !("aPoint" in shapeData && "index" in shapeData)) {
|
|
28580
28482
|
// @ts-expect-error 类型转换问题
|
|
28581
28483
|
renderContent.renderer.shape = getGeometryByShape(shapeData, split);
|
|
28582
28484
|
}
|
|
@@ -28945,16 +28847,15 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28945
28847
|
if (pause) {
|
|
28946
28848
|
this.resume();
|
|
28947
28849
|
}
|
|
28948
|
-
if (!this.rootComposition.isStartCalled) {
|
|
28949
|
-
this.rootComposition.onStart();
|
|
28950
|
-
this.rootComposition.isStartCalled = true;
|
|
28951
|
-
}
|
|
28952
28850
|
this.setSpeed(1);
|
|
28953
28851
|
this.forwardTime(time + this.startTime);
|
|
28954
28852
|
this.setSpeed(speed);
|
|
28955
28853
|
if (pause) {
|
|
28956
28854
|
this.pause();
|
|
28957
28855
|
}
|
|
28856
|
+
this.emit("goto", {
|
|
28857
|
+
time: time
|
|
28858
|
+
});
|
|
28958
28859
|
};
|
|
28959
28860
|
_proto.addItem = function addItem(item) {
|
|
28960
28861
|
this.items.push(item);
|
|
@@ -28986,30 +28887,16 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28986
28887
|
_proto.prepareRender = function prepareRender() {
|
|
28987
28888
|
var _this = this;
|
|
28988
28889
|
var frame = this.renderFrame;
|
|
28989
|
-
frame._renderPasses[0].meshes.length = 0;
|
|
28990
28890
|
this.postLoaders.length = 0;
|
|
28991
28891
|
this.pluginSystem.plugins.forEach(function(loader) {
|
|
28992
28892
|
if (loader.prepareRenderFrame(_this, frame)) {
|
|
28993
28893
|
_this.postLoaders.push(loader);
|
|
28994
28894
|
}
|
|
28995
28895
|
});
|
|
28996
|
-
this.gatherRendererComponent(this.rootItem, frame);
|
|
28997
28896
|
this.postLoaders.forEach(function(loader) {
|
|
28998
28897
|
return loader.postProcessFrame(_this, frame);
|
|
28999
28898
|
});
|
|
29000
28899
|
};
|
|
29001
|
-
_proto.gatherRendererComponent = function gatherRendererComponent(vfxItem, renderFrame) {
|
|
29002
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(vfxItem.rendererComponents), _step; !(_step = _iterator()).done;){
|
|
29003
|
-
var rendererComponent = _step.value;
|
|
29004
|
-
if (rendererComponent.isActiveAndEnabled) {
|
|
29005
|
-
renderFrame.addMeshToDefaultRenderPass(rendererComponent);
|
|
29006
|
-
}
|
|
29007
|
-
}
|
|
29008
|
-
for(var _iterator1 = _create_for_of_iterator_helper_loose(vfxItem.children), _step1; !(_step1 = _iterator1()).done;){
|
|
29009
|
-
var item = _step1.value;
|
|
29010
|
-
this.gatherRendererComponent(item, renderFrame);
|
|
29011
|
-
}
|
|
29012
|
-
};
|
|
29013
28900
|
/**
|
|
29014
28901
|
* 合成更新,针对所有 item 的更新
|
|
29015
28902
|
* @param deltaTime - 更新的时间步长
|
|
@@ -29132,7 +29019,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
29132
29019
|
* 更新主合成组件
|
|
29133
29020
|
*/ _proto.updateRootComposition = function updateRootComposition(deltaTime) {
|
|
29134
29021
|
if (this.rootComposition.isActiveAndEnabled) {
|
|
29135
|
-
var localTime = this.time + deltaTime - this.rootItem.start;
|
|
29022
|
+
var localTime = parseFloat((this.time + deltaTime - this.rootItem.start).toFixed(3));
|
|
29136
29023
|
var isEnded = false;
|
|
29137
29024
|
var duration = this.rootItem.duration;
|
|
29138
29025
|
var endBehavior = this.rootItem.endBehavior;
|
|
@@ -31494,7 +31381,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem, true);
|
|
|
31494
31381
|
registerPlugin("particle", ParticleLoader, exports.VFXItem, true);
|
|
31495
31382
|
registerPlugin("cal", CalculateLoader, exports.VFXItem, true);
|
|
31496
31383
|
registerPlugin("interact", InteractLoader, exports.VFXItem, true);
|
|
31497
|
-
var version = "2.1.
|
|
31384
|
+
var version = "2.1.1";
|
|
31498
31385
|
logger.info("Core version: " + version + ".");
|
|
31499
31386
|
|
|
31500
31387
|
exports.AbstractPlugin = AbstractPlugin;
|