@galacean/effects-threejs 2.2.5 → 2.3.0-alpha.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/index.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects runtime threejs plugin for the web
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
6
- * Version: v2.2.5
6
+ * Version: v2.3.0-alpha.0
7
7
  */
8
8
 
9
9
  import * as THREE from 'three';
@@ -955,7 +955,7 @@ var pluginInfoMap = {
955
955
  "video": "@galacean/effects-plugin-multimedia",
956
956
  "audio": "@galacean/effects-plugin-multimedia",
957
957
  "orientation-transformer": "@galacean/effects-plugin-orientation-transformer",
958
- "richtext": "@galacean/effects-plugin-rich-text",
958
+ "rich-text": "@galacean/effects-plugin-rich-text",
959
959
  "spine": "@galacean/effects-plugin-spine"
960
960
  };
961
961
  function getPluginUsageInfo(name) {
@@ -1020,6 +1020,26 @@ function _inherits(subClass, superClass) {
1020
1020
  if (superClass) _set_prototype_of(subClass, superClass);
1021
1021
  }
1022
1022
 
1023
+ /**
1024
+ * JSON 版本
1025
+ */ var JSONSceneVersion;
1026
+ (function(JSONSceneVersion) {
1027
+ JSONSceneVersion["1_0"] = "1.0";
1028
+ JSONSceneVersion["1_1"] = "1.1";
1029
+ JSONSceneVersion["1_2"] = "1.2";
1030
+ JSONSceneVersion["1_3"] = "1.3";
1031
+ JSONSceneVersion["1_5"] = "1.5";
1032
+ JSONSceneVersion["1_8"] = "1.8";
1033
+ JSONSceneVersion["2_0"] = "2.0";
1034
+ JSONSceneVersion["2_1"] = "2.1";
1035
+ JSONSceneVersion["2_2"] = "2.2";
1036
+ JSONSceneVersion["2_3"] = "2.3";
1037
+ JSONSceneVersion["2_4"] = "2.4";
1038
+ JSONSceneVersion["3_0"] = "3.0";
1039
+ JSONSceneVersion["3_1"] = "3.1";
1040
+ JSONSceneVersion["LATEST"] = "3.1";
1041
+ })(JSONSceneVersion || (JSONSceneVersion = {}));
1042
+
1023
1043
  /*********************************************/ /* 元素属性参数类型 */ /*********************************************/ /**
1024
1044
  * 渲染等级
1025
1045
  */ var RenderLevel;
@@ -1325,8 +1345,12 @@ var RenderFace;
1325
1345
  */ var END_BEHAVIOR_DESTROY_CHILDREN = 6;
1326
1346
  var CAMERA_CLIP_MODE_VERTICAL = 1;
1327
1347
  var CAMERA_CLIP_MODE_NORMAL = 0;
1328
- var MESSAGE_ITEM_PHRASE_BEGIN = 2;
1329
- var MESSAGE_ITEM_PHRASE_END = 1;
1348
+ /**
1349
+ * 消息开始
1350
+ */ var MESSAGE_ITEM_PHRASE_BEGIN = 2;
1351
+ /**
1352
+ * 消息结束
1353
+ */ var MESSAGE_ITEM_PHRASE_END = 1;
1330
1354
 
1331
1355
  var CameraClipMode;
1332
1356
  (function(CameraClipMode) {
@@ -1400,6 +1424,9 @@ var CameraClipMode;
1400
1424
  /**
1401
1425
  * Vector4 曲线
1402
1426
  */ ValueType[ValueType["VECTOR4_CURVE"] = 25] = "VECTOR4_CURVE";
1427
+ /**
1428
+ * Vector2 曲线
1429
+ */ ValueType[ValueType["VECTOR2_CURVE"] = 26] = "VECTOR2_CURVE";
1403
1430
  })(ValueType || (ValueType = {}));
1404
1431
  /**
1405
1432
  * 关键帧类型
@@ -1668,19 +1695,13 @@ var ShapePointType;
1668
1695
  var DataType;
1669
1696
  (function(DataType) {
1670
1697
  DataType["VFXItemData"] = "VFXItemData";
1671
- DataType["EffectComponent"] = "EffectComponent";
1698
+ // Assets
1672
1699
  DataType["Material"] = "Material";
1673
1700
  DataType["Shader"] = "Shader";
1674
- DataType["SpriteComponent"] = "SpriteComponent";
1675
- DataType["ParticleSystem"] = "ParticleSystem";
1676
- DataType["InteractComponent"] = "InteractComponent";
1677
- DataType["CameraController"] = "CameraController";
1678
- DataType["PostProcessVolume"] = "PostProcessVolume";
1679
1701
  DataType["Geometry"] = "Geometry";
1680
1702
  DataType["Texture"] = "Texture";
1681
1703
  DataType["Image"] = "Image";
1682
1704
  DataType["AnimationClip"] = "AnimationClip";
1683
- DataType["TextComponent"] = "TextComponent";
1684
1705
  DataType["BinaryAsset"] = "BinaryAsset";
1685
1706
  // Timeline
1686
1707
  DataType["TrackAsset"] = "TrackAsset";
@@ -1692,6 +1713,7 @@ var DataType;
1692
1713
  DataType["SubCompositionTrack"] = "SubCompositionTrack";
1693
1714
  DataType["FloatPropertyTrack"] = "FloatPropertyTrack";
1694
1715
  DataType["ColorPropertyTrack"] = "ColorPropertyTrack";
1716
+ DataType["Vector2PropertyTrack"] = "Vector2PropertyTrack";
1695
1717
  DataType["Vector4PropertyTrack"] = "Vector4PropertyTrack";
1696
1718
  DataType["TransformPlayableAsset"] = "TransformPlayableAsset";
1697
1719
  DataType["SpriteColorPlayableAsset"] = "SpriteColorPlayableAsset";
@@ -1699,6 +1721,9 @@ var DataType;
1699
1721
  DataType["SubCompositionPlayableAsset"] = "SubCompositionPlayableAsset";
1700
1722
  DataType["FloatPropertyPlayableAsset"] = "FloatPropertyPlayableAsset";
1701
1723
  DataType["ColorPropertyPlayableAsset"] = "ColorPropertyPlayableAsset";
1724
+ DataType["Vector2PropertyPlayableAsset"] = "Vector2PropertyPlayableAsset";
1725
+ DataType["Vector4PropertyPlayableAsset"] = "Vector4PropertyPlayableAsset";
1726
+ // Components
1702
1727
  DataType["MeshComponent"] = "MeshComponent";
1703
1728
  DataType["SkyboxComponent"] = "SkyboxComponent";
1704
1729
  DataType["LightComponent"] = "LightComponent";
@@ -1712,6 +1737,13 @@ var DataType;
1712
1737
  DataType["RichTextComponent"] = "RichTextComponent";
1713
1738
  DataType["OrientationComponent"] = "OrientationComponent";
1714
1739
  DataType["ShapeComponent"] = "ShapeComponent";
1740
+ DataType["SpriteComponent"] = "SpriteComponent";
1741
+ DataType["ParticleSystem"] = "ParticleSystem";
1742
+ DataType["InteractComponent"] = "InteractComponent";
1743
+ DataType["CameraController"] = "CameraController";
1744
+ DataType["PostProcessVolume"] = "PostProcessVolume";
1745
+ DataType["EffectComponent"] = "EffectComponent";
1746
+ DataType["TextComponent"] = "TextComponent";
1715
1747
  // Non-EffectObject
1716
1748
  DataType["TimelineClip"] = "TimelineClip";
1717
1749
  })(DataType || (DataType = {}));
@@ -1800,8 +1832,11 @@ var VertexBufferSemantic;
1800
1832
  VertexBufferSemantic["TangentBS3"] = "TANGENT_BS3";
1801
1833
  })(VertexBufferSemantic || (VertexBufferSemantic = {}));
1802
1834
 
1835
+ var LATEST_VERSION = JSONSceneVersion.LATEST;
1836
+
1803
1837
  var index$1 = /*#__PURE__*/Object.freeze({
1804
1838
  __proto__: null,
1839
+ LATEST_VERSION: LATEST_VERSION,
1805
1840
  get RenderLevel () { return RenderLevel; },
1806
1841
  get BlendingMode () { return BlendingMode; },
1807
1842
  get SideMode () { return SideMode; },
@@ -1829,6 +1864,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
1829
1864
  MESSAGE_ITEM_PHRASE_END: MESSAGE_ITEM_PHRASE_END,
1830
1865
  get ValueType () { return ValueType; },
1831
1866
  get BezierKeyframeType () { return BezierKeyframeType; },
1867
+ get JSONSceneVersion () { return JSONSceneVersion; },
1832
1868
  get EndBehavior () { return EndBehavior; },
1833
1869
  get ParentItemEndBehavior () { return ParentItemEndBehavior; },
1834
1870
  get ParticleInteractionBehavior () { return ParticleInteractionBehavior; },
@@ -5276,418 +5312,6 @@ Matrix4.tempVec1 = new Vector3();
5276
5312
  Matrix4.tempVec2 = new Vector3();
5277
5313
  Matrix4.tempMat0 = new Matrix4();
5278
5314
 
5279
- function _array_like_to_array(arr, len) {
5280
- if (len == null || len > arr.length) len = arr.length;
5281
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
5282
- return arr2;
5283
- }
5284
-
5285
- function _unsupported_iterable_to_array(o, minLen) {
5286
- if (!o) return;
5287
- if (typeof o === "string") return _array_like_to_array(o, minLen);
5288
- var n = Object.prototype.toString.call(o).slice(8, -1);
5289
- if (n === "Object" && o.constructor) n = o.constructor.name;
5290
- if (n === "Map" || n === "Set") return Array.from(n);
5291
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
5292
- }
5293
-
5294
- function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
5295
- var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
5296
- if (it) return (it = it.call(o)).next.bind(it);
5297
- // Fallback for engines without symbol support
5298
- if (Array.isArray(o) || (it = _unsupported_iterable_to_array(o)) || allowArrayLike && o && typeof o.length === "number") {
5299
- if (it) o = it;
5300
- var i = 0;
5301
- return function() {
5302
- if (i >= o.length) return {
5303
- done: true
5304
- };
5305
- return {
5306
- done: false,
5307
- value: o[i++]
5308
- };
5309
- };
5310
- }
5311
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5312
- }
5313
-
5314
- var ShaderCompileResultStatus;
5315
- (function(ShaderCompileResultStatus) {
5316
- ShaderCompileResultStatus[ShaderCompileResultStatus["noShader"] = 0] = "noShader";
5317
- ShaderCompileResultStatus[ShaderCompileResultStatus["success"] = 1] = "success";
5318
- ShaderCompileResultStatus[ShaderCompileResultStatus["fail"] = 2] = "fail";
5319
- ShaderCompileResultStatus[ShaderCompileResultStatus["compiling"] = 3] = "compiling";
5320
- })(ShaderCompileResultStatus || (ShaderCompileResultStatus = {}));
5321
- var GLSLVersion;
5322
- (function(GLSLVersion) {
5323
- GLSLVersion["GLSL1"] = "100";
5324
- GLSLVersion["GLSL3"] = "300 es";
5325
- })(GLSLVersion || (GLSLVersion = {}));
5326
- var ShaderVariant = /*#__PURE__*/ function(EffectsObject) {
5327
- _inherits(ShaderVariant, EffectsObject);
5328
- function ShaderVariant(engine, source) {
5329
- var _this;
5330
- _this = EffectsObject.call(this, engine) || this;
5331
- _this.source = source;
5332
- return _this;
5333
- }
5334
- return ShaderVariant;
5335
- }(EffectsObject);
5336
- var Shader = /*#__PURE__*/ function(EffectsObject) {
5337
- _inherits(Shader, EffectsObject);
5338
- function Shader() {
5339
- return EffectsObject.apply(this, arguments);
5340
- }
5341
- var _proto = Shader.prototype;
5342
- _proto.createVariant = function createVariant(macros) {
5343
- var shaderMacros = [];
5344
- if (macros) {
5345
- for(var _iterator = _create_for_of_iterator_helper_loose(Object.keys(macros)), _step; !(_step = _iterator()).done;){
5346
- var key = _step.value;
5347
- shaderMacros.push([
5348
- key,
5349
- macros[key]
5350
- ]);
5351
- }
5352
- }
5353
- var shaderVariant = this.engine.getShaderLibrary().createShader(this.shaderData, shaderMacros);
5354
- shaderVariant.shader = this;
5355
- return shaderVariant;
5356
- };
5357
- _proto.fromData = function fromData(data) {
5358
- EffectsObject.prototype.fromData.call(this, data);
5359
- this.shaderData = data;
5360
- };
5361
- return Shader;
5362
- }(EffectsObject);
5363
- Shader = __decorate([
5364
- effectsClass(DataType.Shader)
5365
- ], Shader);
5366
-
5367
- var EFFECTS_COPY_MESH_NAME = "effects-internal-copy";
5368
- var COPY_MESH_SHADER_ID = "effects-internal-copy-mesh";
5369
- var COPY_VERTEX_SHADER = "\nprecision highp float;\nattribute vec2 aPos;\nvarying vec2 vTex;\nvoid main(){\n gl_Position = vec4(aPos,0.,1.0);\n vTex = (aPos + vec2(1.0))/2.;\n}";
5370
- var COPY_FRAGMENT_SHADER = "precision mediump float;\nvarying vec2 vTex;\n\n#ifdef DEPTH_TEXTURE\nuniform sampler2D uDepth;\n#extension GL_EXT_frag_depth : enable\n#endif\nvoid main(){\n #ifdef DEPTH_TEXTURE\n gl_FragDepthEXT = texture2D(uDepth,vTex).r;\n #endif\n}\n";
5371
- function createCopyShader(level, writeDepth) {
5372
- var webgl2 = level === 2;
5373
- return {
5374
- name: EFFECTS_COPY_MESH_NAME,
5375
- vertex: COPY_VERTEX_SHADER,
5376
- fragment: COPY_FRAGMENT_SHADER,
5377
- glslVersion: webgl2 ? GLSLVersion.GLSL3 : GLSLVersion.GLSL1,
5378
- macros: [
5379
- [
5380
- "DEPTH_TEXTURE",
5381
- !!writeDepth
5382
- ]
5383
- ],
5384
- // @ts-expect-error
5385
- cacheId: COPY_MESH_SHADER_ID + +writeDepth
5386
- };
5387
- }
5388
-
5389
- /**
5390
- * Helper class to create a WebGL Context
5391
- *
5392
- * @param canvas
5393
- * @param glType
5394
- * @param options
5395
- * @returns
5396
- */ function createGLContext(canvas, glType, options) {
5397
- if (glType === void 0) glType = "webgl";
5398
- var context;
5399
- if (glType === "webgl2") {
5400
- context = canvas.getContext("webgl2", options);
5401
- if (!context) {
5402
- console.debug("WebGL2 context retrieval failed, falling back to WebGL context.");
5403
- }
5404
- }
5405
- if (!context || glType === "webgl") {
5406
- context = canvas.getContext("webgl", options);
5407
- }
5408
- if (!context) {
5409
- throw new Error("This browser does not support WebGL or the WebGL version is incorrect. Please check your WebGL version.");
5410
- }
5411
- return context;
5412
- }
5413
-
5414
- function gpuTimer(gl) {
5415
- var ext = gl.getExtension("EXT_disjoint_timer_query_webgl2");
5416
- if (ext) {
5417
- var query = gl.createQuery();
5418
- var getTime = /*#__PURE__*/ _async_to_generator(function() {
5419
- return __generator(this, function(_state) {
5420
- return [
5421
- 2,
5422
- new Promise(function(resolve, reject) {
5423
- if (query) {
5424
- var available = gl.getQueryParameter(query, gl.QUERY_RESULT_AVAILABLE);
5425
- var disjoint = gl.getParameter(ext.GPU_DISJOINT_EXT);
5426
- if (available && !disjoint) {
5427
- // See how much time the rendering of the object took in nanoseconds.
5428
- var timeElapsed = gl.getQueryParameter(query, gl.QUERY_RESULT); // Do something useful with the time. Note that care should be
5429
- // taken to use all significant bits of the result, not just the
5430
- // least significant 32 bits.
5431
- resolve(timeElapsed / 1000 / 1000);
5432
- }
5433
- if (available || disjoint) {
5434
- // Clean up the query object.
5435
- gl.deleteQuery(query); // Don't re-enter this polling loop.
5436
- query = null;
5437
- }
5438
- available !== null && query && window.setTimeout(function() {
5439
- getTime().then(resolve).catch;
5440
- }, 1);
5441
- }
5442
- })
5443
- ];
5444
- });
5445
- });
5446
- if (!query) {
5447
- return;
5448
- }
5449
- return {
5450
- begin: function() {
5451
- query && gl.beginQuery(ext.TIME_ELAPSED_EXT, query);
5452
- },
5453
- end: function() {
5454
- gl.endQuery(ext.TIME_ELAPSED_EXT);
5455
- },
5456
- getTime: getTime
5457
- };
5458
- }
5459
- }
5460
-
5461
- var initErrors = [];
5462
- // @ts-expect-error
5463
- var glContext = {};
5464
- if (!initErrors.length) {
5465
- initGLContext();
5466
- }
5467
- function initGLContext() {
5468
- // 重要:iOS 9/10 低版本需要拷贝 gl context 的 prototype,要不然会有属性值的缺失
5469
- if (typeof WebGL2RenderingContext === "function") {
5470
- copy(WebGL2RenderingContext);
5471
- } else if (typeof WebGLRenderingContext !== "undefined") {
5472
- copy(WebGLRenderingContext);
5473
- copy(WebGLRenderingContext.prototype);
5474
- } else {
5475
- initErrors.push(// iOS 16 lockdown mode
5476
- "iOS16 lockdown mode, WebGL Constants not in global");
5477
- }
5478
- if (!initErrors.length && !("HALF_FLOAT" in glContext)) {
5479
- // @ts-expect-error set default value
5480
- glContext["HALF_FLOAT"] = 5131;
5481
- }
5482
- }
5483
- function isWebGL2(gl) {
5484
- return typeof WebGL2RenderingContext !== "undefined" && gl.constructor.name === "WebGL2RenderingContext";
5485
- }
5486
- function copy(target) {
5487
- for(var name in target){
5488
- if (/^[A-Z_]/.test(name)) {
5489
- // @ts-expect-error safe to assign
5490
- glContext[name] = target[name];
5491
- }
5492
- }
5493
- }
5494
- function vertexFormatType2GLType(formatType) {
5495
- switch(formatType){
5496
- case VertexFormatType.Float32:
5497
- return WebGLRenderingContext["FLOAT"];
5498
- case VertexFormatType.Int16:
5499
- return WebGLRenderingContext["SHORT"];
5500
- case VertexFormatType.Int8:
5501
- return WebGLRenderingContext["BYTE"];
5502
- case VertexFormatType.UInt16:
5503
- return WebGLRenderingContext["UNSIGNED_SHORT"];
5504
- case VertexFormatType.UInt8:
5505
- return WebGLRenderingContext["UNSIGNED_BYTE"];
5506
- default:
5507
- return WebGLRenderingContext["FLOAT"];
5508
- }
5509
- }
5510
- function glType2VertexFormatType(webglType) {
5511
- switch(webglType){
5512
- case WebGLRenderingContext["FLOAT"]:
5513
- return VertexFormatType.Float32;
5514
- case WebGLRenderingContext["SHORT"]:
5515
- return VertexFormatType.Int16;
5516
- case WebGLRenderingContext["BYTE"]:
5517
- return VertexFormatType.Int8;
5518
- case WebGLRenderingContext["UNSIGNED_SHORT"]:
5519
- return VertexFormatType.UInt16;
5520
- case WebGLRenderingContext["UNSIGNED_BYTE"]:
5521
- return VertexFormatType.UInt8;
5522
- default:
5523
- return VertexFormatType.Float32;
5524
- }
5525
- }
5526
-
5527
- var ShaderType;
5528
- (function(ShaderType) {
5529
- ShaderType[ShaderType["vertex"] = 0] = "vertex";
5530
- ShaderType[ShaderType["fragment"] = 1] = "fragment";
5531
- })(ShaderType || (ShaderType = {}));
5532
-
5533
- function valIfUndefined(val, def) {
5534
- if (val === undefined || val === null) {
5535
- return def;
5536
- }
5537
- return val;
5538
- }
5539
- function getPreMultiAlpha(blending) {
5540
- switch(blending){
5541
- case BlendingMode.ALPHA:
5542
- return 1;
5543
- case BlendingMode.ADD:
5544
- return 1;
5545
- case BlendingMode.SUBTRACTION:
5546
- return 1;
5547
- case BlendingMode.STRONG_LIGHT:
5548
- return 1;
5549
- case BlendingMode.WEAK_LIGHT:
5550
- return 1;
5551
- case BlendingMode.SUPERPOSITION:
5552
- return 2;
5553
- case BlendingMode.BRIGHTNESS:
5554
- return 3;
5555
- case BlendingMode.MULTIPLY:
5556
- return 0;
5557
- default:
5558
- // 处理undefined
5559
- return 1;
5560
- }
5561
- }
5562
- function setBlendMode(material, blendMode) {
5563
- switch(blendMode){
5564
- case undefined:
5565
- material.blendFunction = [
5566
- glContext.ONE,
5567
- glContext.ONE_MINUS_SRC_ALPHA,
5568
- glContext.ONE,
5569
- glContext.ONE_MINUS_SRC_ALPHA
5570
- ];
5571
- break;
5572
- case BlendingMode.ALPHA:
5573
- material.blendFunction = [
5574
- glContext.ONE,
5575
- glContext.ONE_MINUS_SRC_ALPHA,
5576
- glContext.ONE,
5577
- glContext.ONE_MINUS_SRC_ALPHA
5578
- ];
5579
- break;
5580
- case BlendingMode.ADD:
5581
- material.blendFunction = [
5582
- glContext.ONE,
5583
- glContext.ONE,
5584
- glContext.ONE,
5585
- glContext.ONE
5586
- ];
5587
- break;
5588
- case BlendingMode.SUBTRACTION:
5589
- material.blendFunction = [
5590
- glContext.ONE,
5591
- glContext.ONE,
5592
- glContext.ZERO,
5593
- glContext.ONE
5594
- ];
5595
- material.blendEquation = [
5596
- glContext.FUNC_REVERSE_SUBTRACT,
5597
- glContext.FUNC_REVERSE_SUBTRACT
5598
- ];
5599
- break;
5600
- case BlendingMode.SUPERPOSITION:
5601
- material.blendFunction = [
5602
- glContext.ONE,
5603
- glContext.ONE,
5604
- glContext.ONE,
5605
- glContext.ONE
5606
- ];
5607
- break;
5608
- case BlendingMode.MULTIPLY:
5609
- material.blendFunction = [
5610
- glContext.DST_COLOR,
5611
- glContext.ONE_MINUS_SRC_ALPHA,
5612
- glContext.DST_COLOR,
5613
- glContext.ONE_MINUS_SRC_ALPHA
5614
- ];
5615
- break;
5616
- case BlendingMode.BRIGHTNESS:
5617
- material.blendFunction = [
5618
- glContext.ONE,
5619
- glContext.ONE_MINUS_SRC_ALPHA,
5620
- glContext.ONE,
5621
- glContext.ONE_MINUS_SRC_ALPHA
5622
- ];
5623
- break;
5624
- case BlendingMode.STRONG_LIGHT:
5625
- material.blendFunction = [
5626
- glContext.DST_COLOR,
5627
- glContext.DST_ALPHA,
5628
- glContext.ZERO,
5629
- glContext.ONE
5630
- ];
5631
- break;
5632
- case BlendingMode.WEAK_LIGHT:
5633
- material.blendFunction = [
5634
- glContext.DST_COLOR,
5635
- glContext.ZERO,
5636
- glContext.ZERO,
5637
- glContext.ONE
5638
- ];
5639
- break;
5640
- default:
5641
- console.warn("BlendMode " + blendMode + " not in specification, please set blend params separately.");
5642
- }
5643
- }
5644
- function setSideMode(material, side) {
5645
- if (side === SideMode.DOUBLE) {
5646
- material.culling = false;
5647
- } else {
5648
- material.culling = true;
5649
- material.frontFace = glContext.CW;
5650
- material.cullFace = side === SideMode.BACK ? glContext.BACK : glContext.FRONT;
5651
- }
5652
- }
5653
- function setMaskMode(material, maskMode) {
5654
- switch(maskMode){
5655
- case undefined:
5656
- material.stencilTest = false;
5657
- break;
5658
- case MaskMode.MASK:
5659
- material.stencilTest = true;
5660
- material.stencilFunc = [
5661
- glContext.ALWAYS,
5662
- glContext.ALWAYS
5663
- ];
5664
- material.stencilOpZPass = [
5665
- glContext.REPLACE,
5666
- glContext.REPLACE
5667
- ];
5668
- break;
5669
- case MaskMode.OBSCURED:
5670
- material.stencilTest = true;
5671
- material.stencilFunc = [
5672
- glContext.EQUAL,
5673
- glContext.EQUAL
5674
- ];
5675
- break;
5676
- case MaskMode.REVERSE_OBSCURED:
5677
- material.stencilTest = true;
5678
- material.stencilFunc = [
5679
- glContext.NOTEQUAL,
5680
- glContext.NOTEQUAL
5681
- ];
5682
- break;
5683
- case MaskMode.NONE:
5684
- material.stencilTest = false;
5685
- break;
5686
- default:
5687
- console.warn("MaskMode " + maskMode + " not in specification, please set stencil params seperately.");
5688
- }
5689
- }
5690
-
5691
5315
  function _extends() {
5692
5316
  _extends = Object.assign || function assign(target) {
5693
5317
  for(var i = 1; i < arguments.length; i++){
@@ -6098,7 +5722,12 @@ function _loadVideo() {
6098
5722
  });
6099
5723
  return _loadVideo.apply(this, arguments);
6100
5724
  }
6101
- function loadMedia(url, loadFn) {
5725
+ /**
5726
+ * 异步加载一个媒体文件
5727
+ * @param url
5728
+ * @param loadFn
5729
+ * @returns
5730
+ */ function loadMedia(url, loadFn) {
6102
5731
  return _loadMedia.apply(this, arguments);
6103
5732
  }
6104
5733
  function _loadMedia() {
@@ -6260,6 +5889,144 @@ function _loadMipmapImage() {
6260
5889
  return _loadMipmapImage.apply(this, arguments);
6261
5890
  }
6262
5891
 
5892
+ /**
5893
+ * Helper class to create a WebGL Context
5894
+ *
5895
+ * @param canvas
5896
+ * @param glType
5897
+ * @param options
5898
+ * @returns
5899
+ */ function createGLContext(canvas, glType, options) {
5900
+ if (glType === void 0) glType = "webgl";
5901
+ var context;
5902
+ if (glType === "webgl2") {
5903
+ context = canvas.getContext("webgl2", options);
5904
+ if (!context) {
5905
+ console.debug("WebGL2 context retrieval failed, falling back to WebGL context.");
5906
+ }
5907
+ }
5908
+ if (!context || glType === "webgl") {
5909
+ context = canvas.getContext("webgl", options);
5910
+ }
5911
+ if (!context) {
5912
+ throw new Error("This browser does not support WebGL or the WebGL version is incorrect. Please check your WebGL version.");
5913
+ }
5914
+ return context;
5915
+ }
5916
+
5917
+ function gpuTimer(gl) {
5918
+ var ext = gl.getExtension("EXT_disjoint_timer_query_webgl2");
5919
+ if (ext) {
5920
+ var query = gl.createQuery();
5921
+ var getTime = /*#__PURE__*/ _async_to_generator(function() {
5922
+ return __generator(this, function(_state) {
5923
+ return [
5924
+ 2,
5925
+ new Promise(function(resolve, reject) {
5926
+ if (query) {
5927
+ var available = gl.getQueryParameter(query, gl.QUERY_RESULT_AVAILABLE);
5928
+ var disjoint = gl.getParameter(ext.GPU_DISJOINT_EXT);
5929
+ if (available && !disjoint) {
5930
+ // See how much time the rendering of the object took in nanoseconds.
5931
+ var timeElapsed = gl.getQueryParameter(query, gl.QUERY_RESULT); // Do something useful with the time. Note that care should be
5932
+ // taken to use all significant bits of the result, not just the
5933
+ // least significant 32 bits.
5934
+ resolve(timeElapsed / 1000 / 1000);
5935
+ }
5936
+ if (available || disjoint) {
5937
+ // Clean up the query object.
5938
+ gl.deleteQuery(query); // Don't re-enter this polling loop.
5939
+ query = null;
5940
+ }
5941
+ available !== null && query && window.setTimeout(function() {
5942
+ getTime().then(resolve).catch;
5943
+ }, 1);
5944
+ }
5945
+ })
5946
+ ];
5947
+ });
5948
+ });
5949
+ if (!query) {
5950
+ return;
5951
+ }
5952
+ return {
5953
+ begin: function() {
5954
+ query && gl.beginQuery(ext.TIME_ELAPSED_EXT, query);
5955
+ },
5956
+ end: function() {
5957
+ gl.endQuery(ext.TIME_ELAPSED_EXT);
5958
+ },
5959
+ getTime: getTime
5960
+ };
5961
+ }
5962
+ }
5963
+
5964
+ var initErrors = [];
5965
+ // @ts-expect-error
5966
+ var glContext = {};
5967
+ if (!initErrors.length) {
5968
+ initGLContext();
5969
+ }
5970
+ function initGLContext() {
5971
+ // 重要:iOS 9/10 低版本需要拷贝 gl context 的 prototype,要不然会有属性值的缺失
5972
+ if (typeof WebGL2RenderingContext === "function") {
5973
+ copy(WebGL2RenderingContext);
5974
+ } else if (typeof WebGLRenderingContext !== "undefined") {
5975
+ copy(WebGLRenderingContext);
5976
+ copy(WebGLRenderingContext.prototype);
5977
+ } else {
5978
+ initErrors.push(// iOS 16 lockdown mode
5979
+ "iOS16 lockdown mode, WebGL Constants not in global");
5980
+ }
5981
+ if (!initErrors.length && !("HALF_FLOAT" in glContext)) {
5982
+ // @ts-expect-error set default value
5983
+ glContext["HALF_FLOAT"] = 5131;
5984
+ }
5985
+ }
5986
+ function isWebGL2(gl) {
5987
+ return typeof WebGL2RenderingContext !== "undefined" && gl.constructor.name === "WebGL2RenderingContext";
5988
+ }
5989
+ function copy(target) {
5990
+ for(var name in target){
5991
+ if (/^[A-Z_]/.test(name)) {
5992
+ // @ts-expect-error safe to assign
5993
+ glContext[name] = target[name];
5994
+ }
5995
+ }
5996
+ }
5997
+ function vertexFormatType2GLType(formatType) {
5998
+ switch(formatType){
5999
+ case VertexFormatType.Float32:
6000
+ return WebGLRenderingContext["FLOAT"];
6001
+ case VertexFormatType.Int16:
6002
+ return WebGLRenderingContext["SHORT"];
6003
+ case VertexFormatType.Int8:
6004
+ return WebGLRenderingContext["BYTE"];
6005
+ case VertexFormatType.UInt16:
6006
+ return WebGLRenderingContext["UNSIGNED_SHORT"];
6007
+ case VertexFormatType.UInt8:
6008
+ return WebGLRenderingContext["UNSIGNED_BYTE"];
6009
+ default:
6010
+ return WebGLRenderingContext["FLOAT"];
6011
+ }
6012
+ }
6013
+ function glType2VertexFormatType(webglType) {
6014
+ switch(webglType){
6015
+ case WebGLRenderingContext["FLOAT"]:
6016
+ return VertexFormatType.Float32;
6017
+ case WebGLRenderingContext["SHORT"]:
6018
+ return VertexFormatType.Int16;
6019
+ case WebGLRenderingContext["BYTE"]:
6020
+ return VertexFormatType.Int8;
6021
+ case WebGLRenderingContext["UNSIGNED_SHORT"]:
6022
+ return VertexFormatType.UInt16;
6023
+ case WebGLRenderingContext["UNSIGNED_BYTE"]:
6024
+ return VertexFormatType.UInt8;
6025
+ default:
6026
+ return VertexFormatType.Float32;
6027
+ }
6028
+ }
6029
+
6263
6030
  var seed$a = 1;
6264
6031
  /**
6265
6032
  * Texture 抽象类
@@ -6894,6 +6661,280 @@ function setDefaultTextureFactory(factory) {
6894
6661
  g = factory;
6895
6662
  }
6896
6663
 
6664
+ function _array_like_to_array(arr, len) {
6665
+ if (len == null || len > arr.length) len = arr.length;
6666
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
6667
+ return arr2;
6668
+ }
6669
+
6670
+ function _unsupported_iterable_to_array(o, minLen) {
6671
+ if (!o) return;
6672
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
6673
+ var n = Object.prototype.toString.call(o).slice(8, -1);
6674
+ if (n === "Object" && o.constructor) n = o.constructor.name;
6675
+ if (n === "Map" || n === "Set") return Array.from(n);
6676
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
6677
+ }
6678
+
6679
+ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
6680
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
6681
+ if (it) return (it = it.call(o)).next.bind(it);
6682
+ // Fallback for engines without symbol support
6683
+ if (Array.isArray(o) || (it = _unsupported_iterable_to_array(o)) || allowArrayLike && o && typeof o.length === "number") {
6684
+ if (it) o = it;
6685
+ var i = 0;
6686
+ return function() {
6687
+ if (i >= o.length) return {
6688
+ done: true
6689
+ };
6690
+ return {
6691
+ done: false,
6692
+ value: o[i++]
6693
+ };
6694
+ };
6695
+ }
6696
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
6697
+ }
6698
+
6699
+ var ShaderCompileResultStatus;
6700
+ (function(ShaderCompileResultStatus) {
6701
+ ShaderCompileResultStatus[ShaderCompileResultStatus["noShader"] = 0] = "noShader";
6702
+ ShaderCompileResultStatus[ShaderCompileResultStatus["success"] = 1] = "success";
6703
+ ShaderCompileResultStatus[ShaderCompileResultStatus["fail"] = 2] = "fail";
6704
+ ShaderCompileResultStatus[ShaderCompileResultStatus["compiling"] = 3] = "compiling";
6705
+ })(ShaderCompileResultStatus || (ShaderCompileResultStatus = {}));
6706
+ var GLSLVersion;
6707
+ (function(GLSLVersion) {
6708
+ GLSLVersion["GLSL1"] = "100";
6709
+ GLSLVersion["GLSL3"] = "300 es";
6710
+ })(GLSLVersion || (GLSLVersion = {}));
6711
+ var ShaderVariant = /*#__PURE__*/ function(EffectsObject) {
6712
+ _inherits(ShaderVariant, EffectsObject);
6713
+ function ShaderVariant(engine, source) {
6714
+ var _this;
6715
+ _this = EffectsObject.call(this, engine) || this;
6716
+ _this.source = source;
6717
+ return _this;
6718
+ }
6719
+ return ShaderVariant;
6720
+ }(EffectsObject);
6721
+ var Shader = /*#__PURE__*/ function(EffectsObject) {
6722
+ _inherits(Shader, EffectsObject);
6723
+ function Shader() {
6724
+ return EffectsObject.apply(this, arguments);
6725
+ }
6726
+ var _proto = Shader.prototype;
6727
+ _proto.createVariant = function createVariant(macros) {
6728
+ var shaderMacros = [];
6729
+ if (macros) {
6730
+ for(var _iterator = _create_for_of_iterator_helper_loose(Object.keys(macros)), _step; !(_step = _iterator()).done;){
6731
+ var key = _step.value;
6732
+ shaderMacros.push([
6733
+ key,
6734
+ macros[key]
6735
+ ]);
6736
+ }
6737
+ }
6738
+ var shaderVariant = this.engine.getShaderLibrary().createShader(this.shaderData, shaderMacros);
6739
+ shaderVariant.shader = this;
6740
+ return shaderVariant;
6741
+ };
6742
+ _proto.fromData = function fromData(data) {
6743
+ EffectsObject.prototype.fromData.call(this, data);
6744
+ this.shaderData = data;
6745
+ };
6746
+ return Shader;
6747
+ }(EffectsObject);
6748
+ Shader = __decorate([
6749
+ effectsClass(DataType.Shader)
6750
+ ], Shader);
6751
+
6752
+ var EFFECTS_COPY_MESH_NAME = "effects-internal-copy";
6753
+ var COPY_MESH_SHADER_ID = "effects-internal-copy-mesh";
6754
+ var COPY_VERTEX_SHADER = "\nprecision highp float;\nattribute vec2 aPos;\nvarying vec2 vTex;\nvoid main(){\n gl_Position = vec4(aPos,0.,1.0);\n vTex = (aPos + vec2(1.0))/2.;\n}";
6755
+ var COPY_FRAGMENT_SHADER = "precision mediump float;\nvarying vec2 vTex;\n\n#ifdef DEPTH_TEXTURE\nuniform sampler2D uDepth;\n#extension GL_EXT_frag_depth : enable\n#endif\nvoid main(){\n #ifdef DEPTH_TEXTURE\n gl_FragDepthEXT = texture2D(uDepth,vTex).r;\n #endif\n}\n";
6756
+ function createCopyShader(level, writeDepth) {
6757
+ var webgl2 = level === 2;
6758
+ return {
6759
+ name: EFFECTS_COPY_MESH_NAME,
6760
+ vertex: COPY_VERTEX_SHADER,
6761
+ fragment: COPY_FRAGMENT_SHADER,
6762
+ glslVersion: webgl2 ? GLSLVersion.GLSL3 : GLSLVersion.GLSL1,
6763
+ macros: [
6764
+ [
6765
+ "DEPTH_TEXTURE",
6766
+ !!writeDepth
6767
+ ]
6768
+ ],
6769
+ // @ts-expect-error
6770
+ cacheId: COPY_MESH_SHADER_ID + +writeDepth
6771
+ };
6772
+ }
6773
+
6774
+ var ShaderType;
6775
+ (function(ShaderType) {
6776
+ ShaderType[ShaderType["vertex"] = 0] = "vertex";
6777
+ ShaderType[ShaderType["fragment"] = 1] = "fragment";
6778
+ })(ShaderType || (ShaderType = {}));
6779
+
6780
+ function valIfUndefined(val, def) {
6781
+ if (val === undefined || val === null) {
6782
+ return def;
6783
+ }
6784
+ return val;
6785
+ }
6786
+ function getPreMultiAlpha(blending) {
6787
+ switch(blending){
6788
+ case BlendingMode.ALPHA:
6789
+ return 1;
6790
+ case BlendingMode.ADD:
6791
+ return 1;
6792
+ case BlendingMode.SUBTRACTION:
6793
+ return 1;
6794
+ case BlendingMode.STRONG_LIGHT:
6795
+ return 1;
6796
+ case BlendingMode.WEAK_LIGHT:
6797
+ return 1;
6798
+ case BlendingMode.SUPERPOSITION:
6799
+ return 2;
6800
+ case BlendingMode.BRIGHTNESS:
6801
+ return 3;
6802
+ case BlendingMode.MULTIPLY:
6803
+ return 0;
6804
+ default:
6805
+ // 处理undefined
6806
+ return 1;
6807
+ }
6808
+ }
6809
+ function setBlendMode(material, blendMode) {
6810
+ switch(blendMode){
6811
+ case undefined:
6812
+ material.blendFunction = [
6813
+ glContext.ONE,
6814
+ glContext.ONE_MINUS_SRC_ALPHA,
6815
+ glContext.ONE,
6816
+ glContext.ONE_MINUS_SRC_ALPHA
6817
+ ];
6818
+ break;
6819
+ case BlendingMode.ALPHA:
6820
+ material.blendFunction = [
6821
+ glContext.ONE,
6822
+ glContext.ONE_MINUS_SRC_ALPHA,
6823
+ glContext.ONE,
6824
+ glContext.ONE_MINUS_SRC_ALPHA
6825
+ ];
6826
+ break;
6827
+ case BlendingMode.ADD:
6828
+ material.blendFunction = [
6829
+ glContext.ONE,
6830
+ glContext.ONE,
6831
+ glContext.ONE,
6832
+ glContext.ONE
6833
+ ];
6834
+ break;
6835
+ case BlendingMode.SUBTRACTION:
6836
+ material.blendFunction = [
6837
+ glContext.ONE,
6838
+ glContext.ONE,
6839
+ glContext.ZERO,
6840
+ glContext.ONE
6841
+ ];
6842
+ material.blendEquation = [
6843
+ glContext.FUNC_REVERSE_SUBTRACT,
6844
+ glContext.FUNC_REVERSE_SUBTRACT
6845
+ ];
6846
+ break;
6847
+ case BlendingMode.SUPERPOSITION:
6848
+ material.blendFunction = [
6849
+ glContext.ONE,
6850
+ glContext.ONE,
6851
+ glContext.ONE,
6852
+ glContext.ONE
6853
+ ];
6854
+ break;
6855
+ case BlendingMode.MULTIPLY:
6856
+ material.blendFunction = [
6857
+ glContext.DST_COLOR,
6858
+ glContext.ONE_MINUS_SRC_ALPHA,
6859
+ glContext.DST_COLOR,
6860
+ glContext.ONE_MINUS_SRC_ALPHA
6861
+ ];
6862
+ break;
6863
+ case BlendingMode.BRIGHTNESS:
6864
+ material.blendFunction = [
6865
+ glContext.ONE,
6866
+ glContext.ONE_MINUS_SRC_ALPHA,
6867
+ glContext.ONE,
6868
+ glContext.ONE_MINUS_SRC_ALPHA
6869
+ ];
6870
+ break;
6871
+ case BlendingMode.STRONG_LIGHT:
6872
+ material.blendFunction = [
6873
+ glContext.DST_COLOR,
6874
+ glContext.DST_ALPHA,
6875
+ glContext.ZERO,
6876
+ glContext.ONE
6877
+ ];
6878
+ break;
6879
+ case BlendingMode.WEAK_LIGHT:
6880
+ material.blendFunction = [
6881
+ glContext.DST_COLOR,
6882
+ glContext.ZERO,
6883
+ glContext.ZERO,
6884
+ glContext.ONE
6885
+ ];
6886
+ break;
6887
+ default:
6888
+ console.warn("BlendMode " + blendMode + " not in specification, please set blend params separately.");
6889
+ }
6890
+ }
6891
+ function setSideMode(material, side) {
6892
+ if (side === SideMode.DOUBLE) {
6893
+ material.culling = false;
6894
+ } else {
6895
+ material.culling = true;
6896
+ material.frontFace = glContext.CW;
6897
+ material.cullFace = side === SideMode.BACK ? glContext.BACK : glContext.FRONT;
6898
+ }
6899
+ }
6900
+ function setMaskMode(material, maskMode) {
6901
+ switch(maskMode){
6902
+ case undefined:
6903
+ material.stencilTest = false;
6904
+ break;
6905
+ case MaskMode.MASK:
6906
+ material.stencilTest = true;
6907
+ material.stencilFunc = [
6908
+ glContext.ALWAYS,
6909
+ glContext.ALWAYS
6910
+ ];
6911
+ material.stencilOpZPass = [
6912
+ glContext.REPLACE,
6913
+ glContext.REPLACE
6914
+ ];
6915
+ break;
6916
+ case MaskMode.OBSCURED:
6917
+ material.stencilTest = true;
6918
+ material.stencilFunc = [
6919
+ glContext.EQUAL,
6920
+ glContext.EQUAL
6921
+ ];
6922
+ break;
6923
+ case MaskMode.REVERSE_OBSCURED:
6924
+ material.stencilTest = true;
6925
+ material.stencilFunc = [
6926
+ glContext.NOTEQUAL,
6927
+ glContext.NOTEQUAL
6928
+ ];
6929
+ break;
6930
+ case MaskMode.NONE:
6931
+ material.stencilTest = false;
6932
+ break;
6933
+ default:
6934
+ console.warn("MaskMode " + maskMode + " not in specification, please set stencil params seperately.");
6935
+ }
6936
+ }
6937
+
6897
6938
  /**
6898
6939
  * 引擎接入暂时不需要实现
6899
6940
  */ var MaterialDataBlock = /*#__PURE__*/ function() {
@@ -11717,25 +11758,35 @@ function numberToFix(a, fixed) {
11717
11758
  }
11718
11759
 
11719
11760
  var keyframeInfo = {
11761
+ pointIndexCache: {
11762
+ xIndex: 0,
11763
+ yIndex: 0
11764
+ },
11720
11765
  /**
11721
11766
  * 根据不同关键帧类型,获取位于曲线上的点
11722
11767
  */ getPointInCurve: function getPointInCurve(keyframe) {
11723
11768
  keyframe[0]; var data = keyframe[1];
11724
- var _this_getPointIndexInCurve = this.getPointIndexInCurve(keyframe), xIndex = _this_getPointIndexInCurve.xIndex, yIndex = _this_getPointIndexInCurve.yIndex;
11769
+ var _this_getPointIndexInCurve = this.getPointIndexInCurve(keyframe, this.pointIndexCache), xIndex = _this_getPointIndexInCurve.xIndex, yIndex = _this_getPointIndexInCurve.yIndex;
11725
11770
  var time = data[xIndex];
11726
11771
  var value = data[yIndex];
11727
11772
  return new Vector2(time, value);
11728
11773
  },
11729
11774
  /**
11730
11775
  * 根据不同关键帧类型,获取位于曲线上的点的索引
11731
- */ getPointIndexInCurve: function getPointIndexInCurve(keyframe) {
11776
+ */ getPointIndexInCurve: function getPointIndexInCurve(keyframe, res) {
11732
11777
  var type = keyframe[0], markType = keyframe[2];
11733
11778
  // 不同类型,存放的时间不同
11734
11779
  var index = type === BezierKeyframeType.LINE ? 0 : type === BezierKeyframeType.EASE_OUT ? 0 : type === BezierKeyframeType.EASE_IN ? 2 : type === BezierKeyframeType.EASE ? 2 : type === BezierKeyframeType.HOLD ? markType === BezierKeyframeType.EASE_IN ? 2 : 0 : 0;
11735
- return {
11736
- xIndex: index,
11737
- yIndex: index + 1
11738
- };
11780
+ if (res) {
11781
+ res.xIndex = index;
11782
+ res.yIndex = index + 1;
11783
+ return res;
11784
+ } else {
11785
+ return {
11786
+ xIndex: index,
11787
+ yIndex: index + 1
11788
+ };
11789
+ }
11739
11790
  },
11740
11791
  /**
11741
11792
  * 关键帧左侧是否为缓动类型(否则为线段)
@@ -12642,6 +12693,8 @@ var BezierCurve = /*#__PURE__*/ function(ValueGetter) {
12642
12693
  timeEnd: Number(e.x)
12643
12694
  };
12644
12695
  }
12696
+ this.startKeyframe = keyframes[0];
12697
+ this.endKeyframe = keyframes[keyframes.length - 1];
12645
12698
  this.keyTimeData = Object.keys(this.curveMap);
12646
12699
  };
12647
12700
  _proto.getValue = function getValue(time) {
@@ -12649,12 +12702,18 @@ var BezierCurve = /*#__PURE__*/ function(ValueGetter) {
12649
12702
  var keyTimeData = this.keyTimeData;
12650
12703
  var keyTimeStart = this.curveMap[keyTimeData[0]].timeStart;
12651
12704
  var keyTimeEnd = this.curveMap[keyTimeData[keyTimeData.length - 1]].timeEnd;
12652
- // const keyTimeStart = Number(keyTimeData[0].split('&')[0]);
12653
- // const keyTimeEnd = Number(keyTimeData[keyTimeData.length - 1].split('&')[1]);
12654
12705
  if (time <= keyTimeStart) {
12706
+ if (this.startKeyframe[0] === BezierKeyframeType.LINE || this.startKeyframe[0] === BezierKeyframeType.HOLD) {
12707
+ keyframeInfo.getPointIndexInCurve(this.startKeyframe, keyframeInfo.pointIndexCache);
12708
+ return this.endKeyframe[1][keyframeInfo.pointIndexCache.yIndex];
12709
+ }
12655
12710
  return this.getCurveValue(keyTimeData[0], keyTimeStart);
12656
12711
  }
12657
12712
  if (time >= keyTimeEnd) {
12713
+ if (this.endKeyframe[0] === BezierKeyframeType.LINE || this.endKeyframe[0] === BezierKeyframeType.HOLD) {
12714
+ keyframeInfo.getPointIndexInCurve(this.endKeyframe, keyframeInfo.pointIndexCache);
12715
+ return this.endKeyframe[1][keyframeInfo.pointIndexCache.yIndex];
12716
+ }
12658
12717
  return this.getCurveValue(keyTimeData[keyTimeData.length - 1], keyTimeEnd);
12659
12718
  }
12660
12719
  for(var i = 0; i < keyTimeData.length; i++){
@@ -13086,6 +13145,27 @@ var Vector4Curve = /*#__PURE__*/ function(ValueGetter) {
13086
13145
  };
13087
13146
  return Vector4Curve;
13088
13147
  }(ValueGetter);
13148
+ var Vector2Curve = /*#__PURE__*/ function(ValueGetter) {
13149
+ _inherits(Vector2Curve, ValueGetter);
13150
+ function Vector2Curve() {
13151
+ var _this;
13152
+ _this = ValueGetter.apply(this, arguments) || this;
13153
+ _this.value = new Vector2();
13154
+ return _this;
13155
+ }
13156
+ var _proto = Vector2Curve.prototype;
13157
+ _proto.onCreate = function onCreate(arg) {
13158
+ this.xCurve = createValueGetter(arg[0]);
13159
+ this.yCurve = createValueGetter(arg[1]);
13160
+ };
13161
+ _proto.getValue = function getValue(t) {
13162
+ var x = this.xCurve.getValue(t);
13163
+ var y = this.yCurve.getValue(t);
13164
+ this.value.set(x, y);
13165
+ return this.value;
13166
+ };
13167
+ return Vector2Curve;
13168
+ }(ValueGetter);
13089
13169
 
13090
13170
  var SPRITE_VERTEX_STRIDE = 6;
13091
13171
  var SEMANTIC_PRE_COLOR_ATTACHMENT_0 = "PRE_COLOR_0";
@@ -13149,6 +13229,8 @@ var map$1 = (_obj$4 = {}, _obj$4[ValueType.RANDOM] = function(props) {
13149
13229
  return new ColorCurve(props);
13150
13230
  }, _obj$4[ValueType.VECTOR4_CURVE] = function(props) {
13151
13231
  return new Vector4Curve(props);
13232
+ }, _obj$4[ValueType.VECTOR2_CURVE] = function(props) {
13233
+ return new Vector2Curve(props);
13152
13234
  }, _obj$4);
13153
13235
  function createValueGetter(args) {
13154
13236
  if (!args || !isNaN(+args)) {
@@ -13273,13 +13355,39 @@ var ColorCurve = /*#__PURE__*/ function(ValueGetter) {
13273
13355
  this.color = color;
13274
13356
  this.material.setVector4("_Color", new Vector4().setFromArray(color));
13275
13357
  };
13276
- /**
13277
- * 设置当前 Mesh 的纹理
13278
- * @since 2.0.0
13279
- * @param texture - 纹理对象
13280
- */ _proto.setTexture = function setTexture(texture) {
13281
- this.renderer.texture = texture;
13282
- this.material.setTexture("_MainTex", texture);
13358
+ _proto.setTexture = function setTexture(input) {
13359
+ var _this = this;
13360
+ return _async_to_generator(function() {
13361
+ var texture;
13362
+ return __generator(this, function(_state) {
13363
+ switch(_state.label){
13364
+ case 0:
13365
+ if (!(typeof input === "string")) return [
13366
+ 3,
13367
+ 2
13368
+ ];
13369
+ return [
13370
+ 4,
13371
+ Texture.fromImage(input, _this.item.engine)
13372
+ ];
13373
+ case 1:
13374
+ texture = _state.sent();
13375
+ return [
13376
+ 3,
13377
+ 3
13378
+ ];
13379
+ case 2:
13380
+ texture = input;
13381
+ _state.label = 3;
13382
+ case 3:
13383
+ _this.renderer.texture = texture;
13384
+ _this.material.setTexture("_MainTex", texture);
13385
+ return [
13386
+ 2
13387
+ ];
13388
+ }
13389
+ });
13390
+ })();
13283
13391
  };
13284
13392
  /**
13285
13393
  * @internal
@@ -13541,6 +13649,8 @@ function getImageItemRenderInfo(item) {
13541
13649
  };
13542
13650
  }
13543
13651
 
13652
+ // Based on:
13653
+ // https://github.com/pixijs/pixijs/blob/dev/src/maths/shapes/ShapePrimitive.ts
13544
13654
  var ShapePrimitive = function ShapePrimitive() {
13545
13655
  };
13546
13656
 
@@ -14646,6 +14756,7 @@ function triangulate(contours) {
14646
14756
  return triangleVerts;
14647
14757
  }
14648
14758
 
14759
+ // Based on:
14649
14760
  /**
14650
14761
  * A class to define a shape via user defined coordinates.
14651
14762
  */ var Polygon = /*#__PURE__*/ function(ShapePrimitive) {
@@ -14745,12 +14856,13 @@ function triangulate(contours) {
14745
14856
  var triangles = triangulate([
14746
14857
  points
14747
14858
  ]);
14859
+ var indexStart = vertices.length / 2;
14748
14860
  for(var i = 0; i < triangles.length; i++){
14749
- vertices[verticesOffset + i] = triangles[i];
14861
+ vertices[verticesOffset * 2 + i] = triangles[i];
14750
14862
  }
14751
14863
  var vertexCount = triangles.length / 2;
14752
14864
  for(var i1 = 0; i1 < vertexCount; i1++){
14753
- indices[indicesOffset + i1] = i1;
14865
+ indices[indicesOffset + i1] = indexStart + i1;
14754
14866
  }
14755
14867
  };
14756
14868
  _create_class(Polygon, [
@@ -14872,6 +14984,7 @@ function recursive(x1, y1, x2, y2, x3, y3, x4, y4, points, distanceTolerance, le
14872
14984
  recursive(x1234, y1234, x234, y234, x34, y34, x4, y4, points, distanceTolerance, level + 1);
14873
14985
  }
14874
14986
 
14987
+ // Based on:
14875
14988
  /**
14876
14989
  * The Ellipse object is used to help draw graphics and can also be used to specify a hit area for containers.
14877
14990
  */ var Ellipse = /*#__PURE__*/ function(ShapePrimitive) {
@@ -15078,6 +15191,7 @@ function recursive(x1, y1, x2, y2, x3, y3, x4, y4, points, distanceTolerance, le
15078
15191
  return Ellipse;
15079
15192
  }(ShapePrimitive);
15080
15193
 
15194
+ // Based on:
15081
15195
  var StarType;
15082
15196
  (function(StarType) {
15083
15197
  StarType[StarType["Star"] = 0] = "Star";
@@ -15146,12 +15260,13 @@ var PolyStar = /*#__PURE__*/ function(ShapePrimitive) {
15146
15260
  var triangles = triangulate([
15147
15261
  points
15148
15262
  ]);
15263
+ var indexStart = vertices.length / 2;
15149
15264
  for(var i = 0; i < triangles.length; i++){
15150
- vertices[verticesOffset + i] = triangles[i];
15265
+ vertices[verticesOffset * 2 + i] = triangles[i];
15151
15266
  }
15152
15267
  var vertexCount = triangles.length / 2;
15153
15268
  for(var i1 = 0; i1 < vertexCount; i1++){
15154
- indices[indicesOffset + i1] = i1;
15269
+ indices[indicesOffset + i1] = indexStart + i1;
15155
15270
  }
15156
15271
  };
15157
15272
  _proto.buildStarPath = function buildStarPath() {
@@ -15222,6 +15337,7 @@ var PolyStar = /*#__PURE__*/ function(ShapePrimitive) {
15222
15337
  return PolyStar;
15223
15338
  }(ShapePrimitive);
15224
15339
 
15340
+ // Based on:
15225
15341
  // const tempPoints = [new Point(), new Point(), new Point(), new Point()];
15226
15342
  /**
15227
15343
  * The `Rectangle` object is an area defined by its position, as indicated by its upper-left corner
@@ -15545,6 +15661,7 @@ var PolyStar = /*#__PURE__*/ function(ShapePrimitive) {
15545
15661
  return Rectangle;
15546
15662
  }(ShapePrimitive);
15547
15663
 
15664
+ // Based on:
15548
15665
  var ShapePath = /*#__PURE__*/ function() {
15549
15666
  function ShapePath(graphicsPath) {
15550
15667
  this.graphicsPath = graphicsPath;
@@ -15703,6 +15820,7 @@ var ShapePath = /*#__PURE__*/ function() {
15703
15820
  return ShapePath;
15704
15821
  }();
15705
15822
 
15823
+ // Based on:
15706
15824
  var GraphicsPath = /*#__PURE__*/ function() {
15707
15825
  function GraphicsPath() {
15708
15826
  this.instructions = [];
@@ -15840,14 +15958,433 @@ var GraphicsPath = /*#__PURE__*/ function() {
15840
15958
  return GraphicsPath;
15841
15959
  }();
15842
15960
 
15961
+ // Based on:
15962
+ /**
15963
+ * The Point object represents a location in a two-dimensional coordinate system, where `x` represents
15964
+ * the position on the horizontal axis and `y` represents the position on the vertical axis.
15965
+ */ var Point = /*#__PURE__*/ function() {
15966
+ function Point(x, y) {
15967
+ if (x === void 0) x = 0;
15968
+ if (y === void 0) y = 0;
15969
+ /**
15970
+ * Position of the point on the x axis
15971
+ */ this.x = 0;
15972
+ /**
15973
+ * Position of the point on the y axis
15974
+ */ this.y = 0;
15975
+ this.x = x;
15976
+ this.y = y;
15977
+ }
15978
+ var _proto = Point.prototype;
15979
+ /**
15980
+ * Creates a clone of this point
15981
+ * @returns A clone of this point
15982
+ */ _proto.clone = function clone() {
15983
+ return new Point(this.x, this.y);
15984
+ };
15985
+ /**
15986
+ * Copies `x` and `y` from the given point into this point
15987
+ * @param p - The point to copy from
15988
+ * @returns The point instance itself
15989
+ */ _proto.copyFrom = function copyFrom(p) {
15990
+ this.set(p.x, p.y);
15991
+ return this;
15992
+ };
15993
+ /**
15994
+ * Copies this point's x and y into the given point (`p`).
15995
+ * @param p - The point to copy to. Can be any of type that is or extends `PointData`
15996
+ * @returns The point (`p`) with values updated
15997
+ */ _proto.copyTo = function copyTo(p) {
15998
+ p.set(this.x, this.y);
15999
+ return p;
16000
+ };
16001
+ /**
16002
+ * Accepts another point (`p`) and returns `true` if the given point is equal to this point
16003
+ * @param p - The point to check
16004
+ * @returns Returns `true` if both `x` and `y` are equal
16005
+ */ _proto.equals = function equals(p) {
16006
+ return p.x === this.x && p.y === this.y;
16007
+ };
16008
+ /**
16009
+ * Sets the point to a new `x` and `y` position.
16010
+ * If `y` is omitted, both `x` and `y` will be set to `x`.
16011
+ * @param {number} [x=0] - position of the point on the `x` axis
16012
+ * @param {number} [y=x] - position of the point on the `y` axis
16013
+ * @returns The point instance itself
16014
+ */ _proto.set = function set(x, y) {
16015
+ if (x === void 0) x = 0;
16016
+ if (y === void 0) y = x;
16017
+ this.x = x;
16018
+ this.y = y;
16019
+ return this;
16020
+ };
16021
+ _create_class(Point, null, [
16022
+ {
16023
+ key: "shared",
16024
+ get: /**
16025
+ * A static Point object with `x` and `y` values of `0`. Can be used to avoid creating new objects multiple times.
16026
+ * @readonly
16027
+ */ function get() {
16028
+ tempPoint.x = 0;
16029
+ tempPoint.y = 0;
16030
+ return tempPoint;
16031
+ }
16032
+ }
16033
+ ]);
16034
+ return Point;
16035
+ }();
16036
+ var tempPoint = new Point();
16037
+
16038
+ // Based on:
16039
+ var closePointEps = 1e-4;
16040
+ var curveEps = 0.0001;
16041
+ /**
16042
+ * Buffers vertices to draw a square cap.
16043
+ *
16044
+ * @internal
16045
+ * @private
16046
+ * @param x - X-coord of end point
16047
+ * @param y - Y-coord of end point
16048
+ * @param nx - X-coord of line normal pointing inside
16049
+ * @param ny - Y-coord of line normal pointing inside
16050
+ * @param innerWeight - Weight of inner points
16051
+ * @param outerWeight - Weight of outer points
16052
+ * @param clockwise - Whether the cap is drawn clockwise
16053
+ * @param verts - vertex buffer
16054
+ * @returns - no. of vertices pushed
16055
+ */ function square(x, y, nx, ny, innerWeight, outerWeight, clockwise, /* rotation for square (true at left end, false at right end) */ verts) {
16056
+ var ix = x - nx * innerWeight;
16057
+ var iy = y - ny * innerWeight;
16058
+ var ox = x + nx * outerWeight;
16059
+ var oy = y + ny * outerWeight;
16060
+ /* Rotate nx,ny for extension vector */ var exx;
16061
+ var eyy;
16062
+ if (clockwise) {
16063
+ exx = ny;
16064
+ eyy = -nx;
16065
+ } else {
16066
+ exx = -ny;
16067
+ eyy = nx;
16068
+ }
16069
+ /* [i|0]x,y extended at cap */ var eix = ix + exx;
16070
+ var eiy = iy + eyy;
16071
+ var eox = ox + exx;
16072
+ var eoy = oy + eyy;
16073
+ /* Square itself must be inserted clockwise*/ verts.push(eix, eiy);
16074
+ verts.push(eox, eoy);
16075
+ return 2;
16076
+ }
16077
+ /**
16078
+ * Buffers vertices to draw an arc at the line joint or cap.
16079
+ *
16080
+ * @internal
16081
+ * @private
16082
+ * @param cx - X-coord of center
16083
+ * @param cy - Y-coord of center
16084
+ * @param sx - X-coord of arc start
16085
+ * @param sy - Y-coord of arc start
16086
+ * @param ex - X-coord of arc end
16087
+ * @param ey - Y-coord of arc end
16088
+ * @param verts - buffer of vertices
16089
+ * @param clockwise - orientation of vertices
16090
+ * @returns - no. of vertices pushed
16091
+ */ function round(cx, cy, sx, sy, ex, ey, verts, clockwise) {
16092
+ var cx2p0x = sx - cx;
16093
+ var cy2p0y = sy - cy;
16094
+ var angle0 = Math.atan2(cx2p0x, cy2p0y);
16095
+ var angle1 = Math.atan2(ex - cx, ey - cy);
16096
+ if (clockwise && angle0 < angle1) {
16097
+ angle0 += Math.PI * 2;
16098
+ } else if (!clockwise && angle0 > angle1) {
16099
+ angle1 += Math.PI * 2;
16100
+ }
16101
+ var startAngle = angle0;
16102
+ var angleDiff = angle1 - angle0;
16103
+ var absAngleDiff = Math.abs(angleDiff);
16104
+ var radius = Math.sqrt(cx2p0x * cx2p0x + cy2p0y * cy2p0y);
16105
+ var segCount = (15 * absAngleDiff * Math.sqrt(radius) / Math.PI >> 0) + 1;
16106
+ var angleInc = angleDiff / segCount;
16107
+ startAngle += angleInc;
16108
+ if (clockwise) {
16109
+ verts.push(cx, cy);
16110
+ verts.push(sx, sy);
16111
+ for(var i = 1, angle = startAngle; i < segCount; i++, angle += angleInc){
16112
+ verts.push(cx, cy);
16113
+ verts.push(cx + Math.sin(angle) * radius, cy + Math.cos(angle) * radius);
16114
+ }
16115
+ verts.push(cx, cy);
16116
+ verts.push(ex, ey);
16117
+ } else {
16118
+ verts.push(sx, sy);
16119
+ verts.push(cx, cy);
16120
+ for(var i1 = 1, angle2 = startAngle; i1 < segCount; i1++, angle2 += angleInc){
16121
+ verts.push(cx + Math.sin(angle2) * radius, cy + Math.cos(angle2) * radius);
16122
+ verts.push(cx, cy);
16123
+ }
16124
+ verts.push(ex, ey);
16125
+ verts.push(cx, cy);
16126
+ }
16127
+ return segCount * 2;
16128
+ }
16129
+ function getOrientationOfPoints(points) {
16130
+ var m = points.length;
16131
+ if (m < 6) {
16132
+ return 1;
16133
+ }
16134
+ var area = 0;
16135
+ for(var i = 0, x1 = points[m - 2], y1 = points[m - 1]; i < m; i += 2){
16136
+ var x2 = points[i];
16137
+ var y2 = points[i + 1];
16138
+ area += (x2 - x1) * (y2 + y1);
16139
+ x1 = x2;
16140
+ y1 = y2;
16141
+ }
16142
+ if (area < 0) {
16143
+ return -1;
16144
+ }
16145
+ return 1;
16146
+ }
16147
+ /**
16148
+ * Builds a line to draw using the polygon method.
16149
+ * @param points
16150
+ * @param lineStyle
16151
+ * @param flipAlignment
16152
+ * @param closed
16153
+ * @param vertices
16154
+ * @param _verticesStride
16155
+ * @param _verticesOffset
16156
+ * @param indices
16157
+ * @param _indicesOffset
16158
+ */ function buildLine(points, lineStyle, flipAlignment, closed, // alignment:number,
16159
+ vertices, _verticesStride, _verticesOffset, indices, _indicesOffset) {
16160
+ // const shape = graphicsData.shape as Polygon;
16161
+ // let points = graphicsData.points || shape.points.slice();
16162
+ var eps = closePointEps;
16163
+ if (points.length === 0) {
16164
+ return;
16165
+ }
16166
+ var style = lineStyle;
16167
+ var alignment = style.alignment;
16168
+ if (lineStyle.alignment !== 0.5) {
16169
+ // rotate the points!
16170
+ var orientation = getOrientationOfPoints(points);
16171
+ if (flipAlignment) {
16172
+ orientation *= -1;
16173
+ }
16174
+ alignment = (alignment - 0.5) * orientation + 0.5;
16175
+ }
16176
+ // get first and last point.. figure out the middle!
16177
+ var firstPoint = new Point(points[0], points[1]);
16178
+ var lastPoint = new Point(points[points.length - 2], points[points.length - 1]);
16179
+ var closedShape = closed;
16180
+ var closedPath = Math.abs(firstPoint.x - lastPoint.x) < eps && Math.abs(firstPoint.y - lastPoint.y) < eps;
16181
+ // if the first point is the last point - gonna have issues :)
16182
+ if (closedShape) {
16183
+ // need to clone as we are going to slightly modify the shape..
16184
+ points = points.slice();
16185
+ if (closedPath) {
16186
+ points.pop();
16187
+ points.pop();
16188
+ lastPoint.set(points[points.length - 2], points[points.length - 1]);
16189
+ }
16190
+ var midPointX = (firstPoint.x + lastPoint.x) * 0.5;
16191
+ var midPointY = (lastPoint.y + firstPoint.y) * 0.5;
16192
+ points.unshift(midPointX, midPointY);
16193
+ points.push(midPointX, midPointY);
16194
+ }
16195
+ var verts = vertices;
16196
+ var length = points.length / 2;
16197
+ var indexCount = points.length;
16198
+ var indexStart = verts.length / 2;
16199
+ // Max. inner and outer width
16200
+ var width = style.width / 2;
16201
+ var widthSquared = width * width;
16202
+ var miterLimitSquared = style.miterLimit * style.miterLimit;
16203
+ /* Line segments of interest where (x1,y1) forms the corner. */ var x0 = points[0];
16204
+ var y0 = points[1];
16205
+ var x1 = points[2];
16206
+ var y1 = points[3];
16207
+ var x2 = 0;
16208
+ var y2 = 0;
16209
+ /* perp[?](x|y) = the line normal with magnitude lineWidth. */ var perpX = -(y0 - y1);
16210
+ var perpY = x0 - x1;
16211
+ var perp1x = 0;
16212
+ var perp1y = 0;
16213
+ var dist = Math.sqrt(perpX * perpX + perpY * perpY);
16214
+ perpX /= dist;
16215
+ perpY /= dist;
16216
+ perpX *= width;
16217
+ perpY *= width;
16218
+ var ratio = alignment; // 0.5;
16219
+ var innerWeight = (1 - ratio) * 2;
16220
+ var outerWeight = ratio * 2;
16221
+ if (!closedShape) {
16222
+ if (style.cap === "round") {
16223
+ indexCount += round(x0 - perpX * (innerWeight - outerWeight) * 0.5, y0 - perpY * (innerWeight - outerWeight) * 0.5, x0 - perpX * innerWeight, y0 - perpY * innerWeight, x0 + perpX * outerWeight, y0 + perpY * outerWeight, verts, true) + 2;
16224
+ } else if (style.cap === "square") {
16225
+ indexCount += square(x0, y0, perpX, perpY, innerWeight, outerWeight, true, verts);
16226
+ }
16227
+ }
16228
+ // Push first point (below & above vertices)
16229
+ verts.push(x0 - perpX * innerWeight, y0 - perpY * innerWeight);
16230
+ verts.push(x0 + perpX * outerWeight, y0 + perpY * outerWeight);
16231
+ for(var i = 1; i < length - 1; ++i){
16232
+ x0 = points[(i - 1) * 2];
16233
+ y0 = points[(i - 1) * 2 + 1];
16234
+ x1 = points[i * 2];
16235
+ y1 = points[i * 2 + 1];
16236
+ x2 = points[(i + 1) * 2];
16237
+ y2 = points[(i + 1) * 2 + 1];
16238
+ perpX = -(y0 - y1);
16239
+ perpY = x0 - x1;
16240
+ dist = Math.sqrt(perpX * perpX + perpY * perpY);
16241
+ perpX /= dist;
16242
+ perpY /= dist;
16243
+ perpX *= width;
16244
+ perpY *= width;
16245
+ perp1x = -(y1 - y2);
16246
+ perp1y = x1 - x2;
16247
+ dist = Math.sqrt(perp1x * perp1x + perp1y * perp1y);
16248
+ perp1x /= dist;
16249
+ perp1y /= dist;
16250
+ perp1x *= width;
16251
+ perp1y *= width;
16252
+ /* d[x|y](0|1) = the component displacement between points p(0,1|1,2) */ var dx0 = x1 - x0;
16253
+ var dy0 = y0 - y1;
16254
+ var dx1 = x1 - x2;
16255
+ var dy1 = y2 - y1;
16256
+ /* +ve if internal angle < 90 degree, -ve if internal angle > 90 degree. */ var dot = dx0 * dx1 + dy0 * dy1;
16257
+ /* +ve if internal angle counterclockwise, -ve if internal angle clockwise. */ var cross = dy0 * dx1 - dy1 * dx0;
16258
+ var clockwise = cross < 0;
16259
+ /* Going nearly parallel? */ /* atan(0.001) ~= 0.001 rad ~= 0.057 degree */ if (Math.abs(cross) < 0.001 * Math.abs(dot)) {
16260
+ verts.push(x1 - perpX * innerWeight, y1 - perpY * innerWeight);
16261
+ verts.push(x1 + perpX * outerWeight, y1 + perpY * outerWeight);
16262
+ /* 180 degree corner? */ if (dot >= 0) {
16263
+ if (style.join === "round") {
16264
+ indexCount += round(x1, y1, x1 - perpX * innerWeight, y1 - perpY * innerWeight, x1 - perp1x * innerWeight, y1 - perp1y * innerWeight, verts, false) + 4;
16265
+ } else {
16266
+ indexCount += 2;
16267
+ }
16268
+ verts.push(x1 - perp1x * outerWeight, y1 - perp1y * outerWeight);
16269
+ verts.push(x1 + perp1x * innerWeight, y1 + perp1y * innerWeight);
16270
+ }
16271
+ continue;
16272
+ }
16273
+ /* p[x|y] is the miter point. pDist is the distance between miter point and p1. */ var c1 = (-perpX + x0) * (-perpY + y1) - (-perpX + x1) * (-perpY + y0);
16274
+ var c2 = (-perp1x + x2) * (-perp1y + y1) - (-perp1x + x1) * (-perp1y + y2);
16275
+ var px = (dx0 * c2 - dx1 * c1) / cross;
16276
+ var py = (dy1 * c1 - dy0 * c2) / cross;
16277
+ var pDist = (px - x1) * (px - x1) + (py - y1) * (py - y1);
16278
+ /* Inner miter point */ var imx = x1 + (px - x1) * innerWeight;
16279
+ var imy = y1 + (py - y1) * innerWeight;
16280
+ /* Outer miter point */ var omx = x1 - (px - x1) * outerWeight;
16281
+ var omy = y1 - (py - y1) * outerWeight;
16282
+ /* Is the inside miter point too far away, creating a spike? */ var smallerInsideSegmentSq = Math.min(dx0 * dx0 + dy0 * dy0, dx1 * dx1 + dy1 * dy1);
16283
+ var insideWeight = clockwise ? innerWeight : outerWeight;
16284
+ var smallerInsideDiagonalSq = smallerInsideSegmentSq + insideWeight * insideWeight * widthSquared;
16285
+ var insideMiterOk = pDist <= smallerInsideDiagonalSq;
16286
+ if (insideMiterOk) {
16287
+ if (style.join === "bevel" || pDist / widthSquared > miterLimitSquared) {
16288
+ if (clockwise) /* rotating at inner angle */ {
16289
+ verts.push(imx, imy); // inner miter point
16290
+ verts.push(x1 + perpX * outerWeight, y1 + perpY * outerWeight); // first segment's outer vertex
16291
+ verts.push(imx, imy); // inner miter point
16292
+ verts.push(x1 + perp1x * outerWeight, y1 + perp1y * outerWeight); // second segment's outer vertex
16293
+ } else /* rotating at outer angle */ {
16294
+ verts.push(x1 - perpX * innerWeight, y1 - perpY * innerWeight); // first segment's inner vertex
16295
+ verts.push(omx, omy); // outer miter point
16296
+ verts.push(x1 - perp1x * innerWeight, y1 - perp1y * innerWeight); // second segment's outer vertex
16297
+ verts.push(omx, omy); // outer miter point
16298
+ }
16299
+ indexCount += 2;
16300
+ } else if (style.join === "round") {
16301
+ if (clockwise) /* arc is outside */ {
16302
+ verts.push(imx, imy);
16303
+ verts.push(x1 + perpX * outerWeight, y1 + perpY * outerWeight);
16304
+ indexCount += round(x1, y1, x1 + perpX * outerWeight, y1 + perpY * outerWeight, x1 + perp1x * outerWeight, y1 + perp1y * outerWeight, verts, true) + 4;
16305
+ verts.push(imx, imy);
16306
+ verts.push(x1 + perp1x * outerWeight, y1 + perp1y * outerWeight);
16307
+ } else /* arc is inside */ {
16308
+ verts.push(x1 - perpX * innerWeight, y1 - perpY * innerWeight);
16309
+ verts.push(omx, omy);
16310
+ indexCount += round(x1, y1, x1 - perpX * innerWeight, y1 - perpY * innerWeight, x1 - perp1x * innerWeight, y1 - perp1y * innerWeight, verts, false) + 4;
16311
+ verts.push(x1 - perp1x * innerWeight, y1 - perp1y * innerWeight);
16312
+ verts.push(omx, omy);
16313
+ }
16314
+ } else {
16315
+ verts.push(imx, imy);
16316
+ verts.push(omx, omy);
16317
+ }
16318
+ } else {
16319
+ verts.push(x1 - perpX * innerWeight, y1 - perpY * innerWeight); // first segment's inner vertex
16320
+ verts.push(x1 + perpX * outerWeight, y1 + perpY * outerWeight); // first segment's outer vertex
16321
+ if (style.join === "round") {
16322
+ if (clockwise) /* arc is outside */ {
16323
+ indexCount += round(x1, y1, x1 + perpX * outerWeight, y1 + perpY * outerWeight, x1 + perp1x * outerWeight, y1 + perp1y * outerWeight, verts, true) + 2;
16324
+ } else /* arc is inside */ {
16325
+ indexCount += round(x1, y1, x1 - perpX * innerWeight, y1 - perpY * innerWeight, x1 - perp1x * innerWeight, y1 - perp1y * innerWeight, verts, false) + 2;
16326
+ }
16327
+ } else if (style.join === "miter" && pDist / widthSquared <= miterLimitSquared) {
16328
+ if (clockwise) {
16329
+ verts.push(omx, omy); // inner miter point
16330
+ verts.push(omx, omy); // inner miter point
16331
+ } else {
16332
+ verts.push(imx, imy); // outer miter point
16333
+ verts.push(imx, imy); // outer miter point
16334
+ }
16335
+ indexCount += 2;
16336
+ }
16337
+ verts.push(x1 - perp1x * innerWeight, y1 - perp1y * innerWeight); // second segment's inner vertex
16338
+ verts.push(x1 + perp1x * outerWeight, y1 + perp1y * outerWeight); // second segment's outer vertex
16339
+ indexCount += 2;
16340
+ }
16341
+ }
16342
+ x0 = points[(length - 2) * 2];
16343
+ y0 = points[(length - 2) * 2 + 1];
16344
+ x1 = points[(length - 1) * 2];
16345
+ y1 = points[(length - 1) * 2 + 1];
16346
+ perpX = -(y0 - y1);
16347
+ perpY = x0 - x1;
16348
+ dist = Math.sqrt(perpX * perpX + perpY * perpY);
16349
+ perpX /= dist;
16350
+ perpY /= dist;
16351
+ perpX *= width;
16352
+ perpY *= width;
16353
+ verts.push(x1 - perpX * innerWeight, y1 - perpY * innerWeight);
16354
+ verts.push(x1 + perpX * outerWeight, y1 + perpY * outerWeight);
16355
+ if (!closedShape) {
16356
+ if (style.cap === "round") {
16357
+ indexCount += round(x1 - perpX * (innerWeight - outerWeight) * 0.5, y1 - perpY * (innerWeight - outerWeight) * 0.5, x1 - perpX * innerWeight, y1 - perpY * innerWeight, x1 + perpX * outerWeight, y1 + perpY * outerWeight, verts, false) + 2;
16358
+ } else if (style.cap === "square") {
16359
+ indexCount += square(x1, y1, perpX, perpY, innerWeight, outerWeight, false, verts);
16360
+ }
16361
+ }
16362
+ // const indices = graphicsGeometry.indices;
16363
+ var eps2 = curveEps * curveEps;
16364
+ // indices.push(indexStart);
16365
+ for(var i1 = indexStart; i1 < indexCount + indexStart - 2; ++i1){
16366
+ x0 = verts[i1 * 2];
16367
+ y0 = verts[i1 * 2 + 1];
16368
+ x1 = verts[(i1 + 1) * 2];
16369
+ y1 = verts[(i1 + 1) * 2 + 1];
16370
+ x2 = verts[(i1 + 2) * 2];
16371
+ y2 = verts[(i1 + 2) * 2 + 1];
16372
+ /* Skip zero area triangles */ if (Math.abs(x0 * (y1 - y2) + x1 * (y2 - y0) + x2 * (y0 - y1)) < eps2) {
16373
+ continue;
16374
+ }
16375
+ indices.push(i1, i1 + 1, i1 + 2);
16376
+ }
16377
+ }
16378
+
15843
16379
  var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
15844
16380
  _inherits(ShapeComponent, MeshComponent);
15845
16381
  function ShapeComponent(engine) {
15846
16382
  var _this;
15847
16383
  _this = MeshComponent.call(this, engine) || this;
15848
- _this.path = new GraphicsPath();
16384
+ _this.isStroke = false;
16385
+ _this.graphicsPath = new GraphicsPath();
15849
16386
  _this.curveValues = [];
15850
- _this.animated = true;
16387
+ _this.shapeDirty = true;
15851
16388
  _this.vert = "\nprecision highp float;\n\nattribute vec3 aPos;//x y\n\nuniform mat4 effects_MatrixVP;\nuniform mat4 effects_MatrixInvV;\nuniform mat4 effects_ObjectToWorld;\n\nvoid main() {\n vec4 pos = vec4(aPos.xyz, 1.0);\n gl_Position = effects_MatrixVP * effects_ObjectToWorld * pos;\n}\n";
15852
16389
  _this.frag = "\nprecision highp float;\n\nuniform vec4 _Color;\n\nvoid main() {\n vec4 color = _Color;\n color.rgb *= color.a;\n gl_FragColor = color;\n}\n";
15853
16390
  if (!_this.geometry) {
@@ -15895,6 +16432,13 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
15895
16432
  _this.material.depthTest = true;
15896
16433
  _this.material.blending = true;
15897
16434
  }
16435
+ _this.strokeAttributes = {
16436
+ width: 1,
16437
+ alignment: 0.5,
16438
+ cap: "butt",
16439
+ join: "miter",
16440
+ miterLimit: 10
16441
+ };
15898
16442
  return _this;
15899
16443
  }
15900
16444
  var _proto = ShapeComponent.prototype;
@@ -15902,10 +16446,10 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
15902
16446
  this.item.getHitTestParams = this.getHitTestParams;
15903
16447
  };
15904
16448
  _proto.onUpdate = function onUpdate(dt) {
15905
- if (this.animated) {
16449
+ if (this.shapeDirty) {
15906
16450
  this.buildPath(this.data);
15907
- this.buildGeometryFromPath(this.path.shapePath);
15908
- this.animated = false;
16451
+ this.buildGeometryFromPath(this.graphicsPath.shapePath);
16452
+ this.shapeDirty = false;
15909
16453
  }
15910
16454
  };
15911
16455
  _proto.buildGeometryFromPath = function buildGeometryFromPath(shapePath) {
@@ -15920,7 +16464,13 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
15920
16464
  var indexOffset = indices.length;
15921
16465
  var vertOffset = vertices.length / 2;
15922
16466
  shape.build(points);
15923
- shape.triangulate(points, vertices, vertOffset, indices, indexOffset);
16467
+ if (!this.isStroke) {
16468
+ shape.triangulate(points, vertices, vertOffset, indices, indexOffset);
16469
+ } else {
16470
+ var close = true;
16471
+ var lineStyle = this.strokeAttributes;
16472
+ buildLine(points, lineStyle, false, close, vertices, 2, vertOffset, indices);
16473
+ }
15924
16474
  }
15925
16475
  var vertexCount = vertices.length / 2;
15926
16476
  // get the current attribute and index arrays from the geometry, avoiding re-creation
@@ -15933,7 +16483,7 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
15933
16483
  if (!uvArray || uvArray.length < vertexCount * 2) {
15934
16484
  uvArray = new Float32Array(vertexCount * 2);
15935
16485
  }
15936
- if (!indexArray) {
16486
+ if (!indexArray || indexArray.length < indices.length) {
15937
16487
  indexArray = new Uint16Array(indices.length);
15938
16488
  }
15939
16489
  // set position and uv attribute array
@@ -15956,7 +16506,7 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
15956
16506
  this.geometry.setDrawCount(indices.length);
15957
16507
  };
15958
16508
  _proto.buildPath = function buildPath(data) {
15959
- this.path.clear();
16509
+ this.graphicsPath.clear();
15960
16510
  var shapeData = data;
15961
16511
  switch(shapeData.type){
15962
16512
  case ShapePrimitiveType.Custom:
@@ -15965,9 +16515,9 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
15965
16515
  var points = customData.points;
15966
16516
  var easingIns = customData.easingIns;
15967
16517
  var easingOuts = customData.easingOuts;
15968
- this.curveValues = [];
15969
16518
  for(var _iterator = _create_for_of_iterator_helper_loose(customData.shapes), _step; !(_step = _iterator()).done;){
15970
16519
  var shape = _step.value;
16520
+ this.curveValues = [];
15971
16521
  this.setFillColor(shape.fill);
15972
16522
  var indices = shape.indexes;
15973
16523
  for(var i = 1; i < indices.length; i++){
@@ -15985,42 +16535,42 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
15985
16535
  controlPoint1: easingOuts[indices[indices.length - 1].easingOut],
15986
16536
  controlPoint2: easingIns[indices[0].easingIn]
15987
16537
  });
15988
- }
15989
- this.path.moveTo(this.curveValues[this.curveValues.length - 1].point.x, this.curveValues[this.curveValues.length - 1].point.y);
15990
- for(var _iterator1 = _create_for_of_iterator_helper_loose(this.curveValues), _step1; !(_step1 = _iterator1()).done;){
15991
- var curveValue = _step1.value;
15992
- var point = curveValue.point;
15993
- var control1 = curveValue.controlPoint1;
15994
- var control2 = curveValue.controlPoint2;
15995
- this.path.bezierCurveTo(control1.x, control1.y, control2.x, control2.y, point.x, point.y, 1);
16538
+ this.graphicsPath.moveTo(this.curveValues[this.curveValues.length - 1].point.x, this.curveValues[this.curveValues.length - 1].point.y);
16539
+ for(var _iterator1 = _create_for_of_iterator_helper_loose(this.curveValues), _step1; !(_step1 = _iterator1()).done;){
16540
+ var curveValue = _step1.value;
16541
+ var point = curveValue.point;
16542
+ var control1 = curveValue.controlPoint1;
16543
+ var control2 = curveValue.controlPoint2;
16544
+ this.graphicsPath.bezierCurveTo(control1.x, control1.y, control2.x, control2.y, point.x, point.y, 1);
16545
+ }
15996
16546
  }
15997
16547
  break;
15998
16548
  }
15999
16549
  case ShapePrimitiveType.Ellipse:
16000
16550
  {
16001
16551
  var ellipseData = shapeData;
16002
- this.path.ellipse(0, 0, ellipseData.xRadius, ellipseData.yRadius);
16552
+ this.graphicsPath.ellipse(0, 0, ellipseData.xRadius, ellipseData.yRadius);
16003
16553
  this.setFillColor(ellipseData.fill);
16004
16554
  break;
16005
16555
  }
16006
16556
  case ShapePrimitiveType.Rectangle:
16007
16557
  {
16008
16558
  var rectangleData = shapeData;
16009
- this.path.rect(-rectangleData.width / 2, -rectangleData.height / 2, rectangleData.width, rectangleData.height);
16559
+ this.graphicsPath.rect(-rectangleData.width / 2, -rectangleData.height / 2, rectangleData.width, rectangleData.height);
16010
16560
  this.setFillColor(rectangleData.fill);
16011
16561
  break;
16012
16562
  }
16013
16563
  case ShapePrimitiveType.Star:
16014
16564
  {
16015
16565
  var starData = shapeData;
16016
- this.path.polyStar(starData.pointCount, starData.outerRadius, starData.innerRadius, starData.outerRoundness, starData.innerRoundness, StarType.Star);
16566
+ this.graphicsPath.polyStar(starData.pointCount, starData.outerRadius, starData.innerRadius, starData.outerRoundness, starData.innerRoundness, StarType.Star);
16017
16567
  this.setFillColor(starData.fill);
16018
16568
  break;
16019
16569
  }
16020
16570
  case ShapePrimitiveType.Polygon:
16021
16571
  {
16022
16572
  var polygonData = shapeData;
16023
- this.path.polyStar(polygonData.pointCount, polygonData.radius, polygonData.radius, polygonData.roundness, polygonData.roundness, StarType.Polygon);
16573
+ this.graphicsPath.polyStar(polygonData.pointCount, polygonData.radius, polygonData.radius, polygonData.roundness, polygonData.roundness, StarType.Polygon);
16024
16574
  this.setFillColor(polygonData.fill);
16025
16575
  break;
16026
16576
  }
@@ -16035,6 +16585,12 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
16035
16585
  _proto.fromData = function fromData(data) {
16036
16586
  MeshComponent.prototype.fromData.call(this, data);
16037
16587
  this.data = data;
16588
+ this.shapeDirty = true;
16589
+ var strokeParam = data.stroke;
16590
+ if (strokeParam) {
16591
+ this.isStroke = true;
16592
+ this.strokeAttributes.width = strokeParam.width;
16593
+ }
16038
16594
  var material = this.material;
16039
16595
  //@ts-expect-error // TODO 新版蒙版上线后重构
16040
16596
  material.stencilRef = data.renderer.mask !== undefined ? [
@@ -16044,6 +16600,15 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
16044
16600
  //@ts-expect-error // TODO 新版蒙版上线后重构
16045
16601
  setMaskMode(material, data.renderer.maskMode);
16046
16602
  };
16603
+ _create_class(ShapeComponent, [
16604
+ {
16605
+ key: "path",
16606
+ get: function get() {
16607
+ this.shapeDirty = true;
16608
+ return this.data;
16609
+ }
16610
+ }
16611
+ ]);
16047
16612
  return ShapeComponent;
16048
16613
  }(MeshComponent);
16049
16614
  ShapeComponent = __decorate([
@@ -16258,7 +16823,7 @@ var EventSystem = /*#__PURE__*/ function() {
16258
16823
  var vy = 0;
16259
16824
  var ts = performance.now();
16260
16825
  if (!_this.target) {
16261
- logger.error("Trigger TouchEvent after EventSystem is disposed.");
16826
+ logger.warn("Trigger TouchEvent after EventSystem is disposed.");
16262
16827
  return {
16263
16828
  x: x,
16264
16829
  y: y,
@@ -18731,10 +19296,19 @@ var TEMPLATE_USE_OFFSCREEN_CANVAS = "offscreen_canvas";
18731
19296
  // 后处理配置相关
18732
19297
  var POST_PROCESS_SETTINGS = "post_process_settings";
18733
19298
  var config = {};
18734
- function getConfig(name) {
19299
+ /**
19300
+ * 获取全局配置项
19301
+ * @param name
19302
+ * @returns
19303
+ */ function getConfig(name) {
18735
19304
  return config[name];
18736
19305
  }
18737
- function setConfig(name, value) {
19306
+ /**
19307
+ * 设置全局配置项
19308
+ * @param name
19309
+ * @param value
19310
+ * @returns
19311
+ */ function setConfig(name, value) {
18738
19312
  return config[name] = value;
18739
19313
  }
18740
19314
 
@@ -23081,88 +23655,81 @@ var PropertyClipPlayable = /*#__PURE__*/ function(Playable) {
23081
23655
  return PropertyClipPlayable;
23082
23656
  }(Playable);
23083
23657
 
23084
- var ColorPropertyMixerPlayable = /*#__PURE__*/ function(TrackMixerPlayable) {
23085
- _inherits(ColorPropertyMixerPlayable, TrackMixerPlayable);
23086
- function ColorPropertyMixerPlayable() {
23658
+ var PropertyMixerPlayable = /*#__PURE__*/ function(TrackMixerPlayable) {
23659
+ _inherits(PropertyMixerPlayable, TrackMixerPlayable);
23660
+ function PropertyMixerPlayable() {
23087
23661
  var _this;
23088
23662
  _this = TrackMixerPlayable.apply(this, arguments) || this;
23089
23663
  _this.propertyName = "";
23090
23664
  return _this;
23091
23665
  }
23092
- var _proto = ColorPropertyMixerPlayable.prototype;
23666
+ var _proto = PropertyMixerPlayable.prototype;
23093
23667
  _proto.evaluate = function evaluate(context) {
23094
23668
  var boundObject = context.output.getUserData();
23095
23669
  if (!boundObject) {
23096
23670
  return;
23097
23671
  }
23098
23672
  var hasInput = false;
23099
- var value = boundObject[this.propertyName];
23100
- if (!_instanceof1(value, Color)) {
23673
+ this.propertyValue = boundObject[this.propertyName];
23674
+ if (this.propertyValue === undefined || this.propertyValue === null) {
23101
23675
  return;
23102
23676
  }
23103
- value.setZero();
23677
+ this.resetPropertyValue();
23104
23678
  // evaluate the curve
23105
23679
  for(var i = 0; i < this.clipPlayables.length; i++){
23106
23680
  var weight = this.getClipWeight(i);
23107
23681
  if (weight > 0) {
23108
23682
  var propertyClipPlayable = this.getClipPlayable(i);
23109
23683
  if (!_instanceof1(propertyClipPlayable, PropertyClipPlayable)) {
23110
- console.error("ColorPropertyMixerPlayable received incompatible input");
23684
+ console.error("PropertyTrack added non-PropertyPlayableAsset");
23111
23685
  continue;
23112
23686
  }
23113
23687
  var curveValue = propertyClipPlayable.value;
23114
- value.r += curveValue.r * weight;
23115
- value.g += curveValue.g * weight;
23116
- value.b += curveValue.b * weight;
23117
- value.a += curveValue.a * weight;
23688
+ this.addWeightedValue(curveValue, weight);
23118
23689
  hasInput = true;
23119
23690
  }
23120
23691
  }
23121
23692
  // set value
23122
23693
  if (hasInput) {
23123
- boundObject[this.propertyName] = value;
23694
+ boundObject[this.propertyName] = this.propertyValue;
23124
23695
  }
23125
23696
  };
23126
- return ColorPropertyMixerPlayable;
23697
+ return PropertyMixerPlayable;
23127
23698
  }(TrackMixerPlayable);
23128
23699
 
23129
- var FloatPropertyMixerPlayable = /*#__PURE__*/ function(TrackMixerPlayable) {
23130
- _inherits(FloatPropertyMixerPlayable, TrackMixerPlayable);
23700
+ var ColorPropertyMixerPlayable = /*#__PURE__*/ function(PropertyMixerPlayable) {
23701
+ _inherits(ColorPropertyMixerPlayable, PropertyMixerPlayable);
23702
+ function ColorPropertyMixerPlayable() {
23703
+ return PropertyMixerPlayable.apply(this, arguments);
23704
+ }
23705
+ var _proto = ColorPropertyMixerPlayable.prototype;
23706
+ _proto.resetPropertyValue = function resetPropertyValue() {
23707
+ this.propertyValue.setZero();
23708
+ };
23709
+ _proto.addWeightedValue = function addWeightedValue(curveValue, weight) {
23710
+ var result = this.propertyValue;
23711
+ result.r += curveValue.r * weight;
23712
+ result.g += curveValue.g * weight;
23713
+ result.b += curveValue.b * weight;
23714
+ result.a += curveValue.a * weight;
23715
+ };
23716
+ return ColorPropertyMixerPlayable;
23717
+ }(PropertyMixerPlayable);
23718
+
23719
+ var FloatPropertyMixerPlayable = /*#__PURE__*/ function(PropertyMixerPlayable) {
23720
+ _inherits(FloatPropertyMixerPlayable, PropertyMixerPlayable);
23131
23721
  function FloatPropertyMixerPlayable() {
23132
- var _this;
23133
- _this = TrackMixerPlayable.apply(this, arguments) || this;
23134
- _this.propertyName = "";
23135
- return _this;
23722
+ return PropertyMixerPlayable.apply(this, arguments);
23136
23723
  }
23137
23724
  var _proto = FloatPropertyMixerPlayable.prototype;
23138
- _proto.evaluate = function evaluate(context) {
23139
- var boundObject = context.output.getUserData();
23140
- if (!boundObject) {
23141
- return;
23142
- }
23143
- var hasInput = false;
23144
- var value = 0;
23145
- // evaluate the curve
23146
- for(var i = 0; i < this.clipPlayables.length; i++){
23147
- var weight = this.getClipWeight(i);
23148
- if (weight > 0) {
23149
- var propertyClipPlayable = this.getClipPlayable(i);
23150
- if (!_instanceof1(propertyClipPlayable, PropertyClipPlayable)) {
23151
- console.error("FloatPropertyTrack added non-FloatPropertyPlayableAsset");
23152
- continue;
23153
- }
23154
- var curveValue = propertyClipPlayable.value;
23155
- value += curveValue * weight;
23156
- hasInput = true;
23157
- }
23158
- }
23159
- // set value
23160
- if (hasInput) {
23161
- boundObject[this.propertyName] = value;
23162
- }
23725
+ _proto.resetPropertyValue = function resetPropertyValue() {
23726
+ this.propertyValue = 0;
23727
+ };
23728
+ _proto.addWeightedValue = function addWeightedValue(curveValue, weight) {
23729
+ this.propertyValue += curveValue * weight;
23163
23730
  };
23164
23731
  return FloatPropertyMixerPlayable;
23165
- }(TrackMixerPlayable);
23732
+ }(PropertyMixerPlayable);
23166
23733
 
23167
23734
  var ParticleMixerPlayable = /*#__PURE__*/ function(TrackMixerPlayable) {
23168
23735
  _inherits(ParticleMixerPlayable, TrackMixerPlayable);
@@ -23906,50 +24473,40 @@ var TransformMixerPlayable = /*#__PURE__*/ function(TrackMixerPlayable) {
23906
24473
  return TransformMixerPlayable;
23907
24474
  }(TrackMixerPlayable);
23908
24475
 
23909
- var Vector4PropertyMixerPlayable = /*#__PURE__*/ function(TrackMixerPlayable) {
23910
- _inherits(Vector4PropertyMixerPlayable, TrackMixerPlayable);
24476
+ var Vector4PropertyMixerPlayable = /*#__PURE__*/ function(PropertyMixerPlayable) {
24477
+ _inherits(Vector4PropertyMixerPlayable, PropertyMixerPlayable);
23911
24478
  function Vector4PropertyMixerPlayable() {
23912
- var _this;
23913
- _this = TrackMixerPlayable.apply(this, arguments) || this;
23914
- _this.propertyName = "";
23915
- return _this;
24479
+ return PropertyMixerPlayable.apply(this, arguments);
23916
24480
  }
23917
24481
  var _proto = Vector4PropertyMixerPlayable.prototype;
23918
- _proto.evaluate = function evaluate(context) {
23919
- var boundObject = context.output.getUserData();
23920
- if (!boundObject) {
23921
- return;
23922
- }
23923
- var hasInput = false;
23924
- var value = boundObject[this.propertyName];
23925
- if (!_instanceof1(value, Vector4)) {
23926
- return;
23927
- }
23928
- value.setZero();
23929
- // evaluate the curve
23930
- for(var i = 0; i < this.clipPlayables.length; i++){
23931
- var weight = this.getClipWeight(i);
23932
- if (weight > 0) {
23933
- var propertyClipPlayable = this.getClipPlayable(i);
23934
- if (!_instanceof1(propertyClipPlayable, PropertyClipPlayable)) {
23935
- console.error("Vector4PropertyTrack added non-Vector4PropertyPlayableAsset");
23936
- continue;
23937
- }
23938
- var curveValue = propertyClipPlayable.value;
23939
- value.x += curveValue.x * weight;
23940
- value.y += curveValue.y * weight;
23941
- value.z += curveValue.z * weight;
23942
- value.w += curveValue.w * weight;
23943
- hasInput = true;
23944
- }
23945
- }
23946
- // set value
23947
- if (hasInput) {
23948
- boundObject[this.propertyName] = value;
23949
- }
24482
+ _proto.resetPropertyValue = function resetPropertyValue() {
24483
+ this.propertyValue.setZero();
24484
+ };
24485
+ _proto.addWeightedValue = function addWeightedValue(curveValue, weight) {
24486
+ var result = this.propertyValue;
24487
+ result.x += curveValue.x * weight;
24488
+ result.y += curveValue.y * weight;
24489
+ result.z += curveValue.z * weight;
24490
+ result.w += curveValue.w * weight;
23950
24491
  };
23951
24492
  return Vector4PropertyMixerPlayable;
23952
- }(TrackMixerPlayable);
24493
+ }(PropertyMixerPlayable);
24494
+ var Vector2PropertyMixerPlayable = /*#__PURE__*/ function(PropertyMixerPlayable) {
24495
+ _inherits(Vector2PropertyMixerPlayable, PropertyMixerPlayable);
24496
+ function Vector2PropertyMixerPlayable() {
24497
+ return PropertyMixerPlayable.apply(this, arguments);
24498
+ }
24499
+ var _proto = Vector2PropertyMixerPlayable.prototype;
24500
+ _proto.resetPropertyValue = function resetPropertyValue() {
24501
+ this.propertyValue.setZero();
24502
+ };
24503
+ _proto.addWeightedValue = function addWeightedValue(curveValue, weight) {
24504
+ var result = this.propertyValue;
24505
+ result.x += curveValue.x * weight;
24506
+ result.y += curveValue.y * weight;
24507
+ };
24508
+ return Vector2PropertyMixerPlayable;
24509
+ }(PropertyMixerPlayable);
23953
24510
 
23954
24511
  /**
23955
24512
  * @since 2.0.0
@@ -24330,6 +24887,26 @@ var Vector4PropertyTrack = /*#__PURE__*/ function(PropertyTrack) {
24330
24887
  Vector4PropertyTrack = __decorate([
24331
24888
  effectsClass(DataType.Vector4PropertyTrack)
24332
24889
  ], Vector4PropertyTrack);
24890
+ var Vector2PropertyTrack = /*#__PURE__*/ function(PropertyTrack) {
24891
+ _inherits(Vector2PropertyTrack, PropertyTrack);
24892
+ function Vector2PropertyTrack() {
24893
+ return PropertyTrack.apply(this, arguments);
24894
+ }
24895
+ var _proto = Vector2PropertyTrack.prototype;
24896
+ _proto.createTrackMixer = function createTrackMixer(graph) {
24897
+ var mixer = new Vector2PropertyMixerPlayable(graph);
24898
+ var propertyNames = this.propertyNames;
24899
+ if (propertyNames.length > 0) {
24900
+ var propertyName = propertyNames[propertyNames.length - 1];
24901
+ mixer.propertyName = propertyName;
24902
+ }
24903
+ return mixer;
24904
+ };
24905
+ return Vector2PropertyTrack;
24906
+ }(PropertyTrack);
24907
+ Vector2PropertyTrack = __decorate([
24908
+ effectsClass("Vector2PropertyTrack")
24909
+ ], Vector2PropertyTrack);
24333
24910
 
24334
24911
  var ColorPropertyTrack = /*#__PURE__*/ function(PropertyTrack) {
24335
24912
  _inherits(ColorPropertyTrack, PropertyTrack);
@@ -24596,8 +25173,28 @@ __decorate([
24596
25173
  serialize()
24597
25174
  ], Vector4PropertyPlayableAsset.prototype, "curveData", void 0);
24598
25175
  Vector4PropertyPlayableAsset = __decorate([
24599
- effectsClass("Vector4PropertyPlayableAsset")
25176
+ effectsClass(DataType.Vector4PropertyPlayableAsset)
24600
25177
  ], Vector4PropertyPlayableAsset);
25178
+ var Vector2PropertyPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
25179
+ _inherits(Vector2PropertyPlayableAsset, PlayableAsset);
25180
+ function Vector2PropertyPlayableAsset() {
25181
+ return PlayableAsset.apply(this, arguments);
25182
+ }
25183
+ var _proto = Vector2PropertyPlayableAsset.prototype;
25184
+ _proto.createPlayable = function createPlayable(graph) {
25185
+ var clipPlayable = new PropertyClipPlayable(graph);
25186
+ clipPlayable.curve = createValueGetter(this.curveData);
25187
+ clipPlayable.value = clipPlayable.curve.getValue(0);
25188
+ return clipPlayable;
25189
+ };
25190
+ return Vector2PropertyPlayableAsset;
25191
+ }(PlayableAsset);
25192
+ __decorate([
25193
+ serialize()
25194
+ ], Vector2PropertyPlayableAsset.prototype, "curveData", void 0);
25195
+ Vector2PropertyPlayableAsset = __decorate([
25196
+ effectsClass(DataType.Vector2PropertyPlayableAsset)
25197
+ ], Vector2PropertyPlayableAsset);
24601
25198
 
24602
25199
  var ObjectBindingTrack = /*#__PURE__*/ function(TrackAsset) {
24603
25200
  _inherits(ObjectBindingTrack, TrackAsset);
@@ -25980,7 +26577,7 @@ function getStandardInteractContent(ui) {
25980
26577
  }
25981
26578
  });
25982
26579
  });
25983
- json.version = "2.1";
26580
+ json.version = JSONSceneVersion["2_1"];
25984
26581
  return json;
25985
26582
  }
25986
26583
  /**
@@ -26000,6 +26597,18 @@ function getStandardInteractContent(ui) {
26000
26597
  });
26001
26598
  return json;
26002
26599
  }
26600
+ /**
26601
+ * 3.1 版本数据适配
26602
+ * - 富文本插件名称的适配
26603
+ */ function version31Migration(json) {
26604
+ var _json_plugins;
26605
+ (_json_plugins = json.plugins) == null ? void 0 : _json_plugins.forEach(function(plugin, index) {
26606
+ if (plugin === "richtext") {
26607
+ json.plugins[index] = "rich-text";
26608
+ }
26609
+ });
26610
+ return json;
26611
+ }
26003
26612
  /**
26004
26613
  * 3.0 以下版本数据适配(runtime 2.0及以上版本支持)
26005
26614
  */ function version30Migration(json) {
@@ -26307,7 +26916,7 @@ function getStandardInteractContent(ui) {
26307
26916
  break;
26308
26917
  }
26309
26918
  }
26310
- result.version = "3.0";
26919
+ result.version = JSONSceneVersion["3_0"];
26311
26920
  return result;
26312
26921
  }
26313
26922
  /**
@@ -26827,6 +27436,8 @@ function getStandardJSON(json) {
26827
27436
  }
26828
27437
  // 修正老版本数据中,meshItem 以及 lightItem 结束行为错误问题
26829
27438
  version22Migration(json);
27439
+ // 修正老版本数据中,富文本插件名称的问题
27440
+ version31Migration(json);
26830
27441
  if (v0.test(json.version)) {
26831
27442
  var _exec;
26832
27443
  reverseParticle = ((_exec = /^(\d+)/.exec(json.version)) == null ? void 0 : _exec[0]) === "0";
@@ -26847,13 +27458,13 @@ function getStandardJSON(json) {
26847
27458
  }
26848
27459
  throw new Error("Invalid JSON version: " + json.version + ".");
26849
27460
  }
26850
- var currentVersion = "1.0";
27461
+ var currentVersion = JSONSceneVersion["1_0"];
26851
27462
  function getStandardJSONFromV0(json) {
26852
27463
  var _json_bins;
26853
- currentVersion = "1.0";
27464
+ currentVersion = JSONSceneVersion["1_0"];
26854
27465
  var plugins = json.plugins || [];
26855
27466
  if ((_json_bins = json.bins) == null ? void 0 : _json_bins.length) {
26856
- currentVersion = "1.3";
27467
+ currentVersion = JSONSceneVersion["1_3"];
26857
27468
  }
26858
27469
  var requires = (json.requires || []).slice();
26859
27470
  var images = json.images.map(function(img, index) {
@@ -28776,7 +29387,9 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
28776
29387
  */ _proto.getSpeed = function getSpeed() {
28777
29388
  return this.speed;
28778
29389
  };
28779
- _proto.play = function play() {
29390
+ /**
29391
+ *
29392
+ */ _proto.play = function play() {
28780
29393
  if (this.isEnded && this.reusable) {
28781
29394
  this.restart();
28782
29395
  }
@@ -28791,7 +29404,10 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
28791
29404
  */ _proto.pause = function pause() {
28792
29405
  this.paused = true;
28793
29406
  };
28794
- _proto.getPaused = function getPaused() {
29407
+ /**
29408
+ *
29409
+ * @returns
29410
+ */ _proto.getPaused = function getPaused() {
28795
29411
  return this.paused;
28796
29412
  };
28797
29413
  /**
@@ -31369,7 +31985,7 @@ registerPlugin("sprite", SpriteLoader, VFXItem, true);
31369
31985
  registerPlugin("particle", ParticleLoader, VFXItem, true);
31370
31986
  registerPlugin("cal", CalculateLoader, VFXItem, true);
31371
31987
  registerPlugin("interact", InteractLoader, VFXItem, true);
31372
- var version$1 = "2.2.5";
31988
+ var version$1 = "2.3.0-alpha.0";
31373
31989
  logger.info("Core version: " + version$1 + ".");
31374
31990
 
31375
31991
  var _obj;
@@ -33002,8 +33618,8 @@ setMaxSpriteMeshItemCount(8);
33002
33618
  */ Mesh.create = function(engine, props) {
33003
33619
  return new ThreeMesh(engine, props);
33004
33620
  };
33005
- var version = "2.2.5";
33621
+ var version = "2.3.0-alpha.0";
33006
33622
  logger.info("THREEJS plugin version: " + version + ".");
33007
33623
 
33008
- export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, Asset, AssetLoader, AssetManager, BYTES_TYPE_MAP, BaseRenderComponent, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, COMPRESSED_TEXTURE, CONSTANT_MAP_BLEND, CONSTANT_MAP_DEPTH, CONSTANT_MAP_STENCIL_FUNC, CONSTANT_MAP_STENCIL_OP, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, ColorCurve, 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, ParticleTrack, 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, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteLoader, StaticValue, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TEXTURE_UNIFORM_MAP, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, ThreeComposition, ThreeDisplayObject, ThreeEngine, ThreeMaterial, ThreeSpriteComponent, ThreeTextComponent, ThreeTexture, Ticker, TimelineAsset, TimelineClip, TimelinePlayable, TrackAsset, TrackSortWrapper, TrackType, Transform, TransformAnimationPlayable, TransformPlayableAsset, TransformTrack, VFXItem, ValueGetter, Vector4Curve, 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, setUniformValue, sortByOrder, index$1 as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecFill, vecMulCombine, version, vertexFormatType2GLType };
33624
+ export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, Asset, AssetLoader, AssetManager, BYTES_TYPE_MAP, BaseRenderComponent, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, COMPRESSED_TEXTURE, CONSTANT_MAP_BLEND, CONSTANT_MAP_DEPTH, CONSTANT_MAP_STENCIL_FUNC, CONSTANT_MAP_STENCIL_OP, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, ColorCurve, 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, ParticleTrack, 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, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteLoader, StaticValue, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TEXTURE_UNIFORM_MAP, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, ThreeComposition, ThreeDisplayObject, ThreeEngine, ThreeMaterial, ThreeSpriteComponent, ThreeTextComponent, ThreeTexture, Ticker, TimelineAsset, TimelineClip, TimelinePlayable, TrackAsset, TrackSortWrapper, TrackType, Transform, TransformAnimationPlayable, TransformPlayableAsset, TransformTrack, VFXItem, ValueGetter, Vector2Curve, Vector2PropertyPlayableAsset, Vector2PropertyTrack, 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, setUniformValue, sortByOrder, index$1 as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecFill, vecMulCombine, version, vertexFormatType2GLType };
33009
33625
  //# sourceMappingURL=index.mjs.map