@galacean/effects-core 2.7.0-alpha.1 → 2.7.0-beta.0
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/camera.d.ts +30 -0
- package/dist/components/shape-component.d.ts +16 -43
- package/dist/composition.d.ts +2 -5
- package/dist/effects-object.d.ts +1 -1
- package/dist/engine.d.ts +1 -1
- package/dist/index.js +451 -273
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +452 -274
- package/dist/index.mjs.map +1 -1
- package/dist/material/material.d.ts +0 -4
- package/dist/plugin-system.d.ts +3 -2
- package/dist/plugins/animation-graph/pose.d.ts +1 -1
- package/dist/plugins/animation-graph/skeleton.d.ts +1 -1
- package/dist/plugins/interact/interact-item.d.ts +25 -0
- package/dist/plugins/interact/interact-mesh.d.ts +1 -2
- package/dist/plugins/sprite/sprite-item.d.ts +1 -1
- package/dist/plugins/text/text-item.d.ts +2 -0
- package/dist/plugins/text/text-layout.d.ts +12 -0
- package/dist/render/index.d.ts +0 -1
- package/dist/render/render-frame.d.ts +0 -8
- package/dist/texture/texture.d.ts +0 -4
- package/dist/vfx-item.d.ts +7 -20
- package/package.json +2 -2
- package/dist/render/types.d.ts +0 -5
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Description: Galacean Effects runtime core for the web
|
|
4
4
|
* Author: Ant Group CO., Ltd.
|
|
5
5
|
* Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
|
|
6
|
-
* Version: v2.7.0-
|
|
6
|
+
* Version: v2.7.0-beta.0
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -3658,15 +3658,30 @@ var MaterialBlending;
|
|
|
3658
3658
|
var TextOverflow;
|
|
3659
3659
|
(function(TextOverflow) {
|
|
3660
3660
|
/**
|
|
3661
|
-
*
|
|
3662
|
-
*/ TextOverflow[TextOverflow["
|
|
3661
|
+
* visible 模式下,文本内容超出边界框时,会继续显示内容,不进行裁剪或缩放。
|
|
3662
|
+
*/ TextOverflow[TextOverflow["visible"] = 0] = "visible";
|
|
3663
|
+
/**
|
|
3664
|
+
* display 模式下,会显示所有文本,文本字号大小会根据边界框调整。
|
|
3665
|
+
*/ TextOverflow[TextOverflow["display"] = 1] = "display";
|
|
3663
3666
|
/**
|
|
3664
3667
|
* clip 模式下,当文本内容超出边界框时,多余的会被截断。
|
|
3665
|
-
*/ TextOverflow[TextOverflow["clip"] =
|
|
3668
|
+
*/ TextOverflow[TextOverflow["clip"] = 2] = "clip";
|
|
3666
3669
|
/**
|
|
3667
3670
|
* ellipsis 模式下,会使用(...)来代替超出边界框的内容。
|
|
3668
|
-
*/ TextOverflow[TextOverflow["ellipsis"] =
|
|
3671
|
+
*/ TextOverflow[TextOverflow["ellipsis"] = 3] = "ellipsis";
|
|
3669
3672
|
})(TextOverflow || (TextOverflow = {}));
|
|
3673
|
+
var TextSizeMode;
|
|
3674
|
+
(function(TextSizeMode) {
|
|
3675
|
+
/**
|
|
3676
|
+
* 自适应宽度
|
|
3677
|
+
*/ TextSizeMode[TextSizeMode["autoWidth"] = 0] = "autoWidth";
|
|
3678
|
+
/**
|
|
3679
|
+
* 自适应高度
|
|
3680
|
+
*/ TextSizeMode[TextSizeMode["autoHeight"] = 1] = "autoHeight";
|
|
3681
|
+
/**
|
|
3682
|
+
* 固定宽高
|
|
3683
|
+
*/ TextSizeMode[TextSizeMode["fixed"] = 2] = "fixed";
|
|
3684
|
+
})(TextSizeMode || (TextSizeMode = {}));
|
|
3670
3685
|
var TextBaseline;
|
|
3671
3686
|
(function(TextBaseline) {
|
|
3672
3687
|
/**
|
|
@@ -3730,20 +3745,21 @@ var BuiltinObjectGUID = {
|
|
|
3730
3745
|
UnlitShader: "unlit000000000000000000000000000"
|
|
3731
3746
|
};
|
|
3732
3747
|
|
|
3733
|
-
|
|
3734
|
-
* 填充类型
|
|
3735
|
-
*/ var FillType$1;
|
|
3748
|
+
var FillType;
|
|
3736
3749
|
(function(FillType) {
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3750
|
+
FillType[FillType["Solid"] = 0] = "Solid";
|
|
3751
|
+
FillType[FillType["GradientLinear"] = 1] = "GradientLinear";
|
|
3752
|
+
FillType[FillType["GradientRadial"] = 2] = "GradientRadial";
|
|
3753
|
+
FillType[FillType["GradientAngular"] = 3] = "GradientAngular";
|
|
3754
|
+
FillType[FillType["Texture"] = 4] = "Texture";
|
|
3755
|
+
})(FillType || (FillType = {}));
|
|
3756
|
+
var TexturePaintScaleMode$1;
|
|
3757
|
+
(function(TexturePaintScaleMode) {
|
|
3758
|
+
TexturePaintScaleMode[TexturePaintScaleMode["Fill"] = 0] = "Fill";
|
|
3759
|
+
TexturePaintScaleMode[TexturePaintScaleMode["Fit"] = 1] = "Fit";
|
|
3760
|
+
TexturePaintScaleMode[TexturePaintScaleMode["Crop"] = 2] = "Crop";
|
|
3761
|
+
TexturePaintScaleMode[TexturePaintScaleMode["Tile"] = 3] = "Tile";
|
|
3762
|
+
})(TexturePaintScaleMode$1 || (TexturePaintScaleMode$1 = {}));
|
|
3747
3763
|
|
|
3748
3764
|
/**
|
|
3749
3765
|
* 矢量图形类型
|
|
@@ -4007,12 +4023,14 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
4007
4023
|
get MaterialBlending () { return MaterialBlending; },
|
|
4008
4024
|
get RenderMode3D () { return RenderMode3D; },
|
|
4009
4025
|
get TextOverflow () { return TextOverflow; },
|
|
4026
|
+
get TextSizeMode () { return TextSizeMode; },
|
|
4010
4027
|
get TextBaseline () { return TextBaseline; },
|
|
4011
4028
|
get TextAlignment () { return TextAlignment; },
|
|
4012
4029
|
get TextWeight () { return TextWeight; },
|
|
4013
4030
|
get FontStyle () { return FontStyle; },
|
|
4014
4031
|
BuiltinObjectGUID: BuiltinObjectGUID,
|
|
4015
|
-
get FillType () { return FillType
|
|
4032
|
+
get FillType () { return FillType; },
|
|
4033
|
+
get TexturePaintScaleMode () { return TexturePaintScaleMode$1; },
|
|
4016
4034
|
get ShapePrimitiveType () { return ShapePrimitiveType; },
|
|
4017
4035
|
get LineCap () { return LineCap; },
|
|
4018
4036
|
get LineJoin () { return LineJoin; },
|
|
@@ -4120,10 +4138,16 @@ function getDirectStore(target) {
|
|
|
4120
4138
|
* 反序列化函数
|
|
4121
4139
|
*
|
|
4122
4140
|
* @param data - 对象的序列化的数据
|
|
4123
|
-
*/ _proto.fromData = function fromData(data) {
|
|
4141
|
+
*/ _proto.fromData = function fromData(data) {
|
|
4142
|
+
if (data.id !== undefined) {
|
|
4143
|
+
this.setInstanceId(data.id);
|
|
4144
|
+
}
|
|
4145
|
+
};
|
|
4124
4146
|
/**
|
|
4125
|
-
*
|
|
4126
|
-
*/ _proto.dispose = function dispose() {
|
|
4147
|
+
* 销毁当前对象
|
|
4148
|
+
*/ _proto.dispose = function dispose() {
|
|
4149
|
+
this.engine.removeInstance(this.guid);
|
|
4150
|
+
};
|
|
4127
4151
|
/**
|
|
4128
4152
|
*
|
|
4129
4153
|
* @param obj
|
|
@@ -5217,7 +5241,7 @@ var Pose = /*#__PURE__*/ function() {
|
|
|
5217
5241
|
}
|
|
5218
5242
|
for(var _iterator2 = _create_for_of_iterator_helper_loose(skeleton.defaultColorPropertyValues), _step2; !(_step2 = _iterator2()).done;){
|
|
5219
5243
|
var defaultColor = _step2.value;
|
|
5220
|
-
this.colorPropertyValues.push(defaultColor);
|
|
5244
|
+
this.colorPropertyValues.push(new Color().copyFrom(defaultColor));
|
|
5221
5245
|
}
|
|
5222
5246
|
}
|
|
5223
5247
|
var _proto = Pose.prototype;
|
|
@@ -6692,7 +6716,7 @@ var Skeleton = /*#__PURE__*/ function() {
|
|
|
6692
6716
|
break;
|
|
6693
6717
|
case 1:
|
|
6694
6718
|
this.colorAnimatedObjects.push(animatedObject);
|
|
6695
|
-
this.defaultColorPropertyValues.push(directTarget[lastPropertyName]);
|
|
6719
|
+
this.defaultColorPropertyValues.push(new Color().copyFrom(directTarget[lastPropertyName]));
|
|
6696
6720
|
this.pathToObjectIndex.set(totalPath, this.colorAnimatedObjects.length - 1);
|
|
6697
6721
|
}
|
|
6698
6722
|
};
|
|
@@ -6989,6 +7013,7 @@ function _create_class(Constructor, protoProps, staticProps) {
|
|
|
6989
7013
|
if (this.item) {
|
|
6990
7014
|
removeItem(this.item.components, this);
|
|
6991
7015
|
}
|
|
7016
|
+
EffectsObject.prototype.dispose.call(this);
|
|
6992
7017
|
};
|
|
6993
7018
|
_proto.start = function start() {
|
|
6994
7019
|
if (this.isStartCalled) {
|
|
@@ -12179,9 +12204,8 @@ var seed$7 = 1;
|
|
|
12179
12204
|
this.destroyed = true;
|
|
12180
12205
|
if (this.engine !== undefined) {
|
|
12181
12206
|
this.engine.removeMesh(this);
|
|
12182
|
-
// @ts-expect-error
|
|
12183
|
-
this.engine = undefined;
|
|
12184
12207
|
}
|
|
12208
|
+
RendererComponent.prototype.dispose.call(this);
|
|
12185
12209
|
};
|
|
12186
12210
|
_create_class(Mesh, [
|
|
12187
12211
|
{
|
|
@@ -13337,8 +13361,6 @@ var seed$5 = 1;
|
|
|
13337
13361
|
this.clearAction = clearAction;
|
|
13338
13362
|
this.name = "RenderFrame" + seed$5++;
|
|
13339
13363
|
var firstRP = renderPasses[0];
|
|
13340
|
-
this.emptyTexture = generateWhiteTexture(engine);
|
|
13341
|
-
this.transparentTexture = generateTransparentTexture(engine);
|
|
13342
13364
|
this.camera = camera;
|
|
13343
13365
|
this.keepColorBuffer = keepColorBuffer;
|
|
13344
13366
|
this.renderPassInfoMap.set(firstRP, {
|
|
@@ -13387,8 +13409,6 @@ var seed$5 = 1;
|
|
|
13387
13409
|
}
|
|
13388
13410
|
this.passTextureCache.dispose();
|
|
13389
13411
|
this._renderPasses.length = 0;
|
|
13390
|
-
this.emptyTexture.dispose();
|
|
13391
|
-
this.transparentTexture.dispose();
|
|
13392
13412
|
if (this.resource) {
|
|
13393
13413
|
var _this_resource_depthStencil_texture, _this_resource_depthStencil;
|
|
13394
13414
|
this.resource.color_a.dispose();
|
|
@@ -14048,7 +14068,7 @@ var Renderer = /*#__PURE__*/ function() {
|
|
|
14048
14068
|
_this.renderer = {
|
|
14049
14069
|
renderMode: RenderMode.MESH,
|
|
14050
14070
|
blending: BlendingMode.ALPHA,
|
|
14051
|
-
texture: _this.engine.
|
|
14071
|
+
texture: _this.engine.whiteTexture,
|
|
14052
14072
|
occlusion: false,
|
|
14053
14073
|
transparentOcclusion: false,
|
|
14054
14074
|
side: SideMode.DOUBLE,
|
|
@@ -14256,7 +14276,7 @@ var Renderer = /*#__PURE__*/ function() {
|
|
|
14256
14276
|
this.renderer = {
|
|
14257
14277
|
renderMode: (_renderer_renderMode = renderer.renderMode) != null ? _renderer_renderMode : RenderMode.MESH,
|
|
14258
14278
|
blending: (_renderer_blending = renderer.blending) != null ? _renderer_blending : BlendingMode.ALPHA,
|
|
14259
|
-
texture: renderer.texture ? this.engine.findObject(renderer.texture) : this.engine.
|
|
14279
|
+
texture: renderer.texture ? this.engine.findObject(renderer.texture) : this.engine.whiteTexture,
|
|
14260
14280
|
occlusion: !!renderer.occlusion,
|
|
14261
14281
|
transparentOcclusion: !!renderer.transparentOcclusion || this.maskManager.maskMode === MaskMode.MASK,
|
|
14262
14282
|
side: (_renderer_side = renderer.side) != null ? _renderer_side : SideMode.DOUBLE,
|
|
@@ -16100,20 +16120,26 @@ function oldBezierKeyFramesToNew(props) {
|
|
|
16100
16120
|
keyDatas.push(keyData);
|
|
16101
16121
|
lastControl = p2;
|
|
16102
16122
|
}
|
|
16103
|
-
var
|
|
16123
|
+
var calculateSlope = function(p0, p1) {
|
|
16104
16124
|
return (p1.y - p0.y) / (p1.x - p0.x + NumberEpsilon);
|
|
16105
16125
|
};
|
|
16106
16126
|
for(var i1 = 0; i1 < keyDatas.length; i1++){
|
|
16107
16127
|
var leftControl = keyDatas[i1].leftControl;
|
|
16108
16128
|
var value = keyDatas[i1].value;
|
|
16109
16129
|
var rightControl = keyDatas[i1].rightControl;
|
|
16110
|
-
var
|
|
16111
|
-
var
|
|
16130
|
+
var inSlope = 0;
|
|
16131
|
+
var outSlope = 0;
|
|
16132
|
+
if (i1 > 0) {
|
|
16133
|
+
inSlope = calculateSlope(leftControl, value);
|
|
16134
|
+
}
|
|
16135
|
+
if (i1 < keyDatas.length - 1) {
|
|
16136
|
+
outSlope = calculateSlope(value, rightControl);
|
|
16137
|
+
}
|
|
16112
16138
|
var keyframe = {
|
|
16113
16139
|
time: value.x,
|
|
16114
16140
|
value: value.y,
|
|
16115
|
-
inSlope:
|
|
16116
|
-
outSlope:
|
|
16141
|
+
inSlope: inSlope,
|
|
16142
|
+
outSlope: outSlope,
|
|
16117
16143
|
inWeight: 0,
|
|
16118
16144
|
outWeight: 0,
|
|
16119
16145
|
tangentMode: keyDatas[i1].tangentMode,
|
|
@@ -16236,16 +16262,8 @@ var ColorCurve = /*#__PURE__*/ function(ValueGetter) {
|
|
|
16236
16262
|
|
|
16237
16263
|
var vert = "precision highp float;attribute vec3 aPos;attribute vec2 aUV;varying vec2 uv0;uniform mat4 effects_MatrixVP;uniform mat4 effects_MatrixInvV;uniform mat4 effects_ObjectToWorld;void main(){vec4 pos=vec4(aPos.xyz,1.0);uv0=aUV;gl_Position=effects_MatrixVP*effects_ObjectToWorld*pos;}";
|
|
16238
16264
|
|
|
16239
|
-
var frag = "precision highp float;\n#define _MAX_STOPS 8\n#define PI 3.14159265359\nuniform vec4 _Color;uniform vec4 _Colors[_MAX_STOPS];uniform float _Stops[_MAX_STOPS];uniform int _StopsCount;uniform float _FillType;uniform vec2 _StartPoint;uniform vec2 _EndPoint;uniform sampler2D _ImageTex;uniform vec2 _ImageSize;uniform vec2 _DestSize;uniform int _ImageScaleMode;uniform mat3
|
|
16265
|
+
var frag = "precision highp float;\n#define _MAX_STOPS 8\n#define PI 3.14159265359\nuniform vec4 _Color;uniform vec4 _Colors[_MAX_STOPS];uniform float _Stops[_MAX_STOPS];uniform int _StopsCount;uniform float _FillType;uniform vec2 _StartPoint;uniform vec2 _EndPoint;uniform sampler2D _ImageTex;uniform vec2 _ImageSize;uniform vec2 _DestSize;uniform int _ImageScaleMode;uniform mat3 _TextureTransform;uniform float _ImageScalingFactor;uniform float _ImageOpacity;varying vec2 uv0;vec4 smoothMix(vec4 a,vec4 b,float t){return mix(a,b,smoothstep(0.0,1.0,t));}float calculateAngleRatio(vec2 v1,vec2 v2){float angle=atan(v2.y,v2.x)-atan(v1.y,v1.x);if(angle<0.0)angle+=2.0*PI;return angle/(2.0*PI);}vec2 applyTransform(mat3 m,vec2 uv){uv=uv-vec2(0.5,0.5);vec3 p=m*vec3(uv,1.0);p.xy=p.xy+vec2(0.5,0.5);return p.xy;}void main(){vec4 finalColor=vec4(1.0);if(_FillType==0.0){finalColor=_Color;}else if(_FillType==1.0||_FillType==2.0||_FillType==3.0){float t=0.0;if(_FillType==1.0){vec2 gradientVector=_EndPoint-_StartPoint;vec2 pixelVector=uv0-_StartPoint;float denom=max(dot(gradientVector,gradientVector),1e-6);t=clamp(dot(pixelVector,gradientVector)/denom,0.0,1.0);}else if(_FillType==2.0){float maxRadius=max(distance(_EndPoint,_StartPoint),0.001);t=clamp(distance(uv0,_StartPoint)/maxRadius,0.0,1.0);}else{vec2 center=_StartPoint;vec2 referenceVector=_EndPoint-center;vec2 targetVector=uv0-center;if(length(targetVector)>0.001){t=calculateAngleRatio(referenceVector,targetVector);}}finalColor=_Colors[0];for(int i=1;i<_MAX_STOPS;i++){if(i>=_StopsCount)break;float prevStop=_Stops[i-1];float currStop=_Stops[i];if(t>=prevStop&&t<=currStop){float localT=(t-prevStop)/max(currStop-prevStop,1e-6);finalColor=smoothMix(_Colors[i-1],_Colors[i],localT);break;}}}else if(_FillType==4.0){vec2 uv=uv0;float rSrc=_ImageSize.x/max(_ImageSize.y,1.0);float rDst=_DestSize.x/max(_DestSize.y,1.0);bool maskOutside=false;if(_ImageScaleMode==0){vec2 scale=vec2(1.0);if(rDst>rSrc){scale=vec2(1.0,rSrc/rDst);}else{scale=vec2(rDst/rSrc,1.0);}uv=(uv-0.5)*scale+0.5;uv=clamp(uv,0.0,1.0);}else if(_ImageScaleMode==1){vec2 scale=vec2(1.0);if(rDst>rSrc){scale=vec2(rSrc/rDst,1.0);}else{scale=vec2(1.0,rSrc/rDst);}uv=(uv-0.5)*scale+0.5;maskOutside=true;}else if(_ImageScaleMode==2){uv=applyTransform(_TextureTransform,uv0);maskOutside=true;}else if(_ImageScaleMode==3){float aspectFix=rDst/max(rSrc,1e-6);vec2 uvTile=(uv0-0.5)*vec2(aspectFix,1.0)+0.5;float s=max(abs(_ImageScalingFactor),1e-6);uv=fract(uvTile*s);}vec4 img=texture2D(_ImageTex,uv);if(maskOutside){if(uv.x<0.0||uv.x>1.0||uv.y<0.0||uv.y>1.0){img.a=0.0;}}img.a*=_ImageOpacity;finalColor=img;}finalColor.rgb*=finalColor.a;gl_FragColor=finalColor;}";
|
|
16240
16266
|
|
|
16241
|
-
var FillType;
|
|
16242
|
-
(function(FillType) {
|
|
16243
|
-
FillType[FillType["Solid"] = 0] = "Solid";
|
|
16244
|
-
FillType[FillType["GradientLinear"] = 1] = "GradientLinear";
|
|
16245
|
-
FillType[FillType["GradientRadial"] = 2] = "GradientRadial";
|
|
16246
|
-
FillType[FillType["GradientAngular"] = 3] = "GradientAngular";
|
|
16247
|
-
FillType[FillType["Texture"] = 4] = "Texture";
|
|
16248
|
-
})(FillType || (FillType = {}));
|
|
16249
16267
|
var TexturePaintScaleMode;
|
|
16250
16268
|
(function(TexturePaintScaleMode) {
|
|
16251
16269
|
TexturePaintScaleMode[TexturePaintScaleMode["Fill"] = 0] = "Fill";
|
|
@@ -16258,8 +16276,6 @@ var ShapeComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16258
16276
|
function ShapeComponent(engine) {
|
|
16259
16277
|
var _this;
|
|
16260
16278
|
_this = RendererComponent.call(this, engine) || this;
|
|
16261
|
-
_this.hasStroke = false;
|
|
16262
|
-
_this.hasFill = false;
|
|
16263
16279
|
_this.shapeDirty = true;
|
|
16264
16280
|
_this.materialDirty = true;
|
|
16265
16281
|
_this.graphicsPath = new GraphicsPath();
|
|
@@ -16271,10 +16287,15 @@ var ShapeComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16271
16287
|
join: LineJoin.Miter,
|
|
16272
16288
|
miterLimit: 10
|
|
16273
16289
|
};
|
|
16290
|
+
_this.strokeWidth = 1;
|
|
16291
|
+
_this.strokeCap = LineCap.Butt;
|
|
16292
|
+
_this.strokeJoin = LineJoin.Miter;
|
|
16274
16293
|
_this.strokes = [];
|
|
16275
16294
|
/**
|
|
16276
16295
|
* 用于点击测试的碰撞器
|
|
16277
16296
|
*/ _this.meshCollider = new MeshCollider();
|
|
16297
|
+
_this.fillMaterials = [];
|
|
16298
|
+
_this.strokeMaterials = [];
|
|
16278
16299
|
_this.getHitTestParams = function(force) {
|
|
16279
16300
|
var sizeMatrix = Matrix4.fromScale(_this.transform.size.x, _this.transform.size.y, 1);
|
|
16280
16301
|
var worldMatrix = sizeMatrix.premultiply(_this.transform.getWorldMatrix());
|
|
@@ -16286,15 +16307,15 @@ var ShapeComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16286
16307
|
behavior: 0,
|
|
16287
16308
|
type: area.type,
|
|
16288
16309
|
triangles: area.area,
|
|
16289
|
-
backfaceCulling: _this.
|
|
16310
|
+
backfaceCulling: _this.rendererOptions.side === SideMode.FRONT
|
|
16290
16311
|
};
|
|
16291
16312
|
}
|
|
16292
16313
|
}
|
|
16293
16314
|
};
|
|
16294
|
-
_this.
|
|
16315
|
+
_this.rendererOptions = {
|
|
16295
16316
|
renderMode: RenderMode.MESH,
|
|
16296
16317
|
blending: BlendingMode.ALPHA,
|
|
16297
|
-
texture: _this.engine.
|
|
16318
|
+
texture: _this.engine.whiteTexture,
|
|
16298
16319
|
occlusion: false,
|
|
16299
16320
|
transparentOcclusion: false,
|
|
16300
16321
|
side: SideMode.DOUBLE,
|
|
@@ -16304,12 +16325,12 @@ var ShapeComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16304
16325
|
// Create Shape Attrributes
|
|
16305
16326
|
//-------------------------------------------------------------------------
|
|
16306
16327
|
var gradientStrokeFill = {
|
|
16307
|
-
type:
|
|
16328
|
+
type: FillType.Solid,
|
|
16308
16329
|
color: new Color(1, 1, 1, 1)
|
|
16309
16330
|
};
|
|
16310
16331
|
_this.strokes.push(gradientStrokeFill);
|
|
16311
16332
|
var gradientLayerFill = {
|
|
16312
|
-
type:
|
|
16333
|
+
type: FillType.Solid,
|
|
16313
16334
|
color: new Color(1, 1, 1, 1)
|
|
16314
16335
|
};
|
|
16315
16336
|
_this.fills.push(gradientLayerFill);
|
|
@@ -16382,25 +16403,6 @@ var ShapeComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16382
16403
|
indexCount: 0,
|
|
16383
16404
|
vertexCount: 0
|
|
16384
16405
|
});
|
|
16385
|
-
// Create Material
|
|
16386
|
-
//-------------------------------------------------------------------------
|
|
16387
|
-
var materialProps = {
|
|
16388
|
-
shader: {
|
|
16389
|
-
vertex: vert,
|
|
16390
|
-
fragment: frag,
|
|
16391
|
-
glslVersion: GLSLVersion.GLSL1
|
|
16392
|
-
}
|
|
16393
|
-
};
|
|
16394
|
-
var fillMaterial = Material.create(engine, materialProps);
|
|
16395
|
-
var strokeMaterial = Material.create(engine, materialProps);
|
|
16396
|
-
fillMaterial.depthMask = false;
|
|
16397
|
-
fillMaterial.depthTest = true;
|
|
16398
|
-
fillMaterial.blending = true;
|
|
16399
|
-
_this.material = fillMaterial;
|
|
16400
|
-
strokeMaterial.depthMask = false;
|
|
16401
|
-
strokeMaterial.depthTest = true;
|
|
16402
|
-
strokeMaterial.blending = true;
|
|
16403
|
-
_this.materials[1] = strokeMaterial;
|
|
16404
16406
|
return _this;
|
|
16405
16407
|
}
|
|
16406
16408
|
var _proto = ShapeComponent.prototype;
|
|
@@ -16428,18 +16430,26 @@ var ShapeComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16428
16430
|
if (!this.isActiveAndEnabled) {
|
|
16429
16431
|
return;
|
|
16430
16432
|
}
|
|
16431
|
-
var
|
|
16432
|
-
var
|
|
16433
|
-
|
|
16434
|
-
|
|
16435
|
-
|
|
16436
|
-
|
|
16437
|
-
|
|
16433
|
+
var previousColorMask = false;
|
|
16434
|
+
for(var i = 0; i < this.fillMaterials.length; i++){
|
|
16435
|
+
previousColorMask = this.fillMaterials[i].colorMask;
|
|
16436
|
+
this.fillMaterials[i].colorMask = false;
|
|
16437
|
+
renderer.drawGeometry(this.geometry, this.transform.getWorldMatrix(), this.fillMaterials[i], 0);
|
|
16438
|
+
this.fillMaterials[i].colorMask = previousColorMask;
|
|
16439
|
+
}
|
|
16440
|
+
for(var i1 = 0; i1 < this.strokeMaterials.length; i1++){
|
|
16441
|
+
previousColorMask = this.strokeMaterials[i1].colorMask;
|
|
16442
|
+
this.strokeMaterials[i1].colorMask = false;
|
|
16443
|
+
renderer.drawGeometry(this.geometry, this.transform.getWorldMatrix(), this.strokeMaterials[i1], 1);
|
|
16444
|
+
this.strokeMaterials[i1].colorMask = previousColorMask;
|
|
16445
|
+
}
|
|
16438
16446
|
};
|
|
16439
16447
|
_proto.draw = function draw(renderer) {
|
|
16440
|
-
for(var i = 0; i < this.
|
|
16441
|
-
|
|
16442
|
-
|
|
16448
|
+
for(var i = 0; i < this.fillMaterials.length; i++){
|
|
16449
|
+
renderer.drawGeometry(this.geometry, this.transform.getWorldMatrix(), this.fillMaterials[i], 0);
|
|
16450
|
+
}
|
|
16451
|
+
for(var i1 = 0; i1 < this.strokeMaterials.length; i1++){
|
|
16452
|
+
renderer.drawGeometry(this.geometry, this.transform.getWorldMatrix(), this.strokeMaterials[i1], 1);
|
|
16443
16453
|
}
|
|
16444
16454
|
};
|
|
16445
16455
|
_proto.getBoundingBox = function getBoundingBox() {
|
|
@@ -16453,7 +16463,7 @@ var ShapeComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16453
16463
|
var vertices = [];
|
|
16454
16464
|
var indices = [];
|
|
16455
16465
|
// Triangulate shapePrimitives, build fill and stroke shape geometry
|
|
16456
|
-
if (this.
|
|
16466
|
+
if (this.fills.length > 0) {
|
|
16457
16467
|
for(var _iterator = _create_for_of_iterator_helper_loose(shapePrimitives), _step; !(_step = _iterator()).done;){
|
|
16458
16468
|
var shapePrimitive = _step.value;
|
|
16459
16469
|
var shape = shapePrimitive.shape;
|
|
@@ -16465,7 +16475,7 @@ var ShapeComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16465
16475
|
}
|
|
16466
16476
|
}
|
|
16467
16477
|
var fillIndexCount = indices.length;
|
|
16468
|
-
if (this.
|
|
16478
|
+
if (this.strokes.length > 0) {
|
|
16469
16479
|
for(var _iterator1 = _create_for_of_iterator_helper_loose(shapePrimitives), _step1; !(_step1 = _iterator1()).done;){
|
|
16470
16480
|
var shapePrimitive1 = _step1.value;
|
|
16471
16481
|
var shape1 = shapePrimitive1.shape;
|
|
@@ -16473,6 +16483,9 @@ var ShapeComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16473
16483
|
indices.length;
|
|
16474
16484
|
var vertOffset1 = vertices.length / 2;
|
|
16475
16485
|
var lineStyle = this.strokeAttributes;
|
|
16486
|
+
lineStyle.cap = this.strokeCap;
|
|
16487
|
+
lineStyle.join = this.strokeJoin;
|
|
16488
|
+
lineStyle.width = this.strokeWidth;
|
|
16476
16489
|
var close = true;
|
|
16477
16490
|
if (this.shapeAttributes.type === ShapePrimitiveType.Custom) {
|
|
16478
16491
|
close = shape1.closePath;
|
|
@@ -16600,48 +16613,20 @@ var ShapeComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16600
16613
|
}
|
|
16601
16614
|
};
|
|
16602
16615
|
_proto.updateMaterials = function updateMaterials() {
|
|
16603
|
-
for(var
|
|
16604
|
-
|
|
16605
|
-
|
|
16606
|
-
|
|
16607
|
-
|
|
16608
|
-
material.blending = true;
|
|
16609
|
-
material.depthTest = true;
|
|
16610
|
-
material.depthMask = occlusion;
|
|
16611
|
-
material.stencilRef = mask !== undefined ? [
|
|
16612
|
-
mask,
|
|
16613
|
-
mask
|
|
16614
|
-
] : undefined;
|
|
16615
|
-
setBlendMode(material, blendMode);
|
|
16616
|
-
// 兼容旧数据中模板需要渲染的情况
|
|
16617
|
-
setMaskMode(material, maskMode);
|
|
16618
|
-
setSideMode(material, side);
|
|
16619
|
-
material.shader.shaderData.properties = '_MainTex("_MainTex",2D) = "white" {}';
|
|
16620
|
-
material.setVector4("_TexOffset", new Vector4(0, 0, 1, 1));
|
|
16621
|
-
material.setTexture("_MainTex", texture);
|
|
16622
|
-
var preMultiAlpha = getPreMultiAlpha(blendMode);
|
|
16623
|
-
var texParams = new Vector4();
|
|
16624
|
-
texParams.x = renderer.occlusion ? +renderer.transparentOcclusion : 1;
|
|
16625
|
-
texParams.y = preMultiAlpha;
|
|
16626
|
-
texParams.z = renderer.renderMode;
|
|
16627
|
-
texParams.w = maskMode;
|
|
16628
|
-
material.setVector4("_TexParams", texParams);
|
|
16629
|
-
if (texParams.x === 0 || this.maskManager.alphaMaskEnabled) {
|
|
16630
|
-
material.enableMacro("ALPHA_CLIP");
|
|
16631
|
-
} else {
|
|
16632
|
-
material.disableMacro("ALPHA_CLIP");
|
|
16633
|
-
}
|
|
16616
|
+
for(var i = 0; i < this.fills.length; i++){
|
|
16617
|
+
this.updatePaintMaterial(this.fillMaterials[i], this.fills[i]);
|
|
16618
|
+
}
|
|
16619
|
+
for(var i1 = 0; i1 < this.strokes.length; i1++){
|
|
16620
|
+
this.updatePaintMaterial(this.strokeMaterials[i1], this.strokes[i1]);
|
|
16634
16621
|
}
|
|
16635
|
-
this.updatePaintMaterial(this.material, this.fills[0]);
|
|
16636
|
-
this.updatePaintMaterial(this.materials[1], this.strokes[0]);
|
|
16637
16622
|
};
|
|
16638
16623
|
_proto.updatePaintMaterial = function updatePaintMaterial(material, paint) {
|
|
16639
16624
|
material.setFloat("_FillType", paint.type);
|
|
16640
|
-
if (paint.type ===
|
|
16625
|
+
if (paint.type === FillType.Solid) {
|
|
16641
16626
|
material.color = paint.color;
|
|
16642
|
-
} else if (paint.type ===
|
|
16627
|
+
} else if (paint.type === FillType.GradientLinear || paint.type === FillType.GradientAngular || paint.type === FillType.GradientRadial) {
|
|
16643
16628
|
this.updateGradientMaterial(material, paint.gradientStops, paint.startPoint, paint.endPoint);
|
|
16644
|
-
} else if (paint.type ===
|
|
16629
|
+
} else if (paint.type === FillType.Texture) {
|
|
16645
16630
|
material.setInt("_ImageScaleMode", paint.scaleMode);
|
|
16646
16631
|
material.setVector2("_ImageSize", new Vector2(paint.texture.getWidth(), paint.texture.getHeight()));
|
|
16647
16632
|
var boundingBox = this.getBoundingBox();
|
|
@@ -16651,6 +16636,8 @@ var ShapeComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16651
16636
|
material.setFloat("_ImageOpacity", paint.opacity);
|
|
16652
16637
|
material.setFloat("_ImageScalingFactor", paint.scalingFactor);
|
|
16653
16638
|
material.setTexture("_ImageTex", paint.texture);
|
|
16639
|
+
var transform = paint.textureTransform;
|
|
16640
|
+
material.setMatrix3("_TextureTransform", new Matrix3().scale(transform.scale.x, transform.scale.y).rotate(transform.rotation).translate(transform.offset.x, transform.offset.y).invert());
|
|
16654
16641
|
}
|
|
16655
16642
|
};
|
|
16656
16643
|
_proto.updateGradientMaterial = function updateGradientMaterial(material, gradient, startPoint, endPoint) {
|
|
@@ -16668,6 +16655,46 @@ var ShapeComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16668
16655
|
material.setVector2("_StartPoint", startPoint);
|
|
16669
16656
|
material.setVector2("_EndPoint", endPoint);
|
|
16670
16657
|
};
|
|
16658
|
+
_proto.createMaterialFromRendererOptions = function createMaterialFromRendererOptions(rendererOptions) {
|
|
16659
|
+
var materialProps = {
|
|
16660
|
+
shader: {
|
|
16661
|
+
vertex: vert,
|
|
16662
|
+
fragment: frag,
|
|
16663
|
+
glslVersion: GLSLVersion.GLSL1
|
|
16664
|
+
}
|
|
16665
|
+
};
|
|
16666
|
+
var material = Material.create(this.engine, materialProps);
|
|
16667
|
+
var renderer = rendererOptions;
|
|
16668
|
+
var side = renderer.side, occlusion = renderer.occlusion, blendMode = renderer.blending, mask = renderer.mask, texture = renderer.texture;
|
|
16669
|
+
var maskMode = this.maskManager.maskMode;
|
|
16670
|
+
material.blending = true;
|
|
16671
|
+
material.depthTest = true;
|
|
16672
|
+
material.depthMask = occlusion;
|
|
16673
|
+
material.stencilRef = mask !== undefined ? [
|
|
16674
|
+
mask,
|
|
16675
|
+
mask
|
|
16676
|
+
] : undefined;
|
|
16677
|
+
setBlendMode(material, blendMode);
|
|
16678
|
+
// 兼容旧数据中模板需要渲染的情况
|
|
16679
|
+
setMaskMode(material, maskMode);
|
|
16680
|
+
setSideMode(material, side);
|
|
16681
|
+
material.shader.shaderData.properties = '_ImageTex("_ImageTex",2D) = "white" {}';
|
|
16682
|
+
material.setVector4("_TexOffset", new Vector4(0, 0, 1, 1));
|
|
16683
|
+
material.setTexture("_ImageTex", texture);
|
|
16684
|
+
var preMultiAlpha = getPreMultiAlpha(blendMode);
|
|
16685
|
+
var texParams = new Vector4();
|
|
16686
|
+
texParams.x = renderer.occlusion ? +renderer.transparentOcclusion : 1;
|
|
16687
|
+
texParams.y = preMultiAlpha;
|
|
16688
|
+
texParams.z = renderer.renderMode;
|
|
16689
|
+
texParams.w = maskMode;
|
|
16690
|
+
material.setVector4("_TexParams", texParams);
|
|
16691
|
+
if (texParams.x === 0 || this.maskManager.alphaMaskEnabled) {
|
|
16692
|
+
material.enableMacro("ALPHA_CLIP");
|
|
16693
|
+
} else {
|
|
16694
|
+
material.disableMacro("ALPHA_CLIP");
|
|
16695
|
+
}
|
|
16696
|
+
return material;
|
|
16697
|
+
};
|
|
16671
16698
|
_proto.fromData = function fromData(data) {
|
|
16672
16699
|
RendererComponent.prototype.fromData.call(this, data);
|
|
16673
16700
|
this.shapeDirty = true;
|
|
@@ -16676,44 +16703,37 @@ var ShapeComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16676
16703
|
}
|
|
16677
16704
|
var _data_renderer;
|
|
16678
16705
|
var renderer = (_data_renderer = data.renderer) != null ? _data_renderer : {};
|
|
16679
|
-
var
|
|
16680
|
-
this.
|
|
16681
|
-
renderMode:
|
|
16706
|
+
var _renderer_blending, _renderer_side;
|
|
16707
|
+
this.rendererOptions = {
|
|
16708
|
+
renderMode: RenderMode.MESH,
|
|
16682
16709
|
blending: (_renderer_blending = renderer.blending) != null ? _renderer_blending : BlendingMode.ALPHA,
|
|
16683
|
-
texture: renderer.texture ? this.engine.findObject(renderer.texture) : this.engine.
|
|
16710
|
+
texture: renderer.texture ? this.engine.findObject(renderer.texture) : this.engine.whiteTexture,
|
|
16684
16711
|
occlusion: !!renderer.occlusion,
|
|
16685
16712
|
transparentOcclusion: !!renderer.transparentOcclusion || this.maskManager.maskMode === MaskMode.MASK,
|
|
16686
16713
|
side: (_renderer_side = renderer.side) != null ? _renderer_side : SideMode.DOUBLE,
|
|
16687
16714
|
mask: this.maskManager.getRefValue()
|
|
16688
16715
|
};
|
|
16689
|
-
var
|
|
16690
|
-
|
|
16691
|
-
|
|
16692
|
-
|
|
16693
|
-
|
|
16694
|
-
|
|
16695
|
-
|
|
16696
|
-
|
|
16697
|
-
|
|
16698
|
-
|
|
16699
|
-
|
|
16700
|
-
|
|
16701
|
-
|
|
16702
|
-
|
|
16703
|
-
|
|
16704
|
-
|
|
16705
|
-
|
|
16706
|
-
|
|
16707
|
-
|
|
16708
|
-
|
|
16709
|
-
|
|
16710
|
-
var fill = _step1.value;
|
|
16711
|
-
var fillParam = fill;
|
|
16712
|
-
if (fillParam) {
|
|
16713
|
-
this.hasFill = true;
|
|
16714
|
-
this.fills[0] = this.createPaint(fillParam);
|
|
16715
|
-
}
|
|
16716
|
-
}
|
|
16716
|
+
var _data_strokeCap;
|
|
16717
|
+
this.strokeCap = (_data_strokeCap = data.strokeCap) != null ? _data_strokeCap : LineCap.Butt;
|
|
16718
|
+
var _data_strokeWidth;
|
|
16719
|
+
this.strokeWidth = (_data_strokeWidth = data.strokeWidth) != null ? _data_strokeWidth : 1;
|
|
16720
|
+
var _data_strokeJoin;
|
|
16721
|
+
this.strokeJoin = (_data_strokeJoin = data.strokeJoin) != null ? _data_strokeJoin : LineJoin.Miter;
|
|
16722
|
+
this.fills.length = 0;
|
|
16723
|
+
this.fillMaterials.length = 0;
|
|
16724
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(data.fills), _step; !(_step = _iterator()).done;){
|
|
16725
|
+
var fill = _step.value;
|
|
16726
|
+
this.fills.push(this.createPaint(fill));
|
|
16727
|
+
this.fillMaterials.push(this.createMaterialFromRendererOptions(this.rendererOptions));
|
|
16728
|
+
}
|
|
16729
|
+
this.strokes.length = 0;
|
|
16730
|
+
this.strokeMaterials.length = 0;
|
|
16731
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(data.strokes), _step1; !(_step1 = _iterator1()).done;){
|
|
16732
|
+
var stroke = _step1.value;
|
|
16733
|
+
this.strokes.push(this.createPaint(stroke));
|
|
16734
|
+
this.strokeMaterials.push(this.createMaterialFromRendererOptions(this.rendererOptions));
|
|
16735
|
+
}
|
|
16736
|
+
this.materials = [].concat(this.fillMaterials, this.strokeMaterials);
|
|
16717
16737
|
switch(data.type){
|
|
16718
16738
|
case ShapePrimitiveType.Custom:
|
|
16719
16739
|
{
|
|
@@ -16795,7 +16815,7 @@ var ShapeComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16795
16815
|
_proto.createPaint = function createPaint(paintData) {
|
|
16796
16816
|
var paint;
|
|
16797
16817
|
switch(paintData.type){
|
|
16798
|
-
case
|
|
16818
|
+
case FillType.Solid:
|
|
16799
16819
|
{
|
|
16800
16820
|
paint = {
|
|
16801
16821
|
type: paintData.type,
|
|
@@ -16803,9 +16823,9 @@ var ShapeComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16803
16823
|
};
|
|
16804
16824
|
break;
|
|
16805
16825
|
}
|
|
16806
|
-
case
|
|
16807
|
-
case
|
|
16808
|
-
case
|
|
16826
|
+
case FillType.GradientLinear:
|
|
16827
|
+
case FillType.GradientAngular:
|
|
16828
|
+
case FillType.GradientRadial:
|
|
16809
16829
|
{
|
|
16810
16830
|
paint = {
|
|
16811
16831
|
type: paintData.type,
|
|
@@ -16815,15 +16835,32 @@ var ShapeComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16815
16835
|
};
|
|
16816
16836
|
break;
|
|
16817
16837
|
}
|
|
16818
|
-
case
|
|
16838
|
+
case FillType.Texture:
|
|
16819
16839
|
{
|
|
16840
|
+
var _paintData_textureTransform;
|
|
16841
|
+
var textureTransform = _extends({
|
|
16842
|
+
offset: {
|
|
16843
|
+
x: 0,
|
|
16844
|
+
y: 0
|
|
16845
|
+
},
|
|
16846
|
+
rotation: 0,
|
|
16847
|
+
scale: {
|
|
16848
|
+
x: 1,
|
|
16849
|
+
y: 1
|
|
16850
|
+
}
|
|
16851
|
+
}, (_paintData_textureTransform = paintData.textureTransform) != null ? _paintData_textureTransform : {});
|
|
16820
16852
|
var _paintData_scalingFactor, _paintData_opacity;
|
|
16821
16853
|
paint = {
|
|
16822
16854
|
type: paintData.type,
|
|
16823
16855
|
texture: this.engine.findObject(paintData.texture),
|
|
16824
16856
|
scaleMode: paintData.scaleMode,
|
|
16825
16857
|
scalingFactor: (_paintData_scalingFactor = paintData.scalingFactor) != null ? _paintData_scalingFactor : 1,
|
|
16826
|
-
opacity: (_paintData_opacity = paintData.opacity) != null ? _paintData_opacity : 1
|
|
16858
|
+
opacity: (_paintData_opacity = paintData.opacity) != null ? _paintData_opacity : 1,
|
|
16859
|
+
textureTransform: {
|
|
16860
|
+
offset: new Vector2().copyFrom(textureTransform.offset),
|
|
16861
|
+
rotation: textureTransform.rotation,
|
|
16862
|
+
scale: new Vector2().copyFrom(textureTransform.scale)
|
|
16863
|
+
}
|
|
16827
16864
|
};
|
|
16828
16865
|
break;
|
|
16829
16866
|
}
|
|
@@ -17214,11 +17251,11 @@ var vertex = "\nprecision highp float;\n\nattribute vec2 aPoint;\nuniform vec4 u
|
|
|
17214
17251
|
var fragment = "\nprecision highp float;\n\n#define fragColor gl_FragColor\n\nvarying vec4 vColor;\nvoid main() {\n gl_FragColor = vColor*vColor.a;\n}\n";
|
|
17215
17252
|
var seed$4 = 1;
|
|
17216
17253
|
var InteractMesh = /*#__PURE__*/ function() {
|
|
17217
|
-
function InteractMesh(props,
|
|
17254
|
+
function InteractMesh(props, transform, engine) {
|
|
17218
17255
|
this.transform = transform;
|
|
17219
17256
|
this.engine = engine;
|
|
17220
17257
|
this.color = props.options.previewColor;
|
|
17221
|
-
var material = this.createMaterial(
|
|
17258
|
+
var material = this.createMaterial();
|
|
17222
17259
|
var geometry = this.createGeometry();
|
|
17223
17260
|
this.mesh = this.createMesh(geometry, material);
|
|
17224
17261
|
this.updateMesh();
|
|
@@ -17241,7 +17278,7 @@ var InteractMesh = /*#__PURE__*/ function() {
|
|
|
17241
17278
|
material.setVector4("uPos", uPos);
|
|
17242
17279
|
material.setQuaternion("uQuat", tempQuat);
|
|
17243
17280
|
};
|
|
17244
|
-
_proto.createMaterial = function createMaterial(
|
|
17281
|
+
_proto.createMaterial = function createMaterial() {
|
|
17245
17282
|
var _this_engine_renderer;
|
|
17246
17283
|
var macros = [
|
|
17247
17284
|
[
|
|
@@ -17255,7 +17292,6 @@ var InteractMesh = /*#__PURE__*/ function() {
|
|
|
17255
17292
|
vertex: vertex,
|
|
17256
17293
|
fragment: fragment,
|
|
17257
17294
|
glslVersion: GLSLVersion.GLSL1,
|
|
17258
|
-
cacheId: "" + rendererOptions.cachePrefix + "_effects_interact",
|
|
17259
17295
|
macros: macros
|
|
17260
17296
|
}
|
|
17261
17297
|
};
|
|
@@ -17377,19 +17413,33 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
17377
17413
|
return _this;
|
|
17378
17414
|
}
|
|
17379
17415
|
var _proto = InteractComponent.prototype;
|
|
17380
|
-
|
|
17416
|
+
/**
|
|
17417
|
+
* 获取拖拽范围 X 轴
|
|
17418
|
+
* @returns 拖拽范围 [min, max]
|
|
17419
|
+
*/ _proto.getDragRangeX = function getDragRangeX() {
|
|
17381
17420
|
return this.dragRange.dxRange;
|
|
17382
17421
|
};
|
|
17383
|
-
|
|
17422
|
+
/**
|
|
17423
|
+
* 设置拖拽范围 X 轴
|
|
17424
|
+
* @param min 最小值
|
|
17425
|
+
* @param max 最大值
|
|
17426
|
+
*/ _proto.setDragRangeX = function setDragRangeX(min, max) {
|
|
17384
17427
|
this.dragRange.dxRange = [
|
|
17385
17428
|
min,
|
|
17386
17429
|
max
|
|
17387
17430
|
];
|
|
17388
17431
|
};
|
|
17389
|
-
|
|
17432
|
+
/**
|
|
17433
|
+
* 获取拖拽范围 Y 轴
|
|
17434
|
+
* @returns 拖拽范围 [min, max]
|
|
17435
|
+
*/ _proto.getDragRangeY = function getDragRangeY() {
|
|
17390
17436
|
return this.dragRange.dyRange;
|
|
17391
17437
|
};
|
|
17392
|
-
|
|
17438
|
+
/**
|
|
17439
|
+
* 设置拖拽范围 Y 轴
|
|
17440
|
+
* @param min 最小值
|
|
17441
|
+
* @param max 最大值
|
|
17442
|
+
*/ _proto.setDragRangeY = function setDragRangeY(min, max) {
|
|
17393
17443
|
this.dragRange.dyRange = [
|
|
17394
17444
|
min,
|
|
17395
17445
|
max
|
|
@@ -17397,15 +17447,11 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
17397
17447
|
};
|
|
17398
17448
|
_proto.onStart = function onStart() {
|
|
17399
17449
|
var env = this.item.engine.renderer.env;
|
|
17400
|
-
var composition = this.item.composition;
|
|
17401
17450
|
var _this_interactData_options = this.interactData.options, type = _this_interactData_options.type, showPreview = _this_interactData_options.showPreview;
|
|
17402
17451
|
if (type === InteractType.CLICK) {
|
|
17403
17452
|
this.clickable = true;
|
|
17404
17453
|
if (showPreview && env === PLAYER_OPTIONS_ENV_EDITOR) {
|
|
17405
|
-
|
|
17406
|
-
if (rendererOptions !== undefined) {
|
|
17407
|
-
this.previewContent = new InteractMesh(this.item.props.content, rendererOptions, this.transform, this.engine);
|
|
17408
|
-
}
|
|
17454
|
+
this.previewContent = new InteractMesh(this.item.props.content, this.transform, this.engine);
|
|
17409
17455
|
}
|
|
17410
17456
|
}
|
|
17411
17457
|
if (this.previewContent) {
|
|
@@ -17614,7 +17660,10 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
17614
17660
|
}
|
|
17615
17661
|
}
|
|
17616
17662
|
};
|
|
17617
|
-
|
|
17663
|
+
/**
|
|
17664
|
+
* 是否可以交互
|
|
17665
|
+
* @returns
|
|
17666
|
+
*/ _proto.canInteract = function canInteract() {
|
|
17618
17667
|
var _this_item_composition;
|
|
17619
17668
|
return Boolean((_this_item_composition = this.item.composition) == null ? void 0 : _this_item_composition.interactive) && this._interactive;
|
|
17620
17669
|
};
|
|
@@ -17649,7 +17698,9 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
17649
17698
|
get: function get() {
|
|
17650
17699
|
return this._interactive;
|
|
17651
17700
|
},
|
|
17652
|
-
set:
|
|
17701
|
+
set: /**
|
|
17702
|
+
* 是否响应点击和拖拽交互事件
|
|
17703
|
+
*/ function set(enable) {
|
|
17653
17704
|
this._interactive = enable;
|
|
17654
17705
|
if (!enable) {
|
|
17655
17706
|
// 立刻停止惯性滑动
|
|
@@ -18406,6 +18457,12 @@ var tmpScale = new Vector3(1, 1, 1);
|
|
|
18406
18457
|
this./**
|
|
18407
18458
|
* @internal
|
|
18408
18459
|
*/ transform = new Transform();
|
|
18460
|
+
this./**
|
|
18461
|
+
* 画布的像素宽度
|
|
18462
|
+
*/ pixelWidth = 0;
|
|
18463
|
+
this./**
|
|
18464
|
+
* 画布的像素高度
|
|
18465
|
+
*/ pixelHeight = 0;
|
|
18409
18466
|
this.viewportMatrix = Matrix4.fromIdentity();
|
|
18410
18467
|
this.viewMatrix = Matrix4.fromIdentity();
|
|
18411
18468
|
this.projectionMatrix = Matrix4.fromIdentity();
|
|
@@ -18420,7 +18477,7 @@ var tmpScale = new Vector3(1, 1, 1);
|
|
|
18420
18477
|
0,
|
|
18421
18478
|
0,
|
|
18422
18479
|
0
|
|
18423
|
-
] : _options_rotation;
|
|
18480
|
+
] : _options_rotation, _options_pixelWidth = options.pixelWidth, pixelWidth = _options_pixelWidth === void 0 ? 0 : _options_pixelWidth, _options_pixelHeight = options.pixelHeight, pixelHeight = _options_pixelHeight === void 0 ? 0 : _options_pixelHeight;
|
|
18424
18481
|
var euler = new Euler(rotation[0], rotation[1], rotation[2]);
|
|
18425
18482
|
var quat = new Quaternion().setFromEuler(euler);
|
|
18426
18483
|
this.options = {
|
|
@@ -18430,6 +18487,8 @@ var tmpScale = new Vector3(1, 1, 1);
|
|
|
18430
18487
|
aspect: aspect,
|
|
18431
18488
|
clipMode: clipMode
|
|
18432
18489
|
};
|
|
18490
|
+
this.pixelWidth = pixelWidth;
|
|
18491
|
+
this.pixelHeight = pixelHeight;
|
|
18433
18492
|
this.transform.setPosition(position[0], position[1], position[2]);
|
|
18434
18493
|
this.transform.setQuaternion(quat.x, quat.y, quat.z, quat.w);
|
|
18435
18494
|
this.dirty = true;
|
|
@@ -18576,6 +18635,48 @@ var tmpScale = new Vector3(1, 1, 1);
|
|
|
18576
18635
|
this.dirty = false;
|
|
18577
18636
|
}
|
|
18578
18637
|
};
|
|
18638
|
+
/**
|
|
18639
|
+
* 将世界坐标转换为屏幕像素坐标
|
|
18640
|
+
* @param position - 世界坐标
|
|
18641
|
+
* @param out - 输出的屏幕坐标,如果不传则创建新的 Vector3
|
|
18642
|
+
* @returns 屏幕坐标 (x, y 为像素坐标,左下角为(0,0),右上角为(width,height),z 为深度比例 [0,1],0=近平面,1=远平面)
|
|
18643
|
+
*/ _proto.worldToScreenPoint = function worldToScreenPoint(position, out) {
|
|
18644
|
+
this.updateMatrix();
|
|
18645
|
+
var result = out != null ? out : new Vector3();
|
|
18646
|
+
var vpMatrix = this.getViewProjectionMatrix();
|
|
18647
|
+
// 应用视图投影矩阵,得到 NDC 坐标 [-1, 1]
|
|
18648
|
+
result.set(position.x, position.y, position.z);
|
|
18649
|
+
vpMatrix.projectPoint(result, result);
|
|
18650
|
+
// 将 NDC 坐标转换为像素坐标
|
|
18651
|
+
// NDC: x,y in [-1, 1], 其中 (-1,-1) 是左下角,(1,1) 是右上角
|
|
18652
|
+
// Screen: x,y in [0, width/height], 其中 (0,0) 是左下角
|
|
18653
|
+
result.x = (result.x + 1) * 0.5 * this.pixelWidth;
|
|
18654
|
+
result.y = (result.y + 1) * 0.5 * this.pixelHeight;
|
|
18655
|
+
// 将 NDC z 值从 [-1, 1] 转换为深度比例 [0, 1]
|
|
18656
|
+
// -1 (近平面) -> 0, 1 (远平面) -> 1
|
|
18657
|
+
result.z = (result.z + 1) * 0.5;
|
|
18658
|
+
return result;
|
|
18659
|
+
};
|
|
18660
|
+
/**
|
|
18661
|
+
* 将屏幕像素坐标转换为世界坐标
|
|
18662
|
+
* @param position - 屏幕坐标 (x, y 为像素坐标,左下角为(0,0),z 为深度比例 [0,1],0=近平面,1=远平面)
|
|
18663
|
+
* @param out - 输出的世界坐标,如果不传则创建新的 Vector3
|
|
18664
|
+
* @returns 世界坐标
|
|
18665
|
+
*/ _proto.screenToWorldPoint = function screenToWorldPoint(position, out) {
|
|
18666
|
+
this.updateMatrix();
|
|
18667
|
+
var result = out != null ? out : new Vector3();
|
|
18668
|
+
var invVPMatrix = this.getInverseViewProjectionMatrix();
|
|
18669
|
+
// 将像素坐标转换为 NDC 坐标 [-1, 1]
|
|
18670
|
+
var ndcX = position.x / this.pixelWidth * 2 - 1;
|
|
18671
|
+
var ndcY = position.y / this.pixelHeight * 2 - 1;
|
|
18672
|
+
// 将深度比例 [0, 1] 转换为 NDC z 值 [-1, 1]
|
|
18673
|
+
// 0 (近平面) -> -1, 1 (远平面) -> 1
|
|
18674
|
+
var ndcZ = position.z * 2 - 1;
|
|
18675
|
+
// 应用逆视图投影矩阵
|
|
18676
|
+
result.set(ndcX, ndcY, ndcZ);
|
|
18677
|
+
invVPMatrix.projectPoint(result, result);
|
|
18678
|
+
return result;
|
|
18679
|
+
};
|
|
18579
18680
|
_create_class(Camera, [
|
|
18580
18681
|
{
|
|
18581
18682
|
key: "near",
|
|
@@ -21437,7 +21538,6 @@ function modifyMaxKeyframeShader(shader, maxVertex, maxFrag) {
|
|
|
21437
21538
|
var _proto = ParticleSystemRenderer.prototype;
|
|
21438
21539
|
_proto.onStart = function onStart() {
|
|
21439
21540
|
this._priority = this.item.renderOrder;
|
|
21440
|
-
this.particleMesh.gravityModifier.scaleXCoord(this.item.duration);
|
|
21441
21541
|
for(var _iterator = _create_for_of_iterator_helper_loose(this.meshes), _step; !(_step = _iterator()).done;){
|
|
21442
21542
|
var mesh = _step.value;
|
|
21443
21543
|
mesh.onStart();
|
|
@@ -22398,7 +22498,6 @@ var ParticleSystem = /*#__PURE__*/ function(Component) {
|
|
|
22398
22498
|
};
|
|
22399
22499
|
}
|
|
22400
22500
|
this.item.getHitTestParams = this.getHitTestParams;
|
|
22401
|
-
this.item._content = this;
|
|
22402
22501
|
};
|
|
22403
22502
|
_create_class(ParticleSystem, [
|
|
22404
22503
|
{
|
|
@@ -22923,7 +23022,7 @@ var tempPos = new Vector3();
|
|
|
22923
23022
|
*/ _proto.sampleAnimation = function sampleAnimation() {
|
|
22924
23023
|
var _this = this;
|
|
22925
23024
|
var boundItem = this.boundObject;
|
|
22926
|
-
var duration =
|
|
23025
|
+
var duration = this.getDuration();
|
|
22927
23026
|
var life = this.time / duration;
|
|
22928
23027
|
life = life < 0 ? 0 : life > 1 ? 1 : life;
|
|
22929
23028
|
if (this.sizeXOverLifetime) {
|
|
@@ -23393,41 +23492,45 @@ var ObjectBindingTrack = /*#__PURE__*/ function(TrackAsset) {
|
|
|
23393
23492
|
if (!_instanceof1(boundItem, VFXItem)) {
|
|
23394
23493
|
return;
|
|
23395
23494
|
}
|
|
23396
|
-
var hasActiveTrack = false;
|
|
23397
23495
|
for(var _iterator = _create_for_of_iterator_helper_loose(this.getChildTracks()), _step; !(_step = _iterator()).done;){
|
|
23398
23496
|
var childTrack = _step.value;
|
|
23399
23497
|
if (_instanceof1(childTrack, ActivationTrack)) {
|
|
23400
|
-
|
|
23498
|
+
// 添加粒子动画 clip // TODO 待移除
|
|
23499
|
+
if (boundItem.getComponent(ParticleSystem)) {
|
|
23500
|
+
var particleTrack = timelineAsset.createTrack(ParticleTrack, this, "ParticleTrack");
|
|
23501
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(childTrack.getClips()), _step1; !(_step1 = _iterator1()).done;){
|
|
23502
|
+
var activationClip = _step1.value;
|
|
23503
|
+
var particleClip = particleTrack.createClip(ParticleBehaviourPlayableAsset);
|
|
23504
|
+
particleClip.start = activationClip.start;
|
|
23505
|
+
particleClip.duration = activationClip.duration;
|
|
23506
|
+
particleClip.endBehavior = activationClip.endBehavior;
|
|
23507
|
+
}
|
|
23508
|
+
}
|
|
23509
|
+
// 添加图层帧动画动画时间 clip // TODO 待移除
|
|
23510
|
+
if (boundItem.getComponent(SpriteComponent)) {
|
|
23511
|
+
var componentTimeTrack = timelineAsset.createTrack(SpriteComponentTimeTrack, this, "SpriteComponentTimeTrack");
|
|
23512
|
+
for(var _iterator2 = _create_for_of_iterator_helper_loose(childTrack.getClips()), _step2; !(_step2 = _iterator2()).done;){
|
|
23513
|
+
var activationClip1 = _step2.value;
|
|
23514
|
+
var clip = componentTimeTrack.createClip(ComponentTimePlayableAsset);
|
|
23515
|
+
clip.start = activationClip1.start;
|
|
23516
|
+
clip.duration = activationClip1.duration;
|
|
23517
|
+
clip.endBehavior = activationClip1.endBehavior;
|
|
23518
|
+
}
|
|
23519
|
+
}
|
|
23520
|
+
// 添加图层帧动画动画时间 clip // TODO 待移除
|
|
23521
|
+
if (boundItem.getComponent(EffectComponent)) {
|
|
23522
|
+
var componentTimeTrack1 = timelineAsset.createTrack(EffectComponentTimeTrack, this, "EffectComponentTimeTrack");
|
|
23523
|
+
for(var _iterator3 = _create_for_of_iterator_helper_loose(childTrack.getClips()), _step3; !(_step3 = _iterator3()).done;){
|
|
23524
|
+
var activationClip2 = _step3.value;
|
|
23525
|
+
var clip1 = componentTimeTrack1.createClip(ComponentTimePlayableAsset);
|
|
23526
|
+
clip1.start = activationClip2.start;
|
|
23527
|
+
clip1.duration = activationClip2.duration;
|
|
23528
|
+
clip1.endBehavior = activationClip2.endBehavior;
|
|
23529
|
+
}
|
|
23530
|
+
}
|
|
23401
23531
|
break;
|
|
23402
23532
|
}
|
|
23403
23533
|
}
|
|
23404
|
-
if (!hasActiveTrack) {
|
|
23405
|
-
return;
|
|
23406
|
-
}
|
|
23407
|
-
// 添加粒子动画 clip // TODO 待移除
|
|
23408
|
-
if (boundItem.getComponent(ParticleSystem)) {
|
|
23409
|
-
var particleTrack = timelineAsset.createTrack(ParticleTrack, this, "ParticleTrack");
|
|
23410
|
-
var particleClip = particleTrack.createClip(ParticleBehaviourPlayableAsset);
|
|
23411
|
-
particleClip.start = boundItem.start;
|
|
23412
|
-
particleClip.duration = boundItem.duration;
|
|
23413
|
-
particleClip.endBehavior = boundItem.endBehavior;
|
|
23414
|
-
}
|
|
23415
|
-
// 添加图层帧动画动画时间 clip // TODO 待移除
|
|
23416
|
-
if (boundItem.getComponent(SpriteComponent)) {
|
|
23417
|
-
var componentTimeTrack = timelineAsset.createTrack(SpriteComponentTimeTrack, this, "SpriteComponentTimeTrack");
|
|
23418
|
-
var clip = componentTimeTrack.createClip(ComponentTimePlayableAsset);
|
|
23419
|
-
clip.start = boundItem.start;
|
|
23420
|
-
clip.duration = boundItem.duration;
|
|
23421
|
-
clip.endBehavior = boundItem.endBehavior;
|
|
23422
|
-
}
|
|
23423
|
-
// 添加图层帧动画动画时间 clip // TODO 待移除
|
|
23424
|
-
if (boundItem.getComponent(EffectComponent)) {
|
|
23425
|
-
var componentTimeTrack1 = timelineAsset.createTrack(EffectComponentTimeTrack, this, "EffectComponentTimeTrack");
|
|
23426
|
-
var clip1 = componentTimeTrack1.createClip(ComponentTimePlayableAsset);
|
|
23427
|
-
clip1.start = boundItem.start;
|
|
23428
|
-
clip1.duration = boundItem.duration;
|
|
23429
|
-
clip1.endBehavior = boundItem.endBehavior;
|
|
23430
|
-
}
|
|
23431
23534
|
};
|
|
23432
23535
|
return ObjectBindingTrack;
|
|
23433
23536
|
}(TrackAsset);
|
|
@@ -24212,13 +24315,14 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
24212
24315
|
_this.pluginSystem = scene.pluginSystem;
|
|
24213
24316
|
_this.pluginSystem.initializeComposition(_assert_this_initialized(_this), scene);
|
|
24214
24317
|
_this.camera = new Camera(_this.name, _extends({}, sourceContent == null ? void 0 : sourceContent.camera, {
|
|
24215
|
-
aspect: width / height
|
|
24318
|
+
aspect: width / height,
|
|
24319
|
+
pixelWidth: width,
|
|
24320
|
+
pixelHeight: height
|
|
24216
24321
|
}));
|
|
24217
24322
|
_this.url = scene.url;
|
|
24218
24323
|
_this.interactive = true;
|
|
24219
24324
|
_this.handleItemMessage = handleItemMessage;
|
|
24220
24325
|
_this.createRenderFrame();
|
|
24221
|
-
_this.rendererOptions = null;
|
|
24222
24326
|
Composition.buildItemTree(_this.rootItem);
|
|
24223
24327
|
_this.rootComposition.setChildrenRenderOrder(0);
|
|
24224
24328
|
_this.pluginSystem.resetComposition(_assert_this_initialized(_this), _this.renderFrame);
|
|
@@ -24274,9 +24378,11 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
24274
24378
|
this.restart();
|
|
24275
24379
|
}
|
|
24276
24380
|
if (this.rootComposition.isStartCalled) {
|
|
24277
|
-
this.
|
|
24381
|
+
this.setTime(this.time - this.startTime);
|
|
24382
|
+
this.resume();
|
|
24278
24383
|
} else {
|
|
24279
|
-
this.
|
|
24384
|
+
this.setTime(0);
|
|
24385
|
+
this.resume();
|
|
24280
24386
|
}
|
|
24281
24387
|
};
|
|
24282
24388
|
/**
|
|
@@ -24308,6 +24414,9 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
24308
24414
|
* @param time - 相对 startTime 的时间
|
|
24309
24415
|
*/ _proto.gotoAndPlay = function gotoAndPlay(time) {
|
|
24310
24416
|
this.setTime(time);
|
|
24417
|
+
this.emit("goto", {
|
|
24418
|
+
time: time
|
|
24419
|
+
});
|
|
24311
24420
|
this.resume();
|
|
24312
24421
|
};
|
|
24313
24422
|
/**
|
|
@@ -24315,6 +24424,9 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
24315
24424
|
* @param time - 相对 startTime 的时间
|
|
24316
24425
|
*/ _proto.gotoAndStop = function gotoAndStop(time) {
|
|
24317
24426
|
this.setTime(time);
|
|
24427
|
+
this.emit("goto", {
|
|
24428
|
+
time: time
|
|
24429
|
+
});
|
|
24318
24430
|
this.pause();
|
|
24319
24431
|
};
|
|
24320
24432
|
/**
|
|
@@ -24345,9 +24457,6 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
24345
24457
|
if (pause) {
|
|
24346
24458
|
this.paused = true;
|
|
24347
24459
|
}
|
|
24348
|
-
this.emit("goto", {
|
|
24349
|
-
time: time
|
|
24350
|
-
});
|
|
24351
24460
|
};
|
|
24352
24461
|
_proto.addItem = function addItem(item) {
|
|
24353
24462
|
this.items.push(item);
|
|
@@ -24379,7 +24488,6 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
24379
24488
|
/**
|
|
24380
24489
|
* 重置状态函数
|
|
24381
24490
|
*/ _proto.reset = function reset() {
|
|
24382
|
-
this.rendererOptions = null;
|
|
24383
24491
|
this.isEnded = false;
|
|
24384
24492
|
this.isEndCalled = false;
|
|
24385
24493
|
this.rootComposition.time = 0;
|
|
@@ -24405,9 +24513,9 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
24405
24513
|
if (this.getPaused()) {
|
|
24406
24514
|
return;
|
|
24407
24515
|
}
|
|
24408
|
-
//
|
|
24516
|
+
// Scene VFXItem components lifetime function
|
|
24409
24517
|
if (!this.rootItem.isDuringPlay) {
|
|
24410
|
-
this.
|
|
24518
|
+
this.rootItem.awake();
|
|
24411
24519
|
this.rootItem.beginPlay();
|
|
24412
24520
|
}
|
|
24413
24521
|
var previousCompositionTime = this.time;
|
|
@@ -24432,19 +24540,6 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
24432
24540
|
_proto.shouldDispose = function shouldDispose() {
|
|
24433
24541
|
return this.isEnded && this.rootItem.endBehavior === EndBehavior.destroy && !this.reusable;
|
|
24434
24542
|
};
|
|
24435
|
-
_proto.callAwake = function callAwake(item) {
|
|
24436
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(item.components), _step; !(_step = _iterator()).done;){
|
|
24437
|
-
var component = _step.value;
|
|
24438
|
-
if (!component.isAwakeCalled) {
|
|
24439
|
-
component.onAwake();
|
|
24440
|
-
component.isAwakeCalled = true;
|
|
24441
|
-
}
|
|
24442
|
-
}
|
|
24443
|
-
for(var _iterator1 = _create_for_of_iterator_helper_loose(item.children), _step1; !(_step1 = _iterator1()).done;){
|
|
24444
|
-
var child = _step1.value;
|
|
24445
|
-
this.callAwake(child);
|
|
24446
|
-
}
|
|
24447
|
-
};
|
|
24448
24543
|
/**
|
|
24449
24544
|
* 更新相机
|
|
24450
24545
|
* @override
|
|
@@ -24533,7 +24628,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
24533
24628
|
return (_this_renderer = this.renderer) == null ? void 0 : _this_renderer.engine;
|
|
24534
24629
|
};
|
|
24535
24630
|
/**
|
|
24536
|
-
* Item 求交测试,返回求交结果列表,x 和 y 是归一化到[-1, 1]
|
|
24631
|
+
* Item 求交测试,返回求交结果列表,x 和 y 是归一化到[-1, 1]区间的值,x 向右,y 向上
|
|
24537
24632
|
* @param x - 鼠标或触点的 x,已经归一化到[-1, 1]
|
|
24538
24633
|
* @param y - 鼠标或触点的 y,已经归一化到[-1, 1]
|
|
24539
24634
|
* @param force - 是否强制求交,没有交互信息的 Item 也要进行求交测试
|
|
@@ -24632,7 +24727,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
24632
24727
|
* 合成对象销毁
|
|
24633
24728
|
*/ _proto.dispose = function dispose() {
|
|
24634
24729
|
var _this = this;
|
|
24635
|
-
var
|
|
24730
|
+
var _this_pluginSystem;
|
|
24636
24731
|
if (this.destroyed) {
|
|
24637
24732
|
return;
|
|
24638
24733
|
}
|
|
@@ -24652,7 +24747,6 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
24652
24747
|
this.rootItem.dispose();
|
|
24653
24748
|
// FIXME: 注意这里增加了renderFrame销毁
|
|
24654
24749
|
this.renderFrame.dispose();
|
|
24655
|
-
(_this_rendererOptions = this.rendererOptions) == null ? void 0 : _this_rendererOptions.emptyTexture.dispose();
|
|
24656
24750
|
(_this_pluginSystem = this.pluginSystem) == null ? void 0 : _this_pluginSystem.destroyComposition(this);
|
|
24657
24751
|
this.update = function() {
|
|
24658
24752
|
{
|
|
@@ -24749,15 +24843,6 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
24749
24843
|
this.textureOffloaded = true;
|
|
24750
24844
|
}
|
|
24751
24845
|
};
|
|
24752
|
-
_proto.getRendererOptions = function getRendererOptions() {
|
|
24753
|
-
if (!this.rendererOptions) {
|
|
24754
|
-
this.rendererOptions = {
|
|
24755
|
-
emptyTexture: this.renderFrame.emptyTexture,
|
|
24756
|
-
cachePrefix: "-"
|
|
24757
|
-
};
|
|
24758
|
-
}
|
|
24759
|
-
return this.rendererOptions;
|
|
24760
|
-
};
|
|
24761
24846
|
/**
|
|
24762
24847
|
* 重新加载纹理
|
|
24763
24848
|
*/ _proto.reloadTexture = function reloadTexture() {
|
|
@@ -24871,7 +24956,9 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
24871
24956
|
function VFXItem(engine, props) {
|
|
24872
24957
|
var _this;
|
|
24873
24958
|
_this = EffectsObject.call(this, engine) || this;
|
|
24874
|
-
|
|
24959
|
+
/**
|
|
24960
|
+
* 元素的子元素列表
|
|
24961
|
+
*/ _this.children = [];
|
|
24875
24962
|
/**
|
|
24876
24963
|
* 元素的变换包含位置、旋转、缩放。
|
|
24877
24964
|
*/ _this.transform = new Transform();
|
|
@@ -24882,9 +24969,6 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
24882
24969
|
* 元素动画的持续时间
|
|
24883
24970
|
*/ _this.duration = 0;
|
|
24884
24971
|
/**
|
|
24885
|
-
* 元素动画的开始时间
|
|
24886
|
-
*/ _this.start = 0;
|
|
24887
|
-
/**
|
|
24888
24972
|
* 元素动画结束时行为(如何处理元素)
|
|
24889
24973
|
*/ _this.endBehavior = EndBehavior.forward;
|
|
24890
24974
|
_this.type = ItemType.base;
|
|
@@ -25004,6 +25088,7 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
25004
25088
|
this.composition = vfxItem.composition;
|
|
25005
25089
|
}
|
|
25006
25090
|
if (!this.isDuringPlay && vfxItem.isDuringPlay) {
|
|
25091
|
+
this.awake();
|
|
25007
25092
|
this.beginPlay();
|
|
25008
25093
|
}
|
|
25009
25094
|
};
|
|
@@ -25179,6 +25264,21 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
25179
25264
|
};
|
|
25180
25265
|
/**
|
|
25181
25266
|
* @internal
|
|
25267
|
+
*/ _proto.awake = function awake() {
|
|
25268
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(this.components), _step; !(_step = _iterator()).done;){
|
|
25269
|
+
var component = _step.value;
|
|
25270
|
+
if (!component.isAwakeCalled) {
|
|
25271
|
+
component.onAwake();
|
|
25272
|
+
component.isAwakeCalled = true;
|
|
25273
|
+
}
|
|
25274
|
+
}
|
|
25275
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(this.children), _step1; !(_step1 = _iterator1()).done;){
|
|
25276
|
+
var child = _step1.value;
|
|
25277
|
+
child.awake();
|
|
25278
|
+
}
|
|
25279
|
+
};
|
|
25280
|
+
/**
|
|
25281
|
+
* @internal
|
|
25182
25282
|
*/ _proto.onActiveChanged = function onActiveChanged() {
|
|
25183
25283
|
if (!this.isEnabled) {
|
|
25184
25284
|
this.onEnable();
|
|
@@ -25217,12 +25317,11 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
25217
25317
|
};
|
|
25218
25318
|
_proto.fromData = function fromData(data) {
|
|
25219
25319
|
EffectsObject.prototype.fromData.call(this, data);
|
|
25220
|
-
var id = data.id, name = data.name,
|
|
25320
|
+
var id = data.id, name = data.name, parentId = data.parentId, endBehavior = data.endBehavior, transform = data.transform, _data_duration = data.duration, duration = _data_duration === void 0 ? 0 : _data_duration;
|
|
25221
25321
|
this.props = data;
|
|
25222
25322
|
this.type = data.type;
|
|
25223
25323
|
this.id = id.toString(); // TODO 老数据 id 是 number,需要转换
|
|
25224
25324
|
this.name = name;
|
|
25225
|
-
this.start = delay ? delay : this.start;
|
|
25226
25325
|
if (transform) {
|
|
25227
25326
|
this.transform.fromData(transform);
|
|
25228
25327
|
}
|
|
@@ -25299,10 +25398,10 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
25299
25398
|
component.dispose();
|
|
25300
25399
|
}
|
|
25301
25400
|
this.components = [];
|
|
25302
|
-
this._content = undefined;
|
|
25303
25401
|
this._composition = null;
|
|
25304
25402
|
this.transform.setValid(false);
|
|
25305
25403
|
}
|
|
25404
|
+
EffectsObject.prototype.dispose.call(this);
|
|
25306
25405
|
};
|
|
25307
25406
|
_proto.resetChildrenParent = function resetChildrenParent() {
|
|
25308
25407
|
// GE 父元素销毁子元素继承逻辑
|
|
@@ -25442,14 +25541,6 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
25442
25541
|
return false;
|
|
25443
25542
|
};
|
|
25444
25543
|
_create_class(VFXItem, [
|
|
25445
|
-
{
|
|
25446
|
-
key: "content",
|
|
25447
|
-
get: /**
|
|
25448
|
-
* 返回元素创建的数据
|
|
25449
|
-
*/ function get() {
|
|
25450
|
-
return this._content;
|
|
25451
|
-
}
|
|
25452
|
-
},
|
|
25453
25544
|
{
|
|
25454
25545
|
key: "composition",
|
|
25455
25546
|
get: /**
|
|
@@ -25583,7 +25674,7 @@ var ColorPlayable = /*#__PURE__*/ function(Playable) {
|
|
|
25583
25674
|
}
|
|
25584
25675
|
var colorInc = vecFill(tempColor, 1);
|
|
25585
25676
|
var colorChanged;
|
|
25586
|
-
var life = this.time /
|
|
25677
|
+
var life = this.time / this.getDuration();
|
|
25587
25678
|
var opacityOverLifetime = this.opacityOverLifetime;
|
|
25588
25679
|
var colorOverLifetime = this.colorOverLifetime;
|
|
25589
25680
|
if (colorOverLifetime) {
|
|
@@ -25867,7 +25958,7 @@ var SpriteComponent = /*#__PURE__*/ function(MaskableGraphic) {
|
|
|
25867
25958
|
_this = MaskableGraphic.call(this, engine) || this;
|
|
25868
25959
|
_this.time = 0;
|
|
25869
25960
|
_this.duration = 0;
|
|
25870
|
-
_this.
|
|
25961
|
+
_this.loop = true;
|
|
25871
25962
|
/**
|
|
25872
25963
|
* @internal
|
|
25873
25964
|
*/ _this.splits = singleSplits;
|
|
@@ -25882,7 +25973,7 @@ var SpriteComponent = /*#__PURE__*/ function(MaskableGraphic) {
|
|
|
25882
25973
|
var _this = this;
|
|
25883
25974
|
var time = this.time;
|
|
25884
25975
|
var duration = this.duration;
|
|
25885
|
-
if (time > duration && this.
|
|
25976
|
+
if (time > duration && this.loop) {
|
|
25886
25977
|
time = time % duration;
|
|
25887
25978
|
}
|
|
25888
25979
|
var life = Math.min(Math.max(time / duration, 0.0), 1.0);
|
|
@@ -26122,6 +26213,8 @@ var SpriteComponent = /*#__PURE__*/ function(MaskableGraphic) {
|
|
|
26122
26213
|
var _data_duration;
|
|
26123
26214
|
//@ts-expect-error
|
|
26124
26215
|
this.duration = (_data_duration = data.duration) != null ? _data_duration : this.item.duration;
|
|
26216
|
+
var _data_loop;
|
|
26217
|
+
this.loop = (_data_loop = data.loop) != null ? _data_loop : true;
|
|
26125
26218
|
};
|
|
26126
26219
|
return SpriteComponent;
|
|
26127
26220
|
}(MaskableGraphic);
|
|
@@ -28874,7 +28967,8 @@ var TextLayout = /*#__PURE__*/ function() {
|
|
|
28874
28967
|
function TextLayout(options) {
|
|
28875
28968
|
this.width = 0;
|
|
28876
28969
|
this.height = 0;
|
|
28877
|
-
var _options_textHeight = options.textHeight, textHeight = _options_textHeight === void 0 ? 100 : _options_textHeight, _options_textWidth = options.textWidth, textWidth = _options_textWidth === void 0 ? 100 : _options_textWidth, _options_textOverflow = options.textOverflow, textOverflow = _options_textOverflow === void 0 ? TextOverflow.clip : _options_textOverflow, _options_textBaseline = options.textBaseline, textBaseline = _options_textBaseline === void 0 ? TextBaseline.top : _options_textBaseline, _options_textAlign = options.textAlign, textAlign = _options_textAlign === void 0 ? TextAlignment.left : _options_textAlign, _options_text = options.text, text = _options_text === void 0 ? " " : _options_text, _options_letterSpace = options.letterSpace, letterSpace = _options_letterSpace === void 0 ? 0 : _options_letterSpace, _options_lineGap = options.lineGap, lineGap = _options_lineGap === void 0 ? 0.571 : _options_lineGap, _options_autoWidth = options.autoWidth, autoWidth = _options_autoWidth === void 0 ? false : _options_autoWidth,
|
|
28970
|
+
var fontSize = options.fontSize, _options_textHeight = options.textHeight, textHeight = _options_textHeight === void 0 ? 100 : _options_textHeight, _options_textWidth = options.textWidth, textWidth = _options_textWidth === void 0 ? 100 : _options_textWidth, _options_textOverflow = options.textOverflow, textOverflow = _options_textOverflow === void 0 ? TextOverflow.clip : _options_textOverflow, _options_textBaseline = options.textBaseline, textBaseline = _options_textBaseline === void 0 ? TextBaseline.top : _options_textBaseline, _options_textAlign = options.textAlign, textAlign = _options_textAlign === void 0 ? TextAlignment.left : _options_textAlign, _options_text = options.text, text = _options_text === void 0 ? " " : _options_text, _options_letterSpace = options.letterSpace, letterSpace = _options_letterSpace === void 0 ? 0 : _options_letterSpace, _options_lineGap = options.lineGap, lineGap = _options_lineGap === void 0 ? 0.571 : _options_lineGap, _options_autoWidth = options.autoWidth, autoWidth = _options_autoWidth === void 0 ? false : _options_autoWidth, _options_lineHeight = options.lineHeight, lineHeight = _options_lineHeight === void 0 ? fontSize : _options_lineHeight, _options_useLegacyRichText = options.// @ts-expect-error
|
|
28971
|
+
useLegacyRichText, useLegacyRichText = _options_useLegacyRichText === void 0 ? false : _options_useLegacyRichText;
|
|
28878
28972
|
var tempWidth = fontSize + letterSpace;
|
|
28879
28973
|
this.autoWidth = autoWidth;
|
|
28880
28974
|
this.maxTextWidth = text.length * tempWidth;
|
|
@@ -28882,6 +28976,7 @@ var TextLayout = /*#__PURE__*/ function() {
|
|
|
28882
28976
|
this.height = textHeight;
|
|
28883
28977
|
this.letterSpace = letterSpace;
|
|
28884
28978
|
this.lineGap = lineGap;
|
|
28979
|
+
this.useLegacyRichText = useLegacyRichText;
|
|
28885
28980
|
this.overflow = textOverflow;
|
|
28886
28981
|
this.textBaseline = textBaseline;
|
|
28887
28982
|
this.textAlign = textAlign;
|
|
@@ -28932,6 +29027,38 @@ var TextLayout = /*#__PURE__*/ function() {
|
|
|
28932
29027
|
return offsetX;
|
|
28933
29028
|
};
|
|
28934
29029
|
/**
|
|
29030
|
+
* 富文本垂直对齐计算
|
|
29031
|
+
* @param style - 字体样式
|
|
29032
|
+
* @param lineHeights - 每行高度数组
|
|
29033
|
+
* @param fontSize - 字体大小
|
|
29034
|
+
* @returns 第一行基线的 Y 坐标
|
|
29035
|
+
*/ _proto.getOffsetYRich = function getOffsetYRich(style, lineHeights, fontSize) {
|
|
29036
|
+
var outlineWidth = style.outlineWidth, fontScale = style.fontScale;
|
|
29037
|
+
var total = lineHeights.reduce(function(a, b) {
|
|
29038
|
+
return a + b;
|
|
29039
|
+
}, 0);
|
|
29040
|
+
// 使用与原始 getOffsetY 相同的经验值计算
|
|
29041
|
+
// /3 计算 Y 轴偏移量,以匹配编辑器行为
|
|
29042
|
+
var offsetY = (lineHeights[0] - fontSize) / 3;
|
|
29043
|
+
// 计算基础偏移量(从画布顶部到第一行基线的距离)
|
|
29044
|
+
var baseOffset = fontSize + outlineWidth * fontScale;
|
|
29045
|
+
// 除第一行外的所有行的总高度
|
|
29046
|
+
var commonCalculation = total - lineHeights[0]; // 使用实际总高度减去第一行高度
|
|
29047
|
+
var offsetResult = 0;
|
|
29048
|
+
switch(this.textBaseline){
|
|
29049
|
+
case TextBaseline.top:
|
|
29050
|
+
offsetResult = baseOffset + offsetY;
|
|
29051
|
+
break;
|
|
29052
|
+
case TextBaseline.middle:
|
|
29053
|
+
offsetResult = (this.height * fontScale - total + this.lineGap * fontScale) / 2 + baseOffset;
|
|
29054
|
+
break;
|
|
29055
|
+
case TextBaseline.bottom:
|
|
29056
|
+
offsetResult = this.height * fontScale - commonCalculation - offsetY;
|
|
29057
|
+
break;
|
|
29058
|
+
}
|
|
29059
|
+
return offsetResult;
|
|
29060
|
+
};
|
|
29061
|
+
/**
|
|
28935
29062
|
* 设置文本框的宽度和高度
|
|
28936
29063
|
* @param width 文本框宽度
|
|
28937
29064
|
* @param height 文本框高度
|
|
@@ -29062,6 +29189,10 @@ var TextComponent = /*#__PURE__*/ function(MaskableGraphic) {
|
|
|
29062
29189
|
MaskableGraphic.prototype.onUpdate.call(this, dt);
|
|
29063
29190
|
this.updateTexture();
|
|
29064
29191
|
};
|
|
29192
|
+
_proto.onDestroy = function onDestroy() {
|
|
29193
|
+
MaskableGraphic.prototype.onDestroy.call(this);
|
|
29194
|
+
this.disposeTextTexture();
|
|
29195
|
+
};
|
|
29065
29196
|
_proto.fromData = function fromData(data) {
|
|
29066
29197
|
MaskableGraphic.prototype.fromData.call(this, data);
|
|
29067
29198
|
var interaction = data.interaction, options = data.options;
|
|
@@ -29102,10 +29233,10 @@ var TextComponentBase = /*#__PURE__*/ function() {
|
|
|
29102
29233
|
var width = this.textLayout.width + this.textStyle.fontOffset;
|
|
29103
29234
|
var lineCount = 1;
|
|
29104
29235
|
var x = 0;
|
|
29105
|
-
|
|
29106
|
-
|
|
29107
|
-
|
|
29108
|
-
|
|
29236
|
+
// 设置context.font的字号,确保measureText能正确计算字宽
|
|
29237
|
+
if (context) {
|
|
29238
|
+
context.font = this.getFontDesc(this.textStyle.fontSize);
|
|
29239
|
+
}
|
|
29109
29240
|
for(var i = 0; i < text.length; i++){
|
|
29110
29241
|
var _context_measureText;
|
|
29111
29242
|
var str = text[i];
|
|
@@ -29435,10 +29566,17 @@ var TextComponentBase = /*#__PURE__*/ function() {
|
|
|
29435
29566
|
wrapS: glContext.CLAMP_TO_EDGE,
|
|
29436
29567
|
wrapT: glContext.CLAMP_TO_EDGE
|
|
29437
29568
|
});
|
|
29569
|
+
this.disposeTextTexture();
|
|
29438
29570
|
this.renderer.texture = texture;
|
|
29439
29571
|
this.material.setTexture("_MainTex", texture);
|
|
29440
29572
|
this.isDirty = false;
|
|
29441
29573
|
};
|
|
29574
|
+
_proto.disposeTextTexture = function disposeTextTexture() {
|
|
29575
|
+
var texture = this.renderer.texture;
|
|
29576
|
+
if (texture && texture !== this.engine.whiteTexture) {
|
|
29577
|
+
texture.dispose();
|
|
29578
|
+
}
|
|
29579
|
+
};
|
|
29442
29580
|
_proto.getFontDesc = function getFontDesc(size) {
|
|
29443
29581
|
var _this_textStyle = this.textStyle, fontSize = _this_textStyle.fontSize, fontScale = _this_textStyle.fontScale, fontFamily = _this_textStyle.fontFamily, textWeight = _this_textStyle.textWeight, fontStyle = _this_textStyle.fontStyle;
|
|
29444
29582
|
var fontDesc = "" + (size || fontSize * fontScale).toString() + "px ";
|
|
@@ -30479,35 +30617,75 @@ function version34Migration(json) {
|
|
|
30479
30617
|
}
|
|
30480
30618
|
if (componentData1.dataType === DataType.ShapeComponent) {
|
|
30481
30619
|
var shapeComponentData = componentData1;
|
|
30482
|
-
//@ts-expect-error
|
|
30483
30620
|
shapeComponentData.fills = [];
|
|
30621
|
+
//@ts-expect-error
|
|
30484
30622
|
if (shapeComponentData.fill) {
|
|
30485
30623
|
var solidPaintData = {
|
|
30486
30624
|
type: FillType.Solid,
|
|
30625
|
+
//@ts-expect-error
|
|
30487
30626
|
color: shapeComponentData.fill.color
|
|
30488
30627
|
};
|
|
30489
|
-
//@ts-expect-error
|
|
30490
30628
|
shapeComponentData.fills.push(solidPaintData);
|
|
30491
30629
|
}
|
|
30492
|
-
delete shapeComponentData.fill;
|
|
30493
30630
|
//@ts-expect-error
|
|
30631
|
+
delete shapeComponentData.fill;
|
|
30494
30632
|
shapeComponentData.strokes = [];
|
|
30633
|
+
//@ts-expect-error
|
|
30495
30634
|
if (shapeComponentData.stroke) {
|
|
30496
30635
|
var solidPaintData1 = {
|
|
30497
30636
|
type: FillType.Solid,
|
|
30637
|
+
//@ts-expect-error
|
|
30498
30638
|
color: shapeComponentData.stroke.color
|
|
30499
30639
|
};
|
|
30500
|
-
//@ts-expect-error
|
|
30501
30640
|
shapeComponentData.strokes.push(solidPaintData1);
|
|
30502
30641
|
//@ts-expect-error
|
|
30503
|
-
shapeComponentData.
|
|
30642
|
+
shapeComponentData.strokeWidth = shapeComponentData.stroke.width;
|
|
30643
|
+
//@ts-expect-error
|
|
30644
|
+
shapeComponentData.strokeCap = shapeComponentData.stroke.cap;
|
|
30645
|
+
//@ts-expect-error
|
|
30646
|
+
shapeComponentData.strokeJoin = shapeComponentData.stroke.join;
|
|
30647
|
+
//@ts-expect-error
|
|
30648
|
+
delete shapeComponentData.stroke;
|
|
30504
30649
|
}
|
|
30505
30650
|
}
|
|
30506
30651
|
}
|
|
30652
|
+
// 处理富文本lineGap兼容性
|
|
30653
|
+
processRichTextLineGapCompatibility(json);
|
|
30507
30654
|
//@ts-expect-error
|
|
30508
30655
|
json.version = "3.5";
|
|
30509
30656
|
return json;
|
|
30510
30657
|
}
|
|
30658
|
+
/**
|
|
30659
|
+
* 处理富文本 lineGap 兼容性
|
|
30660
|
+
*/ function processRichTextLineGapCompatibility(json) {
|
|
30661
|
+
if (!json.components) {
|
|
30662
|
+
return;
|
|
30663
|
+
}
|
|
30664
|
+
// 遍历所有组件,处理富文本组件
|
|
30665
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(json.components), _step; !(_step = _iterator()).done;){
|
|
30666
|
+
var component = _step.value;
|
|
30667
|
+
// 识别富文本组件并处理 lineGap 兼容性
|
|
30668
|
+
if (component.dataType === DataType.RichTextComponent && component.options) {
|
|
30669
|
+
ensureRichTextLineGap(component.options);
|
|
30670
|
+
}
|
|
30671
|
+
}
|
|
30672
|
+
}
|
|
30673
|
+
/**
|
|
30674
|
+
* 确保富文本组件有版本标识字段
|
|
30675
|
+
*/ function ensureRichTextLineGap(options) {
|
|
30676
|
+
// 检查是否已经处理过
|
|
30677
|
+
if (!options || options.useLegacyRichText !== undefined) {
|
|
30678
|
+
return;
|
|
30679
|
+
}
|
|
30680
|
+
// 根据是否存在 lineGap 字段来判断版本
|
|
30681
|
+
if (options.lineGap === undefined) {
|
|
30682
|
+
// 旧版本(没有 lineGap 字段)
|
|
30683
|
+
options.useLegacyRichText = true;
|
|
30684
|
+
} else {
|
|
30685
|
+
// 新版本(有 lineGap 字段)
|
|
30686
|
+
options.useLegacyRichText = false;
|
|
30687
|
+
}
|
|
30688
|
+
}
|
|
30511
30689
|
/**
|
|
30512
30690
|
* 根据形状获取形状几何体数据
|
|
30513
30691
|
* @param shape - 形状
|
|
@@ -31430,7 +31608,7 @@ function getStandardSpriteContent(sprite, transform) {
|
|
|
31430
31608
|
return ret;
|
|
31431
31609
|
}
|
|
31432
31610
|
|
|
31433
|
-
var version$1 = "2.7.0-
|
|
31611
|
+
var version$1 = "2.7.0-beta.0";
|
|
31434
31612
|
var v0 = /^(\d+)\.(\d+)\.(\d+)(-(\w+)\.\d+)?$/;
|
|
31435
31613
|
var standardVersion = /^(\d+)\.(\d+)$/;
|
|
31436
31614
|
var reverseParticle = false;
|
|
@@ -32666,7 +32844,7 @@ function createTextureOptionsBySource(image, sourceFrom, id) {
|
|
|
32666
32844
|
function AssetService(engine) {
|
|
32667
32845
|
this.engine = engine;
|
|
32668
32846
|
this.builtinObjects = [];
|
|
32669
|
-
this.builtinObjects.push(
|
|
32847
|
+
this.builtinObjects.push(engine.whiteTexture);
|
|
32670
32848
|
}
|
|
32671
32849
|
var _proto = AssetService.prototype;
|
|
32672
32850
|
/**
|
|
@@ -34342,7 +34520,7 @@ var FBGeometryDataT = /*#__PURE__*/ function() {
|
|
|
34342
34520
|
this.jsonSceneData = {};
|
|
34343
34521
|
this.objectInstance = {};
|
|
34344
34522
|
this.assetLoader = new AssetLoader(this);
|
|
34345
|
-
this.
|
|
34523
|
+
this.whiteTexture = generateWhiteTexture(this);
|
|
34346
34524
|
this.transparentTexture = generateTransparentTexture(this);
|
|
34347
34525
|
}
|
|
34348
34526
|
var _proto = Engine.prototype;
|
|
@@ -34703,8 +34881,8 @@ registerPlugin("sprite", SpriteLoader, VFXItem);
|
|
|
34703
34881
|
registerPlugin("particle", ParticleLoader, VFXItem);
|
|
34704
34882
|
registerPlugin("cal", CalculateLoader, VFXItem);
|
|
34705
34883
|
registerPlugin("interact", InteractLoader, VFXItem);
|
|
34706
|
-
var version = "2.7.0-
|
|
34884
|
+
var version = "2.7.0-beta.0";
|
|
34707
34885
|
logger.info("Core version: " + version + ".");
|
|
34708
34886
|
|
|
34709
|
-
export { AbstractPlugin, ActivationMixerPlayable, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AndNode, AndNodeData, Animatable, AnimationClip, AnimationClipNode, AnimationClipNodeData, AnimationGraphAsset, Animator, ApplyAdditiveNode, ApplyAdditiveNodeData, Asset, AssetLoader, AssetManager, AssetService, BYTES_TYPE_MAP, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, BlendNode, BlendNodeData, BoolValueNode, COMPRESSED_TEXTURE, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, ColorCurve, ColorPlayable, ColorPropertyMixerPlayable, ColorPropertyPlayableAsset, ColorPropertyTrack, Component, ComponentTimePlayable, ComponentTimePlayableAsset, ComponentTimeTrack, Composition, CompositionComponent, ConstBoolNode, ConstBoolNodeData, ConstFloatNode, ConstFloatNodeData, ControlParameterBoolNode, ControlParameterBoolNodeData, ControlParameterFloatNode, ControlParameterFloatNodeData, ControlParameterTriggerNode, ControlParameterTriggerNodeData, DEFAULT_FONTS, DEFAULT_FPS, Database, Deferred, DestroyOptions, Downloader, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, EffectComponent, EffectComponentTimeTrack, EffectsObject, EffectsPackage, Ellipse, Engine, EqualNodeData, EventEmitter, EventSystem, Fake3DAnimationMode, Fake3DComponent,
|
|
34887
|
+
export { AbstractPlugin, ActivationMixerPlayable, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AndNode, AndNodeData, Animatable, AnimationClip, AnimationClipNode, AnimationClipNodeData, AnimationGraphAsset, Animator, ApplyAdditiveNode, ApplyAdditiveNodeData, Asset, AssetLoader, AssetManager, AssetService, BYTES_TYPE_MAP, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, BlendNode, BlendNodeData, BoolValueNode, COMPRESSED_TEXTURE, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, ColorCurve, ColorPlayable, ColorPropertyMixerPlayable, ColorPropertyPlayableAsset, ColorPropertyTrack, Component, ComponentTimePlayable, ComponentTimePlayableAsset, ComponentTimeTrack, Composition, CompositionComponent, ConstBoolNode, ConstBoolNodeData, ConstFloatNode, ConstFloatNodeData, ControlParameterBoolNode, ControlParameterBoolNodeData, ControlParameterFloatNode, ControlParameterFloatNodeData, ControlParameterTriggerNode, ControlParameterTriggerNodeData, DEFAULT_FONTS, DEFAULT_FPS, Database, Deferred, DestroyOptions, Downloader, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, EffectComponent, EffectComponentTimeTrack, EffectsObject, EffectsPackage, Ellipse, Engine, EqualNodeData, EventEmitter, EventSystem, Fake3DAnimationMode, Fake3DComponent, FilterMode, Float16ArrayWrapper, FloatComparisonNode, FloatComparisonNodeData, FloatPropertyMixerPlayable, FloatPropertyPlayableAsset, FloatPropertyTrack, FloatValueNode, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, GraphInstance, GraphNode, GraphNodeData, GraphicsPath, GreaterNodeData, HELP_LINK, HitTestType, InteractComponent, InteractLoader, InteractMesh, InvalidIndex, Item, KTXTexture, LayerBlendNode, LayerBlendNodeData, LessNodeData, LineSegments, LinearValue, MaskMode, MaskProcessor, MaskableGraphic, Material, MaterialDataBlock, MaterialRenderType, MaterialTrack, Mesh, MeshCollider, NodeTransform, NotNode, NotNodeData, ObjectBindingTrack, OrNode, OrNodeData, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleMixerPlayable, ParticleSystem, ParticleSystemRenderer, ParticleTrack, PassTextureCache, PathSegments, PlayState, Playable, PlayableAsset, PlayableOutput, PluginSystem, PolyStar, Polygon, Pose, PoseNode, PostProcessVolume, PropertyClipPlayable, 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, ShapePath, SourceType, SpriteColorMixerPlayable, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteComponentTimeTrack, SpriteLoader, StarType, StateMachineNode, StateMachineNodeData, StateNode, StateNodeData, StaticValue, SubCompositionClipPlayable, SubCompositionMixerPlayable, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TangentMode, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TexturePaintScaleMode, TextureSourceType, TextureStoreAction, Ticker, TimelineAsset, TimelineClip, TimelineInstance, TrackAsset, TrackMixerPlayable, TrackType, Transform, TransformMixerPlayable, TransformPlayable, TransformPlayableAsset, TransformTrack, TransitionNode, TransitionNodeData, TransitionState, VFXItem, ValueGetter, ValueNode, Vector2Curve, Vector2PropertyMixerPlayable, Vector2PropertyPlayableAsset, Vector2PropertyTrack, Vector3Curve, Vector3PropertyMixerPlayable, Vector3PropertyTrack, Vector3ropertyPlayableAsset, Vector4Curve, Vector4PropertyMixerPlayable, Vector4PropertyPlayableAsset, Vector4PropertyTrack, WeightedMode, addByOrder, addItem, addItemWithOrder, applyMixins, assertExist, asserts, base64ToFile, buildLine, calculateTranslation, canUseBOM, canvasPool, closePointEps, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, createCopyShader, createGLContext, createKeyFrameMeta, createShape, createValueGetter, curveEps, decimalEqual, defaultPlugins, deserializeMipmapTexture, earcut, effectsClass, effectsClassStore, enlargeBuffer, ensureFixedNumber, ensureVec3, findPreviousRenderPass, gaussianDownHFrag, gaussianDownVFrag, gaussianUpFrag, generateEmptyTypedArray, generateGUID, generateHalfFloatTexture, generateTransparentTexture, generateWhiteTexture, getBackgroundImage, getClass, getColorFromGradientStops, getConfig, getDefaultTextureFactory, getGeometryByShape, getGeometryTriangles, getKTXTextureOptions, getKeyFrameMetaByRawValue, getMergedStore, getNodeDataClass, 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, isOpenHarmony, isPlainObject, isSimulatorCellPhone, isString, isUniformStruct, isUniformStructArray, isValidFontFamily, isWebGL2, isWechatMiniApp, itemFrag, itemVert, loadAVIFOptional, loadBinary, loadBlob, loadImage, loadMedia, loadVideo, loadWebPOptional, logger, index as math, maxSpriteMeshItemCount, modifyMaxKeyframeShader, nearestPowerOfTwo, nodeDataClass, noop, normalizeColor, numberToFix, oldBezierKeyFramesToNew, 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, sortByOrder, index$1 as spec, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecFill, vecMulCombine, version, vertexFormatType2GLType };
|
|
34710
34888
|
//# sourceMappingURL=index.mjs.map
|