@galacean/effects-core 2.1.0-alpha.5 → 2.1.0-alpha.6
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/asset-manager.d.ts +7 -6
- package/dist/binary-asset.d.ts +2 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/components/shape-component.d.ts +172 -0
- package/dist/composition-source-manager.d.ts +1 -1
- package/dist/composition.d.ts +10 -4
- package/dist/image-asset.d.ts +2 -2
- package/dist/index.js +1824 -226
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1825 -224
- package/dist/index.mjs.map +1 -1
- package/dist/plugins/cal/timeline-asset.d.ts +1 -1
- package/dist/plugins/shape/build-adaptive-bezier.d.ts +1 -0
- package/dist/plugins/shape/graphics-path.d.ts +35 -0
- package/dist/plugins/shape/point-data.d.ts +6 -0
- package/dist/plugins/shape/polygon.d.ts +60 -0
- package/dist/plugins/shape/shape-path.d.ts +51 -0
- package/dist/plugins/shape/triangulate.d.ts +1 -0
- package/dist/plugins/timeline/track.d.ts +2 -2
- package/dist/render/gpu-capability.d.ts +1 -1
- package/dist/render/shader.d.ts +1 -1
- package/dist/scene.d.ts +17 -18
- package/dist/shape/geometry.d.ts +3 -3
- package/dist/texture/utils.d.ts +1 -2
- package/package.json +4 -3
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Description: Galacean Effects runtime core for the web
|
|
4
4
|
* Author: Ant Group CO., Ltd.
|
|
5
5
|
* Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
|
|
6
|
-
* Version: v2.1.0-alpha.
|
|
6
|
+
* Version: v2.1.0-alpha.6
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -3946,6 +3946,12 @@ Euler.tempMat0 = new Matrix4();
|
|
|
3946
3946
|
/**
|
|
3947
3947
|
* 节点元素
|
|
3948
3948
|
*/ ItemType["node"] = "node";
|
|
3949
|
+
/**
|
|
3950
|
+
* 视频元素
|
|
3951
|
+
*/ ItemType["video"] = "video";
|
|
3952
|
+
/**
|
|
3953
|
+
* 音频元素
|
|
3954
|
+
*/ ItemType["audio"] = "audio";
|
|
3949
3955
|
})(ItemType || (ItemType = {}));
|
|
3950
3956
|
/**
|
|
3951
3957
|
* 渲染模式
|
|
@@ -4046,15 +4052,6 @@ var CameraClipMode;
|
|
|
4046
4052
|
*/ CameraClipMode[CameraClipMode["landscape"] = 0] = "landscape";
|
|
4047
4053
|
})(CameraClipMode || (CameraClipMode = {}));
|
|
4048
4054
|
|
|
4049
|
-
/**
|
|
4050
|
-
* 动态换图类型
|
|
4051
|
-
* @since 1.1.0
|
|
4052
|
-
*/ var BackgroundType;
|
|
4053
|
-
(function(BackgroundType) {
|
|
4054
|
-
BackgroundType["video"] = "video";
|
|
4055
|
-
BackgroundType["image"] = "image";
|
|
4056
|
-
})(BackgroundType || (BackgroundType = {}));
|
|
4057
|
-
|
|
4058
4055
|
/*********************************************/ /* 基本数值属性参数 */ /*********************************************/ var ValueType;
|
|
4059
4056
|
(function(ValueType) {
|
|
4060
4057
|
/**
|
|
@@ -4360,6 +4357,8 @@ var DataType;
|
|
|
4360
4357
|
DataType["TreeComponent"] = "TreeComponent";
|
|
4361
4358
|
DataType["AnimationComponent"] = "AnimationComponent";
|
|
4362
4359
|
DataType["SpineComponent"] = "SpineComponent";
|
|
4360
|
+
DataType["VideoComponent"] = "VideoComponent";
|
|
4361
|
+
DataType["AudioComponent"] = "AudioComponent";
|
|
4363
4362
|
// Non-EffectObject
|
|
4364
4363
|
DataType["TimelineClip"] = "TimelineClip";
|
|
4365
4364
|
})(DataType || (DataType = {}));
|
|
@@ -4449,10 +4448,28 @@ var VertexBufferSemantic;
|
|
|
4449
4448
|
|
|
4450
4449
|
var BuiltinObjectGUID = {
|
|
4451
4450
|
WhiteTexture: "whitetexture00000000000000000000",
|
|
4451
|
+
TransparentTexture: "transparenttexture00000000000000000000",
|
|
4452
4452
|
PBRShader: "pbr00000000000000000000000000000",
|
|
4453
4453
|
UnlitShader: "unlit000000000000000000000000000"
|
|
4454
4454
|
};
|
|
4455
4455
|
|
|
4456
|
+
/**
|
|
4457
|
+
* 动态换图类型
|
|
4458
|
+
* @since 1.1.0
|
|
4459
|
+
*/ var BackgroundType;
|
|
4460
|
+
(function(BackgroundType) {
|
|
4461
|
+
BackgroundType["video"] = "video";
|
|
4462
|
+
BackgroundType["image"] = "image";
|
|
4463
|
+
})(BackgroundType || (BackgroundType = {}));
|
|
4464
|
+
/**
|
|
4465
|
+
* 多媒体资源类型
|
|
4466
|
+
* @since 2.1.0
|
|
4467
|
+
*/ var MultimediaType;
|
|
4468
|
+
(function(MultimediaType) {
|
|
4469
|
+
MultimediaType["video"] = "video";
|
|
4470
|
+
MultimediaType["audio"] = "audio";
|
|
4471
|
+
})(MultimediaType || (MultimediaType = {}));
|
|
4472
|
+
|
|
4456
4473
|
var index$1 = /*#__PURE__*/Object.freeze({
|
|
4457
4474
|
__proto__: null,
|
|
4458
4475
|
get RenderLevel () { return RenderLevel; },
|
|
@@ -4469,7 +4486,6 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
4469
4486
|
get RenderType () { return RenderType; },
|
|
4470
4487
|
get RenderFace () { return RenderFace; },
|
|
4471
4488
|
get CameraClipMode () { return CameraClipMode; },
|
|
4472
|
-
get BackgroundType () { return BackgroundType; },
|
|
4473
4489
|
END_BEHAVIOR_DESTROY: END_BEHAVIOR_DESTROY,
|
|
4474
4490
|
END_BEHAVIOR_PAUSE: END_BEHAVIOR_PAUSE,
|
|
4475
4491
|
END_BEHAVIOR_FORWARD: END_BEHAVIOR_FORWARD,
|
|
@@ -4503,7 +4519,9 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
4503
4519
|
get VertexFormatType () { return VertexFormatType; },
|
|
4504
4520
|
get IndexFormatType () { return IndexFormatType; },
|
|
4505
4521
|
get VertexBufferSemantic () { return VertexBufferSemantic; },
|
|
4506
|
-
BuiltinObjectGUID: BuiltinObjectGUID
|
|
4522
|
+
BuiltinObjectGUID: BuiltinObjectGUID,
|
|
4523
|
+
get BackgroundType () { return BackgroundType; },
|
|
4524
|
+
get MultimediaType () { return MultimediaType; }
|
|
4507
4525
|
});
|
|
4508
4526
|
|
|
4509
4527
|
var decoratorInitialStore = new Map();
|
|
@@ -8166,11 +8184,11 @@ function _loadMedia() {
|
|
|
8166
8184
|
return _loadMedia.apply(this, arguments);
|
|
8167
8185
|
}
|
|
8168
8186
|
|
|
8169
|
-
function deserializeMipmapTexture(textureOptions, bins,
|
|
8187
|
+
function deserializeMipmapTexture(textureOptions, bins, assets) {
|
|
8170
8188
|
return _deserializeMipmapTexture.apply(this, arguments);
|
|
8171
8189
|
}
|
|
8172
8190
|
function _deserializeMipmapTexture() {
|
|
8173
|
-
_deserializeMipmapTexture = _async_to_generator(function(textureOptions, bins,
|
|
8191
|
+
_deserializeMipmapTexture = _async_to_generator(function(textureOptions, bins, assets, files) {
|
|
8174
8192
|
var mipmaps, target, jobs, loadedMipmaps, mipmaps1, target1, jobs1, loadedMipmaps1, bin;
|
|
8175
8193
|
return __generator(this, function(_state) {
|
|
8176
8194
|
switch(_state.label){
|
|
@@ -8186,9 +8204,8 @@ function _deserializeMipmapTexture() {
|
|
|
8186
8204
|
// @ts-expect-error
|
|
8187
8205
|
if (pointer.id) {
|
|
8188
8206
|
// @ts-expect-error
|
|
8189
|
-
var
|
|
8190
|
-
|
|
8191
|
-
return loadedImageAsset.data;
|
|
8207
|
+
var loadedImage = assets[pointer.id];
|
|
8208
|
+
return loadedImage;
|
|
8192
8209
|
} else {
|
|
8193
8210
|
return loadMipmapImage(pointer, bins);
|
|
8194
8211
|
}
|
|
@@ -8425,7 +8442,7 @@ var sourceOptions = {
|
|
|
8425
8442
|
};
|
|
8426
8443
|
function generateWhiteTexture(engine) {
|
|
8427
8444
|
return Texture.create(engine, _extends({
|
|
8428
|
-
id:
|
|
8445
|
+
id: BuiltinObjectGUID.WhiteTexture,
|
|
8429
8446
|
data: {
|
|
8430
8447
|
width: 1,
|
|
8431
8448
|
height: 1,
|
|
@@ -8441,7 +8458,7 @@ function generateWhiteTexture(engine) {
|
|
|
8441
8458
|
}
|
|
8442
8459
|
function generateTransparentTexture(engine) {
|
|
8443
8460
|
return Texture.create(engine, _extends({
|
|
8444
|
-
id:
|
|
8461
|
+
id: BuiltinObjectGUID.TransparentTexture,
|
|
8445
8462
|
data: {
|
|
8446
8463
|
width: 1,
|
|
8447
8464
|
height: 1,
|
|
@@ -10800,7 +10817,7 @@ var Shader = /*#__PURE__*/ function(EffectsObject) {
|
|
|
10800
10817
|
return Shader;
|
|
10801
10818
|
}(EffectsObject);
|
|
10802
10819
|
Shader = __decorate([
|
|
10803
|
-
effectsClass(
|
|
10820
|
+
effectsClass(DataType.Shader)
|
|
10804
10821
|
], Shader);
|
|
10805
10822
|
|
|
10806
10823
|
var EFFECTS_COPY_MESH_NAME = "effects-internal-copy";
|
|
@@ -12885,7 +12902,7 @@ var GPUCapability = /*#__PURE__*/ function() {
|
|
|
12885
12902
|
shaderTextureLod: level2 || !!gl.getExtension("EXT_shader_texture_lod"),
|
|
12886
12903
|
instanceDraw: level2 || !!gl.getExtension("ANGLE_instanced_arrays"),
|
|
12887
12904
|
drawBuffers: level2 || !!this.drawBufferExtension,
|
|
12888
|
-
asyncShaderCompile: !!
|
|
12905
|
+
asyncShaderCompile: !!this.glAsyncCompileExt,
|
|
12889
12906
|
intIndexElementBuffer: !!gl.getExtension("OES_element_index_uint"),
|
|
12890
12907
|
standardDerivatives: level2 || !!gl.getExtension("OES_standard_derivatives"),
|
|
12891
12908
|
readableDepthStencilTextures: level2 || !!depthTextureExtension,
|
|
@@ -15789,7 +15806,7 @@ function getGeometryTriangles(geometry, options) {
|
|
|
15789
15806
|
*/ function getGeometriesByShapeData(shape) {
|
|
15790
15807
|
var geometries = [];
|
|
15791
15808
|
// 该版本的单个形状数据可以包含多个形状,可以加个埋点,五福之后没有就可以下掉
|
|
15792
|
-
if (shape
|
|
15809
|
+
if ("gs" in shape) {
|
|
15793
15810
|
shape.gs.forEach(function(gs) {
|
|
15794
15811
|
geometries.push({
|
|
15795
15812
|
p: [
|
|
@@ -15802,7 +15819,7 @@ function getGeometryTriangles(geometry, options) {
|
|
|
15802
15819
|
]
|
|
15803
15820
|
});
|
|
15804
15821
|
});
|
|
15805
|
-
} else if (shape
|
|
15822
|
+
} else if ("g" in shape) {
|
|
15806
15823
|
geometries.push({
|
|
15807
15824
|
p: [
|
|
15808
15825
|
ValueType.SHAPE_POINTS,
|
|
@@ -16801,6 +16818,7 @@ var ParticleSystem = /*#__PURE__*/ function(Component) {
|
|
|
16801
16818
|
});
|
|
16802
16819
|
this.frozen = false;
|
|
16803
16820
|
this.ended = false;
|
|
16821
|
+
this.destroyed = false;
|
|
16804
16822
|
};
|
|
16805
16823
|
_proto.update = function update(delta) {
|
|
16806
16824
|
var _this = this;
|
|
@@ -19089,7 +19107,7 @@ var TransformPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
|
19089
19107
|
return TransformPlayableAsset;
|
|
19090
19108
|
}(PlayableAsset);
|
|
19091
19109
|
TransformPlayableAsset = __decorate([
|
|
19092
|
-
effectsClass(
|
|
19110
|
+
effectsClass(DataType.TransformPlayableAsset)
|
|
19093
19111
|
], TransformPlayableAsset);
|
|
19094
19112
|
/**
|
|
19095
19113
|
* @since 2.0.0
|
|
@@ -19120,7 +19138,7 @@ var ActivationPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
|
19120
19138
|
return ActivationPlayableAsset;
|
|
19121
19139
|
}(PlayableAsset);
|
|
19122
19140
|
ActivationPlayableAsset = __decorate([
|
|
19123
|
-
effectsClass(
|
|
19141
|
+
effectsClass(DataType.ActivationPlayableAsset)
|
|
19124
19142
|
], ActivationPlayableAsset);
|
|
19125
19143
|
var AnimationClip = /*#__PURE__*/ function(EffectsObject) {
|
|
19126
19144
|
_inherits(AnimationClip, EffectsObject);
|
|
@@ -19363,7 +19381,7 @@ __decorate([
|
|
|
19363
19381
|
serialize()
|
|
19364
19382
|
], TrackAsset.prototype, "children", void 0);
|
|
19365
19383
|
TrackAsset = __decorate([
|
|
19366
|
-
effectsClass(
|
|
19384
|
+
effectsClass(DataType.TrackAsset)
|
|
19367
19385
|
], TrackAsset);
|
|
19368
19386
|
var TrackType;
|
|
19369
19387
|
(function(TrackType) {
|
|
@@ -19458,7 +19476,7 @@ var ObjectBindingTrack = /*#__PURE__*/ function(TrackAsset1) {
|
|
|
19458
19476
|
return ObjectBindingTrack;
|
|
19459
19477
|
}(TrackAsset);
|
|
19460
19478
|
ObjectBindingTrack = __decorate([
|
|
19461
|
-
effectsClass(
|
|
19479
|
+
effectsClass(DataType.ObjectBindingTrack)
|
|
19462
19480
|
], ObjectBindingTrack);
|
|
19463
19481
|
|
|
19464
19482
|
var TransformTrack = /*#__PURE__*/ function(TrackAsset) {
|
|
@@ -19469,7 +19487,7 @@ var TransformTrack = /*#__PURE__*/ function(TrackAsset) {
|
|
|
19469
19487
|
return TransformTrack;
|
|
19470
19488
|
}(TrackAsset);
|
|
19471
19489
|
TransformTrack = __decorate([
|
|
19472
|
-
effectsClass(
|
|
19490
|
+
effectsClass(DataType.TransformTrack)
|
|
19473
19491
|
], TransformTrack);
|
|
19474
19492
|
|
|
19475
19493
|
var ActivationMixerPlayable = /*#__PURE__*/ function(Playable) {
|
|
@@ -19530,7 +19548,7 @@ var ActivationTrack = /*#__PURE__*/ function(TrackAsset) {
|
|
|
19530
19548
|
return ActivationTrack;
|
|
19531
19549
|
}(TrackAsset);
|
|
19532
19550
|
ActivationTrack = __decorate([
|
|
19533
|
-
effectsClass(
|
|
19551
|
+
effectsClass(DataType.ActivationTrack)
|
|
19534
19552
|
], ActivationTrack);
|
|
19535
19553
|
|
|
19536
19554
|
var SpriteColorTrack = /*#__PURE__*/ function(TrackAsset) {
|
|
@@ -19541,7 +19559,7 @@ var SpriteColorTrack = /*#__PURE__*/ function(TrackAsset) {
|
|
|
19541
19559
|
return SpriteColorTrack;
|
|
19542
19560
|
}(TrackAsset);
|
|
19543
19561
|
SpriteColorTrack = __decorate([
|
|
19544
|
-
effectsClass(
|
|
19562
|
+
effectsClass(DataType.SpriteColorTrack)
|
|
19545
19563
|
], SpriteColorTrack);
|
|
19546
19564
|
|
|
19547
19565
|
var TimelineAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
@@ -19578,7 +19596,7 @@ __decorate([
|
|
|
19578
19596
|
serialize()
|
|
19579
19597
|
], TimelineAsset.prototype, "tracks", void 0);
|
|
19580
19598
|
TimelineAsset = __decorate([
|
|
19581
|
-
effectsClass(
|
|
19599
|
+
effectsClass(DataType.TimelineAsset)
|
|
19582
19600
|
], TimelineAsset);
|
|
19583
19601
|
var TimelinePlayable = /*#__PURE__*/ function(Playable) {
|
|
19584
19602
|
_inherits(TimelinePlayable, Playable);
|
|
@@ -19943,7 +19961,7 @@ var SubCompositionTrack = /*#__PURE__*/ function(TrackAsset) {
|
|
|
19943
19961
|
return SubCompositionTrack;
|
|
19944
19962
|
}(TrackAsset);
|
|
19945
19963
|
SubCompositionTrack = __decorate([
|
|
19946
|
-
effectsClass(
|
|
19964
|
+
effectsClass(DataType.SubCompositionTrack)
|
|
19947
19965
|
], SubCompositionTrack);
|
|
19948
19966
|
|
|
19949
19967
|
var SubCompositionClipPlayable = /*#__PURE__*/ function(Playable) {
|
|
@@ -19973,7 +19991,7 @@ var SubCompositionPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
|
19973
19991
|
return SubCompositionPlayableAsset;
|
|
19974
19992
|
}(PlayableAsset);
|
|
19975
19993
|
SubCompositionPlayableAsset = __decorate([
|
|
19976
|
-
effectsClass(
|
|
19994
|
+
effectsClass(DataType.SubCompositionPlayableAsset)
|
|
19977
19995
|
], SubCompositionPlayableAsset);
|
|
19978
19996
|
|
|
19979
19997
|
function _possible_constructor_return(self, call) {
|
|
@@ -20793,6 +20811,1652 @@ PostProcessVolume = __decorate([
|
|
|
20793
20811
|
effectsClass("PostProcessVolume")
|
|
20794
20812
|
], PostProcessVolume);
|
|
20795
20813
|
|
|
20814
|
+
/**
|
|
20815
|
+
* A class to define a shape via user defined coordinates.
|
|
20816
|
+
*/ var Polygon = /*#__PURE__*/ function() {
|
|
20817
|
+
function Polygon() {
|
|
20818
|
+
for(var _len = arguments.length, points = new Array(_len), _key = 0; _key < _len; _key++){
|
|
20819
|
+
points[_key] = arguments[_key];
|
|
20820
|
+
}
|
|
20821
|
+
/** An array of the points of this polygon. */ this.points = [];
|
|
20822
|
+
/** `false` after moveTo, `true` after `closePath`. In all other cases it is `true`. */ this.closePath = false;
|
|
20823
|
+
var flat = Array.isArray(points[0]) ? points[0] : points;
|
|
20824
|
+
// if this is an array of points, convert it to a flat array of numbers
|
|
20825
|
+
if (typeof flat[0] !== "number") {
|
|
20826
|
+
var p = [];
|
|
20827
|
+
for(var i = 0, il = flat.length; i < il; i++){
|
|
20828
|
+
p.push(flat[i].x, flat[i].y);
|
|
20829
|
+
}
|
|
20830
|
+
flat = p;
|
|
20831
|
+
}
|
|
20832
|
+
this.points = flat;
|
|
20833
|
+
this.closePath = true;
|
|
20834
|
+
}
|
|
20835
|
+
var _proto = Polygon.prototype;
|
|
20836
|
+
/**
|
|
20837
|
+
* Creates a clone of this polygon.
|
|
20838
|
+
* @returns - A copy of the polygon.
|
|
20839
|
+
*/ _proto.clone = function clone() {
|
|
20840
|
+
var points = this.points.slice();
|
|
20841
|
+
var polygon = new Polygon(points);
|
|
20842
|
+
polygon.closePath = this.closePath;
|
|
20843
|
+
return polygon;
|
|
20844
|
+
};
|
|
20845
|
+
/**
|
|
20846
|
+
* Checks whether the x and y coordinates passed to this function are contained within this polygon.
|
|
20847
|
+
* @param x - The X coordinate of the point to test.
|
|
20848
|
+
* @param y - The Y coordinate of the point to test.
|
|
20849
|
+
* @returns - Whether the x/y coordinates are within this polygon.
|
|
20850
|
+
*/ _proto.contains = function contains(x, y) {
|
|
20851
|
+
var inside = false;
|
|
20852
|
+
// use some raycasting to test hits
|
|
20853
|
+
// https://github.com/substack/point-in-polygon/blob/master/index.js
|
|
20854
|
+
var length = this.points.length / 2;
|
|
20855
|
+
for(var i = 0, j = length - 1; i < length; j = i++){
|
|
20856
|
+
var xi = this.points[i * 2];
|
|
20857
|
+
var yi = this.points[i * 2 + 1];
|
|
20858
|
+
var xj = this.points[j * 2];
|
|
20859
|
+
var yj = this.points[j * 2 + 1];
|
|
20860
|
+
var intersect = yi > y !== yj > y && x < (xj - xi) * ((y - yi) / (yj - yi)) + xi;
|
|
20861
|
+
if (intersect) {
|
|
20862
|
+
inside = !inside;
|
|
20863
|
+
}
|
|
20864
|
+
}
|
|
20865
|
+
return inside;
|
|
20866
|
+
};
|
|
20867
|
+
/**
|
|
20868
|
+
* Copies another polygon to this one.
|
|
20869
|
+
* @param polygon - The polygon to copy from.
|
|
20870
|
+
* @returns Returns itself.
|
|
20871
|
+
*/ _proto.copyFrom = function copyFrom(polygon) {
|
|
20872
|
+
this.points = polygon.points.slice();
|
|
20873
|
+
this.closePath = polygon.closePath;
|
|
20874
|
+
return this;
|
|
20875
|
+
};
|
|
20876
|
+
/**
|
|
20877
|
+
* Copies this polygon to another one.
|
|
20878
|
+
* @param polygon - The polygon to copy to.
|
|
20879
|
+
* @returns Returns given parameter.
|
|
20880
|
+
*/ _proto.copyTo = function copyTo(polygon) {
|
|
20881
|
+
polygon.copyFrom(this);
|
|
20882
|
+
return polygon;
|
|
20883
|
+
};
|
|
20884
|
+
_create_class(Polygon, [
|
|
20885
|
+
{
|
|
20886
|
+
key: "lastX",
|
|
20887
|
+
get: /**
|
|
20888
|
+
* Get the last X coordinate of the polygon
|
|
20889
|
+
* @readonly
|
|
20890
|
+
*/ function get() {
|
|
20891
|
+
return this.points[this.points.length - 2];
|
|
20892
|
+
}
|
|
20893
|
+
},
|
|
20894
|
+
{
|
|
20895
|
+
key: "lastY",
|
|
20896
|
+
get: /**
|
|
20897
|
+
* Get the last Y coordinate of the polygon
|
|
20898
|
+
* @readonly
|
|
20899
|
+
*/ function get() {
|
|
20900
|
+
return this.points[this.points.length - 1];
|
|
20901
|
+
}
|
|
20902
|
+
},
|
|
20903
|
+
{
|
|
20904
|
+
key: "x",
|
|
20905
|
+
get: /**
|
|
20906
|
+
* Get the first X coordinate of the polygon
|
|
20907
|
+
* @readonly
|
|
20908
|
+
*/ function get() {
|
|
20909
|
+
return this.points[this.points.length - 2];
|
|
20910
|
+
}
|
|
20911
|
+
},
|
|
20912
|
+
{
|
|
20913
|
+
key: "y",
|
|
20914
|
+
get: /**
|
|
20915
|
+
* Get the first Y coordinate of the polygon
|
|
20916
|
+
* @readonly
|
|
20917
|
+
*/ function get() {
|
|
20918
|
+
return this.points[this.points.length - 1];
|
|
20919
|
+
}
|
|
20920
|
+
}
|
|
20921
|
+
]);
|
|
20922
|
+
return Polygon;
|
|
20923
|
+
}();
|
|
20924
|
+
|
|
20925
|
+
// thanks to https://github.com/mattdesl/adaptive-bezier-curve
|
|
20926
|
+
// for the original code!
|
|
20927
|
+
var RECURSION_LIMIT = 8;
|
|
20928
|
+
var FLT_EPSILON = 1.19209290e-7;
|
|
20929
|
+
var PATH_DISTANCE_EPSILON = 1.0;
|
|
20930
|
+
var defaultBezierSmoothness = 0.5;
|
|
20931
|
+
function buildAdaptiveBezier(points, sX, sY, cp1x, cp1y, cp2x, cp2y, eX, eY, smoothness) {
|
|
20932
|
+
// TODO expose as a parameter
|
|
20933
|
+
var scale = 5;
|
|
20934
|
+
var smoothing = Math.min(0.99, Math.max(0, smoothness != null ? smoothness : defaultBezierSmoothness));
|
|
20935
|
+
var distanceTolerance = (PATH_DISTANCE_EPSILON - smoothing) / scale;
|
|
20936
|
+
distanceTolerance *= distanceTolerance;
|
|
20937
|
+
begin(sX, sY, cp1x, cp1y, cp2x, cp2y, eX, eY, points, distanceTolerance);
|
|
20938
|
+
return points;
|
|
20939
|
+
}
|
|
20940
|
+
//// Based on:
|
|
20941
|
+
//// https://github.com/pelson/antigrain/blob/master/agg-2.4/src/agg_curves.cpp
|
|
20942
|
+
function begin(sX, sY, cp1x, cp1y, cp2x, cp2y, eX, eY, points, distanceTolerance) {
|
|
20943
|
+
// dont need to actually ad this!
|
|
20944
|
+
// points.push(sX, sY);
|
|
20945
|
+
recursive(sX, sY, cp1x, cp1y, cp2x, cp2y, eX, eY, points, distanceTolerance, 0);
|
|
20946
|
+
points.push(eX, eY);
|
|
20947
|
+
}
|
|
20948
|
+
// eslint-disable-next-line max-params
|
|
20949
|
+
function recursive(x1, y1, x2, y2, x3, y3, x4, y4, points, distanceTolerance, level) {
|
|
20950
|
+
if (level > RECURSION_LIMIT) {
|
|
20951
|
+
return;
|
|
20952
|
+
}
|
|
20953
|
+
// Calculate all the mid-points of the line segments
|
|
20954
|
+
// ----------------------
|
|
20955
|
+
var x12 = (x1 + x2) / 2;
|
|
20956
|
+
var y12 = (y1 + y2) / 2;
|
|
20957
|
+
var x23 = (x2 + x3) / 2;
|
|
20958
|
+
var y23 = (y2 + y3) / 2;
|
|
20959
|
+
var x34 = (x3 + x4) / 2;
|
|
20960
|
+
var y34 = (y3 + y4) / 2;
|
|
20961
|
+
var x123 = (x12 + x23) / 2;
|
|
20962
|
+
var y123 = (y12 + y23) / 2;
|
|
20963
|
+
var x234 = (x23 + x34) / 2;
|
|
20964
|
+
var y234 = (y23 + y34) / 2;
|
|
20965
|
+
var x1234 = (x123 + x234) / 2;
|
|
20966
|
+
var y1234 = (y123 + y234) / 2;
|
|
20967
|
+
if (level > 0) {
|
|
20968
|
+
// Try to approximate the full cubic curve by a single straight line
|
|
20969
|
+
// ------------------
|
|
20970
|
+
var dx = x4 - x1;
|
|
20971
|
+
var dy = y4 - y1;
|
|
20972
|
+
var d2 = Math.abs((x2 - x4) * dy - (y2 - y4) * dx);
|
|
20973
|
+
var d3 = Math.abs((x3 - x4) * dy - (y3 - y4) * dx);
|
|
20974
|
+
if (d2 > FLT_EPSILON && d3 > FLT_EPSILON) {
|
|
20975
|
+
// Regular care
|
|
20976
|
+
// -----------------
|
|
20977
|
+
if ((d2 + d3) * (d2 + d3) <= distanceTolerance * (dx * dx + dy * dy)) {
|
|
20978
|
+
// If the curvature doesn't exceed the distanceTolerance value
|
|
20979
|
+
// we tend to finish subdivisions.
|
|
20980
|
+
// ----------------------
|
|
20981
|
+
{
|
|
20982
|
+
points.push(x1234, y1234);
|
|
20983
|
+
return;
|
|
20984
|
+
}
|
|
20985
|
+
}
|
|
20986
|
+
} else if (d2 > FLT_EPSILON) {
|
|
20987
|
+
// p1,p3,p4 are collinear, p2 is considerable
|
|
20988
|
+
// ----------------------
|
|
20989
|
+
if (d2 * d2 <= distanceTolerance * (dx * dx + dy * dy)) {
|
|
20990
|
+
{
|
|
20991
|
+
points.push(x1234, y1234);
|
|
20992
|
+
return;
|
|
20993
|
+
}
|
|
20994
|
+
}
|
|
20995
|
+
} else if (d3 > FLT_EPSILON) {
|
|
20996
|
+
// p1,p2,p4 are collinear, p3 is considerable
|
|
20997
|
+
// ----------------------
|
|
20998
|
+
if (d3 * d3 <= distanceTolerance * (dx * dx + dy * dy)) {
|
|
20999
|
+
{
|
|
21000
|
+
points.push(x1234, y1234);
|
|
21001
|
+
return;
|
|
21002
|
+
}
|
|
21003
|
+
}
|
|
21004
|
+
} else {
|
|
21005
|
+
// Collinear case
|
|
21006
|
+
// -----------------
|
|
21007
|
+
dx = x1234 - (x1 + x4) / 2;
|
|
21008
|
+
dy = y1234 - (y1 + y4) / 2;
|
|
21009
|
+
if (dx * dx + dy * dy <= distanceTolerance) {
|
|
21010
|
+
points.push(x1234, y1234);
|
|
21011
|
+
return;
|
|
21012
|
+
}
|
|
21013
|
+
}
|
|
21014
|
+
}
|
|
21015
|
+
// Continue subdivision
|
|
21016
|
+
// ----------------------
|
|
21017
|
+
recursive(x1, y1, x12, y12, x123, y123, x1234, y1234, points, distanceTolerance, level + 1);
|
|
21018
|
+
recursive(x1234, y1234, x234, y234, x34, y34, x4, y4, points, distanceTolerance, level + 1);
|
|
21019
|
+
}
|
|
21020
|
+
|
|
21021
|
+
var ShapePath = /*#__PURE__*/ function() {
|
|
21022
|
+
function ShapePath(graphicsPath) {
|
|
21023
|
+
this.graphicsPath = graphicsPath;
|
|
21024
|
+
this.currentPoly = null;
|
|
21025
|
+
this.shapePrimitives = [];
|
|
21026
|
+
}
|
|
21027
|
+
var _proto = ShapePath.prototype;
|
|
21028
|
+
/** Builds the path. */ _proto.buildPath = function buildPath() {
|
|
21029
|
+
this.currentPoly = null;
|
|
21030
|
+
this.shapePrimitives.length = 0;
|
|
21031
|
+
var path = this.graphicsPath;
|
|
21032
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(path.instructions), _step; !(_step = _iterator()).done;){
|
|
21033
|
+
var instruction = _step.value;
|
|
21034
|
+
var action = instruction.action;
|
|
21035
|
+
var data = instruction.data;
|
|
21036
|
+
switch(action){
|
|
21037
|
+
case "bezierCurveTo":
|
|
21038
|
+
{
|
|
21039
|
+
this.bezierCurveTo(data[0], data[1], data[2], data[3], data[4], data[5], data[6]);
|
|
21040
|
+
break;
|
|
21041
|
+
}
|
|
21042
|
+
case "moveTo":
|
|
21043
|
+
{
|
|
21044
|
+
this.moveTo(data[0], data[1]);
|
|
21045
|
+
break;
|
|
21046
|
+
}
|
|
21047
|
+
}
|
|
21048
|
+
}
|
|
21049
|
+
this.endPoly();
|
|
21050
|
+
};
|
|
21051
|
+
/**
|
|
21052
|
+
* Adds a cubic Bezier curve to the path.
|
|
21053
|
+
* It requires three points: the first two are control points and the third one is the end point.
|
|
21054
|
+
* The starting point is the last point in the current path.
|
|
21055
|
+
* @param cp1x - The x-coordinate of the first control point.
|
|
21056
|
+
* @param cp1y - The y-coordinate of the first control point.
|
|
21057
|
+
* @param cp2x - The x-coordinate of the second control point.
|
|
21058
|
+
* @param cp2y - The y-coordinate of the second control point.
|
|
21059
|
+
* @param x - The x-coordinate of the end point.
|
|
21060
|
+
* @param y - The y-coordinate of the end point.
|
|
21061
|
+
* @param smoothness - Optional parameter to adjust the smoothness of the curve.
|
|
21062
|
+
* @returns The instance of the current object for chaining.
|
|
21063
|
+
*/ _proto.bezierCurveTo = function bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y, smoothness) {
|
|
21064
|
+
this.ensurePoly();
|
|
21065
|
+
var currentPoly = this.currentPoly;
|
|
21066
|
+
buildAdaptiveBezier(currentPoly.points, currentPoly.lastX, currentPoly.lastY, cp1x, cp1y, cp2x, cp2y, x, y, smoothness);
|
|
21067
|
+
return this;
|
|
21068
|
+
};
|
|
21069
|
+
_proto.moveTo = function moveTo(x, y) {
|
|
21070
|
+
this.startPoly(x, y);
|
|
21071
|
+
return this;
|
|
21072
|
+
};
|
|
21073
|
+
/**
|
|
21074
|
+
* Starts a new polygon path from the specified starting point.
|
|
21075
|
+
* This method initializes a new polygon or ends the current one if it exists.
|
|
21076
|
+
* @param x - The x-coordinate of the starting point of the new polygon.
|
|
21077
|
+
* @param y - The y-coordinate of the starting point of the new polygon.
|
|
21078
|
+
* @returns The instance of the current object for chaining.
|
|
21079
|
+
*/ _proto.startPoly = function startPoly(x, y) {
|
|
21080
|
+
var currentPoly = this.currentPoly;
|
|
21081
|
+
if (currentPoly) {
|
|
21082
|
+
this.endPoly();
|
|
21083
|
+
}
|
|
21084
|
+
currentPoly = new Polygon();
|
|
21085
|
+
currentPoly.points.push(x, y);
|
|
21086
|
+
this.currentPoly = currentPoly;
|
|
21087
|
+
return this;
|
|
21088
|
+
};
|
|
21089
|
+
/**
|
|
21090
|
+
* Ends the current polygon path. If `closePath` is set to true,
|
|
21091
|
+
* the path is closed by connecting the last point to the first one.
|
|
21092
|
+
* This method finalizes the current polygon and prepares it for drawing or adding to the shape primitives.
|
|
21093
|
+
* @param closePath - A boolean indicating whether to close the polygon by connecting the last point
|
|
21094
|
+
* back to the starting point. False by default.
|
|
21095
|
+
* @returns The instance of the current object for chaining.
|
|
21096
|
+
*/ _proto.endPoly = function endPoly(closePath) {
|
|
21097
|
+
if (closePath === void 0) closePath = false;
|
|
21098
|
+
var shape = this.currentPoly;
|
|
21099
|
+
if (shape && shape.points.length > 2) {
|
|
21100
|
+
shape.closePath = closePath;
|
|
21101
|
+
this.shapePrimitives.push({
|
|
21102
|
+
shape: shape
|
|
21103
|
+
});
|
|
21104
|
+
}
|
|
21105
|
+
this.currentPoly = null;
|
|
21106
|
+
return this;
|
|
21107
|
+
};
|
|
21108
|
+
_proto.ensurePoly = function ensurePoly(start) {
|
|
21109
|
+
if (this.currentPoly) {
|
|
21110
|
+
return;
|
|
21111
|
+
}
|
|
21112
|
+
this.currentPoly = new Polygon();
|
|
21113
|
+
this.currentPoly.points.push(0, 0);
|
|
21114
|
+
};
|
|
21115
|
+
return ShapePath;
|
|
21116
|
+
}();
|
|
21117
|
+
|
|
21118
|
+
var GraphicsPath = /*#__PURE__*/ function() {
|
|
21119
|
+
function GraphicsPath() {
|
|
21120
|
+
this.instructions = [];
|
|
21121
|
+
this.dirty = false;
|
|
21122
|
+
}
|
|
21123
|
+
var _proto = GraphicsPath.prototype;
|
|
21124
|
+
/**
|
|
21125
|
+
* Adds a cubic Bezier curve to the path.
|
|
21126
|
+
* It requires three points: the first two are control points and the third one is the end point.
|
|
21127
|
+
* The starting point is the last point in the current path.
|
|
21128
|
+
* @param cp1x - The x-coordinate of the first control point.
|
|
21129
|
+
* @param cp1y - The y-coordinate of the first control point.
|
|
21130
|
+
* @param cp2x - The x-coordinate of the second control point.
|
|
21131
|
+
* @param cp2y - The y-coordinate of the second control point.
|
|
21132
|
+
* @param x - The x-coordinate of the end point.
|
|
21133
|
+
* @param y - The y-coordinate of the end point.
|
|
21134
|
+
* @param smoothness - Optional parameter to adjust the smoothness of the curve.
|
|
21135
|
+
* @returns The instance of the current object for chaining.
|
|
21136
|
+
*/ _proto.bezierCurveTo = function bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y, smoothness) {
|
|
21137
|
+
this.instructions.push({
|
|
21138
|
+
action: "bezierCurveTo",
|
|
21139
|
+
data: [
|
|
21140
|
+
cp1x,
|
|
21141
|
+
cp1y,
|
|
21142
|
+
cp2x,
|
|
21143
|
+
cp2y,
|
|
21144
|
+
x,
|
|
21145
|
+
y,
|
|
21146
|
+
smoothness
|
|
21147
|
+
]
|
|
21148
|
+
});
|
|
21149
|
+
this.dirty = true;
|
|
21150
|
+
return this;
|
|
21151
|
+
};
|
|
21152
|
+
_proto.moveTo = function moveTo(x, y) {
|
|
21153
|
+
this.instructions.push({
|
|
21154
|
+
action: "moveTo",
|
|
21155
|
+
data: [
|
|
21156
|
+
x,
|
|
21157
|
+
y
|
|
21158
|
+
]
|
|
21159
|
+
});
|
|
21160
|
+
this.dirty = true;
|
|
21161
|
+
return this;
|
|
21162
|
+
};
|
|
21163
|
+
_proto.clear = function clear() {
|
|
21164
|
+
this.instructions.length = 0;
|
|
21165
|
+
this.dirty = true;
|
|
21166
|
+
return this;
|
|
21167
|
+
};
|
|
21168
|
+
_create_class(GraphicsPath, [
|
|
21169
|
+
{
|
|
21170
|
+
key: "shapePath",
|
|
21171
|
+
get: /**
|
|
21172
|
+
* Provides access to the internal shape path, ensuring it is up-to-date with the current instructions.
|
|
21173
|
+
* @returns The `ShapePath` instance associated with this `GraphicsPath`.
|
|
21174
|
+
*/ function get() {
|
|
21175
|
+
if (!this._shapePath) {
|
|
21176
|
+
this._shapePath = new ShapePath(this);
|
|
21177
|
+
}
|
|
21178
|
+
if (this.dirty) {
|
|
21179
|
+
this.dirty = false;
|
|
21180
|
+
this._shapePath.buildPath();
|
|
21181
|
+
}
|
|
21182
|
+
return this._shapePath;
|
|
21183
|
+
}
|
|
21184
|
+
}
|
|
21185
|
+
]);
|
|
21186
|
+
return GraphicsPath;
|
|
21187
|
+
}();
|
|
21188
|
+
|
|
21189
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
21190
|
+
|
|
21191
|
+
var libtess_min = {exports: {}};
|
|
21192
|
+
|
|
21193
|
+
/*
|
|
21194
|
+
|
|
21195
|
+
Copyright 2000, Silicon Graphics, Inc. All Rights Reserved.
|
|
21196
|
+
Copyright 2015, Google Inc. All Rights Reserved.
|
|
21197
|
+
|
|
21198
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
21199
|
+
of this software and associated documentation files (the "Software"), to
|
|
21200
|
+
deal in the Software without restriction, including without limitation the
|
|
21201
|
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
21202
|
+
sell copies of the Software, and to permit persons to whom the Software is
|
|
21203
|
+
furnished to do so, subject to the following conditions:
|
|
21204
|
+
|
|
21205
|
+
The above copyright notice including the dates of first publication and
|
|
21206
|
+
either this permission notice or a reference to http://oss.sgi.com/projects/FreeB/
|
|
21207
|
+
shall be included in all copies or substantial portions of the Software.
|
|
21208
|
+
|
|
21209
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21210
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21211
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
21212
|
+
SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
21213
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
|
21214
|
+
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
21215
|
+
|
|
21216
|
+
Original Code. The Original Code is: OpenGL Sample Implementation,
|
|
21217
|
+
Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
|
|
21218
|
+
Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
|
|
21219
|
+
Copyright in any portions created by third parties is as indicated
|
|
21220
|
+
elsewhere herein. All Rights Reserved.
|
|
21221
|
+
*/
|
|
21222
|
+
|
|
21223
|
+
(function (module) {
|
|
21224
|
+
var n;
|
|
21225
|
+
function t(a, b) {
|
|
21226
|
+
return a.b === b.b && a.a === b.a;
|
|
21227
|
+
}
|
|
21228
|
+
function u(a, b) {
|
|
21229
|
+
return a.b < b.b || a.b === b.b && a.a <= b.a;
|
|
21230
|
+
}
|
|
21231
|
+
function v(a, b, c) {
|
|
21232
|
+
var d = b.b - a.b, e = c.b - b.b;
|
|
21233
|
+
return 0 < d + e ? d < e ? b.a - a.a + d / (d + e) * (a.a - c.a) : b.a - c.a + e / (d + e) * (c.a - a.a) : 0;
|
|
21234
|
+
}
|
|
21235
|
+
function x(a, b, c) {
|
|
21236
|
+
var d = b.b - a.b, e = c.b - b.b;
|
|
21237
|
+
return 0 < d + e ? (b.a - c.a) * d + (b.a - a.a) * e : 0;
|
|
21238
|
+
}
|
|
21239
|
+
function z(a, b) {
|
|
21240
|
+
return a.a < b.a || a.a === b.a && a.b <= b.b;
|
|
21241
|
+
}
|
|
21242
|
+
function aa(a, b, c) {
|
|
21243
|
+
var d = b.a - a.a, e = c.a - b.a;
|
|
21244
|
+
return 0 < d + e ? d < e ? b.b - a.b + d / (d + e) * (a.b - c.b) : b.b - c.b + e / (d + e) * (c.b - a.b) : 0;
|
|
21245
|
+
}
|
|
21246
|
+
function ba(a, b, c) {
|
|
21247
|
+
var d = b.a - a.a, e = c.a - b.a;
|
|
21248
|
+
return 0 < d + e ? (b.b - c.b) * d + (b.b - a.b) * e : 0;
|
|
21249
|
+
}
|
|
21250
|
+
function ca(a) {
|
|
21251
|
+
return u(a.b.a, a.a);
|
|
21252
|
+
}
|
|
21253
|
+
function da(a) {
|
|
21254
|
+
return u(a.a, a.b.a);
|
|
21255
|
+
}
|
|
21256
|
+
function A(a, b, c, d) {
|
|
21257
|
+
a = 0 > a ? 0 : a;
|
|
21258
|
+
c = 0 > c ? 0 : c;
|
|
21259
|
+
return a <= c ? 0 === c ? (b + d) / 2 : b + a / (a + c) * (d - b) : d + c / (a + c) * (b - d);
|
|
21260
|
+
}
|
|
21261
|
+
function ea(a) {
|
|
21262
|
+
var b = B(a.b);
|
|
21263
|
+
C(b, a.c);
|
|
21264
|
+
C(b.b, a.c);
|
|
21265
|
+
D(b, a.a);
|
|
21266
|
+
return b;
|
|
21267
|
+
}
|
|
21268
|
+
function E(a, b) {
|
|
21269
|
+
var c = !1, d = !1;
|
|
21270
|
+
a !== b && (b.a !== a.a && (d = !0, F(b.a, a.a)), b.d !== a.d && (c = !0, G(b.d, a.d)), H(b, a), d || (C(b, a.a), a.a.c = a), c || (D(b, a.d), a.d.a = a));
|
|
21271
|
+
}
|
|
21272
|
+
function I(a) {
|
|
21273
|
+
var b = a.b, c = !1;
|
|
21274
|
+
a.d !== a.b.d && (c = !0, G(a.d, a.b.d));
|
|
21275
|
+
a.c === a ? F(a.a, null) : (a.b.d.a = J(a), a.a.c = a.c, H(a, J(a)), c || D(a, a.d));
|
|
21276
|
+
b.c === b ? (F(b.a, null), G(b.d, null)) : (a.d.a = J(b), b.a.c = b.c, H(b, J(b)));
|
|
21277
|
+
fa(a);
|
|
21278
|
+
}
|
|
21279
|
+
function K(a) {
|
|
21280
|
+
var b = B(a), c = b.b;
|
|
21281
|
+
H(b, a.e);
|
|
21282
|
+
b.a = a.b.a;
|
|
21283
|
+
C(c, b.a);
|
|
21284
|
+
b.d = c.d = a.d;
|
|
21285
|
+
b = b.b;
|
|
21286
|
+
H(a.b, J(a.b));
|
|
21287
|
+
H(a.b, b);
|
|
21288
|
+
a.b.a = b.a;
|
|
21289
|
+
b.b.a.c = b.b;
|
|
21290
|
+
b.b.d = a.b.d;
|
|
21291
|
+
b.f = a.f;
|
|
21292
|
+
b.b.f = a.b.f;
|
|
21293
|
+
return b;
|
|
21294
|
+
}
|
|
21295
|
+
function L(a, b) {
|
|
21296
|
+
var c = !1, d = B(a), e = d.b;
|
|
21297
|
+
b.d !== a.d && (c = !0, G(b.d, a.d));
|
|
21298
|
+
H(d, a.e);
|
|
21299
|
+
H(e, b);
|
|
21300
|
+
d.a = a.b.a;
|
|
21301
|
+
e.a = b.a;
|
|
21302
|
+
d.d = e.d = a.d;
|
|
21303
|
+
a.d.a = e;
|
|
21304
|
+
c || D(d, a.d);
|
|
21305
|
+
return d;
|
|
21306
|
+
}
|
|
21307
|
+
function B(a) {
|
|
21308
|
+
var b = new M, c = new M, d = a.b.h;
|
|
21309
|
+
c.h = d;
|
|
21310
|
+
d.b.h = b;
|
|
21311
|
+
b.h = a;
|
|
21312
|
+
a.b.h = c;
|
|
21313
|
+
b.b = c;
|
|
21314
|
+
b.c = b;
|
|
21315
|
+
b.e = c;
|
|
21316
|
+
c.b = b;
|
|
21317
|
+
c.c = c;
|
|
21318
|
+
return c.e = b;
|
|
21319
|
+
}
|
|
21320
|
+
function H(a, b) {
|
|
21321
|
+
var c = a.c, d = b.c;
|
|
21322
|
+
c.b.e = b;
|
|
21323
|
+
d.b.e = a;
|
|
21324
|
+
a.c = d;
|
|
21325
|
+
b.c = c;
|
|
21326
|
+
}
|
|
21327
|
+
function C(a, b) {
|
|
21328
|
+
var c = b.f, d = new N(b, c);
|
|
21329
|
+
c.e = d;
|
|
21330
|
+
b.f = d;
|
|
21331
|
+
c = d.c = a;
|
|
21332
|
+
do c.a = d, c = c.c;
|
|
21333
|
+
while (c !== a);
|
|
21334
|
+
}
|
|
21335
|
+
function D(a, b) {
|
|
21336
|
+
var c = b.d, d = new ga(b, c);
|
|
21337
|
+
c.b = d;
|
|
21338
|
+
b.d = d;
|
|
21339
|
+
d.a = a;
|
|
21340
|
+
d.c = b.c;
|
|
21341
|
+
c = a;
|
|
21342
|
+
do c.d = d, c = c.e;
|
|
21343
|
+
while (c !== a);
|
|
21344
|
+
}
|
|
21345
|
+
function fa(a) {
|
|
21346
|
+
var b = a.h;
|
|
21347
|
+
a = a.b.h;
|
|
21348
|
+
b.b.h = a;
|
|
21349
|
+
a.b.h = b;
|
|
21350
|
+
}
|
|
21351
|
+
function F(a, b) {
|
|
21352
|
+
var c = a.c, d = c;
|
|
21353
|
+
do d.a = b, d = d.c;
|
|
21354
|
+
while (d !== c);
|
|
21355
|
+
c = a.f;
|
|
21356
|
+
d = a.e;
|
|
21357
|
+
d.f = c;
|
|
21358
|
+
c.e = d;
|
|
21359
|
+
}
|
|
21360
|
+
function G(a, b) {
|
|
21361
|
+
var c = a.a, d = c;
|
|
21362
|
+
do d.d = b, d = d.e;
|
|
21363
|
+
while (d !== c);
|
|
21364
|
+
c = a.d;
|
|
21365
|
+
d = a.b;
|
|
21366
|
+
d.d = c;
|
|
21367
|
+
c.b = d;
|
|
21368
|
+
}
|
|
21369
|
+
function ha(a) {
|
|
21370
|
+
var b = 0;
|
|
21371
|
+
Math.abs(a[1]) > Math.abs(a[0]) && (b = 1);
|
|
21372
|
+
Math.abs(a[2]) > Math.abs(a[b]) && (b = 2);
|
|
21373
|
+
return b;
|
|
21374
|
+
}
|
|
21375
|
+
var O = 4 * 1E150;
|
|
21376
|
+
function P(a, b) {
|
|
21377
|
+
a.f += b.f;
|
|
21378
|
+
a.b.f += b.b.f;
|
|
21379
|
+
}
|
|
21380
|
+
function ia(a, b, c) {
|
|
21381
|
+
a = a.a;
|
|
21382
|
+
b = b.a;
|
|
21383
|
+
c = c.a;
|
|
21384
|
+
if (b.b.a === a) return c.b.a === a ? u(b.a, c.a) ? 0 >= x(c.b.a, b.a, c.a) : 0 <= x(b.b.a, c.a, b.a) : 0 >= x(c.b.a, a, c.a);
|
|
21385
|
+
if (c.b.a === a) return 0 <= x(b.b.a, a, b.a);
|
|
21386
|
+
b = v(b.b.a, a, b.a);
|
|
21387
|
+
a = v(c.b.a, a, c.a);
|
|
21388
|
+
return b >= a;
|
|
21389
|
+
}
|
|
21390
|
+
function Q(a) {
|
|
21391
|
+
a.a.i = null;
|
|
21392
|
+
var b = a.e;
|
|
21393
|
+
b.a.c = b.c;
|
|
21394
|
+
b.c.a = b.a;
|
|
21395
|
+
a.e = null;
|
|
21396
|
+
}
|
|
21397
|
+
function ja(a, b) {
|
|
21398
|
+
I(a.a);
|
|
21399
|
+
a.c = !1;
|
|
21400
|
+
a.a = b;
|
|
21401
|
+
b.i = a;
|
|
21402
|
+
}
|
|
21403
|
+
function ka(a) {
|
|
21404
|
+
var b = a.a.a;
|
|
21405
|
+
do a = R(a);
|
|
21406
|
+
while (a.a.a === b);
|
|
21407
|
+
a.c && (b = L(S(a).a.b, a.a.e), ja(a, b), a = R(a));
|
|
21408
|
+
return a;
|
|
21409
|
+
}
|
|
21410
|
+
function la(a, b, c) {
|
|
21411
|
+
var d = new ma;
|
|
21412
|
+
d.a = c;
|
|
21413
|
+
d.e = na(a.f, b.e, d);
|
|
21414
|
+
return c.i = d;
|
|
21415
|
+
}
|
|
21416
|
+
function oa(a, b) {
|
|
21417
|
+
switch(a.s){
|
|
21418
|
+
case 100130:
|
|
21419
|
+
return 0 !== (b & 1);
|
|
21420
|
+
case 100131:
|
|
21421
|
+
return 0 !== b;
|
|
21422
|
+
case 100132:
|
|
21423
|
+
return 0 < b;
|
|
21424
|
+
case 100133:
|
|
21425
|
+
return 0 > b;
|
|
21426
|
+
case 100134:
|
|
21427
|
+
return 2 <= b || -2 >= b;
|
|
21428
|
+
}
|
|
21429
|
+
return !1;
|
|
21430
|
+
}
|
|
21431
|
+
function pa(a) {
|
|
21432
|
+
var b = a.a, c = b.d;
|
|
21433
|
+
c.c = a.d;
|
|
21434
|
+
c.a = b;
|
|
21435
|
+
Q(a);
|
|
21436
|
+
}
|
|
21437
|
+
function T(a, b, c) {
|
|
21438
|
+
a = b;
|
|
21439
|
+
for(b = b.a; a !== c;){
|
|
21440
|
+
a.c = !1;
|
|
21441
|
+
var d = S(a), e = d.a;
|
|
21442
|
+
if (e.a !== b.a) {
|
|
21443
|
+
if (!d.c) {
|
|
21444
|
+
pa(a);
|
|
21445
|
+
break;
|
|
21446
|
+
}
|
|
21447
|
+
e = L(b.c.b, e.b);
|
|
21448
|
+
ja(d, e);
|
|
21449
|
+
}
|
|
21450
|
+
b.c !== e && (E(J(e), e), E(b, e));
|
|
21451
|
+
pa(a);
|
|
21452
|
+
b = d.a;
|
|
21453
|
+
a = d;
|
|
21454
|
+
}
|
|
21455
|
+
return b;
|
|
21456
|
+
}
|
|
21457
|
+
function U(a, b, c, d, e, f) {
|
|
21458
|
+
var g = !0;
|
|
21459
|
+
do la(a, b, c.b), c = c.c;
|
|
21460
|
+
while (c !== d);
|
|
21461
|
+
for(null === e && (e = S(b).a.b.c);;){
|
|
21462
|
+
d = S(b);
|
|
21463
|
+
c = d.a.b;
|
|
21464
|
+
if (c.a !== e.a) break;
|
|
21465
|
+
c.c !== e && (E(J(c), c), E(J(e), c));
|
|
21466
|
+
d.f = b.f - c.f;
|
|
21467
|
+
d.d = oa(a, d.f);
|
|
21468
|
+
b.b = !0;
|
|
21469
|
+
!g && qa(a, b) && (P(c, e), Q(b), I(e));
|
|
21470
|
+
g = !1;
|
|
21471
|
+
b = d;
|
|
21472
|
+
e = c;
|
|
21473
|
+
}
|
|
21474
|
+
b.b = !0;
|
|
21475
|
+
f && ra(a, b);
|
|
21476
|
+
}
|
|
21477
|
+
function sa(a, b, c, d, e) {
|
|
21478
|
+
var f = [
|
|
21479
|
+
b.g[0],
|
|
21480
|
+
b.g[1],
|
|
21481
|
+
b.g[2]
|
|
21482
|
+
];
|
|
21483
|
+
b.d = null;
|
|
21484
|
+
b.d = a.o ? a.o(f, c, d, a.c) || null : null;
|
|
21485
|
+
null === b.d && (e ? a.n || (V(a, 100156), a.n = !0) : b.d = c[0]);
|
|
21486
|
+
}
|
|
21487
|
+
function ta(a, b, c) {
|
|
21488
|
+
var d = [
|
|
21489
|
+
null,
|
|
21490
|
+
null,
|
|
21491
|
+
null,
|
|
21492
|
+
null
|
|
21493
|
+
];
|
|
21494
|
+
d[0] = b.a.d;
|
|
21495
|
+
d[1] = c.a.d;
|
|
21496
|
+
sa(a, b.a, d, [
|
|
21497
|
+
.5,
|
|
21498
|
+
.5,
|
|
21499
|
+
0,
|
|
21500
|
+
0
|
|
21501
|
+
], !1);
|
|
21502
|
+
E(b, c);
|
|
21503
|
+
}
|
|
21504
|
+
function ua(a, b, c, d, e) {
|
|
21505
|
+
var f = Math.abs(b.b - a.b) + Math.abs(b.a - a.a), g = Math.abs(c.b - a.b) + Math.abs(c.a - a.a), h = e + 1;
|
|
21506
|
+
d[e] = .5 * g / (f + g);
|
|
21507
|
+
d[h] = .5 * f / (f + g);
|
|
21508
|
+
a.g[0] += d[e] * b.g[0] + d[h] * c.g[0];
|
|
21509
|
+
a.g[1] += d[e] * b.g[1] + d[h] * c.g[1];
|
|
21510
|
+
a.g[2] += d[e] * b.g[2] + d[h] * c.g[2];
|
|
21511
|
+
}
|
|
21512
|
+
function qa(a, b) {
|
|
21513
|
+
var c = S(b), d = b.a, e = c.a;
|
|
21514
|
+
if (u(d.a, e.a)) {
|
|
21515
|
+
if (0 < x(e.b.a, d.a, e.a)) return !1;
|
|
21516
|
+
if (!t(d.a, e.a)) K(e.b), E(d, J(e)), b.b = c.b = !0;
|
|
21517
|
+
else if (d.a !== e.a) {
|
|
21518
|
+
var c = a.e, f = d.a.h;
|
|
21519
|
+
if (0 <= f) {
|
|
21520
|
+
var c = c.b, g = c.d, h = c.e, k = c.c, l = k[f];
|
|
21521
|
+
g[l] = g[c.a];
|
|
21522
|
+
k[g[l]] = l;
|
|
21523
|
+
l <= --c.a && (1 >= l ? W(c, l) : u(h[g[l >> 1]], h[g[l]]) ? W(c, l) : va(c, l));
|
|
21524
|
+
h[f] = null;
|
|
21525
|
+
k[f] = c.b;
|
|
21526
|
+
c.b = f;
|
|
21527
|
+
} else for(c.c[-(f + 1)] = null; 0 < c.a && null === c.c[c.d[c.a - 1]];)--c.a;
|
|
21528
|
+
ta(a, J(e), d);
|
|
21529
|
+
}
|
|
21530
|
+
} else {
|
|
21531
|
+
if (0 > x(d.b.a, e.a, d.a)) return !1;
|
|
21532
|
+
R(b).b = b.b = !0;
|
|
21533
|
+
K(d.b);
|
|
21534
|
+
E(J(e), d);
|
|
21535
|
+
}
|
|
21536
|
+
return !0;
|
|
21537
|
+
}
|
|
21538
|
+
function wa(a, b) {
|
|
21539
|
+
var c = S(b), d = b.a, e = c.a, f = d.a, g = e.a, h = d.b.a, k = e.b.a, l = new N;
|
|
21540
|
+
x(h, a.a, f);
|
|
21541
|
+
x(k, a.a, g);
|
|
21542
|
+
if (f === g || Math.min(f.a, h.a) > Math.max(g.a, k.a)) return !1;
|
|
21543
|
+
if (u(f, g)) {
|
|
21544
|
+
if (0 < x(k, f, g)) return !1;
|
|
21545
|
+
} else if (0 > x(h, g, f)) return !1;
|
|
21546
|
+
var r = h, p = f, q = k, y = g, m, w;
|
|
21547
|
+
u(r, p) || (m = r, r = p, p = m);
|
|
21548
|
+
u(q, y) || (m = q, q = y, y = m);
|
|
21549
|
+
u(r, q) || (m = r, r = q, q = m, m = p, p = y, y = m);
|
|
21550
|
+
u(q, p) ? u(p, y) ? (m = v(r, q, p), w = v(q, p, y), 0 > m + w && (m = -m, w = -w), l.b = A(m, q.b, w, p.b)) : (m = x(r, q, p), w = -x(r, y, p), 0 > m + w && (m = -m, w = -w), l.b = A(m, q.b, w, y.b)) : l.b = (q.b + p.b) / 2;
|
|
21551
|
+
z(r, p) || (m = r, r = p, p = m);
|
|
21552
|
+
z(q, y) || (m = q, q = y, y = m);
|
|
21553
|
+
z(r, q) || (m = r, r = q, q = m, m = p, p = y, y = m);
|
|
21554
|
+
z(q, p) ? z(p, y) ? (m = aa(r, q, p), w = aa(q, p, y), 0 > m + w && (m = -m, w = -w), l.a = A(m, q.a, w, p.a)) : (m = ba(r, q, p), w = -ba(r, y, p), 0 > m + w && (m = -m, w = -w), l.a = A(m, q.a, w, y.a)) : l.a = (q.a + p.a) / 2;
|
|
21555
|
+
u(l, a.a) && (l.b = a.a.b, l.a = a.a.a);
|
|
21556
|
+
r = u(f, g) ? f : g;
|
|
21557
|
+
u(r, l) && (l.b = r.b, l.a = r.a);
|
|
21558
|
+
if (t(l, f) || t(l, g)) return qa(a, b), !1;
|
|
21559
|
+
if (!t(h, a.a) && 0 <= x(h, a.a, l) || !t(k, a.a) && 0 >= x(k, a.a, l)) {
|
|
21560
|
+
if (k === a.a) return K(d.b), E(e.b, d), b = ka(b), d = S(b).a, T(a, S(b), c), U(a, b, J(d), d, d, !0), !0;
|
|
21561
|
+
if (h === a.a) {
|
|
21562
|
+
K(e.b);
|
|
21563
|
+
E(d.e, J(e));
|
|
21564
|
+
f = c = b;
|
|
21565
|
+
g = f.a.b.a;
|
|
21566
|
+
do f = R(f);
|
|
21567
|
+
while (f.a.b.a === g);
|
|
21568
|
+
b = f;
|
|
21569
|
+
f = S(b).a.b.c;
|
|
21570
|
+
c.a = J(e);
|
|
21571
|
+
e = T(a, c, null);
|
|
21572
|
+
U(a, b, e.c, d.b.c, f, !0);
|
|
21573
|
+
return !0;
|
|
21574
|
+
}
|
|
21575
|
+
0 <= x(h, a.a, l) && (R(b).b = b.b = !0, K(d.b), d.a.b = a.a.b, d.a.a = a.a.a);
|
|
21576
|
+
0 >= x(k, a.a, l) && (b.b = c.b = !0, K(e.b), e.a.b = a.a.b, e.a.a = a.a.a);
|
|
21577
|
+
return !1;
|
|
21578
|
+
}
|
|
21579
|
+
K(d.b);
|
|
21580
|
+
K(e.b);
|
|
21581
|
+
E(J(e), d);
|
|
21582
|
+
d.a.b = l.b;
|
|
21583
|
+
d.a.a = l.a;
|
|
21584
|
+
d.a.h = xa(a.e, d.a);
|
|
21585
|
+
d = d.a;
|
|
21586
|
+
e = [
|
|
21587
|
+
0,
|
|
21588
|
+
0,
|
|
21589
|
+
0,
|
|
21590
|
+
0
|
|
21591
|
+
];
|
|
21592
|
+
l = [
|
|
21593
|
+
f.d,
|
|
21594
|
+
h.d,
|
|
21595
|
+
g.d,
|
|
21596
|
+
k.d
|
|
21597
|
+
];
|
|
21598
|
+
d.g[0] = d.g[1] = d.g[2] = 0;
|
|
21599
|
+
ua(d, f, h, e, 0);
|
|
21600
|
+
ua(d, g, k, e, 2);
|
|
21601
|
+
sa(a, d, l, e, !0);
|
|
21602
|
+
R(b).b = b.b = c.b = !0;
|
|
21603
|
+
return !1;
|
|
21604
|
+
}
|
|
21605
|
+
function ra(a, b) {
|
|
21606
|
+
for(var c = S(b);;){
|
|
21607
|
+
for(; c.b;)b = c, c = S(c);
|
|
21608
|
+
if (!b.b && (c = b, b = R(b), null === b || !b.b)) break;
|
|
21609
|
+
b.b = !1;
|
|
21610
|
+
var d = b.a, e = c.a, f;
|
|
21611
|
+
if (f = d.b.a !== e.b.a) a: {
|
|
21612
|
+
f = b;
|
|
21613
|
+
var g = S(f), h = f.a, k = g.a, l = void 0;
|
|
21614
|
+
if (u(h.b.a, k.b.a)) {
|
|
21615
|
+
if (0 > x(h.b.a, k.b.a, h.a)) {
|
|
21616
|
+
f = !1;
|
|
21617
|
+
break a;
|
|
21618
|
+
}
|
|
21619
|
+
R(f).b = f.b = !0;
|
|
21620
|
+
l = K(h);
|
|
21621
|
+
E(k.b, l);
|
|
21622
|
+
l.d.c = f.d;
|
|
21623
|
+
} else {
|
|
21624
|
+
if (0 < x(k.b.a, h.b.a, k.a)) {
|
|
21625
|
+
f = !1;
|
|
21626
|
+
break a;
|
|
21627
|
+
}
|
|
21628
|
+
f.b = g.b = !0;
|
|
21629
|
+
l = K(k);
|
|
21630
|
+
E(h.e, k.b);
|
|
21631
|
+
l.b.d.c = f.d;
|
|
21632
|
+
}
|
|
21633
|
+
f = !0;
|
|
21634
|
+
}
|
|
21635
|
+
f && (c.c ? (Q(c), I(e), c = S(b), e = c.a) : b.c && (Q(b), I(d), b = R(c), d = b.a));
|
|
21636
|
+
if (d.a !== e.a) {
|
|
21637
|
+
if (d.b.a === e.b.a || b.c || c.c || d.b.a !== a.a && e.b.a !== a.a) qa(a, b);
|
|
21638
|
+
else if (wa(a, b)) break;
|
|
21639
|
+
}
|
|
21640
|
+
d.a === e.a && d.b.a === e.b.a && (P(e, d), Q(b), I(d), b = R(c));
|
|
21641
|
+
}
|
|
21642
|
+
}
|
|
21643
|
+
function ya(a, b) {
|
|
21644
|
+
a.a = b;
|
|
21645
|
+
for(var c = b.c; null === c.i;)if (c = c.c, c === b.c) {
|
|
21646
|
+
var c = a, d = b, e = new ma;
|
|
21647
|
+
e.a = d.c.b;
|
|
21648
|
+
var f = c.f, g = f.a;
|
|
21649
|
+
do g = g.a;
|
|
21650
|
+
while (null !== g.b && !f.c(f.b, e, g.b));
|
|
21651
|
+
var f = g.b, h = S(f), e = f.a, g = h.a;
|
|
21652
|
+
if (0 === x(e.b.a, d, e.a)) e = f.a, t(e.a, d) || t(e.b.a, d) || (K(e.b), f.c && (I(e.c), f.c = !1), E(d.c, e), ya(c, d));
|
|
21653
|
+
else {
|
|
21654
|
+
var k = u(g.b.a, e.b.a) ? f : h, h = void 0;
|
|
21655
|
+
f.d || k.c ? (k === f ? h = L(d.c.b, e.e) : h = L(g.b.c.b, d.c).b, k.c ? ja(k, h) : (e = c, f = la(c, f, h), f.f = R(f).f + f.a.f, f.d = oa(e, f.f)), ya(c, d)) : U(c, f, d.c, d.c, null, !0);
|
|
21656
|
+
}
|
|
21657
|
+
return;
|
|
21658
|
+
}
|
|
21659
|
+
c = ka(c.i);
|
|
21660
|
+
e = S(c);
|
|
21661
|
+
f = e.a;
|
|
21662
|
+
e = T(a, e, null);
|
|
21663
|
+
if (e.c === f) {
|
|
21664
|
+
var f = e, e = f.c, g = S(c), h = c.a, k = g.a, l = !1;
|
|
21665
|
+
h.b.a !== k.b.a && wa(a, c);
|
|
21666
|
+
t(h.a, a.a) && (E(J(e), h), c = ka(c), e = S(c).a, T(a, S(c), g), l = !0);
|
|
21667
|
+
t(k.a, a.a) && (E(f, J(k)), f = T(a, g, null), l = !0);
|
|
21668
|
+
l ? U(a, c, f.c, e, e, !0) : (u(k.a, h.a) ? d = J(k) : d = h, d = L(f.c.b, d), U(a, c, d, d.c, d.c, !1), d.b.i.c = !0, ra(a, c));
|
|
21669
|
+
} else U(a, c, e.c, f, f, !0);
|
|
21670
|
+
}
|
|
21671
|
+
function za(a, b) {
|
|
21672
|
+
var c = new ma, d = ea(a.b);
|
|
21673
|
+
d.a.b = O;
|
|
21674
|
+
d.a.a = b;
|
|
21675
|
+
d.b.a.b = -O;
|
|
21676
|
+
d.b.a.a = b;
|
|
21677
|
+
a.a = d.b.a;
|
|
21678
|
+
c.a = d;
|
|
21679
|
+
c.f = 0;
|
|
21680
|
+
c.d = !1;
|
|
21681
|
+
c.c = !1;
|
|
21682
|
+
c.h = !0;
|
|
21683
|
+
c.b = !1;
|
|
21684
|
+
d = a.f;
|
|
21685
|
+
d = na(d, d.a, c);
|
|
21686
|
+
c.e = d;
|
|
21687
|
+
}
|
|
21688
|
+
function Aa(a) {
|
|
21689
|
+
this.a = new Ba;
|
|
21690
|
+
this.b = a;
|
|
21691
|
+
this.c = ia;
|
|
21692
|
+
}
|
|
21693
|
+
function na(a, b, c) {
|
|
21694
|
+
do b = b.c;
|
|
21695
|
+
while (null !== b.b && !a.c(a.b, b.b, c));
|
|
21696
|
+
a = new Ba(c, b.a, b);
|
|
21697
|
+
b.a.c = a;
|
|
21698
|
+
return b.a = a;
|
|
21699
|
+
}
|
|
21700
|
+
function Ba(a, b, c) {
|
|
21701
|
+
this.b = a || null;
|
|
21702
|
+
this.a = b || this;
|
|
21703
|
+
this.c = c || this;
|
|
21704
|
+
}
|
|
21705
|
+
function X() {
|
|
21706
|
+
this.d = Y;
|
|
21707
|
+
this.p = this.b = this.q = null;
|
|
21708
|
+
this.j = [
|
|
21709
|
+
0,
|
|
21710
|
+
0,
|
|
21711
|
+
0
|
|
21712
|
+
];
|
|
21713
|
+
this.s = 100130;
|
|
21714
|
+
this.n = !1;
|
|
21715
|
+
this.o = this.a = this.e = this.f = null;
|
|
21716
|
+
this.m = !1;
|
|
21717
|
+
this.c = this.r = this.i = this.k = this.l = this.h = null;
|
|
21718
|
+
}
|
|
21719
|
+
var Y = 0;
|
|
21720
|
+
n = X.prototype;
|
|
21721
|
+
n.x = function() {
|
|
21722
|
+
Z(this, Y);
|
|
21723
|
+
};
|
|
21724
|
+
n.B = function(a, b) {
|
|
21725
|
+
switch(a){
|
|
21726
|
+
case 100142:
|
|
21727
|
+
return;
|
|
21728
|
+
case 100140:
|
|
21729
|
+
switch(b){
|
|
21730
|
+
case 100130:
|
|
21731
|
+
case 100131:
|
|
21732
|
+
case 100132:
|
|
21733
|
+
case 100133:
|
|
21734
|
+
case 100134:
|
|
21735
|
+
this.s = b;
|
|
21736
|
+
return;
|
|
21737
|
+
}
|
|
21738
|
+
break;
|
|
21739
|
+
case 100141:
|
|
21740
|
+
this.m = !!b;
|
|
21741
|
+
return;
|
|
21742
|
+
default:
|
|
21743
|
+
V(this, 100900);
|
|
21744
|
+
return;
|
|
21745
|
+
}
|
|
21746
|
+
V(this, 100901);
|
|
21747
|
+
};
|
|
21748
|
+
n.y = function(a) {
|
|
21749
|
+
switch(a){
|
|
21750
|
+
case 100142:
|
|
21751
|
+
return 0;
|
|
21752
|
+
case 100140:
|
|
21753
|
+
return this.s;
|
|
21754
|
+
case 100141:
|
|
21755
|
+
return this.m;
|
|
21756
|
+
default:
|
|
21757
|
+
V(this, 100900);
|
|
21758
|
+
}
|
|
21759
|
+
return !1;
|
|
21760
|
+
};
|
|
21761
|
+
n.A = function(a, b, c) {
|
|
21762
|
+
this.j[0] = a;
|
|
21763
|
+
this.j[1] = b;
|
|
21764
|
+
this.j[2] = c;
|
|
21765
|
+
};
|
|
21766
|
+
n.z = function(a, b) {
|
|
21767
|
+
var c = b ? b : null;
|
|
21768
|
+
switch(a){
|
|
21769
|
+
case 100100:
|
|
21770
|
+
case 100106:
|
|
21771
|
+
this.h = c;
|
|
21772
|
+
break;
|
|
21773
|
+
case 100104:
|
|
21774
|
+
case 100110:
|
|
21775
|
+
this.l = c;
|
|
21776
|
+
break;
|
|
21777
|
+
case 100101:
|
|
21778
|
+
case 100107:
|
|
21779
|
+
this.k = c;
|
|
21780
|
+
break;
|
|
21781
|
+
case 100102:
|
|
21782
|
+
case 100108:
|
|
21783
|
+
this.i = c;
|
|
21784
|
+
break;
|
|
21785
|
+
case 100103:
|
|
21786
|
+
case 100109:
|
|
21787
|
+
this.p = c;
|
|
21788
|
+
break;
|
|
21789
|
+
case 100105:
|
|
21790
|
+
case 100111:
|
|
21791
|
+
this.o = c;
|
|
21792
|
+
break;
|
|
21793
|
+
case 100112:
|
|
21794
|
+
this.r = c;
|
|
21795
|
+
break;
|
|
21796
|
+
default:
|
|
21797
|
+
V(this, 100900);
|
|
21798
|
+
}
|
|
21799
|
+
};
|
|
21800
|
+
n.C = function(a, b) {
|
|
21801
|
+
var c = !1, d = [
|
|
21802
|
+
0,
|
|
21803
|
+
0,
|
|
21804
|
+
0
|
|
21805
|
+
];
|
|
21806
|
+
Z(this, 2);
|
|
21807
|
+
for(var e = 0; 3 > e; ++e){
|
|
21808
|
+
var f = a[e];
|
|
21809
|
+
-1E150 > f && (f = -1E150, c = !0);
|
|
21810
|
+
1E150 < f && (f = 1E150, c = !0);
|
|
21811
|
+
d[e] = f;
|
|
21812
|
+
}
|
|
21813
|
+
c && V(this, 100155);
|
|
21814
|
+
c = this.q;
|
|
21815
|
+
null === c ? (c = ea(this.b), E(c, c.b)) : (K(c), c = c.e);
|
|
21816
|
+
c.a.d = b;
|
|
21817
|
+
c.a.g[0] = d[0];
|
|
21818
|
+
c.a.g[1] = d[1];
|
|
21819
|
+
c.a.g[2] = d[2];
|
|
21820
|
+
c.f = 1;
|
|
21821
|
+
c.b.f = -1;
|
|
21822
|
+
this.q = c;
|
|
21823
|
+
};
|
|
21824
|
+
n.u = function(a) {
|
|
21825
|
+
Z(this, Y);
|
|
21826
|
+
this.d = 1;
|
|
21827
|
+
this.b = new Ca;
|
|
21828
|
+
this.c = a;
|
|
21829
|
+
};
|
|
21830
|
+
n.t = function() {
|
|
21831
|
+
Z(this, 1);
|
|
21832
|
+
this.d = 2;
|
|
21833
|
+
this.q = null;
|
|
21834
|
+
};
|
|
21835
|
+
n.v = function() {
|
|
21836
|
+
Z(this, 2);
|
|
21837
|
+
this.d = 1;
|
|
21838
|
+
};
|
|
21839
|
+
n.w = function() {
|
|
21840
|
+
Z(this, 1);
|
|
21841
|
+
this.d = Y;
|
|
21842
|
+
var a = this.j[0], b = this.j[1], c = this.j[2], d = !1, e = [
|
|
21843
|
+
a,
|
|
21844
|
+
b,
|
|
21845
|
+
c
|
|
21846
|
+
];
|
|
21847
|
+
if (0 === a && 0 === b && 0 === c) {
|
|
21848
|
+
for(var b = [
|
|
21849
|
+
-2 * 1E150,
|
|
21850
|
+
-2 * 1E150,
|
|
21851
|
+
-2 * 1E150
|
|
21852
|
+
], f = [
|
|
21853
|
+
2 * 1E150,
|
|
21854
|
+
2 * 1E150,
|
|
21855
|
+
2 * 1E150
|
|
21856
|
+
], c = [], g = [], d = this.b.c, a = d.e; a !== d; a = a.e)for(var h = 0; 3 > h; ++h){
|
|
21857
|
+
var k = a.g[h];
|
|
21858
|
+
k < f[h] && (f[h] = k, g[h] = a);
|
|
21859
|
+
k > b[h] && (b[h] = k, c[h] = a);
|
|
21860
|
+
}
|
|
21861
|
+
a = 0;
|
|
21862
|
+
b[1] - f[1] > b[0] - f[0] && (a = 1);
|
|
21863
|
+
b[2] - f[2] > b[a] - f[a] && (a = 2);
|
|
21864
|
+
if (f[a] >= b[a]) e[0] = 0, e[1] = 0, e[2] = 1;
|
|
21865
|
+
else {
|
|
21866
|
+
b = 0;
|
|
21867
|
+
f = g[a];
|
|
21868
|
+
c = c[a];
|
|
21869
|
+
g = [
|
|
21870
|
+
0,
|
|
21871
|
+
0,
|
|
21872
|
+
0
|
|
21873
|
+
];
|
|
21874
|
+
f = [
|
|
21875
|
+
f.g[0] - c.g[0],
|
|
21876
|
+
f.g[1] - c.g[1],
|
|
21877
|
+
f.g[2] - c.g[2]
|
|
21878
|
+
];
|
|
21879
|
+
h = [
|
|
21880
|
+
0,
|
|
21881
|
+
0,
|
|
21882
|
+
0
|
|
21883
|
+
];
|
|
21884
|
+
for(a = d.e; a !== d; a = a.e)h[0] = a.g[0] - c.g[0], h[1] = a.g[1] - c.g[1], h[2] = a.g[2] - c.g[2], g[0] = f[1] * h[2] - f[2] * h[1], g[1] = f[2] * h[0] - f[0] * h[2], g[2] = f[0] * h[1] - f[1] * h[0], k = g[0] * g[0] + g[1] * g[1] + g[2] * g[2], k > b && (b = k, e[0] = g[0], e[1] = g[1], e[2] = g[2]);
|
|
21885
|
+
0 >= b && (e[0] = e[1] = e[2] = 0, e[ha(f)] = 1);
|
|
21886
|
+
}
|
|
21887
|
+
d = !0;
|
|
21888
|
+
}
|
|
21889
|
+
g = ha(e);
|
|
21890
|
+
a = this.b.c;
|
|
21891
|
+
b = (g + 1) % 3;
|
|
21892
|
+
c = (g + 2) % 3;
|
|
21893
|
+
g = 0 < e[g] ? 1 : -1;
|
|
21894
|
+
for(e = a.e; e !== a; e = e.e)e.b = e.g[b], e.a = g * e.g[c];
|
|
21895
|
+
if (d) {
|
|
21896
|
+
e = 0;
|
|
21897
|
+
d = this.b.a;
|
|
21898
|
+
for(a = d.b; a !== d; a = a.b)if (b = a.a, !(0 >= b.f)) {
|
|
21899
|
+
do e += (b.a.b - b.b.a.b) * (b.a.a + b.b.a.a), b = b.e;
|
|
21900
|
+
while (b !== a.a);
|
|
21901
|
+
}
|
|
21902
|
+
if (0 > e) for(e = this.b.c, d = e.e; d !== e; d = d.e)d.a = -d.a;
|
|
21903
|
+
}
|
|
21904
|
+
this.n = !1;
|
|
21905
|
+
e = this.b.b;
|
|
21906
|
+
for(a = e.h; a !== e; a = d)if (d = a.h, b = a.e, t(a.a, a.b.a) && a.e.e !== a && (ta(this, b, a), I(a), a = b, b = a.e), b.e === a) {
|
|
21907
|
+
if (b !== a) {
|
|
21908
|
+
if (b === d || b === d.b) d = d.h;
|
|
21909
|
+
I(b);
|
|
21910
|
+
}
|
|
21911
|
+
if (a === d || a === d.b) d = d.h;
|
|
21912
|
+
I(a);
|
|
21913
|
+
}
|
|
21914
|
+
this.e = e = new Da;
|
|
21915
|
+
d = this.b.c;
|
|
21916
|
+
for(a = d.e; a !== d; a = a.e)a.h = xa(e, a);
|
|
21917
|
+
Ea(e);
|
|
21918
|
+
this.f = new Aa(this);
|
|
21919
|
+
za(this, -O);
|
|
21920
|
+
for(za(this, O); null !== (e = Fa(this.e));){
|
|
21921
|
+
for(;;){
|
|
21922
|
+
a: if (a = this.e, 0 === a.a) d = Ga(a.b);
|
|
21923
|
+
else if (d = a.c[a.d[a.a - 1]], 0 !== a.b.a && (a = Ga(a.b), u(a, d))) {
|
|
21924
|
+
d = a;
|
|
21925
|
+
break a;
|
|
21926
|
+
}
|
|
21927
|
+
if (null === d || !t(d, e)) break;
|
|
21928
|
+
d = Fa(this.e);
|
|
21929
|
+
ta(this, e.c, d.c);
|
|
21930
|
+
}
|
|
21931
|
+
ya(this, e);
|
|
21932
|
+
}
|
|
21933
|
+
this.a = this.f.a.a.b.a.a;
|
|
21934
|
+
for(e = 0; null !== (d = this.f.a.a.b);)d.h || ++e, Q(d);
|
|
21935
|
+
this.f = null;
|
|
21936
|
+
e = this.e;
|
|
21937
|
+
e.b = null;
|
|
21938
|
+
e.d = null;
|
|
21939
|
+
this.e = e.c = null;
|
|
21940
|
+
e = this.b;
|
|
21941
|
+
for(a = e.a.b; a !== e.a; a = d)d = a.b, a = a.a, a.e.e === a && (P(a.c, a), I(a));
|
|
21942
|
+
if (!this.n) {
|
|
21943
|
+
e = this.b;
|
|
21944
|
+
if (this.m) for(a = e.b.h; a !== e.b; a = d)d = a.h, a.b.d.c !== a.d.c ? a.f = a.d.c ? 1 : -1 : I(a);
|
|
21945
|
+
else for(a = e.a.b; a !== e.a; a = d)if (d = a.b, a.c) {
|
|
21946
|
+
for(a = a.a; u(a.b.a, a.a); a = a.c.b);
|
|
21947
|
+
for(; u(a.a, a.b.a); a = a.e);
|
|
21948
|
+
b = a.c.b;
|
|
21949
|
+
for(c = void 0; a.e !== b;)if (u(a.b.a, b.a)) {
|
|
21950
|
+
for(; b.e !== a && (ca(b.e) || 0 >= x(b.a, b.b.a, b.e.b.a));)c = L(b.e, b), b = c.b;
|
|
21951
|
+
b = b.c.b;
|
|
21952
|
+
} else {
|
|
21953
|
+
for(; b.e !== a && (da(a.c.b) || 0 <= x(a.b.a, a.a, a.c.b.a));)c = L(a, a.c.b), a = c.b;
|
|
21954
|
+
a = a.e;
|
|
21955
|
+
}
|
|
21956
|
+
for(; b.e.e !== a;)c = L(b.e, b), b = c.b;
|
|
21957
|
+
}
|
|
21958
|
+
if (this.h || this.i || this.k || this.l) if (this.m) for(e = this.b, d = e.a.b; d !== e.a; d = d.b){
|
|
21959
|
+
if (d.c) {
|
|
21960
|
+
this.h && this.h(2, this.c);
|
|
21961
|
+
a = d.a;
|
|
21962
|
+
do this.k && this.k(a.a.d, this.c), a = a.e;
|
|
21963
|
+
while (a !== d.a);
|
|
21964
|
+
this.i && this.i(this.c);
|
|
21965
|
+
}
|
|
21966
|
+
}
|
|
21967
|
+
else {
|
|
21968
|
+
e = this.b;
|
|
21969
|
+
d = !!this.l;
|
|
21970
|
+
a = !1;
|
|
21971
|
+
b = -1;
|
|
21972
|
+
for(c = e.a.d; c !== e.a; c = c.d)if (c.c) {
|
|
21973
|
+
a || (this.h && this.h(4, this.c), a = !0);
|
|
21974
|
+
g = c.a;
|
|
21975
|
+
do d && (f = g.b.d.c ? 0 : 1, b !== f && (b = f, this.l && this.l(!!b, this.c))), this.k && this.k(g.a.d, this.c), g = g.e;
|
|
21976
|
+
while (g !== c.a);
|
|
21977
|
+
}
|
|
21978
|
+
a && this.i && this.i(this.c);
|
|
21979
|
+
}
|
|
21980
|
+
if (this.r) {
|
|
21981
|
+
e = this.b;
|
|
21982
|
+
for(a = e.a.b; a !== e.a; a = d)if (d = a.b, !a.c) {
|
|
21983
|
+
b = a.a;
|
|
21984
|
+
c = b.e;
|
|
21985
|
+
g = void 0;
|
|
21986
|
+
do g = c, c = g.e, g.d = null, null === g.b.d && (g.c === g ? F(g.a, null) : (g.a.c = g.c, H(g, J(g))), f = g.b, f.c === f ? F(f.a, null) : (f.a.c = f.c, H(f, J(f))), fa(g));
|
|
21987
|
+
while (g !== b);
|
|
21988
|
+
b = a.d;
|
|
21989
|
+
a = a.b;
|
|
21990
|
+
a.d = b;
|
|
21991
|
+
b.b = a;
|
|
21992
|
+
}
|
|
21993
|
+
this.r(this.b);
|
|
21994
|
+
this.c = this.b = null;
|
|
21995
|
+
return;
|
|
21996
|
+
}
|
|
21997
|
+
}
|
|
21998
|
+
this.b = this.c = null;
|
|
21999
|
+
};
|
|
22000
|
+
function Z(a, b) {
|
|
22001
|
+
if (a.d !== b) for(; a.d !== b;)if (a.d < b) switch(a.d){
|
|
22002
|
+
case Y:
|
|
22003
|
+
V(a, 100151);
|
|
22004
|
+
a.u(null);
|
|
22005
|
+
break;
|
|
22006
|
+
case 1:
|
|
22007
|
+
V(a, 100152), a.t();
|
|
22008
|
+
}
|
|
22009
|
+
else switch(a.d){
|
|
22010
|
+
case 2:
|
|
22011
|
+
V(a, 100154);
|
|
22012
|
+
a.v();
|
|
22013
|
+
break;
|
|
22014
|
+
case 1:
|
|
22015
|
+
V(a, 100153), a.w();
|
|
22016
|
+
}
|
|
22017
|
+
}
|
|
22018
|
+
function V(a, b) {
|
|
22019
|
+
a.p && a.p(b, a.c);
|
|
22020
|
+
}
|
|
22021
|
+
function ga(a, b) {
|
|
22022
|
+
this.b = a || this;
|
|
22023
|
+
this.d = b || this;
|
|
22024
|
+
this.a = null;
|
|
22025
|
+
this.c = !1;
|
|
22026
|
+
}
|
|
22027
|
+
function M() {
|
|
22028
|
+
this.h = this;
|
|
22029
|
+
this.i = this.d = this.a = this.e = this.c = this.b = null;
|
|
22030
|
+
this.f = 0;
|
|
22031
|
+
}
|
|
22032
|
+
function J(a) {
|
|
22033
|
+
return a.b.e;
|
|
22034
|
+
}
|
|
22035
|
+
function Ca() {
|
|
22036
|
+
this.c = new N;
|
|
22037
|
+
this.a = new ga;
|
|
22038
|
+
this.b = new M;
|
|
22039
|
+
this.d = new M;
|
|
22040
|
+
this.b.b = this.d;
|
|
22041
|
+
this.d.b = this.b;
|
|
22042
|
+
}
|
|
22043
|
+
function N(a, b) {
|
|
22044
|
+
this.e = a || this;
|
|
22045
|
+
this.f = b || this;
|
|
22046
|
+
this.d = this.c = null;
|
|
22047
|
+
this.g = [
|
|
22048
|
+
0,
|
|
22049
|
+
0,
|
|
22050
|
+
0
|
|
22051
|
+
];
|
|
22052
|
+
this.h = this.a = this.b = 0;
|
|
22053
|
+
}
|
|
22054
|
+
function Da() {
|
|
22055
|
+
this.c = [];
|
|
22056
|
+
this.d = null;
|
|
22057
|
+
this.a = 0;
|
|
22058
|
+
this.e = !1;
|
|
22059
|
+
this.b = new Ha;
|
|
22060
|
+
}
|
|
22061
|
+
function Ea(a) {
|
|
22062
|
+
a.d = [];
|
|
22063
|
+
for(var b = 0; b < a.a; b++)a.d[b] = b;
|
|
22064
|
+
a.d.sort(function(a) {
|
|
22065
|
+
return function(b, e) {
|
|
22066
|
+
return u(a[b], a[e]) ? 1 : -1;
|
|
22067
|
+
};
|
|
22068
|
+
}(a.c));
|
|
22069
|
+
a.e = !0;
|
|
22070
|
+
Ia(a.b);
|
|
22071
|
+
}
|
|
22072
|
+
function xa(a, b) {
|
|
22073
|
+
if (a.e) {
|
|
22074
|
+
var c = a.b, d = ++c.a;
|
|
22075
|
+
2 * d > c.f && (c.f *= 2, c.c = Ja(c.c, c.f + 1));
|
|
22076
|
+
var e;
|
|
22077
|
+
0 === c.b ? e = d : (e = c.b, c.b = c.c[c.b]);
|
|
22078
|
+
c.e[e] = b;
|
|
22079
|
+
c.c[e] = d;
|
|
22080
|
+
c.d[d] = e;
|
|
22081
|
+
c.h && va(c, d);
|
|
22082
|
+
return e;
|
|
22083
|
+
}
|
|
22084
|
+
c = a.a++;
|
|
22085
|
+
a.c[c] = b;
|
|
22086
|
+
return -(c + 1);
|
|
22087
|
+
}
|
|
22088
|
+
function Fa(a) {
|
|
22089
|
+
if (0 === a.a) return Ka(a.b);
|
|
22090
|
+
var b = a.c[a.d[a.a - 1]];
|
|
22091
|
+
if (0 !== a.b.a && u(Ga(a.b), b)) return Ka(a.b);
|
|
22092
|
+
do --a.a;
|
|
22093
|
+
while (0 < a.a && null === a.c[a.d[a.a - 1]]);
|
|
22094
|
+
return b;
|
|
22095
|
+
}
|
|
22096
|
+
function Ha() {
|
|
22097
|
+
this.d = Ja([
|
|
22098
|
+
0
|
|
22099
|
+
], 33);
|
|
22100
|
+
this.e = [
|
|
22101
|
+
null,
|
|
22102
|
+
null
|
|
22103
|
+
];
|
|
22104
|
+
this.c = [
|
|
22105
|
+
0,
|
|
22106
|
+
0
|
|
22107
|
+
];
|
|
22108
|
+
this.a = 0;
|
|
22109
|
+
this.f = 32;
|
|
22110
|
+
this.b = 0;
|
|
22111
|
+
this.h = !1;
|
|
22112
|
+
this.d[1] = 1;
|
|
22113
|
+
}
|
|
22114
|
+
function Ja(a, b) {
|
|
22115
|
+
for(var c = Array(b), d = 0; d < a.length; d++)c[d] = a[d];
|
|
22116
|
+
for(; d < b; d++)c[d] = 0;
|
|
22117
|
+
return c;
|
|
22118
|
+
}
|
|
22119
|
+
function Ia(a) {
|
|
22120
|
+
for(var b = a.a; 1 <= b; --b)W(a, b);
|
|
22121
|
+
a.h = !0;
|
|
22122
|
+
}
|
|
22123
|
+
function Ga(a) {
|
|
22124
|
+
return a.e[a.d[1]];
|
|
22125
|
+
}
|
|
22126
|
+
function Ka(a) {
|
|
22127
|
+
var b = a.d, c = a.e, d = a.c, e = b[1], f = c[e];
|
|
22128
|
+
0 < a.a && (b[1] = b[a.a], d[b[1]] = 1, c[e] = null, d[e] = a.b, a.b = e, 0 < --a.a && W(a, 1));
|
|
22129
|
+
return f;
|
|
22130
|
+
}
|
|
22131
|
+
function W(a, b) {
|
|
22132
|
+
for(var c = a.d, d = a.e, e = a.c, f = b, g = c[f];;){
|
|
22133
|
+
var h = f << 1;
|
|
22134
|
+
h < a.a && u(d[c[h + 1]], d[c[h]]) && (h += 1);
|
|
22135
|
+
var k = c[h];
|
|
22136
|
+
if (h > a.a || u(d[g], d[k])) {
|
|
22137
|
+
c[f] = g;
|
|
22138
|
+
e[g] = f;
|
|
22139
|
+
break;
|
|
22140
|
+
}
|
|
22141
|
+
c[f] = k;
|
|
22142
|
+
e[k] = f;
|
|
22143
|
+
f = h;
|
|
22144
|
+
}
|
|
22145
|
+
}
|
|
22146
|
+
function va(a, b) {
|
|
22147
|
+
for(var c = a.d, d = a.e, e = a.c, f = b, g = c[f];;){
|
|
22148
|
+
var h = f >> 1, k = c[h];
|
|
22149
|
+
if (0 === h || u(d[k], d[g])) {
|
|
22150
|
+
c[f] = g;
|
|
22151
|
+
e[g] = f;
|
|
22152
|
+
break;
|
|
22153
|
+
}
|
|
22154
|
+
c[f] = k;
|
|
22155
|
+
e[k] = f;
|
|
22156
|
+
f = h;
|
|
22157
|
+
}
|
|
22158
|
+
}
|
|
22159
|
+
function ma() {
|
|
22160
|
+
this.e = this.a = null;
|
|
22161
|
+
this.f = 0;
|
|
22162
|
+
this.c = this.b = this.h = this.d = !1;
|
|
22163
|
+
}
|
|
22164
|
+
function S(a) {
|
|
22165
|
+
return a.e.c.b;
|
|
22166
|
+
}
|
|
22167
|
+
function R(a) {
|
|
22168
|
+
return a.e.a.b;
|
|
22169
|
+
}
|
|
22170
|
+
commonjsGlobal.libtess = {
|
|
22171
|
+
GluTesselator: X,
|
|
22172
|
+
windingRule: {
|
|
22173
|
+
GLU_TESS_WINDING_ODD: 100130,
|
|
22174
|
+
GLU_TESS_WINDING_NONZERO: 100131,
|
|
22175
|
+
GLU_TESS_WINDING_POSITIVE: 100132,
|
|
22176
|
+
GLU_TESS_WINDING_NEGATIVE: 100133,
|
|
22177
|
+
GLU_TESS_WINDING_ABS_GEQ_TWO: 100134
|
|
22178
|
+
},
|
|
22179
|
+
primitiveType: {
|
|
22180
|
+
GL_LINE_LOOP: 2,
|
|
22181
|
+
GL_TRIANGLES: 4,
|
|
22182
|
+
GL_TRIANGLE_STRIP: 5,
|
|
22183
|
+
GL_TRIANGLE_FAN: 6
|
|
22184
|
+
},
|
|
22185
|
+
errorType: {
|
|
22186
|
+
GLU_TESS_MISSING_BEGIN_POLYGON: 100151,
|
|
22187
|
+
GLU_TESS_MISSING_END_POLYGON: 100153,
|
|
22188
|
+
GLU_TESS_MISSING_BEGIN_CONTOUR: 100152,
|
|
22189
|
+
GLU_TESS_MISSING_END_CONTOUR: 100154,
|
|
22190
|
+
GLU_TESS_COORD_TOO_LARGE: 100155,
|
|
22191
|
+
GLU_TESS_NEED_COMBINE_CALLBACK: 100156
|
|
22192
|
+
},
|
|
22193
|
+
gluEnum: {
|
|
22194
|
+
GLU_TESS_MESH: 100112,
|
|
22195
|
+
GLU_TESS_TOLERANCE: 100142,
|
|
22196
|
+
GLU_TESS_WINDING_RULE: 100140,
|
|
22197
|
+
GLU_TESS_BOUNDARY_ONLY: 100141,
|
|
22198
|
+
GLU_INVALID_ENUM: 100900,
|
|
22199
|
+
GLU_INVALID_VALUE: 100901,
|
|
22200
|
+
GLU_TESS_BEGIN: 100100,
|
|
22201
|
+
GLU_TESS_VERTEX: 100101,
|
|
22202
|
+
GLU_TESS_END: 100102,
|
|
22203
|
+
GLU_TESS_ERROR: 100103,
|
|
22204
|
+
GLU_TESS_EDGE_FLAG: 100104,
|
|
22205
|
+
GLU_TESS_COMBINE: 100105,
|
|
22206
|
+
GLU_TESS_BEGIN_DATA: 100106,
|
|
22207
|
+
GLU_TESS_VERTEX_DATA: 100107,
|
|
22208
|
+
GLU_TESS_END_DATA: 100108,
|
|
22209
|
+
GLU_TESS_ERROR_DATA: 100109,
|
|
22210
|
+
GLU_TESS_EDGE_FLAG_DATA: 100110,
|
|
22211
|
+
GLU_TESS_COMBINE_DATA: 100111
|
|
22212
|
+
}
|
|
22213
|
+
};
|
|
22214
|
+
X.prototype.gluDeleteTess = X.prototype.x;
|
|
22215
|
+
X.prototype.gluTessProperty = X.prototype.B;
|
|
22216
|
+
X.prototype.gluGetTessProperty = X.prototype.y;
|
|
22217
|
+
X.prototype.gluTessNormal = X.prototype.A;
|
|
22218
|
+
X.prototype.gluTessCallback = X.prototype.z;
|
|
22219
|
+
X.prototype.gluTessVertex = X.prototype.C;
|
|
22220
|
+
X.prototype.gluTessBeginPolygon = X.prototype.u;
|
|
22221
|
+
X.prototype.gluTessBeginContour = X.prototype.t;
|
|
22222
|
+
X.prototype.gluTessEndContour = X.prototype.v;
|
|
22223
|
+
X.prototype.gluTessEndPolygon = X.prototype.w;
|
|
22224
|
+
{
|
|
22225
|
+
module.exports = commonjsGlobal.libtess;
|
|
22226
|
+
}
|
|
22227
|
+
}(libtess_min));
|
|
22228
|
+
|
|
22229
|
+
var tessy = function initTesselator() {
|
|
22230
|
+
// function called for each vertex of tesselator output
|
|
22231
|
+
function vertexCallback(data, polyVertArray) {
|
|
22232
|
+
polyVertArray[polyVertArray.length] = data[0];
|
|
22233
|
+
polyVertArray[polyVertArray.length] = data[1];
|
|
22234
|
+
}
|
|
22235
|
+
function begincallback(type) {
|
|
22236
|
+
if (type !== libtess_min.exports.primitiveType.GL_TRIANGLES) {
|
|
22237
|
+
console.info("expected TRIANGLES but got type: " + type);
|
|
22238
|
+
}
|
|
22239
|
+
}
|
|
22240
|
+
function errorcallback(errno) {
|
|
22241
|
+
console.error("error callback, error number: " + errno);
|
|
22242
|
+
}
|
|
22243
|
+
// callback for when segments intersect and must be split
|
|
22244
|
+
function combinecallback(coords, data, weight) {
|
|
22245
|
+
// console.log('combine callback');
|
|
22246
|
+
return [
|
|
22247
|
+
coords[0],
|
|
22248
|
+
coords[1],
|
|
22249
|
+
coords[2]
|
|
22250
|
+
];
|
|
22251
|
+
}
|
|
22252
|
+
function edgeCallback(flag) {
|
|
22253
|
+
// don't really care about the flag, but need no-strip/no-fan behavior
|
|
22254
|
+
// console.log('edge flag: ' + flag);
|
|
22255
|
+
}
|
|
22256
|
+
var tessy = new libtess_min.exports.GluTesselator();
|
|
22257
|
+
// tessy.gluTessProperty(libtess.gluEnum.GLU_TESS_WINDING_RULE, libtess.windingRule.GLU_TESS_WINDING_POSITIVE);
|
|
22258
|
+
tessy.gluTessCallback(libtess_min.exports.gluEnum.GLU_TESS_VERTEX_DATA, vertexCallback);
|
|
22259
|
+
tessy.gluTessCallback(libtess_min.exports.gluEnum.GLU_TESS_BEGIN, begincallback);
|
|
22260
|
+
tessy.gluTessCallback(libtess_min.exports.gluEnum.GLU_TESS_ERROR, errorcallback);
|
|
22261
|
+
tessy.gluTessCallback(libtess_min.exports.gluEnum.GLU_TESS_COMBINE, combinecallback);
|
|
22262
|
+
tessy.gluTessCallback(libtess_min.exports.gluEnum.GLU_TESS_EDGE_FLAG, edgeCallback);
|
|
22263
|
+
return tessy;
|
|
22264
|
+
}();
|
|
22265
|
+
function triangulate(contours) {
|
|
22266
|
+
// libtess will take 3d verts and flatten to a plane for tesselation
|
|
22267
|
+
// since only doing 2d tesselation here, provide z=1 normal to skip
|
|
22268
|
+
// iterating over verts only to get the same answer.
|
|
22269
|
+
// comment out to test normal-generation code
|
|
22270
|
+
tessy.gluTessNormal(0, 0, 1);
|
|
22271
|
+
var triangleVerts = [];
|
|
22272
|
+
tessy.gluTessBeginPolygon(triangleVerts);
|
|
22273
|
+
for(var i = 0; i < contours.length; i++){
|
|
22274
|
+
tessy.gluTessBeginContour();
|
|
22275
|
+
var contour = contours[i];
|
|
22276
|
+
for(var j = 0; j < contour.length; j += 2){
|
|
22277
|
+
var coords = [
|
|
22278
|
+
contour[j],
|
|
22279
|
+
contour[j + 1],
|
|
22280
|
+
0
|
|
22281
|
+
];
|
|
22282
|
+
tessy.gluTessVertex(coords, coords);
|
|
22283
|
+
}
|
|
22284
|
+
tessy.gluTessEndContour();
|
|
22285
|
+
}
|
|
22286
|
+
// finish polygon
|
|
22287
|
+
tessy.gluTessEndPolygon();
|
|
22288
|
+
return triangleVerts;
|
|
22289
|
+
}
|
|
22290
|
+
|
|
22291
|
+
var ShapeComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
22292
|
+
_inherits(ShapeComponent, RendererComponent);
|
|
22293
|
+
function ShapeComponent(engine) {
|
|
22294
|
+
var _this;
|
|
22295
|
+
_this = RendererComponent.call(this, engine) || this;
|
|
22296
|
+
_this.path = new GraphicsPath();
|
|
22297
|
+
_this.curveValues = [];
|
|
22298
|
+
_this.dirty = false;
|
|
22299
|
+
_this.vert = "\nprecision highp float;\n\nattribute vec3 aPos;//x y\n\nvarying vec4 vColor;\n\nuniform vec4 _Color;\nuniform mat4 effects_MatrixVP;\nuniform mat4 effects_MatrixInvV;\nuniform mat4 effects_ObjectToWorld;\n\nvoid main() {\n vColor = _Color;\n vec4 pos = vec4(aPos.xyz, 1.0);\n gl_Position = effects_MatrixVP * effects_ObjectToWorld * pos;\n}\n";
|
|
22300
|
+
_this.frag = "\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main() {\n vec4 color = vec4(1.0,1.0,1.0,1.0);\n gl_FragColor = color;\n}\n";
|
|
22301
|
+
if (!_this.geometry) {
|
|
22302
|
+
_this.geometry = Geometry.create(engine, {
|
|
22303
|
+
attributes: {
|
|
22304
|
+
aPos: {
|
|
22305
|
+
type: glContext.FLOAT,
|
|
22306
|
+
size: 3,
|
|
22307
|
+
data: new Float32Array([
|
|
22308
|
+
-0.5,
|
|
22309
|
+
0.5,
|
|
22310
|
+
0,
|
|
22311
|
+
-0.5,
|
|
22312
|
+
-0.5,
|
|
22313
|
+
0,
|
|
22314
|
+
0.5,
|
|
22315
|
+
0.5,
|
|
22316
|
+
0,
|
|
22317
|
+
0.5,
|
|
22318
|
+
-0.5,
|
|
22319
|
+
0
|
|
22320
|
+
])
|
|
22321
|
+
},
|
|
22322
|
+
aUV: {
|
|
22323
|
+
type: glContext.FLOAT,
|
|
22324
|
+
size: 2,
|
|
22325
|
+
data: new Float32Array()
|
|
22326
|
+
}
|
|
22327
|
+
},
|
|
22328
|
+
mode: glContext.TRIANGLES,
|
|
22329
|
+
drawCount: 4
|
|
22330
|
+
});
|
|
22331
|
+
}
|
|
22332
|
+
if (!_this.material) {
|
|
22333
|
+
var materialProps = {
|
|
22334
|
+
shader: {
|
|
22335
|
+
vertex: _this.vert,
|
|
22336
|
+
fragment: _this.frag,
|
|
22337
|
+
glslVersion: GLSLVersion.GLSL1
|
|
22338
|
+
}
|
|
22339
|
+
};
|
|
22340
|
+
_this.material = Material.create(engine, materialProps);
|
|
22341
|
+
_this.material.setColor("_Color", new Color(1, 1, 1, 1));
|
|
22342
|
+
_this.material.depthMask = true;
|
|
22343
|
+
_this.material.depthTest = true;
|
|
22344
|
+
_this.material.blending = true;
|
|
22345
|
+
}
|
|
22346
|
+
return _this;
|
|
22347
|
+
}
|
|
22348
|
+
var _proto = ShapeComponent.prototype;
|
|
22349
|
+
_proto.onUpdate = function onUpdate(dt) {
|
|
22350
|
+
if (this.dirty) {
|
|
22351
|
+
this.path.clear();
|
|
22352
|
+
this.path.moveTo(this.curveValues[this.curveValues.length - 1].point.x, this.curveValues[this.curveValues.length - 1].point.y);
|
|
22353
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(this.curveValues), _step; !(_step = _iterator()).done;){
|
|
22354
|
+
var curveValue = _step.value;
|
|
22355
|
+
var point = curveValue.point;
|
|
22356
|
+
var control1 = curveValue.controlPoint1;
|
|
22357
|
+
var control2 = curveValue.controlPoint2;
|
|
22358
|
+
this.path.bezierCurveTo(control1.x, control1.y, control2.x, control2.y, point.x, point.y, 1);
|
|
22359
|
+
}
|
|
22360
|
+
this.buildGeometryFromPath(this.path.shapePath);
|
|
22361
|
+
this.dirty = false;
|
|
22362
|
+
}
|
|
22363
|
+
};
|
|
22364
|
+
_proto.render = function render(renderer) {
|
|
22365
|
+
if (renderer.renderingData.currentFrame.globalUniforms) {
|
|
22366
|
+
renderer.setGlobalMatrix("effects_ObjectToWorld", this.transform.getWorldMatrix());
|
|
22367
|
+
}
|
|
22368
|
+
renderer.drawGeometry(this.geometry, this.material);
|
|
22369
|
+
};
|
|
22370
|
+
_proto.buildGeometryFromPath = function buildGeometryFromPath(shapePath) {
|
|
22371
|
+
var shapePrimitives = shapePath.shapePrimitives;
|
|
22372
|
+
var vertices = [];
|
|
22373
|
+
// triangulate shapePrimitive
|
|
22374
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(shapePrimitives), _step; !(_step = _iterator()).done;){
|
|
22375
|
+
var shapePrimitive = _step.value;
|
|
22376
|
+
var _vertices;
|
|
22377
|
+
var shape = shapePrimitive.shape;
|
|
22378
|
+
(_vertices = vertices).push.apply(_vertices, [].concat(triangulate([
|
|
22379
|
+
shape.points
|
|
22380
|
+
])));
|
|
22381
|
+
}
|
|
22382
|
+
// build vertices and uvs
|
|
22383
|
+
var vertexCount = vertices.length / 2;
|
|
22384
|
+
var positionArray = this.geometry.getAttributeData("aPos");
|
|
22385
|
+
var uvArray = this.geometry.getAttributeData("aUV");
|
|
22386
|
+
if (!positionArray || positionArray.length < vertexCount * 3) {
|
|
22387
|
+
positionArray = new Float32Array(vertexCount * 3);
|
|
22388
|
+
}
|
|
22389
|
+
if (!uvArray || uvArray.length < vertexCount * 2) {
|
|
22390
|
+
uvArray = new Float32Array(vertexCount * 2);
|
|
22391
|
+
}
|
|
22392
|
+
for(var i = 0; i < vertexCount; i++){
|
|
22393
|
+
var pointsOffset = i * 3;
|
|
22394
|
+
var positionArrayOffset = i * 2;
|
|
22395
|
+
var uvOffset = i * 2;
|
|
22396
|
+
positionArray[pointsOffset] = vertices[positionArrayOffset];
|
|
22397
|
+
positionArray[pointsOffset + 1] = vertices[positionArrayOffset + 1];
|
|
22398
|
+
positionArray[pointsOffset + 2] = 0;
|
|
22399
|
+
uvArray[uvOffset] = positionArray[pointsOffset];
|
|
22400
|
+
uvArray[uvOffset + 1] = positionArray[pointsOffset + 1];
|
|
22401
|
+
}
|
|
22402
|
+
this.geometry.setAttributeData("aPos", positionArray);
|
|
22403
|
+
this.geometry.setAttributeData("aUV", uvArray);
|
|
22404
|
+
this.geometry.setDrawCount(vertexCount);
|
|
22405
|
+
};
|
|
22406
|
+
_proto.fromData = function fromData(data) {
|
|
22407
|
+
RendererComponent.prototype.fromData.call(this, data);
|
|
22408
|
+
var points = data.param.points;
|
|
22409
|
+
var easingIns = data.param.easingIn;
|
|
22410
|
+
var easingOuts = data.param.easingOut;
|
|
22411
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(data.param.shapes), _step; !(_step = _iterator()).done;){
|
|
22412
|
+
var shape = _step.value;
|
|
22413
|
+
var indices = shape.indexes;
|
|
22414
|
+
for(var i = 1; i < indices.length; i++){
|
|
22415
|
+
var pointIndex = indices[i];
|
|
22416
|
+
var lastPointIndex = indices[i - 1];
|
|
22417
|
+
this.curveValues.push({
|
|
22418
|
+
point: points[pointIndex.point],
|
|
22419
|
+
controlPoint1: easingOuts[lastPointIndex.easingOut],
|
|
22420
|
+
controlPoint2: easingIns[pointIndex.easingIn]
|
|
22421
|
+
});
|
|
22422
|
+
}
|
|
22423
|
+
// Push the last curve
|
|
22424
|
+
this.curveValues.push({
|
|
22425
|
+
point: points[indices[0].point],
|
|
22426
|
+
controlPoint1: easingOuts[indices[indices.length - 1].easingOut],
|
|
22427
|
+
controlPoint2: easingIns[indices[0].easingIn]
|
|
22428
|
+
});
|
|
22429
|
+
}
|
|
22430
|
+
this.dirty = true;
|
|
22431
|
+
};
|
|
22432
|
+
return ShapeComponent;
|
|
22433
|
+
}(RendererComponent);
|
|
22434
|
+
ShapeComponent = __decorate([
|
|
22435
|
+
effectsClass("ShapeComponent")
|
|
22436
|
+
], ShapeComponent);
|
|
22437
|
+
var ComponentShapeType;
|
|
22438
|
+
(function(ComponentShapeType) {
|
|
22439
|
+
/**
|
|
22440
|
+
* 自定义图形
|
|
22441
|
+
*/ ComponentShapeType[ComponentShapeType["CUSTOM"] = 0] = "CUSTOM";
|
|
22442
|
+
/**
|
|
22443
|
+
* 矩形
|
|
22444
|
+
*/ ComponentShapeType[ComponentShapeType["RECTANGLE"] = 1] = "RECTANGLE";
|
|
22445
|
+
/**
|
|
22446
|
+
* 椭圆
|
|
22447
|
+
*/ ComponentShapeType[ComponentShapeType["ELLIPSE"] = 2] = "ELLIPSE";
|
|
22448
|
+
/**
|
|
22449
|
+
* 多边形
|
|
22450
|
+
*/ ComponentShapeType[ComponentShapeType["POLYGON"] = 3] = "POLYGON";
|
|
22451
|
+
/**
|
|
22452
|
+
* 星形
|
|
22453
|
+
*/ ComponentShapeType[ComponentShapeType["STAR"] = 4] = "STAR";
|
|
22454
|
+
})(ComponentShapeType || (ComponentShapeType = {}));
|
|
22455
|
+
var ShapeConnectType;
|
|
22456
|
+
(function(ShapeConnectType) {})(ShapeConnectType || (ShapeConnectType = {}));
|
|
22457
|
+
var ShapePointType;
|
|
22458
|
+
(function(ShapePointType) {})(ShapePointType || (ShapePointType = {}));
|
|
22459
|
+
|
|
20796
22460
|
var EventEmitter = function EventEmitter() {
|
|
20797
22461
|
var _this = this;
|
|
20798
22462
|
var _this1 = this;
|
|
@@ -21162,21 +22826,21 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
21162
22826
|
return now - this.duration > 0.001;
|
|
21163
22827
|
};
|
|
21164
22828
|
_proto.find = function find(name) {
|
|
22829
|
+
var _queue;
|
|
21165
22830
|
if (this.name === name) {
|
|
21166
22831
|
return this;
|
|
21167
22832
|
}
|
|
21168
|
-
|
|
21169
|
-
|
|
21170
|
-
|
|
21171
|
-
|
|
21172
|
-
|
|
21173
|
-
|
|
21174
|
-
|
|
21175
|
-
|
|
21176
|
-
|
|
21177
|
-
if (res) {
|
|
21178
|
-
return res;
|
|
22833
|
+
var queue = [];
|
|
22834
|
+
(_queue = queue).push.apply(_queue, [].concat(this.children));
|
|
22835
|
+
var index = 0;
|
|
22836
|
+
while(index < queue.length){
|
|
22837
|
+
var _queue1;
|
|
22838
|
+
var item = queue[index];
|
|
22839
|
+
index++;
|
|
22840
|
+
if (item.name === name) {
|
|
22841
|
+
return item;
|
|
21179
22842
|
}
|
|
22843
|
+
(_queue1 = queue).push.apply(_queue1, [].concat(item.children));
|
|
21180
22844
|
}
|
|
21181
22845
|
return undefined;
|
|
21182
22846
|
};
|
|
@@ -23920,15 +25584,22 @@ function passRenderLevel(l, renderLevel) {
|
|
|
23920
25584
|
return false;
|
|
23921
25585
|
}
|
|
23922
25586
|
|
|
23923
|
-
|
|
23924
|
-
|
|
23925
|
-
|
|
23926
|
-
|
|
23927
|
-
|
|
23928
|
-
|
|
23929
|
-
|
|
23930
|
-
|
|
23931
|
-
|
|
25587
|
+
var Scene;
|
|
25588
|
+
(function(Scene) {
|
|
25589
|
+
function isJSONObject(scene) {
|
|
25590
|
+
return isObject(scene) && "jsonScene" in scene;
|
|
25591
|
+
}
|
|
25592
|
+
// JSON 对象
|
|
25593
|
+
Scene.isJSONObject = isJSONObject;
|
|
25594
|
+
function isURL(scene) {
|
|
25595
|
+
return isObject(scene) && "url" in scene;
|
|
25596
|
+
}
|
|
25597
|
+
Scene.isURL = isURL;
|
|
25598
|
+
function isWithOptions(scene) {
|
|
25599
|
+
return isObject(scene) && "options" in scene;
|
|
25600
|
+
}
|
|
25601
|
+
Scene.isWithOptions = isWithOptions;
|
|
25602
|
+
})(Scene || (Scene = {}));
|
|
23932
25603
|
|
|
23933
25604
|
function getBackgroundImage(template, variables) {
|
|
23934
25605
|
var templateBackground;
|
|
@@ -24053,13 +25724,12 @@ var seed = 1;
|
|
|
24053
25724
|
*/ _proto.loadScene = function loadScene(url, renderer, options) {
|
|
24054
25725
|
var _this = this;
|
|
24055
25726
|
return _async_to_generator(function() {
|
|
24056
|
-
var
|
|
25727
|
+
var rawJSON, assetUrl, startTime, timeInfoMessages, gpuInstance, _gpuInstance_detail_compressedTexture, compressedTexture, timeInfos, loadTimer, cancelLoading, waitPromise, hookTimeInfo, loadResourcePromise;
|
|
24057
25728
|
return __generator(this, function(_state) {
|
|
24058
25729
|
assetUrl = isString(url) ? url : _this.id;
|
|
24059
25730
|
startTime = performance.now();
|
|
24060
25731
|
timeInfoMessages = [];
|
|
24061
25732
|
gpuInstance = renderer == null ? void 0 : renderer.engine.gpuCapability;
|
|
24062
|
-
asyncShaderCompile = (_gpuInstance_detail_asyncShaderCompile = gpuInstance == null ? void 0 : (_gpuInstance_detail = gpuInstance.detail) == null ? void 0 : _gpuInstance_detail.asyncShaderCompile) != null ? _gpuInstance_detail_asyncShaderCompile : false;
|
|
24063
25733
|
compressedTexture = (_gpuInstance_detail_compressedTexture = gpuInstance == null ? void 0 : gpuInstance.detail.compressedTexture) != null ? _gpuInstance_detail_compressedTexture : COMPRESSED_TEXTURE.NONE;
|
|
24064
25734
|
timeInfos = {};
|
|
24065
25735
|
cancelLoading = false;
|
|
@@ -24112,81 +25782,55 @@ var seed = 1;
|
|
|
24112
25782
|
});
|
|
24113
25783
|
});
|
|
24114
25784
|
loadResourcePromise = /*#__PURE__*/ _async_to_generator(function() {
|
|
24115
|
-
var scene,
|
|
25785
|
+
var scene, link, _ref, jsonScene, pluginSystem, _jsonScene_bins, bins, images, compositions, fonts, _ref1, loadedBins, loadedImages, i, i1, imageAsset, loadedTextures, totalTime;
|
|
24116
25786
|
return __generator(this, function(_state) {
|
|
24117
25787
|
switch(_state.label){
|
|
24118
25788
|
case 0:
|
|
24119
|
-
if (!
|
|
24120
|
-
3,
|
|
24121
|
-
1
|
|
24122
|
-
];
|
|
24123
|
-
// TODO: 原 JSONLoader contructor 判断是否兼容
|
|
24124
|
-
rawJSON = url;
|
|
24125
|
-
_this.baseUrl = location.href;
|
|
24126
|
-
return [
|
|
25789
|
+
if (!isString(url)) return [
|
|
24127
25790
|
3,
|
|
24128
|
-
|
|
25791
|
+
2
|
|
24129
25792
|
];
|
|
24130
|
-
case 1:
|
|
24131
25793
|
// 兼容相对路径
|
|
24132
|
-
|
|
24133
|
-
_this.baseUrl =
|
|
25794
|
+
link = new URL(url, location.href).href;
|
|
25795
|
+
_this.baseUrl = link;
|
|
24134
25796
|
return [
|
|
24135
25797
|
4,
|
|
24136
25798
|
hookTimeInfo("loadJSON", function() {
|
|
24137
|
-
return _this.loadJSON(
|
|
25799
|
+
return _this.loadJSON(link);
|
|
24138
25800
|
})
|
|
24139
25801
|
];
|
|
24140
|
-
case
|
|
25802
|
+
case 1:
|
|
24141
25803
|
rawJSON = _state.sent();
|
|
25804
|
+
return [
|
|
25805
|
+
3,
|
|
25806
|
+
3
|
|
25807
|
+
];
|
|
25808
|
+
case 2:
|
|
25809
|
+
// url 为 spec.JSONScene 或 Scene 对象
|
|
25810
|
+
rawJSON = url;
|
|
25811
|
+
_this.baseUrl = location.href;
|
|
24142
25812
|
_state.label = 3;
|
|
24143
25813
|
case 3:
|
|
24144
|
-
if (!
|
|
25814
|
+
if (!Scene.isJSONObject(rawJSON)) return [
|
|
24145
25815
|
3,
|
|
24146
|
-
|
|
25816
|
+
4
|
|
24147
25817
|
];
|
|
24148
25818
|
// 已经加载过的 可能需要更新数据模板
|
|
24149
25819
|
scene = _extends({}, rawJSON);
|
|
24150
|
-
if (!(_this.options && _this.options.variables && Object.keys(_this.options.variables).length !== 0)) return [
|
|
24151
|
-
3,
|
|
24152
|
-
5
|
|
24153
|
-
];
|
|
24154
|
-
_rawJSON_jsonScene = rawJSON.jsonScene, rawImages = _rawJSON_jsonScene.images;
|
|
24155
|
-
images = scene.images;
|
|
24156
|
-
for(i = 0; i < rawImages.length; i++){
|
|
24157
|
-
// 仅重新加载数据模板对应的图片
|
|
24158
|
-
if (_instanceof1(images[i], HTMLCanvasElement)) {
|
|
24159
|
-
images[i] = rawImages[i];
|
|
24160
|
-
}
|
|
24161
|
-
}
|
|
24162
|
-
return [
|
|
24163
|
-
4,
|
|
24164
|
-
hookTimeInfo("processImages", function() {
|
|
24165
|
-
return _this.processImages(images, compressedTexture);
|
|
24166
|
-
})
|
|
24167
|
-
];
|
|
24168
|
-
case 4:
|
|
24169
|
-
scene.images = _state.sent();
|
|
24170
|
-
// 更新 TextureOptions 中的 image 指向
|
|
24171
|
-
for(i1 = 0; i1 < scene.images.length; i1++){
|
|
24172
|
-
scene.textureOptions[i1].image = scene.images[i1];
|
|
24173
|
-
}
|
|
24174
|
-
_state.label = 5;
|
|
24175
|
-
case 5:
|
|
24176
25820
|
return [
|
|
24177
25821
|
3,
|
|
24178
|
-
|
|
25822
|
+
9
|
|
24179
25823
|
];
|
|
24180
|
-
case
|
|
25824
|
+
case 4:
|
|
24181
25825
|
return [
|
|
24182
25826
|
4,
|
|
24183
25827
|
hookTimeInfo("processJSON", function() {
|
|
24184
25828
|
return _this.processJSON(rawJSON);
|
|
24185
25829
|
})
|
|
24186
25830
|
];
|
|
24187
|
-
case
|
|
24188
|
-
_ref = _state.sent(),
|
|
24189
|
-
_jsonScene_bins = jsonScene.bins, bins = _jsonScene_bins === void 0 ? [] : _jsonScene_bins,
|
|
25831
|
+
case 5:
|
|
25832
|
+
_ref = _state.sent(), jsonScene = _ref.jsonScene, pluginSystem = _ref.pluginSystem;
|
|
25833
|
+
_jsonScene_bins = jsonScene.bins, bins = _jsonScene_bins === void 0 ? [] : _jsonScene_bins, images = jsonScene.images, compositions = jsonScene.compositions, fonts = jsonScene.fonts;
|
|
24190
25834
|
return [
|
|
24191
25835
|
4,
|
|
24192
25836
|
Promise.all([
|
|
@@ -24194,38 +25838,36 @@ var seed = 1;
|
|
|
24194
25838
|
return _this.processBins(bins);
|
|
24195
25839
|
}),
|
|
24196
25840
|
hookTimeInfo("processImages", function() {
|
|
24197
|
-
return _this.processImages(
|
|
25841
|
+
return _this.processImages(images, compressedTexture);
|
|
24198
25842
|
}),
|
|
24199
|
-
hookTimeInfo(""
|
|
25843
|
+
hookTimeInfo("precompile", function() {
|
|
24200
25844
|
return _this.precompile(compositions, pluginSystem, renderer, options);
|
|
25845
|
+
}),
|
|
25846
|
+
hookTimeInfo("processFontURL", function() {
|
|
25847
|
+
return _this.processFontURL(fonts);
|
|
24201
25848
|
})
|
|
24202
25849
|
])
|
|
24203
25850
|
];
|
|
24204
|
-
case
|
|
25851
|
+
case 6:
|
|
24205
25852
|
_ref1 = _state.sent(), loadedBins = _ref1[0], loadedImages = _ref1[1];
|
|
25853
|
+
for(i = 0; i < images.length; i++){
|
|
25854
|
+
_this.assets[images[i].id] = loadedImages[i];
|
|
25855
|
+
}
|
|
24206
25856
|
if (renderer) {
|
|
24207
|
-
for(
|
|
25857
|
+
for(i1 = 0; i1 < images.length; i1++){
|
|
24208
25858
|
imageAsset = new ImageAsset(renderer.engine);
|
|
24209
|
-
imageAsset.data = loadedImages[
|
|
24210
|
-
imageAsset.setInstanceId(
|
|
25859
|
+
imageAsset.data = loadedImages[i1];
|
|
25860
|
+
imageAsset.setInstanceId(images[i1].id);
|
|
24211
25861
|
renderer.engine.addInstance(imageAsset);
|
|
24212
25862
|
}
|
|
24213
25863
|
}
|
|
24214
|
-
return [
|
|
24215
|
-
4,
|
|
24216
|
-
hookTimeInfo("processFontURL", function() {
|
|
24217
|
-
return _this.processFontURL(fonts);
|
|
24218
|
-
})
|
|
24219
|
-
];
|
|
24220
|
-
case 9:
|
|
24221
|
-
_state.sent();
|
|
24222
25864
|
return [
|
|
24223
25865
|
4,
|
|
24224
25866
|
hookTimeInfo("processTextures", function() {
|
|
24225
|
-
return _this.processTextures(loadedImages, loadedBins, jsonScene
|
|
25867
|
+
return _this.processTextures(loadedImages, loadedBins, jsonScene);
|
|
24226
25868
|
})
|
|
24227
25869
|
];
|
|
24228
|
-
case
|
|
25870
|
+
case 7:
|
|
24229
25871
|
loadedTextures = _state.sent();
|
|
24230
25872
|
scene = {
|
|
24231
25873
|
timeInfos: timeInfos,
|
|
@@ -24234,7 +25876,6 @@ var seed = 1;
|
|
|
24234
25876
|
storage: {},
|
|
24235
25877
|
pluginSystem: pluginSystem,
|
|
24236
25878
|
jsonScene: jsonScene,
|
|
24237
|
-
usedImages: usedImages,
|
|
24238
25879
|
images: loadedImages,
|
|
24239
25880
|
textureOptions: loadedTextures,
|
|
24240
25881
|
bins: loadedBins
|
|
@@ -24246,10 +25887,10 @@ var seed = 1;
|
|
|
24246
25887
|
return pluginSystem.loadResources(scene, _this.options);
|
|
24247
25888
|
})
|
|
24248
25889
|
];
|
|
24249
|
-
case
|
|
25890
|
+
case 8:
|
|
24250
25891
|
_state.sent();
|
|
24251
|
-
_state.label =
|
|
24252
|
-
case
|
|
25892
|
+
_state.label = 9;
|
|
25893
|
+
case 9:
|
|
24253
25894
|
totalTime = performance.now() - startTime;
|
|
24254
25895
|
logger.info("Load asset: totalTime: " + totalTime.toFixed(4) + "ms " + timeInfoMessages.join(" ") + ", url: " + assetUrl + ".");
|
|
24255
25896
|
window.clearTimeout(loadTimer);
|
|
@@ -24277,7 +25918,6 @@ var seed = 1;
|
|
|
24277
25918
|
};
|
|
24278
25919
|
_proto.precompile = function precompile(compositions, pluginSystem, renderer, options) {
|
|
24279
25920
|
return _async_to_generator(function() {
|
|
24280
|
-
var shaderLibrary;
|
|
24281
25921
|
return __generator(this, function(_state) {
|
|
24282
25922
|
switch(_state.label){
|
|
24283
25923
|
case 0:
|
|
@@ -24286,22 +25926,11 @@ var seed = 1;
|
|
|
24286
25926
|
2
|
|
24287
25927
|
];
|
|
24288
25928
|
}
|
|
24289
|
-
shaderLibrary = renderer == null ? void 0 : renderer.getShaderLibrary();
|
|
24290
25929
|
return [
|
|
24291
25930
|
4,
|
|
24292
25931
|
pluginSystem == null ? void 0 : pluginSystem.precompile(compositions, renderer, options)
|
|
24293
25932
|
];
|
|
24294
25933
|
case 1:
|
|
24295
|
-
_state.sent();
|
|
24296
|
-
return [
|
|
24297
|
-
4,
|
|
24298
|
-
new Promise(function(resolve) {
|
|
24299
|
-
shaderLibrary == null ? void 0 : shaderLibrary.compileAllShaders(function() {
|
|
24300
|
-
resolve(null);
|
|
24301
|
-
});
|
|
24302
|
-
})
|
|
24303
|
-
];
|
|
24304
|
-
case 2:
|
|
24305
25934
|
_state.sent();
|
|
24306
25935
|
return [
|
|
24307
25936
|
2
|
|
@@ -24313,12 +25942,12 @@ var seed = 1;
|
|
|
24313
25942
|
_proto.processJSON = function processJSON(json) {
|
|
24314
25943
|
var _this = this;
|
|
24315
25944
|
return _async_to_generator(function() {
|
|
24316
|
-
var jsonScene, _jsonScene_plugins, plugins,
|
|
25945
|
+
var jsonScene, _jsonScene_plugins, plugins, pluginSystem;
|
|
24317
25946
|
return __generator(this, function(_state) {
|
|
24318
25947
|
switch(_state.label){
|
|
24319
25948
|
case 0:
|
|
24320
25949
|
jsonScene = getStandardJSON(json);
|
|
24321
|
-
_jsonScene_plugins = jsonScene.plugins, plugins = _jsonScene_plugins === void 0 ? [] : _jsonScene_plugins
|
|
25950
|
+
_jsonScene_plugins = jsonScene.plugins, plugins = _jsonScene_plugins === void 0 ? [] : _jsonScene_plugins;
|
|
24322
25951
|
pluginSystem = new PluginSystem(plugins);
|
|
24323
25952
|
return [
|
|
24324
25953
|
4,
|
|
@@ -24326,20 +25955,9 @@ var seed = 1;
|
|
|
24326
25955
|
];
|
|
24327
25956
|
case 1:
|
|
24328
25957
|
_state.sent();
|
|
24329
|
-
renderLevel = _this.options.renderLevel;
|
|
24330
|
-
usedImages = {};
|
|
24331
|
-
if (imgUsage) {
|
|
24332
|
-
// TODO: 考虑放到独立的 fix 文件
|
|
24333
|
-
fixOldImageUsage(usedImages, sceneCompositions, imgUsage, images, renderLevel);
|
|
24334
|
-
} else {
|
|
24335
|
-
images == null ? void 0 : images.forEach(function(_, i) {
|
|
24336
|
-
usedImages[i] = true;
|
|
24337
|
-
});
|
|
24338
|
-
}
|
|
24339
25958
|
return [
|
|
24340
25959
|
2,
|
|
24341
25960
|
{
|
|
24342
|
-
usedImages: usedImages,
|
|
24343
25961
|
jsonScene: jsonScene,
|
|
24344
25962
|
pluginSystem: pluginSystem
|
|
24345
25963
|
}
|
|
@@ -24411,7 +26029,6 @@ var seed = 1;
|
|
|
24411
26029
|
];
|
|
24412
26030
|
case 2:
|
|
24413
26031
|
_state.sent();
|
|
24414
|
-
//@ts-expect-error
|
|
24415
26032
|
document.fonts.add(fontFace);
|
|
24416
26033
|
AssetManager.fonts.add(font.fontFamily);
|
|
24417
26034
|
return [
|
|
@@ -24493,6 +26110,10 @@ var seed = 1;
|
|
|
24493
26110
|
3,
|
|
24494
26111
|
3
|
|
24495
26112
|
];
|
|
26113
|
+
_this.assets[idx] = {
|
|
26114
|
+
url: resultImage.src,
|
|
26115
|
+
type: TextureSourceType.video
|
|
26116
|
+
};
|
|
24496
26117
|
return [
|
|
24497
26118
|
2,
|
|
24498
26119
|
resultImage
|
|
@@ -24502,6 +26123,10 @@ var seed = 1;
|
|
|
24502
26123
|
if (background && Array.isArray(url) && variables) {
|
|
24503
26124
|
variables[background.name] = resultImage.src;
|
|
24504
26125
|
}
|
|
26126
|
+
_this.assets[idx] = {
|
|
26127
|
+
url: resultImage.src,
|
|
26128
|
+
type: TextureSourceType.image
|
|
26129
|
+
};
|
|
24505
26130
|
return [
|
|
24506
26131
|
4,
|
|
24507
26132
|
combineImageTemplate(resultImage, template, variables)
|
|
@@ -24544,12 +26169,6 @@ var seed = 1;
|
|
|
24544
26169
|
_this.loadBins(bufferURL)
|
|
24545
26170
|
];
|
|
24546
26171
|
}
|
|
24547
|
-
} else if ("sourceType" in img) {
|
|
24548
|
-
// TODO: 确定是否有用
|
|
24549
|
-
return [
|
|
24550
|
-
2,
|
|
24551
|
-
img
|
|
24552
|
-
];
|
|
24553
26172
|
} else if (_instanceof1(img, HTMLImageElement) || _instanceof1(img, HTMLCanvasElement) || _instanceof1(img, HTMLVideoElement) || _instanceof1(img, Texture)) {
|
|
24554
26173
|
return [
|
|
24555
26174
|
2,
|
|
@@ -24600,7 +26219,7 @@ var seed = 1;
|
|
|
24600
26219
|
});
|
|
24601
26220
|
})();
|
|
24602
26221
|
};
|
|
24603
|
-
_proto.processTextures = function processTextures(images, bins, jsonScene
|
|
26222
|
+
_proto.processTextures = function processTextures(images, bins, jsonScene) {
|
|
24604
26223
|
var _this = this;
|
|
24605
26224
|
return _async_to_generator(function() {
|
|
24606
26225
|
var _jsonScene_textures, textures, jobs;
|
|
@@ -24611,7 +26230,7 @@ var seed = 1;
|
|
|
24611
26230
|
};
|
|
24612
26231
|
});
|
|
24613
26232
|
jobs = textures.map(/*#__PURE__*/ _async_to_generator(function(textureOptions, idx) {
|
|
24614
|
-
var e, source, image, texture;
|
|
26233
|
+
var e, source, id, image, texture;
|
|
24615
26234
|
return __generator(this, function(_state) {
|
|
24616
26235
|
switch(_state.label){
|
|
24617
26236
|
case 0:
|
|
@@ -24635,7 +26254,7 @@ var seed = 1;
|
|
|
24635
26254
|
]);
|
|
24636
26255
|
return [
|
|
24637
26256
|
4,
|
|
24638
|
-
deserializeMipmapTexture(textureOptions, bins,
|
|
26257
|
+
deserializeMipmapTexture(textureOptions, bins, _this.assets, jsonScene.bins)
|
|
24639
26258
|
];
|
|
24640
26259
|
case 2:
|
|
24641
26260
|
return [
|
|
@@ -24646,12 +26265,12 @@ var seed = 1;
|
|
|
24646
26265
|
e = _state.sent();
|
|
24647
26266
|
throw new Error("Load texture " + idx + " fails, error message: " + e + ".");
|
|
24648
26267
|
case 4:
|
|
24649
|
-
source = textureOptions.source;
|
|
26268
|
+
source = textureOptions.source, id = textureOptions.id;
|
|
24650
26269
|
if (!isObject(source)) return [
|
|
24651
26270
|
3,
|
|
24652
26271
|
5
|
|
24653
26272
|
];
|
|
24654
|
-
image =
|
|
26273
|
+
image = _this.assets[source.id];
|
|
24655
26274
|
return [
|
|
24656
26275
|
3,
|
|
24657
26276
|
7
|
|
@@ -24670,9 +26289,7 @@ var seed = 1;
|
|
|
24670
26289
|
_state.label = 7;
|
|
24671
26290
|
case 7:
|
|
24672
26291
|
if (image) {
|
|
24673
|
-
texture = createTextureOptionsBySource(image, _this.assets[idx]);
|
|
24674
|
-
texture.id = textureOptions.id;
|
|
24675
|
-
texture.dataType = DataType.Texture;
|
|
26292
|
+
texture = createTextureOptionsBySource(image, _this.assets[idx], id);
|
|
24676
26293
|
return [
|
|
24677
26294
|
2,
|
|
24678
26295
|
texture.sourceType === TextureSourceType.compressed ? texture : _extends({}, texture, textureOptions)
|
|
@@ -24733,11 +26350,6 @@ var seed = 1;
|
|
|
24733
26350
|
return window.clearTimeout(id);
|
|
24734
26351
|
});
|
|
24735
26352
|
}
|
|
24736
|
-
for(var key in this.assets){
|
|
24737
|
-
var _asset_dispose;
|
|
24738
|
-
var asset = this.assets[key];
|
|
24739
|
-
asset == null ? void 0 : (_asset_dispose = asset.dispose) == null ? void 0 : _asset_dispose.call(asset);
|
|
24740
|
-
}
|
|
24741
26353
|
this.assets = {};
|
|
24742
26354
|
this.timers = [];
|
|
24743
26355
|
};
|
|
@@ -24746,55 +26358,44 @@ var seed = 1;
|
|
|
24746
26358
|
/**
|
|
24747
26359
|
* 自定义文本缓存,随页面销毁而销毁
|
|
24748
26360
|
*/ AssetManager.fonts = new Set();
|
|
24749
|
-
function
|
|
24750
|
-
|
|
24751
|
-
|
|
24752
|
-
|
|
24753
|
-
|
|
24754
|
-
for(var j = 0; j < ids.length; j++){
|
|
24755
|
-
var id1 = ids[j];
|
|
24756
|
-
var tag = images[id1].renderLevel;
|
|
24757
|
-
if (passRenderLevel(tag, renderLevel)) {
|
|
24758
|
-
usedImages[id1] = true;
|
|
24759
|
-
}
|
|
24760
|
-
}
|
|
24761
|
-
}
|
|
24762
|
-
}
|
|
24763
|
-
}
|
|
24764
|
-
function createTextureOptionsBySource(image, sourceFrom) {
|
|
26361
|
+
function createTextureOptionsBySource(image, sourceFrom, id) {
|
|
26362
|
+
var options = {
|
|
26363
|
+
id: id,
|
|
26364
|
+
dataType: DataType.Texture
|
|
26365
|
+
};
|
|
24765
26366
|
if (_instanceof1(image, Texture)) {
|
|
24766
|
-
return image.source;
|
|
26367
|
+
return _extends({}, image.source, options);
|
|
24767
26368
|
} else if (_instanceof1(image, HTMLImageElement) || isCanvas(image)) {
|
|
24768
|
-
return {
|
|
26369
|
+
return _extends({
|
|
24769
26370
|
image: image,
|
|
24770
26371
|
sourceType: TextureSourceType.image,
|
|
24771
26372
|
sourceFrom: sourceFrom,
|
|
24772
26373
|
keepImageSource: true,
|
|
24773
26374
|
minFilter: glContext.LINEAR,
|
|
24774
26375
|
magFilter: glContext.LINEAR
|
|
24775
|
-
};
|
|
26376
|
+
}, options);
|
|
24776
26377
|
} else if (_instanceof1(image, HTMLVideoElement)) {
|
|
24777
26378
|
// 视频
|
|
24778
|
-
return {
|
|
26379
|
+
return _extends({
|
|
24779
26380
|
sourceType: TextureSourceType.video,
|
|
24780
26381
|
video: image,
|
|
24781
26382
|
minFilter: glContext.LINEAR,
|
|
24782
26383
|
magFilter: glContext.LINEAR
|
|
24783
|
-
};
|
|
26384
|
+
}, options);
|
|
24784
26385
|
} else if (_instanceof1(image, ArrayBuffer)) {
|
|
24785
26386
|
// 压缩纹理
|
|
24786
26387
|
return _extends({}, getKTXTextureOptions(image), {
|
|
24787
26388
|
sourceFrom: sourceFrom
|
|
24788
|
-
});
|
|
26389
|
+
}, options);
|
|
24789
26390
|
} else if ("width" in image && "height" in image && "data" in image) {
|
|
24790
|
-
return {
|
|
26391
|
+
return _extends({
|
|
24791
26392
|
sourceType: TextureSourceType.data,
|
|
24792
26393
|
data: image,
|
|
24793
26394
|
wrapS: glContext.CLAMP_TO_EDGE,
|
|
24794
26395
|
wrapT: glContext.CLAMP_TO_EDGE,
|
|
24795
26396
|
minFilter: glContext.NEAREST,
|
|
24796
26397
|
magFilter: glContext.NEAREST
|
|
24797
|
-
};
|
|
26398
|
+
}, options);
|
|
24798
26399
|
}
|
|
24799
26400
|
throw new Error("Invalid texture options.");
|
|
24800
26401
|
}
|
|
@@ -25098,11 +26699,12 @@ var listOrder = 0;
|
|
|
25098
26699
|
function CompositionSourceManager(scene, engine) {
|
|
25099
26700
|
this.refCompositions = new Map();
|
|
25100
26701
|
this.refCompositionProps = new Map();
|
|
26702
|
+
this.imgUsage = {};
|
|
25101
26703
|
this.mask = 0;
|
|
25102
26704
|
this.engine = engine;
|
|
25103
26705
|
// 资源
|
|
25104
26706
|
var jsonScene = scene.jsonScene, renderLevel = scene.renderLevel, textureOptions = scene.textureOptions, pluginSystem = scene.pluginSystem, totalTime = scene.totalTime;
|
|
25105
|
-
var compositions = jsonScene.compositions,
|
|
26707
|
+
var compositions = jsonScene.compositions, compositionId = jsonScene.compositionId;
|
|
25106
26708
|
if (!textureOptions) {
|
|
25107
26709
|
throw new Error("scene.textures expected.");
|
|
25108
26710
|
}
|
|
@@ -25122,7 +26724,6 @@ var listOrder = 0;
|
|
|
25122
26724
|
this.renderLevel = renderLevel;
|
|
25123
26725
|
this.pluginSystem = pluginSystem;
|
|
25124
26726
|
this.totalTime = totalTime != null ? totalTime : 0;
|
|
25125
|
-
this.imgUsage = imgUsage != null ? imgUsage : {};
|
|
25126
26727
|
this.textures = cachedTextures;
|
|
25127
26728
|
listOrder = 0;
|
|
25128
26729
|
this.sourceContent = this.getContent(this.composition);
|
|
@@ -25143,11 +26744,12 @@ var listOrder = 0;
|
|
|
25143
26744
|
});
|
|
25144
26745
|
};
|
|
25145
26746
|
_proto.assembleItems = function assembleItems(composition) {
|
|
26747
|
+
var _this_jsonScene;
|
|
25146
26748
|
var items = [];
|
|
25147
|
-
this.mask++;
|
|
25148
26749
|
var componentMap = {};
|
|
25149
|
-
|
|
25150
|
-
|
|
26750
|
+
this.mask++;
|
|
26751
|
+
var _this_jsonScene_components;
|
|
26752
|
+
for(var _iterator = _create_for_of_iterator_helper_loose((_this_jsonScene_components = (_this_jsonScene = this.jsonScene) == null ? void 0 : _this_jsonScene.components) != null ? _this_jsonScene_components : []), _step; !(_step = _iterator()).done;){
|
|
25151
26753
|
var component = _step.value;
|
|
25152
26754
|
componentMap[component.id] = component;
|
|
25153
26755
|
}
|
|
@@ -25184,19 +26786,24 @@ var listOrder = 0;
|
|
|
25184
26786
|
_proto.preProcessItemContent = function preProcessItemContent(renderContent) {
|
|
25185
26787
|
if (renderContent.renderer) {
|
|
25186
26788
|
renderContent.renderer = this.changeTex(renderContent.renderer);
|
|
25187
|
-
if (!renderContent.renderer
|
|
26789
|
+
if (!("mask" in renderContent.renderer)) {
|
|
25188
26790
|
this.processMask(renderContent.renderer);
|
|
25189
26791
|
}
|
|
25190
|
-
var split = renderContent.splits && !renderContent.textureSheetAnimation
|
|
25191
|
-
|
|
26792
|
+
var split = renderContent.splits && !renderContent.textureSheetAnimation ? renderContent.splits[0] : undefined;
|
|
26793
|
+
var shape = renderContent.renderer.shape;
|
|
26794
|
+
var shapeData;
|
|
26795
|
+
if (Number.isInteger(shape)) {
|
|
25192
26796
|
var _this_jsonScene;
|
|
25193
|
-
|
|
25194
|
-
|
|
25195
|
-
|
|
25196
|
-
|
|
26797
|
+
shapeData = (_this_jsonScene = this.jsonScene) == null ? void 0 : _this_jsonScene.shapes[shape];
|
|
26798
|
+
} else {
|
|
26799
|
+
shapeData = shape;
|
|
26800
|
+
}
|
|
26801
|
+
if (shapeData !== undefined) {
|
|
26802
|
+
// @ts-expect-error 类型转换问题
|
|
26803
|
+
renderContent.renderer.shape = getGeometryByShape(shapeData, split);
|
|
25197
26804
|
}
|
|
25198
26805
|
}
|
|
25199
|
-
if (renderContent.trails) {
|
|
26806
|
+
if ("trails" in renderContent && renderContent.trails !== undefined) {
|
|
25200
26807
|
renderContent.trails = this.changeTex(renderContent.trails);
|
|
25201
26808
|
}
|
|
25202
26809
|
};
|
|
@@ -25204,22 +26811,17 @@ var listOrder = 0;
|
|
|
25204
26811
|
if (!renderer.texture) {
|
|
25205
26812
|
return renderer;
|
|
25206
26813
|
}
|
|
25207
|
-
//@ts-expect-error
|
|
25208
26814
|
var texIdx = renderer.texture.id;
|
|
25209
26815
|
if (texIdx !== undefined) {
|
|
25210
|
-
|
|
25211
|
-
this.addTextureUsage(texIdx) || texIdx;
|
|
26816
|
+
this.addTextureUsage(texIdx);
|
|
25212
26817
|
}
|
|
25213
26818
|
return renderer;
|
|
25214
26819
|
};
|
|
25215
|
-
_proto.addTextureUsage = function addTextureUsage(
|
|
25216
|
-
var texId = texIdx;
|
|
26820
|
+
_proto.addTextureUsage = function addTextureUsage(texId) {
|
|
25217
26821
|
var _this_imgUsage;
|
|
25218
|
-
// FIXME: imageUsage 取自 scene.imgUsage,类型为 Record<string, number[]>,这里给的 number,类型对不上
|
|
25219
26822
|
var imageUsage = (_this_imgUsage = this.imgUsage) != null ? _this_imgUsage : {};
|
|
25220
26823
|
if (texId && imageUsage) {
|
|
25221
|
-
|
|
25222
|
-
if (!imageUsage.hasOwnProperty(texId)) {
|
|
26824
|
+
if (!Object.prototype.hasOwnProperty.call(imageUsage, texId)) {
|
|
25223
26825
|
imageUsage[texId] = 0;
|
|
25224
26826
|
}
|
|
25225
26827
|
imageUsage[texId]++;
|
|
@@ -25390,7 +26992,6 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
25390
26992
|
_this.lastVideoUpdateTime = 0;
|
|
25391
26993
|
var _props_reusable = props.reusable, reusable = _props_reusable === void 0 ? false : _props_reusable, _props_speed = props.speed, speed = _props_speed === void 0 ? 1 : _props_speed, _props_baseRenderOrder = props.baseRenderOrder, baseRenderOrder = _props_baseRenderOrder === void 0 ? 0 : _props_baseRenderOrder, renderer = props.renderer, event = props.event, width = props.width, height = props.height, handleItemMessage = props.handleItemMessage;
|
|
25392
26994
|
_this.compositionSourceManager = new CompositionSourceManager(scene, renderer.engine);
|
|
25393
|
-
scene.jsonScene.imgUsage = undefined;
|
|
25394
26995
|
if (reusable) {
|
|
25395
26996
|
_this.keepResource = true;
|
|
25396
26997
|
scene.textures = undefined;
|
|
@@ -25409,24 +27010,23 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
25409
27010
|
_this.rootComposition.data = sourceContent;
|
|
25410
27011
|
_this.rootComposition.item = _this.rootItem;
|
|
25411
27012
|
_this.rootItem.components.push(_this.rootComposition);
|
|
25412
|
-
var imageUsage = !reusable && imgUsage;
|
|
25413
27013
|
_this.width = width;
|
|
25414
27014
|
_this.height = height;
|
|
25415
27015
|
_this.renderOrder = baseRenderOrder;
|
|
25416
27016
|
_this.id = sourceContent.id;
|
|
25417
27017
|
_this.renderer = renderer;
|
|
25418
|
-
_this.texInfo =
|
|
27018
|
+
_this.texInfo = !reusable ? imgUsage : {};
|
|
25419
27019
|
_this.event = event;
|
|
25420
|
-
var _scene_startTime
|
|
27020
|
+
var _scene_startTime;
|
|
25421
27021
|
_this.statistic = {
|
|
25422
|
-
loadTime: totalTime != null ? totalTime : 0,
|
|
25423
27022
|
loadStart: (_scene_startTime = scene.startTime) != null ? _scene_startTime : 0,
|
|
25424
|
-
|
|
25425
|
-
|
|
27023
|
+
loadTime: totalTime != null ? totalTime : 0,
|
|
27024
|
+
compileTime: 0,
|
|
27025
|
+
firstFrameTime: 0
|
|
25426
27026
|
};
|
|
25427
27027
|
_this.reusable = reusable;
|
|
25428
27028
|
_this.speed = speed;
|
|
25429
|
-
_this.autoRefTex = !_this.keepResource &&
|
|
27029
|
+
_this.autoRefTex = !_this.keepResource && _this.texInfo && _this.rootItem.endBehavior !== EndBehavior.restart;
|
|
25430
27030
|
_this.name = sourceContent.name;
|
|
25431
27031
|
_this.pluginSystem = pluginSystem;
|
|
25432
27032
|
_this.pluginSystem.initializeComposition(_assert_this_initialized(_this), scene);
|
|
@@ -25598,6 +27198,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
25598
27198
|
*/ _proto.reset = function reset() {
|
|
25599
27199
|
this.rendererOptions = null;
|
|
25600
27200
|
this.rootItem.ended = false;
|
|
27201
|
+
this.rootComposition.time = 0;
|
|
25601
27202
|
this.pluginSystem.resetComposition(this, this.renderFrame);
|
|
25602
27203
|
};
|
|
25603
27204
|
_proto.prepareRender = function prepareRender() {
|
|
@@ -28122,7 +29723,7 @@ __decorate([
|
|
|
28122
29723
|
serialize()
|
|
28123
29724
|
], BinaryAsset.prototype, "buffer", void 0);
|
|
28124
29725
|
BinaryAsset = __decorate([
|
|
28125
|
-
effectsClass(
|
|
29726
|
+
effectsClass(DataType.BinaryAsset)
|
|
28126
29727
|
], BinaryAsset);
|
|
28127
29728
|
|
|
28128
29729
|
registerPlugin("camera", CameraVFXItemLoader, VFXItem, true);
|
|
@@ -28131,8 +29732,8 @@ registerPlugin("sprite", SpriteLoader, VFXItem, true);
|
|
|
28131
29732
|
registerPlugin("particle", ParticleLoader, VFXItem, true);
|
|
28132
29733
|
registerPlugin("cal", CalculateLoader, VFXItem, true);
|
|
28133
29734
|
registerPlugin("interact", InteractLoader, VFXItem, true);
|
|
28134
|
-
var version = "2.1.0-alpha.
|
|
29735
|
+
var version = "2.1.0-alpha.6";
|
|
28135
29736
|
logger.info("Core version: " + version + ".");
|
|
28136
29737
|
|
|
28137
|
-
export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, AssetLoader, AssetManager, BYTES_TYPE_MAP, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, COMPRESSED_TEXTURE, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, 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, FilterMode, Float16ArrayWrapper, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, HELP_LINK, HitTestType, InteractComponent, InteractLoader, InteractMesh, Item, KTXTexture, LineSegments, LinearValue, Material, MaterialDataBlock, MaterialRenderType, Mesh, ObjectBindingTrack, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, PassTextureCache, PathSegments, PluginSystem, PostProcessVolume, 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, SemanticMap, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderFactory, ShaderType, ShaderVariant, SpriteColorPlayable, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteLoader, StaticValue, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, Ticker, TimelineAsset, TimelineClip, TimelinePlayable, TrackAsset, TrackSortWrapper, TrackType, Transform, TransformAnimationPlayable, TransformPlayableAsset, TransformTrack, VFXItem, ValueGetter, addByOrder, addItem, addItemWithOrder, applyMixins, assertExist, asserts, base64ToFile, blend, calculateTranslation, canvasPool, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, createCopyShader, createGLContext, createKeyFrameMeta, createShape, createValueGetter, decimalEqual, defaultGlobalVolume, 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,
|
|
29738
|
+
export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, AssetLoader, AssetManager, BYTES_TYPE_MAP, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, COMPRESSED_TEXTURE, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, Component, ComponentShapeType, 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, FilterMode, Float16ArrayWrapper, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, HELP_LINK, HitTestType, InteractComponent, InteractLoader, InteractMesh, Item, KTXTexture, LineSegments, LinearValue, Material, MaterialDataBlock, MaterialRenderType, Mesh, ObjectBindingTrack, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, PassTextureCache, PathSegments, PluginSystem, PostProcessVolume, RENDER_PASS_NAME_PREFIX, RENDER_PREFER_LOOKUP_TEXTURE, RUNTIME_ENV, RandomSetValue, RandomValue, RandomVectorValue, RenderFrame, RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, RenderTargetHandle, RenderTextureFormat, Renderbuffer, Renderer, RendererComponent, RuntimeClip, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0, SEMANTIC_PRE_COLOR_ATTACHMENT_0, SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0, SPRITE_VERTEX_STRIDE, Scene, SemanticMap, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderFactory, ShaderType, ShaderVariant, ShapeComponent, ShapeConnectType, ShapePointType, SpriteColorPlayable, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteLoader, StaticValue, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, Ticker, TimelineAsset, TimelineClip, TimelinePlayable, TrackAsset, TrackSortWrapper, TrackType, Transform, TransformAnimationPlayable, TransformPlayableAsset, TransformTrack, VFXItem, ValueGetter, addByOrder, addItem, addItemWithOrder, applyMixins, assertExist, asserts, base64ToFile, blend, calculateTranslation, canvasPool, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, createCopyShader, createGLContext, createKeyFrameMeta, createShape, createValueGetter, decimalEqual, defaultGlobalVolume, 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, pluginLoaderMap, randomInRange, registerPlugin, removeItem, rotateVec2, screenMeshVert, serialize, setBlendMode, setConfig, setDefaultTextureFactory, setMaskMode, setMaxSpriteMeshItemCount, setRayFromCamera, setSideMode, setSpriteMeshMaxItemCountByGPU, sortByOrder, index$1 as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecFill, vecMulCombine, version, vertexFormatType2GLType };
|
|
28138
29739
|
//# sourceMappingURL=index.mjs.map
|