bruce-cesium 7.0.6 → 7.0.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.
- package/dist/bruce-cesium.es5.js +60 -12
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +58 -10
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/visual-register-culler.js +49 -8
- package/dist/lib/rendering/visual-register-culler.js.map +1 -1
- package/dist/lib/rendering/visuals-register.js +9 -1
- package/dist/lib/rendering/visuals-register.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/visual-register-culler.d.ts +15 -1
- package/dist/types/rendering/visuals-register.d.ts +4 -0
- package/package.json +1 -1
package/dist/bruce-cesium.umd.js
CHANGED
|
@@ -6010,7 +6010,7 @@
|
|
|
6010
6010
|
}
|
|
6011
6011
|
if (height == null || isNaN(height)) {
|
|
6012
6012
|
// Terrain tile not loaded yet. Don't record it, so a later pass can sample it properly.
|
|
6013
|
-
return coarseCell ? coarseCell.offset :
|
|
6013
|
+
return coarseCell ? coarseCell.offset : NaN;
|
|
6014
6014
|
}
|
|
6015
6015
|
// Always fold into the coarse cell as well, so its spread keeps being learned even while the finer grid is
|
|
6016
6016
|
// answering lookups for this region.
|
|
@@ -6033,6 +6033,9 @@
|
|
|
6033
6033
|
return pos3d;
|
|
6034
6034
|
}
|
|
6035
6035
|
const offset = getTerrainOffset(viewer, pos3d);
|
|
6036
|
+
if (typeof offset == "number" && isNaN(offset)) {
|
|
6037
|
+
return null;
|
|
6038
|
+
}
|
|
6036
6039
|
if (!offset) {
|
|
6037
6040
|
return pos3d;
|
|
6038
6041
|
}
|
|
@@ -6282,7 +6285,13 @@
|
|
|
6282
6285
|
adjustedSphere.radius += TERRAIN_SKIP_RADIUS_PAD;
|
|
6283
6286
|
}
|
|
6284
6287
|
else {
|
|
6285
|
-
|
|
6288
|
+
const grounded = adjustPos3d(viewer, boundingSphere.heightRef, adjustedSphere.center);
|
|
6289
|
+
if (!grounded) {
|
|
6290
|
+
// Where this sits depends on ground we have not loaded yet. Guessing means guessing wrong sometimes,
|
|
6291
|
+
// and a wrong cull hides something that is on screen with nothing to bring it back.
|
|
6292
|
+
return false;
|
|
6293
|
+
}
|
|
6294
|
+
adjustedSphere.center = grounded;
|
|
6286
6295
|
}
|
|
6287
6296
|
const cullingVolume = camera.frustum.computeCullingVolume(camera.position, camera.direction, camera.up);
|
|
6288
6297
|
const visibility = cullingVolume.computeVisibility(adjustedSphere);
|
|
@@ -6360,7 +6369,7 @@
|
|
|
6360
6369
|
rego.editing == true ||
|
|
6361
6370
|
// Part of a collection we did not create, eg. a geojson data source, which may have its own rules for
|
|
6362
6371
|
// what is in the scene. Our own per-menu-item data sources are fair game.
|
|
6363
|
-
|
|
6372
|
+
exports.VisualsRegister.IsForeignCollection(rego) ||
|
|
6364
6373
|
// We won't cull historic records as they may be interpolating their locations.
|
|
6365
6374
|
Boolean(rego.outline && rego.outline.some(x => !!x.DateTime))) {
|
|
6366
6375
|
return true;
|
|
@@ -6646,6 +6655,28 @@
|
|
|
6646
6655
|
return isCullingIgnored(viewer, rego);
|
|
6647
6656
|
}
|
|
6648
6657
|
VisualRegisterCuller.IsCullingIgnored = IsCullingIgnored;
|
|
6658
|
+
/**
|
|
6659
|
+
* Drops any scene add/remove the culler has queued for these graphics.
|
|
6660
|
+
* Emits whether a removal was among them.
|
|
6661
|
+
* @param visuals an entity or an array of them.
|
|
6662
|
+
* @returns whether a queued removal was cancelled, ie. whether this graphic was on its way out.
|
|
6663
|
+
*/
|
|
6664
|
+
function CancelQueuedSceneChange(visuals) {
|
|
6665
|
+
const list = Array.isArray(visuals) ? visuals : [visuals];
|
|
6666
|
+
let hadRemoval = false;
|
|
6667
|
+
for (let i = 0; i < list.length; i++) {
|
|
6668
|
+
const visual = list[i];
|
|
6669
|
+
if (!(visual instanceof Cesium.Entity)) {
|
|
6670
|
+
continue;
|
|
6671
|
+
}
|
|
6672
|
+
if (entityRemoveAddState.get(visual.id) === false) {
|
|
6673
|
+
hadRemoval = true;
|
|
6674
|
+
}
|
|
6675
|
+
entityRemoveAddState.delete(visual.id);
|
|
6676
|
+
}
|
|
6677
|
+
return hadRemoval;
|
|
6678
|
+
}
|
|
6679
|
+
VisualRegisterCuller.CancelQueuedSceneChange = CancelQueuedSceneChange;
|
|
6649
6680
|
/**
|
|
6650
6681
|
* Discards what the culler knows about an entity's extent, so its next check measures the geometry again.
|
|
6651
6682
|
* The last cull decision is deliberately kept, see the loop below.
|
|
@@ -6677,6 +6708,19 @@
|
|
|
6677
6708
|
invalidateBounds(ids);
|
|
6678
6709
|
}
|
|
6679
6710
|
VisualRegisterCuller.InvalidateBounds = InvalidateBounds;
|
|
6711
|
+
/**
|
|
6712
|
+
* Measures a graphic against the current view and says whether it is out of frame.
|
|
6713
|
+
*/
|
|
6714
|
+
function ShouldCull(viewer, visual) {
|
|
6715
|
+
if (!(visual instanceof Cesium.Entity)) {
|
|
6716
|
+
return false;
|
|
6717
|
+
}
|
|
6718
|
+
return shouldCullEntity(viewer, visual);
|
|
6719
|
+
}
|
|
6720
|
+
VisualRegisterCuller.ShouldCull = ShouldCull;
|
|
6721
|
+
/**
|
|
6722
|
+
* Whether the last cull pass decided this graphic was out of frame.
|
|
6723
|
+
*/
|
|
6680
6724
|
function IsCulled(viewer, rego, visual) {
|
|
6681
6725
|
if (isCullingIgnored(viewer, rego)) {
|
|
6682
6726
|
return false;
|
|
@@ -6685,11 +6729,7 @@
|
|
|
6685
6729
|
return false;
|
|
6686
6730
|
}
|
|
6687
6731
|
if (visual instanceof Cesium.Entity) {
|
|
6688
|
-
|
|
6689
|
-
if (status == null) {
|
|
6690
|
-
status = visual[VisualRegisterCuller.VISUAL_CULL_KEY] = shouldCullEntity(viewer, visual);
|
|
6691
|
-
}
|
|
6692
|
-
return status;
|
|
6732
|
+
return visual[VisualRegisterCuller.VISUAL_CULL_KEY] == true;
|
|
6693
6733
|
}
|
|
6694
6734
|
return false;
|
|
6695
6735
|
}
|
|
@@ -7047,6 +7087,13 @@
|
|
|
7047
7087
|
return Object.keys(state).length === idKeys;
|
|
7048
7088
|
}
|
|
7049
7089
|
(function (VisualsRegister) {
|
|
7090
|
+
/**
|
|
7091
|
+
* Whether a visual lives in a collection somebody else owns, eg. a geojson or KML data source that manages its own scene membership.
|
|
7092
|
+
*/
|
|
7093
|
+
function IsForeignCollection(rego) {
|
|
7094
|
+
return Boolean(rego === null || rego === void 0 ? void 0 : rego.collection) && !IsCCollectionOwned(rego.collection);
|
|
7095
|
+
}
|
|
7096
|
+
VisualsRegister.IsForeignCollection = IsForeignCollection;
|
|
7050
7097
|
let EVisualUpdateType;
|
|
7051
7098
|
(function (EVisualUpdateType) {
|
|
7052
7099
|
EVisualUpdateType["Add"] = "ADD";
|
|
@@ -8178,7 +8225,8 @@
|
|
|
8178
8225
|
if (!(part instanceof Cesium.Entity)) {
|
|
8179
8226
|
continue;
|
|
8180
8227
|
}
|
|
8181
|
-
const
|
|
8228
|
+
const removalPending = VisualRegisterCuller.CancelQueuedSceneChange(part);
|
|
8229
|
+
const wasCulled = part[VisualRegisterCuller.VISUAL_CULL_KEY] == true || removalPending;
|
|
8182
8230
|
delete part[VisualRegisterCuller.VISUAL_CULL_KEY];
|
|
8183
8231
|
if (wasCulled && !IsCEntityInScene(this.viewer, part)) {
|
|
8184
8232
|
AddCEntityToScene(this.viewer, part, rego.collection);
|
|
@@ -40293,7 +40341,7 @@
|
|
|
40293
40341
|
StyleUtils.ApplyTypeStyle = ApplyTypeStyle;
|
|
40294
40342
|
})(exports.StyleUtils || (exports.StyleUtils = {}));
|
|
40295
40343
|
|
|
40296
|
-
const VERSION = "7.0.
|
|
40344
|
+
const VERSION = "7.0.8";
|
|
40297
40345
|
/**
|
|
40298
40346
|
* Updates the environment instance used by bruce-cesium to one specified.
|
|
40299
40347
|
* This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.
|