babylonjs-serializers 5.11.0 → 5.13.0

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.
@@ -7,7 +7,7 @@
7
7
  exports["babylonjs-serializers"] = factory(require("babylonjs"));
8
8
  else
9
9
  root["SERIALIZERS"] = factory(root["BABYLON"]);
10
- })((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_core_Maths_math_vector__) {
10
+ })((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), (__WEBPACK_EXTERNAL_MODULE_core_Maths_math_vector__) => {
11
11
  return /******/ (() => { // webpackBootstrap
12
12
  /******/ "use strict";
13
13
  /******/ var __webpack_modules__ = ({
@@ -27,6 +27,7 @@ __webpack_require__.r(__webpack_exports__);
27
27
  /* harmony export */ "__await": () => (/* binding */ __await),
28
28
  /* harmony export */ "__awaiter": () => (/* binding */ __awaiter),
29
29
  /* harmony export */ "__classPrivateFieldGet": () => (/* binding */ __classPrivateFieldGet),
30
+ /* harmony export */ "__classPrivateFieldIn": () => (/* binding */ __classPrivateFieldIn),
30
31
  /* harmony export */ "__classPrivateFieldSet": () => (/* binding */ __classPrivateFieldSet),
31
32
  /* harmony export */ "__createBinding": () => (/* binding */ __createBinding),
32
33
  /* harmony export */ "__decorate": () => (/* binding */ __decorate),
@@ -45,7 +46,7 @@ __webpack_require__.r(__webpack_exports__);
45
46
  /* harmony export */ "__spreadArrays": () => (/* binding */ __spreadArrays),
46
47
  /* harmony export */ "__values": () => (/* binding */ __values)
47
48
  /* harmony export */ });
48
- /*! *****************************************************************************
49
+ /******************************************************************************
49
50
  Copyright (c) Microsoft Corporation.
50
51
 
51
52
  Permission to use, copy, modify, and/or distribute this software for any
@@ -154,7 +155,11 @@ function __generator(thisArg, body) {
154
155
 
155
156
  var __createBinding = Object.create ? (function(o, m, k, k2) {
156
157
  if (k2 === undefined) k2 = k;
157
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
158
+ var desc = Object.getOwnPropertyDescriptor(m, k);
159
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
160
+ desc = { enumerable: true, get: function() { return m[k]; } };
161
+ }
162
+ Object.defineProperty(o, k2, desc);
158
163
  }) : (function(o, m, k, k2) {
159
164
  if (k2 === undefined) k2 = k;
160
165
  o[k2] = m[k];
@@ -284,6 +289,11 @@ function __classPrivateFieldSet(receiver, state, value, kind, f) {
284
289
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
285
290
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
286
291
  }
292
+
293
+ function __classPrivateFieldIn(state, receiver) {
294
+ if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
295
+ return typeof state === "function" ? receiver === state : state.has(receiver);
296
+ }
287
297
 
288
298
 
289
299
  /***/ }),
@@ -2542,7 +2552,6 @@ __webpack_require__.r(__webpack_exports__);
2542
2552
 
2543
2553
 
2544
2554
 
2545
-
2546
2555
  /**
2547
2556
  * Converts Babylon Scene into glTF 2.0.
2548
2557
  * @hidden
@@ -3539,8 +3548,8 @@ var _Exporter = /** @class */ (function () {
3539
3548
  if (!babylonCamera.position.equalsToFloats(0, 0, 0)) {
3540
3549
  node.translation = convertToRightHandedSystem ? _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__._GLTFUtilities._GetRightHandedPositionVector3(babylonCamera.position).asArray() : babylonCamera.position.asArray();
3541
3550
  }
3542
- var rotationQuaternion = babylonCamera.absoluteRotation;
3543
- if (!core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Quaternion.IsIdentity(rotationQuaternion)) {
3551
+ var rotationQuaternion = babylonCamera.rotationQuaternion; // we target the local transformation if one.
3552
+ if (rotationQuaternion && !core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Quaternion.IsIdentity(rotationQuaternion)) {
3544
3553
  if (convertToRightHandedSystem) {
3545
3554
  _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__._GLTFUtilities._GetRightHandedQuaternionFromRef(rotationQuaternion);
3546
3555
  }
@@ -4114,8 +4123,9 @@ var _Exporter = /** @class */ (function () {
4114
4123
  var babylonNode = nodes_2[_i];
4115
4124
  if (!this._options.shouldExportNode || this._options.shouldExportNode(babylonNode)) {
4116
4125
  exportNodes.push(babylonNode);
4117
- if (babylonNode instanceof core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.AbstractMesh) {
4118
- var material = babylonNode.material || babylonNode.getScene().defaultMaterial;
4126
+ var babylonMesh = babylonNode;
4127
+ if (babylonMesh.subMeshes && babylonMesh.subMeshes.length > 0) {
4128
+ var material = babylonMesh.material || babylonMesh.getScene().defaultMaterial;
4119
4129
  if (material instanceof core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.MultiMaterial) {
4120
4130
  for (var _a = 0, _b = material.subMaterials; _a < _b.length; _a++) {
4121
4131
  var subMaterial = _b[_a];