@xeokit/xeokit-sdk 2.6.87-renderers-refactor-v3 → 2.6.87-renderers-refactor-v4

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.
@@ -1,7 +1,7 @@
1
1
  /**
2
- * xeokit-sdk v2.6.87-renderers-refactor-v3
3
- * Commit: eea8b0fafbb9aae708346dcff68ecada4774dbc5
4
- * Built: 2025-08-01T10:41:45.912Z
2
+ * xeokit-sdk v2.6.87-renderers-refactor-v4
3
+ * Commit: 5caed07165a5e87253766624958029a6267642df
4
+ * Built: 2025-08-04T16:35:27.323Z
5
5
  */
6
6
 
7
7
  'use strict';
@@ -31340,6 +31340,8 @@ class Layer {
31340
31340
  setupFlagCount(ENTITY_FLAGS.EDGES, "numEdgesLayerPortions");
31341
31341
  }
31342
31342
 
31343
+ // Optimize initFlags to not require Object.values call each time (adds up a lot)
31344
+ this._countsByFlagArr = Object.values(this._countsByFlag);
31343
31345
  this._numTransparentLayerPortions = 0;
31344
31346
  }
31345
31347
  }
@@ -31548,7 +31550,7 @@ class Layer {
31548
31550
 
31549
31551
 
31550
31552
  initFlags(portionId, flags, transparent) {
31551
- Object.values(this._countsByFlag).forEach(cnt => cnt.fromFlags(flags, true));
31553
+ this._countsByFlagArr.forEach(cnt => cnt.fromFlags(flags, true));
31552
31554
 
31553
31555
  if (transparent) {
31554
31556
  this._numTransparentLayerPortions++;
@@ -39609,7 +39611,7 @@ class SceneModel extends Component {
39609
39611
  const primitive = instancing ? geometry.primitive : cfg.primitive;
39610
39612
  const origin = cfg.origin;
39611
39613
  const posDecode = (! instancing) && (cfg.positionsDecodeMatrix || cfg.positionsDecodeBoundary);
39612
- const positionsDecodeHash = posDecode ? (JSON.stringify(posDecode).split("").reduce((hash, char) => (((hash << 5) - hash + char.charCodeAt(0)) | 0), 0) >>> 0).toString(16) : "-";
39614
+ const positionsDecodeHash = posDecode ? this._createHashStringFromMatrix(posDecode) : "-";
39613
39615
  const textureSetId = cfg.textureSetId || "-";
39614
39616
  const geometryId = instancing ? cfg.geometryId : "-";
39615
39617
  const layerId = (instancing ? "instancing" : "batching") + `.${Math.round(origin[0])}.${Math.round(origin[1])}.${Math.round(origin[2])}.${primitive}.${positionsDecodeHash}.${textureSetId}.${geometryId}`;
@@ -39641,6 +39643,18 @@ class SceneModel extends Component {
39641
39643
  return this._vboLayers[layerId];
39642
39644
  }
39643
39645
 
39646
+ _createHashStringFromMatrix(matrix) {
39647
+ const matrixString = matrix.join(";");
39648
+ let hash = 0;
39649
+ for (let i = 0; i < matrixString.length; i++) {
39650
+ const char = matrixString.charCodeAt(i);
39651
+ hash = (hash << 5) - hash + char;
39652
+ hash |= 0; // Convert to 32-bit integer
39653
+ }
39654
+ const hashString = (hash >>> 0).toString(16);
39655
+ return hashString;
39656
+ }
39657
+
39644
39658
  /**
39645
39659
  * Creates a {@link SceneModelEntity} within this SceneModel.
39646
39660
  *
@@ -1,7 +1,7 @@
1
1
  /**
2
- * xeokit-sdk v2.6.87-renderers-refactor-v3
3
- * Commit: eea8b0fafbb9aae708346dcff68ecada4774dbc5
4
- * Built: 2025-08-01T10:41:45.912Z
2
+ * xeokit-sdk v2.6.87-renderers-refactor-v4
3
+ * Commit: 5caed07165a5e87253766624958029a6267642df
4
+ * Built: 2025-08-04T16:35:27.323Z
5
5
  */
6
6
 
7
7
  /** @private */
@@ -31336,6 +31336,8 @@ class Layer {
31336
31336
  setupFlagCount(ENTITY_FLAGS.EDGES, "numEdgesLayerPortions");
31337
31337
  }
31338
31338
 
31339
+ // Optimize initFlags to not require Object.values call each time (adds up a lot)
31340
+ this._countsByFlagArr = Object.values(this._countsByFlag);
31339
31341
  this._numTransparentLayerPortions = 0;
31340
31342
  }
31341
31343
  }
@@ -31544,7 +31546,7 @@ class Layer {
31544
31546
 
31545
31547
 
31546
31548
  initFlags(portionId, flags, transparent) {
31547
- Object.values(this._countsByFlag).forEach(cnt => cnt.fromFlags(flags, true));
31549
+ this._countsByFlagArr.forEach(cnt => cnt.fromFlags(flags, true));
31548
31550
 
31549
31551
  if (transparent) {
31550
31552
  this._numTransparentLayerPortions++;
@@ -39605,7 +39607,7 @@ class SceneModel extends Component {
39605
39607
  const primitive = instancing ? geometry.primitive : cfg.primitive;
39606
39608
  const origin = cfg.origin;
39607
39609
  const posDecode = (! instancing) && (cfg.positionsDecodeMatrix || cfg.positionsDecodeBoundary);
39608
- const positionsDecodeHash = posDecode ? (JSON.stringify(posDecode).split("").reduce((hash, char) => (((hash << 5) - hash + char.charCodeAt(0)) | 0), 0) >>> 0).toString(16) : "-";
39610
+ const positionsDecodeHash = posDecode ? this._createHashStringFromMatrix(posDecode) : "-";
39609
39611
  const textureSetId = cfg.textureSetId || "-";
39610
39612
  const geometryId = instancing ? cfg.geometryId : "-";
39611
39613
  const layerId = (instancing ? "instancing" : "batching") + `.${Math.round(origin[0])}.${Math.round(origin[1])}.${Math.round(origin[2])}.${primitive}.${positionsDecodeHash}.${textureSetId}.${geometryId}`;
@@ -39637,6 +39639,18 @@ class SceneModel extends Component {
39637
39639
  return this._vboLayers[layerId];
39638
39640
  }
39639
39641
 
39642
+ _createHashStringFromMatrix(matrix) {
39643
+ const matrixString = matrix.join(";");
39644
+ let hash = 0;
39645
+ for (let i = 0; i < matrixString.length; i++) {
39646
+ const char = matrixString.charCodeAt(i);
39647
+ hash = (hash << 5) - hash + char;
39648
+ hash |= 0; // Convert to 32-bit integer
39649
+ }
39650
+ const hashString = (hash >>> 0).toString(16);
39651
+ return hashString;
39652
+ }
39653
+
39640
39654
  /**
39641
39655
  * Creates a {@link SceneModelEntity} within this SceneModel.
39642
39656
  *