From b41121da1b6b39ef5127c0943bd9a23d74aa037c Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Mon, 1 Jul 2024 13:48:53 +1000 Subject: [PATCH] Set last ellipsoid when setting last locals. --- Runtime/CesiumGlobeAnchor.cs | 2 -- Runtime/ConfigureReinterop.cs | 1 + native~/Runtime/src/CesiumGlobeAnchorImpl.cpp | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Runtime/CesiumGlobeAnchor.cs b/Runtime/CesiumGlobeAnchor.cs index 840314ea..b3352a8c 100644 --- a/Runtime/CesiumGlobeAnchor.cs +++ b/Runtime/CesiumGlobeAnchor.cs @@ -466,8 +466,6 @@ public void Sync() this._lastLocalScale != this.transform.localScale; } - _lastEllipsoidRadii = _georeference.ellipsoid.radii; - if (isEllipsoidChanged || updateFromTransform) this.UpdateEcefFromTransform(); else diff --git a/Runtime/ConfigureReinterop.cs b/Runtime/ConfigureReinterop.cs index 1722bd91..c674fbc0 100644 --- a/Runtime/ConfigureReinterop.cs +++ b/Runtime/ConfigureReinterop.cs @@ -540,6 +540,7 @@ Cesium3DTilesetLoadFailureDetails tilesetDetails globeAnchor._lastLocalPosition = new Vector3(); globeAnchor._lastLocalRotation = new Quaternion(); globeAnchor._lastLocalScale = new Vector3(); + globeAnchor._lastEllipsoidRadii = new double3(); globeAnchor.UpdateGeoreferenceIfNecessary(); CesiumTileExcluder[] excluders = go.GetComponentsInParent(); diff --git a/native~/Runtime/src/CesiumGlobeAnchorImpl.cpp b/native~/Runtime/src/CesiumGlobeAnchorImpl.cpp index 101a0995..360eb25d 100644 --- a/native~/Runtime/src/CesiumGlobeAnchorImpl.cpp +++ b/native~/Runtime/src/CesiumGlobeAnchorImpl.cpp @@ -116,6 +116,7 @@ void updateAnchorFromCpp( anchor._lastLocalRotation(transform.localRotation()); anchor._lastLocalScale(transform.localScale()); anchor._lastLocalsAreValid(true); + anchor._lastEllipsoidRadii(georeference.ellipsoid().radii()); } }