@galacean/effects-threejs 2.1.0-alpha.10 → 2.1.0-alpha.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +264 -229
- 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 +272 -236
- 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.0-alpha.
|
|
6
|
+
* Version: v2.1.0-alpha.12
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import * as THREE from 'three';
|
|
@@ -1092,7 +1092,7 @@ function _inherits(subClass, superClass) {
|
|
|
1092
1092
|
})(MaskMode || (MaskMode = {}));
|
|
1093
1093
|
/**
|
|
1094
1094
|
* 发射器形状
|
|
1095
|
-
*/ var ShapeType
|
|
1095
|
+
*/ var ShapeType;
|
|
1096
1096
|
(function(ShapeType) {
|
|
1097
1097
|
/**
|
|
1098
1098
|
* 没有类型
|
|
@@ -1124,7 +1124,7 @@ function _inherits(subClass, superClass) {
|
|
|
1124
1124
|
/**
|
|
1125
1125
|
* 贴图
|
|
1126
1126
|
*/ ShapeType[ShapeType["TEXTURE"] = 9] = "TEXTURE";
|
|
1127
|
-
})(ShapeType
|
|
1127
|
+
})(ShapeType || (ShapeType = {}));
|
|
1128
1128
|
/**
|
|
1129
1129
|
* 插件类型
|
|
1130
1130
|
*/ var PluginType;
|
|
@@ -1775,7 +1775,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
1775
1775
|
get BlendingMode () { return BlendingMode; },
|
|
1776
1776
|
get SideMode () { return SideMode; },
|
|
1777
1777
|
get MaskMode () { return MaskMode; },
|
|
1778
|
-
get ShapeType () { return ShapeType
|
|
1778
|
+
get ShapeType () { return ShapeType; },
|
|
1779
1779
|
get PluginType () { return PluginType; },
|
|
1780
1780
|
get InteractType () { return InteractType; },
|
|
1781
1781
|
get InteractBehavior () { return InteractBehavior; },
|
|
@@ -2021,7 +2021,7 @@ function getDirectStore(target) {
|
|
|
2021
2021
|
this.onAwake();
|
|
2022
2022
|
this.isAwakeCalled = true;
|
|
2023
2023
|
}
|
|
2024
|
-
if (item.
|
|
2024
|
+
if (item.isActive && this.enabled) {
|
|
2025
2025
|
this.start();
|
|
2026
2026
|
this.enable();
|
|
2027
2027
|
}
|
|
@@ -2066,7 +2066,7 @@ function getDirectStore(target) {
|
|
|
2066
2066
|
get: /**
|
|
2067
2067
|
* 组件是否可以更新,true 更新,false 不更新
|
|
2068
2068
|
*/ function get() {
|
|
2069
|
-
return this.item.
|
|
2069
|
+
return this.item.isActive && this.enabled;
|
|
2070
2070
|
}
|
|
2071
2071
|
},
|
|
2072
2072
|
{
|
|
@@ -3768,24 +3768,29 @@ EffectComponent = __decorate([
|
|
|
3768
3768
|
|
|
3769
3769
|
var PostProcessVolume = /*#__PURE__*/ function(Behaviour) {
|
|
3770
3770
|
_inherits(PostProcessVolume, Behaviour);
|
|
3771
|
-
function PostProcessVolume() {
|
|
3771
|
+
function PostProcessVolume(engine) {
|
|
3772
3772
|
var _this;
|
|
3773
|
-
_this = Behaviour.
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
_this.
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
_this.
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3773
|
+
_this = Behaviour.call(this, engine) || this;
|
|
3774
|
+
_this.bloom = {
|
|
3775
|
+
threshold: 0,
|
|
3776
|
+
intensity: 0,
|
|
3777
|
+
active: false
|
|
3778
|
+
};
|
|
3779
|
+
_this.vignette = {
|
|
3780
|
+
intensity: 0,
|
|
3781
|
+
smoothness: 0,
|
|
3782
|
+
roundness: 0,
|
|
3783
|
+
active: false
|
|
3784
|
+
};
|
|
3785
|
+
_this.tonemapping = {
|
|
3786
|
+
active: false
|
|
3787
|
+
};
|
|
3788
|
+
_this.colorAdjustments = {
|
|
3789
|
+
brightness: 0,
|
|
3790
|
+
saturation: 0,
|
|
3791
|
+
contrast: 0,
|
|
3792
|
+
active: false
|
|
3793
|
+
};
|
|
3789
3794
|
return _this;
|
|
3790
3795
|
}
|
|
3791
3796
|
var _proto = PostProcessVolume.prototype;
|
|
@@ -3799,36 +3804,18 @@ var PostProcessVolume = /*#__PURE__*/ function(Behaviour) {
|
|
|
3799
3804
|
}(Behaviour);
|
|
3800
3805
|
__decorate([
|
|
3801
3806
|
serialize()
|
|
3802
|
-
], PostProcessVolume.prototype, "
|
|
3803
|
-
__decorate([
|
|
3804
|
-
serialize()
|
|
3805
|
-
], PostProcessVolume.prototype, "threshold", void 0);
|
|
3806
|
-
__decorate([
|
|
3807
|
-
serialize()
|
|
3808
|
-
], PostProcessVolume.prototype, "bloomIntensity", void 0);
|
|
3809
|
-
__decorate([
|
|
3810
|
-
serialize()
|
|
3811
|
-
], PostProcessVolume.prototype, "brightness", void 0);
|
|
3812
|
-
__decorate([
|
|
3813
|
-
serialize()
|
|
3814
|
-
], PostProcessVolume.prototype, "saturation", void 0);
|
|
3815
|
-
__decorate([
|
|
3816
|
-
serialize()
|
|
3817
|
-
], PostProcessVolume.prototype, "contrast", void 0);
|
|
3807
|
+
], PostProcessVolume.prototype, "bloom", void 0);
|
|
3818
3808
|
__decorate([
|
|
3819
3809
|
serialize()
|
|
3820
|
-
], PostProcessVolume.prototype, "
|
|
3810
|
+
], PostProcessVolume.prototype, "vignette", void 0);
|
|
3821
3811
|
__decorate([
|
|
3822
3812
|
serialize()
|
|
3823
|
-
], PostProcessVolume.prototype, "
|
|
3813
|
+
], PostProcessVolume.prototype, "tonemapping", void 0);
|
|
3824
3814
|
__decorate([
|
|
3825
3815
|
serialize()
|
|
3826
|
-
], PostProcessVolume.prototype, "
|
|
3827
|
-
__decorate([
|
|
3828
|
-
serialize()
|
|
3829
|
-
], PostProcessVolume.prototype, "toneMappingEnabled", void 0);
|
|
3816
|
+
], PostProcessVolume.prototype, "colorAdjustments", void 0);
|
|
3830
3817
|
PostProcessVolume = __decorate([
|
|
3831
|
-
effectsClass(
|
|
3818
|
+
effectsClass(DataType.PostProcessVolume)
|
|
3832
3819
|
], PostProcessVolume);
|
|
3833
3820
|
|
|
3834
3821
|
function _assert_this_initialized(self) {
|
|
@@ -6915,6 +6902,7 @@ var MaterialRenderType;
|
|
|
6915
6902
|
_this.enabledMacros = {};
|
|
6916
6903
|
_this.destroyed = false;
|
|
6917
6904
|
_this.initialized = false;
|
|
6905
|
+
_this.shaderDirty = true;
|
|
6918
6906
|
if (props) {
|
|
6919
6907
|
var _props_name = props.name, name = _props_name === void 0 ? "Material" + seed$9++ : _props_name, _props_renderType = props.renderType, renderType = _props_renderType === void 0 ? 0 : _props_renderType, shader = props.shader, uniformSemantics = props.uniformSemantics;
|
|
6920
6908
|
_this.name = name;
|
|
@@ -6942,6 +6930,19 @@ var MaterialRenderType;
|
|
|
6942
6930
|
// OVERRIDE
|
|
6943
6931
|
};
|
|
6944
6932
|
_create_class(Material, [
|
|
6933
|
+
{
|
|
6934
|
+
key: "shader",
|
|
6935
|
+
get: function get() {
|
|
6936
|
+
return this._shader;
|
|
6937
|
+
},
|
|
6938
|
+
set: function set(value) {
|
|
6939
|
+
if (this._shader === value) {
|
|
6940
|
+
return;
|
|
6941
|
+
}
|
|
6942
|
+
this._shader = value;
|
|
6943
|
+
this.shaderDirty = true;
|
|
6944
|
+
}
|
|
6945
|
+
},
|
|
6945
6946
|
{
|
|
6946
6947
|
key: "blending",
|
|
6947
6948
|
set: /******** effects-core 中会调用 引擎必须实现 ***********************/ /**
|
|
@@ -10309,15 +10310,15 @@ var BloomThresholdPass = /*#__PURE__*/ function(RenderPass) {
|
|
|
10309
10310
|
renderer.setFramebuffer(this.framebuffer);
|
|
10310
10311
|
};
|
|
10311
10312
|
_proto.execute = function execute(renderer) {
|
|
10312
|
-
var _renderer_renderingData_currentFrame_globalVolume;
|
|
10313
|
+
var _renderer_renderingData_currentFrame_globalVolume_bloom, _renderer_renderingData_currentFrame_globalVolume;
|
|
10313
10314
|
renderer.clear({
|
|
10314
10315
|
colorAction: TextureStoreAction.clear,
|
|
10315
10316
|
depthAction: TextureStoreAction.clear,
|
|
10316
10317
|
stencilAction: TextureStoreAction.clear
|
|
10317
10318
|
});
|
|
10318
10319
|
this.screenMesh.material.setTexture("_MainTex", this.mainTexture);
|
|
10319
|
-
var
|
|
10320
|
-
var threshold = (
|
|
10320
|
+
var _renderer_renderingData_currentFrame_globalVolume_bloom_threshold;
|
|
10321
|
+
var threshold = (_renderer_renderingData_currentFrame_globalVolume_bloom_threshold = (_renderer_renderingData_currentFrame_globalVolume = renderer.renderingData.currentFrame.globalVolume) == null ? void 0 : (_renderer_renderingData_currentFrame_globalVolume_bloom = _renderer_renderingData_currentFrame_globalVolume.bloom) == null ? void 0 : _renderer_renderingData_currentFrame_globalVolume_bloom.threshold) != null ? _renderer_renderingData_currentFrame_globalVolume_bloom_threshold : 1.0;
|
|
10321
10322
|
this.screenMesh.material.setFloat("_Threshold", threshold);
|
|
10322
10323
|
renderer.renderMeshes([
|
|
10323
10324
|
this.screenMesh
|
|
@@ -10530,25 +10531,44 @@ var ToneMappingPass = /*#__PURE__*/ function(RenderPass) {
|
|
|
10530
10531
|
depthAction: TextureStoreAction.clear,
|
|
10531
10532
|
stencilAction: TextureStoreAction.clear
|
|
10532
10533
|
});
|
|
10533
|
-
var
|
|
10534
|
-
var
|
|
10534
|
+
var globalVolume = renderer.renderingData.currentFrame.globalVolume;
|
|
10535
|
+
var bloom = _extends({
|
|
10536
|
+
threshold: 0,
|
|
10537
|
+
intensity: 0,
|
|
10538
|
+
active: false
|
|
10539
|
+
}, globalVolume == null ? void 0 : globalVolume.bloom);
|
|
10540
|
+
var vignette = _extends({
|
|
10541
|
+
intensity: 0,
|
|
10542
|
+
smoothness: 0,
|
|
10543
|
+
roundness: 0,
|
|
10544
|
+
active: false
|
|
10545
|
+
}, globalVolume == null ? void 0 : globalVolume.vignette);
|
|
10546
|
+
var colorAdjustments = _extends({
|
|
10547
|
+
brightness: 0,
|
|
10548
|
+
saturation: 0,
|
|
10549
|
+
contrast: 0,
|
|
10550
|
+
active: false
|
|
10551
|
+
}, globalVolume == null ? void 0 : globalVolume.colorAdjustments);
|
|
10552
|
+
var tonemapping = _extends({
|
|
10553
|
+
active: false
|
|
10554
|
+
}, globalVolume == null ? void 0 : globalVolume.tonemapping);
|
|
10535
10555
|
this.screenMesh.material.setTexture("_SceneTex", this.sceneTextureHandle.texture);
|
|
10536
|
-
this.screenMesh.material.setFloat("_Brightness", brightness);
|
|
10537
|
-
this.screenMesh.material.setFloat("_Saturation", saturation);
|
|
10538
|
-
this.screenMesh.material.setFloat("_Contrast", contrast);
|
|
10539
|
-
this.screenMesh.material.setInt("_UseBloom", Number(
|
|
10540
|
-
if (
|
|
10556
|
+
this.screenMesh.material.setFloat("_Brightness", Math.pow(2, colorAdjustments.brightness));
|
|
10557
|
+
this.screenMesh.material.setFloat("_Saturation", colorAdjustments.saturation * 0.01 + 1);
|
|
10558
|
+
this.screenMesh.material.setFloat("_Contrast", colorAdjustments.contrast * 0.01 + 1);
|
|
10559
|
+
this.screenMesh.material.setInt("_UseBloom", Number(bloom.active));
|
|
10560
|
+
if (bloom.active) {
|
|
10541
10561
|
this.screenMesh.material.setTexture("_GaussianTex", this.mainTexture);
|
|
10542
|
-
this.screenMesh.material.setFloat("_BloomIntensity",
|
|
10562
|
+
this.screenMesh.material.setFloat("_BloomIntensity", bloom.intensity);
|
|
10543
10563
|
}
|
|
10544
|
-
if (
|
|
10545
|
-
this.screenMesh.material.setFloat("_VignetteIntensity",
|
|
10546
|
-
this.screenMesh.material.setFloat("_VignetteSmoothness",
|
|
10547
|
-
this.screenMesh.material.setFloat("_VignetteRoundness",
|
|
10564
|
+
if (vignette.intensity > 0) {
|
|
10565
|
+
this.screenMesh.material.setFloat("_VignetteIntensity", vignette.intensity);
|
|
10566
|
+
this.screenMesh.material.setFloat("_VignetteSmoothness", vignette.smoothness);
|
|
10567
|
+
this.screenMesh.material.setFloat("_VignetteRoundness", vignette.roundness);
|
|
10548
10568
|
this.screenMesh.material.setVector2("_VignetteCenter", new Vector2(0.5, 0.5));
|
|
10549
10569
|
this.screenMesh.material.setVector3("_VignetteColor", new Vector3(0.0, 0.0, 0.0));
|
|
10550
10570
|
}
|
|
10551
|
-
this.screenMesh.material.setInt("_UseToneMapping", Number(
|
|
10571
|
+
this.screenMesh.material.setInt("_UseToneMapping", Number(tonemapping.active));
|
|
10552
10572
|
renderer.renderMeshes([
|
|
10553
10573
|
this.screenMesh
|
|
10554
10574
|
]);
|
|
@@ -15759,70 +15779,79 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
|
|
|
15759
15779
|
};
|
|
15760
15780
|
_proto.buildPath = function buildPath(data) {
|
|
15761
15781
|
this.path.clear();
|
|
15762
|
-
|
|
15763
|
-
|
|
15764
|
-
|
|
15765
|
-
|
|
15766
|
-
|
|
15767
|
-
|
|
15768
|
-
|
|
15769
|
-
|
|
15770
|
-
|
|
15771
|
-
|
|
15772
|
-
|
|
15773
|
-
|
|
15774
|
-
|
|
15775
|
-
|
|
15776
|
-
|
|
15777
|
-
|
|
15778
|
-
this.curveValues.push({
|
|
15779
|
-
point: points[pointIndex.point],
|
|
15780
|
-
controlPoint1: easingOuts[lastPointIndex.easingOut],
|
|
15781
|
-
controlPoint2: easingIns[pointIndex.easingIn]
|
|
15782
|
-
});
|
|
15783
|
-
}
|
|
15784
|
-
// Push the last curve
|
|
15782
|
+
var shapeData = data;
|
|
15783
|
+
switch(shapeData.type){
|
|
15784
|
+
case 0:
|
|
15785
|
+
{
|
|
15786
|
+
var customData = shapeData;
|
|
15787
|
+
var points = customData.points;
|
|
15788
|
+
var easingIns = customData.easingIns;
|
|
15789
|
+
var easingOuts = customData.easingOuts;
|
|
15790
|
+
this.curveValues = [];
|
|
15791
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(customData.shapes), _step; !(_step = _iterator()).done;){
|
|
15792
|
+
var shape = _step.value;
|
|
15793
|
+
this.setFillColor(shape.fill);
|
|
15794
|
+
var indices = shape.indexes;
|
|
15795
|
+
for(var i = 1; i < indices.length; i++){
|
|
15796
|
+
var pointIndex = indices[i];
|
|
15797
|
+
var lastPointIndex = indices[i - 1];
|
|
15785
15798
|
this.curveValues.push({
|
|
15786
|
-
point: points[
|
|
15787
|
-
controlPoint1: easingOuts[
|
|
15788
|
-
controlPoint2: easingIns[
|
|
15799
|
+
point: points[pointIndex.point],
|
|
15800
|
+
controlPoint1: easingOuts[lastPointIndex.easingOut],
|
|
15801
|
+
controlPoint2: easingIns[pointIndex.easingIn]
|
|
15789
15802
|
});
|
|
15790
15803
|
}
|
|
15791
|
-
|
|
15792
|
-
|
|
15793
|
-
|
|
15794
|
-
|
|
15795
|
-
|
|
15796
|
-
|
|
15797
|
-
this.path.bezierCurveTo(control1.x, control1.y, control2.x, control2.y, point.x, point.y, 1);
|
|
15798
|
-
}
|
|
15799
|
-
break;
|
|
15800
|
-
}
|
|
15801
|
-
case 2:
|
|
15802
|
-
{
|
|
15803
|
-
var ellipseData = shapeData;
|
|
15804
|
-
this.path.ellipse(0, 0, ellipseData.xRadius, ellipseData.yRadius);
|
|
15805
|
-
break;
|
|
15806
|
-
}
|
|
15807
|
-
case 1:
|
|
15808
|
-
{
|
|
15809
|
-
var rectangleData = shapeData;
|
|
15810
|
-
this.path.rect(-rectangleData.width / 2, rectangleData.height / 2, rectangleData.width, rectangleData.height);
|
|
15811
|
-
break;
|
|
15812
|
-
}
|
|
15813
|
-
case 4:
|
|
15814
|
-
{
|
|
15815
|
-
var starData = shapeData;
|
|
15816
|
-
this.path.polyStar(starData.pointCount, starData.outerRadius, starData.innerRadius, starData.outerRoundness, starData.innerRoundness, StarType.Star);
|
|
15817
|
-
break;
|
|
15804
|
+
// Push the last curve
|
|
15805
|
+
this.curveValues.push({
|
|
15806
|
+
point: points[indices[0].point],
|
|
15807
|
+
controlPoint1: easingOuts[indices[indices.length - 1].easingOut],
|
|
15808
|
+
controlPoint2: easingIns[indices[0].easingIn]
|
|
15809
|
+
});
|
|
15818
15810
|
}
|
|
15819
|
-
|
|
15820
|
-
{
|
|
15821
|
-
var
|
|
15822
|
-
|
|
15823
|
-
|
|
15811
|
+
this.path.moveTo(this.curveValues[this.curveValues.length - 1].point.x, this.curveValues[this.curveValues.length - 1].point.y);
|
|
15812
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(this.curveValues), _step1; !(_step1 = _iterator1()).done;){
|
|
15813
|
+
var curveValue = _step1.value;
|
|
15814
|
+
var point = curveValue.point;
|
|
15815
|
+
var control1 = curveValue.controlPoint1;
|
|
15816
|
+
var control2 = curveValue.controlPoint2;
|
|
15817
|
+
this.path.bezierCurveTo(control1.x, control1.y, control2.x, control2.y, point.x, point.y, 1);
|
|
15824
15818
|
}
|
|
15825
|
-
|
|
15819
|
+
break;
|
|
15820
|
+
}
|
|
15821
|
+
case 2:
|
|
15822
|
+
{
|
|
15823
|
+
var ellipseData = shapeData;
|
|
15824
|
+
this.path.ellipse(0, 0, ellipseData.xRadius, ellipseData.yRadius);
|
|
15825
|
+
this.setFillColor(ellipseData.fill);
|
|
15826
|
+
break;
|
|
15827
|
+
}
|
|
15828
|
+
case 1:
|
|
15829
|
+
{
|
|
15830
|
+
var rectangleData = shapeData;
|
|
15831
|
+
this.path.rect(-rectangleData.width / 2, rectangleData.height / 2, rectangleData.width, rectangleData.height);
|
|
15832
|
+
this.setFillColor(rectangleData.fill);
|
|
15833
|
+
break;
|
|
15834
|
+
}
|
|
15835
|
+
case 4:
|
|
15836
|
+
{
|
|
15837
|
+
var starData = shapeData;
|
|
15838
|
+
this.path.polyStar(starData.pointCount, starData.outerRadius, starData.innerRadius, starData.outerRoundness, starData.innerRoundness, StarType.Star);
|
|
15839
|
+
this.setFillColor(starData.fill);
|
|
15840
|
+
break;
|
|
15841
|
+
}
|
|
15842
|
+
case 3:
|
|
15843
|
+
{
|
|
15844
|
+
var polygonData = shapeData;
|
|
15845
|
+
this.path.polyStar(polygonData.pointCount, polygonData.radius, polygonData.radius, polygonData.roundness, polygonData.roundness, StarType.Polygon);
|
|
15846
|
+
this.setFillColor(polygonData.fill);
|
|
15847
|
+
break;
|
|
15848
|
+
}
|
|
15849
|
+
}
|
|
15850
|
+
};
|
|
15851
|
+
_proto.setFillColor = function setFillColor(fill) {
|
|
15852
|
+
if (fill) {
|
|
15853
|
+
var color = fill.color;
|
|
15854
|
+
this.material.setColor("_Color", new Color(color.r, color.g, color.b, color.a));
|
|
15826
15855
|
}
|
|
15827
15856
|
};
|
|
15828
15857
|
_proto.fromData = function fromData(data) {
|
|
@@ -15842,26 +15871,24 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
|
|
|
15842
15871
|
ShapeComponent = __decorate([
|
|
15843
15872
|
effectsClass("ShapeComponent")
|
|
15844
15873
|
], ShapeComponent);
|
|
15845
|
-
var
|
|
15846
|
-
(function(
|
|
15874
|
+
var ShapePrimitiveType;
|
|
15875
|
+
(function(ShapePrimitiveType) {
|
|
15847
15876
|
/**
|
|
15848
15877
|
* 自定义图形
|
|
15849
|
-
*/
|
|
15878
|
+
*/ ShapePrimitiveType[ShapePrimitiveType["Custom"] = 0] = "Custom";
|
|
15850
15879
|
/**
|
|
15851
15880
|
* 矩形
|
|
15852
|
-
*/
|
|
15881
|
+
*/ ShapePrimitiveType[ShapePrimitiveType["Rectangle"] = 1] = "Rectangle";
|
|
15853
15882
|
/**
|
|
15854
15883
|
* 椭圆
|
|
15855
|
-
*/
|
|
15884
|
+
*/ ShapePrimitiveType[ShapePrimitiveType["Ellipse"] = 2] = "Ellipse";
|
|
15856
15885
|
/**
|
|
15857
15886
|
* 多边形
|
|
15858
|
-
*/
|
|
15887
|
+
*/ ShapePrimitiveType[ShapePrimitiveType["Polygon"] = 3] = "Polygon";
|
|
15859
15888
|
/**
|
|
15860
15889
|
* 星形
|
|
15861
|
-
*/
|
|
15862
|
-
})(
|
|
15863
|
-
var ShapeData = function ShapeData() {
|
|
15864
|
-
};
|
|
15890
|
+
*/ ShapePrimitiveType[ShapePrimitiveType["Star"] = 4] = "Star";
|
|
15891
|
+
})(ShapePrimitiveType || (ShapePrimitiveType = {}));
|
|
15865
15892
|
var ShapeConnectType;
|
|
15866
15893
|
(function(ShapeConnectType) {})(ShapeConnectType || (ShapeConnectType = {}));
|
|
15867
15894
|
var ShapePointType;
|
|
@@ -16363,8 +16390,8 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16363
16390
|
0
|
|
16364
16391
|
]
|
|
16365
16392
|
};
|
|
16393
|
+
_this.duringPlay = false;
|
|
16366
16394
|
/** 是否响应点击和拖拽交互事件 */ _this._interactive = true;
|
|
16367
|
-
_this.hasBeenAddedToComposition = false;
|
|
16368
16395
|
_this.getHitTestParams = function(force) {
|
|
16369
16396
|
if (!_this.clickable) {
|
|
16370
16397
|
return;
|
|
@@ -16401,7 +16428,6 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16401
16428
|
];
|
|
16402
16429
|
};
|
|
16403
16430
|
_proto.onStart = function onStart() {
|
|
16404
|
-
var _this = this;
|
|
16405
16431
|
var options = this.item.props.content.options;
|
|
16406
16432
|
var env = this.item.engine.renderer.env;
|
|
16407
16433
|
var composition = this.item.composition;
|
|
@@ -16425,32 +16451,35 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16425
16451
|
this.materials = this.previewContent.mesh.materials;
|
|
16426
16452
|
}
|
|
16427
16453
|
this.item.getHitTestParams = this.getHitTestParams;
|
|
16428
|
-
|
|
16429
|
-
|
|
16430
|
-
|
|
16431
|
-
|
|
16432
|
-
|
|
16433
|
-
|
|
16434
|
-
|
|
16435
|
-
_this.endDragTarget();
|
|
16454
|
+
};
|
|
16455
|
+
_proto.onDisable = function onDisable() {
|
|
16456
|
+
if (this.item && this.item.composition) {
|
|
16457
|
+
var _this_previewContent;
|
|
16458
|
+
if (this.duringPlay) {
|
|
16459
|
+
this.item.composition.removeInteractiveItem(this.item, this.item.props.content.options.type);
|
|
16460
|
+
this.duringPlay = false;
|
|
16436
16461
|
}
|
|
16437
|
-
|
|
16462
|
+
this.clickable = false;
|
|
16463
|
+
(_this_previewContent = this.previewContent) == null ? void 0 : _this_previewContent.mesh.dispose();
|
|
16464
|
+
this.endDragTarget();
|
|
16465
|
+
}
|
|
16466
|
+
};
|
|
16467
|
+
_proto.onEnable = function onEnable() {
|
|
16468
|
+
var type = this.interactData.options.type;
|
|
16469
|
+
if (type === InteractType.CLICK) {
|
|
16470
|
+
this.clickable = true;
|
|
16471
|
+
}
|
|
16438
16472
|
};
|
|
16439
16473
|
_proto.onUpdate = function onUpdate(dt) {
|
|
16440
16474
|
var _this_previewContent;
|
|
16441
|
-
|
|
16442
|
-
|
|
16443
|
-
|
|
16444
|
-
|
|
16445
|
-
if (!this.hasBeenAddedToComposition && this.item.composition) {
|
|
16446
|
-
var type = this.interactData.options.type;
|
|
16447
|
-
if (type === InteractType.CLICK) {
|
|
16448
|
-
this.clickable = true;
|
|
16449
|
-
}
|
|
16475
|
+
this.duringPlay = true;
|
|
16476
|
+
// trigger messageBegin when item enter
|
|
16477
|
+
if (this.item.time > 0 && this.item.time - dt / 1000 <= 0) {
|
|
16478
|
+
var _this_item_composition;
|
|
16450
16479
|
var options = this.item.props.content.options;
|
|
16451
|
-
this.item.composition.addInteractiveItem(this.item, options.type);
|
|
16452
|
-
this.hasBeenAddedToComposition = true;
|
|
16480
|
+
(_this_item_composition = this.item.composition) == null ? void 0 : _this_item_composition.addInteractiveItem(this.item, options.type);
|
|
16453
16481
|
}
|
|
16482
|
+
(_this_previewContent = this.previewContent) == null ? void 0 : _this_previewContent.updateMesh();
|
|
16454
16483
|
if (!this.dragEvent || !this.bouncingArg) {
|
|
16455
16484
|
return;
|
|
16456
16485
|
}
|
|
@@ -16864,6 +16893,7 @@ var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
|
|
|
16864
16893
|
if (inputCount === void 0) inputCount = 0;
|
|
16865
16894
|
this.onPlayablePlayFlag = true;
|
|
16866
16895
|
this.onPlayablePauseFlag = false;
|
|
16896
|
+
this.duration = 0;
|
|
16867
16897
|
this.destroyed = false;
|
|
16868
16898
|
this.inputs = [];
|
|
16869
16899
|
this.inputOuputPorts = [];
|
|
@@ -16956,6 +16986,12 @@ var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
|
|
|
16956
16986
|
_proto.getTime = function getTime() {
|
|
16957
16987
|
return this.time;
|
|
16958
16988
|
};
|
|
16989
|
+
_proto.setDuration = function setDuration(duration) {
|
|
16990
|
+
this.duration = duration;
|
|
16991
|
+
};
|
|
16992
|
+
_proto.getDuration = function getDuration() {
|
|
16993
|
+
return this.duration;
|
|
16994
|
+
};
|
|
16959
16995
|
_proto.getPlayState = function getPlayState() {
|
|
16960
16996
|
return this.playState;
|
|
16961
16997
|
};
|
|
@@ -17672,17 +17708,15 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
17672
17708
|
/**
|
|
17673
17709
|
* 元素动画结束时行为(如何处理元素)
|
|
17674
17710
|
*/ _this.endBehavior = EndBehavior.forward;
|
|
17675
|
-
/**
|
|
17676
|
-
* 元素是否可用
|
|
17677
|
-
*/ _this.ended = false;
|
|
17678
|
-
_this.reusable = false;
|
|
17679
17711
|
_this.type = ItemType.base;
|
|
17680
17712
|
_this.isDuringPlay = false;
|
|
17681
17713
|
_this.components = [];
|
|
17682
17714
|
_this.rendererComponents = [];
|
|
17683
17715
|
/**
|
|
17684
|
-
*
|
|
17685
|
-
|
|
17716
|
+
* 元素是否激活
|
|
17717
|
+
*/ _this.active = true;
|
|
17718
|
+
/**
|
|
17719
|
+
* 元素组件是否显示,用于批量开关元素组件
|
|
17686
17720
|
*/ _this.visible = true;
|
|
17687
17721
|
/**
|
|
17688
17722
|
* 元素动画的速度
|
|
@@ -17813,12 +17847,6 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
17813
17847
|
}
|
|
17814
17848
|
};
|
|
17815
17849
|
/**
|
|
17816
|
-
* 元素动画结束播放时回调函数
|
|
17817
|
-
* @override
|
|
17818
|
-
*/ _proto.onEnd = function onEnd() {
|
|
17819
|
-
// OVERRIDE
|
|
17820
|
-
};
|
|
17821
|
-
/**
|
|
17822
17850
|
* 通过指定 r、g、b、a 值设置元素的颜色
|
|
17823
17851
|
* @param {number} r
|
|
17824
17852
|
* @param {number} g
|
|
@@ -17831,17 +17859,27 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
17831
17859
|
* @param opacity - 透明度值,范围 [0,1]
|
|
17832
17860
|
*/ _proto.setOpacity = function setOpacity(opacity) {};
|
|
17833
17861
|
/**
|
|
17834
|
-
*
|
|
17835
|
-
*/ _proto.
|
|
17836
|
-
|
|
17862
|
+
* 激活或停用 VFXItem
|
|
17863
|
+
*/ _proto.setActive = function setActive(value) {
|
|
17864
|
+
if (this.active !== value) {
|
|
17865
|
+
this.active = !!value;
|
|
17866
|
+
this.onActiveChanged();
|
|
17867
|
+
}
|
|
17837
17868
|
};
|
|
17838
17869
|
/**
|
|
17839
|
-
*
|
|
17870
|
+
* 设置元素的显隐,该设置会批量开关元素组件
|
|
17840
17871
|
*/ _proto.setVisible = function setVisible(visible) {
|
|
17841
|
-
|
|
17842
|
-
|
|
17843
|
-
|
|
17872
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(this.components), _step; !(_step = _iterator()).done;){
|
|
17873
|
+
var component = _step.value;
|
|
17874
|
+
component.enabled = visible;
|
|
17844
17875
|
}
|
|
17876
|
+
this.visible = visible;
|
|
17877
|
+
};
|
|
17878
|
+
/**
|
|
17879
|
+
* 元素组件显隐状态
|
|
17880
|
+
* @deprecated use isVisible instead
|
|
17881
|
+
*/ _proto.getVisible = function getVisible() {
|
|
17882
|
+
return this.visible;
|
|
17845
17883
|
};
|
|
17846
17884
|
/**
|
|
17847
17885
|
* 获取元素变换包括位置、旋转、缩放
|
|
@@ -17923,14 +17961,6 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
17923
17961
|
this.transform.assignWorldTRS(pos);
|
|
17924
17962
|
return pos;
|
|
17925
17963
|
};
|
|
17926
|
-
/**
|
|
17927
|
-
* 是否到达元素的结束时间
|
|
17928
|
-
* @param now
|
|
17929
|
-
* @returns
|
|
17930
|
-
*/ _proto.isEnded = function isEnded(now) {
|
|
17931
|
-
// at least 1 ms
|
|
17932
|
-
return now - this.duration > 0.001;
|
|
17933
|
-
};
|
|
17934
17964
|
_proto.find = function find(name) {
|
|
17935
17965
|
var _queue;
|
|
17936
17966
|
if (this.name === name) {
|
|
@@ -17954,7 +17984,7 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
17954
17984
|
* @internal
|
|
17955
17985
|
*/ _proto.beginPlay = function beginPlay() {
|
|
17956
17986
|
this.isDuringPlay = true;
|
|
17957
|
-
if (this.composition && this.
|
|
17987
|
+
if (this.composition && this.active && !this.isEnabled) {
|
|
17958
17988
|
this.onEnable();
|
|
17959
17989
|
}
|
|
17960
17990
|
for(var _iterator = _create_for_of_iterator_helper_loose(this.children), _step; !(_step = _iterator()).done;){
|
|
@@ -18230,6 +18260,22 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
18230
18260
|
}
|
|
18231
18261
|
}
|
|
18232
18262
|
}
|
|
18263
|
+
},
|
|
18264
|
+
{
|
|
18265
|
+
key: "isActive",
|
|
18266
|
+
get: /**
|
|
18267
|
+
* 当前 VFXItem 是否激活
|
|
18268
|
+
*/ function get() {
|
|
18269
|
+
return this.active;
|
|
18270
|
+
}
|
|
18271
|
+
},
|
|
18272
|
+
{
|
|
18273
|
+
key: "isVisible",
|
|
18274
|
+
get: /**
|
|
18275
|
+
* 元素组件显隐状态
|
|
18276
|
+
*/ function get() {
|
|
18277
|
+
return this.visible;
|
|
18278
|
+
}
|
|
18233
18279
|
}
|
|
18234
18280
|
]);
|
|
18235
18281
|
return VFXItem;
|
|
@@ -18900,7 +18946,7 @@ var ShapeNone = /*#__PURE__*/ function() {
|
|
|
18900
18946
|
return ShapeNone;
|
|
18901
18947
|
}();
|
|
18902
18948
|
var _obj$3;
|
|
18903
|
-
var map = (_obj$3 = {}, _obj$3[ShapeType
|
|
18949
|
+
var map = (_obj$3 = {}, _obj$3[ShapeType.NONE] = ShapeNone, _obj$3[ShapeType.CONE] = Cone, _obj$3[ShapeType.SPHERE] = Sphere, _obj$3[ShapeType.HEMISPHERE] = Hemisphere, _obj$3[ShapeType.CIRCLE] = Circle, _obj$3[ShapeType.DONUT] = Donut, _obj$3[ShapeType.RECTANGLE] = Rectangle, _obj$3[ShapeType.EDGE] = Edge, _obj$3[ShapeType.RECTANGLE_EDGE] = RectangleEdge, _obj$3[ShapeType.TEXTURE] = TextureShape, _obj$3);
|
|
18904
18950
|
function createShape(shapeOptions) {
|
|
18905
18951
|
if (!shapeOptions) {
|
|
18906
18952
|
return new ShapeNone();
|
|
@@ -18917,7 +18963,7 @@ function createShape(shapeOptions) {
|
|
|
18917
18963
|
throw new Error("Invalid shape: " + type + ".");
|
|
18918
18964
|
}
|
|
18919
18965
|
var ctrl = new Ctrl(options);
|
|
18920
|
-
if (type !== ShapeType
|
|
18966
|
+
if (type !== ShapeType.NONE) {
|
|
18921
18967
|
var alignSpeedDirection = shapeOptions.alignSpeedDirection, _shapeOptions_upDirection = shapeOptions.upDirection, upDirection = _shapeOptions_upDirection === void 0 ? [
|
|
18922
18968
|
0,
|
|
18923
18969
|
0,
|
|
@@ -22994,6 +23040,7 @@ var TrackAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
|
22994
23040
|
for(var _iterator = _create_for_of_iterator_helper_loose(timelineClips), _step; !(_step = _iterator()).done;){
|
|
22995
23041
|
var timelineClip = _step.value;
|
|
22996
23042
|
var clipPlayable = this.createClipPlayable(graph, timelineClip);
|
|
23043
|
+
clipPlayable.setDuration(timelineClip.duration);
|
|
22997
23044
|
var clip = new RuntimeClip(timelineClip, clipPlayable, mixer, this);
|
|
22998
23045
|
runtimeClips.push(clip);
|
|
22999
23046
|
mixer.addInput(clipPlayable, 0);
|
|
@@ -23097,14 +23144,6 @@ var RuntimeClip = /*#__PURE__*/ function() {
|
|
|
23097
23144
|
this.playable.setTime(clipTime);
|
|
23098
23145
|
// 判断动画是否结束
|
|
23099
23146
|
if (ended) {
|
|
23100
|
-
if (_instanceof1(boundObject, VFXItem) && !boundObject.ended) {
|
|
23101
|
-
boundObject.ended = true;
|
|
23102
|
-
boundObject.onEnd();
|
|
23103
|
-
if (!boundObject.compositionReusable && !boundObject.reusable) {
|
|
23104
|
-
boundObject.dispose();
|
|
23105
|
-
this.playable.dispose();
|
|
23106
|
-
}
|
|
23107
|
-
}
|
|
23108
23147
|
if (this.playable.getPlayState() === PlayState.Playing) {
|
|
23109
23148
|
this.playable.pause();
|
|
23110
23149
|
}
|
|
@@ -23147,26 +23186,10 @@ var ActivationMixerPlayable = /*#__PURE__*/ function(Playable) {
|
|
|
23147
23186
|
}
|
|
23148
23187
|
if (hasInput) {
|
|
23149
23188
|
boundItem.transform.setValid(true);
|
|
23150
|
-
|
|
23189
|
+
boundItem.setActive(true);
|
|
23151
23190
|
} else {
|
|
23152
23191
|
boundItem.transform.setValid(false);
|
|
23153
|
-
|
|
23154
|
-
}
|
|
23155
|
-
};
|
|
23156
|
-
_proto.hideRendererComponents = function hideRendererComponents(item) {
|
|
23157
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(item.rendererComponents), _step; !(_step = _iterator()).done;){
|
|
23158
|
-
var rendererComponent = _step.value;
|
|
23159
|
-
if (rendererComponent.enabled) {
|
|
23160
|
-
rendererComponent.enabled = false;
|
|
23161
|
-
}
|
|
23162
|
-
}
|
|
23163
|
-
};
|
|
23164
|
-
_proto.showRendererComponents = function showRendererComponents(item) {
|
|
23165
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(item.rendererComponents), _step; !(_step = _iterator()).done;){
|
|
23166
|
-
var rendererComponent = _step.value;
|
|
23167
|
-
if (!rendererComponent.enabled) {
|
|
23168
|
-
rendererComponent.enabled = true;
|
|
23169
|
-
}
|
|
23192
|
+
boundItem.setActive(false);
|
|
23170
23193
|
}
|
|
23171
23194
|
};
|
|
23172
23195
|
return ActivationMixerPlayable;
|
|
@@ -23194,7 +23217,7 @@ var PropertyClipPlayable = /*#__PURE__*/ function(Playable) {
|
|
|
23194
23217
|
}
|
|
23195
23218
|
var _proto = PropertyClipPlayable.prototype;
|
|
23196
23219
|
_proto.processFrame = function processFrame(context) {
|
|
23197
|
-
this.value = this.curve.getValue(this.time);
|
|
23220
|
+
this.value = this.curve.getValue(this.time / this.getDuration());
|
|
23198
23221
|
};
|
|
23199
23222
|
return PropertyClipPlayable;
|
|
23200
23223
|
}(Playable);
|
|
@@ -23712,9 +23735,6 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
23712
23735
|
var track = _step.value;
|
|
23713
23736
|
var boundObject = track.boundObject;
|
|
23714
23737
|
if (_instanceof1(boundObject, VFXItem)) {
|
|
23715
|
-
if (_instanceof1(track, ObjectBindingTrack)) {
|
|
23716
|
-
boundObject.reusable = value;
|
|
23717
|
-
}
|
|
23718
23738
|
var subCompositionComponent = boundObject.getComponent(CompositionComponent);
|
|
23719
23739
|
if (subCompositionComponent) {
|
|
23720
23740
|
subCompositionComponent.setReusable(value);
|
|
@@ -23759,16 +23779,16 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
23759
23779
|
}
|
|
23760
23780
|
}
|
|
23761
23781
|
};
|
|
23762
|
-
_proto.
|
|
23782
|
+
_proto.onEnable = function onEnable() {
|
|
23763
23783
|
for(var _iterator = _create_for_of_iterator_helper_loose(this.items), _step; !(_step = _iterator()).done;){
|
|
23764
23784
|
var item = _step.value;
|
|
23765
|
-
item.
|
|
23785
|
+
item.setActive(true);
|
|
23766
23786
|
}
|
|
23767
23787
|
};
|
|
23768
|
-
_proto.
|
|
23788
|
+
_proto.onDisable = function onDisable() {
|
|
23769
23789
|
for(var _iterator = _create_for_of_iterator_helper_loose(this.items), _step; !(_step = _iterator()).done;){
|
|
23770
23790
|
var item = _step.value;
|
|
23771
|
-
item.
|
|
23791
|
+
item.setActive(false);
|
|
23772
23792
|
}
|
|
23773
23793
|
};
|
|
23774
23794
|
_proto.onDestroy = function onDestroy() {
|
|
@@ -23784,7 +23804,7 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
23784
23804
|
_proto.hitTest = function hitTest(ray, x, y, regions, force, options) {
|
|
23785
23805
|
var _this, _loop = function(i) {
|
|
23786
23806
|
var item = _this.items[i];
|
|
23787
|
-
if (item.
|
|
23807
|
+
if (item.isActive && item.transform.getValid() && !VFXItem.isComposition(item) && !skip(item)) {
|
|
23788
23808
|
var hitParams = item.getHitTestParams(force);
|
|
23789
23809
|
if (hitParams) {
|
|
23790
23810
|
var success = false;
|
|
@@ -23926,9 +23946,9 @@ var SubCompositionMixerPlayable = /*#__PURE__*/ function(Playable) {
|
|
|
23926
23946
|
}
|
|
23927
23947
|
}
|
|
23928
23948
|
if (hasInput) {
|
|
23929
|
-
compositionComponent.
|
|
23949
|
+
compositionComponent.item.setActive(true);
|
|
23930
23950
|
} else {
|
|
23931
|
-
compositionComponent.
|
|
23951
|
+
compositionComponent.item.setActive(false);
|
|
23932
23952
|
}
|
|
23933
23953
|
};
|
|
23934
23954
|
return SubCompositionMixerPlayable;
|
|
@@ -24593,6 +24613,8 @@ var TextComponent = /*#__PURE__*/ function(BaseRenderComponent) {
|
|
|
24593
24613
|
/**
|
|
24594
24614
|
* 文本行数
|
|
24595
24615
|
*/ _this.lineCount = 0;
|
|
24616
|
+
_this.SCALE_FACTOR = 0.1;
|
|
24617
|
+
_this.ALPHA_FIX_VALUE = 1 / 255;
|
|
24596
24618
|
_this.name = "MText" + seed$2++;
|
|
24597
24619
|
_this.geometry = _this.createGeometry(glContext.TRIANGLES);
|
|
24598
24620
|
if (props) {
|
|
@@ -26286,13 +26308,13 @@ function getStandardParticleContent(particle) {
|
|
|
26286
26308
|
var options = particle.options;
|
|
26287
26309
|
var transform = particle.transform;
|
|
26288
26310
|
var shape = {
|
|
26289
|
-
type: ShapeType
|
|
26311
|
+
type: ShapeType.NONE
|
|
26290
26312
|
};
|
|
26291
26313
|
if (particle.shape) {
|
|
26292
26314
|
var _particle_shape_shape;
|
|
26293
26315
|
var shapeType = (_particle_shape_shape = particle.shape.shape) == null ? void 0 : _particle_shape_shape.replace(/([A-Z])/g, "_$1").toUpperCase().replace(/^_/, "");
|
|
26294
26316
|
shape = _extends({}, particle.shape, {
|
|
26295
|
-
type: ShapeType
|
|
26317
|
+
type: ShapeType[shapeType]
|
|
26296
26318
|
});
|
|
26297
26319
|
if (particle.shape.upDirection) {
|
|
26298
26320
|
var _particle_shape_upDirection = particle.shape.upDirection, x = _particle_shape_upDirection[0], y = _particle_shape_upDirection[1], z = _particle_shape_upDirection[2];
|
|
@@ -28383,6 +28405,9 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28383
28405
|
* 动画播放速度
|
|
28384
28406
|
*/ _this.speed = 1;
|
|
28385
28407
|
/**
|
|
28408
|
+
* 合成是否结束
|
|
28409
|
+
*/ _this.isEnded = false;
|
|
28410
|
+
/**
|
|
28386
28411
|
* 用于保存与当前合成相关的插件数据
|
|
28387
28412
|
*/ _this.loaderData = {};
|
|
28388
28413
|
/**
|
|
@@ -28404,6 +28429,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28404
28429
|
* 合成暂停/播放 标识
|
|
28405
28430
|
*/ _this.paused = false;
|
|
28406
28431
|
_this.lastVideoUpdateTime = 0;
|
|
28432
|
+
_this.isEndCalled = false;
|
|
28407
28433
|
var _props_reusable = props.reusable, reusable = _props_reusable === void 0 ? false : _props_reusable, _props_speed = props.speed, speed = _props_speed === void 0 ? 1 : _props_speed, _props_baseRenderOrder = props.baseRenderOrder, baseRenderOrder = _props_baseRenderOrder === void 0 ? 0 : _props_baseRenderOrder, renderer = props.renderer, event = props.event, width = props.width, height = props.height, handleItemMessage = props.handleItemMessage;
|
|
28408
28434
|
_this.compositionSourceManager = new CompositionSourceManager(scene, renderer.engine);
|
|
28409
28435
|
if (reusable) {
|
|
@@ -28493,7 +28519,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28493
28519
|
* @param visible - 是否可见
|
|
28494
28520
|
*/ _proto.setVisible = function setVisible(visible) {
|
|
28495
28521
|
this.items.forEach(function(item) {
|
|
28496
|
-
item.
|
|
28522
|
+
item.setActive(visible);
|
|
28497
28523
|
});
|
|
28498
28524
|
};
|
|
28499
28525
|
/**
|
|
@@ -28503,7 +28529,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28503
28529
|
return this.speed;
|
|
28504
28530
|
};
|
|
28505
28531
|
_proto.play = function play() {
|
|
28506
|
-
if (this.
|
|
28532
|
+
if (this.isEnded && this.reusable) {
|
|
28507
28533
|
this.restart();
|
|
28508
28534
|
}
|
|
28509
28535
|
if (this.rootComposition.isStartCalled) {
|
|
@@ -28594,7 +28620,8 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28594
28620
|
* 重置状态函数
|
|
28595
28621
|
*/ _proto.reset = function reset() {
|
|
28596
28622
|
this.rendererOptions = null;
|
|
28597
|
-
this.
|
|
28623
|
+
this.isEnded = false;
|
|
28624
|
+
this.isEndCalled = false;
|
|
28598
28625
|
this.rootComposition.time = 0;
|
|
28599
28626
|
this.pluginSystem.resetComposition(this, this.renderFrame);
|
|
28600
28627
|
};
|
|
@@ -28646,12 +28673,18 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28646
28673
|
this.sceneTicking.lateUpdate.tick(dt);
|
|
28647
28674
|
this.updateCamera();
|
|
28648
28675
|
this.prepareRender();
|
|
28676
|
+
if (this.isEnded && !this.isEndCalled) {
|
|
28677
|
+
this.isEndCalled = true;
|
|
28678
|
+
this.emit("end", {
|
|
28679
|
+
composition: this
|
|
28680
|
+
});
|
|
28681
|
+
}
|
|
28649
28682
|
if (this.shouldDispose()) {
|
|
28650
28683
|
this.dispose();
|
|
28651
28684
|
}
|
|
28652
28685
|
};
|
|
28653
28686
|
_proto.shouldDispose = function shouldDispose() {
|
|
28654
|
-
return this.
|
|
28687
|
+
return this.isEnded && this.rootItem.endBehavior === EndBehavior.destroy && !this.reusable;
|
|
28655
28688
|
};
|
|
28656
28689
|
_proto.getUpdateTime = function getUpdateTime(t) {
|
|
28657
28690
|
var startTimeInMs = this.startTime * 1000;
|
|
@@ -28742,11 +28775,11 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28742
28775
|
*/ _proto.updateRootComposition = function updateRootComposition(deltaTime) {
|
|
28743
28776
|
if (this.rootComposition.isActiveAndEnabled) {
|
|
28744
28777
|
var localTime = this.time + deltaTime - this.rootItem.start;
|
|
28745
|
-
var
|
|
28778
|
+
var isEnded = false;
|
|
28746
28779
|
var duration = this.rootItem.duration;
|
|
28747
28780
|
var endBehavior = this.rootItem.endBehavior;
|
|
28748
28781
|
if (localTime - duration > 0.001) {
|
|
28749
|
-
|
|
28782
|
+
isEnded = true;
|
|
28750
28783
|
switch(endBehavior){
|
|
28751
28784
|
case EndBehavior.restart:
|
|
28752
28785
|
{
|
|
@@ -28770,11 +28803,14 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28770
28803
|
}
|
|
28771
28804
|
}
|
|
28772
28805
|
this.rootComposition.time = localTime;
|
|
28773
|
-
|
|
28774
|
-
|
|
28775
|
-
|
|
28776
|
-
|
|
28777
|
-
}
|
|
28806
|
+
// end state changed, handle onEnd flags
|
|
28807
|
+
if (this.isEnded !== isEnded) {
|
|
28808
|
+
if (isEnded) {
|
|
28809
|
+
this.isEnded = true;
|
|
28810
|
+
} else {
|
|
28811
|
+
this.isEnded = false;
|
|
28812
|
+
this.isEndCalled = false;
|
|
28813
|
+
}
|
|
28778
28814
|
}
|
|
28779
28815
|
}
|
|
28780
28816
|
};
|
|
@@ -31100,7 +31136,7 @@ registerPlugin("sprite", SpriteLoader, VFXItem, true);
|
|
|
31100
31136
|
registerPlugin("particle", ParticleLoader, VFXItem, true);
|
|
31101
31137
|
registerPlugin("cal", CalculateLoader, VFXItem, true);
|
|
31102
31138
|
registerPlugin("interact", InteractLoader, VFXItem, true);
|
|
31103
|
-
var version$1 = "2.1.0-alpha.
|
|
31139
|
+
var version$1 = "2.1.0-alpha.12";
|
|
31104
31140
|
logger.info("Core version: " + version$1 + ".");
|
|
31105
31141
|
|
|
31106
31142
|
var _obj;
|
|
@@ -32744,8 +32780,8 @@ setMaxSpriteMeshItemCount(8);
|
|
|
32744
32780
|
*/ Mesh.create = function(engine, props) {
|
|
32745
32781
|
return new ThreeMesh(engine, props);
|
|
32746
32782
|
};
|
|
32747
|
-
var version = "2.1.0-alpha.
|
|
32783
|
+
var version = "2.1.0-alpha.12";
|
|
32748
32784
|
logger.info("THREEJS plugin version: " + version + ".");
|
|
32749
32785
|
|
|
32750
|
-
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, ShapeConnectType,
|
|
32786
|
+
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, ShapeConnectType, ShapePointType, ShapePrimitiveType, 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, 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 };
|
|
32751
32787
|
//# sourceMappingURL=index.mjs.map
|