bruce-cesium 6.5.5 → 6.5.7
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 +93 -144
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +91 -142
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/entity-render-engine-model3d.js +17 -4
- package/dist/lib/rendering/entity-render-engine-model3d.js.map +1 -1
- package/dist/lib/rendering/getters/entity-filter-getter.js +4 -0
- package/dist/lib/rendering/getters/entity-filter-getter.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js +1 -0
- package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js +1 -0
- package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +2 -0
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/other/assembly-render-manager.js +9 -85
- package/dist/lib/rendering/render-managers/other/assembly-render-manager.js.map +1 -1
- package/dist/lib/utils/entity-utils.js +53 -50
- package/dist/lib/utils/entity-utils.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/utils/entity-utils.d.ts +5 -0
- package/package.json +2 -2
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Cartes, Entity as Entity$1, Calculator, EntityRelationType, EntityType, Style, ENVIRONMENT, ProjectViewTile, DelayQueue, LRUCache, BruceEvent, ObjectUtils, Geometry, EntityHistoricData, EntityLod, ZoomControl, EntityTag, Tileset, Api, EntityCoords, DataLab, EntitySource, ClientFile, MenuItem, EntityRelation, ProgramKey,
|
|
1
|
+
import { Cartes, Entity as Entity$1, Calculator, EntityRelationType, EntityType, Style, ENVIRONMENT, ProjectViewTile, DelayQueue, LRUCache, BruceEvent, ObjectUtils, Geometry, EntityHistoricData, EntityLod, ZoomControl, EntityTag, Tileset, Api, EntityCoords, DataLab, EntitySource, ClientFile, MenuItem, EntityRelation, ProgramKey, Bounds, Carto, ProjectView, ProjectViewBookmark, ProjectViewLegacyTile, Camera, AbstractApi, EntityAttachment, EntityAttachmentType, EntityAttribute, MathUtils, Session } from 'bruce-models';
|
|
2
2
|
import * as Cesium from 'cesium';
|
|
3
|
-
import { Cartographic, ColorMaterialProperty, Entity, Color, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature,
|
|
3
|
+
import { Cartographic, ColorMaterialProperty, Entity, Color, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature, Math as Math$1, Cartesian3, JulianDate, Quaternion, Transforms, HeadingPitchRoll, Matrix4, DistanceDisplayCondition, HeightReference, ColorBlendMode, ShadowMode, ClassificationType, Model, HorizontalOrigin, VerticalOrigin, ConstantPositionProperty, PolygonHierarchy, PolylineGraphics, ArcType, CornerType, Cartesian2, SceneTransforms, NearFarScalar, Matrix3, Rectangle, KmlDataSource, GeoJsonDataSource, SceneMode, Cesium3DTileStyle, HeadingPitchRange, Cesium3DTileColorBlendMode, Ion, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, IonResource, Cesium3DTileset, OrthographicFrustum, EasingFunction, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, PolygonPipeline, BoundingSphere, GeometryInstance, CesiumInspector, ClockRange, ScreenSpaceEventHandler, ScreenSpaceEventType, Intersect, CzmlDataSource, Fullscreen } from 'cesium';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Ensures a number is returned from a given value.
|
|
@@ -8640,6 +8640,7 @@ var EntitiesRenderManager;
|
|
|
8640
8640
|
historicPoint: this.viewer.clock.currentTime.toString(),
|
|
8641
8641
|
schemaId: (_e = this.item.BruceEntity) === null || _e === void 0 ? void 0 : _e.schemaId,
|
|
8642
8642
|
expandSources: true,
|
|
8643
|
+
expandLocation: true,
|
|
8643
8644
|
scenario: this.scenario,
|
|
8644
8645
|
migrated: true,
|
|
8645
8646
|
maxSearchTimeSec: 60 * 2
|
|
@@ -8748,6 +8749,7 @@ var EntitiesRenderManager;
|
|
|
8748
8749
|
schemaId: (_c = this.item.BruceEntity) === null || _c === void 0 ? void 0 : _c.schemaId,
|
|
8749
8750
|
scenario: this.scenario,
|
|
8750
8751
|
expandSources: true,
|
|
8752
|
+
expandLocation: true,
|
|
8751
8753
|
migrated: true,
|
|
8752
8754
|
maxSearchTimeSec: 60 * 2
|
|
8753
8755
|
});
|
|
@@ -9680,6 +9682,7 @@ var EntitiesLoadedRenderManager;
|
|
|
9680
9682
|
api,
|
|
9681
9683
|
entityIds,
|
|
9682
9684
|
expandSources: true,
|
|
9685
|
+
expandLocation: true,
|
|
9683
9686
|
migrated: true,
|
|
9684
9687
|
maxSearchTimeSec: 60 * 2
|
|
9685
9688
|
});
|
|
@@ -10342,6 +10345,7 @@ var EntitiesIdsRenderManager;
|
|
|
10342
10345
|
historicPoint: newDateTime,
|
|
10343
10346
|
historicKey: this.item.BruceEntity.historicAttrKey,
|
|
10344
10347
|
expandSources: true,
|
|
10348
|
+
expandLocation: true,
|
|
10345
10349
|
migrated: true,
|
|
10346
10350
|
// If we're taking 5+ minutes to make a query, it's a dud.
|
|
10347
10351
|
// This is a timeout imposed on our DB and not external sources.
|
|
@@ -13064,6 +13068,8 @@ var EntityFilterGetter;
|
|
|
13064
13068
|
scenario: this.scenario,
|
|
13065
13069
|
historicKey: this.historicAttrKey,
|
|
13066
13070
|
historicPoint: (this.historicAttrKey || this.historic) ? this.historicAttrDateTime : null,
|
|
13071
|
+
expandSources: true,
|
|
13072
|
+
expandLocation: true,
|
|
13067
13073
|
schemaId: this.schemaId,
|
|
13068
13074
|
filter: {
|
|
13069
13075
|
pageSize: PAGE_SIZE,
|
|
@@ -13233,6 +13239,8 @@ var EntityFilterGetter;
|
|
|
13233
13239
|
scenario: this.scenario,
|
|
13234
13240
|
historicKey: this.historicAttrKey,
|
|
13235
13241
|
historicPoint: historicAttrDateTime,
|
|
13242
|
+
expandSources: true,
|
|
13243
|
+
expandLocation: true,
|
|
13236
13244
|
schemaId: this.schemaId,
|
|
13237
13245
|
filter: {
|
|
13238
13246
|
pageSize: batch.length,
|
|
@@ -18949,8 +18957,14 @@ var AssemblyRenderManager;
|
|
|
18949
18957
|
// Won't bother with vector data for this experiment.
|
|
18950
18958
|
continue;
|
|
18951
18959
|
}
|
|
18952
|
-
const pos3d =
|
|
18953
|
-
|
|
18960
|
+
const pos3d = EntityUtils.GetPos({
|
|
18961
|
+
viewer: this.viewer,
|
|
18962
|
+
entity,
|
|
18963
|
+
recordHeightRef: HeightReference.NONE,
|
|
18964
|
+
returnHeightRef: HeightReference.NONE,
|
|
18965
|
+
allowRendered: false
|
|
18966
|
+
});
|
|
18967
|
+
const orient = EntityUtils.GetAssemblyOrientation(entity, pos3d);
|
|
18954
18968
|
if (!pos3d || !orient) {
|
|
18955
18969
|
continue;
|
|
18956
18970
|
}
|
|
@@ -19220,87 +19234,6 @@ var AssemblyRenderManager;
|
|
|
19220
19234
|
}
|
|
19221
19235
|
AssemblyRenderManager.Manager = Manager;
|
|
19222
19236
|
})(AssemblyRenderManager || (AssemblyRenderManager = {}));
|
|
19223
|
-
const axis_shift = new Quaternion(0, 0, -Math.SQRT1_2, Math.SQRT1_2);
|
|
19224
|
-
function calcEntityLocation(entity, modelSpace) {
|
|
19225
|
-
let aRootLocation = entity.Bruce.AssemblyRootLocation;
|
|
19226
|
-
// If we're in model-space we cull location.
|
|
19227
|
-
// This puts it at 0,0 lat/lon which we treat as 0,0,0 for model-space viewing.
|
|
19228
|
-
if (modelSpace) {
|
|
19229
|
-
aRootLocation = null;
|
|
19230
|
-
}
|
|
19231
|
-
const worldPosition = entity.Bruce.AssemblyWorldPosition;
|
|
19232
|
-
if (!worldPosition) {
|
|
19233
|
-
return null;
|
|
19234
|
-
}
|
|
19235
|
-
let offset = new Cartesian3(+worldPosition[0][3], +worldPosition[1][3], +worldPosition[2][3]);
|
|
19236
|
-
let heading = 0;
|
|
19237
|
-
let pitch = 0;
|
|
19238
|
-
let roll = 0;
|
|
19239
|
-
if (!modelSpace) {
|
|
19240
|
-
const eTransform = entity.Bruce.Transform;
|
|
19241
|
-
if (eTransform) {
|
|
19242
|
-
if (eTransform.heading) {
|
|
19243
|
-
heading = eTransform.heading;
|
|
19244
|
-
}
|
|
19245
|
-
if (eTransform.pitch) {
|
|
19246
|
-
pitch = eTransform.pitch;
|
|
19247
|
-
}
|
|
19248
|
-
if (eTransform.roll) {
|
|
19249
|
-
roll = eTransform.roll;
|
|
19250
|
-
}
|
|
19251
|
-
}
|
|
19252
|
-
}
|
|
19253
|
-
let pos3d = Cartesian3.fromDegrees(EnsureNumber(aRootLocation === null || aRootLocation === void 0 ? void 0 : aRootLocation.longitude), EnsureNumber(aRootLocation === null || aRootLocation === void 0 ? void 0 : aRootLocation.latitude), EnsureNumber(aRootLocation === null || aRootLocation === void 0 ? void 0 : aRootLocation.altitude));
|
|
19254
|
-
const m1 = Transforms.eastNorthUpToFixedFrame(pos3d);
|
|
19255
|
-
const hpr = HeadingPitchRoll.fromDegrees(EnsureNumber(heading), EnsureNumber(pitch), EnsureNumber(roll), new HeadingPitchRoll());
|
|
19256
|
-
const transform = Matrix3.fromHeadingPitchRoll(hpr);
|
|
19257
|
-
const transformedOffset = Matrix3.multiplyByVector(transform, offset, new Cartesian3());
|
|
19258
|
-
pos3d = Matrix4.multiplyByPoint(m1, transformedOffset, new Cartesian3());
|
|
19259
|
-
return pos3d;
|
|
19260
|
-
}
|
|
19261
|
-
function calcEntityOrientation(entity, pos3d, modelSpace) {
|
|
19262
|
-
if (!entity.Bruce || !pos3d) {
|
|
19263
|
-
return null;
|
|
19264
|
-
}
|
|
19265
|
-
// 0 or 90 for these?
|
|
19266
|
-
let heading = 90;
|
|
19267
|
-
let pitch = 0;
|
|
19268
|
-
let roll = 0;
|
|
19269
|
-
if (!modelSpace) {
|
|
19270
|
-
const eTransform = entity.Bruce.Transform;
|
|
19271
|
-
if (eTransform) {
|
|
19272
|
-
if (eTransform.heading) {
|
|
19273
|
-
heading = eTransform.heading;
|
|
19274
|
-
}
|
|
19275
|
-
if (eTransform.pitch) {
|
|
19276
|
-
pitch = eTransform.pitch;
|
|
19277
|
-
}
|
|
19278
|
-
if (eTransform.roll) {
|
|
19279
|
-
roll = eTransform.roll;
|
|
19280
|
-
}
|
|
19281
|
-
}
|
|
19282
|
-
}
|
|
19283
|
-
let hpr = HeadingPitchRoll.fromDegrees(EnsureNumber(heading), EnsureNumber(pitch), EnsureNumber(roll));
|
|
19284
|
-
let orientation = Transforms.headingPitchRollQuaternion(pos3d, hpr);
|
|
19285
|
-
if (entity.Bruce.AssemblyWorldPosition) {
|
|
19286
|
-
// extract rot, scale
|
|
19287
|
-
const awp = entity.Bruce.AssemblyWorldPosition;
|
|
19288
|
-
const mawp = new Matrix4(+awp[0][0], +awp[0][1], +awp[0][2], +awp[0][3], +awp[1][0], +awp[1][1], +awp[1][2], +awp[1][3], +awp[2][0], +awp[2][1], +awp[2][2], +awp[2][3], +awp[3][0], +awp[3][1], +awp[3][2], +awp[3][3]);
|
|
19289
|
-
let rotmat = new Matrix3();
|
|
19290
|
-
rotmat = Matrix4.getRotation(mawp, rotmat);
|
|
19291
|
-
// chuck on a heading rotation of +90
|
|
19292
|
-
// according to docs, that is around -z
|
|
19293
|
-
// https://cesium.com/learn/ion-sdk/ref-doc/HeadingPitchRoll.html
|
|
19294
|
-
// see axis_shift quat defined above (could possibly be -ve z value)
|
|
19295
|
-
const q = Quaternion.fromRotationMatrix(rotmat);
|
|
19296
|
-
hpr = HeadingPitchRoll.fromQuaternion(q);
|
|
19297
|
-
orientation = Transforms.headingPitchRollQuaternion(pos3d, hpr);
|
|
19298
|
-
// add another h +90, quats multiply to concat rotations - but are not
|
|
19299
|
-
// subject to order of rotation like HPR
|
|
19300
|
-
orientation = Quaternion.multiply(orientation, axis_shift, new Quaternion());
|
|
19301
|
-
}
|
|
19302
|
-
return orientation;
|
|
19303
|
-
}
|
|
19304
19237
|
|
|
19305
19238
|
/**
|
|
19306
19239
|
* Utility to keep track of enabled menu items within a Cesium viewer.
|
|
@@ -28880,63 +28813,42 @@ const getLocationFromFeature = (feature) => {
|
|
|
28880
28813
|
}
|
|
28881
28814
|
return result;
|
|
28882
28815
|
};
|
|
28883
|
-
function calcEntityLocation
|
|
28884
|
-
|
|
28885
|
-
|
|
28886
|
-
// This puts it at 0,0 lat/lon which we treat as 0,0,0 for model-space viewing.
|
|
28887
|
-
if (modelSpace) {
|
|
28888
|
-
aRootLocation = null;
|
|
28889
|
-
}
|
|
28890
|
-
const worldPosition = entity.Bruce.AssemblyWorldPosition;
|
|
28816
|
+
function calcEntityLocation(entity, modelSpace) {
|
|
28817
|
+
var _a, _b, _c;
|
|
28818
|
+
const worldPosition = (_a = entity.Bruce) === null || _a === void 0 ? void 0 : _a.AssemblyWorldPosition;
|
|
28891
28819
|
if (!worldPosition) {
|
|
28892
28820
|
return null;
|
|
28893
28821
|
}
|
|
28894
|
-
|
|
28895
|
-
|
|
28896
|
-
|
|
28897
|
-
|
|
28898
|
-
|
|
28899
|
-
|
|
28900
|
-
|
|
28901
|
-
|
|
28902
|
-
|
|
28903
|
-
|
|
28904
|
-
|
|
28905
|
-
|
|
28906
|
-
|
|
28907
|
-
const inverseRotmat = Matrix3.transpose(rotmat, new Matrix3());
|
|
28908
|
-
offset = Matrix3.multiplyByVector(inverseRotmat, translation, new Cartesian3());
|
|
28909
|
-
}
|
|
28910
|
-
// For translation-only matrices, extract translation directly.
|
|
28911
|
-
else {
|
|
28912
|
-
offset = new Cartesian3(+worldPosition[0][3], +worldPosition[1][3], +worldPosition[2][3]);
|
|
28913
|
-
}
|
|
28914
|
-
}
|
|
28915
|
-
let heading = 0;
|
|
28916
|
-
let pitch = 0;
|
|
28917
|
-
let roll = 0;
|
|
28918
|
-
if (!modelSpace) {
|
|
28919
|
-
const eTransform = entity.Bruce.Transform;
|
|
28920
|
-
if (eTransform) {
|
|
28921
|
-
if (eTransform.heading) {
|
|
28922
|
-
heading = eTransform.heading;
|
|
28923
|
-
}
|
|
28924
|
-
if (eTransform.pitch) {
|
|
28925
|
-
pitch = eTransform.pitch;
|
|
28926
|
-
}
|
|
28927
|
-
if (eTransform.roll) {
|
|
28928
|
-
roll = eTransform.roll;
|
|
28929
|
-
}
|
|
28930
|
-
}
|
|
28822
|
+
// The translation column of AssemblyWorldPosition is in ENU space:
|
|
28823
|
+
// [0][3] = East offset (m)
|
|
28824
|
+
// [1][3] = North offset (m)
|
|
28825
|
+
// [2][3] = Up/altitude offset (m)
|
|
28826
|
+
// All relative to the Assembly root's world location.
|
|
28827
|
+
// "Bruce.Location" stores the geometry-pivot centre instead of the Entity origin.
|
|
28828
|
+
// So we compute directly from the matrix translation to get the model origin position.
|
|
28829
|
+
const tx = +worldPosition[0][3];
|
|
28830
|
+
const ty = +worldPosition[1][3];
|
|
28831
|
+
const tz = +worldPosition[2][3];
|
|
28832
|
+
let rootPos;
|
|
28833
|
+
if (modelSpace) {
|
|
28834
|
+
rootPos = Cartesian3.fromDegrees(0, 0, 0);
|
|
28931
28835
|
}
|
|
28932
|
-
|
|
28933
|
-
|
|
28934
|
-
|
|
28935
|
-
|
|
28936
|
-
const
|
|
28937
|
-
|
|
28938
|
-
|
|
28836
|
+
else {
|
|
28837
|
+
const rootLoc = (_b = entity.Bruce) === null || _b === void 0 ? void 0 : _b.AssemblyRootLocation;
|
|
28838
|
+
rootPos = Cartesian3.fromDegrees(EnsureNumber(rootLoc === null || rootLoc === void 0 ? void 0 : rootLoc.longitude), EnsureNumber(rootLoc === null || rootLoc === void 0 ? void 0 : rootLoc.latitude), EnsureNumber(rootLoc === null || rootLoc === void 0 ? void 0 : rootLoc.altitude));
|
|
28839
|
+
}
|
|
28840
|
+
const enuFrame = Transforms.eastNorthUpToFixedFrame(rootPos);
|
|
28841
|
+
// Rotate using root hpr before we apply the local offset.
|
|
28842
|
+
const rootTransform = (_c = entity.Bruce) === null || _c === void 0 ? void 0 : _c.AssemblyRootTransform;
|
|
28843
|
+
if (rootTransform) {
|
|
28844
|
+
const rootHpr = new HeadingPitchRoll(Math$1.toRadians(EnsureNumber(rootTransform.heading)), Math$1.toRadians(EnsureNumber(rootTransform.pitch)), Math$1.toRadians(EnsureNumber(rootTransform.roll)));
|
|
28845
|
+
const hprMat4 = Matrix4.fromRotationTranslation(Matrix3.fromHeadingPitchRoll(rootHpr), Cartesian3.ZERO, new Matrix4());
|
|
28846
|
+
Matrix4.multiply(enuFrame, hprMat4, enuFrame);
|
|
28847
|
+
}
|
|
28848
|
+
return Matrix4.multiplyByPoint(enuFrame, new Cartesian3(tx, ty, tz), new Cartesian3());
|
|
28939
28849
|
}
|
|
28850
|
+
// +90° rotation around Z: aligns GLTF Y-up forward with Cesium ENU North.
|
|
28851
|
+
const _assemblyAxisShift = new Quaternion(0, 0, -Math.SQRT1_2, Math.SQRT1_2);
|
|
28940
28852
|
var EntityUtils;
|
|
28941
28853
|
(function (EntityUtils) {
|
|
28942
28854
|
/**
|
|
@@ -29402,7 +29314,7 @@ var EntityUtils;
|
|
|
29402
29314
|
}
|
|
29403
29315
|
let pos3d = null;
|
|
29404
29316
|
if (modelSpace) {
|
|
29405
|
-
pos3d = calcEntityLocation
|
|
29317
|
+
pos3d = calcEntityLocation(entity, modelSpace);
|
|
29406
29318
|
}
|
|
29407
29319
|
else {
|
|
29408
29320
|
const eLocation = Entity$1.GetValue({
|
|
@@ -29700,7 +29612,7 @@ var EntityUtils;
|
|
|
29700
29612
|
}
|
|
29701
29613
|
function evaluateRecord() {
|
|
29702
29614
|
if (isAssemblyEntity) {
|
|
29703
|
-
return calcEntityLocation
|
|
29615
|
+
return calcEntityLocation(entity, isModelSpace);
|
|
29704
29616
|
}
|
|
29705
29617
|
const location = Entity$1.GetValue({
|
|
29706
29618
|
entity: entity,
|
|
@@ -29793,6 +29705,30 @@ var EntityUtils;
|
|
|
29793
29705
|
});
|
|
29794
29706
|
}
|
|
29795
29707
|
EntityUtils.GetPos = GetPos;
|
|
29708
|
+
/**
|
|
29709
|
+
* Returns the orientation quaternion for an assembly entity using its world position matrix.
|
|
29710
|
+
* Uses the rotation component of AssemblyWorldPosition to match the tileset rendering.
|
|
29711
|
+
*/
|
|
29712
|
+
function GetAssemblyOrientation(entity, pos3d) {
|
|
29713
|
+
var _a, _b;
|
|
29714
|
+
const awp = (_a = entity === null || entity === void 0 ? void 0 : entity.Bruce) === null || _a === void 0 ? void 0 : _a.AssemblyWorldPosition;
|
|
29715
|
+
if (!awp || !pos3d) {
|
|
29716
|
+
return null;
|
|
29717
|
+
}
|
|
29718
|
+
const mawp = new Matrix4(+awp[0][0], +awp[0][1], +awp[0][2], +awp[0][3], +awp[1][0], +awp[1][1], +awp[1][2], +awp[1][3], +awp[2][0], +awp[2][1], +awp[2][2], +awp[2][3], +awp[3][0], +awp[3][1], +awp[3][2], +awp[3][3]);
|
|
29719
|
+
let rotmat = new Matrix3();
|
|
29720
|
+
rotmat = Matrix4.getRotation(mawp, rotmat);
|
|
29721
|
+
const q = Quaternion.fromRotationMatrix(rotmat);
|
|
29722
|
+
// Build root-HPR orientation in ECEF at the entity's position, then compose the
|
|
29723
|
+
// entity's local rotation on top — matching how tilesets apply the root transform.
|
|
29724
|
+
const rootTransform = (_b = entity === null || entity === void 0 ? void 0 : entity.Bruce) === null || _b === void 0 ? void 0 : _b.AssemblyRootTransform;
|
|
29725
|
+
const rootHpr = new HeadingPitchRoll(Math$1.toRadians(EnsureNumber(rootTransform === null || rootTransform === void 0 ? void 0 : rootTransform.heading)), Math$1.toRadians(EnsureNumber(rootTransform === null || rootTransform === void 0 ? void 0 : rootTransform.pitch)), Math$1.toRadians(EnsureNumber(rootTransform === null || rootTransform === void 0 ? void 0 : rootTransform.roll)));
|
|
29726
|
+
const rootOrientation = Transforms.headingPitchRollQuaternion(pos3d, rootHpr);
|
|
29727
|
+
const combined = Quaternion.multiply(rootOrientation, q, new Quaternion());
|
|
29728
|
+
// Correct for GLTF Y-up vs Cesium ENU Z-up axis convention (+90° around Z).
|
|
29729
|
+
return Quaternion.multiply(combined, _assemblyAxisShift, new Quaternion());
|
|
29730
|
+
}
|
|
29731
|
+
EntityUtils.GetAssemblyOrientation = GetAssemblyOrientation;
|
|
29796
29732
|
/**
|
|
29797
29733
|
* Returns the position of the entity.
|
|
29798
29734
|
* This is an async variant that checks for related assemblies.
|
|
@@ -31619,11 +31555,12 @@ var EntityRenderEngineModel3d;
|
|
|
31619
31555
|
* @returns
|
|
31620
31556
|
*/
|
|
31621
31557
|
function Render(params) {
|
|
31622
|
-
var _a, _b, _c, _d;
|
|
31558
|
+
var _a, _b, _c, _d, _e;
|
|
31623
31559
|
const entity = params.entity;
|
|
31624
31560
|
if (!params.entityHistoric) {
|
|
31625
31561
|
params.entityHistoric = [];
|
|
31626
31562
|
}
|
|
31563
|
+
const hasAssemblyMatrix = !!((_a = entity === null || entity === void 0 ? void 0 : entity.Bruce) === null || _a === void 0 ? void 0 : _a.AssemblyWorldPosition);
|
|
31627
31564
|
const transform = Entity$1.GetValue({
|
|
31628
31565
|
entity: entity,
|
|
31629
31566
|
path: ["Bruce", "Transform"]
|
|
@@ -31764,6 +31701,12 @@ var EntityRenderEngineModel3d;
|
|
|
31764
31701
|
return animatePosition.GetOrient();
|
|
31765
31702
|
}, false);
|
|
31766
31703
|
}
|
|
31704
|
+
else if (hasAssemblyMatrix) {
|
|
31705
|
+
getOrient = new CallbackProperty(() => {
|
|
31706
|
+
const currentPos = position ? GetCValue(params.viewer, position) : pos3d;
|
|
31707
|
+
return EntityUtils.GetAssemblyOrientation(entity, currentPos || pos3d);
|
|
31708
|
+
}, false);
|
|
31709
|
+
}
|
|
31767
31710
|
else {
|
|
31768
31711
|
const hpr = new HeadingPitchRoll(Math$1.toRadians(heading), Math$1.toRadians(pitch), Math$1.toRadians(roll));
|
|
31769
31712
|
getOrient = new CallbackProperty(() => {
|
|
@@ -31815,7 +31758,7 @@ var EntityRenderEngineModel3d;
|
|
|
31815
31758
|
cEntity.model.colorBlendAmount = new ConstantProperty(blendAmount);
|
|
31816
31759
|
cEntity.model.colorBlendMode = new ConstantProperty(blendMode);
|
|
31817
31760
|
cEntity.model.distanceDisplayCondition = new ConstantProperty(EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance));
|
|
31818
|
-
let dateTimeStr = (
|
|
31761
|
+
let dateTimeStr = (_c = (_b = entity.Bruce.Outline) === null || _b === void 0 ? void 0 : _b.find(x => !!x.DateTime)) === null || _c === void 0 ? void 0 : _c.DateTime;
|
|
31819
31762
|
const isHistoric = Boolean(dateTimeStr);
|
|
31820
31763
|
let dateTime = dateTimeStr ? new Date(dateTimeStr) : null;
|
|
31821
31764
|
// Initial animation check to see if we're continuing an animation.
|
|
@@ -31928,7 +31871,13 @@ var EntityRenderEngineModel3d;
|
|
|
31928
31871
|
const hasExplicitTransformHeading = (transform === null || transform === void 0 ? void 0 : transform.heading) != null && !isNaN(EnsureNumber(transform === null || transform === void 0 ? void 0 : transform.heading));
|
|
31929
31872
|
const isDirectRealtimeUpdate = !isHistoric && !(params.entityHistoric && params.entityHistoric.length > 0);
|
|
31930
31873
|
const preferTransformHeadingForRealtime = isDirectRealtimeUpdate && hasExplicitTransformHeading;
|
|
31931
|
-
if (
|
|
31874
|
+
if (hasAssemblyMatrix) {
|
|
31875
|
+
cEntity.orientation = new CallbackProperty(() => {
|
|
31876
|
+
const currentPos = GetCValue(params.viewer, cEntity.position);
|
|
31877
|
+
return EntityUtils.GetAssemblyOrientation(entity, currentPos || pos3d);
|
|
31878
|
+
}, false);
|
|
31879
|
+
}
|
|
31880
|
+
else if (preferTransformHeadingForRealtime) {
|
|
31932
31881
|
const hpr = new HeadingPitchRoll(Math$1.toRadians(heading), Math$1.toRadians(pitch), Math$1.toRadians(roll));
|
|
31933
31882
|
cEntity.orientation = new CallbackProperty(() => {
|
|
31934
31883
|
const currentPos = GetCValue(params.viewer, cEntity.position);
|
|
@@ -32086,7 +32035,7 @@ var EntityRenderEngineModel3d;
|
|
|
32086
32035
|
// Generate a polyline 'track' for the historic data.
|
|
32087
32036
|
// We do this for historic data that exists and is moving.
|
|
32088
32037
|
if (shouldShowTrack && animatePosition && animatePosition instanceof CesiumAnimatedProperty.AnimatePositionSeries && animatePosition.GetSeries) {
|
|
32089
|
-
const lStyle = (
|
|
32038
|
+
const lStyle = (_e = (_d = params.fullStyle) === null || _d === void 0 ? void 0 : _d.polylineStyle) !== null && _e !== void 0 ? _e : {};
|
|
32090
32039
|
const bColor = lStyle.lineColor ? Calculator.GetColor(lStyle.lineColor, entity, params.tags) : null;
|
|
32091
32040
|
const cColor = bColor ? ColorToCColor(bColor) : Color.fromCssColorString("rgba(255, 193, 7, 0.8)");
|
|
32092
32041
|
let width = lStyle.lineWidth ? EnsureNumber(Calculator.GetNumber(lStyle.lineWidth, entity, params.tags)) : 2;
|
|
@@ -35326,7 +35275,7 @@ class WidgetViewBar extends Widget.AWidget {
|
|
|
35326
35275
|
}
|
|
35327
35276
|
}
|
|
35328
35277
|
|
|
35329
|
-
const VERSION = "6.5.
|
|
35278
|
+
const VERSION = "6.5.7";
|
|
35330
35279
|
/**
|
|
35331
35280
|
* Updates the environment instance used by bruce-cesium to one specified.
|
|
35332
35281
|
* This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.
|