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.
- package/dist/bruce-cesium.es5.js +14 -7
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +13 -6
- 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 +12 -5
- package/dist/lib/rendering/visual-register-culler.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/package.json +1 -1
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BruceEvent, Cartes, ProjectViewTile, Carto, Entity as Entity$1, Geometry, Tileset, MathUtils, LRUCache, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, Bounds, EntityRelationType, DelayQueue, BatchedDataGetter, EntityCoords, EntityFilterGetter, EntitySource, MenuItem, EntityRelation, ENVIRONMENT, ProjectView, ProjectViewBookmark, ProjectViewLegacyTile, ProgramKey, Camera, AbstractApi, EntityAttachment, EntityAttachmentType, EntityAttribute } from 'bruce-models';
|
|
2
2
|
import * as Cesium from 'cesium';
|
|
3
|
-
import { Cartographic, Cartesian2, CallbackProperty, Cartesian3, Color, Rectangle, Math as Math$1, JulianDate, HeightReference, DistanceDisplayCondition, NearFarScalar, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, Primitive, Cesium3DTileFeature, Cesium3DTileColorBlendMode, HeadingPitchRange, createOsmBuildings, Cesium3DTileStyle,
|
|
3
|
+
import { Cartographic, Cartesian2, CallbackProperty, Cartesian3, Color, Rectangle, Math as Math$1, JulianDate, HeightReference, DistanceDisplayCondition, NearFarScalar, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, Primitive, Cesium3DTileFeature, SceneMode, Cesium3DTileColorBlendMode, HeadingPitchRange, createOsmBuildings, Cesium3DTileStyle, KmlDataSource, OrthographicFrustum, EasingFunction, SceneTransforms, EllipsoidTerrainProvider, CesiumInspector, defined, EllipsoidGeodesic, sampleTerrainMostDetailed, Cesium3DTileset, Model, Matrix4, Matrix3, IonResource, Ion, createWorldTerrain, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, PolygonPipeline, ColorMaterialProperty, GeometryInstance, ScreenSpaceEventHandler, ScreenSpaceEventType, BoundingSphere, Intersect } from 'cesium';
|
|
4
4
|
|
|
5
5
|
var TIME_LAG = 300;
|
|
6
6
|
var POSITION_CHECK_TIMER = 950;
|
|
@@ -5052,7 +5052,7 @@ function getPositionsFromEntity(viewer, entity) {
|
|
|
5052
5052
|
var semiMinorAxis = getValue$2(viewer, entity.ellipse.semiMinorAxis);
|
|
5053
5053
|
var rotation = getValue$2(viewer, entity.ellipse.rotation);
|
|
5054
5054
|
// More subdivisions means a more accurate ellipse but worse performance.
|
|
5055
|
-
var numberOfSubdivisions =
|
|
5055
|
+
var numberOfSubdivisions = 5;
|
|
5056
5056
|
var positions = [];
|
|
5057
5057
|
for (var i = 0; i < numberOfSubdivisions; i++) {
|
|
5058
5058
|
var theta = i * (2 * Math.PI / numberOfSubdivisions);
|
|
@@ -5097,7 +5097,7 @@ function shouldCullEntity(viewer, cEntity) {
|
|
|
5097
5097
|
if (positions) {
|
|
5098
5098
|
boundingSphere = computeBoundingSphereFromPositions(positions);
|
|
5099
5099
|
if (cEntity.model) {
|
|
5100
|
-
//
|
|
5100
|
+
// We don't know how large models are so we'll just add a tolerance.
|
|
5101
5101
|
boundingSphere.radius += Math.sqrt(MODEL_SIZE_TOLERANCE);
|
|
5102
5102
|
}
|
|
5103
5103
|
boundingSphereCache[cEntity.id] = boundingSphere;
|
|
@@ -5110,17 +5110,24 @@ function shouldCullEntity(viewer, cEntity) {
|
|
|
5110
5110
|
var visibility = cullingVolume.computeVisibility(boundingSphere);
|
|
5111
5111
|
return visibility !== Intersect.INSIDE && visibility !== Intersect.INTERSECTING;
|
|
5112
5112
|
}
|
|
5113
|
+
// Amount of entities to check per interval.
|
|
5113
5114
|
var CHECK_BATCH = 500;
|
|
5114
|
-
var LAST_RECHECK_KEY = Symbol("LAST_RECHECK_KEY");
|
|
5115
5115
|
var checkInterval = null;
|
|
5116
5116
|
var checkWaiting = false;
|
|
5117
|
+
// We will store the last recheck data on the camera.
|
|
5118
|
+
// This will allow us to check if the camera has moved enough to warrant a recheck.
|
|
5119
|
+
var LAST_RECHECK_KEY = Symbol("LAST_RECHECK_KEY");
|
|
5117
5120
|
/**
|
|
5118
5121
|
* We will recheck if the camera has turned or moved enough.
|
|
5119
5122
|
* @param viewer
|
|
5120
5123
|
* @returns
|
|
5121
5124
|
*/
|
|
5122
5125
|
function shouldRecheck(viewer) {
|
|
5126
|
+
var _a;
|
|
5123
5127
|
var camera = viewer.scene.camera;
|
|
5128
|
+
if (!((_a = camera === null || camera === void 0 ? void 0 : camera.position) === null || _a === void 0 ? void 0 : _a.x)) {
|
|
5129
|
+
return false;
|
|
5130
|
+
}
|
|
5124
5131
|
var lastRecheck = camera[LAST_RECHECK_KEY];
|
|
5125
5132
|
if (!lastRecheck) {
|
|
5126
5133
|
camera[LAST_RECHECK_KEY] = {
|
|
@@ -5129,7 +5136,7 @@ function shouldRecheck(viewer) {
|
|
|
5129
5136
|
};
|
|
5130
5137
|
return true;
|
|
5131
5138
|
}
|
|
5132
|
-
var
|
|
5139
|
+
var _b = lastRecheck, position = _b.position, direction = _b.direction;
|
|
5133
5140
|
var posDiff = Cartesian3.magnitude(Cartesian3.subtract(position, camera.position, new Cartesian3()));
|
|
5134
5141
|
var dirDiff = Cartesian3.magnitude(Cartesian3.subtract(direction, camera.direction, new Cartesian3()));
|
|
5135
5142
|
var recheck = posDiff > 100 || dirDiff > 0.01;
|
|
@@ -5230,7 +5237,7 @@ var VisualRegisterCuller;
|
|
|
5230
5237
|
(_a = checkQueue.Call) === null || _a === void 0 ? void 0 : _a.call(checkQueue);
|
|
5231
5238
|
});
|
|
5232
5239
|
var RENDER_SECS_PASSED = 5;
|
|
5233
|
-
var updateRemoval = register.Viewer.scene.
|
|
5240
|
+
var updateRemoval = register.Viewer.scene.postUpdate.addEventListener(function () {
|
|
5234
5241
|
var _a;
|
|
5235
5242
|
var now = new Date();
|
|
5236
5243
|
if (lastCullCheck == null || (now.getTime() - lastCullCheck.getTime()) > RENDER_SECS_PASSED * 1000) {
|
|
@@ -17561,7 +17568,7 @@ var ViewerUtils;
|
|
|
17561
17568
|
ViewerUtils.CreateWidgets = CreateWidgets;
|
|
17562
17569
|
})(ViewerUtils || (ViewerUtils = {}));
|
|
17563
17570
|
|
|
17564
|
-
var VERSION$1 = "2.9.
|
|
17571
|
+
var VERSION$1 = "2.9.8";
|
|
17565
17572
|
|
|
17566
17573
|
export { VERSION$1 as VERSION, CesiumViewMonitor, ViewerUtils, MenuItemManager, EntityRenderEngine, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, Draw3dPolygon, Draw3dPolyline };
|
|
17567
17574
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|