@xeokit/xeokit-sdk 2.6.19 → 2.6.20

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.
@@ -18735,9 +18735,6 @@ const Renderer$1 = function (scene, options) {
18735
18735
  let drawableTypeInfo = {};
18736
18736
  let drawables = {};
18737
18737
 
18738
- let postSortDrawableList = [];
18739
- let postCullDrawableList = [];
18740
-
18741
18738
  let drawableListDirty = true;
18742
18739
  let stateSortDirty = true;
18743
18740
  let imageDirty = true;
@@ -18963,38 +18960,28 @@ const Renderer$1 = function (scene, options) {
18963
18960
  const drawableInfo = drawableTypeInfo[type];
18964
18961
  if (drawableInfo.isStateSortable) {
18965
18962
  drawableInfo.drawableListPreCull.sort(drawableInfo.stateSortCompare);
18966
-
18967
- drawableInfo.drawableList = drawableInfo.drawableListPreCull;
18968
18963
  }
18969
18964
  }
18970
18965
  }
18971
- let lenDrawableList = 0;
18966
+ }
18967
+
18968
+ function cullDrawableList() {
18972
18969
  for (let type in drawableTypeInfo) {
18973
18970
  if (drawableTypeInfo.hasOwnProperty(type)) {
18974
18971
  const drawableInfo = drawableTypeInfo[type];
18975
18972
  const drawableListPreCull = drawableInfo.drawableListPreCull;
18973
+ const drawableList = drawableInfo.drawableList;
18974
+ let lenDrawableList = 0;
18976
18975
  for (let i = 0, len = drawableListPreCull.length; i < len; i++) {
18977
18976
  const drawable = drawableListPreCull[i];
18978
- postSortDrawableList[lenDrawableList++] = drawable;
18977
+ drawable.rebuildRenderFlags();
18978
+ if (!drawable.renderFlags.culled) {
18979
+ drawableList[lenDrawableList++] = drawable;
18980
+ }
18979
18981
  }
18982
+ drawableList.length = lenDrawableList;
18980
18983
  }
18981
18984
  }
18982
- postSortDrawableList.length = lenDrawableList;
18983
- postSortDrawableList.sort((a, b) => {
18984
- return a.renderOrder - b.renderOrder;
18985
- });
18986
- }
18987
-
18988
- function cullDrawableList() {
18989
- let lenDrawableList = 0;
18990
- for (let i = 0, len = postSortDrawableList.length; i < len; i++) {
18991
- const drawable = postSortDrawableList[i];
18992
- drawable.rebuildRenderFlags();
18993
- if (!drawable.renderFlags.culled) {
18994
- postCullDrawableList[lenDrawableList++] = drawable;
18995
- }
18996
- }
18997
- postCullDrawableList.length = lenDrawableList;
18998
18985
  }
18999
18986
 
19000
18987
  function draw(params) {
@@ -19227,6 +19214,7 @@ const Renderer$1 = function (scene, options) {
19227
19214
  }
19228
19215
 
19229
19216
  let i;
19217
+ let len;
19230
19218
  let drawable;
19231
19219
 
19232
19220
  const startTime = Date.now();
@@ -19259,85 +19247,93 @@ const Renderer$1 = function (scene, options) {
19259
19247
  // Render normal opaque solids, defer others to bins to render after
19260
19248
  //------------------------------------------------------------------------------------------------------
19261
19249
 
19262
- for (let i = 0, len = postCullDrawableList.length; i < len; i++) {
19250
+ for (let type in drawableTypeInfo) {
19251
+ if (drawableTypeInfo.hasOwnProperty(type)) {
19263
19252
 
19264
- drawable = postCullDrawableList[i];
19253
+ const drawableInfo = drawableTypeInfo[type];
19254
+ const drawableList = drawableInfo.drawableList;
19265
19255
 
19266
- if (drawable.culled === true || drawable.visible === false) {
19267
- continue;
19268
- }
19256
+ for (i = 0, len = drawableList.length; i < len; i++) {
19269
19257
 
19270
- const renderFlags = drawable.renderFlags;
19258
+ drawable = drawableList[i];
19271
19259
 
19272
- if (renderFlags.colorOpaque) {
19273
- if (saoEnabled && saoPossible && drawable.saoEnabled) {
19274
- normalDrawSAOBin[normalDrawSAOBinLen++] = drawable;
19275
- } else {
19276
- drawable.drawColorOpaque(frameCtx);
19277
- }
19278
- }
19260
+ if (drawable.culled === true || drawable.visible === false) {
19261
+ continue;
19262
+ }
19279
19263
 
19280
- if (transparentEnabled) {
19281
- if (renderFlags.colorTransparent) {
19282
- normalFillTransparentBin[normalFillTransparentBinLen++] = drawable;
19283
- }
19284
- }
19264
+ const renderFlags = drawable.renderFlags;
19285
19265
 
19286
- if (renderFlags.xrayedSilhouetteTransparent) {
19287
- xrayedFillTransparentBin[xrayedFillTransparentBinLen++] = drawable;
19288
- }
19266
+ if (renderFlags.colorOpaque) {
19267
+ if (saoEnabled && saoPossible && drawable.saoEnabled) {
19268
+ normalDrawSAOBin[normalDrawSAOBinLen++] = drawable;
19269
+ } else {
19270
+ drawable.drawColorOpaque(frameCtx);
19271
+ }
19272
+ }
19289
19273
 
19290
- if (renderFlags.xrayedSilhouetteOpaque) {
19291
- xrayedFillOpaqueBin[xrayedFillOpaqueBinLen++] = drawable;
19292
- }
19274
+ if (transparentEnabled) {
19275
+ if (renderFlags.colorTransparent) {
19276
+ normalFillTransparentBin[normalFillTransparentBinLen++] = drawable;
19277
+ }
19278
+ }
19293
19279
 
19294
- if (renderFlags.highlightedSilhouetteTransparent) {
19295
- highlightedFillTransparentBin[highlightedFillTransparentBinLen++] = drawable;
19296
- }
19280
+ if (renderFlags.xrayedSilhouetteTransparent) {
19281
+ xrayedFillTransparentBin[xrayedFillTransparentBinLen++] = drawable;
19282
+ }
19297
19283
 
19298
- if (renderFlags.highlightedSilhouetteOpaque) {
19299
- highlightedFillOpaqueBin[highlightedFillOpaqueBinLen++] = drawable;
19300
- }
19284
+ if (renderFlags.xrayedSilhouetteOpaque) {
19285
+ xrayedFillOpaqueBin[xrayedFillOpaqueBinLen++] = drawable;
19286
+ }
19301
19287
 
19302
- if (renderFlags.selectedSilhouetteTransparent) {
19303
- selectedFillTransparentBin[selectedFillTransparentBinLen++] = drawable;
19304
- }
19288
+ if (renderFlags.highlightedSilhouetteTransparent) {
19289
+ highlightedFillTransparentBin[highlightedFillTransparentBinLen++] = drawable;
19290
+ }
19305
19291
 
19306
- if (renderFlags.selectedSilhouetteOpaque) {
19307
- selectedFillOpaqueBin[selectedFillOpaqueBinLen++] = drawable;
19308
- }
19292
+ if (renderFlags.highlightedSilhouetteOpaque) {
19293
+ highlightedFillOpaqueBin[highlightedFillOpaqueBinLen++] = drawable;
19294
+ }
19309
19295
 
19310
- if (drawable.edges && edgesEnabled) {
19311
- if (renderFlags.edgesOpaque) {
19312
- normalEdgesOpaqueBin[normalEdgesOpaqueBinLen++] = drawable;
19313
- }
19296
+ if (renderFlags.selectedSilhouetteTransparent) {
19297
+ selectedFillTransparentBin[selectedFillTransparentBinLen++] = drawable;
19298
+ }
19314
19299
 
19315
- if (renderFlags.edgesTransparent) {
19316
- normalEdgesTransparentBin[normalEdgesTransparentBinLen++] = drawable;
19317
- }
19300
+ if (renderFlags.selectedSilhouetteOpaque) {
19301
+ selectedFillOpaqueBin[selectedFillOpaqueBinLen++] = drawable;
19302
+ }
19318
19303
 
19319
- if (renderFlags.selectedEdgesTransparent) {
19320
- selectedEdgesTransparentBin[selectedEdgesTransparentBinLen++] = drawable;
19321
- }
19304
+ if (drawable.edges && edgesEnabled) {
19305
+ if (renderFlags.edgesOpaque) {
19306
+ normalEdgesOpaqueBin[normalEdgesOpaqueBinLen++] = drawable;
19307
+ }
19322
19308
 
19323
- if (renderFlags.selectedEdgesOpaque) {
19324
- selectedEdgesOpaqueBin[selectedEdgesOpaqueBinLen++] = drawable;
19325
- }
19309
+ if (renderFlags.edgesTransparent) {
19310
+ normalEdgesTransparentBin[normalEdgesTransparentBinLen++] = drawable;
19311
+ }
19326
19312
 
19327
- if (renderFlags.xrayedEdgesTransparent) {
19328
- xrayEdgesTransparentBin[xrayEdgesTransparentBinLen++] = drawable;
19329
- }
19313
+ if (renderFlags.selectedEdgesTransparent) {
19314
+ selectedEdgesTransparentBin[selectedEdgesTransparentBinLen++] = drawable;
19315
+ }
19330
19316
 
19331
- if (renderFlags.xrayedEdgesOpaque) {
19332
- xrayEdgesOpaqueBin[xrayEdgesOpaqueBinLen++] = drawable;
19333
- }
19317
+ if (renderFlags.selectedEdgesOpaque) {
19318
+ selectedEdgesOpaqueBin[selectedEdgesOpaqueBinLen++] = drawable;
19319
+ }
19334
19320
 
19335
- if (renderFlags.highlightedEdgesTransparent) {
19336
- highlightedEdgesTransparentBin[highlightedEdgesTransparentBinLen++] = drawable;
19337
- }
19321
+ if (renderFlags.xrayedEdgesTransparent) {
19322
+ xrayEdgesTransparentBin[xrayEdgesTransparentBinLen++] = drawable;
19323
+ }
19324
+
19325
+ if (renderFlags.xrayedEdgesOpaque) {
19326
+ xrayEdgesOpaqueBin[xrayEdgesOpaqueBinLen++] = drawable;
19327
+ }
19338
19328
 
19339
- if (renderFlags.highlightedEdgesOpaque) {
19340
- highlightedEdgesOpaqueBin[highlightedEdgesOpaqueBinLen++] = drawable;
19329
+ if (renderFlags.highlightedEdgesTransparent) {
19330
+ highlightedEdgesTransparentBin[highlightedEdgesTransparentBinLen++] = drawable;
19331
+ }
19332
+
19333
+ if (renderFlags.highlightedEdgesOpaque) {
19334
+ highlightedEdgesOpaqueBin[highlightedEdgesOpaqueBinLen++] = drawable;
19335
+ }
19336
+ }
19341
19337
  }
19342
19338
  }
19343
19339
  }
@@ -31603,8 +31599,6 @@ class Scene extends Component {
31603
31599
  * @param {Number[]} [params.origin] World-space ray origin when ray-picking. Ignored when canvasPos given.
31604
31600
  * @param {Number[]} [params.direction] World-space ray direction when ray-picking. Also indicates the length of the ray. Ignored when canvasPos given.
31605
31601
  * @param {Number[]} [params.matrix] 4x4 transformation matrix to define the World-space ray origin and direction, as an alternative to ````origin```` and ````direction````.
31606
- * @param {String[]} [params.includeEntities] IDs of {@link Entity}s to restrict picking to. When given, ignores {@link Entity}s whose IDs are not in this list.
31607
- * @param {String[]} [params.excludeEntities] IDs of {@link Entity}s to ignore. When given, will pick *through* these {@link Entity}s, as if they were not there.
31608
31602
  * @param {Number} [params.snapRadius=30] The snap radius, in canvas pixels.
31609
31603
  * @param {boolean} [params.snapToVertex=true] Whether to snap to vertex. Only works when `canvasPos` given.
31610
31604
  * @param {boolean} [params.snapToEdge=true] Whether to snap to edge. Only works when `canvasPos` given.
@@ -18731,9 +18731,6 @@ const Renderer$1 = function (scene, options) {
18731
18731
  let drawableTypeInfo = {};
18732
18732
  let drawables = {};
18733
18733
 
18734
- let postSortDrawableList = [];
18735
- let postCullDrawableList = [];
18736
-
18737
18734
  let drawableListDirty = true;
18738
18735
  let stateSortDirty = true;
18739
18736
  let imageDirty = true;
@@ -18959,38 +18956,28 @@ const Renderer$1 = function (scene, options) {
18959
18956
  const drawableInfo = drawableTypeInfo[type];
18960
18957
  if (drawableInfo.isStateSortable) {
18961
18958
  drawableInfo.drawableListPreCull.sort(drawableInfo.stateSortCompare);
18962
-
18963
- drawableInfo.drawableList = drawableInfo.drawableListPreCull;
18964
18959
  }
18965
18960
  }
18966
18961
  }
18967
- let lenDrawableList = 0;
18962
+ }
18963
+
18964
+ function cullDrawableList() {
18968
18965
  for (let type in drawableTypeInfo) {
18969
18966
  if (drawableTypeInfo.hasOwnProperty(type)) {
18970
18967
  const drawableInfo = drawableTypeInfo[type];
18971
18968
  const drawableListPreCull = drawableInfo.drawableListPreCull;
18969
+ const drawableList = drawableInfo.drawableList;
18970
+ let lenDrawableList = 0;
18972
18971
  for (let i = 0, len = drawableListPreCull.length; i < len; i++) {
18973
18972
  const drawable = drawableListPreCull[i];
18974
- postSortDrawableList[lenDrawableList++] = drawable;
18973
+ drawable.rebuildRenderFlags();
18974
+ if (!drawable.renderFlags.culled) {
18975
+ drawableList[lenDrawableList++] = drawable;
18976
+ }
18975
18977
  }
18978
+ drawableList.length = lenDrawableList;
18976
18979
  }
18977
18980
  }
18978
- postSortDrawableList.length = lenDrawableList;
18979
- postSortDrawableList.sort((a, b) => {
18980
- return a.renderOrder - b.renderOrder;
18981
- });
18982
- }
18983
-
18984
- function cullDrawableList() {
18985
- let lenDrawableList = 0;
18986
- for (let i = 0, len = postSortDrawableList.length; i < len; i++) {
18987
- const drawable = postSortDrawableList[i];
18988
- drawable.rebuildRenderFlags();
18989
- if (!drawable.renderFlags.culled) {
18990
- postCullDrawableList[lenDrawableList++] = drawable;
18991
- }
18992
- }
18993
- postCullDrawableList.length = lenDrawableList;
18994
18981
  }
18995
18982
 
18996
18983
  function draw(params) {
@@ -19223,6 +19210,7 @@ const Renderer$1 = function (scene, options) {
19223
19210
  }
19224
19211
 
19225
19212
  let i;
19213
+ let len;
19226
19214
  let drawable;
19227
19215
 
19228
19216
  const startTime = Date.now();
@@ -19255,85 +19243,93 @@ const Renderer$1 = function (scene, options) {
19255
19243
  // Render normal opaque solids, defer others to bins to render after
19256
19244
  //------------------------------------------------------------------------------------------------------
19257
19245
 
19258
- for (let i = 0, len = postCullDrawableList.length; i < len; i++) {
19246
+ for (let type in drawableTypeInfo) {
19247
+ if (drawableTypeInfo.hasOwnProperty(type)) {
19259
19248
 
19260
- drawable = postCullDrawableList[i];
19249
+ const drawableInfo = drawableTypeInfo[type];
19250
+ const drawableList = drawableInfo.drawableList;
19261
19251
 
19262
- if (drawable.culled === true || drawable.visible === false) {
19263
- continue;
19264
- }
19252
+ for (i = 0, len = drawableList.length; i < len; i++) {
19265
19253
 
19266
- const renderFlags = drawable.renderFlags;
19254
+ drawable = drawableList[i];
19267
19255
 
19268
- if (renderFlags.colorOpaque) {
19269
- if (saoEnabled && saoPossible && drawable.saoEnabled) {
19270
- normalDrawSAOBin[normalDrawSAOBinLen++] = drawable;
19271
- } else {
19272
- drawable.drawColorOpaque(frameCtx);
19273
- }
19274
- }
19256
+ if (drawable.culled === true || drawable.visible === false) {
19257
+ continue;
19258
+ }
19275
19259
 
19276
- if (transparentEnabled) {
19277
- if (renderFlags.colorTransparent) {
19278
- normalFillTransparentBin[normalFillTransparentBinLen++] = drawable;
19279
- }
19280
- }
19260
+ const renderFlags = drawable.renderFlags;
19281
19261
 
19282
- if (renderFlags.xrayedSilhouetteTransparent) {
19283
- xrayedFillTransparentBin[xrayedFillTransparentBinLen++] = drawable;
19284
- }
19262
+ if (renderFlags.colorOpaque) {
19263
+ if (saoEnabled && saoPossible && drawable.saoEnabled) {
19264
+ normalDrawSAOBin[normalDrawSAOBinLen++] = drawable;
19265
+ } else {
19266
+ drawable.drawColorOpaque(frameCtx);
19267
+ }
19268
+ }
19285
19269
 
19286
- if (renderFlags.xrayedSilhouetteOpaque) {
19287
- xrayedFillOpaqueBin[xrayedFillOpaqueBinLen++] = drawable;
19288
- }
19270
+ if (transparentEnabled) {
19271
+ if (renderFlags.colorTransparent) {
19272
+ normalFillTransparentBin[normalFillTransparentBinLen++] = drawable;
19273
+ }
19274
+ }
19289
19275
 
19290
- if (renderFlags.highlightedSilhouetteTransparent) {
19291
- highlightedFillTransparentBin[highlightedFillTransparentBinLen++] = drawable;
19292
- }
19276
+ if (renderFlags.xrayedSilhouetteTransparent) {
19277
+ xrayedFillTransparentBin[xrayedFillTransparentBinLen++] = drawable;
19278
+ }
19293
19279
 
19294
- if (renderFlags.highlightedSilhouetteOpaque) {
19295
- highlightedFillOpaqueBin[highlightedFillOpaqueBinLen++] = drawable;
19296
- }
19280
+ if (renderFlags.xrayedSilhouetteOpaque) {
19281
+ xrayedFillOpaqueBin[xrayedFillOpaqueBinLen++] = drawable;
19282
+ }
19297
19283
 
19298
- if (renderFlags.selectedSilhouetteTransparent) {
19299
- selectedFillTransparentBin[selectedFillTransparentBinLen++] = drawable;
19300
- }
19284
+ if (renderFlags.highlightedSilhouetteTransparent) {
19285
+ highlightedFillTransparentBin[highlightedFillTransparentBinLen++] = drawable;
19286
+ }
19301
19287
 
19302
- if (renderFlags.selectedSilhouetteOpaque) {
19303
- selectedFillOpaqueBin[selectedFillOpaqueBinLen++] = drawable;
19304
- }
19288
+ if (renderFlags.highlightedSilhouetteOpaque) {
19289
+ highlightedFillOpaqueBin[highlightedFillOpaqueBinLen++] = drawable;
19290
+ }
19305
19291
 
19306
- if (drawable.edges && edgesEnabled) {
19307
- if (renderFlags.edgesOpaque) {
19308
- normalEdgesOpaqueBin[normalEdgesOpaqueBinLen++] = drawable;
19309
- }
19292
+ if (renderFlags.selectedSilhouetteTransparent) {
19293
+ selectedFillTransparentBin[selectedFillTransparentBinLen++] = drawable;
19294
+ }
19310
19295
 
19311
- if (renderFlags.edgesTransparent) {
19312
- normalEdgesTransparentBin[normalEdgesTransparentBinLen++] = drawable;
19313
- }
19296
+ if (renderFlags.selectedSilhouetteOpaque) {
19297
+ selectedFillOpaqueBin[selectedFillOpaqueBinLen++] = drawable;
19298
+ }
19314
19299
 
19315
- if (renderFlags.selectedEdgesTransparent) {
19316
- selectedEdgesTransparentBin[selectedEdgesTransparentBinLen++] = drawable;
19317
- }
19300
+ if (drawable.edges && edgesEnabled) {
19301
+ if (renderFlags.edgesOpaque) {
19302
+ normalEdgesOpaqueBin[normalEdgesOpaqueBinLen++] = drawable;
19303
+ }
19318
19304
 
19319
- if (renderFlags.selectedEdgesOpaque) {
19320
- selectedEdgesOpaqueBin[selectedEdgesOpaqueBinLen++] = drawable;
19321
- }
19305
+ if (renderFlags.edgesTransparent) {
19306
+ normalEdgesTransparentBin[normalEdgesTransparentBinLen++] = drawable;
19307
+ }
19322
19308
 
19323
- if (renderFlags.xrayedEdgesTransparent) {
19324
- xrayEdgesTransparentBin[xrayEdgesTransparentBinLen++] = drawable;
19325
- }
19309
+ if (renderFlags.selectedEdgesTransparent) {
19310
+ selectedEdgesTransparentBin[selectedEdgesTransparentBinLen++] = drawable;
19311
+ }
19326
19312
 
19327
- if (renderFlags.xrayedEdgesOpaque) {
19328
- xrayEdgesOpaqueBin[xrayEdgesOpaqueBinLen++] = drawable;
19329
- }
19313
+ if (renderFlags.selectedEdgesOpaque) {
19314
+ selectedEdgesOpaqueBin[selectedEdgesOpaqueBinLen++] = drawable;
19315
+ }
19330
19316
 
19331
- if (renderFlags.highlightedEdgesTransparent) {
19332
- highlightedEdgesTransparentBin[highlightedEdgesTransparentBinLen++] = drawable;
19333
- }
19317
+ if (renderFlags.xrayedEdgesTransparent) {
19318
+ xrayEdgesTransparentBin[xrayEdgesTransparentBinLen++] = drawable;
19319
+ }
19320
+
19321
+ if (renderFlags.xrayedEdgesOpaque) {
19322
+ xrayEdgesOpaqueBin[xrayEdgesOpaqueBinLen++] = drawable;
19323
+ }
19334
19324
 
19335
- if (renderFlags.highlightedEdgesOpaque) {
19336
- highlightedEdgesOpaqueBin[highlightedEdgesOpaqueBinLen++] = drawable;
19325
+ if (renderFlags.highlightedEdgesTransparent) {
19326
+ highlightedEdgesTransparentBin[highlightedEdgesTransparentBinLen++] = drawable;
19327
+ }
19328
+
19329
+ if (renderFlags.highlightedEdgesOpaque) {
19330
+ highlightedEdgesOpaqueBin[highlightedEdgesOpaqueBinLen++] = drawable;
19331
+ }
19332
+ }
19337
19333
  }
19338
19334
  }
19339
19335
  }
@@ -31599,8 +31595,6 @@ class Scene extends Component {
31599
31595
  * @param {Number[]} [params.origin] World-space ray origin when ray-picking. Ignored when canvasPos given.
31600
31596
  * @param {Number[]} [params.direction] World-space ray direction when ray-picking. Also indicates the length of the ray. Ignored when canvasPos given.
31601
31597
  * @param {Number[]} [params.matrix] 4x4 transformation matrix to define the World-space ray origin and direction, as an alternative to ````origin```` and ````direction````.
31602
- * @param {String[]} [params.includeEntities] IDs of {@link Entity}s to restrict picking to. When given, ignores {@link Entity}s whose IDs are not in this list.
31603
- * @param {String[]} [params.excludeEntities] IDs of {@link Entity}s to ignore. When given, will pick *through* these {@link Entity}s, as if they were not there.
31604
31598
  * @param {Number} [params.snapRadius=30] The snap radius, in canvas pixels.
31605
31599
  * @param {boolean} [params.snapToVertex=true] Whether to snap to vertex. Only works when `canvasPos` given.
31606
31600
  * @param {boolean} [params.snapToEdge=true] Whether to snap to edge. Only works when `canvasPos` given.