@xeokit/xeokit-sdk 2.4.0-alpha-100 → 2.4.0-alpha-101
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 +16 -11
- package/dist/xeokit-sdk.es.js +16 -11
- package/dist/xeokit-sdk.es5.js +5 -8
- package/dist/xeokit-sdk.min.cjs.js +3 -3
- package/dist/xeokit-sdk.min.es.js +3 -3
- package/dist/xeokit-sdk.min.es5.js +3 -3
- package/package.json +1 -1
- package/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsMouseControl.js +0 -1
- package/src/plugins/NavCubePlugin/CubeTextureCanvas.js +4 -4
- package/src/viewer/scene/model/MeshClusteringManager.js +31 -0
- package/src/viewer/scene/model/dtx/triangles/renderers/TrianglesDataTextureSnapDepthBufInitRenderer.js +4 -2
- package/src/viewer/scene/model/vbo/snapBatching/SnapBatchingDepthBufInitRenderer.js +4 -2
- package/src/viewer/scene/model/vbo/snapInstancing/SnapInstancingDepthBufInitRenderer.js +4 -2
package/package.json
CHANGED
|
@@ -311,7 +311,6 @@ export class DistanceMeasurementsMouseControl extends DistanceMeasurementsContro
|
|
|
311
311
|
this.pointerLens.visible = false;
|
|
312
312
|
}
|
|
313
313
|
this.reset();
|
|
314
|
-
this.viewer
|
|
315
314
|
const canvas = this.scene.canvas.canvas;
|
|
316
315
|
canvas.removeEventListener("mousedown", this._onMouseDown);
|
|
317
316
|
canvas.removeEventListener("mouseup", this._onMouseUp);
|
|
@@ -15,8 +15,8 @@ function CubeTextureCanvas(viewer, navCubeScene, cfg = {}) {
|
|
|
15
15
|
const facesZUp = [
|
|
16
16
|
{boundary: [6, 6, 6, 6], color: cfg.frontColor || cfg.color || "#55FF55"},
|
|
17
17
|
{boundary: [18, 6, 6, 6], color: cfg.backColor || cfg.color || "#55FF55"},
|
|
18
|
-
{boundary: [12, 6, 6, 6], color: cfg.
|
|
19
|
-
{boundary: [0, 6, 6, 6], color: cfg.
|
|
18
|
+
{boundary: [12, 6, 6, 6], color: cfg.rightColor || cfg.color || "#FF5555"},
|
|
19
|
+
{boundary: [0, 6, 6, 6], color: cfg.leftColor || cfg.color || "#FF5555"},
|
|
20
20
|
{boundary: [6, 0, 6, 6], color: cfg.topColor || cfg.color || "#7777FF"},
|
|
21
21
|
{boundary: [6, 12, 6, 6], color: cfg.bottomColor || cfg.color || "#7777FF"}
|
|
22
22
|
];
|
|
@@ -53,8 +53,8 @@ function CubeTextureCanvas(viewer, navCubeScene, cfg = {}) {
|
|
|
53
53
|
const facesYUp = [
|
|
54
54
|
{boundary: [6, 6, 6, 6], color: cfg.frontColor || cfg.color || "#55FF55"},
|
|
55
55
|
{boundary: [18, 6, 6, 6], color: cfg.backColor || cfg.color || "#55FF55"},
|
|
56
|
-
{boundary: [12, 6, 6, 6], color: cfg.
|
|
57
|
-
{boundary: [0, 6, 6, 6], color: cfg.
|
|
56
|
+
{boundary: [12, 6, 6, 6], color: cfg.rightColor || cfg.color || "#FF5555"},
|
|
57
|
+
{boundary: [0, 6, 6, 6], color: cfg.leftColor || cfg.color || "#FF5555"},
|
|
58
58
|
{boundary: [6, 0, 6, 6], color: cfg.topColor || cfg.color || "#7777FF"},
|
|
59
59
|
{boundary: [6, 12, 6, 6], color: cfg.bottomColor || cfg.color || "#7777FF"}
|
|
60
60
|
];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export class MeshClusteringManager {
|
|
2
|
+
|
|
3
|
+
constructor(sceneModel) {
|
|
4
|
+
this.sceneModel = sceneModel;
|
|
5
|
+
this.meshes = [];
|
|
6
|
+
this.entities = [];
|
|
7
|
+
this.clusteredMeshes = [];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
addMeshCfg(meshCfg) {
|
|
11
|
+
this.meshes.push(meshCfg);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
addEntityCfg(entityCfg) {
|
|
15
|
+
this.entities.push(entityCfg);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
doClustering() {
|
|
19
|
+
this.clusteredMeshes = this.meshes;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
finalize() {
|
|
23
|
+
this.doClustering();
|
|
24
|
+
for (let i = 0, len = this.clusteredMeshes.length; i < len; i++) {
|
|
25
|
+
this.sceneModel.addMesh(this.clusteredMeshes[i]);
|
|
26
|
+
}
|
|
27
|
+
for (let i = 0, len = this.entities.length; i < len; i++) {
|
|
28
|
+
this.sceneModel.addEntity(this.entities[i]);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -371,7 +371,6 @@ export class TrianglesDataTextureSnapDepthBufInitRenderer {
|
|
|
371
371
|
src.push("float tmp = clipPos.w;")
|
|
372
372
|
src.push("clipPos.xyzw /= tmp;")
|
|
373
373
|
src.push("clipPos.xy = remapClipPos(clipPos.xy);");
|
|
374
|
-
src.push("clipPos.z += 0.0001;"); // small Z offset
|
|
375
374
|
src.push("clipPos.xyzw *= tmp;")
|
|
376
375
|
if (SNAPPING_LOG_DEPTH_BUF_ENABLED) {
|
|
377
376
|
src.push("vFragDepth = 1.0 + clipPos.w;");
|
|
@@ -429,7 +428,10 @@ export class TrianglesDataTextureSnapDepthBufInitRenderer {
|
|
|
429
428
|
src.push(" }");
|
|
430
429
|
}
|
|
431
430
|
if (SNAPPING_LOG_DEPTH_BUF_ENABLED) {
|
|
432
|
-
src.push("
|
|
431
|
+
src.push(" float dx = dFdx(vFragDepth);")
|
|
432
|
+
src.push(" float dy = dFdy(vFragDepth);")
|
|
433
|
+
src.push(" float diff = sqrt(dx*dx+dy*dy);");
|
|
434
|
+
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth + diff ) * logDepthBufFC * 0.5;");
|
|
433
435
|
}
|
|
434
436
|
src.push("outCoords = ivec4(relativeToOriginPosition.xyz * uCoordinateScaler.xyz, - uLayerNumber);")
|
|
435
437
|
src.push("}");
|
|
@@ -217,7 +217,6 @@ export class SnapBatchingDepthBufInitRenderer extends VBOSceneModelRenderer {
|
|
|
217
217
|
src.push("float tmp = clipPos.w;")
|
|
218
218
|
src.push("clipPos.xyzw /= tmp;")
|
|
219
219
|
src.push("clipPos.xy = remapClipPos(clipPos.xy);");
|
|
220
|
-
src.push("clipPos.z += 0.0001;"); // small Z offset
|
|
221
220
|
src.push("clipPos.xyzw *= tmp;")
|
|
222
221
|
if (SNAPPING_LOG_DEPTH_BUF_ENABLED) {
|
|
223
222
|
src.push("vFragDepth = 1.0 + clipPos.w;");
|
|
@@ -275,7 +274,10 @@ export class SnapBatchingDepthBufInitRenderer extends VBOSceneModelRenderer {
|
|
|
275
274
|
src.push(" }");
|
|
276
275
|
}
|
|
277
276
|
if (SNAPPING_LOG_DEPTH_BUF_ENABLED) {
|
|
278
|
-
src.push("
|
|
277
|
+
src.push(" float dx = dFdx(vFragDepth);")
|
|
278
|
+
src.push(" float dy = dFdy(vFragDepth);")
|
|
279
|
+
src.push(" float diff = sqrt(dx*dx+dy*dy);");
|
|
280
|
+
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth + diff ) * logDepthBufFC * 0.5;");
|
|
279
281
|
}
|
|
280
282
|
src.push("outCoords = ivec4(relativeToOriginPosition.xyz*coordinateScaler.xyz, -layerNumber);")
|
|
281
283
|
src.push("}");
|
|
@@ -249,7 +249,6 @@ class SnapInstancingDepthBufInitRenderer extends VBOSceneModelRenderer {
|
|
|
249
249
|
src.push("float tmp = clipPos.w;")
|
|
250
250
|
src.push("clipPos.xyzw /= tmp;")
|
|
251
251
|
src.push("clipPos.xy = remapClipPos(clipPos.xy);");
|
|
252
|
-
src.push("clipPos.z += 0.0001;"); // small Z offset
|
|
253
252
|
src.push("clipPos.xyzw *= tmp;")
|
|
254
253
|
if (SNAPPING_LOG_DEPTH_BUF_ENABLED) {
|
|
255
254
|
src.push("vFragDepth = 1.0 + clipPos.w;");
|
|
@@ -307,7 +306,10 @@ class SnapInstancingDepthBufInitRenderer extends VBOSceneModelRenderer {
|
|
|
307
306
|
src.push("}");
|
|
308
307
|
}
|
|
309
308
|
if (SNAPPING_LOG_DEPTH_BUF_ENABLED) {
|
|
310
|
-
src.push("
|
|
309
|
+
src.push(" float dx = dFdx(vFragDepth);")
|
|
310
|
+
src.push(" float dy = dFdy(vFragDepth);")
|
|
311
|
+
src.push(" float diff = sqrt(dx*dx+dy*dy);");
|
|
312
|
+
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth + diff ) * logDepthBufFC * 0.5;");
|
|
311
313
|
}
|
|
312
314
|
src.push("outCoords = ivec4(relativeToOriginPosition.xyz*coordinateScaler.xyz, -layerNumber);")
|
|
313
315
|
src.push("}");
|