@xeokit/xeokit-sdk 2.3.0-beta-2 → 2.3.0-beta-3

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.
@@ -153870,23 +153870,26 @@ class MousePickHandler {
153870
153870
 
153871
153871
  if (this._clicks === 1) { // First click
153872
153872
 
153873
- this._timeout = setTimeout(() => {
153873
+ pickController.pickCursorPos = states.pointerCanvasPos;
153874
+ pickController.schedulePickEntity = configs.doublePickFlyTo;
153875
+ pickController.schedulePickSurface = pickedSurfaceSubs;
153876
+ pickController.update();
153874
153877
 
153875
- pickController.pickCursorPos = states.pointerCanvasPos;
153876
- pickController.schedulePickEntity = configs.doublePickFlyTo;
153877
- pickController.schedulePickSurface = pickedSurfaceSubs;
153878
- pickController.update();
153878
+ const firstClickPickResult = pickController.pickResult;
153879
+ const firstClickPickSurface = pickController.pickedSurface;
153879
153880
 
153880
- if (pickController.pickResult) {
153881
+ this._timeout = setTimeout(() => {
153881
153882
 
153882
- cameraControl.fire("picked", pickController.pickResult, true);
153883
+ if (firstClickPickResult) {
153883
153884
 
153884
- if (pickController.pickedSurface) {
153885
+ cameraControl.fire("picked", firstClickPickResult, true);
153885
153886
 
153886
- cameraControl.fire("pickedSurface", pickController.pickResult, true);
153887
+ if (firstClickPickSurface) {
153888
+
153889
+ cameraControl.fire("pickedSurface", firstClickPickResult, true);
153887
153890
 
153888
153891
  if ((!configs.firstPerson) && configs.followPointer) {
153889
- controllers.pivotController.setPivotPos(pickController.pickResult.worldPos);
153892
+ controllers.pivotController.setPivotPos(firstClickPickResult.worldPos);
153890
153893
  if (controllers.pivotController.startPivot()) {
153891
153894
  controllers.pivotController.showPivot();
153892
153895
  }
@@ -153900,7 +153903,7 @@ class MousePickHandler {
153900
153903
 
153901
153904
  this._clicks = 0;
153902
153905
 
153903
- }, 250); // FIXME: Too short for track pads
153906
+ }, configs.doubleClickTimeFrame);
153904
153907
 
153905
153908
  } else { // Second click
153906
153909
 
@@ -155649,6 +155652,7 @@ class CameraControl extends Component {
155649
155652
  pointerEnabled: true,
155650
155653
  constrainVertical: false,
155651
155654
  smartPivot: false,
155655
+ doubleClickTimeFrame: 250,
155652
155656
 
155653
155657
  // Rotation
155654
155658
 
@@ -156612,6 +156616,30 @@ class CameraControl extends Component {
156612
156616
  return this._configs.smartPivot;
156613
156617
  }
156614
156618
 
156619
+ /**
156620
+ * Sets the double click time frame length in milliseconds.
156621
+ *
156622
+ * If two mouse click events occur within this time frame, it is considered a double click.
156623
+ *
156624
+ * Default is ````250````
156625
+ *
156626
+ * @param {Number} value New double click time frame.
156627
+ */
156628
+ set doubleClickTimeFrame(value) {
156629
+ this._configs.doubleClickTimeFrame = (value !== undefined && value !== null) ? value : 250;
156630
+ }
156631
+
156632
+ /**
156633
+ * Gets the double click time frame length in milliseconds.
156634
+ *
156635
+ * Default is ````250````
156636
+ *
156637
+ * @param {Number} value Current double click time frame.
156638
+ */
156639
+ get doubleClickTimeFrame() {
156640
+ return this._configs.doubleClickTimeFrame;
156641
+ }
156642
+
156615
156643
  /**
156616
156644
  * Destroys this ````CameraControl````.
156617
156645
  * @private
@@ -153866,23 +153866,26 @@ class MousePickHandler {
153866
153866
 
153867
153867
  if (this._clicks === 1) { // First click
153868
153868
 
153869
- this._timeout = setTimeout(() => {
153869
+ pickController.pickCursorPos = states.pointerCanvasPos;
153870
+ pickController.schedulePickEntity = configs.doublePickFlyTo;
153871
+ pickController.schedulePickSurface = pickedSurfaceSubs;
153872
+ pickController.update();
153870
153873
 
153871
- pickController.pickCursorPos = states.pointerCanvasPos;
153872
- pickController.schedulePickEntity = configs.doublePickFlyTo;
153873
- pickController.schedulePickSurface = pickedSurfaceSubs;
153874
- pickController.update();
153874
+ const firstClickPickResult = pickController.pickResult;
153875
+ const firstClickPickSurface = pickController.pickedSurface;
153875
153876
 
153876
- if (pickController.pickResult) {
153877
+ this._timeout = setTimeout(() => {
153877
153878
 
153878
- cameraControl.fire("picked", pickController.pickResult, true);
153879
+ if (firstClickPickResult) {
153879
153880
 
153880
- if (pickController.pickedSurface) {
153881
+ cameraControl.fire("picked", firstClickPickResult, true);
153881
153882
 
153882
- cameraControl.fire("pickedSurface", pickController.pickResult, true);
153883
+ if (firstClickPickSurface) {
153884
+
153885
+ cameraControl.fire("pickedSurface", firstClickPickResult, true);
153883
153886
 
153884
153887
  if ((!configs.firstPerson) && configs.followPointer) {
153885
- controllers.pivotController.setPivotPos(pickController.pickResult.worldPos);
153888
+ controllers.pivotController.setPivotPos(firstClickPickResult.worldPos);
153886
153889
  if (controllers.pivotController.startPivot()) {
153887
153890
  controllers.pivotController.showPivot();
153888
153891
  }
@@ -153896,7 +153899,7 @@ class MousePickHandler {
153896
153899
 
153897
153900
  this._clicks = 0;
153898
153901
 
153899
- }, 250); // FIXME: Too short for track pads
153902
+ }, configs.doubleClickTimeFrame);
153900
153903
 
153901
153904
  } else { // Second click
153902
153905
 
@@ -155645,6 +155648,7 @@ class CameraControl extends Component {
155645
155648
  pointerEnabled: true,
155646
155649
  constrainVertical: false,
155647
155650
  smartPivot: false,
155651
+ doubleClickTimeFrame: 250,
155648
155652
 
155649
155653
  // Rotation
155650
155654
 
@@ -156608,6 +156612,30 @@ class CameraControl extends Component {
156608
156612
  return this._configs.smartPivot;
156609
156613
  }
156610
156614
 
156615
+ /**
156616
+ * Sets the double click time frame length in milliseconds.
156617
+ *
156618
+ * If two mouse click events occur within this time frame, it is considered a double click.
156619
+ *
156620
+ * Default is ````250````
156621
+ *
156622
+ * @param {Number} value New double click time frame.
156623
+ */
156624
+ set doubleClickTimeFrame(value) {
156625
+ this._configs.doubleClickTimeFrame = (value !== undefined && value !== null) ? value : 250;
156626
+ }
156627
+
156628
+ /**
156629
+ * Gets the double click time frame length in milliseconds.
156630
+ *
156631
+ * Default is ````250````
156632
+ *
156633
+ * @param {Number} value Current double click time frame.
156634
+ */
156635
+ get doubleClickTimeFrame() {
156636
+ return this._configs.doubleClickTimeFrame;
156637
+ }
156638
+
156611
156639
  /**
156612
156640
  * Destroys this ````CameraControl````.
156613
156641
  * @private