@xeokit/xeokit-sdk 2.4.2-beta-13 → 2.4.2-beta-14

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.
@@ -8584,20 +8584,6 @@ function frustumIntersectsAABB3(frustum, aabb) {
8584
8584
  */
8585
8585
  class MarqueePicker extends Component {
8586
8586
 
8587
- /**
8588
- * Pick mode that picks {@link Entity}s that intersect the marquee box.
8589
- *
8590
- * @type {number}
8591
- */
8592
- static PICK_MODE_INTERSECTS = 0;
8593
-
8594
- /**
8595
- * Pick mode that picks {@link Entity}s that are completely inside the marquee box.
8596
- *
8597
- * @type {number}
8598
- */
8599
- static PICK_MODE_INSIDE = 1;
8600
-
8601
8587
  /**
8602
8588
  * Creates a MarqueePicker.
8603
8589
  *
@@ -8847,6 +8833,20 @@ class MarqueePicker extends Component {
8847
8833
  }
8848
8834
  }
8849
8835
 
8836
+ /**
8837
+ * Pick mode that picks {@link Entity}s that intersect the marquee box.
8838
+ *
8839
+ * @type {number}
8840
+ */
8841
+ MarqueePicker.PICK_MODE_INTERSECTS = 0;
8842
+
8843
+ /**
8844
+ * Pick mode that picks {@link Entity}s that are completely inside the marquee box.
8845
+ *
8846
+ * @type {number}
8847
+ */
8848
+ MarqueePicker.PICK_MODE_INSIDE = 1;
8849
+
8850
8850
  /**
8851
8851
  * Controls a {@link MarqueePicker} with mouse input.
8852
8852
  *
@@ -87286,13 +87286,29 @@ class PickController {
87286
87286
 
87287
87287
  this._lastPickedEntityId = null;
87288
87288
 
87289
- this._needFireEvents = false;
87289
+ this._needFireEvents = 0;
87290
+
87291
+ this._needToUpdate = false;
87292
+
87293
+ this._tickSub = this._scene.on("tick", () => {
87294
+ this.runUpdate();
87295
+ });
87296
+ }
87297
+
87298
+ update() {
87299
+ this._needToUpdate = true;
87290
87300
  }
87291
87301
 
87292
87302
  /**
87293
87303
  * Immediately attempts a pick, if scheduled.
87294
87304
  */
87295
- update() {
87305
+ runUpdate() {
87306
+
87307
+ if (!this._needToUpdate) {
87308
+ return;
87309
+ }
87310
+
87311
+ this._needToUpdate = false;
87296
87312
 
87297
87313
  if (!this._configs.pointerEnabled) {
87298
87314
  return;
@@ -87307,8 +87323,6 @@ class PickController {
87307
87323
  this.snappedOrPicked = false;
87308
87324
  this.hoveredSnappedOrSurfaceOff = false;
87309
87325
 
87310
- this._needFireEvents = false;
87311
-
87312
87326
  const hasHoverSurfaceSubs = this._cameraControl.hasSubs("hoverSurface");
87313
87327
 
87314
87328
  if (this.scheduleSnapOrPick) {
@@ -87321,7 +87335,7 @@ class PickController {
87321
87335
  if (snapPickResult && snapPickResult.snappedWorldPos) {
87322
87336
  this.snapPickResult = snapPickResult;
87323
87337
  this.snappedOrPicked = true;
87324
- this._needFireEvents = true;
87338
+ this._needFireEvents++;
87325
87339
  } else {
87326
87340
  this.schedulePickSurface = true; // Fallback
87327
87341
  this.snapPickResult = null;
@@ -87334,7 +87348,7 @@ class PickController {
87334
87348
  if (pickResultCanvasPos[0] === this.pickCursorPos[0] && pickResultCanvasPos[1] === this.pickCursorPos[1]) {
87335
87349
  this.picked = true;
87336
87350
  this.pickedSurface = true;
87337
- this._needFireEvents = hasHoverSurfaceSubs;
87351
+ this._needFireEvents += hasHoverSurfaceSubs ? 1 : 0;
87338
87352
  this.schedulePickEntity = false;
87339
87353
  this.schedulePickSurface = false;
87340
87354
  if (this.scheduleSnapOrPick) {
@@ -87354,7 +87368,6 @@ class PickController {
87354
87368
  if (pickResultCanvasPos[0] === this.pickCursorPos[0] && pickResultCanvasPos[1] === this.pickCursorPos[1]) {
87355
87369
  this.picked = true;
87356
87370
  this.pickedSurface = false;
87357
- this._needFireEvents = false;
87358
87371
  this.schedulePickEntity = false;
87359
87372
  this.schedulePickSurface = false;
87360
87373
  return;
@@ -87375,10 +87388,10 @@ class PickController {
87375
87388
  } else {
87376
87389
  this.pickedSurface = true;
87377
87390
  }
87378
- this._needFireEvents = true;
87391
+ this._needFireEvents++;
87379
87392
  } else if (this.scheduleSnapOrPick) {
87380
87393
  this.hoveredSnappedOrSurfaceOff = true;
87381
- this._needFireEvents = true;
87394
+ this._needFireEvents++;
87382
87395
  }
87383
87396
 
87384
87397
  } else { // schedulePickEntity == true
@@ -87390,7 +87403,7 @@ class PickController {
87390
87403
  if (this.pickResult) {
87391
87404
  this.picked = true;
87392
87405
  this.pickedSurface = false;
87393
- this._needFireEvents = true;
87406
+ this._needFireEvents++;
87394
87407
  }
87395
87408
  }
87396
87409
 
@@ -87401,7 +87414,7 @@ class PickController {
87401
87414
 
87402
87415
  fireEvents() {
87403
87416
 
87404
- if (!this._needFireEvents) {
87417
+ if (this._needFireEvents == 0) {
87405
87418
  return;
87406
87419
  }
87407
87420
 
@@ -87469,10 +87482,11 @@ class PickController {
87469
87482
 
87470
87483
  this.pickResult = null;
87471
87484
 
87472
- this._needFireEvents = false;
87485
+ this._needFireEvents = 0;
87473
87486
  }
87474
87487
 
87475
87488
  destroy() {
87489
+ this._scene.off(this._tickSub);
87476
87490
  }
87477
87491
  }
87478
87492
 
@@ -8580,20 +8580,6 @@ function frustumIntersectsAABB3(frustum, aabb) {
8580
8580
  */
8581
8581
  class MarqueePicker extends Component {
8582
8582
 
8583
- /**
8584
- * Pick mode that picks {@link Entity}s that intersect the marquee box.
8585
- *
8586
- * @type {number}
8587
- */
8588
- static PICK_MODE_INTERSECTS = 0;
8589
-
8590
- /**
8591
- * Pick mode that picks {@link Entity}s that are completely inside the marquee box.
8592
- *
8593
- * @type {number}
8594
- */
8595
- static PICK_MODE_INSIDE = 1;
8596
-
8597
8583
  /**
8598
8584
  * Creates a MarqueePicker.
8599
8585
  *
@@ -8843,6 +8829,20 @@ class MarqueePicker extends Component {
8843
8829
  }
8844
8830
  }
8845
8831
 
8832
+ /**
8833
+ * Pick mode that picks {@link Entity}s that intersect the marquee box.
8834
+ *
8835
+ * @type {number}
8836
+ */
8837
+ MarqueePicker.PICK_MODE_INTERSECTS = 0;
8838
+
8839
+ /**
8840
+ * Pick mode that picks {@link Entity}s that are completely inside the marquee box.
8841
+ *
8842
+ * @type {number}
8843
+ */
8844
+ MarqueePicker.PICK_MODE_INSIDE = 1;
8845
+
8846
8846
  /**
8847
8847
  * Controls a {@link MarqueePicker} with mouse input.
8848
8848
  *
@@ -87282,13 +87282,29 @@ class PickController {
87282
87282
 
87283
87283
  this._lastPickedEntityId = null;
87284
87284
 
87285
- this._needFireEvents = false;
87285
+ this._needFireEvents = 0;
87286
+
87287
+ this._needToUpdate = false;
87288
+
87289
+ this._tickSub = this._scene.on("tick", () => {
87290
+ this.runUpdate();
87291
+ });
87292
+ }
87293
+
87294
+ update() {
87295
+ this._needToUpdate = true;
87286
87296
  }
87287
87297
 
87288
87298
  /**
87289
87299
  * Immediately attempts a pick, if scheduled.
87290
87300
  */
87291
- update() {
87301
+ runUpdate() {
87302
+
87303
+ if (!this._needToUpdate) {
87304
+ return;
87305
+ }
87306
+
87307
+ this._needToUpdate = false;
87292
87308
 
87293
87309
  if (!this._configs.pointerEnabled) {
87294
87310
  return;
@@ -87303,8 +87319,6 @@ class PickController {
87303
87319
  this.snappedOrPicked = false;
87304
87320
  this.hoveredSnappedOrSurfaceOff = false;
87305
87321
 
87306
- this._needFireEvents = false;
87307
-
87308
87322
  const hasHoverSurfaceSubs = this._cameraControl.hasSubs("hoverSurface");
87309
87323
 
87310
87324
  if (this.scheduleSnapOrPick) {
@@ -87317,7 +87331,7 @@ class PickController {
87317
87331
  if (snapPickResult && snapPickResult.snappedWorldPos) {
87318
87332
  this.snapPickResult = snapPickResult;
87319
87333
  this.snappedOrPicked = true;
87320
- this._needFireEvents = true;
87334
+ this._needFireEvents++;
87321
87335
  } else {
87322
87336
  this.schedulePickSurface = true; // Fallback
87323
87337
  this.snapPickResult = null;
@@ -87330,7 +87344,7 @@ class PickController {
87330
87344
  if (pickResultCanvasPos[0] === this.pickCursorPos[0] && pickResultCanvasPos[1] === this.pickCursorPos[1]) {
87331
87345
  this.picked = true;
87332
87346
  this.pickedSurface = true;
87333
- this._needFireEvents = hasHoverSurfaceSubs;
87347
+ this._needFireEvents += hasHoverSurfaceSubs ? 1 : 0;
87334
87348
  this.schedulePickEntity = false;
87335
87349
  this.schedulePickSurface = false;
87336
87350
  if (this.scheduleSnapOrPick) {
@@ -87350,7 +87364,6 @@ class PickController {
87350
87364
  if (pickResultCanvasPos[0] === this.pickCursorPos[0] && pickResultCanvasPos[1] === this.pickCursorPos[1]) {
87351
87365
  this.picked = true;
87352
87366
  this.pickedSurface = false;
87353
- this._needFireEvents = false;
87354
87367
  this.schedulePickEntity = false;
87355
87368
  this.schedulePickSurface = false;
87356
87369
  return;
@@ -87371,10 +87384,10 @@ class PickController {
87371
87384
  } else {
87372
87385
  this.pickedSurface = true;
87373
87386
  }
87374
- this._needFireEvents = true;
87387
+ this._needFireEvents++;
87375
87388
  } else if (this.scheduleSnapOrPick) {
87376
87389
  this.hoveredSnappedOrSurfaceOff = true;
87377
- this._needFireEvents = true;
87390
+ this._needFireEvents++;
87378
87391
  }
87379
87392
 
87380
87393
  } else { // schedulePickEntity == true
@@ -87386,7 +87399,7 @@ class PickController {
87386
87399
  if (this.pickResult) {
87387
87400
  this.picked = true;
87388
87401
  this.pickedSurface = false;
87389
- this._needFireEvents = true;
87402
+ this._needFireEvents++;
87390
87403
  }
87391
87404
  }
87392
87405
 
@@ -87397,7 +87410,7 @@ class PickController {
87397
87410
 
87398
87411
  fireEvents() {
87399
87412
 
87400
- if (!this._needFireEvents) {
87413
+ if (this._needFireEvents == 0) {
87401
87414
  return;
87402
87415
  }
87403
87416
 
@@ -87465,10 +87478,11 @@ class PickController {
87465
87478
 
87466
87479
  this.pickResult = null;
87467
87480
 
87468
- this._needFireEvents = false;
87481
+ this._needFireEvents = 0;
87469
87482
  }
87470
87483
 
87471
87484
  destroy() {
87485
+ this._scene.off(this._tickSub);
87472
87486
  }
87473
87487
  }
87474
87488