@galacean/effects-core 2.1.0-alpha.12 → 2.1.0-alpha.13
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 +496 -47
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +497 -48
- package/dist/index.mjs.map +1 -1
- package/dist/material/material.d.ts +10 -0
- package/dist/plugins/shape/graphics-path.d.ts +2 -2
- package/dist/plugins/shape/rectangle.d.ts +1 -1
- package/dist/plugins/shape/shape-path.d.ts +10 -0
- package/dist/plugins/timeline/playable-assets/color-property-playable-asset.d.ts +1 -1
- package/dist/plugins/timeline/playable-assets/index.d.ts +2 -0
- package/dist/plugins/timeline/playable-assets/vector4-property-playable-asset.d.ts +1 -1
- package/dist/render/render-frame.d.ts +2 -0
- package/dist/render/renderer.d.ts +2 -1
- package/package.json +2 -2
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.1.0-alpha.
|
|
6
|
+
* Version: v2.1.0-alpha.13
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -6941,6 +6941,28 @@ var MaterialRenderType;
|
|
|
6941
6941
|
this.shaderDirty = true;
|
|
6942
6942
|
}
|
|
6943
6943
|
},
|
|
6944
|
+
{
|
|
6945
|
+
key: "mainTexture",
|
|
6946
|
+
get: /**
|
|
6947
|
+
* 材质的主纹理
|
|
6948
|
+
*/ function get() {
|
|
6949
|
+
return this.getTexture("_MainTex");
|
|
6950
|
+
},
|
|
6951
|
+
set: function set(value) {
|
|
6952
|
+
this.setTexture("_MainTex", value);
|
|
6953
|
+
}
|
|
6954
|
+
},
|
|
6955
|
+
{
|
|
6956
|
+
key: "color",
|
|
6957
|
+
get: /**
|
|
6958
|
+
* 材质的主颜色
|
|
6959
|
+
*/ function get() {
|
|
6960
|
+
return this.getColor("_Color");
|
|
6961
|
+
},
|
|
6962
|
+
set: function set(value) {
|
|
6963
|
+
this.setColor("_Color", value);
|
|
6964
|
+
}
|
|
6965
|
+
},
|
|
6944
6966
|
{
|
|
6945
6967
|
key: "blending",
|
|
6946
6968
|
set: /******** effects-core 中会调用 引擎必须实现 ***********************/ /**
|
|
@@ -10077,7 +10099,7 @@ var integrate = "float calculateMovement(float t,vec2 p1,vec2 p2,vec2 p3,vec2 p4
|
|
|
10077
10099
|
|
|
10078
10100
|
var itemVert = "precision highp float;attribute vec2 atlasOffset;attribute vec3 aPos;varying vec2 vTexCoord;varying vec3 vParams;varying vec4 vColor;uniform vec2 _Size;uniform vec4 _Color;uniform vec4 _TexParams;uniform vec4 _TexOffset;uniform mat4 effects_MatrixVP;uniform mat4 effects_MatrixInvV;uniform mat4 effects_ObjectToWorld;\n#ifdef ENV_EDITOR\nuniform vec4 uEditorTransform;\n#endif\nvoid main(){vec4 texParams=_TexParams;vTexCoord=vec2(atlasOffset.xy*_TexOffset.zw+_TexOffset.xy);vColor=_Color;vParams=vec3(0.0,texParams.y,texParams.x);vec4 pos=vec4(aPos.xy*_Size,aPos.z,1.0);gl_Position=effects_MatrixVP*effects_ObjectToWorld*pos;\n#ifdef ENV_EDITOR\ngl_Position=vec4(gl_Position.xy*uEditorTransform.xy+uEditorTransform.zw*gl_Position.w,gl_Position.zw);\n#endif\n}";
|
|
10079
10101
|
|
|
10080
|
-
var itemFrag = "precision highp float;varying vec4 vColor;varying vec2 vTexCoord;varying vec3 vParams;uniform sampler2D
|
|
10102
|
+
var itemFrag = "precision highp float;varying vec4 vColor;varying vec2 vTexCoord;varying vec3 vParams;uniform sampler2D _MainTex;vec4 blendColor(vec4 color,vec4 vc,float mode){vec4 ret=color*vc;float alpha=ret.a;if(mode==1.){ret.rgb*=alpha;}else if(mode==2.){ret.rgb*=alpha;ret.a=dot(ret.rgb,vec3(0.33333333));}else if(mode==3.){alpha=color.r*alpha;ret=vec4(vc.rgb*alpha,alpha);}return ret;}void main(){vec4 color=vec4(0.);vec4 texColor=texture2D(_MainTex,vTexCoord.xy);color=blendColor(texColor,vColor,floor(0.5+vParams.y));if(vParams.z==0.&&color.a<0.04){discard;}color.a=clamp(color.a,0.0,1.0);gl_FragColor=color;}";
|
|
10081
10103
|
|
|
10082
10104
|
var particleFrag = "#version 100\nprecision mediump float;vec4 blendColor(vec4 color,vec4 vc,float mode){vec4 ret=color*vc;float alpha=ret.a;if(mode==1.){ret.rgb*=alpha;}else if(mode==2.){ret.rgb*=alpha;ret.a=dot(ret.rgb,vec3(0.33333333));}else if(mode==3.){alpha=color.r*alpha;ret=vec4(vc.rgb*alpha,alpha);}return ret;}\n#define PATICLE_SHADER 1\nvarying float vLife;varying vec2 vTexCoord;varying vec4 vColor;uniform vec3 emissionColor;uniform float emissionIntensity;uniform sampler2D uMaskTex;uniform vec4 uColorParams;uniform vec2 uTexOffset;\n#ifdef COLOR_OVER_LIFETIME\nuniform sampler2D uColorOverLifetime;\n#endif\n#ifdef USE_SPRITE\nvarying vec4 vTexCoordBlend;\n#endif\nvarying float vSeed;\n#ifdef PREVIEW_BORDER\nuniform vec4 uPreviewColor;\n#endif\n#ifdef USE_SPRITE\nvec4 getTextureColor(sampler2D tex,vec2 texCoord){if(vTexCoordBlend.w>0.){return mix(texture2D(tex,texCoord),texture2D(tex,vTexCoordBlend.xy+texCoord),vTexCoordBlend.z);}return texture2D(tex,texCoord);}\n#else\n#define getTextureColor texture2D\n#endif\n#ifndef WEBGL2\n#define round(a) floor(0.5+a)\n#endif\n#ifdef PREVIEW_BORDER\nvoid main(){gl_FragColor=uPreviewColor;}\n#else\nvoid main(){vec4 color=vec4(1.0);vec4 tempColor=vColor;vec2 texOffset=uTexOffset;if(vLife<0.){discard;}if(uColorParams.x>0.0){color=getTextureColor(uMaskTex,vTexCoord);}\n#ifdef COLOR_OVER_LIFETIME\n#ifndef ENABLE_VERTEX_TEXTURE\ntempColor*=texture2D(uColorOverLifetime,vec2(vLife,0.));\n#endif\n#endif\ncolor=blendColor(color,tempColor,round(uColorParams.y));if(color.a<=0.01&&uColorParams.w>0.){float _at=texture2D(uMaskTex,vTexCoord+texOffset).a+texture2D(uMaskTex,vTexCoord+texOffset*-1.).a;if(_at<=0.02){discard;}}vec3 emission=emissionColor*pow(2.0,emissionIntensity);color=vec4(pow(pow(color.rgb,vec3(2.2))+emission,vec3(1.0/2.2)),color.a);gl_FragColor=color;}\n#endif\n";
|
|
10083
10105
|
|
|
@@ -10606,6 +10628,9 @@ var seed$5 = 1;
|
|
|
10606
10628
|
this.renderer = renderer;
|
|
10607
10629
|
if (postProcessingEnabled) {
|
|
10608
10630
|
var enableHDR = true;
|
|
10631
|
+
if (!this.renderer.engine.gpuCapability.detail.halfFloatTexture) {
|
|
10632
|
+
throw new Error("Half float texture is not supported.");
|
|
10633
|
+
}
|
|
10609
10634
|
// 使用HDR浮点纹理,FLOAT在IOS上报错,使用HALF_FLOAT
|
|
10610
10635
|
var textureType = enableHDR ? glContext.HALF_FLOAT : glContext.UNSIGNED_BYTE;
|
|
10611
10636
|
attachments = [
|
|
@@ -11326,7 +11351,7 @@ var FinalCopyRP = /*#__PURE__*/ function(RenderPass) {
|
|
|
11326
11351
|
var GlobalUniforms = function GlobalUniforms() {
|
|
11327
11352
|
this.floats = {};
|
|
11328
11353
|
this.ints = {};
|
|
11329
|
-
|
|
11354
|
+
this.vector3s = {};
|
|
11330
11355
|
this.vector4s = {};
|
|
11331
11356
|
this.matrices = {};
|
|
11332
11357
|
//...
|
|
@@ -11567,6 +11592,9 @@ var Renderer = /*#__PURE__*/ function() {
|
|
|
11567
11592
|
_proto.setGlobalVector4 = function setGlobalVector4(name, value) {
|
|
11568
11593
|
// OVERRIDE
|
|
11569
11594
|
};
|
|
11595
|
+
_proto.setGlobalVector3 = function setGlobalVector3(name, value) {
|
|
11596
|
+
// OVERRIDE
|
|
11597
|
+
};
|
|
11570
11598
|
_proto.setGlobalMatrix = function setGlobalMatrix(name, value) {
|
|
11571
11599
|
// OVERRIDE
|
|
11572
11600
|
};
|
|
@@ -13232,10 +13260,10 @@ var Vector4Curve = /*#__PURE__*/ function(ValueGetter) {
|
|
|
13232
13260
|
}
|
|
13233
13261
|
var _proto = Vector4Curve.prototype;
|
|
13234
13262
|
_proto.onCreate = function onCreate(arg) {
|
|
13235
|
-
this.xCurve = createValueGetter(arg
|
|
13236
|
-
this.yCurve = createValueGetter(arg
|
|
13237
|
-
this.zCurve = createValueGetter(arg
|
|
13238
|
-
this.wCurve = createValueGetter(arg
|
|
13263
|
+
this.xCurve = createValueGetter(arg[0]);
|
|
13264
|
+
this.yCurve = createValueGetter(arg[1]);
|
|
13265
|
+
this.zCurve = createValueGetter(arg[2]);
|
|
13266
|
+
this.wCurve = createValueGetter(arg[3]);
|
|
13239
13267
|
};
|
|
13240
13268
|
_proto.getValue = function getValue(t) {
|
|
13241
13269
|
var x = this.xCurve.getValue(t);
|
|
@@ -13335,10 +13363,10 @@ var ColorCurve = /*#__PURE__*/ function(ValueGetter) {
|
|
|
13335
13363
|
}
|
|
13336
13364
|
var _proto = ColorCurve.prototype;
|
|
13337
13365
|
_proto.onCreate = function onCreate(arg) {
|
|
13338
|
-
this.rCurve = createValueGetter(arg
|
|
13339
|
-
this.gCurve = createValueGetter(arg
|
|
13340
|
-
this.bCurve = createValueGetter(arg
|
|
13341
|
-
this.aCurve = createValueGetter(arg
|
|
13366
|
+
this.rCurve = createValueGetter(arg[0]);
|
|
13367
|
+
this.gCurve = createValueGetter(arg[1]);
|
|
13368
|
+
this.bCurve = createValueGetter(arg[2]);
|
|
13369
|
+
this.aCurve = createValueGetter(arg[3]);
|
|
13342
13370
|
};
|
|
13343
13371
|
_proto.getValue = function getValue(t) {
|
|
13344
13372
|
var r = this.rCurve.getValue(t);
|
|
@@ -13440,7 +13468,7 @@ var ColorCurve = /*#__PURE__*/ function(ValueGetter) {
|
|
|
13440
13468
|
* @param texture - 纹理对象
|
|
13441
13469
|
*/ _proto.setTexture = function setTexture(texture) {
|
|
13442
13470
|
this.renderer.texture = texture;
|
|
13443
|
-
this.material.setTexture("
|
|
13471
|
+
this.material.setTexture("_MainTex", texture);
|
|
13444
13472
|
};
|
|
13445
13473
|
/**
|
|
13446
13474
|
* @internal
|
|
@@ -13519,15 +13547,7 @@ var ColorCurve = /*#__PURE__*/ function(ValueGetter) {
|
|
|
13519
13547
|
geometry.setIndexData(indexData);
|
|
13520
13548
|
geometry.setAttributeData("atlasOffset", attributes.atlasOffset);
|
|
13521
13549
|
geometry.setDrawCount(data.index.length);
|
|
13522
|
-
|
|
13523
|
-
var texture1 = textures[i];
|
|
13524
|
-
material.setTexture("uSampler" + i, texture1);
|
|
13525
|
-
}
|
|
13526
|
-
// FIXME: 内存泄漏的临时方案,后面再调整
|
|
13527
|
-
var emptyTexture = this.emptyTexture;
|
|
13528
|
-
for(var k = textures.length; k < maxSpriteMeshItemCount; k++){
|
|
13529
|
-
material.setTexture("uSampler" + k, emptyTexture);
|
|
13530
|
-
}
|
|
13550
|
+
material.setTexture("_MainTex", texture);
|
|
13531
13551
|
};
|
|
13532
13552
|
_proto.getItemGeometryData = function getItemGeometryData() {
|
|
13533
13553
|
var renderer = this.renderer;
|
|
@@ -13645,7 +13665,7 @@ var ColorCurve = /*#__PURE__*/ function(ValueGetter) {
|
|
|
13645
13665
|
setBlendMode(material, states.blendMode);
|
|
13646
13666
|
setMaskMode(material, states.maskMode);
|
|
13647
13667
|
setSideMode(material, states.side);
|
|
13648
|
-
material.shader.shaderData.properties = '
|
|
13668
|
+
material.shader.shaderData.properties = '_MainTex("_MainTex",2D) = "white" {}';
|
|
13649
13669
|
if (!material.hasUniform("_Color")) {
|
|
13650
13670
|
material.setVector4("_Color", new Vector4(0, 0, 0, 1));
|
|
13651
13671
|
}
|
|
@@ -15383,6 +15403,329 @@ var PolyStar = /*#__PURE__*/ function(ShapePrimitive) {
|
|
|
15383
15403
|
return PolyStar;
|
|
15384
15404
|
}(ShapePrimitive);
|
|
15385
15405
|
|
|
15406
|
+
// const tempPoints = [new Point(), new Point(), new Point(), new Point()];
|
|
15407
|
+
/**
|
|
15408
|
+
* The `Rectangle` object is an area defined by its position, as indicated by its upper-left corner
|
|
15409
|
+
* point (`x`, `y`) and by its `width` and its `height`.
|
|
15410
|
+
*/ var Rectangle$1 = /*#__PURE__*/ function(ShapePrimitive) {
|
|
15411
|
+
_inherits(Rectangle, ShapePrimitive);
|
|
15412
|
+
function Rectangle(x, y, width, height) {
|
|
15413
|
+
if (x === void 0) x = 0;
|
|
15414
|
+
if (y === void 0) y = 0;
|
|
15415
|
+
if (width === void 0) width = 0;
|
|
15416
|
+
if (height === void 0) height = 0;
|
|
15417
|
+
var _this;
|
|
15418
|
+
_this = ShapePrimitive.call(this) || this;
|
|
15419
|
+
_this.x = Number(x);
|
|
15420
|
+
_this.y = Number(y);
|
|
15421
|
+
_this.width = Number(width);
|
|
15422
|
+
_this.height = Number(height);
|
|
15423
|
+
return _this;
|
|
15424
|
+
}
|
|
15425
|
+
var _proto = Rectangle.prototype;
|
|
15426
|
+
/** Determines whether the Rectangle is empty. */ _proto.isEmpty = function isEmpty() {
|
|
15427
|
+
return this.left === this.right || this.top === this.bottom;
|
|
15428
|
+
};
|
|
15429
|
+
/**
|
|
15430
|
+
* Creates a clone of this Rectangle
|
|
15431
|
+
* @returns a copy of the rectangle
|
|
15432
|
+
*/ _proto.clone = function clone() {
|
|
15433
|
+
return new Rectangle(this.x, this.y, this.width, this.height);
|
|
15434
|
+
};
|
|
15435
|
+
/**
|
|
15436
|
+
* Converts a Bounds object to a Rectangle object.
|
|
15437
|
+
* @param bounds - The bounds to copy and convert to a rectangle.
|
|
15438
|
+
* @returns Returns itself.
|
|
15439
|
+
*/ // copyFromBounds (bounds: Bounds): this {
|
|
15440
|
+
// this.x = bounds.minX;
|
|
15441
|
+
// this.y = bounds.minY;
|
|
15442
|
+
// this.width = bounds.maxX - bounds.minX;
|
|
15443
|
+
// this.height = bounds.maxY - bounds.minY;
|
|
15444
|
+
// return this;
|
|
15445
|
+
// }
|
|
15446
|
+
/**
|
|
15447
|
+
* Copies another rectangle to this one.
|
|
15448
|
+
* @param rectangle - The rectangle to copy from.
|
|
15449
|
+
* @returns Returns itself.
|
|
15450
|
+
*/ _proto.copyFrom = function copyFrom(rectangle) {
|
|
15451
|
+
this.x = rectangle.x;
|
|
15452
|
+
this.y = rectangle.y;
|
|
15453
|
+
this.width = rectangle.width;
|
|
15454
|
+
this.height = rectangle.height;
|
|
15455
|
+
return this;
|
|
15456
|
+
};
|
|
15457
|
+
/**
|
|
15458
|
+
* Copies this rectangle to another one.
|
|
15459
|
+
* @param rectangle - The rectangle to copy to.
|
|
15460
|
+
* @returns Returns given parameter.
|
|
15461
|
+
*/ _proto.copyTo = function copyTo(rectangle) {
|
|
15462
|
+
rectangle.copyFrom(this);
|
|
15463
|
+
return rectangle;
|
|
15464
|
+
};
|
|
15465
|
+
/**
|
|
15466
|
+
* Checks whether the x and y coordinates given are contained within this Rectangle
|
|
15467
|
+
* @param x - The X coordinate of the point to test
|
|
15468
|
+
* @param y - The Y coordinate of the point to test
|
|
15469
|
+
* @returns Whether the x/y coordinates are within this Rectangle
|
|
15470
|
+
*/ _proto.contains = function contains(x, y) {
|
|
15471
|
+
if (this.width <= 0 || this.height <= 0) {
|
|
15472
|
+
return false;
|
|
15473
|
+
}
|
|
15474
|
+
if (x >= this.x && x < this.x + this.width) {
|
|
15475
|
+
if (y >= this.y && y < this.y + this.height) {
|
|
15476
|
+
return true;
|
|
15477
|
+
}
|
|
15478
|
+
}
|
|
15479
|
+
return false;
|
|
15480
|
+
};
|
|
15481
|
+
/**
|
|
15482
|
+
* Checks whether the x and y coordinates given are contained within this rectangle including the stroke.
|
|
15483
|
+
* @param x - The X coordinate of the point to test
|
|
15484
|
+
* @param y - The Y coordinate of the point to test
|
|
15485
|
+
* @param strokeWidth - The width of the line to check
|
|
15486
|
+
* @returns Whether the x/y coordinates are within this rectangle
|
|
15487
|
+
*/ _proto.strokeContains = function strokeContains(x, y, strokeWidth) {
|
|
15488
|
+
var _this = this, width = _this.width, height = _this.height;
|
|
15489
|
+
if (width <= 0 || height <= 0) {
|
|
15490
|
+
return false;
|
|
15491
|
+
}
|
|
15492
|
+
var _x = this.x;
|
|
15493
|
+
var _y = this.y;
|
|
15494
|
+
var outerLeft = _x - strokeWidth / 2;
|
|
15495
|
+
var outerRight = _x + width + strokeWidth / 2;
|
|
15496
|
+
var outerTop = _y - strokeWidth / 2;
|
|
15497
|
+
var outerBottom = _y + height + strokeWidth / 2;
|
|
15498
|
+
var innerLeft = _x + strokeWidth / 2;
|
|
15499
|
+
var innerRight = _x + width - strokeWidth / 2;
|
|
15500
|
+
var innerTop = _y + strokeWidth / 2;
|
|
15501
|
+
var innerBottom = _y + height - strokeWidth / 2;
|
|
15502
|
+
return x >= outerLeft && x <= outerRight && y >= outerTop && y <= outerBottom && !(x > innerLeft && x < innerRight && y > innerTop && y < innerBottom);
|
|
15503
|
+
};
|
|
15504
|
+
/**
|
|
15505
|
+
* Determines whether the `other` Rectangle transformed by `transform` intersects with `this` Rectangle object.
|
|
15506
|
+
* Returns true only if the area of the intersection is >0, this means that Rectangles
|
|
15507
|
+
* sharing a side are not overlapping. Another side effect is that an arealess rectangle
|
|
15508
|
+
* (width or height equal to zero) can't intersect any other rectangle.
|
|
15509
|
+
* @param {Rectangle} other - The Rectangle to intersect with `this`.
|
|
15510
|
+
* @param {Matrix} transform - The transformation matrix of `other`.
|
|
15511
|
+
* @returns {boolean} A value of `true` if the transformed `other` Rectangle intersects with `this`; otherwise `false`.
|
|
15512
|
+
*/ // intersects (other: Rectangle, transform?: Matrix4): boolean {
|
|
15513
|
+
// if (!transform) {
|
|
15514
|
+
// const x0 = this.x < other.x ? other.x : this.x;
|
|
15515
|
+
// const x1 = this.right > other.right ? other.right : this.right;
|
|
15516
|
+
// if (x1 <= x0) {
|
|
15517
|
+
// return false;
|
|
15518
|
+
// }
|
|
15519
|
+
// const y0 = this.y < other.y ? other.y : this.y;
|
|
15520
|
+
// const y1 = this.bottom > other.bottom ? other.bottom : this.bottom;
|
|
15521
|
+
// return y1 > y0;
|
|
15522
|
+
// }
|
|
15523
|
+
// const x0 = this.left;
|
|
15524
|
+
// const x1 = this.right;
|
|
15525
|
+
// const y0 = this.top;
|
|
15526
|
+
// const y1 = this.bottom;
|
|
15527
|
+
// if (x1 <= x0 || y1 <= y0) {
|
|
15528
|
+
// return false;
|
|
15529
|
+
// }
|
|
15530
|
+
// const lt = tempPoints[0].set(other.left, other.top);
|
|
15531
|
+
// const lb = tempPoints[1].set(other.left, other.bottom);
|
|
15532
|
+
// const rt = tempPoints[2].set(other.right, other.top);
|
|
15533
|
+
// const rb = tempPoints[3].set(other.right, other.bottom);
|
|
15534
|
+
// if (rt.x <= lt.x || lb.y <= lt.y) {
|
|
15535
|
+
// return false;
|
|
15536
|
+
// }
|
|
15537
|
+
// const s = Math.sign((transform.a * transform.d) - (transform.b * transform.c));
|
|
15538
|
+
// if (s === 0) {
|
|
15539
|
+
// return false;
|
|
15540
|
+
// }
|
|
15541
|
+
// transform.apply(lt, lt);
|
|
15542
|
+
// transform.apply(lb, lb);
|
|
15543
|
+
// transform.apply(rt, rt);
|
|
15544
|
+
// transform.apply(rb, rb);
|
|
15545
|
+
// if (Math.max(lt.x, lb.x, rt.x, rb.x) <= x0
|
|
15546
|
+
// || Math.min(lt.x, lb.x, rt.x, rb.x) >= x1
|
|
15547
|
+
// || Math.max(lt.y, lb.y, rt.y, rb.y) <= y0
|
|
15548
|
+
// || Math.min(lt.y, lb.y, rt.y, rb.y) >= y1) {
|
|
15549
|
+
// return false;
|
|
15550
|
+
// }
|
|
15551
|
+
// const nx = s * (lb.y - lt.y);
|
|
15552
|
+
// const ny = s * (lt.x - lb.x);
|
|
15553
|
+
// const n00 = (nx * x0) + (ny * y0);
|
|
15554
|
+
// const n10 = (nx * x1) + (ny * y0);
|
|
15555
|
+
// const n01 = (nx * x0) + (ny * y1);
|
|
15556
|
+
// const n11 = (nx * x1) + (ny * y1);
|
|
15557
|
+
// if (Math.max(n00, n10, n01, n11) <= (nx * lt.x) + (ny * lt.y)
|
|
15558
|
+
// || Math.min(n00, n10, n01, n11) >= (nx * rb.x) + (ny * rb.y)) {
|
|
15559
|
+
// return false;
|
|
15560
|
+
// }
|
|
15561
|
+
// const mx = s * (lt.y - rt.y);
|
|
15562
|
+
// const my = s * (rt.x - lt.x);
|
|
15563
|
+
// const m00 = (mx * x0) + (my * y0);
|
|
15564
|
+
// const m10 = (mx * x1) + (my * y0);
|
|
15565
|
+
// const m01 = (mx * x0) + (my * y1);
|
|
15566
|
+
// const m11 = (mx * x1) + (my * y1);
|
|
15567
|
+
// if (Math.max(m00, m10, m01, m11) <= (mx * lt.x) + (my * lt.y)
|
|
15568
|
+
// || Math.min(m00, m10, m01, m11) >= (mx * rb.x) + (my * rb.y)) {
|
|
15569
|
+
// return false;
|
|
15570
|
+
// }
|
|
15571
|
+
// return true;
|
|
15572
|
+
// }
|
|
15573
|
+
/**
|
|
15574
|
+
* Pads the rectangle making it grow in all directions.
|
|
15575
|
+
* If paddingY is omitted, both paddingX and paddingY will be set to paddingX.
|
|
15576
|
+
* @param paddingX - The horizontal padding amount.
|
|
15577
|
+
* @param paddingY - The vertical padding amount.
|
|
15578
|
+
* @returns Returns itself.
|
|
15579
|
+
*/ _proto.pad = function pad(paddingX, paddingY) {
|
|
15580
|
+
if (paddingX === void 0) paddingX = 0;
|
|
15581
|
+
if (paddingY === void 0) paddingY = paddingX;
|
|
15582
|
+
this.x -= paddingX;
|
|
15583
|
+
this.y -= paddingY;
|
|
15584
|
+
this.width += paddingX * 2;
|
|
15585
|
+
this.height += paddingY * 2;
|
|
15586
|
+
return this;
|
|
15587
|
+
};
|
|
15588
|
+
/**
|
|
15589
|
+
* Fits this rectangle around the passed one.
|
|
15590
|
+
* @param rectangle - The rectangle to fit.
|
|
15591
|
+
* @returns Returns itself.
|
|
15592
|
+
*/ _proto.fit = function fit(rectangle) {
|
|
15593
|
+
var x1 = Math.max(this.x, rectangle.x);
|
|
15594
|
+
var x2 = Math.min(this.x + this.width, rectangle.x + rectangle.width);
|
|
15595
|
+
var y1 = Math.max(this.y, rectangle.y);
|
|
15596
|
+
var y2 = Math.min(this.y + this.height, rectangle.y + rectangle.height);
|
|
15597
|
+
this.x = x1;
|
|
15598
|
+
this.width = Math.max(x2 - x1, 0);
|
|
15599
|
+
this.y = y1;
|
|
15600
|
+
this.height = Math.max(y2 - y1, 0);
|
|
15601
|
+
return this;
|
|
15602
|
+
};
|
|
15603
|
+
/**
|
|
15604
|
+
* Enlarges rectangle that way its corners lie on grid
|
|
15605
|
+
* @param resolution - resolution
|
|
15606
|
+
* @param eps - precision
|
|
15607
|
+
* @returns Returns itself.
|
|
15608
|
+
*/ _proto.ceil = function ceil(resolution, eps) {
|
|
15609
|
+
if (resolution === void 0) resolution = 1;
|
|
15610
|
+
if (eps === void 0) eps = 0.001;
|
|
15611
|
+
var x2 = Math.ceil((this.x + this.width - eps) * resolution) / resolution;
|
|
15612
|
+
var y2 = Math.ceil((this.y + this.height - eps) * resolution) / resolution;
|
|
15613
|
+
this.x = Math.floor((this.x + eps) * resolution) / resolution;
|
|
15614
|
+
this.y = Math.floor((this.y + eps) * resolution) / resolution;
|
|
15615
|
+
this.width = x2 - this.x;
|
|
15616
|
+
this.height = y2 - this.y;
|
|
15617
|
+
return this;
|
|
15618
|
+
};
|
|
15619
|
+
/**
|
|
15620
|
+
* Enlarges this rectangle to include the passed rectangle.
|
|
15621
|
+
* @param rectangle - The rectangle to include.
|
|
15622
|
+
* @returns Returns itself.
|
|
15623
|
+
*/ _proto.enlarge = function enlarge(rectangle) {
|
|
15624
|
+
var x1 = Math.min(this.x, rectangle.x);
|
|
15625
|
+
var x2 = Math.max(this.x + this.width, rectangle.x + rectangle.width);
|
|
15626
|
+
var y1 = Math.min(this.y, rectangle.y);
|
|
15627
|
+
var y2 = Math.max(this.y + this.height, rectangle.y + rectangle.height);
|
|
15628
|
+
this.x = x1;
|
|
15629
|
+
this.width = x2 - x1;
|
|
15630
|
+
this.y = y1;
|
|
15631
|
+
this.height = y2 - y1;
|
|
15632
|
+
return this;
|
|
15633
|
+
};
|
|
15634
|
+
/**
|
|
15635
|
+
* Returns the framing rectangle of the rectangle as a Rectangle object
|
|
15636
|
+
* @param out - optional rectangle to store the result
|
|
15637
|
+
* @returns The framing rectangle
|
|
15638
|
+
*/ _proto.getBounds = function getBounds(out) {
|
|
15639
|
+
out = out || new Rectangle();
|
|
15640
|
+
out.copyFrom(this);
|
|
15641
|
+
return out;
|
|
15642
|
+
};
|
|
15643
|
+
_proto.getX = function getX() {
|
|
15644
|
+
return this.x;
|
|
15645
|
+
};
|
|
15646
|
+
_proto.getY = function getY() {
|
|
15647
|
+
return this.y;
|
|
15648
|
+
};
|
|
15649
|
+
_proto.build = function build(points) {
|
|
15650
|
+
var x = this.x;
|
|
15651
|
+
var y = this.y;
|
|
15652
|
+
var width = this.width;
|
|
15653
|
+
var height = this.height;
|
|
15654
|
+
if (!(width >= 0 && height >= 0)) {
|
|
15655
|
+
return points;
|
|
15656
|
+
}
|
|
15657
|
+
points[0] = x;
|
|
15658
|
+
points[1] = y;
|
|
15659
|
+
points[2] = x + width;
|
|
15660
|
+
points[3] = y;
|
|
15661
|
+
points[4] = x + width;
|
|
15662
|
+
points[5] = y + height;
|
|
15663
|
+
points[6] = x;
|
|
15664
|
+
points[7] = y + height;
|
|
15665
|
+
return points;
|
|
15666
|
+
};
|
|
15667
|
+
_proto.triangulate = function triangulate(points, vertices, verticesOffset, indices, indicesOffset) {
|
|
15668
|
+
var count = 0;
|
|
15669
|
+
var verticesStride = 2;
|
|
15670
|
+
verticesOffset *= verticesStride;
|
|
15671
|
+
vertices[verticesOffset + count] = points[0];
|
|
15672
|
+
vertices[verticesOffset + count + 1] = points[1];
|
|
15673
|
+
count += verticesStride;
|
|
15674
|
+
vertices[verticesOffset + count] = points[2];
|
|
15675
|
+
vertices[verticesOffset + count + 1] = points[3];
|
|
15676
|
+
count += verticesStride;
|
|
15677
|
+
vertices[verticesOffset + count] = points[6];
|
|
15678
|
+
vertices[verticesOffset + count + 1] = points[7];
|
|
15679
|
+
count += verticesStride;
|
|
15680
|
+
vertices[verticesOffset + count] = points[4];
|
|
15681
|
+
vertices[verticesOffset + count + 1] = points[5];
|
|
15682
|
+
count += verticesStride;
|
|
15683
|
+
var verticesIndex = verticesOffset / verticesStride;
|
|
15684
|
+
// triangle 1
|
|
15685
|
+
indices[indicesOffset++] = verticesIndex;
|
|
15686
|
+
indices[indicesOffset++] = verticesIndex + 1;
|
|
15687
|
+
indices[indicesOffset++] = verticesIndex + 2;
|
|
15688
|
+
// triangle 2
|
|
15689
|
+
indices[indicesOffset++] = verticesIndex + 1;
|
|
15690
|
+
indices[indicesOffset++] = verticesIndex + 3;
|
|
15691
|
+
indices[indicesOffset++] = verticesIndex + 2;
|
|
15692
|
+
};
|
|
15693
|
+
_create_class(Rectangle, [
|
|
15694
|
+
{
|
|
15695
|
+
key: "left",
|
|
15696
|
+
get: /** Returns the left edge of the rectangle. */ function get() {
|
|
15697
|
+
return this.x;
|
|
15698
|
+
}
|
|
15699
|
+
},
|
|
15700
|
+
{
|
|
15701
|
+
key: "right",
|
|
15702
|
+
get: /** Returns the right edge of the rectangle. */ function get() {
|
|
15703
|
+
return this.x + this.width;
|
|
15704
|
+
}
|
|
15705
|
+
},
|
|
15706
|
+
{
|
|
15707
|
+
key: "top",
|
|
15708
|
+
get: /** Returns the top edge of the rectangle. */ function get() {
|
|
15709
|
+
return this.y;
|
|
15710
|
+
}
|
|
15711
|
+
},
|
|
15712
|
+
{
|
|
15713
|
+
key: "bottom",
|
|
15714
|
+
get: /** Returns the bottom edge of the rectangle. */ function get() {
|
|
15715
|
+
return this.y + this.height;
|
|
15716
|
+
}
|
|
15717
|
+
}
|
|
15718
|
+
], [
|
|
15719
|
+
{
|
|
15720
|
+
key: "EMPTY",
|
|
15721
|
+
get: /** A constant empty rectangle. This is a new object every time the property is accessed */ function get() {
|
|
15722
|
+
return new Rectangle(0, 0, 0, 0);
|
|
15723
|
+
}
|
|
15724
|
+
}
|
|
15725
|
+
]);
|
|
15726
|
+
return Rectangle;
|
|
15727
|
+
}(ShapePrimitive);
|
|
15728
|
+
|
|
15386
15729
|
var ShapePath = /*#__PURE__*/ function() {
|
|
15387
15730
|
function ShapePath(graphicsPath) {
|
|
15388
15731
|
this.graphicsPath = graphicsPath;
|
|
@@ -15419,6 +15762,11 @@ var ShapePath = /*#__PURE__*/ function() {
|
|
|
15419
15762
|
this.polyStar(data[0], data[1], data[2], data[3], data[4], data[5], data[6]);
|
|
15420
15763
|
break;
|
|
15421
15764
|
}
|
|
15765
|
+
case "rect":
|
|
15766
|
+
{
|
|
15767
|
+
this.rect(data[0], data[1], data[2], data[3], data[4]);
|
|
15768
|
+
break;
|
|
15769
|
+
}
|
|
15422
15770
|
}
|
|
15423
15771
|
}
|
|
15424
15772
|
this.endPoly();
|
|
@@ -15464,6 +15812,18 @@ var ShapePath = /*#__PURE__*/ function() {
|
|
|
15464
15812
|
return this;
|
|
15465
15813
|
};
|
|
15466
15814
|
/**
|
|
15815
|
+
* Draws a rectangle shape. This method adds a new rectangle path to the current drawing.
|
|
15816
|
+
* @param x - The x-coordinate of the upper-left corner of the rectangle.
|
|
15817
|
+
* @param y - The y-coordinate of the upper-left corner of the rectangle.
|
|
15818
|
+
* @param w - The width of the rectangle.
|
|
15819
|
+
* @param h - The height of the rectangle.
|
|
15820
|
+
* @param transform - An optional `Matrix` object to apply a transformation to the rectangle.
|
|
15821
|
+
* @returns The instance of the current object for chaining.
|
|
15822
|
+
*/ _proto.rect = function rect(x, y, w, h, transform) {
|
|
15823
|
+
this.drawShape(new Rectangle$1(x, y, w, h), transform);
|
|
15824
|
+
return this;
|
|
15825
|
+
};
|
|
15826
|
+
/**
|
|
15467
15827
|
* Draws a given shape on the canvas.
|
|
15468
15828
|
* This is a generic method that can draw any type of shape specified by the `ShapePrimitive` parameter.
|
|
15469
15829
|
* An optional transformation matrix can be applied to the shape, allowing for complex transformations.
|
|
@@ -15599,8 +15959,8 @@ var GraphicsPath = /*#__PURE__*/ function() {
|
|
|
15599
15959
|
};
|
|
15600
15960
|
/**
|
|
15601
15961
|
* Draws a rectangle shape. This method adds a new rectangle path to the current drawing.
|
|
15602
|
-
* @param x - The x-coordinate of the
|
|
15603
|
-
* @param y - The y-coordinate of the
|
|
15962
|
+
* @param x - The x-coordinate of the upper-left corner of the rectangle.
|
|
15963
|
+
* @param y - The y-coordinate of the upper-left corner of the rectangle.
|
|
15604
15964
|
* @param w - The width of the rectangle.
|
|
15605
15965
|
* @param h - The height of the rectangle.
|
|
15606
15966
|
* @param transform - An optional `Matrix` object to apply a transformation to the rectangle.
|
|
@@ -15826,7 +16186,7 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
|
|
|
15826
16186
|
case 1:
|
|
15827
16187
|
{
|
|
15828
16188
|
var rectangleData = shapeData;
|
|
15829
|
-
this.path.rect(-rectangleData.width / 2, rectangleData.height / 2, rectangleData.width, rectangleData.height);
|
|
16189
|
+
this.path.rect(-rectangleData.width / 2, -rectangleData.height / 2, rectangleData.width, rectangleData.height);
|
|
15830
16190
|
this.setFillColor(rectangleData.fill);
|
|
15831
16191
|
break;
|
|
15832
16192
|
}
|
|
@@ -16453,7 +16813,7 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16453
16813
|
_proto.onDisable = function onDisable() {
|
|
16454
16814
|
if (this.item && this.item.composition) {
|
|
16455
16815
|
var _this_previewContent;
|
|
16456
|
-
if (this.duringPlay) {
|
|
16816
|
+
if (this.duringPlay && !this.item.transform.getValid()) {
|
|
16457
16817
|
this.item.composition.removeInteractiveItem(this.item, this.item.props.content.options.type);
|
|
16458
16818
|
this.duringPlay = false;
|
|
16459
16819
|
}
|
|
@@ -16656,10 +17016,10 @@ function shouldIgnoreBouncing(arg, mul) {
|
|
|
16656
17016
|
return this.boundingBoxData;
|
|
16657
17017
|
};
|
|
16658
17018
|
_proto.getBoundingBox = function getBoundingBox() {
|
|
16659
|
-
var maxX =
|
|
16660
|
-
var maxY =
|
|
16661
|
-
var minX =
|
|
16662
|
-
var minY =
|
|
17019
|
+
var maxX = -Number.MAX_VALUE;
|
|
17020
|
+
var maxY = -Number.MAX_VALUE;
|
|
17021
|
+
var minX = Number.MAX_VALUE;
|
|
17022
|
+
var minY = Number.MAX_VALUE;
|
|
16663
17023
|
for(var _iterator = _create_for_of_iterator_helper_loose(this.boundingBoxData.area), _step; !(_step = _iterator()).done;){
|
|
16664
17024
|
var triangle = _step.value;
|
|
16665
17025
|
maxX = Math.max(triangle.p0.x, triangle.p1.x, triangle.p2.x, maxX);
|
|
@@ -18076,7 +18436,7 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
18076
18436
|
options: {}
|
|
18077
18437
|
};
|
|
18078
18438
|
}
|
|
18079
|
-
if (duration
|
|
18439
|
+
if (duration < 0) {
|
|
18080
18440
|
throw new Error("Item duration can't be less than 0, see " + HELP_LINK["Item duration can't be less than 0"] + ".");
|
|
18081
18441
|
}
|
|
18082
18442
|
this.rendererComponents.length = 0;
|
|
@@ -18437,6 +18797,16 @@ var SpriteComponent = /*#__PURE__*/ function(BaseRenderComponent) {
|
|
|
18437
18797
|
}
|
|
18438
18798
|
var life = Math.min(Math.max(time / duration, 0.0), 1.0);
|
|
18439
18799
|
var ta = this.textureSheetAnimation;
|
|
18800
|
+
var video = this.renderer.texture.source.video;
|
|
18801
|
+
if (video) {
|
|
18802
|
+
if (time === 0) {
|
|
18803
|
+
video.pause();
|
|
18804
|
+
} else {
|
|
18805
|
+
video.play().catch(function(e) {
|
|
18806
|
+
_this.engine.renderErrors.add(e);
|
|
18807
|
+
});
|
|
18808
|
+
}
|
|
18809
|
+
}
|
|
18440
18810
|
if (ta) {
|
|
18441
18811
|
var _this_material_getVector4;
|
|
18442
18812
|
var total = ta.total || ta.row * ta.col;
|
|
@@ -18491,16 +18861,6 @@ var SpriteComponent = /*#__PURE__*/ function(BaseRenderComponent) {
|
|
|
18491
18861
|
dy
|
|
18492
18862
|
]);
|
|
18493
18863
|
}
|
|
18494
|
-
var video = this.renderer.texture.source.video;
|
|
18495
|
-
if (video) {
|
|
18496
|
-
if (time === 0 || time === this.item.duration) {
|
|
18497
|
-
video.pause();
|
|
18498
|
-
} else {
|
|
18499
|
-
video.play().catch(function(e) {
|
|
18500
|
-
_this.engine.renderErrors.add(e);
|
|
18501
|
-
});
|
|
18502
|
-
}
|
|
18503
|
-
}
|
|
18504
18864
|
};
|
|
18505
18865
|
_proto.onDestroy = function onDestroy() {
|
|
18506
18866
|
if (this.item && this.item.composition) {
|
|
@@ -23997,6 +24357,51 @@ var Vector4PropertyMixerPlayable = /*#__PURE__*/ function(Playable) {
|
|
|
23997
24357
|
return Vector4PropertyMixerPlayable;
|
|
23998
24358
|
}(Playable);
|
|
23999
24359
|
|
|
24360
|
+
var ColorPropertyMixerPlayable = /*#__PURE__*/ function(Playable) {
|
|
24361
|
+
_inherits(ColorPropertyMixerPlayable, Playable);
|
|
24362
|
+
function ColorPropertyMixerPlayable() {
|
|
24363
|
+
var _this;
|
|
24364
|
+
_this = Playable.apply(this, arguments) || this;
|
|
24365
|
+
_this.propertyName = "";
|
|
24366
|
+
return _this;
|
|
24367
|
+
}
|
|
24368
|
+
var _proto = ColorPropertyMixerPlayable.prototype;
|
|
24369
|
+
_proto.processFrame = function processFrame(context) {
|
|
24370
|
+
var boundObject = context.output.getUserData();
|
|
24371
|
+
if (!boundObject) {
|
|
24372
|
+
return;
|
|
24373
|
+
}
|
|
24374
|
+
var hasInput = false;
|
|
24375
|
+
var value = boundObject[this.propertyName];
|
|
24376
|
+
if (!_instanceof1(value, Color)) {
|
|
24377
|
+
return;
|
|
24378
|
+
}
|
|
24379
|
+
value.setZero();
|
|
24380
|
+
// evaluate the curve
|
|
24381
|
+
for(var i = 0; i < this.getInputCount(); i++){
|
|
24382
|
+
var weight = this.getInputWeight(i);
|
|
24383
|
+
if (weight > 0) {
|
|
24384
|
+
var propertyClipPlayable = this.getInput(i);
|
|
24385
|
+
if (!_instanceof1(propertyClipPlayable, PropertyClipPlayable)) {
|
|
24386
|
+
console.error("ColorPropertyMixerPlayable received incompatible input");
|
|
24387
|
+
continue;
|
|
24388
|
+
}
|
|
24389
|
+
var curveValue = propertyClipPlayable.value;
|
|
24390
|
+
value.r += curveValue.r * weight;
|
|
24391
|
+
value.g += curveValue.g * weight;
|
|
24392
|
+
value.b += curveValue.b * weight;
|
|
24393
|
+
value.a += curveValue.a * weight;
|
|
24394
|
+
hasInput = true;
|
|
24395
|
+
}
|
|
24396
|
+
}
|
|
24397
|
+
// set value
|
|
24398
|
+
if (hasInput) {
|
|
24399
|
+
boundObject[this.propertyName] = value;
|
|
24400
|
+
}
|
|
24401
|
+
};
|
|
24402
|
+
return ColorPropertyMixerPlayable;
|
|
24403
|
+
}(Playable);
|
|
24404
|
+
|
|
24000
24405
|
var PropertyTrack = /*#__PURE__*/ function(TrackAsset) {
|
|
24001
24406
|
_inherits(PropertyTrack, TrackAsset);
|
|
24002
24407
|
function PropertyTrack() {
|
|
@@ -24156,7 +24561,7 @@ var ColorPropertyTrack = /*#__PURE__*/ function(PropertyTrack) {
|
|
|
24156
24561
|
}
|
|
24157
24562
|
var _proto = ColorPropertyTrack.prototype;
|
|
24158
24563
|
_proto.createTrackMixer = function createTrackMixer(graph) {
|
|
24159
|
-
var mixer = new
|
|
24564
|
+
var mixer = new ColorPropertyMixerPlayable(graph);
|
|
24160
24565
|
var propertyNames = this.propertyNames;
|
|
24161
24566
|
if (propertyNames.length > 0) {
|
|
24162
24567
|
var propertyName = propertyNames[propertyNames.length - 1];
|
|
@@ -24170,6 +24575,27 @@ ColorPropertyTrack = __decorate([
|
|
|
24170
24575
|
effectsClass(DataType.ColorPropertyTrack)
|
|
24171
24576
|
], ColorPropertyTrack);
|
|
24172
24577
|
|
|
24578
|
+
var ColorPropertyPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
24579
|
+
_inherits(ColorPropertyPlayableAsset, PlayableAsset);
|
|
24580
|
+
function ColorPropertyPlayableAsset() {
|
|
24581
|
+
return PlayableAsset.apply(this, arguments);
|
|
24582
|
+
}
|
|
24583
|
+
var _proto = ColorPropertyPlayableAsset.prototype;
|
|
24584
|
+
_proto.createPlayable = function createPlayable(graph) {
|
|
24585
|
+
var clipPlayable = new PropertyClipPlayable(graph);
|
|
24586
|
+
clipPlayable.curve = createValueGetter(this.curveData);
|
|
24587
|
+
clipPlayable.value = clipPlayable.curve.getValue(0);
|
|
24588
|
+
return clipPlayable;
|
|
24589
|
+
};
|
|
24590
|
+
return ColorPropertyPlayableAsset;
|
|
24591
|
+
}(PlayableAsset);
|
|
24592
|
+
__decorate([
|
|
24593
|
+
serialize()
|
|
24594
|
+
], ColorPropertyPlayableAsset.prototype, "curveData", void 0);
|
|
24595
|
+
ColorPropertyPlayableAsset = __decorate([
|
|
24596
|
+
effectsClass(DataType.ColorPropertyPlayableAsset)
|
|
24597
|
+
], ColorPropertyPlayableAsset);
|
|
24598
|
+
|
|
24173
24599
|
var FloatPropertyPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
24174
24600
|
_inherits(FloatPropertyPlayableAsset, PlayableAsset);
|
|
24175
24601
|
function FloatPropertyPlayableAsset() {
|
|
@@ -24374,6 +24800,27 @@ function compareTracks(a, b) {
|
|
|
24374
24800
|
}
|
|
24375
24801
|
}
|
|
24376
24802
|
|
|
24803
|
+
var Vector4PropertyPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
24804
|
+
_inherits(Vector4PropertyPlayableAsset, PlayableAsset);
|
|
24805
|
+
function Vector4PropertyPlayableAsset() {
|
|
24806
|
+
return PlayableAsset.apply(this, arguments);
|
|
24807
|
+
}
|
|
24808
|
+
var _proto = Vector4PropertyPlayableAsset.prototype;
|
|
24809
|
+
_proto.createPlayable = function createPlayable(graph) {
|
|
24810
|
+
var clipPlayable = new PropertyClipPlayable(graph);
|
|
24811
|
+
clipPlayable.curve = createValueGetter(this.curveData);
|
|
24812
|
+
clipPlayable.value = clipPlayable.curve.getValue(0);
|
|
24813
|
+
return clipPlayable;
|
|
24814
|
+
};
|
|
24815
|
+
return Vector4PropertyPlayableAsset;
|
|
24816
|
+
}(PlayableAsset);
|
|
24817
|
+
__decorate([
|
|
24818
|
+
serialize()
|
|
24819
|
+
], Vector4PropertyPlayableAsset.prototype, "curveData", void 0);
|
|
24820
|
+
Vector4PropertyPlayableAsset = __decorate([
|
|
24821
|
+
effectsClass("Vector4PropertyPlayableAsset")
|
|
24822
|
+
], Vector4PropertyPlayableAsset);
|
|
24823
|
+
|
|
24377
24824
|
var ObjectBindingTrack = /*#__PURE__*/ function(TrackAsset1) {
|
|
24378
24825
|
_inherits(ObjectBindingTrack, TrackAsset1);
|
|
24379
24826
|
function ObjectBindingTrack() {
|
|
@@ -24978,7 +25425,7 @@ var TextComponentBase = /*#__PURE__*/ function() {
|
|
|
24978
25425
|
}
|
|
24979
25426
|
//与 toDataURL() 两种方式都需要像素读取操作
|
|
24980
25427
|
var imageData = context.getImageData(0, 0, this.canvas.width, this.canvas.height);
|
|
24981
|
-
this.material.setTexture("
|
|
25428
|
+
this.material.setTexture("_MainTex", Texture.createWithData(this.engine, {
|
|
24982
25429
|
data: new Uint8Array(imageData.data),
|
|
24983
25430
|
width: imageData.width,
|
|
24984
25431
|
height: imageData.height
|
|
@@ -28176,7 +28623,7 @@ var listOrder = 0;
|
|
|
28176
28623
|
var itemProps = sourceItemData;
|
|
28177
28624
|
if (passRenderLevel(sourceItemData.renderLevel, this.renderLevel)) {
|
|
28178
28625
|
itemProps.listIndex = listOrder++;
|
|
28179
|
-
if (itemProps.type === ItemType.sprite || itemProps.type === ItemType.particle || //@ts-expect-error
|
|
28626
|
+
if (itemProps.type === ItemType.sprite || itemProps.type === ItemType.particle || itemProps.type === ItemType.spine || //@ts-expect-error
|
|
28180
28627
|
itemProps.type === ItemType.shape) {
|
|
28181
28628
|
for(var _iterator2 = _create_for_of_iterator_helper_loose(itemProps.components), _step2; !(_step2 = _iterator2()).done;){
|
|
28182
28629
|
var componentPath = _step2.value;
|
|
@@ -28217,8 +28664,10 @@ var listOrder = 0;
|
|
|
28217
28664
|
shapeData = shape;
|
|
28218
28665
|
}
|
|
28219
28666
|
if (shapeData !== undefined) {
|
|
28220
|
-
|
|
28221
|
-
|
|
28667
|
+
if (!("aPoint" in shapeData && "index" in shapeData)) {
|
|
28668
|
+
// @ts-expect-error 类型转换问题
|
|
28669
|
+
renderContent.renderer.shape = getGeometryByShape(shapeData, split);
|
|
28670
|
+
}
|
|
28222
28671
|
}
|
|
28223
28672
|
}
|
|
28224
28673
|
if ("trails" in renderContent && renderContent.trails !== undefined) {
|
|
@@ -31134,8 +31583,8 @@ registerPlugin("sprite", SpriteLoader, VFXItem, true);
|
|
|
31134
31583
|
registerPlugin("particle", ParticleLoader, VFXItem, true);
|
|
31135
31584
|
registerPlugin("cal", CalculateLoader, VFXItem, true);
|
|
31136
31585
|
registerPlugin("interact", InteractLoader, VFXItem, true);
|
|
31137
|
-
var version = "2.1.0-alpha.
|
|
31586
|
+
var version = "2.1.0-alpha.13";
|
|
31138
31587
|
logger.info("Core version: " + version + ".");
|
|
31139
31588
|
|
|
31140
|
-
export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, Asset, AssetLoader, AssetManager, BYTES_TYPE_MAP, BaseRenderComponent, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, COMPRESSED_TEXTURE, 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, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, 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, sortByOrder, index$1 as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecFill, vecMulCombine, version, vertexFormatType2GLType };
|
|
31589
|
+
export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, Asset, AssetLoader, AssetManager, BYTES_TYPE_MAP, BaseRenderComponent, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, COMPRESSED_TEXTURE, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, ColorCurve, ColorPropertyPlayableAsset, ColorPropertyTrack, Component, Composition, CompositionComponent, CompositionSourceManager, DEFAULT_FONTS, DEFAULT_FPS, Database, DestroyOptions, Downloader, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, EffectComponent, EffectsObject, EffectsPackage, Engine, EventEmitter, EventSystem, Fake3DAnimationMode, Fake3DComponent, FilterMode, Float16ArrayWrapper, FloatPropertyPlayableAsset, FloatPropertyTrack, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, HELP_LINK, HitTestType, InteractComponent, InteractLoader, InteractMesh, Item, KTXTexture, LineSegments, LinearValue, Material, MaterialDataBlock, MaterialRenderType, MaterialTrack, Mesh, MeshCollider, ObjectBindingTrack, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, PassTextureCache, PathSegments, PluginSystem, PostProcessVolume, PropertyTrack, RENDER_PASS_NAME_PREFIX, RENDER_PREFER_LOOKUP_TEXTURE, RUNTIME_ENV, RandomSetValue, RandomValue, RandomVectorValue, RenderFrame, RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, RenderTargetHandle, RenderTextureFormat, Renderbuffer, Renderer, RendererComponent, RuntimeClip, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0, SEMANTIC_PRE_COLOR_ATTACHMENT_0, SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0, SPRITE_VERTEX_STRIDE, Scene, SemanticMap, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderFactory, ShaderType, ShaderVariant, ShapeComponent, ShapeConnectType, ShapePointType, ShapePrimitiveType, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteLoader, StaticValue, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, Ticker, TimelineAsset, TimelineClip, TimelinePlayable, TrackAsset, TrackSortWrapper, TrackType, Transform, TransformAnimationPlayable, TransformPlayableAsset, TransformTrack, VFXItem, ValueGetter, Vector4Curve, Vector4PropertyPlayableAsset, Vector4PropertyTrack, addByOrder, addItem, addItemWithOrder, applyMixins, assertExist, asserts, base64ToFile, blend, calculateTranslation, canvasPool, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, createCopyShader, createGLContext, createKeyFrameMeta, createShape, createValueGetter, decimalEqual, defaultPlugins, deserializeMipmapTexture, earcut, effectsClass, effectsClassStore, enlargeBuffer, ensureFixedNumber, ensureVec3, findPreviousRenderPass, gaussianDown_frag as gaussianDownFrag, gaussianDownHFrag, gaussianDownVFrag, gaussianUpFrag, generateEmptyTypedArray, generateGUID, generateHalfFloatTexture, generateTransparentTexture, generateWhiteTexture, getBackgroundImage, getColorFromGradientStops, getConfig, getDefaultTextureFactory, getGeometryByShape, getGeometryTriangles, getImageItemRenderInfo, getKTXTextureOptions, getKeyFrameMetaByRawValue, getMergedStore, getParticleMeshShader, getPixelRatio, getPreMultiAlpha, getStandardComposition, getStandardImage, getStandardItem, getStandardJSON, getTextureSize, glContext, glType2VertexFormatType, gpuTimer, imageDataFromColor, imageDataFromGradient, initErrors, initGLContext, integrate, interpolateColor, isAlipayMiniApp, isAndroid, isArray, isCanvas, isFunction, isIOS, isIOSByUA, isMiniProgram, isObject, isSimulatorCellPhone, isString, isUniformStruct, isUniformStructArray, isValidFontFamily, isWebGL2, isWechatMiniApp, itemFrag, itemFrameFrag, itemVert, loadAVIFOptional, loadBinary, loadBlob, loadImage, loadMedia, loadVideo, loadWebPOptional, logger, index as math, maxSpriteMeshItemCount, modifyMaxKeyframeShader, nearestPowerOfTwo, noop, normalizeColor, numberToFix, parsePercent$1 as parsePercent, particleFrag, particleOriginTranslateMap$1 as particleOriginTranslateMap, particleUniformTypeMap, particleVert, passRenderLevel, pluginLoaderMap, randomInRange, registerPlugin, removeItem, rotateVec2, screenMeshVert, serialize, setBlendMode, setConfig, setDefaultTextureFactory, setMaskMode, setMaxSpriteMeshItemCount, setRayFromCamera, setSideMode, setSpriteMeshMaxItemCountByGPU, sortByOrder, index$1 as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecFill, vecMulCombine, version, vertexFormatType2GLType };
|
|
31141
31590
|
//# sourceMappingURL=index.mjs.map
|