bruce-cesium 2.9.7 → 2.9.8

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.
@@ -5044,7 +5044,7 @@
5044
5044
  var semiMinorAxis = getValue$2(viewer, entity.ellipse.semiMinorAxis);
5045
5045
  var rotation = getValue$2(viewer, entity.ellipse.rotation);
5046
5046
  // More subdivisions means a more accurate ellipse but worse performance.
5047
- var numberOfSubdivisions = 100;
5047
+ var numberOfSubdivisions = 5;
5048
5048
  var positions = [];
5049
5049
  for (var i = 0; i < numberOfSubdivisions; i++) {
5050
5050
  var theta = i * (2 * Math.PI / numberOfSubdivisions);
@@ -5089,7 +5089,7 @@
5089
5089
  if (positions) {
5090
5090
  boundingSphere = computeBoundingSphereFromPositions(positions);
5091
5091
  if (cEntity.model) {
5092
- // Expand the bounding sphere for models due to our tolerance
5092
+ // We don't know how large models are so we'll just add a tolerance.
5093
5093
  boundingSphere.radius += Math.sqrt(MODEL_SIZE_TOLERANCE);
5094
5094
  }
5095
5095
  boundingSphereCache[cEntity.id] = boundingSphere;
@@ -5102,17 +5102,24 @@
5102
5102
  var visibility = cullingVolume.computeVisibility(boundingSphere);
5103
5103
  return visibility !== Cesium.Intersect.INSIDE && visibility !== Cesium.Intersect.INTERSECTING;
5104
5104
  }
5105
+ // Amount of entities to check per interval.
5105
5106
  var CHECK_BATCH = 500;
5106
- var LAST_RECHECK_KEY = Symbol("LAST_RECHECK_KEY");
5107
5107
  var checkInterval = null;
5108
5108
  var checkWaiting = false;
5109
+ // We will store the last recheck data on the camera.
5110
+ // This will allow us to check if the camera has moved enough to warrant a recheck.
5111
+ var LAST_RECHECK_KEY = Symbol("LAST_RECHECK_KEY");
5109
5112
  /**
5110
5113
  * We will recheck if the camera has turned or moved enough.
5111
5114
  * @param viewer
5112
5115
  * @returns
5113
5116
  */
5114
5117
  function shouldRecheck(viewer) {
5118
+ var _a;
5115
5119
  var camera = viewer.scene.camera;
5120
+ if (!((_a = camera === null || camera === void 0 ? void 0 : camera.position) === null || _a === void 0 ? void 0 : _a.x)) {
5121
+ return false;
5122
+ }
5116
5123
  var lastRecheck = camera[LAST_RECHECK_KEY];
5117
5124
  if (!lastRecheck) {
5118
5125
  camera[LAST_RECHECK_KEY] = {
@@ -5121,7 +5128,7 @@
5121
5128
  };
5122
5129
  return true;
5123
5130
  }
5124
- var _a = lastRecheck, position = _a.position, direction = _a.direction;
5131
+ var _b = lastRecheck, position = _b.position, direction = _b.direction;
5125
5132
  var posDiff = Cesium.Cartesian3.magnitude(Cesium.Cartesian3.subtract(position, camera.position, new Cesium.Cartesian3()));
5126
5133
  var dirDiff = Cesium.Cartesian3.magnitude(Cesium.Cartesian3.subtract(direction, camera.direction, new Cesium.Cartesian3()));
5127
5134
  var recheck = posDiff > 100 || dirDiff > 0.01;
@@ -5222,7 +5229,7 @@
5222
5229
  (_a = checkQueue.Call) === null || _a === void 0 ? void 0 : _a.call(checkQueue);
5223
5230
  });
5224
5231
  var RENDER_SECS_PASSED = 5;
5225
- var updateRemoval = register.Viewer.scene.postRender.addEventListener(function () {
5232
+ var updateRemoval = register.Viewer.scene.postUpdate.addEventListener(function () {
5226
5233
  var _a;
5227
5234
  var now = new Date();
5228
5235
  if (lastCullCheck == null || (now.getTime() - lastCullCheck.getTime()) > RENDER_SECS_PASSED * 1000) {
@@ -17503,7 +17510,7 @@
17503
17510
  ViewerUtils.CreateWidgets = CreateWidgets;
17504
17511
  })(exports.ViewerUtils || (exports.ViewerUtils = {}));
17505
17512
 
17506
- var VERSION$1 = "2.9.7";
17513
+ var VERSION$1 = "2.9.8";
17507
17514
 
17508
17515
  exports.VERSION = VERSION$1;
17509
17516
  exports.CesiumViewMonitor = CesiumViewMonitor;