@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.
- package/dist/xeokit-sdk.cjs.js +79 -85
- package/dist/xeokit-sdk.es.js +79 -85
- package/dist/xeokit-sdk.es5.js +377 -379
- package/dist/xeokit-sdk.min.cjs.js +1 -1
- package/dist/xeokit-sdk.min.es.js +1 -1
- package/dist/xeokit-sdk.min.es5.js +1 -1
- package/package.json +1 -1
- package/src/viewer/scene/scene/Scene.js +0 -2
- package/src/viewer/scene/webgl/Renderer.js +78 -83
package/package.json
CHANGED
|
@@ -2289,8 +2289,6 @@ class Scene extends Component {
|
|
|
2289
2289
|
* @param {Number[]} [params.origin] World-space ray origin when ray-picking. Ignored when canvasPos given.
|
|
2290
2290
|
* @param {Number[]} [params.direction] World-space ray direction when ray-picking. Also indicates the length of the ray. Ignored when canvasPos given.
|
|
2291
2291
|
* @param {Number[]} [params.matrix] 4x4 transformation matrix to define the World-space ray origin and direction, as an alternative to ````origin```` and ````direction````.
|
|
2292
|
-
* @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.
|
|
2293
|
-
* @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.
|
|
2294
2292
|
* @param {Number} [params.snapRadius=30] The snap radius, in canvas pixels.
|
|
2295
2293
|
* @param {boolean} [params.snapToVertex=true] Whether to snap to vertex. Only works when `canvasPos` given.
|
|
2296
2294
|
* @param {boolean} [params.snapToEdge=true] Whether to snap to edge. Only works when `canvasPos` given.
|
|
@@ -32,9 +32,6 @@ const Renderer = function (scene, options) {
|
|
|
32
32
|
let drawableTypeInfo = {};
|
|
33
33
|
let drawables = {};
|
|
34
34
|
|
|
35
|
-
let postSortDrawableList = [];
|
|
36
|
-
let postCullDrawableList = [];
|
|
37
|
-
|
|
38
35
|
let drawableListDirty = true;
|
|
39
36
|
let stateSortDirty = true;
|
|
40
37
|
let imageDirty = true;
|
|
@@ -272,38 +269,28 @@ const Renderer = function (scene, options) {
|
|
|
272
269
|
const drawableInfo = drawableTypeInfo[type];
|
|
273
270
|
if (drawableInfo.isStateSortable) {
|
|
274
271
|
drawableInfo.drawableListPreCull.sort(drawableInfo.stateSortCompare);
|
|
275
|
-
|
|
276
|
-
drawableInfo.drawableList = drawableInfo.drawableListPreCull;
|
|
277
272
|
}
|
|
278
273
|
}
|
|
279
274
|
}
|
|
280
|
-
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
function cullDrawableList() {
|
|
281
278
|
for (let type in drawableTypeInfo) {
|
|
282
279
|
if (drawableTypeInfo.hasOwnProperty(type)) {
|
|
283
280
|
const drawableInfo = drawableTypeInfo[type];
|
|
284
281
|
const drawableListPreCull = drawableInfo.drawableListPreCull;
|
|
282
|
+
const drawableList = drawableInfo.drawableList;
|
|
283
|
+
let lenDrawableList = 0;
|
|
285
284
|
for (let i = 0, len = drawableListPreCull.length; i < len; i++) {
|
|
286
285
|
const drawable = drawableListPreCull[i];
|
|
287
|
-
|
|
286
|
+
drawable.rebuildRenderFlags();
|
|
287
|
+
if (!drawable.renderFlags.culled) {
|
|
288
|
+
drawableList[lenDrawableList++] = drawable;
|
|
289
|
+
}
|
|
288
290
|
}
|
|
291
|
+
drawableList.length = lenDrawableList;
|
|
289
292
|
}
|
|
290
293
|
}
|
|
291
|
-
postSortDrawableList.length = lenDrawableList;
|
|
292
|
-
postSortDrawableList.sort((a, b) => {
|
|
293
|
-
return a.renderOrder - b.renderOrder;
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
function cullDrawableList() {
|
|
298
|
-
let lenDrawableList = 0;
|
|
299
|
-
for (let i = 0, len = postSortDrawableList.length; i < len; i++) {
|
|
300
|
-
const drawable = postSortDrawableList[i];
|
|
301
|
-
drawable.rebuildRenderFlags();
|
|
302
|
-
if (!drawable.renderFlags.culled) {
|
|
303
|
-
postCullDrawableList[lenDrawableList++] = drawable;
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
postCullDrawableList.length = lenDrawableList;
|
|
307
294
|
}
|
|
308
295
|
|
|
309
296
|
function draw(params) {
|
|
@@ -580,85 +567,93 @@ const Renderer = function (scene, options) {
|
|
|
580
567
|
// Render normal opaque solids, defer others to bins to render after
|
|
581
568
|
//------------------------------------------------------------------------------------------------------
|
|
582
569
|
|
|
583
|
-
for (let
|
|
570
|
+
for (let type in drawableTypeInfo) {
|
|
571
|
+
if (drawableTypeInfo.hasOwnProperty(type)) {
|
|
584
572
|
|
|
585
|
-
|
|
573
|
+
const drawableInfo = drawableTypeInfo[type];
|
|
574
|
+
const drawableList = drawableInfo.drawableList;
|
|
586
575
|
|
|
587
|
-
|
|
588
|
-
continue;
|
|
589
|
-
}
|
|
576
|
+
for (i = 0, len = drawableList.length; i < len; i++) {
|
|
590
577
|
|
|
591
|
-
|
|
578
|
+
drawable = drawableList[i];
|
|
592
579
|
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
} else {
|
|
597
|
-
drawable.drawColorOpaque(frameCtx);
|
|
598
|
-
}
|
|
599
|
-
}
|
|
580
|
+
if (drawable.culled === true || drawable.visible === false) {
|
|
581
|
+
continue;
|
|
582
|
+
}
|
|
600
583
|
|
|
601
|
-
|
|
602
|
-
if (renderFlags.colorTransparent) {
|
|
603
|
-
normalFillTransparentBin[normalFillTransparentBinLen++] = drawable;
|
|
604
|
-
}
|
|
605
|
-
}
|
|
584
|
+
const renderFlags = drawable.renderFlags;
|
|
606
585
|
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
586
|
+
if (renderFlags.colorOpaque) {
|
|
587
|
+
if (saoEnabled && saoPossible && drawable.saoEnabled) {
|
|
588
|
+
normalDrawSAOBin[normalDrawSAOBinLen++] = drawable;
|
|
589
|
+
} else {
|
|
590
|
+
drawable.drawColorOpaque(frameCtx);
|
|
591
|
+
}
|
|
592
|
+
}
|
|
610
593
|
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
594
|
+
if (transparentEnabled) {
|
|
595
|
+
if (renderFlags.colorTransparent) {
|
|
596
|
+
normalFillTransparentBin[normalFillTransparentBinLen++] = drawable;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
614
599
|
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
600
|
+
if (renderFlags.xrayedSilhouetteTransparent) {
|
|
601
|
+
xrayedFillTransparentBin[xrayedFillTransparentBinLen++] = drawable;
|
|
602
|
+
}
|
|
618
603
|
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
604
|
+
if (renderFlags.xrayedSilhouetteOpaque) {
|
|
605
|
+
xrayedFillOpaqueBin[xrayedFillOpaqueBinLen++] = drawable;
|
|
606
|
+
}
|
|
622
607
|
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
608
|
+
if (renderFlags.highlightedSilhouetteTransparent) {
|
|
609
|
+
highlightedFillTransparentBin[highlightedFillTransparentBinLen++] = drawable;
|
|
610
|
+
}
|
|
626
611
|
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
612
|
+
if (renderFlags.highlightedSilhouetteOpaque) {
|
|
613
|
+
highlightedFillOpaqueBin[highlightedFillOpaqueBinLen++] = drawable;
|
|
614
|
+
}
|
|
630
615
|
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
}
|
|
616
|
+
if (renderFlags.selectedSilhouetteTransparent) {
|
|
617
|
+
selectedFillTransparentBin[selectedFillTransparentBinLen++] = drawable;
|
|
618
|
+
}
|
|
635
619
|
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
620
|
+
if (renderFlags.selectedSilhouetteOpaque) {
|
|
621
|
+
selectedFillOpaqueBin[selectedFillOpaqueBinLen++] = drawable;
|
|
622
|
+
}
|
|
639
623
|
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
624
|
+
if (drawable.edges && edgesEnabled) {
|
|
625
|
+
if (renderFlags.edgesOpaque) {
|
|
626
|
+
normalEdgesOpaqueBin[normalEdgesOpaqueBinLen++] = drawable;
|
|
627
|
+
}
|
|
643
628
|
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
629
|
+
if (renderFlags.edgesTransparent) {
|
|
630
|
+
normalEdgesTransparentBin[normalEdgesTransparentBinLen++] = drawable;
|
|
631
|
+
}
|
|
647
632
|
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
633
|
+
if (renderFlags.selectedEdgesTransparent) {
|
|
634
|
+
selectedEdgesTransparentBin[selectedEdgesTransparentBinLen++] = drawable;
|
|
635
|
+
}
|
|
651
636
|
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
637
|
+
if (renderFlags.selectedEdgesOpaque) {
|
|
638
|
+
selectedEdgesOpaqueBin[selectedEdgesOpaqueBinLen++] = drawable;
|
|
639
|
+
}
|
|
655
640
|
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
641
|
+
if (renderFlags.xrayedEdgesTransparent) {
|
|
642
|
+
xrayEdgesTransparentBin[xrayEdgesTransparentBinLen++] = drawable;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
if (renderFlags.xrayedEdgesOpaque) {
|
|
646
|
+
xrayEdgesOpaqueBin[xrayEdgesOpaqueBinLen++] = drawable;
|
|
647
|
+
}
|
|
659
648
|
|
|
660
|
-
|
|
661
|
-
|
|
649
|
+
if (renderFlags.highlightedEdgesTransparent) {
|
|
650
|
+
highlightedEdgesTransparentBin[highlightedEdgesTransparentBinLen++] = drawable;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
if (renderFlags.highlightedEdgesOpaque) {
|
|
654
|
+
highlightedEdgesOpaqueBin[highlightedEdgesOpaqueBinLen++] = drawable;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
662
657
|
}
|
|
663
658
|
}
|
|
664
659
|
}
|