@galacean/effects-core 2.1.0-alpha.7 → 2.1.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/comp-vfx-item.d.ts +1 -1
- package/dist/components/post-process-volume.d.ts +2 -3
- package/dist/components/shape-component.d.ts +1 -1
- package/dist/composition.d.ts +5 -3
- package/dist/index.js +575 -279
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +573 -279
- package/dist/index.mjs.map +1 -1
- package/dist/math/index.d.ts +1 -1
- package/dist/math/translate.d.ts +1 -1
- package/dist/math/value-getters/color-curve.d.ts +12 -0
- package/dist/math/value-getters/index.d.ts +4 -0
- package/dist/math/value-getters/value-getter-map.d.ts +2 -0
- package/dist/math/{value-getter.d.ts → value-getters/value-getter.d.ts} +3 -4
- package/dist/math/value-getters/vector4-curve.d.ts +12 -0
- package/dist/plugins/cal/calculate-item.d.ts +1 -0
- package/dist/plugins/cal/playable-graph.d.ts +1 -1
- package/dist/plugins/interact/interact-item.d.ts +11 -0
- package/dist/plugins/shape/graphics-path.d.ts +27 -1
- package/dist/plugins/shape/rectangle.d.ts +129 -0
- package/dist/plugins/shape/triangle.d.ts +89 -0
- package/dist/plugins/timeline/playable-assets/color-property-playable-asset.d.ts +7 -0
- package/dist/plugins/timeline/playable-assets/timeline-asset.d.ts +3 -0
- package/dist/plugins/timeline/playable-assets/vector4-property-playable-asset.d.ts +7 -0
- package/dist/plugins/timeline/playables/color-property-mixer-playable.d.ts +6 -0
- package/dist/plugins/timeline/playables/index.d.ts +3 -1
- package/dist/plugins/timeline/playables/{float-property-clip-playable.d.ts → property-clip-playable.d.ts} +3 -3
- package/dist/plugins/timeline/playables/vector4-property-mixer-playable.d.ts +6 -0
- package/dist/plugins/timeline/track-instance.d.ts +14 -0
- package/dist/plugins/timeline/track.d.ts +1 -1
- package/dist/plugins/timeline/tracks/color-property-track.d.ts +5 -0
- package/dist/plugins/timeline/tracks/float-property-track.d.ts +3 -5
- package/dist/plugins/timeline/tracks/index.d.ts +4 -0
- package/dist/plugins/timeline/tracks/material-track.d.ts +5 -0
- package/dist/plugins/timeline/tracks/property-track.d.ts +8 -0
- package/dist/plugins/timeline/tracks/sub-composition-track.d.ts +1 -1
- package/dist/plugins/timeline/tracks/vector4-property-track.d.ts +5 -0
- package/dist/render/index.d.ts +0 -1
- package/dist/render/render-frame.d.ts +5 -1
- package/dist/vfx-item.d.ts +0 -8
- package/package.json +2 -2
- package/dist/render/global-volume.d.ts +0 -17
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.0-alpha.
|
|
6
|
+
* Version: v2.1.0-alpha.8
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
@@ -956,7 +956,6 @@ var PluginSystem = /*#__PURE__*/ function() {
|
|
|
956
956
|
var pluginInfoMap = {
|
|
957
957
|
"alipay-downgrade": "@galacean/effects-plugin-alipay-downgrade",
|
|
958
958
|
"editor-gizmo": "@galacean/effects-plugin-editor-gizmo",
|
|
959
|
-
"tree": "@galacean/effects-plugin-model",
|
|
960
959
|
"model": "@galacean/effects-plugin-model",
|
|
961
960
|
"orientation-transformer": "@galacean/effects-plugin-orientation-transformer",
|
|
962
961
|
"spine": "@galacean/effects-plugin-spine"
|
|
@@ -1388,6 +1387,12 @@ var CameraClipMode;
|
|
|
1388
1387
|
/**
|
|
1389
1388
|
* 贝塞尔曲线四元数
|
|
1390
1389
|
*/ ValueType[ValueType["BEZIER_CURVE_QUAT"] = 23] = "BEZIER_CURVE_QUAT";
|
|
1390
|
+
/**
|
|
1391
|
+
* 颜色曲线
|
|
1392
|
+
*/ ValueType[ValueType["COLOR_CURVE"] = 24] = "COLOR_CURVE";
|
|
1393
|
+
/**
|
|
1394
|
+
* Vector4 曲线
|
|
1395
|
+
*/ ValueType[ValueType["VECTOR4_CURVE"] = 25] = "VECTOR4_CURVE";
|
|
1391
1396
|
})(ValueType || (ValueType = {}));
|
|
1392
1397
|
/**
|
|
1393
1398
|
* 关键帧类型
|
|
@@ -1624,10 +1629,15 @@ var DataType;
|
|
|
1624
1629
|
DataType["SpriteColorTrack"] = "SpriteColorTrack";
|
|
1625
1630
|
DataType["ActivationTrack"] = "ActivationTrack";
|
|
1626
1631
|
DataType["SubCompositionTrack"] = "SubCompositionTrack";
|
|
1632
|
+
DataType["FloatPropertyTrack"] = "FloatPropertyTrack";
|
|
1633
|
+
DataType["ColorPropertyTrack"] = "ColorPropertyTrack";
|
|
1634
|
+
DataType["Vector4PropertyTrack"] = "Vector4PropertyTrack";
|
|
1627
1635
|
DataType["TransformPlayableAsset"] = "TransformPlayableAsset";
|
|
1628
1636
|
DataType["SpriteColorPlayableAsset"] = "SpriteColorPlayableAsset";
|
|
1629
1637
|
DataType["ActivationPlayableAsset"] = "ActivationPlayableAsset";
|
|
1630
1638
|
DataType["SubCompositionPlayableAsset"] = "SubCompositionPlayableAsset";
|
|
1639
|
+
DataType["FloatPropertyPlayableAsset"] = "FloatPropertyPlayableAsset";
|
|
1640
|
+
DataType["ColorPropertyPlayableAsset"] = "ColorPropertyPlayableAsset";
|
|
1631
1641
|
// FIXME: 先完成ECS的场景转换,后面移到spec中
|
|
1632
1642
|
DataType["MeshComponent"] = "MeshComponent";
|
|
1633
1643
|
DataType["SkyboxComponent"] = "SkyboxComponent";
|
|
@@ -5247,9 +5257,8 @@ exports.PostProcessVolume = /*#__PURE__*/ function(Behaviour) {
|
|
|
5247
5257
|
function PostProcessVolume() {
|
|
5248
5258
|
var _this;
|
|
5249
5259
|
_this = Behaviour.apply(this, arguments) || this;
|
|
5250
|
-
_this.useHDR = true;
|
|
5251
5260
|
// Bloom
|
|
5252
|
-
_this.
|
|
5261
|
+
_this.bloomEnabled = true;
|
|
5253
5262
|
_this.threshold = 1.0;
|
|
5254
5263
|
_this.bloomIntensity = 1.0;
|
|
5255
5264
|
// ColorAdjustments
|
|
@@ -5261,7 +5270,7 @@ exports.PostProcessVolume = /*#__PURE__*/ function(Behaviour) {
|
|
|
5261
5270
|
_this.vignetteSmoothness = 0.4;
|
|
5262
5271
|
_this.vignetteRoundness = 1.0;
|
|
5263
5272
|
// ToneMapping
|
|
5264
|
-
_this.
|
|
5273
|
+
_this.toneMappingEnabled = true // 1: true, 0: false
|
|
5265
5274
|
;
|
|
5266
5275
|
return _this;
|
|
5267
5276
|
}
|
|
@@ -5269,18 +5278,14 @@ exports.PostProcessVolume = /*#__PURE__*/ function(Behaviour) {
|
|
|
5269
5278
|
_proto.onStart = function onStart() {
|
|
5270
5279
|
var composition = this.item.composition;
|
|
5271
5280
|
if (composition) {
|
|
5272
|
-
composition.globalVolume = this;
|
|
5273
|
-
composition.createRenderFrame();
|
|
5281
|
+
composition.renderFrame.globalVolume = this;
|
|
5274
5282
|
}
|
|
5275
5283
|
};
|
|
5276
5284
|
return PostProcessVolume;
|
|
5277
5285
|
}(Behaviour);
|
|
5278
5286
|
__decorate([
|
|
5279
5287
|
serialize()
|
|
5280
|
-
], exports.PostProcessVolume.prototype, "
|
|
5281
|
-
__decorate([
|
|
5282
|
-
serialize()
|
|
5283
|
-
], exports.PostProcessVolume.prototype, "useBloom", void 0);
|
|
5288
|
+
], exports.PostProcessVolume.prototype, "bloomEnabled", void 0);
|
|
5284
5289
|
__decorate([
|
|
5285
5290
|
serialize()
|
|
5286
5291
|
], exports.PostProcessVolume.prototype, "threshold", void 0);
|
|
@@ -5307,7 +5312,7 @@ __decorate([
|
|
|
5307
5312
|
], exports.PostProcessVolume.prototype, "vignetteRoundness", void 0);
|
|
5308
5313
|
__decorate([
|
|
5309
5314
|
serialize()
|
|
5310
|
-
], exports.PostProcessVolume.prototype, "
|
|
5315
|
+
], exports.PostProcessVolume.prototype, "toneMappingEnabled", void 0);
|
|
5311
5316
|
exports.PostProcessVolume = __decorate([
|
|
5312
5317
|
effectsClass("PostProcessVolume")
|
|
5313
5318
|
], exports.PostProcessVolume);
|
|
@@ -10344,13 +10349,15 @@ var BloomThresholdPass = /*#__PURE__*/ function(RenderPass) {
|
|
|
10344
10349
|
renderer.setFramebuffer(this.framebuffer);
|
|
10345
10350
|
};
|
|
10346
10351
|
_proto.execute = function execute(renderer) {
|
|
10352
|
+
var _renderer_renderingData_currentFrame_globalVolume;
|
|
10347
10353
|
renderer.clear({
|
|
10348
10354
|
colorAction: exports.TextureStoreAction.clear,
|
|
10349
10355
|
depthAction: exports.TextureStoreAction.clear,
|
|
10350
10356
|
stencilAction: exports.TextureStoreAction.clear
|
|
10351
10357
|
});
|
|
10352
10358
|
this.screenMesh.material.setTexture("_MainTex", this.mainTexture);
|
|
10353
|
-
var
|
|
10359
|
+
var _renderer_renderingData_currentFrame_globalVolume_threshold;
|
|
10360
|
+
var threshold = (_renderer_renderingData_currentFrame_globalVolume_threshold = (_renderer_renderingData_currentFrame_globalVolume = renderer.renderingData.currentFrame.globalVolume) == null ? void 0 : _renderer_renderingData_currentFrame_globalVolume.threshold) != null ? _renderer_renderingData_currentFrame_globalVolume_threshold : 1.0;
|
|
10354
10361
|
this.screenMesh.material.setFloat("_Threshold", threshold);
|
|
10355
10362
|
renderer.renderMeshes([
|
|
10356
10363
|
this.screenMesh
|
|
@@ -10563,13 +10570,14 @@ var ToneMappingPass = /*#__PURE__*/ function(RenderPass) {
|
|
|
10563
10570
|
depthAction: exports.TextureStoreAction.clear,
|
|
10564
10571
|
stencilAction: exports.TextureStoreAction.clear
|
|
10565
10572
|
});
|
|
10566
|
-
var _renderer_renderingData_currentFrame_globalVolume
|
|
10573
|
+
var _renderer_renderingData_currentFrame_globalVolume;
|
|
10574
|
+
var _ref = (_renderer_renderingData_currentFrame_globalVolume = renderer.renderingData.currentFrame.globalVolume) != null ? _renderer_renderingData_currentFrame_globalVolume : {}, _ref_bloomEnabled = _ref.bloomEnabled, bloomEnabled = _ref_bloomEnabled === void 0 ? false : _ref_bloomEnabled, _ref_bloomIntensity = _ref.bloomIntensity, bloomIntensity = _ref_bloomIntensity === void 0 ? 1.0 : _ref_bloomIntensity, _ref_brightness = _ref.brightness, brightness = _ref_brightness === void 0 ? 1.0 : _ref_brightness, _ref_saturation = _ref.saturation, saturation = _ref_saturation === void 0 ? 1.0 : _ref_saturation, _ref_contrast = _ref.contrast, contrast = _ref_contrast === void 0 ? 1.0 : _ref_contrast, _ref_toneMappingEnabled = _ref.toneMappingEnabled, toneMappingEnabled = _ref_toneMappingEnabled === void 0 ? true : _ref_toneMappingEnabled, _ref_vignetteIntensity = _ref.vignetteIntensity, vignetteIntensity = _ref_vignetteIntensity === void 0 ? 0.2 : _ref_vignetteIntensity, _ref_vignetteSmoothness = _ref.vignetteSmoothness, vignetteSmoothness = _ref_vignetteSmoothness === void 0 ? 0.4 : _ref_vignetteSmoothness, _ref_vignetteRoundness = _ref.vignetteRoundness, vignetteRoundness = _ref_vignetteRoundness === void 0 ? 1.0 : _ref_vignetteRoundness;
|
|
10567
10575
|
this.screenMesh.material.setTexture("_SceneTex", this.sceneTextureHandle.texture);
|
|
10568
10576
|
this.screenMesh.material.setFloat("_Brightness", brightness);
|
|
10569
10577
|
this.screenMesh.material.setFloat("_Saturation", saturation);
|
|
10570
10578
|
this.screenMesh.material.setFloat("_Contrast", contrast);
|
|
10571
|
-
this.screenMesh.material.setInt("_UseBloom", Number(
|
|
10572
|
-
if (
|
|
10579
|
+
this.screenMesh.material.setInt("_UseBloom", Number(bloomEnabled));
|
|
10580
|
+
if (bloomEnabled) {
|
|
10573
10581
|
this.screenMesh.material.setTexture("_GaussianTex", this.mainTexture);
|
|
10574
10582
|
this.screenMesh.material.setFloat("_BloomIntensity", bloomIntensity);
|
|
10575
10583
|
}
|
|
@@ -10580,7 +10588,7 @@ var ToneMappingPass = /*#__PURE__*/ function(RenderPass) {
|
|
|
10580
10588
|
this.screenMesh.material.setVector2("_VignetteCenter", new Vector2(0.5, 0.5));
|
|
10581
10589
|
this.screenMesh.material.setVector3("_VignetteColor", new Vector3(0.0, 0.0, 0.0));
|
|
10582
10590
|
}
|
|
10583
|
-
this.screenMesh.material.setInt("_UseToneMapping", Number(
|
|
10591
|
+
this.screenMesh.material.setInt("_UseToneMapping", Number(toneMappingEnabled));
|
|
10584
10592
|
renderer.renderMeshes([
|
|
10585
10593
|
this.screenMesh
|
|
10586
10594
|
]);
|
|
@@ -10604,7 +10612,7 @@ var seed$5 = 1;
|
|
|
10604
10612
|
1,
|
|
10605
10613
|
0,
|
|
10606
10614
|
0
|
|
10607
|
-
] : _options_editorTransform, globalVolume = options.globalVolume, _options_clearAction = options.clearAction, clearAction = _options_clearAction === void 0 ? {
|
|
10615
|
+
] : _options_editorTransform, globalVolume = options.globalVolume, _options_postProcessingEnabled = options.postProcessingEnabled, postProcessingEnabled = _options_postProcessingEnabled === void 0 ? false : _options_postProcessingEnabled, _options_clearAction = options.clearAction, clearAction = _options_clearAction === void 0 ? {
|
|
10608
10616
|
colorAction: exports.TextureLoadAction.whatever,
|
|
10609
10617
|
stencilAction: exports.TextureLoadAction.clear,
|
|
10610
10618
|
depthAction: exports.TextureLoadAction.whatever
|
|
@@ -10618,10 +10626,10 @@ var seed$5 = 1;
|
|
|
10618
10626
|
var depthStencilAttachment;
|
|
10619
10627
|
var drawObjectPassClearAction = {};
|
|
10620
10628
|
this.renderer = renderer;
|
|
10621
|
-
if (
|
|
10622
|
-
var
|
|
10629
|
+
if (postProcessingEnabled) {
|
|
10630
|
+
var enableHDR = true;
|
|
10623
10631
|
// 使用HDR浮点纹理,FLOAT在IOS上报错,使用HALF_FLOAT
|
|
10624
|
-
var textureType =
|
|
10632
|
+
var textureType = enableHDR ? glContext.HALF_FLOAT : glContext.UNSIGNED_BYTE;
|
|
10625
10633
|
attachments = [
|
|
10626
10634
|
{
|
|
10627
10635
|
texture: {
|
|
@@ -10653,7 +10661,7 @@ var seed$5 = 1;
|
|
|
10653
10661
|
})
|
|
10654
10662
|
];
|
|
10655
10663
|
this.setRenderPasses(renderPasses);
|
|
10656
|
-
if (
|
|
10664
|
+
if (postProcessingEnabled) {
|
|
10657
10665
|
var sceneTextureHandle = new RenderTargetHandle(engine); //保存后处理前的屏幕图像
|
|
10658
10666
|
var gaussianStep = 7; // 高斯模糊的迭代次数,次数越高模糊范围越大
|
|
10659
10667
|
var viewport = [
|
|
@@ -10663,7 +10671,8 @@ var seed$5 = 1;
|
|
|
10663
10671
|
this.renderer.getHeight() / 2
|
|
10664
10672
|
];
|
|
10665
10673
|
var gaussianDownResults = new Array(gaussianStep); //存放多个高斯Pass的模糊结果,用于Bloom
|
|
10666
|
-
var
|
|
10674
|
+
var enableHDR1 = true;
|
|
10675
|
+
var textureType1 = enableHDR1 ? glContext.HALF_FLOAT : glContext.UNSIGNED_BYTE;
|
|
10667
10676
|
var bloomThresholdPass = new BloomThresholdPass(renderer, {
|
|
10668
10677
|
name: "BloomThresholdPass",
|
|
10669
10678
|
attachments: [
|
|
@@ -11659,28 +11668,6 @@ var Renderer = /*#__PURE__*/ function() {
|
|
|
11659
11668
|
return Renderer;
|
|
11660
11669
|
}();
|
|
11661
11670
|
|
|
11662
|
-
/**
|
|
11663
|
-
* 后处理配置
|
|
11664
|
-
*/ var defaultGlobalVolume = {
|
|
11665
|
-
useHDR: false,
|
|
11666
|
-
/***** Material Uniform *****/ // Bloom
|
|
11667
|
-
useBloom: true,
|
|
11668
|
-
threshold: 1.0,
|
|
11669
|
-
bloomIntensity: 1.0,
|
|
11670
|
-
// ColorAdjustments
|
|
11671
|
-
brightness: 1.0,
|
|
11672
|
-
saturation: 1.0,
|
|
11673
|
-
contrast: 1.0,
|
|
11674
|
-
// Vignette
|
|
11675
|
-
// vignetteColor: new math.Color(0, 0, 0, 1),
|
|
11676
|
-
// vignetteCenter: new math.Vector2(0.5, 0.5),
|
|
11677
|
-
vignetteIntensity: 0.2,
|
|
11678
|
-
vignetteSmoothness: 0.4,
|
|
11679
|
-
vignetteRoundness: 1.0,
|
|
11680
|
-
// ToneMapping
|
|
11681
|
-
useToneMapping: true
|
|
11682
|
-
};
|
|
11683
|
-
|
|
11684
11671
|
var toHalf = function() {
|
|
11685
11672
|
var floatView = new Float32Array(1);
|
|
11686
11673
|
var int32View = new Int32Array(floatView.buffer);
|
|
@@ -11919,35 +11906,6 @@ function numberToFix(a, fixed) {
|
|
|
11919
11906
|
return Math.floor(a * base) / base;
|
|
11920
11907
|
}
|
|
11921
11908
|
|
|
11922
|
-
function _is_native_reflect_construct() {
|
|
11923
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
11924
|
-
if (Reflect.construct.sham) return false;
|
|
11925
|
-
if (typeof Proxy === "function") return true;
|
|
11926
|
-
try {
|
|
11927
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
11928
|
-
return true;
|
|
11929
|
-
} catch (e) {
|
|
11930
|
-
return false;
|
|
11931
|
-
}
|
|
11932
|
-
}
|
|
11933
|
-
|
|
11934
|
-
function _construct(Parent, args, Class) {
|
|
11935
|
-
if (_is_native_reflect_construct()) _construct = Reflect.construct;
|
|
11936
|
-
else {
|
|
11937
|
-
_construct = function construct(Parent, args, Class) {
|
|
11938
|
-
var a = [
|
|
11939
|
-
null
|
|
11940
|
-
];
|
|
11941
|
-
a.push.apply(a, args);
|
|
11942
|
-
var Constructor = Function.bind.apply(Parent, a);
|
|
11943
|
-
var instance = new Constructor();
|
|
11944
|
-
if (Class) _set_prototype_of(instance, Class.prototype);
|
|
11945
|
-
return instance;
|
|
11946
|
-
};
|
|
11947
|
-
}
|
|
11948
|
-
return _construct.apply(null, arguments);
|
|
11949
|
-
}
|
|
11950
|
-
|
|
11951
11909
|
var keyframeInfo = {
|
|
11952
11910
|
/**
|
|
11953
11911
|
* 根据不同关键帧类型,获取位于曲线上的点
|
|
@@ -12491,17 +12449,6 @@ var QuaternionInner = /*#__PURE__*/ function() {
|
|
|
12491
12449
|
return QuaternionInner;
|
|
12492
12450
|
}();
|
|
12493
12451
|
|
|
12494
|
-
var SPRITE_VERTEX_STRIDE = 6;
|
|
12495
|
-
var SEMANTIC_PRE_COLOR_ATTACHMENT_0 = "PRE_COLOR_0";
|
|
12496
|
-
var SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0 = "PRE_COLOR_SIZE_0";
|
|
12497
|
-
var SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0 = "PRE_MAIN_COLOR_0";
|
|
12498
|
-
var SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0 = "PRE_MAIN_COLOR_SIZE_0";
|
|
12499
|
-
var PLAYER_OPTIONS_ENV_EDITOR = "editor";
|
|
12500
|
-
var HELP_LINK = {
|
|
12501
|
-
"Item duration can't be less than 0": "https://galacean.antgroup.com/effects/user/gasrv4ka5sacrwpg#AOnQS",
|
|
12502
|
-
"ValueType: 21/22 is not supported": "https://galacean.antgroup.com/effects/user/gasrv4ka5sacrwpg#smO1b"
|
|
12503
|
-
};
|
|
12504
|
-
|
|
12505
12452
|
var CURVE_PRO_TIME = 0;
|
|
12506
12453
|
var CURVE_PRO_VALUE = 1;
|
|
12507
12454
|
var CURVE_PRO_IN_TANGENT = 2;
|
|
@@ -13192,67 +13139,6 @@ var BezierCurveQuat = /*#__PURE__*/ function(ValueGetter) {
|
|
|
13192
13139
|
};
|
|
13193
13140
|
return BezierCurveQuat;
|
|
13194
13141
|
}(ValueGetter);
|
|
13195
|
-
var _obj$3;
|
|
13196
|
-
var map$1 = (_obj$3 = {}, _obj$3[ValueType.RANDOM] = function(props) {
|
|
13197
|
-
if (_instanceof1(props[0], Array)) {
|
|
13198
|
-
return new RandomVectorValue(props);
|
|
13199
|
-
}
|
|
13200
|
-
return new RandomValue(props);
|
|
13201
|
-
}, _obj$3[ValueType.CONSTANT] = function(props) {
|
|
13202
|
-
return new StaticValue(props);
|
|
13203
|
-
}, _obj$3[ValueType.CONSTANT_VEC2] = function(props) {
|
|
13204
|
-
return new StaticValue(props);
|
|
13205
|
-
}, _obj$3[ValueType.CONSTANT_VEC3] = function(props) {
|
|
13206
|
-
return new StaticValue(props);
|
|
13207
|
-
}, _obj$3[ValueType.CONSTANT_VEC4] = function(props) {
|
|
13208
|
-
return new StaticValue(props);
|
|
13209
|
-
}, _obj$3[ValueType.RGBA_COLOR] = function(props) {
|
|
13210
|
-
return new StaticValue(props);
|
|
13211
|
-
}, _obj$3[ValueType.COLORS] = function(props) {
|
|
13212
|
-
return new RandomSetValue(props.map(function(c) {
|
|
13213
|
-
return colorToArr$1(c, false);
|
|
13214
|
-
}));
|
|
13215
|
-
}, _obj$3[ValueType.LINE] = function(props) {
|
|
13216
|
-
if (props.length === 2 && props[0][0] === 0 && props[1][0] === 1) {
|
|
13217
|
-
return new LinearValue([
|
|
13218
|
-
props[0][1],
|
|
13219
|
-
props[1][1]
|
|
13220
|
-
]);
|
|
13221
|
-
}
|
|
13222
|
-
return new LineSegments(props);
|
|
13223
|
-
}, _obj$3[ValueType.GRADIENT_COLOR] = function(props) {
|
|
13224
|
-
return new GradientValue(props);
|
|
13225
|
-
}, _obj$3[ValueType.LINEAR_PATH] = function(pros) {
|
|
13226
|
-
return new PathSegments(pros);
|
|
13227
|
-
}, _obj$3[ValueType.BEZIER_CURVE] = function(props) {
|
|
13228
|
-
if (props.length === 1) {
|
|
13229
|
-
return new StaticValue(props[0][1][1]);
|
|
13230
|
-
}
|
|
13231
|
-
return new BezierCurve(props);
|
|
13232
|
-
}, _obj$3[ValueType.BEZIER_CURVE_PATH] = function(props) {
|
|
13233
|
-
if (props[0].length === 1) {
|
|
13234
|
-
return new StaticValue(_construct(Vector3, [].concat(props[1][0])));
|
|
13235
|
-
}
|
|
13236
|
-
return new BezierCurvePath(props);
|
|
13237
|
-
}, _obj$3[ValueType.BEZIER_CURVE_QUAT] = function(props) {
|
|
13238
|
-
if (props[0].length === 1) {
|
|
13239
|
-
return new StaticValue(_construct(Quaternion, [].concat(props[1][0])));
|
|
13240
|
-
}
|
|
13241
|
-
return new BezierCurveQuat(props);
|
|
13242
|
-
}, _obj$3);
|
|
13243
|
-
function createValueGetter(args) {
|
|
13244
|
-
if (!args || !isNaN(+args)) {
|
|
13245
|
-
return new StaticValue(args || 0);
|
|
13246
|
-
}
|
|
13247
|
-
if (_instanceof1(args, ValueGetter)) {
|
|
13248
|
-
return args;
|
|
13249
|
-
}
|
|
13250
|
-
if (isFunction(map$1[args[0]])) {
|
|
13251
|
-
return map$1[args[0]](args[1]);
|
|
13252
|
-
} else {
|
|
13253
|
-
throw new Error("ValueType: " + args[0] + " is not supported, see " + HELP_LINK["ValueType: 21/22 is not supported"] + ".");
|
|
13254
|
-
}
|
|
13255
|
-
}
|
|
13256
13142
|
function lineSegIntegrate(t, t0, t1, y0, y1) {
|
|
13257
13143
|
var h = t - t0;
|
|
13258
13144
|
return (y0 + y0 + (y1 - y0) * h / (t1 - t0)) * h / 2;
|
|
@@ -13329,6 +13215,164 @@ function createKeyFrameMeta() {
|
|
|
13329
13215
|
};
|
|
13330
13216
|
}
|
|
13331
13217
|
|
|
13218
|
+
function _is_native_reflect_construct() {
|
|
13219
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
13220
|
+
if (Reflect.construct.sham) return false;
|
|
13221
|
+
if (typeof Proxy === "function") return true;
|
|
13222
|
+
try {
|
|
13223
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
13224
|
+
return true;
|
|
13225
|
+
} catch (e) {
|
|
13226
|
+
return false;
|
|
13227
|
+
}
|
|
13228
|
+
}
|
|
13229
|
+
|
|
13230
|
+
function _construct(Parent, args, Class) {
|
|
13231
|
+
if (_is_native_reflect_construct()) _construct = Reflect.construct;
|
|
13232
|
+
else {
|
|
13233
|
+
_construct = function construct(Parent, args, Class) {
|
|
13234
|
+
var a = [
|
|
13235
|
+
null
|
|
13236
|
+
];
|
|
13237
|
+
a.push.apply(a, args);
|
|
13238
|
+
var Constructor = Function.bind.apply(Parent, a);
|
|
13239
|
+
var instance = new Constructor();
|
|
13240
|
+
if (Class) _set_prototype_of(instance, Class.prototype);
|
|
13241
|
+
return instance;
|
|
13242
|
+
};
|
|
13243
|
+
}
|
|
13244
|
+
return _construct.apply(null, arguments);
|
|
13245
|
+
}
|
|
13246
|
+
|
|
13247
|
+
var Vector4Curve = /*#__PURE__*/ function(ValueGetter) {
|
|
13248
|
+
_inherits(Vector4Curve, ValueGetter);
|
|
13249
|
+
function Vector4Curve() {
|
|
13250
|
+
var _this;
|
|
13251
|
+
_this = ValueGetter.apply(this, arguments) || this;
|
|
13252
|
+
_this.value = new Vector4();
|
|
13253
|
+
return _this;
|
|
13254
|
+
}
|
|
13255
|
+
var _proto = Vector4Curve.prototype;
|
|
13256
|
+
_proto.onCreate = function onCreate(arg) {
|
|
13257
|
+
this.xCurve = createValueGetter(arg.x);
|
|
13258
|
+
this.yCurve = createValueGetter(arg.y);
|
|
13259
|
+
this.zCurve = createValueGetter(arg.z);
|
|
13260
|
+
this.wCurve = createValueGetter(arg.w);
|
|
13261
|
+
};
|
|
13262
|
+
_proto.getValue = function getValue(t) {
|
|
13263
|
+
var x = this.xCurve.getValue(t);
|
|
13264
|
+
var y = this.yCurve.getValue(t);
|
|
13265
|
+
var z = this.zCurve.getValue(t);
|
|
13266
|
+
var w = this.wCurve.getValue(t);
|
|
13267
|
+
this.value.set(x, y, z, w);
|
|
13268
|
+
return this.value;
|
|
13269
|
+
};
|
|
13270
|
+
return Vector4Curve;
|
|
13271
|
+
}(ValueGetter);
|
|
13272
|
+
|
|
13273
|
+
var SPRITE_VERTEX_STRIDE = 6;
|
|
13274
|
+
var SEMANTIC_PRE_COLOR_ATTACHMENT_0 = "PRE_COLOR_0";
|
|
13275
|
+
var SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0 = "PRE_COLOR_SIZE_0";
|
|
13276
|
+
var SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0 = "PRE_MAIN_COLOR_0";
|
|
13277
|
+
var SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0 = "PRE_MAIN_COLOR_SIZE_0";
|
|
13278
|
+
var PLAYER_OPTIONS_ENV_EDITOR = "editor";
|
|
13279
|
+
var HELP_LINK = {
|
|
13280
|
+
"Item duration can't be less than 0": "https://galacean.antgroup.com/effects/user/gasrv4ka5sacrwpg#AOnQS",
|
|
13281
|
+
"ValueType: 21/22 is not supported": "https://galacean.antgroup.com/effects/user/gasrv4ka5sacrwpg#smO1b"
|
|
13282
|
+
};
|
|
13283
|
+
|
|
13284
|
+
var _obj$3;
|
|
13285
|
+
var map$1 = (_obj$3 = {}, _obj$3[ValueType.RANDOM] = function(props) {
|
|
13286
|
+
if (_instanceof1(props[0], Array)) {
|
|
13287
|
+
return new RandomVectorValue(props);
|
|
13288
|
+
}
|
|
13289
|
+
return new RandomValue(props);
|
|
13290
|
+
}, _obj$3[ValueType.CONSTANT] = function(props) {
|
|
13291
|
+
return new StaticValue(props);
|
|
13292
|
+
}, _obj$3[ValueType.CONSTANT_VEC2] = function(props) {
|
|
13293
|
+
return new StaticValue(props);
|
|
13294
|
+
}, _obj$3[ValueType.CONSTANT_VEC3] = function(props) {
|
|
13295
|
+
return new StaticValue(props);
|
|
13296
|
+
}, _obj$3[ValueType.CONSTANT_VEC4] = function(props) {
|
|
13297
|
+
return new StaticValue(props);
|
|
13298
|
+
}, _obj$3[ValueType.RGBA_COLOR] = function(props) {
|
|
13299
|
+
return new StaticValue(props);
|
|
13300
|
+
}, _obj$3[ValueType.COLORS] = function(props) {
|
|
13301
|
+
return new RandomSetValue(props.map(function(c) {
|
|
13302
|
+
return colorToArr$1(c, false);
|
|
13303
|
+
}));
|
|
13304
|
+
}, _obj$3[ValueType.LINE] = function(props) {
|
|
13305
|
+
if (props.length === 2 && props[0][0] === 0 && props[1][0] === 1) {
|
|
13306
|
+
return new LinearValue([
|
|
13307
|
+
props[0][1],
|
|
13308
|
+
props[1][1]
|
|
13309
|
+
]);
|
|
13310
|
+
}
|
|
13311
|
+
return new LineSegments(props);
|
|
13312
|
+
}, _obj$3[ValueType.GRADIENT_COLOR] = function(props) {
|
|
13313
|
+
return new GradientValue(props);
|
|
13314
|
+
}, _obj$3[ValueType.LINEAR_PATH] = function(pros) {
|
|
13315
|
+
return new PathSegments(pros);
|
|
13316
|
+
}, _obj$3[ValueType.BEZIER_CURVE] = function(props) {
|
|
13317
|
+
if (props.length === 1) {
|
|
13318
|
+
return new StaticValue(props[0][1][1]);
|
|
13319
|
+
}
|
|
13320
|
+
return new BezierCurve(props);
|
|
13321
|
+
}, _obj$3[ValueType.BEZIER_CURVE_PATH] = function(props) {
|
|
13322
|
+
if (props[0].length === 1) {
|
|
13323
|
+
return new StaticValue(_construct(Vector3, [].concat(props[1][0])));
|
|
13324
|
+
}
|
|
13325
|
+
return new BezierCurvePath(props);
|
|
13326
|
+
}, _obj$3[ValueType.BEZIER_CURVE_QUAT] = function(props) {
|
|
13327
|
+
if (props[0].length === 1) {
|
|
13328
|
+
return new StaticValue(_construct(Quaternion, [].concat(props[1][0])));
|
|
13329
|
+
}
|
|
13330
|
+
return new BezierCurveQuat(props);
|
|
13331
|
+
}, _obj$3[ValueType.COLOR_CURVE] = function(props) {
|
|
13332
|
+
return new ColorCurve(props);
|
|
13333
|
+
}, _obj$3[ValueType.VECTOR4_CURVE] = function(props) {
|
|
13334
|
+
return new Vector4Curve(props);
|
|
13335
|
+
}, _obj$3);
|
|
13336
|
+
function createValueGetter(args) {
|
|
13337
|
+
if (!args || !isNaN(+args)) {
|
|
13338
|
+
return new StaticValue(args || 0);
|
|
13339
|
+
}
|
|
13340
|
+
if (_instanceof1(args, ValueGetter)) {
|
|
13341
|
+
return args;
|
|
13342
|
+
}
|
|
13343
|
+
if (isFunction(map$1[args[0]])) {
|
|
13344
|
+
return map$1[args[0]](args[1]);
|
|
13345
|
+
} else {
|
|
13346
|
+
throw new Error("ValueType: " + args[0] + " is not supported, see " + HELP_LINK["ValueType: 21/22 is not supported"] + ".");
|
|
13347
|
+
}
|
|
13348
|
+
}
|
|
13349
|
+
|
|
13350
|
+
var ColorCurve = /*#__PURE__*/ function(ValueGetter) {
|
|
13351
|
+
_inherits(ColorCurve, ValueGetter);
|
|
13352
|
+
function ColorCurve() {
|
|
13353
|
+
var _this;
|
|
13354
|
+
_this = ValueGetter.apply(this, arguments) || this;
|
|
13355
|
+
_this.value = new Color();
|
|
13356
|
+
return _this;
|
|
13357
|
+
}
|
|
13358
|
+
var _proto = ColorCurve.prototype;
|
|
13359
|
+
_proto.onCreate = function onCreate(arg) {
|
|
13360
|
+
this.rCurve = createValueGetter(arg.r);
|
|
13361
|
+
this.gCurve = createValueGetter(arg.g);
|
|
13362
|
+
this.bCurve = createValueGetter(arg.b);
|
|
13363
|
+
this.aCurve = createValueGetter(arg.a);
|
|
13364
|
+
};
|
|
13365
|
+
_proto.getValue = function getValue(t) {
|
|
13366
|
+
var r = this.rCurve.getValue(t);
|
|
13367
|
+
var g = this.gCurve.getValue(t);
|
|
13368
|
+
var b = this.bCurve.getValue(t);
|
|
13369
|
+
var a = this.aCurve.getValue(t);
|
|
13370
|
+
this.value.set(r, g, b, a);
|
|
13371
|
+
return this.value;
|
|
13372
|
+
};
|
|
13373
|
+
return ColorCurve;
|
|
13374
|
+
}(ValueGetter);
|
|
13375
|
+
|
|
13332
13376
|
var BaseRenderComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
13333
13377
|
_inherits(BaseRenderComponent, RendererComponent);
|
|
13334
13378
|
function BaseRenderComponent(engine) {
|
|
@@ -15364,7 +15408,12 @@ var GraphicsPath = /*#__PURE__*/ function() {
|
|
|
15364
15408
|
this.dirty = true;
|
|
15365
15409
|
return this;
|
|
15366
15410
|
};
|
|
15367
|
-
|
|
15411
|
+
/**
|
|
15412
|
+
* Sets the starting point for a new sub-path. Any subsequent drawing commands are considered part of this path.
|
|
15413
|
+
* @param x - The x-coordinate for the starting point.
|
|
15414
|
+
* @param y - The y-coordinate for the starting point.
|
|
15415
|
+
* @returns The instance of the current object for chaining.
|
|
15416
|
+
*/ _proto.moveTo = function moveTo(x, y) {
|
|
15368
15417
|
this.instructions.push({
|
|
15369
15418
|
action: "moveTo",
|
|
15370
15419
|
data: [
|
|
@@ -15375,7 +15424,16 @@ var GraphicsPath = /*#__PURE__*/ function() {
|
|
|
15375
15424
|
this.dirty = true;
|
|
15376
15425
|
return this;
|
|
15377
15426
|
};
|
|
15378
|
-
|
|
15427
|
+
/**
|
|
15428
|
+
* Draws an ellipse at the specified location and with the given x and y radii.
|
|
15429
|
+
* An optional transformation can be applied, allowing for rotation, scaling, and translation.
|
|
15430
|
+
* @param x - The x-coordinate of the center of the ellipse.
|
|
15431
|
+
* @param y - The y-coordinate of the center of the ellipse.
|
|
15432
|
+
* @param radiusX - The horizontal radius of the ellipse.
|
|
15433
|
+
* @param radiusY - The vertical radius of the ellipse.
|
|
15434
|
+
* @param transform - An optional `Matrix` object to apply a transformation to the ellipse. This can include rotations.
|
|
15435
|
+
* @returns The instance of the current object for chaining.
|
|
15436
|
+
*/ _proto.ellipse = function ellipse(x, y, radiusX, radiusY, transform) {
|
|
15379
15437
|
this.instructions.push({
|
|
15380
15438
|
action: "ellipse",
|
|
15381
15439
|
data: [
|
|
@@ -15383,7 +15441,29 @@ var GraphicsPath = /*#__PURE__*/ function() {
|
|
|
15383
15441
|
y,
|
|
15384
15442
|
radiusX,
|
|
15385
15443
|
radiusY,
|
|
15386
|
-
|
|
15444
|
+
transform
|
|
15445
|
+
]
|
|
15446
|
+
});
|
|
15447
|
+
this.dirty = true;
|
|
15448
|
+
return this;
|
|
15449
|
+
};
|
|
15450
|
+
/**
|
|
15451
|
+
* Draws a rectangle shape. This method adds a new rectangle path to the current drawing.
|
|
15452
|
+
* @param x - The x-coordinate of the top-left corner of the rectangle.
|
|
15453
|
+
* @param y - The y-coordinate of the top-left corner of the rectangle.
|
|
15454
|
+
* @param w - The width of the rectangle.
|
|
15455
|
+
* @param h - The height of the rectangle.
|
|
15456
|
+
* @param transform - An optional `Matrix` object to apply a transformation to the rectangle.
|
|
15457
|
+
* @returns The instance of the current object for chaining.
|
|
15458
|
+
*/ _proto.rect = function rect(x, y, w, h, transform) {
|
|
15459
|
+
this.instructions.push({
|
|
15460
|
+
action: "rect",
|
|
15461
|
+
data: [
|
|
15462
|
+
x,
|
|
15463
|
+
y,
|
|
15464
|
+
w,
|
|
15465
|
+
h,
|
|
15466
|
+
transform
|
|
15387
15467
|
]
|
|
15388
15468
|
});
|
|
15389
15469
|
this.dirty = true;
|
|
@@ -15422,9 +15502,9 @@ exports.ShapeComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
15422
15502
|
_this = RendererComponent.call(this, engine) || this;
|
|
15423
15503
|
_this.path = new GraphicsPath();
|
|
15424
15504
|
_this.curveValues = [];
|
|
15425
|
-
_this.
|
|
15426
|
-
_this.vert = "\nprecision highp float;\n\nattribute vec3 aPos;//x y\n\
|
|
15427
|
-
_this.frag = "\nprecision highp float;\n\
|
|
15505
|
+
_this.animated = false;
|
|
15506
|
+
_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";
|
|
15507
|
+
_this.frag = "\nprecision highp float;\n\nuniform vec4 _Color;\n\nvoid main() {\n vec4 color = _Color;\n gl_FragColor = color;\n}\n";
|
|
15428
15508
|
if (!_this.geometry) {
|
|
15429
15509
|
_this.geometry = Geometry.create(engine, {
|
|
15430
15510
|
attributes: {
|
|
@@ -15474,10 +15554,9 @@ exports.ShapeComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
15474
15554
|
}
|
|
15475
15555
|
var _proto = ShapeComponent.prototype;
|
|
15476
15556
|
_proto.onUpdate = function onUpdate(dt) {
|
|
15477
|
-
if (this.
|
|
15557
|
+
if (this.animated) {
|
|
15478
15558
|
this.buildPath(this.data);
|
|
15479
15559
|
this.buildGeometryFromPath(this.path.shapePath);
|
|
15480
|
-
// this.dirty = false;
|
|
15481
15560
|
}
|
|
15482
15561
|
};
|
|
15483
15562
|
_proto.render = function render(renderer) {
|
|
@@ -15584,7 +15663,7 @@ exports.ShapeComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
15584
15663
|
_proto.fromData = function fromData(data) {
|
|
15585
15664
|
RendererComponent.prototype.fromData.call(this, data);
|
|
15586
15665
|
this.data = data;
|
|
15587
|
-
this.
|
|
15666
|
+
this.animated = true;
|
|
15588
15667
|
};
|
|
15589
15668
|
return ShapeComponent;
|
|
15590
15669
|
}(RendererComponent);
|
|
@@ -15972,6 +16051,18 @@ exports.InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
15972
16051
|
1,
|
|
15973
16052
|
1
|
|
15974
16053
|
];
|
|
16054
|
+
/**
|
|
16055
|
+
* 拖拽X范围
|
|
16056
|
+
*/ _this.dragRange = {
|
|
16057
|
+
dxRange: [
|
|
16058
|
+
0,
|
|
16059
|
+
0
|
|
16060
|
+
],
|
|
16061
|
+
dyRange: [
|
|
16062
|
+
0,
|
|
16063
|
+
0
|
|
16064
|
+
]
|
|
16065
|
+
};
|
|
15975
16066
|
/** 是否响应点击和拖拽交互事件 */ _this._interactive = true;
|
|
15976
16067
|
_this.hasBeenAddedToComposition = false;
|
|
15977
16068
|
_this.getHitTestParams = function(force) {
|
|
@@ -15991,6 +16082,24 @@ exports.InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
15991
16082
|
return _this;
|
|
15992
16083
|
}
|
|
15993
16084
|
var _proto = InteractComponent.prototype;
|
|
16085
|
+
_proto.getDragRangeX = function getDragRangeX() {
|
|
16086
|
+
return this.dragRange.dxRange;
|
|
16087
|
+
};
|
|
16088
|
+
_proto.setDragRangeX = function setDragRangeX(min, max) {
|
|
16089
|
+
this.dragRange.dxRange = [
|
|
16090
|
+
min,
|
|
16091
|
+
max
|
|
16092
|
+
];
|
|
16093
|
+
};
|
|
16094
|
+
_proto.getDragRangeY = function getDragRangeY() {
|
|
16095
|
+
return this.dragRange.dyRange;
|
|
16096
|
+
};
|
|
16097
|
+
_proto.setDragRangeY = function setDragRangeY(min, max) {
|
|
16098
|
+
this.dragRange.dyRange = [
|
|
16099
|
+
min,
|
|
16100
|
+
max
|
|
16101
|
+
];
|
|
16102
|
+
};
|
|
15994
16103
|
_proto.onStart = function onStart() {
|
|
15995
16104
|
var _this = this;
|
|
15996
16105
|
var options = this.item.props.content.options;
|
|
@@ -16034,6 +16143,10 @@ exports.InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16034
16143
|
}
|
|
16035
16144
|
(_this_previewContent = this.previewContent) == null ? void 0 : _this_previewContent.updateMesh();
|
|
16036
16145
|
if (!this.hasBeenAddedToComposition && this.item.composition) {
|
|
16146
|
+
var type = this.interactData.options.type;
|
|
16147
|
+
if (type === InteractType.CLICK) {
|
|
16148
|
+
this.clickable = true;
|
|
16149
|
+
}
|
|
16037
16150
|
var options = this.item.props.content.options;
|
|
16038
16151
|
this.item.composition.addInteractiveItem(this.item, options.type);
|
|
16039
16152
|
this.hasBeenAddedToComposition = true;
|
|
@@ -16065,7 +16178,6 @@ exports.InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16065
16178
|
if (!(evt == null ? void 0 : evt.cameraParam) || !this.canInteract() || !this.item.composition) {
|
|
16066
16179
|
return;
|
|
16067
16180
|
}
|
|
16068
|
-
var options = this.item.props.content.options;
|
|
16069
16181
|
var _evt_cameraParam = evt.cameraParam, position = _evt_cameraParam.position, fov = _evt_cameraParam.fov;
|
|
16070
16182
|
var dy = event.dy;
|
|
16071
16183
|
var dx = event.dx * event.width / event.height;
|
|
@@ -16073,23 +16185,20 @@ exports.InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16073
16185
|
var sp = Math.tan(fov * Math.PI / 180 / 2) * Math.abs(depth);
|
|
16074
16186
|
var height = dy * sp;
|
|
16075
16187
|
var width = dx * sp;
|
|
16188
|
+
var _this_dragRange = this.dragRange, dxRange = _this_dragRange.dxRange, dyRange = _this_dragRange.dyRange;
|
|
16076
16189
|
var nx = position[0] - this.dragRatio[0] * width;
|
|
16077
16190
|
var ny = position[1] - this.dragRatio[1] * height;
|
|
16078
|
-
|
|
16079
|
-
|
|
16080
|
-
|
|
16081
|
-
|
|
16082
|
-
|
|
16083
|
-
|
|
16084
|
-
|
|
16085
|
-
}
|
|
16086
|
-
if (
|
|
16087
|
-
var
|
|
16088
|
-
|
|
16089
|
-
if (ny !== min1 && ny !== max1 && min1 !== max1) {
|
|
16090
|
-
var _event_origin1;
|
|
16091
|
-
(_event_origin1 = event.origin) == null ? void 0 : _event_origin1.preventDefault();
|
|
16092
|
-
}
|
|
16191
|
+
var xMin = dxRange[0], xMax = dxRange[1];
|
|
16192
|
+
var yMin = dyRange[0], yMax = dyRange[1];
|
|
16193
|
+
nx = clamp$1(nx, xMin, xMax);
|
|
16194
|
+
ny = clamp$1(ny, yMin, yMax);
|
|
16195
|
+
if (nx !== xMin && nx !== xMax && xMin !== xMax) {
|
|
16196
|
+
var _event_origin;
|
|
16197
|
+
(_event_origin = event.origin) == null ? void 0 : _event_origin.preventDefault();
|
|
16198
|
+
}
|
|
16199
|
+
if (ny !== yMin && ny !== yMax && yMin !== yMax) {
|
|
16200
|
+
var _event_origin1;
|
|
16201
|
+
(_event_origin1 = event.origin) == null ? void 0 : _event_origin1.preventDefault();
|
|
16093
16202
|
}
|
|
16094
16203
|
this.item.composition.camera.position = new Vector3(nx, ny, depth);
|
|
16095
16204
|
};
|
|
@@ -16170,6 +16279,15 @@ exports.InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16170
16279
|
_proto.fromData = function fromData(data) {
|
|
16171
16280
|
RendererComponent.prototype.fromData.call(this, data);
|
|
16172
16281
|
this.interactData = data;
|
|
16282
|
+
if (data.options.type === InteractType.DRAG) {
|
|
16283
|
+
var options = data.options;
|
|
16284
|
+
if (options.dxRange) {
|
|
16285
|
+
this.dragRange.dxRange = options.dxRange;
|
|
16286
|
+
}
|
|
16287
|
+
if (options.dyRange) {
|
|
16288
|
+
this.dragRange.dyRange = options.dyRange;
|
|
16289
|
+
}
|
|
16290
|
+
}
|
|
16173
16291
|
};
|
|
16174
16292
|
_proto.canInteract = function canInteract() {
|
|
16175
16293
|
var _this_item_composition;
|
|
@@ -16544,7 +16662,7 @@ var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
|
|
|
16544
16662
|
};
|
|
16545
16663
|
}
|
|
16546
16664
|
var _proto = PlayableOutput.prototype;
|
|
16547
|
-
_proto.
|
|
16665
|
+
_proto.setSourcePlayable = function setSourcePlayable(playable, port) {
|
|
16548
16666
|
if (port === void 0) port = 0;
|
|
16549
16667
|
this.sourcePlayable = playable;
|
|
16550
16668
|
this.sourceOutputPort = port;
|
|
@@ -17327,21 +17445,6 @@ exports.VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
17327
17445
|
return tf;
|
|
17328
17446
|
};
|
|
17329
17447
|
/**
|
|
17330
|
-
* 获取元素内部节点的变换,目前只有场景树元素在使用
|
|
17331
|
-
* @param itemId 元素id信息,如果带^就返回内部节点变换,否则返回自己的变换
|
|
17332
|
-
* @returns 元素变换或内部节点变换
|
|
17333
|
-
*/ _proto.getNodeTransform = function getNodeTransform(itemId) {
|
|
17334
|
-
for(var i = 0; i < this.components.length; i++){
|
|
17335
|
-
var comp = this.components[1];
|
|
17336
|
-
// @ts-expect-error
|
|
17337
|
-
if (comp.getNodeTransform) {
|
|
17338
|
-
// @ts-expect-error
|
|
17339
|
-
return comp.getNodeTransform(itemId);
|
|
17340
|
-
}
|
|
17341
|
-
}
|
|
17342
|
-
return this.transform;
|
|
17343
|
-
};
|
|
17344
|
-
/**
|
|
17345
17448
|
* 设置元素在 3D 坐标轴上相对移动
|
|
17346
17449
|
*/ _proto.translate = function translate(x, y, z) {
|
|
17347
17450
|
this.transform.translate(x, y, z);
|
|
@@ -17820,7 +17923,7 @@ exports.SpriteColorPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
|
17820
17923
|
return SpriteColorPlayableAsset;
|
|
17821
17924
|
}(PlayableAsset);
|
|
17822
17925
|
exports.SpriteColorPlayableAsset = __decorate([
|
|
17823
|
-
effectsClass(
|
|
17926
|
+
effectsClass(DataType.SpriteColorPlayableAsset)
|
|
17824
17927
|
], exports.SpriteColorPlayableAsset);
|
|
17825
17928
|
exports.SpriteComponent = /*#__PURE__*/ function(BaseRenderComponent) {
|
|
17826
17929
|
_inherits(SpriteComponent, BaseRenderComponent);
|
|
@@ -17839,6 +17942,7 @@ exports.SpriteComponent = /*#__PURE__*/ function(BaseRenderComponent) {
|
|
|
17839
17942
|
}
|
|
17840
17943
|
var _proto = SpriteComponent.prototype;
|
|
17841
17944
|
_proto.onUpdate = function onUpdate(dt) {
|
|
17945
|
+
var _this = this;
|
|
17842
17946
|
if (!this.isManualTimeSet) {
|
|
17843
17947
|
this.frameAnimationTime += dt / 1000;
|
|
17844
17948
|
this.isManualTimeSet = false;
|
|
@@ -17904,6 +18008,16 @@ exports.SpriteComponent = /*#__PURE__*/ function(BaseRenderComponent) {
|
|
|
17904
18008
|
dy
|
|
17905
18009
|
]);
|
|
17906
18010
|
}
|
|
18011
|
+
var video = this.renderer.texture.source.video;
|
|
18012
|
+
if (video) {
|
|
18013
|
+
if (time === 0 || time === this.item.duration) {
|
|
18014
|
+
video.pause();
|
|
18015
|
+
} else {
|
|
18016
|
+
video.play().catch(function(e) {
|
|
18017
|
+
_this.engine.renderErrors.add(e);
|
|
18018
|
+
});
|
|
18019
|
+
}
|
|
18020
|
+
}
|
|
17907
18021
|
};
|
|
17908
18022
|
_proto.onDestroy = function onDestroy() {
|
|
17909
18023
|
if (this.item && this.item.composition) {
|
|
@@ -22409,7 +22523,7 @@ exports.TrackAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
|
22409
22523
|
var _proto = TrackAsset.prototype;
|
|
22410
22524
|
/**
|
|
22411
22525
|
* 重写该方法以获取自定义对象绑定
|
|
22412
|
-
*/ _proto.
|
|
22526
|
+
*/ _proto.updateAnimatedObject = function updateAnimatedObject() {
|
|
22413
22527
|
if (this.parent) {
|
|
22414
22528
|
this.boundObject = this.parent.boundObject;
|
|
22415
22529
|
}
|
|
@@ -22540,6 +22654,8 @@ var RuntimeClip = /*#__PURE__*/ function() {
|
|
|
22540
22654
|
this.playable.play();
|
|
22541
22655
|
}
|
|
22542
22656
|
this.parentMixer.setInputWeight(this.playable, weight);
|
|
22657
|
+
var clipTime = clip.toLocalTime(localTime);
|
|
22658
|
+
this.playable.setTime(clipTime);
|
|
22543
22659
|
// 判断动画是否结束
|
|
22544
22660
|
if (ended) {
|
|
22545
22661
|
if (_instanceof1(boundObject, exports.VFXItem) && !boundObject.ended) {
|
|
@@ -22554,8 +22670,6 @@ var RuntimeClip = /*#__PURE__*/ function() {
|
|
|
22554
22670
|
this.playable.pause();
|
|
22555
22671
|
}
|
|
22556
22672
|
}
|
|
22557
|
-
var clipTime = clip.toLocalTime(localTime);
|
|
22558
|
-
this.playable.setTime(clipTime);
|
|
22559
22673
|
};
|
|
22560
22674
|
_create_class(RuntimeClip, [
|
|
22561
22675
|
{
|
|
@@ -22634,16 +22748,16 @@ exports.ActivationTrack = __decorate([
|
|
|
22634
22748
|
effectsClass(DataType.ActivationTrack)
|
|
22635
22749
|
], exports.ActivationTrack);
|
|
22636
22750
|
|
|
22637
|
-
var
|
|
22638
|
-
_inherits(
|
|
22639
|
-
function
|
|
22751
|
+
var PropertyClipPlayable = /*#__PURE__*/ function(Playable) {
|
|
22752
|
+
_inherits(PropertyClipPlayable, Playable);
|
|
22753
|
+
function PropertyClipPlayable() {
|
|
22640
22754
|
return Playable.apply(this, arguments);
|
|
22641
22755
|
}
|
|
22642
|
-
var _proto =
|
|
22756
|
+
var _proto = PropertyClipPlayable.prototype;
|
|
22643
22757
|
_proto.processFrame = function processFrame(context) {
|
|
22644
22758
|
this.value = this.curve.getValue(this.time);
|
|
22645
22759
|
};
|
|
22646
|
-
return
|
|
22760
|
+
return PropertyClipPlayable;
|
|
22647
22761
|
}(Playable);
|
|
22648
22762
|
|
|
22649
22763
|
var FloatPropertyMixerPlayable = /*#__PURE__*/ function(Playable) {
|
|
@@ -22667,7 +22781,7 @@ var FloatPropertyMixerPlayable = /*#__PURE__*/ function(Playable) {
|
|
|
22667
22781
|
var weight = this.getInputWeight(i);
|
|
22668
22782
|
if (weight > 0) {
|
|
22669
22783
|
var propertyClipPlayable = this.getInput(i);
|
|
22670
|
-
if (!_instanceof1(propertyClipPlayable,
|
|
22784
|
+
if (!_instanceof1(propertyClipPlayable, PropertyClipPlayable)) {
|
|
22671
22785
|
console.error("FloatPropertyTrack added non-FloatPropertyPlayableAsset");
|
|
22672
22786
|
continue;
|
|
22673
22787
|
}
|
|
@@ -23182,11 +23296,11 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
23182
23296
|
for(var _iterator = _create_for_of_iterator_helper_loose(this.items), _step; !(_step = _iterator()).done;){
|
|
23183
23297
|
var item = _step.value;
|
|
23184
23298
|
item.composition = this.item.composition;
|
|
23185
|
-
var itemData = item.props;
|
|
23186
23299
|
// 设置预合成作为元素时的时长、结束行为和渲染延时
|
|
23187
|
-
if (exports.
|
|
23300
|
+
if (exports.VFXItem.isComposition(item)) {
|
|
23188
23301
|
this.item.composition.refContent.push(item);
|
|
23189
|
-
var
|
|
23302
|
+
var compositionContent = item.props.content;
|
|
23303
|
+
var refId = compositionContent.options.refId;
|
|
23190
23304
|
var props = this.item.composition.refCompositionProps.get(refId);
|
|
23191
23305
|
if (!props) {
|
|
23192
23306
|
throw new Error("Referenced precomposition with Id: " + refId + " does not exist.");
|
|
@@ -23231,7 +23345,7 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
23231
23345
|
_proto.hitTest = function hitTest(ray, x, y, regions, force, options) {
|
|
23232
23346
|
var _this, _loop = function(i) {
|
|
23233
23347
|
var item = _this.items[i];
|
|
23234
|
-
if (item.getVisible() && item.transform.getValid() && !
|
|
23348
|
+
if (item.getVisible() && item.transform.getValid() && !exports.VFXItem.isComposition(item) && !skip(item)) {
|
|
23235
23349
|
var hitParams = item.getHitTestParams(force);
|
|
23236
23350
|
if (hitParams) {
|
|
23237
23351
|
var success = false;
|
|
@@ -23320,16 +23434,19 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
23320
23434
|
var sceneBinding = _step.value;
|
|
23321
23435
|
sceneBinding.key.boundObject = sceneBinding.value;
|
|
23322
23436
|
}
|
|
23437
|
+
// 未了通过帧对比,需要保证和原有的 update 时机一致。
|
|
23438
|
+
// 因此这边更新一次对象绑定,后续 timeline playable 中 sort tracks 的排序才能和原先的版本对上。
|
|
23439
|
+
// 如果不需要严格保证和之前的 updata 时机一致,这边的更新和 timeline playable 中的 sortTracks 都能去掉。
|
|
23323
23440
|
for(var _iterator1 = _create_for_of_iterator_helper_loose(this.timelineAsset.tracks), _step1; !(_step1 = _iterator1()).done;){
|
|
23324
23441
|
var masterTrack = _step1.value;
|
|
23325
|
-
this.
|
|
23442
|
+
this.updateTrackAnimatedObject(masterTrack);
|
|
23326
23443
|
}
|
|
23327
23444
|
};
|
|
23328
|
-
_proto.
|
|
23445
|
+
_proto.updateTrackAnimatedObject = function updateTrackAnimatedObject(track) {
|
|
23329
23446
|
for(var _iterator = _create_for_of_iterator_helper_loose(track.getChildTracks()), _step; !(_step = _iterator()).done;){
|
|
23330
23447
|
var subTrack = _step.value;
|
|
23331
|
-
subTrack.
|
|
23332
|
-
this.
|
|
23448
|
+
subTrack.updateAnimatedObject();
|
|
23449
|
+
this.updateTrackAnimatedObject(subTrack);
|
|
23333
23450
|
}
|
|
23334
23451
|
};
|
|
23335
23452
|
return CompositionComponent;
|
|
@@ -23378,23 +23495,101 @@ var SubCompositionMixerPlayable = /*#__PURE__*/ function(Playable) {
|
|
|
23378
23495
|
return SubCompositionMixerPlayable;
|
|
23379
23496
|
}(Playable);
|
|
23380
23497
|
|
|
23381
|
-
|
|
23382
|
-
_inherits(
|
|
23383
|
-
function
|
|
23498
|
+
var Vector4PropertyMixerPlayable = /*#__PURE__*/ function(Playable) {
|
|
23499
|
+
_inherits(Vector4PropertyMixerPlayable, Playable);
|
|
23500
|
+
function Vector4PropertyMixerPlayable() {
|
|
23501
|
+
var _this;
|
|
23502
|
+
_this = Playable.apply(this, arguments) || this;
|
|
23503
|
+
_this.propertyName = "";
|
|
23504
|
+
return _this;
|
|
23505
|
+
}
|
|
23506
|
+
var _proto = Vector4PropertyMixerPlayable.prototype;
|
|
23507
|
+
_proto.processFrame = function processFrame(context) {
|
|
23508
|
+
var boundObject = context.output.getUserData();
|
|
23509
|
+
if (!boundObject) {
|
|
23510
|
+
return;
|
|
23511
|
+
}
|
|
23512
|
+
var hasInput = false;
|
|
23513
|
+
var value = boundObject[this.propertyName];
|
|
23514
|
+
if (!_instanceof1(value, Vector4)) {
|
|
23515
|
+
return;
|
|
23516
|
+
}
|
|
23517
|
+
value.setZero();
|
|
23518
|
+
// evaluate the curve
|
|
23519
|
+
for(var i = 0; i < this.getInputCount(); i++){
|
|
23520
|
+
var weight = this.getInputWeight(i);
|
|
23521
|
+
if (weight > 0) {
|
|
23522
|
+
var propertyClipPlayable = this.getInput(i);
|
|
23523
|
+
if (!_instanceof1(propertyClipPlayable, PropertyClipPlayable)) {
|
|
23524
|
+
console.error("Vector4PropertyTrack added non-Vector4PropertyPlayableAsset");
|
|
23525
|
+
continue;
|
|
23526
|
+
}
|
|
23527
|
+
var curveValue = propertyClipPlayable.value;
|
|
23528
|
+
value.x += curveValue.x * weight;
|
|
23529
|
+
value.y += curveValue.y * weight;
|
|
23530
|
+
value.z += curveValue.z * weight;
|
|
23531
|
+
value.w += curveValue.w * weight;
|
|
23532
|
+
hasInput = true;
|
|
23533
|
+
}
|
|
23534
|
+
}
|
|
23535
|
+
// set value
|
|
23536
|
+
if (hasInput) {
|
|
23537
|
+
boundObject[this.propertyName] = value;
|
|
23538
|
+
}
|
|
23539
|
+
};
|
|
23540
|
+
return Vector4PropertyMixerPlayable;
|
|
23541
|
+
}(Playable);
|
|
23542
|
+
|
|
23543
|
+
var PropertyTrack = /*#__PURE__*/ function(TrackAsset) {
|
|
23544
|
+
_inherits(PropertyTrack, TrackAsset);
|
|
23545
|
+
function PropertyTrack() {
|
|
23384
23546
|
var _this;
|
|
23385
23547
|
_this = TrackAsset.apply(this, arguments) || this;
|
|
23548
|
+
_this.propertyNames = [];
|
|
23386
23549
|
_this.path = "";
|
|
23387
|
-
_this.propertyName = "";
|
|
23388
23550
|
return _this;
|
|
23389
23551
|
}
|
|
23552
|
+
var _proto = PropertyTrack.prototype;
|
|
23553
|
+
_proto.updateAnimatedObject = function updateAnimatedObject() {
|
|
23554
|
+
var propertyNames = this.propertyNames;
|
|
23555
|
+
var target = this.parent.boundObject;
|
|
23556
|
+
for(var i = 0; i < propertyNames.length - 1; i++){
|
|
23557
|
+
var property = target[propertyNames[i]];
|
|
23558
|
+
if (property === undefined) {
|
|
23559
|
+
console.error("The " + propertyNames[i] + " property of " + target + " was not found");
|
|
23560
|
+
}
|
|
23561
|
+
target = property;
|
|
23562
|
+
}
|
|
23563
|
+
this.boundObject = target;
|
|
23564
|
+
};
|
|
23565
|
+
_proto.fromData = function fromData(data) {
|
|
23566
|
+
TrackAsset.prototype.fromData.call(this, data);
|
|
23567
|
+
var propertyNames = this.path.split(".");
|
|
23568
|
+
this.propertyNames = propertyNames;
|
|
23569
|
+
};
|
|
23570
|
+
return PropertyTrack;
|
|
23571
|
+
}(exports.TrackAsset);
|
|
23572
|
+
__decorate([
|
|
23573
|
+
serialize()
|
|
23574
|
+
], PropertyTrack.prototype, "path", void 0);
|
|
23575
|
+
|
|
23576
|
+
exports.FloatPropertyTrack = /*#__PURE__*/ function(PropertyTrack) {
|
|
23577
|
+
_inherits(FloatPropertyTrack, PropertyTrack);
|
|
23578
|
+
function FloatPropertyTrack() {
|
|
23579
|
+
return PropertyTrack.apply(this, arguments);
|
|
23580
|
+
}
|
|
23390
23581
|
var _proto = FloatPropertyTrack.prototype;
|
|
23391
23582
|
_proto.createTrackMixer = function createTrackMixer(graph) {
|
|
23392
23583
|
var mixer = new FloatPropertyMixerPlayable(graph);
|
|
23393
|
-
|
|
23584
|
+
var propertyNames = this.propertyNames;
|
|
23585
|
+
if (propertyNames.length > 0) {
|
|
23586
|
+
var propertyName = propertyNames[propertyNames.length - 1];
|
|
23587
|
+
mixer.propertyName = propertyName;
|
|
23588
|
+
}
|
|
23394
23589
|
return mixer;
|
|
23395
23590
|
};
|
|
23396
|
-
_proto.
|
|
23397
|
-
var propertyNames = this.
|
|
23591
|
+
_proto.updateAnimatedObject = function updateAnimatedObject() {
|
|
23592
|
+
var propertyNames = this.propertyNames;
|
|
23398
23593
|
var target = this.parent.boundObject;
|
|
23399
23594
|
for(var i = 0; i < propertyNames.length - 1; i++){
|
|
23400
23595
|
var property = target[propertyNames[i]];
|
|
@@ -23403,18 +23598,12 @@ exports.FloatPropertyTrack = /*#__PURE__*/ function(TrackAsset) {
|
|
|
23403
23598
|
}
|
|
23404
23599
|
target = property;
|
|
23405
23600
|
}
|
|
23406
|
-
if (propertyNames.length > 0) {
|
|
23407
|
-
this.propertyName = propertyNames[propertyNames.length - 1];
|
|
23408
|
-
}
|
|
23409
23601
|
this.boundObject = target;
|
|
23410
23602
|
};
|
|
23411
23603
|
return FloatPropertyTrack;
|
|
23412
|
-
}(
|
|
23413
|
-
__decorate([
|
|
23414
|
-
serialize()
|
|
23415
|
-
], exports.FloatPropertyTrack.prototype, "path", void 0);
|
|
23604
|
+
}(PropertyTrack);
|
|
23416
23605
|
exports.FloatPropertyTrack = __decorate([
|
|
23417
|
-
effectsClass(
|
|
23606
|
+
effectsClass(DataType.FloatPropertyTrack)
|
|
23418
23607
|
], exports.FloatPropertyTrack);
|
|
23419
23608
|
|
|
23420
23609
|
exports.SpriteColorTrack = /*#__PURE__*/ function(TrackAsset) {
|
|
@@ -23434,7 +23623,7 @@ exports.SubCompositionTrack = /*#__PURE__*/ function(TrackAsset) {
|
|
|
23434
23623
|
return TrackAsset.apply(this, arguments);
|
|
23435
23624
|
}
|
|
23436
23625
|
var _proto = SubCompositionTrack.prototype;
|
|
23437
|
-
_proto.
|
|
23626
|
+
_proto.updateAnimatedObject = function updateAnimatedObject() {
|
|
23438
23627
|
if (!this.parent || !_instanceof1(this.parent.boundObject, exports.VFXItem)) {
|
|
23439
23628
|
throw new Error("SubCompositionTrack needs to be set under the VFXItem track.");
|
|
23440
23629
|
}
|
|
@@ -23460,6 +23649,70 @@ exports.TransformTrack = __decorate([
|
|
|
23460
23649
|
effectsClass(DataType.TransformTrack)
|
|
23461
23650
|
], exports.TransformTrack);
|
|
23462
23651
|
|
|
23652
|
+
exports.MaterialTrack = /*#__PURE__*/ function(TrackAsset) {
|
|
23653
|
+
_inherits(MaterialTrack, TrackAsset);
|
|
23654
|
+
function MaterialTrack() {
|
|
23655
|
+
return TrackAsset.apply(this, arguments);
|
|
23656
|
+
}
|
|
23657
|
+
var _proto = MaterialTrack.prototype;
|
|
23658
|
+
_proto.updateAnimatedObject = function updateAnimatedObject() {
|
|
23659
|
+
if (!_instanceof1(this.parent.boundObject, RendererComponent)) {
|
|
23660
|
+
return;
|
|
23661
|
+
}
|
|
23662
|
+
this.parent.boundObject;
|
|
23663
|
+
this.boundObject = this.parent.boundObject.materials[this.index];
|
|
23664
|
+
};
|
|
23665
|
+
return MaterialTrack;
|
|
23666
|
+
}(exports.TrackAsset);
|
|
23667
|
+
__decorate([
|
|
23668
|
+
serialize()
|
|
23669
|
+
], exports.MaterialTrack.prototype, "index", void 0);
|
|
23670
|
+
exports.MaterialTrack = __decorate([
|
|
23671
|
+
effectsClass("MaterialTrack")
|
|
23672
|
+
], exports.MaterialTrack);
|
|
23673
|
+
|
|
23674
|
+
exports.Vector4PropertyTrack = /*#__PURE__*/ function(PropertyTrack) {
|
|
23675
|
+
_inherits(Vector4PropertyTrack, PropertyTrack);
|
|
23676
|
+
function Vector4PropertyTrack() {
|
|
23677
|
+
return PropertyTrack.apply(this, arguments);
|
|
23678
|
+
}
|
|
23679
|
+
var _proto = Vector4PropertyTrack.prototype;
|
|
23680
|
+
_proto.createTrackMixer = function createTrackMixer(graph) {
|
|
23681
|
+
var mixer = new Vector4PropertyMixerPlayable(graph);
|
|
23682
|
+
var propertyNames = this.propertyNames;
|
|
23683
|
+
if (propertyNames.length > 0) {
|
|
23684
|
+
var propertyName = propertyNames[propertyNames.length - 1];
|
|
23685
|
+
mixer.propertyName = propertyName;
|
|
23686
|
+
}
|
|
23687
|
+
return mixer;
|
|
23688
|
+
};
|
|
23689
|
+
return Vector4PropertyTrack;
|
|
23690
|
+
}(PropertyTrack);
|
|
23691
|
+
exports.Vector4PropertyTrack = __decorate([
|
|
23692
|
+
effectsClass(DataType.Vector4PropertyTrack)
|
|
23693
|
+
], exports.Vector4PropertyTrack);
|
|
23694
|
+
|
|
23695
|
+
exports.ColorPropertyTrack = /*#__PURE__*/ function(PropertyTrack) {
|
|
23696
|
+
_inherits(ColorPropertyTrack, PropertyTrack);
|
|
23697
|
+
function ColorPropertyTrack() {
|
|
23698
|
+
return PropertyTrack.apply(this, arguments);
|
|
23699
|
+
}
|
|
23700
|
+
var _proto = ColorPropertyTrack.prototype;
|
|
23701
|
+
_proto.createTrackMixer = function createTrackMixer(graph) {
|
|
23702
|
+
var mixer = new FloatPropertyMixerPlayable(graph);
|
|
23703
|
+
var propertyNames = this.propertyNames;
|
|
23704
|
+
if (propertyNames.length > 0) {
|
|
23705
|
+
var propertyName = propertyNames[propertyNames.length - 1];
|
|
23706
|
+
mixer.propertyName = propertyName;
|
|
23707
|
+
}
|
|
23708
|
+
return mixer;
|
|
23709
|
+
};
|
|
23710
|
+
return ColorPropertyTrack;
|
|
23711
|
+
}(PropertyTrack);
|
|
23712
|
+
exports.ColorPropertyTrack = __decorate([
|
|
23713
|
+
effectsClass(DataType.ColorPropertyTrack)
|
|
23714
|
+
], exports.ColorPropertyTrack);
|
|
23715
|
+
|
|
23463
23716
|
exports.FloatPropertyPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
23464
23717
|
_inherits(FloatPropertyPlayableAsset, PlayableAsset);
|
|
23465
23718
|
function FloatPropertyPlayableAsset() {
|
|
@@ -23467,7 +23720,7 @@ exports.FloatPropertyPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
|
23467
23720
|
}
|
|
23468
23721
|
var _proto = FloatPropertyPlayableAsset.prototype;
|
|
23469
23722
|
_proto.createPlayable = function createPlayable(graph) {
|
|
23470
|
-
var clipPlayable = new
|
|
23723
|
+
var clipPlayable = new PropertyClipPlayable(graph);
|
|
23471
23724
|
clipPlayable.curve = createValueGetter(this.curveData);
|
|
23472
23725
|
clipPlayable.value = clipPlayable.curve.getValue(0);
|
|
23473
23726
|
return clipPlayable;
|
|
@@ -23478,7 +23731,7 @@ __decorate([
|
|
|
23478
23731
|
serialize()
|
|
23479
23732
|
], exports.FloatPropertyPlayableAsset.prototype, "curveData", void 0);
|
|
23480
23733
|
exports.FloatPropertyPlayableAsset = __decorate([
|
|
23481
|
-
effectsClass(
|
|
23734
|
+
effectsClass(DataType.FloatPropertyPlayableAsset)
|
|
23482
23735
|
], exports.FloatPropertyPlayableAsset);
|
|
23483
23736
|
|
|
23484
23737
|
exports.SubCompositionPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
@@ -23496,6 +23749,23 @@ exports.SubCompositionPlayableAsset = __decorate([
|
|
|
23496
23749
|
effectsClass(DataType.SubCompositionPlayableAsset)
|
|
23497
23750
|
], exports.SubCompositionPlayableAsset);
|
|
23498
23751
|
|
|
23752
|
+
/**
|
|
23753
|
+
* A class that stores track assets and the generated mixer playables and playable outputs.
|
|
23754
|
+
* It is used to query the corresponding playable object based on the track asset.
|
|
23755
|
+
*/ var TrackInstance = /*#__PURE__*/ function() {
|
|
23756
|
+
function TrackInstance(trackAsset, mixer, output) {
|
|
23757
|
+
this.children = [];
|
|
23758
|
+
this.trackAsset = trackAsset;
|
|
23759
|
+
this.mixer = mixer;
|
|
23760
|
+
this.output = output;
|
|
23761
|
+
}
|
|
23762
|
+
var _proto = TrackInstance.prototype;
|
|
23763
|
+
_proto.addChild = function addChild(trackInstance) {
|
|
23764
|
+
this.children.push(trackInstance);
|
|
23765
|
+
};
|
|
23766
|
+
return TrackInstance;
|
|
23767
|
+
}();
|
|
23768
|
+
|
|
23499
23769
|
exports.TimelineAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
23500
23770
|
_inherits(TimelineAsset, PlayableAsset);
|
|
23501
23771
|
function TimelineAsset() {
|
|
@@ -23538,6 +23808,7 @@ var TimelinePlayable = /*#__PURE__*/ function(Playable) {
|
|
|
23538
23808
|
var _this;
|
|
23539
23809
|
_this = Playable.apply(this, arguments) || this;
|
|
23540
23810
|
_this.clips = [];
|
|
23811
|
+
_this.masterTrackInstances = [];
|
|
23541
23812
|
return _this;
|
|
23542
23813
|
}
|
|
23543
23814
|
var _proto = TimelinePlayable.prototype;
|
|
@@ -23546,6 +23817,8 @@ var TimelinePlayable = /*#__PURE__*/ function(Playable) {
|
|
|
23546
23817
|
};
|
|
23547
23818
|
_proto.evaluate = function evaluate() {
|
|
23548
23819
|
var time = this.getTime();
|
|
23820
|
+
// update all tracks binding
|
|
23821
|
+
this.updateTrackAnimatedObject(this.masterTrackInstances);
|
|
23549
23822
|
// TODO search active clips
|
|
23550
23823
|
for(var _iterator = _create_for_of_iterator_helper_loose(this.clips), _step; !(_step = _iterator()).done;){
|
|
23551
23824
|
var clip = _step.value;
|
|
@@ -23555,19 +23828,50 @@ var TimelinePlayable = /*#__PURE__*/ function(Playable) {
|
|
|
23555
23828
|
_proto.compileTracks = function compileTracks(graph, tracks) {
|
|
23556
23829
|
this.sortTracks(tracks);
|
|
23557
23830
|
var outputTrack = [];
|
|
23831
|
+
// flatten track tree
|
|
23558
23832
|
for(var _iterator = _create_for_of_iterator_helper_loose(tracks), _step; !(_step = _iterator()).done;){
|
|
23559
23833
|
var masterTrack = _step.value;
|
|
23560
23834
|
outputTrack.push(masterTrack);
|
|
23561
23835
|
this.addSubTracksRecursive(masterTrack, outputTrack);
|
|
23562
23836
|
}
|
|
23837
|
+
// map for searching track instance with track asset guid
|
|
23838
|
+
var trackInstanceMap = {};
|
|
23563
23839
|
for(var _iterator1 = _create_for_of_iterator_helper_loose(outputTrack), _step1; !(_step1 = _iterator1()).done;){
|
|
23564
23840
|
var track = _step1.value;
|
|
23841
|
+
// create track mixer and track output
|
|
23565
23842
|
var trackMixPlayable = track.createPlayableGraph(graph, this.clips);
|
|
23566
23843
|
this.addInput(trackMixPlayable, 0);
|
|
23567
23844
|
var trackOutput = track.createOutput();
|
|
23568
23845
|
trackOutput.setUserData(track.boundObject);
|
|
23569
23846
|
graph.addOutput(trackOutput);
|
|
23570
|
-
trackOutput.
|
|
23847
|
+
trackOutput.setSourcePlayable(this, this.getInputCount() - 1);
|
|
23848
|
+
// create track instance
|
|
23849
|
+
var trackInstance = new TrackInstance(track, trackMixPlayable, trackOutput);
|
|
23850
|
+
trackInstanceMap[track.getInstanceId()] = trackInstance;
|
|
23851
|
+
if (!track.parent) {
|
|
23852
|
+
this.masterTrackInstances.push(trackInstance);
|
|
23853
|
+
}
|
|
23854
|
+
}
|
|
23855
|
+
// build trackInstance tree
|
|
23856
|
+
for(var _iterator2 = _create_for_of_iterator_helper_loose(outputTrack), _step2; !(_step2 = _iterator2()).done;){
|
|
23857
|
+
var track1 = _step2.value;
|
|
23858
|
+
var trackInstance1 = trackInstanceMap[track1.getInstanceId()];
|
|
23859
|
+
for(var _iterator3 = _create_for_of_iterator_helper_loose(track1.getChildTracks()), _step3; !(_step3 = _iterator3()).done;){
|
|
23860
|
+
var child = _step3.value;
|
|
23861
|
+
var childTrackInstance = trackInstanceMap[child.getInstanceId()];
|
|
23862
|
+
trackInstance1.addChild(childTrackInstance);
|
|
23863
|
+
}
|
|
23864
|
+
}
|
|
23865
|
+
};
|
|
23866
|
+
_proto.updateTrackAnimatedObject = function updateTrackAnimatedObject(trackInstances) {
|
|
23867
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(trackInstances), _step; !(_step = _iterator()).done;){
|
|
23868
|
+
var trackInstance = _step.value;
|
|
23869
|
+
var trackAsset = trackInstance.trackAsset;
|
|
23870
|
+
// update track binding use custom method
|
|
23871
|
+
trackAsset.updateAnimatedObject();
|
|
23872
|
+
trackInstance.output.setUserData(trackAsset.boundObject);
|
|
23873
|
+
// update children tracks
|
|
23874
|
+
this.updateTrackAnimatedObject(trackInstance.children);
|
|
23571
23875
|
}
|
|
23572
23876
|
};
|
|
23573
23877
|
_proto.sortTracks = function sortTracks(tracks) {
|
|
@@ -23619,6 +23923,7 @@ exports.ObjectBindingTrack = /*#__PURE__*/ function(TrackAsset1) {
|
|
|
23619
23923
|
return TrackAsset1.apply(this, arguments);
|
|
23620
23924
|
}
|
|
23621
23925
|
var _proto = ObjectBindingTrack.prototype;
|
|
23926
|
+
_proto.updateAnimatedObject = function updateAnimatedObject() {};
|
|
23622
23927
|
_proto.create = function create(timelineAsset) {
|
|
23623
23928
|
if (!_instanceof1(this.boundObject, exports.VFXItem)) {
|
|
23624
23929
|
return;
|
|
@@ -27619,6 +27924,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
27619
27924
|
_inherits(Composition, EventEmitter);
|
|
27620
27925
|
function Composition(props, scene) {
|
|
27621
27926
|
var _this;
|
|
27927
|
+
var _scene_jsonScene_renderSettings;
|
|
27622
27928
|
_this = EventEmitter.call(this) || this;
|
|
27623
27929
|
_this.sceneTicking = new SceneTicking();
|
|
27624
27930
|
/**
|
|
@@ -27633,6 +27939,9 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
27633
27939
|
/**
|
|
27634
27940
|
* 预合成的合成属性,在 content 中会被其元素属性覆盖
|
|
27635
27941
|
*/ _this.refCompositionProps = new Map();
|
|
27942
|
+
/**
|
|
27943
|
+
* 是否开启后处理
|
|
27944
|
+
*/ _this.postProcessingEnabled = false;
|
|
27636
27945
|
// TODO: 待优化
|
|
27637
27946
|
_this.assigned = false;
|
|
27638
27947
|
/**
|
|
@@ -27651,6 +27960,8 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
27651
27960
|
scene.consumed = true;
|
|
27652
27961
|
}
|
|
27653
27962
|
var _this_compositionSourceManager = _this.compositionSourceManager, sourceContent = _this_compositionSourceManager.sourceContent, pluginSystem = _this_compositionSourceManager.pluginSystem, imgUsage = _this_compositionSourceManager.imgUsage, totalTime = _this_compositionSourceManager.totalTime, refCompositionProps = _this_compositionSourceManager.refCompositionProps;
|
|
27963
|
+
var _scene_jsonScene_renderSettings_postProcessingEnabled;
|
|
27964
|
+
_this.postProcessingEnabled = (_scene_jsonScene_renderSettings_postProcessingEnabled = (_scene_jsonScene_renderSettings = scene.jsonScene.renderSettings) == null ? void 0 : _scene_jsonScene_renderSettings.postProcessingEnabled) != null ? _scene_jsonScene_renderSettings_postProcessingEnabled : false;
|
|
27654
27965
|
assertExist(sourceContent);
|
|
27655
27966
|
_this.renderer = renderer;
|
|
27656
27967
|
_this.refCompositionProps = refCompositionProps;
|
|
@@ -27691,27 +28002,10 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
27691
28002
|
SerializationHelper.deserialize(sourceContent, _this.rootComposition);
|
|
27692
28003
|
_this.rootComposition.createContent();
|
|
27693
28004
|
_this.buildItemTree(_this.rootItem);
|
|
27694
|
-
_this.rootItem.onEnd = function() {
|
|
27695
|
-
window.setTimeout(function() {
|
|
27696
|
-
_this.emit("end", {
|
|
27697
|
-
composition: _assert_this_initialized(_this)
|
|
27698
|
-
});
|
|
27699
|
-
}, 0);
|
|
27700
|
-
};
|
|
27701
28005
|
_this.pluginSystem.resetComposition(_assert_this_initialized(_this), _this.renderFrame);
|
|
27702
28006
|
return _this;
|
|
27703
28007
|
}
|
|
27704
28008
|
var _proto = Composition.prototype;
|
|
27705
|
-
_proto.initializeSceneTicking = function initializeSceneTicking(item) {
|
|
27706
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(item.components), _step; !(_step = _iterator()).done;){
|
|
27707
|
-
var component = _step.value;
|
|
27708
|
-
this.sceneTicking.addComponent(component);
|
|
27709
|
-
}
|
|
27710
|
-
for(var _iterator1 = _create_for_of_iterator_helper_loose(item.children), _step1; !(_step1 = _iterator1()).done;){
|
|
27711
|
-
var child = _step1.value;
|
|
27712
|
-
this.initializeSceneTicking(child);
|
|
27713
|
-
}
|
|
27714
|
-
};
|
|
27715
28009
|
/**
|
|
27716
28010
|
* 获取合成的时长
|
|
27717
28011
|
*/ _proto.getDuration = function getDuration() {
|
|
@@ -27800,7 +28094,8 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
27800
28094
|
camera: this.camera,
|
|
27801
28095
|
renderer: this.renderer,
|
|
27802
28096
|
keepColorBuffer: this.keepColorBuffer,
|
|
27803
|
-
globalVolume: this.globalVolume
|
|
28097
|
+
globalVolume: this.globalVolume,
|
|
28098
|
+
postProcessingEnabled: this.postProcessingEnabled
|
|
27804
28099
|
});
|
|
27805
28100
|
// TODO 考虑放到构造函数
|
|
27806
28101
|
this.renderFrame.cachedTextures = this.textures;
|
|
@@ -27903,40 +28198,6 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
27903
28198
|
this.dispose();
|
|
27904
28199
|
}
|
|
27905
28200
|
};
|
|
27906
|
-
_proto.toLocalTime = function toLocalTime(time) {
|
|
27907
|
-
var localTime = time - this.rootItem.start;
|
|
27908
|
-
var duration = this.rootItem.duration;
|
|
27909
|
-
if (localTime - duration > 0.001) {
|
|
27910
|
-
if (!this.rootItem.ended) {
|
|
27911
|
-
this.rootItem.ended = true;
|
|
27912
|
-
this.emit("end", {
|
|
27913
|
-
composition: this
|
|
27914
|
-
});
|
|
27915
|
-
}
|
|
27916
|
-
switch(this.rootItem.endBehavior){
|
|
27917
|
-
case EndBehavior.restart:
|
|
27918
|
-
{
|
|
27919
|
-
localTime = localTime % duration;
|
|
27920
|
-
this.restart();
|
|
27921
|
-
break;
|
|
27922
|
-
}
|
|
27923
|
-
case EndBehavior.freeze:
|
|
27924
|
-
{
|
|
27925
|
-
localTime = Math.min(duration, localTime);
|
|
27926
|
-
break;
|
|
27927
|
-
}
|
|
27928
|
-
case EndBehavior.forward:
|
|
27929
|
-
{
|
|
27930
|
-
break;
|
|
27931
|
-
}
|
|
27932
|
-
case EndBehavior.destroy:
|
|
27933
|
-
{
|
|
27934
|
-
break;
|
|
27935
|
-
}
|
|
27936
|
-
}
|
|
27937
|
-
}
|
|
27938
|
-
return localTime;
|
|
27939
|
-
};
|
|
27940
28201
|
_proto.shouldDispose = function shouldDispose() {
|
|
27941
28202
|
return this.rootItem.ended && this.rootItem.endBehavior === EndBehavior.destroy && !this.reusable;
|
|
27942
28203
|
};
|
|
@@ -28028,8 +28289,41 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28028
28289
|
* 更新主合成组件
|
|
28029
28290
|
*/ _proto.updateRootComposition = function updateRootComposition(deltaTime) {
|
|
28030
28291
|
if (this.rootComposition.isActiveAndEnabled) {
|
|
28031
|
-
var localTime = this.
|
|
28292
|
+
var localTime = this.time + deltaTime - this.rootItem.start;
|
|
28293
|
+
var ended = false;
|
|
28294
|
+
var duration = this.rootItem.duration;
|
|
28295
|
+
var endBehavior = this.rootItem.endBehavior;
|
|
28296
|
+
if (localTime - duration > 0.001) {
|
|
28297
|
+
ended = true;
|
|
28298
|
+
switch(endBehavior){
|
|
28299
|
+
case EndBehavior.restart:
|
|
28300
|
+
{
|
|
28301
|
+
localTime = localTime % duration;
|
|
28302
|
+
this.restart();
|
|
28303
|
+
break;
|
|
28304
|
+
}
|
|
28305
|
+
case EndBehavior.freeze:
|
|
28306
|
+
{
|
|
28307
|
+
localTime = Math.min(duration, localTime);
|
|
28308
|
+
break;
|
|
28309
|
+
}
|
|
28310
|
+
case EndBehavior.forward:
|
|
28311
|
+
{
|
|
28312
|
+
break;
|
|
28313
|
+
}
|
|
28314
|
+
case EndBehavior.destroy:
|
|
28315
|
+
{
|
|
28316
|
+
break;
|
|
28317
|
+
}
|
|
28318
|
+
}
|
|
28319
|
+
}
|
|
28032
28320
|
this.rootComposition.time = localTime;
|
|
28321
|
+
if (ended && !this.rootItem.ended) {
|
|
28322
|
+
this.rootItem.ended = true;
|
|
28323
|
+
this.emit("end", {
|
|
28324
|
+
composition: this
|
|
28325
|
+
});
|
|
28326
|
+
}
|
|
28033
28327
|
}
|
|
28034
28328
|
};
|
|
28035
28329
|
/**
|
|
@@ -30354,7 +30648,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem, true);
|
|
|
30354
30648
|
registerPlugin("particle", ParticleLoader, exports.VFXItem, true);
|
|
30355
30649
|
registerPlugin("cal", CalculateLoader, exports.VFXItem, true);
|
|
30356
30650
|
registerPlugin("interact", InteractLoader, exports.VFXItem, true);
|
|
30357
|
-
var version = "2.1.0-alpha.
|
|
30651
|
+
var version = "2.1.0-alpha.8";
|
|
30358
30652
|
logger.info("Core version: " + version + ".");
|
|
30359
30653
|
|
|
30360
30654
|
exports.AbstractPlugin = AbstractPlugin;
|
|
@@ -30375,6 +30669,7 @@ exports.COPY_VERTEX_SHADER = COPY_VERTEX_SHADER;
|
|
|
30375
30669
|
exports.CalculateLoader = CalculateLoader;
|
|
30376
30670
|
exports.Camera = Camera;
|
|
30377
30671
|
exports.CameraVFXItemLoader = CameraVFXItemLoader;
|
|
30672
|
+
exports.ColorCurve = ColorCurve;
|
|
30378
30673
|
exports.Component = Component;
|
|
30379
30674
|
exports.Composition = Composition;
|
|
30380
30675
|
exports.CompositionComponent = CompositionComponent;
|
|
@@ -30418,6 +30713,7 @@ exports.ParticleSystemRenderer = ParticleSystemRenderer;
|
|
|
30418
30713
|
exports.PassTextureCache = PassTextureCache;
|
|
30419
30714
|
exports.PathSegments = PathSegments;
|
|
30420
30715
|
exports.PluginSystem = PluginSystem;
|
|
30716
|
+
exports.PropertyTrack = PropertyTrack;
|
|
30421
30717
|
exports.RENDER_PASS_NAME_PREFIX = RENDER_PASS_NAME_PREFIX;
|
|
30422
30718
|
exports.RENDER_PREFER_LOOKUP_TEXTURE = RENDER_PREFER_LOOKUP_TEXTURE;
|
|
30423
30719
|
exports.RUNTIME_ENV = RUNTIME_ENV;
|
|
@@ -30459,6 +30755,7 @@ exports.TrackSortWrapper = TrackSortWrapper;
|
|
|
30459
30755
|
exports.Transform = Transform;
|
|
30460
30756
|
exports.TransformAnimationPlayable = TransformAnimationPlayable;
|
|
30461
30757
|
exports.ValueGetter = ValueGetter;
|
|
30758
|
+
exports.Vector4Curve = Vector4Curve;
|
|
30462
30759
|
exports.addByOrder = addByOrder;
|
|
30463
30760
|
exports.addItem = addItem;
|
|
30464
30761
|
exports.addItemWithOrder = addItemWithOrder;
|
|
@@ -30479,7 +30776,6 @@ exports.createKeyFrameMeta = createKeyFrameMeta;
|
|
|
30479
30776
|
exports.createShape = createShape;
|
|
30480
30777
|
exports.createValueGetter = createValueGetter;
|
|
30481
30778
|
exports.decimalEqual = decimalEqual;
|
|
30482
|
-
exports.defaultGlobalVolume = defaultGlobalVolume;
|
|
30483
30779
|
exports.defaultPlugins = defaultPlugins;
|
|
30484
30780
|
exports.deserializeMipmapTexture = deserializeMipmapTexture;
|
|
30485
30781
|
exports.earcut = earcut;
|