@xeokit/xeokit-sdk 2.2.4 → 2.2.5-beta-2
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 +77 -40
- package/dist/xeokit-sdk.es.js +77 -40
- package/dist/xeokit-sdk.min.cjs.js +1 -1
- package/dist/xeokit-sdk.min.es.js +1 -1
- package/package.json +4 -2
- package/types/extras/ContextMenu/ContextMenu.d.ts +125 -0
- package/types/extras/ContextMenu/index.d.ts +1 -0
- package/types/extras/index.d.ts +1 -0
- package/types/index.d.ts +3 -0
- package/types/plugins/AngleMeasurementsPlugin/AngleMeasurement.d.ts +144 -0
- package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsControl.d.ts +42 -0
- package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsPlugin.d.ts +85 -0
- package/types/plugins/AngleMeasurementsPlugin/index.d.ts +1 -0
- package/types/plugins/AnnotationsPlugin/Annotation.d.ts +134 -0
- package/types/plugins/AnnotationsPlugin/AnnotationsPlugin.d.ts +117 -0
- package/types/plugins/AnnotationsPlugin/index.d.ts +1 -0
- package/types/plugins/AxisGizmoPlugin/AxisGizmoPlugin.d.ts +28 -0
- package/types/plugins/AxisGizmoPlugin/index.d.ts +1 -0
- package/types/plugins/BCFViewpointsPlugin/BCFViewpointsPlugin.d.ts +146 -0
- package/types/plugins/BCFViewpointsPlugin/index.d.ts +1 -0
- package/types/plugins/CityJSONLoaderPlugin/CityJSONLoaderPlugin.d.ts +81 -0
- package/types/plugins/CityJSONLoaderPlugin/index.d.ts +1 -0
- package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.d.ts +137 -0
- package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsControl.d.ts +40 -0
- package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsPlugin.d.ts +120 -0
- package/types/plugins/DistanceMeasurementsPlugin/index.d.ts +1 -0
- package/types/plugins/FastNavPlugin/FastNavPlugin.d.ts +203 -0
- package/types/plugins/FastNavPlugin/index.d.ts +1 -0
- package/types/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.d.ts +140 -0
- package/types/plugins/GLTFLoaderPlugin/index.d.ts +1 -0
- package/types/plugins/LASLoaderPlugin/LASLoaderPlugin.d.ts +146 -0
- package/types/plugins/LASLoaderPlugin/index.d.ts +1 -0
- package/types/plugins/NavCubePlugin/NavCubePlugin.d.ts +160 -0
- package/types/plugins/NavCubePlugin/index.d.ts +1 -0
- package/types/plugins/OBJLoaderPlugin/OBJLoaderPlugin.d.ts +44 -0
- package/types/plugins/OBJLoaderPlugin/index.d.ts +1 -0
- package/types/plugins/STLLoaderPlugin/STLLoaderPlugin.d.ts +88 -0
- package/types/plugins/STLLoaderPlugin/index.d.ts +2 -0
- package/types/plugins/SectionPlanesPlugin/SectionPlanesPlugin.d.ts +103 -0
- package/types/plugins/SectionPlanesPlugin/index.d.ts +1 -0
- package/types/plugins/SkyboxesPlugin/SkyboxesPlugin.d.ts +34 -0
- package/types/plugins/SkyboxesPlugin/index.d.ts +1 -0
- package/types/plugins/StoreyViewsPlugin/Storey.d.ts +47 -0
- package/types/plugins/StoreyViewsPlugin/StoreyMap.d.ts +41 -0
- package/types/plugins/StoreyViewsPlugin/StoreyViewsPlugin.d.ts +173 -0
- package/types/plugins/StoreyViewsPlugin/index.d.ts +1 -0
- package/types/plugins/TreeViewPlugin/ModelTreeView.d.ts +24 -0
- package/types/plugins/TreeViewPlugin/TreeViewNode.d.ts +66 -0
- package/types/plugins/TreeViewPlugin/TreeViewPlugin.d.ts +136 -0
- package/types/plugins/TreeViewPlugin/index.d.ts +1 -0
- package/types/plugins/ViewCullPlugin/ViewCullPlugin.d.ts +34 -0
- package/types/plugins/ViewCullPlugin/index.d.ts +1 -0
- package/types/plugins/WebIFCLoaderPlugin/WebIFCLoaderPlugin.d.ts +230 -0
- package/types/plugins/WebIFCLoaderPlugin/index.d.ts +1 -0
- package/types/plugins/XKTLoaderPlugin/XKTLoaderPlugin.d.ts +277 -0
- package/types/plugins/XKTLoaderPlugin/index.d.ts +1 -0
- package/types/plugins/XML3DLoaderPlugin/XML3DLoaderPlugin.d.ts +65 -0
- package/types/plugins/XML3DLoaderPlugin/index.d.ts +1 -0
- package/types/plugins/index.d.ts +34 -0
- package/types/viewer/Configs.d.ts +20 -0
- package/types/viewer/Plugin.d.ts +69 -0
- package/types/viewer/Viewer.d.ts +212 -0
- package/types/viewer/index.d.ts +6 -0
- package/types/viewer/localization/LocaleService.d.ts +176 -0
- package/types/viewer/metadata/IFCObjectDefaults.d.ts +9 -0
- package/types/viewer/metadata/MetaModel.d.ts +65 -0
- package/types/viewer/metadata/MetaObject.d.ts +74 -0
- package/types/viewer/metadata/MetaScene.d.ts +135 -0
- package/types/viewer/metadata/Property.d.ts +29 -0
- package/types/viewer/metadata/PropertySet.d.ts +31 -0
- package/types/viewer/metadata/index.d.ts +6 -0
- package/types/viewer/scene/CameraControl/CameraControl.d.ts +591 -0
- package/types/viewer/scene/Component.d.ts +155 -0
- package/types/viewer/scene/Entity.d.ts +394 -0
- package/types/viewer/scene/PerformanceModel/PerformanceModel.d.ts +605 -0
- package/types/viewer/scene/PerformanceModel/PerformanceNode.d.ts +302 -0
- package/types/viewer/scene/camera/Camera.d.ts +364 -0
- package/types/viewer/scene/camera/CameraFlightAnimation.d.ts +167 -0
- package/types/viewer/scene/camera/CameraPath.d.ts +28 -0
- package/types/viewer/scene/camera/CameraPathAnimation.d.ts +95 -0
- package/types/viewer/scene/camera/CustomProjection.d.ts +57 -0
- package/types/viewer/scene/camera/Frustum.d.ts +166 -0
- package/types/viewer/scene/camera/Ortho.d.ts +115 -0
- package/types/viewer/scene/camera/Perspective.d.ts +136 -0
- package/types/viewer/scene/camera/index.d.ts +4 -0
- package/types/viewer/scene/geometry/Geometry.d.ts +7 -0
- package/types/viewer/scene/geometry/ReadableGeometry.d.ts +95 -0
- package/types/viewer/scene/geometry/index.d.ts +1 -0
- package/types/viewer/scene/index.d.ts +6 -0
- package/types/viewer/scene/marker/Marker.d.ts +136 -0
- package/types/viewer/scene/marker/index.d.ts +1 -0
- package/types/viewer/scene/materials/EdgeMaterial.d.ts +83 -0
- package/types/viewer/scene/materials/EmphasisMaterial.d.ts +241 -0
- package/types/viewer/scene/materials/Fresnel.d.ts +149 -0
- package/types/viewer/scene/materials/LinesMaterial.d.ts +71 -0
- package/types/viewer/scene/materials/Material.d.ts +3 -0
- package/types/viewer/scene/materials/PhongMaterial.d.ts +468 -0
- package/types/viewer/scene/materials/PointsMaterial.d.ts +206 -0
- package/types/viewer/scene/materials/Texture.d.ts +261 -0
- package/types/viewer/scene/materials/index.d.ts +5 -0
- package/types/viewer/scene/math/math.d.ts +36 -0
- package/types/viewer/scene/postfx/SAO.d.ts +209 -0
- package/types/viewer/scene/scene/Scene.d.ts +727 -0
- package/types/viewer/scene/sectionPlane/SectionPlane.d.ts +93 -0
- package/types/viewer/scene/sectionPlane/index.d.ts +1 -0
- package/types/viewer/scene/viewport/Viewport.d.ts +23 -0
- package/types/viewer/scene/webgl/PickResult.d.ts +103 -0
package/dist/xeokit-sdk.cjs.js
CHANGED
|
@@ -15962,7 +15962,9 @@ const Renderer = function (scene, options) {
|
|
|
15962
15962
|
|
|
15963
15963
|
if (highlightedFillOpaqueBinLen > 0 || highlightedEdgesOpaqueBinLen > 0) {
|
|
15964
15964
|
frameCtx.lastProgramId = null;
|
|
15965
|
-
|
|
15965
|
+
if ( scene.highlightMaterial.glowThrough) {
|
|
15966
|
+
gl.clear(gl.DEPTH_BUFFER_BIT);
|
|
15967
|
+
}
|
|
15966
15968
|
if (highlightedEdgesOpaqueBinLen > 0) {
|
|
15967
15969
|
for (i = 0; i < highlightedEdgesOpaqueBinLen; i++) {
|
|
15968
15970
|
highlightedEdgesOpaqueBin[i].drawEdgesHighlighted(frameCtx);
|
|
@@ -15977,17 +15979,17 @@ const Renderer = function (scene, options) {
|
|
|
15977
15979
|
|
|
15978
15980
|
if (highlightedFillTransparentBinLen > 0 || highlightedEdgesTransparentBinLen > 0 || highlightedFillOpaqueBinLen > 0) {
|
|
15979
15981
|
frameCtx.lastProgramId = null;
|
|
15980
|
-
|
|
15981
|
-
|
|
15982
|
+
if (scene.selectedMaterial.glowThrough) {
|
|
15983
|
+
gl.clear(gl.DEPTH_BUFFER_BIT);
|
|
15984
|
+
}
|
|
15982
15985
|
gl.enable(gl.BLEND);
|
|
15983
|
-
|
|
15984
15986
|
if (canvasTransparent) {
|
|
15985
15987
|
gl.blendEquation(gl.FUNC_ADD);
|
|
15986
15988
|
gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
|
|
15987
15989
|
} else {
|
|
15988
15990
|
gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
|
|
15989
15991
|
}
|
|
15990
|
-
|
|
15992
|
+
gl.enable(gl.CULL_FACE);
|
|
15991
15993
|
if (highlightedEdgesTransparentBinLen > 0) {
|
|
15992
15994
|
for (i = 0; i < highlightedEdgesTransparentBinLen; i++) {
|
|
15993
15995
|
highlightedEdgesTransparentBin[i].drawEdgesHighlighted(frameCtx);
|
|
@@ -16003,7 +16005,9 @@ const Renderer = function (scene, options) {
|
|
|
16003
16005
|
|
|
16004
16006
|
if (selectedFillOpaqueBinLen > 0 || selectedEdgesOpaqueBinLen > 0) {
|
|
16005
16007
|
frameCtx.lastProgramId = null;
|
|
16006
|
-
|
|
16008
|
+
if (scene.selectedMaterial.glowThrough) {
|
|
16009
|
+
gl.clear(gl.DEPTH_BUFFER_BIT);
|
|
16010
|
+
}
|
|
16007
16011
|
if (selectedEdgesOpaqueBinLen > 0) {
|
|
16008
16012
|
for (i = 0; i < selectedEdgesOpaqueBinLen; i++) {
|
|
16009
16013
|
selectedEdgesOpaqueBin[i].drawEdgesSelected(frameCtx);
|
|
@@ -16018,10 +16022,11 @@ const Renderer = function (scene, options) {
|
|
|
16018
16022
|
|
|
16019
16023
|
if (selectedFillTransparentBinLen > 0 || selectedEdgesTransparentBinLen > 0) {
|
|
16020
16024
|
frameCtx.lastProgramId = null;
|
|
16021
|
-
|
|
16025
|
+
if (scene.selectedMaterial.glowThrough) {
|
|
16026
|
+
gl.clear(gl.DEPTH_BUFFER_BIT);
|
|
16027
|
+
}
|
|
16022
16028
|
gl.enable(gl.CULL_FACE);
|
|
16023
16029
|
gl.enable(gl.BLEND);
|
|
16024
|
-
|
|
16025
16030
|
if (canvasTransparent) {
|
|
16026
16031
|
gl.blendEquation(gl.FUNC_ADD);
|
|
16027
16032
|
gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
|
|
@@ -23166,6 +23171,7 @@ class EmphasisMaterial extends Material {
|
|
|
23166
23171
|
* @param {Number} [cfg.edgeWidth=1] Width of xray edges, in pixels.
|
|
23167
23172
|
* @param {String} [cfg.preset] Selects a preset EmphasisMaterial configuration - see {@link EmphasisMaterial#presets}.
|
|
23168
23173
|
* @param {Boolean} [cfg.backfaces=false] Whether to render geometry backfaces when emphasising.
|
|
23174
|
+
* @param {Boolean} [cfg.glowThrough=true] Whether to make the emphasized object appear to float on top of other objects, as if it were "glowing through" them.
|
|
23169
23175
|
*/
|
|
23170
23176
|
constructor(owner, cfg = {}) {
|
|
23171
23177
|
|
|
@@ -23180,7 +23186,8 @@ class EmphasisMaterial extends Material {
|
|
|
23180
23186
|
edgeColor: null,
|
|
23181
23187
|
edgeAlpha: null,
|
|
23182
23188
|
edgeWidth: null,
|
|
23183
|
-
backfaces: true
|
|
23189
|
+
backfaces: true,
|
|
23190
|
+
glowThrough: true
|
|
23184
23191
|
});
|
|
23185
23192
|
|
|
23186
23193
|
this._preset = "default";
|
|
@@ -23211,6 +23218,9 @@ class EmphasisMaterial extends Material {
|
|
|
23211
23218
|
if (cfg.backfaces !== undefined) {
|
|
23212
23219
|
this.backfaces = cfg.backfaces;
|
|
23213
23220
|
}
|
|
23221
|
+
if (cfg.glowThrough !== undefined) {
|
|
23222
|
+
this.glowThrough = cfg.glowThrough;
|
|
23223
|
+
}
|
|
23214
23224
|
} else {
|
|
23215
23225
|
this.fill = cfg.fill;
|
|
23216
23226
|
this.fillColor = cfg.fillColor;
|
|
@@ -23220,6 +23230,7 @@ class EmphasisMaterial extends Material {
|
|
|
23220
23230
|
this.edgeAlpha = cfg.edgeAlpha;
|
|
23221
23231
|
this.edgeWidth = cfg.edgeWidth;
|
|
23222
23232
|
this.backfaces = cfg.backfaces;
|
|
23233
|
+
this.glowThrough = cfg.glowThrough;
|
|
23223
23234
|
}
|
|
23224
23235
|
}
|
|
23225
23236
|
|
|
@@ -23441,7 +23452,7 @@ class EmphasisMaterial extends Material {
|
|
|
23441
23452
|
}
|
|
23442
23453
|
|
|
23443
23454
|
/**
|
|
23444
|
-
* Sets whether to render backfaces when {@link EmphasisMaterial#fill} is ````true
|
|
23455
|
+
* Sets whether to render backfaces when {@link EmphasisMaterial#fill} is ````true````.
|
|
23445
23456
|
*
|
|
23446
23457
|
* Default is ````false````.
|
|
23447
23458
|
*
|
|
@@ -23457,9 +23468,9 @@ class EmphasisMaterial extends Material {
|
|
|
23457
23468
|
}
|
|
23458
23469
|
|
|
23459
23470
|
/**
|
|
23460
|
-
* Gets whether to render backfaces when {@link EmphasisMaterial#fill} is ````true
|
|
23471
|
+
* Gets whether to render backfaces when {@link EmphasisMaterial#fill} is ````true````.
|
|
23461
23472
|
*
|
|
23462
|
-
* Default is ````
|
|
23473
|
+
* Default is ````true````.
|
|
23463
23474
|
*
|
|
23464
23475
|
* @type {Boolean}
|
|
23465
23476
|
*/
|
|
@@ -23467,6 +23478,35 @@ class EmphasisMaterial extends Material {
|
|
|
23467
23478
|
return this._state.backfaces;
|
|
23468
23479
|
}
|
|
23469
23480
|
|
|
23481
|
+
/**
|
|
23482
|
+
* Sets whether to render emphasized objects over the top of other objects, as if they were "glowing through".
|
|
23483
|
+
*
|
|
23484
|
+
* Default is ````true````.
|
|
23485
|
+
*
|
|
23486
|
+
* Note: updating this property will not affect the appearance of objects that are already emphasized.
|
|
23487
|
+
*
|
|
23488
|
+
* @type {Boolean}
|
|
23489
|
+
*/
|
|
23490
|
+
set glowThrough(value) {
|
|
23491
|
+
value = (value !== false);
|
|
23492
|
+
if (this._state.glowThrough === value) {
|
|
23493
|
+
return;
|
|
23494
|
+
}
|
|
23495
|
+
this._state.glowThrough = value;
|
|
23496
|
+
this.glRedraw();
|
|
23497
|
+
}
|
|
23498
|
+
|
|
23499
|
+
/**
|
|
23500
|
+
* Sets whether to render emphasized objects over the top of other objects, as if they were "glowing through".
|
|
23501
|
+
*
|
|
23502
|
+
* Default is ````true````.
|
|
23503
|
+
*
|
|
23504
|
+
* @type {Boolean}
|
|
23505
|
+
*/
|
|
23506
|
+
get glowThrough() {
|
|
23507
|
+
return this._state.glowThrough;
|
|
23508
|
+
}
|
|
23509
|
+
|
|
23470
23510
|
/**
|
|
23471
23511
|
* Selects a preset EmphasisMaterial configuration.
|
|
23472
23512
|
*
|
|
@@ -23491,6 +23531,7 @@ class EmphasisMaterial extends Material {
|
|
|
23491
23531
|
this.edgeColor = preset.edgeColor;
|
|
23492
23532
|
this.edgeAlpha = preset.edgeAlpha;
|
|
23493
23533
|
this.edgeWidth = preset.edgeWidth;
|
|
23534
|
+
this.glowThrough = preset.glowThrough;
|
|
23494
23535
|
this._preset = value;
|
|
23495
23536
|
}
|
|
23496
23537
|
|
|
@@ -27412,7 +27453,7 @@ class Scene extends Component {
|
|
|
27412
27453
|
* @returns {Boolean} True if any {@link Entity}s were updated, else false if all updates were redundant and not applied.
|
|
27413
27454
|
*/
|
|
27414
27455
|
setObjectsCulled(ids, culled) {
|
|
27415
|
-
return this.withObjects(ids,
|
|
27456
|
+
return this.withObjects(ids, entity => {
|
|
27416
27457
|
const changed = (entity.culled !== culled);
|
|
27417
27458
|
entity.culled = culled;
|
|
27418
27459
|
return changed;
|
|
@@ -46531,7 +46572,7 @@ class TrianglesBatchingLayer {
|
|
|
46531
46572
|
// Color
|
|
46532
46573
|
|
|
46533
46574
|
let f0;
|
|
46534
|
-
if (!visible || culled || xrayed) { // Highlight & select are layered on top of color - not mutually exclusive
|
|
46575
|
+
if (!visible || culled || xrayed || (highlighted && !this.model.scene.highlightMaterial.glowThrough) || (selected && !this.model.scene.selectedMaterial.glowThrough)) { // Highlight & select are layered on top of color - not mutually exclusive
|
|
46535
46576
|
f0 = RENDER_PASSES.NOT_RENDERED;
|
|
46536
46577
|
} else {
|
|
46537
46578
|
if (transparent) {
|
|
@@ -53648,7 +53689,7 @@ class TrianglesInstancingLayer {
|
|
|
53648
53689
|
// Normal fill
|
|
53649
53690
|
|
|
53650
53691
|
let f0;
|
|
53651
|
-
if (!visible || culled || xrayed) { // Highlight & select are layered on top of color - not mutually exclusive
|
|
53692
|
+
if (!visible || culled || xrayed || (highlighted && !this.model.scene.highlightMaterial.glowThrough) || (selected && !this.model.scene.selectedMaterial.glowThrough)) { // Highlight & select are layered on top of color - not mutually exclusive
|
|
53652
53693
|
f0 = RENDER_PASSES.NOT_RENDERED;
|
|
53653
53694
|
} else {
|
|
53654
53695
|
if (meshTransparent) {
|
|
@@ -55398,7 +55439,7 @@ class LinesBatchingLayer {
|
|
|
55398
55439
|
// Color
|
|
55399
55440
|
|
|
55400
55441
|
let f0;
|
|
55401
|
-
if (!visible || culled || xrayed) {
|
|
55442
|
+
if (!visible || culled || xrayed || (highlighted && !this.model.scene.highlightMaterial.glowThrough) || (selected && !this.model.scene.selectedMaterial.glowThrough)) { // Highlight & select are layered on top of color - not mutually exclusive
|
|
55402
55443
|
f0 = RENDER_PASSES.NOT_RENDERED;
|
|
55403
55444
|
} else {
|
|
55404
55445
|
if (transparent) {
|
|
@@ -56865,7 +56906,7 @@ class LinesInstancingLayer {
|
|
|
56865
56906
|
// Normal fill
|
|
56866
56907
|
|
|
56867
56908
|
let f0;
|
|
56868
|
-
if (!visible || culled || xrayed) {
|
|
56909
|
+
if (!visible || culled || xrayed || (highlighted && !this.model.scene.highlightMaterial.glowThrough) || (selected && !this.model.scene.selectedMaterial.glowThrough)) { // Highlight & select are layered on top of color - not mutually exclusive
|
|
56869
56910
|
f0 = RENDER_PASSES.NOT_RENDERED;
|
|
56870
56911
|
} else {
|
|
56871
56912
|
if (meshTransparent) {
|
|
@@ -59431,7 +59472,7 @@ class PointsBatchingLayer {
|
|
|
59431
59472
|
// Normal fill
|
|
59432
59473
|
|
|
59433
59474
|
let f0;
|
|
59434
|
-
if (!visible || culled || xrayed) {
|
|
59475
|
+
if (!visible || culled || xrayed || (highlighted && !this.model.scene.highlightMaterial.glowThrough) || (selected && !this.model.scene.selectedMaterial.glowThrough)) { // Highlight & select are layered on top of color - not mutually exclusive
|
|
59435
59476
|
f0 = RENDER_PASSES.NOT_RENDERED;
|
|
59436
59477
|
} else {
|
|
59437
59478
|
if (transparent) {
|
|
@@ -62824,7 +62865,7 @@ class PointsInstancingLayer {
|
|
|
62824
62865
|
// Normal fill
|
|
62825
62866
|
|
|
62826
62867
|
let f0;
|
|
62827
|
-
if (!visible || culled || xrayed) {
|
|
62868
|
+
if (!visible || culled || xrayed || (highlighted && !this.model.scene.highlightMaterial.glowThrough) || (selected && !this.model.scene.selectedMaterial.glowThrough)) { // Highlight & select are layered on top of color - not mutually exclusive
|
|
62828
62869
|
f0 = RENDER_PASSES.NOT_RENDERED;
|
|
62829
62870
|
} else {
|
|
62830
62871
|
if (meshTransparent) {
|
|
@@ -65078,41 +65119,37 @@ class PerformanceModel extends Component {
|
|
|
65078
65119
|
|
|
65079
65120
|
let needNewBatchingLayers = false;
|
|
65080
65121
|
|
|
65081
|
-
|
|
65122
|
+
const origin = math.vec3(this._origin);
|
|
65123
|
+
|
|
65124
|
+
const cfgOrigin = cfg.origin || cfg.rtcCenter;
|
|
65125
|
+
if (cfgOrigin) {
|
|
65126
|
+
math.addVec3(origin, cfgOrigin, origin);
|
|
65127
|
+
}
|
|
65082
65128
|
|
|
65129
|
+
let rtcOrigin = null;
|
|
65083
65130
|
if (!cfg.positionsDecodeMatrix) { // TODO: Assumes we never quantize double-precision coordinates
|
|
65084
65131
|
const rtcCenter = math.vec3();
|
|
65085
65132
|
const rtcPositions = [];
|
|
65086
65133
|
const rtcNeeded = worldToRTCPositions(positions, rtcPositions, rtcCenter);
|
|
65087
65134
|
if (rtcNeeded) {
|
|
65088
65135
|
positions = rtcPositions;
|
|
65089
|
-
|
|
65136
|
+
rtcOrigin = rtcCenter;
|
|
65090
65137
|
}
|
|
65091
65138
|
}
|
|
65092
|
-
|
|
65093
|
-
|
|
65094
|
-
if (cfgOrigin) {
|
|
65095
|
-
if (!origin) {
|
|
65096
|
-
origin = cfgOrigin;
|
|
65097
|
-
} else {
|
|
65098
|
-
origin = math.addVec3(this._origin, cfgOrigin, tempVec3a$9);
|
|
65099
|
-
}
|
|
65100
|
-
} else {
|
|
65101
|
-
origin = this._origin;
|
|
65139
|
+
if (rtcOrigin) {
|
|
65140
|
+
math.addVec3(origin, rtcOrigin, origin);
|
|
65102
65141
|
}
|
|
65103
65142
|
|
|
65104
|
-
if (
|
|
65105
|
-
|
|
65143
|
+
if (!this._lastOrigin) {
|
|
65144
|
+
needNewBatchingLayers = true;
|
|
65145
|
+
this._lastOrigin = math.vec3(origin);
|
|
65146
|
+
} else {
|
|
65147
|
+
if (!math.compareVec3(this._lastOrigin, origin)) {
|
|
65106
65148
|
needNewBatchingLayers = true;
|
|
65107
|
-
this._lastOrigin
|
|
65108
|
-
} else {
|
|
65109
|
-
if (!math.compareVec3(this._lastOrigin, origin)) {
|
|
65110
|
-
needNewBatchingLayers = true;
|
|
65111
|
-
this._lastOrigin.set(origin);
|
|
65112
|
-
}
|
|
65149
|
+
this._lastOrigin.set(origin);
|
|
65113
65150
|
}
|
|
65114
65151
|
}
|
|
65115
|
-
|
|
65152
|
+
|
|
65116
65153
|
if (cfg.positionsDecodeMatrix) {
|
|
65117
65154
|
if (!this._lastDecodeMatrix) {
|
|
65118
65155
|
needNewBatchingLayers = true;
|
package/dist/xeokit-sdk.es.js
CHANGED
|
@@ -15958,7 +15958,9 @@ const Renderer = function (scene, options) {
|
|
|
15958
15958
|
|
|
15959
15959
|
if (highlightedFillOpaqueBinLen > 0 || highlightedEdgesOpaqueBinLen > 0) {
|
|
15960
15960
|
frameCtx.lastProgramId = null;
|
|
15961
|
-
|
|
15961
|
+
if ( scene.highlightMaterial.glowThrough) {
|
|
15962
|
+
gl.clear(gl.DEPTH_BUFFER_BIT);
|
|
15963
|
+
}
|
|
15962
15964
|
if (highlightedEdgesOpaqueBinLen > 0) {
|
|
15963
15965
|
for (i = 0; i < highlightedEdgesOpaqueBinLen; i++) {
|
|
15964
15966
|
highlightedEdgesOpaqueBin[i].drawEdgesHighlighted(frameCtx);
|
|
@@ -15973,17 +15975,17 @@ const Renderer = function (scene, options) {
|
|
|
15973
15975
|
|
|
15974
15976
|
if (highlightedFillTransparentBinLen > 0 || highlightedEdgesTransparentBinLen > 0 || highlightedFillOpaqueBinLen > 0) {
|
|
15975
15977
|
frameCtx.lastProgramId = null;
|
|
15976
|
-
|
|
15977
|
-
|
|
15978
|
+
if (scene.selectedMaterial.glowThrough) {
|
|
15979
|
+
gl.clear(gl.DEPTH_BUFFER_BIT);
|
|
15980
|
+
}
|
|
15978
15981
|
gl.enable(gl.BLEND);
|
|
15979
|
-
|
|
15980
15982
|
if (canvasTransparent) {
|
|
15981
15983
|
gl.blendEquation(gl.FUNC_ADD);
|
|
15982
15984
|
gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
|
|
15983
15985
|
} else {
|
|
15984
15986
|
gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
|
|
15985
15987
|
}
|
|
15986
|
-
|
|
15988
|
+
gl.enable(gl.CULL_FACE);
|
|
15987
15989
|
if (highlightedEdgesTransparentBinLen > 0) {
|
|
15988
15990
|
for (i = 0; i < highlightedEdgesTransparentBinLen; i++) {
|
|
15989
15991
|
highlightedEdgesTransparentBin[i].drawEdgesHighlighted(frameCtx);
|
|
@@ -15999,7 +16001,9 @@ const Renderer = function (scene, options) {
|
|
|
15999
16001
|
|
|
16000
16002
|
if (selectedFillOpaqueBinLen > 0 || selectedEdgesOpaqueBinLen > 0) {
|
|
16001
16003
|
frameCtx.lastProgramId = null;
|
|
16002
|
-
|
|
16004
|
+
if (scene.selectedMaterial.glowThrough) {
|
|
16005
|
+
gl.clear(gl.DEPTH_BUFFER_BIT);
|
|
16006
|
+
}
|
|
16003
16007
|
if (selectedEdgesOpaqueBinLen > 0) {
|
|
16004
16008
|
for (i = 0; i < selectedEdgesOpaqueBinLen; i++) {
|
|
16005
16009
|
selectedEdgesOpaqueBin[i].drawEdgesSelected(frameCtx);
|
|
@@ -16014,10 +16018,11 @@ const Renderer = function (scene, options) {
|
|
|
16014
16018
|
|
|
16015
16019
|
if (selectedFillTransparentBinLen > 0 || selectedEdgesTransparentBinLen > 0) {
|
|
16016
16020
|
frameCtx.lastProgramId = null;
|
|
16017
|
-
|
|
16021
|
+
if (scene.selectedMaterial.glowThrough) {
|
|
16022
|
+
gl.clear(gl.DEPTH_BUFFER_BIT);
|
|
16023
|
+
}
|
|
16018
16024
|
gl.enable(gl.CULL_FACE);
|
|
16019
16025
|
gl.enable(gl.BLEND);
|
|
16020
|
-
|
|
16021
16026
|
if (canvasTransparent) {
|
|
16022
16027
|
gl.blendEquation(gl.FUNC_ADD);
|
|
16023
16028
|
gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
|
|
@@ -23162,6 +23167,7 @@ class EmphasisMaterial extends Material {
|
|
|
23162
23167
|
* @param {Number} [cfg.edgeWidth=1] Width of xray edges, in pixels.
|
|
23163
23168
|
* @param {String} [cfg.preset] Selects a preset EmphasisMaterial configuration - see {@link EmphasisMaterial#presets}.
|
|
23164
23169
|
* @param {Boolean} [cfg.backfaces=false] Whether to render geometry backfaces when emphasising.
|
|
23170
|
+
* @param {Boolean} [cfg.glowThrough=true] Whether to make the emphasized object appear to float on top of other objects, as if it were "glowing through" them.
|
|
23165
23171
|
*/
|
|
23166
23172
|
constructor(owner, cfg = {}) {
|
|
23167
23173
|
|
|
@@ -23176,7 +23182,8 @@ class EmphasisMaterial extends Material {
|
|
|
23176
23182
|
edgeColor: null,
|
|
23177
23183
|
edgeAlpha: null,
|
|
23178
23184
|
edgeWidth: null,
|
|
23179
|
-
backfaces: true
|
|
23185
|
+
backfaces: true,
|
|
23186
|
+
glowThrough: true
|
|
23180
23187
|
});
|
|
23181
23188
|
|
|
23182
23189
|
this._preset = "default";
|
|
@@ -23207,6 +23214,9 @@ class EmphasisMaterial extends Material {
|
|
|
23207
23214
|
if (cfg.backfaces !== undefined) {
|
|
23208
23215
|
this.backfaces = cfg.backfaces;
|
|
23209
23216
|
}
|
|
23217
|
+
if (cfg.glowThrough !== undefined) {
|
|
23218
|
+
this.glowThrough = cfg.glowThrough;
|
|
23219
|
+
}
|
|
23210
23220
|
} else {
|
|
23211
23221
|
this.fill = cfg.fill;
|
|
23212
23222
|
this.fillColor = cfg.fillColor;
|
|
@@ -23216,6 +23226,7 @@ class EmphasisMaterial extends Material {
|
|
|
23216
23226
|
this.edgeAlpha = cfg.edgeAlpha;
|
|
23217
23227
|
this.edgeWidth = cfg.edgeWidth;
|
|
23218
23228
|
this.backfaces = cfg.backfaces;
|
|
23229
|
+
this.glowThrough = cfg.glowThrough;
|
|
23219
23230
|
}
|
|
23220
23231
|
}
|
|
23221
23232
|
|
|
@@ -23437,7 +23448,7 @@ class EmphasisMaterial extends Material {
|
|
|
23437
23448
|
}
|
|
23438
23449
|
|
|
23439
23450
|
/**
|
|
23440
|
-
* Sets whether to render backfaces when {@link EmphasisMaterial#fill} is ````true
|
|
23451
|
+
* Sets whether to render backfaces when {@link EmphasisMaterial#fill} is ````true````.
|
|
23441
23452
|
*
|
|
23442
23453
|
* Default is ````false````.
|
|
23443
23454
|
*
|
|
@@ -23453,9 +23464,9 @@ class EmphasisMaterial extends Material {
|
|
|
23453
23464
|
}
|
|
23454
23465
|
|
|
23455
23466
|
/**
|
|
23456
|
-
* Gets whether to render backfaces when {@link EmphasisMaterial#fill} is ````true
|
|
23467
|
+
* Gets whether to render backfaces when {@link EmphasisMaterial#fill} is ````true````.
|
|
23457
23468
|
*
|
|
23458
|
-
* Default is ````
|
|
23469
|
+
* Default is ````true````.
|
|
23459
23470
|
*
|
|
23460
23471
|
* @type {Boolean}
|
|
23461
23472
|
*/
|
|
@@ -23463,6 +23474,35 @@ class EmphasisMaterial extends Material {
|
|
|
23463
23474
|
return this._state.backfaces;
|
|
23464
23475
|
}
|
|
23465
23476
|
|
|
23477
|
+
/**
|
|
23478
|
+
* Sets whether to render emphasized objects over the top of other objects, as if they were "glowing through".
|
|
23479
|
+
*
|
|
23480
|
+
* Default is ````true````.
|
|
23481
|
+
*
|
|
23482
|
+
* Note: updating this property will not affect the appearance of objects that are already emphasized.
|
|
23483
|
+
*
|
|
23484
|
+
* @type {Boolean}
|
|
23485
|
+
*/
|
|
23486
|
+
set glowThrough(value) {
|
|
23487
|
+
value = (value !== false);
|
|
23488
|
+
if (this._state.glowThrough === value) {
|
|
23489
|
+
return;
|
|
23490
|
+
}
|
|
23491
|
+
this._state.glowThrough = value;
|
|
23492
|
+
this.glRedraw();
|
|
23493
|
+
}
|
|
23494
|
+
|
|
23495
|
+
/**
|
|
23496
|
+
* Sets whether to render emphasized objects over the top of other objects, as if they were "glowing through".
|
|
23497
|
+
*
|
|
23498
|
+
* Default is ````true````.
|
|
23499
|
+
*
|
|
23500
|
+
* @type {Boolean}
|
|
23501
|
+
*/
|
|
23502
|
+
get glowThrough() {
|
|
23503
|
+
return this._state.glowThrough;
|
|
23504
|
+
}
|
|
23505
|
+
|
|
23466
23506
|
/**
|
|
23467
23507
|
* Selects a preset EmphasisMaterial configuration.
|
|
23468
23508
|
*
|
|
@@ -23487,6 +23527,7 @@ class EmphasisMaterial extends Material {
|
|
|
23487
23527
|
this.edgeColor = preset.edgeColor;
|
|
23488
23528
|
this.edgeAlpha = preset.edgeAlpha;
|
|
23489
23529
|
this.edgeWidth = preset.edgeWidth;
|
|
23530
|
+
this.glowThrough = preset.glowThrough;
|
|
23490
23531
|
this._preset = value;
|
|
23491
23532
|
}
|
|
23492
23533
|
|
|
@@ -27408,7 +27449,7 @@ class Scene extends Component {
|
|
|
27408
27449
|
* @returns {Boolean} True if any {@link Entity}s were updated, else false if all updates were redundant and not applied.
|
|
27409
27450
|
*/
|
|
27410
27451
|
setObjectsCulled(ids, culled) {
|
|
27411
|
-
return this.withObjects(ids,
|
|
27452
|
+
return this.withObjects(ids, entity => {
|
|
27412
27453
|
const changed = (entity.culled !== culled);
|
|
27413
27454
|
entity.culled = culled;
|
|
27414
27455
|
return changed;
|
|
@@ -46527,7 +46568,7 @@ class TrianglesBatchingLayer {
|
|
|
46527
46568
|
// Color
|
|
46528
46569
|
|
|
46529
46570
|
let f0;
|
|
46530
|
-
if (!visible || culled || xrayed) { // Highlight & select are layered on top of color - not mutually exclusive
|
|
46571
|
+
if (!visible || culled || xrayed || (highlighted && !this.model.scene.highlightMaterial.glowThrough) || (selected && !this.model.scene.selectedMaterial.glowThrough)) { // Highlight & select are layered on top of color - not mutually exclusive
|
|
46531
46572
|
f0 = RENDER_PASSES.NOT_RENDERED;
|
|
46532
46573
|
} else {
|
|
46533
46574
|
if (transparent) {
|
|
@@ -53644,7 +53685,7 @@ class TrianglesInstancingLayer {
|
|
|
53644
53685
|
// Normal fill
|
|
53645
53686
|
|
|
53646
53687
|
let f0;
|
|
53647
|
-
if (!visible || culled || xrayed) { // Highlight & select are layered on top of color - not mutually exclusive
|
|
53688
|
+
if (!visible || culled || xrayed || (highlighted && !this.model.scene.highlightMaterial.glowThrough) || (selected && !this.model.scene.selectedMaterial.glowThrough)) { // Highlight & select are layered on top of color - not mutually exclusive
|
|
53648
53689
|
f0 = RENDER_PASSES.NOT_RENDERED;
|
|
53649
53690
|
} else {
|
|
53650
53691
|
if (meshTransparent) {
|
|
@@ -55394,7 +55435,7 @@ class LinesBatchingLayer {
|
|
|
55394
55435
|
// Color
|
|
55395
55436
|
|
|
55396
55437
|
let f0;
|
|
55397
|
-
if (!visible || culled || xrayed) {
|
|
55438
|
+
if (!visible || culled || xrayed || (highlighted && !this.model.scene.highlightMaterial.glowThrough) || (selected && !this.model.scene.selectedMaterial.glowThrough)) { // Highlight & select are layered on top of color - not mutually exclusive
|
|
55398
55439
|
f0 = RENDER_PASSES.NOT_RENDERED;
|
|
55399
55440
|
} else {
|
|
55400
55441
|
if (transparent) {
|
|
@@ -56861,7 +56902,7 @@ class LinesInstancingLayer {
|
|
|
56861
56902
|
// Normal fill
|
|
56862
56903
|
|
|
56863
56904
|
let f0;
|
|
56864
|
-
if (!visible || culled || xrayed) {
|
|
56905
|
+
if (!visible || culled || xrayed || (highlighted && !this.model.scene.highlightMaterial.glowThrough) || (selected && !this.model.scene.selectedMaterial.glowThrough)) { // Highlight & select are layered on top of color - not mutually exclusive
|
|
56865
56906
|
f0 = RENDER_PASSES.NOT_RENDERED;
|
|
56866
56907
|
} else {
|
|
56867
56908
|
if (meshTransparent) {
|
|
@@ -59427,7 +59468,7 @@ class PointsBatchingLayer {
|
|
|
59427
59468
|
// Normal fill
|
|
59428
59469
|
|
|
59429
59470
|
let f0;
|
|
59430
|
-
if (!visible || culled || xrayed) {
|
|
59471
|
+
if (!visible || culled || xrayed || (highlighted && !this.model.scene.highlightMaterial.glowThrough) || (selected && !this.model.scene.selectedMaterial.glowThrough)) { // Highlight & select are layered on top of color - not mutually exclusive
|
|
59431
59472
|
f0 = RENDER_PASSES.NOT_RENDERED;
|
|
59432
59473
|
} else {
|
|
59433
59474
|
if (transparent) {
|
|
@@ -62820,7 +62861,7 @@ class PointsInstancingLayer {
|
|
|
62820
62861
|
// Normal fill
|
|
62821
62862
|
|
|
62822
62863
|
let f0;
|
|
62823
|
-
if (!visible || culled || xrayed) {
|
|
62864
|
+
if (!visible || culled || xrayed || (highlighted && !this.model.scene.highlightMaterial.glowThrough) || (selected && !this.model.scene.selectedMaterial.glowThrough)) { // Highlight & select are layered on top of color - not mutually exclusive
|
|
62824
62865
|
f0 = RENDER_PASSES.NOT_RENDERED;
|
|
62825
62866
|
} else {
|
|
62826
62867
|
if (meshTransparent) {
|
|
@@ -65074,41 +65115,37 @@ class PerformanceModel extends Component {
|
|
|
65074
65115
|
|
|
65075
65116
|
let needNewBatchingLayers = false;
|
|
65076
65117
|
|
|
65077
|
-
|
|
65118
|
+
const origin = math.vec3(this._origin);
|
|
65119
|
+
|
|
65120
|
+
const cfgOrigin = cfg.origin || cfg.rtcCenter;
|
|
65121
|
+
if (cfgOrigin) {
|
|
65122
|
+
math.addVec3(origin, cfgOrigin, origin);
|
|
65123
|
+
}
|
|
65078
65124
|
|
|
65125
|
+
let rtcOrigin = null;
|
|
65079
65126
|
if (!cfg.positionsDecodeMatrix) { // TODO: Assumes we never quantize double-precision coordinates
|
|
65080
65127
|
const rtcCenter = math.vec3();
|
|
65081
65128
|
const rtcPositions = [];
|
|
65082
65129
|
const rtcNeeded = worldToRTCPositions(positions, rtcPositions, rtcCenter);
|
|
65083
65130
|
if (rtcNeeded) {
|
|
65084
65131
|
positions = rtcPositions;
|
|
65085
|
-
|
|
65132
|
+
rtcOrigin = rtcCenter;
|
|
65086
65133
|
}
|
|
65087
65134
|
}
|
|
65088
|
-
|
|
65089
|
-
|
|
65090
|
-
if (cfgOrigin) {
|
|
65091
|
-
if (!origin) {
|
|
65092
|
-
origin = cfgOrigin;
|
|
65093
|
-
} else {
|
|
65094
|
-
origin = math.addVec3(this._origin, cfgOrigin, tempVec3a$9);
|
|
65095
|
-
}
|
|
65096
|
-
} else {
|
|
65097
|
-
origin = this._origin;
|
|
65135
|
+
if (rtcOrigin) {
|
|
65136
|
+
math.addVec3(origin, rtcOrigin, origin);
|
|
65098
65137
|
}
|
|
65099
65138
|
|
|
65100
|
-
if (
|
|
65101
|
-
|
|
65139
|
+
if (!this._lastOrigin) {
|
|
65140
|
+
needNewBatchingLayers = true;
|
|
65141
|
+
this._lastOrigin = math.vec3(origin);
|
|
65142
|
+
} else {
|
|
65143
|
+
if (!math.compareVec3(this._lastOrigin, origin)) {
|
|
65102
65144
|
needNewBatchingLayers = true;
|
|
65103
|
-
this._lastOrigin
|
|
65104
|
-
} else {
|
|
65105
|
-
if (!math.compareVec3(this._lastOrigin, origin)) {
|
|
65106
|
-
needNewBatchingLayers = true;
|
|
65107
|
-
this._lastOrigin.set(origin);
|
|
65108
|
-
}
|
|
65145
|
+
this._lastOrigin.set(origin);
|
|
65109
65146
|
}
|
|
65110
65147
|
}
|
|
65111
|
-
|
|
65148
|
+
|
|
65112
65149
|
if (cfg.positionsDecodeMatrix) {
|
|
65113
65150
|
if (!this._lastDecodeMatrix) {
|
|
65114
65151
|
needNewBatchingLayers = true;
|