babylonjs-serializers 5.7.0 → 5.8.2
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/babylon.glTF2Serializer.js +209 -3
- package/babylon.glTF2Serializer.js.map +1 -1
- package/babylon.glTF2Serializer.min.js +1 -1
- package/babylon.glTF2Serializer.min.js.map +1 -1
- package/babylonjs.serializers.d.ts +38 -2
- package/babylonjs.serializers.js +212 -3
- package/babylonjs.serializers.js.map +1 -1
- package/babylonjs.serializers.min.js +1 -1
- package/babylonjs.serializers.min.js.map +1 -1
- package/babylonjs.serializers.module.d.ts +84 -4
- package/package.json +3 -3
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
|
|
2
2
|
declare module BABYLON {
|
|
3
|
+
/**
|
|
4
|
+
* [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/README.md)
|
|
5
|
+
*/
|
|
6
|
+
export class EXT_mesh_gpu_instancing implements IGLTFExporterExtensionV2 {
|
|
7
|
+
/** Name of this extension */
|
|
8
|
+
readonly name = "EXT_mesh_gpu_instancing";
|
|
9
|
+
/** Defines whether this extension is enabled */
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
/** Defines whether this extension is required */
|
|
12
|
+
required: boolean;
|
|
13
|
+
private _exporter;
|
|
14
|
+
private _wasUsed;
|
|
15
|
+
constructor(exporter: _Exporter);
|
|
16
|
+
dispose(): void;
|
|
17
|
+
/** @hidden */
|
|
18
|
+
get wasUsed(): boolean;
|
|
19
|
+
postExportNodeAsync?(context: string, node: Nullable<BABYLON.GLTF2.INode>, babylonNode: Node, nodeMap?: {
|
|
20
|
+
[key: number]: number;
|
|
21
|
+
}, binaryWriter?: _BinaryWriter): Promise<Nullable<BABYLON.GLTF2.INode>>;
|
|
22
|
+
private _buildAccessor;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
3
26
|
|
|
4
27
|
|
|
5
28
|
/**
|
|
@@ -578,7 +601,7 @@ declare module BABYLON {
|
|
|
578
601
|
_extensionsPostExportMeshPrimitiveAsync(context: string, meshPrimitive: BABYLON.GLTF2.IMeshPrimitive, babylonSubMesh: SubMesh, binaryWriter: _BinaryWriter): Promise<Nullable<BABYLON.GLTF2.IMeshPrimitive>>;
|
|
579
602
|
_extensionsPostExportNodeAsync(context: string, node: Nullable<BABYLON.GLTF2.INode>, babylonNode: Node, nodeMap?: {
|
|
580
603
|
[key: number]: number;
|
|
581
|
-
}): Promise<Nullable<BABYLON.GLTF2.INode>>;
|
|
604
|
+
}, binaryWriter?: _BinaryWriter): Promise<Nullable<BABYLON.GLTF2.INode>>;
|
|
582
605
|
_extensionsPostExportMaterialAsync(context: string, material: Nullable<BABYLON.GLTF2.IMaterial>, babylonMaterial: Material): Promise<Nullable<BABYLON.GLTF2.IMaterial>>;
|
|
583
606
|
_extensionsPostExportMaterialAdditionalTextures(context: string, material: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
|
|
584
607
|
_extensionsPostExportTextures(context: string, textureInfo: BABYLON.GLTF2.ITextureInfo, babylonTexture: BaseTexture): void;
|
|
@@ -595,6 +618,7 @@ declare module BABYLON {
|
|
|
595
618
|
*/
|
|
596
619
|
constructor(babylonScene?: Nullable<Scene>, options?: IExportOptions);
|
|
597
620
|
dispose(): void;
|
|
621
|
+
get options(): IExportOptions;
|
|
598
622
|
/**
|
|
599
623
|
* Registers a glTF exporter extension
|
|
600
624
|
* @param name Name of the extension to export
|
|
@@ -899,6 +923,18 @@ declare module BABYLON {
|
|
|
899
923
|
* @param byteOffset If defined, specifies where to set the value as an offset.
|
|
900
924
|
*/
|
|
901
925
|
setUInt32(entry: number, byteOffset?: number): void;
|
|
926
|
+
/**
|
|
927
|
+
* Stores an Int16 in the array buffer
|
|
928
|
+
* @param entry
|
|
929
|
+
* @param byteOffset If defined, specifies where to set the value as an offset.
|
|
930
|
+
*/
|
|
931
|
+
setInt16(entry: number, byteOffset?: number): void;
|
|
932
|
+
/**
|
|
933
|
+
* Stores a byte in the array buffer
|
|
934
|
+
* @param entry
|
|
935
|
+
* @param byteOffset If defined, specifies where to set the value as an offset.
|
|
936
|
+
*/
|
|
937
|
+
setByte(entry: number, byteOffset?: number): void;
|
|
902
938
|
}
|
|
903
939
|
|
|
904
940
|
|
|
@@ -942,7 +978,7 @@ declare module BABYLON {
|
|
|
942
978
|
*/
|
|
943
979
|
postExportNodeAsync?(context: string, node: Nullable<BABYLON.GLTF2.INode>, babylonNode: Node, nodeMap?: {
|
|
944
980
|
[key: number]: number;
|
|
945
|
-
}): Promise<Nullable<BABYLON.GLTF2.INode>>;
|
|
981
|
+
}, binaryWriter?: _BinaryWriter): Promise<Nullable<BABYLON.GLTF2.INode>>;
|
|
946
982
|
/**
|
|
947
983
|
* Define this method to modify the default behavior when exporting a material
|
|
948
984
|
* @param material glTF material
|
package/babylonjs.serializers.js
CHANGED
|
@@ -492,6 +492,156 @@ var OBJExport = /** @class */ (function () {
|
|
|
492
492
|
|
|
493
493
|
|
|
494
494
|
|
|
495
|
+
/***/ }),
|
|
496
|
+
|
|
497
|
+
/***/ "../../../lts/serializers/dist/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js":
|
|
498
|
+
/*!************************************************************************************!*\
|
|
499
|
+
!*** ../../../lts/serializers/dist/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js ***!
|
|
500
|
+
\************************************************************************************/
|
|
501
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
502
|
+
|
|
503
|
+
__webpack_require__.r(__webpack_exports__);
|
|
504
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
505
|
+
/* harmony export */ "EXT_mesh_gpu_instancing": () => (/* binding */ EXT_mesh_gpu_instancing)
|
|
506
|
+
/* harmony export */ });
|
|
507
|
+
/* harmony import */ var _glTFExporter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../glTFExporter */ "../../../lts/serializers/dist/glTF/2.0/glTFExporter.js");
|
|
508
|
+
/* harmony import */ var core_Meshes_mesh__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Buffers/buffer */ "core/Maths/math.vector");
|
|
509
|
+
/* harmony import */ var core_Meshes_mesh__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Meshes_mesh__WEBPACK_IMPORTED_MODULE_1__);
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
var NAME = "EXT_mesh_gpu_instancing";
|
|
516
|
+
/**
|
|
517
|
+
* [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/README.md)
|
|
518
|
+
*/
|
|
519
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
520
|
+
var EXT_mesh_gpu_instancing = /** @class */ (function () {
|
|
521
|
+
function EXT_mesh_gpu_instancing(exporter) {
|
|
522
|
+
/** Name of this extension */
|
|
523
|
+
this.name = NAME;
|
|
524
|
+
/** Defines whether this extension is enabled */
|
|
525
|
+
this.enabled = true;
|
|
526
|
+
/** Defines whether this extension is required */
|
|
527
|
+
this.required = false;
|
|
528
|
+
this._wasUsed = false;
|
|
529
|
+
this._exporter = exporter;
|
|
530
|
+
}
|
|
531
|
+
EXT_mesh_gpu_instancing.prototype.dispose = function () { };
|
|
532
|
+
Object.defineProperty(EXT_mesh_gpu_instancing.prototype, "wasUsed", {
|
|
533
|
+
/** @hidden */
|
|
534
|
+
get: function () {
|
|
535
|
+
return this._wasUsed;
|
|
536
|
+
},
|
|
537
|
+
enumerable: false,
|
|
538
|
+
configurable: true
|
|
539
|
+
});
|
|
540
|
+
EXT_mesh_gpu_instancing.prototype.postExportNodeAsync = function (context, node, babylonNode, nodeMap, binaryWriter) {
|
|
541
|
+
var _this = this;
|
|
542
|
+
return new Promise(function (resolve) {
|
|
543
|
+
if (node && babylonNode instanceof core_Meshes_mesh__WEBPACK_IMPORTED_MODULE_1__.Mesh) {
|
|
544
|
+
if (babylonNode.hasThinInstances && binaryWriter) {
|
|
545
|
+
_this._wasUsed = true;
|
|
546
|
+
var noTranslation = core_Meshes_mesh__WEBPACK_IMPORTED_MODULE_1__.Vector3.Zero();
|
|
547
|
+
var noRotation = core_Meshes_mesh__WEBPACK_IMPORTED_MODULE_1__.Quaternion.Identity();
|
|
548
|
+
var noScale = core_Meshes_mesh__WEBPACK_IMPORTED_MODULE_1__.Vector3.One();
|
|
549
|
+
// retreive all the instance world matrix
|
|
550
|
+
var matrix = babylonNode.thinInstanceGetWorldMatrices();
|
|
551
|
+
var iwt = core_Meshes_mesh__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector3[2];
|
|
552
|
+
var iwr = core_Meshes_mesh__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Quaternion[1];
|
|
553
|
+
var iws = core_Meshes_mesh__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector3[3];
|
|
554
|
+
var hasAnyInstanceWorldTranslation = false;
|
|
555
|
+
var hasAnyInstanceWorldRotation = false;
|
|
556
|
+
var hasAnyInstanceWorldScale = false;
|
|
557
|
+
// prepare temp buffers
|
|
558
|
+
var translationBuffer = new Float32Array(babylonNode.thinInstanceCount * 3);
|
|
559
|
+
var rotationBuffer = new Float32Array(babylonNode.thinInstanceCount * 4);
|
|
560
|
+
var scaleBuffer = new Float32Array(babylonNode.thinInstanceCount * 3);
|
|
561
|
+
var i = 0;
|
|
562
|
+
for (var _i = 0, matrix_1 = matrix; _i < matrix_1.length; _i++) {
|
|
563
|
+
var m = matrix_1[_i];
|
|
564
|
+
m.decompose(iws, iwr, iwt);
|
|
565
|
+
// fill the temp buffer
|
|
566
|
+
translationBuffer.set(iwt.asArray(), i * 3);
|
|
567
|
+
rotationBuffer.set(iwr.normalize().asArray(), i * 4); // ensure the quaternion is normalized
|
|
568
|
+
scaleBuffer.set(iws.asArray(), i * 3);
|
|
569
|
+
// this is where we decide if there is any transformation
|
|
570
|
+
hasAnyInstanceWorldTranslation = hasAnyInstanceWorldTranslation || !iwt.equalsWithEpsilon(noTranslation);
|
|
571
|
+
hasAnyInstanceWorldRotation = hasAnyInstanceWorldRotation || !iwr.equalsWithEpsilon(noRotation);
|
|
572
|
+
hasAnyInstanceWorldScale = hasAnyInstanceWorldScale || !iws.equalsWithEpsilon(noScale);
|
|
573
|
+
i++;
|
|
574
|
+
}
|
|
575
|
+
var extension = {
|
|
576
|
+
attributes: {},
|
|
577
|
+
};
|
|
578
|
+
// do we need to write TRANSLATION ?
|
|
579
|
+
if (hasAnyInstanceWorldTranslation) {
|
|
580
|
+
extension.attributes["TRANSLATION"] = _this._buildAccessor(translationBuffer, "VEC3" /* VEC3 */, babylonNode.thinInstanceCount, binaryWriter, 5126 /* FLOAT */);
|
|
581
|
+
}
|
|
582
|
+
// do we need to write ROTATION ?
|
|
583
|
+
if (hasAnyInstanceWorldRotation) {
|
|
584
|
+
var componentType = 5126 /* FLOAT */; // we decided to stay on FLOAT for now see https://github.com/BabylonJS/Babylon.js/pull/12495
|
|
585
|
+
extension.attributes["ROTATION"] = _this._buildAccessor(rotationBuffer, "VEC4" /* VEC4 */, babylonNode.thinInstanceCount, binaryWriter, componentType);
|
|
586
|
+
}
|
|
587
|
+
// do we need to write SCALE ?
|
|
588
|
+
if (hasAnyInstanceWorldScale) {
|
|
589
|
+
extension.attributes["SCALE"] = _this._buildAccessor(scaleBuffer, "VEC3" /* VEC3 */, babylonNode.thinInstanceCount, binaryWriter, 5126 /* FLOAT */);
|
|
590
|
+
}
|
|
591
|
+
/* eslint-enable @typescript-eslint/naming-convention*/
|
|
592
|
+
node.extensions = node.extensions || {};
|
|
593
|
+
node.extensions[NAME] = extension;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
resolve(node);
|
|
597
|
+
});
|
|
598
|
+
};
|
|
599
|
+
EXT_mesh_gpu_instancing.prototype._buildAccessor = function (buffer, type, count, binaryWriter, componentType) {
|
|
600
|
+
// write the buffer
|
|
601
|
+
var bufferOffset = binaryWriter.getByteOffset();
|
|
602
|
+
switch (componentType) {
|
|
603
|
+
case 5126 /* FLOAT */: {
|
|
604
|
+
for (var i = 0; i != buffer.length; i++) {
|
|
605
|
+
binaryWriter.setFloat32(buffer[i]);
|
|
606
|
+
}
|
|
607
|
+
break;
|
|
608
|
+
}
|
|
609
|
+
case 5120 /* BYTE */: {
|
|
610
|
+
for (var i = 0; i != buffer.length; i++) {
|
|
611
|
+
binaryWriter.setByte(buffer[i] * 127);
|
|
612
|
+
}
|
|
613
|
+
break;
|
|
614
|
+
}
|
|
615
|
+
case 5122 /* SHORT */: {
|
|
616
|
+
for (var i = 0; i != buffer.length; i++) {
|
|
617
|
+
binaryWriter.setInt16(buffer[i] * 32767);
|
|
618
|
+
}
|
|
619
|
+
break;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
// build the buffer view
|
|
623
|
+
var bv = { buffer: 0, byteOffset: bufferOffset, byteLength: buffer.length * core_Meshes_mesh__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.GetTypeByteLength(componentType) };
|
|
624
|
+
var bufferViewIndex = this._exporter._bufferViews.length;
|
|
625
|
+
this._exporter._bufferViews.push(bv);
|
|
626
|
+
// finally build the accessor
|
|
627
|
+
var accessorIndex = this._exporter._accessors.length;
|
|
628
|
+
var accessor = {
|
|
629
|
+
bufferView: bufferViewIndex,
|
|
630
|
+
componentType: componentType,
|
|
631
|
+
count: count,
|
|
632
|
+
type: type,
|
|
633
|
+
normalized: componentType == 5120 /* BYTE */ || componentType == 5122 /* SHORT */,
|
|
634
|
+
};
|
|
635
|
+
this._exporter._accessors.push(accessor);
|
|
636
|
+
return accessorIndex;
|
|
637
|
+
};
|
|
638
|
+
return EXT_mesh_gpu_instancing;
|
|
639
|
+
}());
|
|
640
|
+
|
|
641
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
642
|
+
_glTFExporter__WEBPACK_IMPORTED_MODULE_0__._Exporter.RegisterExtension(NAME, function (exporter) { return new EXT_mesh_gpu_instancing(exporter); });
|
|
643
|
+
|
|
644
|
+
|
|
495
645
|
/***/ }),
|
|
496
646
|
|
|
497
647
|
/***/ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_lights_punctual.js":
|
|
@@ -1589,6 +1739,7 @@ _glTFExporter__WEBPACK_IMPORTED_MODULE_1__._Exporter.RegisterExtension(NAME, fun
|
|
|
1589
1739
|
|
|
1590
1740
|
__webpack_require__.r(__webpack_exports__);
|
|
1591
1741
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1742
|
+
/* harmony export */ "EXT_mesh_gpu_instancing": () => (/* reexport safe */ _EXT_mesh_gpu_instancing__WEBPACK_IMPORTED_MODULE_10__.EXT_mesh_gpu_instancing),
|
|
1592
1743
|
/* harmony export */ "KHR_lights_punctual": () => (/* reexport safe */ _KHR_lights_punctual__WEBPACK_IMPORTED_MODULE_1__.KHR_lights_punctual),
|
|
1593
1744
|
/* harmony export */ "KHR_materials_clearcoat": () => (/* reexport safe */ _KHR_materials_clearcoat__WEBPACK_IMPORTED_MODULE_2__.KHR_materials_clearcoat),
|
|
1594
1745
|
/* harmony export */ "KHR_materials_ior": () => (/* reexport safe */ _KHR_materials_ior__WEBPACK_IMPORTED_MODULE_6__.KHR_materials_ior),
|
|
@@ -1610,6 +1761,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1610
1761
|
/* harmony import */ var _KHR_materials_specular__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./KHR_materials_specular */ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_specular.js");
|
|
1611
1762
|
/* harmony import */ var _KHR_materials_volume__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./KHR_materials_volume */ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_volume.js");
|
|
1612
1763
|
/* harmony import */ var _KHR_materials_transmission__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./KHR_materials_transmission */ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_transmission.js");
|
|
1764
|
+
/* harmony import */ var _EXT_mesh_gpu_instancing__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./EXT_mesh_gpu_instancing */ "../../../lts/serializers/dist/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js");
|
|
1765
|
+
|
|
1613
1766
|
|
|
1614
1767
|
|
|
1615
1768
|
|
|
@@ -2666,8 +2819,8 @@ var _Exporter = /** @class */ (function () {
|
|
|
2666
2819
|
_Exporter.prototype._extensionsPostExportMeshPrimitiveAsync = function (context, meshPrimitive, babylonSubMesh, binaryWriter) {
|
|
2667
2820
|
return this._applyExtensions(meshPrimitive, function (extension, node) { return extension.postExportMeshPrimitiveAsync && extension.postExportMeshPrimitiveAsync(context, node, babylonSubMesh, binaryWriter); });
|
|
2668
2821
|
};
|
|
2669
|
-
_Exporter.prototype._extensionsPostExportNodeAsync = function (context, node, babylonNode, nodeMap) {
|
|
2670
|
-
return this._applyExtensions(node, function (extension, node) { return extension.postExportNodeAsync && extension.postExportNodeAsync(context, node, babylonNode, nodeMap); });
|
|
2822
|
+
_Exporter.prototype._extensionsPostExportNodeAsync = function (context, node, babylonNode, nodeMap, binaryWriter) {
|
|
2823
|
+
return this._applyExtensions(node, function (extension, node) { return extension.postExportNodeAsync && extension.postExportNodeAsync(context, node, babylonNode, nodeMap, binaryWriter); });
|
|
2671
2824
|
};
|
|
2672
2825
|
_Exporter.prototype._extensionsPostExportMaterialAsync = function (context, material, babylonMaterial) {
|
|
2673
2826
|
return this._applyExtensions(material, function (extension, node) { return extension.postExportMaterialAsync && extension.postExportMaterialAsync(context, node, babylonMaterial); });
|
|
@@ -2744,6 +2897,13 @@ var _Exporter = /** @class */ (function () {
|
|
|
2744
2897
|
extension.dispose();
|
|
2745
2898
|
}
|
|
2746
2899
|
};
|
|
2900
|
+
Object.defineProperty(_Exporter.prototype, "options", {
|
|
2901
|
+
get: function () {
|
|
2902
|
+
return this._options;
|
|
2903
|
+
},
|
|
2904
|
+
enumerable: false,
|
|
2905
|
+
configurable: true
|
|
2906
|
+
});
|
|
2747
2907
|
/**
|
|
2748
2908
|
* Registers a glTF exporter extension
|
|
2749
2909
|
* @param name Name of the extension to export
|
|
@@ -4203,7 +4363,7 @@ var _Exporter = /** @class */ (function () {
|
|
|
4203
4363
|
promiseChain = promiseChain.then(function () {
|
|
4204
4364
|
var convertToRightHandedSystem = _this._convertToRightHandedSystemMap[babylonNode.uniqueId];
|
|
4205
4365
|
return _this._createNodeAsync(babylonNode, binaryWriter, convertToRightHandedSystem).then(function (node) {
|
|
4206
|
-
var promise = _this._extensionsPostExportNodeAsync("createNodeAsync", node, babylonNode, nodeMap);
|
|
4366
|
+
var promise = _this._extensionsPostExportNodeAsync("createNodeAsync", node, babylonNode, nodeMap, binaryWriter);
|
|
4207
4367
|
if (promise == null) {
|
|
4208
4368
|
core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Tools.Warn("Not exporting node ".concat(babylonNode.name));
|
|
4209
4369
|
return Promise.resolve();
|
|
@@ -4552,6 +4712,50 @@ var _BinaryWriter = /** @class */ (function () {
|
|
|
4552
4712
|
this._byteOffset += 4;
|
|
4553
4713
|
}
|
|
4554
4714
|
};
|
|
4715
|
+
/**
|
|
4716
|
+
* Stores an Int16 in the array buffer
|
|
4717
|
+
* @param entry
|
|
4718
|
+
* @param byteOffset If defined, specifies where to set the value as an offset.
|
|
4719
|
+
*/
|
|
4720
|
+
_BinaryWriter.prototype.setInt16 = function (entry, byteOffset) {
|
|
4721
|
+
if (byteOffset != null) {
|
|
4722
|
+
if (byteOffset < this._byteOffset) {
|
|
4723
|
+
this._dataView.setInt16(byteOffset, entry, true);
|
|
4724
|
+
}
|
|
4725
|
+
else {
|
|
4726
|
+
core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Tools.Error("BinaryWriter: byteoffset is greater than the current binary buffer length!");
|
|
4727
|
+
}
|
|
4728
|
+
}
|
|
4729
|
+
else {
|
|
4730
|
+
if (this._byteOffset + 2 > this._arrayBuffer.byteLength) {
|
|
4731
|
+
this._resizeBuffer(this._arrayBuffer.byteLength * 2);
|
|
4732
|
+
}
|
|
4733
|
+
this._dataView.setInt16(this._byteOffset, entry, true);
|
|
4734
|
+
this._byteOffset += 2;
|
|
4735
|
+
}
|
|
4736
|
+
};
|
|
4737
|
+
/**
|
|
4738
|
+
* Stores a byte in the array buffer
|
|
4739
|
+
* @param entry
|
|
4740
|
+
* @param byteOffset If defined, specifies where to set the value as an offset.
|
|
4741
|
+
*/
|
|
4742
|
+
_BinaryWriter.prototype.setByte = function (entry, byteOffset) {
|
|
4743
|
+
if (byteOffset != null) {
|
|
4744
|
+
if (byteOffset < this._byteOffset) {
|
|
4745
|
+
this._dataView.setInt8(byteOffset, entry);
|
|
4746
|
+
}
|
|
4747
|
+
else {
|
|
4748
|
+
core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Tools.Error("BinaryWriter: byteoffset is greater than the current binary buffer length!");
|
|
4749
|
+
}
|
|
4750
|
+
}
|
|
4751
|
+
else {
|
|
4752
|
+
if (this._byteOffset + 1 > this._arrayBuffer.byteLength) {
|
|
4753
|
+
this._resizeBuffer(this._arrayBuffer.byteLength * 2);
|
|
4754
|
+
}
|
|
4755
|
+
this._dataView.setInt8(this._byteOffset, entry);
|
|
4756
|
+
this._byteOffset++;
|
|
4757
|
+
}
|
|
4758
|
+
};
|
|
4555
4759
|
return _BinaryWriter;
|
|
4556
4760
|
}());
|
|
4557
4761
|
|
|
@@ -5928,6 +6132,7 @@ var _GLTFUtilities = /** @class */ (function () {
|
|
|
5928
6132
|
|
|
5929
6133
|
__webpack_require__.r(__webpack_exports__);
|
|
5930
6134
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6135
|
+
/* harmony export */ "EXT_mesh_gpu_instancing": () => (/* reexport safe */ _Extensions_index__WEBPACK_IMPORTED_MODULE_7__.EXT_mesh_gpu_instancing),
|
|
5931
6136
|
/* harmony export */ "GLTF2Export": () => (/* reexport safe */ _glTFSerializer__WEBPACK_IMPORTED_MODULE_5__.GLTF2Export),
|
|
5932
6137
|
/* harmony export */ "GLTFData": () => (/* reexport safe */ _glTFData__WEBPACK_IMPORTED_MODULE_1__.GLTFData),
|
|
5933
6138
|
/* harmony export */ "KHR_lights_punctual": () => (/* reexport safe */ _Extensions_index__WEBPACK_IMPORTED_MODULE_7__.KHR_lights_punctual),
|
|
@@ -6017,6 +6222,7 @@ var __IGLTFExporterExtension = 0; // I am here to allow dts to be created
|
|
|
6017
6222
|
|
|
6018
6223
|
__webpack_require__.r(__webpack_exports__);
|
|
6019
6224
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6225
|
+
/* harmony export */ "EXT_mesh_gpu_instancing": () => (/* reexport safe */ _2_0_index__WEBPACK_IMPORTED_MODULE_1__.EXT_mesh_gpu_instancing),
|
|
6020
6226
|
/* harmony export */ "GLTF2Export": () => (/* reexport safe */ _2_0_index__WEBPACK_IMPORTED_MODULE_1__.GLTF2Export),
|
|
6021
6227
|
/* harmony export */ "GLTFData": () => (/* reexport safe */ _2_0_index__WEBPACK_IMPORTED_MODULE_1__.GLTFData),
|
|
6022
6228
|
/* harmony export */ "KHR_lights_punctual": () => (/* reexport safe */ _2_0_index__WEBPACK_IMPORTED_MODULE_1__.KHR_lights_punctual),
|
|
@@ -6054,6 +6260,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6054
6260
|
|
|
6055
6261
|
__webpack_require__.r(__webpack_exports__);
|
|
6056
6262
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6263
|
+
/* harmony export */ "EXT_mesh_gpu_instancing": () => (/* reexport safe */ _glTF_index__WEBPACK_IMPORTED_MODULE_1__.EXT_mesh_gpu_instancing),
|
|
6057
6264
|
/* harmony export */ "GLTF2Export": () => (/* reexport safe */ _glTF_index__WEBPACK_IMPORTED_MODULE_1__.GLTF2Export),
|
|
6058
6265
|
/* harmony export */ "GLTFData": () => (/* reexport safe */ _glTF_index__WEBPACK_IMPORTED_MODULE_1__.GLTFData),
|
|
6059
6266
|
/* harmony export */ "KHR_lights_punctual": () => (/* reexport safe */ _glTF_index__WEBPACK_IMPORTED_MODULE_1__.KHR_lights_punctual),
|
|
@@ -6095,6 +6302,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6095
6302
|
|
|
6096
6303
|
__webpack_require__.r(__webpack_exports__);
|
|
6097
6304
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6305
|
+
/* harmony export */ "EXT_mesh_gpu_instancing": () => (/* reexport safe */ _glTF_2_0_index__WEBPACK_IMPORTED_MODULE_4__.EXT_mesh_gpu_instancing),
|
|
6098
6306
|
/* harmony export */ "GLTF2Export": () => (/* reexport safe */ _glTF_2_0_index__WEBPACK_IMPORTED_MODULE_4__.GLTF2Export),
|
|
6099
6307
|
/* harmony export */ "GLTFData": () => (/* reexport safe */ _glTF_2_0_index__WEBPACK_IMPORTED_MODULE_4__.GLTFData),
|
|
6100
6308
|
/* harmony export */ "KHR_lights_punctual": () => (/* reexport safe */ _glTF_2_0_index__WEBPACK_IMPORTED_MODULE_4__.KHR_lights_punctual),
|
|
@@ -6232,6 +6440,7 @@ if (typeof globalObject !== "undefined") {
|
|
|
6232
6440
|
|
|
6233
6441
|
__webpack_require__.r(__webpack_exports__);
|
|
6234
6442
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6443
|
+
/* harmony export */ "EXT_mesh_gpu_instancing": () => (/* reexport safe */ _legacy_glTF2Serializer__WEBPACK_IMPORTED_MODULE_1__.EXT_mesh_gpu_instancing),
|
|
6235
6444
|
/* harmony export */ "GLTF2Export": () => (/* reexport safe */ _legacy_glTF2Serializer__WEBPACK_IMPORTED_MODULE_1__.GLTF2Export),
|
|
6236
6445
|
/* harmony export */ "GLTFData": () => (/* reexport safe */ _legacy_glTF2Serializer__WEBPACK_IMPORTED_MODULE_1__.GLTFData),
|
|
6237
6446
|
/* harmony export */ "KHR_lights_punctual": () => (/* reexport safe */ _legacy_glTF2Serializer__WEBPACK_IMPORTED_MODULE_1__.KHR_lights_punctual),
|