@xeokit/xeokit-sdk 2.4.0-alpha-21 → 2.4.0-alpha-23
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 +63 -32
- package/dist/xeokit-sdk.es.js +63 -32
- package/dist/xeokit-sdk.es5.js +30 -21
- package/dist/xeokit-sdk.min.cjs.js +4 -4
- package/dist/xeokit-sdk.min.es.js +3 -3
- package/dist/xeokit-sdk.min.es5.js +3 -3
- package/package.json +1 -1
package/dist/xeokit-sdk.cjs.js
CHANGED
|
@@ -627,7 +627,7 @@ class ContextMenu {
|
|
|
627
627
|
}
|
|
628
628
|
|
|
629
629
|
_getNextId() { // Returns a unique ID
|
|
630
|
-
return "ContextMenu_" + this._id + "" + this._nextId++; // Start ID with alpha chars to make a valid DOM element selector
|
|
630
|
+
return "ContextMenu_" + this._id + "_" + this._nextId++; // Start ID with alpha chars to make a valid DOM element selector
|
|
631
631
|
}
|
|
632
632
|
|
|
633
633
|
_createUI() { // Builds DOM elements for the entire menu tree
|
|
@@ -9507,7 +9507,7 @@ class Wire {
|
|
|
9507
9507
|
wireClickableStyle['-o-transform'] = 'rotate(0deg)';
|
|
9508
9508
|
wireClickableStyle['transform'] = 'rotate(0deg)';
|
|
9509
9509
|
wireClickableStyle["opacity"] = 0.0;
|
|
9510
|
-
wireClickableStyle["pointer-events"] = "
|
|
9510
|
+
wireClickableStyle["pointer-events"] = "none";
|
|
9511
9511
|
if (cfg.onContextMenu) ;
|
|
9512
9512
|
|
|
9513
9513
|
parentElement.appendChild(wireClickable);
|
|
@@ -9617,8 +9617,12 @@ class Wire {
|
|
|
9617
9617
|
}
|
|
9618
9618
|
|
|
9619
9619
|
destroy(visible) {
|
|
9620
|
-
this._wire.parentElement
|
|
9621
|
-
|
|
9620
|
+
if (this._wire.parentElement) {
|
|
9621
|
+
this._wire.parentElement.removeChild(this._wire);
|
|
9622
|
+
}
|
|
9623
|
+
if (this._wireClickable.parentElement) {
|
|
9624
|
+
this._wireClickable.parentElement.removeChild(this._wireClickable);
|
|
9625
|
+
}
|
|
9622
9626
|
}
|
|
9623
9627
|
}
|
|
9624
9628
|
|
|
@@ -9753,8 +9757,12 @@ class Dot {
|
|
|
9753
9757
|
|
|
9754
9758
|
destroy() {
|
|
9755
9759
|
this.setVisible(false);
|
|
9756
|
-
this._dot.parentElement
|
|
9757
|
-
|
|
9760
|
+
if (this._dot.parentElement) {
|
|
9761
|
+
this._dot.parentElement.removeChild(this._dot);
|
|
9762
|
+
}
|
|
9763
|
+
if (this._dotClickable.parentElement) {
|
|
9764
|
+
this._dotClickable.parentElement.removeChild(this._dotClickable);
|
|
9765
|
+
}
|
|
9758
9766
|
}
|
|
9759
9767
|
}
|
|
9760
9768
|
|
|
@@ -9904,7 +9912,9 @@ class Label {
|
|
|
9904
9912
|
}
|
|
9905
9913
|
|
|
9906
9914
|
destroy() {
|
|
9907
|
-
this._label.parentElement
|
|
9915
|
+
if (this._label.parentElement) {
|
|
9916
|
+
this._label.parentElement.removeChild(this._label);
|
|
9917
|
+
}
|
|
9908
9918
|
}
|
|
9909
9919
|
}
|
|
9910
9920
|
|
|
@@ -9965,11 +9975,16 @@ class AngleMeasurement extends Component {
|
|
|
9965
9975
|
cfg.onContextMenu(event, this);
|
|
9966
9976
|
} : null;
|
|
9967
9977
|
|
|
9978
|
+
const onMouseWheel = (event) => {
|
|
9979
|
+
this.plugin.viewer.scene.canvas.canvas.dispatchEvent(new WheelEvent('wheel', event));
|
|
9980
|
+
};
|
|
9981
|
+
|
|
9968
9982
|
this._originDot = new Dot(this._container, {
|
|
9969
9983
|
fillColor: this._color,
|
|
9970
9984
|
zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined,
|
|
9971
9985
|
onMouseOver,
|
|
9972
9986
|
onMouseLeave,
|
|
9987
|
+
onMouseWheel,
|
|
9973
9988
|
onContextMenu
|
|
9974
9989
|
});
|
|
9975
9990
|
this._cornerDot = new Dot(this._container, {
|
|
@@ -9977,6 +9992,7 @@ class AngleMeasurement extends Component {
|
|
|
9977
9992
|
zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined,
|
|
9978
9993
|
onMouseOver,
|
|
9979
9994
|
onMouseLeave,
|
|
9995
|
+
onMouseWheel,
|
|
9980
9996
|
onContextMenu
|
|
9981
9997
|
});
|
|
9982
9998
|
this._targetDot = new Dot(this._container, {
|
|
@@ -9984,6 +10000,7 @@ class AngleMeasurement extends Component {
|
|
|
9984
10000
|
zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined,
|
|
9985
10001
|
onMouseOver,
|
|
9986
10002
|
onMouseLeave,
|
|
10003
|
+
onMouseWheel,
|
|
9987
10004
|
onContextMenu
|
|
9988
10005
|
});
|
|
9989
10006
|
|
|
@@ -9993,6 +10010,7 @@ class AngleMeasurement extends Component {
|
|
|
9993
10010
|
zIndex: plugin.zIndex,
|
|
9994
10011
|
onMouseOver,
|
|
9995
10012
|
onMouseLeave,
|
|
10013
|
+
onMouseWheel,
|
|
9996
10014
|
onContextMenu
|
|
9997
10015
|
});
|
|
9998
10016
|
this._targetWire = new Wire(this._container, {
|
|
@@ -10001,6 +10019,7 @@ class AngleMeasurement extends Component {
|
|
|
10001
10019
|
zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1: undefined,
|
|
10002
10020
|
onMouseOver,
|
|
10003
10021
|
onMouseLeave,
|
|
10022
|
+
onMouseWheel,
|
|
10004
10023
|
onContextMenu
|
|
10005
10024
|
});
|
|
10006
10025
|
|
|
@@ -10011,6 +10030,7 @@ class AngleMeasurement extends Component {
|
|
|
10011
10030
|
zIndex: plugin.zIndex + 2,
|
|
10012
10031
|
onMouseOver,
|
|
10013
10032
|
onMouseLeave,
|
|
10033
|
+
onMouseWheel,
|
|
10014
10034
|
onContextMenu
|
|
10015
10035
|
});
|
|
10016
10036
|
|
|
@@ -29676,7 +29696,7 @@ function attachFPSTracker (scene, cullingManager) {
|
|
|
29676
29696
|
|
|
29677
29697
|
// Apply LOD-culling before rendering the scene
|
|
29678
29698
|
scene.on("rendering", function () {
|
|
29679
|
-
if (currentFPS
|
|
29699
|
+
if (currentFPS === -1)
|
|
29680
29700
|
{
|
|
29681
29701
|
return;
|
|
29682
29702
|
}
|
|
@@ -29842,7 +29862,7 @@ function attachFPSTracker (scene, cullingManager) {
|
|
|
29842
29862
|
* @param {DataTextureSceneModel} model
|
|
29843
29863
|
*/
|
|
29844
29864
|
initializeLodState (model) {
|
|
29845
|
-
if (model._nodeList.length
|
|
29865
|
+
if (model._nodeList.length === 0)
|
|
29846
29866
|
{
|
|
29847
29867
|
return;
|
|
29848
29868
|
}
|
|
@@ -29911,11 +29931,11 @@ class LodCullingManager {
|
|
|
29911
29931
|
targetFps
|
|
29912
29932
|
);
|
|
29913
29933
|
|
|
29914
|
-
|
|
29934
|
+
// console.time ("initializeLodState");
|
|
29915
29935
|
|
|
29916
29936
|
this.lodState.initializeLodState (model);
|
|
29917
29937
|
|
|
29918
|
-
|
|
29938
|
+
// console.timeEnd ("initializeLodState");
|
|
29919
29939
|
|
|
29920
29940
|
attachFPSTracker (this.model.scene, this);
|
|
29921
29941
|
}
|
|
@@ -29929,7 +29949,7 @@ class LodCullingManager {
|
|
|
29929
29949
|
{
|
|
29930
29950
|
const lodState = this.lodState;
|
|
29931
29951
|
|
|
29932
|
-
if (lodState.lodLevelIndex
|
|
29952
|
+
if (lodState.lodLevelIndex === lodState.triangleLODLevels.length)
|
|
29933
29953
|
{
|
|
29934
29954
|
return false;
|
|
29935
29955
|
}
|
|
@@ -29955,7 +29975,7 @@ class LodCullingManager {
|
|
|
29955
29975
|
{
|
|
29956
29976
|
const lodState = this.lodState;
|
|
29957
29977
|
|
|
29958
|
-
if (lodState.lodLevelIndex
|
|
29978
|
+
if (lodState.lodLevelIndex === 0)
|
|
29959
29979
|
{
|
|
29960
29980
|
return false;
|
|
29961
29981
|
}
|
|
@@ -30008,9 +30028,9 @@ class LodCullingManager {
|
|
|
30008
30028
|
}
|
|
30009
30029
|
}
|
|
30010
30030
|
|
|
30011
|
-
if (retVal) {
|
|
30012
|
-
|
|
30013
|
-
}
|
|
30031
|
+
// if (retVal) {
|
|
30032
|
+
// console.log ("LOD level = " + lodState.lodLevelIndex);
|
|
30033
|
+
// }
|
|
30014
30034
|
|
|
30015
30035
|
return retVal;
|
|
30016
30036
|
}
|
|
@@ -30027,9 +30047,9 @@ class LodCullingManager {
|
|
|
30027
30047
|
retVal |= (decreasedLevel = this._decreaseLODLevelIndex());
|
|
30028
30048
|
} while (decreasedLevel);
|
|
30029
30049
|
|
|
30030
|
-
if (retVal) {
|
|
30031
|
-
|
|
30032
|
-
}
|
|
30050
|
+
// if (retVal) {
|
|
30051
|
+
// console.log ("LOD resetted");
|
|
30052
|
+
// }
|
|
30033
30053
|
|
|
30034
30054
|
return retVal;
|
|
30035
30055
|
}
|
|
@@ -32177,12 +32197,13 @@ class DataTextureSceneModel extends Component {
|
|
|
32177
32197
|
* @param {Boolean} [cfg.edges=false] Indicates if the DataTextureSceneModel's edges are initially emphasized.
|
|
32178
32198
|
* @param {Number[]} [cfg.colorize=[1.0,1.0,1.0]] DataTextureSceneModel's initial RGB colorize color, multiplies by the rendered fragment colors.
|
|
32179
32199
|
* @param {Number} [cfg.opacity=1.0] DataTextureSceneModel's initial opacity factor, multiplies by the rendered fragment alpha.
|
|
32180
|
-
* @param {Number} [cfg.backfaces=false] When we set this ````true````, then we force rendering of backfaces for this
|
|
32200
|
+
* @param {Number} [cfg.backfaces=false] When we set this ````true````, then we force rendering of backfaces for this DataTextureModel. When
|
|
32181
32201
|
* we leave this ````false````, then we allow the Viewer to decide when to render backfaces. In that case, the
|
|
32182
32202
|
* Viewer will hide backfaces on watertight meshes, show backfaces on open meshes, and always show backfaces on meshes when we slice them open with {@link SectionPlane}s.
|
|
32183
|
-
* @param {Boolean} [cfg.saoEnabled=true] Indicates if Scalable Ambient Obscurance (SAO) will apply to this
|
|
32184
|
-
* @param {Boolean} [cfg.pbrEnabled=false] Indicates if physically-based rendering (PBR) will apply to the dataTexturePerformanceModel. Only works when {@link Scene#pbrEnabled} is also ````true````.
|
|
32203
|
+
* @param {Boolean} [cfg.saoEnabled=true] Indicates if Scalable Ambient Obscurance (SAO) will apply to this DataTextureModel. SAO is configured by the Scene's {@link SAO} component.
|
|
32185
32204
|
* @param {Number} [cfg.edgeThreshold=10] When xraying, highlighting, selecting or edging, this is the threshold angle between normals of adjacent triangles, below which their shared wireframe edge is not drawn.
|
|
32205
|
+
* @param {Number} [cfg.targetLodFps] Optional target LoD FPS. When provided, will enable LoD culling for this DataTextureModel, with the given target FPS.
|
|
32206
|
+
* @param {Boolean} [cfg.enableViewFrustumCulling=false] When true, will enable view frustum culling for the objects within this DataTextureModel.
|
|
32186
32207
|
* @param {Boolean} [cfg.disableVertexWelding] Disable vertex welding when loading geometry into the GPU. Default is ```false```.
|
|
32187
32208
|
* @param {Boolean} [cfg.disableIndexRebucketing] Disable index rebucketing when loading geometry into the GPU. Default is ```false```.
|
|
32188
32209
|
*/
|
|
@@ -32366,7 +32387,7 @@ class DataTextureSceneModel extends Component {
|
|
|
32366
32387
|
|
|
32367
32388
|
this._saoEnabled = (cfg.saoEnabled !== false);
|
|
32368
32389
|
|
|
32369
|
-
this._pbrEnabled =
|
|
32390
|
+
this._pbrEnabled = false;
|
|
32370
32391
|
|
|
32371
32392
|
this._isModel = cfg.isModel;
|
|
32372
32393
|
if (this._isModel) {
|
|
@@ -32978,7 +32999,7 @@ class DataTextureSceneModel extends Component {
|
|
|
32978
32999
|
/**
|
|
32979
33000
|
* Gets if physically-based rendering (PBR) is enabled for this DataTextureSceneModel.
|
|
32980
33001
|
*
|
|
32981
|
-
*
|
|
33002
|
+
* This will always be ````false````.
|
|
32982
33003
|
*
|
|
32983
33004
|
* @type {Boolean}
|
|
32984
33005
|
*/
|
|
@@ -57665,10 +57686,17 @@ class Texture2D {
|
|
|
57665
57686
|
let generateMipMap = false;
|
|
57666
57687
|
|
|
57667
57688
|
gl.bindTexture(this.target, this.texture);
|
|
57689
|
+
|
|
57690
|
+
const bak1 = gl.getParameter(gl.UNPACK_FLIP_Y_WEBGL);
|
|
57668
57691
|
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, this.flipY);
|
|
57692
|
+
|
|
57693
|
+
const bak2 = gl.getParameter(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL);
|
|
57669
57694
|
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this.premultiplyAlpha);
|
|
57695
|
+
|
|
57696
|
+
const bak3 = gl.getParameter(gl.UNPACK_ALIGNMENT);
|
|
57670
57697
|
gl.pixelStorei(gl.UNPACK_ALIGNMENT, this.unpackAlignment);
|
|
57671
|
-
|
|
57698
|
+
|
|
57699
|
+
const bak4 = gl.getParameter(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL); gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);
|
|
57672
57700
|
|
|
57673
57701
|
const minFilter = convertConstant(gl, this.minFilter);
|
|
57674
57702
|
gl.texParameteri(this.target, gl.TEXTURE_MIN_FILTER, minFilter);
|
|
@@ -57723,6 +57751,11 @@ class Texture2D {
|
|
|
57723
57751
|
}
|
|
57724
57752
|
|
|
57725
57753
|
gl.bindTexture(this.target, null);
|
|
57754
|
+
|
|
57755
|
+
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, bak1);
|
|
57756
|
+
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, bak2);
|
|
57757
|
+
gl.pixelStorei(gl.UNPACK_ALIGNMENT, bak3);
|
|
57758
|
+
gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, bak4);
|
|
57726
57759
|
}
|
|
57727
57760
|
|
|
57728
57761
|
setCompressedData({mipmaps, props = {}}) {
|
|
@@ -83786,7 +83819,7 @@ class TrianglesInstancingLayer {
|
|
|
83786
83819
|
this._numPickableLayerPortions--;
|
|
83787
83820
|
this.model.numPickableLayerPortions--;
|
|
83788
83821
|
}
|
|
83789
|
-
this.
|
|
83822
|
+
this._setFlags(portionId, flags, meshTransparent);
|
|
83790
83823
|
}
|
|
83791
83824
|
|
|
83792
83825
|
setCulled(portionId, flags, meshTransparent) {
|
|
@@ -88792,6 +88825,7 @@ class PointsBatchingOcclusionRenderer {
|
|
|
88792
88825
|
const sectionPlanesState = scene._sectionPlanesState;
|
|
88793
88826
|
const clipping = sectionPlanesState.sectionPlanes.length > 0;
|
|
88794
88827
|
const src = [];
|
|
88828
|
+
src.push ('#version 300 es');
|
|
88795
88829
|
src.push("// Points batching occlusion fragment shader");
|
|
88796
88830
|
src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH");
|
|
88797
88831
|
src.push("precision highp float;");
|
|
@@ -99254,9 +99288,6 @@ class KeyboardPanRotateDollyHandler {
|
|
|
99254
99288
|
if (!(configs.active && configs.pointerEnabled) || (!scene.input.keyboardEnabled)) {
|
|
99255
99289
|
return;
|
|
99256
99290
|
}
|
|
99257
|
-
if (!states.mouseover) {
|
|
99258
|
-
return;
|
|
99259
|
-
}
|
|
99260
99291
|
keyDownMap[keyCode] = false;
|
|
99261
99292
|
|
|
99262
99293
|
if (keyCode === input.KEY_SHIFT) {
|
|
@@ -102591,7 +102622,7 @@ class MetaScene {
|
|
|
102591
102622
|
for (let i = 0, len = createObjectsParams.length; i < len; i++) {
|
|
102592
102623
|
const createObject = createObjectsParams[i];
|
|
102593
102624
|
const type = createObject.type;
|
|
102594
|
-
const objectId = createObject.id;
|
|
102625
|
+
const objectId = options.globalizeObjectIds ? math.globalizeObjectId(modelId, createObject.id) : createObject.id;
|
|
102595
102626
|
const originalSystemId = createObject.id;
|
|
102596
102627
|
const name = createObject.name;
|
|
102597
102628
|
const propertySets = [];
|
|
@@ -102625,13 +102656,13 @@ class MetaScene {
|
|
|
102625
102656
|
|
|
102626
102657
|
for (let i = 0, len = existingObjects.length; i < len; i++) {
|
|
102627
102658
|
const existingObject = existingObjects[i];
|
|
102628
|
-
const objectId = existingObject.id;
|
|
102659
|
+
const objectId = options.globalizeObjectIds ? math.globalizeObjectId(modelId, existingObject.id) : existingObject.id;
|
|
102629
102660
|
if ((existingObject._parentId === undefined || existingObject._parentId === null) && !existingObject.parent) {
|
|
102630
102661
|
metaModel.rootMetaObject = existingObject; // Deprecated, and won't work for federated models
|
|
102631
102662
|
metaModel.rootMetaObjects[objectId] = existingObject;
|
|
102632
102663
|
this.rootMetaObjects[objectId] = existingObject;
|
|
102633
102664
|
} else if (existingObject._parentId) {
|
|
102634
|
-
const parentId = existingObject._parentId;
|
|
102665
|
+
const parentId = options.globalizeObjectIds ? math.globalizeObjectId(modelId, existingObject._parentId) : existingObject._parentId;
|
|
102635
102666
|
existingObject._parentId = null;
|
|
102636
102667
|
let parentMetaObject = this.metaObjects[parentId];
|
|
102637
102668
|
if (parentMetaObject) {
|
package/dist/xeokit-sdk.es.js
CHANGED
|
@@ -623,7 +623,7 @@ class ContextMenu {
|
|
|
623
623
|
}
|
|
624
624
|
|
|
625
625
|
_getNextId() { // Returns a unique ID
|
|
626
|
-
return "ContextMenu_" + this._id + "" + this._nextId++; // Start ID with alpha chars to make a valid DOM element selector
|
|
626
|
+
return "ContextMenu_" + this._id + "_" + this._nextId++; // Start ID with alpha chars to make a valid DOM element selector
|
|
627
627
|
}
|
|
628
628
|
|
|
629
629
|
_createUI() { // Builds DOM elements for the entire menu tree
|
|
@@ -9503,7 +9503,7 @@ class Wire {
|
|
|
9503
9503
|
wireClickableStyle['-o-transform'] = 'rotate(0deg)';
|
|
9504
9504
|
wireClickableStyle['transform'] = 'rotate(0deg)';
|
|
9505
9505
|
wireClickableStyle["opacity"] = 0.0;
|
|
9506
|
-
wireClickableStyle["pointer-events"] = "
|
|
9506
|
+
wireClickableStyle["pointer-events"] = "none";
|
|
9507
9507
|
if (cfg.onContextMenu) ;
|
|
9508
9508
|
|
|
9509
9509
|
parentElement.appendChild(wireClickable);
|
|
@@ -9613,8 +9613,12 @@ class Wire {
|
|
|
9613
9613
|
}
|
|
9614
9614
|
|
|
9615
9615
|
destroy(visible) {
|
|
9616
|
-
this._wire.parentElement
|
|
9617
|
-
|
|
9616
|
+
if (this._wire.parentElement) {
|
|
9617
|
+
this._wire.parentElement.removeChild(this._wire);
|
|
9618
|
+
}
|
|
9619
|
+
if (this._wireClickable.parentElement) {
|
|
9620
|
+
this._wireClickable.parentElement.removeChild(this._wireClickable);
|
|
9621
|
+
}
|
|
9618
9622
|
}
|
|
9619
9623
|
}
|
|
9620
9624
|
|
|
@@ -9749,8 +9753,12 @@ class Dot {
|
|
|
9749
9753
|
|
|
9750
9754
|
destroy() {
|
|
9751
9755
|
this.setVisible(false);
|
|
9752
|
-
this._dot.parentElement
|
|
9753
|
-
|
|
9756
|
+
if (this._dot.parentElement) {
|
|
9757
|
+
this._dot.parentElement.removeChild(this._dot);
|
|
9758
|
+
}
|
|
9759
|
+
if (this._dotClickable.parentElement) {
|
|
9760
|
+
this._dotClickable.parentElement.removeChild(this._dotClickable);
|
|
9761
|
+
}
|
|
9754
9762
|
}
|
|
9755
9763
|
}
|
|
9756
9764
|
|
|
@@ -9900,7 +9908,9 @@ class Label {
|
|
|
9900
9908
|
}
|
|
9901
9909
|
|
|
9902
9910
|
destroy() {
|
|
9903
|
-
this._label.parentElement
|
|
9911
|
+
if (this._label.parentElement) {
|
|
9912
|
+
this._label.parentElement.removeChild(this._label);
|
|
9913
|
+
}
|
|
9904
9914
|
}
|
|
9905
9915
|
}
|
|
9906
9916
|
|
|
@@ -9961,11 +9971,16 @@ class AngleMeasurement extends Component {
|
|
|
9961
9971
|
cfg.onContextMenu(event, this);
|
|
9962
9972
|
} : null;
|
|
9963
9973
|
|
|
9974
|
+
const onMouseWheel = (event) => {
|
|
9975
|
+
this.plugin.viewer.scene.canvas.canvas.dispatchEvent(new WheelEvent('wheel', event));
|
|
9976
|
+
};
|
|
9977
|
+
|
|
9964
9978
|
this._originDot = new Dot(this._container, {
|
|
9965
9979
|
fillColor: this._color,
|
|
9966
9980
|
zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined,
|
|
9967
9981
|
onMouseOver,
|
|
9968
9982
|
onMouseLeave,
|
|
9983
|
+
onMouseWheel,
|
|
9969
9984
|
onContextMenu
|
|
9970
9985
|
});
|
|
9971
9986
|
this._cornerDot = new Dot(this._container, {
|
|
@@ -9973,6 +9988,7 @@ class AngleMeasurement extends Component {
|
|
|
9973
9988
|
zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined,
|
|
9974
9989
|
onMouseOver,
|
|
9975
9990
|
onMouseLeave,
|
|
9991
|
+
onMouseWheel,
|
|
9976
9992
|
onContextMenu
|
|
9977
9993
|
});
|
|
9978
9994
|
this._targetDot = new Dot(this._container, {
|
|
@@ -9980,6 +9996,7 @@ class AngleMeasurement extends Component {
|
|
|
9980
9996
|
zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined,
|
|
9981
9997
|
onMouseOver,
|
|
9982
9998
|
onMouseLeave,
|
|
9999
|
+
onMouseWheel,
|
|
9983
10000
|
onContextMenu
|
|
9984
10001
|
});
|
|
9985
10002
|
|
|
@@ -9989,6 +10006,7 @@ class AngleMeasurement extends Component {
|
|
|
9989
10006
|
zIndex: plugin.zIndex,
|
|
9990
10007
|
onMouseOver,
|
|
9991
10008
|
onMouseLeave,
|
|
10009
|
+
onMouseWheel,
|
|
9992
10010
|
onContextMenu
|
|
9993
10011
|
});
|
|
9994
10012
|
this._targetWire = new Wire(this._container, {
|
|
@@ -9997,6 +10015,7 @@ class AngleMeasurement extends Component {
|
|
|
9997
10015
|
zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1: undefined,
|
|
9998
10016
|
onMouseOver,
|
|
9999
10017
|
onMouseLeave,
|
|
10018
|
+
onMouseWheel,
|
|
10000
10019
|
onContextMenu
|
|
10001
10020
|
});
|
|
10002
10021
|
|
|
@@ -10007,6 +10026,7 @@ class AngleMeasurement extends Component {
|
|
|
10007
10026
|
zIndex: plugin.zIndex + 2,
|
|
10008
10027
|
onMouseOver,
|
|
10009
10028
|
onMouseLeave,
|
|
10029
|
+
onMouseWheel,
|
|
10010
10030
|
onContextMenu
|
|
10011
10031
|
});
|
|
10012
10032
|
|
|
@@ -29672,7 +29692,7 @@ function attachFPSTracker (scene, cullingManager) {
|
|
|
29672
29692
|
|
|
29673
29693
|
// Apply LOD-culling before rendering the scene
|
|
29674
29694
|
scene.on("rendering", function () {
|
|
29675
|
-
if (currentFPS
|
|
29695
|
+
if (currentFPS === -1)
|
|
29676
29696
|
{
|
|
29677
29697
|
return;
|
|
29678
29698
|
}
|
|
@@ -29838,7 +29858,7 @@ function attachFPSTracker (scene, cullingManager) {
|
|
|
29838
29858
|
* @param {DataTextureSceneModel} model
|
|
29839
29859
|
*/
|
|
29840
29860
|
initializeLodState (model) {
|
|
29841
|
-
if (model._nodeList.length
|
|
29861
|
+
if (model._nodeList.length === 0)
|
|
29842
29862
|
{
|
|
29843
29863
|
return;
|
|
29844
29864
|
}
|
|
@@ -29907,11 +29927,11 @@ class LodCullingManager {
|
|
|
29907
29927
|
targetFps
|
|
29908
29928
|
);
|
|
29909
29929
|
|
|
29910
|
-
|
|
29930
|
+
// console.time ("initializeLodState");
|
|
29911
29931
|
|
|
29912
29932
|
this.lodState.initializeLodState (model);
|
|
29913
29933
|
|
|
29914
|
-
|
|
29934
|
+
// console.timeEnd ("initializeLodState");
|
|
29915
29935
|
|
|
29916
29936
|
attachFPSTracker (this.model.scene, this);
|
|
29917
29937
|
}
|
|
@@ -29925,7 +29945,7 @@ class LodCullingManager {
|
|
|
29925
29945
|
{
|
|
29926
29946
|
const lodState = this.lodState;
|
|
29927
29947
|
|
|
29928
|
-
if (lodState.lodLevelIndex
|
|
29948
|
+
if (lodState.lodLevelIndex === lodState.triangleLODLevels.length)
|
|
29929
29949
|
{
|
|
29930
29950
|
return false;
|
|
29931
29951
|
}
|
|
@@ -29951,7 +29971,7 @@ class LodCullingManager {
|
|
|
29951
29971
|
{
|
|
29952
29972
|
const lodState = this.lodState;
|
|
29953
29973
|
|
|
29954
|
-
if (lodState.lodLevelIndex
|
|
29974
|
+
if (lodState.lodLevelIndex === 0)
|
|
29955
29975
|
{
|
|
29956
29976
|
return false;
|
|
29957
29977
|
}
|
|
@@ -30004,9 +30024,9 @@ class LodCullingManager {
|
|
|
30004
30024
|
}
|
|
30005
30025
|
}
|
|
30006
30026
|
|
|
30007
|
-
if (retVal) {
|
|
30008
|
-
|
|
30009
|
-
}
|
|
30027
|
+
// if (retVal) {
|
|
30028
|
+
// console.log ("LOD level = " + lodState.lodLevelIndex);
|
|
30029
|
+
// }
|
|
30010
30030
|
|
|
30011
30031
|
return retVal;
|
|
30012
30032
|
}
|
|
@@ -30023,9 +30043,9 @@ class LodCullingManager {
|
|
|
30023
30043
|
retVal |= (decreasedLevel = this._decreaseLODLevelIndex());
|
|
30024
30044
|
} while (decreasedLevel);
|
|
30025
30045
|
|
|
30026
|
-
if (retVal) {
|
|
30027
|
-
|
|
30028
|
-
}
|
|
30046
|
+
// if (retVal) {
|
|
30047
|
+
// console.log ("LOD resetted");
|
|
30048
|
+
// }
|
|
30029
30049
|
|
|
30030
30050
|
return retVal;
|
|
30031
30051
|
}
|
|
@@ -32173,12 +32193,13 @@ class DataTextureSceneModel extends Component {
|
|
|
32173
32193
|
* @param {Boolean} [cfg.edges=false] Indicates if the DataTextureSceneModel's edges are initially emphasized.
|
|
32174
32194
|
* @param {Number[]} [cfg.colorize=[1.0,1.0,1.0]] DataTextureSceneModel's initial RGB colorize color, multiplies by the rendered fragment colors.
|
|
32175
32195
|
* @param {Number} [cfg.opacity=1.0] DataTextureSceneModel's initial opacity factor, multiplies by the rendered fragment alpha.
|
|
32176
|
-
* @param {Number} [cfg.backfaces=false] When we set this ````true````, then we force rendering of backfaces for this
|
|
32196
|
+
* @param {Number} [cfg.backfaces=false] When we set this ````true````, then we force rendering of backfaces for this DataTextureModel. When
|
|
32177
32197
|
* we leave this ````false````, then we allow the Viewer to decide when to render backfaces. In that case, the
|
|
32178
32198
|
* Viewer will hide backfaces on watertight meshes, show backfaces on open meshes, and always show backfaces on meshes when we slice them open with {@link SectionPlane}s.
|
|
32179
|
-
* @param {Boolean} [cfg.saoEnabled=true] Indicates if Scalable Ambient Obscurance (SAO) will apply to this
|
|
32180
|
-
* @param {Boolean} [cfg.pbrEnabled=false] Indicates if physically-based rendering (PBR) will apply to the dataTexturePerformanceModel. Only works when {@link Scene#pbrEnabled} is also ````true````.
|
|
32199
|
+
* @param {Boolean} [cfg.saoEnabled=true] Indicates if Scalable Ambient Obscurance (SAO) will apply to this DataTextureModel. SAO is configured by the Scene's {@link SAO} component.
|
|
32181
32200
|
* @param {Number} [cfg.edgeThreshold=10] When xraying, highlighting, selecting or edging, this is the threshold angle between normals of adjacent triangles, below which their shared wireframe edge is not drawn.
|
|
32201
|
+
* @param {Number} [cfg.targetLodFps] Optional target LoD FPS. When provided, will enable LoD culling for this DataTextureModel, with the given target FPS.
|
|
32202
|
+
* @param {Boolean} [cfg.enableViewFrustumCulling=false] When true, will enable view frustum culling for the objects within this DataTextureModel.
|
|
32182
32203
|
* @param {Boolean} [cfg.disableVertexWelding] Disable vertex welding when loading geometry into the GPU. Default is ```false```.
|
|
32183
32204
|
* @param {Boolean} [cfg.disableIndexRebucketing] Disable index rebucketing when loading geometry into the GPU. Default is ```false```.
|
|
32184
32205
|
*/
|
|
@@ -32362,7 +32383,7 @@ class DataTextureSceneModel extends Component {
|
|
|
32362
32383
|
|
|
32363
32384
|
this._saoEnabled = (cfg.saoEnabled !== false);
|
|
32364
32385
|
|
|
32365
|
-
this._pbrEnabled =
|
|
32386
|
+
this._pbrEnabled = false;
|
|
32366
32387
|
|
|
32367
32388
|
this._isModel = cfg.isModel;
|
|
32368
32389
|
if (this._isModel) {
|
|
@@ -32974,7 +32995,7 @@ class DataTextureSceneModel extends Component {
|
|
|
32974
32995
|
/**
|
|
32975
32996
|
* Gets if physically-based rendering (PBR) is enabled for this DataTextureSceneModel.
|
|
32976
32997
|
*
|
|
32977
|
-
*
|
|
32998
|
+
* This will always be ````false````.
|
|
32978
32999
|
*
|
|
32979
33000
|
* @type {Boolean}
|
|
32980
33001
|
*/
|
|
@@ -57661,10 +57682,17 @@ class Texture2D {
|
|
|
57661
57682
|
let generateMipMap = false;
|
|
57662
57683
|
|
|
57663
57684
|
gl.bindTexture(this.target, this.texture);
|
|
57685
|
+
|
|
57686
|
+
const bak1 = gl.getParameter(gl.UNPACK_FLIP_Y_WEBGL);
|
|
57664
57687
|
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, this.flipY);
|
|
57688
|
+
|
|
57689
|
+
const bak2 = gl.getParameter(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL);
|
|
57665
57690
|
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this.premultiplyAlpha);
|
|
57691
|
+
|
|
57692
|
+
const bak3 = gl.getParameter(gl.UNPACK_ALIGNMENT);
|
|
57666
57693
|
gl.pixelStorei(gl.UNPACK_ALIGNMENT, this.unpackAlignment);
|
|
57667
|
-
|
|
57694
|
+
|
|
57695
|
+
const bak4 = gl.getParameter(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL); gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);
|
|
57668
57696
|
|
|
57669
57697
|
const minFilter = convertConstant(gl, this.minFilter);
|
|
57670
57698
|
gl.texParameteri(this.target, gl.TEXTURE_MIN_FILTER, minFilter);
|
|
@@ -57719,6 +57747,11 @@ class Texture2D {
|
|
|
57719
57747
|
}
|
|
57720
57748
|
|
|
57721
57749
|
gl.bindTexture(this.target, null);
|
|
57750
|
+
|
|
57751
|
+
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, bak1);
|
|
57752
|
+
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, bak2);
|
|
57753
|
+
gl.pixelStorei(gl.UNPACK_ALIGNMENT, bak3);
|
|
57754
|
+
gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, bak4);
|
|
57722
57755
|
}
|
|
57723
57756
|
|
|
57724
57757
|
setCompressedData({mipmaps, props = {}}) {
|
|
@@ -83782,7 +83815,7 @@ class TrianglesInstancingLayer {
|
|
|
83782
83815
|
this._numPickableLayerPortions--;
|
|
83783
83816
|
this.model.numPickableLayerPortions--;
|
|
83784
83817
|
}
|
|
83785
|
-
this.
|
|
83818
|
+
this._setFlags(portionId, flags, meshTransparent);
|
|
83786
83819
|
}
|
|
83787
83820
|
|
|
83788
83821
|
setCulled(portionId, flags, meshTransparent) {
|
|
@@ -88788,6 +88821,7 @@ class PointsBatchingOcclusionRenderer {
|
|
|
88788
88821
|
const sectionPlanesState = scene._sectionPlanesState;
|
|
88789
88822
|
const clipping = sectionPlanesState.sectionPlanes.length > 0;
|
|
88790
88823
|
const src = [];
|
|
88824
|
+
src.push ('#version 300 es');
|
|
88791
88825
|
src.push("// Points batching occlusion fragment shader");
|
|
88792
88826
|
src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH");
|
|
88793
88827
|
src.push("precision highp float;");
|
|
@@ -99250,9 +99284,6 @@ class KeyboardPanRotateDollyHandler {
|
|
|
99250
99284
|
if (!(configs.active && configs.pointerEnabled) || (!scene.input.keyboardEnabled)) {
|
|
99251
99285
|
return;
|
|
99252
99286
|
}
|
|
99253
|
-
if (!states.mouseover) {
|
|
99254
|
-
return;
|
|
99255
|
-
}
|
|
99256
99287
|
keyDownMap[keyCode] = false;
|
|
99257
99288
|
|
|
99258
99289
|
if (keyCode === input.KEY_SHIFT) {
|
|
@@ -102587,7 +102618,7 @@ class MetaScene {
|
|
|
102587
102618
|
for (let i = 0, len = createObjectsParams.length; i < len; i++) {
|
|
102588
102619
|
const createObject = createObjectsParams[i];
|
|
102589
102620
|
const type = createObject.type;
|
|
102590
|
-
const objectId = createObject.id;
|
|
102621
|
+
const objectId = options.globalizeObjectIds ? math.globalizeObjectId(modelId, createObject.id) : createObject.id;
|
|
102591
102622
|
const originalSystemId = createObject.id;
|
|
102592
102623
|
const name = createObject.name;
|
|
102593
102624
|
const propertySets = [];
|
|
@@ -102621,13 +102652,13 @@ class MetaScene {
|
|
|
102621
102652
|
|
|
102622
102653
|
for (let i = 0, len = existingObjects.length; i < len; i++) {
|
|
102623
102654
|
const existingObject = existingObjects[i];
|
|
102624
|
-
const objectId = existingObject.id;
|
|
102655
|
+
const objectId = options.globalizeObjectIds ? math.globalizeObjectId(modelId, existingObject.id) : existingObject.id;
|
|
102625
102656
|
if ((existingObject._parentId === undefined || existingObject._parentId === null) && !existingObject.parent) {
|
|
102626
102657
|
metaModel.rootMetaObject = existingObject; // Deprecated, and won't work for federated models
|
|
102627
102658
|
metaModel.rootMetaObjects[objectId] = existingObject;
|
|
102628
102659
|
this.rootMetaObjects[objectId] = existingObject;
|
|
102629
102660
|
} else if (existingObject._parentId) {
|
|
102630
|
-
const parentId = existingObject._parentId;
|
|
102661
|
+
const parentId = options.globalizeObjectIds ? math.globalizeObjectId(modelId, existingObject._parentId) : existingObject._parentId;
|
|
102631
102662
|
existingObject._parentId = null;
|
|
102632
102663
|
let parentMetaObject = this.metaObjects[parentId];
|
|
102633
102664
|
if (parentMetaObject) {
|