@galacean/effects-threejs 2.1.0-alpha.10 → 2.1.0-alpha.11
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 +257 -228
- 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 +265 -235
- 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.11
|
|
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);
|
|
3807
|
+
], PostProcessVolume.prototype, "bloom", void 0);
|
|
3806
3808
|
__decorate([
|
|
3807
3809
|
serialize()
|
|
3808
|
-
], PostProcessVolume.prototype, "
|
|
3810
|
+
], PostProcessVolume.prototype, "vignette", void 0);
|
|
3809
3811
|
__decorate([
|
|
3810
3812
|
serialize()
|
|
3811
|
-
], PostProcessVolume.prototype, "
|
|
3813
|
+
], PostProcessVolume.prototype, "tonemapping", void 0);
|
|
3812
3814
|
__decorate([
|
|
3813
3815
|
serialize()
|
|
3814
|
-
], PostProcessVolume.prototype, "
|
|
3815
|
-
__decorate([
|
|
3816
|
-
serialize()
|
|
3817
|
-
], PostProcessVolume.prototype, "contrast", void 0);
|
|
3818
|
-
__decorate([
|
|
3819
|
-
serialize()
|
|
3820
|
-
], PostProcessVolume.prototype, "vignetteIntensity", void 0);
|
|
3821
|
-
__decorate([
|
|
3822
|
-
serialize()
|
|
3823
|
-
], PostProcessVolume.prototype, "vignetteSmoothness", void 0);
|
|
3824
|
-
__decorate([
|
|
3825
|
-
serialize()
|
|
3826
|
-
], PostProcessVolume.prototype, "vignetteRoundness", void 0);
|
|
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;
|
|
@@ -16364,7 +16391,6 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16364
16391
|
]
|
|
16365
16392
|
};
|
|
16366
16393
|
/** 是否响应点击和拖拽交互事件 */ _this._interactive = true;
|
|
16367
|
-
_this.hasBeenAddedToComposition = false;
|
|
16368
16394
|
_this.getHitTestParams = function(force) {
|
|
16369
16395
|
if (!_this.clickable) {
|
|
16370
16396
|
return;
|
|
@@ -16401,7 +16427,6 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16401
16427
|
];
|
|
16402
16428
|
};
|
|
16403
16429
|
_proto.onStart = function onStart() {
|
|
16404
|
-
var _this = this;
|
|
16405
16430
|
var options = this.item.props.content.options;
|
|
16406
16431
|
var env = this.item.engine.renderer.env;
|
|
16407
16432
|
var composition = this.item.composition;
|
|
@@ -16425,16 +16450,25 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16425
16450
|
this.materials = this.previewContent.mesh.materials;
|
|
16426
16451
|
}
|
|
16427
16452
|
this.item.getHitTestParams = this.getHitTestParams;
|
|
16428
|
-
|
|
16429
|
-
|
|
16430
|
-
|
|
16431
|
-
|
|
16432
|
-
|
|
16433
|
-
|
|
16434
|
-
|
|
16435
|
-
|
|
16436
|
-
|
|
16437
|
-
|
|
16453
|
+
};
|
|
16454
|
+
_proto.onDisable = function onDisable() {
|
|
16455
|
+
if (this.item && this.item.composition) {
|
|
16456
|
+
var _this_previewContent;
|
|
16457
|
+
this.item.composition.removeInteractiveItem(this.item, this.item.props.content.options.type);
|
|
16458
|
+
this.clickable = false;
|
|
16459
|
+
(_this_previewContent = this.previewContent) == null ? void 0 : _this_previewContent.mesh.dispose();
|
|
16460
|
+
this.endDragTarget();
|
|
16461
|
+
}
|
|
16462
|
+
};
|
|
16463
|
+
_proto.onEnable = function onEnable() {
|
|
16464
|
+
var type = this.interactData.options.type;
|
|
16465
|
+
if (type === InteractType.CLICK) {
|
|
16466
|
+
this.clickable = true;
|
|
16467
|
+
}
|
|
16468
|
+
var options = this.item.props.content.options;
|
|
16469
|
+
if (this.item.composition) {
|
|
16470
|
+
this.item.composition.addInteractiveItem(this.item, options.type);
|
|
16471
|
+
}
|
|
16438
16472
|
};
|
|
16439
16473
|
_proto.onUpdate = function onUpdate(dt) {
|
|
16440
16474
|
var _this_previewContent;
|
|
@@ -16442,15 +16476,6 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16442
16476
|
return;
|
|
16443
16477
|
}
|
|
16444
16478
|
(_this_previewContent = this.previewContent) == null ? void 0 : _this_previewContent.updateMesh();
|
|
16445
|
-
if (!this.hasBeenAddedToComposition && this.item.composition) {
|
|
16446
|
-
var type = this.interactData.options.type;
|
|
16447
|
-
if (type === InteractType.CLICK) {
|
|
16448
|
-
this.clickable = true;
|
|
16449
|
-
}
|
|
16450
|
-
var options = this.item.props.content.options;
|
|
16451
|
-
this.item.composition.addInteractiveItem(this.item, options.type);
|
|
16452
|
-
this.hasBeenAddedToComposition = true;
|
|
16453
|
-
}
|
|
16454
16479
|
if (!this.dragEvent || !this.bouncingArg) {
|
|
16455
16480
|
return;
|
|
16456
16481
|
}
|
|
@@ -16864,6 +16889,7 @@ var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
|
|
|
16864
16889
|
if (inputCount === void 0) inputCount = 0;
|
|
16865
16890
|
this.onPlayablePlayFlag = true;
|
|
16866
16891
|
this.onPlayablePauseFlag = false;
|
|
16892
|
+
this.duration = 0;
|
|
16867
16893
|
this.destroyed = false;
|
|
16868
16894
|
this.inputs = [];
|
|
16869
16895
|
this.inputOuputPorts = [];
|
|
@@ -16956,6 +16982,12 @@ var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
|
|
|
16956
16982
|
_proto.getTime = function getTime() {
|
|
16957
16983
|
return this.time;
|
|
16958
16984
|
};
|
|
16985
|
+
_proto.setDuration = function setDuration(duration) {
|
|
16986
|
+
this.duration = duration;
|
|
16987
|
+
};
|
|
16988
|
+
_proto.getDuration = function getDuration() {
|
|
16989
|
+
return this.duration;
|
|
16990
|
+
};
|
|
16959
16991
|
_proto.getPlayState = function getPlayState() {
|
|
16960
16992
|
return this.playState;
|
|
16961
16993
|
};
|
|
@@ -17672,17 +17704,15 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
17672
17704
|
/**
|
|
17673
17705
|
* 元素动画结束时行为(如何处理元素)
|
|
17674
17706
|
*/ _this.endBehavior = EndBehavior.forward;
|
|
17675
|
-
/**
|
|
17676
|
-
* 元素是否可用
|
|
17677
|
-
*/ _this.ended = false;
|
|
17678
|
-
_this.reusable = false;
|
|
17679
17707
|
_this.type = ItemType.base;
|
|
17680
17708
|
_this.isDuringPlay = false;
|
|
17681
17709
|
_this.components = [];
|
|
17682
17710
|
_this.rendererComponents = [];
|
|
17683
17711
|
/**
|
|
17684
|
-
*
|
|
17685
|
-
|
|
17712
|
+
* 元素是否激活
|
|
17713
|
+
*/ _this.active = true;
|
|
17714
|
+
/**
|
|
17715
|
+
* 元素组件是否显示,用于批量开关元素组件
|
|
17686
17716
|
*/ _this.visible = true;
|
|
17687
17717
|
/**
|
|
17688
17718
|
* 元素动画的速度
|
|
@@ -17813,12 +17843,6 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
17813
17843
|
}
|
|
17814
17844
|
};
|
|
17815
17845
|
/**
|
|
17816
|
-
* 元素动画结束播放时回调函数
|
|
17817
|
-
* @override
|
|
17818
|
-
*/ _proto.onEnd = function onEnd() {
|
|
17819
|
-
// OVERRIDE
|
|
17820
|
-
};
|
|
17821
|
-
/**
|
|
17822
17846
|
* 通过指定 r、g、b、a 值设置元素的颜色
|
|
17823
17847
|
* @param {number} r
|
|
17824
17848
|
* @param {number} g
|
|
@@ -17831,17 +17855,27 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
17831
17855
|
* @param opacity - 透明度值,范围 [0,1]
|
|
17832
17856
|
*/ _proto.setOpacity = function setOpacity(opacity) {};
|
|
17833
17857
|
/**
|
|
17834
|
-
*
|
|
17835
|
-
*/ _proto.
|
|
17836
|
-
|
|
17858
|
+
* 激活或停用 VFXItem
|
|
17859
|
+
*/ _proto.setActive = function setActive(value) {
|
|
17860
|
+
if (this.active !== value) {
|
|
17861
|
+
this.active = !!value;
|
|
17862
|
+
this.onActiveChanged();
|
|
17863
|
+
}
|
|
17837
17864
|
};
|
|
17838
17865
|
/**
|
|
17839
|
-
*
|
|
17866
|
+
* 设置元素的显隐,该设置会批量开关元素组件
|
|
17840
17867
|
*/ _proto.setVisible = function setVisible(visible) {
|
|
17841
|
-
|
|
17842
|
-
|
|
17843
|
-
|
|
17868
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(this.components), _step; !(_step = _iterator()).done;){
|
|
17869
|
+
var component = _step.value;
|
|
17870
|
+
component.enabled = visible;
|
|
17844
17871
|
}
|
|
17872
|
+
this.visible = visible;
|
|
17873
|
+
};
|
|
17874
|
+
/**
|
|
17875
|
+
* 元素组件显隐状态
|
|
17876
|
+
* @deprecated use isVisible instead
|
|
17877
|
+
*/ _proto.getVisible = function getVisible() {
|
|
17878
|
+
return this.visible;
|
|
17845
17879
|
};
|
|
17846
17880
|
/**
|
|
17847
17881
|
* 获取元素变换包括位置、旋转、缩放
|
|
@@ -17923,14 +17957,6 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
17923
17957
|
this.transform.assignWorldTRS(pos);
|
|
17924
17958
|
return pos;
|
|
17925
17959
|
};
|
|
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
17960
|
_proto.find = function find(name) {
|
|
17935
17961
|
var _queue;
|
|
17936
17962
|
if (this.name === name) {
|
|
@@ -17954,7 +17980,7 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
17954
17980
|
* @internal
|
|
17955
17981
|
*/ _proto.beginPlay = function beginPlay() {
|
|
17956
17982
|
this.isDuringPlay = true;
|
|
17957
|
-
if (this.composition && this.
|
|
17983
|
+
if (this.composition && this.active && !this.isEnabled) {
|
|
17958
17984
|
this.onEnable();
|
|
17959
17985
|
}
|
|
17960
17986
|
for(var _iterator = _create_for_of_iterator_helper_loose(this.children), _step; !(_step = _iterator()).done;){
|
|
@@ -18230,6 +18256,22 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
18230
18256
|
}
|
|
18231
18257
|
}
|
|
18232
18258
|
}
|
|
18259
|
+
},
|
|
18260
|
+
{
|
|
18261
|
+
key: "isActive",
|
|
18262
|
+
get: /**
|
|
18263
|
+
* 当前 VFXItem 是否激活
|
|
18264
|
+
*/ function get() {
|
|
18265
|
+
return this.active;
|
|
18266
|
+
}
|
|
18267
|
+
},
|
|
18268
|
+
{
|
|
18269
|
+
key: "isVisible",
|
|
18270
|
+
get: /**
|
|
18271
|
+
* 元素组件显隐状态
|
|
18272
|
+
*/ function get() {
|
|
18273
|
+
return this.visible;
|
|
18274
|
+
}
|
|
18233
18275
|
}
|
|
18234
18276
|
]);
|
|
18235
18277
|
return VFXItem;
|
|
@@ -18900,7 +18942,7 @@ var ShapeNone = /*#__PURE__*/ function() {
|
|
|
18900
18942
|
return ShapeNone;
|
|
18901
18943
|
}();
|
|
18902
18944
|
var _obj$3;
|
|
18903
|
-
var map = (_obj$3 = {}, _obj$3[ShapeType
|
|
18945
|
+
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
18946
|
function createShape(shapeOptions) {
|
|
18905
18947
|
if (!shapeOptions) {
|
|
18906
18948
|
return new ShapeNone();
|
|
@@ -18917,7 +18959,7 @@ function createShape(shapeOptions) {
|
|
|
18917
18959
|
throw new Error("Invalid shape: " + type + ".");
|
|
18918
18960
|
}
|
|
18919
18961
|
var ctrl = new Ctrl(options);
|
|
18920
|
-
if (type !== ShapeType
|
|
18962
|
+
if (type !== ShapeType.NONE) {
|
|
18921
18963
|
var alignSpeedDirection = shapeOptions.alignSpeedDirection, _shapeOptions_upDirection = shapeOptions.upDirection, upDirection = _shapeOptions_upDirection === void 0 ? [
|
|
18922
18964
|
0,
|
|
18923
18965
|
0,
|
|
@@ -22994,6 +23036,7 @@ var TrackAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
|
22994
23036
|
for(var _iterator = _create_for_of_iterator_helper_loose(timelineClips), _step; !(_step = _iterator()).done;){
|
|
22995
23037
|
var timelineClip = _step.value;
|
|
22996
23038
|
var clipPlayable = this.createClipPlayable(graph, timelineClip);
|
|
23039
|
+
clipPlayable.setDuration(timelineClip.duration);
|
|
22997
23040
|
var clip = new RuntimeClip(timelineClip, clipPlayable, mixer, this);
|
|
22998
23041
|
runtimeClips.push(clip);
|
|
22999
23042
|
mixer.addInput(clipPlayable, 0);
|
|
@@ -23097,14 +23140,6 @@ var RuntimeClip = /*#__PURE__*/ function() {
|
|
|
23097
23140
|
this.playable.setTime(clipTime);
|
|
23098
23141
|
// 判断动画是否结束
|
|
23099
23142
|
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
23143
|
if (this.playable.getPlayState() === PlayState.Playing) {
|
|
23109
23144
|
this.playable.pause();
|
|
23110
23145
|
}
|
|
@@ -23147,26 +23182,10 @@ var ActivationMixerPlayable = /*#__PURE__*/ function(Playable) {
|
|
|
23147
23182
|
}
|
|
23148
23183
|
if (hasInput) {
|
|
23149
23184
|
boundItem.transform.setValid(true);
|
|
23150
|
-
|
|
23185
|
+
boundItem.setActive(true);
|
|
23151
23186
|
} else {
|
|
23152
23187
|
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
|
-
}
|
|
23188
|
+
boundItem.setActive(false);
|
|
23170
23189
|
}
|
|
23171
23190
|
};
|
|
23172
23191
|
return ActivationMixerPlayable;
|
|
@@ -23194,7 +23213,7 @@ var PropertyClipPlayable = /*#__PURE__*/ function(Playable) {
|
|
|
23194
23213
|
}
|
|
23195
23214
|
var _proto = PropertyClipPlayable.prototype;
|
|
23196
23215
|
_proto.processFrame = function processFrame(context) {
|
|
23197
|
-
this.value = this.curve.getValue(this.time);
|
|
23216
|
+
this.value = this.curve.getValue(this.time / this.getDuration());
|
|
23198
23217
|
};
|
|
23199
23218
|
return PropertyClipPlayable;
|
|
23200
23219
|
}(Playable);
|
|
@@ -23712,9 +23731,6 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
23712
23731
|
var track = _step.value;
|
|
23713
23732
|
var boundObject = track.boundObject;
|
|
23714
23733
|
if (_instanceof1(boundObject, VFXItem)) {
|
|
23715
|
-
if (_instanceof1(track, ObjectBindingTrack)) {
|
|
23716
|
-
boundObject.reusable = value;
|
|
23717
|
-
}
|
|
23718
23734
|
var subCompositionComponent = boundObject.getComponent(CompositionComponent);
|
|
23719
23735
|
if (subCompositionComponent) {
|
|
23720
23736
|
subCompositionComponent.setReusable(value);
|
|
@@ -23759,16 +23775,16 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
23759
23775
|
}
|
|
23760
23776
|
}
|
|
23761
23777
|
};
|
|
23762
|
-
_proto.
|
|
23778
|
+
_proto.onEnable = function onEnable() {
|
|
23763
23779
|
for(var _iterator = _create_for_of_iterator_helper_loose(this.items), _step; !(_step = _iterator()).done;){
|
|
23764
23780
|
var item = _step.value;
|
|
23765
|
-
item.
|
|
23781
|
+
item.setActive(true);
|
|
23766
23782
|
}
|
|
23767
23783
|
};
|
|
23768
|
-
_proto.
|
|
23784
|
+
_proto.onDisable = function onDisable() {
|
|
23769
23785
|
for(var _iterator = _create_for_of_iterator_helper_loose(this.items), _step; !(_step = _iterator()).done;){
|
|
23770
23786
|
var item = _step.value;
|
|
23771
|
-
item.
|
|
23787
|
+
item.setActive(false);
|
|
23772
23788
|
}
|
|
23773
23789
|
};
|
|
23774
23790
|
_proto.onDestroy = function onDestroy() {
|
|
@@ -23784,7 +23800,7 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
23784
23800
|
_proto.hitTest = function hitTest(ray, x, y, regions, force, options) {
|
|
23785
23801
|
var _this, _loop = function(i) {
|
|
23786
23802
|
var item = _this.items[i];
|
|
23787
|
-
if (item.
|
|
23803
|
+
if (item.isActive && item.transform.getValid() && !VFXItem.isComposition(item) && !skip(item)) {
|
|
23788
23804
|
var hitParams = item.getHitTestParams(force);
|
|
23789
23805
|
if (hitParams) {
|
|
23790
23806
|
var success = false;
|
|
@@ -23926,9 +23942,9 @@ var SubCompositionMixerPlayable = /*#__PURE__*/ function(Playable) {
|
|
|
23926
23942
|
}
|
|
23927
23943
|
}
|
|
23928
23944
|
if (hasInput) {
|
|
23929
|
-
compositionComponent.
|
|
23945
|
+
compositionComponent.item.setActive(true);
|
|
23930
23946
|
} else {
|
|
23931
|
-
compositionComponent.
|
|
23947
|
+
compositionComponent.item.setActive(false);
|
|
23932
23948
|
}
|
|
23933
23949
|
};
|
|
23934
23950
|
return SubCompositionMixerPlayable;
|
|
@@ -26286,13 +26302,13 @@ function getStandardParticleContent(particle) {
|
|
|
26286
26302
|
var options = particle.options;
|
|
26287
26303
|
var transform = particle.transform;
|
|
26288
26304
|
var shape = {
|
|
26289
|
-
type: ShapeType
|
|
26305
|
+
type: ShapeType.NONE
|
|
26290
26306
|
};
|
|
26291
26307
|
if (particle.shape) {
|
|
26292
26308
|
var _particle_shape_shape;
|
|
26293
26309
|
var shapeType = (_particle_shape_shape = particle.shape.shape) == null ? void 0 : _particle_shape_shape.replace(/([A-Z])/g, "_$1").toUpperCase().replace(/^_/, "");
|
|
26294
26310
|
shape = _extends({}, particle.shape, {
|
|
26295
|
-
type: ShapeType
|
|
26311
|
+
type: ShapeType[shapeType]
|
|
26296
26312
|
});
|
|
26297
26313
|
if (particle.shape.upDirection) {
|
|
26298
26314
|
var _particle_shape_upDirection = particle.shape.upDirection, x = _particle_shape_upDirection[0], y = _particle_shape_upDirection[1], z = _particle_shape_upDirection[2];
|
|
@@ -28383,6 +28399,9 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28383
28399
|
* 动画播放速度
|
|
28384
28400
|
*/ _this.speed = 1;
|
|
28385
28401
|
/**
|
|
28402
|
+
* 合成是否结束
|
|
28403
|
+
*/ _this.isEnded = false;
|
|
28404
|
+
/**
|
|
28386
28405
|
* 用于保存与当前合成相关的插件数据
|
|
28387
28406
|
*/ _this.loaderData = {};
|
|
28388
28407
|
/**
|
|
@@ -28404,6 +28423,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28404
28423
|
* 合成暂停/播放 标识
|
|
28405
28424
|
*/ _this.paused = false;
|
|
28406
28425
|
_this.lastVideoUpdateTime = 0;
|
|
28426
|
+
_this.isEndCalled = false;
|
|
28407
28427
|
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
28428
|
_this.compositionSourceManager = new CompositionSourceManager(scene, renderer.engine);
|
|
28409
28429
|
if (reusable) {
|
|
@@ -28493,7 +28513,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28493
28513
|
* @param visible - 是否可见
|
|
28494
28514
|
*/ _proto.setVisible = function setVisible(visible) {
|
|
28495
28515
|
this.items.forEach(function(item) {
|
|
28496
|
-
item.
|
|
28516
|
+
item.setActive(visible);
|
|
28497
28517
|
});
|
|
28498
28518
|
};
|
|
28499
28519
|
/**
|
|
@@ -28503,7 +28523,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28503
28523
|
return this.speed;
|
|
28504
28524
|
};
|
|
28505
28525
|
_proto.play = function play() {
|
|
28506
|
-
if (this.
|
|
28526
|
+
if (this.isEnded && this.reusable) {
|
|
28507
28527
|
this.restart();
|
|
28508
28528
|
}
|
|
28509
28529
|
if (this.rootComposition.isStartCalled) {
|
|
@@ -28594,7 +28614,8 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28594
28614
|
* 重置状态函数
|
|
28595
28615
|
*/ _proto.reset = function reset() {
|
|
28596
28616
|
this.rendererOptions = null;
|
|
28597
|
-
this.
|
|
28617
|
+
this.isEnded = false;
|
|
28618
|
+
this.isEndCalled = false;
|
|
28598
28619
|
this.rootComposition.time = 0;
|
|
28599
28620
|
this.pluginSystem.resetComposition(this, this.renderFrame);
|
|
28600
28621
|
};
|
|
@@ -28646,12 +28667,18 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28646
28667
|
this.sceneTicking.lateUpdate.tick(dt);
|
|
28647
28668
|
this.updateCamera();
|
|
28648
28669
|
this.prepareRender();
|
|
28670
|
+
if (this.isEnded && !this.isEndCalled) {
|
|
28671
|
+
this.isEndCalled = true;
|
|
28672
|
+
this.emit("end", {
|
|
28673
|
+
composition: this
|
|
28674
|
+
});
|
|
28675
|
+
}
|
|
28649
28676
|
if (this.shouldDispose()) {
|
|
28650
28677
|
this.dispose();
|
|
28651
28678
|
}
|
|
28652
28679
|
};
|
|
28653
28680
|
_proto.shouldDispose = function shouldDispose() {
|
|
28654
|
-
return this.
|
|
28681
|
+
return this.isEnded && this.rootItem.endBehavior === EndBehavior.destroy && !this.reusable;
|
|
28655
28682
|
};
|
|
28656
28683
|
_proto.getUpdateTime = function getUpdateTime(t) {
|
|
28657
28684
|
var startTimeInMs = this.startTime * 1000;
|
|
@@ -28742,11 +28769,11 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28742
28769
|
*/ _proto.updateRootComposition = function updateRootComposition(deltaTime) {
|
|
28743
28770
|
if (this.rootComposition.isActiveAndEnabled) {
|
|
28744
28771
|
var localTime = this.time + deltaTime - this.rootItem.start;
|
|
28745
|
-
var
|
|
28772
|
+
var isEnded = false;
|
|
28746
28773
|
var duration = this.rootItem.duration;
|
|
28747
28774
|
var endBehavior = this.rootItem.endBehavior;
|
|
28748
28775
|
if (localTime - duration > 0.001) {
|
|
28749
|
-
|
|
28776
|
+
isEnded = true;
|
|
28750
28777
|
switch(endBehavior){
|
|
28751
28778
|
case EndBehavior.restart:
|
|
28752
28779
|
{
|
|
@@ -28770,11 +28797,14 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28770
28797
|
}
|
|
28771
28798
|
}
|
|
28772
28799
|
this.rootComposition.time = localTime;
|
|
28773
|
-
|
|
28774
|
-
|
|
28775
|
-
|
|
28776
|
-
|
|
28777
|
-
}
|
|
28800
|
+
// end state changed, handle onEnd flags
|
|
28801
|
+
if (this.isEnded !== isEnded) {
|
|
28802
|
+
if (isEnded) {
|
|
28803
|
+
this.isEnded = true;
|
|
28804
|
+
} else {
|
|
28805
|
+
this.isEnded = false;
|
|
28806
|
+
this.isEndCalled = false;
|
|
28807
|
+
}
|
|
28778
28808
|
}
|
|
28779
28809
|
}
|
|
28780
28810
|
};
|
|
@@ -31100,7 +31130,7 @@ registerPlugin("sprite", SpriteLoader, VFXItem, true);
|
|
|
31100
31130
|
registerPlugin("particle", ParticleLoader, VFXItem, true);
|
|
31101
31131
|
registerPlugin("cal", CalculateLoader, VFXItem, true);
|
|
31102
31132
|
registerPlugin("interact", InteractLoader, VFXItem, true);
|
|
31103
|
-
var version$1 = "2.1.0-alpha.
|
|
31133
|
+
var version$1 = "2.1.0-alpha.11";
|
|
31104
31134
|
logger.info("Core version: " + version$1 + ".");
|
|
31105
31135
|
|
|
31106
31136
|
var _obj;
|
|
@@ -32744,8 +32774,8 @@ setMaxSpriteMeshItemCount(8);
|
|
|
32744
32774
|
*/ Mesh.create = function(engine, props) {
|
|
32745
32775
|
return new ThreeMesh(engine, props);
|
|
32746
32776
|
};
|
|
32747
|
-
var version = "2.1.0-alpha.
|
|
32777
|
+
var version = "2.1.0-alpha.11";
|
|
32748
32778
|
logger.info("THREEJS plugin version: " + version + ".");
|
|
32749
32779
|
|
|
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,
|
|
32780
|
+
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
32781
|
//# sourceMappingURL=index.mjs.map
|