bruce-cesium 7.7.5 → 7.7.6

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.
@@ -28584,26 +28584,38 @@
28584
28584
  */
28585
28585
  function ApplyPosition(params) {
28586
28586
  const { renderObject, origin, rotation, dontRotate, dontTransform } = params;
28587
- if (!renderObject) {
28587
+ if (!renderObject || dontTransform) {
28588
28588
  return;
28589
28589
  }
28590
28590
  const lat = EnsureNumber(origin === null || origin === void 0 ? void 0 : origin.latitude, 0);
28591
28591
  const lon = EnsureNumber(origin === null || origin === void 0 ? void 0 : origin.longitude, 0);
28592
28592
  const alt = EnsureNumber(origin === null || origin === void 0 ? void 0 : origin.altitude, 0);
28593
28593
  const scale = EnsureNumber((origin === null || origin === void 0 ? void 0 : origin.scale) || 1, 1);
28594
+ // A complete matrix avoids SDK setters whose translation, rotation and scale contracts differ.
28595
+ if (typeof renderObject.setModelMatrix === "function") {
28596
+ const matrix = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(lon, lat, alt));
28597
+ if (!dontRotate) {
28598
+ const hpr = Cesium.HeadingPitchRoll.fromDegrees(EnsureNumber(rotation === null || rotation === void 0 ? void 0 : rotation.z), EnsureNumber(rotation === null || rotation === void 0 ? void 0 : rotation.x), EnsureNumber(rotation === null || rotation === void 0 ? void 0 : rotation.y));
28599
+ const local = Cesium.Matrix4.fromRotation(Cesium.Matrix3.fromHeadingPitchRoll(hpr));
28600
+ Cesium.Matrix4.multiply(matrix, local, matrix);
28601
+ Cesium.Matrix4.multiplyByUniformScale(matrix, scale, matrix);
28602
+ }
28603
+ renderObject.setModelMatrix(matrix);
28604
+ return;
28605
+ }
28594
28606
  if (!dontTransform) {
28595
28607
  const pos = Cesium.Cartesian3.fromDegrees(lon, lat, alt);
28596
- if (typeof renderObject.setTranslation === 'function') {
28608
+ if (typeof renderObject.setTranslation === "function") {
28597
28609
  renderObject.setTranslation(pos);
28598
28610
  }
28599
28611
  }
28600
28612
  if (!dontRotate && !dontTransform) {
28601
28613
  const hpr = Cesium.HeadingPitchRoll.fromDegrees(EnsureNumber(rotation === null || rotation === void 0 ? void 0 : rotation.z), EnsureNumber(rotation === null || rotation === void 0 ? void 0 : rotation.x), EnsureNumber(rotation === null || rotation === void 0 ? void 0 : rotation.y), new Cesium.HeadingPitchRoll());
28602
28614
  const rotMatrix = Cesium.Matrix3.fromHeadingPitchRoll(hpr);
28603
- if (typeof renderObject.setRotation === 'function') {
28615
+ if (typeof renderObject.setRotation === "function") {
28604
28616
  renderObject.setRotation(rotMatrix);
28605
28617
  }
28606
- if (typeof renderObject.setScale === 'function') {
28618
+ if (typeof renderObject.setScale === "function") {
28607
28619
  renderObject.setScale(new Cesium.Cartesian3(scale, scale, scale));
28608
28620
  }
28609
28621
  }
@@ -57563,7 +57575,7 @@ void main() {
57563
57575
  StyleUtils.ApplyTypeStyle = ApplyTypeStyle;
57564
57576
  })(exports.StyleUtils || (exports.StyleUtils = {}));
57565
57577
 
57566
- const VERSION = "7.7.5";
57578
+ const VERSION = "7.7.6";
57567
57579
  /**
57568
57580
  * Updates the environment instance used by bruce-cesium to one specified.
57569
57581
  * This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.