@galacean/effects-threejs 2.1.0-alpha.4 → 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/index.js +1841 -243
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/dist/index.mjs +1842 -241
- package/dist/index.mjs.map +1 -1
- package/dist/three-display-object.d.ts +4 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Description: Galacean Effects runtime threejs plugin for the web
|
|
4
4
|
* Author: Ant Group CO., Ltd.
|
|
5
5
|
* Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
|
|
6
|
-
* Version: v2.1.0-alpha.
|
|
6
|
+
* Version: v2.1.0-alpha.6
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
@@ -3972,6 +3972,12 @@ Euler.tempMat0 = new Matrix4();
|
|
|
3972
3972
|
/**
|
|
3973
3973
|
* 节点元素
|
|
3974
3974
|
*/ ItemType["node"] = "node";
|
|
3975
|
+
/**
|
|
3976
|
+
* 视频元素
|
|
3977
|
+
*/ ItemType["video"] = "video";
|
|
3978
|
+
/**
|
|
3979
|
+
* 音频元素
|
|
3980
|
+
*/ ItemType["audio"] = "audio";
|
|
3975
3981
|
})(ItemType || (ItemType = {}));
|
|
3976
3982
|
/**
|
|
3977
3983
|
* 渲染模式
|
|
@@ -4072,15 +4078,6 @@ var CameraClipMode;
|
|
|
4072
4078
|
*/ CameraClipMode[CameraClipMode["landscape"] = 0] = "landscape";
|
|
4073
4079
|
})(CameraClipMode || (CameraClipMode = {}));
|
|
4074
4080
|
|
|
4075
|
-
/**
|
|
4076
|
-
* 动态换图类型
|
|
4077
|
-
* @since 1.1.0
|
|
4078
|
-
*/ var BackgroundType;
|
|
4079
|
-
(function(BackgroundType) {
|
|
4080
|
-
BackgroundType["video"] = "video";
|
|
4081
|
-
BackgroundType["image"] = "image";
|
|
4082
|
-
})(BackgroundType || (BackgroundType = {}));
|
|
4083
|
-
|
|
4084
4081
|
/*********************************************/ /* 基本数值属性参数 */ /*********************************************/ var ValueType;
|
|
4085
4082
|
(function(ValueType) {
|
|
4086
4083
|
/**
|
|
@@ -4386,6 +4383,8 @@ var DataType;
|
|
|
4386
4383
|
DataType["TreeComponent"] = "TreeComponent";
|
|
4387
4384
|
DataType["AnimationComponent"] = "AnimationComponent";
|
|
4388
4385
|
DataType["SpineComponent"] = "SpineComponent";
|
|
4386
|
+
DataType["VideoComponent"] = "VideoComponent";
|
|
4387
|
+
DataType["AudioComponent"] = "AudioComponent";
|
|
4389
4388
|
// Non-EffectObject
|
|
4390
4389
|
DataType["TimelineClip"] = "TimelineClip";
|
|
4391
4390
|
})(DataType || (DataType = {}));
|
|
@@ -4475,10 +4474,28 @@ var VertexBufferSemantic;
|
|
|
4475
4474
|
|
|
4476
4475
|
var BuiltinObjectGUID = {
|
|
4477
4476
|
WhiteTexture: "whitetexture00000000000000000000",
|
|
4477
|
+
TransparentTexture: "transparenttexture00000000000000000000",
|
|
4478
4478
|
PBRShader: "pbr00000000000000000000000000000",
|
|
4479
4479
|
UnlitShader: "unlit000000000000000000000000000"
|
|
4480
4480
|
};
|
|
4481
4481
|
|
|
4482
|
+
/**
|
|
4483
|
+
* 动态换图类型
|
|
4484
|
+
* @since 1.1.0
|
|
4485
|
+
*/ var BackgroundType;
|
|
4486
|
+
(function(BackgroundType) {
|
|
4487
|
+
BackgroundType["video"] = "video";
|
|
4488
|
+
BackgroundType["image"] = "image";
|
|
4489
|
+
})(BackgroundType || (BackgroundType = {}));
|
|
4490
|
+
/**
|
|
4491
|
+
* 多媒体资源类型
|
|
4492
|
+
* @since 2.1.0
|
|
4493
|
+
*/ var MultimediaType;
|
|
4494
|
+
(function(MultimediaType) {
|
|
4495
|
+
MultimediaType["video"] = "video";
|
|
4496
|
+
MultimediaType["audio"] = "audio";
|
|
4497
|
+
})(MultimediaType || (MultimediaType = {}));
|
|
4498
|
+
|
|
4482
4499
|
var index$1 = /*#__PURE__*/Object.freeze({
|
|
4483
4500
|
__proto__: null,
|
|
4484
4501
|
get RenderLevel () { return RenderLevel; },
|
|
@@ -4495,7 +4512,6 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
4495
4512
|
get RenderType () { return RenderType; },
|
|
4496
4513
|
get RenderFace () { return RenderFace; },
|
|
4497
4514
|
get CameraClipMode () { return CameraClipMode; },
|
|
4498
|
-
get BackgroundType () { return BackgroundType; },
|
|
4499
4515
|
END_BEHAVIOR_DESTROY: END_BEHAVIOR_DESTROY,
|
|
4500
4516
|
END_BEHAVIOR_PAUSE: END_BEHAVIOR_PAUSE,
|
|
4501
4517
|
END_BEHAVIOR_FORWARD: END_BEHAVIOR_FORWARD,
|
|
@@ -4529,7 +4545,9 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
4529
4545
|
get VertexFormatType () { return VertexFormatType; },
|
|
4530
4546
|
get IndexFormatType () { return IndexFormatType; },
|
|
4531
4547
|
get VertexBufferSemantic () { return VertexBufferSemantic; },
|
|
4532
|
-
BuiltinObjectGUID: BuiltinObjectGUID
|
|
4548
|
+
BuiltinObjectGUID: BuiltinObjectGUID,
|
|
4549
|
+
get BackgroundType () { return BackgroundType; },
|
|
4550
|
+
get MultimediaType () { return MultimediaType; }
|
|
4533
4551
|
});
|
|
4534
4552
|
|
|
4535
4553
|
var decoratorInitialStore = new Map();
|
|
@@ -8192,11 +8210,11 @@ function _loadMedia() {
|
|
|
8192
8210
|
return _loadMedia.apply(this, arguments);
|
|
8193
8211
|
}
|
|
8194
8212
|
|
|
8195
|
-
function deserializeMipmapTexture(textureOptions, bins,
|
|
8213
|
+
function deserializeMipmapTexture(textureOptions, bins, assets) {
|
|
8196
8214
|
return _deserializeMipmapTexture.apply(this, arguments);
|
|
8197
8215
|
}
|
|
8198
8216
|
function _deserializeMipmapTexture() {
|
|
8199
|
-
_deserializeMipmapTexture = _async_to_generator(function(textureOptions, bins,
|
|
8217
|
+
_deserializeMipmapTexture = _async_to_generator(function(textureOptions, bins, assets, files) {
|
|
8200
8218
|
var mipmaps, target, jobs, loadedMipmaps, mipmaps1, target1, jobs1, loadedMipmaps1, bin;
|
|
8201
8219
|
return __generator(this, function(_state) {
|
|
8202
8220
|
switch(_state.label){
|
|
@@ -8212,9 +8230,8 @@ function _deserializeMipmapTexture() {
|
|
|
8212
8230
|
// @ts-expect-error
|
|
8213
8231
|
if (pointer.id) {
|
|
8214
8232
|
// @ts-expect-error
|
|
8215
|
-
var
|
|
8216
|
-
|
|
8217
|
-
return loadedImageAsset.data;
|
|
8233
|
+
var loadedImage = assets[pointer.id];
|
|
8234
|
+
return loadedImage;
|
|
8218
8235
|
} else {
|
|
8219
8236
|
return loadMipmapImage(pointer, bins);
|
|
8220
8237
|
}
|
|
@@ -8451,7 +8468,7 @@ var sourceOptions = {
|
|
|
8451
8468
|
};
|
|
8452
8469
|
function generateWhiteTexture(engine) {
|
|
8453
8470
|
return Texture.create(engine, _extends({
|
|
8454
|
-
id:
|
|
8471
|
+
id: BuiltinObjectGUID.WhiteTexture,
|
|
8455
8472
|
data: {
|
|
8456
8473
|
width: 1,
|
|
8457
8474
|
height: 1,
|
|
@@ -8467,7 +8484,7 @@ function generateWhiteTexture(engine) {
|
|
|
8467
8484
|
}
|
|
8468
8485
|
function generateTransparentTexture(engine) {
|
|
8469
8486
|
return Texture.create(engine, _extends({
|
|
8470
|
-
id:
|
|
8487
|
+
id: BuiltinObjectGUID.TransparentTexture,
|
|
8471
8488
|
data: {
|
|
8472
8489
|
width: 1,
|
|
8473
8490
|
height: 1,
|
|
@@ -10826,7 +10843,7 @@ exports.Shader = /*#__PURE__*/ function(EffectsObject) {
|
|
|
10826
10843
|
return Shader;
|
|
10827
10844
|
}(EffectsObject);
|
|
10828
10845
|
exports.Shader = __decorate([
|
|
10829
|
-
effectsClass(
|
|
10846
|
+
effectsClass(DataType.Shader)
|
|
10830
10847
|
], exports.Shader);
|
|
10831
10848
|
|
|
10832
10849
|
var EFFECTS_COPY_MESH_NAME = "effects-internal-copy";
|
|
@@ -11613,7 +11630,7 @@ var valueDefine = "#ifdef SHADER_VERTEX\n#define CURVE_VALUE_TEXTURE uVCurveValu
|
|
|
11613
11630
|
|
|
11614
11631
|
var screenMeshVert = "precision highp float;attribute vec2 aPos;varying vec2 uv;void main(){gl_Position=vec4(aPos,0.,1.0);uv=(aPos+vec2(1.0))/2.;}";
|
|
11615
11632
|
|
|
11616
|
-
var colorGradingFrag = "precision highp float;\n#define HALF_MAX 60000.0\n#define ACEScc_MIDGRAY 0.4135884\nvarying vec2 uv;uniform sampler2D _GaussianTex;uniform sampler2D _SceneTex;uniform float _BloomIntensity;uniform float _Brightness;uniform float _Saturation;uniform float _Contrast;uniform bool _UseBloom;uniform bool _UseToneMapping;uniform vec3 _VignetteColor;uniform vec2 _VignetteCenter;uniform float _VignetteIntensity;uniform float _VignetteSmoothness;uniform float _VignetteRoundness;mat3 LinearToACES=mat3(0.59719,0.07600,0.02840,0.35458,0.90834,0.13383,0.04823,0.01566,0.83777);mat3 ACESToLinear=mat3(1.60475,-0.10208,-0.00327,-0.53108,1.10813,-0.07276,-0.07367,-0.00605,1.07602);float log10(float x){return log(x)/log(10.0);}vec3 log10(vec3 v){return vec3(log10(v.x),log10(v.y),log10(v.z));}vec3 LinearToLogC(vec3 x){return 0.244161*log10(5.555556*x+0.047996)+0.386036;}vec3 LogCToLinear(vec3 x){return(pow(vec3(10.0),(x-0.386036)/0.244161)-0.047996)/5.555556;}vec3 rrt_and_odt_fit(vec3 col){vec3 a=col*(col+0.0245786)-0.000090537;vec3 b=col*(0.983729*col+0.4329510)+0.238081;return a/b;}vec3 ACESToneMapping(vec3 col){vec3 aces=LinearToACES*col;aces=rrt_and_odt_fit(aces);col=ACESToLinear*aces;return col;}vec3 LinearToSrgb(vec3 c){return mix(1.055*pow(c,vec3(1./2.4))-0.055,12.92*c,step(c,vec3(0.0031308)));}vec3 GammaCorrection(vec3 c){return pow(c,vec3(1.0/2.2));}vec3 ApplyVignette(vec3 inputColor,vec2 uv,vec2 center,float intensity,float roundness,float smoothness,vec3 color){vec2 dist=abs(uv-center)*intensity;dist.x*=roundness;float vfactor=pow(clamp((1.0-dot(dist,dist)),0.0,1.0),smoothness);return inputColor*mix(color,vec3(1.0),vfactor);}void main(){vec4 hdrColor=texture2D(_SceneTex,uv);hdrColor
|
|
11633
|
+
var colorGradingFrag = "precision highp float;\n#define HALF_MAX 60000.0\n#define ACEScc_MIDGRAY 0.4135884\nvarying vec2 uv;uniform sampler2D _GaussianTex;uniform sampler2D _SceneTex;uniform float _BloomIntensity;uniform float _Brightness;uniform float _Saturation;uniform float _Contrast;uniform bool _UseBloom;uniform bool _UseToneMapping;uniform vec3 _VignetteColor;uniform vec2 _VignetteCenter;uniform float _VignetteIntensity;uniform float _VignetteSmoothness;uniform float _VignetteRoundness;mat3 LinearToACES=mat3(0.59719,0.07600,0.02840,0.35458,0.90834,0.13383,0.04823,0.01566,0.83777);mat3 ACESToLinear=mat3(1.60475,-0.10208,-0.00327,-0.53108,1.10813,-0.07276,-0.07367,-0.00605,1.07602);float log10(float x){return log(x)/log(10.0);}vec3 log10(vec3 v){return vec3(log10(v.x),log10(v.y),log10(v.z));}vec3 LinearToLogC(vec3 x){return 0.244161*log10(5.555556*x+0.047996)+0.386036;}vec3 LogCToLinear(vec3 x){return(pow(vec3(10.0),(x-0.386036)/0.244161)-0.047996)/5.555556;}vec3 rrt_and_odt_fit(vec3 col){vec3 a=col*(col+0.0245786)-0.000090537;vec3 b=col*(0.983729*col+0.4329510)+0.238081;return a/b;}vec3 ACESToneMapping(vec3 col){vec3 aces=LinearToACES*col;aces=rrt_and_odt_fit(aces);col=ACESToLinear*aces;return col;}vec3 LinearToSrgb(vec3 c){return mix(1.055*pow(c,vec3(1./2.4))-0.055,12.92*c,step(c,vec3(0.0031308)));}vec3 GammaCorrection(vec3 c){return pow(c,vec3(1.0/2.2));}vec3 ApplyVignette(vec3 inputColor,vec2 uv,vec2 center,float intensity,float roundness,float smoothness,vec3 color){vec2 dist=abs(uv-center)*intensity;dist.x*=roundness;float vfactor=pow(clamp((1.0-dot(dist,dist)),0.0,1.0),smoothness);return inputColor*mix(color,vec3(1.0),vfactor);}void main(){vec4 hdrColor=texture2D(_SceneTex,uv);hdrColor.rgb=pow(hdrColor.rgb,vec3(2.2));vec3 finalColor=hdrColor.rgb;if(_UseBloom){vec4 bloomColor=texture2D(_GaussianTex,uv);bloomColor.rgb*=_BloomIntensity;finalColor+=bloomColor.rgb;}if(_VignetteIntensity>0.0){finalColor=ApplyVignette(finalColor,uv,_VignetteCenter,_VignetteIntensity,_VignetteRoundness,_VignetteSmoothness,_VignetteColor);}finalColor=finalColor*_Brightness;vec3 colorLog=LinearToLogC(finalColor);colorLog=(colorLog-ACEScc_MIDGRAY)*_Contrast+ACEScc_MIDGRAY;finalColor=LogCToLinear(colorLog);finalColor=max(finalColor,0.0);float luminance=0.2125*finalColor.r+0.7154*finalColor.g+0.0721*finalColor.b;vec3 luminanceColor=vec3(luminance,luminance,luminance);finalColor=(finalColor-luminanceColor)*_Saturation+luminanceColor;finalColor=max(finalColor,0.0);if(_UseToneMapping){finalColor=max(vec3(0.0),ACESToneMapping(finalColor));}float alpha=min(hdrColor.a,1.0);gl_FragColor=vec4(clamp(GammaCorrection(finalColor),0.0,1.0),alpha);}";
|
|
11617
11634
|
|
|
11618
11635
|
var gaussianDown_frag = "precision highp float;varying vec2 uv;uniform sampler2D _MainTex;uniform vec2 _TextureSize;float GaussWeight2D(float x,float y,float sigma){float PI=3.14159265358;float E=2.71828182846;float sigma_2=pow(sigma,2.0);float a=-(x*x+y*y)/(2.0*sigma_2);return pow(E,a)/(2.0*PI*sigma_2);}vec3 GaussNxN(sampler2D tex,vec2 uv,vec2 stride,float sigma){vec3 color=vec3(0.,0.,0.);const int r=5/2;float weight=0.0;for(int i=-r;i<=r;i++){for(int j=-r;j<=r;j++){float w=GaussWeight2D(float(i),float(j),sigma);vec2 coord=uv+vec2(i,j)*stride;color+=texture2D(tex,coord).rgb*w;weight+=w;}}color/=weight;return color;}void main(){vec4 mainColor=texture2D(_MainTex,uv);vec3 color=mainColor.rgb;color=GaussNxN(_MainTex,uv,1.0/_TextureSize,1.0);gl_FragColor=vec4(color,1.0);}";
|
|
11619
11636
|
|
|
@@ -12911,7 +12928,7 @@ var GPUCapability = /*#__PURE__*/ function() {
|
|
|
12911
12928
|
shaderTextureLod: level2 || !!gl.getExtension("EXT_shader_texture_lod"),
|
|
12912
12929
|
instanceDraw: level2 || !!gl.getExtension("ANGLE_instanced_arrays"),
|
|
12913
12930
|
drawBuffers: level2 || !!this.drawBufferExtension,
|
|
12914
|
-
asyncShaderCompile: !!
|
|
12931
|
+
asyncShaderCompile: !!this.glAsyncCompileExt,
|
|
12915
12932
|
intIndexElementBuffer: !!gl.getExtension("OES_element_index_uint"),
|
|
12916
12933
|
standardDerivatives: level2 || !!gl.getExtension("OES_standard_derivatives"),
|
|
12917
12934
|
readableDepthStencilTextures: level2 || !!depthTextureExtension,
|
|
@@ -15815,7 +15832,7 @@ function getGeometryTriangles(geometry, options) {
|
|
|
15815
15832
|
*/ function getGeometriesByShapeData(shape) {
|
|
15816
15833
|
var geometries = [];
|
|
15817
15834
|
// 该版本的单个形状数据可以包含多个形状,可以加个埋点,五福之后没有就可以下掉
|
|
15818
|
-
if (shape
|
|
15835
|
+
if ("gs" in shape) {
|
|
15819
15836
|
shape.gs.forEach(function(gs) {
|
|
15820
15837
|
geometries.push({
|
|
15821
15838
|
p: [
|
|
@@ -15828,7 +15845,7 @@ function getGeometryTriangles(geometry, options) {
|
|
|
15828
15845
|
]
|
|
15829
15846
|
});
|
|
15830
15847
|
});
|
|
15831
|
-
} else if (shape
|
|
15848
|
+
} else if ("g" in shape) {
|
|
15832
15849
|
geometries.push({
|
|
15833
15850
|
p: [
|
|
15834
15851
|
ValueType.SHAPE_POINTS,
|
|
@@ -16827,6 +16844,7 @@ exports.ParticleSystem = /*#__PURE__*/ function(Component) {
|
|
|
16827
16844
|
});
|
|
16828
16845
|
this.frozen = false;
|
|
16829
16846
|
this.ended = false;
|
|
16847
|
+
this.destroyed = false;
|
|
16830
16848
|
};
|
|
16831
16849
|
_proto.update = function update(delta) {
|
|
16832
16850
|
var _this = this;
|
|
@@ -18137,7 +18155,9 @@ var ParticleMesh = /*#__PURE__*/ function() {
|
|
|
18137
18155
|
aPos: new Float32Array(48),
|
|
18138
18156
|
aRot: new Float32Array(32),
|
|
18139
18157
|
aOffset: new Float32Array(16),
|
|
18140
|
-
aTranslation: new Float32Array(12)
|
|
18158
|
+
aTranslation: new Float32Array(12),
|
|
18159
|
+
aLinearMove: new Float32Array(12),
|
|
18160
|
+
aRotation0: new Float32Array(36)
|
|
18141
18161
|
};
|
|
18142
18162
|
var useSprite = this.useSprite;
|
|
18143
18163
|
if (useSprite) {
|
|
@@ -19113,7 +19133,7 @@ exports.TransformPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
|
19113
19133
|
return TransformPlayableAsset;
|
|
19114
19134
|
}(PlayableAsset);
|
|
19115
19135
|
exports.TransformPlayableAsset = __decorate([
|
|
19116
|
-
effectsClass(
|
|
19136
|
+
effectsClass(DataType.TransformPlayableAsset)
|
|
19117
19137
|
], exports.TransformPlayableAsset);
|
|
19118
19138
|
/**
|
|
19119
19139
|
* @since 2.0.0
|
|
@@ -19144,7 +19164,7 @@ exports.ActivationPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
|
19144
19164
|
return ActivationPlayableAsset;
|
|
19145
19165
|
}(PlayableAsset);
|
|
19146
19166
|
exports.ActivationPlayableAsset = __decorate([
|
|
19147
|
-
effectsClass(
|
|
19167
|
+
effectsClass(DataType.ActivationPlayableAsset)
|
|
19148
19168
|
], exports.ActivationPlayableAsset);
|
|
19149
19169
|
exports.AnimationClip = /*#__PURE__*/ function(EffectsObject) {
|
|
19150
19170
|
_inherits(AnimationClip, EffectsObject);
|
|
@@ -19387,7 +19407,7 @@ __decorate([
|
|
|
19387
19407
|
serialize()
|
|
19388
19408
|
], exports.TrackAsset.prototype, "children", void 0);
|
|
19389
19409
|
exports.TrackAsset = __decorate([
|
|
19390
|
-
effectsClass(
|
|
19410
|
+
effectsClass(DataType.TrackAsset)
|
|
19391
19411
|
], exports.TrackAsset);
|
|
19392
19412
|
exports.TrackType = void 0;
|
|
19393
19413
|
(function(TrackType) {
|
|
@@ -19482,7 +19502,7 @@ exports.ObjectBindingTrack = /*#__PURE__*/ function(TrackAsset1) {
|
|
|
19482
19502
|
return ObjectBindingTrack;
|
|
19483
19503
|
}(exports.TrackAsset);
|
|
19484
19504
|
exports.ObjectBindingTrack = __decorate([
|
|
19485
|
-
effectsClass(
|
|
19505
|
+
effectsClass(DataType.ObjectBindingTrack)
|
|
19486
19506
|
], exports.ObjectBindingTrack);
|
|
19487
19507
|
|
|
19488
19508
|
exports.TransformTrack = /*#__PURE__*/ function(TrackAsset) {
|
|
@@ -19493,7 +19513,7 @@ exports.TransformTrack = /*#__PURE__*/ function(TrackAsset) {
|
|
|
19493
19513
|
return TransformTrack;
|
|
19494
19514
|
}(exports.TrackAsset);
|
|
19495
19515
|
exports.TransformTrack = __decorate([
|
|
19496
|
-
effectsClass(
|
|
19516
|
+
effectsClass(DataType.TransformTrack)
|
|
19497
19517
|
], exports.TransformTrack);
|
|
19498
19518
|
|
|
19499
19519
|
var ActivationMixerPlayable = /*#__PURE__*/ function(Playable) {
|
|
@@ -19554,7 +19574,7 @@ exports.ActivationTrack = /*#__PURE__*/ function(TrackAsset) {
|
|
|
19554
19574
|
return ActivationTrack;
|
|
19555
19575
|
}(exports.TrackAsset);
|
|
19556
19576
|
exports.ActivationTrack = __decorate([
|
|
19557
|
-
effectsClass(
|
|
19577
|
+
effectsClass(DataType.ActivationTrack)
|
|
19558
19578
|
], exports.ActivationTrack);
|
|
19559
19579
|
|
|
19560
19580
|
exports.SpriteColorTrack = /*#__PURE__*/ function(TrackAsset) {
|
|
@@ -19565,7 +19585,7 @@ exports.SpriteColorTrack = /*#__PURE__*/ function(TrackAsset) {
|
|
|
19565
19585
|
return SpriteColorTrack;
|
|
19566
19586
|
}(exports.TrackAsset);
|
|
19567
19587
|
exports.SpriteColorTrack = __decorate([
|
|
19568
|
-
effectsClass(
|
|
19588
|
+
effectsClass(DataType.SpriteColorTrack)
|
|
19569
19589
|
], exports.SpriteColorTrack);
|
|
19570
19590
|
|
|
19571
19591
|
exports.TimelineAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
@@ -19602,7 +19622,7 @@ __decorate([
|
|
|
19602
19622
|
serialize()
|
|
19603
19623
|
], exports.TimelineAsset.prototype, "tracks", void 0);
|
|
19604
19624
|
exports.TimelineAsset = __decorate([
|
|
19605
|
-
effectsClass(
|
|
19625
|
+
effectsClass(DataType.TimelineAsset)
|
|
19606
19626
|
], exports.TimelineAsset);
|
|
19607
19627
|
var TimelinePlayable = /*#__PURE__*/ function(Playable) {
|
|
19608
19628
|
_inherits(TimelinePlayable, Playable);
|
|
@@ -19967,7 +19987,7 @@ exports.SubCompositionTrack = /*#__PURE__*/ function(TrackAsset) {
|
|
|
19967
19987
|
return SubCompositionTrack;
|
|
19968
19988
|
}(exports.TrackAsset);
|
|
19969
19989
|
exports.SubCompositionTrack = __decorate([
|
|
19970
|
-
effectsClass(
|
|
19990
|
+
effectsClass(DataType.SubCompositionTrack)
|
|
19971
19991
|
], exports.SubCompositionTrack);
|
|
19972
19992
|
|
|
19973
19993
|
var SubCompositionClipPlayable = /*#__PURE__*/ function(Playable) {
|
|
@@ -19997,7 +20017,7 @@ exports.SubCompositionPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
|
19997
20017
|
return SubCompositionPlayableAsset;
|
|
19998
20018
|
}(PlayableAsset);
|
|
19999
20019
|
exports.SubCompositionPlayableAsset = __decorate([
|
|
20000
|
-
effectsClass(
|
|
20020
|
+
effectsClass(DataType.SubCompositionPlayableAsset)
|
|
20001
20021
|
], exports.SubCompositionPlayableAsset);
|
|
20002
20022
|
|
|
20003
20023
|
function _possible_constructor_return(self, call) {
|
|
@@ -20817,6 +20837,1652 @@ exports.PostProcessVolume = __decorate([
|
|
|
20817
20837
|
effectsClass("PostProcessVolume")
|
|
20818
20838
|
], exports.PostProcessVolume);
|
|
20819
20839
|
|
|
20840
|
+
/**
|
|
20841
|
+
* A class to define a shape via user defined coordinates.
|
|
20842
|
+
*/ var Polygon = /*#__PURE__*/ function() {
|
|
20843
|
+
function Polygon() {
|
|
20844
|
+
for(var _len = arguments.length, points = new Array(_len), _key = 0; _key < _len; _key++){
|
|
20845
|
+
points[_key] = arguments[_key];
|
|
20846
|
+
}
|
|
20847
|
+
/** An array of the points of this polygon. */ this.points = [];
|
|
20848
|
+
/** `false` after moveTo, `true` after `closePath`. In all other cases it is `true`. */ this.closePath = false;
|
|
20849
|
+
var flat = Array.isArray(points[0]) ? points[0] : points;
|
|
20850
|
+
// if this is an array of points, convert it to a flat array of numbers
|
|
20851
|
+
if (typeof flat[0] !== "number") {
|
|
20852
|
+
var p = [];
|
|
20853
|
+
for(var i = 0, il = flat.length; i < il; i++){
|
|
20854
|
+
p.push(flat[i].x, flat[i].y);
|
|
20855
|
+
}
|
|
20856
|
+
flat = p;
|
|
20857
|
+
}
|
|
20858
|
+
this.points = flat;
|
|
20859
|
+
this.closePath = true;
|
|
20860
|
+
}
|
|
20861
|
+
var _proto = Polygon.prototype;
|
|
20862
|
+
/**
|
|
20863
|
+
* Creates a clone of this polygon.
|
|
20864
|
+
* @returns - A copy of the polygon.
|
|
20865
|
+
*/ _proto.clone = function clone() {
|
|
20866
|
+
var points = this.points.slice();
|
|
20867
|
+
var polygon = new Polygon(points);
|
|
20868
|
+
polygon.closePath = this.closePath;
|
|
20869
|
+
return polygon;
|
|
20870
|
+
};
|
|
20871
|
+
/**
|
|
20872
|
+
* Checks whether the x and y coordinates passed to this function are contained within this polygon.
|
|
20873
|
+
* @param x - The X coordinate of the point to test.
|
|
20874
|
+
* @param y - The Y coordinate of the point to test.
|
|
20875
|
+
* @returns - Whether the x/y coordinates are within this polygon.
|
|
20876
|
+
*/ _proto.contains = function contains(x, y) {
|
|
20877
|
+
var inside = false;
|
|
20878
|
+
// use some raycasting to test hits
|
|
20879
|
+
// https://github.com/substack/point-in-polygon/blob/master/index.js
|
|
20880
|
+
var length = this.points.length / 2;
|
|
20881
|
+
for(var i = 0, j = length - 1; i < length; j = i++){
|
|
20882
|
+
var xi = this.points[i * 2];
|
|
20883
|
+
var yi = this.points[i * 2 + 1];
|
|
20884
|
+
var xj = this.points[j * 2];
|
|
20885
|
+
var yj = this.points[j * 2 + 1];
|
|
20886
|
+
var intersect = yi > y !== yj > y && x < (xj - xi) * ((y - yi) / (yj - yi)) + xi;
|
|
20887
|
+
if (intersect) {
|
|
20888
|
+
inside = !inside;
|
|
20889
|
+
}
|
|
20890
|
+
}
|
|
20891
|
+
return inside;
|
|
20892
|
+
};
|
|
20893
|
+
/**
|
|
20894
|
+
* Copies another polygon to this one.
|
|
20895
|
+
* @param polygon - The polygon to copy from.
|
|
20896
|
+
* @returns Returns itself.
|
|
20897
|
+
*/ _proto.copyFrom = function copyFrom(polygon) {
|
|
20898
|
+
this.points = polygon.points.slice();
|
|
20899
|
+
this.closePath = polygon.closePath;
|
|
20900
|
+
return this;
|
|
20901
|
+
};
|
|
20902
|
+
/**
|
|
20903
|
+
* Copies this polygon to another one.
|
|
20904
|
+
* @param polygon - The polygon to copy to.
|
|
20905
|
+
* @returns Returns given parameter.
|
|
20906
|
+
*/ _proto.copyTo = function copyTo(polygon) {
|
|
20907
|
+
polygon.copyFrom(this);
|
|
20908
|
+
return polygon;
|
|
20909
|
+
};
|
|
20910
|
+
_create_class(Polygon, [
|
|
20911
|
+
{
|
|
20912
|
+
key: "lastX",
|
|
20913
|
+
get: /**
|
|
20914
|
+
* Get the last X coordinate of the polygon
|
|
20915
|
+
* @readonly
|
|
20916
|
+
*/ function get() {
|
|
20917
|
+
return this.points[this.points.length - 2];
|
|
20918
|
+
}
|
|
20919
|
+
},
|
|
20920
|
+
{
|
|
20921
|
+
key: "lastY",
|
|
20922
|
+
get: /**
|
|
20923
|
+
* Get the last Y coordinate of the polygon
|
|
20924
|
+
* @readonly
|
|
20925
|
+
*/ function get() {
|
|
20926
|
+
return this.points[this.points.length - 1];
|
|
20927
|
+
}
|
|
20928
|
+
},
|
|
20929
|
+
{
|
|
20930
|
+
key: "x",
|
|
20931
|
+
get: /**
|
|
20932
|
+
* Get the first X coordinate of the polygon
|
|
20933
|
+
* @readonly
|
|
20934
|
+
*/ function get() {
|
|
20935
|
+
return this.points[this.points.length - 2];
|
|
20936
|
+
}
|
|
20937
|
+
},
|
|
20938
|
+
{
|
|
20939
|
+
key: "y",
|
|
20940
|
+
get: /**
|
|
20941
|
+
* Get the first Y coordinate of the polygon
|
|
20942
|
+
* @readonly
|
|
20943
|
+
*/ function get() {
|
|
20944
|
+
return this.points[this.points.length - 1];
|
|
20945
|
+
}
|
|
20946
|
+
}
|
|
20947
|
+
]);
|
|
20948
|
+
return Polygon;
|
|
20949
|
+
}();
|
|
20950
|
+
|
|
20951
|
+
// thanks to https://github.com/mattdesl/adaptive-bezier-curve
|
|
20952
|
+
// for the original code!
|
|
20953
|
+
var RECURSION_LIMIT = 8;
|
|
20954
|
+
var FLT_EPSILON = 1.19209290e-7;
|
|
20955
|
+
var PATH_DISTANCE_EPSILON = 1.0;
|
|
20956
|
+
var defaultBezierSmoothness = 0.5;
|
|
20957
|
+
function buildAdaptiveBezier(points, sX, sY, cp1x, cp1y, cp2x, cp2y, eX, eY, smoothness) {
|
|
20958
|
+
// TODO expose as a parameter
|
|
20959
|
+
var scale = 5;
|
|
20960
|
+
var smoothing = Math.min(0.99, Math.max(0, smoothness != null ? smoothness : defaultBezierSmoothness));
|
|
20961
|
+
var distanceTolerance = (PATH_DISTANCE_EPSILON - smoothing) / scale;
|
|
20962
|
+
distanceTolerance *= distanceTolerance;
|
|
20963
|
+
begin(sX, sY, cp1x, cp1y, cp2x, cp2y, eX, eY, points, distanceTolerance);
|
|
20964
|
+
return points;
|
|
20965
|
+
}
|
|
20966
|
+
//// Based on:
|
|
20967
|
+
//// https://github.com/pelson/antigrain/blob/master/agg-2.4/src/agg_curves.cpp
|
|
20968
|
+
function begin(sX, sY, cp1x, cp1y, cp2x, cp2y, eX, eY, points, distanceTolerance) {
|
|
20969
|
+
// dont need to actually ad this!
|
|
20970
|
+
// points.push(sX, sY);
|
|
20971
|
+
recursive(sX, sY, cp1x, cp1y, cp2x, cp2y, eX, eY, points, distanceTolerance, 0);
|
|
20972
|
+
points.push(eX, eY);
|
|
20973
|
+
}
|
|
20974
|
+
// eslint-disable-next-line max-params
|
|
20975
|
+
function recursive(x1, y1, x2, y2, x3, y3, x4, y4, points, distanceTolerance, level) {
|
|
20976
|
+
if (level > RECURSION_LIMIT) {
|
|
20977
|
+
return;
|
|
20978
|
+
}
|
|
20979
|
+
// Calculate all the mid-points of the line segments
|
|
20980
|
+
// ----------------------
|
|
20981
|
+
var x12 = (x1 + x2) / 2;
|
|
20982
|
+
var y12 = (y1 + y2) / 2;
|
|
20983
|
+
var x23 = (x2 + x3) / 2;
|
|
20984
|
+
var y23 = (y2 + y3) / 2;
|
|
20985
|
+
var x34 = (x3 + x4) / 2;
|
|
20986
|
+
var y34 = (y3 + y4) / 2;
|
|
20987
|
+
var x123 = (x12 + x23) / 2;
|
|
20988
|
+
var y123 = (y12 + y23) / 2;
|
|
20989
|
+
var x234 = (x23 + x34) / 2;
|
|
20990
|
+
var y234 = (y23 + y34) / 2;
|
|
20991
|
+
var x1234 = (x123 + x234) / 2;
|
|
20992
|
+
var y1234 = (y123 + y234) / 2;
|
|
20993
|
+
if (level > 0) {
|
|
20994
|
+
// Try to approximate the full cubic curve by a single straight line
|
|
20995
|
+
// ------------------
|
|
20996
|
+
var dx = x4 - x1;
|
|
20997
|
+
var dy = y4 - y1;
|
|
20998
|
+
var d2 = Math.abs((x2 - x4) * dy - (y2 - y4) * dx);
|
|
20999
|
+
var d3 = Math.abs((x3 - x4) * dy - (y3 - y4) * dx);
|
|
21000
|
+
if (d2 > FLT_EPSILON && d3 > FLT_EPSILON) {
|
|
21001
|
+
// Regular care
|
|
21002
|
+
// -----------------
|
|
21003
|
+
if ((d2 + d3) * (d2 + d3) <= distanceTolerance * (dx * dx + dy * dy)) {
|
|
21004
|
+
// If the curvature doesn't exceed the distanceTolerance value
|
|
21005
|
+
// we tend to finish subdivisions.
|
|
21006
|
+
// ----------------------
|
|
21007
|
+
{
|
|
21008
|
+
points.push(x1234, y1234);
|
|
21009
|
+
return;
|
|
21010
|
+
}
|
|
21011
|
+
}
|
|
21012
|
+
} else if (d2 > FLT_EPSILON) {
|
|
21013
|
+
// p1,p3,p4 are collinear, p2 is considerable
|
|
21014
|
+
// ----------------------
|
|
21015
|
+
if (d2 * d2 <= distanceTolerance * (dx * dx + dy * dy)) {
|
|
21016
|
+
{
|
|
21017
|
+
points.push(x1234, y1234);
|
|
21018
|
+
return;
|
|
21019
|
+
}
|
|
21020
|
+
}
|
|
21021
|
+
} else if (d3 > FLT_EPSILON) {
|
|
21022
|
+
// p1,p2,p4 are collinear, p3 is considerable
|
|
21023
|
+
// ----------------------
|
|
21024
|
+
if (d3 * d3 <= distanceTolerance * (dx * dx + dy * dy)) {
|
|
21025
|
+
{
|
|
21026
|
+
points.push(x1234, y1234);
|
|
21027
|
+
return;
|
|
21028
|
+
}
|
|
21029
|
+
}
|
|
21030
|
+
} else {
|
|
21031
|
+
// Collinear case
|
|
21032
|
+
// -----------------
|
|
21033
|
+
dx = x1234 - (x1 + x4) / 2;
|
|
21034
|
+
dy = y1234 - (y1 + y4) / 2;
|
|
21035
|
+
if (dx * dx + dy * dy <= distanceTolerance) {
|
|
21036
|
+
points.push(x1234, y1234);
|
|
21037
|
+
return;
|
|
21038
|
+
}
|
|
21039
|
+
}
|
|
21040
|
+
}
|
|
21041
|
+
// Continue subdivision
|
|
21042
|
+
// ----------------------
|
|
21043
|
+
recursive(x1, y1, x12, y12, x123, y123, x1234, y1234, points, distanceTolerance, level + 1);
|
|
21044
|
+
recursive(x1234, y1234, x234, y234, x34, y34, x4, y4, points, distanceTolerance, level + 1);
|
|
21045
|
+
}
|
|
21046
|
+
|
|
21047
|
+
var ShapePath = /*#__PURE__*/ function() {
|
|
21048
|
+
function ShapePath(graphicsPath) {
|
|
21049
|
+
this.graphicsPath = graphicsPath;
|
|
21050
|
+
this.currentPoly = null;
|
|
21051
|
+
this.shapePrimitives = [];
|
|
21052
|
+
}
|
|
21053
|
+
var _proto = ShapePath.prototype;
|
|
21054
|
+
/** Builds the path. */ _proto.buildPath = function buildPath() {
|
|
21055
|
+
this.currentPoly = null;
|
|
21056
|
+
this.shapePrimitives.length = 0;
|
|
21057
|
+
var path = this.graphicsPath;
|
|
21058
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(path.instructions), _step; !(_step = _iterator()).done;){
|
|
21059
|
+
var instruction = _step.value;
|
|
21060
|
+
var action = instruction.action;
|
|
21061
|
+
var data = instruction.data;
|
|
21062
|
+
switch(action){
|
|
21063
|
+
case "bezierCurveTo":
|
|
21064
|
+
{
|
|
21065
|
+
this.bezierCurveTo(data[0], data[1], data[2], data[3], data[4], data[5], data[6]);
|
|
21066
|
+
break;
|
|
21067
|
+
}
|
|
21068
|
+
case "moveTo":
|
|
21069
|
+
{
|
|
21070
|
+
this.moveTo(data[0], data[1]);
|
|
21071
|
+
break;
|
|
21072
|
+
}
|
|
21073
|
+
}
|
|
21074
|
+
}
|
|
21075
|
+
this.endPoly();
|
|
21076
|
+
};
|
|
21077
|
+
/**
|
|
21078
|
+
* Adds a cubic Bezier curve to the path.
|
|
21079
|
+
* It requires three points: the first two are control points and the third one is the end point.
|
|
21080
|
+
* The starting point is the last point in the current path.
|
|
21081
|
+
* @param cp1x - The x-coordinate of the first control point.
|
|
21082
|
+
* @param cp1y - The y-coordinate of the first control point.
|
|
21083
|
+
* @param cp2x - The x-coordinate of the second control point.
|
|
21084
|
+
* @param cp2y - The y-coordinate of the second control point.
|
|
21085
|
+
* @param x - The x-coordinate of the end point.
|
|
21086
|
+
* @param y - The y-coordinate of the end point.
|
|
21087
|
+
* @param smoothness - Optional parameter to adjust the smoothness of the curve.
|
|
21088
|
+
* @returns The instance of the current object for chaining.
|
|
21089
|
+
*/ _proto.bezierCurveTo = function bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y, smoothness) {
|
|
21090
|
+
this.ensurePoly();
|
|
21091
|
+
var currentPoly = this.currentPoly;
|
|
21092
|
+
buildAdaptiveBezier(currentPoly.points, currentPoly.lastX, currentPoly.lastY, cp1x, cp1y, cp2x, cp2y, x, y, smoothness);
|
|
21093
|
+
return this;
|
|
21094
|
+
};
|
|
21095
|
+
_proto.moveTo = function moveTo(x, y) {
|
|
21096
|
+
this.startPoly(x, y);
|
|
21097
|
+
return this;
|
|
21098
|
+
};
|
|
21099
|
+
/**
|
|
21100
|
+
* Starts a new polygon path from the specified starting point.
|
|
21101
|
+
* This method initializes a new polygon or ends the current one if it exists.
|
|
21102
|
+
* @param x - The x-coordinate of the starting point of the new polygon.
|
|
21103
|
+
* @param y - The y-coordinate of the starting point of the new polygon.
|
|
21104
|
+
* @returns The instance of the current object for chaining.
|
|
21105
|
+
*/ _proto.startPoly = function startPoly(x, y) {
|
|
21106
|
+
var currentPoly = this.currentPoly;
|
|
21107
|
+
if (currentPoly) {
|
|
21108
|
+
this.endPoly();
|
|
21109
|
+
}
|
|
21110
|
+
currentPoly = new Polygon();
|
|
21111
|
+
currentPoly.points.push(x, y);
|
|
21112
|
+
this.currentPoly = currentPoly;
|
|
21113
|
+
return this;
|
|
21114
|
+
};
|
|
21115
|
+
/**
|
|
21116
|
+
* Ends the current polygon path. If `closePath` is set to true,
|
|
21117
|
+
* the path is closed by connecting the last point to the first one.
|
|
21118
|
+
* This method finalizes the current polygon and prepares it for drawing or adding to the shape primitives.
|
|
21119
|
+
* @param closePath - A boolean indicating whether to close the polygon by connecting the last point
|
|
21120
|
+
* back to the starting point. False by default.
|
|
21121
|
+
* @returns The instance of the current object for chaining.
|
|
21122
|
+
*/ _proto.endPoly = function endPoly(closePath) {
|
|
21123
|
+
if (closePath === void 0) closePath = false;
|
|
21124
|
+
var shape = this.currentPoly;
|
|
21125
|
+
if (shape && shape.points.length > 2) {
|
|
21126
|
+
shape.closePath = closePath;
|
|
21127
|
+
this.shapePrimitives.push({
|
|
21128
|
+
shape: shape
|
|
21129
|
+
});
|
|
21130
|
+
}
|
|
21131
|
+
this.currentPoly = null;
|
|
21132
|
+
return this;
|
|
21133
|
+
};
|
|
21134
|
+
_proto.ensurePoly = function ensurePoly(start) {
|
|
21135
|
+
if (this.currentPoly) {
|
|
21136
|
+
return;
|
|
21137
|
+
}
|
|
21138
|
+
this.currentPoly = new Polygon();
|
|
21139
|
+
this.currentPoly.points.push(0, 0);
|
|
21140
|
+
};
|
|
21141
|
+
return ShapePath;
|
|
21142
|
+
}();
|
|
21143
|
+
|
|
21144
|
+
var GraphicsPath = /*#__PURE__*/ function() {
|
|
21145
|
+
function GraphicsPath() {
|
|
21146
|
+
this.instructions = [];
|
|
21147
|
+
this.dirty = false;
|
|
21148
|
+
}
|
|
21149
|
+
var _proto = GraphicsPath.prototype;
|
|
21150
|
+
/**
|
|
21151
|
+
* Adds a cubic Bezier curve to the path.
|
|
21152
|
+
* It requires three points: the first two are control points and the third one is the end point.
|
|
21153
|
+
* The starting point is the last point in the current path.
|
|
21154
|
+
* @param cp1x - The x-coordinate of the first control point.
|
|
21155
|
+
* @param cp1y - The y-coordinate of the first control point.
|
|
21156
|
+
* @param cp2x - The x-coordinate of the second control point.
|
|
21157
|
+
* @param cp2y - The y-coordinate of the second control point.
|
|
21158
|
+
* @param x - The x-coordinate of the end point.
|
|
21159
|
+
* @param y - The y-coordinate of the end point.
|
|
21160
|
+
* @param smoothness - Optional parameter to adjust the smoothness of the curve.
|
|
21161
|
+
* @returns The instance of the current object for chaining.
|
|
21162
|
+
*/ _proto.bezierCurveTo = function bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y, smoothness) {
|
|
21163
|
+
this.instructions.push({
|
|
21164
|
+
action: "bezierCurveTo",
|
|
21165
|
+
data: [
|
|
21166
|
+
cp1x,
|
|
21167
|
+
cp1y,
|
|
21168
|
+
cp2x,
|
|
21169
|
+
cp2y,
|
|
21170
|
+
x,
|
|
21171
|
+
y,
|
|
21172
|
+
smoothness
|
|
21173
|
+
]
|
|
21174
|
+
});
|
|
21175
|
+
this.dirty = true;
|
|
21176
|
+
return this;
|
|
21177
|
+
};
|
|
21178
|
+
_proto.moveTo = function moveTo(x, y) {
|
|
21179
|
+
this.instructions.push({
|
|
21180
|
+
action: "moveTo",
|
|
21181
|
+
data: [
|
|
21182
|
+
x,
|
|
21183
|
+
y
|
|
21184
|
+
]
|
|
21185
|
+
});
|
|
21186
|
+
this.dirty = true;
|
|
21187
|
+
return this;
|
|
21188
|
+
};
|
|
21189
|
+
_proto.clear = function clear() {
|
|
21190
|
+
this.instructions.length = 0;
|
|
21191
|
+
this.dirty = true;
|
|
21192
|
+
return this;
|
|
21193
|
+
};
|
|
21194
|
+
_create_class(GraphicsPath, [
|
|
21195
|
+
{
|
|
21196
|
+
key: "shapePath",
|
|
21197
|
+
get: /**
|
|
21198
|
+
* Provides access to the internal shape path, ensuring it is up-to-date with the current instructions.
|
|
21199
|
+
* @returns The `ShapePath` instance associated with this `GraphicsPath`.
|
|
21200
|
+
*/ function get() {
|
|
21201
|
+
if (!this._shapePath) {
|
|
21202
|
+
this._shapePath = new ShapePath(this);
|
|
21203
|
+
}
|
|
21204
|
+
if (this.dirty) {
|
|
21205
|
+
this.dirty = false;
|
|
21206
|
+
this._shapePath.buildPath();
|
|
21207
|
+
}
|
|
21208
|
+
return this._shapePath;
|
|
21209
|
+
}
|
|
21210
|
+
}
|
|
21211
|
+
]);
|
|
21212
|
+
return GraphicsPath;
|
|
21213
|
+
}();
|
|
21214
|
+
|
|
21215
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
21216
|
+
|
|
21217
|
+
var libtess_min = {exports: {}};
|
|
21218
|
+
|
|
21219
|
+
/*
|
|
21220
|
+
|
|
21221
|
+
Copyright 2000, Silicon Graphics, Inc. All Rights Reserved.
|
|
21222
|
+
Copyright 2015, Google Inc. All Rights Reserved.
|
|
21223
|
+
|
|
21224
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
21225
|
+
of this software and associated documentation files (the "Software"), to
|
|
21226
|
+
deal in the Software without restriction, including without limitation the
|
|
21227
|
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
21228
|
+
sell copies of the Software, and to permit persons to whom the Software is
|
|
21229
|
+
furnished to do so, subject to the following conditions:
|
|
21230
|
+
|
|
21231
|
+
The above copyright notice including the dates of first publication and
|
|
21232
|
+
either this permission notice or a reference to http://oss.sgi.com/projects/FreeB/
|
|
21233
|
+
shall be included in all copies or substantial portions of the Software.
|
|
21234
|
+
|
|
21235
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21236
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21237
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
21238
|
+
SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
21239
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
|
21240
|
+
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
21241
|
+
|
|
21242
|
+
Original Code. The Original Code is: OpenGL Sample Implementation,
|
|
21243
|
+
Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
|
|
21244
|
+
Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
|
|
21245
|
+
Copyright in any portions created by third parties is as indicated
|
|
21246
|
+
elsewhere herein. All Rights Reserved.
|
|
21247
|
+
*/
|
|
21248
|
+
|
|
21249
|
+
(function (module) {
|
|
21250
|
+
var n;
|
|
21251
|
+
function t(a, b) {
|
|
21252
|
+
return a.b === b.b && a.a === b.a;
|
|
21253
|
+
}
|
|
21254
|
+
function u(a, b) {
|
|
21255
|
+
return a.b < b.b || a.b === b.b && a.a <= b.a;
|
|
21256
|
+
}
|
|
21257
|
+
function v(a, b, c) {
|
|
21258
|
+
var d = b.b - a.b, e = c.b - b.b;
|
|
21259
|
+
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;
|
|
21260
|
+
}
|
|
21261
|
+
function x(a, b, c) {
|
|
21262
|
+
var d = b.b - a.b, e = c.b - b.b;
|
|
21263
|
+
return 0 < d + e ? (b.a - c.a) * d + (b.a - a.a) * e : 0;
|
|
21264
|
+
}
|
|
21265
|
+
function z(a, b) {
|
|
21266
|
+
return a.a < b.a || a.a === b.a && a.b <= b.b;
|
|
21267
|
+
}
|
|
21268
|
+
function aa(a, b, c) {
|
|
21269
|
+
var d = b.a - a.a, e = c.a - b.a;
|
|
21270
|
+
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;
|
|
21271
|
+
}
|
|
21272
|
+
function ba(a, b, c) {
|
|
21273
|
+
var d = b.a - a.a, e = c.a - b.a;
|
|
21274
|
+
return 0 < d + e ? (b.b - c.b) * d + (b.b - a.b) * e : 0;
|
|
21275
|
+
}
|
|
21276
|
+
function ca(a) {
|
|
21277
|
+
return u(a.b.a, a.a);
|
|
21278
|
+
}
|
|
21279
|
+
function da(a) {
|
|
21280
|
+
return u(a.a, a.b.a);
|
|
21281
|
+
}
|
|
21282
|
+
function A(a, b, c, d) {
|
|
21283
|
+
a = 0 > a ? 0 : a;
|
|
21284
|
+
c = 0 > c ? 0 : c;
|
|
21285
|
+
return a <= c ? 0 === c ? (b + d) / 2 : b + a / (a + c) * (d - b) : d + c / (a + c) * (b - d);
|
|
21286
|
+
}
|
|
21287
|
+
function ea(a) {
|
|
21288
|
+
var b = B(a.b);
|
|
21289
|
+
C(b, a.c);
|
|
21290
|
+
C(b.b, a.c);
|
|
21291
|
+
D(b, a.a);
|
|
21292
|
+
return b;
|
|
21293
|
+
}
|
|
21294
|
+
function E(a, b) {
|
|
21295
|
+
var c = !1, d = !1;
|
|
21296
|
+
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));
|
|
21297
|
+
}
|
|
21298
|
+
function I(a) {
|
|
21299
|
+
var b = a.b, c = !1;
|
|
21300
|
+
a.d !== a.b.d && (c = !0, G(a.d, a.b.d));
|
|
21301
|
+
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));
|
|
21302
|
+
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)));
|
|
21303
|
+
fa(a);
|
|
21304
|
+
}
|
|
21305
|
+
function K(a) {
|
|
21306
|
+
var b = B(a), c = b.b;
|
|
21307
|
+
H(b, a.e);
|
|
21308
|
+
b.a = a.b.a;
|
|
21309
|
+
C(c, b.a);
|
|
21310
|
+
b.d = c.d = a.d;
|
|
21311
|
+
b = b.b;
|
|
21312
|
+
H(a.b, J(a.b));
|
|
21313
|
+
H(a.b, b);
|
|
21314
|
+
a.b.a = b.a;
|
|
21315
|
+
b.b.a.c = b.b;
|
|
21316
|
+
b.b.d = a.b.d;
|
|
21317
|
+
b.f = a.f;
|
|
21318
|
+
b.b.f = a.b.f;
|
|
21319
|
+
return b;
|
|
21320
|
+
}
|
|
21321
|
+
function L(a, b) {
|
|
21322
|
+
var c = !1, d = B(a), e = d.b;
|
|
21323
|
+
b.d !== a.d && (c = !0, G(b.d, a.d));
|
|
21324
|
+
H(d, a.e);
|
|
21325
|
+
H(e, b);
|
|
21326
|
+
d.a = a.b.a;
|
|
21327
|
+
e.a = b.a;
|
|
21328
|
+
d.d = e.d = a.d;
|
|
21329
|
+
a.d.a = e;
|
|
21330
|
+
c || D(d, a.d);
|
|
21331
|
+
return d;
|
|
21332
|
+
}
|
|
21333
|
+
function B(a) {
|
|
21334
|
+
var b = new M, c = new M, d = a.b.h;
|
|
21335
|
+
c.h = d;
|
|
21336
|
+
d.b.h = b;
|
|
21337
|
+
b.h = a;
|
|
21338
|
+
a.b.h = c;
|
|
21339
|
+
b.b = c;
|
|
21340
|
+
b.c = b;
|
|
21341
|
+
b.e = c;
|
|
21342
|
+
c.b = b;
|
|
21343
|
+
c.c = c;
|
|
21344
|
+
return c.e = b;
|
|
21345
|
+
}
|
|
21346
|
+
function H(a, b) {
|
|
21347
|
+
var c = a.c, d = b.c;
|
|
21348
|
+
c.b.e = b;
|
|
21349
|
+
d.b.e = a;
|
|
21350
|
+
a.c = d;
|
|
21351
|
+
b.c = c;
|
|
21352
|
+
}
|
|
21353
|
+
function C(a, b) {
|
|
21354
|
+
var c = b.f, d = new N(b, c);
|
|
21355
|
+
c.e = d;
|
|
21356
|
+
b.f = d;
|
|
21357
|
+
c = d.c = a;
|
|
21358
|
+
do c.a = d, c = c.c;
|
|
21359
|
+
while (c !== a);
|
|
21360
|
+
}
|
|
21361
|
+
function D(a, b) {
|
|
21362
|
+
var c = b.d, d = new ga(b, c);
|
|
21363
|
+
c.b = d;
|
|
21364
|
+
b.d = d;
|
|
21365
|
+
d.a = a;
|
|
21366
|
+
d.c = b.c;
|
|
21367
|
+
c = a;
|
|
21368
|
+
do c.d = d, c = c.e;
|
|
21369
|
+
while (c !== a);
|
|
21370
|
+
}
|
|
21371
|
+
function fa(a) {
|
|
21372
|
+
var b = a.h;
|
|
21373
|
+
a = a.b.h;
|
|
21374
|
+
b.b.h = a;
|
|
21375
|
+
a.b.h = b;
|
|
21376
|
+
}
|
|
21377
|
+
function F(a, b) {
|
|
21378
|
+
var c = a.c, d = c;
|
|
21379
|
+
do d.a = b, d = d.c;
|
|
21380
|
+
while (d !== c);
|
|
21381
|
+
c = a.f;
|
|
21382
|
+
d = a.e;
|
|
21383
|
+
d.f = c;
|
|
21384
|
+
c.e = d;
|
|
21385
|
+
}
|
|
21386
|
+
function G(a, b) {
|
|
21387
|
+
var c = a.a, d = c;
|
|
21388
|
+
do d.d = b, d = d.e;
|
|
21389
|
+
while (d !== c);
|
|
21390
|
+
c = a.d;
|
|
21391
|
+
d = a.b;
|
|
21392
|
+
d.d = c;
|
|
21393
|
+
c.b = d;
|
|
21394
|
+
}
|
|
21395
|
+
function ha(a) {
|
|
21396
|
+
var b = 0;
|
|
21397
|
+
Math.abs(a[1]) > Math.abs(a[0]) && (b = 1);
|
|
21398
|
+
Math.abs(a[2]) > Math.abs(a[b]) && (b = 2);
|
|
21399
|
+
return b;
|
|
21400
|
+
}
|
|
21401
|
+
var O = 4 * 1E150;
|
|
21402
|
+
function P(a, b) {
|
|
21403
|
+
a.f += b.f;
|
|
21404
|
+
a.b.f += b.b.f;
|
|
21405
|
+
}
|
|
21406
|
+
function ia(a, b, c) {
|
|
21407
|
+
a = a.a;
|
|
21408
|
+
b = b.a;
|
|
21409
|
+
c = c.a;
|
|
21410
|
+
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);
|
|
21411
|
+
if (c.b.a === a) return 0 <= x(b.b.a, a, b.a);
|
|
21412
|
+
b = v(b.b.a, a, b.a);
|
|
21413
|
+
a = v(c.b.a, a, c.a);
|
|
21414
|
+
return b >= a;
|
|
21415
|
+
}
|
|
21416
|
+
function Q(a) {
|
|
21417
|
+
a.a.i = null;
|
|
21418
|
+
var b = a.e;
|
|
21419
|
+
b.a.c = b.c;
|
|
21420
|
+
b.c.a = b.a;
|
|
21421
|
+
a.e = null;
|
|
21422
|
+
}
|
|
21423
|
+
function ja(a, b) {
|
|
21424
|
+
I(a.a);
|
|
21425
|
+
a.c = !1;
|
|
21426
|
+
a.a = b;
|
|
21427
|
+
b.i = a;
|
|
21428
|
+
}
|
|
21429
|
+
function ka(a) {
|
|
21430
|
+
var b = a.a.a;
|
|
21431
|
+
do a = R(a);
|
|
21432
|
+
while (a.a.a === b);
|
|
21433
|
+
a.c && (b = L(S(a).a.b, a.a.e), ja(a, b), a = R(a));
|
|
21434
|
+
return a;
|
|
21435
|
+
}
|
|
21436
|
+
function la(a, b, c) {
|
|
21437
|
+
var d = new ma;
|
|
21438
|
+
d.a = c;
|
|
21439
|
+
d.e = na(a.f, b.e, d);
|
|
21440
|
+
return c.i = d;
|
|
21441
|
+
}
|
|
21442
|
+
function oa(a, b) {
|
|
21443
|
+
switch(a.s){
|
|
21444
|
+
case 100130:
|
|
21445
|
+
return 0 !== (b & 1);
|
|
21446
|
+
case 100131:
|
|
21447
|
+
return 0 !== b;
|
|
21448
|
+
case 100132:
|
|
21449
|
+
return 0 < b;
|
|
21450
|
+
case 100133:
|
|
21451
|
+
return 0 > b;
|
|
21452
|
+
case 100134:
|
|
21453
|
+
return 2 <= b || -2 >= b;
|
|
21454
|
+
}
|
|
21455
|
+
return !1;
|
|
21456
|
+
}
|
|
21457
|
+
function pa(a) {
|
|
21458
|
+
var b = a.a, c = b.d;
|
|
21459
|
+
c.c = a.d;
|
|
21460
|
+
c.a = b;
|
|
21461
|
+
Q(a);
|
|
21462
|
+
}
|
|
21463
|
+
function T(a, b, c) {
|
|
21464
|
+
a = b;
|
|
21465
|
+
for(b = b.a; a !== c;){
|
|
21466
|
+
a.c = !1;
|
|
21467
|
+
var d = S(a), e = d.a;
|
|
21468
|
+
if (e.a !== b.a) {
|
|
21469
|
+
if (!d.c) {
|
|
21470
|
+
pa(a);
|
|
21471
|
+
break;
|
|
21472
|
+
}
|
|
21473
|
+
e = L(b.c.b, e.b);
|
|
21474
|
+
ja(d, e);
|
|
21475
|
+
}
|
|
21476
|
+
b.c !== e && (E(J(e), e), E(b, e));
|
|
21477
|
+
pa(a);
|
|
21478
|
+
b = d.a;
|
|
21479
|
+
a = d;
|
|
21480
|
+
}
|
|
21481
|
+
return b;
|
|
21482
|
+
}
|
|
21483
|
+
function U(a, b, c, d, e, f) {
|
|
21484
|
+
var g = !0;
|
|
21485
|
+
do la(a, b, c.b), c = c.c;
|
|
21486
|
+
while (c !== d);
|
|
21487
|
+
for(null === e && (e = S(b).a.b.c);;){
|
|
21488
|
+
d = S(b);
|
|
21489
|
+
c = d.a.b;
|
|
21490
|
+
if (c.a !== e.a) break;
|
|
21491
|
+
c.c !== e && (E(J(c), c), E(J(e), c));
|
|
21492
|
+
d.f = b.f - c.f;
|
|
21493
|
+
d.d = oa(a, d.f);
|
|
21494
|
+
b.b = !0;
|
|
21495
|
+
!g && qa(a, b) && (P(c, e), Q(b), I(e));
|
|
21496
|
+
g = !1;
|
|
21497
|
+
b = d;
|
|
21498
|
+
e = c;
|
|
21499
|
+
}
|
|
21500
|
+
b.b = !0;
|
|
21501
|
+
f && ra(a, b);
|
|
21502
|
+
}
|
|
21503
|
+
function sa(a, b, c, d, e) {
|
|
21504
|
+
var f = [
|
|
21505
|
+
b.g[0],
|
|
21506
|
+
b.g[1],
|
|
21507
|
+
b.g[2]
|
|
21508
|
+
];
|
|
21509
|
+
b.d = null;
|
|
21510
|
+
b.d = a.o ? a.o(f, c, d, a.c) || null : null;
|
|
21511
|
+
null === b.d && (e ? a.n || (V(a, 100156), a.n = !0) : b.d = c[0]);
|
|
21512
|
+
}
|
|
21513
|
+
function ta(a, b, c) {
|
|
21514
|
+
var d = [
|
|
21515
|
+
null,
|
|
21516
|
+
null,
|
|
21517
|
+
null,
|
|
21518
|
+
null
|
|
21519
|
+
];
|
|
21520
|
+
d[0] = b.a.d;
|
|
21521
|
+
d[1] = c.a.d;
|
|
21522
|
+
sa(a, b.a, d, [
|
|
21523
|
+
.5,
|
|
21524
|
+
.5,
|
|
21525
|
+
0,
|
|
21526
|
+
0
|
|
21527
|
+
], !1);
|
|
21528
|
+
E(b, c);
|
|
21529
|
+
}
|
|
21530
|
+
function ua(a, b, c, d, e) {
|
|
21531
|
+
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;
|
|
21532
|
+
d[e] = .5 * g / (f + g);
|
|
21533
|
+
d[h] = .5 * f / (f + g);
|
|
21534
|
+
a.g[0] += d[e] * b.g[0] + d[h] * c.g[0];
|
|
21535
|
+
a.g[1] += d[e] * b.g[1] + d[h] * c.g[1];
|
|
21536
|
+
a.g[2] += d[e] * b.g[2] + d[h] * c.g[2];
|
|
21537
|
+
}
|
|
21538
|
+
function qa(a, b) {
|
|
21539
|
+
var c = S(b), d = b.a, e = c.a;
|
|
21540
|
+
if (u(d.a, e.a)) {
|
|
21541
|
+
if (0 < x(e.b.a, d.a, e.a)) return !1;
|
|
21542
|
+
if (!t(d.a, e.a)) K(e.b), E(d, J(e)), b.b = c.b = !0;
|
|
21543
|
+
else if (d.a !== e.a) {
|
|
21544
|
+
var c = a.e, f = d.a.h;
|
|
21545
|
+
if (0 <= f) {
|
|
21546
|
+
var c = c.b, g = c.d, h = c.e, k = c.c, l = k[f];
|
|
21547
|
+
g[l] = g[c.a];
|
|
21548
|
+
k[g[l]] = l;
|
|
21549
|
+
l <= --c.a && (1 >= l ? W(c, l) : u(h[g[l >> 1]], h[g[l]]) ? W(c, l) : va(c, l));
|
|
21550
|
+
h[f] = null;
|
|
21551
|
+
k[f] = c.b;
|
|
21552
|
+
c.b = f;
|
|
21553
|
+
} else for(c.c[-(f + 1)] = null; 0 < c.a && null === c.c[c.d[c.a - 1]];)--c.a;
|
|
21554
|
+
ta(a, J(e), d);
|
|
21555
|
+
}
|
|
21556
|
+
} else {
|
|
21557
|
+
if (0 > x(d.b.a, e.a, d.a)) return !1;
|
|
21558
|
+
R(b).b = b.b = !0;
|
|
21559
|
+
K(d.b);
|
|
21560
|
+
E(J(e), d);
|
|
21561
|
+
}
|
|
21562
|
+
return !0;
|
|
21563
|
+
}
|
|
21564
|
+
function wa(a, b) {
|
|
21565
|
+
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;
|
|
21566
|
+
x(h, a.a, f);
|
|
21567
|
+
x(k, a.a, g);
|
|
21568
|
+
if (f === g || Math.min(f.a, h.a) > Math.max(g.a, k.a)) return !1;
|
|
21569
|
+
if (u(f, g)) {
|
|
21570
|
+
if (0 < x(k, f, g)) return !1;
|
|
21571
|
+
} else if (0 > x(h, g, f)) return !1;
|
|
21572
|
+
var r = h, p = f, q = k, y = g, m, w;
|
|
21573
|
+
u(r, p) || (m = r, r = p, p = m);
|
|
21574
|
+
u(q, y) || (m = q, q = y, y = m);
|
|
21575
|
+
u(r, q) || (m = r, r = q, q = m, m = p, p = y, y = m);
|
|
21576
|
+
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;
|
|
21577
|
+
z(r, p) || (m = r, r = p, p = m);
|
|
21578
|
+
z(q, y) || (m = q, q = y, y = m);
|
|
21579
|
+
z(r, q) || (m = r, r = q, q = m, m = p, p = y, y = m);
|
|
21580
|
+
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;
|
|
21581
|
+
u(l, a.a) && (l.b = a.a.b, l.a = a.a.a);
|
|
21582
|
+
r = u(f, g) ? f : g;
|
|
21583
|
+
u(r, l) && (l.b = r.b, l.a = r.a);
|
|
21584
|
+
if (t(l, f) || t(l, g)) return qa(a, b), !1;
|
|
21585
|
+
if (!t(h, a.a) && 0 <= x(h, a.a, l) || !t(k, a.a) && 0 >= x(k, a.a, l)) {
|
|
21586
|
+
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;
|
|
21587
|
+
if (h === a.a) {
|
|
21588
|
+
K(e.b);
|
|
21589
|
+
E(d.e, J(e));
|
|
21590
|
+
f = c = b;
|
|
21591
|
+
g = f.a.b.a;
|
|
21592
|
+
do f = R(f);
|
|
21593
|
+
while (f.a.b.a === g);
|
|
21594
|
+
b = f;
|
|
21595
|
+
f = S(b).a.b.c;
|
|
21596
|
+
c.a = J(e);
|
|
21597
|
+
e = T(a, c, null);
|
|
21598
|
+
U(a, b, e.c, d.b.c, f, !0);
|
|
21599
|
+
return !0;
|
|
21600
|
+
}
|
|
21601
|
+
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);
|
|
21602
|
+
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);
|
|
21603
|
+
return !1;
|
|
21604
|
+
}
|
|
21605
|
+
K(d.b);
|
|
21606
|
+
K(e.b);
|
|
21607
|
+
E(J(e), d);
|
|
21608
|
+
d.a.b = l.b;
|
|
21609
|
+
d.a.a = l.a;
|
|
21610
|
+
d.a.h = xa(a.e, d.a);
|
|
21611
|
+
d = d.a;
|
|
21612
|
+
e = [
|
|
21613
|
+
0,
|
|
21614
|
+
0,
|
|
21615
|
+
0,
|
|
21616
|
+
0
|
|
21617
|
+
];
|
|
21618
|
+
l = [
|
|
21619
|
+
f.d,
|
|
21620
|
+
h.d,
|
|
21621
|
+
g.d,
|
|
21622
|
+
k.d
|
|
21623
|
+
];
|
|
21624
|
+
d.g[0] = d.g[1] = d.g[2] = 0;
|
|
21625
|
+
ua(d, f, h, e, 0);
|
|
21626
|
+
ua(d, g, k, e, 2);
|
|
21627
|
+
sa(a, d, l, e, !0);
|
|
21628
|
+
R(b).b = b.b = c.b = !0;
|
|
21629
|
+
return !1;
|
|
21630
|
+
}
|
|
21631
|
+
function ra(a, b) {
|
|
21632
|
+
for(var c = S(b);;){
|
|
21633
|
+
for(; c.b;)b = c, c = S(c);
|
|
21634
|
+
if (!b.b && (c = b, b = R(b), null === b || !b.b)) break;
|
|
21635
|
+
b.b = !1;
|
|
21636
|
+
var d = b.a, e = c.a, f;
|
|
21637
|
+
if (f = d.b.a !== e.b.a) a: {
|
|
21638
|
+
f = b;
|
|
21639
|
+
var g = S(f), h = f.a, k = g.a, l = void 0;
|
|
21640
|
+
if (u(h.b.a, k.b.a)) {
|
|
21641
|
+
if (0 > x(h.b.a, k.b.a, h.a)) {
|
|
21642
|
+
f = !1;
|
|
21643
|
+
break a;
|
|
21644
|
+
}
|
|
21645
|
+
R(f).b = f.b = !0;
|
|
21646
|
+
l = K(h);
|
|
21647
|
+
E(k.b, l);
|
|
21648
|
+
l.d.c = f.d;
|
|
21649
|
+
} else {
|
|
21650
|
+
if (0 < x(k.b.a, h.b.a, k.a)) {
|
|
21651
|
+
f = !1;
|
|
21652
|
+
break a;
|
|
21653
|
+
}
|
|
21654
|
+
f.b = g.b = !0;
|
|
21655
|
+
l = K(k);
|
|
21656
|
+
E(h.e, k.b);
|
|
21657
|
+
l.b.d.c = f.d;
|
|
21658
|
+
}
|
|
21659
|
+
f = !0;
|
|
21660
|
+
}
|
|
21661
|
+
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));
|
|
21662
|
+
if (d.a !== e.a) {
|
|
21663
|
+
if (d.b.a === e.b.a || b.c || c.c || d.b.a !== a.a && e.b.a !== a.a) qa(a, b);
|
|
21664
|
+
else if (wa(a, b)) break;
|
|
21665
|
+
}
|
|
21666
|
+
d.a === e.a && d.b.a === e.b.a && (P(e, d), Q(b), I(d), b = R(c));
|
|
21667
|
+
}
|
|
21668
|
+
}
|
|
21669
|
+
function ya(a, b) {
|
|
21670
|
+
a.a = b;
|
|
21671
|
+
for(var c = b.c; null === c.i;)if (c = c.c, c === b.c) {
|
|
21672
|
+
var c = a, d = b, e = new ma;
|
|
21673
|
+
e.a = d.c.b;
|
|
21674
|
+
var f = c.f, g = f.a;
|
|
21675
|
+
do g = g.a;
|
|
21676
|
+
while (null !== g.b && !f.c(f.b, e, g.b));
|
|
21677
|
+
var f = g.b, h = S(f), e = f.a, g = h.a;
|
|
21678
|
+
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));
|
|
21679
|
+
else {
|
|
21680
|
+
var k = u(g.b.a, e.b.a) ? f : h, h = void 0;
|
|
21681
|
+
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);
|
|
21682
|
+
}
|
|
21683
|
+
return;
|
|
21684
|
+
}
|
|
21685
|
+
c = ka(c.i);
|
|
21686
|
+
e = S(c);
|
|
21687
|
+
f = e.a;
|
|
21688
|
+
e = T(a, e, null);
|
|
21689
|
+
if (e.c === f) {
|
|
21690
|
+
var f = e, e = f.c, g = S(c), h = c.a, k = g.a, l = !1;
|
|
21691
|
+
h.b.a !== k.b.a && wa(a, c);
|
|
21692
|
+
t(h.a, a.a) && (E(J(e), h), c = ka(c), e = S(c).a, T(a, S(c), g), l = !0);
|
|
21693
|
+
t(k.a, a.a) && (E(f, J(k)), f = T(a, g, null), l = !0);
|
|
21694
|
+
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));
|
|
21695
|
+
} else U(a, c, e.c, f, f, !0);
|
|
21696
|
+
}
|
|
21697
|
+
function za(a, b) {
|
|
21698
|
+
var c = new ma, d = ea(a.b);
|
|
21699
|
+
d.a.b = O;
|
|
21700
|
+
d.a.a = b;
|
|
21701
|
+
d.b.a.b = -O;
|
|
21702
|
+
d.b.a.a = b;
|
|
21703
|
+
a.a = d.b.a;
|
|
21704
|
+
c.a = d;
|
|
21705
|
+
c.f = 0;
|
|
21706
|
+
c.d = !1;
|
|
21707
|
+
c.c = !1;
|
|
21708
|
+
c.h = !0;
|
|
21709
|
+
c.b = !1;
|
|
21710
|
+
d = a.f;
|
|
21711
|
+
d = na(d, d.a, c);
|
|
21712
|
+
c.e = d;
|
|
21713
|
+
}
|
|
21714
|
+
function Aa(a) {
|
|
21715
|
+
this.a = new Ba;
|
|
21716
|
+
this.b = a;
|
|
21717
|
+
this.c = ia;
|
|
21718
|
+
}
|
|
21719
|
+
function na(a, b, c) {
|
|
21720
|
+
do b = b.c;
|
|
21721
|
+
while (null !== b.b && !a.c(a.b, b.b, c));
|
|
21722
|
+
a = new Ba(c, b.a, b);
|
|
21723
|
+
b.a.c = a;
|
|
21724
|
+
return b.a = a;
|
|
21725
|
+
}
|
|
21726
|
+
function Ba(a, b, c) {
|
|
21727
|
+
this.b = a || null;
|
|
21728
|
+
this.a = b || this;
|
|
21729
|
+
this.c = c || this;
|
|
21730
|
+
}
|
|
21731
|
+
function X() {
|
|
21732
|
+
this.d = Y;
|
|
21733
|
+
this.p = this.b = this.q = null;
|
|
21734
|
+
this.j = [
|
|
21735
|
+
0,
|
|
21736
|
+
0,
|
|
21737
|
+
0
|
|
21738
|
+
];
|
|
21739
|
+
this.s = 100130;
|
|
21740
|
+
this.n = !1;
|
|
21741
|
+
this.o = this.a = this.e = this.f = null;
|
|
21742
|
+
this.m = !1;
|
|
21743
|
+
this.c = this.r = this.i = this.k = this.l = this.h = null;
|
|
21744
|
+
}
|
|
21745
|
+
var Y = 0;
|
|
21746
|
+
n = X.prototype;
|
|
21747
|
+
n.x = function() {
|
|
21748
|
+
Z(this, Y);
|
|
21749
|
+
};
|
|
21750
|
+
n.B = function(a, b) {
|
|
21751
|
+
switch(a){
|
|
21752
|
+
case 100142:
|
|
21753
|
+
return;
|
|
21754
|
+
case 100140:
|
|
21755
|
+
switch(b){
|
|
21756
|
+
case 100130:
|
|
21757
|
+
case 100131:
|
|
21758
|
+
case 100132:
|
|
21759
|
+
case 100133:
|
|
21760
|
+
case 100134:
|
|
21761
|
+
this.s = b;
|
|
21762
|
+
return;
|
|
21763
|
+
}
|
|
21764
|
+
break;
|
|
21765
|
+
case 100141:
|
|
21766
|
+
this.m = !!b;
|
|
21767
|
+
return;
|
|
21768
|
+
default:
|
|
21769
|
+
V(this, 100900);
|
|
21770
|
+
return;
|
|
21771
|
+
}
|
|
21772
|
+
V(this, 100901);
|
|
21773
|
+
};
|
|
21774
|
+
n.y = function(a) {
|
|
21775
|
+
switch(a){
|
|
21776
|
+
case 100142:
|
|
21777
|
+
return 0;
|
|
21778
|
+
case 100140:
|
|
21779
|
+
return this.s;
|
|
21780
|
+
case 100141:
|
|
21781
|
+
return this.m;
|
|
21782
|
+
default:
|
|
21783
|
+
V(this, 100900);
|
|
21784
|
+
}
|
|
21785
|
+
return !1;
|
|
21786
|
+
};
|
|
21787
|
+
n.A = function(a, b, c) {
|
|
21788
|
+
this.j[0] = a;
|
|
21789
|
+
this.j[1] = b;
|
|
21790
|
+
this.j[2] = c;
|
|
21791
|
+
};
|
|
21792
|
+
n.z = function(a, b) {
|
|
21793
|
+
var c = b ? b : null;
|
|
21794
|
+
switch(a){
|
|
21795
|
+
case 100100:
|
|
21796
|
+
case 100106:
|
|
21797
|
+
this.h = c;
|
|
21798
|
+
break;
|
|
21799
|
+
case 100104:
|
|
21800
|
+
case 100110:
|
|
21801
|
+
this.l = c;
|
|
21802
|
+
break;
|
|
21803
|
+
case 100101:
|
|
21804
|
+
case 100107:
|
|
21805
|
+
this.k = c;
|
|
21806
|
+
break;
|
|
21807
|
+
case 100102:
|
|
21808
|
+
case 100108:
|
|
21809
|
+
this.i = c;
|
|
21810
|
+
break;
|
|
21811
|
+
case 100103:
|
|
21812
|
+
case 100109:
|
|
21813
|
+
this.p = c;
|
|
21814
|
+
break;
|
|
21815
|
+
case 100105:
|
|
21816
|
+
case 100111:
|
|
21817
|
+
this.o = c;
|
|
21818
|
+
break;
|
|
21819
|
+
case 100112:
|
|
21820
|
+
this.r = c;
|
|
21821
|
+
break;
|
|
21822
|
+
default:
|
|
21823
|
+
V(this, 100900);
|
|
21824
|
+
}
|
|
21825
|
+
};
|
|
21826
|
+
n.C = function(a, b) {
|
|
21827
|
+
var c = !1, d = [
|
|
21828
|
+
0,
|
|
21829
|
+
0,
|
|
21830
|
+
0
|
|
21831
|
+
];
|
|
21832
|
+
Z(this, 2);
|
|
21833
|
+
for(var e = 0; 3 > e; ++e){
|
|
21834
|
+
var f = a[e];
|
|
21835
|
+
-1E150 > f && (f = -1E150, c = !0);
|
|
21836
|
+
1E150 < f && (f = 1E150, c = !0);
|
|
21837
|
+
d[e] = f;
|
|
21838
|
+
}
|
|
21839
|
+
c && V(this, 100155);
|
|
21840
|
+
c = this.q;
|
|
21841
|
+
null === c ? (c = ea(this.b), E(c, c.b)) : (K(c), c = c.e);
|
|
21842
|
+
c.a.d = b;
|
|
21843
|
+
c.a.g[0] = d[0];
|
|
21844
|
+
c.a.g[1] = d[1];
|
|
21845
|
+
c.a.g[2] = d[2];
|
|
21846
|
+
c.f = 1;
|
|
21847
|
+
c.b.f = -1;
|
|
21848
|
+
this.q = c;
|
|
21849
|
+
};
|
|
21850
|
+
n.u = function(a) {
|
|
21851
|
+
Z(this, Y);
|
|
21852
|
+
this.d = 1;
|
|
21853
|
+
this.b = new Ca;
|
|
21854
|
+
this.c = a;
|
|
21855
|
+
};
|
|
21856
|
+
n.t = function() {
|
|
21857
|
+
Z(this, 1);
|
|
21858
|
+
this.d = 2;
|
|
21859
|
+
this.q = null;
|
|
21860
|
+
};
|
|
21861
|
+
n.v = function() {
|
|
21862
|
+
Z(this, 2);
|
|
21863
|
+
this.d = 1;
|
|
21864
|
+
};
|
|
21865
|
+
n.w = function() {
|
|
21866
|
+
Z(this, 1);
|
|
21867
|
+
this.d = Y;
|
|
21868
|
+
var a = this.j[0], b = this.j[1], c = this.j[2], d = !1, e = [
|
|
21869
|
+
a,
|
|
21870
|
+
b,
|
|
21871
|
+
c
|
|
21872
|
+
];
|
|
21873
|
+
if (0 === a && 0 === b && 0 === c) {
|
|
21874
|
+
for(var b = [
|
|
21875
|
+
-2 * 1E150,
|
|
21876
|
+
-2 * 1E150,
|
|
21877
|
+
-2 * 1E150
|
|
21878
|
+
], f = [
|
|
21879
|
+
2 * 1E150,
|
|
21880
|
+
2 * 1E150,
|
|
21881
|
+
2 * 1E150
|
|
21882
|
+
], c = [], g = [], d = this.b.c, a = d.e; a !== d; a = a.e)for(var h = 0; 3 > h; ++h){
|
|
21883
|
+
var k = a.g[h];
|
|
21884
|
+
k < f[h] && (f[h] = k, g[h] = a);
|
|
21885
|
+
k > b[h] && (b[h] = k, c[h] = a);
|
|
21886
|
+
}
|
|
21887
|
+
a = 0;
|
|
21888
|
+
b[1] - f[1] > b[0] - f[0] && (a = 1);
|
|
21889
|
+
b[2] - f[2] > b[a] - f[a] && (a = 2);
|
|
21890
|
+
if (f[a] >= b[a]) e[0] = 0, e[1] = 0, e[2] = 1;
|
|
21891
|
+
else {
|
|
21892
|
+
b = 0;
|
|
21893
|
+
f = g[a];
|
|
21894
|
+
c = c[a];
|
|
21895
|
+
g = [
|
|
21896
|
+
0,
|
|
21897
|
+
0,
|
|
21898
|
+
0
|
|
21899
|
+
];
|
|
21900
|
+
f = [
|
|
21901
|
+
f.g[0] - c.g[0],
|
|
21902
|
+
f.g[1] - c.g[1],
|
|
21903
|
+
f.g[2] - c.g[2]
|
|
21904
|
+
];
|
|
21905
|
+
h = [
|
|
21906
|
+
0,
|
|
21907
|
+
0,
|
|
21908
|
+
0
|
|
21909
|
+
];
|
|
21910
|
+
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]);
|
|
21911
|
+
0 >= b && (e[0] = e[1] = e[2] = 0, e[ha(f)] = 1);
|
|
21912
|
+
}
|
|
21913
|
+
d = !0;
|
|
21914
|
+
}
|
|
21915
|
+
g = ha(e);
|
|
21916
|
+
a = this.b.c;
|
|
21917
|
+
b = (g + 1) % 3;
|
|
21918
|
+
c = (g + 2) % 3;
|
|
21919
|
+
g = 0 < e[g] ? 1 : -1;
|
|
21920
|
+
for(e = a.e; e !== a; e = e.e)e.b = e.g[b], e.a = g * e.g[c];
|
|
21921
|
+
if (d) {
|
|
21922
|
+
e = 0;
|
|
21923
|
+
d = this.b.a;
|
|
21924
|
+
for(a = d.b; a !== d; a = a.b)if (b = a.a, !(0 >= b.f)) {
|
|
21925
|
+
do e += (b.a.b - b.b.a.b) * (b.a.a + b.b.a.a), b = b.e;
|
|
21926
|
+
while (b !== a.a);
|
|
21927
|
+
}
|
|
21928
|
+
if (0 > e) for(e = this.b.c, d = e.e; d !== e; d = d.e)d.a = -d.a;
|
|
21929
|
+
}
|
|
21930
|
+
this.n = !1;
|
|
21931
|
+
e = this.b.b;
|
|
21932
|
+
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) {
|
|
21933
|
+
if (b !== a) {
|
|
21934
|
+
if (b === d || b === d.b) d = d.h;
|
|
21935
|
+
I(b);
|
|
21936
|
+
}
|
|
21937
|
+
if (a === d || a === d.b) d = d.h;
|
|
21938
|
+
I(a);
|
|
21939
|
+
}
|
|
21940
|
+
this.e = e = new Da;
|
|
21941
|
+
d = this.b.c;
|
|
21942
|
+
for(a = d.e; a !== d; a = a.e)a.h = xa(e, a);
|
|
21943
|
+
Ea(e);
|
|
21944
|
+
this.f = new Aa(this);
|
|
21945
|
+
za(this, -O);
|
|
21946
|
+
for(za(this, O); null !== (e = Fa(this.e));){
|
|
21947
|
+
for(;;){
|
|
21948
|
+
a: if (a = this.e, 0 === a.a) d = Ga(a.b);
|
|
21949
|
+
else if (d = a.c[a.d[a.a - 1]], 0 !== a.b.a && (a = Ga(a.b), u(a, d))) {
|
|
21950
|
+
d = a;
|
|
21951
|
+
break a;
|
|
21952
|
+
}
|
|
21953
|
+
if (null === d || !t(d, e)) break;
|
|
21954
|
+
d = Fa(this.e);
|
|
21955
|
+
ta(this, e.c, d.c);
|
|
21956
|
+
}
|
|
21957
|
+
ya(this, e);
|
|
21958
|
+
}
|
|
21959
|
+
this.a = this.f.a.a.b.a.a;
|
|
21960
|
+
for(e = 0; null !== (d = this.f.a.a.b);)d.h || ++e, Q(d);
|
|
21961
|
+
this.f = null;
|
|
21962
|
+
e = this.e;
|
|
21963
|
+
e.b = null;
|
|
21964
|
+
e.d = null;
|
|
21965
|
+
this.e = e.c = null;
|
|
21966
|
+
e = this.b;
|
|
21967
|
+
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));
|
|
21968
|
+
if (!this.n) {
|
|
21969
|
+
e = this.b;
|
|
21970
|
+
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);
|
|
21971
|
+
else for(a = e.a.b; a !== e.a; a = d)if (d = a.b, a.c) {
|
|
21972
|
+
for(a = a.a; u(a.b.a, a.a); a = a.c.b);
|
|
21973
|
+
for(; u(a.a, a.b.a); a = a.e);
|
|
21974
|
+
b = a.c.b;
|
|
21975
|
+
for(c = void 0; a.e !== b;)if (u(a.b.a, b.a)) {
|
|
21976
|
+
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;
|
|
21977
|
+
b = b.c.b;
|
|
21978
|
+
} else {
|
|
21979
|
+
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;
|
|
21980
|
+
a = a.e;
|
|
21981
|
+
}
|
|
21982
|
+
for(; b.e.e !== a;)c = L(b.e, b), b = c.b;
|
|
21983
|
+
}
|
|
21984
|
+
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){
|
|
21985
|
+
if (d.c) {
|
|
21986
|
+
this.h && this.h(2, this.c);
|
|
21987
|
+
a = d.a;
|
|
21988
|
+
do this.k && this.k(a.a.d, this.c), a = a.e;
|
|
21989
|
+
while (a !== d.a);
|
|
21990
|
+
this.i && this.i(this.c);
|
|
21991
|
+
}
|
|
21992
|
+
}
|
|
21993
|
+
else {
|
|
21994
|
+
e = this.b;
|
|
21995
|
+
d = !!this.l;
|
|
21996
|
+
a = !1;
|
|
21997
|
+
b = -1;
|
|
21998
|
+
for(c = e.a.d; c !== e.a; c = c.d)if (c.c) {
|
|
21999
|
+
a || (this.h && this.h(4, this.c), a = !0);
|
|
22000
|
+
g = c.a;
|
|
22001
|
+
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;
|
|
22002
|
+
while (g !== c.a);
|
|
22003
|
+
}
|
|
22004
|
+
a && this.i && this.i(this.c);
|
|
22005
|
+
}
|
|
22006
|
+
if (this.r) {
|
|
22007
|
+
e = this.b;
|
|
22008
|
+
for(a = e.a.b; a !== e.a; a = d)if (d = a.b, !a.c) {
|
|
22009
|
+
b = a.a;
|
|
22010
|
+
c = b.e;
|
|
22011
|
+
g = void 0;
|
|
22012
|
+
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));
|
|
22013
|
+
while (g !== b);
|
|
22014
|
+
b = a.d;
|
|
22015
|
+
a = a.b;
|
|
22016
|
+
a.d = b;
|
|
22017
|
+
b.b = a;
|
|
22018
|
+
}
|
|
22019
|
+
this.r(this.b);
|
|
22020
|
+
this.c = this.b = null;
|
|
22021
|
+
return;
|
|
22022
|
+
}
|
|
22023
|
+
}
|
|
22024
|
+
this.b = this.c = null;
|
|
22025
|
+
};
|
|
22026
|
+
function Z(a, b) {
|
|
22027
|
+
if (a.d !== b) for(; a.d !== b;)if (a.d < b) switch(a.d){
|
|
22028
|
+
case Y:
|
|
22029
|
+
V(a, 100151);
|
|
22030
|
+
a.u(null);
|
|
22031
|
+
break;
|
|
22032
|
+
case 1:
|
|
22033
|
+
V(a, 100152), a.t();
|
|
22034
|
+
}
|
|
22035
|
+
else switch(a.d){
|
|
22036
|
+
case 2:
|
|
22037
|
+
V(a, 100154);
|
|
22038
|
+
a.v();
|
|
22039
|
+
break;
|
|
22040
|
+
case 1:
|
|
22041
|
+
V(a, 100153), a.w();
|
|
22042
|
+
}
|
|
22043
|
+
}
|
|
22044
|
+
function V(a, b) {
|
|
22045
|
+
a.p && a.p(b, a.c);
|
|
22046
|
+
}
|
|
22047
|
+
function ga(a, b) {
|
|
22048
|
+
this.b = a || this;
|
|
22049
|
+
this.d = b || this;
|
|
22050
|
+
this.a = null;
|
|
22051
|
+
this.c = !1;
|
|
22052
|
+
}
|
|
22053
|
+
function M() {
|
|
22054
|
+
this.h = this;
|
|
22055
|
+
this.i = this.d = this.a = this.e = this.c = this.b = null;
|
|
22056
|
+
this.f = 0;
|
|
22057
|
+
}
|
|
22058
|
+
function J(a) {
|
|
22059
|
+
return a.b.e;
|
|
22060
|
+
}
|
|
22061
|
+
function Ca() {
|
|
22062
|
+
this.c = new N;
|
|
22063
|
+
this.a = new ga;
|
|
22064
|
+
this.b = new M;
|
|
22065
|
+
this.d = new M;
|
|
22066
|
+
this.b.b = this.d;
|
|
22067
|
+
this.d.b = this.b;
|
|
22068
|
+
}
|
|
22069
|
+
function N(a, b) {
|
|
22070
|
+
this.e = a || this;
|
|
22071
|
+
this.f = b || this;
|
|
22072
|
+
this.d = this.c = null;
|
|
22073
|
+
this.g = [
|
|
22074
|
+
0,
|
|
22075
|
+
0,
|
|
22076
|
+
0
|
|
22077
|
+
];
|
|
22078
|
+
this.h = this.a = this.b = 0;
|
|
22079
|
+
}
|
|
22080
|
+
function Da() {
|
|
22081
|
+
this.c = [];
|
|
22082
|
+
this.d = null;
|
|
22083
|
+
this.a = 0;
|
|
22084
|
+
this.e = !1;
|
|
22085
|
+
this.b = new Ha;
|
|
22086
|
+
}
|
|
22087
|
+
function Ea(a) {
|
|
22088
|
+
a.d = [];
|
|
22089
|
+
for(var b = 0; b < a.a; b++)a.d[b] = b;
|
|
22090
|
+
a.d.sort(function(a) {
|
|
22091
|
+
return function(b, e) {
|
|
22092
|
+
return u(a[b], a[e]) ? 1 : -1;
|
|
22093
|
+
};
|
|
22094
|
+
}(a.c));
|
|
22095
|
+
a.e = !0;
|
|
22096
|
+
Ia(a.b);
|
|
22097
|
+
}
|
|
22098
|
+
function xa(a, b) {
|
|
22099
|
+
if (a.e) {
|
|
22100
|
+
var c = a.b, d = ++c.a;
|
|
22101
|
+
2 * d > c.f && (c.f *= 2, c.c = Ja(c.c, c.f + 1));
|
|
22102
|
+
var e;
|
|
22103
|
+
0 === c.b ? e = d : (e = c.b, c.b = c.c[c.b]);
|
|
22104
|
+
c.e[e] = b;
|
|
22105
|
+
c.c[e] = d;
|
|
22106
|
+
c.d[d] = e;
|
|
22107
|
+
c.h && va(c, d);
|
|
22108
|
+
return e;
|
|
22109
|
+
}
|
|
22110
|
+
c = a.a++;
|
|
22111
|
+
a.c[c] = b;
|
|
22112
|
+
return -(c + 1);
|
|
22113
|
+
}
|
|
22114
|
+
function Fa(a) {
|
|
22115
|
+
if (0 === a.a) return Ka(a.b);
|
|
22116
|
+
var b = a.c[a.d[a.a - 1]];
|
|
22117
|
+
if (0 !== a.b.a && u(Ga(a.b), b)) return Ka(a.b);
|
|
22118
|
+
do --a.a;
|
|
22119
|
+
while (0 < a.a && null === a.c[a.d[a.a - 1]]);
|
|
22120
|
+
return b;
|
|
22121
|
+
}
|
|
22122
|
+
function Ha() {
|
|
22123
|
+
this.d = Ja([
|
|
22124
|
+
0
|
|
22125
|
+
], 33);
|
|
22126
|
+
this.e = [
|
|
22127
|
+
null,
|
|
22128
|
+
null
|
|
22129
|
+
];
|
|
22130
|
+
this.c = [
|
|
22131
|
+
0,
|
|
22132
|
+
0
|
|
22133
|
+
];
|
|
22134
|
+
this.a = 0;
|
|
22135
|
+
this.f = 32;
|
|
22136
|
+
this.b = 0;
|
|
22137
|
+
this.h = !1;
|
|
22138
|
+
this.d[1] = 1;
|
|
22139
|
+
}
|
|
22140
|
+
function Ja(a, b) {
|
|
22141
|
+
for(var c = Array(b), d = 0; d < a.length; d++)c[d] = a[d];
|
|
22142
|
+
for(; d < b; d++)c[d] = 0;
|
|
22143
|
+
return c;
|
|
22144
|
+
}
|
|
22145
|
+
function Ia(a) {
|
|
22146
|
+
for(var b = a.a; 1 <= b; --b)W(a, b);
|
|
22147
|
+
a.h = !0;
|
|
22148
|
+
}
|
|
22149
|
+
function Ga(a) {
|
|
22150
|
+
return a.e[a.d[1]];
|
|
22151
|
+
}
|
|
22152
|
+
function Ka(a) {
|
|
22153
|
+
var b = a.d, c = a.e, d = a.c, e = b[1], f = c[e];
|
|
22154
|
+
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));
|
|
22155
|
+
return f;
|
|
22156
|
+
}
|
|
22157
|
+
function W(a, b) {
|
|
22158
|
+
for(var c = a.d, d = a.e, e = a.c, f = b, g = c[f];;){
|
|
22159
|
+
var h = f << 1;
|
|
22160
|
+
h < a.a && u(d[c[h + 1]], d[c[h]]) && (h += 1);
|
|
22161
|
+
var k = c[h];
|
|
22162
|
+
if (h > a.a || u(d[g], d[k])) {
|
|
22163
|
+
c[f] = g;
|
|
22164
|
+
e[g] = f;
|
|
22165
|
+
break;
|
|
22166
|
+
}
|
|
22167
|
+
c[f] = k;
|
|
22168
|
+
e[k] = f;
|
|
22169
|
+
f = h;
|
|
22170
|
+
}
|
|
22171
|
+
}
|
|
22172
|
+
function va(a, b) {
|
|
22173
|
+
for(var c = a.d, d = a.e, e = a.c, f = b, g = c[f];;){
|
|
22174
|
+
var h = f >> 1, k = c[h];
|
|
22175
|
+
if (0 === h || u(d[k], d[g])) {
|
|
22176
|
+
c[f] = g;
|
|
22177
|
+
e[g] = f;
|
|
22178
|
+
break;
|
|
22179
|
+
}
|
|
22180
|
+
c[f] = k;
|
|
22181
|
+
e[k] = f;
|
|
22182
|
+
f = h;
|
|
22183
|
+
}
|
|
22184
|
+
}
|
|
22185
|
+
function ma() {
|
|
22186
|
+
this.e = this.a = null;
|
|
22187
|
+
this.f = 0;
|
|
22188
|
+
this.c = this.b = this.h = this.d = !1;
|
|
22189
|
+
}
|
|
22190
|
+
function S(a) {
|
|
22191
|
+
return a.e.c.b;
|
|
22192
|
+
}
|
|
22193
|
+
function R(a) {
|
|
22194
|
+
return a.e.a.b;
|
|
22195
|
+
}
|
|
22196
|
+
commonjsGlobal.libtess = {
|
|
22197
|
+
GluTesselator: X,
|
|
22198
|
+
windingRule: {
|
|
22199
|
+
GLU_TESS_WINDING_ODD: 100130,
|
|
22200
|
+
GLU_TESS_WINDING_NONZERO: 100131,
|
|
22201
|
+
GLU_TESS_WINDING_POSITIVE: 100132,
|
|
22202
|
+
GLU_TESS_WINDING_NEGATIVE: 100133,
|
|
22203
|
+
GLU_TESS_WINDING_ABS_GEQ_TWO: 100134
|
|
22204
|
+
},
|
|
22205
|
+
primitiveType: {
|
|
22206
|
+
GL_LINE_LOOP: 2,
|
|
22207
|
+
GL_TRIANGLES: 4,
|
|
22208
|
+
GL_TRIANGLE_STRIP: 5,
|
|
22209
|
+
GL_TRIANGLE_FAN: 6
|
|
22210
|
+
},
|
|
22211
|
+
errorType: {
|
|
22212
|
+
GLU_TESS_MISSING_BEGIN_POLYGON: 100151,
|
|
22213
|
+
GLU_TESS_MISSING_END_POLYGON: 100153,
|
|
22214
|
+
GLU_TESS_MISSING_BEGIN_CONTOUR: 100152,
|
|
22215
|
+
GLU_TESS_MISSING_END_CONTOUR: 100154,
|
|
22216
|
+
GLU_TESS_COORD_TOO_LARGE: 100155,
|
|
22217
|
+
GLU_TESS_NEED_COMBINE_CALLBACK: 100156
|
|
22218
|
+
},
|
|
22219
|
+
gluEnum: {
|
|
22220
|
+
GLU_TESS_MESH: 100112,
|
|
22221
|
+
GLU_TESS_TOLERANCE: 100142,
|
|
22222
|
+
GLU_TESS_WINDING_RULE: 100140,
|
|
22223
|
+
GLU_TESS_BOUNDARY_ONLY: 100141,
|
|
22224
|
+
GLU_INVALID_ENUM: 100900,
|
|
22225
|
+
GLU_INVALID_VALUE: 100901,
|
|
22226
|
+
GLU_TESS_BEGIN: 100100,
|
|
22227
|
+
GLU_TESS_VERTEX: 100101,
|
|
22228
|
+
GLU_TESS_END: 100102,
|
|
22229
|
+
GLU_TESS_ERROR: 100103,
|
|
22230
|
+
GLU_TESS_EDGE_FLAG: 100104,
|
|
22231
|
+
GLU_TESS_COMBINE: 100105,
|
|
22232
|
+
GLU_TESS_BEGIN_DATA: 100106,
|
|
22233
|
+
GLU_TESS_VERTEX_DATA: 100107,
|
|
22234
|
+
GLU_TESS_END_DATA: 100108,
|
|
22235
|
+
GLU_TESS_ERROR_DATA: 100109,
|
|
22236
|
+
GLU_TESS_EDGE_FLAG_DATA: 100110,
|
|
22237
|
+
GLU_TESS_COMBINE_DATA: 100111
|
|
22238
|
+
}
|
|
22239
|
+
};
|
|
22240
|
+
X.prototype.gluDeleteTess = X.prototype.x;
|
|
22241
|
+
X.prototype.gluTessProperty = X.prototype.B;
|
|
22242
|
+
X.prototype.gluGetTessProperty = X.prototype.y;
|
|
22243
|
+
X.prototype.gluTessNormal = X.prototype.A;
|
|
22244
|
+
X.prototype.gluTessCallback = X.prototype.z;
|
|
22245
|
+
X.prototype.gluTessVertex = X.prototype.C;
|
|
22246
|
+
X.prototype.gluTessBeginPolygon = X.prototype.u;
|
|
22247
|
+
X.prototype.gluTessBeginContour = X.prototype.t;
|
|
22248
|
+
X.prototype.gluTessEndContour = X.prototype.v;
|
|
22249
|
+
X.prototype.gluTessEndPolygon = X.prototype.w;
|
|
22250
|
+
{
|
|
22251
|
+
module.exports = commonjsGlobal.libtess;
|
|
22252
|
+
}
|
|
22253
|
+
}(libtess_min));
|
|
22254
|
+
|
|
22255
|
+
var tessy = function initTesselator() {
|
|
22256
|
+
// function called for each vertex of tesselator output
|
|
22257
|
+
function vertexCallback(data, polyVertArray) {
|
|
22258
|
+
polyVertArray[polyVertArray.length] = data[0];
|
|
22259
|
+
polyVertArray[polyVertArray.length] = data[1];
|
|
22260
|
+
}
|
|
22261
|
+
function begincallback(type) {
|
|
22262
|
+
if (type !== libtess_min.exports.primitiveType.GL_TRIANGLES) {
|
|
22263
|
+
console.info("expected TRIANGLES but got type: " + type);
|
|
22264
|
+
}
|
|
22265
|
+
}
|
|
22266
|
+
function errorcallback(errno) {
|
|
22267
|
+
console.error("error callback, error number: " + errno);
|
|
22268
|
+
}
|
|
22269
|
+
// callback for when segments intersect and must be split
|
|
22270
|
+
function combinecallback(coords, data, weight) {
|
|
22271
|
+
// console.log('combine callback');
|
|
22272
|
+
return [
|
|
22273
|
+
coords[0],
|
|
22274
|
+
coords[1],
|
|
22275
|
+
coords[2]
|
|
22276
|
+
];
|
|
22277
|
+
}
|
|
22278
|
+
function edgeCallback(flag) {
|
|
22279
|
+
// don't really care about the flag, but need no-strip/no-fan behavior
|
|
22280
|
+
// console.log('edge flag: ' + flag);
|
|
22281
|
+
}
|
|
22282
|
+
var tessy = new libtess_min.exports.GluTesselator();
|
|
22283
|
+
// tessy.gluTessProperty(libtess.gluEnum.GLU_TESS_WINDING_RULE, libtess.windingRule.GLU_TESS_WINDING_POSITIVE);
|
|
22284
|
+
tessy.gluTessCallback(libtess_min.exports.gluEnum.GLU_TESS_VERTEX_DATA, vertexCallback);
|
|
22285
|
+
tessy.gluTessCallback(libtess_min.exports.gluEnum.GLU_TESS_BEGIN, begincallback);
|
|
22286
|
+
tessy.gluTessCallback(libtess_min.exports.gluEnum.GLU_TESS_ERROR, errorcallback);
|
|
22287
|
+
tessy.gluTessCallback(libtess_min.exports.gluEnum.GLU_TESS_COMBINE, combinecallback);
|
|
22288
|
+
tessy.gluTessCallback(libtess_min.exports.gluEnum.GLU_TESS_EDGE_FLAG, edgeCallback);
|
|
22289
|
+
return tessy;
|
|
22290
|
+
}();
|
|
22291
|
+
function triangulate(contours) {
|
|
22292
|
+
// libtess will take 3d verts and flatten to a plane for tesselation
|
|
22293
|
+
// since only doing 2d tesselation here, provide z=1 normal to skip
|
|
22294
|
+
// iterating over verts only to get the same answer.
|
|
22295
|
+
// comment out to test normal-generation code
|
|
22296
|
+
tessy.gluTessNormal(0, 0, 1);
|
|
22297
|
+
var triangleVerts = [];
|
|
22298
|
+
tessy.gluTessBeginPolygon(triangleVerts);
|
|
22299
|
+
for(var i = 0; i < contours.length; i++){
|
|
22300
|
+
tessy.gluTessBeginContour();
|
|
22301
|
+
var contour = contours[i];
|
|
22302
|
+
for(var j = 0; j < contour.length; j += 2){
|
|
22303
|
+
var coords = [
|
|
22304
|
+
contour[j],
|
|
22305
|
+
contour[j + 1],
|
|
22306
|
+
0
|
|
22307
|
+
];
|
|
22308
|
+
tessy.gluTessVertex(coords, coords);
|
|
22309
|
+
}
|
|
22310
|
+
tessy.gluTessEndContour();
|
|
22311
|
+
}
|
|
22312
|
+
// finish polygon
|
|
22313
|
+
tessy.gluTessEndPolygon();
|
|
22314
|
+
return triangleVerts;
|
|
22315
|
+
}
|
|
22316
|
+
|
|
22317
|
+
exports.ShapeComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
22318
|
+
_inherits(ShapeComponent, RendererComponent);
|
|
22319
|
+
function ShapeComponent(engine) {
|
|
22320
|
+
var _this;
|
|
22321
|
+
_this = RendererComponent.call(this, engine) || this;
|
|
22322
|
+
_this.path = new GraphicsPath();
|
|
22323
|
+
_this.curveValues = [];
|
|
22324
|
+
_this.dirty = false;
|
|
22325
|
+
_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";
|
|
22326
|
+
_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";
|
|
22327
|
+
if (!_this.geometry) {
|
|
22328
|
+
_this.geometry = Geometry.create(engine, {
|
|
22329
|
+
attributes: {
|
|
22330
|
+
aPos: {
|
|
22331
|
+
type: glContext.FLOAT,
|
|
22332
|
+
size: 3,
|
|
22333
|
+
data: new Float32Array([
|
|
22334
|
+
-0.5,
|
|
22335
|
+
0.5,
|
|
22336
|
+
0,
|
|
22337
|
+
-0.5,
|
|
22338
|
+
-0.5,
|
|
22339
|
+
0,
|
|
22340
|
+
0.5,
|
|
22341
|
+
0.5,
|
|
22342
|
+
0,
|
|
22343
|
+
0.5,
|
|
22344
|
+
-0.5,
|
|
22345
|
+
0
|
|
22346
|
+
])
|
|
22347
|
+
},
|
|
22348
|
+
aUV: {
|
|
22349
|
+
type: glContext.FLOAT,
|
|
22350
|
+
size: 2,
|
|
22351
|
+
data: new Float32Array()
|
|
22352
|
+
}
|
|
22353
|
+
},
|
|
22354
|
+
mode: glContext.TRIANGLES,
|
|
22355
|
+
drawCount: 4
|
|
22356
|
+
});
|
|
22357
|
+
}
|
|
22358
|
+
if (!_this.material) {
|
|
22359
|
+
var materialProps = {
|
|
22360
|
+
shader: {
|
|
22361
|
+
vertex: _this.vert,
|
|
22362
|
+
fragment: _this.frag,
|
|
22363
|
+
glslVersion: exports.GLSLVersion.GLSL1
|
|
22364
|
+
}
|
|
22365
|
+
};
|
|
22366
|
+
_this.material = Material.create(engine, materialProps);
|
|
22367
|
+
_this.material.setColor("_Color", new Color(1, 1, 1, 1));
|
|
22368
|
+
_this.material.depthMask = true;
|
|
22369
|
+
_this.material.depthTest = true;
|
|
22370
|
+
_this.material.blending = true;
|
|
22371
|
+
}
|
|
22372
|
+
return _this;
|
|
22373
|
+
}
|
|
22374
|
+
var _proto = ShapeComponent.prototype;
|
|
22375
|
+
_proto.onUpdate = function onUpdate(dt) {
|
|
22376
|
+
if (this.dirty) {
|
|
22377
|
+
this.path.clear();
|
|
22378
|
+
this.path.moveTo(this.curveValues[this.curveValues.length - 1].point.x, this.curveValues[this.curveValues.length - 1].point.y);
|
|
22379
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(this.curveValues), _step; !(_step = _iterator()).done;){
|
|
22380
|
+
var curveValue = _step.value;
|
|
22381
|
+
var point = curveValue.point;
|
|
22382
|
+
var control1 = curveValue.controlPoint1;
|
|
22383
|
+
var control2 = curveValue.controlPoint2;
|
|
22384
|
+
this.path.bezierCurveTo(control1.x, control1.y, control2.x, control2.y, point.x, point.y, 1);
|
|
22385
|
+
}
|
|
22386
|
+
this.buildGeometryFromPath(this.path.shapePath);
|
|
22387
|
+
this.dirty = false;
|
|
22388
|
+
}
|
|
22389
|
+
};
|
|
22390
|
+
_proto.render = function render(renderer) {
|
|
22391
|
+
if (renderer.renderingData.currentFrame.globalUniforms) {
|
|
22392
|
+
renderer.setGlobalMatrix("effects_ObjectToWorld", this.transform.getWorldMatrix());
|
|
22393
|
+
}
|
|
22394
|
+
renderer.drawGeometry(this.geometry, this.material);
|
|
22395
|
+
};
|
|
22396
|
+
_proto.buildGeometryFromPath = function buildGeometryFromPath(shapePath) {
|
|
22397
|
+
var shapePrimitives = shapePath.shapePrimitives;
|
|
22398
|
+
var vertices = [];
|
|
22399
|
+
// triangulate shapePrimitive
|
|
22400
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(shapePrimitives), _step; !(_step = _iterator()).done;){
|
|
22401
|
+
var shapePrimitive = _step.value;
|
|
22402
|
+
var _vertices;
|
|
22403
|
+
var shape = shapePrimitive.shape;
|
|
22404
|
+
(_vertices = vertices).push.apply(_vertices, [].concat(triangulate([
|
|
22405
|
+
shape.points
|
|
22406
|
+
])));
|
|
22407
|
+
}
|
|
22408
|
+
// build vertices and uvs
|
|
22409
|
+
var vertexCount = vertices.length / 2;
|
|
22410
|
+
var positionArray = this.geometry.getAttributeData("aPos");
|
|
22411
|
+
var uvArray = this.geometry.getAttributeData("aUV");
|
|
22412
|
+
if (!positionArray || positionArray.length < vertexCount * 3) {
|
|
22413
|
+
positionArray = new Float32Array(vertexCount * 3);
|
|
22414
|
+
}
|
|
22415
|
+
if (!uvArray || uvArray.length < vertexCount * 2) {
|
|
22416
|
+
uvArray = new Float32Array(vertexCount * 2);
|
|
22417
|
+
}
|
|
22418
|
+
for(var i = 0; i < vertexCount; i++){
|
|
22419
|
+
var pointsOffset = i * 3;
|
|
22420
|
+
var positionArrayOffset = i * 2;
|
|
22421
|
+
var uvOffset = i * 2;
|
|
22422
|
+
positionArray[pointsOffset] = vertices[positionArrayOffset];
|
|
22423
|
+
positionArray[pointsOffset + 1] = vertices[positionArrayOffset + 1];
|
|
22424
|
+
positionArray[pointsOffset + 2] = 0;
|
|
22425
|
+
uvArray[uvOffset] = positionArray[pointsOffset];
|
|
22426
|
+
uvArray[uvOffset + 1] = positionArray[pointsOffset + 1];
|
|
22427
|
+
}
|
|
22428
|
+
this.geometry.setAttributeData("aPos", positionArray);
|
|
22429
|
+
this.geometry.setAttributeData("aUV", uvArray);
|
|
22430
|
+
this.geometry.setDrawCount(vertexCount);
|
|
22431
|
+
};
|
|
22432
|
+
_proto.fromData = function fromData(data) {
|
|
22433
|
+
RendererComponent.prototype.fromData.call(this, data);
|
|
22434
|
+
var points = data.param.points;
|
|
22435
|
+
var easingIns = data.param.easingIn;
|
|
22436
|
+
var easingOuts = data.param.easingOut;
|
|
22437
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(data.param.shapes), _step; !(_step = _iterator()).done;){
|
|
22438
|
+
var shape = _step.value;
|
|
22439
|
+
var indices = shape.indexes;
|
|
22440
|
+
for(var i = 1; i < indices.length; i++){
|
|
22441
|
+
var pointIndex = indices[i];
|
|
22442
|
+
var lastPointIndex = indices[i - 1];
|
|
22443
|
+
this.curveValues.push({
|
|
22444
|
+
point: points[pointIndex.point],
|
|
22445
|
+
controlPoint1: easingOuts[lastPointIndex.easingOut],
|
|
22446
|
+
controlPoint2: easingIns[pointIndex.easingIn]
|
|
22447
|
+
});
|
|
22448
|
+
}
|
|
22449
|
+
// Push the last curve
|
|
22450
|
+
this.curveValues.push({
|
|
22451
|
+
point: points[indices[0].point],
|
|
22452
|
+
controlPoint1: easingOuts[indices[indices.length - 1].easingOut],
|
|
22453
|
+
controlPoint2: easingIns[indices[0].easingIn]
|
|
22454
|
+
});
|
|
22455
|
+
}
|
|
22456
|
+
this.dirty = true;
|
|
22457
|
+
};
|
|
22458
|
+
return ShapeComponent;
|
|
22459
|
+
}(RendererComponent);
|
|
22460
|
+
exports.ShapeComponent = __decorate([
|
|
22461
|
+
effectsClass("ShapeComponent")
|
|
22462
|
+
], exports.ShapeComponent);
|
|
22463
|
+
exports.ComponentShapeType = void 0;
|
|
22464
|
+
(function(ComponentShapeType) {
|
|
22465
|
+
/**
|
|
22466
|
+
* 自定义图形
|
|
22467
|
+
*/ ComponentShapeType[ComponentShapeType["CUSTOM"] = 0] = "CUSTOM";
|
|
22468
|
+
/**
|
|
22469
|
+
* 矩形
|
|
22470
|
+
*/ ComponentShapeType[ComponentShapeType["RECTANGLE"] = 1] = "RECTANGLE";
|
|
22471
|
+
/**
|
|
22472
|
+
* 椭圆
|
|
22473
|
+
*/ ComponentShapeType[ComponentShapeType["ELLIPSE"] = 2] = "ELLIPSE";
|
|
22474
|
+
/**
|
|
22475
|
+
* 多边形
|
|
22476
|
+
*/ ComponentShapeType[ComponentShapeType["POLYGON"] = 3] = "POLYGON";
|
|
22477
|
+
/**
|
|
22478
|
+
* 星形
|
|
22479
|
+
*/ ComponentShapeType[ComponentShapeType["STAR"] = 4] = "STAR";
|
|
22480
|
+
})(exports.ComponentShapeType || (exports.ComponentShapeType = {}));
|
|
22481
|
+
exports.ShapeConnectType = void 0;
|
|
22482
|
+
(function(ShapeConnectType) {})(exports.ShapeConnectType || (exports.ShapeConnectType = {}));
|
|
22483
|
+
exports.ShapePointType = void 0;
|
|
22484
|
+
(function(ShapePointType) {})(exports.ShapePointType || (exports.ShapePointType = {}));
|
|
22485
|
+
|
|
20820
22486
|
var EventEmitter = function EventEmitter() {
|
|
20821
22487
|
var _this = this;
|
|
20822
22488
|
var _this1 = this;
|
|
@@ -21186,21 +22852,21 @@ exports.VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
21186
22852
|
return now - this.duration > 0.001;
|
|
21187
22853
|
};
|
|
21188
22854
|
_proto.find = function find(name) {
|
|
22855
|
+
var _queue;
|
|
21189
22856
|
if (this.name === name) {
|
|
21190
22857
|
return this;
|
|
21191
22858
|
}
|
|
21192
|
-
|
|
21193
|
-
|
|
21194
|
-
|
|
21195
|
-
|
|
21196
|
-
|
|
21197
|
-
|
|
21198
|
-
|
|
21199
|
-
|
|
21200
|
-
|
|
21201
|
-
if (res) {
|
|
21202
|
-
return res;
|
|
22859
|
+
var queue = [];
|
|
22860
|
+
(_queue = queue).push.apply(_queue, [].concat(this.children));
|
|
22861
|
+
var index = 0;
|
|
22862
|
+
while(index < queue.length){
|
|
22863
|
+
var _queue1;
|
|
22864
|
+
var item = queue[index];
|
|
22865
|
+
index++;
|
|
22866
|
+
if (item.name === name) {
|
|
22867
|
+
return item;
|
|
21203
22868
|
}
|
|
22869
|
+
(_queue1 = queue).push.apply(_queue1, [].concat(item.children));
|
|
21204
22870
|
}
|
|
21205
22871
|
return undefined;
|
|
21206
22872
|
};
|
|
@@ -23944,15 +25610,22 @@ function passRenderLevel(l, renderLevel) {
|
|
|
23944
25610
|
return false;
|
|
23945
25611
|
}
|
|
23946
25612
|
|
|
23947
|
-
|
|
23948
|
-
|
|
23949
|
-
|
|
23950
|
-
|
|
23951
|
-
|
|
23952
|
-
|
|
23953
|
-
|
|
23954
|
-
|
|
23955
|
-
|
|
25613
|
+
exports.Scene = void 0;
|
|
25614
|
+
(function(Scene) {
|
|
25615
|
+
function isJSONObject(scene) {
|
|
25616
|
+
return isObject(scene) && "jsonScene" in scene;
|
|
25617
|
+
}
|
|
25618
|
+
// JSON 对象
|
|
25619
|
+
Scene.isJSONObject = isJSONObject;
|
|
25620
|
+
function isURL(scene) {
|
|
25621
|
+
return isObject(scene) && "url" in scene;
|
|
25622
|
+
}
|
|
25623
|
+
Scene.isURL = isURL;
|
|
25624
|
+
function isWithOptions(scene) {
|
|
25625
|
+
return isObject(scene) && "options" in scene;
|
|
25626
|
+
}
|
|
25627
|
+
Scene.isWithOptions = isWithOptions;
|
|
25628
|
+
})(exports.Scene || (exports.Scene = {}));
|
|
23956
25629
|
|
|
23957
25630
|
function getBackgroundImage(template, variables) {
|
|
23958
25631
|
var templateBackground;
|
|
@@ -24077,13 +25750,12 @@ var seed$1 = 1;
|
|
|
24077
25750
|
*/ _proto.loadScene = function loadScene(url, renderer, options) {
|
|
24078
25751
|
var _this = this;
|
|
24079
25752
|
return _async_to_generator(function() {
|
|
24080
|
-
var
|
|
25753
|
+
var rawJSON, assetUrl, startTime, timeInfoMessages, gpuInstance, _gpuInstance_detail_compressedTexture, compressedTexture, timeInfos, loadTimer, cancelLoading, waitPromise, hookTimeInfo, loadResourcePromise;
|
|
24081
25754
|
return __generator(this, function(_state) {
|
|
24082
25755
|
assetUrl = isString(url) ? url : _this.id;
|
|
24083
25756
|
startTime = performance.now();
|
|
24084
25757
|
timeInfoMessages = [];
|
|
24085
25758
|
gpuInstance = renderer == null ? void 0 : renderer.engine.gpuCapability;
|
|
24086
|
-
asyncShaderCompile = (_gpuInstance_detail_asyncShaderCompile = gpuInstance == null ? void 0 : (_gpuInstance_detail = gpuInstance.detail) == null ? void 0 : _gpuInstance_detail.asyncShaderCompile) != null ? _gpuInstance_detail_asyncShaderCompile : false;
|
|
24087
25759
|
compressedTexture = (_gpuInstance_detail_compressedTexture = gpuInstance == null ? void 0 : gpuInstance.detail.compressedTexture) != null ? _gpuInstance_detail_compressedTexture : exports.COMPRESSED_TEXTURE.NONE;
|
|
24088
25760
|
timeInfos = {};
|
|
24089
25761
|
cancelLoading = false;
|
|
@@ -24136,81 +25808,55 @@ var seed$1 = 1;
|
|
|
24136
25808
|
});
|
|
24137
25809
|
});
|
|
24138
25810
|
loadResourcePromise = /*#__PURE__*/ _async_to_generator(function() {
|
|
24139
|
-
var scene,
|
|
25811
|
+
var scene, link, _ref, jsonScene, pluginSystem, _jsonScene_bins, bins, images, compositions, fonts, _ref1, loadedBins, loadedImages, i, i1, imageAsset, loadedTextures, totalTime;
|
|
24140
25812
|
return __generator(this, function(_state) {
|
|
24141
25813
|
switch(_state.label){
|
|
24142
25814
|
case 0:
|
|
24143
|
-
if (!
|
|
24144
|
-
3,
|
|
24145
|
-
1
|
|
24146
|
-
];
|
|
24147
|
-
// TODO: 原 JSONLoader contructor 判断是否兼容
|
|
24148
|
-
rawJSON = url;
|
|
24149
|
-
_this.baseUrl = location.href;
|
|
24150
|
-
return [
|
|
25815
|
+
if (!isString(url)) return [
|
|
24151
25816
|
3,
|
|
24152
|
-
|
|
25817
|
+
2
|
|
24153
25818
|
];
|
|
24154
|
-
case 1:
|
|
24155
25819
|
// 兼容相对路径
|
|
24156
|
-
|
|
24157
|
-
_this.baseUrl =
|
|
25820
|
+
link = new URL(url, location.href).href;
|
|
25821
|
+
_this.baseUrl = link;
|
|
24158
25822
|
return [
|
|
24159
25823
|
4,
|
|
24160
25824
|
hookTimeInfo("loadJSON", function() {
|
|
24161
|
-
return _this.loadJSON(
|
|
25825
|
+
return _this.loadJSON(link);
|
|
24162
25826
|
})
|
|
24163
25827
|
];
|
|
24164
|
-
case
|
|
25828
|
+
case 1:
|
|
24165
25829
|
rawJSON = _state.sent();
|
|
25830
|
+
return [
|
|
25831
|
+
3,
|
|
25832
|
+
3
|
|
25833
|
+
];
|
|
25834
|
+
case 2:
|
|
25835
|
+
// url 为 spec.JSONScene 或 Scene 对象
|
|
25836
|
+
rawJSON = url;
|
|
25837
|
+
_this.baseUrl = location.href;
|
|
24166
25838
|
_state.label = 3;
|
|
24167
25839
|
case 3:
|
|
24168
|
-
if (!
|
|
25840
|
+
if (!exports.Scene.isJSONObject(rawJSON)) return [
|
|
24169
25841
|
3,
|
|
24170
|
-
|
|
25842
|
+
4
|
|
24171
25843
|
];
|
|
24172
25844
|
// 已经加载过的 可能需要更新数据模板
|
|
24173
25845
|
scene = _extends({}, rawJSON);
|
|
24174
|
-
if (!(_this.options && _this.options.variables && Object.keys(_this.options.variables).length !== 0)) return [
|
|
24175
|
-
3,
|
|
24176
|
-
5
|
|
24177
|
-
];
|
|
24178
|
-
_rawJSON_jsonScene = rawJSON.jsonScene, rawImages = _rawJSON_jsonScene.images;
|
|
24179
|
-
images = scene.images;
|
|
24180
|
-
for(i = 0; i < rawImages.length; i++){
|
|
24181
|
-
// 仅重新加载数据模板对应的图片
|
|
24182
|
-
if (_instanceof1(images[i], HTMLCanvasElement)) {
|
|
24183
|
-
images[i] = rawImages[i];
|
|
24184
|
-
}
|
|
24185
|
-
}
|
|
24186
|
-
return [
|
|
24187
|
-
4,
|
|
24188
|
-
hookTimeInfo("processImages", function() {
|
|
24189
|
-
return _this.processImages(images, compressedTexture);
|
|
24190
|
-
})
|
|
24191
|
-
];
|
|
24192
|
-
case 4:
|
|
24193
|
-
scene.images = _state.sent();
|
|
24194
|
-
// 更新 TextureOptions 中的 image 指向
|
|
24195
|
-
for(i1 = 0; i1 < scene.images.length; i1++){
|
|
24196
|
-
scene.textureOptions[i1].image = scene.images[i1];
|
|
24197
|
-
}
|
|
24198
|
-
_state.label = 5;
|
|
24199
|
-
case 5:
|
|
24200
25846
|
return [
|
|
24201
25847
|
3,
|
|
24202
|
-
|
|
25848
|
+
9
|
|
24203
25849
|
];
|
|
24204
|
-
case
|
|
25850
|
+
case 4:
|
|
24205
25851
|
return [
|
|
24206
25852
|
4,
|
|
24207
25853
|
hookTimeInfo("processJSON", function() {
|
|
24208
25854
|
return _this.processJSON(rawJSON);
|
|
24209
25855
|
})
|
|
24210
25856
|
];
|
|
24211
|
-
case
|
|
24212
|
-
_ref = _state.sent(),
|
|
24213
|
-
_jsonScene_bins = jsonScene.bins, bins = _jsonScene_bins === void 0 ? [] : _jsonScene_bins,
|
|
25857
|
+
case 5:
|
|
25858
|
+
_ref = _state.sent(), jsonScene = _ref.jsonScene, pluginSystem = _ref.pluginSystem;
|
|
25859
|
+
_jsonScene_bins = jsonScene.bins, bins = _jsonScene_bins === void 0 ? [] : _jsonScene_bins, images = jsonScene.images, compositions = jsonScene.compositions, fonts = jsonScene.fonts;
|
|
24214
25860
|
return [
|
|
24215
25861
|
4,
|
|
24216
25862
|
Promise.all([
|
|
@@ -24218,38 +25864,36 @@ var seed$1 = 1;
|
|
|
24218
25864
|
return _this.processBins(bins);
|
|
24219
25865
|
}),
|
|
24220
25866
|
hookTimeInfo("processImages", function() {
|
|
24221
|
-
return _this.processImages(
|
|
25867
|
+
return _this.processImages(images, compressedTexture);
|
|
24222
25868
|
}),
|
|
24223
|
-
hookTimeInfo(""
|
|
25869
|
+
hookTimeInfo("precompile", function() {
|
|
24224
25870
|
return _this.precompile(compositions, pluginSystem, renderer, options);
|
|
25871
|
+
}),
|
|
25872
|
+
hookTimeInfo("processFontURL", function() {
|
|
25873
|
+
return _this.processFontURL(fonts);
|
|
24225
25874
|
})
|
|
24226
25875
|
])
|
|
24227
25876
|
];
|
|
24228
|
-
case
|
|
25877
|
+
case 6:
|
|
24229
25878
|
_ref1 = _state.sent(), loadedBins = _ref1[0], loadedImages = _ref1[1];
|
|
25879
|
+
for(i = 0; i < images.length; i++){
|
|
25880
|
+
_this.assets[images[i].id] = loadedImages[i];
|
|
25881
|
+
}
|
|
24230
25882
|
if (renderer) {
|
|
24231
|
-
for(
|
|
25883
|
+
for(i1 = 0; i1 < images.length; i1++){
|
|
24232
25884
|
imageAsset = new ImageAsset(renderer.engine);
|
|
24233
|
-
imageAsset.data = loadedImages[
|
|
24234
|
-
imageAsset.setInstanceId(
|
|
25885
|
+
imageAsset.data = loadedImages[i1];
|
|
25886
|
+
imageAsset.setInstanceId(images[i1].id);
|
|
24235
25887
|
renderer.engine.addInstance(imageAsset);
|
|
24236
25888
|
}
|
|
24237
25889
|
}
|
|
24238
|
-
return [
|
|
24239
|
-
4,
|
|
24240
|
-
hookTimeInfo("processFontURL", function() {
|
|
24241
|
-
return _this.processFontURL(fonts);
|
|
24242
|
-
})
|
|
24243
|
-
];
|
|
24244
|
-
case 9:
|
|
24245
|
-
_state.sent();
|
|
24246
25890
|
return [
|
|
24247
25891
|
4,
|
|
24248
25892
|
hookTimeInfo("processTextures", function() {
|
|
24249
|
-
return _this.processTextures(loadedImages, loadedBins, jsonScene
|
|
25893
|
+
return _this.processTextures(loadedImages, loadedBins, jsonScene);
|
|
24250
25894
|
})
|
|
24251
25895
|
];
|
|
24252
|
-
case
|
|
25896
|
+
case 7:
|
|
24253
25897
|
loadedTextures = _state.sent();
|
|
24254
25898
|
scene = {
|
|
24255
25899
|
timeInfos: timeInfos,
|
|
@@ -24258,7 +25902,6 @@ var seed$1 = 1;
|
|
|
24258
25902
|
storage: {},
|
|
24259
25903
|
pluginSystem: pluginSystem,
|
|
24260
25904
|
jsonScene: jsonScene,
|
|
24261
|
-
usedImages: usedImages,
|
|
24262
25905
|
images: loadedImages,
|
|
24263
25906
|
textureOptions: loadedTextures,
|
|
24264
25907
|
bins: loadedBins
|
|
@@ -24270,10 +25913,10 @@ var seed$1 = 1;
|
|
|
24270
25913
|
return pluginSystem.loadResources(scene, _this.options);
|
|
24271
25914
|
})
|
|
24272
25915
|
];
|
|
24273
|
-
case
|
|
25916
|
+
case 8:
|
|
24274
25917
|
_state.sent();
|
|
24275
|
-
_state.label =
|
|
24276
|
-
case
|
|
25918
|
+
_state.label = 9;
|
|
25919
|
+
case 9:
|
|
24277
25920
|
totalTime = performance.now() - startTime;
|
|
24278
25921
|
logger.info("Load asset: totalTime: " + totalTime.toFixed(4) + "ms " + timeInfoMessages.join(" ") + ", url: " + assetUrl + ".");
|
|
24279
25922
|
window.clearTimeout(loadTimer);
|
|
@@ -24301,7 +25944,6 @@ var seed$1 = 1;
|
|
|
24301
25944
|
};
|
|
24302
25945
|
_proto.precompile = function precompile(compositions, pluginSystem, renderer, options) {
|
|
24303
25946
|
return _async_to_generator(function() {
|
|
24304
|
-
var shaderLibrary;
|
|
24305
25947
|
return __generator(this, function(_state) {
|
|
24306
25948
|
switch(_state.label){
|
|
24307
25949
|
case 0:
|
|
@@ -24310,22 +25952,11 @@ var seed$1 = 1;
|
|
|
24310
25952
|
2
|
|
24311
25953
|
];
|
|
24312
25954
|
}
|
|
24313
|
-
shaderLibrary = renderer == null ? void 0 : renderer.getShaderLibrary();
|
|
24314
25955
|
return [
|
|
24315
25956
|
4,
|
|
24316
25957
|
pluginSystem == null ? void 0 : pluginSystem.precompile(compositions, renderer, options)
|
|
24317
25958
|
];
|
|
24318
25959
|
case 1:
|
|
24319
|
-
_state.sent();
|
|
24320
|
-
return [
|
|
24321
|
-
4,
|
|
24322
|
-
new Promise(function(resolve) {
|
|
24323
|
-
shaderLibrary == null ? void 0 : shaderLibrary.compileAllShaders(function() {
|
|
24324
|
-
resolve(null);
|
|
24325
|
-
});
|
|
24326
|
-
})
|
|
24327
|
-
];
|
|
24328
|
-
case 2:
|
|
24329
25960
|
_state.sent();
|
|
24330
25961
|
return [
|
|
24331
25962
|
2
|
|
@@ -24337,12 +25968,12 @@ var seed$1 = 1;
|
|
|
24337
25968
|
_proto.processJSON = function processJSON(json) {
|
|
24338
25969
|
var _this = this;
|
|
24339
25970
|
return _async_to_generator(function() {
|
|
24340
|
-
var jsonScene, _jsonScene_plugins, plugins,
|
|
25971
|
+
var jsonScene, _jsonScene_plugins, plugins, pluginSystem;
|
|
24341
25972
|
return __generator(this, function(_state) {
|
|
24342
25973
|
switch(_state.label){
|
|
24343
25974
|
case 0:
|
|
24344
25975
|
jsonScene = getStandardJSON(json);
|
|
24345
|
-
_jsonScene_plugins = jsonScene.plugins, plugins = _jsonScene_plugins === void 0 ? [] : _jsonScene_plugins
|
|
25976
|
+
_jsonScene_plugins = jsonScene.plugins, plugins = _jsonScene_plugins === void 0 ? [] : _jsonScene_plugins;
|
|
24346
25977
|
pluginSystem = new PluginSystem(plugins);
|
|
24347
25978
|
return [
|
|
24348
25979
|
4,
|
|
@@ -24350,20 +25981,9 @@ var seed$1 = 1;
|
|
|
24350
25981
|
];
|
|
24351
25982
|
case 1:
|
|
24352
25983
|
_state.sent();
|
|
24353
|
-
renderLevel = _this.options.renderLevel;
|
|
24354
|
-
usedImages = {};
|
|
24355
|
-
if (imgUsage) {
|
|
24356
|
-
// TODO: 考虑放到独立的 fix 文件
|
|
24357
|
-
fixOldImageUsage(usedImages, sceneCompositions, imgUsage, images, renderLevel);
|
|
24358
|
-
} else {
|
|
24359
|
-
images == null ? void 0 : images.forEach(function(_, i) {
|
|
24360
|
-
usedImages[i] = true;
|
|
24361
|
-
});
|
|
24362
|
-
}
|
|
24363
25984
|
return [
|
|
24364
25985
|
2,
|
|
24365
25986
|
{
|
|
24366
|
-
usedImages: usedImages,
|
|
24367
25987
|
jsonScene: jsonScene,
|
|
24368
25988
|
pluginSystem: pluginSystem
|
|
24369
25989
|
}
|
|
@@ -24435,7 +26055,6 @@ var seed$1 = 1;
|
|
|
24435
26055
|
];
|
|
24436
26056
|
case 2:
|
|
24437
26057
|
_state.sent();
|
|
24438
|
-
//@ts-expect-error
|
|
24439
26058
|
document.fonts.add(fontFace);
|
|
24440
26059
|
AssetManager.fonts.add(font.fontFamily);
|
|
24441
26060
|
return [
|
|
@@ -24517,6 +26136,10 @@ var seed$1 = 1;
|
|
|
24517
26136
|
3,
|
|
24518
26137
|
3
|
|
24519
26138
|
];
|
|
26139
|
+
_this.assets[idx] = {
|
|
26140
|
+
url: resultImage.src,
|
|
26141
|
+
type: exports.TextureSourceType.video
|
|
26142
|
+
};
|
|
24520
26143
|
return [
|
|
24521
26144
|
2,
|
|
24522
26145
|
resultImage
|
|
@@ -24526,6 +26149,10 @@ var seed$1 = 1;
|
|
|
24526
26149
|
if (background && Array.isArray(url) && variables) {
|
|
24527
26150
|
variables[background.name] = resultImage.src;
|
|
24528
26151
|
}
|
|
26152
|
+
_this.assets[idx] = {
|
|
26153
|
+
url: resultImage.src,
|
|
26154
|
+
type: exports.TextureSourceType.image
|
|
26155
|
+
};
|
|
24529
26156
|
return [
|
|
24530
26157
|
4,
|
|
24531
26158
|
combineImageTemplate(resultImage, template, variables)
|
|
@@ -24568,12 +26195,6 @@ var seed$1 = 1;
|
|
|
24568
26195
|
_this.loadBins(bufferURL)
|
|
24569
26196
|
];
|
|
24570
26197
|
}
|
|
24571
|
-
} else if ("sourceType" in img) {
|
|
24572
|
-
// TODO: 确定是否有用
|
|
24573
|
-
return [
|
|
24574
|
-
2,
|
|
24575
|
-
img
|
|
24576
|
-
];
|
|
24577
26198
|
} else if (_instanceof1(img, HTMLImageElement) || _instanceof1(img, HTMLCanvasElement) || _instanceof1(img, HTMLVideoElement) || _instanceof1(img, Texture)) {
|
|
24578
26199
|
return [
|
|
24579
26200
|
2,
|
|
@@ -24624,7 +26245,7 @@ var seed$1 = 1;
|
|
|
24624
26245
|
});
|
|
24625
26246
|
})();
|
|
24626
26247
|
};
|
|
24627
|
-
_proto.processTextures = function processTextures(images, bins, jsonScene
|
|
26248
|
+
_proto.processTextures = function processTextures(images, bins, jsonScene) {
|
|
24628
26249
|
var _this = this;
|
|
24629
26250
|
return _async_to_generator(function() {
|
|
24630
26251
|
var _jsonScene_textures, textures, jobs;
|
|
@@ -24635,7 +26256,7 @@ var seed$1 = 1;
|
|
|
24635
26256
|
};
|
|
24636
26257
|
});
|
|
24637
26258
|
jobs = textures.map(/*#__PURE__*/ _async_to_generator(function(textureOptions, idx) {
|
|
24638
|
-
var e, source, image, texture;
|
|
26259
|
+
var e, source, id, image, texture;
|
|
24639
26260
|
return __generator(this, function(_state) {
|
|
24640
26261
|
switch(_state.label){
|
|
24641
26262
|
case 0:
|
|
@@ -24659,7 +26280,7 @@ var seed$1 = 1;
|
|
|
24659
26280
|
]);
|
|
24660
26281
|
return [
|
|
24661
26282
|
4,
|
|
24662
|
-
deserializeMipmapTexture(textureOptions, bins,
|
|
26283
|
+
deserializeMipmapTexture(textureOptions, bins, _this.assets, jsonScene.bins)
|
|
24663
26284
|
];
|
|
24664
26285
|
case 2:
|
|
24665
26286
|
return [
|
|
@@ -24670,12 +26291,12 @@ var seed$1 = 1;
|
|
|
24670
26291
|
e = _state.sent();
|
|
24671
26292
|
throw new Error("Load texture " + idx + " fails, error message: " + e + ".");
|
|
24672
26293
|
case 4:
|
|
24673
|
-
source = textureOptions.source;
|
|
26294
|
+
source = textureOptions.source, id = textureOptions.id;
|
|
24674
26295
|
if (!isObject(source)) return [
|
|
24675
26296
|
3,
|
|
24676
26297
|
5
|
|
24677
26298
|
];
|
|
24678
|
-
image =
|
|
26299
|
+
image = _this.assets[source.id];
|
|
24679
26300
|
return [
|
|
24680
26301
|
3,
|
|
24681
26302
|
7
|
|
@@ -24694,9 +26315,7 @@ var seed$1 = 1;
|
|
|
24694
26315
|
_state.label = 7;
|
|
24695
26316
|
case 7:
|
|
24696
26317
|
if (image) {
|
|
24697
|
-
texture = createTextureOptionsBySource(image, _this.assets[idx]);
|
|
24698
|
-
texture.id = textureOptions.id;
|
|
24699
|
-
texture.dataType = DataType.Texture;
|
|
26318
|
+
texture = createTextureOptionsBySource(image, _this.assets[idx], id);
|
|
24700
26319
|
return [
|
|
24701
26320
|
2,
|
|
24702
26321
|
texture.sourceType === exports.TextureSourceType.compressed ? texture : _extends({}, texture, textureOptions)
|
|
@@ -24757,11 +26376,6 @@ var seed$1 = 1;
|
|
|
24757
26376
|
return window.clearTimeout(id);
|
|
24758
26377
|
});
|
|
24759
26378
|
}
|
|
24760
|
-
for(var key in this.assets){
|
|
24761
|
-
var _asset_dispose;
|
|
24762
|
-
var asset = this.assets[key];
|
|
24763
|
-
asset == null ? void 0 : (_asset_dispose = asset.dispose) == null ? void 0 : _asset_dispose.call(asset);
|
|
24764
|
-
}
|
|
24765
26379
|
this.assets = {};
|
|
24766
26380
|
this.timers = [];
|
|
24767
26381
|
};
|
|
@@ -24770,55 +26384,44 @@ var seed$1 = 1;
|
|
|
24770
26384
|
/**
|
|
24771
26385
|
* 自定义文本缓存,随页面销毁而销毁
|
|
24772
26386
|
*/ AssetManager.fonts = new Set();
|
|
24773
|
-
function
|
|
24774
|
-
|
|
24775
|
-
|
|
24776
|
-
|
|
24777
|
-
|
|
24778
|
-
for(var j = 0; j < ids.length; j++){
|
|
24779
|
-
var id1 = ids[j];
|
|
24780
|
-
var tag = images[id1].renderLevel;
|
|
24781
|
-
if (passRenderLevel(tag, renderLevel)) {
|
|
24782
|
-
usedImages[id1] = true;
|
|
24783
|
-
}
|
|
24784
|
-
}
|
|
24785
|
-
}
|
|
24786
|
-
}
|
|
24787
|
-
}
|
|
24788
|
-
function createTextureOptionsBySource(image, sourceFrom) {
|
|
26387
|
+
function createTextureOptionsBySource(image, sourceFrom, id) {
|
|
26388
|
+
var options = {
|
|
26389
|
+
id: id,
|
|
26390
|
+
dataType: DataType.Texture
|
|
26391
|
+
};
|
|
24789
26392
|
if (_instanceof1(image, Texture)) {
|
|
24790
|
-
return image.source;
|
|
26393
|
+
return _extends({}, image.source, options);
|
|
24791
26394
|
} else if (_instanceof1(image, HTMLImageElement) || isCanvas(image)) {
|
|
24792
|
-
return {
|
|
26395
|
+
return _extends({
|
|
24793
26396
|
image: image,
|
|
24794
26397
|
sourceType: exports.TextureSourceType.image,
|
|
24795
26398
|
sourceFrom: sourceFrom,
|
|
24796
26399
|
keepImageSource: true,
|
|
24797
26400
|
minFilter: glContext.LINEAR,
|
|
24798
26401
|
magFilter: glContext.LINEAR
|
|
24799
|
-
};
|
|
26402
|
+
}, options);
|
|
24800
26403
|
} else if (_instanceof1(image, HTMLVideoElement)) {
|
|
24801
26404
|
// 视频
|
|
24802
|
-
return {
|
|
26405
|
+
return _extends({
|
|
24803
26406
|
sourceType: exports.TextureSourceType.video,
|
|
24804
26407
|
video: image,
|
|
24805
26408
|
minFilter: glContext.LINEAR,
|
|
24806
26409
|
magFilter: glContext.LINEAR
|
|
24807
|
-
};
|
|
26410
|
+
}, options);
|
|
24808
26411
|
} else if (_instanceof1(image, ArrayBuffer)) {
|
|
24809
26412
|
// 压缩纹理
|
|
24810
26413
|
return _extends({}, getKTXTextureOptions(image), {
|
|
24811
26414
|
sourceFrom: sourceFrom
|
|
24812
|
-
});
|
|
26415
|
+
}, options);
|
|
24813
26416
|
} else if ("width" in image && "height" in image && "data" in image) {
|
|
24814
|
-
return {
|
|
26417
|
+
return _extends({
|
|
24815
26418
|
sourceType: exports.TextureSourceType.data,
|
|
24816
26419
|
data: image,
|
|
24817
26420
|
wrapS: glContext.CLAMP_TO_EDGE,
|
|
24818
26421
|
wrapT: glContext.CLAMP_TO_EDGE,
|
|
24819
26422
|
minFilter: glContext.NEAREST,
|
|
24820
26423
|
magFilter: glContext.NEAREST
|
|
24821
|
-
};
|
|
26424
|
+
}, options);
|
|
24822
26425
|
}
|
|
24823
26426
|
throw new Error("Invalid texture options.");
|
|
24824
26427
|
}
|
|
@@ -25122,11 +26725,12 @@ var listOrder = 0;
|
|
|
25122
26725
|
function CompositionSourceManager(scene, engine) {
|
|
25123
26726
|
this.refCompositions = new Map();
|
|
25124
26727
|
this.refCompositionProps = new Map();
|
|
26728
|
+
this.imgUsage = {};
|
|
25125
26729
|
this.mask = 0;
|
|
25126
26730
|
this.engine = engine;
|
|
25127
26731
|
// 资源
|
|
25128
26732
|
var jsonScene = scene.jsonScene, renderLevel = scene.renderLevel, textureOptions = scene.textureOptions, pluginSystem = scene.pluginSystem, totalTime = scene.totalTime;
|
|
25129
|
-
var compositions = jsonScene.compositions,
|
|
26733
|
+
var compositions = jsonScene.compositions, compositionId = jsonScene.compositionId;
|
|
25130
26734
|
if (!textureOptions) {
|
|
25131
26735
|
throw new Error("scene.textures expected.");
|
|
25132
26736
|
}
|
|
@@ -25146,7 +26750,6 @@ var listOrder = 0;
|
|
|
25146
26750
|
this.renderLevel = renderLevel;
|
|
25147
26751
|
this.pluginSystem = pluginSystem;
|
|
25148
26752
|
this.totalTime = totalTime != null ? totalTime : 0;
|
|
25149
|
-
this.imgUsage = imgUsage != null ? imgUsage : {};
|
|
25150
26753
|
this.textures = cachedTextures;
|
|
25151
26754
|
listOrder = 0;
|
|
25152
26755
|
this.sourceContent = this.getContent(this.composition);
|
|
@@ -25167,11 +26770,12 @@ var listOrder = 0;
|
|
|
25167
26770
|
});
|
|
25168
26771
|
};
|
|
25169
26772
|
_proto.assembleItems = function assembleItems(composition) {
|
|
26773
|
+
var _this_jsonScene;
|
|
25170
26774
|
var items = [];
|
|
25171
|
-
this.mask++;
|
|
25172
26775
|
var componentMap = {};
|
|
25173
|
-
|
|
25174
|
-
|
|
26776
|
+
this.mask++;
|
|
26777
|
+
var _this_jsonScene_components;
|
|
26778
|
+
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;){
|
|
25175
26779
|
var component = _step.value;
|
|
25176
26780
|
componentMap[component.id] = component;
|
|
25177
26781
|
}
|
|
@@ -25208,19 +26812,24 @@ var listOrder = 0;
|
|
|
25208
26812
|
_proto.preProcessItemContent = function preProcessItemContent(renderContent) {
|
|
25209
26813
|
if (renderContent.renderer) {
|
|
25210
26814
|
renderContent.renderer = this.changeTex(renderContent.renderer);
|
|
25211
|
-
if (!renderContent.renderer
|
|
26815
|
+
if (!("mask" in renderContent.renderer)) {
|
|
25212
26816
|
this.processMask(renderContent.renderer);
|
|
25213
26817
|
}
|
|
25214
|
-
var split = renderContent.splits && !renderContent.textureSheetAnimation
|
|
25215
|
-
|
|
26818
|
+
var split = renderContent.splits && !renderContent.textureSheetAnimation ? renderContent.splits[0] : undefined;
|
|
26819
|
+
var shape = renderContent.renderer.shape;
|
|
26820
|
+
var shapeData;
|
|
26821
|
+
if (Number.isInteger(shape)) {
|
|
25216
26822
|
var _this_jsonScene;
|
|
25217
|
-
|
|
25218
|
-
|
|
25219
|
-
|
|
25220
|
-
|
|
26823
|
+
shapeData = (_this_jsonScene = this.jsonScene) == null ? void 0 : _this_jsonScene.shapes[shape];
|
|
26824
|
+
} else {
|
|
26825
|
+
shapeData = shape;
|
|
26826
|
+
}
|
|
26827
|
+
if (shapeData !== undefined) {
|
|
26828
|
+
// @ts-expect-error 类型转换问题
|
|
26829
|
+
renderContent.renderer.shape = getGeometryByShape(shapeData, split);
|
|
25221
26830
|
}
|
|
25222
26831
|
}
|
|
25223
|
-
if (renderContent.trails) {
|
|
26832
|
+
if ("trails" in renderContent && renderContent.trails !== undefined) {
|
|
25224
26833
|
renderContent.trails = this.changeTex(renderContent.trails);
|
|
25225
26834
|
}
|
|
25226
26835
|
};
|
|
@@ -25228,22 +26837,17 @@ var listOrder = 0;
|
|
|
25228
26837
|
if (!renderer.texture) {
|
|
25229
26838
|
return renderer;
|
|
25230
26839
|
}
|
|
25231
|
-
//@ts-expect-error
|
|
25232
26840
|
var texIdx = renderer.texture.id;
|
|
25233
26841
|
if (texIdx !== undefined) {
|
|
25234
|
-
|
|
25235
|
-
this.addTextureUsage(texIdx) || texIdx;
|
|
26842
|
+
this.addTextureUsage(texIdx);
|
|
25236
26843
|
}
|
|
25237
26844
|
return renderer;
|
|
25238
26845
|
};
|
|
25239
|
-
_proto.addTextureUsage = function addTextureUsage(
|
|
25240
|
-
var texId = texIdx;
|
|
26846
|
+
_proto.addTextureUsage = function addTextureUsage(texId) {
|
|
25241
26847
|
var _this_imgUsage;
|
|
25242
|
-
// FIXME: imageUsage 取自 scene.imgUsage,类型为 Record<string, number[]>,这里给的 number,类型对不上
|
|
25243
26848
|
var imageUsage = (_this_imgUsage = this.imgUsage) != null ? _this_imgUsage : {};
|
|
25244
26849
|
if (texId && imageUsage) {
|
|
25245
|
-
|
|
25246
|
-
if (!imageUsage.hasOwnProperty(texId)) {
|
|
26850
|
+
if (!Object.prototype.hasOwnProperty.call(imageUsage, texId)) {
|
|
25247
26851
|
imageUsage[texId] = 0;
|
|
25248
26852
|
}
|
|
25249
26853
|
imageUsage[texId]++;
|
|
@@ -25414,7 +27018,6 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
25414
27018
|
_this.lastVideoUpdateTime = 0;
|
|
25415
27019
|
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;
|
|
25416
27020
|
_this.compositionSourceManager = new CompositionSourceManager(scene, renderer.engine);
|
|
25417
|
-
scene.jsonScene.imgUsage = undefined;
|
|
25418
27021
|
if (reusable) {
|
|
25419
27022
|
_this.keepResource = true;
|
|
25420
27023
|
scene.textures = undefined;
|
|
@@ -25433,24 +27036,23 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
25433
27036
|
_this.rootComposition.data = sourceContent;
|
|
25434
27037
|
_this.rootComposition.item = _this.rootItem;
|
|
25435
27038
|
_this.rootItem.components.push(_this.rootComposition);
|
|
25436
|
-
var imageUsage = !reusable && imgUsage;
|
|
25437
27039
|
_this.width = width;
|
|
25438
27040
|
_this.height = height;
|
|
25439
27041
|
_this.renderOrder = baseRenderOrder;
|
|
25440
27042
|
_this.id = sourceContent.id;
|
|
25441
27043
|
_this.renderer = renderer;
|
|
25442
|
-
_this.texInfo =
|
|
27044
|
+
_this.texInfo = !reusable ? imgUsage : {};
|
|
25443
27045
|
_this.event = event;
|
|
25444
|
-
var _scene_startTime
|
|
27046
|
+
var _scene_startTime;
|
|
25445
27047
|
_this.statistic = {
|
|
25446
|
-
loadTime: totalTime != null ? totalTime : 0,
|
|
25447
27048
|
loadStart: (_scene_startTime = scene.startTime) != null ? _scene_startTime : 0,
|
|
25448
|
-
|
|
25449
|
-
|
|
27049
|
+
loadTime: totalTime != null ? totalTime : 0,
|
|
27050
|
+
compileTime: 0,
|
|
27051
|
+
firstFrameTime: 0
|
|
25450
27052
|
};
|
|
25451
27053
|
_this.reusable = reusable;
|
|
25452
27054
|
_this.speed = speed;
|
|
25453
|
-
_this.autoRefTex = !_this.keepResource &&
|
|
27055
|
+
_this.autoRefTex = !_this.keepResource && _this.texInfo && _this.rootItem.endBehavior !== EndBehavior.restart;
|
|
25454
27056
|
_this.name = sourceContent.name;
|
|
25455
27057
|
_this.pluginSystem = pluginSystem;
|
|
25456
27058
|
_this.pluginSystem.initializeComposition(_assert_this_initialized(_this), scene);
|
|
@@ -25459,7 +27061,6 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
25459
27061
|
}));
|
|
25460
27062
|
_this.url = scene.url;
|
|
25461
27063
|
_this.assigned = true;
|
|
25462
|
-
_this.globalTime = 0;
|
|
25463
27064
|
_this.interactive = true;
|
|
25464
27065
|
_this.handleItemMessage = handleItemMessage;
|
|
25465
27066
|
_this.createRenderFrame();
|
|
@@ -25622,8 +27223,8 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
25622
27223
|
* 重置状态函数
|
|
25623
27224
|
*/ _proto.reset = function reset() {
|
|
25624
27225
|
this.rendererOptions = null;
|
|
25625
|
-
this.globalTime = 0;
|
|
25626
27226
|
this.rootItem.ended = false;
|
|
27227
|
+
this.rootComposition.time = 0;
|
|
25627
27228
|
this.pluginSystem.resetComposition(this, this.renderFrame);
|
|
25628
27229
|
};
|
|
25629
27230
|
_proto.prepareRender = function prepareRender() {
|
|
@@ -25660,9 +27261,8 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
25660
27261
|
if (!this.assigned || this.paused) {
|
|
25661
27262
|
return;
|
|
25662
27263
|
}
|
|
25663
|
-
var
|
|
25664
|
-
this.
|
|
25665
|
-
this.updateRootComposition();
|
|
27264
|
+
var dt = this.getUpdateTime(deltaTime * this.speed);
|
|
27265
|
+
this.updateRootComposition(dt / 1000);
|
|
25666
27266
|
this.updateVideo();
|
|
25667
27267
|
// 更新 model-tree-plugin
|
|
25668
27268
|
this.updatePluginLoaders(deltaTime);
|
|
@@ -25671,8 +27271,8 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
25671
27271
|
this.callAwake(this.rootItem);
|
|
25672
27272
|
this.rootItem.beginPlay();
|
|
25673
27273
|
}
|
|
25674
|
-
this.sceneTicking.update.tick(
|
|
25675
|
-
this.sceneTicking.lateUpdate.tick(
|
|
27274
|
+
this.sceneTicking.update.tick(dt);
|
|
27275
|
+
this.sceneTicking.lateUpdate.tick(dt);
|
|
25676
27276
|
this.updateCamera();
|
|
25677
27277
|
this.prepareRender();
|
|
25678
27278
|
if (this.shouldDispose()) {
|
|
@@ -25813,9 +27413,9 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
25813
27413
|
};
|
|
25814
27414
|
/**
|
|
25815
27415
|
* 更新主合成组件
|
|
25816
|
-
*/ _proto.updateRootComposition = function updateRootComposition() {
|
|
27416
|
+
*/ _proto.updateRootComposition = function updateRootComposition(deltaTime) {
|
|
25817
27417
|
if (this.rootComposition.isActiveAndEnabled) {
|
|
25818
|
-
var localTime = this.toLocalTime(this.
|
|
27418
|
+
var localTime = this.toLocalTime(this.time + deltaTime);
|
|
25819
27419
|
this.rootComposition.time = localTime;
|
|
25820
27420
|
}
|
|
25821
27421
|
};
|
|
@@ -28149,7 +29749,7 @@ __decorate([
|
|
|
28149
29749
|
serialize()
|
|
28150
29750
|
], exports.BinaryAsset.prototype, "buffer", void 0);
|
|
28151
29751
|
exports.BinaryAsset = __decorate([
|
|
28152
|
-
effectsClass(
|
|
29752
|
+
effectsClass(DataType.BinaryAsset)
|
|
28153
29753
|
], exports.BinaryAsset);
|
|
28154
29754
|
|
|
28155
29755
|
registerPlugin("camera", CameraVFXItemLoader, exports.VFXItem, true);
|
|
@@ -28158,7 +29758,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem, true);
|
|
|
28158
29758
|
registerPlugin("particle", ParticleLoader, exports.VFXItem, true);
|
|
28159
29759
|
registerPlugin("cal", CalculateLoader, exports.VFXItem, true);
|
|
28160
29760
|
registerPlugin("interact", InteractLoader, exports.VFXItem, true);
|
|
28161
|
-
var version$1 = "2.1.0-alpha.
|
|
29761
|
+
var version$1 = "2.1.0-alpha.6";
|
|
28162
29762
|
logger.info("Core version: " + version$1 + ".");
|
|
28163
29763
|
|
|
28164
29764
|
var _obj;
|
|
@@ -29557,13 +31157,14 @@ var ThreeRenderer = /*#__PURE__*/ function(Renderer) {
|
|
|
29557
31157
|
opts = _extends({
|
|
29558
31158
|
autoplay: true
|
|
29559
31159
|
}, options);
|
|
29560
|
-
|
|
29561
|
-
|
|
29562
|
-
if (
|
|
31160
|
+
source = url;
|
|
31161
|
+
if (exports.Scene.isURL(url)) {
|
|
31162
|
+
if (!exports.Scene.isJSONObject(url)) {
|
|
31163
|
+
source = url.url;
|
|
31164
|
+
}
|
|
31165
|
+
if (exports.Scene.isWithOptions(url)) {
|
|
29563
31166
|
opts = _extends({}, opts, url.options || {});
|
|
29564
31167
|
}
|
|
29565
|
-
} else {
|
|
29566
|
-
source = url;
|
|
29567
31168
|
}
|
|
29568
31169
|
if (_this.assetManager) {
|
|
29569
31170
|
_this.assetManager.updateOptions(opts);
|
|
@@ -29839,7 +31440,7 @@ setMaxSpriteMeshItemCount(8);
|
|
|
29839
31440
|
*/ Mesh.create = function(engine, props) {
|
|
29840
31441
|
return new ThreeMesh(engine, props);
|
|
29841
31442
|
};
|
|
29842
|
-
var version = "2.1.0-alpha.
|
|
31443
|
+
var version = "2.1.0-alpha.6";
|
|
29843
31444
|
logger.info("THREEJS plugin version: " + version + ".");
|
|
29844
31445
|
|
|
29845
31446
|
exports.AbstractPlugin = AbstractPlugin;
|
|
@@ -30028,9 +31629,6 @@ exports.isIOS = isIOS;
|
|
|
30028
31629
|
exports.isIOSByUA = isIOSByUA;
|
|
30029
31630
|
exports.isMiniProgram = isMiniProgram;
|
|
30030
31631
|
exports.isObject = isObject;
|
|
30031
|
-
exports.isSceneJSON = isSceneJSON;
|
|
30032
|
-
exports.isSceneURL = isSceneURL;
|
|
30033
|
-
exports.isSceneWithOptions = isSceneWithOptions;
|
|
30034
31632
|
exports.isSimulatorCellPhone = isSimulatorCellPhone;
|
|
30035
31633
|
exports.isString = isString;
|
|
30036
31634
|
exports.isUniformStruct = isUniformStruct;
|