@xeokit/xeokit-sdk 2.6.25 → 2.6.26

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.
@@ -14529,6 +14529,7 @@ class Annotation extends Marker {
14529
14529
  this._values = cfg.values || {};
14530
14530
  this._layoutDirty = true;
14531
14531
  this._visibilityDirty = true;
14532
+ this._labelPosition = 24;
14532
14533
 
14533
14534
  this._buildHTML();
14534
14535
 
@@ -14659,17 +14660,23 @@ class Annotation extends Marker {
14659
14660
  * @private
14660
14661
  */
14661
14662
  _updatePosition() {
14663
+ const px = x => x + "px";
14662
14664
  const boundary = this.scene.canvas.boundary;
14663
- const left = boundary[0];
14664
- const top = boundary[1];
14665
- const canvasPos = this.canvasPos;
14666
- this._marker.style.left = (Math.floor(left + canvasPos[0]) - 12) + "px";
14667
- this._marker.style.top = (Math.floor(top + canvasPos[1]) - 12) + "px";
14665
+ const left = boundary[0] + this.canvasPos[0];
14666
+ const top = boundary[1] + this.canvasPos[1];
14667
+ const markerRect = this._marker.getBoundingClientRect();
14668
+ const markerWidth = markerRect.width;
14669
+ const markerDir = (this._markerAlign === "right") ? -1 : ((this._markerAlign === "center") ? 0 : 1);
14670
+ const markerCenter = left + markerDir * (markerWidth / 2 - 12);
14671
+ this._marker.style.left = px(markerCenter - markerWidth / 2);
14672
+ this._marker.style.top = px(top - 12);
14668
14673
  this._marker.style["z-index"] = 90005 + Math.floor(this._viewPos[2]) + 1;
14669
- const offsetX = 20;
14670
- const offsetY = -17;
14671
- this._label.style.left = 20 + Math.floor(left + canvasPos[0] + offsetX) + "px";
14672
- this._label.style.top = Math.floor(top + canvasPos[1] + offsetY) + "px";
14674
+
14675
+ const labelRect = this._label.getBoundingClientRect();
14676
+ const labelWidth = labelRect.width;
14677
+ const labelDir = Math.sign(this._labelPosition);
14678
+ this._label.style.left = px(markerCenter + labelDir * (markerWidth / 2 + Math.abs(this._labelPosition) + labelWidth / 2) - labelWidth / 2);
14679
+ this._label.style.top = px(top - 17);
14673
14680
  this._label.style["z-index"] = 90005 + Math.floor(this._viewPos[2]) + 1;
14674
14681
  }
14675
14682
 
@@ -14704,6 +14711,37 @@ class Annotation extends Marker {
14704
14711
  }
14705
14712
  }
14706
14713
 
14714
+ /**
14715
+ * Sets the horizontal alignment of the Annotation's marker HTML.
14716
+ *
14717
+ * @param {String} align Either "left", "center", "right" (default "left")
14718
+ */
14719
+ setMarkerAlign(align) {
14720
+ const valid = [ "left", "center", "right" ];
14721
+ if (! valid.includes(align)) {
14722
+ this.error("Param 'align' should be one of: " + JSON.stringify(valid));
14723
+ } else {
14724
+ this._markerAlign = align;
14725
+ this._updatePosition();
14726
+ }
14727
+ }
14728
+
14729
+ /**
14730
+ * Sets the relative horizontal position of the Annotation's label HTML.
14731
+ *
14732
+ * @param {Number} position Negative - to the left, positive - to the right, otherwise ignore (default 24)
14733
+ */
14734
+ setLabelPosition(position) {
14735
+ if (typeof position !== "number") {
14736
+ this.error("Param 'position' is not a number");
14737
+ } else if (position === 0) {
14738
+ this.error("Param 'position' is zero");
14739
+ } else {
14740
+ this._labelPosition = position;
14741
+ this._updatePosition();
14742
+ }
14743
+ }
14744
+
14707
14745
  /**
14708
14746
  * Sets whether or not to show this Annotation's marker.
14709
14747
  *
@@ -31777,10 +31815,10 @@ class Scene extends Component {
31777
31815
  */
31778
31816
  get center() {
31779
31817
  if (this._aabbDirty || !this._center) {
31780
- if (!this._center || !this._center) {
31818
+ const aabb = this.aabb;
31819
+ if (!this._center) {
31781
31820
  this._center = math.vec3();
31782
31821
  }
31783
- const aabb = this.aabb;
31784
31822
  this._center[0] = (aabb[0] + aabb[3]) / 2;
31785
31823
  this._center[1] = (aabb[1] + aabb[4]) / 2;
31786
31824
  this._center[2] = (aabb[2] + aabb[5]) / 2;
@@ -31855,6 +31893,7 @@ class Scene extends Component {
31855
31893
  this._aabb[4] = ymax;
31856
31894
  this._aabb[5] = zmax;
31857
31895
  this._aabbDirty = false;
31896
+ this._center = null;
31858
31897
  }
31859
31898
  return this._aabb;
31860
31899
  }
@@ -96774,7 +96813,7 @@ class KeyboardAxisViewHandler {
96774
96813
  return;
96775
96814
  }
96776
96815
 
96777
- if (!states.mouseover) {
96816
+ if (configs.keyboardEnabledOnlyIfMouseover && !states.mouseover) {
96778
96817
  return;
96779
96818
  }
96780
96819
 
@@ -97268,7 +97307,7 @@ class KeyboardPanRotateDollyHandler {
97268
97307
  if (!(configs.active && configs.pointerEnabled) || (!scene.input.keyboardEnabled)) {
97269
97308
  return;
97270
97309
  }
97271
- if (!states.mouseover) {
97310
+ if (configs.keyboardEnabledOnlyIfMouseover && !states.mouseover) {
97272
97311
  return;
97273
97312
  }
97274
97313
  keyDownMap[keyCode] = true;
@@ -97299,7 +97338,7 @@ class KeyboardPanRotateDollyHandler {
97299
97338
  return;
97300
97339
  }
97301
97340
 
97302
- if (!states.mouseover) {
97341
+ if (configs.keyboardEnabledOnlyIfMouseover && !states.mouseover) {
97303
97342
  return;
97304
97343
  }
97305
97344
 
@@ -98940,6 +98979,8 @@ class CameraControl extends Component {
98940
98979
  snapToEdge: DEFAULT_SNAP_EDGE,
98941
98980
  snapRadius: DEFAULT_SNAP_PICK_RADIUS,
98942
98981
 
98982
+ keyboardEnabledOnlyIfMouseover: true,
98983
+
98943
98984
  // Rotation
98944
98985
 
98945
98986
  dragRotationRate: 360.0,
@@ -99250,6 +99291,24 @@ class CameraControl extends Component {
99250
99291
  get snapRadius() {
99251
99292
  return this._configs.snapRadius;
99252
99293
  }
99294
+
99295
+ /**
99296
+ * If `true`, the keyboard shortcuts are enabled ONLY if the mouse is over the canvas.
99297
+ *
99298
+ * @param {boolean} value
99299
+ */
99300
+ set keyboardEnabledOnlyIfMouseover(value) {
99301
+ this._configs.keyboardEnabledOnlyIfMouseover = !!value;
99302
+ }
99303
+
99304
+ /**
99305
+ * Gets whether the keyboard shortcuts are enabled ONLY if the mouse is over the canvas or ALWAYS.
99306
+ *
99307
+ * @returns {boolean}
99308
+ */
99309
+ get keyboardEnabledOnlyIfMouseover() {
99310
+ return this._configs.keyboardEnabledOnlyIfMouseover;
99311
+ }
99253
99312
 
99254
99313
  /**
99255
99314
  * Sets the current navigation mode.
@@ -14525,6 +14525,7 @@ class Annotation extends Marker {
14525
14525
  this._values = cfg.values || {};
14526
14526
  this._layoutDirty = true;
14527
14527
  this._visibilityDirty = true;
14528
+ this._labelPosition = 24;
14528
14529
 
14529
14530
  this._buildHTML();
14530
14531
 
@@ -14655,17 +14656,23 @@ class Annotation extends Marker {
14655
14656
  * @private
14656
14657
  */
14657
14658
  _updatePosition() {
14659
+ const px = x => x + "px";
14658
14660
  const boundary = this.scene.canvas.boundary;
14659
- const left = boundary[0];
14660
- const top = boundary[1];
14661
- const canvasPos = this.canvasPos;
14662
- this._marker.style.left = (Math.floor(left + canvasPos[0]) - 12) + "px";
14663
- this._marker.style.top = (Math.floor(top + canvasPos[1]) - 12) + "px";
14661
+ const left = boundary[0] + this.canvasPos[0];
14662
+ const top = boundary[1] + this.canvasPos[1];
14663
+ const markerRect = this._marker.getBoundingClientRect();
14664
+ const markerWidth = markerRect.width;
14665
+ const markerDir = (this._markerAlign === "right") ? -1 : ((this._markerAlign === "center") ? 0 : 1);
14666
+ const markerCenter = left + markerDir * (markerWidth / 2 - 12);
14667
+ this._marker.style.left = px(markerCenter - markerWidth / 2);
14668
+ this._marker.style.top = px(top - 12);
14664
14669
  this._marker.style["z-index"] = 90005 + Math.floor(this._viewPos[2]) + 1;
14665
- const offsetX = 20;
14666
- const offsetY = -17;
14667
- this._label.style.left = 20 + Math.floor(left + canvasPos[0] + offsetX) + "px";
14668
- this._label.style.top = Math.floor(top + canvasPos[1] + offsetY) + "px";
14670
+
14671
+ const labelRect = this._label.getBoundingClientRect();
14672
+ const labelWidth = labelRect.width;
14673
+ const labelDir = Math.sign(this._labelPosition);
14674
+ this._label.style.left = px(markerCenter + labelDir * (markerWidth / 2 + Math.abs(this._labelPosition) + labelWidth / 2) - labelWidth / 2);
14675
+ this._label.style.top = px(top - 17);
14669
14676
  this._label.style["z-index"] = 90005 + Math.floor(this._viewPos[2]) + 1;
14670
14677
  }
14671
14678
 
@@ -14700,6 +14707,37 @@ class Annotation extends Marker {
14700
14707
  }
14701
14708
  }
14702
14709
 
14710
+ /**
14711
+ * Sets the horizontal alignment of the Annotation's marker HTML.
14712
+ *
14713
+ * @param {String} align Either "left", "center", "right" (default "left")
14714
+ */
14715
+ setMarkerAlign(align) {
14716
+ const valid = [ "left", "center", "right" ];
14717
+ if (! valid.includes(align)) {
14718
+ this.error("Param 'align' should be one of: " + JSON.stringify(valid));
14719
+ } else {
14720
+ this._markerAlign = align;
14721
+ this._updatePosition();
14722
+ }
14723
+ }
14724
+
14725
+ /**
14726
+ * Sets the relative horizontal position of the Annotation's label HTML.
14727
+ *
14728
+ * @param {Number} position Negative - to the left, positive - to the right, otherwise ignore (default 24)
14729
+ */
14730
+ setLabelPosition(position) {
14731
+ if (typeof position !== "number") {
14732
+ this.error("Param 'position' is not a number");
14733
+ } else if (position === 0) {
14734
+ this.error("Param 'position' is zero");
14735
+ } else {
14736
+ this._labelPosition = position;
14737
+ this._updatePosition();
14738
+ }
14739
+ }
14740
+
14703
14741
  /**
14704
14742
  * Sets whether or not to show this Annotation's marker.
14705
14743
  *
@@ -31773,10 +31811,10 @@ class Scene extends Component {
31773
31811
  */
31774
31812
  get center() {
31775
31813
  if (this._aabbDirty || !this._center) {
31776
- if (!this._center || !this._center) {
31814
+ const aabb = this.aabb;
31815
+ if (!this._center) {
31777
31816
  this._center = math.vec3();
31778
31817
  }
31779
- const aabb = this.aabb;
31780
31818
  this._center[0] = (aabb[0] + aabb[3]) / 2;
31781
31819
  this._center[1] = (aabb[1] + aabb[4]) / 2;
31782
31820
  this._center[2] = (aabb[2] + aabb[5]) / 2;
@@ -31851,6 +31889,7 @@ class Scene extends Component {
31851
31889
  this._aabb[4] = ymax;
31852
31890
  this._aabb[5] = zmax;
31853
31891
  this._aabbDirty = false;
31892
+ this._center = null;
31854
31893
  }
31855
31894
  return this._aabb;
31856
31895
  }
@@ -96770,7 +96809,7 @@ class KeyboardAxisViewHandler {
96770
96809
  return;
96771
96810
  }
96772
96811
 
96773
- if (!states.mouseover) {
96812
+ if (configs.keyboardEnabledOnlyIfMouseover && !states.mouseover) {
96774
96813
  return;
96775
96814
  }
96776
96815
 
@@ -97264,7 +97303,7 @@ class KeyboardPanRotateDollyHandler {
97264
97303
  if (!(configs.active && configs.pointerEnabled) || (!scene.input.keyboardEnabled)) {
97265
97304
  return;
97266
97305
  }
97267
- if (!states.mouseover) {
97306
+ if (configs.keyboardEnabledOnlyIfMouseover && !states.mouseover) {
97268
97307
  return;
97269
97308
  }
97270
97309
  keyDownMap[keyCode] = true;
@@ -97295,7 +97334,7 @@ class KeyboardPanRotateDollyHandler {
97295
97334
  return;
97296
97335
  }
97297
97336
 
97298
- if (!states.mouseover) {
97337
+ if (configs.keyboardEnabledOnlyIfMouseover && !states.mouseover) {
97299
97338
  return;
97300
97339
  }
97301
97340
 
@@ -98936,6 +98975,8 @@ class CameraControl extends Component {
98936
98975
  snapToEdge: DEFAULT_SNAP_EDGE,
98937
98976
  snapRadius: DEFAULT_SNAP_PICK_RADIUS,
98938
98977
 
98978
+ keyboardEnabledOnlyIfMouseover: true,
98979
+
98939
98980
  // Rotation
98940
98981
 
98941
98982
  dragRotationRate: 360.0,
@@ -99246,6 +99287,24 @@ class CameraControl extends Component {
99246
99287
  get snapRadius() {
99247
99288
  return this._configs.snapRadius;
99248
99289
  }
99290
+
99291
+ /**
99292
+ * If `true`, the keyboard shortcuts are enabled ONLY if the mouse is over the canvas.
99293
+ *
99294
+ * @param {boolean} value
99295
+ */
99296
+ set keyboardEnabledOnlyIfMouseover(value) {
99297
+ this._configs.keyboardEnabledOnlyIfMouseover = !!value;
99298
+ }
99299
+
99300
+ /**
99301
+ * Gets whether the keyboard shortcuts are enabled ONLY if the mouse is over the canvas or ALWAYS.
99302
+ *
99303
+ * @returns {boolean}
99304
+ */
99305
+ get keyboardEnabledOnlyIfMouseover() {
99306
+ return this._configs.keyboardEnabledOnlyIfMouseover;
99307
+ }
99249
99308
 
99250
99309
  /**
99251
99310
  * Sets the current navigation mode.
@@ -3441,7 +3441,7 @@ return pickResult&&pickResult.worldPos?pickResult.worldPos:snap&&tryPickWorldPos
3441
3441
  * @type {AnnotationsPlugin}
3442
3442
  */_this27.plugin=cfg.plugin;_this27._container=cfg.container;if(!_this27._container){throw"config missing: container";}if(!cfg.markerElement&&!cfg.markerHTML){throw"config missing: need either markerElement or markerHTML";}if(!cfg.labelElement&&!cfg.labelHTML){throw"config missing: need either labelElement or labelHTML";}_this27._htmlDirty=false;if(cfg.markerElement){_this27._marker=cfg.markerElement;_this27._marker.addEventListener("click",_this27._onMouseClickedExternalMarker=function(){_this27.plugin.fire("markerClicked",_assertThisInitialized(_this27));});_this27._marker.addEventListener("contextmenu",_this27._onContextMenuExtenalMarker=function(){_this27.plugin.fire("contextmenu",_assertThisInitialized(_this27));});_this27._marker.addEventListener("mouseenter",_this27._onMouseEnterExternalMarker=function(){_this27.plugin.fire("markerMouseEnter",_assertThisInitialized(_this27));});_this27._marker.addEventListener("mouseleave",_this27._onMouseLeaveExternalMarker=function(){_this27.plugin.fire("markerMouseLeave",_assertThisInitialized(_this27));});_this27._markerExternal=true;// Don't destroy marker when destroying Annotation
3443
3443
  }else{_this27._markerHTML=cfg.markerHTML;_this27._htmlDirty=true;_this27._markerExternal=false;}if(cfg.labelElement){_this27._label=cfg.labelElement;_this27._labelExternal=true;// Don't destroy marker when destroying Annotation
3444
- }else{_this27._labelHTML=cfg.labelHTML;_this27._htmlDirty=true;_this27._labelExternal=false;}_this27._markerShown=!!cfg.markerShown;_this27._labelShown=!!cfg.labelShown;_this27._values=cfg.values||{};_this27._layoutDirty=true;_this27._visibilityDirty=true;_this27._buildHTML();_this27._onTick=_this27.scene.on("tick",function(){if(_this27._htmlDirty){_this27._buildHTML();_this27._htmlDirty=false;_this27._layoutDirty=true;_this27._visibilityDirty=true;}if(_this27._layoutDirty||_this27._visibilityDirty){if(_this27._markerShown||_this27._labelShown){_this27._updatePosition();_this27._layoutDirty=false;}}if(_this27._visibilityDirty){_this27._marker.style.visibility=_this27.visible&&_this27._markerShown?"visible":"hidden";_this27._label.style.visibility=_this27.visible&&_this27._markerShown&&_this27._labelShown?"visible":"hidden";_this27._visibilityDirty=false;}});_this27.on("canvasPos",function(){_this27._layoutDirty=true;});_this27.on("visible",function(){_this27._visibilityDirty=true;});_this27.setMarkerShown(cfg.markerShown!==false);_this27.setLabelShown(cfg.labelShown);/**
3444
+ }else{_this27._labelHTML=cfg.labelHTML;_this27._htmlDirty=true;_this27._labelExternal=false;}_this27._markerShown=!!cfg.markerShown;_this27._labelShown=!!cfg.labelShown;_this27._values=cfg.values||{};_this27._layoutDirty=true;_this27._visibilityDirty=true;_this27._labelPosition=24;_this27._buildHTML();_this27._onTick=_this27.scene.on("tick",function(){if(_this27._htmlDirty){_this27._buildHTML();_this27._htmlDirty=false;_this27._layoutDirty=true;_this27._visibilityDirty=true;}if(_this27._layoutDirty||_this27._visibilityDirty){if(_this27._markerShown||_this27._labelShown){_this27._updatePosition();_this27._layoutDirty=false;}}if(_this27._visibilityDirty){_this27._marker.style.visibility=_this27.visible&&_this27._markerShown?"visible":"hidden";_this27._label.style.visibility=_this27.visible&&_this27._markerShown&&_this27._labelShown?"visible":"hidden";_this27._visibilityDirty=false;}});_this27.on("canvasPos",function(){_this27._layoutDirty=true;});_this27.on("visible",function(){_this27._visibilityDirty=true;});_this27.setMarkerShown(cfg.markerShown!==false);_this27.setLabelShown(cfg.labelShown);/**
3445
3445
  * Optional World-space position for {@link Camera#eye}, used when this Annotation is associated with a {@link Camera} position.
3446
3446
  *
3447
3447
  * Undefined by default.
@@ -3471,13 +3471,21 @@ return pickResult&&pickResult.worldPos?pickResult.worldPos:snap&&tryPickWorldPos
3471
3471
  if(utils.isArray(markerHTML)){markerHTML=markerHTML.join("");}markerHTML=this._renderTemplate(markerHTML.trim());var markerFragment=document.createRange().createContextualFragment(markerHTML);this._marker=markerFragment.firstChild;this._container.appendChild(this._marker);this._marker.style.visibility=this._markerShown?"visible":"hidden";this._marker.addEventListener("click",function(){_this28.plugin.fire("markerClicked",_this28);});this._marker.addEventListener("contextmenu",function(e){e.preventDefault();_this28.plugin.fire("contextmenu",_this28);});this._marker.addEventListener("mouseenter",function(){_this28.plugin.fire("markerMouseEnter",_this28);});this._marker.addEventListener("mouseleave",function(){_this28.plugin.fire("markerMouseLeave",_this28);});this._marker.addEventListener('wheel',function(event){_this28.plugin.viewer.scene.canvas.canvas.dispatchEvent(new WheelEvent('wheel',event));});}if(!this._labelExternal){if(this._label){this._container.removeChild(this._label);this._label=null;}var labelHTML=this._labelHTML||"<p></p>";// Make label
3472
3472
  if(utils.isArray(labelHTML)){labelHTML=labelHTML.join("");}labelHTML=this._renderTemplate(labelHTML.trim());var labelFragment=document.createRange().createContextualFragment(labelHTML);this._label=labelFragment.firstChild;this._container.appendChild(this._label);this._label.style.visibility=this._markerShown&&this._labelShown?"visible":"hidden";this._label.addEventListener('wheel',function(event){_this28.plugin.viewer.scene.canvas.canvas.dispatchEvent(new WheelEvent('wheel',event));});}}/**
3473
3473
  * @private
3474
- */},{key:"_updatePosition",value:function _updatePosition(){var boundary=this.scene.canvas.boundary;var left=boundary[0];var top=boundary[1];var canvasPos=this.canvasPos;this._marker.style.left=Math.floor(left+canvasPos[0])-12+"px";this._marker.style.top=Math.floor(top+canvasPos[1])-12+"px";this._marker.style["z-index"]=90005+Math.floor(this._viewPos[2])+1;var offsetX=20;var offsetY=-17;this._label.style.left=20+Math.floor(left+canvasPos[0]+offsetX)+"px";this._label.style.top=Math.floor(top+canvasPos[1]+offsetY)+"px";this._label.style["z-index"]=90005+Math.floor(this._viewPos[2])+1;}/**
3474
+ */},{key:"_updatePosition",value:function _updatePosition(){var px=function px(x){return x+"px";};var boundary=this.scene.canvas.boundary;var left=boundary[0]+this.canvasPos[0];var top=boundary[1]+this.canvasPos[1];var markerRect=this._marker.getBoundingClientRect();var markerWidth=markerRect.width;var markerDir=this._markerAlign==="right"?-1:this._markerAlign==="center"?0:1;var markerCenter=left+markerDir*(markerWidth/2-12);this._marker.style.left=px(markerCenter-markerWidth/2);this._marker.style.top=px(top-12);this._marker.style["z-index"]=90005+Math.floor(this._viewPos[2])+1;var labelRect=this._label.getBoundingClientRect();var labelWidth=labelRect.width;var labelDir=Math.sign(this._labelPosition);this._label.style.left=px(markerCenter+labelDir*(markerWidth/2+Math.abs(this._labelPosition)+labelWidth/2)-labelWidth/2);this._label.style.top=px(top-17);this._label.style["z-index"]=90005+Math.floor(this._viewPos[2])+1;}/**
3475
3475
  * @private
3476
3476
  */},{key:"_renderTemplate",value:function _renderTemplate(template){for(var key in this._values){if(this._values.hasOwnProperty(key)){var value=this._values[key];template=template.replace(new RegExp('{{'+key+'}}','g'),value);}}return template;}/**
3477
3477
  * Sets the Marker's worldPos and entity properties based on passed {@link PickResult}
3478
3478
  *
3479
3479
  * @param {PickResult} pickResult A PickResult to position the Marker at.
3480
3480
  */},{key:"setFromPickResult",value:function setFromPickResult(pickResult){if(!pickResult.worldPos||!pickResult.worldNormal){this.error("Param 'pickResult' does not have both worldPos and worldNormal");}else{var normalizedWorldNormal=math.normalizeVec3(pickResult.worldNormal,tempVec3a$K);var offset=this.plugin&&this.plugin.surfaceOffset||0;var offsetVec=math.mulVec3Scalar(normalizedWorldNormal,offset,tempVec3b$z);var offsetWorldPos=math.addVec3(pickResult.worldPos,offsetVec,tempVec3c$v);this.entity=pickResult.entity;this.worldPos=offsetWorldPos;}}/**
3481
+ * Sets the horizontal alignment of the Annotation's marker HTML.
3482
+ *
3483
+ * @param {String} align Either "left", "center", "right" (default "left")
3484
+ */},{key:"setMarkerAlign",value:function setMarkerAlign(align){var valid=["left","center","right"];if(!valid.includes(align)){this.error("Param 'align' should be one of: "+JSON.stringify(valid));}else{this._markerAlign=align;this._updatePosition();}}/**
3485
+ * Sets the relative horizontal position of the Annotation's label HTML.
3486
+ *
3487
+ * @param {Number} position Negative - to the left, positive - to the right, otherwise ignore (default 24)
3488
+ */},{key:"setLabelPosition",value:function setLabelPosition(position){if(typeof position!=="number"){this.error("Param 'position' is not a number");}else if(position===0){this.error("Param 'position' is zero");}else{this._labelPosition=position;this._updatePosition();}}/**
3481
3489
  * Sets whether or not to show this Annotation's marker.
3482
3490
  *
3483
3491
  * The marker shows the Annotation's position.
@@ -9719,7 +9727,7 @@ dontClear:true});}/**
9719
9727
  * Gets the World-space 3D center of this Scene.
9720
9728
  *
9721
9729
  *@type {Number[]}
9722
- */},{key:"center",get:function get(){if(this._aabbDirty||!this._center){if(!this._center||!this._center){this._center=math.vec3();}var aabb=this.aabb;this._center[0]=(aabb[0]+aabb[3])/2;this._center[1]=(aabb[1]+aabb[4])/2;this._center[2]=(aabb[2]+aabb[5])/2;}return this._center;}/**
9730
+ */},{key:"center",get:function get(){if(this._aabbDirty||!this._center){var aabb=this.aabb;if(!this._center){this._center=math.vec3();}this._center[0]=(aabb[0]+aabb[3])/2;this._center[1]=(aabb[1]+aabb[4])/2;this._center[2]=(aabb[2]+aabb[5])/2;}return this._center;}/**
9723
9731
  * Gets the World-space axis-aligned 3D boundary (AABB) of this Scene.
9724
9732
  *
9725
9733
  * The AABB is represented by a six-element Float64Array containing the min/max extents of the axis-aligned volume, ie. ````[xmin, ymin,zmin,xmax,ymax, zmax]````.
@@ -9727,7 +9735,7 @@ dontClear:true});}/**
9727
9735
  * When the Scene has no content, will be ````[-100,-100,-100,100,100,100]````.
9728
9736
  *
9729
9737
  * @type {Number[]}
9730
- */},{key:"aabb",get:function get(){if(this._aabbDirty){if(!this._aabb){this._aabb=math.AABB3();}var xmin=math.MAX_DOUBLE;var ymin=math.MAX_DOUBLE;var zmin=math.MAX_DOUBLE;var xmax=math.MIN_DOUBLE;var ymax=math.MIN_DOUBLE;var zmax=math.MIN_DOUBLE;var aabb;var collidables=this._collidables;var collidable;var valid=false;for(var collidableId in collidables){if(collidables.hasOwnProperty(collidableId)){collidable=collidables[collidableId];if(collidable.collidable===false){continue;}aabb=collidable.aabb;if(aabb[0]<xmin){xmin=aabb[0];}if(aabb[1]<ymin){ymin=aabb[1];}if(aabb[2]<zmin){zmin=aabb[2];}if(aabb[3]>xmax){xmax=aabb[3];}if(aabb[4]>ymax){ymax=aabb[4];}if(aabb[5]>zmax){zmax=aabb[5];}valid=true;}}if(!valid){xmin=-100;ymin=-100;zmin=-100;xmax=100;ymax=100;zmax=100;}this._aabb[0]=xmin;this._aabb[1]=ymin;this._aabb[2]=zmin;this._aabb[3]=xmax;this._aabb[4]=ymax;this._aabb[5]=zmax;this._aabbDirty=false;}return this._aabb;}},{key:"_setAABBDirty",value:function _setAABBDirty(){//if (!this._aabbDirty) {
9738
+ */},{key:"aabb",get:function get(){if(this._aabbDirty){if(!this._aabb){this._aabb=math.AABB3();}var xmin=math.MAX_DOUBLE;var ymin=math.MAX_DOUBLE;var zmin=math.MAX_DOUBLE;var xmax=math.MIN_DOUBLE;var ymax=math.MIN_DOUBLE;var zmax=math.MIN_DOUBLE;var aabb;var collidables=this._collidables;var collidable;var valid=false;for(var collidableId in collidables){if(collidables.hasOwnProperty(collidableId)){collidable=collidables[collidableId];if(collidable.collidable===false){continue;}aabb=collidable.aabb;if(aabb[0]<xmin){xmin=aabb[0];}if(aabb[1]<ymin){ymin=aabb[1];}if(aabb[2]<zmin){zmin=aabb[2];}if(aabb[3]>xmax){xmax=aabb[3];}if(aabb[4]>ymax){ymax=aabb[4];}if(aabb[5]>zmax){zmax=aabb[5];}valid=true;}}if(!valid){xmin=-100;ymin=-100;zmin=-100;xmax=100;ymax=100;zmax=100;}this._aabb[0]=xmin;this._aabb[1]=ymin;this._aabb[2]=zmin;this._aabb[3]=xmax;this._aabb[4]=ymax;this._aabb[5]=zmax;this._aabbDirty=false;this._center=null;}return this._aabb;}},{key:"_setAABBDirty",value:function _setAABBDirty(){//if (!this._aabbDirty) {
9731
9739
  this._aabbDirty=true;this.fire("boundary");// }
9732
9740
  }/**
9733
9741
  * Attempts to pick an {@link Entity} in this Scene.
@@ -22839,7 +22847,7 @@ mouseDownLeft=false;mouseDownMiddle=false;mouseDownRight=false;break;}});canvas.
22839
22847
  getCanvasPosFromEvent$3(e,canvasPos);var x=canvasPos[0];var y=canvasPos[1];if(Math.abs(x-lastXDown)<3&&Math.abs(y-lastYDown)<3){controllers.cameraControl.fire("rightClick",{// For context menus
22840
22848
  pagePos:[Math.round(e.pageX),Math.round(e.pageY)],canvasPos:canvasPos,event:e},true);}break;}canvas.style.removeProperty("cursor");});canvas.addEventListener("mouseenter",this._mouseEnterHandler=function(){if(!(configs.active&&configs.pointerEnabled)){return;}});var maxElapsed=1/20;var minElapsed=1/60;var secsNowLast=null;canvas.addEventListener("wheel",this._mouseWheelHandler=function(e){if(!(configs.active&&configs.pointerEnabled)){return;}var secsNow=performance.now()/1000.0;var secsElapsed=secsNowLast!==null?secsNow-secsNowLast:0;secsNowLast=secsNow;if(secsElapsed>maxElapsed){secsElapsed=maxElapsed;}if(secsElapsed<minElapsed){secsElapsed=minElapsed;}var delta=Math.max(-1,Math.min(1,-e.deltaY*40));if(delta===0){return;}var normalizedDelta=delta/Math.abs(delta);updates.dollyDelta+=-normalizedDelta*secsElapsed*configs.mouseWheelDollyRate;if(mouseMovedOnCanvasSinceLastWheel){states.followPointerDirty=true;mouseMovedOnCanvasSinceLastWheel=false;}},{passive:true});}_createClass(MousePanRotateDollyHandler,[{key:"reset",value:function reset(){}},{key:"destroy",value:function destroy(){var canvas=this._scene.canvas.canvas;document.removeEventListener("keydown",this._documentKeyDownHandler);document.removeEventListener("keyup",this._documentKeyUpHandler);canvas.removeEventListener("mousedown",this._mouseDownHandler);document.removeEventListener("mousemove",this._documentMouseMoveHandler);canvas.removeEventListener("mousemove",this._canvasMouseMoveHandler);document.removeEventListener("mouseup",this._documentMouseUpHandler);canvas.removeEventListener("mouseup",this._mouseUpHandler);canvas.removeEventListener("mouseenter",this._mouseEnterHandler);canvas.removeEventListener("wheel",this._mouseWheelHandler);}}]);return MousePanRotateDollyHandler;}();var center=math.vec3();var tempVec3a$5=math.vec3();var tempVec3b$2=math.vec3();var tempVec3c$1=math.vec3();var tempVec3d=math.vec3();var tempCameraTarget={eye:math.vec3(),look:math.vec3(),up:math.vec3()};/**
22841
22849
  * @private
22842
- */var KeyboardAxisViewHandler=/*#__PURE__*/function(){function KeyboardAxisViewHandler(scene,controllers,configs,states){_classCallCheck(this,KeyboardAxisViewHandler);this._scene=scene;var cameraControl=controllers.cameraControl;var camera=scene.camera;this._onSceneKeyDown=scene.input.on("keydown",function(){if(!(configs.active&&configs.pointerEnabled)||!scene.input.keyboardEnabled){return;}if(!states.mouseover){return;}var axisViewRight=cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_RIGHT);var axisViewBack=cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_BACK);var axisViewLeft=cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_LEFT);var axisViewFront=cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_FRONT);var axisViewTop=cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_TOP);var axisViewBottom=cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_BOTTOM);if(!axisViewRight&&!axisViewBack&&!axisViewLeft&&!axisViewFront&&!axisViewTop&&!axisViewBottom){return;}var aabb=scene.aabb;var diag=math.getAABB3Diag(aabb);math.getAABB3Center(aabb,center);var perspectiveDist=Math.abs(diag/Math.tan(controllers.cameraFlight.fitFOV*math.DEGTORAD));var orthoScale=diag*1.1;tempCameraTarget.orthoScale=orthoScale;if(axisViewRight){tempCameraTarget.eye.set(math.addVec3(center,math.mulVec3Scalar(camera.worldRight,perspectiveDist,tempVec3a$5),tempVec3d));tempCameraTarget.look.set(center);tempCameraTarget.up.set(camera.worldUp);}else if(axisViewBack){tempCameraTarget.eye.set(math.addVec3(center,math.mulVec3Scalar(camera.worldForward,perspectiveDist,tempVec3a$5),tempVec3d));tempCameraTarget.look.set(center);tempCameraTarget.up.set(camera.worldUp);}else if(axisViewLeft){tempCameraTarget.eye.set(math.addVec3(center,math.mulVec3Scalar(camera.worldRight,-perspectiveDist,tempVec3a$5),tempVec3d));tempCameraTarget.look.set(center);tempCameraTarget.up.set(camera.worldUp);}else if(axisViewFront){tempCameraTarget.eye.set(math.addVec3(center,math.mulVec3Scalar(camera.worldForward,-perspectiveDist,tempVec3a$5),tempVec3d));tempCameraTarget.look.set(center);tempCameraTarget.up.set(camera.worldUp);}else if(axisViewTop){tempCameraTarget.eye.set(math.addVec3(center,math.mulVec3Scalar(camera.worldUp,perspectiveDist,tempVec3a$5),tempVec3d));tempCameraTarget.look.set(center);tempCameraTarget.up.set(math.normalizeVec3(math.mulVec3Scalar(camera.worldForward,1,tempVec3b$2),tempVec3c$1));}else if(axisViewBottom){tempCameraTarget.eye.set(math.addVec3(center,math.mulVec3Scalar(camera.worldUp,-perspectiveDist,tempVec3a$5),tempVec3d));tempCameraTarget.look.set(center);tempCameraTarget.up.set(math.normalizeVec3(math.mulVec3Scalar(camera.worldForward,-1,tempVec3b$2)));}if(!configs.firstPerson&&configs.followPointer){controllers.pivotController.setPivotPos(center);}if(controllers.cameraFlight.duration>0){controllers.cameraFlight.flyTo(tempCameraTarget,function(){if(controllers.pivotController.getPivoting()&&configs.followPointer){controllers.pivotController.showPivot();}});}else{controllers.cameraFlight.jumpTo(tempCameraTarget);if(controllers.pivotController.getPivoting()&&configs.followPointer){controllers.pivotController.showPivot();}}});}_createClass(KeyboardAxisViewHandler,[{key:"reset",value:function reset(){}},{key:"destroy",value:function destroy(){this._scene.input.off(this._onSceneKeyDown);}}]);return KeyboardAxisViewHandler;}();/**
22850
+ */var KeyboardAxisViewHandler=/*#__PURE__*/function(){function KeyboardAxisViewHandler(scene,controllers,configs,states){_classCallCheck(this,KeyboardAxisViewHandler);this._scene=scene;var cameraControl=controllers.cameraControl;var camera=scene.camera;this._onSceneKeyDown=scene.input.on("keydown",function(){if(!(configs.active&&configs.pointerEnabled)||!scene.input.keyboardEnabled){return;}if(configs.keyboardEnabledOnlyIfMouseover&&!states.mouseover){return;}var axisViewRight=cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_RIGHT);var axisViewBack=cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_BACK);var axisViewLeft=cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_LEFT);var axisViewFront=cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_FRONT);var axisViewTop=cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_TOP);var axisViewBottom=cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_BOTTOM);if(!axisViewRight&&!axisViewBack&&!axisViewLeft&&!axisViewFront&&!axisViewTop&&!axisViewBottom){return;}var aabb=scene.aabb;var diag=math.getAABB3Diag(aabb);math.getAABB3Center(aabb,center);var perspectiveDist=Math.abs(diag/Math.tan(controllers.cameraFlight.fitFOV*math.DEGTORAD));var orthoScale=diag*1.1;tempCameraTarget.orthoScale=orthoScale;if(axisViewRight){tempCameraTarget.eye.set(math.addVec3(center,math.mulVec3Scalar(camera.worldRight,perspectiveDist,tempVec3a$5),tempVec3d));tempCameraTarget.look.set(center);tempCameraTarget.up.set(camera.worldUp);}else if(axisViewBack){tempCameraTarget.eye.set(math.addVec3(center,math.mulVec3Scalar(camera.worldForward,perspectiveDist,tempVec3a$5),tempVec3d));tempCameraTarget.look.set(center);tempCameraTarget.up.set(camera.worldUp);}else if(axisViewLeft){tempCameraTarget.eye.set(math.addVec3(center,math.mulVec3Scalar(camera.worldRight,-perspectiveDist,tempVec3a$5),tempVec3d));tempCameraTarget.look.set(center);tempCameraTarget.up.set(camera.worldUp);}else if(axisViewFront){tempCameraTarget.eye.set(math.addVec3(center,math.mulVec3Scalar(camera.worldForward,-perspectiveDist,tempVec3a$5),tempVec3d));tempCameraTarget.look.set(center);tempCameraTarget.up.set(camera.worldUp);}else if(axisViewTop){tempCameraTarget.eye.set(math.addVec3(center,math.mulVec3Scalar(camera.worldUp,perspectiveDist,tempVec3a$5),tempVec3d));tempCameraTarget.look.set(center);tempCameraTarget.up.set(math.normalizeVec3(math.mulVec3Scalar(camera.worldForward,1,tempVec3b$2),tempVec3c$1));}else if(axisViewBottom){tempCameraTarget.eye.set(math.addVec3(center,math.mulVec3Scalar(camera.worldUp,-perspectiveDist,tempVec3a$5),tempVec3d));tempCameraTarget.look.set(center);tempCameraTarget.up.set(math.normalizeVec3(math.mulVec3Scalar(camera.worldForward,-1,tempVec3b$2)));}if(!configs.firstPerson&&configs.followPointer){controllers.pivotController.setPivotPos(center);}if(controllers.cameraFlight.duration>0){controllers.cameraFlight.flyTo(tempCameraTarget,function(){if(controllers.pivotController.getPivoting()&&configs.followPointer){controllers.pivotController.showPivot();}});}else{controllers.cameraFlight.jumpTo(tempCameraTarget);if(controllers.pivotController.getPivoting()&&configs.followPointer){controllers.pivotController.showPivot();}}});}_createClass(KeyboardAxisViewHandler,[{key:"reset",value:function reset(){}},{key:"destroy",value:function destroy(){this._scene.input.off(this._onSceneKeyDown);}}]);return KeyboardAxisViewHandler;}();/**
22843
22851
  * @private
22844
22852
  */var MousePickHandler=/*#__PURE__*/function(){function MousePickHandler(scene,controllers,configs,states,updates){var _this113=this;_classCallCheck(this,MousePickHandler);this._scene=scene;var pickController=controllers.pickController;var pivotController=controllers.pivotController;var cameraControl=controllers.cameraControl;this._clicks=0;this._timeout=null;this._lastPickedEntityId=null;var leftDown=false;var rightDown=false;var canvas=this._scene.canvas.canvas;var flyCameraTo=function flyCameraTo(pickResult){var pos;if(pickResult&&pickResult.worldPos){pos=pickResult.worldPos;}var aabb=pickResult&&pickResult.entity?pickResult.entity.aabb:scene.aabb;if(pos){// Fly to look at point, don't change eye->look dist
22845
22853
  var camera=scene.camera;math.subVec3(camera.eye,camera.look,[]);controllers.cameraFlight.flyTo({// look: pos,
@@ -22861,7 +22869,7 @@ if(pickedSubs||pickedNothingSubs||pickedSurfaceSubs){pickController.pickCursorPo
22861
22869
  pickController.pickCursorPos=states.pointerCanvasPos;pickController.schedulePickEntity=configs.doublePickFlyTo;pickController.schedulePickSurface=pickedSurfaceSubs;pickController.update();var firstClickPickResult=pickController.pickResult;var firstClickPickSurface=pickController.pickedSurface;_this113._timeout=setTimeout(function(){if(firstClickPickResult){cameraControl.fire("picked",firstClickPickResult,true);if(firstClickPickSurface){cameraControl.fire("pickedSurface",firstClickPickResult,true);if(!configs.firstPerson&&configs.followPointer){controllers.pivotController.setPivotPos(firstClickPickResult.worldPos);if(controllers.pivotController.startPivot()){controllers.pivotController.showPivot();}}}}else{cameraControl.fire("pickedNothing",{canvasPos:states.pointerCanvasPos},true);}_this113._clicks=0;},configs.doubleClickTimeFrame);}else{// Second click
22862
22870
  if(_this113._timeout!==null){window.clearTimeout(_this113._timeout);_this113._timeout=null;}pickController.pickCursorPos=states.pointerCanvasPos;pickController.schedulePickEntity=configs.doublePickFlyTo||doublePickedSubs||doublePickedSurfaceSubs;pickController.schedulePickSurface=pickController.schedulePickEntity&&doublePickedSurfaceSubs;pickController.update();if(pickController.pickResult){cameraControl.fire("doublePicked",pickController.pickResult,true);if(pickController.pickedSurface){cameraControl.fire("doublePickedSurface",pickController.pickResult,true);}if(configs.doublePickFlyTo){flyCameraTo(pickController.pickResult);if(!configs.firstPerson&&configs.followPointer){var pickedEntityAABB=pickController.pickResult.entity.aabb;var pickedEntityCenterPos=math.getAABB3Center(pickedEntityAABB);controllers.pivotController.setPivotPos(pickedEntityCenterPos);if(controllers.pivotController.startPivot()){controllers.pivotController.showPivot();}}}}else{cameraControl.fire("doublePickedNothing",{canvasPos:states.pointerCanvasPos},true);if(configs.doublePickFlyTo){flyCameraTo();if(!configs.firstPerson&&configs.followPointer){var sceneAABB=scene.aabb;var sceneCenterPos=math.getAABB3Center(sceneAABB);controllers.pivotController.setPivotPos(sceneCenterPos);if(controllers.pivotController.startPivot()){controllers.pivotController.showPivot();}}}}_this113._clicks=0;}},false);}_createClass(MousePickHandler,[{key:"reset",value:function reset(){this._clicks=0;this._lastPickedEntityId=null;if(this._timeout){window.clearTimeout(this._timeout);this._timeout=null;}}},{key:"destroy",value:function destroy(){var canvas=this._scene.canvas.canvas;canvas.removeEventListener("mousemove",this._canvasMouseMoveHandler);canvas.removeEventListener("mousedown",this._canvasMouseDownHandler);document.removeEventListener("mouseup",this._documentMouseUpHandler);canvas.removeEventListener("mouseup",this._canvasMouseUpHandler);if(this._timeout){window.clearTimeout(this._timeout);this._timeout=null;}}}]);return MousePickHandler;}();/**
22863
22871
  * @private
22864
- */var KeyboardPanRotateDollyHandler=/*#__PURE__*/function(){function KeyboardPanRotateDollyHandler(scene,controllers,configs,states,updates){_classCallCheck(this,KeyboardPanRotateDollyHandler);this._scene=scene;var input=scene.input;var keyDownMap=[];var canvas=scene.canvas.canvas;var mouseMovedSinceLastKeyboardDolly=true;this._onSceneMouseMove=input.on("mousemove",function(){mouseMovedSinceLastKeyboardDolly=true;});this._onSceneKeyDown=input.on("keydown",function(keyCode){if(!(configs.active&&configs.pointerEnabled)||!scene.input.keyboardEnabled){return;}if(!states.mouseover){return;}keyDownMap[keyCode]=true;if(keyCode===input.KEY_SHIFT){canvas.style.cursor="move";}});this._onSceneKeyUp=input.on("keyup",function(keyCode){if(!(configs.active&&configs.pointerEnabled)||!scene.input.keyboardEnabled){return;}keyDownMap[keyCode]=false;if(keyCode===input.KEY_SHIFT){canvas.style.cursor=null;}if(controllers.pivotController.getPivoting()){controllers.pivotController.endPivot();}});this._onTick=scene.on("tick",function(e){if(!(configs.active&&configs.pointerEnabled)||!scene.input.keyboardEnabled){return;}if(!states.mouseover){return;}var cameraControl=controllers.cameraControl;var elapsedSecs=e.deltaTime/1000.0;//-------------------------------------------------------------------------------------------------
22872
+ */var KeyboardPanRotateDollyHandler=/*#__PURE__*/function(){function KeyboardPanRotateDollyHandler(scene,controllers,configs,states,updates){_classCallCheck(this,KeyboardPanRotateDollyHandler);this._scene=scene;var input=scene.input;var keyDownMap=[];var canvas=scene.canvas.canvas;var mouseMovedSinceLastKeyboardDolly=true;this._onSceneMouseMove=input.on("mousemove",function(){mouseMovedSinceLastKeyboardDolly=true;});this._onSceneKeyDown=input.on("keydown",function(keyCode){if(!(configs.active&&configs.pointerEnabled)||!scene.input.keyboardEnabled){return;}if(configs.keyboardEnabledOnlyIfMouseover&&!states.mouseover){return;}keyDownMap[keyCode]=true;if(keyCode===input.KEY_SHIFT){canvas.style.cursor="move";}});this._onSceneKeyUp=input.on("keyup",function(keyCode){if(!(configs.active&&configs.pointerEnabled)||!scene.input.keyboardEnabled){return;}keyDownMap[keyCode]=false;if(keyCode===input.KEY_SHIFT){canvas.style.cursor=null;}if(controllers.pivotController.getPivoting()){controllers.pivotController.endPivot();}});this._onTick=scene.on("tick",function(e){if(!(configs.active&&configs.pointerEnabled)||!scene.input.keyboardEnabled){return;}if(configs.keyboardEnabledOnlyIfMouseover&&!states.mouseover){return;}var cameraControl=controllers.cameraControl;var elapsedSecs=e.deltaTime/1000.0;//-------------------------------------------------------------------------------------------------
22865
22873
  // Keyboard rotation
22866
22874
  //-------------------------------------------------------------------------------------------------
22867
22875
  if(!configs.planView){var rotateYPos=cameraControl._isKeyDownForAction(cameraControl.ROTATE_Y_POS,keyDownMap);var rotateYNeg=cameraControl._isKeyDownForAction(cameraControl.ROTATE_Y_NEG,keyDownMap);var rotateXPos=cameraControl._isKeyDownForAction(cameraControl.ROTATE_X_POS,keyDownMap);var rotateXNeg=cameraControl._isKeyDownForAction(cameraControl.ROTATE_X_NEG,keyDownMap);var orbitDelta=elapsedSecs*configs.keyboardRotationRate;if(rotateYPos||rotateYNeg||rotateXPos||rotateXNeg){if(!configs.firstPerson&&configs.followPointer){controllers.pivotController.startPivot();}if(rotateYPos){updates.rotateDeltaY+=orbitDelta;}else if(rotateYNeg){updates.rotateDeltaY-=orbitDelta;}if(rotateXPos){updates.rotateDeltaX+=orbitDelta;}else if(rotateXNeg){updates.rotateDeltaX-=orbitDelta;}if(!configs.firstPerson&&configs.followPointer){controllers.pivotController.startPivot();}}}//-------------------------------------------------------------------------------------------------
@@ -23483,7 +23491,7 @@ _this114._configs={// Private
23483
23491
  longTapTimeout:600,// Millisecs
23484
23492
  longTapRadius:5,// Pixels
23485
23493
  // General
23486
- active:true,keyboardLayout:"qwerty",navMode:"orbit",planView:false,firstPerson:false,followPointer:true,doublePickFlyTo:true,panRightClick:true,showPivot:false,pointerEnabled:true,constrainVertical:false,smartPivot:false,doubleClickTimeFrame:250,snapToVertex:DEFAULT_SNAP_VERTEX,snapToEdge:DEFAULT_SNAP_EDGE,snapRadius:DEFAULT_SNAP_PICK_RADIUS,// Rotation
23494
+ active:true,keyboardLayout:"qwerty",navMode:"orbit",planView:false,firstPerson:false,followPointer:true,doublePickFlyTo:true,panRightClick:true,showPivot:false,pointerEnabled:true,constrainVertical:false,smartPivot:false,doubleClickTimeFrame:250,snapToVertex:DEFAULT_SNAP_VERTEX,snapToEdge:DEFAULT_SNAP_EDGE,snapRadius:DEFAULT_SNAP_PICK_RADIUS,keyboardEnabledOnlyIfMouseover:true,// Rotation
23487
23495
  dragRotationRate:360.0,keyboardRotationRate:90.0,rotationInertia:0.0,// Panning
23488
23496
  keyboardPanRate:1.0,touchPanRate:1.0,panInertia:0.5,// Dollying
23489
23497
  keyboardDollyRate:10,mouseWheelDollyRate:100,touchDollyRate:0.2,dollyInertia:0,dollyProximityThreshold:30.0,dollyMinSpeed:0.04};// Current runtime state of the CameraControl
@@ -23560,6 +23568,14 @@ case"qwerty":keyMap[this.PAN_LEFT]=[input.KEY_A];keyMap[this.PAN_RIGHT]=[input.K
23560
23568
  *
23561
23569
  * @returns {Number} The snap radius.
23562
23570
  */function get(){return this._configs.snapRadius;}/**
23571
+ * If `true`, the keyboard shortcuts are enabled ONLY if the mouse is over the canvas.
23572
+ *
23573
+ * @param {boolean} value
23574
+ */,set:function set(snapRadius){snapRadius=snapRadius||DEFAULT_SNAP_PICK_RADIUS;this._configs.snapRadius=snapRadius;}},{key:"keyboardEnabledOnlyIfMouseover",get:/**
23575
+ * Gets whether the keyboard shortcuts are enabled ONLY if the mouse is over the canvas or ALWAYS.
23576
+ *
23577
+ * @returns {boolean}
23578
+ */function get(){return this._configs.keyboardEnabledOnlyIfMouseover;}/**
23563
23579
  * Sets the current navigation mode.
23564
23580
  *
23565
23581
  * Accepted values are:
@@ -23571,7 +23587,7 @@ case"qwerty":keyMap[this.PAN_LEFT]=[input.KEY_A];keyMap[this.PAN_RIGHT]=[input.K
23571
23587
  * See class comments for more info.
23572
23588
  *
23573
23589
  * @param {String} navMode The navigation mode: "orbit", "firstPerson" or "planView".
23574
- */,set:function set(snapRadius){snapRadius=snapRadius||DEFAULT_SNAP_PICK_RADIUS;this._configs.snapRadius=snapRadius;}},{key:"navMode",get:/**
23590
+ */,set:function set(value){this._configs.keyboardEnabledOnlyIfMouseover=!!value;}},{key:"navMode",get:/**
23575
23591
  * Gets the current navigation mode.
23576
23592
  *
23577
23593
  * @returns {String} The navigation mode: "orbit", "firstPerson" or "planView".