@xeokit/xeokit-sdk 2.4.0-alpha-22 → 2.4.0-alpha-23

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.
@@ -627,7 +627,7 @@ class ContextMenu {
627
627
  }
628
628
 
629
629
  _getNextId() { // Returns a unique ID
630
- return "ContextMenu_" + this._id + "" + this._nextId++; // Start ID with alpha chars to make a valid DOM element selector
630
+ return "ContextMenu_" + this._id + "_" + this._nextId++; // Start ID with alpha chars to make a valid DOM element selector
631
631
  }
632
632
 
633
633
  _createUI() { // Builds DOM elements for the entire menu tree
@@ -9507,7 +9507,7 @@ class Wire {
9507
9507
  wireClickableStyle['-o-transform'] = 'rotate(0deg)';
9508
9508
  wireClickableStyle['transform'] = 'rotate(0deg)';
9509
9509
  wireClickableStyle["opacity"] = 0.0;
9510
- wireClickableStyle["pointer-events"] = "all";
9510
+ wireClickableStyle["pointer-events"] = "none";
9511
9511
  if (cfg.onContextMenu) ;
9512
9512
 
9513
9513
  parentElement.appendChild(wireClickable);
@@ -9617,8 +9617,12 @@ class Wire {
9617
9617
  }
9618
9618
 
9619
9619
  destroy(visible) {
9620
- this._wire.parentElement.removeChild(this._wire);
9621
- this._wireClickable.parentElement.removeChild(this._wireClickable);
9620
+ if (this._wire.parentElement) {
9621
+ this._wire.parentElement.removeChild(this._wire);
9622
+ }
9623
+ if (this._wireClickable.parentElement) {
9624
+ this._wireClickable.parentElement.removeChild(this._wireClickable);
9625
+ }
9622
9626
  }
9623
9627
  }
9624
9628
 
@@ -9753,8 +9757,12 @@ class Dot {
9753
9757
 
9754
9758
  destroy() {
9755
9759
  this.setVisible(false);
9756
- this._dot.parentElement.removeChild(this._dot);
9757
- this._dotClickable.parentElement.removeChild(this._dotClickable);
9760
+ if (this._dot.parentElement) {
9761
+ this._dot.parentElement.removeChild(this._dot);
9762
+ }
9763
+ if (this._dotClickable.parentElement) {
9764
+ this._dotClickable.parentElement.removeChild(this._dotClickable);
9765
+ }
9758
9766
  }
9759
9767
  }
9760
9768
 
@@ -9904,7 +9912,9 @@ class Label {
9904
9912
  }
9905
9913
 
9906
9914
  destroy() {
9907
- this._label.parentElement.removeChild(this._label);
9915
+ if (this._label.parentElement) {
9916
+ this._label.parentElement.removeChild(this._label);
9917
+ }
9908
9918
  }
9909
9919
  }
9910
9920
 
@@ -29686,7 +29696,7 @@ function attachFPSTracker (scene, cullingManager) {
29686
29696
 
29687
29697
  // Apply LOD-culling before rendering the scene
29688
29698
  scene.on("rendering", function () {
29689
- if (currentFPS == -1)
29699
+ if (currentFPS === -1)
29690
29700
  {
29691
29701
  return;
29692
29702
  }
@@ -29852,7 +29862,7 @@ function attachFPSTracker (scene, cullingManager) {
29852
29862
  * @param {DataTextureSceneModel} model
29853
29863
  */
29854
29864
  initializeLodState (model) {
29855
- if (model._nodeList.length == 0)
29865
+ if (model._nodeList.length === 0)
29856
29866
  {
29857
29867
  return;
29858
29868
  }
@@ -29921,11 +29931,11 @@ class LodCullingManager {
29921
29931
  targetFps
29922
29932
  );
29923
29933
 
29924
- console.time ("initializeLodState");
29934
+ // console.time ("initializeLodState");
29925
29935
 
29926
29936
  this.lodState.initializeLodState (model);
29927
29937
 
29928
- console.timeEnd ("initializeLodState");
29938
+ // console.timeEnd ("initializeLodState");
29929
29939
 
29930
29940
  attachFPSTracker (this.model.scene, this);
29931
29941
  }
@@ -29939,7 +29949,7 @@ class LodCullingManager {
29939
29949
  {
29940
29950
  const lodState = this.lodState;
29941
29951
 
29942
- if (lodState.lodLevelIndex == lodState.triangleLODLevels.length)
29952
+ if (lodState.lodLevelIndex === lodState.triangleLODLevels.length)
29943
29953
  {
29944
29954
  return false;
29945
29955
  }
@@ -29965,7 +29975,7 @@ class LodCullingManager {
29965
29975
  {
29966
29976
  const lodState = this.lodState;
29967
29977
 
29968
- if (lodState.lodLevelIndex == 0)
29978
+ if (lodState.lodLevelIndex === 0)
29969
29979
  {
29970
29980
  return false;
29971
29981
  }
@@ -30018,9 +30028,9 @@ class LodCullingManager {
30018
30028
  }
30019
30029
  }
30020
30030
 
30021
- if (retVal) {
30022
- console.log ("LOD level = " + lodState.lodLevelIndex);
30023
- }
30031
+ // if (retVal) {
30032
+ // console.log ("LOD level = " + lodState.lodLevelIndex);
30033
+ // }
30024
30034
 
30025
30035
  return retVal;
30026
30036
  }
@@ -30037,9 +30047,9 @@ class LodCullingManager {
30037
30047
  retVal |= (decreasedLevel = this._decreaseLODLevelIndex());
30038
30048
  } while (decreasedLevel);
30039
30049
 
30040
- if (retVal) {
30041
- console.log ("LOD resetted");
30042
- }
30050
+ // if (retVal) {
30051
+ // console.log ("LOD resetted");
30052
+ // }
30043
30053
 
30044
30054
  return retVal;
30045
30055
  }
@@ -32187,12 +32197,13 @@ class DataTextureSceneModel extends Component {
32187
32197
  * @param {Boolean} [cfg.edges=false] Indicates if the DataTextureSceneModel's edges are initially emphasized.
32188
32198
  * @param {Number[]} [cfg.colorize=[1.0,1.0,1.0]] DataTextureSceneModel's initial RGB colorize color, multiplies by the rendered fragment colors.
32189
32199
  * @param {Number} [cfg.opacity=1.0] DataTextureSceneModel's initial opacity factor, multiplies by the rendered fragment alpha.
32190
- * @param {Number} [cfg.backfaces=false] When we set this ````true````, then we force rendering of backfaces for this dataTexturePerformanceModel. When
32200
+ * @param {Number} [cfg.backfaces=false] When we set this ````true````, then we force rendering of backfaces for this DataTextureModel. When
32191
32201
  * we leave this ````false````, then we allow the Viewer to decide when to render backfaces. In that case, the
32192
32202
  * Viewer will hide backfaces on watertight meshes, show backfaces on open meshes, and always show backfaces on meshes when we slice them open with {@link SectionPlane}s.
32193
- * @param {Boolean} [cfg.saoEnabled=true] Indicates if Scalable Ambient Obscurance (SAO) will apply to this dataTexturePerformanceModel. SAO is configured by the Scene's {@link SAO} component.
32194
- * @param {Boolean} [cfg.pbrEnabled=false] Indicates if physically-based rendering (PBR) will apply to the dataTexturePerformanceModel. Only works when {@link Scene#pbrEnabled} is also ````true````.
32203
+ * @param {Boolean} [cfg.saoEnabled=true] Indicates if Scalable Ambient Obscurance (SAO) will apply to this DataTextureModel. SAO is configured by the Scene's {@link SAO} component.
32195
32204
  * @param {Number} [cfg.edgeThreshold=10] When xraying, highlighting, selecting or edging, this is the threshold angle between normals of adjacent triangles, below which their shared wireframe edge is not drawn.
32205
+ * @param {Number} [cfg.targetLodFps] Optional target LoD FPS. When provided, will enable LoD culling for this DataTextureModel, with the given target FPS.
32206
+ * @param {Boolean} [cfg.enableViewFrustumCulling=false] When true, will enable view frustum culling for the objects within this DataTextureModel.
32196
32207
  * @param {Boolean} [cfg.disableVertexWelding] Disable vertex welding when loading geometry into the GPU. Default is ```false```.
32197
32208
  * @param {Boolean} [cfg.disableIndexRebucketing] Disable index rebucketing when loading geometry into the GPU. Default is ```false```.
32198
32209
  */
@@ -32376,7 +32387,7 @@ class DataTextureSceneModel extends Component {
32376
32387
 
32377
32388
  this._saoEnabled = (cfg.saoEnabled !== false);
32378
32389
 
32379
- this._pbrEnabled = (!!cfg.pbrEnabled);
32390
+ this._pbrEnabled = false;
32380
32391
 
32381
32392
  this._isModel = cfg.isModel;
32382
32393
  if (this._isModel) {
@@ -32988,7 +32999,7 @@ class DataTextureSceneModel extends Component {
32988
32999
  /**
32989
33000
  * Gets if physically-based rendering (PBR) is enabled for this DataTextureSceneModel.
32990
33001
  *
32991
- * Only works when {@link Scene#pbrEnabled} is also true.
33002
+ * This will always be ````false````.
32992
33003
  *
32993
33004
  * @type {Boolean}
32994
33005
  */
@@ -57675,10 +57686,17 @@ class Texture2D {
57675
57686
  let generateMipMap = false;
57676
57687
 
57677
57688
  gl.bindTexture(this.target, this.texture);
57689
+
57690
+ const bak1 = gl.getParameter(gl.UNPACK_FLIP_Y_WEBGL);
57678
57691
  gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, this.flipY);
57692
+
57693
+ const bak2 = gl.getParameter(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL);
57679
57694
  gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this.premultiplyAlpha);
57695
+
57696
+ const bak3 = gl.getParameter(gl.UNPACK_ALIGNMENT);
57680
57697
  gl.pixelStorei(gl.UNPACK_ALIGNMENT, this.unpackAlignment);
57681
- gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);
57698
+
57699
+ const bak4 = gl.getParameter(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL); gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);
57682
57700
 
57683
57701
  const minFilter = convertConstant(gl, this.minFilter);
57684
57702
  gl.texParameteri(this.target, gl.TEXTURE_MIN_FILTER, minFilter);
@@ -57733,6 +57751,11 @@ class Texture2D {
57733
57751
  }
57734
57752
 
57735
57753
  gl.bindTexture(this.target, null);
57754
+
57755
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, bak1);
57756
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, bak2);
57757
+ gl.pixelStorei(gl.UNPACK_ALIGNMENT, bak3);
57758
+ gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, bak4);
57736
57759
  }
57737
57760
 
57738
57761
  setCompressedData({mipmaps, props = {}}) {
@@ -83796,7 +83819,7 @@ class TrianglesInstancingLayer {
83796
83819
  this._numPickableLayerPortions--;
83797
83820
  this.model.numPickableLayerPortions--;
83798
83821
  }
83799
- this._setFlags2(portionId, flags, meshTransparent);
83822
+ this._setFlags(portionId, flags, meshTransparent);
83800
83823
  }
83801
83824
 
83802
83825
  setCulled(portionId, flags, meshTransparent) {
@@ -88802,6 +88825,7 @@ class PointsBatchingOcclusionRenderer {
88802
88825
  const sectionPlanesState = scene._sectionPlanesState;
88803
88826
  const clipping = sectionPlanesState.sectionPlanes.length > 0;
88804
88827
  const src = [];
88828
+ src.push ('#version 300 es');
88805
88829
  src.push("// Points batching occlusion fragment shader");
88806
88830
  src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH");
88807
88831
  src.push("precision highp float;");
@@ -102598,7 +102622,7 @@ class MetaScene {
102598
102622
  for (let i = 0, len = createObjectsParams.length; i < len; i++) {
102599
102623
  const createObject = createObjectsParams[i];
102600
102624
  const type = createObject.type;
102601
- const objectId = createObject.id;
102625
+ const objectId = options.globalizeObjectIds ? math.globalizeObjectId(modelId, createObject.id) : createObject.id;
102602
102626
  const originalSystemId = createObject.id;
102603
102627
  const name = createObject.name;
102604
102628
  const propertySets = [];
@@ -102632,13 +102656,13 @@ class MetaScene {
102632
102656
 
102633
102657
  for (let i = 0, len = existingObjects.length; i < len; i++) {
102634
102658
  const existingObject = existingObjects[i];
102635
- const objectId = existingObject.id;
102659
+ const objectId = options.globalizeObjectIds ? math.globalizeObjectId(modelId, existingObject.id) : existingObject.id;
102636
102660
  if ((existingObject._parentId === undefined || existingObject._parentId === null) && !existingObject.parent) {
102637
102661
  metaModel.rootMetaObject = existingObject; // Deprecated, and won't work for federated models
102638
102662
  metaModel.rootMetaObjects[objectId] = existingObject;
102639
102663
  this.rootMetaObjects[objectId] = existingObject;
102640
102664
  } else if (existingObject._parentId) {
102641
- const parentId = existingObject._parentId;
102665
+ const parentId = options.globalizeObjectIds ? math.globalizeObjectId(modelId, existingObject._parentId) : existingObject._parentId;
102642
102666
  existingObject._parentId = null;
102643
102667
  let parentMetaObject = this.metaObjects[parentId];
102644
102668
  if (parentMetaObject) {
@@ -623,7 +623,7 @@ class ContextMenu {
623
623
  }
624
624
 
625
625
  _getNextId() { // Returns a unique ID
626
- return "ContextMenu_" + this._id + "" + this._nextId++; // Start ID with alpha chars to make a valid DOM element selector
626
+ return "ContextMenu_" + this._id + "_" + this._nextId++; // Start ID with alpha chars to make a valid DOM element selector
627
627
  }
628
628
 
629
629
  _createUI() { // Builds DOM elements for the entire menu tree
@@ -9503,7 +9503,7 @@ class Wire {
9503
9503
  wireClickableStyle['-o-transform'] = 'rotate(0deg)';
9504
9504
  wireClickableStyle['transform'] = 'rotate(0deg)';
9505
9505
  wireClickableStyle["opacity"] = 0.0;
9506
- wireClickableStyle["pointer-events"] = "all";
9506
+ wireClickableStyle["pointer-events"] = "none";
9507
9507
  if (cfg.onContextMenu) ;
9508
9508
 
9509
9509
  parentElement.appendChild(wireClickable);
@@ -9613,8 +9613,12 @@ class Wire {
9613
9613
  }
9614
9614
 
9615
9615
  destroy(visible) {
9616
- this._wire.parentElement.removeChild(this._wire);
9617
- this._wireClickable.parentElement.removeChild(this._wireClickable);
9616
+ if (this._wire.parentElement) {
9617
+ this._wire.parentElement.removeChild(this._wire);
9618
+ }
9619
+ if (this._wireClickable.parentElement) {
9620
+ this._wireClickable.parentElement.removeChild(this._wireClickable);
9621
+ }
9618
9622
  }
9619
9623
  }
9620
9624
 
@@ -9749,8 +9753,12 @@ class Dot {
9749
9753
 
9750
9754
  destroy() {
9751
9755
  this.setVisible(false);
9752
- this._dot.parentElement.removeChild(this._dot);
9753
- this._dotClickable.parentElement.removeChild(this._dotClickable);
9756
+ if (this._dot.parentElement) {
9757
+ this._dot.parentElement.removeChild(this._dot);
9758
+ }
9759
+ if (this._dotClickable.parentElement) {
9760
+ this._dotClickable.parentElement.removeChild(this._dotClickable);
9761
+ }
9754
9762
  }
9755
9763
  }
9756
9764
 
@@ -9900,7 +9908,9 @@ class Label {
9900
9908
  }
9901
9909
 
9902
9910
  destroy() {
9903
- this._label.parentElement.removeChild(this._label);
9911
+ if (this._label.parentElement) {
9912
+ this._label.parentElement.removeChild(this._label);
9913
+ }
9904
9914
  }
9905
9915
  }
9906
9916
 
@@ -29682,7 +29692,7 @@ function attachFPSTracker (scene, cullingManager) {
29682
29692
 
29683
29693
  // Apply LOD-culling before rendering the scene
29684
29694
  scene.on("rendering", function () {
29685
- if (currentFPS == -1)
29695
+ if (currentFPS === -1)
29686
29696
  {
29687
29697
  return;
29688
29698
  }
@@ -29848,7 +29858,7 @@ function attachFPSTracker (scene, cullingManager) {
29848
29858
  * @param {DataTextureSceneModel} model
29849
29859
  */
29850
29860
  initializeLodState (model) {
29851
- if (model._nodeList.length == 0)
29861
+ if (model._nodeList.length === 0)
29852
29862
  {
29853
29863
  return;
29854
29864
  }
@@ -29917,11 +29927,11 @@ class LodCullingManager {
29917
29927
  targetFps
29918
29928
  );
29919
29929
 
29920
- console.time ("initializeLodState");
29930
+ // console.time ("initializeLodState");
29921
29931
 
29922
29932
  this.lodState.initializeLodState (model);
29923
29933
 
29924
- console.timeEnd ("initializeLodState");
29934
+ // console.timeEnd ("initializeLodState");
29925
29935
 
29926
29936
  attachFPSTracker (this.model.scene, this);
29927
29937
  }
@@ -29935,7 +29945,7 @@ class LodCullingManager {
29935
29945
  {
29936
29946
  const lodState = this.lodState;
29937
29947
 
29938
- if (lodState.lodLevelIndex == lodState.triangleLODLevels.length)
29948
+ if (lodState.lodLevelIndex === lodState.triangleLODLevels.length)
29939
29949
  {
29940
29950
  return false;
29941
29951
  }
@@ -29961,7 +29971,7 @@ class LodCullingManager {
29961
29971
  {
29962
29972
  const lodState = this.lodState;
29963
29973
 
29964
- if (lodState.lodLevelIndex == 0)
29974
+ if (lodState.lodLevelIndex === 0)
29965
29975
  {
29966
29976
  return false;
29967
29977
  }
@@ -30014,9 +30024,9 @@ class LodCullingManager {
30014
30024
  }
30015
30025
  }
30016
30026
 
30017
- if (retVal) {
30018
- console.log ("LOD level = " + lodState.lodLevelIndex);
30019
- }
30027
+ // if (retVal) {
30028
+ // console.log ("LOD level = " + lodState.lodLevelIndex);
30029
+ // }
30020
30030
 
30021
30031
  return retVal;
30022
30032
  }
@@ -30033,9 +30043,9 @@ class LodCullingManager {
30033
30043
  retVal |= (decreasedLevel = this._decreaseLODLevelIndex());
30034
30044
  } while (decreasedLevel);
30035
30045
 
30036
- if (retVal) {
30037
- console.log ("LOD resetted");
30038
- }
30046
+ // if (retVal) {
30047
+ // console.log ("LOD resetted");
30048
+ // }
30039
30049
 
30040
30050
  return retVal;
30041
30051
  }
@@ -32183,12 +32193,13 @@ class DataTextureSceneModel extends Component {
32183
32193
  * @param {Boolean} [cfg.edges=false] Indicates if the DataTextureSceneModel's edges are initially emphasized.
32184
32194
  * @param {Number[]} [cfg.colorize=[1.0,1.0,1.0]] DataTextureSceneModel's initial RGB colorize color, multiplies by the rendered fragment colors.
32185
32195
  * @param {Number} [cfg.opacity=1.0] DataTextureSceneModel's initial opacity factor, multiplies by the rendered fragment alpha.
32186
- * @param {Number} [cfg.backfaces=false] When we set this ````true````, then we force rendering of backfaces for this dataTexturePerformanceModel. When
32196
+ * @param {Number} [cfg.backfaces=false] When we set this ````true````, then we force rendering of backfaces for this DataTextureModel. When
32187
32197
  * we leave this ````false````, then we allow the Viewer to decide when to render backfaces. In that case, the
32188
32198
  * Viewer will hide backfaces on watertight meshes, show backfaces on open meshes, and always show backfaces on meshes when we slice them open with {@link SectionPlane}s.
32189
- * @param {Boolean} [cfg.saoEnabled=true] Indicates if Scalable Ambient Obscurance (SAO) will apply to this dataTexturePerformanceModel. SAO is configured by the Scene's {@link SAO} component.
32190
- * @param {Boolean} [cfg.pbrEnabled=false] Indicates if physically-based rendering (PBR) will apply to the dataTexturePerformanceModel. Only works when {@link Scene#pbrEnabled} is also ````true````.
32199
+ * @param {Boolean} [cfg.saoEnabled=true] Indicates if Scalable Ambient Obscurance (SAO) will apply to this DataTextureModel. SAO is configured by the Scene's {@link SAO} component.
32191
32200
  * @param {Number} [cfg.edgeThreshold=10] When xraying, highlighting, selecting or edging, this is the threshold angle between normals of adjacent triangles, below which their shared wireframe edge is not drawn.
32201
+ * @param {Number} [cfg.targetLodFps] Optional target LoD FPS. When provided, will enable LoD culling for this DataTextureModel, with the given target FPS.
32202
+ * @param {Boolean} [cfg.enableViewFrustumCulling=false] When true, will enable view frustum culling for the objects within this DataTextureModel.
32192
32203
  * @param {Boolean} [cfg.disableVertexWelding] Disable vertex welding when loading geometry into the GPU. Default is ```false```.
32193
32204
  * @param {Boolean} [cfg.disableIndexRebucketing] Disable index rebucketing when loading geometry into the GPU. Default is ```false```.
32194
32205
  */
@@ -32372,7 +32383,7 @@ class DataTextureSceneModel extends Component {
32372
32383
 
32373
32384
  this._saoEnabled = (cfg.saoEnabled !== false);
32374
32385
 
32375
- this._pbrEnabled = (!!cfg.pbrEnabled);
32386
+ this._pbrEnabled = false;
32376
32387
 
32377
32388
  this._isModel = cfg.isModel;
32378
32389
  if (this._isModel) {
@@ -32984,7 +32995,7 @@ class DataTextureSceneModel extends Component {
32984
32995
  /**
32985
32996
  * Gets if physically-based rendering (PBR) is enabled for this DataTextureSceneModel.
32986
32997
  *
32987
- * Only works when {@link Scene#pbrEnabled} is also true.
32998
+ * This will always be ````false````.
32988
32999
  *
32989
33000
  * @type {Boolean}
32990
33001
  */
@@ -57671,10 +57682,17 @@ class Texture2D {
57671
57682
  let generateMipMap = false;
57672
57683
 
57673
57684
  gl.bindTexture(this.target, this.texture);
57685
+
57686
+ const bak1 = gl.getParameter(gl.UNPACK_FLIP_Y_WEBGL);
57674
57687
  gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, this.flipY);
57688
+
57689
+ const bak2 = gl.getParameter(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL);
57675
57690
  gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this.premultiplyAlpha);
57691
+
57692
+ const bak3 = gl.getParameter(gl.UNPACK_ALIGNMENT);
57676
57693
  gl.pixelStorei(gl.UNPACK_ALIGNMENT, this.unpackAlignment);
57677
- gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);
57694
+
57695
+ const bak4 = gl.getParameter(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL); gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);
57678
57696
 
57679
57697
  const minFilter = convertConstant(gl, this.minFilter);
57680
57698
  gl.texParameteri(this.target, gl.TEXTURE_MIN_FILTER, minFilter);
@@ -57729,6 +57747,11 @@ class Texture2D {
57729
57747
  }
57730
57748
 
57731
57749
  gl.bindTexture(this.target, null);
57750
+
57751
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, bak1);
57752
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, bak2);
57753
+ gl.pixelStorei(gl.UNPACK_ALIGNMENT, bak3);
57754
+ gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, bak4);
57732
57755
  }
57733
57756
 
57734
57757
  setCompressedData({mipmaps, props = {}}) {
@@ -83792,7 +83815,7 @@ class TrianglesInstancingLayer {
83792
83815
  this._numPickableLayerPortions--;
83793
83816
  this.model.numPickableLayerPortions--;
83794
83817
  }
83795
- this._setFlags2(portionId, flags, meshTransparent);
83818
+ this._setFlags(portionId, flags, meshTransparent);
83796
83819
  }
83797
83820
 
83798
83821
  setCulled(portionId, flags, meshTransparent) {
@@ -88798,6 +88821,7 @@ class PointsBatchingOcclusionRenderer {
88798
88821
  const sectionPlanesState = scene._sectionPlanesState;
88799
88822
  const clipping = sectionPlanesState.sectionPlanes.length > 0;
88800
88823
  const src = [];
88824
+ src.push ('#version 300 es');
88801
88825
  src.push("// Points batching occlusion fragment shader");
88802
88826
  src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH");
88803
88827
  src.push("precision highp float;");
@@ -102594,7 +102618,7 @@ class MetaScene {
102594
102618
  for (let i = 0, len = createObjectsParams.length; i < len; i++) {
102595
102619
  const createObject = createObjectsParams[i];
102596
102620
  const type = createObject.type;
102597
- const objectId = createObject.id;
102621
+ const objectId = options.globalizeObjectIds ? math.globalizeObjectId(modelId, createObject.id) : createObject.id;
102598
102622
  const originalSystemId = createObject.id;
102599
102623
  const name = createObject.name;
102600
102624
  const propertySets = [];
@@ -102628,13 +102652,13 @@ class MetaScene {
102628
102652
 
102629
102653
  for (let i = 0, len = existingObjects.length; i < len; i++) {
102630
102654
  const existingObject = existingObjects[i];
102631
- const objectId = existingObject.id;
102655
+ const objectId = options.globalizeObjectIds ? math.globalizeObjectId(modelId, existingObject.id) : existingObject.id;
102632
102656
  if ((existingObject._parentId === undefined || existingObject._parentId === null) && !existingObject.parent) {
102633
102657
  metaModel.rootMetaObject = existingObject; // Deprecated, and won't work for federated models
102634
102658
  metaModel.rootMetaObjects[objectId] = existingObject;
102635
102659
  this.rootMetaObjects[objectId] = existingObject;
102636
102660
  } else if (existingObject._parentId) {
102637
- const parentId = existingObject._parentId;
102661
+ const parentId = options.globalizeObjectIds ? math.globalizeObjectId(modelId, existingObject._parentId) : existingObject._parentId;
102638
102662
  existingObject._parentId = null;
102639
102663
  let parentMetaObject = this.metaObjects[parentId];
102640
102664
  if (parentMetaObject) {