@xeokit/xeokit-sdk 2.6.16 → 2.6.19
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 +2348 -118
- package/dist/xeokit-sdk.es.js +2338 -119
- package/dist/xeokit-sdk.es5.js +559 -419
- package/dist/xeokit-sdk.min.cjs.js +4 -4
- package/dist/xeokit-sdk.min.es.js +5 -5
- package/dist/xeokit-sdk.min.es5.js +4 -4
- package/package.json +2 -2
- package/src/extras/PointerLens/PointerLens.js +2 -2
- package/src/plugins/AnnotationsPlugin/Annotation.js +1 -0
- package/src/plugins/CityJSONLoaderPlugin/CityJSONDefaultDataSource.js +15 -2
- package/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.js +1 -1
- package/src/plugins/DotBIMLoaderPlugin/DotBIMDefaultDataSource.js +15 -2
- package/src/plugins/GLTFLoaderPlugin/GLTFDefaultDataSource.js +18 -5
- package/src/plugins/LASLoaderPlugin/LASDefaultDataSource.js +15 -1
- package/src/plugins/STLLoaderPlugin/STLDefaultDataSource.js +17 -0
- package/src/plugins/WebIFCLoaderPlugin/WebIFCDefaultDataSource.js +16 -1
- package/src/plugins/XKTLoaderPlugin/XKTDefaultDataSource.js +18 -4
- package/src/plugins/ZonesPlugin/index.js +2046 -0
- package/src/plugins/index.js +2 -1
- package/src/plugins/lib/html/Dot.js +19 -1
- package/src/viewer/Viewer.js +3 -1
- package/src/viewer/scene/CameraControl/lib/handlers/MousePickHandler.js +9 -0
- package/src/viewer/scene/geometry/builders/buildLineGeometry.js +267 -0
- package/src/viewer/scene/input/Input.js +41 -0
- package/src/viewer/scene/marker/Marker.js +4 -1
- package/src/viewer/scene/mesh/Mesh.js +5 -0
- package/src/viewer/scene/model/SceneModel.js +7 -1
- package/src/viewer/scene/scene/Scene.js +30 -4
- package/src/viewer/scene/sectionPlane/SectionPlane.js +3 -7
- package/src/viewer/scene/webgl/Renderer.js +84 -79
- package/src/viewer/scene/webgl/occlusion/OcclusionLayer.js +1 -1
- package/src/viewer/scene/webgl/occlusion/OcclusionTester.js +8 -5
- package/types/viewer/Viewer.d.ts +2 -0
- package/types/viewer/scene/geometry/builders/buildLineGeometry.d.ts +22 -0
- package/types/viewer/scene/geometry/builders/buildPolylineGeometry.d.ts +2 -2
- package/types/viewer/scene/scene/Scene.d.ts +11 -0
- package/dist/web-ifc.wasm +0 -0
|
@@ -32,6 +32,9 @@ const Renderer = function (scene, options) {
|
|
|
32
32
|
let drawableTypeInfo = {};
|
|
33
33
|
let drawables = {};
|
|
34
34
|
|
|
35
|
+
let postSortDrawableList = [];
|
|
36
|
+
let postCullDrawableList = [];
|
|
37
|
+
|
|
35
38
|
let drawableListDirty = true;
|
|
36
39
|
let stateSortDirty = true;
|
|
37
40
|
let imageDirty = true;
|
|
@@ -269,28 +272,38 @@ const Renderer = function (scene, options) {
|
|
|
269
272
|
const drawableInfo = drawableTypeInfo[type];
|
|
270
273
|
if (drawableInfo.isStateSortable) {
|
|
271
274
|
drawableInfo.drawableListPreCull.sort(drawableInfo.stateSortCompare);
|
|
275
|
+
|
|
276
|
+
drawableInfo.drawableList = drawableInfo.drawableListPreCull;
|
|
272
277
|
}
|
|
273
278
|
}
|
|
274
279
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
function cullDrawableList() {
|
|
280
|
+
let lenDrawableList = 0;
|
|
278
281
|
for (let type in drawableTypeInfo) {
|
|
279
282
|
if (drawableTypeInfo.hasOwnProperty(type)) {
|
|
280
283
|
const drawableInfo = drawableTypeInfo[type];
|
|
281
284
|
const drawableListPreCull = drawableInfo.drawableListPreCull;
|
|
282
|
-
const drawableList = drawableInfo.drawableList;
|
|
283
|
-
let lenDrawableList = 0;
|
|
284
285
|
for (let i = 0, len = drawableListPreCull.length; i < len; i++) {
|
|
285
286
|
const drawable = drawableListPreCull[i];
|
|
286
|
-
drawable
|
|
287
|
-
if (!drawable.renderFlags.culled) {
|
|
288
|
-
drawableList[lenDrawableList++] = drawable;
|
|
289
|
-
}
|
|
287
|
+
postSortDrawableList[lenDrawableList++] = drawable;
|
|
290
288
|
}
|
|
291
|
-
drawableList.length = lenDrawableList;
|
|
292
289
|
}
|
|
293
290
|
}
|
|
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;
|
|
294
307
|
}
|
|
295
308
|
|
|
296
309
|
function draw(params) {
|
|
@@ -567,93 +580,85 @@ const Renderer = function (scene, options) {
|
|
|
567
580
|
// Render normal opaque solids, defer others to bins to render after
|
|
568
581
|
//------------------------------------------------------------------------------------------------------
|
|
569
582
|
|
|
570
|
-
for (let
|
|
571
|
-
if (drawableTypeInfo.hasOwnProperty(type)) {
|
|
583
|
+
for (let i = 0, len = postCullDrawableList.length; i < len; i++) {
|
|
572
584
|
|
|
573
|
-
|
|
574
|
-
const drawableList = drawableInfo.drawableList;
|
|
575
|
-
|
|
576
|
-
for (i = 0, len = drawableList.length; i < len; i++) {
|
|
577
|
-
|
|
578
|
-
drawable = drawableList[i];
|
|
585
|
+
drawable = postCullDrawableList[i];
|
|
579
586
|
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
587
|
+
if (drawable.culled === true || drawable.visible === false) {
|
|
588
|
+
continue;
|
|
589
|
+
}
|
|
583
590
|
|
|
584
|
-
|
|
591
|
+
const renderFlags = drawable.renderFlags;
|
|
585
592
|
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
+
if (renderFlags.colorOpaque) {
|
|
594
|
+
if (saoEnabled && saoPossible && drawable.saoEnabled) {
|
|
595
|
+
normalDrawSAOBin[normalDrawSAOBinLen++] = drawable;
|
|
596
|
+
} else {
|
|
597
|
+
drawable.drawColorOpaque(frameCtx);
|
|
598
|
+
}
|
|
599
|
+
}
|
|
593
600
|
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
601
|
+
if (transparentEnabled) {
|
|
602
|
+
if (renderFlags.colorTransparent) {
|
|
603
|
+
normalFillTransparentBin[normalFillTransparentBinLen++] = drawable;
|
|
604
|
+
}
|
|
605
|
+
}
|
|
599
606
|
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
607
|
+
if (renderFlags.xrayedSilhouetteTransparent) {
|
|
608
|
+
xrayedFillTransparentBin[xrayedFillTransparentBinLen++] = drawable;
|
|
609
|
+
}
|
|
603
610
|
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
611
|
+
if (renderFlags.xrayedSilhouetteOpaque) {
|
|
612
|
+
xrayedFillOpaqueBin[xrayedFillOpaqueBinLen++] = drawable;
|
|
613
|
+
}
|
|
607
614
|
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
615
|
+
if (renderFlags.highlightedSilhouetteTransparent) {
|
|
616
|
+
highlightedFillTransparentBin[highlightedFillTransparentBinLen++] = drawable;
|
|
617
|
+
}
|
|
611
618
|
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
619
|
+
if (renderFlags.highlightedSilhouetteOpaque) {
|
|
620
|
+
highlightedFillOpaqueBin[highlightedFillOpaqueBinLen++] = drawable;
|
|
621
|
+
}
|
|
615
622
|
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
623
|
+
if (renderFlags.selectedSilhouetteTransparent) {
|
|
624
|
+
selectedFillTransparentBin[selectedFillTransparentBinLen++] = drawable;
|
|
625
|
+
}
|
|
619
626
|
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
627
|
+
if (renderFlags.selectedSilhouetteOpaque) {
|
|
628
|
+
selectedFillOpaqueBin[selectedFillOpaqueBinLen++] = drawable;
|
|
629
|
+
}
|
|
623
630
|
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
631
|
+
if (drawable.edges && edgesEnabled) {
|
|
632
|
+
if (renderFlags.edgesOpaque) {
|
|
633
|
+
normalEdgesOpaqueBin[normalEdgesOpaqueBinLen++] = drawable;
|
|
634
|
+
}
|
|
628
635
|
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
636
|
+
if (renderFlags.edgesTransparent) {
|
|
637
|
+
normalEdgesTransparentBin[normalEdgesTransparentBinLen++] = drawable;
|
|
638
|
+
}
|
|
632
639
|
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
640
|
+
if (renderFlags.selectedEdgesTransparent) {
|
|
641
|
+
selectedEdgesTransparentBin[selectedEdgesTransparentBinLen++] = drawable;
|
|
642
|
+
}
|
|
636
643
|
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
644
|
+
if (renderFlags.selectedEdgesOpaque) {
|
|
645
|
+
selectedEdgesOpaqueBin[selectedEdgesOpaqueBinLen++] = drawable;
|
|
646
|
+
}
|
|
640
647
|
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
648
|
+
if (renderFlags.xrayedEdgesTransparent) {
|
|
649
|
+
xrayEdgesTransparentBin[xrayEdgesTransparentBinLen++] = drawable;
|
|
650
|
+
}
|
|
644
651
|
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
652
|
+
if (renderFlags.xrayedEdgesOpaque) {
|
|
653
|
+
xrayEdgesOpaqueBin[xrayEdgesOpaqueBinLen++] = drawable;
|
|
654
|
+
}
|
|
648
655
|
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
656
|
+
if (renderFlags.highlightedEdgesTransparent) {
|
|
657
|
+
highlightedEdgesTransparentBin[highlightedEdgesTransparentBinLen++] = drawable;
|
|
658
|
+
}
|
|
652
659
|
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
}
|
|
656
|
-
}
|
|
660
|
+
if (renderFlags.highlightedEdgesOpaque) {
|
|
661
|
+
highlightedEdgesOpaqueBin[highlightedEdgesOpaqueBinLen++] = drawable;
|
|
657
662
|
}
|
|
658
663
|
}
|
|
659
664
|
}
|
|
@@ -970,7 +975,7 @@ const Renderer = function (scene, options) {
|
|
|
970
975
|
math.cross3Vec3(worldRayDir, randomVec3, up);
|
|
971
976
|
|
|
972
977
|
pickViewMatrix = math.lookAtMat4v(worldRayOrigin, look, up, tempMat4b);
|
|
973
|
-
|
|
978
|
+
// pickProjMatrix = scene.camera.projMatrix;
|
|
974
979
|
pickProjMatrix = scene.camera.ortho.matrix;
|
|
975
980
|
|
|
976
981
|
pickResult.origin = worldRayOrigin;
|
|
@@ -126,7 +126,7 @@ class OcclusionLayer {
|
|
|
126
126
|
_buildVBOs() {
|
|
127
127
|
if (this.positionsBuf) {
|
|
128
128
|
if (this.lenPositionsBuf === this.positions.length) { // Just updating buffer elements, don't need to reallocate
|
|
129
|
-
this.positionsBuf.setData(this.positions); // Indices don't need updating
|
|
129
|
+
this.positionsBuf.setData(new Float32Array(this.positions)); // Indices don't need updating
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
132
|
this.positionsBuf.destroy();
|
|
@@ -7,7 +7,6 @@ import {WEBGL_INFO} from "../../webglInfo.js";
|
|
|
7
7
|
const TEST_MODE = false;
|
|
8
8
|
const MARKER_COLOR = math.vec3([1.0, 0.0, 0.0]);
|
|
9
9
|
const POINT_SIZE = 20;
|
|
10
|
-
const MARKER_SPRITE_CLIPZ_OFFSET = -0.001; // Amount that we offset sprite clip Z coords to raise them from surfaces
|
|
11
10
|
|
|
12
11
|
const tempVec3a = math.vec3();
|
|
13
12
|
|
|
@@ -74,7 +73,6 @@ class OcclusionTester {
|
|
|
74
73
|
markerWorldPosUpdated(marker) {
|
|
75
74
|
const occlusionLayer = this._markersToOcclusionLayersMap[marker.id];
|
|
76
75
|
if (!occlusionLayer) {
|
|
77
|
-
marker.error("Marker has not been added to OcclusionTester");
|
|
78
76
|
return;
|
|
79
77
|
}
|
|
80
78
|
const originHash = marker.origin.join();
|
|
@@ -89,7 +87,7 @@ class OcclusionTester {
|
|
|
89
87
|
let newOcclusionLayer = this._occlusionLayers[originHash];
|
|
90
88
|
if (!newOcclusionLayer) {
|
|
91
89
|
newOcclusionLayer = new OcclusionLayer(this._scene, marker.origin);
|
|
92
|
-
this._occlusionLayers[originHash] =
|
|
90
|
+
this._occlusionLayers[originHash] = newOcclusionLayer;
|
|
93
91
|
this._occlusionLayersListDirty = true;
|
|
94
92
|
}
|
|
95
93
|
newOcclusionLayer.addMarker(marker);
|
|
@@ -219,7 +217,9 @@ class OcclusionTester {
|
|
|
219
217
|
if (scene.logarithmicDepthBufferEnabled) {
|
|
220
218
|
src.push("vFragDepth = 1.0 + clipPos.w;");
|
|
221
219
|
} else {
|
|
222
|
-
|
|
220
|
+
if (scene.markerZOffset < 0.000) {
|
|
221
|
+
src.push("clipPos.z += " + scene.markerZOffset + ";");
|
|
222
|
+
}
|
|
223
223
|
}
|
|
224
224
|
src.push(" gl_Position = clipPos;");
|
|
225
225
|
src.push("}");
|
|
@@ -333,7 +333,10 @@ class OcclusionTester {
|
|
|
333
333
|
continue;
|
|
334
334
|
}
|
|
335
335
|
|
|
336
|
-
|
|
336
|
+
// The `origin` has been changed from `occlusionLayer.origin` to `[ 0, 0, 0 ]`
|
|
337
|
+
// because OcclusionLayer markers' transformation is being applied through the
|
|
338
|
+
// OcclusionLayer::positions array. See XEOK-33
|
|
339
|
+
const origin = [ 0, 0, 0 ];
|
|
337
340
|
|
|
338
341
|
gl.uniformMatrix4fv(this._uViewMatrix, false, createRTCViewMat(camera.viewMatrix, origin));
|
|
339
342
|
|
package/types/viewer/Viewer.d.ts
CHANGED
|
@@ -63,6 +63,8 @@ export declare type ViewerConfiguration = {
|
|
|
63
63
|
localeService?: LocaleService;
|
|
64
64
|
/** Whether to enable data texture-based (DTX) scene representation within the Viewer. */
|
|
65
65
|
dtxEnabled?: boolean;
|
|
66
|
+
/** The Z value of offset for Marker's OcclusionTester. The closest the value is to 0.000 the more precise OcclusionTester will be, but at the same time the less precise it will behave for Markers that are located exactly on the Surface. */
|
|
67
|
+
markerZOffset?: number;
|
|
66
68
|
/** Enhances the efficiency of SectionPlane creation by proactively allocating Viewer resources for a specified quantity of SectionPlanes.*/
|
|
67
69
|
numCachedSectionPlanes?: number;
|
|
68
70
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Geometry } from "../Geometry";
|
|
2
|
+
|
|
3
|
+
export declare type buildLineGeometryConfiguration = {
|
|
4
|
+
/* Optional ID for the {@link Geometry}, unique among all components in the parent {@link Scene}, generated automatically when omitted. */
|
|
5
|
+
id?: string;
|
|
6
|
+
/* 3D start point (x0, y0, z0). */
|
|
7
|
+
startPoint?: number[];
|
|
8
|
+
/* 3D end point (x1, y1, z1). */
|
|
9
|
+
endPoint?: number[];
|
|
10
|
+
/* Lengths of segments that describe a pattern. */
|
|
11
|
+
pattern?: number[];
|
|
12
|
+
/* If true: it will try to make sure the line doesn't end up with a gap, as it will extend the last segment. */
|
|
13
|
+
extendToEnd?: boolean;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @desc Creates a 3D line {@link Geometry}.
|
|
18
|
+
*
|
|
19
|
+
* @param {buildLineGeometryConfiguration} [cfg] Configs
|
|
20
|
+
* @returns {Object} Configuration for a {@link Geometry} subtype.
|
|
21
|
+
*/
|
|
22
|
+
export function buildLineGeometry(cfg: buildLineGeometryConfiguration): Geometry;
|
|
@@ -19,7 +19,7 @@ export declare type buildPolylineGeometryFromCurveConfiguration = {
|
|
|
19
19
|
/**
|
|
20
20
|
* @desc Creates a 3D polyline {@link Geometry}.
|
|
21
21
|
*
|
|
22
|
-
* @param {
|
|
22
|
+
* @param {buildPolylineGeometryConfiguration} [cfg] Configs
|
|
23
23
|
* @returns {Object} Configuration for a {@link Geometry} subtype.
|
|
24
24
|
*/
|
|
25
25
|
export function buildPolylineGeometry(cfg: buildPolylineGeometryConfiguration): Geometry;
|
|
@@ -27,7 +27,7 @@ export function buildPolylineGeometry(cfg: buildPolylineGeometryConfiguration):
|
|
|
27
27
|
/**
|
|
28
28
|
* @desc Creates a 3D polyline from curve {@link Geometry}.
|
|
29
29
|
*
|
|
30
|
-
* @param {
|
|
30
|
+
* @param {buildPolylineGeometryFromCurveConfiguration} [cfg] Configs
|
|
31
31
|
* @returns {Object} Configuration for a {@link Geometry} subtype.
|
|
32
32
|
*/
|
|
33
33
|
export function buildPolylineGeometryFromCurve(cfg: buildPolylineGeometryFromCurveConfiguration): Geometry;
|
|
@@ -218,6 +218,17 @@ export declare class Scene extends Component {
|
|
|
218
218
|
*/
|
|
219
219
|
get pbrEnabled(): boolean
|
|
220
220
|
|
|
221
|
+
/**
|
|
222
|
+
* Gets the Z value of offset for Marker's OcclusionTester.
|
|
223
|
+
* The closest the value is to 0.000 the more precise OcclusionTester will be, but at the same time the less
|
|
224
|
+
* precise it will behave for Markers that are located exactly on the Surface.
|
|
225
|
+
*
|
|
226
|
+
* Default is ````-0.001````.
|
|
227
|
+
*
|
|
228
|
+
* @returns {Number} Z offset for Marker
|
|
229
|
+
*/
|
|
230
|
+
get markerZOffset(): number
|
|
231
|
+
|
|
221
232
|
/**
|
|
222
233
|
* Gets the IDs of the {@link Entity}s in {@link Scene.models}.
|
|
223
234
|
*
|
package/dist/web-ifc.wasm
DELETED
|
Binary file
|