bruce-cesium 7.3.0 → 7.3.1
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 +16 -13
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +14 -11
- 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 +13 -10
- 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 * as Cesium from 'cesium';
|
|
2
|
-
import { Cartographic,
|
|
3
|
-
import { Cartes, Entity as Entity$1, ProjectViewTile, ENVIRONMENT, Calculator, ClientFile, EntityLod, EntityTag, EntityType, LRUCache, ObjectUtils, Style, Carto, Geometry as Geometry$1, Api, MenuItem, ProjectView, ProjectViewBookmark, Tileset, ZoomControl, ClientFileValueMap, Color as Color$1, BruceEvent, EntityCoords,
|
|
2
|
+
import { Cartographic, Entity, DistanceDisplayCondition, ColorMaterialProperty, Color, Math as Math$1, Cartesian3, JulianDate, Quaternion, Transforms, HeadingPitchRoll, Matrix4, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature, ShaderSource, Ellipsoid, Geometry, GeometryAttribute, ComponentDatatype, PrimitiveType, BoundingSphere, GeometryPipeline, sampleTerrain, Texture, PixelFormat, Sampler, TextureWrap, TextureMinificationFilter, TextureMagnificationFilter, VertexArray, BufferUsage, ShaderProgram, RenderState, BlendingState, DrawCommand, Pass, Cartesian2, Cartesian4, HeightReference, ColorBlendMode, ShadowMode, ClassificationType, Model, ArcType, CornerType, ConstantPositionProperty, HorizontalOrigin, VerticalOrigin, ImageMaterialProperty, PolygonHierarchy, PolylineGraphics, Rectangle, SceneTransforms, NearFarScalar, Matrix3, KmlDataSource, GeoJsonDataSource, SceneMode, Cesium3DTileStyle, HeadingPitchRange, Ion, IonResource, Cesium3DTileColorBlendMode, Cesium3DTileset, OrthographicFrustum, EasingFunction, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, Intersect, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, PolygonPipeline, CesiumInspector, ClockRange, DynamicEnvironmentMapManager, CustomDataSource, GeometryInstance, ScreenSpaceEventHandler, ScreenSpaceEventType, Fullscreen, CzmlDataSource } from 'cesium';
|
|
3
|
+
import { Cartes, Entity as Entity$1, ProjectViewTile, ENVIRONMENT, Calculator, ClientFile, EntityLod, EntityTag, EntityType, LRUCache, ObjectUtils, Style, Carto, Geometry as Geometry$1, Api, MenuItem, ProjectView, ProjectViewBookmark, Tileset, ZoomControl, ClientFileValueMap, Color as Color$1, Bounds, BruceEvent, EntityCoords, DelayQueue, DataLab, AccountConcept, RecordChangeFeed, BruceApi, EntityRelation, EntitySource, Camera, ProgramKey, ProjectViewLegacyTile, Account, AccountLimits, Session, UrlUtils, ProjectViewBookmarkGroup, EntityAttachment, EntityAttachmentType, EntityAttribute, MathUtils, EntityRelationType, EntityHistoricData } from 'bruce-models';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Ensures a number is returned from a given value.
|
|
@@ -6591,7 +6591,7 @@ function shouldCullEntity(viewer, cEntity) {
|
|
|
6591
6591
|
const adjustedSphere = boundingSphere.sphere.clone();
|
|
6592
6592
|
// Terrain only matters here because it moves the sphere onto the ground.
|
|
6593
6593
|
// Far enough away that a plausible ground height is a rounding error against the viewing distance, sampling it is wasted work.
|
|
6594
|
-
const cameraDistance = Cartesian3.distance(camera.
|
|
6594
|
+
const cameraDistance = Cartesian3.distance(camera.positionWC, adjustedSphere.center);
|
|
6595
6595
|
if (cameraDistance > TERRAIN_SKIP_DISTANCE) {
|
|
6596
6596
|
adjustedSphere.radius += TERRAIN_SKIP_RADIUS_PAD;
|
|
6597
6597
|
}
|
|
@@ -6604,7 +6604,8 @@ function shouldCullEntity(viewer, cEntity) {
|
|
|
6604
6604
|
}
|
|
6605
6605
|
adjustedSphere.center = grounded;
|
|
6606
6606
|
}
|
|
6607
|
-
|
|
6607
|
+
// Camera vectors are frame relative while a reference frame is set (the compass orbits via lookAt).
|
|
6608
|
+
const cullingVolume = camera.frustum.computeCullingVolume(camera.positionWC, camera.directionWC, camera.upWC);
|
|
6608
6609
|
const visibility = cullingVolume.computeVisibility(adjustedSphere);
|
|
6609
6610
|
return visibility !== Intersect.INSIDE && visibility !== Intersect.INTERSECTING;
|
|
6610
6611
|
}
|
|
@@ -6631,14 +6632,14 @@ function shouldRecheck(viewer) {
|
|
|
6631
6632
|
return true;
|
|
6632
6633
|
}
|
|
6633
6634
|
const camera = viewer.scene.camera;
|
|
6634
|
-
if (!((_a = camera === null || camera === void 0 ? void 0 : camera.
|
|
6635
|
+
if (!((_a = camera === null || camera === void 0 ? void 0 : camera.positionWC) === null || _a === void 0 ? void 0 : _a.x)) {
|
|
6635
6636
|
return false;
|
|
6636
6637
|
}
|
|
6637
6638
|
const lastRecheck = camera[LAST_RECHECK_KEY];
|
|
6638
6639
|
if (!lastRecheck) {
|
|
6639
6640
|
camera[LAST_RECHECK_KEY] = {
|
|
6640
|
-
position: camera.
|
|
6641
|
-
direction: camera.
|
|
6641
|
+
position: camera.positionWC.clone(),
|
|
6642
|
+
direction: camera.directionWC.clone(),
|
|
6642
6643
|
tilesLoading: viewer.scene.globe.tilesLoaded
|
|
6643
6644
|
};
|
|
6644
6645
|
return true;
|
|
@@ -6647,14 +6648,14 @@ function shouldRecheck(viewer) {
|
|
|
6647
6648
|
const tilesLoadingDiff = lastRecheck.tilesLoading != viewer.scene.globe.tilesLoaded;
|
|
6648
6649
|
let recheck = tilesLoadingDiff;
|
|
6649
6650
|
if (!recheck) {
|
|
6650
|
-
const posDiff = Cartesian3.magnitude(Cartesian3.subtract(position, camera.
|
|
6651
|
-
const dirDiff = Cartesian3.magnitude(Cartesian3.subtract(direction, camera.
|
|
6651
|
+
const posDiff = Cartesian3.magnitude(Cartesian3.subtract(position, camera.positionWC, new Cartesian3()));
|
|
6652
|
+
const dirDiff = Cartesian3.magnitude(Cartesian3.subtract(direction, camera.directionWC, new Cartesian3()));
|
|
6652
6653
|
recheck = posDiff > 100 || dirDiff > 0.01;
|
|
6653
6654
|
}
|
|
6654
6655
|
if (recheck) {
|
|
6655
6656
|
camera[LAST_RECHECK_KEY] = {
|
|
6656
|
-
position: camera.
|
|
6657
|
-
direction: camera.
|
|
6657
|
+
position: camera.positionWC.clone(),
|
|
6658
|
+
direction: camera.directionWC.clone(),
|
|
6658
6659
|
tilesLoading: viewer.scene.globe.tilesLoaded
|
|
6659
6660
|
};
|
|
6660
6661
|
}
|
|
@@ -6707,7 +6708,9 @@ function cullTilesets(register) {
|
|
|
6707
6708
|
return;
|
|
6708
6709
|
}
|
|
6709
6710
|
const camera = viewer.scene.camera;
|
|
6710
|
-
|
|
6711
|
+
// Camera vectors are frame relative while a reference frame is set (the compass orbits via lookAt).
|
|
6712
|
+
// These spheres are world space, so only the world coordinate vectors compare against them correctly.
|
|
6713
|
+
const cullingVolume = camera.frustum.computeCullingVolume(camera.positionWC, camera.directionWC, camera.upWC);
|
|
6711
6714
|
let changed = false;
|
|
6712
6715
|
for (const rego of tilesets) {
|
|
6713
6716
|
const tileset = rego.tileset;
|
|
@@ -46391,7 +46394,7 @@ var StyleUtils;
|
|
|
46391
46394
|
StyleUtils.ApplyTypeStyle = ApplyTypeStyle;
|
|
46392
46395
|
})(StyleUtils || (StyleUtils = {}));
|
|
46393
46396
|
|
|
46394
|
-
const VERSION = "7.3.
|
|
46397
|
+
const VERSION = "7.3.1";
|
|
46395
46398
|
/**
|
|
46396
46399
|
* Updates the environment instance used by bruce-cesium to one specified.
|
|
46397
46400
|
* This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.
|