@xeokit/xeokit-sdk 2.6.0-beta-7 → 2.6.0-beta-9
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/web-ifc.wasm +0 -0
- package/dist/xeokit-sdk.cjs.js +40 -4
- package/dist/xeokit-sdk.es.js +40 -4
- package/dist/xeokit-sdk.es5.js +24 -5
- package/dist/xeokit-sdk.min.cjs.js +3 -3
- package/dist/xeokit-sdk.min.es.js +2 -2
- package/dist/xeokit-sdk.min.es5.js +2 -2
- package/package.json +1 -1
- package/src/plugins/FastNavPlugin/FastNavPlugin.js +34 -3
- package/src/viewer/scene/CameraControl/lib/CameraUpdater.js +4 -1
- package/src/viewer/scene/model/dtx/triangles/DTXTrianglesLayer.js +3 -1
package/dist/web-ifc.wasm
CHANGED
|
Binary file
|
package/dist/xeokit-sdk.cjs.js
CHANGED
|
@@ -77176,7 +77176,9 @@ class DTXTrianglesLayer {
|
|
|
77176
77176
|
// Color
|
|
77177
77177
|
|
|
77178
77178
|
let f0;
|
|
77179
|
-
if (!visible || culled || xrayed
|
|
77179
|
+
if (!visible || culled || xrayed
|
|
77180
|
+
|| (highlighted && !this.model.scene.highlightMaterial.glowThrough)
|
|
77181
|
+
|| (selected && !this.model.scene.selectedMaterial.glowThrough)) {
|
|
77180
77182
|
f0 = RENDER_PASSES.NOT_RENDERED;
|
|
77181
77183
|
} else {
|
|
77182
77184
|
if (transparent) {
|
|
@@ -86763,6 +86765,7 @@ class DistanceMeasurementsPlugin extends Plugin {
|
|
|
86763
86765
|
* hidePBR: true, // No physically-based rendering while we interact (default is true)
|
|
86764
86766
|
* hideTransparentObjects: true, // Hide transparent objects while we interact (default is false)
|
|
86765
86767
|
* scaleCanvasResolution: true, // Scale canvas resolution while we interact (default is false)
|
|
86768
|
+
* defaultScaleCanvasResolutionFactor: 1.0, // Factor by which we scale canvas resolution when we stop interacting (default is 1.0)
|
|
86766
86769
|
* scaleCanvasResolutionFactor: 0.5, // Factor by which we scale canvas resolution when we interact (default is 0.6)
|
|
86767
86770
|
* delayBeforeRestore: true, // When we stop interacting, delay before restoring normal render (default is true)
|
|
86768
86771
|
* delayBeforeRestoreSeconds: 0.5 // The delay duration, in seconds (default is 0.5)
|
|
@@ -86795,6 +86798,7 @@ class FastNavPlugin extends Plugin {
|
|
|
86795
86798
|
* @param {Boolean} [cfg.hideEdges=true] Whether to temporarily hide edges whenever we interact with the Viewer.
|
|
86796
86799
|
* @param {Boolean} [cfg.hideTransparentObjects=false] Whether to temporarily hide transparent objects whenever we interact with the Viewer.
|
|
86797
86800
|
* @param {Number} [cfg.scaleCanvasResolution=false] Whether to temporarily down-scale the canvas resolution whenever we interact with the Viewer.
|
|
86801
|
+
* @param {Number} [cfg.defaultScaleCanvasResolutionFactor=0.6] The factor by which we downscale the canvas resolution whenever we stop interacting with the Viewer.
|
|
86798
86802
|
* @param {Number} [cfg.scaleCanvasResolutionFactor=0.6] The factor by which we downscale the canvas resolution whenever we interact with the Viewer.
|
|
86799
86803
|
* @param {Boolean} [cfg.delayBeforeRestore=true] Whether to temporarily have a delay before restoring normal rendering after we stop interacting with the Viewer.
|
|
86800
86804
|
* @param {Number} [cfg.delayBeforeRestoreSeconds=0.5] Delay in seconds before restoring normal rendering after we stop interacting with the Viewer.
|
|
@@ -86809,6 +86813,7 @@ class FastNavPlugin extends Plugin {
|
|
|
86809
86813
|
this._hideEdges = cfg.hideEdges !== false;
|
|
86810
86814
|
this._hideTransparentObjects = !!cfg.hideTransparentObjects;
|
|
86811
86815
|
this._scaleCanvasResolution = !!cfg.scaleCanvasResolution;
|
|
86816
|
+
this._defaultScaleCanvasResolutionFactor = cfg.defaultScaleCanvasResolutionFactor || 1.0;
|
|
86812
86817
|
this._scaleCanvasResolutionFactor = cfg.scaleCanvasResolutionFactor || 0.6;
|
|
86813
86818
|
this._delayBeforeRestore = (cfg.delayBeforeRestore !== false);
|
|
86814
86819
|
this._delayBeforeRestoreSeconds = cfg.delayBeforeRestoreSeconds || 0.5;
|
|
@@ -86827,14 +86832,14 @@ class FastNavPlugin extends Plugin {
|
|
|
86827
86832
|
if (this._scaleCanvasResolution) {
|
|
86828
86833
|
viewer.scene.canvas.resolutionScale = this._scaleCanvasResolutionFactor;
|
|
86829
86834
|
} else {
|
|
86830
|
-
viewer.scene.canvas.resolutionScale =
|
|
86835
|
+
viewer.scene.canvas.resolutionScale = this._defaultScaleCanvasResolutionFactor;
|
|
86831
86836
|
}
|
|
86832
86837
|
fastMode = true;
|
|
86833
86838
|
}
|
|
86834
86839
|
};
|
|
86835
86840
|
|
|
86836
86841
|
const switchToHighQuality = () => {
|
|
86837
|
-
viewer.scene.canvas.resolutionScale =
|
|
86842
|
+
viewer.scene.canvas.resolutionScale = this._defaultScaleCanvasResolutionFactor;
|
|
86838
86843
|
viewer.scene._renderer.setEdgesEnabled(true);
|
|
86839
86844
|
viewer.scene._renderer.setColorTextureEnabled(true);
|
|
86840
86845
|
viewer.scene._renderer.setPBREnabled(true);
|
|
@@ -87002,7 +87007,7 @@ class FastNavPlugin extends Plugin {
|
|
|
87002
87007
|
}
|
|
87003
87008
|
|
|
87004
87009
|
/**
|
|
87005
|
-
* Sets
|
|
87010
|
+
* Sets the factor to which we restore the canvas resolution scale when we stop interacting with the viewer.
|
|
87006
87011
|
*
|
|
87007
87012
|
* Default is ````false````.
|
|
87008
87013
|
*
|
|
@@ -87014,6 +87019,34 @@ class FastNavPlugin extends Plugin {
|
|
|
87014
87019
|
this._scaleCanvasResolution = scaleCanvasResolution;
|
|
87015
87020
|
}
|
|
87016
87021
|
|
|
87022
|
+
/**
|
|
87023
|
+
* Gets the factor to which we restore the canvas resolution scale when we stop interacting with the viewer.
|
|
87024
|
+
*
|
|
87025
|
+
* Default is ````1.0````.
|
|
87026
|
+
*
|
|
87027
|
+
* Enable canvas resolution scaling by setting {@link FastNavPlugin#scaleCanvasResolution} ````true````.
|
|
87028
|
+
*
|
|
87029
|
+
* @return {Number} Factor by scale canvas resolution when we stop interacting with the viewer.
|
|
87030
|
+
*/
|
|
87031
|
+
get defaultScaleCanvasResolutionFactor() {
|
|
87032
|
+
return this._defaultScaleCanvasResolutionFactor;
|
|
87033
|
+
}
|
|
87034
|
+
|
|
87035
|
+
/**
|
|
87036
|
+
* Sets the factor to which we restore the canvas resolution scale when we stop interacting with the viewer.
|
|
87037
|
+
*
|
|
87038
|
+
* Accepted range is ````[0.0 .. 1.0]````.
|
|
87039
|
+
*
|
|
87040
|
+
* Default is ````1.0````.
|
|
87041
|
+
*
|
|
87042
|
+
* Enable canvas resolution scaling by setting {@link FastNavPlugin#scaleCanvasResolution} ````true````.
|
|
87043
|
+
*
|
|
87044
|
+
* @param {Number} defaultScaleCanvasResolutionFactor Factor by scale canvas resolution when we stop interacting with the viewer.
|
|
87045
|
+
*/
|
|
87046
|
+
set defaultScaleCanvasResolutionFactor(defaultScaleCanvasResolutionFactor) {
|
|
87047
|
+
this._defaultScaleCanvasResolutionFactor = defaultScaleCanvasResolutionFactor || 1.0;
|
|
87048
|
+
}
|
|
87049
|
+
|
|
87017
87050
|
/**
|
|
87018
87051
|
* Gets the factor by which we temporarily scale the canvas resolution when we interact with the viewer.
|
|
87019
87052
|
*
|
|
@@ -94103,6 +94136,9 @@ class CameraUpdater {
|
|
|
94103
94136
|
}
|
|
94104
94137
|
}
|
|
94105
94138
|
}
|
|
94139
|
+
} else {
|
|
94140
|
+
dollyDistFactor = 1;
|
|
94141
|
+
followPointerWorldPos = null;
|
|
94106
94142
|
}
|
|
94107
94143
|
|
|
94108
94144
|
const dollyDeltaForDist = (updates.dollyDelta * dollyDistFactor);
|
package/dist/xeokit-sdk.es.js
CHANGED
|
@@ -77172,7 +77172,9 @@ class DTXTrianglesLayer {
|
|
|
77172
77172
|
// Color
|
|
77173
77173
|
|
|
77174
77174
|
let f0;
|
|
77175
|
-
if (!visible || culled || xrayed
|
|
77175
|
+
if (!visible || culled || xrayed
|
|
77176
|
+
|| (highlighted && !this.model.scene.highlightMaterial.glowThrough)
|
|
77177
|
+
|| (selected && !this.model.scene.selectedMaterial.glowThrough)) {
|
|
77176
77178
|
f0 = RENDER_PASSES.NOT_RENDERED;
|
|
77177
77179
|
} else {
|
|
77178
77180
|
if (transparent) {
|
|
@@ -86759,6 +86761,7 @@ class DistanceMeasurementsPlugin extends Plugin {
|
|
|
86759
86761
|
* hidePBR: true, // No physically-based rendering while we interact (default is true)
|
|
86760
86762
|
* hideTransparentObjects: true, // Hide transparent objects while we interact (default is false)
|
|
86761
86763
|
* scaleCanvasResolution: true, // Scale canvas resolution while we interact (default is false)
|
|
86764
|
+
* defaultScaleCanvasResolutionFactor: 1.0, // Factor by which we scale canvas resolution when we stop interacting (default is 1.0)
|
|
86762
86765
|
* scaleCanvasResolutionFactor: 0.5, // Factor by which we scale canvas resolution when we interact (default is 0.6)
|
|
86763
86766
|
* delayBeforeRestore: true, // When we stop interacting, delay before restoring normal render (default is true)
|
|
86764
86767
|
* delayBeforeRestoreSeconds: 0.5 // The delay duration, in seconds (default is 0.5)
|
|
@@ -86791,6 +86794,7 @@ class FastNavPlugin extends Plugin {
|
|
|
86791
86794
|
* @param {Boolean} [cfg.hideEdges=true] Whether to temporarily hide edges whenever we interact with the Viewer.
|
|
86792
86795
|
* @param {Boolean} [cfg.hideTransparentObjects=false] Whether to temporarily hide transparent objects whenever we interact with the Viewer.
|
|
86793
86796
|
* @param {Number} [cfg.scaleCanvasResolution=false] Whether to temporarily down-scale the canvas resolution whenever we interact with the Viewer.
|
|
86797
|
+
* @param {Number} [cfg.defaultScaleCanvasResolutionFactor=0.6] The factor by which we downscale the canvas resolution whenever we stop interacting with the Viewer.
|
|
86794
86798
|
* @param {Number} [cfg.scaleCanvasResolutionFactor=0.6] The factor by which we downscale the canvas resolution whenever we interact with the Viewer.
|
|
86795
86799
|
* @param {Boolean} [cfg.delayBeforeRestore=true] Whether to temporarily have a delay before restoring normal rendering after we stop interacting with the Viewer.
|
|
86796
86800
|
* @param {Number} [cfg.delayBeforeRestoreSeconds=0.5] Delay in seconds before restoring normal rendering after we stop interacting with the Viewer.
|
|
@@ -86805,6 +86809,7 @@ class FastNavPlugin extends Plugin {
|
|
|
86805
86809
|
this._hideEdges = cfg.hideEdges !== false;
|
|
86806
86810
|
this._hideTransparentObjects = !!cfg.hideTransparentObjects;
|
|
86807
86811
|
this._scaleCanvasResolution = !!cfg.scaleCanvasResolution;
|
|
86812
|
+
this._defaultScaleCanvasResolutionFactor = cfg.defaultScaleCanvasResolutionFactor || 1.0;
|
|
86808
86813
|
this._scaleCanvasResolutionFactor = cfg.scaleCanvasResolutionFactor || 0.6;
|
|
86809
86814
|
this._delayBeforeRestore = (cfg.delayBeforeRestore !== false);
|
|
86810
86815
|
this._delayBeforeRestoreSeconds = cfg.delayBeforeRestoreSeconds || 0.5;
|
|
@@ -86823,14 +86828,14 @@ class FastNavPlugin extends Plugin {
|
|
|
86823
86828
|
if (this._scaleCanvasResolution) {
|
|
86824
86829
|
viewer.scene.canvas.resolutionScale = this._scaleCanvasResolutionFactor;
|
|
86825
86830
|
} else {
|
|
86826
|
-
viewer.scene.canvas.resolutionScale =
|
|
86831
|
+
viewer.scene.canvas.resolutionScale = this._defaultScaleCanvasResolutionFactor;
|
|
86827
86832
|
}
|
|
86828
86833
|
fastMode = true;
|
|
86829
86834
|
}
|
|
86830
86835
|
};
|
|
86831
86836
|
|
|
86832
86837
|
const switchToHighQuality = () => {
|
|
86833
|
-
viewer.scene.canvas.resolutionScale =
|
|
86838
|
+
viewer.scene.canvas.resolutionScale = this._defaultScaleCanvasResolutionFactor;
|
|
86834
86839
|
viewer.scene._renderer.setEdgesEnabled(true);
|
|
86835
86840
|
viewer.scene._renderer.setColorTextureEnabled(true);
|
|
86836
86841
|
viewer.scene._renderer.setPBREnabled(true);
|
|
@@ -86998,7 +87003,7 @@ class FastNavPlugin extends Plugin {
|
|
|
86998
87003
|
}
|
|
86999
87004
|
|
|
87000
87005
|
/**
|
|
87001
|
-
* Sets
|
|
87006
|
+
* Sets the factor to which we restore the canvas resolution scale when we stop interacting with the viewer.
|
|
87002
87007
|
*
|
|
87003
87008
|
* Default is ````false````.
|
|
87004
87009
|
*
|
|
@@ -87010,6 +87015,34 @@ class FastNavPlugin extends Plugin {
|
|
|
87010
87015
|
this._scaleCanvasResolution = scaleCanvasResolution;
|
|
87011
87016
|
}
|
|
87012
87017
|
|
|
87018
|
+
/**
|
|
87019
|
+
* Gets the factor to which we restore the canvas resolution scale when we stop interacting with the viewer.
|
|
87020
|
+
*
|
|
87021
|
+
* Default is ````1.0````.
|
|
87022
|
+
*
|
|
87023
|
+
* Enable canvas resolution scaling by setting {@link FastNavPlugin#scaleCanvasResolution} ````true````.
|
|
87024
|
+
*
|
|
87025
|
+
* @return {Number} Factor by scale canvas resolution when we stop interacting with the viewer.
|
|
87026
|
+
*/
|
|
87027
|
+
get defaultScaleCanvasResolutionFactor() {
|
|
87028
|
+
return this._defaultScaleCanvasResolutionFactor;
|
|
87029
|
+
}
|
|
87030
|
+
|
|
87031
|
+
/**
|
|
87032
|
+
* Sets the factor to which we restore the canvas resolution scale when we stop interacting with the viewer.
|
|
87033
|
+
*
|
|
87034
|
+
* Accepted range is ````[0.0 .. 1.0]````.
|
|
87035
|
+
*
|
|
87036
|
+
* Default is ````1.0````.
|
|
87037
|
+
*
|
|
87038
|
+
* Enable canvas resolution scaling by setting {@link FastNavPlugin#scaleCanvasResolution} ````true````.
|
|
87039
|
+
*
|
|
87040
|
+
* @param {Number} defaultScaleCanvasResolutionFactor Factor by scale canvas resolution when we stop interacting with the viewer.
|
|
87041
|
+
*/
|
|
87042
|
+
set defaultScaleCanvasResolutionFactor(defaultScaleCanvasResolutionFactor) {
|
|
87043
|
+
this._defaultScaleCanvasResolutionFactor = defaultScaleCanvasResolutionFactor || 1.0;
|
|
87044
|
+
}
|
|
87045
|
+
|
|
87013
87046
|
/**
|
|
87014
87047
|
* Gets the factor by which we temporarily scale the canvas resolution when we interact with the viewer.
|
|
87015
87048
|
*
|
|
@@ -94099,6 +94132,9 @@ class CameraUpdater {
|
|
|
94099
94132
|
}
|
|
94100
94133
|
}
|
|
94101
94134
|
}
|
|
94135
|
+
} else {
|
|
94136
|
+
dollyDistFactor = 1;
|
|
94137
|
+
followPointerWorldPos = null;
|
|
94102
94138
|
}
|
|
94103
94139
|
|
|
94104
94140
|
const dollyDeltaForDist = (updates.dollyDelta * dollyDistFactor);
|
package/dist/xeokit-sdk.es5.js
CHANGED
|
@@ -16199,8 +16199,7 @@ Math.floor(subPortionId/512),// yoffset
|
|
|
16199
16199
|
1,//height
|
|
16200
16200
|
gl.RGBA_INTEGER,gl.UNSIGNED_BYTE,tempUint8Array4);// gl.bindTexture (gl.TEXTURE_2D, null);
|
|
16201
16201
|
}},{key:"setTransparent",value:function setTransparent(portionId,flags,transparent){if(transparent){this._numTransparentLayerPortions++;this.model.numTransparentLayerPortions++;}else{this._numTransparentLayerPortions--;this.model.numTransparentLayerPortions--;}this._setFlags(portionId,flags,transparent);}},{key:"_setFlags",value:function _setFlags(portionId,flags,transparent){var deferred=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var subPortionIds=this._portionToSubPortionsMap[portionId];for(var _i369=0,len=subPortionIds.length;_i369<len;_i369++){this._subPortionSetFlags(subPortionIds[_i369],flags,transparent,deferred);}}},{key:"_subPortionSetFlags",value:function _subPortionSetFlags(subPortionId,flags,transparent){var deferred=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;if(!this._finalized){throw"Not finalized";}var visible=!!(flags&ENTITY_FLAGS.VISIBLE);var xrayed=!!(flags&ENTITY_FLAGS.XRAYED);var highlighted=!!(flags&ENTITY_FLAGS.HIGHLIGHTED);var selected=!!(flags&ENTITY_FLAGS.SELECTED);var edges=!!(flags&ENTITY_FLAGS.EDGES);var pickable=!!(flags&ENTITY_FLAGS.PICKABLE);var culled=!!(flags&ENTITY_FLAGS.CULLED);// Color
|
|
16202
|
-
var f0;if(!visible||culled||xrayed){//
|
|
16203
|
-
f0=RENDER_PASSES.NOT_RENDERED;}else{if(transparent){f0=RENDER_PASSES.COLOR_TRANSPARENT;}else{f0=RENDER_PASSES.COLOR_OPAQUE;}}// Silhouette
|
|
16202
|
+
var f0;if(!visible||culled||xrayed||highlighted&&!this.model.scene.highlightMaterial.glowThrough||selected&&!this.model.scene.selectedMaterial.glowThrough){f0=RENDER_PASSES.NOT_RENDERED;}else{if(transparent){f0=RENDER_PASSES.COLOR_TRANSPARENT;}else{f0=RENDER_PASSES.COLOR_OPAQUE;}}// Silhouette
|
|
16204
16203
|
var f1;if(!visible||culled){f1=RENDER_PASSES.NOT_RENDERED;}else if(selected){f1=RENDER_PASSES.SILHOUETTE_SELECTED;}else if(highlighted){f1=RENDER_PASSES.SILHOUETTE_HIGHLIGHTED;}else if(xrayed){f1=RENDER_PASSES.SILHOUETTE_XRAYED;}else{f1=RENDER_PASSES.NOT_RENDERED;}// Edges
|
|
16205
16204
|
var f2=0;if(!visible||culled){f2=RENDER_PASSES.NOT_RENDERED;}else if(selected){f2=RENDER_PASSES.EDGES_SELECTED;}else if(highlighted){f2=RENDER_PASSES.EDGES_HIGHLIGHTED;}else if(xrayed){f2=RENDER_PASSES.EDGES_XRAYED;}else if(edges){if(transparent){f2=RENDER_PASSES.EDGES_COLOR_TRANSPARENT;}else{f2=RENDER_PASSES.EDGES_COLOR_OPAQUE;}}else{f2=RENDER_PASSES.NOT_RENDERED;}// Pick
|
|
16206
16205
|
var f3=visible&&!culled&&pickable?RENDER_PASSES.PICK:RENDER_PASSES.NOT_RENDERED;var textureState=this._dtxState;var gl=this.model.scene.canvas.gl;tempUint8Array4[0]=f0;tempUint8Array4[1]=f1;tempUint8Array4[2]=f2;tempUint8Array4[3]=f3;// object flags
|
|
@@ -19649,6 +19648,7 @@ this._originDot.setVisible(this._visible&&this._originVisible);this._targetDot.s
|
|
|
19649
19648
|
* hidePBR: true, // No physically-based rendering while we interact (default is true)
|
|
19650
19649
|
* hideTransparentObjects: true, // Hide transparent objects while we interact (default is false)
|
|
19651
19650
|
* scaleCanvasResolution: true, // Scale canvas resolution while we interact (default is false)
|
|
19651
|
+
* defaultScaleCanvasResolutionFactor: 1.0, // Factor by which we scale canvas resolution when we stop interacting (default is 1.0)
|
|
19652
19652
|
* scaleCanvasResolutionFactor: 0.5, // Factor by which we scale canvas resolution when we interact (default is 0.6)
|
|
19653
19653
|
* delayBeforeRestore: true, // When we stop interacting, delay before restoring normal render (default is true)
|
|
19654
19654
|
* delayBeforeRestoreSeconds: 0.5 // The delay duration, in seconds (default is 0.5)
|
|
@@ -19678,10 +19678,11 @@ this._originDot.setVisible(this._visible&&this._originVisible);this._targetDot.s
|
|
|
19678
19678
|
* @param {Boolean} [cfg.hideEdges=true] Whether to temporarily hide edges whenever we interact with the Viewer.
|
|
19679
19679
|
* @param {Boolean} [cfg.hideTransparentObjects=false] Whether to temporarily hide transparent objects whenever we interact with the Viewer.
|
|
19680
19680
|
* @param {Number} [cfg.scaleCanvasResolution=false] Whether to temporarily down-scale the canvas resolution whenever we interact with the Viewer.
|
|
19681
|
+
* @param {Number} [cfg.defaultScaleCanvasResolutionFactor=0.6] The factor by which we downscale the canvas resolution whenever we stop interacting with the Viewer.
|
|
19681
19682
|
* @param {Number} [cfg.scaleCanvasResolutionFactor=0.6] The factor by which we downscale the canvas resolution whenever we interact with the Viewer.
|
|
19682
19683
|
* @param {Boolean} [cfg.delayBeforeRestore=true] Whether to temporarily have a delay before restoring normal rendering after we stop interacting with the Viewer.
|
|
19683
19684
|
* @param {Number} [cfg.delayBeforeRestoreSeconds=0.5] Delay in seconds before restoring normal rendering after we stop interacting with the Viewer.
|
|
19684
|
-
*/function FastNavPlugin(viewer){var _this85;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,FastNavPlugin);_this85=_super119.call(this,"FastNav",viewer);_this85._hideColorTexture=cfg.hideColorTexture!==false;_this85._hidePBR=cfg.hidePBR!==false;_this85._hideSAO=cfg.hideSAO!==false;_this85._hideEdges=cfg.hideEdges!==false;_this85._hideTransparentObjects=!!cfg.hideTransparentObjects;_this85._scaleCanvasResolution=!!cfg.scaleCanvasResolution;_this85._scaleCanvasResolutionFactor=cfg.scaleCanvasResolutionFactor||0.6;_this85._delayBeforeRestore=cfg.delayBeforeRestore!==false;_this85._delayBeforeRestoreSeconds=cfg.delayBeforeRestoreSeconds||0.5;var timer=_this85._delayBeforeRestoreSeconds*1000;var fastMode=false;var switchToLowQuality=function switchToLowQuality(){timer=_this85._delayBeforeRestoreSeconds*1000;if(!fastMode){viewer.scene._renderer.setColorTextureEnabled(!_this85._hideColorTexture);viewer.scene._renderer.setPBREnabled(!_this85._hidePBR);viewer.scene._renderer.setSAOEnabled(!_this85._hideSAO);viewer.scene._renderer.setTransparentEnabled(!_this85._hideTransparentObjects);viewer.scene._renderer.setEdgesEnabled(!_this85._hideEdges);if(_this85._scaleCanvasResolution){viewer.scene.canvas.resolutionScale=_this85._scaleCanvasResolutionFactor;}else{viewer.scene.canvas.resolutionScale=
|
|
19685
|
+
*/function FastNavPlugin(viewer){var _this85;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,FastNavPlugin);_this85=_super119.call(this,"FastNav",viewer);_this85._hideColorTexture=cfg.hideColorTexture!==false;_this85._hidePBR=cfg.hidePBR!==false;_this85._hideSAO=cfg.hideSAO!==false;_this85._hideEdges=cfg.hideEdges!==false;_this85._hideTransparentObjects=!!cfg.hideTransparentObjects;_this85._scaleCanvasResolution=!!cfg.scaleCanvasResolution;_this85._defaultScaleCanvasResolutionFactor=cfg.defaultScaleCanvasResolutionFactor||1.0;_this85._scaleCanvasResolutionFactor=cfg.scaleCanvasResolutionFactor||0.6;_this85._delayBeforeRestore=cfg.delayBeforeRestore!==false;_this85._delayBeforeRestoreSeconds=cfg.delayBeforeRestoreSeconds||0.5;var timer=_this85._delayBeforeRestoreSeconds*1000;var fastMode=false;var switchToLowQuality=function switchToLowQuality(){timer=_this85._delayBeforeRestoreSeconds*1000;if(!fastMode){viewer.scene._renderer.setColorTextureEnabled(!_this85._hideColorTexture);viewer.scene._renderer.setPBREnabled(!_this85._hidePBR);viewer.scene._renderer.setSAOEnabled(!_this85._hideSAO);viewer.scene._renderer.setTransparentEnabled(!_this85._hideTransparentObjects);viewer.scene._renderer.setEdgesEnabled(!_this85._hideEdges);if(_this85._scaleCanvasResolution){viewer.scene.canvas.resolutionScale=_this85._scaleCanvasResolutionFactor;}else{viewer.scene.canvas.resolutionScale=_this85._defaultScaleCanvasResolutionFactor;}fastMode=true;}};var switchToHighQuality=function switchToHighQuality(){viewer.scene.canvas.resolutionScale=_this85._defaultScaleCanvasResolutionFactor;viewer.scene._renderer.setEdgesEnabled(true);viewer.scene._renderer.setColorTextureEnabled(true);viewer.scene._renderer.setPBREnabled(true);viewer.scene._renderer.setSAOEnabled(true);viewer.scene._renderer.setTransparentEnabled(true);fastMode=false;};_this85._onCanvasBoundary=viewer.scene.canvas.on("boundary",switchToLowQuality);_this85._onCameraMatrix=viewer.scene.camera.on("matrix",switchToLowQuality);_this85._onSceneTick=viewer.scene.on("tick",function(tickEvent){if(!fastMode){return;}timer-=tickEvent.deltaTime;if(!_this85._delayBeforeRestore||timer<=0){switchToHighQuality();}});var down=false;_this85._onSceneMouseDown=viewer.scene.input.on("mousedown",function(){down=true;});_this85._onSceneMouseUp=viewer.scene.input.on("mouseup",function(){down=false;});_this85._onSceneMouseMove=viewer.scene.input.on("mousemove",function(){if(!down){return;}switchToLowQuality();});return _this85;}/**
|
|
19685
19686
|
* Gets whether to temporarily hide color textures whenever we interact with the Viewer.
|
|
19686
19687
|
*
|
|
19687
19688
|
* Default is ````true````.
|
|
@@ -19754,7 +19755,7 @@ this._originDot.setVisible(this._visible&&this._originVisible);this._targetDot.s
|
|
|
19754
19755
|
*
|
|
19755
19756
|
* @return {Boolean} ````true```` if scaling the canvas resolution.
|
|
19756
19757
|
*/},{key:"scaleCanvasResolution",get:function get(){return this._scaleCanvasResolution;}/**
|
|
19757
|
-
* Sets
|
|
19758
|
+
* Sets the factor to which we restore the canvas resolution scale when we stop interacting with the viewer.
|
|
19758
19759
|
*
|
|
19759
19760
|
* Default is ````false````.
|
|
19760
19761
|
*
|
|
@@ -19762,6 +19763,24 @@ this._originDot.setVisible(this._visible&&this._originVisible);this._targetDot.s
|
|
|
19762
19763
|
*
|
|
19763
19764
|
* @param {Boolean} scaleCanvasResolution ````true```` to scale the canvas resolution.
|
|
19764
19765
|
*/,set:function set(scaleCanvasResolution){this._scaleCanvasResolution=scaleCanvasResolution;}/**
|
|
19766
|
+
* Gets the factor to which we restore the canvas resolution scale when we stop interacting with the viewer.
|
|
19767
|
+
*
|
|
19768
|
+
* Default is ````1.0````.
|
|
19769
|
+
*
|
|
19770
|
+
* Enable canvas resolution scaling by setting {@link FastNavPlugin#scaleCanvasResolution} ````true````.
|
|
19771
|
+
*
|
|
19772
|
+
* @return {Number} Factor by scale canvas resolution when we stop interacting with the viewer.
|
|
19773
|
+
*/},{key:"defaultScaleCanvasResolutionFactor",get:function get(){return this._defaultScaleCanvasResolutionFactor;}/**
|
|
19774
|
+
* Sets the factor to which we restore the canvas resolution scale when we stop interacting with the viewer.
|
|
19775
|
+
*
|
|
19776
|
+
* Accepted range is ````[0.0 .. 1.0]````.
|
|
19777
|
+
*
|
|
19778
|
+
* Default is ````1.0````.
|
|
19779
|
+
*
|
|
19780
|
+
* Enable canvas resolution scaling by setting {@link FastNavPlugin#scaleCanvasResolution} ````true````.
|
|
19781
|
+
*
|
|
19782
|
+
* @param {Number} defaultScaleCanvasResolutionFactor Factor by scale canvas resolution when we stop interacting with the viewer.
|
|
19783
|
+
*/,set:function set(defaultScaleCanvasResolutionFactor){this._defaultScaleCanvasResolutionFactor=defaultScaleCanvasResolutionFactor||1.0;}/**
|
|
19765
19784
|
* Gets the factor by which we temporarily scale the canvas resolution when we interact with the viewer.
|
|
19766
19785
|
*
|
|
19767
19786
|
* Default is ````0.6````.
|
|
@@ -22137,7 +22156,7 @@ if(Math.abs(updates.rotateDeltaX)<EPSILON){updates.rotateDeltaX=0;}if(Math.abs(u
|
|
|
22137
22156
|
// which empty background shows, that the pointer may inadvertently be over. In these cases, we don't
|
|
22138
22157
|
// want dolly speed wildly varying depending on how accurately the user avoids the gaps with the pointer.
|
|
22139
22158
|
//----------------------------------------------------------------------------------------------------------
|
|
22140
|
-
if(configs.followPointer){if(--countDown<=0){countDown=SCALE_DOLLY_EACH_FRAME;if(updates.dollyDelta!==0){if(updates.rotateDeltaY===0&&updates.rotateDeltaX===0){if(configs.followPointer&&states.followPointerDirty){pickController.pickCursorPos=states.pointerCanvasPos;pickController.schedulePickSurface=true;pickController.update();if(pickController.pickResult&&pickController.pickResult.worldPos){followPointerWorldPos=pickController.pickResult.worldPos;}else{dollyDistFactor=1.0;followPointerWorldPos=null;}states.followPointerDirty=false;}}if(followPointerWorldPos){var dist=Math.abs(math.lenVec3(math.subVec3(followPointerWorldPos,scene.camera.eye,tempVec3$2)));dollyDistFactor=dist/configs.dollyProximityThreshold;}if(dollyDistFactor<configs.dollyMinSpeed){dollyDistFactor=configs.dollyMinSpeed;}}}}var dollyDeltaForDist=updates.dollyDelta*dollyDistFactor;//----------------------------------------------------------------------------------------------------------
|
|
22159
|
+
if(configs.followPointer){if(--countDown<=0){countDown=SCALE_DOLLY_EACH_FRAME;if(updates.dollyDelta!==0){if(updates.rotateDeltaY===0&&updates.rotateDeltaX===0){if(configs.followPointer&&states.followPointerDirty){pickController.pickCursorPos=states.pointerCanvasPos;pickController.schedulePickSurface=true;pickController.update();if(pickController.pickResult&&pickController.pickResult.worldPos){followPointerWorldPos=pickController.pickResult.worldPos;}else{dollyDistFactor=1.0;followPointerWorldPos=null;}states.followPointerDirty=false;}}if(followPointerWorldPos){var dist=Math.abs(math.lenVec3(math.subVec3(followPointerWorldPos,scene.camera.eye,tempVec3$2)));dollyDistFactor=dist/configs.dollyProximityThreshold;}if(dollyDistFactor<configs.dollyMinSpeed){dollyDistFactor=configs.dollyMinSpeed;}}}}else{dollyDistFactor=1;followPointerWorldPos=null;}var dollyDeltaForDist=updates.dollyDelta*dollyDistFactor;//----------------------------------------------------------------------------------------------------------
|
|
22141
22160
|
// Rotation
|
|
22142
22161
|
//----------------------------------------------------------------------------------------------------------
|
|
22143
22162
|
if(updates.rotateDeltaY!==0||updates.rotateDeltaX!==0){if(!configs.firstPerson&&configs.followPointer&&pivotController.getPivoting()){pivotController.continuePivot(updates.rotateDeltaY,updates.rotateDeltaX);pivotController.showPivot();}else{if(updates.rotateDeltaX!==0){if(configs.firstPerson){camera.pitch(-updates.rotateDeltaX);}else{camera.orbitPitch(updates.rotateDeltaX);}}if(updates.rotateDeltaY!==0){if(configs.firstPerson){camera.yaw(updates.rotateDeltaY);}else{camera.orbitYaw(updates.rotateDeltaY);}}}updates.rotateDeltaX*=configs.rotationInertia;updates.rotateDeltaY*=configs.rotationInertia;cursorType="grabbing";}//----------------------------------------------------------------------------------------------------------
|