@galacean/effects-core 2.0.0-alpha.26 → 2.0.0-alpha.27
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/composition-source-manager.d.ts +1 -1
- package/dist/effects-package.d.ts +15 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1646 -70
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1646 -71
- package/dist/index.mjs.map +1 -1
- package/dist/plugins/timeline/track.d.ts +2 -2
- package/dist/vfx-item.d.ts +1 -1
- package/package.json +5 -3
package/dist/index.js
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.27
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
@@ -4001,13 +4001,29 @@ var RenderFace;
|
|
|
4001
4001
|
RenderFace["Front"] = "Front";
|
|
4002
4002
|
})(RenderFace || (RenderFace = {}));
|
|
4003
4003
|
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
var
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
var
|
|
4004
|
+
/**
|
|
4005
|
+
* 销毁
|
|
4006
|
+
*/ var END_BEHAVIOR_DESTROY = 0;
|
|
4007
|
+
/**
|
|
4008
|
+
* 暂停
|
|
4009
|
+
* @deprecated since 2.0 - use `END_BEHAVIOR_FREEZE` instead
|
|
4010
|
+
*/ var END_BEHAVIOR_PAUSE = 1;
|
|
4011
|
+
/**
|
|
4012
|
+
* 无限播放
|
|
4013
|
+
*/ var END_BEHAVIOR_FORWARD = 2;
|
|
4014
|
+
/**
|
|
4015
|
+
* 销毁并保留最后一帧
|
|
4016
|
+
* @deprecated since 2.0
|
|
4017
|
+
*/ var END_BEHAVIOR_PAUSE_AND_DESTROY = 3;
|
|
4018
|
+
/**
|
|
4019
|
+
* 冻结
|
|
4020
|
+
*/ var END_BEHAVIOR_FREEZE = 4;
|
|
4021
|
+
/**
|
|
4022
|
+
* 重播
|
|
4023
|
+
*/ var END_BEHAVIOR_RESTART = 5;
|
|
4024
|
+
/**
|
|
4025
|
+
*
|
|
4026
|
+
*/ var END_BEHAVIOR_DESTROY_CHILDREN = 6;
|
|
4011
4027
|
var CAMERA_CLIP_MODE_VERTICAL = 1;
|
|
4012
4028
|
var CAMERA_CLIP_MODE_NORMAL = 0;
|
|
4013
4029
|
var MESSAGE_ITEM_PHRASE_BEGIN = 2;
|
|
@@ -4022,29 +4038,6 @@ var CameraClipMode;
|
|
|
4022
4038
|
* 剪裁左右
|
|
4023
4039
|
*/ CameraClipMode[CameraClipMode["landscape"] = 0] = "landscape";
|
|
4024
4040
|
})(CameraClipMode || (CameraClipMode = {}));
|
|
4025
|
-
/**
|
|
4026
|
-
* 结束行为
|
|
4027
|
-
*/ var CompositionEndBehavior;
|
|
4028
|
-
(function(CompositionEndBehavior) {
|
|
4029
|
-
/**
|
|
4030
|
-
* 销毁
|
|
4031
|
-
*/ CompositionEndBehavior[CompositionEndBehavior["destroy"] = 0] = "destroy";
|
|
4032
|
-
/**
|
|
4033
|
-
* 暂停
|
|
4034
|
-
*/ CompositionEndBehavior[CompositionEndBehavior["pause"] = 1] = "pause";
|
|
4035
|
-
/**
|
|
4036
|
-
* 重播
|
|
4037
|
-
*/ CompositionEndBehavior[CompositionEndBehavior["restart"] = 5] = "restart";
|
|
4038
|
-
/**
|
|
4039
|
-
* 无限播放
|
|
4040
|
-
*/ CompositionEndBehavior[CompositionEndBehavior["forward"] = 2] = "forward";
|
|
4041
|
-
/**
|
|
4042
|
-
* 销毁并保留最后一帧
|
|
4043
|
-
*/ CompositionEndBehavior[CompositionEndBehavior["pause_destroy"] = 3] = "pause_destroy";
|
|
4044
|
-
/**
|
|
4045
|
-
* 冻结
|
|
4046
|
-
*/ CompositionEndBehavior[CompositionEndBehavior["freeze"] = 4] = "freeze";
|
|
4047
|
-
})(CompositionEndBehavior || (CompositionEndBehavior = {}));
|
|
4048
4041
|
|
|
4049
4042
|
/**
|
|
4050
4043
|
* 动态换图类型
|
|
@@ -4125,12 +4118,23 @@ var CameraClipMode;
|
|
|
4125
4118
|
BezierKeyframeType[BezierKeyframeType["LINE_OUT"] = 6] = "LINE_OUT";
|
|
4126
4119
|
})(BezierKeyframeType || (BezierKeyframeType = {}));
|
|
4127
4120
|
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4121
|
+
/**
|
|
4122
|
+
* 结束行为
|
|
4123
|
+
*/ var EndBehavior;
|
|
4124
|
+
(function(EndBehavior) {
|
|
4125
|
+
/**
|
|
4126
|
+
* 销毁
|
|
4127
|
+
*/ EndBehavior[EndBehavior["destroy"] = 0] = "destroy";
|
|
4128
|
+
/**
|
|
4129
|
+
* 重播
|
|
4130
|
+
*/ EndBehavior[EndBehavior["restart"] = 5] = "restart";
|
|
4131
|
+
/**
|
|
4132
|
+
* 无限播放
|
|
4133
|
+
*/ EndBehavior[EndBehavior["forward"] = 2] = "forward";
|
|
4134
|
+
/**
|
|
4135
|
+
* 冻结
|
|
4136
|
+
*/ EndBehavior[EndBehavior["freeze"] = 4] = "freeze";
|
|
4137
|
+
})(EndBehavior || (EndBehavior = {}));
|
|
4134
4138
|
var ParentItemEndBehavior;
|
|
4135
4139
|
(function(ParentItemEndBehavior) {
|
|
4136
4140
|
ParentItemEndBehavior[ParentItemEndBehavior["destroyChildren"] = 6] = "destroyChildren";
|
|
@@ -4455,7 +4459,6 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
4455
4459
|
get RenderType () { return RenderType; },
|
|
4456
4460
|
get RenderFace () { return RenderFace; },
|
|
4457
4461
|
get CameraClipMode () { return CameraClipMode; },
|
|
4458
|
-
get CompositionEndBehavior () { return CompositionEndBehavior; },
|
|
4459
4462
|
get BackgroundType () { return BackgroundType; },
|
|
4460
4463
|
END_BEHAVIOR_DESTROY: END_BEHAVIOR_DESTROY,
|
|
4461
4464
|
END_BEHAVIOR_PAUSE: END_BEHAVIOR_PAUSE,
|
|
@@ -4470,7 +4473,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
4470
4473
|
MESSAGE_ITEM_PHRASE_END: MESSAGE_ITEM_PHRASE_END,
|
|
4471
4474
|
get ValueType () { return ValueType; },
|
|
4472
4475
|
get BezierKeyframeType () { return BezierKeyframeType; },
|
|
4473
|
-
get
|
|
4476
|
+
get EndBehavior () { return EndBehavior; },
|
|
4474
4477
|
get ParentItemEndBehavior () { return ParentItemEndBehavior; },
|
|
4475
4478
|
get ParticleInteractionBehavior () { return ParticleInteractionBehavior; },
|
|
4476
4479
|
get ShapeArcMode () { return ShapeArcMode; },
|
|
@@ -16620,7 +16623,7 @@ exports.ParticleSystem = /*#__PURE__*/ function(Component) {
|
|
|
16620
16623
|
}
|
|
16621
16624
|
}
|
|
16622
16625
|
}
|
|
16623
|
-
} else if (this.item.endBehavior ===
|
|
16626
|
+
} else if (this.item.endBehavior === EndBehavior.restart) {
|
|
16624
16627
|
updateTrail();
|
|
16625
16628
|
this.loopStartTime = now - duration;
|
|
16626
16629
|
this.lastEmitTime -= duration;
|
|
@@ -16639,12 +16642,12 @@ exports.ParticleSystem = /*#__PURE__*/ function(Component) {
|
|
|
16639
16642
|
this.ended = true;
|
|
16640
16643
|
this.onEnd(this);
|
|
16641
16644
|
var endBehavior = this.item.endBehavior;
|
|
16642
|
-
if (endBehavior ===
|
|
16645
|
+
if (endBehavior === EndBehavior.freeze) {
|
|
16643
16646
|
this.frozen = true;
|
|
16644
16647
|
}
|
|
16645
16648
|
}
|
|
16646
|
-
} else if (this.item.endBehavior !==
|
|
16647
|
-
if (
|
|
16649
|
+
} else if (this.item.endBehavior !== EndBehavior.restart) {
|
|
16650
|
+
if (EndBehavior.destroy === this.item.endBehavior) {
|
|
16648
16651
|
var node = link.last;
|
|
16649
16652
|
if (node && node.content[0] < this.lastUpdate) {
|
|
16650
16653
|
this.destroyed = true;
|
|
@@ -18724,9 +18727,9 @@ var AnimationClipPlayable = /*#__PURE__*/ function(Playable) {
|
|
|
18724
18727
|
var localTime = time - this.start;
|
|
18725
18728
|
var duration = this.duration;
|
|
18726
18729
|
if (localTime - duration > 0.001) {
|
|
18727
|
-
if (this.endBehavior ===
|
|
18730
|
+
if (this.endBehavior === EndBehavior.restart) {
|
|
18728
18731
|
localTime = localTime % duration;
|
|
18729
|
-
} else if (this.endBehavior ===
|
|
18732
|
+
} else if (this.endBehavior === EndBehavior.freeze) {
|
|
18730
18733
|
localTime = Math.min(duration, localTime);
|
|
18731
18734
|
}
|
|
18732
18735
|
}
|
|
@@ -18852,7 +18855,7 @@ var RuntimeClip = /*#__PURE__*/ function() {
|
|
|
18852
18855
|
var ended = false;
|
|
18853
18856
|
var started = false;
|
|
18854
18857
|
var boundObject = this.track.binding;
|
|
18855
|
-
if (localTime > clip.start + clip.duration + 0.001 && clip.endBehavior ===
|
|
18858
|
+
if (localTime > clip.start + clip.duration + 0.001 && clip.endBehavior === EndBehavior.destroy) {
|
|
18856
18859
|
if (_instanceof1(boundObject, exports.VFXItem) && exports.VFXItem.isParticle(boundObject) && this.particleSystem && !this.particleSystem.destroyed) {
|
|
18857
18860
|
weight = 1.0;
|
|
18858
18861
|
} else {
|
|
@@ -19160,7 +19163,7 @@ function compareTracks(a, b) {
|
|
|
19160
19163
|
this.resolveBindings();
|
|
19161
19164
|
this.timelinePlayable = this.timelineAsset.createPlayable(this.graph);
|
|
19162
19165
|
// 重播不销毁元素
|
|
19163
|
-
if (this.item.endBehavior !==
|
|
19166
|
+
if (this.item.endBehavior !== EndBehavior.destroy) {
|
|
19164
19167
|
this.setReusable(true);
|
|
19165
19168
|
}
|
|
19166
19169
|
};
|
|
@@ -19227,7 +19230,7 @@ function compareTracks(a, b) {
|
|
|
19227
19230
|
compositionComponent.refId = refId;
|
|
19228
19231
|
item.transform.parentTransform = this.transform;
|
|
19229
19232
|
this.item.composition.refContent.push(item);
|
|
19230
|
-
if (item.endBehavior ===
|
|
19233
|
+
if (item.endBehavior === EndBehavior.restart) {
|
|
19231
19234
|
this.item.composition.autoRefTex = false;
|
|
19232
19235
|
}
|
|
19233
19236
|
compositionComponent.createContent();
|
|
@@ -22209,8 +22212,8 @@ function getStandardCameraContent(model) {
|
|
|
22209
22212
|
json.compositions.forEach(function(composition) {
|
|
22210
22213
|
composition.items.forEach(function(item) {
|
|
22211
22214
|
if (item.type === ItemType.null) {
|
|
22212
|
-
if (item.endBehavior ===
|
|
22213
|
-
item.endBehavior =
|
|
22215
|
+
if (item.endBehavior === EndBehavior.destroy) {
|
|
22216
|
+
item.endBehavior = EndBehavior.freeze;
|
|
22214
22217
|
}
|
|
22215
22218
|
}
|
|
22216
22219
|
});
|
|
@@ -22229,7 +22232,7 @@ function getStandardCameraContent(model) {
|
|
|
22229
22232
|
json.compositions.forEach(function(composition) {
|
|
22230
22233
|
composition.items.forEach(function(item) {
|
|
22231
22234
|
if (item.type === ItemType.mesh || item.type === ItemType.light) {
|
|
22232
|
-
item.endBehavior = item.endBehavior === 1 ?
|
|
22235
|
+
item.endBehavior = item.endBehavior === 1 ? EndBehavior.destroy : item.endBehavior;
|
|
22233
22236
|
}
|
|
22234
22237
|
});
|
|
22235
22238
|
});
|
|
@@ -22241,7 +22244,11 @@ function getStandardCameraContent(model) {
|
|
|
22241
22244
|
var _loop = function() {
|
|
22242
22245
|
var composition = _step1.value;
|
|
22243
22246
|
// composition 的 endBehavior 兼容
|
|
22244
|
-
if (
|
|
22247
|
+
if (// @ts-expect-error
|
|
22248
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
|
|
22249
|
+
composition.endBehavior === END_BEHAVIOR_PAUSE_AND_DESTROY || // @ts-expect-error
|
|
22250
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
|
|
22251
|
+
composition.endBehavior === END_BEHAVIOR_PAUSE) {
|
|
22245
22252
|
composition.endBehavior = END_BEHAVIOR_FREEZE;
|
|
22246
22253
|
}
|
|
22247
22254
|
// 过滤掉滤镜元素
|
|
@@ -23028,13 +23035,13 @@ function getStandardItem(item, opt) {
|
|
|
23028
23035
|
var looping = (_originContent_options = originContent.options) == null ? void 0 : _originContent_options.looping;
|
|
23029
23036
|
if (looping) {
|
|
23030
23037
|
if (Array.isArray(looping)) {
|
|
23031
|
-
endBehavior = looping[1] ?
|
|
23038
|
+
endBehavior = looping[1] ? EndBehavior.restart : EndBehavior.destroy;
|
|
23032
23039
|
} else {
|
|
23033
|
-
endBehavior =
|
|
23040
|
+
endBehavior = EndBehavior.restart;
|
|
23034
23041
|
}
|
|
23035
23042
|
} else {
|
|
23036
23043
|
var _originContent_options1;
|
|
23037
|
-
endBehavior = endBehavior || (originContent == null ? void 0 : (_originContent_options1 = originContent.options) == null ? void 0 : _originContent_options1.endBehavior) ||
|
|
23044
|
+
endBehavior = endBehavior || (originContent == null ? void 0 : (_originContent_options1 = originContent.options) == null ? void 0 : _originContent_options1.endBehavior) || EndBehavior.destroy;
|
|
23038
23045
|
}
|
|
23039
23046
|
if (originContent.options.renderLevel) {
|
|
23040
23047
|
renderLevel = originContent.options.renderLevel;
|
|
@@ -24379,7 +24386,7 @@ var listOrder = 0;
|
|
|
24379
24386
|
id: id,
|
|
24380
24387
|
duration: duration,
|
|
24381
24388
|
name: name,
|
|
24382
|
-
endBehavior: isNaN(endBehavior) ?
|
|
24389
|
+
endBehavior: isNaN(endBehavior) ? EndBehavior.freeze : endBehavior,
|
|
24383
24390
|
// looping,
|
|
24384
24391
|
items: items,
|
|
24385
24392
|
camera: camera,
|
|
@@ -24563,7 +24570,7 @@ var listOrder = 0;
|
|
|
24563
24570
|
};
|
|
24564
24571
|
this.reusable = reusable;
|
|
24565
24572
|
this.speed = speed;
|
|
24566
|
-
this.autoRefTex = !this.keepResource && imageUsage && this.rootItem.endBehavior !==
|
|
24573
|
+
this.autoRefTex = !this.keepResource && imageUsage && this.rootItem.endBehavior !== EndBehavior.restart;
|
|
24567
24574
|
this.name = sourceContent.name;
|
|
24568
24575
|
this.pluginSystem = pluginSystem;
|
|
24569
24576
|
this.pluginSystem.initializeComposition(this, scene);
|
|
@@ -24763,7 +24770,7 @@ var listOrder = 0;
|
|
|
24763
24770
|
* @returns 重新播放合成标志位
|
|
24764
24771
|
*/ _proto.shouldRestart = function shouldRestart() {
|
|
24765
24772
|
var _this_rootItem = this.rootItem, ended = _this_rootItem.ended, endBehavior = _this_rootItem.endBehavior;
|
|
24766
|
-
return ended && endBehavior ===
|
|
24773
|
+
return ended && endBehavior === EndBehavior.restart;
|
|
24767
24774
|
};
|
|
24768
24775
|
/**
|
|
24769
24776
|
* 是否合成需要销毁
|
|
@@ -24816,9 +24823,9 @@ var listOrder = 0;
|
|
|
24816
24823
|
var localTime = time - this.rootItem.start;
|
|
24817
24824
|
var duration = this.rootItem.duration;
|
|
24818
24825
|
if (localTime - duration > 0.001) {
|
|
24819
|
-
if (this.rootItem.endBehavior ===
|
|
24826
|
+
if (this.rootItem.endBehavior === EndBehavior.restart) {
|
|
24820
24827
|
localTime = localTime % duration;
|
|
24821
|
-
} else if (this.rootItem.endBehavior ===
|
|
24828
|
+
} else if (this.rootItem.endBehavior === EndBehavior.freeze) {
|
|
24822
24829
|
localTime = Math.min(duration, localTime);
|
|
24823
24830
|
}
|
|
24824
24831
|
}
|
|
@@ -24869,7 +24876,7 @@ var listOrder = 0;
|
|
|
24869
24876
|
for(var _iterator2 = _create_for_of_iterator_helper_loose(item.children), _step2; !(_step2 = _iterator2()).done;){
|
|
24870
24877
|
var child = _step2.value;
|
|
24871
24878
|
if (exports.VFXItem.isComposition(child)) {
|
|
24872
|
-
if (child.ended && child.endBehavior ===
|
|
24879
|
+
if (child.ended && child.endBehavior === EndBehavior.restart) {
|
|
24873
24880
|
child.ended = false;
|
|
24874
24881
|
// TODO K帧动画在元素重建后需要 tick ,否则会导致元素位置和 k 帧第一帧位置不一致
|
|
24875
24882
|
this.callUpdate(child, 0);
|
|
@@ -25080,7 +25087,7 @@ var listOrder = 0;
|
|
|
25080
25087
|
var _this = this;
|
|
25081
25088
|
// 预合成元素销毁时销毁其中的item
|
|
25082
25089
|
if (item.type == ItemType.composition) {
|
|
25083
|
-
if (item.endBehavior !==
|
|
25090
|
+
if (item.endBehavior !== EndBehavior.freeze) {
|
|
25084
25091
|
var contentItems = item.getComponent(CompositionComponent).items;
|
|
25085
25092
|
contentItems.forEach(function(it) {
|
|
25086
25093
|
return _this.pluginSystem.plugins.forEach(function(loader) {
|
|
@@ -25339,6 +25346,1567 @@ var listOrder = 0;
|
|
|
25339
25346
|
return Composition;
|
|
25340
25347
|
}();
|
|
25341
25348
|
|
|
25349
|
+
var SIZEOF_SHORT = 2;
|
|
25350
|
+
var SIZEOF_INT = 4;
|
|
25351
|
+
var FILE_IDENTIFIER_LENGTH = 4;
|
|
25352
|
+
var SIZE_PREFIX_LENGTH = 4;
|
|
25353
|
+
|
|
25354
|
+
var int32 = new Int32Array(2);
|
|
25355
|
+
var float32 = new Float32Array(int32.buffer);
|
|
25356
|
+
var float64 = new Float64Array(int32.buffer);
|
|
25357
|
+
var isLittleEndian = new Uint16Array(new Uint8Array([
|
|
25358
|
+
1,
|
|
25359
|
+
0
|
|
25360
|
+
]).buffer)[0] === 1;
|
|
25361
|
+
|
|
25362
|
+
var Encoding;
|
|
25363
|
+
(function(Encoding) {
|
|
25364
|
+
Encoding[Encoding["UTF8_BYTES"] = 1] = "UTF8_BYTES";
|
|
25365
|
+
Encoding[Encoding["UTF16_STRING"] = 2] = "UTF16_STRING";
|
|
25366
|
+
})(Encoding || (Encoding = {}));
|
|
25367
|
+
|
|
25368
|
+
var ByteBuffer = /*#__PURE__*/ function() {
|
|
25369
|
+
function ByteBuffer(bytes_) {
|
|
25370
|
+
this.bytes_ = bytes_;
|
|
25371
|
+
this.position_ = 0;
|
|
25372
|
+
this.text_decoder_ = new TextDecoder();
|
|
25373
|
+
}
|
|
25374
|
+
var _proto = ByteBuffer.prototype;
|
|
25375
|
+
_proto.clear = function clear() {
|
|
25376
|
+
this.position_ = 0;
|
|
25377
|
+
};
|
|
25378
|
+
/**
|
|
25379
|
+
* Get the underlying `Uint8Array`.
|
|
25380
|
+
*/ _proto.bytes = function bytes() {
|
|
25381
|
+
return this.bytes_;
|
|
25382
|
+
};
|
|
25383
|
+
/**
|
|
25384
|
+
* Get the buffer's position.
|
|
25385
|
+
*/ _proto.position = function position() {
|
|
25386
|
+
return this.position_;
|
|
25387
|
+
};
|
|
25388
|
+
/**
|
|
25389
|
+
* Set the buffer's position.
|
|
25390
|
+
*/ _proto.setPosition = function setPosition(position) {
|
|
25391
|
+
this.position_ = position;
|
|
25392
|
+
};
|
|
25393
|
+
/**
|
|
25394
|
+
* Get the buffer's capacity.
|
|
25395
|
+
*/ _proto.capacity = function capacity() {
|
|
25396
|
+
return this.bytes_.length;
|
|
25397
|
+
};
|
|
25398
|
+
_proto.readInt8 = function readInt8(offset) {
|
|
25399
|
+
return this.readUint8(offset) << 24 >> 24;
|
|
25400
|
+
};
|
|
25401
|
+
_proto.readUint8 = function readUint8(offset) {
|
|
25402
|
+
return this.bytes_[offset];
|
|
25403
|
+
};
|
|
25404
|
+
_proto.readInt16 = function readInt16(offset) {
|
|
25405
|
+
return this.readUint16(offset) << 16 >> 16;
|
|
25406
|
+
};
|
|
25407
|
+
_proto.readUint16 = function readUint16(offset) {
|
|
25408
|
+
return this.bytes_[offset] | this.bytes_[offset + 1] << 8;
|
|
25409
|
+
};
|
|
25410
|
+
_proto.readInt32 = function readInt32(offset) {
|
|
25411
|
+
return this.bytes_[offset] | this.bytes_[offset + 1] << 8 | this.bytes_[offset + 2] << 16 | this.bytes_[offset + 3] << 24;
|
|
25412
|
+
};
|
|
25413
|
+
_proto.readUint32 = function readUint32(offset) {
|
|
25414
|
+
return this.readInt32(offset) >>> 0;
|
|
25415
|
+
};
|
|
25416
|
+
_proto.readInt64 = function readInt64(offset) {
|
|
25417
|
+
return BigInt.asIntN(64, BigInt(this.readUint32(offset)) + (BigInt(this.readUint32(offset + 4)) << BigInt(32)));
|
|
25418
|
+
};
|
|
25419
|
+
_proto.readUint64 = function readUint64(offset) {
|
|
25420
|
+
return BigInt.asUintN(64, BigInt(this.readUint32(offset)) + (BigInt(this.readUint32(offset + 4)) << BigInt(32)));
|
|
25421
|
+
};
|
|
25422
|
+
_proto.readFloat32 = function readFloat32(offset) {
|
|
25423
|
+
int32[0] = this.readInt32(offset);
|
|
25424
|
+
return float32[0];
|
|
25425
|
+
};
|
|
25426
|
+
_proto.readFloat64 = function readFloat64(offset) {
|
|
25427
|
+
int32[isLittleEndian ? 0 : 1] = this.readInt32(offset);
|
|
25428
|
+
int32[isLittleEndian ? 1 : 0] = this.readInt32(offset + 4);
|
|
25429
|
+
return float64[0];
|
|
25430
|
+
};
|
|
25431
|
+
_proto.writeInt8 = function writeInt8(offset, value) {
|
|
25432
|
+
this.bytes_[offset] = value;
|
|
25433
|
+
};
|
|
25434
|
+
_proto.writeUint8 = function writeUint8(offset, value) {
|
|
25435
|
+
this.bytes_[offset] = value;
|
|
25436
|
+
};
|
|
25437
|
+
_proto.writeInt16 = function writeInt16(offset, value) {
|
|
25438
|
+
this.bytes_[offset] = value;
|
|
25439
|
+
this.bytes_[offset + 1] = value >> 8;
|
|
25440
|
+
};
|
|
25441
|
+
_proto.writeUint16 = function writeUint16(offset, value) {
|
|
25442
|
+
this.bytes_[offset] = value;
|
|
25443
|
+
this.bytes_[offset + 1] = value >> 8;
|
|
25444
|
+
};
|
|
25445
|
+
_proto.writeInt32 = function writeInt32(offset, value) {
|
|
25446
|
+
this.bytes_[offset] = value;
|
|
25447
|
+
this.bytes_[offset + 1] = value >> 8;
|
|
25448
|
+
this.bytes_[offset + 2] = value >> 16;
|
|
25449
|
+
this.bytes_[offset + 3] = value >> 24;
|
|
25450
|
+
};
|
|
25451
|
+
_proto.writeUint32 = function writeUint32(offset, value) {
|
|
25452
|
+
this.bytes_[offset] = value;
|
|
25453
|
+
this.bytes_[offset + 1] = value >> 8;
|
|
25454
|
+
this.bytes_[offset + 2] = value >> 16;
|
|
25455
|
+
this.bytes_[offset + 3] = value >> 24;
|
|
25456
|
+
};
|
|
25457
|
+
_proto.writeInt64 = function writeInt64(offset, value) {
|
|
25458
|
+
this.writeInt32(offset, Number(BigInt.asIntN(32, value)));
|
|
25459
|
+
this.writeInt32(offset + 4, Number(BigInt.asIntN(32, value >> BigInt(32))));
|
|
25460
|
+
};
|
|
25461
|
+
_proto.writeUint64 = function writeUint64(offset, value) {
|
|
25462
|
+
this.writeUint32(offset, Number(BigInt.asUintN(32, value)));
|
|
25463
|
+
this.writeUint32(offset + 4, Number(BigInt.asUintN(32, value >> BigInt(32))));
|
|
25464
|
+
};
|
|
25465
|
+
_proto.writeFloat32 = function writeFloat32(offset, value) {
|
|
25466
|
+
float32[0] = value;
|
|
25467
|
+
this.writeInt32(offset, int32[0]);
|
|
25468
|
+
};
|
|
25469
|
+
_proto.writeFloat64 = function writeFloat64(offset, value) {
|
|
25470
|
+
float64[0] = value;
|
|
25471
|
+
this.writeInt32(offset, int32[isLittleEndian ? 0 : 1]);
|
|
25472
|
+
this.writeInt32(offset + 4, int32[isLittleEndian ? 1 : 0]);
|
|
25473
|
+
};
|
|
25474
|
+
/**
|
|
25475
|
+
* Return the file identifier. Behavior is undefined for FlatBuffers whose
|
|
25476
|
+
* schema does not include a file_identifier (likely points at padding or the
|
|
25477
|
+
* start of a the root vtable).
|
|
25478
|
+
*/ _proto.getBufferIdentifier = function getBufferIdentifier() {
|
|
25479
|
+
if (this.bytes_.length < this.position_ + SIZEOF_INT + FILE_IDENTIFIER_LENGTH) {
|
|
25480
|
+
throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");
|
|
25481
|
+
}
|
|
25482
|
+
var result = "";
|
|
25483
|
+
for(var i = 0; i < FILE_IDENTIFIER_LENGTH; i++){
|
|
25484
|
+
result += String.fromCharCode(this.readInt8(this.position_ + SIZEOF_INT + i));
|
|
25485
|
+
}
|
|
25486
|
+
return result;
|
|
25487
|
+
};
|
|
25488
|
+
/**
|
|
25489
|
+
* Look up a field in the vtable, return an offset into the object, or 0 if the
|
|
25490
|
+
* field is not present.
|
|
25491
|
+
*/ _proto.__offset = function __offset(bb_pos, vtable_offset) {
|
|
25492
|
+
var vtable = bb_pos - this.readInt32(bb_pos);
|
|
25493
|
+
return vtable_offset < this.readInt16(vtable) ? this.readInt16(vtable + vtable_offset) : 0;
|
|
25494
|
+
};
|
|
25495
|
+
/**
|
|
25496
|
+
* Initialize any Table-derived type to point to the union at the given offset.
|
|
25497
|
+
*/ _proto.__union = function __union(t, offset) {
|
|
25498
|
+
t.bb_pos = offset + this.readInt32(offset);
|
|
25499
|
+
t.bb = this;
|
|
25500
|
+
return t;
|
|
25501
|
+
};
|
|
25502
|
+
/**
|
|
25503
|
+
* Create a JavaScript string from UTF-8 data stored inside the FlatBuffer.
|
|
25504
|
+
* This allocates a new string and converts to wide chars upon each access.
|
|
25505
|
+
*
|
|
25506
|
+
* To avoid the conversion to string, pass Encoding.UTF8_BYTES as the
|
|
25507
|
+
* "optionalEncoding" argument. This is useful for avoiding conversion when
|
|
25508
|
+
* the data will just be packaged back up in another FlatBuffer later on.
|
|
25509
|
+
*
|
|
25510
|
+
* @param offset
|
|
25511
|
+
* @param opt_encoding Defaults to UTF16_STRING
|
|
25512
|
+
*/ _proto.__string = function __string(offset, opt_encoding) {
|
|
25513
|
+
offset += this.readInt32(offset);
|
|
25514
|
+
var length = this.readInt32(offset);
|
|
25515
|
+
offset += SIZEOF_INT;
|
|
25516
|
+
var utf8bytes = this.bytes_.subarray(offset, offset + length);
|
|
25517
|
+
if (opt_encoding === Encoding.UTF8_BYTES) return utf8bytes;
|
|
25518
|
+
else return this.text_decoder_.decode(utf8bytes);
|
|
25519
|
+
};
|
|
25520
|
+
/**
|
|
25521
|
+
* Handle unions that can contain string as its member, if a Table-derived type then initialize it,
|
|
25522
|
+
* if a string then return a new one
|
|
25523
|
+
*
|
|
25524
|
+
* WARNING: strings are immutable in JS so we can't change the string that the user gave us, this
|
|
25525
|
+
* makes the behaviour of __union_with_string different compared to __union
|
|
25526
|
+
*/ _proto.__union_with_string = function __union_with_string(o, offset) {
|
|
25527
|
+
if (typeof o === "string") {
|
|
25528
|
+
return this.__string(offset);
|
|
25529
|
+
}
|
|
25530
|
+
return this.__union(o, offset);
|
|
25531
|
+
};
|
|
25532
|
+
/**
|
|
25533
|
+
* Retrieve the relative offset stored at "offset"
|
|
25534
|
+
*/ _proto.__indirect = function __indirect(offset) {
|
|
25535
|
+
return offset + this.readInt32(offset);
|
|
25536
|
+
};
|
|
25537
|
+
/**
|
|
25538
|
+
* Get the start of data of a vector whose offset is stored at "offset" in this object.
|
|
25539
|
+
*/ _proto.__vector = function __vector(offset) {
|
|
25540
|
+
return offset + this.readInt32(offset) + SIZEOF_INT; // data starts after the length
|
|
25541
|
+
};
|
|
25542
|
+
/**
|
|
25543
|
+
* Get the length of a vector whose offset is stored at "offset" in this object.
|
|
25544
|
+
*/ _proto.__vector_len = function __vector_len(offset) {
|
|
25545
|
+
return this.readInt32(offset + this.readInt32(offset));
|
|
25546
|
+
};
|
|
25547
|
+
_proto.__has_identifier = function __has_identifier(ident) {
|
|
25548
|
+
if (ident.length != FILE_IDENTIFIER_LENGTH) {
|
|
25549
|
+
throw new Error("FlatBuffers: file identifier must be length " + FILE_IDENTIFIER_LENGTH);
|
|
25550
|
+
}
|
|
25551
|
+
for(var i = 0; i < FILE_IDENTIFIER_LENGTH; i++){
|
|
25552
|
+
if (ident.charCodeAt(i) != this.readInt8(this.position() + SIZEOF_INT + i)) {
|
|
25553
|
+
return false;
|
|
25554
|
+
}
|
|
25555
|
+
}
|
|
25556
|
+
return true;
|
|
25557
|
+
};
|
|
25558
|
+
/**
|
|
25559
|
+
* A helper function for generating list for obj api
|
|
25560
|
+
*/ _proto.createScalarList = function createScalarList(listAccessor, listLength) {
|
|
25561
|
+
var ret = [];
|
|
25562
|
+
for(var i = 0; i < listLength; ++i){
|
|
25563
|
+
var val = listAccessor(i);
|
|
25564
|
+
if (val !== null) {
|
|
25565
|
+
ret.push(val);
|
|
25566
|
+
}
|
|
25567
|
+
}
|
|
25568
|
+
return ret;
|
|
25569
|
+
};
|
|
25570
|
+
/**
|
|
25571
|
+
* A helper function for generating list for obj api
|
|
25572
|
+
* @param listAccessor function that accepts an index and return data at that index
|
|
25573
|
+
* @param listLength listLength
|
|
25574
|
+
* @param res result list
|
|
25575
|
+
*/ _proto.createObjList = function createObjList(listAccessor, listLength) {
|
|
25576
|
+
var ret = [];
|
|
25577
|
+
for(var i = 0; i < listLength; ++i){
|
|
25578
|
+
var val = listAccessor(i);
|
|
25579
|
+
if (val !== null) {
|
|
25580
|
+
ret.push(val.unpack());
|
|
25581
|
+
}
|
|
25582
|
+
}
|
|
25583
|
+
return ret;
|
|
25584
|
+
};
|
|
25585
|
+
/**
|
|
25586
|
+
* Create and allocate a new ByteBuffer with a given size.
|
|
25587
|
+
*/ ByteBuffer.allocate = function allocate(byte_size) {
|
|
25588
|
+
return new ByteBuffer(new Uint8Array(byte_size));
|
|
25589
|
+
};
|
|
25590
|
+
return ByteBuffer;
|
|
25591
|
+
}();
|
|
25592
|
+
|
|
25593
|
+
var Builder = /*#__PURE__*/ function() {
|
|
25594
|
+
function Builder(opt_initial_size) {
|
|
25595
|
+
/** Minimum alignment encountered so far. */ this.minalign = 1;
|
|
25596
|
+
/** The vtable for the current table. */ this.vtable = null;
|
|
25597
|
+
/** The amount of fields we're actually using. */ this.vtable_in_use = 0;
|
|
25598
|
+
/** Whether we are currently serializing a table. */ this.isNested = false;
|
|
25599
|
+
/** Starting offset of the current struct/table. */ this.object_start = 0;
|
|
25600
|
+
/** List of offsets of all vtables. */ this.vtables = [];
|
|
25601
|
+
/** For the current vector being built. */ this.vector_num_elems = 0;
|
|
25602
|
+
/** False omits default values from the serialized data */ this.force_defaults = false;
|
|
25603
|
+
this.string_maps = null;
|
|
25604
|
+
this.text_encoder = new TextEncoder();
|
|
25605
|
+
var initial_size;
|
|
25606
|
+
if (!opt_initial_size) {
|
|
25607
|
+
initial_size = 1024;
|
|
25608
|
+
} else {
|
|
25609
|
+
initial_size = opt_initial_size;
|
|
25610
|
+
}
|
|
25611
|
+
/**
|
|
25612
|
+
* @type {ByteBuffer}
|
|
25613
|
+
* @private
|
|
25614
|
+
*/ this.bb = ByteBuffer.allocate(initial_size);
|
|
25615
|
+
this.space = initial_size;
|
|
25616
|
+
}
|
|
25617
|
+
var _proto = Builder.prototype;
|
|
25618
|
+
_proto.clear = function clear() {
|
|
25619
|
+
this.bb.clear();
|
|
25620
|
+
this.space = this.bb.capacity();
|
|
25621
|
+
this.minalign = 1;
|
|
25622
|
+
this.vtable = null;
|
|
25623
|
+
this.vtable_in_use = 0;
|
|
25624
|
+
this.isNested = false;
|
|
25625
|
+
this.object_start = 0;
|
|
25626
|
+
this.vtables = [];
|
|
25627
|
+
this.vector_num_elems = 0;
|
|
25628
|
+
this.force_defaults = false;
|
|
25629
|
+
this.string_maps = null;
|
|
25630
|
+
};
|
|
25631
|
+
/**
|
|
25632
|
+
* In order to save space, fields that are set to their default value
|
|
25633
|
+
* don't get serialized into the buffer. Forcing defaults provides a
|
|
25634
|
+
* way to manually disable this optimization.
|
|
25635
|
+
*
|
|
25636
|
+
* @param forceDefaults true always serializes default values
|
|
25637
|
+
*/ _proto.forceDefaults = function forceDefaults(forceDefaults) {
|
|
25638
|
+
this.force_defaults = forceDefaults;
|
|
25639
|
+
};
|
|
25640
|
+
/**
|
|
25641
|
+
* Get the ByteBuffer representing the FlatBuffer. Only call this after you've
|
|
25642
|
+
* called finish(). The actual data starts at the ByteBuffer's current position,
|
|
25643
|
+
* not necessarily at 0.
|
|
25644
|
+
*/ _proto.dataBuffer = function dataBuffer() {
|
|
25645
|
+
return this.bb;
|
|
25646
|
+
};
|
|
25647
|
+
/**
|
|
25648
|
+
* Get the bytes representing the FlatBuffer. Only call this after you've
|
|
25649
|
+
* called finish().
|
|
25650
|
+
*/ _proto.asUint8Array = function asUint8Array() {
|
|
25651
|
+
return this.bb.bytes().subarray(this.bb.position(), this.bb.position() + this.offset());
|
|
25652
|
+
};
|
|
25653
|
+
/**
|
|
25654
|
+
* Prepare to write an element of `size` after `additional_bytes` have been
|
|
25655
|
+
* written, e.g. if you write a string, you need to align such the int length
|
|
25656
|
+
* field is aligned to 4 bytes, and the string data follows it directly. If all
|
|
25657
|
+
* you need to do is alignment, `additional_bytes` will be 0.
|
|
25658
|
+
*
|
|
25659
|
+
* @param size This is the of the new element to write
|
|
25660
|
+
* @param additional_bytes The padding size
|
|
25661
|
+
*/ _proto.prep = function prep(size, additional_bytes) {
|
|
25662
|
+
// Track the biggest thing we've ever aligned to.
|
|
25663
|
+
if (size > this.minalign) {
|
|
25664
|
+
this.minalign = size;
|
|
25665
|
+
}
|
|
25666
|
+
// Find the amount of alignment needed such that `size` is properly
|
|
25667
|
+
// aligned after `additional_bytes`
|
|
25668
|
+
var align_size = ~(this.bb.capacity() - this.space + additional_bytes) + 1 & size - 1;
|
|
25669
|
+
// Reallocate the buffer if needed.
|
|
25670
|
+
while(this.space < align_size + size + additional_bytes){
|
|
25671
|
+
var old_buf_size = this.bb.capacity();
|
|
25672
|
+
this.bb = Builder.growByteBuffer(this.bb);
|
|
25673
|
+
this.space += this.bb.capacity() - old_buf_size;
|
|
25674
|
+
}
|
|
25675
|
+
this.pad(align_size);
|
|
25676
|
+
};
|
|
25677
|
+
_proto.pad = function pad(byte_size) {
|
|
25678
|
+
for(var i = 0; i < byte_size; i++){
|
|
25679
|
+
this.bb.writeInt8(--this.space, 0);
|
|
25680
|
+
}
|
|
25681
|
+
};
|
|
25682
|
+
_proto.writeInt8 = function writeInt8(value) {
|
|
25683
|
+
this.bb.writeInt8(this.space -= 1, value);
|
|
25684
|
+
};
|
|
25685
|
+
_proto.writeInt16 = function writeInt16(value) {
|
|
25686
|
+
this.bb.writeInt16(this.space -= 2, value);
|
|
25687
|
+
};
|
|
25688
|
+
_proto.writeInt32 = function writeInt32(value) {
|
|
25689
|
+
this.bb.writeInt32(this.space -= 4, value);
|
|
25690
|
+
};
|
|
25691
|
+
_proto.writeInt64 = function writeInt64(value) {
|
|
25692
|
+
this.bb.writeInt64(this.space -= 8, value);
|
|
25693
|
+
};
|
|
25694
|
+
_proto.writeFloat32 = function writeFloat32(value) {
|
|
25695
|
+
this.bb.writeFloat32(this.space -= 4, value);
|
|
25696
|
+
};
|
|
25697
|
+
_proto.writeFloat64 = function writeFloat64(value) {
|
|
25698
|
+
this.bb.writeFloat64(this.space -= 8, value);
|
|
25699
|
+
};
|
|
25700
|
+
/**
|
|
25701
|
+
* Add an `int8` to the buffer, properly aligned, and grows the buffer (if necessary).
|
|
25702
|
+
* @param value The `int8` to add the buffer.
|
|
25703
|
+
*/ _proto.addInt8 = function addInt8(value) {
|
|
25704
|
+
this.prep(1, 0);
|
|
25705
|
+
this.writeInt8(value);
|
|
25706
|
+
};
|
|
25707
|
+
/**
|
|
25708
|
+
* Add an `int16` to the buffer, properly aligned, and grows the buffer (if necessary).
|
|
25709
|
+
* @param value The `int16` to add the buffer.
|
|
25710
|
+
*/ _proto.addInt16 = function addInt16(value) {
|
|
25711
|
+
this.prep(2, 0);
|
|
25712
|
+
this.writeInt16(value);
|
|
25713
|
+
};
|
|
25714
|
+
/**
|
|
25715
|
+
* Add an `int32` to the buffer, properly aligned, and grows the buffer (if necessary).
|
|
25716
|
+
* @param value The `int32` to add the buffer.
|
|
25717
|
+
*/ _proto.addInt32 = function addInt32(value) {
|
|
25718
|
+
this.prep(4, 0);
|
|
25719
|
+
this.writeInt32(value);
|
|
25720
|
+
};
|
|
25721
|
+
/**
|
|
25722
|
+
* Add an `int64` to the buffer, properly aligned, and grows the buffer (if necessary).
|
|
25723
|
+
* @param value The `int64` to add the buffer.
|
|
25724
|
+
*/ _proto.addInt64 = function addInt64(value) {
|
|
25725
|
+
this.prep(8, 0);
|
|
25726
|
+
this.writeInt64(value);
|
|
25727
|
+
};
|
|
25728
|
+
/**
|
|
25729
|
+
* Add a `float32` to the buffer, properly aligned, and grows the buffer (if necessary).
|
|
25730
|
+
* @param value The `float32` to add the buffer.
|
|
25731
|
+
*/ _proto.addFloat32 = function addFloat32(value) {
|
|
25732
|
+
this.prep(4, 0);
|
|
25733
|
+
this.writeFloat32(value);
|
|
25734
|
+
};
|
|
25735
|
+
/**
|
|
25736
|
+
* Add a `float64` to the buffer, properly aligned, and grows the buffer (if necessary).
|
|
25737
|
+
* @param value The `float64` to add the buffer.
|
|
25738
|
+
*/ _proto.addFloat64 = function addFloat64(value) {
|
|
25739
|
+
this.prep(8, 0);
|
|
25740
|
+
this.writeFloat64(value);
|
|
25741
|
+
};
|
|
25742
|
+
_proto.addFieldInt8 = function addFieldInt8(voffset, value, defaultValue) {
|
|
25743
|
+
if (this.force_defaults || value != defaultValue) {
|
|
25744
|
+
this.addInt8(value);
|
|
25745
|
+
this.slot(voffset);
|
|
25746
|
+
}
|
|
25747
|
+
};
|
|
25748
|
+
_proto.addFieldInt16 = function addFieldInt16(voffset, value, defaultValue) {
|
|
25749
|
+
if (this.force_defaults || value != defaultValue) {
|
|
25750
|
+
this.addInt16(value);
|
|
25751
|
+
this.slot(voffset);
|
|
25752
|
+
}
|
|
25753
|
+
};
|
|
25754
|
+
_proto.addFieldInt32 = function addFieldInt32(voffset, value, defaultValue) {
|
|
25755
|
+
if (this.force_defaults || value != defaultValue) {
|
|
25756
|
+
this.addInt32(value);
|
|
25757
|
+
this.slot(voffset);
|
|
25758
|
+
}
|
|
25759
|
+
};
|
|
25760
|
+
_proto.addFieldInt64 = function addFieldInt64(voffset, value, defaultValue) {
|
|
25761
|
+
if (this.force_defaults || value !== defaultValue) {
|
|
25762
|
+
this.addInt64(value);
|
|
25763
|
+
this.slot(voffset);
|
|
25764
|
+
}
|
|
25765
|
+
};
|
|
25766
|
+
_proto.addFieldFloat32 = function addFieldFloat32(voffset, value, defaultValue) {
|
|
25767
|
+
if (this.force_defaults || value != defaultValue) {
|
|
25768
|
+
this.addFloat32(value);
|
|
25769
|
+
this.slot(voffset);
|
|
25770
|
+
}
|
|
25771
|
+
};
|
|
25772
|
+
_proto.addFieldFloat64 = function addFieldFloat64(voffset, value, defaultValue) {
|
|
25773
|
+
if (this.force_defaults || value != defaultValue) {
|
|
25774
|
+
this.addFloat64(value);
|
|
25775
|
+
this.slot(voffset);
|
|
25776
|
+
}
|
|
25777
|
+
};
|
|
25778
|
+
_proto.addFieldOffset = function addFieldOffset(voffset, value, defaultValue) {
|
|
25779
|
+
if (this.force_defaults || value != defaultValue) {
|
|
25780
|
+
this.addOffset(value);
|
|
25781
|
+
this.slot(voffset);
|
|
25782
|
+
}
|
|
25783
|
+
};
|
|
25784
|
+
/**
|
|
25785
|
+
* Structs are stored inline, so nothing additional is being added. `d` is always 0.
|
|
25786
|
+
*/ _proto.addFieldStruct = function addFieldStruct(voffset, value, defaultValue) {
|
|
25787
|
+
if (value != defaultValue) {
|
|
25788
|
+
this.nested(value);
|
|
25789
|
+
this.slot(voffset);
|
|
25790
|
+
}
|
|
25791
|
+
};
|
|
25792
|
+
/**
|
|
25793
|
+
* Structures are always stored inline, they need to be created right
|
|
25794
|
+
* where they're used. You'll get this assertion failure if you
|
|
25795
|
+
* created it elsewhere.
|
|
25796
|
+
*/ _proto.nested = function nested(obj) {
|
|
25797
|
+
if (obj != this.offset()) {
|
|
25798
|
+
throw new TypeError("FlatBuffers: struct must be serialized inline.");
|
|
25799
|
+
}
|
|
25800
|
+
};
|
|
25801
|
+
/**
|
|
25802
|
+
* Should not be creating any other object, string or vector
|
|
25803
|
+
* while an object is being constructed
|
|
25804
|
+
*/ _proto.notNested = function notNested() {
|
|
25805
|
+
if (this.isNested) {
|
|
25806
|
+
throw new TypeError("FlatBuffers: object serialization must not be nested.");
|
|
25807
|
+
}
|
|
25808
|
+
};
|
|
25809
|
+
/**
|
|
25810
|
+
* Set the current vtable at `voffset` to the current location in the buffer.
|
|
25811
|
+
*/ _proto.slot = function slot(voffset) {
|
|
25812
|
+
if (this.vtable !== null) this.vtable[voffset] = this.offset();
|
|
25813
|
+
};
|
|
25814
|
+
/**
|
|
25815
|
+
* @returns Offset relative to the end of the buffer.
|
|
25816
|
+
*/ _proto.offset = function offset() {
|
|
25817
|
+
return this.bb.capacity() - this.space;
|
|
25818
|
+
};
|
|
25819
|
+
/**
|
|
25820
|
+
* Adds on offset, relative to where it will be written.
|
|
25821
|
+
*
|
|
25822
|
+
* @param offset The offset to add.
|
|
25823
|
+
*/ _proto.addOffset = function addOffset(offset) {
|
|
25824
|
+
this.prep(SIZEOF_INT, 0); // Ensure alignment is already done.
|
|
25825
|
+
this.writeInt32(this.offset() - offset + SIZEOF_INT);
|
|
25826
|
+
};
|
|
25827
|
+
/**
|
|
25828
|
+
* Start encoding a new object in the buffer. Users will not usually need to
|
|
25829
|
+
* call this directly. The FlatBuffers compiler will generate helper methods
|
|
25830
|
+
* that call this method internally.
|
|
25831
|
+
*/ _proto.startObject = function startObject(numfields) {
|
|
25832
|
+
this.notNested();
|
|
25833
|
+
if (this.vtable == null) {
|
|
25834
|
+
this.vtable = [];
|
|
25835
|
+
}
|
|
25836
|
+
this.vtable_in_use = numfields;
|
|
25837
|
+
for(var i = 0; i < numfields; i++){
|
|
25838
|
+
this.vtable[i] = 0; // This will push additional elements as needed
|
|
25839
|
+
}
|
|
25840
|
+
this.isNested = true;
|
|
25841
|
+
this.object_start = this.offset();
|
|
25842
|
+
};
|
|
25843
|
+
/**
|
|
25844
|
+
* Finish off writing the object that is under construction.
|
|
25845
|
+
*
|
|
25846
|
+
* @returns The offset to the object inside `dataBuffer`
|
|
25847
|
+
*/ _proto.endObject = function endObject() {
|
|
25848
|
+
if (this.vtable == null || !this.isNested) {
|
|
25849
|
+
throw new Error("FlatBuffers: endObject called without startObject");
|
|
25850
|
+
}
|
|
25851
|
+
this.addInt32(0);
|
|
25852
|
+
var vtableloc = this.offset();
|
|
25853
|
+
// Trim trailing zeroes.
|
|
25854
|
+
var i = this.vtable_in_use - 1;
|
|
25855
|
+
// eslint-disable-next-line no-empty
|
|
25856
|
+
for(; i >= 0 && this.vtable[i] == 0; i--){}
|
|
25857
|
+
var trimmed_size = i + 1;
|
|
25858
|
+
// Write out the current vtable.
|
|
25859
|
+
for(; i >= 0; i--){
|
|
25860
|
+
// Offset relative to the start of the table.
|
|
25861
|
+
this.addInt16(this.vtable[i] != 0 ? vtableloc - this.vtable[i] : 0);
|
|
25862
|
+
}
|
|
25863
|
+
var standard_fields = 2; // The fields below:
|
|
25864
|
+
this.addInt16(vtableloc - this.object_start);
|
|
25865
|
+
var len = (trimmed_size + standard_fields) * SIZEOF_SHORT;
|
|
25866
|
+
this.addInt16(len);
|
|
25867
|
+
// Search for an existing vtable that matches the current one.
|
|
25868
|
+
var existing_vtable = 0;
|
|
25869
|
+
var vt1 = this.space;
|
|
25870
|
+
outer_loop: for(i = 0; i < this.vtables.length; i++){
|
|
25871
|
+
var vt2 = this.bb.capacity() - this.vtables[i];
|
|
25872
|
+
if (len == this.bb.readInt16(vt2)) {
|
|
25873
|
+
for(var j = SIZEOF_SHORT; j < len; j += SIZEOF_SHORT){
|
|
25874
|
+
if (this.bb.readInt16(vt1 + j) != this.bb.readInt16(vt2 + j)) {
|
|
25875
|
+
continue outer_loop;
|
|
25876
|
+
}
|
|
25877
|
+
}
|
|
25878
|
+
existing_vtable = this.vtables[i];
|
|
25879
|
+
break;
|
|
25880
|
+
}
|
|
25881
|
+
}
|
|
25882
|
+
if (existing_vtable) {
|
|
25883
|
+
// Found a match:
|
|
25884
|
+
// Remove the current vtable.
|
|
25885
|
+
this.space = this.bb.capacity() - vtableloc;
|
|
25886
|
+
// Point table to existing vtable.
|
|
25887
|
+
this.bb.writeInt32(this.space, existing_vtable - vtableloc);
|
|
25888
|
+
} else {
|
|
25889
|
+
// No match:
|
|
25890
|
+
// Add the location of the current vtable to the list of vtables.
|
|
25891
|
+
this.vtables.push(this.offset());
|
|
25892
|
+
// Point table to current vtable.
|
|
25893
|
+
this.bb.writeInt32(this.bb.capacity() - vtableloc, this.offset() - vtableloc);
|
|
25894
|
+
}
|
|
25895
|
+
this.isNested = false;
|
|
25896
|
+
return vtableloc;
|
|
25897
|
+
};
|
|
25898
|
+
/**
|
|
25899
|
+
* Finalize a buffer, poiting to the given `root_table`.
|
|
25900
|
+
*/ _proto.finish = function finish(root_table, opt_file_identifier, opt_size_prefix) {
|
|
25901
|
+
var size_prefix = opt_size_prefix ? SIZE_PREFIX_LENGTH : 0;
|
|
25902
|
+
if (opt_file_identifier) {
|
|
25903
|
+
var file_identifier = opt_file_identifier;
|
|
25904
|
+
this.prep(this.minalign, SIZEOF_INT + FILE_IDENTIFIER_LENGTH + size_prefix);
|
|
25905
|
+
if (file_identifier.length != FILE_IDENTIFIER_LENGTH) {
|
|
25906
|
+
throw new TypeError("FlatBuffers: file identifier must be length " + FILE_IDENTIFIER_LENGTH);
|
|
25907
|
+
}
|
|
25908
|
+
for(var i = FILE_IDENTIFIER_LENGTH - 1; i >= 0; i--){
|
|
25909
|
+
this.writeInt8(file_identifier.charCodeAt(i));
|
|
25910
|
+
}
|
|
25911
|
+
}
|
|
25912
|
+
this.prep(this.minalign, SIZEOF_INT + size_prefix);
|
|
25913
|
+
this.addOffset(root_table);
|
|
25914
|
+
if (size_prefix) {
|
|
25915
|
+
this.addInt32(this.bb.capacity() - this.space);
|
|
25916
|
+
}
|
|
25917
|
+
this.bb.setPosition(this.space);
|
|
25918
|
+
};
|
|
25919
|
+
/**
|
|
25920
|
+
* Finalize a size prefixed buffer, pointing to the given `root_table`.
|
|
25921
|
+
*/ _proto.finishSizePrefixed = function finishSizePrefixed(root_table, opt_file_identifier) {
|
|
25922
|
+
this.finish(root_table, opt_file_identifier, true);
|
|
25923
|
+
};
|
|
25924
|
+
/**
|
|
25925
|
+
* This checks a required field has been set in a given table that has
|
|
25926
|
+
* just been constructed.
|
|
25927
|
+
*/ _proto.requiredField = function requiredField(table, field) {
|
|
25928
|
+
var table_start = this.bb.capacity() - table;
|
|
25929
|
+
var vtable_start = table_start - this.bb.readInt32(table_start);
|
|
25930
|
+
var ok = field < this.bb.readInt16(vtable_start) && this.bb.readInt16(vtable_start + field) != 0;
|
|
25931
|
+
// If this fails, the caller will show what field needs to be set.
|
|
25932
|
+
if (!ok) {
|
|
25933
|
+
throw new TypeError("FlatBuffers: field " + field + " must be set");
|
|
25934
|
+
}
|
|
25935
|
+
};
|
|
25936
|
+
/**
|
|
25937
|
+
* Start a new array/vector of objects. Users usually will not call
|
|
25938
|
+
* this directly. The FlatBuffers compiler will create a start/end
|
|
25939
|
+
* method for vector types in generated code.
|
|
25940
|
+
*
|
|
25941
|
+
* @param elem_size The size of each element in the array
|
|
25942
|
+
* @param num_elems The number of elements in the array
|
|
25943
|
+
* @param alignment The alignment of the array
|
|
25944
|
+
*/ _proto.startVector = function startVector(elem_size, num_elems, alignment) {
|
|
25945
|
+
this.notNested();
|
|
25946
|
+
this.vector_num_elems = num_elems;
|
|
25947
|
+
this.prep(SIZEOF_INT, elem_size * num_elems);
|
|
25948
|
+
this.prep(alignment, elem_size * num_elems); // Just in case alignment > int.
|
|
25949
|
+
};
|
|
25950
|
+
/**
|
|
25951
|
+
* Finish off the creation of an array and all its elements. The array must be
|
|
25952
|
+
* created with `startVector`.
|
|
25953
|
+
*
|
|
25954
|
+
* @returns The offset at which the newly created array
|
|
25955
|
+
* starts.
|
|
25956
|
+
*/ _proto.endVector = function endVector() {
|
|
25957
|
+
this.writeInt32(this.vector_num_elems);
|
|
25958
|
+
return this.offset();
|
|
25959
|
+
};
|
|
25960
|
+
/**
|
|
25961
|
+
* Encode the string `s` in the buffer using UTF-8. If the string passed has
|
|
25962
|
+
* already been seen, we return the offset of the already written string
|
|
25963
|
+
*
|
|
25964
|
+
* @param s The string to encode
|
|
25965
|
+
* @return The offset in the buffer where the encoded string starts
|
|
25966
|
+
*/ _proto.createSharedString = function createSharedString(s) {
|
|
25967
|
+
if (!s) {
|
|
25968
|
+
return 0;
|
|
25969
|
+
}
|
|
25970
|
+
if (!this.string_maps) {
|
|
25971
|
+
this.string_maps = new Map();
|
|
25972
|
+
}
|
|
25973
|
+
if (this.string_maps.has(s)) {
|
|
25974
|
+
return this.string_maps.get(s);
|
|
25975
|
+
}
|
|
25976
|
+
var offset = this.createString(s);
|
|
25977
|
+
this.string_maps.set(s, offset);
|
|
25978
|
+
return offset;
|
|
25979
|
+
};
|
|
25980
|
+
/**
|
|
25981
|
+
* Encode the string `s` in the buffer using UTF-8. If a Uint8Array is passed
|
|
25982
|
+
* instead of a string, it is assumed to contain valid UTF-8 encoded data.
|
|
25983
|
+
*
|
|
25984
|
+
* @param s The string to encode
|
|
25985
|
+
* @return The offset in the buffer where the encoded string starts
|
|
25986
|
+
*/ _proto.createString = function createString(s) {
|
|
25987
|
+
if (s === null || s === undefined) {
|
|
25988
|
+
return 0;
|
|
25989
|
+
}
|
|
25990
|
+
var utf8;
|
|
25991
|
+
if (_instanceof1(s, Uint8Array)) {
|
|
25992
|
+
utf8 = s;
|
|
25993
|
+
} else {
|
|
25994
|
+
utf8 = this.text_encoder.encode(s);
|
|
25995
|
+
}
|
|
25996
|
+
this.addInt8(0);
|
|
25997
|
+
this.startVector(1, utf8.length, 1);
|
|
25998
|
+
this.bb.setPosition(this.space -= utf8.length);
|
|
25999
|
+
this.bb.bytes().set(utf8, this.space);
|
|
26000
|
+
return this.endVector();
|
|
26001
|
+
};
|
|
26002
|
+
/**
|
|
26003
|
+
* Create a byte vector.
|
|
26004
|
+
*
|
|
26005
|
+
* @param v The bytes to add
|
|
26006
|
+
* @returns The offset in the buffer where the byte vector starts
|
|
26007
|
+
*/ _proto.createByteVector = function createByteVector(v) {
|
|
26008
|
+
if (v === null || v === undefined) {
|
|
26009
|
+
return 0;
|
|
26010
|
+
}
|
|
26011
|
+
this.startVector(1, v.length, 1);
|
|
26012
|
+
this.bb.setPosition(this.space -= v.length);
|
|
26013
|
+
this.bb.bytes().set(v, this.space);
|
|
26014
|
+
return this.endVector();
|
|
26015
|
+
};
|
|
26016
|
+
/**
|
|
26017
|
+
* A helper function to pack an object
|
|
26018
|
+
*
|
|
26019
|
+
* @returns offset of obj
|
|
26020
|
+
*/ _proto.createObjectOffset = function createObjectOffset(obj) {
|
|
26021
|
+
if (obj === null) {
|
|
26022
|
+
return 0;
|
|
26023
|
+
}
|
|
26024
|
+
if (typeof obj === "string") {
|
|
26025
|
+
return this.createString(obj);
|
|
26026
|
+
} else {
|
|
26027
|
+
return obj.pack(this);
|
|
26028
|
+
}
|
|
26029
|
+
};
|
|
26030
|
+
/**
|
|
26031
|
+
* A helper function to pack a list of object
|
|
26032
|
+
*
|
|
26033
|
+
* @returns list of offsets of each non null object
|
|
26034
|
+
*/ _proto.createObjectOffsetList = function createObjectOffsetList(list) {
|
|
26035
|
+
var ret = [];
|
|
26036
|
+
for(var i = 0; i < list.length; ++i){
|
|
26037
|
+
var val = list[i];
|
|
26038
|
+
if (val !== null) {
|
|
26039
|
+
ret.push(this.createObjectOffset(val));
|
|
26040
|
+
} else {
|
|
26041
|
+
throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.");
|
|
26042
|
+
}
|
|
26043
|
+
}
|
|
26044
|
+
return ret;
|
|
26045
|
+
};
|
|
26046
|
+
_proto.createStructOffsetList = function createStructOffsetList(list, startFunc) {
|
|
26047
|
+
startFunc(this, list.length);
|
|
26048
|
+
this.createObjectOffsetList(list.slice().reverse());
|
|
26049
|
+
return this.endVector();
|
|
26050
|
+
};
|
|
26051
|
+
/**
|
|
26052
|
+
* Doubles the size of the backing ByteBuffer and copies the old data towards
|
|
26053
|
+
* the end of the new buffer (since we build the buffer backwards).
|
|
26054
|
+
*
|
|
26055
|
+
* @param bb The current buffer with the existing data
|
|
26056
|
+
* @returns A new byte buffer with the old data copied
|
|
26057
|
+
* to it. The data is located at the end of the buffer.
|
|
26058
|
+
*
|
|
26059
|
+
* uint8Array.set() formally takes {Array<number>|ArrayBufferView}, so to pass
|
|
26060
|
+
* it a uint8Array we need to suppress the type check:
|
|
26061
|
+
* @suppress {checkTypes}
|
|
26062
|
+
*/ Builder.growByteBuffer = function growByteBuffer(bb) {
|
|
26063
|
+
var old_buf_size = bb.capacity();
|
|
26064
|
+
// Ensure we don't grow beyond what fits in an int.
|
|
26065
|
+
if (old_buf_size & 0xC0000000) {
|
|
26066
|
+
throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");
|
|
26067
|
+
}
|
|
26068
|
+
var new_buf_size = old_buf_size << 1;
|
|
26069
|
+
var nbb = ByteBuffer.allocate(new_buf_size);
|
|
26070
|
+
nbb.setPosition(new_buf_size - old_buf_size);
|
|
26071
|
+
nbb.bytes().set(bb.bytes(), new_buf_size - old_buf_size);
|
|
26072
|
+
return nbb;
|
|
26073
|
+
};
|
|
26074
|
+
return Builder;
|
|
26075
|
+
}();
|
|
26076
|
+
|
|
26077
|
+
// automatically generated by the FlatBuffers compiler, do not modify
|
|
26078
|
+
var FBEffectsObjectData = /*#__PURE__*/ function() {
|
|
26079
|
+
function FBEffectsObjectData() {
|
|
26080
|
+
this.bb = null;
|
|
26081
|
+
this.bb_pos = 0;
|
|
26082
|
+
}
|
|
26083
|
+
var _proto = FBEffectsObjectData.prototype;
|
|
26084
|
+
_proto.__init = function __init(i, bb) {
|
|
26085
|
+
this.bb_pos = i;
|
|
26086
|
+
this.bb = bb;
|
|
26087
|
+
return this;
|
|
26088
|
+
};
|
|
26089
|
+
_proto.dataType = function dataType(optionalEncoding) {
|
|
26090
|
+
var offset = this.bb.__offset(this.bb_pos, 4);
|
|
26091
|
+
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
26092
|
+
};
|
|
26093
|
+
_proto.data = function data(index) {
|
|
26094
|
+
var offset = this.bb.__offset(this.bb_pos, 6);
|
|
26095
|
+
return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
|
|
26096
|
+
};
|
|
26097
|
+
_proto.dataLength = function dataLength() {
|
|
26098
|
+
var offset = this.bb.__offset(this.bb_pos, 6);
|
|
26099
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
26100
|
+
};
|
|
26101
|
+
_proto.dataArray = function dataArray() {
|
|
26102
|
+
var offset = this.bb.__offset(this.bb_pos, 6);
|
|
26103
|
+
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;
|
|
26104
|
+
};
|
|
26105
|
+
_proto.unpack = function unpack() {
|
|
26106
|
+
return new FBEffectsObjectDataT(this.dataType(), this.bb.createScalarList(this.data.bind(this), this.dataLength()));
|
|
26107
|
+
};
|
|
26108
|
+
_proto.unpackTo = function unpackTo(_o) {
|
|
26109
|
+
_o.dataType = this.dataType();
|
|
26110
|
+
_o.data = this.bb.createScalarList(this.data.bind(this), this.dataLength());
|
|
26111
|
+
};
|
|
26112
|
+
FBEffectsObjectData.getRootAsFBEffectsObjectData = function getRootAsFBEffectsObjectData(bb, obj) {
|
|
26113
|
+
return (obj || new FBEffectsObjectData()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
26114
|
+
};
|
|
26115
|
+
FBEffectsObjectData.getSizePrefixedRootAsFBEffectsObjectData = function getSizePrefixedRootAsFBEffectsObjectData(bb, obj) {
|
|
26116
|
+
bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
|
|
26117
|
+
return (obj || new FBEffectsObjectData()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
26118
|
+
};
|
|
26119
|
+
FBEffectsObjectData.startFBEffectsObjectData = function startFBEffectsObjectData(builder) {
|
|
26120
|
+
builder.startObject(2);
|
|
26121
|
+
};
|
|
26122
|
+
FBEffectsObjectData.addDataType = function addDataType(builder, dataTypeOffset) {
|
|
26123
|
+
builder.addFieldOffset(0, dataTypeOffset, 0);
|
|
26124
|
+
};
|
|
26125
|
+
FBEffectsObjectData.addData = function addData(builder, dataOffset) {
|
|
26126
|
+
builder.addFieldOffset(1, dataOffset, 0);
|
|
26127
|
+
};
|
|
26128
|
+
FBEffectsObjectData.createDataVector = function createDataVector(builder, data) {
|
|
26129
|
+
builder.startVector(1, data.length, 1);
|
|
26130
|
+
for(var i = data.length - 1; i >= 0; i--){
|
|
26131
|
+
builder.addInt8(data[i]);
|
|
26132
|
+
}
|
|
26133
|
+
return builder.endVector();
|
|
26134
|
+
};
|
|
26135
|
+
FBEffectsObjectData.startDataVector = function startDataVector(builder, numElems) {
|
|
26136
|
+
builder.startVector(1, numElems, 1);
|
|
26137
|
+
};
|
|
26138
|
+
FBEffectsObjectData.endFBEffectsObjectData = function endFBEffectsObjectData(builder) {
|
|
26139
|
+
var offset = builder.endObject();
|
|
26140
|
+
return offset;
|
|
26141
|
+
};
|
|
26142
|
+
FBEffectsObjectData.createFBEffectsObjectData = function createFBEffectsObjectData(builder, dataTypeOffset, dataOffset) {
|
|
26143
|
+
FBEffectsObjectData.startFBEffectsObjectData(builder);
|
|
26144
|
+
FBEffectsObjectData.addDataType(builder, dataTypeOffset);
|
|
26145
|
+
FBEffectsObjectData.addData(builder, dataOffset);
|
|
26146
|
+
return FBEffectsObjectData.endFBEffectsObjectData(builder);
|
|
26147
|
+
};
|
|
26148
|
+
return FBEffectsObjectData;
|
|
26149
|
+
}();
|
|
26150
|
+
var FBEffectsObjectDataT = /*#__PURE__*/ function() {
|
|
26151
|
+
function FBEffectsObjectDataT(dataType, data) {
|
|
26152
|
+
if (dataType === void 0) dataType = null;
|
|
26153
|
+
if (data === void 0) data = [];
|
|
26154
|
+
this.dataType = dataType;
|
|
26155
|
+
this.data = data;
|
|
26156
|
+
}
|
|
26157
|
+
var _proto = FBEffectsObjectDataT.prototype;
|
|
26158
|
+
_proto.pack = function pack(builder) {
|
|
26159
|
+
var dataType = this.dataType !== null ? builder.createString(this.dataType) : 0;
|
|
26160
|
+
var data = FBEffectsObjectData.createDataVector(builder, this.data);
|
|
26161
|
+
return FBEffectsObjectData.createFBEffectsObjectData(builder, dataType, data);
|
|
26162
|
+
};
|
|
26163
|
+
return FBEffectsObjectDataT;
|
|
26164
|
+
}();
|
|
26165
|
+
|
|
26166
|
+
// automatically generated by the FlatBuffers compiler, do not modify
|
|
26167
|
+
var FBEffectsPackageData = /*#__PURE__*/ function() {
|
|
26168
|
+
function FBEffectsPackageData() {
|
|
26169
|
+
this.bb = null;
|
|
26170
|
+
this.bb_pos = 0;
|
|
26171
|
+
}
|
|
26172
|
+
var _proto = FBEffectsPackageData.prototype;
|
|
26173
|
+
_proto.__init = function __init(i, bb) {
|
|
26174
|
+
this.bb_pos = i;
|
|
26175
|
+
this.bb = bb;
|
|
26176
|
+
return this;
|
|
26177
|
+
};
|
|
26178
|
+
_proto.exportObjects = function exportObjects(index, obj) {
|
|
26179
|
+
var offset = this.bb.__offset(this.bb_pos, 4);
|
|
26180
|
+
return offset ? (obj || new FBEffectsObjectData()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
|
26181
|
+
};
|
|
26182
|
+
_proto.exportObjectsLength = function exportObjectsLength() {
|
|
26183
|
+
var offset = this.bb.__offset(this.bb_pos, 4);
|
|
26184
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
26185
|
+
};
|
|
26186
|
+
_proto.unpack = function unpack() {
|
|
26187
|
+
return new FBEffectsPackageDataT(this.bb.createObjList(this.exportObjects.bind(this), this.exportObjectsLength()));
|
|
26188
|
+
};
|
|
26189
|
+
_proto.unpackTo = function unpackTo(_o) {
|
|
26190
|
+
_o.exportObjects = this.bb.createObjList(this.exportObjects.bind(this), this.exportObjectsLength());
|
|
26191
|
+
};
|
|
26192
|
+
FBEffectsPackageData.getRootAsFBEffectsPackageData = function getRootAsFBEffectsPackageData(bb, obj) {
|
|
26193
|
+
return (obj || new FBEffectsPackageData()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
26194
|
+
};
|
|
26195
|
+
FBEffectsPackageData.getSizePrefixedRootAsFBEffectsPackageData = function getSizePrefixedRootAsFBEffectsPackageData(bb, obj) {
|
|
26196
|
+
bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
|
|
26197
|
+
return (obj || new FBEffectsPackageData()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
26198
|
+
};
|
|
26199
|
+
FBEffectsPackageData.startFBEffectsPackageData = function startFBEffectsPackageData(builder) {
|
|
26200
|
+
builder.startObject(1);
|
|
26201
|
+
};
|
|
26202
|
+
FBEffectsPackageData.addExportObjects = function addExportObjects(builder, exportObjectsOffset) {
|
|
26203
|
+
builder.addFieldOffset(0, exportObjectsOffset, 0);
|
|
26204
|
+
};
|
|
26205
|
+
FBEffectsPackageData.createExportObjectsVector = function createExportObjectsVector(builder, data) {
|
|
26206
|
+
builder.startVector(4, data.length, 4);
|
|
26207
|
+
for(var i = data.length - 1; i >= 0; i--){
|
|
26208
|
+
builder.addOffset(data[i]);
|
|
26209
|
+
}
|
|
26210
|
+
return builder.endVector();
|
|
26211
|
+
};
|
|
26212
|
+
FBEffectsPackageData.startExportObjectsVector = function startExportObjectsVector(builder, numElems) {
|
|
26213
|
+
builder.startVector(4, numElems, 4);
|
|
26214
|
+
};
|
|
26215
|
+
FBEffectsPackageData.endFBEffectsPackageData = function endFBEffectsPackageData(builder) {
|
|
26216
|
+
var offset = builder.endObject();
|
|
26217
|
+
return offset;
|
|
26218
|
+
};
|
|
26219
|
+
FBEffectsPackageData.finishFBEffectsPackageDataBuffer = function finishFBEffectsPackageDataBuffer(builder, offset) {
|
|
26220
|
+
builder.finish(offset);
|
|
26221
|
+
};
|
|
26222
|
+
FBEffectsPackageData.finishSizePrefixedFBEffectsPackageDataBuffer = function finishSizePrefixedFBEffectsPackageDataBuffer(builder, offset) {
|
|
26223
|
+
builder.finish(offset, undefined, true);
|
|
26224
|
+
};
|
|
26225
|
+
FBEffectsPackageData.createFBEffectsPackageData = function createFBEffectsPackageData(builder, exportObjectsOffset) {
|
|
26226
|
+
FBEffectsPackageData.startFBEffectsPackageData(builder);
|
|
26227
|
+
FBEffectsPackageData.addExportObjects(builder, exportObjectsOffset);
|
|
26228
|
+
return FBEffectsPackageData.endFBEffectsPackageData(builder);
|
|
26229
|
+
};
|
|
26230
|
+
return FBEffectsPackageData;
|
|
26231
|
+
}();
|
|
26232
|
+
var FBEffectsPackageDataT = /*#__PURE__*/ function() {
|
|
26233
|
+
function FBEffectsPackageDataT(exportObjects) {
|
|
26234
|
+
if (exportObjects === void 0) exportObjects = [];
|
|
26235
|
+
this.exportObjects = exportObjects;
|
|
26236
|
+
}
|
|
26237
|
+
var _proto = FBEffectsPackageDataT.prototype;
|
|
26238
|
+
_proto.pack = function pack(builder) {
|
|
26239
|
+
var exportObjects = FBEffectsPackageData.createExportObjectsVector(builder, builder.createObjectOffsetList(this.exportObjects));
|
|
26240
|
+
return FBEffectsPackageData.createFBEffectsPackageData(builder, exportObjects);
|
|
26241
|
+
};
|
|
26242
|
+
return FBEffectsPackageDataT;
|
|
26243
|
+
}();
|
|
26244
|
+
|
|
26245
|
+
// automatically generated by the FlatBuffers compiler, do not modify
|
|
26246
|
+
var FBSubMesh = /*#__PURE__*/ function() {
|
|
26247
|
+
function FBSubMesh() {
|
|
26248
|
+
this.bb = null;
|
|
26249
|
+
this.bb_pos = 0;
|
|
26250
|
+
}
|
|
26251
|
+
var _proto = FBSubMesh.prototype;
|
|
26252
|
+
_proto.__init = function __init(i, bb) {
|
|
26253
|
+
this.bb_pos = i;
|
|
26254
|
+
this.bb = bb;
|
|
26255
|
+
return this;
|
|
26256
|
+
};
|
|
26257
|
+
_proto.offset = function offset() {
|
|
26258
|
+
var offset = this.bb.__offset(this.bb_pos, 4);
|
|
26259
|
+
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
|
26260
|
+
};
|
|
26261
|
+
_proto.indexCount = function indexCount() {
|
|
26262
|
+
var offset = this.bb.__offset(this.bb_pos, 6);
|
|
26263
|
+
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
|
26264
|
+
};
|
|
26265
|
+
_proto.vertexCount = function vertexCount() {
|
|
26266
|
+
var offset = this.bb.__offset(this.bb_pos, 8);
|
|
26267
|
+
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
|
26268
|
+
};
|
|
26269
|
+
_proto.unpack = function unpack() {
|
|
26270
|
+
return new FBSubMeshT(this.offset(), this.indexCount(), this.vertexCount());
|
|
26271
|
+
};
|
|
26272
|
+
_proto.unpackTo = function unpackTo(_o) {
|
|
26273
|
+
_o.offset = this.offset();
|
|
26274
|
+
_o.indexCount = this.indexCount();
|
|
26275
|
+
_o.vertexCount = this.vertexCount();
|
|
26276
|
+
};
|
|
26277
|
+
FBSubMesh.getRootAsFBSubMesh = function getRootAsFBSubMesh(bb, obj) {
|
|
26278
|
+
return (obj || new FBSubMesh()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
26279
|
+
};
|
|
26280
|
+
FBSubMesh.getSizePrefixedRootAsFBSubMesh = function getSizePrefixedRootAsFBSubMesh(bb, obj) {
|
|
26281
|
+
bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
|
|
26282
|
+
return (obj || new FBSubMesh()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
26283
|
+
};
|
|
26284
|
+
FBSubMesh.startFBSubMesh = function startFBSubMesh(builder) {
|
|
26285
|
+
builder.startObject(3);
|
|
26286
|
+
};
|
|
26287
|
+
FBSubMesh.addOffset = function addOffset(builder, offset) {
|
|
26288
|
+
builder.addFieldInt32(0, offset, 0);
|
|
26289
|
+
};
|
|
26290
|
+
FBSubMesh.addIndexCount = function addIndexCount(builder, indexCount) {
|
|
26291
|
+
builder.addFieldInt32(1, indexCount, 0);
|
|
26292
|
+
};
|
|
26293
|
+
FBSubMesh.addVertexCount = function addVertexCount(builder, vertexCount) {
|
|
26294
|
+
builder.addFieldInt32(2, vertexCount, 0);
|
|
26295
|
+
};
|
|
26296
|
+
FBSubMesh.endFBSubMesh = function endFBSubMesh(builder) {
|
|
26297
|
+
var offset = builder.endObject();
|
|
26298
|
+
return offset;
|
|
26299
|
+
};
|
|
26300
|
+
FBSubMesh.createFBSubMesh = function createFBSubMesh(builder, offset, indexCount, vertexCount) {
|
|
26301
|
+
FBSubMesh.startFBSubMesh(builder);
|
|
26302
|
+
FBSubMesh.addOffset(builder, offset);
|
|
26303
|
+
FBSubMesh.addIndexCount(builder, indexCount);
|
|
26304
|
+
FBSubMesh.addVertexCount(builder, vertexCount);
|
|
26305
|
+
return FBSubMesh.endFBSubMesh(builder);
|
|
26306
|
+
};
|
|
26307
|
+
return FBSubMesh;
|
|
26308
|
+
}();
|
|
26309
|
+
var FBSubMeshT = /*#__PURE__*/ function() {
|
|
26310
|
+
function FBSubMeshT(offset, indexCount, vertexCount) {
|
|
26311
|
+
if (offset === void 0) offset = 0;
|
|
26312
|
+
if (indexCount === void 0) indexCount = 0;
|
|
26313
|
+
if (vertexCount === void 0) vertexCount = 0;
|
|
26314
|
+
this.offset = offset;
|
|
26315
|
+
this.indexCount = indexCount;
|
|
26316
|
+
this.vertexCount = vertexCount;
|
|
26317
|
+
}
|
|
26318
|
+
var _proto = FBSubMeshT.prototype;
|
|
26319
|
+
_proto.pack = function pack(builder) {
|
|
26320
|
+
return FBSubMesh.createFBSubMesh(builder, this.offset, this.indexCount, this.vertexCount);
|
|
26321
|
+
};
|
|
26322
|
+
return FBSubMeshT;
|
|
26323
|
+
}();
|
|
26324
|
+
|
|
26325
|
+
// automatically generated by the FlatBuffers compiler, do not modify
|
|
26326
|
+
var FBVertexChannel = /*#__PURE__*/ function() {
|
|
26327
|
+
function FBVertexChannel() {
|
|
26328
|
+
this.bb = null;
|
|
26329
|
+
this.bb_pos = 0;
|
|
26330
|
+
}
|
|
26331
|
+
var _proto = FBVertexChannel.prototype;
|
|
26332
|
+
_proto.__init = function __init(i, bb) {
|
|
26333
|
+
this.bb_pos = i;
|
|
26334
|
+
this.bb = bb;
|
|
26335
|
+
return this;
|
|
26336
|
+
};
|
|
26337
|
+
_proto.semantic = function semantic(optionalEncoding) {
|
|
26338
|
+
var offset = this.bb.__offset(this.bb_pos, 4);
|
|
26339
|
+
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
26340
|
+
};
|
|
26341
|
+
_proto.offset = function offset() {
|
|
26342
|
+
var offset = this.bb.__offset(this.bb_pos, 6);
|
|
26343
|
+
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
|
26344
|
+
};
|
|
26345
|
+
_proto.format = function format() {
|
|
26346
|
+
var offset = this.bb.__offset(this.bb_pos, 8);
|
|
26347
|
+
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
|
26348
|
+
};
|
|
26349
|
+
_proto.dimension = function dimension() {
|
|
26350
|
+
var offset = this.bb.__offset(this.bb_pos, 10);
|
|
26351
|
+
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
|
26352
|
+
};
|
|
26353
|
+
_proto.normalize = function normalize() {
|
|
26354
|
+
var offset = this.bb.__offset(this.bb_pos, 12);
|
|
26355
|
+
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
|
|
26356
|
+
};
|
|
26357
|
+
_proto.unpack = function unpack() {
|
|
26358
|
+
return new FBVertexChannelT(this.semantic(), this.offset(), this.format(), this.dimension(), this.normalize());
|
|
26359
|
+
};
|
|
26360
|
+
_proto.unpackTo = function unpackTo(_o) {
|
|
26361
|
+
_o.semantic = this.semantic();
|
|
26362
|
+
_o.offset = this.offset();
|
|
26363
|
+
_o.format = this.format();
|
|
26364
|
+
_o.dimension = this.dimension();
|
|
26365
|
+
_o.normalize = this.normalize();
|
|
26366
|
+
};
|
|
26367
|
+
FBVertexChannel.getRootAsFBVertexChannel = function getRootAsFBVertexChannel(bb, obj) {
|
|
26368
|
+
return (obj || new FBVertexChannel()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
26369
|
+
};
|
|
26370
|
+
FBVertexChannel.getSizePrefixedRootAsFBVertexChannel = function getSizePrefixedRootAsFBVertexChannel(bb, obj) {
|
|
26371
|
+
bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
|
|
26372
|
+
return (obj || new FBVertexChannel()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
26373
|
+
};
|
|
26374
|
+
FBVertexChannel.startFBVertexChannel = function startFBVertexChannel(builder) {
|
|
26375
|
+
builder.startObject(5);
|
|
26376
|
+
};
|
|
26377
|
+
FBVertexChannel.addSemantic = function addSemantic(builder, semanticOffset) {
|
|
26378
|
+
builder.addFieldOffset(0, semanticOffset, 0);
|
|
26379
|
+
};
|
|
26380
|
+
FBVertexChannel.addOffset = function addOffset(builder, offset) {
|
|
26381
|
+
builder.addFieldInt32(1, offset, 0);
|
|
26382
|
+
};
|
|
26383
|
+
FBVertexChannel.addFormat = function addFormat(builder, format) {
|
|
26384
|
+
builder.addFieldInt32(2, format, 0);
|
|
26385
|
+
};
|
|
26386
|
+
FBVertexChannel.addDimension = function addDimension(builder, dimension) {
|
|
26387
|
+
builder.addFieldInt32(3, dimension, 0);
|
|
26388
|
+
};
|
|
26389
|
+
FBVertexChannel.addNormalize = function addNormalize(builder, normalize) {
|
|
26390
|
+
builder.addFieldInt8(4, +normalize, +false);
|
|
26391
|
+
};
|
|
26392
|
+
FBVertexChannel.endFBVertexChannel = function endFBVertexChannel(builder) {
|
|
26393
|
+
var offset = builder.endObject();
|
|
26394
|
+
return offset;
|
|
26395
|
+
};
|
|
26396
|
+
FBVertexChannel.createFBVertexChannel = function createFBVertexChannel(builder, semanticOffset, offset, format, dimension, normalize) {
|
|
26397
|
+
FBVertexChannel.startFBVertexChannel(builder);
|
|
26398
|
+
FBVertexChannel.addSemantic(builder, semanticOffset);
|
|
26399
|
+
FBVertexChannel.addOffset(builder, offset);
|
|
26400
|
+
FBVertexChannel.addFormat(builder, format);
|
|
26401
|
+
FBVertexChannel.addDimension(builder, dimension);
|
|
26402
|
+
FBVertexChannel.addNormalize(builder, normalize);
|
|
26403
|
+
return FBVertexChannel.endFBVertexChannel(builder);
|
|
26404
|
+
};
|
|
26405
|
+
return FBVertexChannel;
|
|
26406
|
+
}();
|
|
26407
|
+
var FBVertexChannelT = /*#__PURE__*/ function() {
|
|
26408
|
+
function FBVertexChannelT(semantic, offset, format, dimension, normalize) {
|
|
26409
|
+
if (semantic === void 0) semantic = null;
|
|
26410
|
+
if (offset === void 0) offset = 0;
|
|
26411
|
+
if (format === void 0) format = 0;
|
|
26412
|
+
if (dimension === void 0) dimension = 0;
|
|
26413
|
+
if (normalize === void 0) normalize = false;
|
|
26414
|
+
this.semantic = semantic;
|
|
26415
|
+
this.offset = offset;
|
|
26416
|
+
this.format = format;
|
|
26417
|
+
this.dimension = dimension;
|
|
26418
|
+
this.normalize = normalize;
|
|
26419
|
+
}
|
|
26420
|
+
var _proto = FBVertexChannelT.prototype;
|
|
26421
|
+
_proto.pack = function pack(builder) {
|
|
26422
|
+
var semantic = this.semantic !== null ? builder.createString(this.semantic) : 0;
|
|
26423
|
+
return FBVertexChannel.createFBVertexChannel(builder, semantic, this.offset, this.format, this.dimension, this.normalize);
|
|
26424
|
+
};
|
|
26425
|
+
return FBVertexChannelT;
|
|
26426
|
+
}();
|
|
26427
|
+
|
|
26428
|
+
// automatically generated by the FlatBuffers compiler, do not modify
|
|
26429
|
+
var FBVertexData = /*#__PURE__*/ function() {
|
|
26430
|
+
function FBVertexData() {
|
|
26431
|
+
this.bb = null;
|
|
26432
|
+
this.bb_pos = 0;
|
|
26433
|
+
}
|
|
26434
|
+
var _proto = FBVertexData.prototype;
|
|
26435
|
+
_proto.__init = function __init(i, bb) {
|
|
26436
|
+
this.bb_pos = i;
|
|
26437
|
+
this.bb = bb;
|
|
26438
|
+
return this;
|
|
26439
|
+
};
|
|
26440
|
+
_proto.vertexCount = function vertexCount() {
|
|
26441
|
+
var offset = this.bb.__offset(this.bb_pos, 4);
|
|
26442
|
+
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
|
26443
|
+
};
|
|
26444
|
+
_proto.channels = function channels(index, obj) {
|
|
26445
|
+
var offset = this.bb.__offset(this.bb_pos, 6);
|
|
26446
|
+
return offset ? (obj || new FBVertexChannel()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
|
26447
|
+
};
|
|
26448
|
+
_proto.channelsLength = function channelsLength() {
|
|
26449
|
+
var offset = this.bb.__offset(this.bb_pos, 6);
|
|
26450
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
26451
|
+
};
|
|
26452
|
+
_proto.unpack = function unpack() {
|
|
26453
|
+
return new FBVertexDataT(this.vertexCount(), this.bb.createObjList(this.channels.bind(this), this.channelsLength()));
|
|
26454
|
+
};
|
|
26455
|
+
_proto.unpackTo = function unpackTo(_o) {
|
|
26456
|
+
_o.vertexCount = this.vertexCount();
|
|
26457
|
+
_o.channels = this.bb.createObjList(this.channels.bind(this), this.channelsLength());
|
|
26458
|
+
};
|
|
26459
|
+
FBVertexData.getRootAsFBVertexData = function getRootAsFBVertexData(bb, obj) {
|
|
26460
|
+
return (obj || new FBVertexData()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
26461
|
+
};
|
|
26462
|
+
FBVertexData.getSizePrefixedRootAsFBVertexData = function getSizePrefixedRootAsFBVertexData(bb, obj) {
|
|
26463
|
+
bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
|
|
26464
|
+
return (obj || new FBVertexData()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
26465
|
+
};
|
|
26466
|
+
FBVertexData.startFBVertexData = function startFBVertexData(builder) {
|
|
26467
|
+
builder.startObject(2);
|
|
26468
|
+
};
|
|
26469
|
+
FBVertexData.addVertexCount = function addVertexCount(builder, vertexCount) {
|
|
26470
|
+
builder.addFieldInt32(0, vertexCount, 0);
|
|
26471
|
+
};
|
|
26472
|
+
FBVertexData.addChannels = function addChannels(builder, channelsOffset) {
|
|
26473
|
+
builder.addFieldOffset(1, channelsOffset, 0);
|
|
26474
|
+
};
|
|
26475
|
+
FBVertexData.createChannelsVector = function createChannelsVector(builder, data) {
|
|
26476
|
+
builder.startVector(4, data.length, 4);
|
|
26477
|
+
for(var i = data.length - 1; i >= 0; i--){
|
|
26478
|
+
builder.addOffset(data[i]);
|
|
26479
|
+
}
|
|
26480
|
+
return builder.endVector();
|
|
26481
|
+
};
|
|
26482
|
+
FBVertexData.startChannelsVector = function startChannelsVector(builder, numElems) {
|
|
26483
|
+
builder.startVector(4, numElems, 4);
|
|
26484
|
+
};
|
|
26485
|
+
FBVertexData.endFBVertexData = function endFBVertexData(builder) {
|
|
26486
|
+
var offset = builder.endObject();
|
|
26487
|
+
return offset;
|
|
26488
|
+
};
|
|
26489
|
+
FBVertexData.createFBVertexData = function createFBVertexData(builder, vertexCount, channelsOffset) {
|
|
26490
|
+
FBVertexData.startFBVertexData(builder);
|
|
26491
|
+
FBVertexData.addVertexCount(builder, vertexCount);
|
|
26492
|
+
FBVertexData.addChannels(builder, channelsOffset);
|
|
26493
|
+
return FBVertexData.endFBVertexData(builder);
|
|
26494
|
+
};
|
|
26495
|
+
return FBVertexData;
|
|
26496
|
+
}();
|
|
26497
|
+
var FBVertexDataT = /*#__PURE__*/ function() {
|
|
26498
|
+
function FBVertexDataT(vertexCount, channels) {
|
|
26499
|
+
if (vertexCount === void 0) vertexCount = 0;
|
|
26500
|
+
if (channels === void 0) channels = [];
|
|
26501
|
+
this.vertexCount = vertexCount;
|
|
26502
|
+
this.channels = channels;
|
|
26503
|
+
}
|
|
26504
|
+
var _proto = FBVertexDataT.prototype;
|
|
26505
|
+
_proto.pack = function pack(builder) {
|
|
26506
|
+
var channels = FBVertexData.createChannelsVector(builder, builder.createObjectOffsetList(this.channels));
|
|
26507
|
+
return FBVertexData.createFBVertexData(builder, this.vertexCount, channels);
|
|
26508
|
+
};
|
|
26509
|
+
return FBVertexDataT;
|
|
26510
|
+
}();
|
|
26511
|
+
|
|
26512
|
+
// automatically generated by the FlatBuffers compiler, do not modify
|
|
26513
|
+
var FBGeometryData = /*#__PURE__*/ function() {
|
|
26514
|
+
function FBGeometryData() {
|
|
26515
|
+
this.bb = null;
|
|
26516
|
+
this.bb_pos = 0;
|
|
26517
|
+
}
|
|
26518
|
+
var _proto = FBGeometryData.prototype;
|
|
26519
|
+
_proto.__init = function __init(i, bb) {
|
|
26520
|
+
this.bb_pos = i;
|
|
26521
|
+
this.bb = bb;
|
|
26522
|
+
return this;
|
|
26523
|
+
};
|
|
26524
|
+
_proto.id = function id(optionalEncoding) {
|
|
26525
|
+
var offset = this.bb.__offset(this.bb_pos, 4);
|
|
26526
|
+
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
26527
|
+
};
|
|
26528
|
+
_proto.name = function name(optionalEncoding) {
|
|
26529
|
+
var offset = this.bb.__offset(this.bb_pos, 6);
|
|
26530
|
+
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
26531
|
+
};
|
|
26532
|
+
_proto.vertexData = function vertexData(obj) {
|
|
26533
|
+
var offset = this.bb.__offset(this.bb_pos, 8);
|
|
26534
|
+
return offset ? (obj || new FBVertexData()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
|
|
26535
|
+
};
|
|
26536
|
+
_proto.indexFormat = function indexFormat() {
|
|
26537
|
+
var offset = this.bb.__offset(this.bb_pos, 10);
|
|
26538
|
+
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
|
26539
|
+
};
|
|
26540
|
+
_proto.indexOffset = function indexOffset() {
|
|
26541
|
+
var offset = this.bb.__offset(this.bb_pos, 12);
|
|
26542
|
+
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
|
26543
|
+
};
|
|
26544
|
+
_proto.subMeshes = function subMeshes(index, obj) {
|
|
26545
|
+
var offset = this.bb.__offset(this.bb_pos, 14);
|
|
26546
|
+
return offset ? (obj || new FBSubMesh()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
|
26547
|
+
};
|
|
26548
|
+
_proto.subMeshesLength = function subMeshesLength() {
|
|
26549
|
+
var offset = this.bb.__offset(this.bb_pos, 14);
|
|
26550
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
26551
|
+
};
|
|
26552
|
+
_proto.mode = function mode() {
|
|
26553
|
+
var offset = this.bb.__offset(this.bb_pos, 16);
|
|
26554
|
+
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
|
26555
|
+
};
|
|
26556
|
+
_proto.buffer = function buffer(optionalEncoding) {
|
|
26557
|
+
var offset = this.bb.__offset(this.bb_pos, 18);
|
|
26558
|
+
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
26559
|
+
};
|
|
26560
|
+
_proto.binaryData = function binaryData(index) {
|
|
26561
|
+
var offset = this.bb.__offset(this.bb_pos, 20);
|
|
26562
|
+
return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
|
|
26563
|
+
};
|
|
26564
|
+
_proto.binaryDataLength = function binaryDataLength() {
|
|
26565
|
+
var offset = this.bb.__offset(this.bb_pos, 20);
|
|
26566
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
26567
|
+
};
|
|
26568
|
+
_proto.binaryDataArray = function binaryDataArray() {
|
|
26569
|
+
var offset = this.bb.__offset(this.bb_pos, 20);
|
|
26570
|
+
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;
|
|
26571
|
+
};
|
|
26572
|
+
_proto.boneNames = function boneNames(index, optionalEncoding) {
|
|
26573
|
+
var offset = this.bb.__offset(this.bb_pos, 22);
|
|
26574
|
+
return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
|
|
26575
|
+
};
|
|
26576
|
+
_proto.boneNamesLength = function boneNamesLength() {
|
|
26577
|
+
var offset = this.bb.__offset(this.bb_pos, 22);
|
|
26578
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
26579
|
+
};
|
|
26580
|
+
_proto.rootBoneName = function rootBoneName(optionalEncoding) {
|
|
26581
|
+
var offset = this.bb.__offset(this.bb_pos, 24);
|
|
26582
|
+
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
26583
|
+
};
|
|
26584
|
+
_proto.inverseBindMatrices = function inverseBindMatrices(index) {
|
|
26585
|
+
var offset = this.bb.__offset(this.bb_pos, 26);
|
|
26586
|
+
return offset ? this.bb.readFloat32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
|
|
26587
|
+
};
|
|
26588
|
+
_proto.inverseBindMatricesLength = function inverseBindMatricesLength() {
|
|
26589
|
+
var offset = this.bb.__offset(this.bb_pos, 26);
|
|
26590
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
26591
|
+
};
|
|
26592
|
+
_proto.inverseBindMatricesArray = function inverseBindMatricesArray() {
|
|
26593
|
+
var offset = this.bb.__offset(this.bb_pos, 26);
|
|
26594
|
+
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;
|
|
26595
|
+
};
|
|
26596
|
+
_proto.unpack = function unpack() {
|
|
26597
|
+
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()));
|
|
26598
|
+
};
|
|
26599
|
+
_proto.unpackTo = function unpackTo(_o) {
|
|
26600
|
+
_o.id = this.id();
|
|
26601
|
+
_o.name = this.name();
|
|
26602
|
+
_o.vertexData = this.vertexData() !== null ? this.vertexData().unpack() : null;
|
|
26603
|
+
_o.indexFormat = this.indexFormat();
|
|
26604
|
+
_o.indexOffset = this.indexOffset();
|
|
26605
|
+
_o.subMeshes = this.bb.createObjList(this.subMeshes.bind(this), this.subMeshesLength());
|
|
26606
|
+
_o.mode = this.mode();
|
|
26607
|
+
_o.buffer = this.buffer();
|
|
26608
|
+
_o.binaryData = this.bb.createScalarList(this.binaryData.bind(this), this.binaryDataLength());
|
|
26609
|
+
_o.boneNames = this.bb.createScalarList(this.boneNames.bind(this), this.boneNamesLength());
|
|
26610
|
+
_o.rootBoneName = this.rootBoneName();
|
|
26611
|
+
_o.inverseBindMatrices = this.bb.createScalarList(this.inverseBindMatrices.bind(this), this.inverseBindMatricesLength());
|
|
26612
|
+
};
|
|
26613
|
+
FBGeometryData.getRootAsFBGeometryData = function getRootAsFBGeometryData(bb, obj) {
|
|
26614
|
+
return (obj || new FBGeometryData()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
26615
|
+
};
|
|
26616
|
+
FBGeometryData.getSizePrefixedRootAsFBGeometryData = function getSizePrefixedRootAsFBGeometryData(bb, obj) {
|
|
26617
|
+
bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
|
|
26618
|
+
return (obj || new FBGeometryData()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
26619
|
+
};
|
|
26620
|
+
FBGeometryData.startFBGeometryData = function startFBGeometryData(builder) {
|
|
26621
|
+
builder.startObject(12);
|
|
26622
|
+
};
|
|
26623
|
+
FBGeometryData.addId = function addId(builder, idOffset) {
|
|
26624
|
+
builder.addFieldOffset(0, idOffset, 0);
|
|
26625
|
+
};
|
|
26626
|
+
FBGeometryData.addName = function addName(builder, nameOffset) {
|
|
26627
|
+
builder.addFieldOffset(1, nameOffset, 0);
|
|
26628
|
+
};
|
|
26629
|
+
FBGeometryData.addVertexData = function addVertexData(builder, vertexDataOffset) {
|
|
26630
|
+
builder.addFieldOffset(2, vertexDataOffset, 0);
|
|
26631
|
+
};
|
|
26632
|
+
FBGeometryData.addIndexFormat = function addIndexFormat(builder, indexFormat) {
|
|
26633
|
+
builder.addFieldInt32(3, indexFormat, 0);
|
|
26634
|
+
};
|
|
26635
|
+
FBGeometryData.addIndexOffset = function addIndexOffset(builder, indexOffset) {
|
|
26636
|
+
builder.addFieldInt32(4, indexOffset, 0);
|
|
26637
|
+
};
|
|
26638
|
+
FBGeometryData.addSubMeshes = function addSubMeshes(builder, subMeshesOffset) {
|
|
26639
|
+
builder.addFieldOffset(5, subMeshesOffset, 0);
|
|
26640
|
+
};
|
|
26641
|
+
FBGeometryData.createSubMeshesVector = function createSubMeshesVector(builder, data) {
|
|
26642
|
+
builder.startVector(4, data.length, 4);
|
|
26643
|
+
for(var i = data.length - 1; i >= 0; i--){
|
|
26644
|
+
builder.addOffset(data[i]);
|
|
26645
|
+
}
|
|
26646
|
+
return builder.endVector();
|
|
26647
|
+
};
|
|
26648
|
+
FBGeometryData.startSubMeshesVector = function startSubMeshesVector(builder, numElems) {
|
|
26649
|
+
builder.startVector(4, numElems, 4);
|
|
26650
|
+
};
|
|
26651
|
+
FBGeometryData.addMode = function addMode(builder, mode) {
|
|
26652
|
+
builder.addFieldInt32(6, mode, 0);
|
|
26653
|
+
};
|
|
26654
|
+
FBGeometryData.addBuffer = function addBuffer(builder, bufferOffset) {
|
|
26655
|
+
builder.addFieldOffset(7, bufferOffset, 0);
|
|
26656
|
+
};
|
|
26657
|
+
FBGeometryData.addBinaryData = function addBinaryData(builder, binaryDataOffset) {
|
|
26658
|
+
builder.addFieldOffset(8, binaryDataOffset, 0);
|
|
26659
|
+
};
|
|
26660
|
+
FBGeometryData.createBinaryDataVector = function createBinaryDataVector(builder, data) {
|
|
26661
|
+
builder.startVector(1, data.length, 1);
|
|
26662
|
+
for(var i = data.length - 1; i >= 0; i--){
|
|
26663
|
+
builder.addInt8(data[i]);
|
|
26664
|
+
}
|
|
26665
|
+
return builder.endVector();
|
|
26666
|
+
};
|
|
26667
|
+
FBGeometryData.startBinaryDataVector = function startBinaryDataVector(builder, numElems) {
|
|
26668
|
+
builder.startVector(1, numElems, 1);
|
|
26669
|
+
};
|
|
26670
|
+
FBGeometryData.addBoneNames = function addBoneNames(builder, boneNamesOffset) {
|
|
26671
|
+
builder.addFieldOffset(9, boneNamesOffset, 0);
|
|
26672
|
+
};
|
|
26673
|
+
FBGeometryData.createBoneNamesVector = function createBoneNamesVector(builder, data) {
|
|
26674
|
+
builder.startVector(4, data.length, 4);
|
|
26675
|
+
for(var i = data.length - 1; i >= 0; i--){
|
|
26676
|
+
builder.addOffset(data[i]);
|
|
26677
|
+
}
|
|
26678
|
+
return builder.endVector();
|
|
26679
|
+
};
|
|
26680
|
+
FBGeometryData.startBoneNamesVector = function startBoneNamesVector(builder, numElems) {
|
|
26681
|
+
builder.startVector(4, numElems, 4);
|
|
26682
|
+
};
|
|
26683
|
+
FBGeometryData.addRootBoneName = function addRootBoneName(builder, rootBoneNameOffset) {
|
|
26684
|
+
builder.addFieldOffset(10, rootBoneNameOffset, 0);
|
|
26685
|
+
};
|
|
26686
|
+
FBGeometryData.addInverseBindMatrices = function addInverseBindMatrices(builder, inverseBindMatricesOffset) {
|
|
26687
|
+
builder.addFieldOffset(11, inverseBindMatricesOffset, 0);
|
|
26688
|
+
};
|
|
26689
|
+
FBGeometryData.createInverseBindMatricesVector = function createInverseBindMatricesVector(builder, data) {
|
|
26690
|
+
builder.startVector(4, data.length, 4);
|
|
26691
|
+
for(var i = data.length - 1; i >= 0; i--){
|
|
26692
|
+
builder.addFloat32(data[i]);
|
|
26693
|
+
}
|
|
26694
|
+
return builder.endVector();
|
|
26695
|
+
};
|
|
26696
|
+
FBGeometryData.startInverseBindMatricesVector = function startInverseBindMatricesVector(builder, numElems) {
|
|
26697
|
+
builder.startVector(4, numElems, 4);
|
|
26698
|
+
};
|
|
26699
|
+
FBGeometryData.endFBGeometryData = function endFBGeometryData(builder) {
|
|
26700
|
+
var offset = builder.endObject();
|
|
26701
|
+
return offset;
|
|
26702
|
+
};
|
|
26703
|
+
return FBGeometryData;
|
|
26704
|
+
}();
|
|
26705
|
+
var FBGeometryDataT = /*#__PURE__*/ function() {
|
|
26706
|
+
function FBGeometryDataT(id, name, vertexData, indexFormat, indexOffset, subMeshes, mode, buffer, binaryData, boneNames, rootBoneName, inverseBindMatrices) {
|
|
26707
|
+
if (id === void 0) id = null;
|
|
26708
|
+
if (name === void 0) name = null;
|
|
26709
|
+
if (vertexData === void 0) vertexData = null;
|
|
26710
|
+
if (indexFormat === void 0) indexFormat = 0;
|
|
26711
|
+
if (indexOffset === void 0) indexOffset = 0;
|
|
26712
|
+
if (subMeshes === void 0) subMeshes = [];
|
|
26713
|
+
if (mode === void 0) mode = 0;
|
|
26714
|
+
if (buffer === void 0) buffer = null;
|
|
26715
|
+
if (binaryData === void 0) binaryData = [];
|
|
26716
|
+
if (boneNames === void 0) boneNames = [];
|
|
26717
|
+
if (rootBoneName === void 0) rootBoneName = null;
|
|
26718
|
+
if (inverseBindMatrices === void 0) inverseBindMatrices = [];
|
|
26719
|
+
this.id = id;
|
|
26720
|
+
this.name = name;
|
|
26721
|
+
this.vertexData = vertexData;
|
|
26722
|
+
this.indexFormat = indexFormat;
|
|
26723
|
+
this.indexOffset = indexOffset;
|
|
26724
|
+
this.subMeshes = subMeshes;
|
|
26725
|
+
this.mode = mode;
|
|
26726
|
+
this.buffer = buffer;
|
|
26727
|
+
this.binaryData = binaryData;
|
|
26728
|
+
this.boneNames = boneNames;
|
|
26729
|
+
this.rootBoneName = rootBoneName;
|
|
26730
|
+
this.inverseBindMatrices = inverseBindMatrices;
|
|
26731
|
+
}
|
|
26732
|
+
var _proto = FBGeometryDataT.prototype;
|
|
26733
|
+
_proto.pack = function pack(builder) {
|
|
26734
|
+
var id = this.id !== null ? builder.createString(this.id) : 0;
|
|
26735
|
+
var name = this.name !== null ? builder.createString(this.name) : 0;
|
|
26736
|
+
var vertexData = this.vertexData !== null ? this.vertexData.pack(builder) : 0;
|
|
26737
|
+
var subMeshes = FBGeometryData.createSubMeshesVector(builder, builder.createObjectOffsetList(this.subMeshes));
|
|
26738
|
+
var buffer = this.buffer !== null ? builder.createString(this.buffer) : 0;
|
|
26739
|
+
var binaryData = FBGeometryData.createBinaryDataVector(builder, this.binaryData);
|
|
26740
|
+
var boneNames = FBGeometryData.createBoneNamesVector(builder, builder.createObjectOffsetList(this.boneNames));
|
|
26741
|
+
var rootBoneName = this.rootBoneName !== null ? builder.createString(this.rootBoneName) : 0;
|
|
26742
|
+
var inverseBindMatrices = FBGeometryData.createInverseBindMatricesVector(builder, this.inverseBindMatrices);
|
|
26743
|
+
FBGeometryData.startFBGeometryData(builder);
|
|
26744
|
+
FBGeometryData.addId(builder, id);
|
|
26745
|
+
FBGeometryData.addName(builder, name);
|
|
26746
|
+
FBGeometryData.addVertexData(builder, vertexData);
|
|
26747
|
+
FBGeometryData.addIndexFormat(builder, this.indexFormat);
|
|
26748
|
+
FBGeometryData.addIndexOffset(builder, this.indexOffset);
|
|
26749
|
+
FBGeometryData.addSubMeshes(builder, subMeshes);
|
|
26750
|
+
FBGeometryData.addMode(builder, this.mode);
|
|
26751
|
+
FBGeometryData.addBuffer(builder, buffer);
|
|
26752
|
+
FBGeometryData.addBinaryData(builder, binaryData);
|
|
26753
|
+
FBGeometryData.addBoneNames(builder, boneNames);
|
|
26754
|
+
FBGeometryData.addRootBoneName(builder, rootBoneName);
|
|
26755
|
+
FBGeometryData.addInverseBindMatrices(builder, inverseBindMatrices);
|
|
26756
|
+
return FBGeometryData.endFBGeometryData(builder);
|
|
26757
|
+
};
|
|
26758
|
+
return FBGeometryDataT;
|
|
26759
|
+
}();
|
|
26760
|
+
|
|
26761
|
+
var EffectsPackage = /*#__PURE__*/ function() {
|
|
26762
|
+
function EffectsPackage() {
|
|
26763
|
+
this.exportObjectDatas = [];
|
|
26764
|
+
}
|
|
26765
|
+
var _proto = EffectsPackage.prototype;
|
|
26766
|
+
_proto.addData = function addData(effectsObjectData) {
|
|
26767
|
+
this.exportObjectDatas.push(effectsObjectData);
|
|
26768
|
+
};
|
|
26769
|
+
_proto.serializeToBinary = function serializeToBinary() {
|
|
26770
|
+
var fbb = new Builder(1);
|
|
26771
|
+
var effectsPackage = new FBEffectsPackageDataT();
|
|
26772
|
+
var exportObjects = [];
|
|
26773
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(this.exportObjectDatas), _step; !(_step = _iterator()).done;){
|
|
26774
|
+
var effectsObjectData = _step.value;
|
|
26775
|
+
var fbEffectsObjectData = void 0;
|
|
26776
|
+
if (effectsObjectData.dataType === DataType.Geometry) {
|
|
26777
|
+
fbEffectsObjectData = new FBEffectsObjectDataT("Geometry", this.geometryDataToBinary(effectsObjectData));
|
|
26778
|
+
}
|
|
26779
|
+
if (!fbEffectsObjectData) {
|
|
26780
|
+
continue;
|
|
26781
|
+
}
|
|
26782
|
+
exportObjects.push(fbEffectsObjectData);
|
|
26783
|
+
}
|
|
26784
|
+
effectsPackage.exportObjects = exportObjects;
|
|
26785
|
+
FBEffectsPackageData.finishFBEffectsPackageDataBuffer(fbb, effectsPackage.pack(fbb));
|
|
26786
|
+
var buffer = fbb.asUint8Array(); // Of type `Uint8Array`.
|
|
26787
|
+
return buffer;
|
|
26788
|
+
};
|
|
26789
|
+
_proto.deserializeFromBinary = function deserializeFromBinary(buffer) {
|
|
26790
|
+
var buf = new ByteBuffer(buffer);
|
|
26791
|
+
var fbEffectsPackage = FBEffectsPackageData.getRootAsFBEffectsPackageData(buf);
|
|
26792
|
+
for(var i = 0; i < fbEffectsPackage.exportObjectsLength(); i++){
|
|
26793
|
+
var fbEffectsObjectData = fbEffectsPackage.exportObjects(i);
|
|
26794
|
+
if (!fbEffectsObjectData) {
|
|
26795
|
+
continue;
|
|
26796
|
+
}
|
|
26797
|
+
var dataBuffer = fbEffectsObjectData.dataArray();
|
|
26798
|
+
var dataType = fbEffectsObjectData.dataType();
|
|
26799
|
+
if (!dataBuffer) {
|
|
26800
|
+
continue;
|
|
26801
|
+
}
|
|
26802
|
+
var effectsObjectData = void 0;
|
|
26803
|
+
if (dataType === DataType.Geometry) {
|
|
26804
|
+
effectsObjectData = this.binaryToGeometryData(dataBuffer);
|
|
26805
|
+
}
|
|
26806
|
+
if (!effectsObjectData) {
|
|
26807
|
+
continue;
|
|
26808
|
+
}
|
|
26809
|
+
this.exportObjectDatas.push(effectsObjectData);
|
|
26810
|
+
}
|
|
26811
|
+
};
|
|
26812
|
+
_proto.geometryDataToBinary = function geometryDataToBinary(geometryData) {
|
|
26813
|
+
var fbb = new Builder(1);
|
|
26814
|
+
var fbGeometryData = new FBGeometryDataT();
|
|
26815
|
+
fbGeometryData.indexFormat = geometryData.indexFormat;
|
|
26816
|
+
fbGeometryData.indexOffset = geometryData.indexOffset;
|
|
26817
|
+
fbGeometryData.mode = geometryData.mode;
|
|
26818
|
+
fbGeometryData.id = geometryData.id;
|
|
26819
|
+
var _geometryData_boneNames;
|
|
26820
|
+
fbGeometryData.boneNames = (_geometryData_boneNames = geometryData.boneNames) != null ? _geometryData_boneNames : [];
|
|
26821
|
+
var _geometryData_rootBoneName;
|
|
26822
|
+
fbGeometryData.rootBoneName = (_geometryData_rootBoneName = geometryData.rootBoneName) != null ? _geometryData_rootBoneName : "";
|
|
26823
|
+
var _geometryData_inverseBindMatrices;
|
|
26824
|
+
fbGeometryData.inverseBindMatrices = (_geometryData_inverseBindMatrices = geometryData.inverseBindMatrices) != null ? _geometryData_inverseBindMatrices : [];
|
|
26825
|
+
var _geometryData_binaryData;
|
|
26826
|
+
fbGeometryData.binaryData = (_geometryData_binaryData = geometryData.binaryData) != null ? _geometryData_binaryData : [];
|
|
26827
|
+
var fbVertexdata = new FBVertexDataT();
|
|
26828
|
+
fbVertexdata.vertexCount = geometryData.vertexData.vertexCount;
|
|
26829
|
+
fbVertexdata.channels = [];
|
|
26830
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(geometryData.vertexData.channels), _step; !(_step = _iterator()).done;){
|
|
26831
|
+
var channel = _step.value;
|
|
26832
|
+
var fbChannel = new FBVertexChannelT(channel.semantic, channel.offset, channel.format, channel.dimension, channel.normalize);
|
|
26833
|
+
fbVertexdata.channels.push(fbChannel);
|
|
26834
|
+
}
|
|
26835
|
+
fbGeometryData.vertexData = fbVertexdata;
|
|
26836
|
+
var fbSubMeshes = [];
|
|
26837
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(geometryData.subMeshes), _step1; !(_step1 = _iterator1()).done;){
|
|
26838
|
+
var subMesh = _step1.value;
|
|
26839
|
+
var fbSubMesh = new FBSubMeshT(subMesh.offset, subMesh.indexCount, subMesh.vertexCount);
|
|
26840
|
+
fbSubMeshes.push(fbSubMesh);
|
|
26841
|
+
}
|
|
26842
|
+
fbGeometryData.subMeshes = fbSubMeshes;
|
|
26843
|
+
FBEffectsPackageData.finishFBEffectsPackageDataBuffer(fbb, fbGeometryData.pack(fbb));
|
|
26844
|
+
var buffer = fbb.asUint8Array(); // Of type `Uint8Array`.
|
|
26845
|
+
return buffer;
|
|
26846
|
+
};
|
|
26847
|
+
_proto.binaryToGeometryData = function binaryToGeometryData(buffer) {
|
|
26848
|
+
var buf = new ByteBuffer(buffer);
|
|
26849
|
+
var fbGeometryData = FBGeometryData.getRootAsFBGeometryData(buf);
|
|
26850
|
+
var vertexData = {
|
|
26851
|
+
vertexCount: 0,
|
|
26852
|
+
channels: []
|
|
26853
|
+
};
|
|
26854
|
+
var fbVertexData = fbGeometryData.vertexData();
|
|
26855
|
+
if (fbVertexData) {
|
|
26856
|
+
vertexData.vertexCount = fbVertexData.vertexCount();
|
|
26857
|
+
for(var i = 0; i < fbVertexData.channelsLength(); i++){
|
|
26858
|
+
var channel = fbVertexData.channels(i);
|
|
26859
|
+
if (!channel) {
|
|
26860
|
+
continue;
|
|
26861
|
+
}
|
|
26862
|
+
var _channel_semantic;
|
|
26863
|
+
var vertexChannel = {
|
|
26864
|
+
semantic: (_channel_semantic = channel.semantic()) != null ? _channel_semantic : "",
|
|
26865
|
+
offset: channel.offset(),
|
|
26866
|
+
format: channel.format(),
|
|
26867
|
+
dimension: channel.dimension()
|
|
26868
|
+
};
|
|
26869
|
+
vertexData.channels.push(vertexChannel);
|
|
26870
|
+
}
|
|
26871
|
+
}
|
|
26872
|
+
var subMeshes = [];
|
|
26873
|
+
for(var i1 = 0; i1 < fbGeometryData.subMeshesLength(); i1++){
|
|
26874
|
+
var fbSubMesh = fbGeometryData.subMeshes(i1);
|
|
26875
|
+
if (!fbSubMesh) {
|
|
26876
|
+
continue;
|
|
26877
|
+
}
|
|
26878
|
+
var subMesh = {
|
|
26879
|
+
offset: fbSubMesh.offset(),
|
|
26880
|
+
vertexCount: fbSubMesh.vertexCount()
|
|
26881
|
+
};
|
|
26882
|
+
subMeshes.push(subMesh);
|
|
26883
|
+
}
|
|
26884
|
+
var boneNames = [];
|
|
26885
|
+
for(var i2 = 0; i2 < fbGeometryData.boneNamesLength(); i2++){
|
|
26886
|
+
var boneName = fbGeometryData.boneNames(i2);
|
|
26887
|
+
boneNames.push(boneName);
|
|
26888
|
+
}
|
|
26889
|
+
var inverseBindMatricesArray = fbGeometryData.inverseBindMatricesArray();
|
|
26890
|
+
var _fbGeometryData_buffer, _fbGeometryData_rootBoneName, _fbGeometryData_binaryDataArray, _fbGeometryData_id;
|
|
26891
|
+
var geometryData = {
|
|
26892
|
+
vertexData: vertexData,
|
|
26893
|
+
indexFormat: fbGeometryData.indexFormat(),
|
|
26894
|
+
indexOffset: fbGeometryData.indexOffset(),
|
|
26895
|
+
subMeshes: subMeshes,
|
|
26896
|
+
mode: fbGeometryData.mode(),
|
|
26897
|
+
buffer: (_fbGeometryData_buffer = fbGeometryData.buffer()) != null ? _fbGeometryData_buffer : "",
|
|
26898
|
+
boneNames: boneNames,
|
|
26899
|
+
rootBoneName: (_fbGeometryData_rootBoneName = fbGeometryData.rootBoneName()) != null ? _fbGeometryData_rootBoneName : "",
|
|
26900
|
+
inverseBindMatrices: inverseBindMatricesArray ? Array.from(inverseBindMatricesArray) : undefined,
|
|
26901
|
+
binaryData: (_fbGeometryData_binaryDataArray = fbGeometryData.binaryDataArray()) != null ? _fbGeometryData_binaryDataArray : undefined,
|
|
26902
|
+
id: (_fbGeometryData_id = fbGeometryData.id()) != null ? _fbGeometryData_id : "",
|
|
26903
|
+
dataType: DataType.Geometry
|
|
26904
|
+
};
|
|
26905
|
+
return geometryData;
|
|
26906
|
+
};
|
|
26907
|
+
return EffectsPackage;
|
|
26908
|
+
}();
|
|
26909
|
+
|
|
25342
26910
|
/**
|
|
25343
26911
|
* Engine 基类,负责维护所有 GPU 资源的管理及销毁
|
|
25344
26912
|
*/ var Engine = /*#__PURE__*/ function() {
|
|
@@ -25412,16 +26980,23 @@ var listOrder = 0;
|
|
|
25412
26980
|
for(var i = 0; i < bins.length; i++){
|
|
25413
26981
|
var binaryData = bins[i];
|
|
25414
26982
|
var binaryBuffer = scene.bins[i];
|
|
25415
|
-
|
|
25416
|
-
binaryData.buffer = binaryBuffer;
|
|
25417
|
-
//@ts-expect-error
|
|
25418
|
-
if (binaryData.id) {
|
|
26983
|
+
if (binaryData.dataType === DataType.BinaryAsset) {
|
|
25419
26984
|
//@ts-expect-error
|
|
25420
|
-
|
|
26985
|
+
binaryData.buffer = binaryBuffer;
|
|
26986
|
+
if (binaryData.id) {
|
|
26987
|
+
this.addEffectsObjectData(binaryData);
|
|
26988
|
+
}
|
|
26989
|
+
} else {
|
|
26990
|
+
var effectsPackage = new EffectsPackage();
|
|
26991
|
+
effectsPackage.deserializeFromBinary(new Uint8Array(binaryBuffer));
|
|
26992
|
+
for(var _iterator7 = _create_for_of_iterator_helper_loose(effectsPackage.exportObjectDatas), _step7; !(_step7 = _iterator7()).done;){
|
|
26993
|
+
var effectsObjectData = _step7.value;
|
|
26994
|
+
this.addEffectsObjectData(effectsObjectData);
|
|
26995
|
+
}
|
|
25421
26996
|
}
|
|
25422
26997
|
}
|
|
25423
|
-
for(var
|
|
25424
|
-
var textureData =
|
|
26998
|
+
for(var _iterator8 = _create_for_of_iterator_helper_loose(textureOptions), _step8; !(_step8 = _iterator8()).done;){
|
|
26999
|
+
var textureData = _step8.value;
|
|
25425
27000
|
this.addEffectsObjectData(textureData);
|
|
25426
27001
|
}
|
|
25427
27002
|
};
|
|
@@ -25731,7 +27306,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem, true);
|
|
|
25731
27306
|
registerPlugin("particle", ParticleLoader, exports.VFXItem, true);
|
|
25732
27307
|
registerPlugin("cal", CalculateLoader, exports.VFXItem, true);
|
|
25733
27308
|
registerPlugin("interact", InteractLoader, exports.VFXItem, true);
|
|
25734
|
-
var version = "2.0.0-alpha.
|
|
27309
|
+
var version = "2.0.0-alpha.27";
|
|
25735
27310
|
logger.info("Core version: " + version + ".");
|
|
25736
27311
|
|
|
25737
27312
|
exports.AbstractPlugin = AbstractPlugin;
|
|
@@ -25763,6 +27338,7 @@ exports.EVENT_TYPE_TOUCH_END = EVENT_TYPE_TOUCH_END;
|
|
|
25763
27338
|
exports.EVENT_TYPE_TOUCH_MOVE = EVENT_TYPE_TOUCH_MOVE;
|
|
25764
27339
|
exports.EVENT_TYPE_TOUCH_START = EVENT_TYPE_TOUCH_START;
|
|
25765
27340
|
exports.EffectsObject = EffectsObject;
|
|
27341
|
+
exports.EffectsPackage = EffectsPackage;
|
|
25766
27342
|
exports.Engine = Engine;
|
|
25767
27343
|
exports.EventSystem = EventSystem;
|
|
25768
27344
|
exports.Float16ArrayWrapper = Float16ArrayWrapper;
|