@galacean/effects-core 2.0.0-alpha.26 → 2.0.0-alpha.28
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/__definations__/fbeffects-object-data.d.ts +28 -0
- package/dist/__definations__/fbeffects-package-data.d.ts +26 -0
- package/dist/__definations__/fbgeometry-data.d.ts +77 -0
- package/dist/__definations__/fbsub-mesh.d.ts +26 -0
- package/dist/__definations__/fbvertex-channel.d.ts +33 -0
- package/dist/__definations__/fbvertex-data.d.ts +27 -0
- package/dist/__definations__/index.d.ts +6 -0
- package/dist/camera.d.ts +4 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/post-process-volume.d.ts +16 -0
- package/dist/composition-source-manager.d.ts +1 -3
- package/dist/composition.d.ts +5 -5
- package/dist/effects-package.d.ts +19 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1925 -285
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1922 -285
- package/dist/index.mjs.map +1 -1
- package/dist/math/translate.d.ts +1 -1
- package/dist/plugins/interact/interact-item.d.ts +1 -0
- package/dist/plugins/timeline/track.d.ts +2 -2
- package/dist/render/global-volume.d.ts +4 -5
- package/dist/render/render-frame.d.ts +6 -5
- package/dist/utils/device.d.ts +3 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/vfx-item.d.ts +2 -8
- package/package.json +5 -3
- package/dist/asset-migrations.d.ts +0 -5
- package/dist/plugins/cal/animation-mixer-playable.d.ts +0 -4
- package/dist/plugins/cal/animation-playable-output.d.ts +0 -4
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Description: Galacean Effects runtime core for the web
|
|
4
4
|
* Author: Ant Group CO., Ltd.
|
|
5
5
|
* Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
|
|
6
|
-
* Version: v2.0.0-alpha.
|
|
6
|
+
* Version: v2.0.0-alpha.28
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -440,16 +440,27 @@ function isIOS() {
|
|
|
440
440
|
// real ios device not in simulator
|
|
441
441
|
return !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);
|
|
442
442
|
}
|
|
443
|
+
function isIOSByUA() {
|
|
444
|
+
var str = navigator.userAgent.toLowerCase();
|
|
445
|
+
var ver = str.match(/cpu (iphone )?os (.*?) like mac os/);
|
|
446
|
+
return ver ? parseInt(ver[2], 10) : 0;
|
|
447
|
+
}
|
|
443
448
|
function isAndroid() {
|
|
444
449
|
return /\b[Aa]ndroid\b/.test(navigator.userAgent);
|
|
445
450
|
}
|
|
446
451
|
function isSimulatorCellPhone() {
|
|
447
452
|
return isAndroid() || /\b(iPad|iPhone|iPod)\b/.test(navigator.userAgent);
|
|
448
453
|
}
|
|
454
|
+
function isMiniProgram() {
|
|
455
|
+
return isAlipayMiniApp() || isWechatMiniApp();
|
|
456
|
+
}
|
|
449
457
|
function isAlipayMiniApp() {
|
|
450
458
|
var _my;
|
|
451
459
|
return typeof my !== "undefined" && ((_my = my) == null ? void 0 : _my.renderTarget) === "web";
|
|
452
460
|
}
|
|
461
|
+
function isWechatMiniApp() {
|
|
462
|
+
return window.__wxjs_environment === "miniprogram";
|
|
463
|
+
}
|
|
453
464
|
|
|
454
465
|
function imageDataFromColor(value) {
|
|
455
466
|
if (isString(value)) {
|
|
@@ -3997,13 +4008,29 @@ var RenderFace;
|
|
|
3997
4008
|
RenderFace["Front"] = "Front";
|
|
3998
4009
|
})(RenderFace || (RenderFace = {}));
|
|
3999
4010
|
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
var
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
var
|
|
4011
|
+
/**
|
|
4012
|
+
* 销毁
|
|
4013
|
+
*/ var END_BEHAVIOR_DESTROY = 0;
|
|
4014
|
+
/**
|
|
4015
|
+
* 暂停
|
|
4016
|
+
* @deprecated since 2.0 - use `END_BEHAVIOR_FREEZE` instead
|
|
4017
|
+
*/ var END_BEHAVIOR_PAUSE = 1;
|
|
4018
|
+
/**
|
|
4019
|
+
* 无限播放
|
|
4020
|
+
*/ var END_BEHAVIOR_FORWARD = 2;
|
|
4021
|
+
/**
|
|
4022
|
+
* 销毁并保留最后一帧
|
|
4023
|
+
* @deprecated since 2.0
|
|
4024
|
+
*/ var END_BEHAVIOR_PAUSE_AND_DESTROY = 3;
|
|
4025
|
+
/**
|
|
4026
|
+
* 冻结
|
|
4027
|
+
*/ var END_BEHAVIOR_FREEZE = 4;
|
|
4028
|
+
/**
|
|
4029
|
+
* 重播
|
|
4030
|
+
*/ var END_BEHAVIOR_RESTART = 5;
|
|
4031
|
+
/**
|
|
4032
|
+
*
|
|
4033
|
+
*/ var END_BEHAVIOR_DESTROY_CHILDREN = 6;
|
|
4007
4034
|
var CAMERA_CLIP_MODE_VERTICAL = 1;
|
|
4008
4035
|
var CAMERA_CLIP_MODE_NORMAL = 0;
|
|
4009
4036
|
var MESSAGE_ITEM_PHRASE_BEGIN = 2;
|
|
@@ -4018,29 +4045,6 @@ var CameraClipMode;
|
|
|
4018
4045
|
* 剪裁左右
|
|
4019
4046
|
*/ CameraClipMode[CameraClipMode["landscape"] = 0] = "landscape";
|
|
4020
4047
|
})(CameraClipMode || (CameraClipMode = {}));
|
|
4021
|
-
/**
|
|
4022
|
-
* 结束行为
|
|
4023
|
-
*/ var CompositionEndBehavior;
|
|
4024
|
-
(function(CompositionEndBehavior) {
|
|
4025
|
-
/**
|
|
4026
|
-
* 销毁
|
|
4027
|
-
*/ CompositionEndBehavior[CompositionEndBehavior["destroy"] = 0] = "destroy";
|
|
4028
|
-
/**
|
|
4029
|
-
* 暂停
|
|
4030
|
-
*/ CompositionEndBehavior[CompositionEndBehavior["pause"] = 1] = "pause";
|
|
4031
|
-
/**
|
|
4032
|
-
* 重播
|
|
4033
|
-
*/ CompositionEndBehavior[CompositionEndBehavior["restart"] = 5] = "restart";
|
|
4034
|
-
/**
|
|
4035
|
-
* 无限播放
|
|
4036
|
-
*/ CompositionEndBehavior[CompositionEndBehavior["forward"] = 2] = "forward";
|
|
4037
|
-
/**
|
|
4038
|
-
* 销毁并保留最后一帧
|
|
4039
|
-
*/ CompositionEndBehavior[CompositionEndBehavior["pause_destroy"] = 3] = "pause_destroy";
|
|
4040
|
-
/**
|
|
4041
|
-
* 冻结
|
|
4042
|
-
*/ CompositionEndBehavior[CompositionEndBehavior["freeze"] = 4] = "freeze";
|
|
4043
|
-
})(CompositionEndBehavior || (CompositionEndBehavior = {}));
|
|
4044
4048
|
|
|
4045
4049
|
/**
|
|
4046
4050
|
* 动态换图类型
|
|
@@ -4121,12 +4125,23 @@ var CameraClipMode;
|
|
|
4121
4125
|
BezierKeyframeType[BezierKeyframeType["LINE_OUT"] = 6] = "LINE_OUT";
|
|
4122
4126
|
})(BezierKeyframeType || (BezierKeyframeType = {}));
|
|
4123
4127
|
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4128
|
+
/**
|
|
4129
|
+
* 结束行为
|
|
4130
|
+
*/ var EndBehavior;
|
|
4131
|
+
(function(EndBehavior) {
|
|
4132
|
+
/**
|
|
4133
|
+
* 销毁
|
|
4134
|
+
*/ EndBehavior[EndBehavior["destroy"] = 0] = "destroy";
|
|
4135
|
+
/**
|
|
4136
|
+
* 重播
|
|
4137
|
+
*/ EndBehavior[EndBehavior["restart"] = 5] = "restart";
|
|
4138
|
+
/**
|
|
4139
|
+
* 无限播放
|
|
4140
|
+
*/ EndBehavior[EndBehavior["forward"] = 2] = "forward";
|
|
4141
|
+
/**
|
|
4142
|
+
* 冻结
|
|
4143
|
+
*/ EndBehavior[EndBehavior["freeze"] = 4] = "freeze";
|
|
4144
|
+
})(EndBehavior || (EndBehavior = {}));
|
|
4130
4145
|
var ParentItemEndBehavior;
|
|
4131
4146
|
(function(ParentItemEndBehavior) {
|
|
4132
4147
|
ParentItemEndBehavior[ParentItemEndBehavior["destroyChildren"] = 6] = "destroyChildren";
|
|
@@ -4451,7 +4466,6 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
4451
4466
|
get RenderType () { return RenderType; },
|
|
4452
4467
|
get RenderFace () { return RenderFace; },
|
|
4453
4468
|
get CameraClipMode () { return CameraClipMode; },
|
|
4454
|
-
get CompositionEndBehavior () { return CompositionEndBehavior; },
|
|
4455
4469
|
get BackgroundType () { return BackgroundType; },
|
|
4456
4470
|
END_BEHAVIOR_DESTROY: END_BEHAVIOR_DESTROY,
|
|
4457
4471
|
END_BEHAVIOR_PAUSE: END_BEHAVIOR_PAUSE,
|
|
@@ -4466,7 +4480,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
4466
4480
|
MESSAGE_ITEM_PHRASE_END: MESSAGE_ITEM_PHRASE_END,
|
|
4467
4481
|
get ValueType () { return ValueType; },
|
|
4468
4482
|
get BezierKeyframeType () { return BezierKeyframeType; },
|
|
4469
|
-
get
|
|
4483
|
+
get EndBehavior () { return EndBehavior; },
|
|
4470
4484
|
get ParentItemEndBehavior () { return ParentItemEndBehavior; },
|
|
4471
4485
|
get ParticleInteractionBehavior () { return ParticleInteractionBehavior; },
|
|
4472
4486
|
get ShapeArcMode () { return ShapeArcMode; },
|
|
@@ -8126,31 +8140,35 @@ function deserializeMipmapTexture(textureOptions, bins, engine) {
|
|
|
8126
8140
|
}
|
|
8127
8141
|
function _deserializeMipmapTexture() {
|
|
8128
8142
|
_deserializeMipmapTexture = _async_to_generator(function(textureOptions, bins, engine, files) {
|
|
8129
|
-
var mipmaps, target,
|
|
8143
|
+
var mipmaps, target, jobs, loadedMipmaps, mipmaps1, target1, jobs1, loadedMipmaps1, bin;
|
|
8130
8144
|
return __generator(this, function(_state) {
|
|
8131
8145
|
switch(_state.label){
|
|
8132
8146
|
case 0:
|
|
8133
8147
|
if (files === void 0) files = [];
|
|
8134
8148
|
if (!(textureOptions.target === 34067)) return [
|
|
8135
8149
|
3,
|
|
8136
|
-
|
|
8150
|
+
2
|
|
8137
8151
|
];
|
|
8138
8152
|
mipmaps = textureOptions.mipmaps, target = textureOptions.target;
|
|
8139
|
-
|
|
8140
|
-
|
|
8141
|
-
for(_iterator = _create_for_of_iterator_helper_loose(mipmaps); !(_step = _iterator()).done;){
|
|
8142
|
-
level = _step.value;
|
|
8143
|
-
newLevel = [];
|
|
8144
|
-
for(_iterator1 = _create_for_of_iterator_helper_loose(level); !(_step1 = _iterator1()).done;){
|
|
8145
|
-
face = _step1.value;
|
|
8153
|
+
jobs = mipmaps.map(function(mipmap) {
|
|
8154
|
+
return Promise.all(mipmap.map(function(pointer) {
|
|
8146
8155
|
// @ts-expect-error
|
|
8147
|
-
|
|
8148
|
-
|
|
8149
|
-
|
|
8150
|
-
|
|
8151
|
-
|
|
8152
|
-
|
|
8153
|
-
|
|
8156
|
+
if (pointer.id) {
|
|
8157
|
+
// @ts-expect-error
|
|
8158
|
+
var loadedImageAsset = engine.assetLoader.loadGUID(pointer.id);
|
|
8159
|
+
// @ts-expect-error
|
|
8160
|
+
return loadedImageAsset.data;
|
|
8161
|
+
} else {
|
|
8162
|
+
return loadMipmapImage(pointer, bins);
|
|
8163
|
+
}
|
|
8164
|
+
}));
|
|
8165
|
+
});
|
|
8166
|
+
return [
|
|
8167
|
+
4,
|
|
8168
|
+
Promise.all(jobs)
|
|
8169
|
+
];
|
|
8170
|
+
case 1:
|
|
8171
|
+
loadedMipmaps = _state.sent();
|
|
8154
8172
|
return [
|
|
8155
8173
|
2,
|
|
8156
8174
|
_extends({
|
|
@@ -8164,17 +8182,17 @@ function _deserializeMipmapTexture() {
|
|
|
8164
8182
|
}
|
|
8165
8183
|
})
|
|
8166
8184
|
];
|
|
8167
|
-
case
|
|
8185
|
+
case 2:
|
|
8168
8186
|
// TODO: 补充测试用例
|
|
8169
8187
|
mipmaps1 = textureOptions.mipmaps, target1 = textureOptions.target;
|
|
8170
|
-
|
|
8188
|
+
jobs1 = mipmaps1.map(function(pointer) {
|
|
8171
8189
|
return loadMipmapImage(pointer, bins);
|
|
8172
8190
|
});
|
|
8173
8191
|
return [
|
|
8174
8192
|
4,
|
|
8175
|
-
Promise.all(
|
|
8193
|
+
Promise.all(jobs1)
|
|
8176
8194
|
];
|
|
8177
|
-
case
|
|
8195
|
+
case 3:
|
|
8178
8196
|
loadedMipmaps1 = _state.sent();
|
|
8179
8197
|
bin = files[mipmaps1[0][1][0]].url;
|
|
8180
8198
|
return [
|
|
@@ -8197,7 +8215,7 @@ function _deserializeMipmapTexture() {
|
|
|
8197
8215
|
}
|
|
8198
8216
|
})
|
|
8199
8217
|
];
|
|
8200
|
-
case
|
|
8218
|
+
case 4:
|
|
8201
8219
|
return [
|
|
8202
8220
|
2
|
|
8203
8221
|
];
|
|
@@ -11552,7 +11570,7 @@ var valueDefine = "#ifdef SHADER_VERTEX\n#define CURVE_VALUE_TEXTURE uVCurveValu
|
|
|
11552
11570
|
|
|
11553
11571
|
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.;}";
|
|
11554
11572
|
|
|
11555
|
-
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));}gl_FragColor=vec4(clamp(GammaCorrection(finalColor),0.0,1.0),1.0);}";
|
|
11573
|
+
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*=hdrColor.a;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));}gl_FragColor=vec4(clamp(GammaCorrection(finalColor),0.0,1.0),1.0);}";
|
|
11556
11574
|
|
|
11557
11575
|
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);}";
|
|
11558
11576
|
|
|
@@ -11840,7 +11858,7 @@ var ToneMappingPass = /*#__PURE__*/ function(RenderPass) {
|
|
|
11840
11858
|
this.screenMesh.material.setFloat("_Brightness", brightness);
|
|
11841
11859
|
this.screenMesh.material.setFloat("_Saturation", saturation);
|
|
11842
11860
|
this.screenMesh.material.setFloat("_Contrast", contrast);
|
|
11843
|
-
this.screenMesh.material.setInt("_UseBloom", useBloom);
|
|
11861
|
+
this.screenMesh.material.setInt("_UseBloom", Number(useBloom));
|
|
11844
11862
|
if (useBloom) {
|
|
11845
11863
|
this.screenMesh.material.setTexture("_GaussianTex", this.mainTexture);
|
|
11846
11864
|
this.screenMesh.material.setFloat("_BloomIntensity", bloomIntensity);
|
|
@@ -11852,7 +11870,7 @@ var ToneMappingPass = /*#__PURE__*/ function(RenderPass) {
|
|
|
11852
11870
|
this.screenMesh.material.setVector2("_VignetteCenter", new Vector2(0.5, 0.5));
|
|
11853
11871
|
this.screenMesh.material.setVector3("_VignetteColor", new Vector3(0.0, 0.0, 0.0));
|
|
11854
11872
|
}
|
|
11855
|
-
this.screenMesh.material.setInt("_UseToneMapping", useToneMapping);
|
|
11873
|
+
this.screenMesh.material.setInt("_UseToneMapping", Number(useToneMapping));
|
|
11856
11874
|
renderer.renderMeshes([
|
|
11857
11875
|
this.screenMesh
|
|
11858
11876
|
]);
|
|
@@ -11864,9 +11882,8 @@ var ToneMappingPass = /*#__PURE__*/ function(RenderPass) {
|
|
|
11864
11882
|
* 后处理配置
|
|
11865
11883
|
*/ var defaultGlobalVolume = {
|
|
11866
11884
|
useHDR: false,
|
|
11867
|
-
usePostProcessing: false,
|
|
11868
11885
|
/***** Material Uniform *****/ // Bloom
|
|
11869
|
-
useBloom:
|
|
11886
|
+
useBloom: true,
|
|
11870
11887
|
threshold: 1.0,
|
|
11871
11888
|
bloomIntensity: 1.0,
|
|
11872
11889
|
// ColorAdjustments
|
|
@@ -11880,7 +11897,7 @@ var ToneMappingPass = /*#__PURE__*/ function(RenderPass) {
|
|
|
11880
11897
|
vignetteSmoothness: 0.4,
|
|
11881
11898
|
vignetteRoundness: 1.0,
|
|
11882
11899
|
// ToneMapping
|
|
11883
|
-
useToneMapping:
|
|
11900
|
+
useToneMapping: true
|
|
11884
11901
|
};
|
|
11885
11902
|
|
|
11886
11903
|
var RENDER_PASS_NAME_PREFIX = "_effects_default_";
|
|
@@ -11949,20 +11966,36 @@ var seed$5 = 1;
|
|
|
11949
11966
|
];
|
|
11950
11967
|
this.setRenderPasses(renderPasses);
|
|
11951
11968
|
if (this.globalVolume) {
|
|
11952
|
-
var useBloom = this.globalVolume.useBloom;
|
|
11953
11969
|
var sceneTextureHandle = new RenderTargetHandle(engine); //保存后处理前的屏幕图像
|
|
11954
|
-
|
|
11955
|
-
|
|
11956
|
-
|
|
11957
|
-
|
|
11958
|
-
|
|
11959
|
-
|
|
11960
|
-
|
|
11961
|
-
|
|
11962
|
-
|
|
11963
|
-
|
|
11964
|
-
|
|
11965
|
-
|
|
11970
|
+
var gaussianStep = 7; // 高斯模糊的迭代次数,次数越高模糊范围越大
|
|
11971
|
+
var viewport = [
|
|
11972
|
+
0,
|
|
11973
|
+
0,
|
|
11974
|
+
this.renderer.getWidth() / 2,
|
|
11975
|
+
this.renderer.getHeight() / 2
|
|
11976
|
+
];
|
|
11977
|
+
var gaussianDownResults = new Array(gaussianStep); //存放多个高斯Pass的模糊结果,用于Bloom
|
|
11978
|
+
var textureType1 = this.globalVolume.useHDR ? glContext.HALF_FLOAT : glContext.UNSIGNED_BYTE;
|
|
11979
|
+
var bloomThresholdPass = new BloomThresholdPass(renderer, {
|
|
11980
|
+
name: "BloomThresholdPass",
|
|
11981
|
+
attachments: [
|
|
11982
|
+
{
|
|
11983
|
+
texture: {
|
|
11984
|
+
format: glContext.RGBA,
|
|
11985
|
+
type: textureType1,
|
|
11986
|
+
minFilter: glContext.LINEAR,
|
|
11987
|
+
magFilter: glContext.LINEAR
|
|
11988
|
+
}
|
|
11989
|
+
}
|
|
11990
|
+
]
|
|
11991
|
+
});
|
|
11992
|
+
bloomThresholdPass.sceneTextureHandle = sceneTextureHandle;
|
|
11993
|
+
this.addRenderPass(bloomThresholdPass);
|
|
11994
|
+
for(var i = 0; i < gaussianStep; i++){
|
|
11995
|
+
gaussianDownResults[i] = new RenderTargetHandle(engine);
|
|
11996
|
+
var gaussianDownHPass = new HQGaussianDownSamplePass(renderer, "H", {
|
|
11997
|
+
name: "GaussianDownPassH" + i,
|
|
11998
|
+
viewport: viewport,
|
|
11966
11999
|
attachments: [
|
|
11967
12000
|
{
|
|
11968
12001
|
texture: {
|
|
@@ -11974,74 +12007,50 @@ var seed$5 = 1;
|
|
|
11974
12007
|
}
|
|
11975
12008
|
]
|
|
11976
12009
|
});
|
|
11977
|
-
|
|
11978
|
-
|
|
11979
|
-
|
|
11980
|
-
|
|
11981
|
-
|
|
11982
|
-
|
|
11983
|
-
|
|
11984
|
-
|
|
11985
|
-
|
|
11986
|
-
|
|
11987
|
-
format: glContext.RGBA,
|
|
11988
|
-
type: textureType1,
|
|
11989
|
-
minFilter: glContext.LINEAR,
|
|
11990
|
-
magFilter: glContext.LINEAR
|
|
11991
|
-
}
|
|
11992
|
-
}
|
|
11993
|
-
]
|
|
11994
|
-
});
|
|
11995
|
-
var gaussianDownVPass = new HQGaussianDownSamplePass(renderer, "V", {
|
|
11996
|
-
name: "GaussianDownPassV" + i,
|
|
11997
|
-
viewport: viewport,
|
|
11998
|
-
attachments: [
|
|
11999
|
-
{
|
|
12000
|
-
texture: {
|
|
12001
|
-
format: glContext.RGBA,
|
|
12002
|
-
type: textureType1,
|
|
12003
|
-
minFilter: glContext.LINEAR,
|
|
12004
|
-
magFilter: glContext.LINEAR
|
|
12005
|
-
}
|
|
12010
|
+
var gaussianDownVPass = new HQGaussianDownSamplePass(renderer, "V", {
|
|
12011
|
+
name: "GaussianDownPassV" + i,
|
|
12012
|
+
viewport: viewport,
|
|
12013
|
+
attachments: [
|
|
12014
|
+
{
|
|
12015
|
+
texture: {
|
|
12016
|
+
format: glContext.RGBA,
|
|
12017
|
+
type: textureType1,
|
|
12018
|
+
minFilter: glContext.LINEAR,
|
|
12019
|
+
magFilter: glContext.LINEAR
|
|
12006
12020
|
}
|
|
12007
|
-
|
|
12008
|
-
|
|
12009
|
-
|
|
12010
|
-
|
|
12011
|
-
|
|
12012
|
-
|
|
12013
|
-
|
|
12014
|
-
|
|
12015
|
-
|
|
12016
|
-
|
|
12017
|
-
|
|
12018
|
-
|
|
12019
|
-
|
|
12020
|
-
|
|
12021
|
-
|
|
12022
|
-
|
|
12023
|
-
|
|
12024
|
-
|
|
12025
|
-
|
|
12026
|
-
|
|
12027
|
-
|
|
12028
|
-
|
|
12029
|
-
|
|
12021
|
+
}
|
|
12022
|
+
]
|
|
12023
|
+
});
|
|
12024
|
+
gaussianDownVPass.gaussianResult = gaussianDownResults[i];
|
|
12025
|
+
this.addRenderPass(gaussianDownHPass);
|
|
12026
|
+
this.addRenderPass(gaussianDownVPass);
|
|
12027
|
+
viewport[2] /= 2;
|
|
12028
|
+
viewport[3] /= 2;
|
|
12029
|
+
// TODO 限制最大迭代
|
|
12030
|
+
}
|
|
12031
|
+
viewport[2] *= 4;
|
|
12032
|
+
viewport[3] *= 4;
|
|
12033
|
+
for(var i1 = 0; i1 < gaussianStep - 1; i1++){
|
|
12034
|
+
var gaussianUpPass = new HQGaussianUpSamplePass(renderer, {
|
|
12035
|
+
name: "GaussianUpPass" + i1,
|
|
12036
|
+
viewport: viewport,
|
|
12037
|
+
attachments: [
|
|
12038
|
+
{
|
|
12039
|
+
texture: {
|
|
12040
|
+
format: glContext.RGBA,
|
|
12041
|
+
type: textureType1,
|
|
12042
|
+
minFilter: glContext.LINEAR,
|
|
12043
|
+
magFilter: glContext.LINEAR
|
|
12030
12044
|
}
|
|
12031
|
-
|
|
12032
|
-
|
|
12033
|
-
|
|
12034
|
-
|
|
12035
|
-
|
|
12036
|
-
|
|
12037
|
-
|
|
12038
|
-
}
|
|
12039
|
-
var postProcessPass;
|
|
12040
|
-
if (useBloom) {
|
|
12041
|
-
postProcessPass = new ToneMappingPass(renderer, sceneTextureHandle);
|
|
12042
|
-
} else {
|
|
12043
|
-
postProcessPass = new ToneMappingPass(renderer);
|
|
12045
|
+
}
|
|
12046
|
+
]
|
|
12047
|
+
});
|
|
12048
|
+
gaussianUpPass.gaussianDownSampleResult = gaussianDownResults[gaussianStep - 2 - i1];
|
|
12049
|
+
this.addRenderPass(gaussianUpPass);
|
|
12050
|
+
viewport[2] *= 2;
|
|
12051
|
+
viewport[3] *= 2;
|
|
12044
12052
|
}
|
|
12053
|
+
var postProcessPass = new ToneMappingPass(renderer, sceneTextureHandle);
|
|
12045
12054
|
this.addRenderPass(postProcessPass);
|
|
12046
12055
|
}
|
|
12047
12056
|
this.semantics = new SemanticMap(options.semantics);
|
|
@@ -13078,6 +13087,7 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
13078
13087
|
1
|
|
13079
13088
|
];
|
|
13080
13089
|
/** 是否响应点击和拖拽交互事件 */ _this._interactive = true;
|
|
13090
|
+
_this.hasBeenAddedToComposition = false;
|
|
13081
13091
|
_this.getHitTestParams = function(force) {
|
|
13082
13092
|
if (!_this.clickable) {
|
|
13083
13093
|
return;
|
|
@@ -13096,7 +13106,6 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
13096
13106
|
}
|
|
13097
13107
|
var _proto = InteractComponent.prototype;
|
|
13098
13108
|
_proto.start = function start() {
|
|
13099
|
-
var _this = this;
|
|
13100
13109
|
var options = this.item.props.content.options;
|
|
13101
13110
|
var env = this.item.engine.renderer.env;
|
|
13102
13111
|
var composition = this.item.composition;
|
|
@@ -13108,10 +13117,6 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
13108
13117
|
this.previewContent = new InteractMesh(this.item.props.content, rendererOptions, this.transform, this.engine);
|
|
13109
13118
|
}
|
|
13110
13119
|
}
|
|
13111
|
-
composition.addInteractiveItem(this.item, options.type);
|
|
13112
|
-
this.item.onEnd = function() {
|
|
13113
|
-
return composition.removeInteractiveItem(_this.item, options.type);
|
|
13114
|
-
};
|
|
13115
13120
|
if (options.type === InteractType.DRAG) {
|
|
13116
13121
|
if (env !== PLAYER_OPTIONS_ENV_EDITOR || options.enableInEditor) {
|
|
13117
13122
|
composition.event && this.beginDragTarget(options, composition.event);
|
|
@@ -13126,6 +13131,11 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
13126
13131
|
_proto.update = function update(dt) {
|
|
13127
13132
|
var _this_previewContent;
|
|
13128
13133
|
(_this_previewContent = this.previewContent) == null ? void 0 : _this_previewContent.updateMesh();
|
|
13134
|
+
if (!this.hasBeenAddedToComposition && this.item.composition) {
|
|
13135
|
+
var options = this.item.props.content.options;
|
|
13136
|
+
this.item.composition.addInteractiveItem(this.item, options.type);
|
|
13137
|
+
this.hasBeenAddedToComposition = true;
|
|
13138
|
+
}
|
|
13129
13139
|
if (!this.dragEvent || !this.bouncingArg) {
|
|
13130
13140
|
return;
|
|
13131
13141
|
}
|
|
@@ -14849,8 +14859,7 @@ var RectangleEdge = /*#__PURE__*/ function() {
|
|
|
14849
14859
|
}();
|
|
14850
14860
|
var Edge = /*#__PURE__*/ function() {
|
|
14851
14861
|
function Edge(args) {
|
|
14852
|
-
|
|
14853
|
-
this._d = (args.width || 1) / 2;
|
|
14862
|
+
this._d = args.width || 1;
|
|
14854
14863
|
this.arcMode = args.arcMode;
|
|
14855
14864
|
}
|
|
14856
14865
|
var _proto = Edge.prototype;
|
|
@@ -16616,7 +16625,7 @@ var ParticleSystem = /*#__PURE__*/ function(Component) {
|
|
|
16616
16625
|
}
|
|
16617
16626
|
}
|
|
16618
16627
|
}
|
|
16619
|
-
} else if (this.item.endBehavior ===
|
|
16628
|
+
} else if (this.item.endBehavior === EndBehavior.restart) {
|
|
16620
16629
|
updateTrail();
|
|
16621
16630
|
this.loopStartTime = now - duration;
|
|
16622
16631
|
this.lastEmitTime -= duration;
|
|
@@ -16635,12 +16644,12 @@ var ParticleSystem = /*#__PURE__*/ function(Component) {
|
|
|
16635
16644
|
this.ended = true;
|
|
16636
16645
|
this.onEnd(this);
|
|
16637
16646
|
var endBehavior = this.item.endBehavior;
|
|
16638
|
-
if (endBehavior ===
|
|
16647
|
+
if (endBehavior === EndBehavior.freeze) {
|
|
16639
16648
|
this.frozen = true;
|
|
16640
16649
|
}
|
|
16641
16650
|
}
|
|
16642
|
-
} else if (this.item.endBehavior !==
|
|
16643
|
-
if (
|
|
16651
|
+
} else if (this.item.endBehavior !== EndBehavior.restart) {
|
|
16652
|
+
if (EndBehavior.destroy === this.item.endBehavior) {
|
|
16644
16653
|
var node = link.last;
|
|
16645
16654
|
if (node && node.content[0] < this.lastUpdate) {
|
|
16646
16655
|
this.destroyed = true;
|
|
@@ -18720,9 +18729,9 @@ var AnimationClipPlayable = /*#__PURE__*/ function(Playable) {
|
|
|
18720
18729
|
var localTime = time - this.start;
|
|
18721
18730
|
var duration = this.duration;
|
|
18722
18731
|
if (localTime - duration > 0.001) {
|
|
18723
|
-
if (this.endBehavior ===
|
|
18732
|
+
if (this.endBehavior === EndBehavior.restart) {
|
|
18724
18733
|
localTime = localTime % duration;
|
|
18725
|
-
} else if (this.endBehavior ===
|
|
18734
|
+
} else if (this.endBehavior === EndBehavior.freeze) {
|
|
18726
18735
|
localTime = Math.min(duration, localTime);
|
|
18727
18736
|
}
|
|
18728
18737
|
}
|
|
@@ -18848,7 +18857,7 @@ var RuntimeClip = /*#__PURE__*/ function() {
|
|
|
18848
18857
|
var ended = false;
|
|
18849
18858
|
var started = false;
|
|
18850
18859
|
var boundObject = this.track.binding;
|
|
18851
|
-
if (localTime > clip.start + clip.duration + 0.001 && clip.endBehavior ===
|
|
18860
|
+
if (localTime > clip.start + clip.duration + 0.001 && clip.endBehavior === EndBehavior.destroy) {
|
|
18852
18861
|
if (_instanceof1(boundObject, VFXItem) && VFXItem.isParticle(boundObject) && this.particleSystem && !this.particleSystem.destroyed) {
|
|
18853
18862
|
weight = 1.0;
|
|
18854
18863
|
} else {
|
|
@@ -19156,7 +19165,7 @@ function compareTracks(a, b) {
|
|
|
19156
19165
|
this.resolveBindings();
|
|
19157
19166
|
this.timelinePlayable = this.timelineAsset.createPlayable(this.graph);
|
|
19158
19167
|
// 重播不销毁元素
|
|
19159
|
-
if (this.item.endBehavior !==
|
|
19168
|
+
if (this.item.endBehavior !== EndBehavior.destroy) {
|
|
19160
19169
|
this.setReusable(true);
|
|
19161
19170
|
}
|
|
19162
19171
|
};
|
|
@@ -19223,7 +19232,7 @@ function compareTracks(a, b) {
|
|
|
19223
19232
|
compositionComponent.refId = refId;
|
|
19224
19233
|
item.transform.parentTransform = this.transform;
|
|
19225
19234
|
this.item.composition.refContent.push(item);
|
|
19226
|
-
if (item.endBehavior ===
|
|
19235
|
+
if (item.endBehavior === EndBehavior.restart) {
|
|
19227
19236
|
this.item.composition.autoRefTex = false;
|
|
19228
19237
|
}
|
|
19229
19238
|
compositionComponent.createContent();
|
|
@@ -20175,6 +20184,105 @@ function geometryToTriangles(geometry) {
|
|
|
20175
20184
|
return res;
|
|
20176
20185
|
}
|
|
20177
20186
|
|
|
20187
|
+
var PostProcessVolume = /*#__PURE__*/ function(ItemBehaviour) {
|
|
20188
|
+
_inherits(PostProcessVolume, ItemBehaviour);
|
|
20189
|
+
function PostProcessVolume() {
|
|
20190
|
+
var _this;
|
|
20191
|
+
_this = ItemBehaviour.apply(this, arguments) || this;
|
|
20192
|
+
_this.useHDR = true;
|
|
20193
|
+
// Bloom
|
|
20194
|
+
_this.useBloom = true;
|
|
20195
|
+
_this.threshold = 1.0;
|
|
20196
|
+
_this.bloomIntensity = 1.0;
|
|
20197
|
+
// ColorAdjustments
|
|
20198
|
+
_this.brightness = 1.0;
|
|
20199
|
+
_this.saturation = 1.0;
|
|
20200
|
+
_this.contrast = 1.0;
|
|
20201
|
+
// Vignette
|
|
20202
|
+
_this.vignetteIntensity = 0.2;
|
|
20203
|
+
_this.vignetteSmoothness = 0.4;
|
|
20204
|
+
_this.vignetteRoundness = 1.0;
|
|
20205
|
+
// ToneMapping
|
|
20206
|
+
_this.useToneMapping = true // 1: true, 0: false
|
|
20207
|
+
;
|
|
20208
|
+
return _this;
|
|
20209
|
+
}
|
|
20210
|
+
var _proto = PostProcessVolume.prototype;
|
|
20211
|
+
_proto.start = function start() {
|
|
20212
|
+
var composition = this.item.composition;
|
|
20213
|
+
if (composition) {
|
|
20214
|
+
composition.globalVolume = {
|
|
20215
|
+
useHDR: this.useHDR,
|
|
20216
|
+
useBloom: this.useBloom,
|
|
20217
|
+
threshold: this.threshold,
|
|
20218
|
+
bloomIntensity: this.bloomIntensity,
|
|
20219
|
+
brightness: this.brightness,
|
|
20220
|
+
saturation: this.saturation,
|
|
20221
|
+
contrast: this.contrast,
|
|
20222
|
+
vignetteIntensity: this.vignetteIntensity,
|
|
20223
|
+
vignetteSmoothness: this.vignetteSmoothness,
|
|
20224
|
+
vignetteRoundness: this.vignetteRoundness,
|
|
20225
|
+
useToneMapping: this.useToneMapping
|
|
20226
|
+
};
|
|
20227
|
+
composition.createRenderFrame();
|
|
20228
|
+
}
|
|
20229
|
+
};
|
|
20230
|
+
_proto.update = function update(dt) {
|
|
20231
|
+
var composition = this.item.composition;
|
|
20232
|
+
if (composition) {
|
|
20233
|
+
var globalVolume = composition.renderFrame.globalVolume;
|
|
20234
|
+
globalVolume.useHDR = this.useHDR;
|
|
20235
|
+
globalVolume.useBloom = this.useBloom;
|
|
20236
|
+
globalVolume.threshold = this.threshold;
|
|
20237
|
+
globalVolume.bloomIntensity = this.bloomIntensity;
|
|
20238
|
+
globalVolume.brightness = this.brightness;
|
|
20239
|
+
globalVolume.saturation = this.saturation;
|
|
20240
|
+
globalVolume.contrast = this.contrast;
|
|
20241
|
+
globalVolume.vignetteIntensity = this.vignetteIntensity;
|
|
20242
|
+
globalVolume.vignetteSmoothness = this.vignetteSmoothness;
|
|
20243
|
+
globalVolume.vignetteRoundness = this.vignetteRoundness;
|
|
20244
|
+
globalVolume.useToneMapping = this.useToneMapping;
|
|
20245
|
+
}
|
|
20246
|
+
};
|
|
20247
|
+
return PostProcessVolume;
|
|
20248
|
+
}(ItemBehaviour);
|
|
20249
|
+
__decorate([
|
|
20250
|
+
serialize()
|
|
20251
|
+
], PostProcessVolume.prototype, "useHDR", void 0);
|
|
20252
|
+
__decorate([
|
|
20253
|
+
serialize()
|
|
20254
|
+
], PostProcessVolume.prototype, "useBloom", void 0);
|
|
20255
|
+
__decorate([
|
|
20256
|
+
serialize()
|
|
20257
|
+
], PostProcessVolume.prototype, "threshold", void 0);
|
|
20258
|
+
__decorate([
|
|
20259
|
+
serialize()
|
|
20260
|
+
], PostProcessVolume.prototype, "bloomIntensity", void 0);
|
|
20261
|
+
__decorate([
|
|
20262
|
+
serialize()
|
|
20263
|
+
], PostProcessVolume.prototype, "brightness", void 0);
|
|
20264
|
+
__decorate([
|
|
20265
|
+
serialize()
|
|
20266
|
+
], PostProcessVolume.prototype, "saturation", void 0);
|
|
20267
|
+
__decorate([
|
|
20268
|
+
serialize()
|
|
20269
|
+
], PostProcessVolume.prototype, "contrast", void 0);
|
|
20270
|
+
__decorate([
|
|
20271
|
+
serialize()
|
|
20272
|
+
], PostProcessVolume.prototype, "vignetteIntensity", void 0);
|
|
20273
|
+
__decorate([
|
|
20274
|
+
serialize()
|
|
20275
|
+
], PostProcessVolume.prototype, "vignetteSmoothness", void 0);
|
|
20276
|
+
__decorate([
|
|
20277
|
+
serialize()
|
|
20278
|
+
], PostProcessVolume.prototype, "vignetteRoundness", void 0);
|
|
20279
|
+
__decorate([
|
|
20280
|
+
serialize()
|
|
20281
|
+
], PostProcessVolume.prototype, "useToneMapping", void 0);
|
|
20282
|
+
PostProcessVolume = __decorate([
|
|
20283
|
+
effectsClass("PostProcessVolume")
|
|
20284
|
+
], PostProcessVolume);
|
|
20285
|
+
|
|
20178
20286
|
var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
20179
20287
|
_inherits(VFXItem, EffectsObject);
|
|
20180
20288
|
function VFXItem(engine, props) {
|
|
@@ -20398,7 +20506,7 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
20398
20506
|
/**
|
|
20399
20507
|
* 获取元素用于计算光线投射的面片类型和参数
|
|
20400
20508
|
* @override
|
|
20401
|
-
* @param force 元素没有开启交互也返回参数
|
|
20509
|
+
* @param force - 元素没有开启交互也返回参数
|
|
20402
20510
|
*/ _proto.getHitTestParams = function getHitTestParams(force) {
|
|
20403
20511
|
// OVERRIDE
|
|
20404
20512
|
};
|
|
@@ -20648,42 +20756,6 @@ var Item;
|
|
|
20648
20756
|
}
|
|
20649
20757
|
Item.isNull = isNull;
|
|
20650
20758
|
})(Item || (Item = {}));
|
|
20651
|
-
/**
|
|
20652
|
-
* (待废弃) 根据元素的类型创建对应的 `VFXItem` 实例
|
|
20653
|
-
* @param props
|
|
20654
|
-
* @param composition
|
|
20655
|
-
*/ function createVFXItem(props, composition) {
|
|
20656
|
-
var type = props.type;
|
|
20657
|
-
var pluginName = props.pluginName;
|
|
20658
|
-
if (!pluginName) {
|
|
20659
|
-
switch(type){
|
|
20660
|
-
case ItemType.null:
|
|
20661
|
-
pluginName = "cal";
|
|
20662
|
-
break;
|
|
20663
|
-
case ItemType.sprite:
|
|
20664
|
-
pluginName = "sprite";
|
|
20665
|
-
break;
|
|
20666
|
-
case ItemType.particle:
|
|
20667
|
-
pluginName = "particle";
|
|
20668
|
-
break;
|
|
20669
|
-
case ItemType.interact:
|
|
20670
|
-
pluginName = "interact";
|
|
20671
|
-
break;
|
|
20672
|
-
case ItemType.camera:
|
|
20673
|
-
pluginName = "camera";
|
|
20674
|
-
break;
|
|
20675
|
-
case ItemType.text:
|
|
20676
|
-
pluginName = "text";
|
|
20677
|
-
break;
|
|
20678
|
-
case ItemType.tree:
|
|
20679
|
-
pluginName = "tree";
|
|
20680
|
-
break;
|
|
20681
|
-
default:
|
|
20682
|
-
throw new Error("Invalid vfx item type.");
|
|
20683
|
-
}
|
|
20684
|
-
}
|
|
20685
|
-
return composition.pluginSystem.createPluginItem(pluginName, props, composition);
|
|
20686
|
-
}
|
|
20687
20759
|
|
|
20688
20760
|
var pluginLoaderMap = {};
|
|
20689
20761
|
var defaultPlugins = [];
|
|
@@ -20696,6 +20768,9 @@ var pluginCtrlMap = {};
|
|
|
20696
20768
|
* @param isDefault load
|
|
20697
20769
|
*/ // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
20698
20770
|
function registerPlugin(name, pluginClass, itemClass, isDefault) {
|
|
20771
|
+
if (pluginCtrlMap[name]) {
|
|
20772
|
+
logger.error("Duplicate registration for plugin " + name + ".");
|
|
20773
|
+
}
|
|
20699
20774
|
pluginCtrlMap[name] = itemClass;
|
|
20700
20775
|
pluginLoaderMap[name] = pluginClass;
|
|
20701
20776
|
if (isDefault) {
|
|
@@ -21274,8 +21349,8 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
21274
21349
|
if (this.engine.objectInstance[guid]) {
|
|
21275
21350
|
return this.engine.objectInstance[guid];
|
|
21276
21351
|
}
|
|
21277
|
-
var effectsObject;
|
|
21278
21352
|
var effectsObjectData = this.findData(guid);
|
|
21353
|
+
var effectsObject;
|
|
21279
21354
|
if (!effectsObjectData) {
|
|
21280
21355
|
console.error("Object data with uuid: " + guid + " not found.");
|
|
21281
21356
|
return undefined;
|
|
@@ -21311,7 +21386,7 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
21311
21386
|
_proto.loadGUIDAsync = function loadGUIDAsync(guid) {
|
|
21312
21387
|
var _this = this;
|
|
21313
21388
|
return _async_to_generator(function() {
|
|
21314
|
-
var
|
|
21389
|
+
var effectsObjectData, effectsObject, classConstructor;
|
|
21315
21390
|
return __generator(this, function(_state) {
|
|
21316
21391
|
switch(_state.label){
|
|
21317
21392
|
case 0:
|
|
@@ -22205,8 +22280,8 @@ function getStandardCameraContent(model) {
|
|
|
22205
22280
|
json.compositions.forEach(function(composition) {
|
|
22206
22281
|
composition.items.forEach(function(item) {
|
|
22207
22282
|
if (item.type === ItemType.null) {
|
|
22208
|
-
if (item.endBehavior ===
|
|
22209
|
-
item.endBehavior =
|
|
22283
|
+
if (item.endBehavior === EndBehavior.destroy) {
|
|
22284
|
+
item.endBehavior = EndBehavior.freeze;
|
|
22210
22285
|
}
|
|
22211
22286
|
}
|
|
22212
22287
|
});
|
|
@@ -22225,7 +22300,7 @@ function getStandardCameraContent(model) {
|
|
|
22225
22300
|
json.compositions.forEach(function(composition) {
|
|
22226
22301
|
composition.items.forEach(function(item) {
|
|
22227
22302
|
if (item.type === ItemType.mesh || item.type === ItemType.light) {
|
|
22228
|
-
item.endBehavior = item.endBehavior === 1 ?
|
|
22303
|
+
item.endBehavior = item.endBehavior === 1 ? EndBehavior.destroy : item.endBehavior;
|
|
22229
22304
|
}
|
|
22230
22305
|
});
|
|
22231
22306
|
});
|
|
@@ -22237,7 +22312,11 @@ function getStandardCameraContent(model) {
|
|
|
22237
22312
|
var _loop = function() {
|
|
22238
22313
|
var composition = _step1.value;
|
|
22239
22314
|
// composition 的 endBehavior 兼容
|
|
22240
|
-
if (
|
|
22315
|
+
if (// @ts-expect-error
|
|
22316
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
|
|
22317
|
+
composition.endBehavior === END_BEHAVIOR_PAUSE_AND_DESTROY || // @ts-expect-error
|
|
22318
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
|
|
22319
|
+
composition.endBehavior === END_BEHAVIOR_PAUSE) {
|
|
22241
22320
|
composition.endBehavior = END_BEHAVIOR_FREEZE;
|
|
22242
22321
|
}
|
|
22243
22322
|
// 过滤掉滤镜元素
|
|
@@ -23024,13 +23103,13 @@ function getStandardItem(item, opt) {
|
|
|
23024
23103
|
var looping = (_originContent_options = originContent.options) == null ? void 0 : _originContent_options.looping;
|
|
23025
23104
|
if (looping) {
|
|
23026
23105
|
if (Array.isArray(looping)) {
|
|
23027
|
-
endBehavior = looping[1] ?
|
|
23106
|
+
endBehavior = looping[1] ? EndBehavior.restart : EndBehavior.destroy;
|
|
23028
23107
|
} else {
|
|
23029
|
-
endBehavior =
|
|
23108
|
+
endBehavior = EndBehavior.restart;
|
|
23030
23109
|
}
|
|
23031
23110
|
} else {
|
|
23032
23111
|
var _originContent_options1;
|
|
23033
|
-
endBehavior = endBehavior || (originContent == null ? void 0 : (_originContent_options1 = originContent.options) == null ? void 0 : _originContent_options1.endBehavior) ||
|
|
23112
|
+
endBehavior = endBehavior || (originContent == null ? void 0 : (_originContent_options1 = originContent.options) == null ? void 0 : _originContent_options1.endBehavior) || EndBehavior.destroy;
|
|
23034
23113
|
}
|
|
23035
23114
|
if (originContent.options.renderLevel) {
|
|
23036
23115
|
renderLevel = originContent.options.renderLevel;
|
|
@@ -23572,14 +23651,6 @@ var seed = 1;
|
|
|
23572
23651
|
case 0:
|
|
23573
23652
|
// TODO: 后面切换到新的数据版本,就不用掉用 getStandardJSON 做转换了
|
|
23574
23653
|
jsonScene = getStandardJSON(json);
|
|
23575
|
-
// FIXME: hack globalVolume,specification 更新后需移除
|
|
23576
|
-
// @ts-expect-error
|
|
23577
|
-
json.compositions.forEach(function(composition, i) {
|
|
23578
|
-
if (composition.globalVolume) {
|
|
23579
|
-
// @ts-expect-error
|
|
23580
|
-
jsonScene.compositions[i].globalVolume = composition.globalVolume;
|
|
23581
|
-
}
|
|
23582
|
-
});
|
|
23583
23654
|
_jsonScene_plugins = jsonScene.plugins, plugins = _jsonScene_plugins === void 0 ? [] : _jsonScene_plugins, sceneCompositions = jsonScene.compositions, imgUsage = jsonScene.imgUsage, images = jsonScene.images;
|
|
23584
23655
|
pluginSystem = new PluginSystem(plugins);
|
|
23585
23656
|
return [
|
|
@@ -24367,20 +24438,17 @@ var listOrder = 0;
|
|
|
24367
24438
|
}
|
|
24368
24439
|
var _proto = CompositionSourceManager.prototype;
|
|
24369
24440
|
_proto.getContent = function getContent(composition) {
|
|
24370
|
-
|
|
24371
|
-
// @ts-expect-error
|
|
24372
|
-
var id = composition.id, duration = composition.duration, name = composition.name, endBehavior = composition.endBehavior, camera = composition.camera, globalVolume = composition.globalVolume, _composition_startTime = composition.startTime, startTime = _composition_startTime === void 0 ? 0 : _composition_startTime;
|
|
24441
|
+
var id = composition.id, duration = composition.duration, name = composition.name, endBehavior = composition.endBehavior, camera = composition.camera, _composition_startTime = composition.startTime, startTime = _composition_startTime === void 0 ? 0 : _composition_startTime;
|
|
24373
24442
|
var items = this.assembleItems(composition);
|
|
24374
24443
|
return _extends({}, composition, {
|
|
24375
24444
|
id: id,
|
|
24376
24445
|
duration: duration,
|
|
24377
24446
|
name: name,
|
|
24378
|
-
endBehavior: isNaN(endBehavior) ?
|
|
24447
|
+
endBehavior: isNaN(endBehavior) ? EndBehavior.freeze : endBehavior,
|
|
24379
24448
|
// looping,
|
|
24380
24449
|
items: items,
|
|
24381
24450
|
camera: camera,
|
|
24382
|
-
startTime: startTime
|
|
24383
|
-
globalVolume: globalVolume
|
|
24451
|
+
startTime: startTime
|
|
24384
24452
|
});
|
|
24385
24453
|
};
|
|
24386
24454
|
_proto.assembleItems = function assembleItems(composition) {
|
|
@@ -24542,7 +24610,6 @@ var listOrder = 0;
|
|
|
24542
24610
|
this.rootComposition = this.rootItem.addComponent(CompositionComponent);
|
|
24543
24611
|
this.rootComposition.data = sourceContent;
|
|
24544
24612
|
var imageUsage = !reusable && imgUsage;
|
|
24545
|
-
this.globalVolume = sourceContent.globalVolume;
|
|
24546
24613
|
this.width = width;
|
|
24547
24614
|
this.height = height;
|
|
24548
24615
|
this.renderOrder = baseRenderOrder;
|
|
@@ -24559,7 +24626,7 @@ var listOrder = 0;
|
|
|
24559
24626
|
};
|
|
24560
24627
|
this.reusable = reusable;
|
|
24561
24628
|
this.speed = speed;
|
|
24562
|
-
this.autoRefTex = !this.keepResource && imageUsage && this.rootItem.endBehavior !==
|
|
24629
|
+
this.autoRefTex = !this.keepResource && imageUsage && this.rootItem.endBehavior !== EndBehavior.restart;
|
|
24563
24630
|
this.name = sourceContent.name;
|
|
24564
24631
|
this.pluginSystem = pluginSystem;
|
|
24565
24632
|
this.pluginSystem.initializeComposition(this, scene);
|
|
@@ -24759,7 +24826,7 @@ var listOrder = 0;
|
|
|
24759
24826
|
* @returns 重新播放合成标志位
|
|
24760
24827
|
*/ _proto.shouldRestart = function shouldRestart() {
|
|
24761
24828
|
var _this_rootItem = this.rootItem, ended = _this_rootItem.ended, endBehavior = _this_rootItem.endBehavior;
|
|
24762
|
-
return ended && endBehavior ===
|
|
24829
|
+
return ended && endBehavior === EndBehavior.restart;
|
|
24763
24830
|
};
|
|
24764
24831
|
/**
|
|
24765
24832
|
* 是否合成需要销毁
|
|
@@ -24812,9 +24879,9 @@ var listOrder = 0;
|
|
|
24812
24879
|
var localTime = time - this.rootItem.start;
|
|
24813
24880
|
var duration = this.rootItem.duration;
|
|
24814
24881
|
if (localTime - duration > 0.001) {
|
|
24815
|
-
if (this.rootItem.endBehavior ===
|
|
24882
|
+
if (this.rootItem.endBehavior === EndBehavior.restart) {
|
|
24816
24883
|
localTime = localTime % duration;
|
|
24817
|
-
} else if (this.rootItem.endBehavior ===
|
|
24884
|
+
} else if (this.rootItem.endBehavior === EndBehavior.freeze) {
|
|
24818
24885
|
localTime = Math.min(duration, localTime);
|
|
24819
24886
|
}
|
|
24820
24887
|
}
|
|
@@ -24865,7 +24932,7 @@ var listOrder = 0;
|
|
|
24865
24932
|
for(var _iterator2 = _create_for_of_iterator_helper_loose(item.children), _step2; !(_step2 = _iterator2()).done;){
|
|
24866
24933
|
var child = _step2.value;
|
|
24867
24934
|
if (VFXItem.isComposition(child)) {
|
|
24868
|
-
if (child.ended && child.endBehavior ===
|
|
24935
|
+
if (child.ended && child.endBehavior === EndBehavior.restart) {
|
|
24869
24936
|
child.ended = false;
|
|
24870
24937
|
// TODO K帧动画在元素重建后需要 tick ,否则会导致元素位置和 k 帧第一帧位置不一致
|
|
24871
24938
|
this.callUpdate(child, 0);
|
|
@@ -25076,7 +25143,7 @@ var listOrder = 0;
|
|
|
25076
25143
|
var _this = this;
|
|
25077
25144
|
// 预合成元素销毁时销毁其中的item
|
|
25078
25145
|
if (item.type == ItemType.composition) {
|
|
25079
|
-
if (item.endBehavior !==
|
|
25146
|
+
if (item.endBehavior !== EndBehavior.freeze) {
|
|
25080
25147
|
var contentItems = item.getComponent(CompositionComponent).items;
|
|
25081
25148
|
contentItems.forEach(function(it) {
|
|
25082
25149
|
return _this.pluginSystem.plugins.forEach(function(loader) {
|
|
@@ -25335,65 +25402,1628 @@ var listOrder = 0;
|
|
|
25335
25402
|
return Composition;
|
|
25336
25403
|
}();
|
|
25337
25404
|
|
|
25338
|
-
|
|
25339
|
-
|
|
25340
|
-
|
|
25341
|
-
|
|
25342
|
-
|
|
25343
|
-
|
|
25344
|
-
|
|
25345
|
-
|
|
25346
|
-
|
|
25347
|
-
|
|
25348
|
-
|
|
25349
|
-
|
|
25350
|
-
|
|
25351
|
-
|
|
25352
|
-
|
|
25353
|
-
|
|
25354
|
-
|
|
25355
|
-
|
|
25405
|
+
var SIZEOF_SHORT = 2;
|
|
25406
|
+
var SIZEOF_INT = 4;
|
|
25407
|
+
var FILE_IDENTIFIER_LENGTH = 4;
|
|
25408
|
+
var SIZE_PREFIX_LENGTH = 4;
|
|
25409
|
+
|
|
25410
|
+
var int32 = new Int32Array(2);
|
|
25411
|
+
var float32 = new Float32Array(int32.buffer);
|
|
25412
|
+
var float64 = new Float64Array(int32.buffer);
|
|
25413
|
+
var isLittleEndian = new Uint16Array(new Uint8Array([
|
|
25414
|
+
1,
|
|
25415
|
+
0
|
|
25416
|
+
]).buffer)[0] === 1;
|
|
25417
|
+
|
|
25418
|
+
var Encoding;
|
|
25419
|
+
(function(Encoding) {
|
|
25420
|
+
Encoding[Encoding["UTF8_BYTES"] = 1] = "UTF8_BYTES";
|
|
25421
|
+
Encoding[Encoding["UTF16_STRING"] = 2] = "UTF16_STRING";
|
|
25422
|
+
})(Encoding || (Encoding = {}));
|
|
25423
|
+
|
|
25424
|
+
var ByteBuffer = /*#__PURE__*/ function() {
|
|
25425
|
+
function ByteBuffer(bytes_) {
|
|
25426
|
+
this.bytes_ = bytes_;
|
|
25427
|
+
this.position_ = 0;
|
|
25428
|
+
this.text_decoder_ = new TextDecoder();
|
|
25356
25429
|
}
|
|
25357
|
-
var _proto =
|
|
25358
|
-
_proto.
|
|
25359
|
-
this.
|
|
25360
|
-
this.objectInstance = {};
|
|
25430
|
+
var _proto = ByteBuffer.prototype;
|
|
25431
|
+
_proto.clear = function clear() {
|
|
25432
|
+
this.position_ = 0;
|
|
25361
25433
|
};
|
|
25362
|
-
|
|
25363
|
-
|
|
25434
|
+
/**
|
|
25435
|
+
* Get the underlying `Uint8Array`.
|
|
25436
|
+
*/ _proto.bytes = function bytes() {
|
|
25437
|
+
return this.bytes_;
|
|
25364
25438
|
};
|
|
25365
|
-
|
|
25366
|
-
|
|
25439
|
+
/**
|
|
25440
|
+
* Get the buffer's position.
|
|
25441
|
+
*/ _proto.position = function position() {
|
|
25442
|
+
return this.position_;
|
|
25367
25443
|
};
|
|
25368
|
-
|
|
25369
|
-
|
|
25444
|
+
/**
|
|
25445
|
+
* Set the buffer's position.
|
|
25446
|
+
*/ _proto.setPosition = function setPosition(position) {
|
|
25447
|
+
this.position_ = position;
|
|
25370
25448
|
};
|
|
25371
|
-
|
|
25372
|
-
|
|
25449
|
+
/**
|
|
25450
|
+
* Get the buffer's capacity.
|
|
25451
|
+
*/ _proto.capacity = function capacity() {
|
|
25452
|
+
return this.bytes_.length;
|
|
25373
25453
|
};
|
|
25374
|
-
_proto.
|
|
25375
|
-
|
|
25454
|
+
_proto.readInt8 = function readInt8(offset) {
|
|
25455
|
+
return this.readUint8(offset) << 24 >> 24;
|
|
25376
25456
|
};
|
|
25377
|
-
_proto.
|
|
25378
|
-
|
|
25379
|
-
|
|
25380
|
-
|
|
25381
|
-
|
|
25382
|
-
|
|
25383
|
-
|
|
25384
|
-
|
|
25385
|
-
|
|
25386
|
-
|
|
25457
|
+
_proto.readUint8 = function readUint8(offset) {
|
|
25458
|
+
return this.bytes_[offset];
|
|
25459
|
+
};
|
|
25460
|
+
_proto.readInt16 = function readInt16(offset) {
|
|
25461
|
+
return this.readUint16(offset) << 16 >> 16;
|
|
25462
|
+
};
|
|
25463
|
+
_proto.readUint16 = function readUint16(offset) {
|
|
25464
|
+
return this.bytes_[offset] | this.bytes_[offset + 1] << 8;
|
|
25465
|
+
};
|
|
25466
|
+
_proto.readInt32 = function readInt32(offset) {
|
|
25467
|
+
return this.bytes_[offset] | this.bytes_[offset + 1] << 8 | this.bytes_[offset + 2] << 16 | this.bytes_[offset + 3] << 24;
|
|
25468
|
+
};
|
|
25469
|
+
_proto.readUint32 = function readUint32(offset) {
|
|
25470
|
+
return this.readInt32(offset) >>> 0;
|
|
25471
|
+
};
|
|
25472
|
+
_proto.readInt64 = function readInt64(offset) {
|
|
25473
|
+
return BigInt.asIntN(64, BigInt(this.readUint32(offset)) + (BigInt(this.readUint32(offset + 4)) << BigInt(32)));
|
|
25474
|
+
};
|
|
25475
|
+
_proto.readUint64 = function readUint64(offset) {
|
|
25476
|
+
return BigInt.asUintN(64, BigInt(this.readUint32(offset)) + (BigInt(this.readUint32(offset + 4)) << BigInt(32)));
|
|
25477
|
+
};
|
|
25478
|
+
_proto.readFloat32 = function readFloat32(offset) {
|
|
25479
|
+
int32[0] = this.readInt32(offset);
|
|
25480
|
+
return float32[0];
|
|
25481
|
+
};
|
|
25482
|
+
_proto.readFloat64 = function readFloat64(offset) {
|
|
25483
|
+
int32[isLittleEndian ? 0 : 1] = this.readInt32(offset);
|
|
25484
|
+
int32[isLittleEndian ? 1 : 0] = this.readInt32(offset + 4);
|
|
25485
|
+
return float64[0];
|
|
25486
|
+
};
|
|
25487
|
+
_proto.writeInt8 = function writeInt8(offset, value) {
|
|
25488
|
+
this.bytes_[offset] = value;
|
|
25489
|
+
};
|
|
25490
|
+
_proto.writeUint8 = function writeUint8(offset, value) {
|
|
25491
|
+
this.bytes_[offset] = value;
|
|
25492
|
+
};
|
|
25493
|
+
_proto.writeInt16 = function writeInt16(offset, value) {
|
|
25494
|
+
this.bytes_[offset] = value;
|
|
25495
|
+
this.bytes_[offset + 1] = value >> 8;
|
|
25496
|
+
};
|
|
25497
|
+
_proto.writeUint16 = function writeUint16(offset, value) {
|
|
25498
|
+
this.bytes_[offset] = value;
|
|
25499
|
+
this.bytes_[offset + 1] = value >> 8;
|
|
25500
|
+
};
|
|
25501
|
+
_proto.writeInt32 = function writeInt32(offset, value) {
|
|
25502
|
+
this.bytes_[offset] = value;
|
|
25503
|
+
this.bytes_[offset + 1] = value >> 8;
|
|
25504
|
+
this.bytes_[offset + 2] = value >> 16;
|
|
25505
|
+
this.bytes_[offset + 3] = value >> 24;
|
|
25506
|
+
};
|
|
25507
|
+
_proto.writeUint32 = function writeUint32(offset, value) {
|
|
25508
|
+
this.bytes_[offset] = value;
|
|
25509
|
+
this.bytes_[offset + 1] = value >> 8;
|
|
25510
|
+
this.bytes_[offset + 2] = value >> 16;
|
|
25511
|
+
this.bytes_[offset + 3] = value >> 24;
|
|
25512
|
+
};
|
|
25513
|
+
_proto.writeInt64 = function writeInt64(offset, value) {
|
|
25514
|
+
this.writeInt32(offset, Number(BigInt.asIntN(32, value)));
|
|
25515
|
+
this.writeInt32(offset + 4, Number(BigInt.asIntN(32, value >> BigInt(32))));
|
|
25516
|
+
};
|
|
25517
|
+
_proto.writeUint64 = function writeUint64(offset, value) {
|
|
25518
|
+
this.writeUint32(offset, Number(BigInt.asUintN(32, value)));
|
|
25519
|
+
this.writeUint32(offset + 4, Number(BigInt.asUintN(32, value >> BigInt(32))));
|
|
25520
|
+
};
|
|
25521
|
+
_proto.writeFloat32 = function writeFloat32(offset, value) {
|
|
25522
|
+
float32[0] = value;
|
|
25523
|
+
this.writeInt32(offset, int32[0]);
|
|
25524
|
+
};
|
|
25525
|
+
_proto.writeFloat64 = function writeFloat64(offset, value) {
|
|
25526
|
+
float64[0] = value;
|
|
25527
|
+
this.writeInt32(offset, int32[isLittleEndian ? 0 : 1]);
|
|
25528
|
+
this.writeInt32(offset + 4, int32[isLittleEndian ? 1 : 0]);
|
|
25529
|
+
};
|
|
25530
|
+
/**
|
|
25531
|
+
* Return the file identifier. Behavior is undefined for FlatBuffers whose
|
|
25532
|
+
* schema does not include a file_identifier (likely points at padding or the
|
|
25533
|
+
* start of a the root vtable).
|
|
25534
|
+
*/ _proto.getBufferIdentifier = function getBufferIdentifier() {
|
|
25535
|
+
if (this.bytes_.length < this.position_ + SIZEOF_INT + FILE_IDENTIFIER_LENGTH) {
|
|
25536
|
+
throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");
|
|
25387
25537
|
}
|
|
25388
|
-
|
|
25389
|
-
|
|
25390
|
-
this.
|
|
25538
|
+
var result = "";
|
|
25539
|
+
for(var i = 0; i < FILE_IDENTIFIER_LENGTH; i++){
|
|
25540
|
+
result += String.fromCharCode(this.readInt8(this.position_ + SIZEOF_INT + i));
|
|
25391
25541
|
}
|
|
25392
|
-
|
|
25393
|
-
|
|
25394
|
-
|
|
25542
|
+
return result;
|
|
25543
|
+
};
|
|
25544
|
+
/**
|
|
25545
|
+
* Look up a field in the vtable, return an offset into the object, or 0 if the
|
|
25546
|
+
* field is not present.
|
|
25547
|
+
*/ _proto.__offset = function __offset(bb_pos, vtable_offset) {
|
|
25548
|
+
var vtable = bb_pos - this.readInt32(bb_pos);
|
|
25549
|
+
return vtable_offset < this.readInt16(vtable) ? this.readInt16(vtable + vtable_offset) : 0;
|
|
25550
|
+
};
|
|
25551
|
+
/**
|
|
25552
|
+
* Initialize any Table-derived type to point to the union at the given offset.
|
|
25553
|
+
*/ _proto.__union = function __union(t, offset) {
|
|
25554
|
+
t.bb_pos = offset + this.readInt32(offset);
|
|
25555
|
+
t.bb = this;
|
|
25556
|
+
return t;
|
|
25557
|
+
};
|
|
25558
|
+
/**
|
|
25559
|
+
* Create a JavaScript string from UTF-8 data stored inside the FlatBuffer.
|
|
25560
|
+
* This allocates a new string and converts to wide chars upon each access.
|
|
25561
|
+
*
|
|
25562
|
+
* To avoid the conversion to string, pass Encoding.UTF8_BYTES as the
|
|
25563
|
+
* "optionalEncoding" argument. This is useful for avoiding conversion when
|
|
25564
|
+
* the data will just be packaged back up in another FlatBuffer later on.
|
|
25565
|
+
*
|
|
25566
|
+
* @param offset
|
|
25567
|
+
* @param opt_encoding Defaults to UTF16_STRING
|
|
25568
|
+
*/ _proto.__string = function __string(offset, opt_encoding) {
|
|
25569
|
+
offset += this.readInt32(offset);
|
|
25570
|
+
var length = this.readInt32(offset);
|
|
25571
|
+
offset += SIZEOF_INT;
|
|
25572
|
+
var utf8bytes = this.bytes_.subarray(offset, offset + length);
|
|
25573
|
+
if (opt_encoding === Encoding.UTF8_BYTES) return utf8bytes;
|
|
25574
|
+
else return this.text_decoder_.decode(utf8bytes);
|
|
25575
|
+
};
|
|
25576
|
+
/**
|
|
25577
|
+
* Handle unions that can contain string as its member, if a Table-derived type then initialize it,
|
|
25578
|
+
* if a string then return a new one
|
|
25579
|
+
*
|
|
25580
|
+
* WARNING: strings are immutable in JS so we can't change the string that the user gave us, this
|
|
25581
|
+
* makes the behaviour of __union_with_string different compared to __union
|
|
25582
|
+
*/ _proto.__union_with_string = function __union_with_string(o, offset) {
|
|
25583
|
+
if (typeof o === "string") {
|
|
25584
|
+
return this.__string(offset);
|
|
25395
25585
|
}
|
|
25396
|
-
|
|
25586
|
+
return this.__union(o, offset);
|
|
25587
|
+
};
|
|
25588
|
+
/**
|
|
25589
|
+
* Retrieve the relative offset stored at "offset"
|
|
25590
|
+
*/ _proto.__indirect = function __indirect(offset) {
|
|
25591
|
+
return offset + this.readInt32(offset);
|
|
25592
|
+
};
|
|
25593
|
+
/**
|
|
25594
|
+
* Get the start of data of a vector whose offset is stored at "offset" in this object.
|
|
25595
|
+
*/ _proto.__vector = function __vector(offset) {
|
|
25596
|
+
return offset + this.readInt32(offset) + SIZEOF_INT; // data starts after the length
|
|
25597
|
+
};
|
|
25598
|
+
/**
|
|
25599
|
+
* Get the length of a vector whose offset is stored at "offset" in this object.
|
|
25600
|
+
*/ _proto.__vector_len = function __vector_len(offset) {
|
|
25601
|
+
return this.readInt32(offset + this.readInt32(offset));
|
|
25602
|
+
};
|
|
25603
|
+
_proto.__has_identifier = function __has_identifier(ident) {
|
|
25604
|
+
if (ident.length != FILE_IDENTIFIER_LENGTH) {
|
|
25605
|
+
throw new Error("FlatBuffers: file identifier must be length " + FILE_IDENTIFIER_LENGTH);
|
|
25606
|
+
}
|
|
25607
|
+
for(var i = 0; i < FILE_IDENTIFIER_LENGTH; i++){
|
|
25608
|
+
if (ident.charCodeAt(i) != this.readInt8(this.position() + SIZEOF_INT + i)) {
|
|
25609
|
+
return false;
|
|
25610
|
+
}
|
|
25611
|
+
}
|
|
25612
|
+
return true;
|
|
25613
|
+
};
|
|
25614
|
+
/**
|
|
25615
|
+
* A helper function for generating list for obj api
|
|
25616
|
+
*/ _proto.createScalarList = function createScalarList(listAccessor, listLength) {
|
|
25617
|
+
var ret = [];
|
|
25618
|
+
for(var i = 0; i < listLength; ++i){
|
|
25619
|
+
var val = listAccessor(i);
|
|
25620
|
+
if (val !== null) {
|
|
25621
|
+
ret.push(val);
|
|
25622
|
+
}
|
|
25623
|
+
}
|
|
25624
|
+
return ret;
|
|
25625
|
+
};
|
|
25626
|
+
/**
|
|
25627
|
+
* A helper function for generating list for obj api
|
|
25628
|
+
* @param listAccessor function that accepts an index and return data at that index
|
|
25629
|
+
* @param listLength listLength
|
|
25630
|
+
* @param res result list
|
|
25631
|
+
*/ _proto.createObjList = function createObjList(listAccessor, listLength) {
|
|
25632
|
+
var ret = [];
|
|
25633
|
+
for(var i = 0; i < listLength; ++i){
|
|
25634
|
+
var val = listAccessor(i);
|
|
25635
|
+
if (val !== null) {
|
|
25636
|
+
ret.push(val.unpack());
|
|
25637
|
+
}
|
|
25638
|
+
}
|
|
25639
|
+
return ret;
|
|
25640
|
+
};
|
|
25641
|
+
/**
|
|
25642
|
+
* Create and allocate a new ByteBuffer with a given size.
|
|
25643
|
+
*/ ByteBuffer.allocate = function allocate(byte_size) {
|
|
25644
|
+
return new ByteBuffer(new Uint8Array(byte_size));
|
|
25645
|
+
};
|
|
25646
|
+
return ByteBuffer;
|
|
25647
|
+
}();
|
|
25648
|
+
|
|
25649
|
+
var Builder = /*#__PURE__*/ function() {
|
|
25650
|
+
function Builder(opt_initial_size) {
|
|
25651
|
+
/** Minimum alignment encountered so far. */ this.minalign = 1;
|
|
25652
|
+
/** The vtable for the current table. */ this.vtable = null;
|
|
25653
|
+
/** The amount of fields we're actually using. */ this.vtable_in_use = 0;
|
|
25654
|
+
/** Whether we are currently serializing a table. */ this.isNested = false;
|
|
25655
|
+
/** Starting offset of the current struct/table. */ this.object_start = 0;
|
|
25656
|
+
/** List of offsets of all vtables. */ this.vtables = [];
|
|
25657
|
+
/** For the current vector being built. */ this.vector_num_elems = 0;
|
|
25658
|
+
/** False omits default values from the serialized data */ this.force_defaults = false;
|
|
25659
|
+
this.string_maps = null;
|
|
25660
|
+
this.text_encoder = new TextEncoder();
|
|
25661
|
+
var initial_size;
|
|
25662
|
+
if (!opt_initial_size) {
|
|
25663
|
+
initial_size = 1024;
|
|
25664
|
+
} else {
|
|
25665
|
+
initial_size = opt_initial_size;
|
|
25666
|
+
}
|
|
25667
|
+
/**
|
|
25668
|
+
* @type {ByteBuffer}
|
|
25669
|
+
* @private
|
|
25670
|
+
*/ this.bb = ByteBuffer.allocate(initial_size);
|
|
25671
|
+
this.space = initial_size;
|
|
25672
|
+
}
|
|
25673
|
+
var _proto = Builder.prototype;
|
|
25674
|
+
_proto.clear = function clear() {
|
|
25675
|
+
this.bb.clear();
|
|
25676
|
+
this.space = this.bb.capacity();
|
|
25677
|
+
this.minalign = 1;
|
|
25678
|
+
this.vtable = null;
|
|
25679
|
+
this.vtable_in_use = 0;
|
|
25680
|
+
this.isNested = false;
|
|
25681
|
+
this.object_start = 0;
|
|
25682
|
+
this.vtables = [];
|
|
25683
|
+
this.vector_num_elems = 0;
|
|
25684
|
+
this.force_defaults = false;
|
|
25685
|
+
this.string_maps = null;
|
|
25686
|
+
};
|
|
25687
|
+
/**
|
|
25688
|
+
* In order to save space, fields that are set to their default value
|
|
25689
|
+
* don't get serialized into the buffer. Forcing defaults provides a
|
|
25690
|
+
* way to manually disable this optimization.
|
|
25691
|
+
*
|
|
25692
|
+
* @param forceDefaults true always serializes default values
|
|
25693
|
+
*/ _proto.forceDefaults = function forceDefaults(forceDefaults) {
|
|
25694
|
+
this.force_defaults = forceDefaults;
|
|
25695
|
+
};
|
|
25696
|
+
/**
|
|
25697
|
+
* Get the ByteBuffer representing the FlatBuffer. Only call this after you've
|
|
25698
|
+
* called finish(). The actual data starts at the ByteBuffer's current position,
|
|
25699
|
+
* not necessarily at 0.
|
|
25700
|
+
*/ _proto.dataBuffer = function dataBuffer() {
|
|
25701
|
+
return this.bb;
|
|
25702
|
+
};
|
|
25703
|
+
/**
|
|
25704
|
+
* Get the bytes representing the FlatBuffer. Only call this after you've
|
|
25705
|
+
* called finish().
|
|
25706
|
+
*/ _proto.asUint8Array = function asUint8Array() {
|
|
25707
|
+
return this.bb.bytes().subarray(this.bb.position(), this.bb.position() + this.offset());
|
|
25708
|
+
};
|
|
25709
|
+
/**
|
|
25710
|
+
* Prepare to write an element of `size` after `additional_bytes` have been
|
|
25711
|
+
* written, e.g. if you write a string, you need to align such the int length
|
|
25712
|
+
* field is aligned to 4 bytes, and the string data follows it directly. If all
|
|
25713
|
+
* you need to do is alignment, `additional_bytes` will be 0.
|
|
25714
|
+
*
|
|
25715
|
+
* @param size This is the of the new element to write
|
|
25716
|
+
* @param additional_bytes The padding size
|
|
25717
|
+
*/ _proto.prep = function prep(size, additional_bytes) {
|
|
25718
|
+
// Track the biggest thing we've ever aligned to.
|
|
25719
|
+
if (size > this.minalign) {
|
|
25720
|
+
this.minalign = size;
|
|
25721
|
+
}
|
|
25722
|
+
// Find the amount of alignment needed such that `size` is properly
|
|
25723
|
+
// aligned after `additional_bytes`
|
|
25724
|
+
var align_size = ~(this.bb.capacity() - this.space + additional_bytes) + 1 & size - 1;
|
|
25725
|
+
// Reallocate the buffer if needed.
|
|
25726
|
+
while(this.space < align_size + size + additional_bytes){
|
|
25727
|
+
var old_buf_size = this.bb.capacity();
|
|
25728
|
+
this.bb = Builder.growByteBuffer(this.bb);
|
|
25729
|
+
this.space += this.bb.capacity() - old_buf_size;
|
|
25730
|
+
}
|
|
25731
|
+
this.pad(align_size);
|
|
25732
|
+
};
|
|
25733
|
+
_proto.pad = function pad(byte_size) {
|
|
25734
|
+
for(var i = 0; i < byte_size; i++){
|
|
25735
|
+
this.bb.writeInt8(--this.space, 0);
|
|
25736
|
+
}
|
|
25737
|
+
};
|
|
25738
|
+
_proto.writeInt8 = function writeInt8(value) {
|
|
25739
|
+
this.bb.writeInt8(this.space -= 1, value);
|
|
25740
|
+
};
|
|
25741
|
+
_proto.writeInt16 = function writeInt16(value) {
|
|
25742
|
+
this.bb.writeInt16(this.space -= 2, value);
|
|
25743
|
+
};
|
|
25744
|
+
_proto.writeInt32 = function writeInt32(value) {
|
|
25745
|
+
this.bb.writeInt32(this.space -= 4, value);
|
|
25746
|
+
};
|
|
25747
|
+
_proto.writeInt64 = function writeInt64(value) {
|
|
25748
|
+
this.bb.writeInt64(this.space -= 8, value);
|
|
25749
|
+
};
|
|
25750
|
+
_proto.writeFloat32 = function writeFloat32(value) {
|
|
25751
|
+
this.bb.writeFloat32(this.space -= 4, value);
|
|
25752
|
+
};
|
|
25753
|
+
_proto.writeFloat64 = function writeFloat64(value) {
|
|
25754
|
+
this.bb.writeFloat64(this.space -= 8, value);
|
|
25755
|
+
};
|
|
25756
|
+
/**
|
|
25757
|
+
* Add an `int8` to the buffer, properly aligned, and grows the buffer (if necessary).
|
|
25758
|
+
* @param value The `int8` to add the buffer.
|
|
25759
|
+
*/ _proto.addInt8 = function addInt8(value) {
|
|
25760
|
+
this.prep(1, 0);
|
|
25761
|
+
this.writeInt8(value);
|
|
25762
|
+
};
|
|
25763
|
+
/**
|
|
25764
|
+
* Add an `int16` to the buffer, properly aligned, and grows the buffer (if necessary).
|
|
25765
|
+
* @param value The `int16` to add the buffer.
|
|
25766
|
+
*/ _proto.addInt16 = function addInt16(value) {
|
|
25767
|
+
this.prep(2, 0);
|
|
25768
|
+
this.writeInt16(value);
|
|
25769
|
+
};
|
|
25770
|
+
/**
|
|
25771
|
+
* Add an `int32` to the buffer, properly aligned, and grows the buffer (if necessary).
|
|
25772
|
+
* @param value The `int32` to add the buffer.
|
|
25773
|
+
*/ _proto.addInt32 = function addInt32(value) {
|
|
25774
|
+
this.prep(4, 0);
|
|
25775
|
+
this.writeInt32(value);
|
|
25776
|
+
};
|
|
25777
|
+
/**
|
|
25778
|
+
* Add an `int64` to the buffer, properly aligned, and grows the buffer (if necessary).
|
|
25779
|
+
* @param value The `int64` to add the buffer.
|
|
25780
|
+
*/ _proto.addInt64 = function addInt64(value) {
|
|
25781
|
+
this.prep(8, 0);
|
|
25782
|
+
this.writeInt64(value);
|
|
25783
|
+
};
|
|
25784
|
+
/**
|
|
25785
|
+
* Add a `float32` to the buffer, properly aligned, and grows the buffer (if necessary).
|
|
25786
|
+
* @param value The `float32` to add the buffer.
|
|
25787
|
+
*/ _proto.addFloat32 = function addFloat32(value) {
|
|
25788
|
+
this.prep(4, 0);
|
|
25789
|
+
this.writeFloat32(value);
|
|
25790
|
+
};
|
|
25791
|
+
/**
|
|
25792
|
+
* Add a `float64` to the buffer, properly aligned, and grows the buffer (if necessary).
|
|
25793
|
+
* @param value The `float64` to add the buffer.
|
|
25794
|
+
*/ _proto.addFloat64 = function addFloat64(value) {
|
|
25795
|
+
this.prep(8, 0);
|
|
25796
|
+
this.writeFloat64(value);
|
|
25797
|
+
};
|
|
25798
|
+
_proto.addFieldInt8 = function addFieldInt8(voffset, value, defaultValue) {
|
|
25799
|
+
if (this.force_defaults || value != defaultValue) {
|
|
25800
|
+
this.addInt8(value);
|
|
25801
|
+
this.slot(voffset);
|
|
25802
|
+
}
|
|
25803
|
+
};
|
|
25804
|
+
_proto.addFieldInt16 = function addFieldInt16(voffset, value, defaultValue) {
|
|
25805
|
+
if (this.force_defaults || value != defaultValue) {
|
|
25806
|
+
this.addInt16(value);
|
|
25807
|
+
this.slot(voffset);
|
|
25808
|
+
}
|
|
25809
|
+
};
|
|
25810
|
+
_proto.addFieldInt32 = function addFieldInt32(voffset, value, defaultValue) {
|
|
25811
|
+
if (this.force_defaults || value != defaultValue) {
|
|
25812
|
+
this.addInt32(value);
|
|
25813
|
+
this.slot(voffset);
|
|
25814
|
+
}
|
|
25815
|
+
};
|
|
25816
|
+
_proto.addFieldInt64 = function addFieldInt64(voffset, value, defaultValue) {
|
|
25817
|
+
if (this.force_defaults || value !== defaultValue) {
|
|
25818
|
+
this.addInt64(value);
|
|
25819
|
+
this.slot(voffset);
|
|
25820
|
+
}
|
|
25821
|
+
};
|
|
25822
|
+
_proto.addFieldFloat32 = function addFieldFloat32(voffset, value, defaultValue) {
|
|
25823
|
+
if (this.force_defaults || value != defaultValue) {
|
|
25824
|
+
this.addFloat32(value);
|
|
25825
|
+
this.slot(voffset);
|
|
25826
|
+
}
|
|
25827
|
+
};
|
|
25828
|
+
_proto.addFieldFloat64 = function addFieldFloat64(voffset, value, defaultValue) {
|
|
25829
|
+
if (this.force_defaults || value != defaultValue) {
|
|
25830
|
+
this.addFloat64(value);
|
|
25831
|
+
this.slot(voffset);
|
|
25832
|
+
}
|
|
25833
|
+
};
|
|
25834
|
+
_proto.addFieldOffset = function addFieldOffset(voffset, value, defaultValue) {
|
|
25835
|
+
if (this.force_defaults || value != defaultValue) {
|
|
25836
|
+
this.addOffset(value);
|
|
25837
|
+
this.slot(voffset);
|
|
25838
|
+
}
|
|
25839
|
+
};
|
|
25840
|
+
/**
|
|
25841
|
+
* Structs are stored inline, so nothing additional is being added. `d` is always 0.
|
|
25842
|
+
*/ _proto.addFieldStruct = function addFieldStruct(voffset, value, defaultValue) {
|
|
25843
|
+
if (value != defaultValue) {
|
|
25844
|
+
this.nested(value);
|
|
25845
|
+
this.slot(voffset);
|
|
25846
|
+
}
|
|
25847
|
+
};
|
|
25848
|
+
/**
|
|
25849
|
+
* Structures are always stored inline, they need to be created right
|
|
25850
|
+
* where they're used. You'll get this assertion failure if you
|
|
25851
|
+
* created it elsewhere.
|
|
25852
|
+
*/ _proto.nested = function nested(obj) {
|
|
25853
|
+
if (obj != this.offset()) {
|
|
25854
|
+
throw new TypeError("FlatBuffers: struct must be serialized inline.");
|
|
25855
|
+
}
|
|
25856
|
+
};
|
|
25857
|
+
/**
|
|
25858
|
+
* Should not be creating any other object, string or vector
|
|
25859
|
+
* while an object is being constructed
|
|
25860
|
+
*/ _proto.notNested = function notNested() {
|
|
25861
|
+
if (this.isNested) {
|
|
25862
|
+
throw new TypeError("FlatBuffers: object serialization must not be nested.");
|
|
25863
|
+
}
|
|
25864
|
+
};
|
|
25865
|
+
/**
|
|
25866
|
+
* Set the current vtable at `voffset` to the current location in the buffer.
|
|
25867
|
+
*/ _proto.slot = function slot(voffset) {
|
|
25868
|
+
if (this.vtable !== null) this.vtable[voffset] = this.offset();
|
|
25869
|
+
};
|
|
25870
|
+
/**
|
|
25871
|
+
* @returns Offset relative to the end of the buffer.
|
|
25872
|
+
*/ _proto.offset = function offset() {
|
|
25873
|
+
return this.bb.capacity() - this.space;
|
|
25874
|
+
};
|
|
25875
|
+
/**
|
|
25876
|
+
* Adds on offset, relative to where it will be written.
|
|
25877
|
+
*
|
|
25878
|
+
* @param offset The offset to add.
|
|
25879
|
+
*/ _proto.addOffset = function addOffset(offset) {
|
|
25880
|
+
this.prep(SIZEOF_INT, 0); // Ensure alignment is already done.
|
|
25881
|
+
this.writeInt32(this.offset() - offset + SIZEOF_INT);
|
|
25882
|
+
};
|
|
25883
|
+
/**
|
|
25884
|
+
* Start encoding a new object in the buffer. Users will not usually need to
|
|
25885
|
+
* call this directly. The FlatBuffers compiler will generate helper methods
|
|
25886
|
+
* that call this method internally.
|
|
25887
|
+
*/ _proto.startObject = function startObject(numfields) {
|
|
25888
|
+
this.notNested();
|
|
25889
|
+
if (this.vtable == null) {
|
|
25890
|
+
this.vtable = [];
|
|
25891
|
+
}
|
|
25892
|
+
this.vtable_in_use = numfields;
|
|
25893
|
+
for(var i = 0; i < numfields; i++){
|
|
25894
|
+
this.vtable[i] = 0; // This will push additional elements as needed
|
|
25895
|
+
}
|
|
25896
|
+
this.isNested = true;
|
|
25897
|
+
this.object_start = this.offset();
|
|
25898
|
+
};
|
|
25899
|
+
/**
|
|
25900
|
+
* Finish off writing the object that is under construction.
|
|
25901
|
+
*
|
|
25902
|
+
* @returns The offset to the object inside `dataBuffer`
|
|
25903
|
+
*/ _proto.endObject = function endObject() {
|
|
25904
|
+
if (this.vtable == null || !this.isNested) {
|
|
25905
|
+
throw new Error("FlatBuffers: endObject called without startObject");
|
|
25906
|
+
}
|
|
25907
|
+
this.addInt32(0);
|
|
25908
|
+
var vtableloc = this.offset();
|
|
25909
|
+
// Trim trailing zeroes.
|
|
25910
|
+
var i = this.vtable_in_use - 1;
|
|
25911
|
+
// eslint-disable-next-line no-empty
|
|
25912
|
+
for(; i >= 0 && this.vtable[i] == 0; i--){}
|
|
25913
|
+
var trimmed_size = i + 1;
|
|
25914
|
+
// Write out the current vtable.
|
|
25915
|
+
for(; i >= 0; i--){
|
|
25916
|
+
// Offset relative to the start of the table.
|
|
25917
|
+
this.addInt16(this.vtable[i] != 0 ? vtableloc - this.vtable[i] : 0);
|
|
25918
|
+
}
|
|
25919
|
+
var standard_fields = 2; // The fields below:
|
|
25920
|
+
this.addInt16(vtableloc - this.object_start);
|
|
25921
|
+
var len = (trimmed_size + standard_fields) * SIZEOF_SHORT;
|
|
25922
|
+
this.addInt16(len);
|
|
25923
|
+
// Search for an existing vtable that matches the current one.
|
|
25924
|
+
var existing_vtable = 0;
|
|
25925
|
+
var vt1 = this.space;
|
|
25926
|
+
outer_loop: for(i = 0; i < this.vtables.length; i++){
|
|
25927
|
+
var vt2 = this.bb.capacity() - this.vtables[i];
|
|
25928
|
+
if (len == this.bb.readInt16(vt2)) {
|
|
25929
|
+
for(var j = SIZEOF_SHORT; j < len; j += SIZEOF_SHORT){
|
|
25930
|
+
if (this.bb.readInt16(vt1 + j) != this.bb.readInt16(vt2 + j)) {
|
|
25931
|
+
continue outer_loop;
|
|
25932
|
+
}
|
|
25933
|
+
}
|
|
25934
|
+
existing_vtable = this.vtables[i];
|
|
25935
|
+
break;
|
|
25936
|
+
}
|
|
25937
|
+
}
|
|
25938
|
+
if (existing_vtable) {
|
|
25939
|
+
// Found a match:
|
|
25940
|
+
// Remove the current vtable.
|
|
25941
|
+
this.space = this.bb.capacity() - vtableloc;
|
|
25942
|
+
// Point table to existing vtable.
|
|
25943
|
+
this.bb.writeInt32(this.space, existing_vtable - vtableloc);
|
|
25944
|
+
} else {
|
|
25945
|
+
// No match:
|
|
25946
|
+
// Add the location of the current vtable to the list of vtables.
|
|
25947
|
+
this.vtables.push(this.offset());
|
|
25948
|
+
// Point table to current vtable.
|
|
25949
|
+
this.bb.writeInt32(this.bb.capacity() - vtableloc, this.offset() - vtableloc);
|
|
25950
|
+
}
|
|
25951
|
+
this.isNested = false;
|
|
25952
|
+
return vtableloc;
|
|
25953
|
+
};
|
|
25954
|
+
/**
|
|
25955
|
+
* Finalize a buffer, poiting to the given `root_table`.
|
|
25956
|
+
*/ _proto.finish = function finish(root_table, opt_file_identifier, opt_size_prefix) {
|
|
25957
|
+
var size_prefix = opt_size_prefix ? SIZE_PREFIX_LENGTH : 0;
|
|
25958
|
+
if (opt_file_identifier) {
|
|
25959
|
+
var file_identifier = opt_file_identifier;
|
|
25960
|
+
this.prep(this.minalign, SIZEOF_INT + FILE_IDENTIFIER_LENGTH + size_prefix);
|
|
25961
|
+
if (file_identifier.length != FILE_IDENTIFIER_LENGTH) {
|
|
25962
|
+
throw new TypeError("FlatBuffers: file identifier must be length " + FILE_IDENTIFIER_LENGTH);
|
|
25963
|
+
}
|
|
25964
|
+
for(var i = FILE_IDENTIFIER_LENGTH - 1; i >= 0; i--){
|
|
25965
|
+
this.writeInt8(file_identifier.charCodeAt(i));
|
|
25966
|
+
}
|
|
25967
|
+
}
|
|
25968
|
+
this.prep(this.minalign, SIZEOF_INT + size_prefix);
|
|
25969
|
+
this.addOffset(root_table);
|
|
25970
|
+
if (size_prefix) {
|
|
25971
|
+
this.addInt32(this.bb.capacity() - this.space);
|
|
25972
|
+
}
|
|
25973
|
+
this.bb.setPosition(this.space);
|
|
25974
|
+
};
|
|
25975
|
+
/**
|
|
25976
|
+
* Finalize a size prefixed buffer, pointing to the given `root_table`.
|
|
25977
|
+
*/ _proto.finishSizePrefixed = function finishSizePrefixed(root_table, opt_file_identifier) {
|
|
25978
|
+
this.finish(root_table, opt_file_identifier, true);
|
|
25979
|
+
};
|
|
25980
|
+
/**
|
|
25981
|
+
* This checks a required field has been set in a given table that has
|
|
25982
|
+
* just been constructed.
|
|
25983
|
+
*/ _proto.requiredField = function requiredField(table, field) {
|
|
25984
|
+
var table_start = this.bb.capacity() - table;
|
|
25985
|
+
var vtable_start = table_start - this.bb.readInt32(table_start);
|
|
25986
|
+
var ok = field < this.bb.readInt16(vtable_start) && this.bb.readInt16(vtable_start + field) != 0;
|
|
25987
|
+
// If this fails, the caller will show what field needs to be set.
|
|
25988
|
+
if (!ok) {
|
|
25989
|
+
throw new TypeError("FlatBuffers: field " + field + " must be set");
|
|
25990
|
+
}
|
|
25991
|
+
};
|
|
25992
|
+
/**
|
|
25993
|
+
* Start a new array/vector of objects. Users usually will not call
|
|
25994
|
+
* this directly. The FlatBuffers compiler will create a start/end
|
|
25995
|
+
* method for vector types in generated code.
|
|
25996
|
+
*
|
|
25997
|
+
* @param elem_size The size of each element in the array
|
|
25998
|
+
* @param num_elems The number of elements in the array
|
|
25999
|
+
* @param alignment The alignment of the array
|
|
26000
|
+
*/ _proto.startVector = function startVector(elem_size, num_elems, alignment) {
|
|
26001
|
+
this.notNested();
|
|
26002
|
+
this.vector_num_elems = num_elems;
|
|
26003
|
+
this.prep(SIZEOF_INT, elem_size * num_elems);
|
|
26004
|
+
this.prep(alignment, elem_size * num_elems); // Just in case alignment > int.
|
|
26005
|
+
};
|
|
26006
|
+
/**
|
|
26007
|
+
* Finish off the creation of an array and all its elements. The array must be
|
|
26008
|
+
* created with `startVector`.
|
|
26009
|
+
*
|
|
26010
|
+
* @returns The offset at which the newly created array
|
|
26011
|
+
* starts.
|
|
26012
|
+
*/ _proto.endVector = function endVector() {
|
|
26013
|
+
this.writeInt32(this.vector_num_elems);
|
|
26014
|
+
return this.offset();
|
|
26015
|
+
};
|
|
26016
|
+
/**
|
|
26017
|
+
* Encode the string `s` in the buffer using UTF-8. If the string passed has
|
|
26018
|
+
* already been seen, we return the offset of the already written string
|
|
26019
|
+
*
|
|
26020
|
+
* @param s The string to encode
|
|
26021
|
+
* @return The offset in the buffer where the encoded string starts
|
|
26022
|
+
*/ _proto.createSharedString = function createSharedString(s) {
|
|
26023
|
+
if (!s) {
|
|
26024
|
+
return 0;
|
|
26025
|
+
}
|
|
26026
|
+
if (!this.string_maps) {
|
|
26027
|
+
this.string_maps = new Map();
|
|
26028
|
+
}
|
|
26029
|
+
if (this.string_maps.has(s)) {
|
|
26030
|
+
return this.string_maps.get(s);
|
|
26031
|
+
}
|
|
26032
|
+
var offset = this.createString(s);
|
|
26033
|
+
this.string_maps.set(s, offset);
|
|
26034
|
+
return offset;
|
|
26035
|
+
};
|
|
26036
|
+
/**
|
|
26037
|
+
* Encode the string `s` in the buffer using UTF-8. If a Uint8Array is passed
|
|
26038
|
+
* instead of a string, it is assumed to contain valid UTF-8 encoded data.
|
|
26039
|
+
*
|
|
26040
|
+
* @param s The string to encode
|
|
26041
|
+
* @return The offset in the buffer where the encoded string starts
|
|
26042
|
+
*/ _proto.createString = function createString(s) {
|
|
26043
|
+
if (s === null || s === undefined) {
|
|
26044
|
+
return 0;
|
|
26045
|
+
}
|
|
26046
|
+
var utf8;
|
|
26047
|
+
if (_instanceof1(s, Uint8Array)) {
|
|
26048
|
+
utf8 = s;
|
|
26049
|
+
} else {
|
|
26050
|
+
utf8 = this.text_encoder.encode(s);
|
|
26051
|
+
}
|
|
26052
|
+
this.addInt8(0);
|
|
26053
|
+
this.startVector(1, utf8.length, 1);
|
|
26054
|
+
this.bb.setPosition(this.space -= utf8.length);
|
|
26055
|
+
this.bb.bytes().set(utf8, this.space);
|
|
26056
|
+
return this.endVector();
|
|
26057
|
+
};
|
|
26058
|
+
/**
|
|
26059
|
+
* Create a byte vector.
|
|
26060
|
+
*
|
|
26061
|
+
* @param v The bytes to add
|
|
26062
|
+
* @returns The offset in the buffer where the byte vector starts
|
|
26063
|
+
*/ _proto.createByteVector = function createByteVector(v) {
|
|
26064
|
+
if (v === null || v === undefined) {
|
|
26065
|
+
return 0;
|
|
26066
|
+
}
|
|
26067
|
+
this.startVector(1, v.length, 1);
|
|
26068
|
+
this.bb.setPosition(this.space -= v.length);
|
|
26069
|
+
this.bb.bytes().set(v, this.space);
|
|
26070
|
+
return this.endVector();
|
|
26071
|
+
};
|
|
26072
|
+
/**
|
|
26073
|
+
* A helper function to pack an object
|
|
26074
|
+
*
|
|
26075
|
+
* @returns offset of obj
|
|
26076
|
+
*/ _proto.createObjectOffset = function createObjectOffset(obj) {
|
|
26077
|
+
if (obj === null) {
|
|
26078
|
+
return 0;
|
|
26079
|
+
}
|
|
26080
|
+
if (typeof obj === "string") {
|
|
26081
|
+
return this.createString(obj);
|
|
26082
|
+
} else {
|
|
26083
|
+
return obj.pack(this);
|
|
26084
|
+
}
|
|
26085
|
+
};
|
|
26086
|
+
/**
|
|
26087
|
+
* A helper function to pack a list of object
|
|
26088
|
+
*
|
|
26089
|
+
* @returns list of offsets of each non null object
|
|
26090
|
+
*/ _proto.createObjectOffsetList = function createObjectOffsetList(list) {
|
|
26091
|
+
var ret = [];
|
|
26092
|
+
for(var i = 0; i < list.length; ++i){
|
|
26093
|
+
var val = list[i];
|
|
26094
|
+
if (val !== null) {
|
|
26095
|
+
ret.push(this.createObjectOffset(val));
|
|
26096
|
+
} else {
|
|
26097
|
+
throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.");
|
|
26098
|
+
}
|
|
26099
|
+
}
|
|
26100
|
+
return ret;
|
|
26101
|
+
};
|
|
26102
|
+
_proto.createStructOffsetList = function createStructOffsetList(list, startFunc) {
|
|
26103
|
+
startFunc(this, list.length);
|
|
26104
|
+
this.createObjectOffsetList(list.slice().reverse());
|
|
26105
|
+
return this.endVector();
|
|
26106
|
+
};
|
|
26107
|
+
/**
|
|
26108
|
+
* Doubles the size of the backing ByteBuffer and copies the old data towards
|
|
26109
|
+
* the end of the new buffer (since we build the buffer backwards).
|
|
26110
|
+
*
|
|
26111
|
+
* @param bb The current buffer with the existing data
|
|
26112
|
+
* @returns A new byte buffer with the old data copied
|
|
26113
|
+
* to it. The data is located at the end of the buffer.
|
|
26114
|
+
*
|
|
26115
|
+
* uint8Array.set() formally takes {Array<number>|ArrayBufferView}, so to pass
|
|
26116
|
+
* it a uint8Array we need to suppress the type check:
|
|
26117
|
+
* @suppress {checkTypes}
|
|
26118
|
+
*/ Builder.growByteBuffer = function growByteBuffer(bb) {
|
|
26119
|
+
var old_buf_size = bb.capacity();
|
|
26120
|
+
// Ensure we don't grow beyond what fits in an int.
|
|
26121
|
+
if (old_buf_size & 0xC0000000) {
|
|
26122
|
+
throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");
|
|
26123
|
+
}
|
|
26124
|
+
var new_buf_size = old_buf_size << 1;
|
|
26125
|
+
var nbb = ByteBuffer.allocate(new_buf_size);
|
|
26126
|
+
nbb.setPosition(new_buf_size - old_buf_size);
|
|
26127
|
+
nbb.bytes().set(bb.bytes(), new_buf_size - old_buf_size);
|
|
26128
|
+
return nbb;
|
|
26129
|
+
};
|
|
26130
|
+
return Builder;
|
|
26131
|
+
}();
|
|
26132
|
+
|
|
26133
|
+
// automatically generated by the FlatBuffers compiler, do not modify
|
|
26134
|
+
var FBEffectsObjectData = /*#__PURE__*/ function() {
|
|
26135
|
+
function FBEffectsObjectData() {
|
|
26136
|
+
this.bb = null;
|
|
26137
|
+
this.bb_pos = 0;
|
|
26138
|
+
}
|
|
26139
|
+
var _proto = FBEffectsObjectData.prototype;
|
|
26140
|
+
_proto.__init = function __init(i, bb) {
|
|
26141
|
+
this.bb_pos = i;
|
|
26142
|
+
this.bb = bb;
|
|
26143
|
+
return this;
|
|
26144
|
+
};
|
|
26145
|
+
_proto.dataType = function dataType(optionalEncoding) {
|
|
26146
|
+
var offset = this.bb.__offset(this.bb_pos, 4);
|
|
26147
|
+
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
26148
|
+
};
|
|
26149
|
+
_proto.data = function data(index) {
|
|
26150
|
+
var offset = this.bb.__offset(this.bb_pos, 6);
|
|
26151
|
+
return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
|
|
26152
|
+
};
|
|
26153
|
+
_proto.dataLength = function dataLength() {
|
|
26154
|
+
var offset = this.bb.__offset(this.bb_pos, 6);
|
|
26155
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
26156
|
+
};
|
|
26157
|
+
_proto.dataArray = function dataArray() {
|
|
26158
|
+
var offset = this.bb.__offset(this.bb_pos, 6);
|
|
26159
|
+
return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
|
|
26160
|
+
};
|
|
26161
|
+
_proto.unpack = function unpack() {
|
|
26162
|
+
return new FBEffectsObjectDataT(this.dataType(), this.bb.createScalarList(this.data.bind(this), this.dataLength()));
|
|
26163
|
+
};
|
|
26164
|
+
_proto.unpackTo = function unpackTo(_o) {
|
|
26165
|
+
_o.dataType = this.dataType();
|
|
26166
|
+
_o.data = this.bb.createScalarList(this.data.bind(this), this.dataLength());
|
|
26167
|
+
};
|
|
26168
|
+
FBEffectsObjectData.getRootAsFBEffectsObjectData = function getRootAsFBEffectsObjectData(bb, obj) {
|
|
26169
|
+
return (obj || new FBEffectsObjectData()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
26170
|
+
};
|
|
26171
|
+
FBEffectsObjectData.getSizePrefixedRootAsFBEffectsObjectData = function getSizePrefixedRootAsFBEffectsObjectData(bb, obj) {
|
|
26172
|
+
bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
|
|
26173
|
+
return (obj || new FBEffectsObjectData()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
26174
|
+
};
|
|
26175
|
+
FBEffectsObjectData.startFBEffectsObjectData = function startFBEffectsObjectData(builder) {
|
|
26176
|
+
builder.startObject(2);
|
|
26177
|
+
};
|
|
26178
|
+
FBEffectsObjectData.addDataType = function addDataType(builder, dataTypeOffset) {
|
|
26179
|
+
builder.addFieldOffset(0, dataTypeOffset, 0);
|
|
26180
|
+
};
|
|
26181
|
+
FBEffectsObjectData.addData = function addData(builder, dataOffset) {
|
|
26182
|
+
builder.addFieldOffset(1, dataOffset, 0);
|
|
26183
|
+
};
|
|
26184
|
+
FBEffectsObjectData.createDataVector = function createDataVector(builder, data) {
|
|
26185
|
+
builder.startVector(1, data.length, 1);
|
|
26186
|
+
for(var i = data.length - 1; i >= 0; i--){
|
|
26187
|
+
builder.addInt8(data[i]);
|
|
26188
|
+
}
|
|
26189
|
+
return builder.endVector();
|
|
26190
|
+
};
|
|
26191
|
+
FBEffectsObjectData.startDataVector = function startDataVector(builder, numElems) {
|
|
26192
|
+
builder.startVector(1, numElems, 1);
|
|
26193
|
+
};
|
|
26194
|
+
FBEffectsObjectData.endFBEffectsObjectData = function endFBEffectsObjectData(builder) {
|
|
26195
|
+
var offset = builder.endObject();
|
|
26196
|
+
return offset;
|
|
26197
|
+
};
|
|
26198
|
+
FBEffectsObjectData.createFBEffectsObjectData = function createFBEffectsObjectData(builder, dataTypeOffset, dataOffset) {
|
|
26199
|
+
FBEffectsObjectData.startFBEffectsObjectData(builder);
|
|
26200
|
+
FBEffectsObjectData.addDataType(builder, dataTypeOffset);
|
|
26201
|
+
FBEffectsObjectData.addData(builder, dataOffset);
|
|
26202
|
+
return FBEffectsObjectData.endFBEffectsObjectData(builder);
|
|
26203
|
+
};
|
|
26204
|
+
return FBEffectsObjectData;
|
|
26205
|
+
}();
|
|
26206
|
+
var FBEffectsObjectDataT = /*#__PURE__*/ function() {
|
|
26207
|
+
function FBEffectsObjectDataT(dataType, data) {
|
|
26208
|
+
if (dataType === void 0) dataType = null;
|
|
26209
|
+
if (data === void 0) data = [];
|
|
26210
|
+
this.dataType = dataType;
|
|
26211
|
+
this.data = data;
|
|
26212
|
+
}
|
|
26213
|
+
var _proto = FBEffectsObjectDataT.prototype;
|
|
26214
|
+
_proto.pack = function pack(builder) {
|
|
26215
|
+
var dataType = this.dataType !== null ? builder.createString(this.dataType) : 0;
|
|
26216
|
+
var data = FBEffectsObjectData.createDataVector(builder, this.data);
|
|
26217
|
+
return FBEffectsObjectData.createFBEffectsObjectData(builder, dataType, data);
|
|
26218
|
+
};
|
|
26219
|
+
return FBEffectsObjectDataT;
|
|
26220
|
+
}();
|
|
26221
|
+
|
|
26222
|
+
// automatically generated by the FlatBuffers compiler, do not modify
|
|
26223
|
+
var FBEffectsPackageData = /*#__PURE__*/ function() {
|
|
26224
|
+
function FBEffectsPackageData() {
|
|
26225
|
+
this.bb = null;
|
|
26226
|
+
this.bb_pos = 0;
|
|
26227
|
+
}
|
|
26228
|
+
var _proto = FBEffectsPackageData.prototype;
|
|
26229
|
+
_proto.__init = function __init(i, bb) {
|
|
26230
|
+
this.bb_pos = i;
|
|
26231
|
+
this.bb = bb;
|
|
26232
|
+
return this;
|
|
26233
|
+
};
|
|
26234
|
+
_proto.exportObjects = function exportObjects(index, obj) {
|
|
26235
|
+
var offset = this.bb.__offset(this.bb_pos, 4);
|
|
26236
|
+
return offset ? (obj || new FBEffectsObjectData()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
|
26237
|
+
};
|
|
26238
|
+
_proto.exportObjectsLength = function exportObjectsLength() {
|
|
26239
|
+
var offset = this.bb.__offset(this.bb_pos, 4);
|
|
26240
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
26241
|
+
};
|
|
26242
|
+
_proto.unpack = function unpack() {
|
|
26243
|
+
return new FBEffectsPackageDataT(this.bb.createObjList(this.exportObjects.bind(this), this.exportObjectsLength()));
|
|
26244
|
+
};
|
|
26245
|
+
_proto.unpackTo = function unpackTo(_o) {
|
|
26246
|
+
_o.exportObjects = this.bb.createObjList(this.exportObjects.bind(this), this.exportObjectsLength());
|
|
26247
|
+
};
|
|
26248
|
+
FBEffectsPackageData.getRootAsFBEffectsPackageData = function getRootAsFBEffectsPackageData(bb, obj) {
|
|
26249
|
+
return (obj || new FBEffectsPackageData()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
26250
|
+
};
|
|
26251
|
+
FBEffectsPackageData.getSizePrefixedRootAsFBEffectsPackageData = function getSizePrefixedRootAsFBEffectsPackageData(bb, obj) {
|
|
26252
|
+
bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
|
|
26253
|
+
return (obj || new FBEffectsPackageData()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
26254
|
+
};
|
|
26255
|
+
FBEffectsPackageData.startFBEffectsPackageData = function startFBEffectsPackageData(builder) {
|
|
26256
|
+
builder.startObject(1);
|
|
26257
|
+
};
|
|
26258
|
+
FBEffectsPackageData.addExportObjects = function addExportObjects(builder, exportObjectsOffset) {
|
|
26259
|
+
builder.addFieldOffset(0, exportObjectsOffset, 0);
|
|
26260
|
+
};
|
|
26261
|
+
FBEffectsPackageData.createExportObjectsVector = function createExportObjectsVector(builder, data) {
|
|
26262
|
+
builder.startVector(4, data.length, 4);
|
|
26263
|
+
for(var i = data.length - 1; i >= 0; i--){
|
|
26264
|
+
builder.addOffset(data[i]);
|
|
26265
|
+
}
|
|
26266
|
+
return builder.endVector();
|
|
26267
|
+
};
|
|
26268
|
+
FBEffectsPackageData.startExportObjectsVector = function startExportObjectsVector(builder, numElems) {
|
|
26269
|
+
builder.startVector(4, numElems, 4);
|
|
26270
|
+
};
|
|
26271
|
+
FBEffectsPackageData.endFBEffectsPackageData = function endFBEffectsPackageData(builder) {
|
|
26272
|
+
var offset = builder.endObject();
|
|
26273
|
+
return offset;
|
|
26274
|
+
};
|
|
26275
|
+
FBEffectsPackageData.finishFBEffectsPackageDataBuffer = function finishFBEffectsPackageDataBuffer(builder, offset) {
|
|
26276
|
+
builder.finish(offset);
|
|
26277
|
+
};
|
|
26278
|
+
FBEffectsPackageData.finishSizePrefixedFBEffectsPackageDataBuffer = function finishSizePrefixedFBEffectsPackageDataBuffer(builder, offset) {
|
|
26279
|
+
builder.finish(offset, undefined, true);
|
|
26280
|
+
};
|
|
26281
|
+
FBEffectsPackageData.createFBEffectsPackageData = function createFBEffectsPackageData(builder, exportObjectsOffset) {
|
|
26282
|
+
FBEffectsPackageData.startFBEffectsPackageData(builder);
|
|
26283
|
+
FBEffectsPackageData.addExportObjects(builder, exportObjectsOffset);
|
|
26284
|
+
return FBEffectsPackageData.endFBEffectsPackageData(builder);
|
|
26285
|
+
};
|
|
26286
|
+
return FBEffectsPackageData;
|
|
26287
|
+
}();
|
|
26288
|
+
var FBEffectsPackageDataT = /*#__PURE__*/ function() {
|
|
26289
|
+
function FBEffectsPackageDataT(exportObjects) {
|
|
26290
|
+
if (exportObjects === void 0) exportObjects = [];
|
|
26291
|
+
this.exportObjects = exportObjects;
|
|
26292
|
+
}
|
|
26293
|
+
var _proto = FBEffectsPackageDataT.prototype;
|
|
26294
|
+
_proto.pack = function pack(builder) {
|
|
26295
|
+
var exportObjects = FBEffectsPackageData.createExportObjectsVector(builder, builder.createObjectOffsetList(this.exportObjects));
|
|
26296
|
+
return FBEffectsPackageData.createFBEffectsPackageData(builder, exportObjects);
|
|
26297
|
+
};
|
|
26298
|
+
return FBEffectsPackageDataT;
|
|
26299
|
+
}();
|
|
26300
|
+
|
|
26301
|
+
// automatically generated by the FlatBuffers compiler, do not modify
|
|
26302
|
+
var FBSubMesh = /*#__PURE__*/ function() {
|
|
26303
|
+
function FBSubMesh() {
|
|
26304
|
+
this.bb = null;
|
|
26305
|
+
this.bb_pos = 0;
|
|
26306
|
+
}
|
|
26307
|
+
var _proto = FBSubMesh.prototype;
|
|
26308
|
+
_proto.__init = function __init(i, bb) {
|
|
26309
|
+
this.bb_pos = i;
|
|
26310
|
+
this.bb = bb;
|
|
26311
|
+
return this;
|
|
26312
|
+
};
|
|
26313
|
+
_proto.offset = function offset() {
|
|
26314
|
+
var offset = this.bb.__offset(this.bb_pos, 4);
|
|
26315
|
+
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
|
26316
|
+
};
|
|
26317
|
+
_proto.indexCount = function indexCount() {
|
|
26318
|
+
var offset = this.bb.__offset(this.bb_pos, 6);
|
|
26319
|
+
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
|
26320
|
+
};
|
|
26321
|
+
_proto.vertexCount = function vertexCount() {
|
|
26322
|
+
var offset = this.bb.__offset(this.bb_pos, 8);
|
|
26323
|
+
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
|
26324
|
+
};
|
|
26325
|
+
_proto.unpack = function unpack() {
|
|
26326
|
+
return new FBSubMeshT(this.offset(), this.indexCount(), this.vertexCount());
|
|
26327
|
+
};
|
|
26328
|
+
_proto.unpackTo = function unpackTo(_o) {
|
|
26329
|
+
_o.offset = this.offset();
|
|
26330
|
+
_o.indexCount = this.indexCount();
|
|
26331
|
+
_o.vertexCount = this.vertexCount();
|
|
26332
|
+
};
|
|
26333
|
+
FBSubMesh.getRootAsFBSubMesh = function getRootAsFBSubMesh(bb, obj) {
|
|
26334
|
+
return (obj || new FBSubMesh()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
26335
|
+
};
|
|
26336
|
+
FBSubMesh.getSizePrefixedRootAsFBSubMesh = function getSizePrefixedRootAsFBSubMesh(bb, obj) {
|
|
26337
|
+
bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
|
|
26338
|
+
return (obj || new FBSubMesh()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
26339
|
+
};
|
|
26340
|
+
FBSubMesh.startFBSubMesh = function startFBSubMesh(builder) {
|
|
26341
|
+
builder.startObject(3);
|
|
26342
|
+
};
|
|
26343
|
+
FBSubMesh.addOffset = function addOffset(builder, offset) {
|
|
26344
|
+
builder.addFieldInt32(0, offset, 0);
|
|
26345
|
+
};
|
|
26346
|
+
FBSubMesh.addIndexCount = function addIndexCount(builder, indexCount) {
|
|
26347
|
+
builder.addFieldInt32(1, indexCount, 0);
|
|
26348
|
+
};
|
|
26349
|
+
FBSubMesh.addVertexCount = function addVertexCount(builder, vertexCount) {
|
|
26350
|
+
builder.addFieldInt32(2, vertexCount, 0);
|
|
26351
|
+
};
|
|
26352
|
+
FBSubMesh.endFBSubMesh = function endFBSubMesh(builder) {
|
|
26353
|
+
var offset = builder.endObject();
|
|
26354
|
+
return offset;
|
|
26355
|
+
};
|
|
26356
|
+
FBSubMesh.createFBSubMesh = function createFBSubMesh(builder, offset, indexCount, vertexCount) {
|
|
26357
|
+
FBSubMesh.startFBSubMesh(builder);
|
|
26358
|
+
FBSubMesh.addOffset(builder, offset);
|
|
26359
|
+
FBSubMesh.addIndexCount(builder, indexCount);
|
|
26360
|
+
FBSubMesh.addVertexCount(builder, vertexCount);
|
|
26361
|
+
return FBSubMesh.endFBSubMesh(builder);
|
|
26362
|
+
};
|
|
26363
|
+
return FBSubMesh;
|
|
26364
|
+
}();
|
|
26365
|
+
var FBSubMeshT = /*#__PURE__*/ function() {
|
|
26366
|
+
function FBSubMeshT(offset, indexCount, vertexCount) {
|
|
26367
|
+
if (offset === void 0) offset = 0;
|
|
26368
|
+
if (indexCount === void 0) indexCount = 0;
|
|
26369
|
+
if (vertexCount === void 0) vertexCount = 0;
|
|
26370
|
+
this.offset = offset;
|
|
26371
|
+
this.indexCount = indexCount;
|
|
26372
|
+
this.vertexCount = vertexCount;
|
|
26373
|
+
}
|
|
26374
|
+
var _proto = FBSubMeshT.prototype;
|
|
26375
|
+
_proto.pack = function pack(builder) {
|
|
26376
|
+
return FBSubMesh.createFBSubMesh(builder, this.offset, this.indexCount, this.vertexCount);
|
|
26377
|
+
};
|
|
26378
|
+
return FBSubMeshT;
|
|
26379
|
+
}();
|
|
26380
|
+
|
|
26381
|
+
// automatically generated by the FlatBuffers compiler, do not modify
|
|
26382
|
+
var FBVertexChannel = /*#__PURE__*/ function() {
|
|
26383
|
+
function FBVertexChannel() {
|
|
26384
|
+
this.bb = null;
|
|
26385
|
+
this.bb_pos = 0;
|
|
26386
|
+
}
|
|
26387
|
+
var _proto = FBVertexChannel.prototype;
|
|
26388
|
+
_proto.__init = function __init(i, bb) {
|
|
26389
|
+
this.bb_pos = i;
|
|
26390
|
+
this.bb = bb;
|
|
26391
|
+
return this;
|
|
26392
|
+
};
|
|
26393
|
+
_proto.semantic = function semantic(optionalEncoding) {
|
|
26394
|
+
var offset = this.bb.__offset(this.bb_pos, 4);
|
|
26395
|
+
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
26396
|
+
};
|
|
26397
|
+
_proto.offset = function offset() {
|
|
26398
|
+
var offset = this.bb.__offset(this.bb_pos, 6);
|
|
26399
|
+
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
|
26400
|
+
};
|
|
26401
|
+
_proto.format = function format() {
|
|
26402
|
+
var offset = this.bb.__offset(this.bb_pos, 8);
|
|
26403
|
+
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
|
26404
|
+
};
|
|
26405
|
+
_proto.dimension = function dimension() {
|
|
26406
|
+
var offset = this.bb.__offset(this.bb_pos, 10);
|
|
26407
|
+
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
|
26408
|
+
};
|
|
26409
|
+
_proto.normalize = function normalize() {
|
|
26410
|
+
var offset = this.bb.__offset(this.bb_pos, 12);
|
|
26411
|
+
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
|
|
26412
|
+
};
|
|
26413
|
+
_proto.unpack = function unpack() {
|
|
26414
|
+
return new FBVertexChannelT(this.semantic(), this.offset(), this.format(), this.dimension(), this.normalize());
|
|
26415
|
+
};
|
|
26416
|
+
_proto.unpackTo = function unpackTo(_o) {
|
|
26417
|
+
_o.semantic = this.semantic();
|
|
26418
|
+
_o.offset = this.offset();
|
|
26419
|
+
_o.format = this.format();
|
|
26420
|
+
_o.dimension = this.dimension();
|
|
26421
|
+
_o.normalize = this.normalize();
|
|
26422
|
+
};
|
|
26423
|
+
FBVertexChannel.getRootAsFBVertexChannel = function getRootAsFBVertexChannel(bb, obj) {
|
|
26424
|
+
return (obj || new FBVertexChannel()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
26425
|
+
};
|
|
26426
|
+
FBVertexChannel.getSizePrefixedRootAsFBVertexChannel = function getSizePrefixedRootAsFBVertexChannel(bb, obj) {
|
|
26427
|
+
bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
|
|
26428
|
+
return (obj || new FBVertexChannel()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
26429
|
+
};
|
|
26430
|
+
FBVertexChannel.startFBVertexChannel = function startFBVertexChannel(builder) {
|
|
26431
|
+
builder.startObject(5);
|
|
26432
|
+
};
|
|
26433
|
+
FBVertexChannel.addSemantic = function addSemantic(builder, semanticOffset) {
|
|
26434
|
+
builder.addFieldOffset(0, semanticOffset, 0);
|
|
26435
|
+
};
|
|
26436
|
+
FBVertexChannel.addOffset = function addOffset(builder, offset) {
|
|
26437
|
+
builder.addFieldInt32(1, offset, 0);
|
|
26438
|
+
};
|
|
26439
|
+
FBVertexChannel.addFormat = function addFormat(builder, format) {
|
|
26440
|
+
builder.addFieldInt32(2, format, 0);
|
|
26441
|
+
};
|
|
26442
|
+
FBVertexChannel.addDimension = function addDimension(builder, dimension) {
|
|
26443
|
+
builder.addFieldInt32(3, dimension, 0);
|
|
26444
|
+
};
|
|
26445
|
+
FBVertexChannel.addNormalize = function addNormalize(builder, normalize) {
|
|
26446
|
+
builder.addFieldInt8(4, +normalize, +false);
|
|
26447
|
+
};
|
|
26448
|
+
FBVertexChannel.endFBVertexChannel = function endFBVertexChannel(builder) {
|
|
26449
|
+
var offset = builder.endObject();
|
|
26450
|
+
return offset;
|
|
26451
|
+
};
|
|
26452
|
+
FBVertexChannel.createFBVertexChannel = function createFBVertexChannel(builder, semanticOffset, offset, format, dimension, normalize) {
|
|
26453
|
+
FBVertexChannel.startFBVertexChannel(builder);
|
|
26454
|
+
FBVertexChannel.addSemantic(builder, semanticOffset);
|
|
26455
|
+
FBVertexChannel.addOffset(builder, offset);
|
|
26456
|
+
FBVertexChannel.addFormat(builder, format);
|
|
26457
|
+
FBVertexChannel.addDimension(builder, dimension);
|
|
26458
|
+
FBVertexChannel.addNormalize(builder, normalize);
|
|
26459
|
+
return FBVertexChannel.endFBVertexChannel(builder);
|
|
26460
|
+
};
|
|
26461
|
+
return FBVertexChannel;
|
|
26462
|
+
}();
|
|
26463
|
+
var FBVertexChannelT = /*#__PURE__*/ function() {
|
|
26464
|
+
function FBVertexChannelT(semantic, offset, format, dimension, normalize) {
|
|
26465
|
+
if (semantic === void 0) semantic = null;
|
|
26466
|
+
if (offset === void 0) offset = 0;
|
|
26467
|
+
if (format === void 0) format = 0;
|
|
26468
|
+
if (dimension === void 0) dimension = 0;
|
|
26469
|
+
if (normalize === void 0) normalize = false;
|
|
26470
|
+
this.semantic = semantic;
|
|
26471
|
+
this.offset = offset;
|
|
26472
|
+
this.format = format;
|
|
26473
|
+
this.dimension = dimension;
|
|
26474
|
+
this.normalize = normalize;
|
|
26475
|
+
}
|
|
26476
|
+
var _proto = FBVertexChannelT.prototype;
|
|
26477
|
+
_proto.pack = function pack(builder) {
|
|
26478
|
+
var semantic = this.semantic !== null ? builder.createString(this.semantic) : 0;
|
|
26479
|
+
return FBVertexChannel.createFBVertexChannel(builder, semantic, this.offset, this.format, this.dimension, this.normalize);
|
|
26480
|
+
};
|
|
26481
|
+
return FBVertexChannelT;
|
|
26482
|
+
}();
|
|
26483
|
+
|
|
26484
|
+
// automatically generated by the FlatBuffers compiler, do not modify
|
|
26485
|
+
var FBVertexData = /*#__PURE__*/ function() {
|
|
26486
|
+
function FBVertexData() {
|
|
26487
|
+
this.bb = null;
|
|
26488
|
+
this.bb_pos = 0;
|
|
26489
|
+
}
|
|
26490
|
+
var _proto = FBVertexData.prototype;
|
|
26491
|
+
_proto.__init = function __init(i, bb) {
|
|
26492
|
+
this.bb_pos = i;
|
|
26493
|
+
this.bb = bb;
|
|
26494
|
+
return this;
|
|
26495
|
+
};
|
|
26496
|
+
_proto.vertexCount = function vertexCount() {
|
|
26497
|
+
var offset = this.bb.__offset(this.bb_pos, 4);
|
|
26498
|
+
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
|
26499
|
+
};
|
|
26500
|
+
_proto.channels = function channels(index, obj) {
|
|
26501
|
+
var offset = this.bb.__offset(this.bb_pos, 6);
|
|
26502
|
+
return offset ? (obj || new FBVertexChannel()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
|
26503
|
+
};
|
|
26504
|
+
_proto.channelsLength = function channelsLength() {
|
|
26505
|
+
var offset = this.bb.__offset(this.bb_pos, 6);
|
|
26506
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
26507
|
+
};
|
|
26508
|
+
_proto.unpack = function unpack() {
|
|
26509
|
+
return new FBVertexDataT(this.vertexCount(), this.bb.createObjList(this.channels.bind(this), this.channelsLength()));
|
|
26510
|
+
};
|
|
26511
|
+
_proto.unpackTo = function unpackTo(_o) {
|
|
26512
|
+
_o.vertexCount = this.vertexCount();
|
|
26513
|
+
_o.channels = this.bb.createObjList(this.channels.bind(this), this.channelsLength());
|
|
26514
|
+
};
|
|
26515
|
+
FBVertexData.getRootAsFBVertexData = function getRootAsFBVertexData(bb, obj) {
|
|
26516
|
+
return (obj || new FBVertexData()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
26517
|
+
};
|
|
26518
|
+
FBVertexData.getSizePrefixedRootAsFBVertexData = function getSizePrefixedRootAsFBVertexData(bb, obj) {
|
|
26519
|
+
bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
|
|
26520
|
+
return (obj || new FBVertexData()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
26521
|
+
};
|
|
26522
|
+
FBVertexData.startFBVertexData = function startFBVertexData(builder) {
|
|
26523
|
+
builder.startObject(2);
|
|
26524
|
+
};
|
|
26525
|
+
FBVertexData.addVertexCount = function addVertexCount(builder, vertexCount) {
|
|
26526
|
+
builder.addFieldInt32(0, vertexCount, 0);
|
|
26527
|
+
};
|
|
26528
|
+
FBVertexData.addChannels = function addChannels(builder, channelsOffset) {
|
|
26529
|
+
builder.addFieldOffset(1, channelsOffset, 0);
|
|
26530
|
+
};
|
|
26531
|
+
FBVertexData.createChannelsVector = function createChannelsVector(builder, data) {
|
|
26532
|
+
builder.startVector(4, data.length, 4);
|
|
26533
|
+
for(var i = data.length - 1; i >= 0; i--){
|
|
26534
|
+
builder.addOffset(data[i]);
|
|
26535
|
+
}
|
|
26536
|
+
return builder.endVector();
|
|
26537
|
+
};
|
|
26538
|
+
FBVertexData.startChannelsVector = function startChannelsVector(builder, numElems) {
|
|
26539
|
+
builder.startVector(4, numElems, 4);
|
|
26540
|
+
};
|
|
26541
|
+
FBVertexData.endFBVertexData = function endFBVertexData(builder) {
|
|
26542
|
+
var offset = builder.endObject();
|
|
26543
|
+
return offset;
|
|
26544
|
+
};
|
|
26545
|
+
FBVertexData.createFBVertexData = function createFBVertexData(builder, vertexCount, channelsOffset) {
|
|
26546
|
+
FBVertexData.startFBVertexData(builder);
|
|
26547
|
+
FBVertexData.addVertexCount(builder, vertexCount);
|
|
26548
|
+
FBVertexData.addChannels(builder, channelsOffset);
|
|
26549
|
+
return FBVertexData.endFBVertexData(builder);
|
|
26550
|
+
};
|
|
26551
|
+
return FBVertexData;
|
|
26552
|
+
}();
|
|
26553
|
+
var FBVertexDataT = /*#__PURE__*/ function() {
|
|
26554
|
+
function FBVertexDataT(vertexCount, channels) {
|
|
26555
|
+
if (vertexCount === void 0) vertexCount = 0;
|
|
26556
|
+
if (channels === void 0) channels = [];
|
|
26557
|
+
this.vertexCount = vertexCount;
|
|
26558
|
+
this.channels = channels;
|
|
26559
|
+
}
|
|
26560
|
+
var _proto = FBVertexDataT.prototype;
|
|
26561
|
+
_proto.pack = function pack(builder) {
|
|
26562
|
+
var channels = FBVertexData.createChannelsVector(builder, builder.createObjectOffsetList(this.channels));
|
|
26563
|
+
return FBVertexData.createFBVertexData(builder, this.vertexCount, channels);
|
|
26564
|
+
};
|
|
26565
|
+
return FBVertexDataT;
|
|
26566
|
+
}();
|
|
26567
|
+
|
|
26568
|
+
// automatically generated by the FlatBuffers compiler, do not modify
|
|
26569
|
+
var FBGeometryData = /*#__PURE__*/ function() {
|
|
26570
|
+
function FBGeometryData() {
|
|
26571
|
+
this.bb = null;
|
|
26572
|
+
this.bb_pos = 0;
|
|
26573
|
+
}
|
|
26574
|
+
var _proto = FBGeometryData.prototype;
|
|
26575
|
+
_proto.__init = function __init(i, bb) {
|
|
26576
|
+
this.bb_pos = i;
|
|
26577
|
+
this.bb = bb;
|
|
26578
|
+
return this;
|
|
26579
|
+
};
|
|
26580
|
+
_proto.id = function id(optionalEncoding) {
|
|
26581
|
+
var offset = this.bb.__offset(this.bb_pos, 4);
|
|
26582
|
+
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
26583
|
+
};
|
|
26584
|
+
_proto.name = function name(optionalEncoding) {
|
|
26585
|
+
var offset = this.bb.__offset(this.bb_pos, 6);
|
|
26586
|
+
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
26587
|
+
};
|
|
26588
|
+
_proto.vertexData = function vertexData(obj) {
|
|
26589
|
+
var offset = this.bb.__offset(this.bb_pos, 8);
|
|
26590
|
+
return offset ? (obj || new FBVertexData()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
|
|
26591
|
+
};
|
|
26592
|
+
_proto.indexFormat = function indexFormat() {
|
|
26593
|
+
var offset = this.bb.__offset(this.bb_pos, 10);
|
|
26594
|
+
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
|
26595
|
+
};
|
|
26596
|
+
_proto.indexOffset = function indexOffset() {
|
|
26597
|
+
var offset = this.bb.__offset(this.bb_pos, 12);
|
|
26598
|
+
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
|
26599
|
+
};
|
|
26600
|
+
_proto.subMeshes = function subMeshes(index, obj) {
|
|
26601
|
+
var offset = this.bb.__offset(this.bb_pos, 14);
|
|
26602
|
+
return offset ? (obj || new FBSubMesh()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
|
26603
|
+
};
|
|
26604
|
+
_proto.subMeshesLength = function subMeshesLength() {
|
|
26605
|
+
var offset = this.bb.__offset(this.bb_pos, 14);
|
|
26606
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
26607
|
+
};
|
|
26608
|
+
_proto.mode = function mode() {
|
|
26609
|
+
var offset = this.bb.__offset(this.bb_pos, 16);
|
|
26610
|
+
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
|
26611
|
+
};
|
|
26612
|
+
_proto.buffer = function buffer(optionalEncoding) {
|
|
26613
|
+
var offset = this.bb.__offset(this.bb_pos, 18);
|
|
26614
|
+
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
26615
|
+
};
|
|
26616
|
+
_proto.binaryData = function binaryData(index) {
|
|
26617
|
+
var offset = this.bb.__offset(this.bb_pos, 20);
|
|
26618
|
+
return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
|
|
26619
|
+
};
|
|
26620
|
+
_proto.binaryDataLength = function binaryDataLength() {
|
|
26621
|
+
var offset = this.bb.__offset(this.bb_pos, 20);
|
|
26622
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
26623
|
+
};
|
|
26624
|
+
_proto.binaryDataArray = function binaryDataArray() {
|
|
26625
|
+
var offset = this.bb.__offset(this.bb_pos, 20);
|
|
26626
|
+
return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
|
|
26627
|
+
};
|
|
26628
|
+
_proto.boneNames = function boneNames(index, optionalEncoding) {
|
|
26629
|
+
var offset = this.bb.__offset(this.bb_pos, 22);
|
|
26630
|
+
return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
|
|
26631
|
+
};
|
|
26632
|
+
_proto.boneNamesLength = function boneNamesLength() {
|
|
26633
|
+
var offset = this.bb.__offset(this.bb_pos, 22);
|
|
26634
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
26635
|
+
};
|
|
26636
|
+
_proto.rootBoneName = function rootBoneName(optionalEncoding) {
|
|
26637
|
+
var offset = this.bb.__offset(this.bb_pos, 24);
|
|
26638
|
+
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
26639
|
+
};
|
|
26640
|
+
_proto.inverseBindMatrices = function inverseBindMatrices(index) {
|
|
26641
|
+
var offset = this.bb.__offset(this.bb_pos, 26);
|
|
26642
|
+
return offset ? this.bb.readFloat32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
|
|
26643
|
+
};
|
|
26644
|
+
_proto.inverseBindMatricesLength = function inverseBindMatricesLength() {
|
|
26645
|
+
var offset = this.bb.__offset(this.bb_pos, 26);
|
|
26646
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
26647
|
+
};
|
|
26648
|
+
_proto.inverseBindMatricesArray = function inverseBindMatricesArray() {
|
|
26649
|
+
var offset = this.bb.__offset(this.bb_pos, 26);
|
|
26650
|
+
return offset ? new Float32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
|
|
26651
|
+
};
|
|
26652
|
+
_proto.unpack = function unpack() {
|
|
26653
|
+
return new FBGeometryDataT(this.id(), this.name(), this.vertexData() !== null ? this.vertexData().unpack() : null, this.indexFormat(), this.indexOffset(), this.bb.createObjList(this.subMeshes.bind(this), this.subMeshesLength()), this.mode(), this.buffer(), this.bb.createScalarList(this.binaryData.bind(this), this.binaryDataLength()), this.bb.createScalarList(this.boneNames.bind(this), this.boneNamesLength()), this.rootBoneName(), this.bb.createScalarList(this.inverseBindMatrices.bind(this), this.inverseBindMatricesLength()));
|
|
26654
|
+
};
|
|
26655
|
+
_proto.unpackTo = function unpackTo(_o) {
|
|
26656
|
+
_o.id = this.id();
|
|
26657
|
+
_o.name = this.name();
|
|
26658
|
+
_o.vertexData = this.vertexData() !== null ? this.vertexData().unpack() : null;
|
|
26659
|
+
_o.indexFormat = this.indexFormat();
|
|
26660
|
+
_o.indexOffset = this.indexOffset();
|
|
26661
|
+
_o.subMeshes = this.bb.createObjList(this.subMeshes.bind(this), this.subMeshesLength());
|
|
26662
|
+
_o.mode = this.mode();
|
|
26663
|
+
_o.buffer = this.buffer();
|
|
26664
|
+
_o.binaryData = this.bb.createScalarList(this.binaryData.bind(this), this.binaryDataLength());
|
|
26665
|
+
_o.boneNames = this.bb.createScalarList(this.boneNames.bind(this), this.boneNamesLength());
|
|
26666
|
+
_o.rootBoneName = this.rootBoneName();
|
|
26667
|
+
_o.inverseBindMatrices = this.bb.createScalarList(this.inverseBindMatrices.bind(this), this.inverseBindMatricesLength());
|
|
26668
|
+
};
|
|
26669
|
+
FBGeometryData.getRootAsFBGeometryData = function getRootAsFBGeometryData(bb, obj) {
|
|
26670
|
+
return (obj || new FBGeometryData()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
26671
|
+
};
|
|
26672
|
+
FBGeometryData.getSizePrefixedRootAsFBGeometryData = function getSizePrefixedRootAsFBGeometryData(bb, obj) {
|
|
26673
|
+
bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
|
|
26674
|
+
return (obj || new FBGeometryData()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
26675
|
+
};
|
|
26676
|
+
FBGeometryData.startFBGeometryData = function startFBGeometryData(builder) {
|
|
26677
|
+
builder.startObject(12);
|
|
26678
|
+
};
|
|
26679
|
+
FBGeometryData.addId = function addId(builder, idOffset) {
|
|
26680
|
+
builder.addFieldOffset(0, idOffset, 0);
|
|
26681
|
+
};
|
|
26682
|
+
FBGeometryData.addName = function addName(builder, nameOffset) {
|
|
26683
|
+
builder.addFieldOffset(1, nameOffset, 0);
|
|
26684
|
+
};
|
|
26685
|
+
FBGeometryData.addVertexData = function addVertexData(builder, vertexDataOffset) {
|
|
26686
|
+
builder.addFieldOffset(2, vertexDataOffset, 0);
|
|
26687
|
+
};
|
|
26688
|
+
FBGeometryData.addIndexFormat = function addIndexFormat(builder, indexFormat) {
|
|
26689
|
+
builder.addFieldInt32(3, indexFormat, 0);
|
|
26690
|
+
};
|
|
26691
|
+
FBGeometryData.addIndexOffset = function addIndexOffset(builder, indexOffset) {
|
|
26692
|
+
builder.addFieldInt32(4, indexOffset, 0);
|
|
26693
|
+
};
|
|
26694
|
+
FBGeometryData.addSubMeshes = function addSubMeshes(builder, subMeshesOffset) {
|
|
26695
|
+
builder.addFieldOffset(5, subMeshesOffset, 0);
|
|
26696
|
+
};
|
|
26697
|
+
FBGeometryData.createSubMeshesVector = function createSubMeshesVector(builder, data) {
|
|
26698
|
+
builder.startVector(4, data.length, 4);
|
|
26699
|
+
for(var i = data.length - 1; i >= 0; i--){
|
|
26700
|
+
builder.addOffset(data[i]);
|
|
26701
|
+
}
|
|
26702
|
+
return builder.endVector();
|
|
26703
|
+
};
|
|
26704
|
+
FBGeometryData.startSubMeshesVector = function startSubMeshesVector(builder, numElems) {
|
|
26705
|
+
builder.startVector(4, numElems, 4);
|
|
26706
|
+
};
|
|
26707
|
+
FBGeometryData.addMode = function addMode(builder, mode) {
|
|
26708
|
+
builder.addFieldInt32(6, mode, 0);
|
|
26709
|
+
};
|
|
26710
|
+
FBGeometryData.addBuffer = function addBuffer(builder, bufferOffset) {
|
|
26711
|
+
builder.addFieldOffset(7, bufferOffset, 0);
|
|
26712
|
+
};
|
|
26713
|
+
FBGeometryData.addBinaryData = function addBinaryData(builder, binaryDataOffset) {
|
|
26714
|
+
builder.addFieldOffset(8, binaryDataOffset, 0);
|
|
26715
|
+
};
|
|
26716
|
+
FBGeometryData.createBinaryDataVector = function createBinaryDataVector(builder, data) {
|
|
26717
|
+
builder.startVector(1, data.length, 1);
|
|
26718
|
+
for(var i = data.length - 1; i >= 0; i--){
|
|
26719
|
+
builder.addInt8(data[i]);
|
|
26720
|
+
}
|
|
26721
|
+
return builder.endVector();
|
|
26722
|
+
};
|
|
26723
|
+
FBGeometryData.startBinaryDataVector = function startBinaryDataVector(builder, numElems) {
|
|
26724
|
+
builder.startVector(1, numElems, 1);
|
|
26725
|
+
};
|
|
26726
|
+
FBGeometryData.addBoneNames = function addBoneNames(builder, boneNamesOffset) {
|
|
26727
|
+
builder.addFieldOffset(9, boneNamesOffset, 0);
|
|
26728
|
+
};
|
|
26729
|
+
FBGeometryData.createBoneNamesVector = function createBoneNamesVector(builder, data) {
|
|
26730
|
+
builder.startVector(4, data.length, 4);
|
|
26731
|
+
for(var i = data.length - 1; i >= 0; i--){
|
|
26732
|
+
builder.addOffset(data[i]);
|
|
26733
|
+
}
|
|
26734
|
+
return builder.endVector();
|
|
26735
|
+
};
|
|
26736
|
+
FBGeometryData.startBoneNamesVector = function startBoneNamesVector(builder, numElems) {
|
|
26737
|
+
builder.startVector(4, numElems, 4);
|
|
26738
|
+
};
|
|
26739
|
+
FBGeometryData.addRootBoneName = function addRootBoneName(builder, rootBoneNameOffset) {
|
|
26740
|
+
builder.addFieldOffset(10, rootBoneNameOffset, 0);
|
|
26741
|
+
};
|
|
26742
|
+
FBGeometryData.addInverseBindMatrices = function addInverseBindMatrices(builder, inverseBindMatricesOffset) {
|
|
26743
|
+
builder.addFieldOffset(11, inverseBindMatricesOffset, 0);
|
|
26744
|
+
};
|
|
26745
|
+
FBGeometryData.createInverseBindMatricesVector = function createInverseBindMatricesVector(builder, data) {
|
|
26746
|
+
builder.startVector(4, data.length, 4);
|
|
26747
|
+
for(var i = data.length - 1; i >= 0; i--){
|
|
26748
|
+
builder.addFloat32(data[i]);
|
|
26749
|
+
}
|
|
26750
|
+
return builder.endVector();
|
|
26751
|
+
};
|
|
26752
|
+
FBGeometryData.startInverseBindMatricesVector = function startInverseBindMatricesVector(builder, numElems) {
|
|
26753
|
+
builder.startVector(4, numElems, 4);
|
|
26754
|
+
};
|
|
26755
|
+
FBGeometryData.endFBGeometryData = function endFBGeometryData(builder) {
|
|
26756
|
+
var offset = builder.endObject();
|
|
26757
|
+
return offset;
|
|
26758
|
+
};
|
|
26759
|
+
return FBGeometryData;
|
|
26760
|
+
}();
|
|
26761
|
+
var FBGeometryDataT = /*#__PURE__*/ function() {
|
|
26762
|
+
function FBGeometryDataT(id, name, vertexData, indexFormat, indexOffset, subMeshes, mode, buffer, binaryData, boneNames, rootBoneName, inverseBindMatrices) {
|
|
26763
|
+
if (id === void 0) id = null;
|
|
26764
|
+
if (name === void 0) name = null;
|
|
26765
|
+
if (vertexData === void 0) vertexData = null;
|
|
26766
|
+
if (indexFormat === void 0) indexFormat = 0;
|
|
26767
|
+
if (indexOffset === void 0) indexOffset = 0;
|
|
26768
|
+
if (subMeshes === void 0) subMeshes = [];
|
|
26769
|
+
if (mode === void 0) mode = 0;
|
|
26770
|
+
if (buffer === void 0) buffer = null;
|
|
26771
|
+
if (binaryData === void 0) binaryData = [];
|
|
26772
|
+
if (boneNames === void 0) boneNames = [];
|
|
26773
|
+
if (rootBoneName === void 0) rootBoneName = null;
|
|
26774
|
+
if (inverseBindMatrices === void 0) inverseBindMatrices = [];
|
|
26775
|
+
this.id = id;
|
|
26776
|
+
this.name = name;
|
|
26777
|
+
this.vertexData = vertexData;
|
|
26778
|
+
this.indexFormat = indexFormat;
|
|
26779
|
+
this.indexOffset = indexOffset;
|
|
26780
|
+
this.subMeshes = subMeshes;
|
|
26781
|
+
this.mode = mode;
|
|
26782
|
+
this.buffer = buffer;
|
|
26783
|
+
this.binaryData = binaryData;
|
|
26784
|
+
this.boneNames = boneNames;
|
|
26785
|
+
this.rootBoneName = rootBoneName;
|
|
26786
|
+
this.inverseBindMatrices = inverseBindMatrices;
|
|
26787
|
+
}
|
|
26788
|
+
var _proto = FBGeometryDataT.prototype;
|
|
26789
|
+
_proto.pack = function pack(builder) {
|
|
26790
|
+
var id = this.id !== null ? builder.createString(this.id) : 0;
|
|
26791
|
+
var name = this.name !== null ? builder.createString(this.name) : 0;
|
|
26792
|
+
var vertexData = this.vertexData !== null ? this.vertexData.pack(builder) : 0;
|
|
26793
|
+
var subMeshes = FBGeometryData.createSubMeshesVector(builder, builder.createObjectOffsetList(this.subMeshes));
|
|
26794
|
+
var buffer = this.buffer !== null ? builder.createString(this.buffer) : 0;
|
|
26795
|
+
var binaryData = FBGeometryData.createBinaryDataVector(builder, this.binaryData);
|
|
26796
|
+
var boneNames = FBGeometryData.createBoneNamesVector(builder, builder.createObjectOffsetList(this.boneNames));
|
|
26797
|
+
var rootBoneName = this.rootBoneName !== null ? builder.createString(this.rootBoneName) : 0;
|
|
26798
|
+
var inverseBindMatrices = FBGeometryData.createInverseBindMatricesVector(builder, this.inverseBindMatrices);
|
|
26799
|
+
FBGeometryData.startFBGeometryData(builder);
|
|
26800
|
+
FBGeometryData.addId(builder, id);
|
|
26801
|
+
FBGeometryData.addName(builder, name);
|
|
26802
|
+
FBGeometryData.addVertexData(builder, vertexData);
|
|
26803
|
+
FBGeometryData.addIndexFormat(builder, this.indexFormat);
|
|
26804
|
+
FBGeometryData.addIndexOffset(builder, this.indexOffset);
|
|
26805
|
+
FBGeometryData.addSubMeshes(builder, subMeshes);
|
|
26806
|
+
FBGeometryData.addMode(builder, this.mode);
|
|
26807
|
+
FBGeometryData.addBuffer(builder, buffer);
|
|
26808
|
+
FBGeometryData.addBinaryData(builder, binaryData);
|
|
26809
|
+
FBGeometryData.addBoneNames(builder, boneNames);
|
|
26810
|
+
FBGeometryData.addRootBoneName(builder, rootBoneName);
|
|
26811
|
+
FBGeometryData.addInverseBindMatrices(builder, inverseBindMatrices);
|
|
26812
|
+
return FBGeometryData.endFBGeometryData(builder);
|
|
26813
|
+
};
|
|
26814
|
+
return FBGeometryDataT;
|
|
26815
|
+
}();
|
|
26816
|
+
|
|
26817
|
+
/**
|
|
26818
|
+
* @since 2.0.0
|
|
26819
|
+
* @internal
|
|
26820
|
+
*/ var EffectsPackage = /*#__PURE__*/ function() {
|
|
26821
|
+
function EffectsPackage() {
|
|
26822
|
+
this.exportObjectDatas = [];
|
|
26823
|
+
}
|
|
26824
|
+
var _proto = EffectsPackage.prototype;
|
|
26825
|
+
_proto.addData = function addData(effectsObjectData) {
|
|
26826
|
+
this.exportObjectDatas.push(effectsObjectData);
|
|
26827
|
+
};
|
|
26828
|
+
_proto.serializeToBinary = function serializeToBinary() {
|
|
26829
|
+
var fbb = new Builder(1);
|
|
26830
|
+
var effectsPackage = new FBEffectsPackageDataT();
|
|
26831
|
+
var exportObjects = [];
|
|
26832
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(this.exportObjectDatas), _step; !(_step = _iterator()).done;){
|
|
26833
|
+
var effectsObjectData = _step.value;
|
|
26834
|
+
var fbEffectsObjectData = void 0;
|
|
26835
|
+
if (effectsObjectData.dataType === DataType.Geometry) {
|
|
26836
|
+
fbEffectsObjectData = new FBEffectsObjectDataT("Geometry", this.geometryDataToBinary(effectsObjectData));
|
|
26837
|
+
}
|
|
26838
|
+
if (!fbEffectsObjectData) {
|
|
26839
|
+
continue;
|
|
26840
|
+
}
|
|
26841
|
+
exportObjects.push(fbEffectsObjectData);
|
|
26842
|
+
}
|
|
26843
|
+
effectsPackage.exportObjects = exportObjects;
|
|
26844
|
+
FBEffectsPackageData.finishFBEffectsPackageDataBuffer(fbb, effectsPackage.pack(fbb));
|
|
26845
|
+
return fbb.asUint8Array(); // Of type `Uint8Array`.
|
|
26846
|
+
};
|
|
26847
|
+
_proto.deserializeFromBinary = function deserializeFromBinary(buffer) {
|
|
26848
|
+
var buf = new ByteBuffer(buffer);
|
|
26849
|
+
var fbEffectsPackage = FBEffectsPackageData.getRootAsFBEffectsPackageData(buf);
|
|
26850
|
+
for(var i = 0; i < fbEffectsPackage.exportObjectsLength(); i++){
|
|
26851
|
+
var fbEffectsObjectData = fbEffectsPackage.exportObjects(i);
|
|
26852
|
+
if (!fbEffectsObjectData) {
|
|
26853
|
+
continue;
|
|
26854
|
+
}
|
|
26855
|
+
var dataBuffer = fbEffectsObjectData.dataArray();
|
|
26856
|
+
var dataType = fbEffectsObjectData.dataType();
|
|
26857
|
+
if (!dataBuffer) {
|
|
26858
|
+
continue;
|
|
26859
|
+
}
|
|
26860
|
+
var effectsObjectData = void 0;
|
|
26861
|
+
if (dataType === DataType.Geometry) {
|
|
26862
|
+
effectsObjectData = this.binaryToGeometryData(dataBuffer);
|
|
26863
|
+
}
|
|
26864
|
+
if (!effectsObjectData) {
|
|
26865
|
+
continue;
|
|
26866
|
+
}
|
|
26867
|
+
this.exportObjectDatas.push(effectsObjectData);
|
|
26868
|
+
}
|
|
26869
|
+
};
|
|
26870
|
+
_proto.geometryDataToBinary = function geometryDataToBinary(geometryData) {
|
|
26871
|
+
var fbb = new Builder(1);
|
|
26872
|
+
var fbGeometryData = new FBGeometryDataT();
|
|
26873
|
+
var indexFormat = geometryData.indexFormat, indexOffset = geometryData.indexOffset, mode = geometryData.mode, id = geometryData.id, vertexData = geometryData.vertexData, _geometryData_boneNames = geometryData.boneNames, boneNames = _geometryData_boneNames === void 0 ? [] : _geometryData_boneNames, _geometryData_rootBoneName = geometryData.rootBoneName, rootBoneName = _geometryData_rootBoneName === void 0 ? "" : _geometryData_rootBoneName, _geometryData_inverseBindMatrices = geometryData.inverseBindMatrices, inverseBindMatrices = _geometryData_inverseBindMatrices === void 0 ? [] : _geometryData_inverseBindMatrices, _geometryData_binaryData = geometryData.binaryData, binaryData = _geometryData_binaryData === void 0 ? [] : _geometryData_binaryData;
|
|
26874
|
+
fbGeometryData.indexFormat = indexFormat;
|
|
26875
|
+
fbGeometryData.indexOffset = indexOffset;
|
|
26876
|
+
fbGeometryData.mode = mode;
|
|
26877
|
+
fbGeometryData.id = id;
|
|
26878
|
+
fbGeometryData.boneNames = boneNames;
|
|
26879
|
+
fbGeometryData.rootBoneName = rootBoneName;
|
|
26880
|
+
fbGeometryData.inverseBindMatrices = inverseBindMatrices;
|
|
26881
|
+
fbGeometryData.binaryData = binaryData;
|
|
26882
|
+
var fbVertexdata = new FBVertexDataT();
|
|
26883
|
+
fbVertexdata.vertexCount = vertexData.vertexCount;
|
|
26884
|
+
fbVertexdata.channels = [];
|
|
26885
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(vertexData.channels), _step; !(_step = _iterator()).done;){
|
|
26886
|
+
var channel = _step.value;
|
|
26887
|
+
var semantic = channel.semantic, offset = channel.offset, format = channel.format, dimension = channel.dimension, normalize = channel.normalize;
|
|
26888
|
+
var fbChannel = new FBVertexChannelT(semantic, offset, format, dimension, normalize);
|
|
26889
|
+
fbVertexdata.channels.push(fbChannel);
|
|
26890
|
+
}
|
|
26891
|
+
fbGeometryData.vertexData = fbVertexdata;
|
|
26892
|
+
var fbSubMeshes = [];
|
|
26893
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(geometryData.subMeshes), _step1; !(_step1 = _iterator1()).done;){
|
|
26894
|
+
var subMesh = _step1.value;
|
|
26895
|
+
var offset1 = subMesh.offset, indexCount = subMesh.indexCount, vertexCount = subMesh.vertexCount;
|
|
26896
|
+
var fbSubMesh = new FBSubMeshT(offset1, indexCount, vertexCount);
|
|
26897
|
+
fbSubMeshes.push(fbSubMesh);
|
|
26898
|
+
}
|
|
26899
|
+
fbGeometryData.subMeshes = fbSubMeshes;
|
|
26900
|
+
FBEffectsPackageData.finishFBEffectsPackageDataBuffer(fbb, fbGeometryData.pack(fbb));
|
|
26901
|
+
return fbb.asUint8Array(); // Of type `Uint8Array`.
|
|
26902
|
+
};
|
|
26903
|
+
_proto.binaryToGeometryData = function binaryToGeometryData(buffer) {
|
|
26904
|
+
var buf = new ByteBuffer(buffer);
|
|
26905
|
+
var fbGeometryData = FBGeometryData.getRootAsFBGeometryData(buf);
|
|
26906
|
+
var vertexData = {
|
|
26907
|
+
vertexCount: 0,
|
|
26908
|
+
channels: []
|
|
26909
|
+
};
|
|
26910
|
+
var fbVertexData = fbGeometryData.vertexData();
|
|
26911
|
+
if (fbVertexData) {
|
|
26912
|
+
vertexData.vertexCount = fbVertexData.vertexCount();
|
|
26913
|
+
for(var i = 0; i < fbVertexData.channelsLength(); i++){
|
|
26914
|
+
var channel = fbVertexData.channels(i);
|
|
26915
|
+
if (!channel) {
|
|
26916
|
+
continue;
|
|
26917
|
+
}
|
|
26918
|
+
var _channel_semantic;
|
|
26919
|
+
var vertexChannel = {
|
|
26920
|
+
semantic: (_channel_semantic = channel.semantic()) != null ? _channel_semantic : "",
|
|
26921
|
+
offset: channel.offset(),
|
|
26922
|
+
format: channel.format(),
|
|
26923
|
+
dimension: channel.dimension(),
|
|
26924
|
+
normalize: channel.normalize()
|
|
26925
|
+
};
|
|
26926
|
+
vertexData.channels.push(vertexChannel);
|
|
26927
|
+
}
|
|
26928
|
+
}
|
|
26929
|
+
var subMeshes = [];
|
|
26930
|
+
for(var i1 = 0; i1 < fbGeometryData.subMeshesLength(); i1++){
|
|
26931
|
+
var fbSubMesh = fbGeometryData.subMeshes(i1);
|
|
26932
|
+
if (!fbSubMesh) {
|
|
26933
|
+
continue;
|
|
26934
|
+
}
|
|
26935
|
+
var subMesh = {
|
|
26936
|
+
offset: fbSubMesh.offset(),
|
|
26937
|
+
vertexCount: fbSubMesh.vertexCount(),
|
|
26938
|
+
indexCount: fbSubMesh.indexCount()
|
|
26939
|
+
};
|
|
26940
|
+
subMeshes.push(subMesh);
|
|
26941
|
+
}
|
|
26942
|
+
var boneNames = [];
|
|
26943
|
+
for(var i2 = 0; i2 < fbGeometryData.boneNamesLength(); i2++){
|
|
26944
|
+
var boneName = fbGeometryData.boneNames(i2);
|
|
26945
|
+
boneNames.push(boneName);
|
|
26946
|
+
}
|
|
26947
|
+
var inverseBindMatricesArray = fbGeometryData.inverseBindMatricesArray();
|
|
26948
|
+
var _fbGeometryData_buffer, _fbGeometryData_rootBoneName, _fbGeometryData_binaryDataArray, _fbGeometryData_id;
|
|
26949
|
+
var geometryData = {
|
|
26950
|
+
vertexData: vertexData,
|
|
26951
|
+
indexFormat: fbGeometryData.indexFormat(),
|
|
26952
|
+
indexOffset: fbGeometryData.indexOffset(),
|
|
26953
|
+
subMeshes: subMeshes,
|
|
26954
|
+
mode: fbGeometryData.mode(),
|
|
26955
|
+
buffer: (_fbGeometryData_buffer = fbGeometryData.buffer()) != null ? _fbGeometryData_buffer : "",
|
|
26956
|
+
boneNames: boneNames,
|
|
26957
|
+
rootBoneName: (_fbGeometryData_rootBoneName = fbGeometryData.rootBoneName()) != null ? _fbGeometryData_rootBoneName : "",
|
|
26958
|
+
inverseBindMatrices: inverseBindMatricesArray ? Array.from(inverseBindMatricesArray) : undefined,
|
|
26959
|
+
binaryData: (_fbGeometryData_binaryDataArray = fbGeometryData.binaryDataArray()) != null ? _fbGeometryData_binaryDataArray : undefined,
|
|
26960
|
+
id: (_fbGeometryData_id = fbGeometryData.id()) != null ? _fbGeometryData_id : "",
|
|
26961
|
+
dataType: DataType.Geometry
|
|
26962
|
+
};
|
|
26963
|
+
return geometryData;
|
|
26964
|
+
};
|
|
26965
|
+
return EffectsPackage;
|
|
26966
|
+
}();
|
|
26967
|
+
|
|
26968
|
+
/**
|
|
26969
|
+
* Engine 基类,负责维护所有 GPU 资源的管理及销毁
|
|
26970
|
+
*/ var Engine = /*#__PURE__*/ function() {
|
|
26971
|
+
function Engine() {
|
|
26972
|
+
/**
|
|
26973
|
+
* 渲染过程中错误队列
|
|
26974
|
+
*/ this.renderErrors = new Set();
|
|
26975
|
+
this.destroyed = false;
|
|
26976
|
+
this.textures = [];
|
|
26977
|
+
this.materials = [];
|
|
26978
|
+
this.geometries = [];
|
|
26979
|
+
this.meshes = [];
|
|
26980
|
+
this.renderPasses = [];
|
|
26981
|
+
this.jsonSceneData = {};
|
|
26982
|
+
this.objectInstance = {};
|
|
26983
|
+
this.assetLoader = new AssetLoader(this);
|
|
26984
|
+
this.emptyTexture = generateWhiteTexture(this);
|
|
26985
|
+
this.transparentTexture = generateTransparentTexture(this);
|
|
26986
|
+
}
|
|
26987
|
+
var _proto = Engine.prototype;
|
|
26988
|
+
_proto.clearResources = function clearResources() {
|
|
26989
|
+
this.jsonSceneData = {};
|
|
26990
|
+
this.objectInstance = {};
|
|
26991
|
+
};
|
|
26992
|
+
_proto.addEffectsObjectData = function addEffectsObjectData(data) {
|
|
26993
|
+
this.jsonSceneData[data.id] = data;
|
|
26994
|
+
};
|
|
26995
|
+
_proto.findEffectsObjectData = function findEffectsObjectData(uuid) {
|
|
26996
|
+
return this.jsonSceneData[uuid];
|
|
26997
|
+
};
|
|
26998
|
+
_proto.addInstance = function addInstance(effectsObject) {
|
|
26999
|
+
this.objectInstance[effectsObject.getInstanceId()] = effectsObject;
|
|
27000
|
+
};
|
|
27001
|
+
_proto.getInstance = function getInstance(id) {
|
|
27002
|
+
return this.objectInstance[id];
|
|
27003
|
+
};
|
|
27004
|
+
_proto.removeInstance = function removeInstance(id) {
|
|
27005
|
+
delete this.objectInstance[id];
|
|
27006
|
+
};
|
|
27007
|
+
_proto.addPackageDatas = function addPackageDatas(scene) {
|
|
27008
|
+
var jsonScene = scene.jsonScene, _scene_textureOptions = scene.textureOptions, textureOptions = _scene_textureOptions === void 0 ? [] : _scene_textureOptions;
|
|
27009
|
+
var _jsonScene_items = jsonScene.items, items = _jsonScene_items === void 0 ? [] : _jsonScene_items, _jsonScene_materials = jsonScene.materials, materials = _jsonScene_materials === void 0 ? [] : _jsonScene_materials, _jsonScene_shaders = jsonScene.shaders, shaders = _jsonScene_shaders === void 0 ? [] : _jsonScene_shaders, _jsonScene_geometries = jsonScene.geometries, geometries = _jsonScene_geometries === void 0 ? [] : _jsonScene_geometries, _jsonScene_components = jsonScene.components, components = _jsonScene_components === void 0 ? [] : _jsonScene_components, _jsonScene_animations = jsonScene.animations, animations = _jsonScene_animations === void 0 ? [] : _jsonScene_animations, _jsonScene_bins = jsonScene.bins, bins = _jsonScene_bins === void 0 ? [] : _jsonScene_bins, _jsonScene_miscs = jsonScene.miscs, miscs = _jsonScene_miscs === void 0 ? [] : _jsonScene_miscs;
|
|
27010
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(items), _step; !(_step = _iterator()).done;){
|
|
27011
|
+
var vfxItemData = _step.value;
|
|
27012
|
+
this.addEffectsObjectData(vfxItemData);
|
|
27013
|
+
}
|
|
27014
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(materials), _step1; !(_step1 = _iterator1()).done;){
|
|
27015
|
+
var materialData = _step1.value;
|
|
27016
|
+
this.addEffectsObjectData(materialData);
|
|
27017
|
+
}
|
|
27018
|
+
for(var _iterator2 = _create_for_of_iterator_helper_loose(shaders), _step2; !(_step2 = _iterator2()).done;){
|
|
27019
|
+
var shaderData = _step2.value;
|
|
27020
|
+
this.addEffectsObjectData(shaderData);
|
|
27021
|
+
}
|
|
27022
|
+
for(var _iterator3 = _create_for_of_iterator_helper_loose(geometries), _step3; !(_step3 = _iterator3()).done;){
|
|
27023
|
+
var geometryData = _step3.value;
|
|
27024
|
+
this.addEffectsObjectData(geometryData);
|
|
27025
|
+
}
|
|
27026
|
+
for(var _iterator4 = _create_for_of_iterator_helper_loose(components), _step4; !(_step4 = _iterator4()).done;){
|
|
25397
27027
|
var componentData = _step4.value;
|
|
25398
27028
|
this.addEffectsObjectData(componentData);
|
|
25399
27029
|
}
|
|
@@ -25408,16 +27038,23 @@ var listOrder = 0;
|
|
|
25408
27038
|
for(var i = 0; i < bins.length; i++){
|
|
25409
27039
|
var binaryData = bins[i];
|
|
25410
27040
|
var binaryBuffer = scene.bins[i];
|
|
25411
|
-
|
|
25412
|
-
binaryData.buffer = binaryBuffer;
|
|
25413
|
-
//@ts-expect-error
|
|
25414
|
-
if (binaryData.id) {
|
|
27041
|
+
if (binaryData.dataType === DataType.BinaryAsset) {
|
|
25415
27042
|
//@ts-expect-error
|
|
25416
|
-
|
|
27043
|
+
binaryData.buffer = binaryBuffer;
|
|
27044
|
+
if (binaryData.id) {
|
|
27045
|
+
this.addEffectsObjectData(binaryData);
|
|
27046
|
+
}
|
|
27047
|
+
} else {
|
|
27048
|
+
var effectsPackage = new EffectsPackage();
|
|
27049
|
+
effectsPackage.deserializeFromBinary(new Uint8Array(binaryBuffer));
|
|
27050
|
+
for(var _iterator7 = _create_for_of_iterator_helper_loose(effectsPackage.exportObjectDatas), _step7; !(_step7 = _iterator7()).done;){
|
|
27051
|
+
var effectsObjectData = _step7.value;
|
|
27052
|
+
this.addEffectsObjectData(effectsObjectData);
|
|
27053
|
+
}
|
|
25417
27054
|
}
|
|
25418
27055
|
}
|
|
25419
|
-
for(var
|
|
25420
|
-
var textureData =
|
|
27056
|
+
for(var _iterator8 = _create_for_of_iterator_helper_loose(textureOptions), _step8; !(_step8 = _iterator8()).done;){
|
|
27057
|
+
var textureData = _step8.value;
|
|
25421
27058
|
this.addEffectsObjectData(textureData);
|
|
25422
27059
|
}
|
|
25423
27060
|
};
|
|
@@ -25727,8 +27364,8 @@ registerPlugin("sprite", SpriteLoader, VFXItem, true);
|
|
|
25727
27364
|
registerPlugin("particle", ParticleLoader, VFXItem, true);
|
|
25728
27365
|
registerPlugin("cal", CalculateLoader, VFXItem, true);
|
|
25729
27366
|
registerPlugin("interact", InteractLoader, VFXItem, true);
|
|
25730
|
-
var version = "2.0.0-alpha.
|
|
27367
|
+
var version = "2.0.0-alpha.28";
|
|
25731
27368
|
logger.info("Core version: " + version + ".");
|
|
25732
27369
|
|
|
25733
|
-
export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, AssetLoader, AssetManager, BYTES_TYPE_MAP, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, COMPRESSED_TEXTURE, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, Component, Composition, CompositionComponent, CompositionSourceManager, DEFAULT_FONTS, Database, DestroyOptions, Downloader, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, EffectComponent, EffectsObject, Engine, EventSystem, FilterMode, Float16ArrayWrapper, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, HELP_LINK, HitTestType, InteractComponent, InteractLoader, InteractMesh, Item, ItemBehaviour, KTXTexture, LineSegments, LinearValue, Material, MaterialDataBlock, MaterialRenderType, Mesh, ObjectBindingTrack, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, PassTextureCache, PathSegments, PluginSystem, RENDER_PASS_NAME_PREFIX, RENDER_PREFER_LOOKUP_TEXTURE, RUNTIME_ENV, RandomSetValue, RandomValue, RandomVectorValue, RenderFrame, RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, RenderTargetHandle, RenderTextureFormat, Renderbuffer, Renderer, RendererComponent, RuntimeClip, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0, SEMANTIC_PRE_COLOR_ATTACHMENT_0, SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0, SPRITE_VERTEX_STRIDE, SemanticMap, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderType, ShaderVariant, SpriteColorPlayable, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteLoader, StaticValue, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, Ticker, TimelineAsset, TimelineClip, TimelinePlayable, TrackAsset, TrackSortWrapper, TrackType, Transform, TransformAnimationPlayable, TransformPlayableAsset, TransformTrack, VFXItem, ValueGetter, addByOrder, addItem, addItemWithOrder, applyMixins, assertExist, asserts, base64ToFile, blend, calculateTranslation, canvasPool, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, compatible_frag as compatibleFrag, compatible_vert as compatibleVert, createCopyShader, createGLContext, createKeyFrameMeta, createShaderWithMacros, createShape,
|
|
27370
|
+
export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, AssetLoader, AssetManager, BYTES_TYPE_MAP, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, COMPRESSED_TEXTURE, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, Component, Composition, CompositionComponent, CompositionSourceManager, DEFAULT_FONTS, Database, DestroyOptions, Downloader, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, EffectComponent, EffectsObject, EffectsPackage, Engine, EventSystem, FilterMode, Float16ArrayWrapper, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, HELP_LINK, HitTestType, InteractComponent, InteractLoader, InteractMesh, Item, ItemBehaviour, KTXTexture, LineSegments, LinearValue, Material, MaterialDataBlock, MaterialRenderType, Mesh, ObjectBindingTrack, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, PassTextureCache, PathSegments, PluginSystem, PostProcessVolume, RENDER_PASS_NAME_PREFIX, RENDER_PREFER_LOOKUP_TEXTURE, RUNTIME_ENV, RandomSetValue, RandomValue, RandomVectorValue, RenderFrame, RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, RenderTargetHandle, RenderTextureFormat, Renderbuffer, Renderer, RendererComponent, RuntimeClip, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0, SEMANTIC_PRE_COLOR_ATTACHMENT_0, SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0, SPRITE_VERTEX_STRIDE, SemanticMap, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderType, ShaderVariant, SpriteColorPlayable, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteLoader, StaticValue, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, Ticker, TimelineAsset, TimelineClip, TimelinePlayable, TrackAsset, TrackSortWrapper, TrackType, Transform, TransformAnimationPlayable, TransformPlayableAsset, TransformTrack, VFXItem, ValueGetter, addByOrder, addItem, addItemWithOrder, applyMixins, assertExist, asserts, base64ToFile, blend, calculateTranslation, canvasPool, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, compatible_frag as compatibleFrag, compatible_vert as compatibleVert, createCopyShader, createGLContext, createKeyFrameMeta, createShaderWithMacros, createShape, createValueGetter, decimalEqual, defaultGlobalVolume, defaultPlugins, deserializeMipmapTexture, earcut, effectsClass, effectsClassStore, enlargeBuffer, ensureFixedNumber, ensureVec3, findPreviousRenderPass, gaussianDown_frag as gaussianDownFrag, gaussianDownHFrag, gaussianDownVFrag, gaussianUpFrag, generateEmptyTypedArray, generateGUID, generateHalfFloatTexture, generateTransparentTexture, generateWhiteTexture, getBackgroundImage, getColorFromGradientStops, getConfig, getDefaultTemplateCanvasPool, getDefaultTextureFactory, getGeometryByShape, getGeometryTriangles, getImageItemRenderInfo, getKTXTextureOptions, getKeyFrameMetaByRawValue, getMergedStore, getParticleMeshShader, getPixelRatio, getPreMultiAlpha, getStandardComposition, getStandardImage, getStandardItem, getStandardJSON, getTextureSize, glContext, glType2VertexFormatType, gpuTimer, imageDataFromColor, imageDataFromGradient, initErrors, initGLContext, integrate, interpolateColor, isAlipayMiniApp, isAndroid, isArray, isCanvas, isFunction, isIOS, isIOSByUA, isMiniProgram, isObject, isSceneJSON, isSceneURL, isSceneWithOptions, isSimulatorCellPhone, isString, isUniformStruct, isUniformStructArray, isValidFontFamily, isWebGL2, isWechatMiniApp, itemFrag, itemFrameFrag, itemVert, loadBinary, loadBlob, loadImage, loadMedia, loadVideo, loadWebPOptional, logger, index as math, maxSpriteMeshItemCount, modifyMaxKeyframeShader, nearestPowerOfTwo, noop, normalizeColor, numberToFix, parsePercent$1 as parsePercent, particleFrag, particleOriginTranslateMap$1 as particleOriginTranslateMap, particleUniformTypeMap, particleVert, pluginLoaderMap, pointOnLine, randomInRange, registerPlugin, removeItem, rotateVec2, screenMeshVert, serialize, setBlendMode, setConfig, setDefaultTextureFactory, setMaskMode, setMaxSpriteMeshItemCount, setRayFromCamera, setSideMode, setSpriteMeshMaxItemCountByGPU, sortByOrder, index$1 as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecAssign, vecFill, vecMulCombine, vecNormalize, version, vertexFormatType2GLType };
|
|
25734
27371
|
//# sourceMappingURL=index.mjs.map
|