@galacean/effects-threejs 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/index.js +283 -396
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/dist/index.mjs +284 -397
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Description: Galacean Effects runtime threejs plugin 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
|
import * as THREE from 'three';
|
|
@@ -1092,39 +1092,39 @@ function _inherits(subClass, superClass) {
|
|
|
1092
1092
|
})(MaskMode || (MaskMode = {}));
|
|
1093
1093
|
/**
|
|
1094
1094
|
* 发射器形状
|
|
1095
|
-
*/ var
|
|
1096
|
-
(function(
|
|
1095
|
+
*/ var ParticleEmitterShapeType;
|
|
1096
|
+
(function(ParticleEmitterShapeType) {
|
|
1097
1097
|
/**
|
|
1098
1098
|
* 没有类型
|
|
1099
|
-
*/
|
|
1099
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["NONE"] = 0] = "NONE";
|
|
1100
1100
|
/**
|
|
1101
1101
|
* 圆球
|
|
1102
|
-
*/
|
|
1102
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["SPHERE"] = 1] = "SPHERE";
|
|
1103
1103
|
/**
|
|
1104
1104
|
* 圆锥
|
|
1105
|
-
*/
|
|
1105
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["CONE"] = 2] = "CONE";
|
|
1106
1106
|
/**
|
|
1107
1107
|
* 半球
|
|
1108
|
-
*/
|
|
1108
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["HEMISPHERE"] = 3] = "HEMISPHERE";
|
|
1109
1109
|
/**
|
|
1110
1110
|
* 圆
|
|
1111
|
-
*/
|
|
1111
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["CIRCLE"] = 4] = "CIRCLE";
|
|
1112
1112
|
/**
|
|
1113
1113
|
* 圆环
|
|
1114
|
-
*/
|
|
1114
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["DONUT"] = 5] = "DONUT";
|
|
1115
1115
|
/**
|
|
1116
1116
|
* 矩形
|
|
1117
|
-
*/
|
|
1117
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["RECTANGLE"] = 6] = "RECTANGLE";
|
|
1118
1118
|
/**
|
|
1119
1119
|
* 矩形框
|
|
1120
|
-
*/
|
|
1120
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["RECTANGLE_EDGE"] = 7] = "RECTANGLE_EDGE";
|
|
1121
1121
|
/**
|
|
1122
1122
|
* 直线
|
|
1123
|
-
*/
|
|
1123
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["EDGE"] = 8] = "EDGE";
|
|
1124
1124
|
/**
|
|
1125
1125
|
* 贴图
|
|
1126
|
-
*/
|
|
1127
|
-
})(
|
|
1126
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["TEXTURE"] = 9] = "TEXTURE";
|
|
1127
|
+
})(ParticleEmitterShapeType || (ParticleEmitterShapeType = {}));
|
|
1128
1128
|
/**
|
|
1129
1129
|
* 插件类型
|
|
1130
1130
|
*/ var PluginType;
|
|
@@ -1620,6 +1620,34 @@ var BuiltinObjectGUID = {
|
|
|
1620
1620
|
UnlitShader: "unlit000000000000000000000000000"
|
|
1621
1621
|
};
|
|
1622
1622
|
|
|
1623
|
+
/**
|
|
1624
|
+
* 矢量图形类型
|
|
1625
|
+
*/ var ShapePrimitiveType;
|
|
1626
|
+
(function(ShapePrimitiveType) {
|
|
1627
|
+
/**
|
|
1628
|
+
* 自定义图形
|
|
1629
|
+
*/ ShapePrimitiveType[ShapePrimitiveType["Custom"] = 0] = "Custom";
|
|
1630
|
+
/**
|
|
1631
|
+
* 矩形
|
|
1632
|
+
*/ ShapePrimitiveType[ShapePrimitiveType["Rectangle"] = 1] = "Rectangle";
|
|
1633
|
+
/**
|
|
1634
|
+
* 椭圆
|
|
1635
|
+
*/ ShapePrimitiveType[ShapePrimitiveType["Ellipse"] = 2] = "Ellipse";
|
|
1636
|
+
/**
|
|
1637
|
+
* 多边形
|
|
1638
|
+
*/ ShapePrimitiveType[ShapePrimitiveType["Polygon"] = 3] = "Polygon";
|
|
1639
|
+
/**
|
|
1640
|
+
* 星形
|
|
1641
|
+
*/ ShapePrimitiveType[ShapePrimitiveType["Star"] = 4] = "Star";
|
|
1642
|
+
})(ShapePrimitiveType || (ShapePrimitiveType = {}));
|
|
1643
|
+
|
|
1644
|
+
// 本期无该功能 待补充
|
|
1645
|
+
var ShapeConnectType;
|
|
1646
|
+
(function(ShapeConnectType) {})(ShapeConnectType || (ShapeConnectType = {}));
|
|
1647
|
+
// @待补充
|
|
1648
|
+
var ShapePointType;
|
|
1649
|
+
(function(ShapePointType) {})(ShapePointType || (ShapePointType = {}));
|
|
1650
|
+
|
|
1623
1651
|
/**
|
|
1624
1652
|
* 动态换图类型
|
|
1625
1653
|
* @since 1.1.0
|
|
@@ -1650,6 +1678,7 @@ var DataType;
|
|
|
1650
1678
|
DataType["PostProcessVolume"] = "PostProcessVolume";
|
|
1651
1679
|
DataType["Geometry"] = "Geometry";
|
|
1652
1680
|
DataType["Texture"] = "Texture";
|
|
1681
|
+
DataType["Image"] = "Image";
|
|
1653
1682
|
DataType["AnimationClip"] = "AnimationClip";
|
|
1654
1683
|
DataType["TextComponent"] = "TextComponent";
|
|
1655
1684
|
DataType["BinaryAsset"] = "BinaryAsset";
|
|
@@ -1681,6 +1710,8 @@ var DataType;
|
|
|
1681
1710
|
DataType["VideoComponent"] = "VideoComponent";
|
|
1682
1711
|
DataType["AudioComponent"] = "AudioComponent";
|
|
1683
1712
|
DataType["RichTextComponent"] = "RichTextComponent";
|
|
1713
|
+
DataType["OrientationComponent"] = "OrientationComponent";
|
|
1714
|
+
DataType["ShapeComponent"] = "ShapeComponent";
|
|
1684
1715
|
// Non-EffectObject
|
|
1685
1716
|
DataType["TimelineClip"] = "TimelineClip";
|
|
1686
1717
|
})(DataType || (DataType = {}));
|
|
@@ -1775,7 +1806,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
1775
1806
|
get BlendingMode () { return BlendingMode; },
|
|
1776
1807
|
get SideMode () { return SideMode; },
|
|
1777
1808
|
get MaskMode () { return MaskMode; },
|
|
1778
|
-
get
|
|
1809
|
+
get ParticleEmitterShapeType () { return ParticleEmitterShapeType; },
|
|
1779
1810
|
get PluginType () { return PluginType; },
|
|
1780
1811
|
get InteractType () { return InteractType; },
|
|
1781
1812
|
get InteractBehavior () { return InteractBehavior; },
|
|
@@ -1814,6 +1845,9 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
1814
1845
|
get TextWeight () { return TextWeight; },
|
|
1815
1846
|
get FontStyle () { return FontStyle; },
|
|
1816
1847
|
BuiltinObjectGUID: BuiltinObjectGUID,
|
|
1848
|
+
get ShapePrimitiveType () { return ShapePrimitiveType; },
|
|
1849
|
+
get ShapeConnectType () { return ShapeConnectType; },
|
|
1850
|
+
get ShapePointType () { return ShapePointType; },
|
|
1817
1851
|
get BackgroundType () { return BackgroundType; },
|
|
1818
1852
|
get MultimediaType () { return MultimediaType; },
|
|
1819
1853
|
get DataType () { return DataType; },
|
|
@@ -2134,6 +2168,14 @@ __decorate([
|
|
|
2134
2168
|
Component.prototype.setVFXItem.call(this, item);
|
|
2135
2169
|
this.item.rendererComponents.push(this);
|
|
2136
2170
|
};
|
|
2171
|
+
_proto.onEnable = function onEnable() {
|
|
2172
|
+
var _this_item_composition;
|
|
2173
|
+
(_this_item_composition = this.item.composition) == null ? void 0 : _this_item_composition.renderFrame.addMeshToDefaultRenderPass(this);
|
|
2174
|
+
};
|
|
2175
|
+
_proto.onDisable = function onDisable() {
|
|
2176
|
+
var _this_item_composition;
|
|
2177
|
+
(_this_item_composition = this.item.composition) == null ? void 0 : _this_item_composition.renderFrame.removeMeshFromDefaultRenderPass(this);
|
|
2178
|
+
};
|
|
2137
2179
|
_proto.fromData = function fromData(data) {
|
|
2138
2180
|
Component.prototype.fromData.call(this, data);
|
|
2139
2181
|
};
|
|
@@ -10654,16 +10696,16 @@ var seed$6 = 1;
|
|
|
10654
10696
|
depthAction: TextureLoadAction.clear
|
|
10655
10697
|
};
|
|
10656
10698
|
}
|
|
10657
|
-
|
|
10699
|
+
this.drawObjectPass = new RenderPass(renderer, {
|
|
10700
|
+
name: RENDER_PASS_NAME_PREFIX,
|
|
10701
|
+
priority: RenderPassPriorityNormal,
|
|
10702
|
+
meshOrder: OrderType.ascending,
|
|
10703
|
+
depthStencilAttachment: depthStencilAttachment,
|
|
10704
|
+
attachments: attachments,
|
|
10705
|
+
clearAction: drawObjectPassClearAction
|
|
10706
|
+
});
|
|
10658
10707
|
var renderPasses = [
|
|
10659
|
-
|
|
10660
|
-
name: RENDER_PASS_NAME_PREFIX,
|
|
10661
|
-
priority: RenderPassPriorityNormal,
|
|
10662
|
-
meshOrder: OrderType.ascending,
|
|
10663
|
-
depthStencilAttachment: depthStencilAttachment,
|
|
10664
|
-
attachments: attachments,
|
|
10665
|
-
clearAction: drawObjectPassClearAction
|
|
10666
|
-
})
|
|
10708
|
+
this.drawObjectPass
|
|
10667
10709
|
];
|
|
10668
10710
|
this.setRenderPasses(renderPasses);
|
|
10669
10711
|
if (postProcessingEnabled) {
|
|
@@ -10785,216 +10827,15 @@ var seed$6 = 1;
|
|
|
10785
10827
|
* 根据 Mesh 优先级添加到 RenderPass
|
|
10786
10828
|
* @param mesh - 要添加的 Mesh 对象
|
|
10787
10829
|
*/ _proto.addMeshToDefaultRenderPass = function addMeshToDefaultRenderPass(mesh) {
|
|
10788
|
-
|
|
10789
|
-
return;
|
|
10790
|
-
}
|
|
10791
|
-
this.renderPasses[0].addMesh(mesh);
|
|
10792
|
-
// const renderPasses = this.renderPasses;
|
|
10793
|
-
// const infoMap = this.renderPassInfoMap;
|
|
10794
|
-
// const { priority } = mesh;
|
|
10795
|
-
// for (let i = 1; i < renderPasses.length; i++) {
|
|
10796
|
-
// const renderPass = renderPasses[i - 1];
|
|
10797
|
-
// const info = infoMap.get(renderPasses[i])!;
|
|
10798
|
-
// if (info && info.listStart > priority && (priority > infoMap.get(renderPass)!.listEnd || i === 1)) {
|
|
10799
|
-
// return this.addToRenderPass(renderPass, mesh);
|
|
10800
|
-
// }
|
|
10801
|
-
// }
|
|
10802
|
-
// // TODO: diff逻辑待优化,有时会添加进找不到的元素
|
|
10803
|
-
// let last = renderPasses[renderPasses.length - 1];
|
|
10804
|
-
// // TODO: 是否添加mesh到pass的判断方式需要优化,先通过长度判断是否有postprocess
|
|
10805
|
-
// for (const pass of renderPasses) {
|
|
10806
|
-
// if (!(pass instanceof HQGaussianDownSamplePass
|
|
10807
|
-
// || pass instanceof BloomThresholdPass
|
|
10808
|
-
// || pass instanceof ToneMappingPass
|
|
10809
|
-
// || pass instanceof HQGaussianUpSamplePass
|
|
10810
|
-
// || pass.name === 'mars-final-copy')) {
|
|
10811
|
-
// last = pass;
|
|
10812
|
-
// }
|
|
10813
|
-
// }
|
|
10814
|
-
// // if (priority > infoMap.get(last)!.listStart || renderPasses.length === 1) {
|
|
10815
|
-
// // return this.addToRenderPass(last, mesh);
|
|
10816
|
-
// // }
|
|
10817
|
-
// return this.addToRenderPass(last, mesh);
|
|
10818
|
-
// if (false) {
|
|
10819
|
-
// throw Error('render pass not found');
|
|
10820
|
-
// }
|
|
10830
|
+
this.drawObjectPass.addMesh(mesh);
|
|
10821
10831
|
};
|
|
10822
10832
|
/**
|
|
10823
10833
|
* 把 Mesh 从 RenderPass 中移除,
|
|
10824
10834
|
* 如果 renderPass 中没有 mesh,此 renderPass 会被删除
|
|
10825
10835
|
* @param mesh - 要删除的 Mesh 对象
|
|
10826
10836
|
*/ _proto.removeMeshFromDefaultRenderPass = function removeMeshFromDefaultRenderPass(mesh) {
|
|
10827
|
-
|
|
10828
|
-
// const infoMap = this.renderPassInfoMap;
|
|
10829
|
-
// for (let i = renderPasses.length - 1; i >= 0; i--) {
|
|
10830
|
-
// const renderPass = renderPasses[i];
|
|
10831
|
-
// const info = infoMap.get(renderPass)!;
|
|
10832
|
-
// // 只有渲染场景物体的pass才有 info
|
|
10833
|
-
// if (!info) {
|
|
10834
|
-
// continue;
|
|
10835
|
-
// }
|
|
10836
|
-
// if (info.listStart <= mesh.priority && info.listEnd >= mesh.priority) {
|
|
10837
|
-
// const idx = renderPass.meshes.indexOf(mesh);
|
|
10838
|
-
// if (idx === -1) {
|
|
10839
|
-
// return;
|
|
10840
|
-
// }
|
|
10841
|
-
// // TODO hack: 现在的除了rp1和finalcopy pass,所有renderpass的meshes是一个copy加上一个filter mesh,这里的判断当filter mesh被删除后当前pass需不需要删除,
|
|
10842
|
-
// // 判断需要更鲁棒。
|
|
10843
|
-
// const shouldRestoreRenderPass = idx === 1 && renderPass.meshes[0].name === MARS_COPY_MESH_NAME;
|
|
10844
|
-
// renderPass.removeMesh(mesh);
|
|
10845
|
-
// if (shouldRestoreRenderPass) {
|
|
10846
|
-
// const nextRenderPass = renderPasses[i + 1];
|
|
10847
|
-
// const meshes = renderPass.meshes;
|
|
10848
|
-
// if (!info.intermedia) {
|
|
10849
|
-
// info.preRenderPass?.resetColorAttachments([]);
|
|
10850
|
-
// //this.renderer.extension.resetColorAttachments?.(info.preRenderPass, []);
|
|
10851
|
-
// }
|
|
10852
|
-
// for (let j = 1; j < meshes.length; j++) {
|
|
10853
|
-
// info.preRenderPass?.addMesh(meshes[j]);
|
|
10854
|
-
// }
|
|
10855
|
-
// const cp = renderPass.attachments[0]?.texture;
|
|
10856
|
-
// const keepColor = cp === this.resource.color_a || cp === this.resource.color_b;
|
|
10857
|
-
// renderPass.dispose({
|
|
10858
|
-
// meshes: DestroyOptions.keep,
|
|
10859
|
-
// colorAttachment: keepColor ? RenderPassDestroyAttachmentType.keep : RenderPassDestroyAttachmentType.destroy,
|
|
10860
|
-
// depthStencilAttachment: RenderPassDestroyAttachmentType.keep,
|
|
10861
|
-
// });
|
|
10862
|
-
// removeItem(renderPasses, renderPass);
|
|
10863
|
-
// this.removeRenderPass(renderPass);
|
|
10864
|
-
// infoMap.delete(renderPass);
|
|
10865
|
-
// if (nextRenderPass) {
|
|
10866
|
-
// this.updateRenderInfo(nextRenderPass);
|
|
10867
|
-
// }
|
|
10868
|
-
// if (info.preRenderPass) {
|
|
10869
|
-
// this.updateRenderInfo(info.preRenderPass);
|
|
10870
|
-
// }
|
|
10871
|
-
// if (info.prePasses) {
|
|
10872
|
-
// info.prePasses.forEach(rp => {
|
|
10873
|
-
// this.removeRenderPass(rp.pass);
|
|
10874
|
-
// if (rp?.destroyOptions !== false) {
|
|
10875
|
-
// rp.pass.attachments.forEach(c => {
|
|
10876
|
-
// if (c.texture !== this.resource.color_b || c.texture !== this.resource.color_a) {
|
|
10877
|
-
// c.texture.dispose();
|
|
10878
|
-
// }
|
|
10879
|
-
// });
|
|
10880
|
-
// const options: RenderPassDestroyOptions = {
|
|
10881
|
-
// ...(rp?.destroyOptions ? rp.destroyOptions as RenderPassDestroyOptions : {}),
|
|
10882
|
-
// depthStencilAttachment: RenderPassDestroyAttachmentType.keep,
|
|
10883
|
-
// };
|
|
10884
|
-
// rp.pass.dispose(options);
|
|
10885
|
-
// }
|
|
10886
|
-
// });
|
|
10887
|
-
// }
|
|
10888
|
-
// this.resetRenderPassDefaultAttachment(renderPasses, Math.max(i - 1, 0));
|
|
10889
|
-
// if (renderPasses.length === 1) {
|
|
10890
|
-
// renderPasses[0].resetColorAttachments([]);
|
|
10891
|
-
// //this.renderer.extension.resetColorAttachments?.(renderPasses[0], []);
|
|
10892
|
-
// this.removeRenderPass(this.resource.finalCopyRP);
|
|
10893
|
-
// }
|
|
10894
|
-
// }
|
|
10895
|
-
// return this.resetClearActions();
|
|
10896
|
-
// }
|
|
10897
|
-
// }
|
|
10837
|
+
this.drawObjectPass.removeMesh(mesh);
|
|
10898
10838
|
};
|
|
10899
|
-
// /**
|
|
10900
|
-
// * 将 Mesh 所有在 RenderPass 进行切分
|
|
10901
|
-
// * @param mesh - 目标 Mesh 对象
|
|
10902
|
-
// * @param options - 切分选项,包含 RenderPass 相关的 Attachment 等数据
|
|
10903
|
-
// */
|
|
10904
|
-
// splitDefaultRenderPassByMesh (mesh: Mesh, options: RenderPassSplitOptions): RenderPass {
|
|
10905
|
-
// const index = this.findMeshRenderPassIndex(mesh);
|
|
10906
|
-
// const renderPass = this.renderPasses[index];
|
|
10907
|
-
// if (false) {
|
|
10908
|
-
// if (!renderPass) {
|
|
10909
|
-
// throw Error('RenderPassNotFound');
|
|
10910
|
-
// }
|
|
10911
|
-
// }
|
|
10912
|
-
// this.createResource();
|
|
10913
|
-
// const meshIndex = renderPass.meshes.indexOf(mesh);
|
|
10914
|
-
// const ms0 = renderPass.meshes.slice(0, meshIndex);
|
|
10915
|
-
// const ms1 = renderPass.meshes.slice(meshIndex);
|
|
10916
|
-
// const infoMap = this.renderPassInfoMap;
|
|
10917
|
-
// // TODO 为什么要加这个判断?
|
|
10918
|
-
// // if (renderPass.attachments[0] && this.renderPasses[index + 1] !== this.resource.finalCopyRP) {
|
|
10919
|
-
// // throw Error('not implement');
|
|
10920
|
-
// // } else {
|
|
10921
|
-
// if (!options.attachments?.length) {
|
|
10922
|
-
// throw Error('should include at least one color attachment');
|
|
10923
|
-
// }
|
|
10924
|
-
// const defRPS = this.renderPasses;
|
|
10925
|
-
// const defIndex = defRPS.indexOf(renderPass);
|
|
10926
|
-
// const lastDefRP = defRPS[defIndex - 1];
|
|
10927
|
-
// removeItem(defRPS, renderPass);
|
|
10928
|
-
// const lastInfo = infoMap.get(renderPass);
|
|
10929
|
-
// infoMap.delete(renderPass);
|
|
10930
|
-
// const filter = GPUCapability.getInstance().level === 2 ? glContext.LINEAR : glContext.NEAREST;
|
|
10931
|
-
// const rp0 = new RenderPass({
|
|
10932
|
-
// name: RENDER_PASS_NAME_PREFIX + defIndex,
|
|
10933
|
-
// priority: renderPass.priority,
|
|
10934
|
-
// attachments: [{
|
|
10935
|
-
// texture: {
|
|
10936
|
-
// sourceType: TextureSourceType.framebuffer,
|
|
10937
|
-
// format: glContext.RGBA,
|
|
10938
|
-
// name: 'frame_a',
|
|
10939
|
-
// minFilter: filter,
|
|
10940
|
-
// magFilter: filter,
|
|
10941
|
-
// },
|
|
10942
|
-
// }],
|
|
10943
|
-
// clearAction: renderPass.clearAction || { colorAction: TextureLoadAction.clear },
|
|
10944
|
-
// storeAction: renderPass.storeAction,
|
|
10945
|
-
// depthStencilAttachment: this.resource.depthStencil,
|
|
10946
|
-
// meshes: ms0,
|
|
10947
|
-
// meshOrder: OrderType.ascending,
|
|
10948
|
-
// });
|
|
10949
|
-
// ms1.unshift(this.createCopyMesh());
|
|
10950
|
-
// const renderPasses = this.renderPasses;
|
|
10951
|
-
// renderPasses[index] = rp0;
|
|
10952
|
-
// const prePasses: RenderPass[] = [];
|
|
10953
|
-
// const restMeshes = ms1.slice();
|
|
10954
|
-
// if (options.prePasses) {
|
|
10955
|
-
// options.prePasses.forEach((pass, i) => {
|
|
10956
|
-
// pass.priority = renderPass.priority + 1 + i;
|
|
10957
|
-
// pass.setMeshes(ms1);
|
|
10958
|
-
// prePasses.push(pass);
|
|
10959
|
-
// });
|
|
10960
|
-
// renderPasses.splice(index + 1, 0, ...prePasses);
|
|
10961
|
-
// restMeshes.splice(0, 2);
|
|
10962
|
-
// }
|
|
10963
|
-
// const copyRP = this.resource.finalCopyRP;
|
|
10964
|
-
// if (!renderPasses.includes(copyRP)) {
|
|
10965
|
-
// renderPasses.push(copyRP);
|
|
10966
|
-
// }
|
|
10967
|
-
// // let sourcePass = (prePasses.length && !options.useLastDefaultPassColor) ? prePasses[prePasses.length - 1] : rp0;
|
|
10968
|
-
// const finalFilterPass = prePasses[prePasses.length - 1];
|
|
10969
|
-
// finalFilterPass.initialize(this.renderer);
|
|
10970
|
-
// // 不切RT,接着上一个pass的渲染结果渲染
|
|
10971
|
-
// const rp1 = new RenderPass({
|
|
10972
|
-
// name: RENDER_PASS_NAME_PREFIX + (defIndex + 1),
|
|
10973
|
-
// priority: renderPass.priority + 1 + (options.prePasses?.length || 0),
|
|
10974
|
-
// meshes: restMeshes,
|
|
10975
|
-
// meshOrder: OrderType.ascending,
|
|
10976
|
-
// depthStencilAttachment: this.resource.depthStencil,
|
|
10977
|
-
// storeAction: options.storeAction,
|
|
10978
|
-
// clearAction: {
|
|
10979
|
-
// depthAction: TextureLoadAction.whatever,
|
|
10980
|
-
// stencilAction: TextureLoadAction.whatever,
|
|
10981
|
-
// colorAction: TextureLoadAction.whatever,
|
|
10982
|
-
// },
|
|
10983
|
-
// });
|
|
10984
|
-
// renderPasses.splice(index + 1 + (options.prePasses?.length || 0), 0, rp1);
|
|
10985
|
-
// this.setRenderPasses(renderPasses);
|
|
10986
|
-
// this.updateRenderInfo(finalFilterPass);
|
|
10987
|
-
// this.updateRenderInfo(rp0);
|
|
10988
|
-
// this.updateRenderInfo(rp1);
|
|
10989
|
-
// // 目的是删除滤镜元素后,把之前滤镜用到的prePass给删除,逻辑有些复杂,考虑优化
|
|
10990
|
-
// infoMap.get(rp0)!.prePasses = lastInfo!.prePasses;
|
|
10991
|
-
// prePasses.pop();
|
|
10992
|
-
// infoMap.get(finalFilterPass)!.prePasses = prePasses.map((pass, i) => {
|
|
10993
|
-
// return { pass, destroyOptions: false };
|
|
10994
|
-
// });
|
|
10995
|
-
// this.resetClearActions();
|
|
10996
|
-
// return finalFilterPass;
|
|
10997
|
-
// }
|
|
10998
10839
|
/**
|
|
10999
10840
|
* 销毁 RenderFrame
|
|
11000
10841
|
* @param options - 可以有选择销毁一些对象
|
|
@@ -11114,45 +10955,6 @@ var seed$6 = 1;
|
|
|
11114
10955
|
this.clearAction.colorAction = TextureLoadAction.whatever;
|
|
11115
10956
|
}
|
|
11116
10957
|
};
|
|
11117
|
-
// protected updateRenderInfo (renderPass: RenderPass): RenderPassInfo {
|
|
11118
|
-
// const map = this.renderPassInfoMap;
|
|
11119
|
-
// const passes = this.renderPasses;
|
|
11120
|
-
// let info: RenderPassInfo;
|
|
11121
|
-
// if (!map.has(renderPass)) {
|
|
11122
|
-
// info = {
|
|
11123
|
-
// intermedia: false,
|
|
11124
|
-
// renderPass: renderPass,
|
|
11125
|
-
// listStart: 0,
|
|
11126
|
-
// listEnd: 0,
|
|
11127
|
-
// };
|
|
11128
|
-
// map.set(renderPass, info);
|
|
11129
|
-
// } else {
|
|
11130
|
-
// info = map.get(renderPass)!;
|
|
11131
|
-
// }
|
|
11132
|
-
// info.intermedia = renderPass.attachments.length > 0;
|
|
11133
|
-
// const meshes = renderPass.meshes;
|
|
11134
|
-
// if (meshes[0]) {
|
|
11135
|
-
// info.listStart = (meshes[0].name === MARS_COPY_MESH_NAME ? meshes[1] : meshes[0]).priority;
|
|
11136
|
-
// info.listEnd = meshes[meshes.length - 1].priority;
|
|
11137
|
-
// } else {
|
|
11138
|
-
// info.listStart = 0;
|
|
11139
|
-
// info.listEnd = 0;
|
|
11140
|
-
// }
|
|
11141
|
-
// const index = passes.indexOf(renderPass);
|
|
11142
|
-
// const depthStencilActon = index === 0 ? TextureLoadAction.clear : TextureLoadAction.whatever;
|
|
11143
|
-
// if (index === 0) {
|
|
11144
|
-
// renderPass.clearAction.colorAction = TextureLoadAction.clear;
|
|
11145
|
-
// }
|
|
11146
|
-
// renderPass.clearAction.depthAction = depthStencilActon;
|
|
11147
|
-
// renderPass.clearAction.stencilAction = depthStencilActon;
|
|
11148
|
-
// if (index > -1) {
|
|
11149
|
-
// renderPass.semantics.setSemantic('EDITOR_TRANSFORM', () => this.editorTransform);
|
|
11150
|
-
// } else {
|
|
11151
|
-
// renderPass.semantics.setSemantic('EDITOR_TRANSFORM', undefined);
|
|
11152
|
-
// }
|
|
11153
|
-
// info.preRenderPass = passes[index - 1];
|
|
11154
|
-
// return info;
|
|
11155
|
-
// }
|
|
11156
10958
|
/**
|
|
11157
10959
|
* 设置 RenderPass 数组,直接修改内部的 RenderPass 数组
|
|
11158
10960
|
* @param passes - RenderPass 数组
|
|
@@ -11353,7 +11155,7 @@ var FinalCopyRP = /*#__PURE__*/ function(RenderPass) {
|
|
|
11353
11155
|
var GlobalUniforms = function GlobalUniforms() {
|
|
11354
11156
|
this.floats = {};
|
|
11355
11157
|
this.ints = {};
|
|
11356
|
-
|
|
11158
|
+
this.vector3s = {};
|
|
11357
11159
|
this.vector4s = {};
|
|
11358
11160
|
this.matrices = {};
|
|
11359
11161
|
//...
|
|
@@ -11594,6 +11396,9 @@ var Renderer = /*#__PURE__*/ function() {
|
|
|
11594
11396
|
_proto.setGlobalVector4 = function setGlobalVector4(name, value) {
|
|
11595
11397
|
// OVERRIDE
|
|
11596
11398
|
};
|
|
11399
|
+
_proto.setGlobalVector3 = function setGlobalVector3(name, value) {
|
|
11400
|
+
// OVERRIDE
|
|
11401
|
+
};
|
|
11597
11402
|
_proto.setGlobalMatrix = function setGlobalMatrix(name, value) {
|
|
11598
11403
|
// OVERRIDE
|
|
11599
11404
|
};
|
|
@@ -13259,10 +13064,10 @@ var Vector4Curve = /*#__PURE__*/ function(ValueGetter) {
|
|
|
13259
13064
|
}
|
|
13260
13065
|
var _proto = Vector4Curve.prototype;
|
|
13261
13066
|
_proto.onCreate = function onCreate(arg) {
|
|
13262
|
-
this.xCurve = createValueGetter(arg
|
|
13263
|
-
this.yCurve = createValueGetter(arg
|
|
13264
|
-
this.zCurve = createValueGetter(arg
|
|
13265
|
-
this.wCurve = createValueGetter(arg
|
|
13067
|
+
this.xCurve = createValueGetter(arg[0]);
|
|
13068
|
+
this.yCurve = createValueGetter(arg[1]);
|
|
13069
|
+
this.zCurve = createValueGetter(arg[2]);
|
|
13070
|
+
this.wCurve = createValueGetter(arg[3]);
|
|
13266
13071
|
};
|
|
13267
13072
|
_proto.getValue = function getValue(t) {
|
|
13268
13073
|
var x = this.xCurve.getValue(t);
|
|
@@ -13282,8 +13087,8 @@ var SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0 = "PRE_MAIN_COLOR_0";
|
|
|
13282
13087
|
var SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0 = "PRE_MAIN_COLOR_SIZE_0";
|
|
13283
13088
|
var PLAYER_OPTIONS_ENV_EDITOR = "editor";
|
|
13284
13089
|
var HELP_LINK = {
|
|
13285
|
-
"Item duration can't be less than 0": "https://galacean.
|
|
13286
|
-
"ValueType: 21/22 is not supported": "https://galacean.
|
|
13090
|
+
"Item duration can't be less than 0": "https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#AOnQS",
|
|
13091
|
+
"ValueType: 21/22 is not supported": "https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#smO1b"
|
|
13287
13092
|
};
|
|
13288
13093
|
|
|
13289
13094
|
var _obj$4;
|
|
@@ -13362,10 +13167,10 @@ var ColorCurve = /*#__PURE__*/ function(ValueGetter) {
|
|
|
13362
13167
|
}
|
|
13363
13168
|
var _proto = ColorCurve.prototype;
|
|
13364
13169
|
_proto.onCreate = function onCreate(arg) {
|
|
13365
|
-
this.rCurve = createValueGetter(arg
|
|
13366
|
-
this.gCurve = createValueGetter(arg
|
|
13367
|
-
this.bCurve = createValueGetter(arg
|
|
13368
|
-
this.aCurve = createValueGetter(arg
|
|
13170
|
+
this.rCurve = createValueGetter(arg[0]);
|
|
13171
|
+
this.gCurve = createValueGetter(arg[1]);
|
|
13172
|
+
this.bCurve = createValueGetter(arg[2]);
|
|
13173
|
+
this.aCurve = createValueGetter(arg[3]);
|
|
13369
13174
|
};
|
|
13370
13175
|
_proto.getValue = function getValue(t) {
|
|
13371
13176
|
var r = this.rCurve.getValue(t);
|
|
@@ -15404,7 +15209,7 @@ var PolyStar = /*#__PURE__*/ function(ShapePrimitive) {
|
|
|
15404
15209
|
|
|
15405
15210
|
// const tempPoints = [new Point(), new Point(), new Point(), new Point()];
|
|
15406
15211
|
/**
|
|
15407
|
-
* The `Rectangle` object is an area defined by its position, as indicated by its
|
|
15212
|
+
* The `Rectangle` object is an area defined by its position, as indicated by its upper-left corner
|
|
15408
15213
|
* point (`x`, `y`) and by its `width` and its `height`.
|
|
15409
15214
|
*/ var Rectangle$1 = /*#__PURE__*/ function(ShapePrimitive) {
|
|
15410
15215
|
_inherits(Rectangle, ShapePrimitive);
|
|
@@ -15812,8 +15617,8 @@ var ShapePath = /*#__PURE__*/ function() {
|
|
|
15812
15617
|
};
|
|
15813
15618
|
/**
|
|
15814
15619
|
* Draws a rectangle shape. This method adds a new rectangle path to the current drawing.
|
|
15815
|
-
* @param x - The x-coordinate of the
|
|
15816
|
-
* @param y - The y-coordinate of the
|
|
15620
|
+
* @param x - The x-coordinate of the upper-left corner of the rectangle.
|
|
15621
|
+
* @param y - The y-coordinate of the upper-left corner of the rectangle.
|
|
15817
15622
|
* @param w - The width of the rectangle.
|
|
15818
15623
|
* @param h - The height of the rectangle.
|
|
15819
15624
|
* @param transform - An optional `Matrix` object to apply a transformation to the rectangle.
|
|
@@ -15958,8 +15763,8 @@ var GraphicsPath = /*#__PURE__*/ function() {
|
|
|
15958
15763
|
};
|
|
15959
15764
|
/**
|
|
15960
15765
|
* Draws a rectangle shape. This method adds a new rectangle path to the current drawing.
|
|
15961
|
-
* @param x - The x-coordinate of the
|
|
15962
|
-
* @param y - The y-coordinate of the
|
|
15766
|
+
* @param x - The x-coordinate of the upper-left corner of the rectangle.
|
|
15767
|
+
* @param y - The y-coordinate of the upper-left corner of the rectangle.
|
|
15963
15768
|
* @param w - The width of the rectangle.
|
|
15964
15769
|
* @param h - The height of the rectangle.
|
|
15965
15770
|
* @param transform - An optional `Matrix` object to apply a transformation to the rectangle.
|
|
@@ -16029,7 +15834,7 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
|
|
|
16029
15834
|
_this.curveValues = [];
|
|
16030
15835
|
_this.animated = true;
|
|
16031
15836
|
_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";
|
|
16032
|
-
_this.frag = "\nprecision highp float;\n\nuniform vec4 _Color;\n\nvoid main() {\n vec4 color = _Color;\n gl_FragColor = color;\n}\n";
|
|
15837
|
+
_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";
|
|
16033
15838
|
if (!_this.geometry) {
|
|
16034
15839
|
_this.geometry = Geometry.create(engine, {
|
|
16035
15840
|
attributes: {
|
|
@@ -16138,7 +15943,7 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
|
|
|
16138
15943
|
this.path.clear();
|
|
16139
15944
|
var shapeData = data;
|
|
16140
15945
|
switch(shapeData.type){
|
|
16141
|
-
case
|
|
15946
|
+
case ShapePrimitiveType.Custom:
|
|
16142
15947
|
{
|
|
16143
15948
|
var customData = shapeData;
|
|
16144
15949
|
var points = customData.points;
|
|
@@ -16175,28 +15980,28 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
|
|
|
16175
15980
|
}
|
|
16176
15981
|
break;
|
|
16177
15982
|
}
|
|
16178
|
-
case
|
|
15983
|
+
case ShapePrimitiveType.Ellipse:
|
|
16179
15984
|
{
|
|
16180
15985
|
var ellipseData = shapeData;
|
|
16181
15986
|
this.path.ellipse(0, 0, ellipseData.xRadius, ellipseData.yRadius);
|
|
16182
15987
|
this.setFillColor(ellipseData.fill);
|
|
16183
15988
|
break;
|
|
16184
15989
|
}
|
|
16185
|
-
case
|
|
15990
|
+
case ShapePrimitiveType.Rectangle:
|
|
16186
15991
|
{
|
|
16187
15992
|
var rectangleData = shapeData;
|
|
16188
|
-
this.path.rect(-rectangleData.width / 2, rectangleData.height / 2, rectangleData.width, rectangleData.height);
|
|
15993
|
+
this.path.rect(-rectangleData.width / 2, -rectangleData.height / 2, rectangleData.width, rectangleData.height);
|
|
16189
15994
|
this.setFillColor(rectangleData.fill);
|
|
16190
15995
|
break;
|
|
16191
15996
|
}
|
|
16192
|
-
case
|
|
15997
|
+
case ShapePrimitiveType.Star:
|
|
16193
15998
|
{
|
|
16194
15999
|
var starData = shapeData;
|
|
16195
16000
|
this.path.polyStar(starData.pointCount, starData.outerRadius, starData.innerRadius, starData.outerRoundness, starData.innerRoundness, StarType.Star);
|
|
16196
16001
|
this.setFillColor(starData.fill);
|
|
16197
16002
|
break;
|
|
16198
16003
|
}
|
|
16199
|
-
case
|
|
16004
|
+
case ShapePrimitiveType.Polygon:
|
|
16200
16005
|
{
|
|
16201
16006
|
var polygonData = shapeData;
|
|
16202
16007
|
this.path.polyStar(polygonData.pointCount, polygonData.radius, polygonData.radius, polygonData.roundness, polygonData.roundness, StarType.Polygon);
|
|
@@ -16228,28 +16033,6 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
|
|
|
16228
16033
|
ShapeComponent = __decorate([
|
|
16229
16034
|
effectsClass("ShapeComponent")
|
|
16230
16035
|
], ShapeComponent);
|
|
16231
|
-
var ShapePrimitiveType;
|
|
16232
|
-
(function(ShapePrimitiveType) {
|
|
16233
|
-
/**
|
|
16234
|
-
* 自定义图形
|
|
16235
|
-
*/ ShapePrimitiveType[ShapePrimitiveType["Custom"] = 0] = "Custom";
|
|
16236
|
-
/**
|
|
16237
|
-
* 矩形
|
|
16238
|
-
*/ ShapePrimitiveType[ShapePrimitiveType["Rectangle"] = 1] = "Rectangle";
|
|
16239
|
-
/**
|
|
16240
|
-
* 椭圆
|
|
16241
|
-
*/ ShapePrimitiveType[ShapePrimitiveType["Ellipse"] = 2] = "Ellipse";
|
|
16242
|
-
/**
|
|
16243
|
-
* 多边形
|
|
16244
|
-
*/ ShapePrimitiveType[ShapePrimitiveType["Polygon"] = 3] = "Polygon";
|
|
16245
|
-
/**
|
|
16246
|
-
* 星形
|
|
16247
|
-
*/ ShapePrimitiveType[ShapePrimitiveType["Star"] = 4] = "Star";
|
|
16248
|
-
})(ShapePrimitiveType || (ShapePrimitiveType = {}));
|
|
16249
|
-
var ShapeConnectType;
|
|
16250
|
-
(function(ShapeConnectType) {})(ShapeConnectType || (ShapeConnectType = {}));
|
|
16251
|
-
var ShapePointType;
|
|
16252
|
-
(function(ShapePointType) {})(ShapePointType || (ShapePointType = {}));
|
|
16253
16036
|
|
|
16254
16037
|
var Fake3DComponent = /*#__PURE__*/ function(Component) {
|
|
16255
16038
|
_inherits(Fake3DComponent, Component);
|
|
@@ -16810,18 +16593,18 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16810
16593
|
this.item.getHitTestParams = this.getHitTestParams;
|
|
16811
16594
|
};
|
|
16812
16595
|
_proto.onDisable = function onDisable() {
|
|
16596
|
+
RendererComponent.prototype.onDisable.call(this);
|
|
16813
16597
|
if (this.item && this.item.composition) {
|
|
16814
|
-
var _this_previewContent;
|
|
16815
16598
|
if (this.duringPlay && !this.item.transform.getValid()) {
|
|
16816
16599
|
this.item.composition.removeInteractiveItem(this.item, this.item.props.content.options.type);
|
|
16817
16600
|
this.duringPlay = false;
|
|
16818
16601
|
}
|
|
16819
16602
|
this.clickable = false;
|
|
16820
|
-
(_this_previewContent = this.previewContent) == null ? void 0 : _this_previewContent.mesh.dispose();
|
|
16821
16603
|
this.endDragTarget();
|
|
16822
16604
|
}
|
|
16823
16605
|
};
|
|
16824
16606
|
_proto.onEnable = function onEnable() {
|
|
16607
|
+
RendererComponent.prototype.onEnable.call(this);
|
|
16825
16608
|
var type = this.interactData.options.type;
|
|
16826
16609
|
if (type === InteractType.CLICK) {
|
|
16827
16610
|
this.clickable = true;
|
|
@@ -16853,10 +16636,14 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16853
16636
|
};
|
|
16854
16637
|
_proto.render = function render(renderer) {
|
|
16855
16638
|
if (this.previewContent) {
|
|
16639
|
+
this.previewContent.mesh.worldMatrix = this.transform.getWorldMatrix();
|
|
16856
16640
|
this.previewContent.mesh.render(renderer);
|
|
16857
16641
|
}
|
|
16858
16642
|
};
|
|
16859
|
-
_proto.onDestroy = function onDestroy() {
|
|
16643
|
+
_proto.onDestroy = function onDestroy() {
|
|
16644
|
+
var _this_previewContent;
|
|
16645
|
+
(_this_previewContent = this.previewContent) == null ? void 0 : _this_previewContent.mesh.dispose();
|
|
16646
|
+
};
|
|
16860
16647
|
_proto.endDragTarget = function endDragTarget() {
|
|
16861
16648
|
// OVERRIDE
|
|
16862
16649
|
};
|
|
@@ -17214,7 +17001,7 @@ var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
|
|
|
17214
17001
|
// 更新节点时间
|
|
17215
17002
|
for(var _iterator3 = _create_for_of_iterator_helper_loose(this.playables), _step3; !(_step3 = _iterator3()).done;){
|
|
17216
17003
|
var playable = _step3.value;
|
|
17217
|
-
this.updatePlayableTime(playable, dt);
|
|
17004
|
+
this.updatePlayableTime(playable, dt / 1000);
|
|
17218
17005
|
}
|
|
17219
17006
|
};
|
|
17220
17007
|
_proto.connect = function connect(source, sourceOutputPort, destination, destinationInputPort) {
|
|
@@ -18435,7 +18222,7 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
18435
18222
|
options: {}
|
|
18436
18223
|
};
|
|
18437
18224
|
}
|
|
18438
|
-
if (duration
|
|
18225
|
+
if (duration < 0) {
|
|
18439
18226
|
throw new Error("Item duration can't be less than 0, see " + HELP_LINK["Item duration can't be less than 0"] + ".");
|
|
18440
18227
|
}
|
|
18441
18228
|
this.rendererComponents.length = 0;
|
|
@@ -18796,6 +18583,16 @@ var SpriteComponent = /*#__PURE__*/ function(BaseRenderComponent) {
|
|
|
18796
18583
|
}
|
|
18797
18584
|
var life = Math.min(Math.max(time / duration, 0.0), 1.0);
|
|
18798
18585
|
var ta = this.textureSheetAnimation;
|
|
18586
|
+
var video = this.renderer.texture.source.video;
|
|
18587
|
+
if (video) {
|
|
18588
|
+
if (time === 0) {
|
|
18589
|
+
video.pause();
|
|
18590
|
+
} else {
|
|
18591
|
+
video.play().catch(function(e) {
|
|
18592
|
+
_this.engine.renderErrors.add(e);
|
|
18593
|
+
});
|
|
18594
|
+
}
|
|
18595
|
+
}
|
|
18799
18596
|
if (ta) {
|
|
18800
18597
|
var _this_material_getVector4;
|
|
18801
18598
|
var total = ta.total || ta.row * ta.col;
|
|
@@ -18850,21 +18647,20 @@ var SpriteComponent = /*#__PURE__*/ function(BaseRenderComponent) {
|
|
|
18850
18647
|
dy
|
|
18851
18648
|
]);
|
|
18852
18649
|
}
|
|
18853
|
-
var video = this.renderer.texture.source.video;
|
|
18854
|
-
if (video) {
|
|
18855
|
-
if (time === 0 || time === this.item.duration) {
|
|
18856
|
-
video.pause();
|
|
18857
|
-
} else {
|
|
18858
|
-
video.play().catch(function(e) {
|
|
18859
|
-
_this.engine.renderErrors.add(e);
|
|
18860
|
-
});
|
|
18861
|
-
}
|
|
18862
|
-
}
|
|
18863
18650
|
};
|
|
18864
18651
|
_proto.onDestroy = function onDestroy() {
|
|
18652
|
+
var textures = this.getTextures();
|
|
18865
18653
|
if (this.item && this.item.composition) {
|
|
18866
|
-
this.item.composition.destroyTextures(
|
|
18654
|
+
this.item.composition.destroyTextures(textures);
|
|
18867
18655
|
}
|
|
18656
|
+
textures.forEach(function(texture) {
|
|
18657
|
+
var source = texture.source;
|
|
18658
|
+
if (source.sourceType === TextureSourceType.video && (source == null ? void 0 : source.video)) {
|
|
18659
|
+
source.video.pause();
|
|
18660
|
+
source.video.src = "";
|
|
18661
|
+
source.video.load();
|
|
18662
|
+
}
|
|
18663
|
+
});
|
|
18868
18664
|
};
|
|
18869
18665
|
_proto.createGeometry = function createGeometry(mode) {
|
|
18870
18666
|
var maxVertex = 12 * this.splits.length;
|
|
@@ -19303,7 +19099,7 @@ var ShapeNone = /*#__PURE__*/ function() {
|
|
|
19303
19099
|
return ShapeNone;
|
|
19304
19100
|
}();
|
|
19305
19101
|
var _obj$3;
|
|
19306
|
-
var map = (_obj$3 = {}, _obj$3[
|
|
19102
|
+
var map = (_obj$3 = {}, _obj$3[ParticleEmitterShapeType.NONE] = ShapeNone, _obj$3[ParticleEmitterShapeType.CONE] = Cone, _obj$3[ParticleEmitterShapeType.SPHERE] = Sphere, _obj$3[ParticleEmitterShapeType.HEMISPHERE] = Hemisphere, _obj$3[ParticleEmitterShapeType.CIRCLE] = Circle, _obj$3[ParticleEmitterShapeType.DONUT] = Donut, _obj$3[ParticleEmitterShapeType.RECTANGLE] = Rectangle, _obj$3[ParticleEmitterShapeType.EDGE] = Edge, _obj$3[ParticleEmitterShapeType.RECTANGLE_EDGE] = RectangleEdge, _obj$3[ParticleEmitterShapeType.TEXTURE] = TextureShape, _obj$3);
|
|
19307
19103
|
function createShape(shapeOptions) {
|
|
19308
19104
|
if (!shapeOptions) {
|
|
19309
19105
|
return new ShapeNone();
|
|
@@ -19320,7 +19116,7 @@ function createShape(shapeOptions) {
|
|
|
19320
19116
|
throw new Error("Invalid shape: " + type + ".");
|
|
19321
19117
|
}
|
|
19322
19118
|
var ctrl = new Ctrl(options);
|
|
19323
|
-
if (type !==
|
|
19119
|
+
if (type !== ParticleEmitterShapeType.NONE) {
|
|
19324
19120
|
var alignSpeedDirection = shapeOptions.alignSpeedDirection, _shapeOptions_upDirection = shapeOptions.upDirection, upDirection = _shapeOptions_upDirection === void 0 ? [
|
|
19325
19121
|
0,
|
|
19326
19122
|
0,
|
|
@@ -24250,9 +24046,9 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
24250
24046
|
var sceneBinding = _step.value;
|
|
24251
24047
|
sceneBinding.key.boundObject = sceneBinding.value;
|
|
24252
24048
|
}
|
|
24253
|
-
//
|
|
24049
|
+
// 为了通过帧对比,需要保证和原有的 update 时机一致。
|
|
24254
24050
|
// 因此这边更新一次对象绑定,后续 timeline playable 中 sort tracks 的排序才能和原先的版本对上。
|
|
24255
|
-
// 如果不需要严格保证和之前的 updata 时机一致,这边的更新和 timeline
|
|
24051
|
+
// 如果不需要严格保证和之前的 updata 时机一致,这边的更新和 timeline asset 中的 sortTracks 都能去掉。
|
|
24256
24052
|
for(var _iterator1 = _create_for_of_iterator_helper_loose(this.timelineAsset.tracks), _step1; !(_step1 = _iterator1()).done;){
|
|
24257
24053
|
var masterTrack = _step1.value;
|
|
24258
24054
|
this.updateTrackAnimatedObject(masterTrack);
|
|
@@ -24356,6 +24152,51 @@ var Vector4PropertyMixerPlayable = /*#__PURE__*/ function(Playable) {
|
|
|
24356
24152
|
return Vector4PropertyMixerPlayable;
|
|
24357
24153
|
}(Playable);
|
|
24358
24154
|
|
|
24155
|
+
var ColorPropertyMixerPlayable = /*#__PURE__*/ function(Playable) {
|
|
24156
|
+
_inherits(ColorPropertyMixerPlayable, Playable);
|
|
24157
|
+
function ColorPropertyMixerPlayable() {
|
|
24158
|
+
var _this;
|
|
24159
|
+
_this = Playable.apply(this, arguments) || this;
|
|
24160
|
+
_this.propertyName = "";
|
|
24161
|
+
return _this;
|
|
24162
|
+
}
|
|
24163
|
+
var _proto = ColorPropertyMixerPlayable.prototype;
|
|
24164
|
+
_proto.processFrame = function processFrame(context) {
|
|
24165
|
+
var boundObject = context.output.getUserData();
|
|
24166
|
+
if (!boundObject) {
|
|
24167
|
+
return;
|
|
24168
|
+
}
|
|
24169
|
+
var hasInput = false;
|
|
24170
|
+
var value = boundObject[this.propertyName];
|
|
24171
|
+
if (!_instanceof1(value, Color)) {
|
|
24172
|
+
return;
|
|
24173
|
+
}
|
|
24174
|
+
value.setZero();
|
|
24175
|
+
// evaluate the curve
|
|
24176
|
+
for(var i = 0; i < this.getInputCount(); i++){
|
|
24177
|
+
var weight = this.getInputWeight(i);
|
|
24178
|
+
if (weight > 0) {
|
|
24179
|
+
var propertyClipPlayable = this.getInput(i);
|
|
24180
|
+
if (!_instanceof1(propertyClipPlayable, PropertyClipPlayable)) {
|
|
24181
|
+
console.error("ColorPropertyMixerPlayable received incompatible input");
|
|
24182
|
+
continue;
|
|
24183
|
+
}
|
|
24184
|
+
var curveValue = propertyClipPlayable.value;
|
|
24185
|
+
value.r += curveValue.r * weight;
|
|
24186
|
+
value.g += curveValue.g * weight;
|
|
24187
|
+
value.b += curveValue.b * weight;
|
|
24188
|
+
value.a += curveValue.a * weight;
|
|
24189
|
+
hasInput = true;
|
|
24190
|
+
}
|
|
24191
|
+
}
|
|
24192
|
+
// set value
|
|
24193
|
+
if (hasInput) {
|
|
24194
|
+
boundObject[this.propertyName] = value;
|
|
24195
|
+
}
|
|
24196
|
+
};
|
|
24197
|
+
return ColorPropertyMixerPlayable;
|
|
24198
|
+
}(Playable);
|
|
24199
|
+
|
|
24359
24200
|
var PropertyTrack = /*#__PURE__*/ function(TrackAsset) {
|
|
24360
24201
|
_inherits(PropertyTrack, TrackAsset);
|
|
24361
24202
|
function PropertyTrack() {
|
|
@@ -24515,7 +24356,7 @@ var ColorPropertyTrack = /*#__PURE__*/ function(PropertyTrack) {
|
|
|
24515
24356
|
}
|
|
24516
24357
|
var _proto = ColorPropertyTrack.prototype;
|
|
24517
24358
|
_proto.createTrackMixer = function createTrackMixer(graph) {
|
|
24518
|
-
var mixer = new
|
|
24359
|
+
var mixer = new ColorPropertyMixerPlayable(graph);
|
|
24519
24360
|
var propertyNames = this.propertyNames;
|
|
24520
24361
|
if (propertyNames.length > 0) {
|
|
24521
24362
|
var propertyName = propertyNames[propertyNames.length - 1];
|
|
@@ -24529,6 +24370,27 @@ ColorPropertyTrack = __decorate([
|
|
|
24529
24370
|
effectsClass(DataType.ColorPropertyTrack)
|
|
24530
24371
|
], ColorPropertyTrack);
|
|
24531
24372
|
|
|
24373
|
+
var ColorPropertyPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
24374
|
+
_inherits(ColorPropertyPlayableAsset, PlayableAsset);
|
|
24375
|
+
function ColorPropertyPlayableAsset() {
|
|
24376
|
+
return PlayableAsset.apply(this, arguments);
|
|
24377
|
+
}
|
|
24378
|
+
var _proto = ColorPropertyPlayableAsset.prototype;
|
|
24379
|
+
_proto.createPlayable = function createPlayable(graph) {
|
|
24380
|
+
var clipPlayable = new PropertyClipPlayable(graph);
|
|
24381
|
+
clipPlayable.curve = createValueGetter(this.curveData);
|
|
24382
|
+
clipPlayable.value = clipPlayable.curve.getValue(0);
|
|
24383
|
+
return clipPlayable;
|
|
24384
|
+
};
|
|
24385
|
+
return ColorPropertyPlayableAsset;
|
|
24386
|
+
}(PlayableAsset);
|
|
24387
|
+
__decorate([
|
|
24388
|
+
serialize()
|
|
24389
|
+
], ColorPropertyPlayableAsset.prototype, "curveData", void 0);
|
|
24390
|
+
ColorPropertyPlayableAsset = __decorate([
|
|
24391
|
+
effectsClass(DataType.ColorPropertyPlayableAsset)
|
|
24392
|
+
], ColorPropertyPlayableAsset);
|
|
24393
|
+
|
|
24532
24394
|
var FloatPropertyPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
24533
24395
|
_inherits(FloatPropertyPlayableAsset, PlayableAsset);
|
|
24534
24396
|
function FloatPropertyPlayableAsset() {
|
|
@@ -24588,6 +24450,7 @@ var TimelineAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
|
24588
24450
|
var _this;
|
|
24589
24451
|
_this = PlayableAsset.apply(this, arguments) || this;
|
|
24590
24452
|
_this.tracks = [];
|
|
24453
|
+
_this.cacheFlattenedTracks = null;
|
|
24591
24454
|
return _this;
|
|
24592
24455
|
}
|
|
24593
24456
|
var _proto = TimelineAsset.prototype;
|
|
@@ -24600,16 +24463,62 @@ var TimelineAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
|
24600
24463
|
track.create(this);
|
|
24601
24464
|
}
|
|
24602
24465
|
}
|
|
24603
|
-
|
|
24466
|
+
this.sortTracks(this.tracks);
|
|
24467
|
+
timelinePlayable.compileTracks(graph, this.flattenedTracks);
|
|
24604
24468
|
return timelinePlayable;
|
|
24605
24469
|
};
|
|
24606
24470
|
_proto.createTrack = function createTrack(classConstructor, parent, name) {
|
|
24607
24471
|
var newTrack = new classConstructor(this.engine);
|
|
24608
24472
|
newTrack.name = name ? name : classConstructor.name;
|
|
24609
24473
|
parent.addChild(newTrack);
|
|
24474
|
+
this.invalidate();
|
|
24610
24475
|
return newTrack;
|
|
24611
24476
|
};
|
|
24477
|
+
/**
|
|
24478
|
+
* Invalidates the asset, called when tracks data changed
|
|
24479
|
+
*/ _proto.invalidate = function invalidate() {
|
|
24480
|
+
this.cacheFlattenedTracks = null;
|
|
24481
|
+
};
|
|
24482
|
+
_proto.addSubTracksRecursive = function addSubTracksRecursive(track, allTracks) {
|
|
24483
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(track.getChildTracks()), _step; !(_step = _iterator()).done;){
|
|
24484
|
+
var subTrack = _step.value;
|
|
24485
|
+
allTracks.push(subTrack);
|
|
24486
|
+
}
|
|
24487
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(track.getChildTracks()), _step1; !(_step1 = _iterator1()).done;){
|
|
24488
|
+
var subTrack1 = _step1.value;
|
|
24489
|
+
this.addSubTracksRecursive(subTrack1, allTracks);
|
|
24490
|
+
}
|
|
24491
|
+
};
|
|
24492
|
+
_proto.sortTracks = function sortTracks(tracks) {
|
|
24493
|
+
var sortedTracks = [];
|
|
24494
|
+
for(var i = 0; i < tracks.length; i++){
|
|
24495
|
+
sortedTracks.push(new TrackSortWrapper(tracks[i], i));
|
|
24496
|
+
}
|
|
24497
|
+
sortedTracks.sort(compareTracks);
|
|
24498
|
+
tracks.length = 0;
|
|
24499
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(sortedTracks), _step; !(_step = _iterator()).done;){
|
|
24500
|
+
var trackWrapper = _step.value;
|
|
24501
|
+
tracks.push(trackWrapper.track);
|
|
24502
|
+
}
|
|
24503
|
+
};
|
|
24612
24504
|
_proto.fromData = function fromData(data) {};
|
|
24505
|
+
_create_class(TimelineAsset, [
|
|
24506
|
+
{
|
|
24507
|
+
key: "flattenedTracks",
|
|
24508
|
+
get: function get() {
|
|
24509
|
+
if (!this.cacheFlattenedTracks) {
|
|
24510
|
+
this.cacheFlattenedTracks = [];
|
|
24511
|
+
// flatten track tree
|
|
24512
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(this.tracks), _step; !(_step = _iterator()).done;){
|
|
24513
|
+
var masterTrack = _step.value;
|
|
24514
|
+
this.cacheFlattenedTracks.push(masterTrack);
|
|
24515
|
+
this.addSubTracksRecursive(masterTrack, this.cacheFlattenedTracks);
|
|
24516
|
+
}
|
|
24517
|
+
}
|
|
24518
|
+
return this.cacheFlattenedTracks;
|
|
24519
|
+
}
|
|
24520
|
+
}
|
|
24521
|
+
]);
|
|
24613
24522
|
return TimelineAsset;
|
|
24614
24523
|
}(PlayableAsset);
|
|
24615
24524
|
__decorate([
|
|
@@ -24642,18 +24551,11 @@ var TimelinePlayable = /*#__PURE__*/ function(Playable) {
|
|
|
24642
24551
|
}
|
|
24643
24552
|
};
|
|
24644
24553
|
_proto.compileTracks = function compileTracks(graph, tracks) {
|
|
24645
|
-
|
|
24646
|
-
var outputTrack = [];
|
|
24647
|
-
// flatten track tree
|
|
24648
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(tracks), _step; !(_step = _iterator()).done;){
|
|
24649
|
-
var masterTrack = _step.value;
|
|
24650
|
-
outputTrack.push(masterTrack);
|
|
24651
|
-
this.addSubTracksRecursive(masterTrack, outputTrack);
|
|
24652
|
-
}
|
|
24554
|
+
var outputTrack = tracks;
|
|
24653
24555
|
// map for searching track instance with track asset guid
|
|
24654
24556
|
var trackInstanceMap = {};
|
|
24655
|
-
for(var
|
|
24656
|
-
var track =
|
|
24557
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(outputTrack), _step; !(_step = _iterator()).done;){
|
|
24558
|
+
var track = _step.value;
|
|
24657
24559
|
// create track mixer and track output
|
|
24658
24560
|
var trackMixPlayable = track.createPlayableGraph(graph, this.clips);
|
|
24659
24561
|
this.addInput(trackMixPlayable, 0);
|
|
@@ -24669,11 +24571,11 @@ var TimelinePlayable = /*#__PURE__*/ function(Playable) {
|
|
|
24669
24571
|
}
|
|
24670
24572
|
}
|
|
24671
24573
|
// build trackInstance tree
|
|
24672
|
-
for(var
|
|
24673
|
-
var track1 =
|
|
24574
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(outputTrack), _step1; !(_step1 = _iterator1()).done;){
|
|
24575
|
+
var track1 = _step1.value;
|
|
24674
24576
|
var trackInstance1 = trackInstanceMap[track1.getInstanceId()];
|
|
24675
|
-
for(var
|
|
24676
|
-
var child =
|
|
24577
|
+
for(var _iterator2 = _create_for_of_iterator_helper_loose(track1.getChildTracks()), _step2; !(_step2 = _iterator2()).done;){
|
|
24578
|
+
var child = _step2.value;
|
|
24677
24579
|
var childTrackInstance = trackInstanceMap[child.getInstanceId()];
|
|
24678
24580
|
trackInstance1.addChild(childTrackInstance);
|
|
24679
24581
|
}
|
|
@@ -24690,28 +24592,6 @@ var TimelinePlayable = /*#__PURE__*/ function(Playable) {
|
|
|
24690
24592
|
this.updateTrackAnimatedObject(trackInstance.children);
|
|
24691
24593
|
}
|
|
24692
24594
|
};
|
|
24693
|
-
_proto.sortTracks = function sortTracks(tracks) {
|
|
24694
|
-
var sortedTracks = [];
|
|
24695
|
-
for(var i = 0; i < tracks.length; i++){
|
|
24696
|
-
sortedTracks.push(new TrackSortWrapper(tracks[i], i));
|
|
24697
|
-
}
|
|
24698
|
-
sortedTracks.sort(compareTracks);
|
|
24699
|
-
tracks.length = 0;
|
|
24700
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(sortedTracks), _step; !(_step = _iterator()).done;){
|
|
24701
|
-
var trackWrapper = _step.value;
|
|
24702
|
-
tracks.push(trackWrapper.track);
|
|
24703
|
-
}
|
|
24704
|
-
};
|
|
24705
|
-
_proto.addSubTracksRecursive = function addSubTracksRecursive(track, allTracks) {
|
|
24706
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(track.getChildTracks()), _step; !(_step = _iterator()).done;){
|
|
24707
|
-
var subTrack = _step.value;
|
|
24708
|
-
allTracks.push(subTrack);
|
|
24709
|
-
}
|
|
24710
|
-
for(var _iterator1 = _create_for_of_iterator_helper_loose(track.getChildTracks()), _step1; !(_step1 = _iterator1()).done;){
|
|
24711
|
-
var subTrack1 = _step1.value;
|
|
24712
|
-
this.addSubTracksRecursive(subTrack1, allTracks);
|
|
24713
|
-
}
|
|
24714
|
-
};
|
|
24715
24595
|
return TimelinePlayable;
|
|
24716
24596
|
}(Playable);
|
|
24717
24597
|
var TrackSortWrapper = function TrackSortWrapper(track, originalIndex) {
|
|
@@ -24733,6 +24613,27 @@ function compareTracks(a, b) {
|
|
|
24733
24613
|
}
|
|
24734
24614
|
}
|
|
24735
24615
|
|
|
24616
|
+
var Vector4PropertyPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
24617
|
+
_inherits(Vector4PropertyPlayableAsset, PlayableAsset);
|
|
24618
|
+
function Vector4PropertyPlayableAsset() {
|
|
24619
|
+
return PlayableAsset.apply(this, arguments);
|
|
24620
|
+
}
|
|
24621
|
+
var _proto = Vector4PropertyPlayableAsset.prototype;
|
|
24622
|
+
_proto.createPlayable = function createPlayable(graph) {
|
|
24623
|
+
var clipPlayable = new PropertyClipPlayable(graph);
|
|
24624
|
+
clipPlayable.curve = createValueGetter(this.curveData);
|
|
24625
|
+
clipPlayable.value = clipPlayable.curve.getValue(0);
|
|
24626
|
+
return clipPlayable;
|
|
24627
|
+
};
|
|
24628
|
+
return Vector4PropertyPlayableAsset;
|
|
24629
|
+
}(PlayableAsset);
|
|
24630
|
+
__decorate([
|
|
24631
|
+
serialize()
|
|
24632
|
+
], Vector4PropertyPlayableAsset.prototype, "curveData", void 0);
|
|
24633
|
+
Vector4PropertyPlayableAsset = __decorate([
|
|
24634
|
+
effectsClass("Vector4PropertyPlayableAsset")
|
|
24635
|
+
], Vector4PropertyPlayableAsset);
|
|
24636
|
+
|
|
24736
24637
|
var ObjectBindingTrack = /*#__PURE__*/ function(TrackAsset1) {
|
|
24737
24638
|
_inherits(ObjectBindingTrack, TrackAsset1);
|
|
24738
24639
|
function ObjectBindingTrack() {
|
|
@@ -24770,7 +24671,7 @@ var TextLayout = /*#__PURE__*/ function() {
|
|
|
24770
24671
|
function TextLayout(options) {
|
|
24771
24672
|
this.width = 0;
|
|
24772
24673
|
this.height = 0;
|
|
24773
|
-
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,
|
|
24674
|
+
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;
|
|
24774
24675
|
var tempWidth = fontSize + letterSpace;
|
|
24775
24676
|
this.autoWidth = autoWidth;
|
|
24776
24677
|
this.maxTextWidth = text.length * tempWidth;
|
|
@@ -26665,13 +26566,13 @@ function getStandardParticleContent(particle) {
|
|
|
26665
26566
|
var options = particle.options;
|
|
26666
26567
|
var transform = particle.transform;
|
|
26667
26568
|
var shape = {
|
|
26668
|
-
type:
|
|
26569
|
+
type: ParticleEmitterShapeType.NONE
|
|
26669
26570
|
};
|
|
26670
26571
|
if (particle.shape) {
|
|
26671
26572
|
var _particle_shape_shape;
|
|
26672
26573
|
var shapeType = (_particle_shape_shape = particle.shape.shape) == null ? void 0 : _particle_shape_shape.replace(/([A-Z])/g, "_$1").toUpperCase().replace(/^_/, "");
|
|
26673
26574
|
shape = _extends({}, particle.shape, {
|
|
26674
|
-
type:
|
|
26575
|
+
type: ParticleEmitterShapeType[shapeType]
|
|
26675
26576
|
});
|
|
26676
26577
|
if (particle.shape.upDirection) {
|
|
26677
26578
|
var _particle_shape_upDirection = particle.shape.upDirection, x = _particle_shape_upDirection[0], y = _particle_shape_upDirection[1], z = _particle_shape_upDirection[2];
|
|
@@ -28535,7 +28436,8 @@ var listOrder = 0;
|
|
|
28535
28436
|
var itemProps = sourceItemData;
|
|
28536
28437
|
if (passRenderLevel(sourceItemData.renderLevel, this.renderLevel)) {
|
|
28537
28438
|
itemProps.listIndex = listOrder++;
|
|
28538
|
-
if (itemProps.type === ItemType.sprite || itemProps.type === ItemType.particle || itemProps.type === ItemType.spine
|
|
28439
|
+
if (itemProps.type === ItemType.sprite || itemProps.type === ItemType.particle || itemProps.type === ItemType.spine || //@ts-expect-error
|
|
28440
|
+
itemProps.type === ItemType.shape) {
|
|
28539
28441
|
for(var _iterator2 = _create_for_of_iterator_helper_loose(itemProps.components), _step2; !(_step2 = _iterator2()).done;){
|
|
28540
28442
|
var componentPath = _step2.value;
|
|
28541
28443
|
var componentData = componentMap[componentPath.id];
|
|
@@ -28571,10 +28473,10 @@ var listOrder = 0;
|
|
|
28571
28473
|
if (Number.isInteger(shape)) {
|
|
28572
28474
|
var _this_jsonScene;
|
|
28573
28475
|
shapeData = (_this_jsonScene = this.jsonScene) == null ? void 0 : _this_jsonScene.shapes[shape];
|
|
28574
|
-
} else {
|
|
28476
|
+
} else if (shape) {
|
|
28575
28477
|
shapeData = shape;
|
|
28576
28478
|
}
|
|
28577
|
-
if (shapeData !== undefined) {
|
|
28479
|
+
if (shapeData !== undefined && !("aPoint" in shapeData && "index" in shapeData)) {
|
|
28578
28480
|
// @ts-expect-error 类型转换问题
|
|
28579
28481
|
renderContent.renderer.shape = getGeometryByShape(shapeData, split);
|
|
28580
28482
|
}
|
|
@@ -28943,16 +28845,15 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28943
28845
|
if (pause) {
|
|
28944
28846
|
this.resume();
|
|
28945
28847
|
}
|
|
28946
|
-
if (!this.rootComposition.isStartCalled) {
|
|
28947
|
-
this.rootComposition.onStart();
|
|
28948
|
-
this.rootComposition.isStartCalled = true;
|
|
28949
|
-
}
|
|
28950
28848
|
this.setSpeed(1);
|
|
28951
28849
|
this.forwardTime(time + this.startTime);
|
|
28952
28850
|
this.setSpeed(speed);
|
|
28953
28851
|
if (pause) {
|
|
28954
28852
|
this.pause();
|
|
28955
28853
|
}
|
|
28854
|
+
this.emit("goto", {
|
|
28855
|
+
time: time
|
|
28856
|
+
});
|
|
28956
28857
|
};
|
|
28957
28858
|
_proto.addItem = function addItem(item) {
|
|
28958
28859
|
this.items.push(item);
|
|
@@ -28984,30 +28885,16 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28984
28885
|
_proto.prepareRender = function prepareRender() {
|
|
28985
28886
|
var _this = this;
|
|
28986
28887
|
var frame = this.renderFrame;
|
|
28987
|
-
frame._renderPasses[0].meshes.length = 0;
|
|
28988
28888
|
this.postLoaders.length = 0;
|
|
28989
28889
|
this.pluginSystem.plugins.forEach(function(loader) {
|
|
28990
28890
|
if (loader.prepareRenderFrame(_this, frame)) {
|
|
28991
28891
|
_this.postLoaders.push(loader);
|
|
28992
28892
|
}
|
|
28993
28893
|
});
|
|
28994
|
-
this.gatherRendererComponent(this.rootItem, frame);
|
|
28995
28894
|
this.postLoaders.forEach(function(loader) {
|
|
28996
28895
|
return loader.postProcessFrame(_this, frame);
|
|
28997
28896
|
});
|
|
28998
28897
|
};
|
|
28999
|
-
_proto.gatherRendererComponent = function gatherRendererComponent(vfxItem, renderFrame) {
|
|
29000
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(vfxItem.rendererComponents), _step; !(_step = _iterator()).done;){
|
|
29001
|
-
var rendererComponent = _step.value;
|
|
29002
|
-
if (rendererComponent.isActiveAndEnabled) {
|
|
29003
|
-
renderFrame.addMeshToDefaultRenderPass(rendererComponent);
|
|
29004
|
-
}
|
|
29005
|
-
}
|
|
29006
|
-
for(var _iterator1 = _create_for_of_iterator_helper_loose(vfxItem.children), _step1; !(_step1 = _iterator1()).done;){
|
|
29007
|
-
var item = _step1.value;
|
|
29008
|
-
this.gatherRendererComponent(item, renderFrame);
|
|
29009
|
-
}
|
|
29010
|
-
};
|
|
29011
28898
|
/**
|
|
29012
28899
|
* 合成更新,针对所有 item 的更新
|
|
29013
28900
|
* @param deltaTime - 更新的时间步长
|
|
@@ -29130,7 +29017,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
29130
29017
|
* 更新主合成组件
|
|
29131
29018
|
*/ _proto.updateRootComposition = function updateRootComposition(deltaTime) {
|
|
29132
29019
|
if (this.rootComposition.isActiveAndEnabled) {
|
|
29133
|
-
var localTime = this.time + deltaTime - this.rootItem.start;
|
|
29020
|
+
var localTime = parseFloat((this.time + deltaTime - this.rootItem.start).toFixed(3));
|
|
29134
29021
|
var isEnded = false;
|
|
29135
29022
|
var duration = this.rootItem.duration;
|
|
29136
29023
|
var endBehavior = this.rootItem.endBehavior;
|
|
@@ -31492,7 +31379,7 @@ registerPlugin("sprite", SpriteLoader, VFXItem, true);
|
|
|
31492
31379
|
registerPlugin("particle", ParticleLoader, VFXItem, true);
|
|
31493
31380
|
registerPlugin("cal", CalculateLoader, VFXItem, true);
|
|
31494
31381
|
registerPlugin("interact", InteractLoader, VFXItem, true);
|
|
31495
|
-
var version$1 = "2.1.
|
|
31382
|
+
var version$1 = "2.1.1";
|
|
31496
31383
|
logger.info("Core version: " + version$1 + ".");
|
|
31497
31384
|
|
|
31498
31385
|
var _obj;
|
|
@@ -33119,8 +33006,8 @@ setMaxSpriteMeshItemCount(8);
|
|
|
33119
33006
|
*/ Mesh.create = function(engine, props) {
|
|
33120
33007
|
return new ThreeMesh(engine, props);
|
|
33121
33008
|
};
|
|
33122
|
-
var version = "2.1.
|
|
33009
|
+
var version = "2.1.1";
|
|
33123
33010
|
logger.info("THREEJS plugin version: " + version + ".");
|
|
33124
33011
|
|
|
33125
|
-
export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, Asset, AssetLoader, AssetManager, BYTES_TYPE_MAP, BaseRenderComponent, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, COMPRESSED_TEXTURE, CONSTANT_MAP_BLEND, CONSTANT_MAP_DEPTH, CONSTANT_MAP_STENCIL_FUNC, CONSTANT_MAP_STENCIL_OP, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, ColorCurve, ColorPropertyTrack, Component, Composition, CompositionComponent, CompositionSourceManager, 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, Engine, EventEmitter, EventSystem, Fake3DAnimationMode, Fake3DComponent, FilterMode, Float16ArrayWrapper, FloatPropertyPlayableAsset, FloatPropertyTrack, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, HELP_LINK, HitTestType, InteractComponent, InteractLoader, InteractMesh, Item, KTXTexture, LineSegments, LinearValue, Material, MaterialDataBlock, MaterialRenderType, MaterialTrack, Mesh, MeshCollider, ObjectBindingTrack, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, PassTextureCache, PathSegments, PluginSystem, 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,
|
|
33012
|
+
export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, Asset, AssetLoader, AssetManager, BYTES_TYPE_MAP, BaseRenderComponent, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, COMPRESSED_TEXTURE, CONSTANT_MAP_BLEND, CONSTANT_MAP_DEPTH, CONSTANT_MAP_STENCIL_FUNC, CONSTANT_MAP_STENCIL_OP, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, ColorCurve, ColorPropertyPlayableAsset, ColorPropertyTrack, Component, Composition, CompositionComponent, CompositionSourceManager, 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, Engine, EventEmitter, EventSystem, Fake3DAnimationMode, Fake3DComponent, FilterMode, Float16ArrayWrapper, FloatPropertyPlayableAsset, FloatPropertyTrack, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, HELP_LINK, HitTestType, InteractComponent, InteractLoader, InteractMesh, Item, KTXTexture, LineSegments, LinearValue, Material, MaterialDataBlock, MaterialRenderType, MaterialTrack, Mesh, MeshCollider, ObjectBindingTrack, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, PassTextureCache, PathSegments, PluginSystem, 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, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteLoader, StaticValue, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TEXTURE_UNIFORM_MAP, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, ThreeComposition, ThreeDisplayObject, ThreeEngine, ThreeMaterial, ThreeSpriteComponent, ThreeTextComponent, ThreeTexture, Ticker, TimelineAsset, TimelineClip, TimelinePlayable, TrackAsset, TrackSortWrapper, TrackType, Transform, TransformAnimationPlayable, TransformPlayableAsset, TransformTrack, VFXItem, ValueGetter, Vector4Curve, Vector4PropertyPlayableAsset, Vector4PropertyTrack, addByOrder, addItem, addItemWithOrder, applyMixins, assertExist, asserts, base64ToFile, blend, calculateTranslation, canvasPool, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, createCopyShader, createGLContext, createKeyFrameMeta, createShape, createValueGetter, 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, getImageItemRenderInfo, 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, 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, setUniformValue, sortByOrder, index$1 as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecFill, vecMulCombine, version, vertexFormatType2GLType };
|
|
33126
33013
|
//# sourceMappingURL=index.mjs.map
|